CMS 3D CMS Logo

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
L1TRate::m_l1GtPfAlgoToken
const edm::ESGetToken< L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd > m_l1GtPfAlgoToken
Definition: L1TRate.h:100
L1TRate::m_refPrescaleSet
int m_refPrescaleSet
Definition: L1TRate.h:74
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
L1TRate::m_inputCategories
std::map< std::string, bool > m_inputCategories
Definition: L1TRate.h:89
LumiScalers.h
L1TRate::m_parameters
edm::ParameterSet m_parameters
Definition: L1TRate.h:104
MessageLogger.h
L1TRate::m_verbose
bool m_verbose
Definition: L1TRate.h:71
L1TRate::getXSexFitsOMDS
bool getXSexFitsOMDS(const edm::ParameterSet &ps)
Definition: L1TRate.cc:391
L1TRate::m_l1GtUtils
L1GtUtils m_l1GtUtils
Definition: L1TRate.h:112
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
edm::EDGetTokenT< LumiScalersCollection >
LuminosityBlock.h
L1TRate::m_lsPrescaleIndex
std::map< int, int > m_lsPrescaleIndex
Definition: L1TRate.h:85
L1TRate::m_l1GtDataDaqInputTag
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDataDaqInputTag
Definition: L1TRate.h:98
L1TRate::m_listsPrescaleFactors
const std::vector< std::vector< int > > * m_listsPrescaleFactors
Definition: L1TRate.h:82
L1TRate::m_lsRates
std::map< int, std::map< TString, double > > m_lsRates
Definition: L1TRate.h:87
DQMOneEDAnalyzer
Definition: DQMOneEDAnalyzer.h:20
L1TRate::m_selectedTriggers
std::map< std::string, std::string > m_selectedTriggers
Definition: L1TRate.h:90
DQMStore.h
L1TRate
Definition: L1TRate.h:47
L1TMenuHelper::Tokens
Definition: L1TMenuHelper.h:80
L1TRate::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: L1TRate.cc:285
L1TRate::m_lsLuminosity
std::map< int, double > m_lsLuminosity
Definition: L1TRate.h:86
DQMOneEDAnalyzer.h
L1TRate::m_templateFunctions
std::map< TString, TF1 * > m_templateFunctions
Definition: L1TRate.h:93
MakerMacros.h
Level1TriggerScalers.h
L1GtUtils
Definition: L1GtUtils.h:66
L1TRate::bookHistograms
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &, const edm::EventSetup &) override
Definition: L1TRate.cc:84
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1TRate::m_xSecVsInstLumi
std::map< TString, MonitorElement * > m_xSecVsInstLumi
Definition: L1TRate.h:92
edm::ParameterSet
Definition: ParameterSet.h:47
L1TRate::getXSexFitsPython
bool getXSexFitsPython(const edm::ParameterSet &ps)
Definition: L1TRate.cc:464
Event.h
L1TRate::dqmBeginRun
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
Definition: L1TRate.cc:186
L1TRate::m_helperTokens
L1TMenuHelper::Tokens m_helperTokens
Definition: L1TRate.h:101
L1TRate::m_outputFile
std::string m_outputFile
Definition: L1TRate.h:79
L1TRate::m_xSecObservedToExpected
std::map< TString, MonitorElement * > m_xSecObservedToExpected
Definition: L1TRate.h:91
edm::EventSetup
Definition: EventSetup.h:58
edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd >
L1TRate::m_lsShiftGTRates
int m_lsShiftGTRates
Definition: L1TRate.h:76
L1TRate::m_ErrorMonitor
MonitorElement * m_ErrorMonitor
Definition: L1TRate.h:107
L1TRate::~L1TRate
~L1TRate() override
Definition: L1TRate.cc:79
L1TMenuHelper.h
Frameworkfwd.h
L1GtUtils.h
L1TRate::m_menuToken
const edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > m_menuToken
Definition: L1TRate.h:99
L1TRate::m_maxNbins
int m_maxNbins
Definition: L1TRate.h:75
Level1TriggerRates.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
L1TRate::endLuminosityBlock
void endLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) override
Definition: L1TRate.cc:200
L1TRate::L1TRate
L1TRate(const edm::ParameterSet &ps)
Definition: L1TRate.cc:32
ParameterSet.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
L1TRate::m_algoBit
std::map< TString, int > m_algoBit
Definition: L1TRate.h:88
edm::Event
Definition: Event.h:73
L1TRate::beginLuminosityBlock
void beginLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) override
Definition: L1TRate.cc:193
L1TRate::m_scalersSource_triggerScalers
edm::EDGetTokenT< Level1TriggerScalersCollection > m_scalersSource_triggerScalers
Definition: L1TRate.h:97
L1GlobalTriggerReadoutRecord.h
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
L1TRate::m_scalersSource_colLScal
edm::EDGetTokenT< LumiScalersCollection > m_scalersSource_colLScal
Definition: L1TRate.h:96