33 virtual void endJob()
override;
65 perEvent_(iConfig.getUntrackedParameter<bool>(
"perEvent",
false)),
66 perJob_(iConfig.getUntrackedParameter<bool>(
"perJob",
true)),
67 self_(iConfig.getParameter<std::
string>(
"@module_label")),
68 logName_(iConfig.getUntrackedParameter<std::
string>(
"logName")),
69 dumpItems_(iConfig.getUntrackedParameter<bool>(
"dumpItems",
false))
71 std::vector<edm::InputTag>
inputs = iConfig.
getParameter<std::vector<edm::InputTag> >(
"candidates");
72 for (std::vector<edm::InputTag>::const_iterator it = inputs.begin(); it != inputs.end(); ++it) {
83 using std::setw;
using std::left;
using std::right;
using std::setprecision;
87 LogInfo(logName_) <<
"Per Event Table " << logName_ <<
88 " (" << self_ <<
", run:event " << iEvent.
id().
run() <<
":" << iEvent.
id().
event() <<
")";
91 for (std::vector<Record>::iterator it = collections_.begin(), ed = collections_.end(); it != ed; ++it) {
93 if (!candidates.failedToGet()) it->update(*candidates);
95 LogVerbatim(logName_) <<
" " << setw(30) << left << it->src.encode() << right;
98 std::ostringstream oss;
100 oss <<
" [" << setw(3) << i <<
"]" <<
101 " pt " << setw(7) << setprecision(5) << cand->pt() <<
102 " eta " << setw(7) << setprecision(5) << cand->eta() <<
103 " phi " << setw(7) << setprecision(5) << cand->phi() <<
104 " et " << setw(7) << setprecision(5) << cand->et() <<
105 " phi " << setw(7) << setprecision(5) << cand->phi() <<
106 " charge " << setw(2) << cand->charge() <<
107 " id " << setw(7) << cand->pdgId() <<
108 " st " << setw(7) << cand->status() <<
"\n";
114 if (perEvent_)
LogInfo(logName_) <<
"" ;
120 using std::setw;
using std::left;
using std::right;
using std::setprecision;
122 std::ostringstream oss;
123 oss <<
"Summary Table " << logName_ <<
" (" << self_ <<
", events total " << totalEvents_ <<
")\n";
124 for (std::vector<Record>::iterator it = collections_.begin(), ed = collections_.end(); it != ed; ++it) {
125 oss <<
" " << setw(30) << left << it->src.encode() << right <<
126 " present " << setw(7) << it->present <<
" (" << setw(4) << setprecision(3) << (it->present*100.0/totalEvents_) <<
"%)" <<
127 " empty " << setw(7) << it->empty <<
" (" << setw(4) << setprecision(3) << (it->empty*100.0/totalEvents_) <<
"%)" <<
128 " min " << setw(7) << it->min <<
129 " max " << setw(7) << it->max <<
130 " total " << setw(7) << it->total <<
131 " avg " << setw(5) << setprecision(3) << (it->total/double(totalEvents_)) <<
"\n";
T getParameter(std::string const &) const
EventNumber_t event() const
virtual void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
CandidateSummaryTable(const edm::ParameterSet &iConfig)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< edm::View< reco::Candidate > > srcToken
void update(const edm::View< reco::Candidate > &items)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const_iterator begin() const
Record(edm::InputTag tag, edm::ConsumesCollector &&iC)
Produce a summary table of some candidate collections.
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
virtual void endJob() override
volatile std::atomic< bool > shutdown_flag false
tuple size
Write out results.
std::vector< Record > collections_