CMS 3D CMS Logo

HLTrigReport.h
Go to the documentation of this file.
1 #ifndef HLTrigReport_h
2 #define HLTrigReport_h
3 
15 #include <string>
16 #include <vector>
17 
26 
27 //
28 // class declaration
29 //
30 
31 namespace hltrigreport {
32  struct Accumulate {
33  Accumulate();
34  Accumulate(size_t numHLNames,
35  std::vector<std::vector<unsigned int>> const& hlIndex,
36  std::vector<std::vector<unsigned int>> const& dsIndex);
37 
38  unsigned int nEvents_; // number of events processed
39  unsigned int nWasRun_; // # where at least one HLT was run
40  unsigned int nAccept_; // # of accepted events
41  unsigned int nErrors_; // # where at least one HLT had error
42 
43  std::vector<unsigned int> hlWasRun_; // # where HLT[i] was run
44  std::vector<unsigned int> hltL1s_; // # of events after L1 seed
45  std::vector<unsigned int> hltPre_; // # of events after HLT prescale
46  std::vector<unsigned int> hlAccept_; // # of events accepted by HLT[i]
47  std::vector<unsigned int> hlAccTot_; // # of events accepted by HLT[0] OR ... OR HLT[i]
48  std::vector<unsigned int> hlErrors_; // # of events with error in HLT[i]
49 
50  std::vector<std::vector<unsigned int>>
51  hlAccTotDS_; // hlAccTotDS_[ds][p] stores the # of accepted events by the 0-th to p-th paths in the ds-th dataset
52  std::vector<unsigned int> hlAllTotDS_; // hlAllTotDS_[ds] stores the # of accepted events in the ds-th dataset
53  std::vector<std::vector<unsigned int>>
54  dsAccTotS_; // dsAccTotS_[s][ds] stores the # of accepted events by the 0-th to ds-th dataset in the s-th stream
55  std::vector<unsigned int> dsAllTotS_; // dsAllTotS_[s] stores the # of accepted events in the s-th stream
56 
57  void accumulate(Accumulate const&);
58  void reset();
59  };
60 
61 } // namespace hltrigreport
62 
64  : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::LuminosityBlockCache<hltrigreport::Accumulate>> {
65 private:
66  enum ReportEvery { NEVER = 0, EVERY_EVENT = 1, EVERY_LUMI = 2, EVERY_RUN = 3, EVERY_JOB = 4 };
67 
68 public:
70 
71  explicit HLTrigReport(const edm::ParameterSet&);
72  ~HLTrigReport() override;
73  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
74 
75  static ReportEvery decode(const std::string& value);
76 
77  void beginJob() override;
78  void endJob() override;
79 
80  void beginRun(edm::Run const&, edm::EventSetup const&) override;
81  void endRun(edm::Run const&, edm::EventSetup const&) override;
82 
83  std::shared_ptr<Accumulate> globalBeginLuminosityBlock(edm::LuminosityBlock const&,
84  edm::EventSetup const&) const override;
86 
87  void analyze(const edm::Event&, const edm::EventSetup&) override;
88 
89  // names and event counts
90  const std::vector<std::string>& streamNames() const;
91  const std::vector<std::string>& datasetNames() const;
92 
93 private:
94  void reset(); // reset all counters
95 
97  if (useLumiCache()) {
98  return *luminosityBlockCache(index);
99  }
100  return accumulate_;
101  }
103  bool readAfterLumi() const {
105  }
106 
107  void updateConfigCache();
108 
109  void dumpReport(hltrigreport::Accumulate const& accumulate, std::string const& header = std::string()) const;
110  void updateService(Accumulate const& accumulate) const;
111 
112  const edm::InputTag hlTriggerResults_; // Input tag for TriggerResults
114  bool configured_; // is HLTConfigProvider configured ?
115 
116  std::vector<std::string> hlNames_; // name of each HLT algorithm
117 
118  std::vector<std::vector<unsigned int>>
119  hlIndex_; // hlIndex_[ds][p] stores the hlNames_ index of the p-th path of the ds-th dataset
120 
121  std::vector<int> posL1s_; // pos # of last L1 seed
122  std::vector<int> posPre_; // pos # of last HLT prescale
123 
124  std::vector<std::string> datasetNames_; // list of dataset names
125  std::vector<std::vector<std::string>> datasetContents_; // list of path names for each dataset
126  bool isCustomDatasets_; // true if the user overwrote the dataset definitions of the provenance with the CustomDatasets parameter
127  std::vector<std::vector<unsigned int>>
128  dsIndex_; // dsIndex_[s][ds] stores the datasetNames_ index of the ds-th dataset of the s-th stream
129  std::vector<std::string> streamNames_; // list of stream names
130  std::vector<std::vector<std::string>> streamContents_; // list of dataset names for each stream
131  bool isCustomStreams_; // true if the user overwrote the stream definitions of the provenance with the CustomSterams parameter
132  std::string refPath_; // name of the reference path for rate calculation
133  unsigned int refIndex_; // index of the reference path for rate calculation
134  const double refRate_; // rate of the reference path, the rate of all other paths will be normalized to this
135 
136  const ReportEvery reportBy_; // dump report for every never/event/lumi/run/job
137  const ReportEvery resetBy_; // reset counters every never/event/lumi/run/job
138  const ReportEvery serviceBy_; // call to service every never/event/lumi/run/job
139  HLTConfigProvider hltConfig_; // to get configuration for L1s/Pre
140 
142 };
143 
144 #endif //HLTrigReport_h
ConfigurationDescriptions.h
HLTrigReport::HLTrigReport
HLTrigReport(const edm::ParameterSet &)
Definition: HLTrigReport.cc:152
hltrigreport::Accumulate::hltL1s_
std::vector< unsigned int > hltL1s_
Definition: HLTrigReport.h:44
hltrigreport::Accumulate::hlAccTot_
std::vector< unsigned int > hlAccTot_
Definition: HLTrigReport.h:47
HLTrigReport::EVERY_EVENT
Definition: HLTrigReport.h:66
hltrigreport::Accumulate
Definition: HLTrigReport.h:32
EDAnalyzer.h
hltrigreport::Accumulate::dsAccTotS_
std::vector< std::vector< unsigned int > > dsAccTotS_
Definition: HLTrigReport.h:54
TriggerResults.h
HLTrigReport::hltConfig_
HLTConfigProvider hltConfig_
Definition: HLTrigReport.h:139
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
edm::EDGetTokenT< edm::TriggerResults >
HLTrigReport::configured_
bool configured_
Definition: HLTrigReport.h:114
HLTrigReport::~HLTrigReport
~HLTrigReport() override
HLTrigReport::streamNames_
std::vector< std::string > streamNames_
Definition: HLTrigReport.h:129
HLTrigReport::reset
void reset()
Definition: HLTrigReport.cc:316
hltrigreport::Accumulate::nWasRun_
unsigned int nWasRun_
Definition: HLTrigReport.h:39
HLTrigReport
Definition: HLTrigReport.h:63
hltrigreport::Accumulate::hlAllTotDS_
std::vector< unsigned int > hlAllTotDS_
Definition: HLTrigReport.h:52
hltrigreport::Accumulate::hlErrors_
std::vector< unsigned int > hlErrors_
Definition: HLTrigReport.h:48
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
HLTrigReport::hlIndex_
std::vector< std::vector< unsigned int > > hlIndex_
Definition: HLTrigReport.h:119
HLTrigReport::EVERY_JOB
Definition: HLTrigReport.h:66
HLTrigReport::serviceBy_
const ReportEvery serviceBy_
Definition: HLTrigReport.h:138
HLTrigReport::posL1s_
std::vector< int > posL1s_
Definition: HLTrigReport.h:121
hltrigreport::Accumulate::hltPre_
std::vector< unsigned int > hltPre_
Definition: HLTrigReport.h:45
HLTrigReport::NEVER
Definition: HLTrigReport.h:66
HLTrigReport::beginRun
void beginRun(edm::Run const &, edm::EventSetup const &) override
Definition: HLTrigReport.cc:331
HLTrigReport::dsIndex_
std::vector< std::vector< unsigned int > > dsIndex_
Definition: HLTrigReport.h:128
HLTrigReport::ReportEvery
ReportEvery
Definition: HLTrigReport.h:66
HLTrigReport::hlNames_
std::vector< std::string > hlNames_
Definition: HLTrigReport.h:116
HLTrigReport::readAfterLumi
bool readAfterLumi() const
Definition: HLTrigReport.h:103
HLTrigReport::endJob
void endJob() override
Definition: HLTrigReport.cc:323
HLTrigReport::datasetNames_
std::vector< std::string > datasetNames_
Definition: HLTrigReport.h:124
HLTrigReport::datasetContents_
std::vector< std::vector< std::string > > datasetContents_
Definition: HLTrigReport.h:125
edm::LuminosityBlockIndex
Definition: LuminosityBlockIndex.h:33
HLTrigReport::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: HLTrigReport.cc:407
hlx_dqm_sourceclient_cfi.Accumulate
Accumulate
Definition: hlx_dqm_sourceclient_cfi.py:27
hltrigreport
Definition: HLTrigReport.h:31
HLTrigReport::EVERY_LUMI
Definition: HLTrigReport.h:66
HLTrigReport::beginJob
void beginJob() override
Definition: HLTrigReport.cc:318
HLTrigReport::globalEndLuminosityBlock
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: HLTrigReport.cc:374
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
hltrigreport::Accumulate::dsAllTotS_
std::vector< unsigned int > dsAllTotS_
Definition: HLTrigReport.h:55
hltrigreport::Accumulate::Accumulate
Accumulate()
Definition: HLTrigReport.cc:47
hltrigreport::Accumulate::hlAccept_
std::vector< unsigned int > hlAccept_
Definition: HLTrigReport.h:46
HLTrigReport::EVERY_RUN
Definition: HLTrigReport.h:66
edm::ParameterSet
Definition: ParameterSet.h:36
HLTrigReport::isCustomDatasets_
bool isCustomDatasets_
Definition: HLTrigReport.h:126
Event.h
HLTrigReport::streamNames
const std::vector< std::string > & streamNames() const
Definition: HLTrigReport.cc:229
HLTrigReport::posPre_
std::vector< int > posPre_
Definition: HLTrigReport.h:122
TriggerNames.h
value
Definition: value.py:1
HLTrigReport::updateConfigCache
void updateConfigCache()
Definition: HLTrigReport.cc:231
HLTrigReport::useLumiCache
bool useLumiCache() const
Definition: HLTrigReport.h:102
HLTrigReport::reportBy_
const ReportEvery reportBy_
Definition: HLTrigReport.h:136
edm::EventSetup
Definition: EventSetup.h:57
HLTrigReport::decode
static ReportEvery decode(const std::string &value)
Definition: HLTrigReport.cc:24
HLTConfigProvider.h
HLTrigReport::refPath_
std::string refPath_
Definition: HLTrigReport.h:132
hltrigreport::Accumulate::nAccept_
unsigned int nAccept_
Definition: HLTrigReport.h:40
hltrigreport::Accumulate::hlWasRun_
std::vector< unsigned int > hlWasRun_
Definition: HLTrigReport.h:43
hltrigreport::Accumulate::accumulate
void accumulate(Accumulate const &)
Definition: HLTrigReport.cc:87
hltrigreport::Accumulate::nErrors_
unsigned int nErrors_
Definition: HLTrigReport.h:41
HLTrigReport::datasetNames
const std::vector< std::string > & datasetNames() const
Definition: HLTrigReport.cc:228
HLTrigReport::endRun
void endRun(edm::Run const &, edm::EventSetup const &) override
Definition: HLTrigReport.cc:352
HLTrigReport::Accumulate
hltrigreport::Accumulate Accumulate
Definition: HLTrigReport.h:69
HLTrigReport::isCustomStreams_
bool isCustomStreams_
Definition: HLTrigReport.h:131
HLTConfigProvider
Definition: HLTConfigProvider.h:28
HLTrigReport::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: HLTrigReport.cc:207
HLTrigReport::refIndex_
unsigned int refIndex_
Definition: HLTrigReport.h:133
HLTrigReport::globalBeginLuminosityBlock
std::shared_ptr< Accumulate > globalBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const override
Definition: HLTrigReport.cc:363
or
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
hltrigreport::Accumulate::nEvents_
unsigned int nEvents_
Definition: HLTrigReport.h:38
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:292
HLTrigReport::hlTriggerResults_
const edm::InputTag hlTriggerResults_
Definition: HLTrigReport.h:112
hltrigreport::Accumulate::hlAccTotDS_
std::vector< std::vector< unsigned int > > hlAccTotDS_
Definition: HLTrigReport.h:51
HLTrigReport::accumulate_
hltrigreport::Accumulate accumulate_
Definition: HLTrigReport.h:141
ParameterSet.h
HLTrigReport::chooseAccumulate
hltrigreport::Accumulate & chooseAccumulate(edm::LuminosityBlockIndex index)
Definition: HLTrigReport.h:96
HLTrigReport::hlTriggerResultsToken_
const edm::EDGetTokenT< edm::TriggerResults > hlTriggerResultsToken_
Definition: HLTrigReport.h:113
hltrigreport::Accumulate::reset
void reset()
Definition: HLTrigReport.cc:124
HLTrigReport::dumpReport
void dumpReport(hltrigreport::Accumulate const &accumulate, std::string const &header=std::string()) const
Definition: HLTrigReport.cc:517
edm::Event
Definition: Event.h:73
HLTrigReport::refRate_
const double refRate_
Definition: HLTrigReport.h:134
HLTrigReport::updateService
void updateService(Accumulate const &accumulate) const
Definition: HLTrigReport.cc:509
edm::InputTag
Definition: InputTag.h:15
HLTrigReport::resetBy_
const ReportEvery resetBy_
Definition: HLTrigReport.h:137
HLTrigReport::streamContents_
std::vector< std::vector< std::string > > streamContents_
Definition: HLTrigReport.h:130