Module to analyze the particle listing as provided by common event generators.
More...
Module to analyze the particle listing as provided by common event generators.
Module to analyze the particle listing as provided by common event generators equivalent to PYLIST(1) (from pythia). It is expected to run on vectors of reo::GenParticles. For an example of use have a look to:
PhysicsTools/HepMCCandAlgos/test/testParticleTreeDrawer.py
Caveats: Status 3 particles can have daughters both with status 2 and 3. In pythia this is not the same mother-daughter. The relations are correct but special care has to be taken when looking at mother-daughter relation which involve status 2 and 3 particles.
Definition at line 41 of file ParticleListDrawer.cc.
Implements edm::EDAnalyzer.
Definition at line 79 of file ParticleListDrawer.cc.
References gather_cfg::cout, spr::find(), newFWLiteAna::found, edm::Event::getByLabel(), edm::EventSetup::getData(), getParticleName(), edm::InputTag::label(), maxEventsToPrint_, nEventAnalyzed_, dbtoconf::out, L1TEmulatorMonitor_cff::p, pdt_, printOnlyHardInteraction_, printVertex_, src_, and useMessageLogger_.
89 <<
"[ParticleListDrawer] analysing particle collection " <<
src_.
label() << endl;
91 snprintf(buf, 256,
" idx | ID - Name |Stat| Mo1 Mo2 Da1 Da2 |nMo nDa| pt eta phi | px py pz m |");
94 snprintf(buf, 256,
" vx vy vz |");
104 vector<const reco::Candidate *> cands;
105 vector<const Candidate *>::const_iterator
found = cands.begin();
107 p != particles->end(); ++
p) {
108 cands.push_back(&*
p);
112 p != particles->end();
121 idx =
p - particles->begin();
128 int nMo =
p->numberOfMothers();
129 int nDa =
p->numberOfDaughters();
131 found =
find(cands.begin(), cands.end(),
p->mother(0));
132 if(found != cands.end()) iMo1 = found - cands.begin() ;
134 found =
find(cands.begin(), cands.end(),
p->mother(nMo-1));
135 if(found != cands.end()) iMo2 = found - cands.begin() ;
137 found =
find(cands.begin(), cands.end(),
p->daughter(0));
138 if(found != cands.end()) iDa1 = found - cands.begin() ;
140 found =
find(cands.begin(), cands.end(),
p->daughter(nDa-1));
141 if(found != cands.end()) iDa2 = found - cands.begin() ;
145 " %4d | %5d - %10s | %2d | %4d %4d %4d %4d | %2d %2d | %7.3f %10.3f %6.3f | %10.3f %10.3f %10.3f %8.3f |",
148 particleName.c_str(),
150 iMo1,iMo2,iDa1,iDa2,nMo,nDa,
162 snprintf(buf, 256,
" %10.3f %10.3f %10.3f |",
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void getData(T &iHolder) const
bool printOnlyHardInteraction_
unsigned int nEventAnalyzed_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::ESHandle< ParticleDataTable > pdt_
std::string getParticleName(int id) const