64 : src_(pset.getParameter<
InputTag>(
"src")),
67 maxEventsToPrint_(pset.getUntrackedParameter<int>(
"maxEventsToPrint", 1)),
69 printOnlyHardInteraction_(pset.getUntrackedParameter<bool>(
"printOnlyHardInteraction",
false)),
70 printVertex_(pset.getUntrackedParameter<bool>(
"printVertex",
false)),
71 printFlags_(pset.getUntrackedParameter<bool>(
"printFlags",
false)),
72 useMessageLogger_(pset.getUntrackedParameter<bool>(
"useMessageLogger",
false)) {}
77 std::ostringstream
ss;
93 out << endl <<
"[ParticleListDrawer] analysing particle collection " <<
src_.
label() << endl;
97 " idx | ID - Name |Stat| Mo1 Mo2 Da1 Da2 |nMo nDa| pt eta phi | px "
101 snprintf(buf,
sizeof(buf),
" vx vy vz |");
111 vector<const reco::Candidate*>
cands;
112 vector<const Candidate*>::const_iterator
found = cands.begin();
114 cands.push_back(&*
p);
126 idx =
p - particles->begin();
133 int nMo =
p->numberOfMothers();
134 int nDa =
p->numberOfDaughters();
136 found =
find(cands.begin(), cands.end(),
p->mother(0));
137 if (found != cands.end())
138 iMo1 = found - cands.begin();
140 found =
find(cands.begin(), cands.end(),
p->mother(nMo - 1));
141 if (found != cands.end())
142 iMo2 = found - cands.begin();
144 found =
find(cands.begin(), cands.end(),
p->daughter(0));
145 if (found != cands.end())
146 iDa1 = found - cands.begin();
148 found =
find(cands.begin(), cands.end(),
p->daughter(nDa - 1));
149 if (found != cands.end())
150 iDa2 = found - cands.begin();
156 " %4d | %5d - %10s | %2d | %4d %4d %4d %4d | %2d %2d | %7.3f %10.3f %6.3f | %10.3f %10.3f %10.3f %8.3f |",
159 particleName.c_str(),
177 snprintf(buf,
sizeof(buf),
" %10.3f %10.3f %10.3f |",
p->vertex().x(),
p->vertex().y(),
p->vertex().z());
184 throw cms::Exception(
"Unsupported",
"Status flags can be printed only for reco::GenParticle objects\n");
186 out <<
" PromptFinalState";
188 out <<
" DirectPromptTauDecayProductFinalState";
190 out <<
" HardProcess";
192 out <<
" HardProcessFinalState";
194 out <<
" HardProcessBeforeFSR";
200 out <<
" LastCopyBeforeFSR";
Log< level::Info, true > LogVerbatim
bool isPromptFinalState() const
bool isLastCopyBeforeFSR() const
uint16_t *__restrict__ id
HepPDT::ParticleDataTable ParticleDataTable
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
bool isHardProcess() const
bool fromHardProcessBeforeFSR() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
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
const GenStatusFlags & statusFlags() const
bool fromHardProcessFinalState() const
edm::ESHandle< ParticleDataTable > pdt_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
std::string getParticleName(int id) const
bool isDirectPromptTauDecayProductFinalState() const
~ParticleListDrawer() override
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Module to analyze the particle listing as provided by common event generators.
edm::ESGetToken< ParticleDataTable, edm::DefaultRecord > pdtToken_