61 src_(pset.getParameter<
InputTag>(
"src")),
63 maxEventsToPrint_ (pset.getUntrackedParameter<int>(
"maxEventsToPrint",1)),
65 printOnlyHardInteraction_(pset.getUntrackedParameter<bool>(
"printOnlyHardInteraction",
false)),
66 printVertex_(pset.getUntrackedParameter<bool>(
"printVertex",
false)),
67 useMessageLogger_(pset.getUntrackedParameter<bool>(
"useMessageLogger",
false)) {
74 std::ostringstream
ss;
91 <<
"[ParticleListDrawer] analysing particle collection " <<
src_.
label() << endl;
93 snprintf(buf, 256,
" idx | ID - Name |Stat| Mo1 Mo2 Da1 Da2 |nMo nDa| pt eta phi | px py pz m |");
96 snprintf(buf, 256,
" vx vy vz |");
106 vector<const reco::Candidate *> cands;
107 vector<const Candidate *>::const_iterator
found = cands.begin();
109 p != particles->end(); ++
p) {
110 cands.push_back(&*
p);
114 p != particles->end();
123 idx =
p - particles->begin();
130 int nMo =
p->numberOfMothers();
131 int nDa =
p->numberOfDaughters();
133 found =
find(cands.begin(), cands.end(),
p->mother(0));
134 if(found != cands.end()) iMo1 = found - cands.begin() ;
136 found =
find(cands.begin(), cands.end(),
p->mother(nMo-1));
137 if(found != cands.end()) iMo2 = found - cands.begin() ;
139 found =
find(cands.begin(), cands.end(),
p->daughter(0));
140 if(found != cands.end()) iDa1 = found - cands.begin() ;
142 found =
find(cands.begin(), cands.end(),
p->daughter(nDa-1));
143 if(found != cands.end()) iDa2 = found - cands.begin() ;
147 " %4d | %5d - %10s | %2d | %4d %4d %4d %4d | %2d %2d | %7.3f %10.3f %6.3f | %10.3f %10.3f %10.3f %8.3f |",
150 particleName.c_str(),
152 iMo1,iMo2,iDa1,iDa2,nMo,nDa,
164 snprintf(buf, 256,
" %10.3f %10.3f %10.3f |",
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#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
edm::EDGetTokenT< reco::CandidateView > srcToken_
bool printOnlyHardInteraction_
ParticleListDrawer(const edm::ParameterSet &)
unsigned int nEventAnalyzed_
HepPDT::ParticleData ParticleData
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
edm::ESHandle< ParticleDataTable > pdt_
std::string getParticleName(int id) const
volatile std::atomic< bool > shutdown_flag false
Module to analyze the particle listing as provided by common event generators.