106 bool beamTriggerEvent =
false;
108 if(!
evt.isRealData()){
113 auto mcTruths =
evt.getValidHandle<std::vector<simb::MCTruth>>(
fGeneratorTag);
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;
149 auto recoParticles =
evt.getValidHandle<std::vector<recob::PFParticle>>(
fPFParticleTag);
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;
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
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.
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
std::string fGeneratorTag
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.
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...
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.
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.
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:
QTextStream & endl(QTextStream &s)
bool IsBeamTrigger(art::Event const &evt) const
protoana::ProtoDUNEDataUtils dataUtil