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