CMS 3D CMS Logo

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