62 : src_(pset.getParameter<
InputTag>(
"src")),
64 maxEventsToPrint_(pset.getUntrackedParameter<
int>(
"maxEventsToPrint", 1)),
66 printOnlyHardInteraction_(pset.getUntrackedParameter<
bool>(
"printOnlyHardInteraction",
false)),
67 printVertex_(pset.getUntrackedParameter<
bool>(
"printVertex",
false)),
68 printFlags_(pset.getUntrackedParameter<
bool>(
"printFlags",
false)),
69 useMessageLogger_(pset.getUntrackedParameter<
bool>(
"useMessageLogger",
false)) {}
74 std::ostringstream
ss;
90 out << endl <<
"[ParticleListDrawer] analysing particle collection " <<
src_.
label() << endl;
94 " idx | ID - Name |Stat| Mo1 Mo2 Da1 Da2 |nMo nDa| pt eta phi | px " 98 snprintf(buf,
sizeof(buf),
" vx vy vz |");
108 vector<const reco::Candidate*>
cands;
109 vector<const Candidate*>::const_iterator
found = cands.begin();
111 cands.push_back(&*
p);
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())
135 iMo1 = found - cands.begin();
137 found =
find(cands.begin(), cands.end(),
p->mother(nMo - 1));
138 if (found != cands.end())
139 iMo2 = found - cands.begin();
141 found =
find(cands.begin(), cands.end(),
p->daughter(0));
142 if (found != cands.end())
143 iDa1 = found - cands.begin();
145 found =
find(cands.begin(), cands.end(),
p->daughter(nDa - 1));
146 if (found != cands.end())
147 iDa2 = found - cands.begin();
153 " %4d | %5d - %10s | %2d | %4d %4d %4d %4d | %2d %2d | %7.3f %10.3f %6.3f | %10.3f %10.3f %10.3f %8.3f |",
156 particleName.c_str(),
174 snprintf(buf,
sizeof(buf),
" %10.3f %10.3f %10.3f |",
p->vertex().x(),
p->vertex().y(),
p->vertex().z());
181 throw cms::Exception(
"Unsupported",
"Status flags can be printed only for reco::GenParticle objects\n");
183 out <<
" PromptFinalState";
185 out <<
" DirectPromptTauDecayProductFinalState";
187 out <<
" HardProcess";
189 out <<
" HardProcessFinalState";
191 out <<
" HardProcessBeforeFSR";
197 out <<
" LastCopyBeforeFSR";
bool isPromptFinalState() const
bool isLastCopyBeforeFSR() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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
bool getData(T &iHolder) const
edm::EDGetTokenT< reco::CandidateView > srcToken_
#define DEFINE_FWK_MODULE(type)
const_iterator begin() const
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
const_iterator end() const
Module to analyze the particle listing as provided by common event generators.