CMS 3D CMS Logo

HLTrigReport.cc
Go to the documentation of this file.
1 
11 
13 
17 #include "Math/QuantFuncMathCore.h"
18 
21 
22 #include <iomanip>
23 #include <cstring>
24 #include <sstream>
25 
26 
28  if (value == "never")
29  return NEVER;
30 
31  if (value == "job")
32  return EVERY_JOB;
33 
34  if (value == "run")
35  return EVERY_RUN;
36 
37  if (value == "lumi")
38  return EVERY_LUMI;
39 
40  if (value == "event")
41  return EVERY_EVENT;
42 
43  throw cms::Exception("Configuration") << "Invalid option value \"" << value << "\". Legal values are \"job\", \"run\", \"lumi\", \"event\" and \"never\".";
44 }
45 
46 
47 //
48 // constructors and destructor
49 //
51  hlTriggerResults_(iConfig.getParameter<edm::InputTag> ("HLTriggerResults")),
54  nEvents_(0),
55  nWasRun_(0),
56  nAccept_(0),
57  nErrors_(0),
58  hlWasRun_(0),
59  hltL1s_(0),
60  hltPre_(0),
61  hlAccept_(0),
62  hlAccTot_(0),
63  hlErrors_(0),
64  posL1s_(0),
65  posPre_(0),
66  hlNames_(0),
67  hlIndex_(0),
68  hlAccTotDS_(0),
69  datasetNames_(0),
72  dsIndex_(0),
73  dsAccTotS_(0),
74  streamNames_(0),
75  streamContents_(0),
77  refPath_("HLTriggerFinalPath"),
78  refIndex_(0),
79  refRate_(100.0),
80  reportBy_( decode(iConfig.getUntrackedParameter<std::string>("reportBy", "job")) ),
81  resetBy_( decode(iConfig.getUntrackedParameter<std::string>("resetBy", "never")) ),
82  serviceBy_(decode(iConfig.getUntrackedParameter<std::string>("serviceBy", "never")) ),
83  hltConfig_()
84 {
85  const edm::ParameterSet customDatasets(iConfig.getUntrackedParameter<edm::ParameterSet>("CustomDatasets", edm::ParameterSet()));
86  isCustomDatasets_ = (customDatasets != edm::ParameterSet());
87  if (isCustomDatasets_) {
88  datasetNames_ = customDatasets.getParameterNamesForType<std::vector<std::string> >();
89  for (std::vector<std::string>::const_iterator name = datasetNames_.begin(); name != datasetNames_.end(); name++) {
90  datasetContents_.push_back(customDatasets.getParameter<std::vector<std::string> >(*name));
91  }
92  }
93 
94  const edm::ParameterSet customStreams (iConfig.getUntrackedParameter<edm::ParameterSet>("CustomStreams" , edm::ParameterSet()));
95  isCustomStreams_ = (customStreams != edm::ParameterSet());
96  if (isCustomStreams_ ) {
97  streamNames_ = customStreams.getParameterNamesForType<std::vector<std::string> >();
98  for (std::vector<std::string>::const_iterator name = streamNames_.begin(); name != streamNames_.end(); name++) {
99  streamContents_.push_back(customStreams.getParameter<std::vector<std::string> >(*name));
100  }
101  }
102 
103  refPath_ = iConfig.getUntrackedParameter<std::string>("ReferencePath","HLTriggerFinalPath");
104  refRate_ = iConfig.getUntrackedParameter<double>("ReferenceRate", 100.0);
105  refIndex_= 0;
106 
107  LogDebug("HLTrigReport")
108  << "HL TiggerResults: " + hlTriggerResults_.encode()
109  << " using reference path and rate: " + refPath_ + " " << refRate_;
110 
112  edm::Service<HLTrigReportService>()->registerModule(this);
113  }
114 
115 }
116 
117 HLTrigReport::~HLTrigReport() = default;
118 
119 void
122  desc.add<edm::InputTag>("HLTriggerResults",edm::InputTag("TriggerResults","","HLT"));
123  desc.addUntracked<std::string>("reportBy","job");
124  desc.addUntracked<std::string>("resetBy","never");
125  desc.addUntracked<std::string>("serviceBy","never");
126 
127  edm::ParameterSetDescription customDatasetsParameters;
128  desc.addUntracked<edm::ParameterSetDescription>("CustomDatasets" ,customDatasetsParameters);
129  edm::ParameterSetDescription customStreamsParameters;
130  desc.addUntracked<edm::ParameterSetDescription>("CustomStreams" ,customStreamsParameters);
131  desc.addUntracked<std::string>("ReferencePath","HLTriggerFinalPath");
132  desc.addUntracked<double>("ReferenceRate",100.0);
133 
134  descriptions.add("hltTrigReport",desc);
135 }
136 
137 //
138 // member functions
139 //
140 
141 const std::vector<std::string>& HLTrigReport::datasetNames() const {
142  return datasetNames_;
143 }
144 const std::vector<std::string>& HLTrigReport::streamNames() const {
145  return streamNames_;
146 }
147 const std::vector<unsigned int>& HLTrigReport::datasetCounts() const {
148  return hlAllTotDS_;
149 }
150 const std::vector<unsigned int>& HLTrigReport::streamCounts() const {
151  return dsAllTotS_;
152 }
153 
154 void HLTrigReport::reset(bool changed /* = false */) {
155 
156  // reset global counters
157  nEvents_ = 0;
158  nWasRun_ = 0;
159  nAccept_ = 0;
160  nErrors_ = 0;
161 
162  // update trigger names
163  if (changed)
165 
166  const unsigned int n = hlNames_.size();
167 
168  if (changed) {
169  // resize per-path counters
170  hlWasRun_.resize(n);
171  hltL1s_.resize(n);
172  hltPre_.resize(n);
173  hlAccept_.resize(n);
174  hlAccTot_.resize(n);
175  hlErrors_.resize(n);
176  // find the positions of seeding and prescaler modules
177  posL1s_.resize(n);
178  posPre_.resize(n);
179  for (unsigned int i = 0; i < n; ++i) {
180  posL1s_[i] = -1;
181  posPre_[i] = -1;
182  const std::vector<std::string> & moduleLabels(hltConfig_.moduleLabels(i));
183  for (unsigned int j = 0; j < moduleLabels.size(); ++j) {
184  const std::string & label = hltConfig_.moduleType(moduleLabels[j]);
185  if (label == "HLTLevel1GTSeed")
186  posL1s_[i] = j;
187  else if (label == "HLTPrescaler")
188  posPre_[i] = j;
189  }
190  }
191  }
192 
193  // reset per-path counters
194  for (unsigned int i = 0; i < n; ++i) {
195  hlWasRun_[i] = 0;
196  hltL1s_[i] = 0;
197  hltPre_[i] = 0;
198  hlAccept_[i] = 0;
199  hlAccTot_[i] = 0;
200  hlErrors_[i] = 0;
201  }
202 
203  // if not overridden, reload the datasets and streams
204  if (changed and not isCustomDatasets_) {
207  }
208  if (changed and not isCustomStreams_) {
211  }
212 
213  if (changed) {
214  // fill the matrices of hlIndex_, hlAccTotDS_
215  hlIndex_.clear();
216  hlIndex_.resize(datasetNames_.size());
217  hlAccTotDS_.clear();
218  hlAllTotDS_.clear();
219  hlAccTotDS_.resize(datasetNames_.size());
220  hlAllTotDS_.resize(datasetNames_.size());
221  for (unsigned int ds = 0; ds < datasetNames_.size(); ds++) {
222  unsigned int size = datasetContents_[ds].size();
223  hlIndex_[ds].reserve(size);
224  hlAccTotDS_[ds].reserve(size);
225  hlAllTotDS_[ds]=0;
226  for (unsigned int p = 0; p < size; ++p) {
227  unsigned int i = hltConfig_.triggerIndex(datasetContents_[ds][p]);
228  if (i<n) {
229  hlIndex_[ds].push_back(i);
230  hlAccTotDS_[ds].push_back(0);
231  }
232  }
233  }
234  } else {
235  // reset the matrix of hlAccTotDS_
236  for (unsigned int ds = 0; ds < datasetNames_.size(); ds++) {
237  hlAllTotDS_[ds]=0;
238  for (unsigned int & i : hlAccTotDS_[ds])
239  i = 0;
240  }
241  }
242 
243  if (changed) {
244  // fill the matrices of dsIndex_, dsAccTotS_
245  dsIndex_.clear();
246  dsIndex_.resize(streamNames_.size());
247  dsAccTotS_.clear();
248  dsAllTotS_.clear();
249  dsAccTotS_.resize(streamNames_.size());
250  dsAllTotS_.resize(streamNames_.size());
251  for (unsigned int s = 0; s < streamNames_.size(); ++s) {
252  unsigned int size = streamContents_[s].size();
253  dsIndex_.reserve(size);
254  dsAccTotS_.reserve(size);
255  dsAllTotS_[s]=0;
256  for (unsigned int ds = 0; ds < size; ++ds) {
257  unsigned int i = 0;
258  for (; i<datasetNames_.size(); i++) if (datasetNames_[i] == streamContents_[s][ds])
259  break;
260  // report only datasets that have at least one path otherwise crash
261  if (i < datasetNames_.size() and hlIndex_[i].size() > 0) {
262  dsIndex_[s].push_back(i);
263  dsAccTotS_[s].push_back(0);
264  }
265  }
266  }
267  } else {
268  // reset the matrix of dsAccTotS_
269  for (unsigned int s = 0; s < streamNames_.size(); ++s) {
270  dsAllTotS_[s]=0;
271  for (unsigned int & i : dsAccTotS_[s])
272  i = 0;
273  }
274  }
275 
276  // if needed, update the reference path
277  if (changed) {
279  if (refIndex_ >= n) {
280  refIndex_ = 0;
281  edm::LogWarning("HLTrigReport")
282  << "Requested reference path '"+refPath_+"' not in HLT menu. "
283  << "Using HLTriggerFinalPath instead.";
284  refPath_ = "HLTriggerFinalPath";
286  if (refIndex_ >= n) {
287  refIndex_ = 0;
288  edm::LogWarning("HLTrigReport")
289  << "Requested reference path '"+refPath_+"' not in HLT menu. "
290  << "Using first path in table (index=0) instead.";
291  }
292  }
293  }
294 
295  if (changed and serviceBy_ != NEVER and edm::Service<HLTrigReportService>()) {
298  }
299 
300 }
301 
303  if (resetBy_ == EVERY_JOB)
304  reset();
305 }
306 
308  if (reportBy_ == EVERY_JOB)
309  dumpReport("Summary for Job");
311  edm::Service<HLTrigReportService>()->setDatasetCounts(datasetCounts());
312  edm::Service<HLTrigReportService>()->setStreamCounts(streamCounts());
313  }
314 
315 }
316 
317 void
318 HLTrigReport::beginRun(edm::Run const & iRun, edm::EventSetup const& iSetup)
319 {
320  bool changed = true;
321  if (hltConfig_.init(iRun, iSetup, hlTriggerResults_.process(), changed)) {
322  configured_ = true;
323  if (changed) {
324  dumpReport("Summary for this HLT table");
325  reset(true);
326  }
327  } else {
328  dumpReport("Summary for this HLT table");
329  // cannot initialize the HLT menu - reset and clear all counters and tables
330  configured_ = false;
331  nEvents_ = 0;
332  nWasRun_ = 0;
333  nAccept_ = 0;
334  nErrors_ = 0;
335  hlWasRun_.clear();
336  hltL1s_.clear();
337  hltPre_.clear();
338  hlAccept_.clear();
339  hlAccTot_.clear();
340  hlErrors_.clear();
341  posL1s_.clear();
342  posPre_.clear();
343  hlNames_.clear();
344  hlIndex_.clear();
345  hlAccTotDS_.clear();
346  hlAllTotDS_.clear();
347  dsIndex_.clear();
348  dsAccTotS_.clear();
349  dsAllTotS_.clear();
350  }
351 
352  if (resetBy_ == EVERY_RUN) reset();
353 
354 }
355 
357  if (reportBy_ == EVERY_RUN) {
358  std::stringstream stream;
359  stream << "Summary for Run " << run.run();
360  dumpReport(stream.str());
361  }
363  edm::Service<HLTrigReportService>()->setDatasetCounts(datasetCounts());
364  edm::Service<HLTrigReportService>()->setStreamCounts(streamCounts());
365  }
366 }
367 
369  if (resetBy_ == EVERY_LUMI) reset();
370 }
371 
373  if (reportBy_ == EVERY_LUMI) {
374  std::stringstream stream;
375  stream << "Summary for Run " << lumi.run() << ", LumiSection " << lumi.luminosityBlock();
376  dumpReport(stream.str());
377  }
379  edm::Service<HLTrigReportService>()->setDatasetCounts(datasetCounts());
380  edm::Service<HLTrigReportService>()->setStreamCounts(streamCounts());
381  }
382 }
383 
384 
385 // ------------ method called to produce the data ------------
386 void
388 {
389  // accumulation of statistics event by event
390 
391  using namespace std;
392  using namespace edm;
393 
394  if (resetBy_ == EVERY_EVENT) reset();
395 
396  nEvents_++;
397 
398  // get hold of TriggerResults
400  iEvent.getByToken(hlTriggerResultsToken_, HLTR);
401  if (HLTR.isValid()) {
402  if (HLTR->wasrun()) nWasRun_++;
403  const bool accept(HLTR->accept());
404  LogDebug("HLTrigReport") << "HLT TriggerResults decision: " << accept;
405  if (accept) ++nAccept_;
406  if (HLTR->error()) nErrors_++;
407  } else {
408  LogDebug("HLTrigReport") << "HLT TriggerResults with label ["+hlTriggerResults_.encode()+"] not found!";
409  nErrors_++;
410  return;
411  }
412 
413  // HLTConfigProvider not configured - cannot produce any detailed statistics
414  if (not configured_)
415  return;
416 
417  // decision for each HL algorithm
418  const unsigned int n(hlNames_.size());
419  bool acceptedByPrevoiusPaths = false;
420  for (unsigned int i=0; i!=n; ++i) {
421  if (HLTR->wasrun(i)) hlWasRun_[i]++;
422  if (HLTR->accept(i)) {
423  acceptedByPrevoiusPaths = true;
424  hlAccept_[i]++;
425  }
426  if (acceptedByPrevoiusPaths) hlAccTot_[i]++;
427  if (HLTR->error(i) ) hlErrors_[i]++;
428  const int index(static_cast<int>(HLTR->index(i)));
429  if (HLTR->accept(i)) {
430  if (index >= posL1s_[i]) hltL1s_[i]++;
431  if (index >= posPre_[i]) hltPre_[i]++;
432  } else {
433  if (index > posL1s_[i]) hltL1s_[i]++;
434  if (index > posPre_[i]) hltPre_[i]++;
435  }
436  }
437 
438  // calculate accumulation of accepted events by a path within a dataset
439  std::vector<bool> acceptedByDS(hlIndex_.size(), false);
440  for (size_t ds=0; ds<hlIndex_.size(); ++ds) {
441  for (size_t p=0; p<hlIndex_[ds].size(); ++p) {
442  if (acceptedByDS[ds] or HLTR->accept(hlIndex_[ds][p])) {
443  acceptedByDS[ds] = true;
444  hlAccTotDS_[ds][p]++;
445  }
446  }
447  if (acceptedByDS[ds]) hlAllTotDS_[ds]++;
448  }
449 
450  // calculate accumulation of accepted events by a dataset within a stream
451  for (size_t s=0; s<dsIndex_.size(); ++s) {
452  bool acceptedByS = false;
453  for (size_t ds=0; ds<dsIndex_[s].size(); ++ds) {
454  if (acceptedByS or acceptedByDS[dsIndex_[s][ds]]) {
455  acceptedByS = true;
456  dsAccTotS_[s][ds]++;
457  }
458  }
459  if (acceptedByS) dsAllTotS_[s]++;
460  }
461 
462  if (reportBy_ == EVERY_EVENT) {
463  std::stringstream stream;
464  stream << "Summary for Run " << iEvent.run() << ", LumiSection " << iEvent.luminosityBlock() << ", Event " << iEvent.id();
465  dumpReport(stream.str());
466  }
468  edm::Service<HLTrigReportService>()->setDatasetCounts(datasetCounts());
469  edm::Service<HLTrigReportService>()->setStreamCounts(streamCounts());
470  }
471 
472 }
473 
474 void
475 HLTrigReport::dumpReport(std::string const & header /* = std::string() */)
476 {
477  // final printout of accumulated statistics
478 
479  using namespace std;
480  using namespace edm;
481  const unsigned int n(hlNames_.size());
482 
483  if ((n==0) and (nEvents_==0)) return;
484 
485  LogVerbatim("HLTrigReport") << dec << endl;
486  LogVerbatim("HLTrigReport") << "HLT-Report " << "---------- Event Summary ------------" << endl;
487  if (not header.empty())
488  LogVerbatim("HLTrigReport") << "HLT-Report " << header << endl;
489  LogVerbatim("HLTrigReport") << "HLT-Report"
490  << " Events total = " << nEvents_
491  << " wasrun = " << nWasRun_
492  << " passed = " << nAccept_
493  << " errors = " << nErrors_
494  << endl;
495 
496  // HLTConfigProvider not configured - cannot produce any detailed statistics
497  if (not configured_)
498  return;
499 
500  double scale = hlAccept_[refIndex_]>0 ? refRate_/hlAccept_[refIndex_] : 0.;
501  double alpha = 1 - (1.0 - .6854)/2; // for the Clopper-Pearson 68% CI
502 
503  LogVerbatim("HLTrigReport") << endl;
504  LogVerbatim("HLTrigReport") << "HLT-Report " << "---------- HLTrig Summary ------------" << endl;
505  LogVerbatim("HLTrigReport") << "HLT-Report "
506  << right << setw(7) << "HLT #" << " "
507  << right << setw(7) << "WasRun" << " "
508  << right << setw(7) << "L1S" << " "
509  << right << setw(7) << "Pre" << " "
510  << right << setw(7) << "HLT" << " "
511  << right << setw(9) << "%L1sPre" << " "
512  << right << setw(7) << "Rate" << " "
513  << right << setw(7) << "RateHi" << " "
514  << right << setw(7) << "Errors" << " "
515  << "Name" << endl;
516 
517  if (n>0) {
518  for (unsigned int i=0; i!=n; ++i) {
519  LogVerbatim("HLTrigReport") << "HLT-Report "
520  << right << setw(7) << i << " "
521  << right << setw(7) << hlWasRun_[i] << " "
522  << right << setw(7) << hltL1s_[i] << " "
523  << right << setw(7) << hltPre_[i] << " "
524  << right << setw(7) << hlAccept_[i] << " "
525  << right << setw(9) << fixed << setprecision(5)
526  << static_cast<float>(100*hlAccept_[i])/
527  static_cast<float>(max(hltPre_[i], 1u)) << " "
528  << right << setw(7) << fixed << setprecision(1) << scale*hlAccept_[i] << " "
529  << right << setw(7) << fixed << setprecision(1) <<
530  ((hlAccept_[refIndex_]-hlAccept_[i] > 0) ? refRate_*ROOT::Math::beta_quantile(alpha, hlAccept_[i]+1, hlAccept_[refIndex_]-hlAccept_[i]) : 0) << " "
531  << right << setw(7) << hlErrors_[i] << " "
532  << hlNames_[i] << endl;
533  }
534  }
535 
536  LogVerbatim("HLTrigRprtTt") << endl;
537  LogVerbatim("HLTrigRprtTt") << "HLT-Report " << "---------- HLTrig Summary ------------" << endl;
538  LogVerbatim("HLTrigRprtTt") << "HLT-Report "
539  << right << setw(7) << "HLT #" << " "
540  << right << setw(7) << "WasRun" << " "
541  << right << setw(7) << "L1S" << " "
542  << right << setw(7) << "Pre" << " "
543  << right << setw(7) << "HLT" << " "
544  << right << setw(9) << "%L1sPre" << " "
545  << right << setw(7) << "Rate" << " "
546  << right << setw(7) << "RateHi" << " "
547  << right << setw(7) << "HLTtot" << " "
548  << right << setw(7) << "RateTot" << " "
549  << right << setw(7) << "Errors" << " "
550  << "Name" << endl;
551 
552  if (n>0) {
553  for (unsigned int i=0; i!=n; ++i) {
554  LogVerbatim("HLTrigRprtTt") << "HLT-Report "
555  << right << setw(7) << i << " "
556  << right << setw(7) << hlWasRun_[i] << " "
557  << right << setw(7) << hltL1s_[i] << " "
558  << right << setw(7) << hltPre_[i] << " "
559  << right << setw(7) << hlAccept_[i] << " "
560  << right << setw(9) << fixed << setprecision(5)
561  << static_cast<float>(100*hlAccept_[i])/
562  static_cast<float>(max(hltPre_[i], 1u)) << " "
563  << right << setw(7) << fixed << setprecision(1) << scale*hlAccept_[i] << " "
564  << right << setw(7) << fixed << setprecision(1) <<
565  ((hlAccept_[refIndex_]-hlAccept_[i] > 0) ? refRate_*ROOT::Math::beta_quantile(alpha, hlAccept_[i]+1, hlAccept_[refIndex_]-hlAccept_[i]) : 0) << " "
566  << right << setw(7) << hlAccTot_[i] << " "
567  << right << setw(7) << fixed << setprecision(1) << scale*hlAccTot_[i] << " "
568  << right << setw(7) << hlErrors_[i] << " "
569  << hlNames_[i] << endl;
570  }
571 
572  // now for each dataset
573  for (size_t ds=0; ds<hlIndex_.size(); ++ds) {
574  LogVerbatim("HLTrigRprtPD") << endl;
575  LogVerbatim("HLTrigRprtPD") << "HLT-Report " << "---------- Dataset Summary: " << datasetNames_[ds] << " ------------" << hlAllTotDS_[ds] << endl;
576  LogVerbatim("HLTrigRprtPD") << "HLT-Report "
577  << right << setw(7) << "HLT #" << " "
578  << right << setw(7) << "WasRun" << " "
579  << right << setw(7) << "L1S" << " "
580  << right << setw(7) << "Pre" << " "
581  << right << setw(7) << "HLT" << " "
582  << right << setw(9) << "%L1sPre" << " "
583  << right << setw(7) << "Rate" << " "
584  << right << setw(7) << "RateHi" << " "
585  << right << setw(7) << "HLTtot" << " "
586  << right << setw(7) << "RateTot" << " "
587  << right << setw(7) << "Errors" << " "
588  << "Name" << endl;
589  for (size_t p=0; p<hlIndex_[ds].size(); ++p) {
590  LogVerbatim("HLTrigRprtPD") << "HLT-Report "
591  << right << setw(7) << p << " "
592  << right << setw(7) << hlWasRun_[hlIndex_[ds][p]] << " "
593  << right << setw(7) << hltL1s_[hlIndex_[ds][p]] << " "
594  << right << setw(7) << hltPre_[hlIndex_[ds][p]] << " "
595  << right << setw(7) << hlAccept_[hlIndex_[ds][p]] << " "
596  << right << setw(9) << fixed << setprecision(5)
597  << static_cast<float>(100*hlAccept_[hlIndex_[ds][p]])/
598  static_cast<float>(max(hltPre_[hlIndex_[ds][p]], 1u)) << " "
599  << right << setw(7) << fixed << setprecision(1) << scale*hlAccept_[hlIndex_[ds][p]] << " "
600  << right << setw(7) << fixed << setprecision(1) <<
601  ((hlAccept_[refIndex_]-hlAccept_[hlIndex_[ds][p]] > 0) ? refRate_*ROOT::Math::beta_quantile(alpha, hlAccept_[hlIndex_[ds][p]]+1, hlAccept_[refIndex_]-hlAccept_[hlIndex_[ds][p]]) : 0) << " "
602  << right << setw(7) << hlAccTotDS_[ds][p] << " "
603  << right << setw(7) << fixed << setprecision(1) << scale*hlAccTotDS_[ds][p] << " "
604  << right << setw(7) << hlErrors_[hlIndex_[ds][p]] << " "
605  << hlNames_[hlIndex_[ds][p]] << endl;
606  }
607  }
608 
609  // now for each stream
610  for (size_t s=0; s<dsIndex_.size(); ++s) {
611  LogVerbatim("HLTrigRprtST") << endl;
612  LogVerbatim("HLTrigRprtST") << "HLT-Report " << "---------- Stream Summary: " << streamNames_[s] << " ------------" << dsAllTotS_[s] << endl;
613  LogVerbatim("HLTrigRprtST") << "HLT-Report "
614  << right << setw(10) << "Dataset #" << " "
615  << right << setw(10) << "Individual" << " "
616  << right << setw(10) << "Total" << " "
617  << right << setw(10) << "Rate" << " "
618  << right << setw(10) << "RateHi" << " "
619  << right << setw(10) << "RateTot" << " "
620  << "Name" << endl;
621  for (size_t ds=0;ds<dsIndex_[s].size(); ++ds) {
622  unsigned int acceptedDS = hlAccTotDS_[dsIndex_[s][ds]][hlIndex_[dsIndex_[s][ds]].size()-1];
623  LogVerbatim("HLTrigRprtST") << "HLT-Report "
624  << right << setw(10) << ds << " "
625  << right << setw(10) << acceptedDS << " "
626  << right << setw(10) << dsAccTotS_[s][ds] << " "
627  << right << setw(10) << fixed << setprecision(1) << scale*acceptedDS << " "
628  << right << setw(10) << fixed << setprecision(1) <<
629  ((hlAccept_[refIndex_]-acceptedDS > 0) ? refRate_*ROOT::Math::beta_quantile(alpha, acceptedDS+1, hlAccept_[refIndex_]-acceptedDS) : 0) << " "
630  << right << setw(10) << fixed << setprecision(1) << scale*dsAccTotS_[s][ds] << " "
631  << datasetNames_[dsIndex_[s][ds]] << endl;
632  }
633  }
634 
635  } else {
636  LogVerbatim("HLTrigReport") << "HLT-Report - No HLT paths found!" << endl;
637  }
638 
639  LogVerbatim("HLTrigReport") << endl;
640  LogVerbatim("HLTrigReport") << "HLT-Report end!" << endl;
641  LogVerbatim("HLTrigReport") << endl;
642 
643  return;
644 }
#define LogDebug(id)
std::vector< unsigned int > hlErrors_
Definition: HLTrigReport.h:84
size
Write out results.
std::vector< std::vector< std::string > > datasetContents_
Definition: HLTrigReport.h:94
bool isCustomStreams_
Definition: HLTrigReport.h:101
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool wasrun() const
Was at least one path run?
bool isCustomDatasets_
Definition: HLTrigReport.h:95
float alpha
Definition: AMPTWrapper.h:95
std::vector< unsigned int > hlAccTot_
Definition: HLTrigReport.h:83
std::vector< std::string > hlNames_
Definition: HLTrigReport.h:88
const std::string moduleType(const std::string &module) const
C++ class name of module.
const ReportEvery resetBy_
Definition: HLTrigReport.h:107
const ReportEvery reportBy_
Definition: HLTrigReport.h:106
const std::vector< std::vector< std::string > > & streamContents() const
names of datasets for all streams
RunNumber_t run() const
Definition: RunBase.h:40
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
std::vector< unsigned int > dsAllTotS_
Definition: HLTrigReport.h:98
const std::vector< unsigned int > & streamCounts() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
std::vector< std::vector< unsigned int > > hlAccTotDS_
Definition: HLTrigReport.h:91
bool accept() const
Has at least one path accepted the event?
const std::vector< std::string > & triggerNames() const
names of trigger paths
const std::vector< std::string > & datasetNames() const
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
unsigned int nWasRun_
Definition: HLTrigReport.h:75
std::vector< std::string > datasetNames_
Definition: HLTrigReport.h:93
double refRate_
Definition: HLTrigReport.h:104
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
static ReportEvery decode(const std::string &value)
Definition: HLTrigReport.cc:27
std::string encode() const
Definition: InputTag.cc:166
edm::EDGetTokenT< edm::TriggerResults > hlTriggerResultsToken_
Definition: HLTrigReport.h:71
virtual void beginRun(edm::Run const &, edm::EventSetup const &) override
std::vector< int > posL1s_
Definition: HLTrigReport.h:86
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:194
LuminosityBlockNumber_t luminosityBlock() const
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
std::vector< int > posPre_
Definition: HLTrigReport.h:87
std::vector< unsigned int > hltL1s_
Definition: HLTrigReport.h:80
virtual void endRun(edm::Run const &, edm::EventSetup const &) override
int iEvent
Definition: GenABIO.cc:230
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
const std::vector< std::string > & streamNames() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
unsigned int index(const unsigned int i) const
Get index (slot position) of module giving the decision of the ith path.
RunNumber_t run() const
Definition: Event.h:94
bool error() const
Has any path encountered an error (exception)
void dumpReport(std::string const &header=std::string())
std::vector< std::string > streamNames_
Definition: HLTrigReport.h:99
RunNumber_t run() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: value.py:1
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool isValid() const
Definition: HandleBase.h:74
unsigned int nAccept_
Definition: HLTrigReport.h:76
unsigned int refIndex_
Definition: HLTrigReport.h:103
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< unsigned int > hlWasRun_
Definition: HLTrigReport.h:79
bool configured_
Definition: HLTrigReport.h:72
std::string refPath_
Definition: HLTrigReport.h:102
HLTConfigProvider hltConfig_
Definition: HLTrigReport.h:109
std::vector< unsigned int > hlAllTotDS_
Definition: HLTrigReport.h:92
std::vector< std::vector< std::string > > streamContents_
Definition: HLTrigReport.h:100
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
const std::vector< unsigned int > & datasetCounts() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
unsigned int nEvents_
Definition: HLTrigReport.h:74
std::vector< unsigned int > hltPre_
Definition: HLTrigReport.h:81
std::string const & process() const
Definition: InputTag.h:40
unsigned int nErrors_
Definition: HLTrigReport.h:77
const std::vector< std::vector< std::string > > & datasetContents() const
names of trigger paths for all datasets
edm::EventID id() const
Definition: EventBase.h:60
HLT enums.
void reset(bool changed=false)
virtual void beginJob() override
HLTrigReport(const edm::ParameterSet &)
Definition: HLTrigReport.cc:50
std::vector< std::vector< unsigned int > > hlIndex_
Definition: HLTrigReport.h:90
virtual void endJob() override
std::vector< unsigned int > hlAccept_
Definition: HLTrigReport.h:82
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< std::vector< unsigned int > > dsAccTotS_
Definition: HLTrigReport.h:97
const std::vector< std::string > & streamNames() const
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
edm::InputTag hlTriggerResults_
Definition: HLTrigReport.h:70
const ReportEvery serviceBy_
Definition: HLTrigReport.h:108
std::vector< std::vector< unsigned int > > dsIndex_
Definition: HLTrigReport.h:96
Definition: Run.h:42
const std::vector< std::string > & datasetNames() const