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