CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
HLTrigReport Class Reference

#include <HLTrigReport.h>

Inheritance diagram for HLTrigReport:
edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginJob () override
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &) override
 
const std::vector< unsigned int > & datasetCounts () const
 
const std::vector< std::string > & datasetNames () const
 
virtual void endJob () override
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
virtual void endRun (edm::Run const &, edm::EventSetup const &) override
 
 HLTrigReport (const edm::ParameterSet &)
 
void reset (bool changed=false)
 
const std::vector< unsigned int > & streamCounts () const
 
const std::vector< std::string > & streamNames () const
 
 ~HLTrigReport ()
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static ReportEvery decode (const std::string &value)
 
static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Types

enum  ReportEvery {
  NEVER = 0, EVERY_EVENT = 1, EVERY_LUMI = 2, EVERY_RUN = 3,
  EVERY_JOB = 4
}
 

Private Member Functions

void dumpReport (std::string const &header=std::string())
 

Private Attributes

bool configured_
 
std::vector< std::vector< std::string > > datasetContents_
 
std::vector< std::string > datasetNames_
 
std::vector< std::vector< unsigned int > > dsAccTotS_
 
std::vector< unsigned int > dsAllTotS_
 
std::vector< std::vector< unsigned int > > dsIndex_
 
std::vector< unsigned int > hlAccept_
 
std::vector< unsigned int > hlAccTot_
 
std::vector< std::vector< unsigned int > > hlAccTotDS_
 
std::vector< unsigned int > hlAllTotDS_
 
std::vector< unsigned int > hlErrors_
 
std::vector< std::vector< unsigned int > > hlIndex_
 
std::vector< std::string > hlNames_
 
HLTConfigProvider hltConfig_
 
std::vector< unsigned int > hltL1s_
 
std::vector< unsigned int > hltPre_
 
edm::InputTag hlTriggerResults_
 
edm::EDGetTokenT< edm::TriggerResultshlTriggerResultsToken_
 
std::vector< unsigned int > hlWasRun_
 
bool isCustomDatasets_
 
bool isCustomStreams_
 
unsigned int nAccept_
 
unsigned int nErrors_
 
unsigned int nEvents_
 
unsigned int nWasRun_
 
std::vector< int > posL1s_
 
std::vector< int > posPre_
 
unsigned int refIndex_
 
std::string refPath_
 
double refRate_
 
const ReportEvery reportBy_
 
const ReportEvery resetBy_
 
const ReportEvery serviceBy_
 
std::vector< std::vector< std::string > > streamContents_
 
std::vector< std::string > streamNames_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

This class is an EDAnalyzer implementing TrigReport (statistics printed to log file) for HL triggers

Author
Martin Grunewald

See header file for documentation

Author
Martin Grunewald

Definition at line 30 of file HLTrigReport.h.

Member Enumeration Documentation

Enumerator
NEVER 
EVERY_EVENT 
EVERY_LUMI 
EVERY_RUN 
EVERY_JOB 

Definition at line 32 of file HLTrigReport.h.

Constructor & Destructor Documentation

HLTrigReport::HLTrigReport ( const edm::ParameterSet iConfig)
explicit

Definition at line 50 of file HLTrigReport.cc.

References datasetContents_, datasetNames_, edm::InputTag::encode(), edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), edm::ParameterSet::getUntrackedParameter(), hlTriggerResults_, isCustomDatasets_, isCustomStreams_, LogDebug, dataset::name, NEVER, refIndex_, refPath_, refRate_, serviceBy_, streamContents_, streamNames_, AlCaHLTBitMon_QueryRunRegistry::string, and ~HLTrigReport().

50  :
51  hlTriggerResults_(iConfig.getParameter<edm::InputTag> ("HLTriggerResults")),
52  hlTriggerResultsToken_(consumes<edm::TriggerResults>(hlTriggerResults_)),
53  configured_(false),
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),
71  isCustomDatasets_(false),
72  dsIndex_(0),
73  dsAccTotS_(0),
74  streamNames_(0),
75  streamContents_(0),
76  isCustomStreams_(false),
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 }
#define LogDebug(id)
std::vector< unsigned int > hlErrors_
Definition: HLTrigReport.h:84
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 isCustomDatasets_
Definition: HLTrigReport.h:95
std::vector< unsigned int > hlAccTot_
Definition: HLTrigReport.h:83
std::vector< std::string > hlNames_
Definition: HLTrigReport.h:88
const ReportEvery resetBy_
Definition: HLTrigReport.h:107
const ReportEvery reportBy_
Definition: HLTrigReport.h:106
std::vector< std::vector< unsigned int > > hlAccTotDS_
Definition: HLTrigReport.h:91
unsigned int nWasRun_
Definition: HLTrigReport.h:75
std::vector< std::string > datasetNames_
Definition: HLTrigReport.h:93
double refRate_
Definition: HLTrigReport.h:104
static ReportEvery decode(const std::string &value)
Definition: HLTrigReport.cc:27
std::string encode() const
Definition: InputTag.cc:165
edm::EDGetTokenT< edm::TriggerResults > hlTriggerResultsToken_
Definition: HLTrigReport.h:71
std::vector< int > posL1s_
Definition: HLTrigReport.h:86
std::vector< int > posPre_
Definition: HLTrigReport.h:87
std::vector< unsigned int > hltL1s_
Definition: HLTrigReport.h:80
std::vector< std::string > streamNames_
Definition: HLTrigReport.h:99
unsigned int nAccept_
Definition: HLTrigReport.h:76
unsigned int refIndex_
Definition: HLTrigReport.h:103
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< std::vector< std::string > > streamContents_
Definition: HLTrigReport.h:100
unsigned int nEvents_
Definition: HLTrigReport.h:74
std::vector< unsigned int > hltPre_
Definition: HLTrigReport.h:81
unsigned int nErrors_
Definition: HLTrigReport.h:77
std::vector< std::vector< unsigned int > > hlIndex_
Definition: HLTrigReport.h:90
std::vector< unsigned int > hlAccept_
Definition: HLTrigReport.h:82
std::vector< std::vector< unsigned int > > dsAccTotS_
Definition: HLTrigReport.h:97
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
HLTrigReport::~HLTrigReport ( )
default

Referenced by HLTrigReport().

Member Function Documentation

void HLTrigReport::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Definition at line 387 of file HLTrigReport.cc.

References accept(), edm::HLTGlobalStatus::accept(), configured_, datasetCounts(), dsAccTotS_, dsAllTotS_, dsIndex_, dumpReport(), edm::InputTag::encode(), edm::HLTGlobalStatus::error(), EVERY_EVENT, edm::Event::getByToken(), hlAccept_, hlAccTot_, hlAccTotDS_, hlAllTotDS_, hlErrors_, hlIndex_, hlNames_, hltL1s_, hltPre_, hlTriggerResults_, hlTriggerResultsToken_, hlWasRun_, mps_fire::i, edm::EventBase::id(), edm::HLTGlobalStatus::index(), diffTreeTool::index, edm::HandleBase::isValid(), LogDebug, edm::EventBase::luminosityBlock(), gen::n, nAccept_, nErrors_, nEvents_, nWasRun_, or, AlCaHLTBitMon_ParallelJobs::p, posL1s_, posPre_, reportBy_, reset(), resetBy_, edm::Event::run(), alignCSCRings::s, serviceBy_, streamCounts(), and edm::HLTGlobalStatus::wasrun().

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 }
#define LogDebug(id)
std::vector< unsigned int > hlErrors_
Definition: HLTrigReport.h:84
bool wasrun() const
Was at least one path run?
std::vector< unsigned int > hlAccTot_
Definition: HLTrigReport.h:83
std::vector< std::string > hlNames_
Definition: HLTrigReport.h:88
const ReportEvery resetBy_
Definition: HLTrigReport.h:107
const ReportEvery reportBy_
Definition: HLTrigReport.h:106
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?
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
unsigned int nWasRun_
Definition: HLTrigReport.h:75
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
std::string encode() const
Definition: InputTag.cc:165
edm::EDGetTokenT< edm::TriggerResults > hlTriggerResultsToken_
Definition: HLTrigReport.h:71
std::vector< int > posL1s_
Definition: HLTrigReport.h:86
std::vector< int > posPre_
Definition: HLTrigReport.h:87
std::vector< unsigned int > hltL1s_
Definition: HLTrigReport.h:80
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())
bool isValid() const
Definition: HandleBase.h:74
unsigned int nAccept_
Definition: HLTrigReport.h:76
std::vector< unsigned int > hlWasRun_
Definition: HLTrigReport.h:79
bool configured_
Definition: HLTrigReport.h:72
std::vector< unsigned int > hlAllTotDS_
Definition: HLTrigReport.h:92
const std::vector< unsigned int > & datasetCounts() const
unsigned int nEvents_
Definition: HLTrigReport.h:74
std::vector< unsigned int > hltPre_
Definition: HLTrigReport.h:81
unsigned int nErrors_
Definition: HLTrigReport.h:77
edm::EventID id() const
Definition: EventBase.h:60
HLT enums.
void reset(bool changed=false)
std::vector< std::vector< unsigned int > > hlIndex_
Definition: HLTrigReport.h:90
std::vector< unsigned int > hlAccept_
Definition: HLTrigReport.h:82
std::vector< std::vector< unsigned int > > dsAccTotS_
Definition: HLTrigReport.h:97
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
void HLTrigReport::beginJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 302 of file HLTrigReport.cc.

References EVERY_JOB, reset(), and resetBy_.

302  {
303  if (resetBy_ == EVERY_JOB)
304  reset();
305 }
const ReportEvery resetBy_
Definition: HLTrigReport.h:107
void reset(bool changed=false)
void HLTrigReport::beginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  setup 
)
overridevirtual

Definition at line 368 of file HLTrigReport.cc.

References EVERY_LUMI, reset(), and resetBy_.

368  {
369  if (resetBy_ == EVERY_LUMI) reset();
370 }
const ReportEvery resetBy_
Definition: HLTrigReport.h:107
void reset(bool changed=false)
void HLTrigReport::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overridevirtual

Definition at line 318 of file HLTrigReport.cc.

References configured_, dsAccTotS_, dsAllTotS_, dsIndex_, dumpReport(), EVERY_RUN, hlAccept_, hlAccTot_, hlAccTotDS_, hlAllTotDS_, hlErrors_, hlIndex_, hlNames_, hltConfig_, hltL1s_, hltPre_, hlTriggerResults_, hlWasRun_, HLTConfigProvider::init(), nAccept_, nErrors_, nEvents_, nWasRun_, posL1s_, posPre_, edm::InputTag::process(), reset(), and resetBy_.

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 }
std::vector< unsigned int > hlErrors_
Definition: HLTrigReport.h:84
std::vector< unsigned int > hlAccTot_
Definition: HLTrigReport.h:83
std::vector< std::string > hlNames_
Definition: HLTrigReport.h:88
const ReportEvery resetBy_
Definition: HLTrigReport.h:107
std::vector< unsigned int > dsAllTotS_
Definition: HLTrigReport.h:98
std::vector< std::vector< unsigned int > > hlAccTotDS_
Definition: HLTrigReport.h:91
unsigned int nWasRun_
Definition: HLTrigReport.h:75
std::vector< int > posL1s_
Definition: HLTrigReport.h:86
std::vector< int > posPre_
Definition: HLTrigReport.h:87
std::vector< unsigned int > hltL1s_
Definition: HLTrigReport.h:80
void dumpReport(std::string const &header=std::string())
unsigned int nAccept_
Definition: HLTrigReport.h:76
std::vector< unsigned int > hlWasRun_
Definition: HLTrigReport.h:79
bool configured_
Definition: HLTrigReport.h:72
HLTConfigProvider hltConfig_
Definition: HLTrigReport.h:109
std::vector< unsigned int > hlAllTotDS_
Definition: HLTrigReport.h:92
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
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
void reset(bool changed=false)
std::vector< std::vector< unsigned int > > hlIndex_
Definition: HLTrigReport.h:90
std::vector< unsigned int > hlAccept_
Definition: HLTrigReport.h:82
std::vector< std::vector< unsigned int > > dsAccTotS_
Definition: HLTrigReport.h:97
edm::InputTag hlTriggerResults_
Definition: HLTrigReport.h:70
std::vector< std::vector< unsigned int > > dsIndex_
Definition: HLTrigReport.h:96
const std::vector< unsigned int > & HLTrigReport::datasetCounts ( ) const

Definition at line 147 of file HLTrigReport.cc.

References hlAllTotDS_.

Referenced by analyze(), endJob(), endLuminosityBlock(), and endRun().

147  {
148  return hlAllTotDS_;
149 }
std::vector< unsigned int > hlAllTotDS_
Definition: HLTrigReport.h:92
const std::vector< std::string > & HLTrigReport::datasetNames ( ) const

Definition at line 141 of file HLTrigReport.cc.

References datasetNames_.

141  {
142  return datasetNames_;
143 }
std::vector< std::string > datasetNames_
Definition: HLTrigReport.h:93
HLTrigReport::ReportEvery HLTrigReport::decode ( const std::string &  value)
static

Definition at line 27 of file HLTrigReport.cc.

References EVERY_EVENT, EVERY_JOB, EVERY_LUMI, EVERY_RUN, Exception, and NEVER.

27  {
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 }
Definition: value.py:1
void HLTrigReport::dumpReport ( std::string const &  header = std::string())
private

Definition at line 475 of file HLTrigReport.cc.

References alpha, configured_, datasetNames_, TauDecayModes::dec, dsAccTotS_, dsAllTotS_, dsIndex_, alignBH_cfg::fixed, hlAccept_, hlAccTot_, hlAccTotDS_, hlAllTotDS_, hlErrors_, hlIndex_, hlNames_, hltL1s_, hltPre_, hlWasRun_, mps_fire::i, hpstanc_transforms::max, gen::n, nAccept_, nErrors_, nEvents_, nWasRun_, AlCaHLTBitMon_ParallelJobs::p, refIndex_, refRate_, alignCSCRings::s, Scenarios_cff::scale, and streamNames_.

Referenced by analyze(), beginRun(), endJob(), endLuminosityBlock(), and endRun().

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 }
std::vector< unsigned int > hlErrors_
Definition: HLTrigReport.h:84
float alpha
Definition: AMPTWrapper.h:95
std::vector< unsigned int > hlAccTot_
Definition: HLTrigReport.h:83
std::vector< std::string > hlNames_
Definition: HLTrigReport.h:88
std::vector< unsigned int > dsAllTotS_
Definition: HLTrigReport.h:98
std::vector< std::vector< unsigned int > > hlAccTotDS_
Definition: HLTrigReport.h:91
unsigned int nWasRun_
Definition: HLTrigReport.h:75
std::vector< std::string > datasetNames_
Definition: HLTrigReport.h:93
double refRate_
Definition: HLTrigReport.h:104
std::vector< unsigned int > hltL1s_
Definition: HLTrigReport.h:80
std::vector< std::string > streamNames_
Definition: HLTrigReport.h:99
unsigned int nAccept_
Definition: HLTrigReport.h:76
unsigned int refIndex_
Definition: HLTrigReport.h:103
std::vector< unsigned int > hlWasRun_
Definition: HLTrigReport.h:79
bool configured_
Definition: HLTrigReport.h:72
std::vector< unsigned int > hlAllTotDS_
Definition: HLTrigReport.h:92
unsigned int nEvents_
Definition: HLTrigReport.h:74
std::vector< unsigned int > hltPre_
Definition: HLTrigReport.h:81
unsigned int nErrors_
Definition: HLTrigReport.h:77
HLT enums.
std::vector< std::vector< unsigned int > > hlIndex_
Definition: HLTrigReport.h:90
std::vector< unsigned int > hlAccept_
Definition: HLTrigReport.h:82
std::vector< std::vector< unsigned int > > dsAccTotS_
Definition: HLTrigReport.h:97
std::vector< std::vector< unsigned int > > dsIndex_
Definition: HLTrigReport.h:96
void HLTrigReport::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 307 of file HLTrigReport.cc.

References datasetCounts(), dumpReport(), EVERY_JOB, reportBy_, serviceBy_, and streamCounts().

307  {
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 }
const ReportEvery reportBy_
Definition: HLTrigReport.h:106
const std::vector< unsigned int > & streamCounts() const
void dumpReport(std::string const &header=std::string())
const std::vector< unsigned int > & datasetCounts() const
const ReportEvery serviceBy_
Definition: HLTrigReport.h:108
void HLTrigReport::endLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  setup 
)
overridevirtual

Definition at line 372 of file HLTrigReport.cc.

References datasetCounts(), dumpReport(), EVERY_LUMI, edm::LuminosityBlockBase::luminosityBlock(), reportBy_, edm::LuminosityBlockBase::run(), serviceBy_, and streamCounts().

372  {
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 }
const ReportEvery reportBy_
Definition: HLTrigReport.h:106
const std::vector< unsigned int > & streamCounts() const
void dumpReport(std::string const &header=std::string())
const std::vector< unsigned int > & datasetCounts() const
const ReportEvery serviceBy_
Definition: HLTrigReport.h:108
void HLTrigReport::endRun ( edm::Run const &  run,
edm::EventSetup const &  setup 
)
overridevirtual

Definition at line 356 of file HLTrigReport.cc.

References datasetCounts(), dumpReport(), EVERY_RUN, reportBy_, edm::RunBase::run(), serviceBy_, and streamCounts().

356  {
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 }
const ReportEvery reportBy_
Definition: HLTrigReport.h:106
const std::vector< unsigned int > & streamCounts() const
void dumpReport(std::string const &header=std::string())
const std::vector< unsigned int > & datasetCounts() const
const ReportEvery serviceBy_
Definition: HLTrigReport.h:108
void HLTrigReport::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 120 of file HLTrigReport.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), and AlCaHLTBitMon_QueryRunRegistry::string.

120  {
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 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HLTrigReport::reset ( bool  changed = false)

Definition at line 154 of file HLTrigReport.cc.

References HLTConfigProvider::datasetContents(), datasetContents_, HLTConfigProvider::datasetNames(), datasetNames_, dsAccTotS_, dsAllTotS_, dsIndex_, hlAccept_, hlAccTot_, hlAccTotDS_, hlAllTotDS_, hlErrors_, hlIndex_, hlNames_, hltConfig_, hltL1s_, hltPre_, hlWasRun_, mps_fire::i, isCustomDatasets_, isCustomStreams_, diffTwoXMLs::label, HLTConfigProvider::moduleLabels(), HLTConfigProvider::moduleType(), gen::n, nAccept_, nErrors_, nEvents_, NEVER, nWasRun_, AlCaHLTBitMon_ParallelJobs::p, posL1s_, posPre_, refIndex_, refPath_, alignCSCRings::s, serviceBy_, findQualityFiles::size, HLTConfigProvider::streamContents(), streamContents_, HLTConfigProvider::streamNames(), streamNames_, AlCaHLTBitMon_QueryRunRegistry::string, HLTConfigProvider::triggerIndex(), and HLTConfigProvider::triggerNames().

Referenced by analyze(), beginJob(), beginLuminosityBlock(), and beginRun().

154  {
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 }
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
bool isCustomDatasets_
Definition: HLTrigReport.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 std::vector< std::vector< std::string > > & streamContents() const
names of datasets for all streams
std::vector< unsigned int > dsAllTotS_
Definition: HLTrigReport.h:98
std::vector< std::vector< unsigned int > > hlAccTotDS_
Definition: HLTrigReport.h:91
const std::vector< std::string > & triggerNames() const
names of trigger paths
unsigned int nWasRun_
Definition: HLTrigReport.h:75
std::vector< std::string > datasetNames_
Definition: HLTrigReport.h:93
std::vector< int > posL1s_
Definition: HLTrigReport.h:86
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
const std::vector< std::string > & streamNames() const
std::vector< std::string > streamNames_
Definition: HLTrigReport.h:99
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
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
unsigned int nEvents_
Definition: HLTrigReport.h:74
std::vector< unsigned int > hltPre_
Definition: HLTrigReport.h:81
unsigned int nErrors_
Definition: HLTrigReport.h:77
const std::vector< std::vector< std::string > > & datasetContents() const
names of trigger paths for all datasets
std::vector< std::vector< unsigned int > > hlIndex_
Definition: HLTrigReport.h:90
std::vector< unsigned int > hlAccept_
Definition: HLTrigReport.h:82
std::vector< std::vector< unsigned int > > dsAccTotS_
Definition: HLTrigReport.h:97
const ReportEvery serviceBy_
Definition: HLTrigReport.h:108
std::vector< std::vector< unsigned int > > dsIndex_
Definition: HLTrigReport.h:96
const std::vector< std::string > & datasetNames() const
const std::vector< unsigned int > & HLTrigReport::streamCounts ( ) const

Definition at line 150 of file HLTrigReport.cc.

References dsAllTotS_.

Referenced by analyze(), endJob(), endLuminosityBlock(), and endRun().

150  {
151  return dsAllTotS_;
152 }
std::vector< unsigned int > dsAllTotS_
Definition: HLTrigReport.h:98
const std::vector< std::string > & HLTrigReport::streamNames ( ) const

Definition at line 144 of file HLTrigReport.cc.

References streamNames_.

144  {
145  return streamNames_;
146 }
std::vector< std::string > streamNames_
Definition: HLTrigReport.h:99

Member Data Documentation

bool HLTrigReport::configured_
private

Definition at line 72 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), and dumpReport().

std::vector<std::vector<std::string> > HLTrigReport::datasetContents_
private

Definition at line 94 of file HLTrigReport.h.

Referenced by HLTrigReport(), and reset().

std::vector<std::string> HLTrigReport::datasetNames_
private

Definition at line 93 of file HLTrigReport.h.

Referenced by datasetNames(), dumpReport(), HLTrigReport(), and reset().

std::vector<std::vector<unsigned int> > HLTrigReport::dsAccTotS_
private

Definition at line 97 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), dumpReport(), and reset().

std::vector<unsigned int> HLTrigReport::dsAllTotS_
private

Definition at line 98 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), dumpReport(), reset(), and streamCounts().

std::vector<std::vector<unsigned int> > HLTrigReport::dsIndex_
private

Definition at line 96 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), dumpReport(), and reset().

std::vector<unsigned int> HLTrigReport::hlAccept_
private

Definition at line 82 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), dumpReport(), and reset().

std::vector<unsigned int> HLTrigReport::hlAccTot_
private

Definition at line 83 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), dumpReport(), and reset().

std::vector<std::vector<unsigned int> > HLTrigReport::hlAccTotDS_
private

Definition at line 91 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), dumpReport(), and reset().

std::vector<unsigned int> HLTrigReport::hlAllTotDS_
private

Definition at line 92 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), datasetCounts(), dumpReport(), and reset().

std::vector<unsigned int> HLTrigReport::hlErrors_
private

Definition at line 84 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), dumpReport(), and reset().

std::vector<std::vector<unsigned int> > HLTrigReport::hlIndex_
private

Definition at line 90 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), dumpReport(), and reset().

std::vector<std::string> HLTrigReport::hlNames_
private

Definition at line 88 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), dumpReport(), and reset().

HLTConfigProvider HLTrigReport::hltConfig_
private

Definition at line 109 of file HLTrigReport.h.

Referenced by beginRun(), and reset().

std::vector<unsigned int> HLTrigReport::hltL1s_
private

Definition at line 80 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), dumpReport(), and reset().

std::vector<unsigned int> HLTrigReport::hltPre_
private

Definition at line 81 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), dumpReport(), and reset().

edm::InputTag HLTrigReport::hlTriggerResults_
private

Definition at line 70 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), and HLTrigReport().

edm::EDGetTokenT<edm::TriggerResults> HLTrigReport::hlTriggerResultsToken_
private

Definition at line 71 of file HLTrigReport.h.

Referenced by analyze().

std::vector<unsigned int> HLTrigReport::hlWasRun_
private

Definition at line 79 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), dumpReport(), and reset().

bool HLTrigReport::isCustomDatasets_
private

Definition at line 95 of file HLTrigReport.h.

Referenced by HLTrigReport(), and reset().

bool HLTrigReport::isCustomStreams_
private

Definition at line 101 of file HLTrigReport.h.

Referenced by HLTrigReport(), and reset().

unsigned int HLTrigReport::nAccept_
private

Definition at line 76 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), dumpReport(), and reset().

unsigned int HLTrigReport::nErrors_
private

Definition at line 77 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), dumpReport(), and reset().

unsigned int HLTrigReport::nEvents_
private

Definition at line 74 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), dumpReport(), and reset().

unsigned int HLTrigReport::nWasRun_
private

Definition at line 75 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), dumpReport(), and reset().

std::vector<int> HLTrigReport::posL1s_
private

Definition at line 86 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), and reset().

std::vector<int> HLTrigReport::posPre_
private

Definition at line 87 of file HLTrigReport.h.

Referenced by analyze(), beginRun(), and reset().

unsigned int HLTrigReport::refIndex_
private

Definition at line 103 of file HLTrigReport.h.

Referenced by dumpReport(), HLTrigReport(), and reset().

std::string HLTrigReport::refPath_
private

Definition at line 102 of file HLTrigReport.h.

Referenced by HLTrigReport(), and reset().

double HLTrigReport::refRate_
private

Definition at line 104 of file HLTrigReport.h.

Referenced by dumpReport(), and HLTrigReport().

const ReportEvery HLTrigReport::reportBy_
private

Definition at line 106 of file HLTrigReport.h.

Referenced by analyze(), endJob(), endLuminosityBlock(), and endRun().

const ReportEvery HLTrigReport::resetBy_
private

Definition at line 107 of file HLTrigReport.h.

Referenced by analyze(), beginJob(), beginLuminosityBlock(), and beginRun().

const ReportEvery HLTrigReport::serviceBy_
private

Definition at line 108 of file HLTrigReport.h.

Referenced by analyze(), endJob(), endLuminosityBlock(), endRun(), HLTrigReport(), and reset().

std::vector<std::vector<std::string> > HLTrigReport::streamContents_
private

Definition at line 100 of file HLTrigReport.h.

Referenced by HLTrigReport(), and reset().

std::vector<std::string> HLTrigReport::streamNames_
private

Definition at line 99 of file HLTrigReport.h.

Referenced by dumpReport(), HLTrigReport(), reset(), and streamNames().