CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/HLTrigger/HLTanalyzers/interface/HLTrigReport.h

Go to the documentation of this file.
00001 #ifndef HLTrigReport_h
00002 #define HLTrigReport_h
00003 
00017 #include "FWCore/Framework/interface/Event.h"
00018 #include "FWCore/Framework/interface/EDAnalyzer.h"
00019 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00020 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
00021 #include "FWCore/Common/interface/TriggerNames.h"
00022 #include<vector>
00023 #include<string>
00024 
00025 //
00026 // class declaration
00027 //
00028 
00029 class HLTrigReport : public edm::EDAnalyzer {
00030    private:
00031       enum ReportEvery {
00032         NEVER       = 0,
00033         EVERY_EVENT = 1,
00034         EVERY_LUMI  = 2,
00035         EVERY_RUN   = 3,
00036         EVERY_JOB   = 4
00037       };
00038 
00039    public:
00040       explicit HLTrigReport(const edm::ParameterSet&);
00041       ~HLTrigReport();
00042 
00043       static
00044       ReportEvery decode(const std::string & value);
00045 
00046       virtual void beginJob();
00047       virtual void endJob();
00048 
00049       virtual void beginRun(edm::Run const &, edm::EventSetup const&);
00050       virtual void endRun(edm::Run const &, edm::EventSetup const&);
00051 
00052       virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
00053       virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&);
00054 
00055       virtual void analyze(const edm::Event&, const edm::EventSetup&);
00056 
00057       void reset(bool changed = false);     // reset all counters
00058 
00059       // names and event counts
00060       const std::vector<std::string>& streamNames() const;
00061       const std::vector<std::string>& datasetNames() const;
00062       const std::vector<unsigned int>& streamCounts() const;
00063       const std::vector<unsigned int>& datasetCounts() const;
00064 
00065    private:
00066       void dumpReport(std::string const & header = std::string());
00067 
00068       edm::InputTag hlTriggerResults_;      // Input tag for TriggerResults
00069       bool          configured_;            // is HLTConfigProvider configured ?
00070 
00071       unsigned int  nEvents_;               // number of events processed
00072       unsigned int  nWasRun_;               // # where at least one HLT was run
00073       unsigned int  nAccept_;               // # of accepted events
00074       unsigned int  nErrors_;               // # where at least one HLT had error
00075 
00076       std::vector<unsigned int> hlWasRun_;  // # where HLT[i] was run
00077       std::vector<unsigned int> hltL1s_;    // # of events after L1 seed
00078       std::vector<unsigned int> hltPre_;    // # of events after HLT prescale
00079       std::vector<unsigned int> hlAccept_;  // # of events accepted by HLT[i]
00080       std::vector<unsigned int> hlAccTot_;  // # of events accepted by HLT[0] OR ... OR HLT[i]
00081       std::vector<unsigned int> hlErrors_;  // # of events with error in HLT[i]
00082 
00083       std::vector<int> posL1s_;             // pos # of last L1 seed
00084       std::vector<int> posPre_;             // pos # of last HLT prescale
00085       std::vector<std::string>  hlNames_;   // name of each HLT algorithm
00086 
00087       std::vector<std::vector<unsigned int> > hlIndex_;        // hlIndex_[ds][p] stores the hlNames_ index of the p-th path of the ds-th dataset 
00088       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 
00089       std::vector<unsigned int>               hlAllTotDS_;     // hlAllTotDS_[ds] stores the # of accepted events in the ds-th dataset
00090       std::vector<std::string> datasetNames_;                  // list of dataset names
00091       std::vector<std::vector<std::string> > datasetContents_; // list of path names for each dataset
00092       bool isCustomDatasets_;                                  // true if the user overwrote the dataset definitions of the provenance with the CustomDatasets parameter
00093       std::vector<std::vector<unsigned int> > dsIndex_;        // dsIndex_[s][ds] stores the datasetNames_ index of the ds-th dataset of the s-th stream 
00094       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 
00095       std::vector<unsigned int>               dsAllTotS_;      // dsAllTotS_[s] stores the # of accepted events in the s-th stream
00096       std::vector<std::string> streamNames_;                   // list of stream names
00097       std::vector<std::vector<std::string> > streamContents_;  // list of dataset names for each stream
00098       bool isCustomStreams_;                                   // true if the user overwrote the stream definitions of the provenance with the CustomSterams parameter
00099       std::string refPath_;                                    // name of the reference path for rate calculation
00100       unsigned int refIndex_;                                   // index of the reference path for rate calculation
00101       double refRate_;                                         // rate of the reference path, the rate of all other paths will be normalized to this
00102 
00103       ReportEvery reportBy_;        // dump report for every never/event/lumi/run/job
00104       ReportEvery resetBy_;         // reset counters  every never/event/lumi/run/job
00105       ReportEvery serviceBy_;       // call to service every never/event/lumi/run/job
00106       HLTConfigProvider hltConfig_; // to get configuration for L1s/Pre
00107 };
00108 
00109 #endif //HLTrigReport_h