64 perEvent_(iConfig.getUntrackedParameter<bool>(
"perEvent",
false)),
65 perJob_(iConfig.getUntrackedParameter<bool>(
"perJob",
true)),
66 self_(iConfig.getParameter<std::
string>(
"@module_label")),
67 logName_(iConfig.getUntrackedParameter<std::
string>(
"logName")),
68 dumpItems_(iConfig.getUntrackedParameter<bool>(
"dumpItems",
false))
70 std::vector<edm::InputTag>
inputs = iConfig.
getParameter<std::vector<edm::InputTag> >(
"candidates");
71 for (std::vector<edm::InputTag>::const_iterator it = inputs.begin(); it != inputs.end(); ++it) {
82 using std::setw;
using std::left;
using std::right;
using std::setprecision;
86 LogInfo(logName_) <<
"Per Event Table " << logName_ <<
87 " (" << self_ <<
", run:event " << iEvent.
id().
run() <<
":" << iEvent.
id().
event() <<
")";
90 for (std::vector<Record>::iterator it = collections_.begin(), ed = collections_.end(); it != ed; ++it) {
92 if (!candidates.failedToGet()) it->update(*candidates);
94 LogVerbatim(logName_) <<
" " << setw(30) << left << it->src.encode() << right;
97 std::ostringstream oss;
99 oss <<
" [" << setw(3) << i <<
"]" <<
100 " pt " << setw(7) << setprecision(5) << cand->pt() <<
101 " eta " << setw(7) << setprecision(5) << cand->eta() <<
102 " phi " << setw(7) << setprecision(5) << cand->phi() <<
103 " et " << setw(7) << setprecision(5) << cand->et() <<
104 " phi " << setw(7) << setprecision(5) << cand->phi() <<
105 " charge " << setw(2) << cand->charge() <<
106 " id " << setw(7) << cand->pdgId() <<
107 " st " << setw(7) << cand->status() <<
"\n";
113 if (perEvent_)
LogInfo(logName_) <<
"" ;
119 using std::setw;
using std::left;
using std::right;
using std::setprecision;
121 std::ostringstream oss;
122 oss <<
"Summary Table " << logName_ <<
" (" << self_ <<
", events total " << totalEvents_ <<
")\n";
123 for (std::vector<Record>::iterator it = collections_.begin(), ed = collections_.end(); it != ed; ++it) {
124 oss <<
" " << setw(30) << left << it->src.encode() << right <<
125 " present " << setw(7) << it->present <<
" (" << setw(4) << setprecision(3) << (it->present*100.0/totalEvents_) <<
"%)" <<
126 " empty " << setw(7) << it->empty <<
" (" << setw(4) << setprecision(3) << (it->empty*100.0/totalEvents_) <<
"%)" <<
127 " min " << setw(7) << it->min <<
128 " max " << setw(7) << it->max <<
129 " total " << setw(7) << it->total <<
130 " avg " << setw(5) << setprecision(3) << (it->total/double(totalEvents_)) <<
"\n";
T getParameter(std::string const &) const
EventNumber_t event() const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
virtual void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
CandidateSummaryTable(const edm::ParameterSet &iConfig)
#define DEFINE_FWK_MODULE(type)
Record(edm::InputTag tag)
void update(const edm::View< reco::Candidate > &items)
Produce a summary table of some candidate collections.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
tuple size
Write out results.
std::vector< Record > collections_