48 std::string getParticleName(
int id )
const;
60 src_(pset.getParameter<
InputTag>(
"src")),
61 maxEventsToPrint_ (pset.getUntrackedParameter<int>(
"maxEventsToPrint",1)),
63 printOnlyHardInteraction_(pset.getUntrackedParameter<bool>(
"printOnlyHardInteraction",
false)),
64 printVertex_(pset.getUntrackedParameter<bool>(
"printVertex",
false)),
65 useMessageLogger_(pset.getUntrackedParameter<bool>(
"useMessageLogger",
false)) {
72 std::ostringstream ss;
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
#define DEFINE_FWK_MODULE(type)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void getData(T &iHolder) const
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup)
bool printOnlyHardInteraction_
ParticleListDrawer(const edm::ParameterSet &)
unsigned int nEventAnalyzed_
HepPDT::ParticleData ParticleData
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::ESHandle< ParticleDataTable > pdt_
std::string getParticleName(int id) const
Module to analyze the particle listing as provided by common event generators.