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

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
const std::vector< unsigned int > & datasetCounts () const
 
const std::vector< std::string > & datasetNames () const
 
void endJob () override
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
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 () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks >
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) 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

See header file for documentation

Author
Martin Grunewald

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

Author
Martin Grunewald

Definition at line 31 of file HLTrigReport.h.

Member Enumeration Documentation

Enumerator
NEVER 
EVERY_EVENT 
EVERY_LUMI 
EVERY_RUN 
EVERY_JOB 

Definition at line 33 of file HLTrigReport.h.

Constructor & Destructor Documentation

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

Definition at line 48 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().

48  :
49  hlTriggerResults_(iConfig.getParameter<edm::InputTag> ("HLTriggerResults")),
50  hlTriggerResultsToken_(consumes<edm::TriggerResults>(hlTriggerResults_)),
51  configured_(false),
52  nEvents_(0),
53  nWasRun_(0),
54  nAccept_(0),
55  nErrors_(0),
56  hlWasRun_(0),
57  hltL1s_(0),
58  hltPre_(0),
59  hlAccept_(0),
60  hlAccTot_(0),
61  hlErrors_(0),
62  posL1s_(0),
63  posPre_(0),
64  hlNames_(0),
65  hlIndex_(0),
66  hlAccTotDS_(0),
67  datasetNames_(0),
69  isCustomDatasets_(false),
70  dsIndex_(0),
71  dsAccTotS_(0),
72  streamNames_(0),
73  streamContents_(0),
74  isCustomStreams_(false),
75  refPath_("HLTriggerFinalPath"),
76  refIndex_(0),
77  refRate_(100.0),
78  reportBy_( decode(iConfig.getUntrackedParameter<std::string>("reportBy", "job")) ),
79  resetBy_( decode(iConfig.getUntrackedParameter<std::string>("resetBy", "never")) ),
80  serviceBy_(decode(iConfig.getUntrackedParameter<std::string>("serviceBy", "never")) ),
81  hltConfig_()
82 {
83  const edm::ParameterSet customDatasets(iConfig.getUntrackedParameter<edm::ParameterSet>("CustomDatasets", edm::ParameterSet()));
84  isCustomDatasets_ = (customDatasets != edm::ParameterSet());
85  if (isCustomDatasets_) {
86  datasetNames_ = customDatasets.getParameterNamesForType<std::vector<std::string> >();
87  for (std::vector<std::string>::const_iterator name = datasetNames_.begin(); name != datasetNames_.end(); name++) {
88  datasetContents_.push_back(customDatasets.getParameter<std::vector<std::string> >(*name));
89  }
90  }
91 
92  const edm::ParameterSet customStreams (iConfig.getUntrackedParameter<edm::ParameterSet>("CustomStreams" , edm::ParameterSet()));
93  isCustomStreams_ = (customStreams != edm::ParameterSet());
94  if (isCustomStreams_ ) {
95  streamNames_ = customStreams.getParameterNamesForType<std::vector<std::string> >();
96  for (std::vector<std::string>::const_iterator name = streamNames_.begin(); name != streamNames_.end(); name++) {
97  streamContents_.push_back(customStreams.getParameter<std::vector<std::string> >(*name));
98  }
99  }
100 
101  refPath_ = iConfig.getUntrackedParameter<std::string>("ReferencePath","HLTriggerFinalPath");
102  refRate_ = iConfig.getUntrackedParameter<double>("ReferenceRate", 100.0);
103  refIndex_= 0;
104 
105  LogDebug("HLTrigReport")
106  << "HL TiggerResults: " + hlTriggerResults_.encode()
107  << " using reference path and rate: " + refPath_ + " " << refRate_;
108 
110  edm::Service<HLTrigReportService>()->registerModule(this);
111  }
112 
113 }
#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
bool isCustomDatasets_
Definition: HLTrigReport.h:96
std::vector< unsigned int > hlAccTot_
Definition: HLTrigReport.h:84
std::vector< std::string > hlNames_
Definition: HLTrigReport.h:89
const ReportEvery resetBy_
Definition: HLTrigReport.h:108
const ReportEvery reportBy_
Definition: HLTrigReport.h:107
std::vector< std::vector< unsigned int > > hlAccTotDS_
Definition: HLTrigReport.h:92
unsigned int nWasRun_
Definition: HLTrigReport.h:76
std::vector< std::string > datasetNames_
Definition: HLTrigReport.h:94
double refRate_
Definition: HLTrigReport.h:105
static ReportEvery decode(const std::string &value)
Definition: HLTrigReport.cc:25
std::string encode() const
Definition: InputTag.cc:166
edm::EDGetTokenT< edm::TriggerResults > hlTriggerResultsToken_
Definition: HLTrigReport.h:72
std::vector< int > posL1s_
Definition: HLTrigReport.h:87
std::vector< int > posPre_
Definition: HLTrigReport.h:88
std::vector< unsigned int > hltL1s_
Definition: HLTrigReport.h:81
std::vector< std::string > streamNames_
Definition: HLTrigReport.h:100
unsigned int nAccept_
Definition: HLTrigReport.h:77
unsigned int refIndex_
Definition: HLTrigReport.h:104
std::vector< unsigned int > hlWasRun_
Definition: HLTrigReport.h:80
bool configured_
Definition: HLTrigReport.h:73
std::string refPath_
Definition: HLTrigReport.h:103
HLTConfigProvider hltConfig_
Definition: HLTrigReport.h:110
std::vector< std::vector< std::string > > streamContents_
Definition: HLTrigReport.h:101
unsigned int nEvents_
Definition: HLTrigReport.h:75
std::vector< unsigned int > hltPre_
Definition: HLTrigReport.h:82
unsigned int nErrors_
Definition: HLTrigReport.h:78
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
edm::InputTag hlTriggerResults_
Definition: HLTrigReport.h:71
const ReportEvery serviceBy_
Definition: HLTrigReport.h:109
std::vector< std::vector< unsigned int > > dsIndex_
Definition: HLTrigReport.h:97
HLTrigReport::~HLTrigReport ( )
overridedefault

Referenced by HLTrigReport().

Member Function Documentation

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

Definition at line 385 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(), 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().

386 {
387  // accumulation of statistics event by event
388 
389  using namespace std;
390  using namespace edm;
391 
392  if (resetBy_ == EVERY_EVENT) reset();
393 
394  nEvents_++;
395 
396  // get hold of TriggerResults
398  iEvent.getByToken(hlTriggerResultsToken_, HLTR);
399  if (HLTR.isValid()) {
400  if (HLTR->wasrun()) nWasRun_++;
401  const bool accept(HLTR->accept());
402  LogDebug("HLTrigReport") << "HLT TriggerResults decision: " << accept;
403  if (accept) ++nAccept_;
404  if (HLTR->error()) nErrors_++;
405  } else {
406  LogDebug("HLTrigReport") << "HLT TriggerResults with label ["+hlTriggerResults_.encode()+"] not found!";
407  nErrors_++;
408  return;
409  }
410 
411  // HLTConfigProvider not configured - cannot produce any detailed statistics
412  if (not configured_)
413  return;
414 
415  // decision for each HL algorithm
416  const unsigned int n(hlNames_.size());
417  bool acceptedByPrevoiusPaths = false;
418  for (unsigned int i=0; i!=n; ++i) {
419  if (HLTR->wasrun(i)) hlWasRun_[i]++;
420  if (HLTR->accept(i)) {
421  acceptedByPrevoiusPaths = true;
422  hlAccept_[i]++;
423  }
424  if (acceptedByPrevoiusPaths) hlAccTot_[i]++;
425  if (HLTR->error(i) ) hlErrors_[i]++;
426  const int index(static_cast<int>(HLTR->index(i)));
427  if (HLTR->accept(i)) {
428  if (index >= posL1s_[i]) hltL1s_[i]++;
429  if (index >= posPre_[i]) hltPre_[i]++;
430  } else {
431  if (index > posL1s_[i]) hltL1s_[i]++;
432  if (index > posPre_[i]) hltPre_[i]++;
433  }
434  }
435 
436  // calculate accumulation of accepted events by a path within a dataset
437  std::vector<bool> acceptedByDS(hlIndex_.size(), false);
438  for (size_t ds=0; ds<hlIndex_.size(); ++ds) {
439  for (size_t p=0; p<hlIndex_[ds].size(); ++p) {
440  if (acceptedByDS[ds] or HLTR->accept(hlIndex_[ds][p])) {
441  acceptedByDS[ds] = true;
442  hlAccTotDS_[ds][p]++;
443  }
444  }
445  if (acceptedByDS[ds]) hlAllTotDS_[ds]++;
446  }
447 
448  // calculate accumulation of accepted events by a dataset within a stream
449  for (size_t s=0; s<dsIndex_.size(); ++s) {
450  bool acceptedByS = false;
451  for (size_t ds=0; ds<dsIndex_[s].size(); ++ds) {
452  if (acceptedByS or acceptedByDS[dsIndex_[s][ds]]) {
453  acceptedByS = true;
454  dsAccTotS_[s][ds]++;
455  }
456  }
457  if (acceptedByS) dsAllTotS_[s]++;
458  }
459 
460  if (reportBy_ == EVERY_EVENT) {
461  std::stringstream stream;
462  stream << "Summary for Run " << iEvent.run() << ", LumiSection " << iEvent.luminosityBlock() << ", Event " << iEvent.id();
463  dumpReport(stream.str());
464  }
466  edm::Service<HLTrigReportService>()->setDatasetCounts(datasetCounts());
467  edm::Service<HLTrigReportService>()->setStreamCounts(streamCounts());
468  }
469 
470 }
#define LogDebug(id)
std::vector< unsigned int > hlErrors_
Definition: HLTrigReport.h:85
bool wasrun() const
Was at least one path run?
std::vector< unsigned int > hlAccTot_
Definition: HLTrigReport.h:84
std::vector< std::string > hlNames_
Definition: HLTrigReport.h:89
const ReportEvery resetBy_
Definition: HLTrigReport.h:108
const ReportEvery reportBy_
Definition: HLTrigReport.h:107
std::vector< unsigned int > dsAllTotS_
Definition: HLTrigReport.h:99
const std::vector< unsigned int > & streamCounts() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
std::vector< std::vector< unsigned int > > hlAccTotDS_
Definition: HLTrigReport.h:92
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:76
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:166
edm::EDGetTokenT< edm::TriggerResults > hlTriggerResultsToken_
Definition: HLTrigReport.h:72
std::vector< int > posL1s_
Definition: HLTrigReport.h:87
std::vector< int > posPre_
Definition: HLTrigReport.h:88
std::vector< unsigned int > hltL1s_
Definition: HLTrigReport.h:81
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:109
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:77
std::vector< unsigned int > hlWasRun_
Definition: HLTrigReport.h:80
bool configured_
Definition: HLTrigReport.h:73
std::vector< unsigned int > hlAllTotDS_
Definition: HLTrigReport.h:93
const std::vector< unsigned int > & datasetCounts() const
unsigned int nEvents_
Definition: HLTrigReport.h:75
std::vector< unsigned int > hltPre_
Definition: HLTrigReport.h:82
unsigned int nErrors_
Definition: HLTrigReport.h:78
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:91
std::vector< unsigned int > hlAccept_
Definition: HLTrigReport.h:83
std::vector< std::vector< unsigned int > > dsAccTotS_
Definition: HLTrigReport.h:98
edm::InputTag hlTriggerResults_
Definition: HLTrigReport.h:71
const ReportEvery serviceBy_
Definition: HLTrigReport.h:109
std::vector< std::vector< unsigned int > > dsIndex_
Definition: HLTrigReport.h:97
void HLTrigReport::beginJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 300 of file HLTrigReport.cc.

References EVERY_JOB, reset(), and resetBy_.

300  {
301  if (resetBy_ == EVERY_JOB)
302  reset();
303 }
const ReportEvery resetBy_
Definition: HLTrigReport.h:108
void reset(bool changed=false)
void HLTrigReport::beginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  setup 
)
override

Definition at line 366 of file HLTrigReport.cc.

References EVERY_LUMI, reset(), and resetBy_.

366  {
367  if (resetBy_ == EVERY_LUMI) reset();
368 }
const ReportEvery resetBy_
Definition: HLTrigReport.h:108
void reset(bool changed=false)
void HLTrigReport::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
override

Definition at line 316 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_.

317 {
318  bool changed = true;
319  if (hltConfig_.init(iRun, iSetup, hlTriggerResults_.process(), changed)) {
320  configured_ = true;
321  if (changed) {
322  dumpReport("Summary for this HLT table");
323  reset(true);
324  }
325  } else {
326  dumpReport("Summary for this HLT table");
327  // cannot initialize the HLT menu - reset and clear all counters and tables
328  configured_ = false;
329  nEvents_ = 0;
330  nWasRun_ = 0;
331  nAccept_ = 0;
332  nErrors_ = 0;
333  hlWasRun_.clear();
334  hltL1s_.clear();
335  hltPre_.clear();
336  hlAccept_.clear();
337  hlAccTot_.clear();
338  hlErrors_.clear();
339  posL1s_.clear();
340  posPre_.clear();
341  hlNames_.clear();
342  hlIndex_.clear();
343  hlAccTotDS_.clear();
344  hlAllTotDS_.clear();
345  dsIndex_.clear();
346  dsAccTotS_.clear();
347  dsAllTotS_.clear();
348  }
349 
350  if (resetBy_ == EVERY_RUN) reset();
351 
352 }
std::vector< unsigned int > hlErrors_
Definition: HLTrigReport.h:85
std::vector< unsigned int > hlAccTot_
Definition: HLTrigReport.h:84
std::vector< std::string > hlNames_
Definition: HLTrigReport.h:89
const ReportEvery resetBy_
Definition: HLTrigReport.h:108
std::vector< unsigned int > dsAllTotS_
Definition: HLTrigReport.h:99
std::vector< std::vector< unsigned int > > hlAccTotDS_
Definition: HLTrigReport.h:92
unsigned int nWasRun_
Definition: HLTrigReport.h:76
std::vector< int > posL1s_
Definition: HLTrigReport.h:87
std::vector< int > posPre_
Definition: HLTrigReport.h:88
std::vector< unsigned int > hltL1s_
Definition: HLTrigReport.h:81
void dumpReport(std::string const &header=std::string())
unsigned int nAccept_
Definition: HLTrigReport.h:77
std::vector< unsigned int > hlWasRun_
Definition: HLTrigReport.h:80
bool configured_
Definition: HLTrigReport.h:73
HLTConfigProvider hltConfig_
Definition: HLTrigReport.h:110
std::vector< unsigned int > hlAllTotDS_
Definition: HLTrigReport.h:93
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:75
std::vector< unsigned int > hltPre_
Definition: HLTrigReport.h:82
std::string const & process() const
Definition: InputTag.h:40
unsigned int nErrors_
Definition: HLTrigReport.h:78
void reset(bool changed=false)
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
edm::InputTag hlTriggerResults_
Definition: HLTrigReport.h:71
std::vector< std::vector< unsigned int > > dsIndex_
Definition: HLTrigReport.h:97
const std::vector< unsigned int > & HLTrigReport::datasetCounts ( ) const

Definition at line 145 of file HLTrigReport.cc.

References hlAllTotDS_.

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

145  {
146  return hlAllTotDS_;
147 }
std::vector< unsigned int > hlAllTotDS_
Definition: HLTrigReport.h:93
const std::vector< std::string > & HLTrigReport::datasetNames ( ) const

Definition at line 139 of file HLTrigReport.cc.

References datasetNames_.

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

Definition at line 25 of file HLTrigReport.cc.

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

25  {
26  if (value == "never")
27  return NEVER;
28 
29  if (value == "job")
30  return EVERY_JOB;
31 
32  if (value == "run")
33  return EVERY_RUN;
34 
35  if (value == "lumi")
36  return EVERY_LUMI;
37 
38  if (value == "event")
39  return EVERY_EVENT;
40 
41  throw cms::Exception("Configuration") << "Invalid option value \"" << value << "\". Legal values are \"job\", \"run\", \"lumi\", \"event\" and \"never\".";
42 }
Definition: value.py:1
void HLTrigReport::dumpReport ( std::string const &  header = std::string())
private

Definition at line 473 of file HLTrigReport.cc.

References alpha, configured_, datasetNames_, TauDecayModes::dec, DEFINE_FWK_MODULE, dsAccTotS_, dsAllTotS_, dsIndex_, alignBH_cfg::fixed, hlAccept_, hlAccTot_, hlAccTotDS_, hlAllTotDS_, hlErrors_, hlIndex_, hlNames_, hltL1s_, hltPre_, hlWasRun_, mps_fire::i, SiStripPI::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().

474 {
475  // final printout of accumulated statistics
476 
477  using namespace std;
478  using namespace edm;
479  const unsigned int n(hlNames_.size());
480 
481  if ((n==0) and (nEvents_==0)) return;
482 
483  LogVerbatim("HLTrigReport") << dec << endl;
484  LogVerbatim("HLTrigReport") << "HLT-Report " << "---------- Event Summary ------------" << endl;
485  if (not header.empty())
486  LogVerbatim("HLTrigReport") << "HLT-Report " << header << endl;
487  LogVerbatim("HLTrigReport") << "HLT-Report"
488  << " Events total = " << nEvents_
489  << " wasrun = " << nWasRun_
490  << " passed = " << nAccept_
491  << " errors = " << nErrors_
492  << endl;
493 
494  // HLTConfigProvider not configured - cannot produce any detailed statistics
495  if (not configured_)
496  return;
497 
498  double scale = hlAccept_[refIndex_]>0 ? refRate_/hlAccept_[refIndex_] : 0.;
499  double alpha = 1 - (1.0 - .6854)/2; // for the Clopper-Pearson 68% CI
500 
501  LogVerbatim("HLTrigReport") << endl;
502  LogVerbatim("HLTrigReport") << "HLT-Report " << "---------- HLTrig Summary ------------" << endl;
503  LogVerbatim("HLTrigReport") << "HLT-Report "
504  << right << setw(7) << "HLT #" << " "
505  << right << setw(7) << "WasRun" << " "
506  << right << setw(7) << "L1S" << " "
507  << right << setw(7) << "Pre" << " "
508  << right << setw(7) << "HLT" << " "
509  << right << setw(9) << "%L1sPre" << " "
510  << right << setw(7) << "Rate" << " "
511  << right << setw(7) << "RateHi" << " "
512  << right << setw(7) << "Errors" << " "
513  << "Name" << endl;
514 
515  if (n>0) {
516  for (unsigned int i=0; i!=n; ++i) {
517  LogVerbatim("HLTrigReport") << "HLT-Report "
518  << right << setw(7) << i << " "
519  << right << setw(7) << hlWasRun_[i] << " "
520  << right << setw(7) << hltL1s_[i] << " "
521  << right << setw(7) << hltPre_[i] << " "
522  << right << setw(7) << hlAccept_[i] << " "
523  << right << setw(9) << fixed << setprecision(5)
524  << static_cast<float>(100*hlAccept_[i])/
525  static_cast<float>(max(hltPre_[i], 1u)) << " "
526  << right << setw(7) << fixed << setprecision(1) << scale*hlAccept_[i] << " "
527  << right << setw(7) << fixed << setprecision(1) <<
528  ((hlAccept_[refIndex_]-hlAccept_[i] > 0) ? refRate_*ROOT::Math::beta_quantile(alpha, hlAccept_[i]+1, hlAccept_[refIndex_]-hlAccept_[i]) : 0) << " "
529  << right << setw(7) << hlErrors_[i] << " "
530  << hlNames_[i] << endl;
531  }
532  }
533 
534  LogVerbatim("HLTrigRprtTt") << endl;
535  LogVerbatim("HLTrigRprtTt") << "HLT-Report " << "---------- HLTrig Summary ------------" << endl;
536  LogVerbatim("HLTrigRprtTt") << "HLT-Report "
537  << right << setw(7) << "HLT #" << " "
538  << right << setw(7) << "WasRun" << " "
539  << right << setw(7) << "L1S" << " "
540  << right << setw(7) << "Pre" << " "
541  << right << setw(7) << "HLT" << " "
542  << right << setw(9) << "%L1sPre" << " "
543  << right << setw(7) << "Rate" << " "
544  << right << setw(7) << "RateHi" << " "
545  << right << setw(7) << "HLTtot" << " "
546  << right << setw(7) << "RateTot" << " "
547  << right << setw(7) << "Errors" << " "
548  << "Name" << endl;
549 
550  if (n>0) {
551  for (unsigned int i=0; i!=n; ++i) {
552  LogVerbatim("HLTrigRprtTt") << "HLT-Report "
553  << right << setw(7) << i << " "
554  << right << setw(7) << hlWasRun_[i] << " "
555  << right << setw(7) << hltL1s_[i] << " "
556  << right << setw(7) << hltPre_[i] << " "
557  << right << setw(7) << hlAccept_[i] << " "
558  << right << setw(9) << fixed << setprecision(5)
559  << static_cast<float>(100*hlAccept_[i])/
560  static_cast<float>(max(hltPre_[i], 1u)) << " "
561  << right << setw(7) << fixed << setprecision(1) << scale*hlAccept_[i] << " "
562  << right << setw(7) << fixed << setprecision(1) <<
563  ((hlAccept_[refIndex_]-hlAccept_[i] > 0) ? refRate_*ROOT::Math::beta_quantile(alpha, hlAccept_[i]+1, hlAccept_[refIndex_]-hlAccept_[i]) : 0) << " "
564  << right << setw(7) << hlAccTot_[i] << " "
565  << right << setw(7) << fixed << setprecision(1) << scale*hlAccTot_[i] << " "
566  << right << setw(7) << hlErrors_[i] << " "
567  << hlNames_[i] << endl;
568  }
569 
570  // now for each dataset
571  for (size_t ds=0; ds<hlIndex_.size(); ++ds) {
572  LogVerbatim("HLTrigRprtPD") << endl;
573  LogVerbatim("HLTrigRprtPD") << "HLT-Report " << "---------- Dataset Summary: " << datasetNames_[ds] << " ------------" << hlAllTotDS_[ds] << endl;
574  LogVerbatim("HLTrigRprtPD") << "HLT-Report "
575  << right << setw(7) << "HLT #" << " "
576  << right << setw(7) << "WasRun" << " "
577  << right << setw(7) << "L1S" << " "
578  << right << setw(7) << "Pre" << " "
579  << right << setw(7) << "HLT" << " "
580  << right << setw(9) << "%L1sPre" << " "
581  << right << setw(7) << "Rate" << " "
582  << right << setw(7) << "RateHi" << " "
583  << right << setw(7) << "HLTtot" << " "
584  << right << setw(7) << "RateTot" << " "
585  << right << setw(7) << "Errors" << " "
586  << "Name" << endl;
587  for (size_t p=0; p<hlIndex_[ds].size(); ++p) {
588  LogVerbatim("HLTrigRprtPD") << "HLT-Report "
589  << right << setw(7) << p << " "
590  << right << setw(7) << hlWasRun_[hlIndex_[ds][p]] << " "
591  << right << setw(7) << hltL1s_[hlIndex_[ds][p]] << " "
592  << right << setw(7) << hltPre_[hlIndex_[ds][p]] << " "
593  << right << setw(7) << hlAccept_[hlIndex_[ds][p]] << " "
594  << right << setw(9) << fixed << setprecision(5)
595  << static_cast<float>(100*hlAccept_[hlIndex_[ds][p]])/
596  static_cast<float>(max(hltPre_[hlIndex_[ds][p]], 1u)) << " "
597  << right << setw(7) << fixed << setprecision(1) << scale*hlAccept_[hlIndex_[ds][p]] << " "
598  << right << setw(7) << fixed << setprecision(1) <<
599  ((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) << " "
600  << right << setw(7) << hlAccTotDS_[ds][p] << " "
601  << right << setw(7) << fixed << setprecision(1) << scale*hlAccTotDS_[ds][p] << " "
602  << right << setw(7) << hlErrors_[hlIndex_[ds][p]] << " "
603  << hlNames_[hlIndex_[ds][p]] << endl;
604  }
605  }
606 
607  // now for each stream
608  for (size_t s=0; s<dsIndex_.size(); ++s) {
609  LogVerbatim("HLTrigRprtST") << endl;
610  LogVerbatim("HLTrigRprtST") << "HLT-Report " << "---------- Stream Summary: " << streamNames_[s] << " ------------" << dsAllTotS_[s] << endl;
611  LogVerbatim("HLTrigRprtST") << "HLT-Report "
612  << right << setw(10) << "Dataset #" << " "
613  << right << setw(10) << "Individual" << " "
614  << right << setw(10) << "Total" << " "
615  << right << setw(10) << "Rate" << " "
616  << right << setw(10) << "RateHi" << " "
617  << right << setw(10) << "RateTot" << " "
618  << "Name" << endl;
619  for (size_t ds=0;ds<dsIndex_[s].size(); ++ds) {
620  unsigned int acceptedDS = hlAccTotDS_[dsIndex_[s][ds]][hlIndex_[dsIndex_[s][ds]].size()-1];
621  LogVerbatim("HLTrigRprtST") << "HLT-Report "
622  << right << setw(10) << ds << " "
623  << right << setw(10) << acceptedDS << " "
624  << right << setw(10) << dsAccTotS_[s][ds] << " "
625  << right << setw(10) << fixed << setprecision(1) << scale*acceptedDS << " "
626  << right << setw(10) << fixed << setprecision(1) <<
627  ((hlAccept_[refIndex_]-acceptedDS > 0) ? refRate_*ROOT::Math::beta_quantile(alpha, acceptedDS+1, hlAccept_[refIndex_]-acceptedDS) : 0) << " "
628  << right << setw(10) << fixed << setprecision(1) << scale*dsAccTotS_[s][ds] << " "
629  << datasetNames_[dsIndex_[s][ds]] << endl;
630  }
631  }
632 
633  } else {
634  LogVerbatim("HLTrigReport") << "HLT-Report - No HLT paths found!" << endl;
635  }
636 
637  LogVerbatim("HLTrigReport") << endl;
638  LogVerbatim("HLTrigReport") << "HLT-Report end!" << endl;
639  LogVerbatim("HLTrigReport") << endl;
640 
641  return;
642 }
std::vector< unsigned int > hlErrors_
Definition: HLTrigReport.h:85
float alpha
Definition: AMPTWrapper.h:95
std::vector< unsigned int > hlAccTot_
Definition: HLTrigReport.h:84
std::vector< std::string > hlNames_
Definition: HLTrigReport.h:89
std::vector< unsigned int > dsAllTotS_
Definition: HLTrigReport.h:99
std::vector< std::vector< unsigned int > > hlAccTotDS_
Definition: HLTrigReport.h:92
unsigned int nWasRun_
Definition: HLTrigReport.h:76
std::vector< std::string > datasetNames_
Definition: HLTrigReport.h:94
double refRate_
Definition: HLTrigReport.h:105
std::vector< unsigned int > hltL1s_
Definition: HLTrigReport.h:81
std::vector< std::string > streamNames_
Definition: HLTrigReport.h:100
unsigned int nAccept_
Definition: HLTrigReport.h:77
unsigned int refIndex_
Definition: HLTrigReport.h:104
std::vector< unsigned int > hlWasRun_
Definition: HLTrigReport.h:80
bool configured_
Definition: HLTrigReport.h:73
std::vector< unsigned int > hlAllTotDS_
Definition: HLTrigReport.h:93
unsigned int nEvents_
Definition: HLTrigReport.h:75
std::vector< unsigned int > hltPre_
Definition: HLTrigReport.h:82
unsigned int nErrors_
Definition: HLTrigReport.h:78
HLT enums.
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
std::vector< std::vector< unsigned int > > dsIndex_
Definition: HLTrigReport.h:97
void HLTrigReport::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 305 of file HLTrigReport.cc.

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

305  {
306  if (reportBy_ == EVERY_JOB)
307  dumpReport("Summary for Job");
309  edm::Service<HLTrigReportService>()->setDatasetCounts(datasetCounts());
310  edm::Service<HLTrigReportService>()->setStreamCounts(streamCounts());
311  }
312 
313 }
const ReportEvery reportBy_
Definition: HLTrigReport.h:107
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:109
void HLTrigReport::endLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  setup 
)
override

Definition at line 370 of file HLTrigReport.cc.

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

370  {
371  if (reportBy_ == EVERY_LUMI) {
372  std::stringstream stream;
373  stream << "Summary for Run " << lumi.run() << ", LumiSection " << lumi.luminosityBlock();
374  dumpReport(stream.str());
375  }
377  edm::Service<HLTrigReportService>()->setDatasetCounts(datasetCounts());
378  edm::Service<HLTrigReportService>()->setStreamCounts(streamCounts());
379  }
380 }
const ReportEvery reportBy_
Definition: HLTrigReport.h:107
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:109
void HLTrigReport::endRun ( edm::Run const &  run,
edm::EventSetup const &  setup 
)
override

Definition at line 354 of file HLTrigReport.cc.

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

354  {
355  if (reportBy_ == EVERY_RUN) {
356  std::stringstream stream;
357  stream << "Summary for Run " << run.run();
358  dumpReport(stream.str());
359  }
361  edm::Service<HLTrigReportService>()->setDatasetCounts(datasetCounts());
362  edm::Service<HLTrigReportService>()->setStreamCounts(streamCounts());
363  }
364 }
const ReportEvery reportBy_
Definition: HLTrigReport.h:107
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:109
void HLTrigReport::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 118 of file HLTrigReport.cc.

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

118  {
120  desc.add<edm::InputTag>("HLTriggerResults",edm::InputTag("TriggerResults","","HLT"));
121  desc.addUntracked<std::string>("reportBy","job");
122  desc.addUntracked<std::string>("resetBy","never");
123  desc.addUntracked<std::string>("serviceBy","never");
124 
125  edm::ParameterSetDescription customDatasetsParameters;
126  desc.addUntracked<edm::ParameterSetDescription>("CustomDatasets" ,customDatasetsParameters);
127  edm::ParameterSetDescription customStreamsParameters;
128  desc.addUntracked<edm::ParameterSetDescription>("CustomStreams" ,customStreamsParameters);
129  desc.addUntracked<std::string>("ReferencePath","HLTriggerFinalPath");
130  desc.addUntracked<double>("ReferenceRate",100.0);
131 
132  descriptions.add("hltTrigReport",desc);
133 }
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 152 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().

152  {
153 
154  // reset global counters
155  nEvents_ = 0;
156  nWasRun_ = 0;
157  nAccept_ = 0;
158  nErrors_ = 0;
159 
160  // update trigger names
161  if (changed)
163 
164  const unsigned int n = hlNames_.size();
165 
166  if (changed) {
167  // resize per-path counters
168  hlWasRun_.resize(n);
169  hltL1s_.resize(n);
170  hltPre_.resize(n);
171  hlAccept_.resize(n);
172  hlAccTot_.resize(n);
173  hlErrors_.resize(n);
174  // find the positions of seeding and prescaler modules
175  posL1s_.resize(n);
176  posPre_.resize(n);
177  for (unsigned int i = 0; i < n; ++i) {
178  posL1s_[i] = -1;
179  posPre_[i] = -1;
180  const std::vector<std::string> & moduleLabels(hltConfig_.moduleLabels(i));
181  for (unsigned int j = 0; j < moduleLabels.size(); ++j) {
182  const std::string & label = hltConfig_.moduleType(moduleLabels[j]);
183  if (label == "HLTLevel1GTSeed")
184  posL1s_[i] = j;
185  else if (label == "HLTPrescaler")
186  posPre_[i] = j;
187  }
188  }
189  }
190 
191  // reset per-path counters
192  for (unsigned int i = 0; i < n; ++i) {
193  hlWasRun_[i] = 0;
194  hltL1s_[i] = 0;
195  hltPre_[i] = 0;
196  hlAccept_[i] = 0;
197  hlAccTot_[i] = 0;
198  hlErrors_[i] = 0;
199  }
200 
201  // if not overridden, reload the datasets and streams
202  if (changed and not isCustomDatasets_) {
205  }
206  if (changed and not isCustomStreams_) {
209  }
210 
211  if (changed) {
212  // fill the matrices of hlIndex_, hlAccTotDS_
213  hlIndex_.clear();
214  hlIndex_.resize(datasetNames_.size());
215  hlAccTotDS_.clear();
216  hlAllTotDS_.clear();
217  hlAccTotDS_.resize(datasetNames_.size());
218  hlAllTotDS_.resize(datasetNames_.size());
219  for (unsigned int ds = 0; ds < datasetNames_.size(); ds++) {
220  unsigned int size = datasetContents_[ds].size();
221  hlIndex_[ds].reserve(size);
222  hlAccTotDS_[ds].reserve(size);
223  hlAllTotDS_[ds]=0;
224  for (unsigned int p = 0; p < size; ++p) {
225  unsigned int i = hltConfig_.triggerIndex(datasetContents_[ds][p]);
226  if (i<n) {
227  hlIndex_[ds].push_back(i);
228  hlAccTotDS_[ds].push_back(0);
229  }
230  }
231  }
232  } else {
233  // reset the matrix of hlAccTotDS_
234  for (unsigned int ds = 0; ds < datasetNames_.size(); ds++) {
235  hlAllTotDS_[ds]=0;
236  for (unsigned int & i : hlAccTotDS_[ds])
237  i = 0;
238  }
239  }
240 
241  if (changed) {
242  // fill the matrices of dsIndex_, dsAccTotS_
243  dsIndex_.clear();
244  dsIndex_.resize(streamNames_.size());
245  dsAccTotS_.clear();
246  dsAllTotS_.clear();
247  dsAccTotS_.resize(streamNames_.size());
248  dsAllTotS_.resize(streamNames_.size());
249  for (unsigned int s = 0; s < streamNames_.size(); ++s) {
250  unsigned int size = streamContents_[s].size();
251  dsIndex_.reserve(size);
252  dsAccTotS_.reserve(size);
253  dsAllTotS_[s]=0;
254  for (unsigned int ds = 0; ds < size; ++ds) {
255  unsigned int i = 0;
256  for (; i<datasetNames_.size(); i++) if (datasetNames_[i] == streamContents_[s][ds])
257  break;
258  // report only datasets that have at least one path otherwise crash
259  if (i < datasetNames_.size() and !hlIndex_[i].empty()) {
260  dsIndex_[s].push_back(i);
261  dsAccTotS_[s].push_back(0);
262  }
263  }
264  }
265  } else {
266  // reset the matrix of dsAccTotS_
267  for (unsigned int s = 0; s < streamNames_.size(); ++s) {
268  dsAllTotS_[s]=0;
269  for (unsigned int & i : dsAccTotS_[s])
270  i = 0;
271  }
272  }
273 
274  // if needed, update the reference path
275  if (changed) {
277  if (refIndex_ >= n) {
278  refIndex_ = 0;
279  edm::LogWarning("HLTrigReport")
280  << "Requested reference path '"+refPath_+"' not in HLT menu. "
281  << "Using HLTriggerFinalPath instead.";
282  refPath_ = "HLTriggerFinalPath";
284  if (refIndex_ >= n) {
285  refIndex_ = 0;
286  edm::LogWarning("HLTrigReport")
287  << "Requested reference path '"+refPath_+"' not in HLT menu. "
288  << "Using first path in table (index=0) instead.";
289  }
290  }
291  }
292 
293  if (changed and serviceBy_ != NEVER and edm::Service<HLTrigReportService>()) {
296  }
297 
298 }
std::vector< unsigned int > hlErrors_
Definition: HLTrigReport.h:85
size
Write out results.
std::vector< std::vector< std::string > > datasetContents_
Definition: HLTrigReport.h:95
bool isCustomStreams_
Definition: HLTrigReport.h:102
bool isCustomDatasets_
Definition: HLTrigReport.h:96
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
std::vector< unsigned int > dsAllTotS_
Definition: HLTrigReport.h:99
std::vector< std::vector< unsigned int > > hlAccTotDS_
Definition: HLTrigReport.h:92
const std::vector< std::string > & triggerNames() const
names of trigger paths
unsigned int nWasRun_
Definition: HLTrigReport.h:76
std::vector< std::string > datasetNames_
Definition: HLTrigReport.h:94
std::vector< int > posL1s_
Definition: HLTrigReport.h:87
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
const std::vector< std::string > & streamNames() const
std::vector< std::string > streamNames_
Definition: HLTrigReport.h:100
unsigned int nAccept_
Definition: HLTrigReport.h:77
unsigned int refIndex_
Definition: HLTrigReport.h:104
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
std::string refPath_
Definition: HLTrigReport.h:103
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
unsigned int nEvents_
Definition: HLTrigReport.h:75
std::vector< unsigned int > hltPre_
Definition: HLTrigReport.h:82
unsigned int nErrors_
Definition: HLTrigReport.h:78
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:91
std::vector< unsigned int > hlAccept_
Definition: HLTrigReport.h:83
std::vector< std::vector< unsigned int > > dsAccTotS_
Definition: HLTrigReport.h:98
const ReportEvery serviceBy_
Definition: HLTrigReport.h:109
std::vector< std::vector< unsigned int > > dsIndex_
Definition: HLTrigReport.h:97
const std::vector< std::string > & datasetNames() const
const std::vector< unsigned int > & HLTrigReport::streamCounts ( ) const

Definition at line 148 of file HLTrigReport.cc.

References dsAllTotS_.

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

148  {
149  return dsAllTotS_;
150 }
std::vector< unsigned int > dsAllTotS_
Definition: HLTrigReport.h:99
const std::vector< std::string > & HLTrigReport::streamNames ( ) const

Definition at line 142 of file HLTrigReport.cc.

References streamNames_.

142  {
143  return streamNames_;
144 }
std::vector< std::string > streamNames_
Definition: HLTrigReport.h:100

Member Data Documentation

bool HLTrigReport::configured_
private

Definition at line 73 of file HLTrigReport.h.

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

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

Definition at line 95 of file HLTrigReport.h.

Referenced by HLTrigReport(), and reset().

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

Definition at line 94 of file HLTrigReport.h.

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

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

Definition at line 98 of file HLTrigReport.h.

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

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

Definition at line 99 of file HLTrigReport.h.

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

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

Definition at line 97 of file HLTrigReport.h.

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

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

Definition at line 83 of file HLTrigReport.h.

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

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

Definition at line 84 of file HLTrigReport.h.

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

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

Definition at line 92 of file HLTrigReport.h.

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

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

Definition at line 93 of file HLTrigReport.h.

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

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

Definition at line 85 of file HLTrigReport.h.

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

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

Definition at line 91 of file HLTrigReport.h.

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

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

Definition at line 89 of file HLTrigReport.h.

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

HLTConfigProvider HLTrigReport::hltConfig_
private

Definition at line 110 of file HLTrigReport.h.

Referenced by beginRun(), and reset().

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

Definition at line 81 of file HLTrigReport.h.

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

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

Definition at line 82 of file HLTrigReport.h.

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

edm::InputTag HLTrigReport::hlTriggerResults_
private

Definition at line 71 of file HLTrigReport.h.

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

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

Definition at line 72 of file HLTrigReport.h.

Referenced by analyze().

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

Definition at line 80 of file HLTrigReport.h.

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

bool HLTrigReport::isCustomDatasets_
private

Definition at line 96 of file HLTrigReport.h.

Referenced by HLTrigReport(), and reset().

bool HLTrigReport::isCustomStreams_
private

Definition at line 102 of file HLTrigReport.h.

Referenced by HLTrigReport(), and reset().

unsigned int HLTrigReport::nAccept_
private

Definition at line 77 of file HLTrigReport.h.

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

unsigned int HLTrigReport::nErrors_
private

Definition at line 78 of file HLTrigReport.h.

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

unsigned int HLTrigReport::nEvents_
private

Definition at line 75 of file HLTrigReport.h.

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

unsigned int HLTrigReport::nWasRun_
private

Definition at line 76 of file HLTrigReport.h.

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

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

Definition at line 87 of file HLTrigReport.h.

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

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

Definition at line 88 of file HLTrigReport.h.

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

unsigned int HLTrigReport::refIndex_
private

Definition at line 104 of file HLTrigReport.h.

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

std::string HLTrigReport::refPath_
private

Definition at line 103 of file HLTrigReport.h.

Referenced by HLTrigReport(), and reset().

double HLTrigReport::refRate_
private

Definition at line 105 of file HLTrigReport.h.

Referenced by dumpReport(), and HLTrigReport().

const ReportEvery HLTrigReport::reportBy_
private

Definition at line 107 of file HLTrigReport.h.

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

const ReportEvery HLTrigReport::resetBy_
private

Definition at line 108 of file HLTrigReport.h.

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

const ReportEvery HLTrigReport::serviceBy_
private

Definition at line 109 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 101 of file HLTrigReport.h.

Referenced by HLTrigReport(), and reset().

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

Definition at line 100 of file HLTrigReport.h.

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