CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
L1TRate.h
Go to the documentation of this file.
1 #ifndef DQM_L1TMONITOR_L1TRATE_H
2 #define DQM_L1TMONITOR_L1TRATE_H
3 
4 /*
5  * \file L1TRate.h
6  *
7  * \author J. Pela
8  *
9 */
10 
11 // system include files
12 #include <memory>
13 #include <unistd.h>
14 
15 // user include files
20 
22 
25 
30 
32 
34 
36 
37 #include <TString.h>
38 
39 #include <iostream>
40 #include <fstream>
41 #include <vector>
42 
43 //
44 // class declaration
45 //
46 
47 class L1TRate : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> {
48 public:
49  L1TRate(const edm::ParameterSet& ps); // Constructor
50  ~L1TRate() override; // Destructor
51 
52 protected:
53  void analyze(const edm::Event& e, const edm::EventSetup& c) override; // Analyze
54  //void beginJob(); // BeginJob
55  //void endJob (); // EndJob
56  void bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, const edm::EventSetup&) override;
57  //void dqmEndRun (const edm::Run& run, const edm::EventSetup& iSetup);
58 
59  void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
60  void endLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
61  void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override;
62 
63  // Private methods
64 private:
65  bool getXSexFitsOMDS(const edm::ParameterSet& ps);
66  bool getXSexFitsPython(const edm::ParameterSet& ps);
67 
68  // Private variables
69 private:
70  // bool
71  bool m_verbose;
72 
73  // int
74  int m_refPrescaleSet; // What is the reference prescale index to use for trigger choice
75  int m_maxNbins; // Maximum number of bins for MonitorElement
76  int m_lsShiftGTRates; // What shift (if any) to be applied to GT Rates LS number
77 
78  // string
79  std::string m_outputFile; // External output file name (for testiting)
80 
81  // Vectors
82  const std::vector<std::vector<int> >* m_listsPrescaleFactors; // Collection os all sets of prescales
83 
84  // Maps
85  std::map<int, int> m_lsPrescaleIndex; // Map of precale index for each LS
86  std::map<int, double> m_lsLuminosity; // Map of luminosity recorded for each LS
87  std::map<int, std::map<TString, double> > m_lsRates; // Map of rates (by bit) recorded for each LS
88  std::map<TString, int> m_algoBit; // Map of bit associated with a L1 Algo alias
89  std::map<std::string, bool> m_inputCategories; // Map of categories to monitor
90  std::map<std::string, std::string> m_selectedTriggers; // Map of what trigger to monitor for each category
91  std::map<TString, MonitorElement*> m_xSecObservedToExpected; // Monitor Elements for Observed to Expected Algo XSec
92  std::map<TString, MonitorElement*> m_xSecVsInstLumi; // Monitor Elements for Algo XSec vs Instant Luminosity
93  std::map<TString, TF1*> m_templateFunctions; // For each trigger template f(InstLumi)=XSec
94 
95  // Input tags
102 
103  // ParameterSet
105 
106  // MonitorElement
108 
109  // Others
110  //DQMStore* dbe; // The DQM Service Handle
111 
113 };
114 
115 #endif
std::map< TString, TF1 * > m_templateFunctions
Definition: L1TRate.h:93
std::map< int, std::map< TString, double > > m_lsRates
Definition: L1TRate.h:87
edm::EDGetTokenT< LumiScalersCollection > m_scalersSource_colLScal
Definition: L1TRate.h:96
edm::EDGetTokenT< Level1TriggerScalersCollection > m_scalersSource_triggerScalers
Definition: L1TRate.h:97
void beginLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) override
Definition: L1TRate.cc:193
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDataDaqInputTag
Definition: L1TRate.h:98
std::map< std::string, bool > m_inputCategories
Definition: L1TRate.h:89
edm::ParameterSet m_parameters
Definition: L1TRate.h:104
bool m_verbose
Definition: L1TRate.h:71
const edm::ESGetToken< L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd > m_l1GtPfAlgoToken
Definition: L1TRate.h:100
void endLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) override
Definition: L1TRate.cc:200
L1GtUtils m_l1GtUtils
Definition: L1TRate.h:112
int m_lsShiftGTRates
Definition: L1TRate.h:76
bool getXSexFitsPython(const edm::ParameterSet &ps)
Definition: L1TRate.cc:464
int m_maxNbins
Definition: L1TRate.h:75
const std::vector< std::vector< int > > * m_listsPrescaleFactors
Definition: L1TRate.h:82
int m_refPrescaleSet
Definition: L1TRate.h:74
std::map< TString, int > m_algoBit
Definition: L1TRate.h:88
L1TRate(const edm::ParameterSet &ps)
Definition: L1TRate.cc:32
bool getXSexFitsOMDS(const edm::ParameterSet &ps)
Definition: L1TRate.cc:391
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: L1TRate.cc:285
std::map< TString, MonitorElement * > m_xSecVsInstLumi
Definition: L1TRate.h:92
std::map< TString, MonitorElement * > m_xSecObservedToExpected
Definition: L1TRate.h:91
L1TMenuHelper::Tokens m_helperTokens
Definition: L1TRate.h:101
std::map< std::string, std::string > m_selectedTriggers
Definition: L1TRate.h:90
std::string m_outputFile
Definition: L1TRate.h:79
~L1TRate() override
Definition: L1TRate.cc:79
MonitorElement * m_ErrorMonitor
Definition: L1TRate.h:107
const edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > m_menuToken
Definition: L1TRate.h:99
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
Definition: L1TRate.cc:186
std::map< int, double > m_lsLuminosity
Definition: L1TRate.h:86
Definition: Run.h:45
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &, const edm::EventSetup &) override
Definition: L1TRate.cc:84
std::map< int, int > m_lsPrescaleIndex
Definition: L1TRate.h:85