22 #include "art_root_io/TFileService.h" 24 #include "canvas/Persistency/Common/FindManyP.h" 43 #include "dune/Protodune/singlephase/DataUtils/ProtoDUNEDataUtils.h" 64 virtual void endJob()
override;
106 bool beamTriggerEvent =
false;
117 if(geantGoodParticle != 0x0){
118 std::cout <<
"Found GEANT particle corresponding to the good particle with pdg = " << geantGoodParticle->PdgCode() <<
std::endl;
124 if(beamTriggerEvent){
125 std::cout <<
"This data event has a beam trigger" <<
std::endl;
157 if(beamParticles.size() == 0){
158 std::cerr <<
"We found no beam particles for this event... moving on" <<
std::endl;
169 if(thisTrack != 0x0) std::cout <<
"Beam particle is track-like" <<
std::endl;
170 if(thisShower != 0x0) std::cout <<
"Beam particle is shower-like" <<
std::endl;
182 for(
const int daughterID : particle->Daughters()){
185 std::cout <<
"Daughter " << daughterID <<
" has " << daughterParticle->
NumDaughters() <<
" daughters" <<
std::endl;
192 std::cout <<
"Beam particle has " << trackDaughters.size() <<
" track-like daughters and " << showerDaughters.size() <<
" shower-like daughters." <<
std::endl;
BeamExample & operator=(BeamExample const &)=delete
int NumDaughters() const
Returns the number of daughter particles flowing from this one.
const simb::MCParticle * GetGeantGoodParticle(const simb::MCTruth &genTruth, const art::Event &evt) const
BeamExample(fhicl::ParameterSet const &p)
const recob::Shower * GetPFParticleShower(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string showerLabel) const
Get the shower associated to this particle. Returns a null pointer if not found.
void analyze(art::Event const &e) override
const TVector3 GetPFParticleVertex(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string trackLabel) const
Function to find the interaction vertex of a primary PFParticle.
std::string fPFParticleTag
EDAnalyzer(fhicl::ParameterSet const &pset)
virtual void beginJob() override
std::string fGeneratorTag
#define DEFINE_ART_MODULE(klass)
const recob::Track * GetPFParticleTrack(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string trackLabel) const
Get the track associated to this particle. Returns a null pointer if not found.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
const std::vector< const recob::PFParticle * > GetPFParticlesFromBeamSlice(art::Event const &evt, const std::string particleLabel) const
Return the pointers for the PFParticles in the beam slice. Returns an empty vector is no beam slice w...
std::string fCalorimetryTag
Declaration of signal hit object.
Hierarchical representation of particle flow.
const std::vector< const recob::Shower * > GetPFParticleDaughterShowers(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string showerLabel) const
Get the daughter showers from the PFParticle.
Provides recob::Track data product.
const TVector3 GetPFParticleSecondaryVertex(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string trackLabel) const
Function to find the secondary interaction vertex of a primary PFParticle.
auto const & get(AssnsNode< L, R, D > const &r)
const std::vector< const recob::Track * > GetPFParticleDaughterTracks(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string trackLabel) const
Get the daughter tracks from the PFParticle.
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
virtual void endJob() override
QTextStream & endl(QTextStream &s)
bool IsBeamTrigger(art::Event const &evt) const
protoana::ProtoDUNEDataUtils dataUtil