CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLTrigReport.h
Go to the documentation of this file.
1 #ifndef HLTrigReport_h
2 #define HLTrigReport_h
3 
23 #include <vector>
24 #include <string>
25 
26 //
27 // class declaration
28 //
29 
31  private:
32  enum ReportEvery {
33  NEVER = 0,
36  EVERY_RUN = 3,
38  };
39 
40  public:
41  explicit HLTrigReport(const edm::ParameterSet&);
42  ~HLTrigReport();
43  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
44 
45  static
47 
48  virtual void beginJob();
49  virtual void endJob();
50 
51  virtual void beginRun(edm::Run const &, edm::EventSetup const&);
52  virtual void endRun(edm::Run const &, edm::EventSetup const&);
53 
54  virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
55  virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
56 
57  virtual void analyze(const edm::Event&, const edm::EventSetup&);
58 
59  void reset(bool changed = false); // reset all counters
60 
61  // names and event counts
62  const std::vector<std::string>& streamNames() const;
63  const std::vector<std::string>& datasetNames() const;
64  const std::vector<unsigned int>& streamCounts() const;
65  const std::vector<unsigned int>& datasetCounts() const;
66 
67  private:
68  void dumpReport(std::string const & header = std::string());
69 
70  edm::InputTag hlTriggerResults_; // Input tag for TriggerResults
72  bool configured_; // is HLTConfigProvider configured ?
73 
74  unsigned int nEvents_; // number of events processed
75  unsigned int nWasRun_; // # where at least one HLT was run
76  unsigned int nAccept_; // # of accepted events
77  unsigned int nErrors_; // # where at least one HLT had error
78 
79  std::vector<unsigned int> hlWasRun_; // # where HLT[i] was run
80  std::vector<unsigned int> hltL1s_; // # of events after L1 seed
81  std::vector<unsigned int> hltPre_; // # of events after HLT prescale
82  std::vector<unsigned int> hlAccept_; // # of events accepted by HLT[i]
83  std::vector<unsigned int> hlAccTot_; // # of events accepted by HLT[0] OR ... OR HLT[i]
84  std::vector<unsigned int> hlErrors_; // # of events with error in HLT[i]
85 
86  std::vector<int> posL1s_; // pos # of last L1 seed
87  std::vector<int> posPre_; // pos # of last HLT prescale
88  std::vector<std::string> hlNames_; // name of each HLT algorithm
89 
90  std::vector<std::vector<unsigned int> > hlIndex_; // hlIndex_[ds][p] stores the hlNames_ index of the p-th path of the ds-th dataset
91  std::vector<std::vector<unsigned int> > hlAccTotDS_; // hlAccTotDS_[ds][p] stores the # of accepted events by the 0-th to p-th paths in the ds-th dataset
92  std::vector<unsigned int> hlAllTotDS_; // hlAllTotDS_[ds] stores the # of accepted events in the ds-th dataset
93  std::vector<std::string> datasetNames_; // list of dataset names
94  std::vector<std::vector<std::string> > datasetContents_; // list of path names for each dataset
95  bool isCustomDatasets_; // true if the user overwrote the dataset definitions of the provenance with the CustomDatasets parameter
96  std::vector<std::vector<unsigned int> > dsIndex_; // dsIndex_[s][ds] stores the datasetNames_ index of the ds-th dataset of the s-th stream
97  std::vector<std::vector<unsigned int> > dsAccTotS_; // dsAccTotS_[s][ds] stores the # of accepted events by the 0-th to ds-th dataset in the s-th stream
98  std::vector<unsigned int> dsAllTotS_; // dsAllTotS_[s] stores the # of accepted events in the s-th stream
99  std::vector<std::string> streamNames_; // list of stream names
100  std::vector<std::vector<std::string> > streamContents_; // list of dataset names for each stream
101  bool isCustomStreams_; // true if the user overwrote the stream definitions of the provenance with the CustomSterams parameter
102  std::string refPath_; // name of the reference path for rate calculation
103  unsigned int refIndex_; // index of the reference path for rate calculation
104  double refRate_; // rate of the reference path, the rate of all other paths will be normalized to this
105 
106  const ReportEvery reportBy_; // dump report for every never/event/lumi/run/job
107  const ReportEvery resetBy_; // reset counters every never/event/lumi/run/job
108  const ReportEvery serviceBy_; // call to service every never/event/lumi/run/job
109  HLTConfigProvider hltConfig_; // to get configuration for L1s/Pre
110 };
111 
112 #endif //HLTrigReport_h
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
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup 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< unsigned int > dsAllTotS_
Definition: HLTrigReport.h:98
const std::vector< unsigned int > & streamCounts() const
std::vector< std::vector< unsigned int > > hlAccTotDS_
Definition: HLTrigReport.h:91
const std::vector< std::string > & datasetNames() const
unsigned int nWasRun_
Definition: HLTrigReport.h:75
std::vector< std::string > datasetNames_
Definition: HLTrigReport.h:93
virtual void endRun(edm::Run const &, edm::EventSetup const &)
double refRate_
Definition: HLTrigReport.h:104
static ReportEvery decode(const std::string &value)
Definition: HLTrigReport.cc:27
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
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
void dumpReport(std::string const &header=std::string())
std::vector< std::string > streamNames_
Definition: HLTrigReport.h:99
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void endJob()
unsigned int nAccept_
Definition: HLTrigReport.h:76
unsigned int refIndex_
Definition: HLTrigReport.h:103
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
std::vector< unsigned int > hlWasRun_
Definition: HLTrigReport.h:79
bool configured_
Definition: HLTrigReport.h:72
std::string refPath_
Definition: HLTrigReport.h:102
virtual void beginJob()
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
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
void reset(bool changed=false)
HLTrigReport(const edm::ParameterSet &)
Definition: HLTrigReport.cc:50
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
virtual void analyze(const edm::Event &, const edm::EventSetup &)
const std::vector< std::string > & streamNames() const
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
Definition: Run.h:41