CMS 3D CMS Logo

L1TRate_Offline.h
Go to the documentation of this file.
1 #ifndef DQMOFFLINE_L1TRIGGER_L1TRATE_OFFLINE_H
2 #define DQMOFFLINE_L1TRIGGER_L1TRATE_OFFLINE_H
3 
4 // system include files
5 #include <memory>
6 #include <unistd.h>
7 
8 // user include files
16 
18 
22 
23 //DataFormats
28 #include "DataFormats/Common/interface/ConditionsInEdm.h" // Parameters associated to Run, LS and Event
29 #include "DataFormats/Luminosity/interface/LumiDetails.h" // Luminosity Information
30 #include "DataFormats/Luminosity/interface/LumiSummary.h" // Luminosity Information
31 
33 
34 #include <TString.h>
35 
36 #include <iostream>
37 #include <fstream>
38 #include <vector>
39 
40 //
41 // class declaration
42 //
43 
44 class L1TRate_Offline : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> {
45 public:
47 
48 public:
49  L1TRate_Offline(const edm::ParameterSet& ps); // Constructor
50  ~L1TRate_Offline() override; // Destructor
51 
52 protected:
53  void analyze(const edm::Event& e, const edm::EventSetup& c) override; // Analyze
54  void bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& run, const edm::EventSetup& iSetup) override;
55 
56  void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
57  void endLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
58 
59  // Private methods
60  //private:
61 
62  // bool getXSexFitsOMDS (const edm::ParameterSet& ps);
63  bool getXSexFitsPython(const edm::ParameterSet& ps);
64 
65  // Private variables
66 private:
67  // bool
68  bool m_verbose;
69 
70  // int
71  int m_refPrescaleSet; // What is the reference prescale index to use for trigger choice
72  int m_maxNbins; // Maximum number of bins for MonitorElement
73  int m_lsShiftGTRates; // What shift (if any) to be applied to GT Rates LS number
74 
75  // string
76  std::string m_outputFile; // External output file name (for testiting)
77 
78  // Vectors
79  const std::vector<std::vector<int> >* m_listsPrescaleFactors; // Collection os all sets of prescales
80 
81  // Maps
82  std::map<int, double> m_lsDeadTime; // Map of dead time for each LS
83  std::map<int, int> m_lsPrescaleIndex; // Map of precale index for each LS
84  std::map<int, double> m_lsLuminosity; // Map of luminosity recorded for each LS
85  std::map<int, std::map<TString, double> > m_lsRates; // Map of rates (by bit) recorded for each LS
86  std::map<TString, int> m_algoBit; // Map of bit associated with a L1 Algo alias
87  std::map<TString, TF1*> m_algoFit; // Map of bit associated with a L1 Algo alias
88  std::map<std::string, bool> m_inputCategories; // Map of categories to monitor
89  std::map<std::string, std::string> m_selectedTriggers; // Map of what trigger to monitor for each category
90  std::map<TString, MonitorElement*> m_xSecObservedToExpected; // Monitor Elements for Observed to Expected Algo XSec
91  std::map<TString, MonitorElement*> m_xSecVsInstLumi; // Monitor Elements for Algo XSec vs Instant Luminosity
92 
93  std::map<TString, MonitorElement*> m_xSecObservedVsDelivLumi;
94  std::map<TString, MonitorElement*> m_xSecObservedVsRecorLumi;
95 
96  std::map<TString, MonitorElement*> m_CountsVsLS; // Monitor Elements for counts
97  std::map<TString, MonitorElement*> m_InstLumiVsLS; // Monitor Elements for Instant Lumi
98  std::map<TString, MonitorElement*> m_PrescIndexVsLS; // Monitor Elements for Prescale Index
99  // std::map<TString,MonitorElement*> m_DeadTimeVsLS; // Monitor Elements (Check Purpose)
100 
101  std::map<TString, MonitorElement*> m_xSecObservedVsLS;
102  std::map<TString, MonitorElement*> m_DelivLumiVsLS;
103  std::map<TString, MonitorElement*> m_RecorLumiVsLS;
104 
105  std::map<TString, TF1*> m_templateFunctions; // For each trigger template f(InstLumi)=XSec
106 
107  std::map<int, std::map<TString, double> > m_lsCounts; // Map of counts (by bit) recorded for each LS
108 
109  // Input tags
113 
114  // ParameterSet
116 
117  // MonitorElement
119 
121 };
122 
123 #endif
L1TRate_Offline::m_RecorLumiVsLS
std::map< TString, MonitorElement * > m_RecorLumiVsLS
Definition: L1TRate_Offline.h:103
LumiScalers.h
MessageLogger.h
L1TRate_Offline::~L1TRate_Offline
~L1TRate_Offline() override
Definition: L1TRate_Offline.cc:56
L1TRate_Offline::m_algoFit
std::map< TString, TF1 * > m_algoFit
Definition: L1TRate_Offline.h:87
ESHandle.h
L1TRate_Offline::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: L1TRate_Offline.cc:341
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
L1TRate_Offline::m_verbose
bool m_verbose
Definition: L1TRate_Offline.h:68
edm::Run
Definition: Run.h:45
L1TRate_Offline::m_outputFile
std::string m_outputFile
Definition: L1TRate_Offline.h:76
edm::EDGetTokenT< LumiScalersCollection >
LuminosityBlock.h
L1TRate_Offline::m_l1GtUtils
L1GtUtils m_l1GtUtils
Definition: L1TRate_Offline.h:120
L1TRate_Offline::m_listsPrescaleFactors
const std::vector< std::vector< int > > * m_listsPrescaleFactors
Definition: L1TRate_Offline.h:79
L1TRate_Offline::m_algoBit
std::map< TString, int > m_algoBit
Definition: L1TRate_Offline.h:86
DQMOneEDAnalyzer
Definition: DQMOneEDAnalyzer.h:20
DQMStore.h
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
L1TRate_Offline::bookHistograms
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &run, const edm::EventSetup &iSetup) override
Definition: L1TRate_Offline.cc:61
EDAnalyzer.h
L1TRate_Offline::m_InstLumiVsLS
std::map< TString, MonitorElement * > m_InstLumiVsLS
Definition: L1TRate_Offline.h:97
L1TRate_Offline::m_CountsVsLS
std::map< TString, MonitorElement * > m_CountsVsLS
Definition: L1TRate_Offline.h:96
DQMOneEDAnalyzer.h
L1TRate_Offline::m_maxNbins
int m_maxNbins
Definition: L1TRate_Offline.h:72
L1TRate_Offline::m_scalersSource_LSCollection
edm::EDGetTokenT< LumiScalersCollection > m_scalersSource_LSCollection
Definition: L1TRate_Offline.h:110
dqm::legacy::DQMStore::IBooker
dqm::implementation::IBooker IBooker
Definition: DQMStore.h:729
MakerMacros.h
L1TRate_Offline::m_PrescIndexVsLS
std::map< TString, MonitorElement * > m_PrescIndexVsLS
Definition: L1TRate_Offline.h:98
Level1TriggerScalers.h
L1TRate_Offline::m_xSecObservedVsRecorLumi
std::map< TString, MonitorElement * > m_xSecObservedVsRecorLumi
Definition: L1TRate_Offline.h:94
Service.h
L1TRate_Offline::m_lsShiftGTRates
int m_lsShiftGTRates
Definition: L1TRate_Offline.h:73
L1GtUtils
Definition: L1GtUtils.h:66
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1TRate_Offline::m_lsCounts
std::map< int, std::map< TString, double > > m_lsCounts
Definition: L1TRate_Offline.h:107
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
LumiDetails.h
L1TRate_Offline::m_lsDeadTime
std::map< int, double > m_lsDeadTime
Definition: L1TRate_Offline.h:82
L1TRate_Offline::m_scalersSource_L1TSCollection
edm::EDGetTokenT< Level1TriggerScalersCollection > m_scalersSource_L1TSCollection
Definition: L1TRate_Offline.h:111
L1TRate_Offline::m_xSecVsInstLumi
std::map< TString, MonitorElement * > m_xSecVsInstLumi
Definition: L1TRate_Offline.h:91
L1TRate_Offline::Errors
Errors
Definition: L1TRate_Offline.h:46
L1TRate_Offline::m_ErrorMonitor
MonitorElement * m_ErrorMonitor
Definition: L1TRate_Offline.h:118
edm::EventSetup
Definition: EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
L1TRate_Offline::m_xSecObservedToExpected
std::map< TString, MonitorElement * > m_xSecObservedToExpected
Definition: L1TRate_Offline.h:90
L1TRate_Offline::m_inputCategories
std::map< std::string, bool > m_inputCategories
Definition: L1TRate_Offline.h:88
L1TRate_Offline::m_selectedTriggers
std::map< std::string, std::string > m_selectedTriggers
Definition: L1TRate_Offline.h:89
L1TRate_Offline::WARNING_PY_MISSING_FIT
Definition: L1TRate_Offline.h:46
writedatasetfile.run
run
Definition: writedatasetfile.py:27
L1TRate_Offline::m_lsRates
std::map< int, std::map< TString, double > > m_lsRates
Definition: L1TRate_Offline.h:85
L1TRate_Offline::m_lsPrescaleIndex
std::map< int, int > m_lsPrescaleIndex
Definition: L1TRate_Offline.h:83
ConditionsInEdm.h
Frameworkfwd.h
L1TRate_Offline::m_xSecObservedVsLS
std::map< TString, MonitorElement * > m_xSecObservedVsLS
Definition: L1TRate_Offline.h:101
L1GtUtils.h
LumiSummary.h
L1TRate_Offline::endLuminosityBlock
void endLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) override
Definition: L1TRate_Offline.cc:220
Level1TriggerRates.h
L1TRate_Offline::m_l1GtDataDaqInputTag
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDataDaqInputTag
Definition: L1TRate_Offline.h:112
L1TRate_Offline::m_parameters
edm::ParameterSet m_parameters
Definition: L1TRate_Offline.h:115
L1TRate_Offline::getXSexFitsPython
bool getXSexFitsPython(const edm::ParameterSet &ps)
Definition: L1TRate_Offline.cc:477
L1TRate_Offline::m_refPrescaleSet
int m_refPrescaleSet
Definition: L1TRate_Offline.h:71
ParameterSet.h
L1TRate_Offline
Definition: L1TRate_Offline.h:44
L1TRate_Offline::m_xSecObservedVsDelivLumi
std::map< TString, MonitorElement * > m_xSecObservedVsDelivLumi
Definition: L1TRate_Offline.h:93
L1TRate_Offline::beginLuminosityBlock
void beginLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) override
Definition: L1TRate_Offline.cc:213
edm::Event
Definition: Event.h:73
L1TRate_Offline::UNKNOWN
Definition: L1TRate_Offline.h:46
L1TRate_Offline::m_templateFunctions
std::map< TString, TF1 * > m_templateFunctions
Definition: L1TRate_Offline.h:105
L1TRate_Offline::m_lsLuminosity
std::map< int, double > m_lsLuminosity
Definition: L1TRate_Offline.h:84
L1GlobalTriggerReadoutRecord.h
L1TRate_Offline::m_DelivLumiVsLS
std::map< TString, MonitorElement * > m_DelivLumiVsLS
Definition: L1TRate_Offline.h:102
L1TRate_Offline::L1TRate_Offline
L1TRate_Offline(const edm::ParameterSet &ps)
Definition: L1TRate_Offline.cc:19
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37