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