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
14 
16 
19 
20 //DataFormats
25 #include "DataFormats/Common/interface/ConditionsInEdm.h" // Parameters associated to Run, LS and Event
26 #include "DataFormats/Luminosity/interface/LumiDetails.h" // Luminosity Information
27 #include "DataFormats/Luminosity/interface/LumiSummary.h" // Luminosity Information
28 
30 
32 
33 #include <TString.h>
34 
35 #include <iostream>
36 #include <fstream>
37 #include <vector>
38 
39 //
40 // class declaration
41 //
42 
43 class L1TRate_Offline : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> {
44 public:
46 
47 public:
48  L1TRate_Offline(const edm::ParameterSet& ps); // Constructor
49  ~L1TRate_Offline() override; // Destructor
50 
51 protected:
52  void analyze(const edm::Event& e, const edm::EventSetup& c) override; // Analyze
53  void bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& run, const edm::EventSetup& iSetup) override;
54 
55  void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
56  void endLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
57 
58  // Private methods
59  //private:
60 
61  // bool getXSexFitsOMDS (const edm::ParameterSet& ps);
62  bool getXSexFitsPython(const edm::ParameterSet& ps);
63 
64  // Private variables
65 private:
66  // bool
67  bool m_verbose;
68 
69  // int
70  int m_refPrescaleSet; // What is the reference prescale index to use for trigger choice
71  int m_maxNbins; // Maximum number of bins for MonitorElement
72  int m_lsShiftGTRates; // What shift (if any) to be applied to GT Rates LS number
73 
74  // string
75  std::string m_outputFile; // External output file name (for testiting)
76 
77  // Vectors
78  const std::vector<std::vector<int> >* m_listsPrescaleFactors; // Collection os all sets of prescales
79 
80  // Maps
81  std::map<int, double> m_lsDeadTime; // Map of dead time for each LS
82  std::map<int, int> m_lsPrescaleIndex; // Map of precale index for each LS
83  std::map<int, double> m_lsLuminosity; // Map of luminosity recorded for each LS
84  std::map<int, std::map<TString, double> > m_lsRates; // Map of rates (by bit) recorded for each LS
85  std::map<TString, int> m_algoBit; // Map of bit associated with a L1 Algo alias
86  std::map<TString, TF1*> m_algoFit; // Map of bit associated with a L1 Algo alias
87  std::map<std::string, bool> m_inputCategories; // Map of categories to monitor
88  std::map<std::string, std::string> m_selectedTriggers; // Map of what trigger to monitor for each category
89  std::map<TString, MonitorElement*> m_xSecObservedToExpected; // Monitor Elements for Observed to Expected Algo XSec
90  std::map<TString, MonitorElement*> m_xSecVsInstLumi; // Monitor Elements for Algo XSec vs Instant Luminosity
91 
92  std::map<TString, MonitorElement*> m_xSecObservedVsDelivLumi;
93  std::map<TString, MonitorElement*> m_xSecObservedVsRecorLumi;
94 
95  std::map<TString, MonitorElement*> m_CountsVsLS; // Monitor Elements for counts
96  std::map<TString, MonitorElement*> m_InstLumiVsLS; // Monitor Elements for Instant Lumi
97  std::map<TString, MonitorElement*> m_PrescIndexVsLS; // Monitor Elements for Prescale Index
98  // std::map<TString,MonitorElement*> m_DeadTimeVsLS; // Monitor Elements (Check Purpose)
99 
100  std::map<TString, MonitorElement*> m_xSecObservedVsLS;
101  std::map<TString, MonitorElement*> m_DelivLumiVsLS;
102  std::map<TString, MonitorElement*> m_RecorLumiVsLS;
103 
104  std::map<TString, TF1*> m_templateFunctions; // For each trigger template f(InstLumi)=XSec
105 
106  std::map<int, std::map<TString, double> > m_lsCounts; // Map of counts (by bit) recorded for each LS
107 
108  // Input tags
112 
113  // ParameterSet
115 
116  // MonitorElement
118 
123 };
124 
125 #endif
std::map< int, std::map< TString, double > > m_lsCounts
edm::EDGetTokenT< Level1TriggerScalersCollection > m_scalersSource_L1TSCollection
MonitorElement * m_ErrorMonitor
std::map< int, double > m_lsDeadTime
std::map< TString, MonitorElement * > m_xSecObservedToExpected
std::map< TString, MonitorElement * > m_xSecVsInstLumi
std::map< int, int > m_lsPrescaleIndex
std::map< std::string, bool > m_inputCategories
std::map< std::string, std::string > m_selectedTriggers
std::map< int, std::map< TString, double > > m_lsRates
bool getXSexFitsPython(const edm::ParameterSet &ps)
const edm::ESGetToken< L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd > m_l1GtPfAlgoToken
std::map< TString, MonitorElement * > m_xSecObservedVsLS
void beginLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) override
void endLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) override
std::map< TString, MonitorElement * > m_xSecObservedVsDelivLumi
std::map< int, double > m_lsLuminosity
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDataDaqInputTag
edm::ParameterSet m_parameters
L1TMenuHelper::Tokens m_helperTokens
std::map< TString, MonitorElement * > m_RecorLumiVsLS
std::map< TString, TF1 * > m_templateFunctions
L1TRate_Offline(const edm::ParameterSet &ps)
~L1TRate_Offline() override
std::map< TString, MonitorElement * > m_DelivLumiVsLS
std::string m_outputFile
std::map< TString, int > m_algoBit
std::map< TString, TF1 * > m_algoFit
const std::vector< std::vector< int > > * m_listsPrescaleFactors
void analyze(const edm::Event &e, const edm::EventSetup &c) override
L1GtUtils m_l1GtUtils
std::map< TString, MonitorElement * > m_InstLumiVsLS
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &run, const edm::EventSetup &iSetup) override
std::map< TString, MonitorElement * > m_CountsVsLS
edm::EDGetTokenT< LumiScalersCollection > m_scalersSource_LSCollection
std::map< TString, MonitorElement * > m_PrescIndexVsLS
std::map< TString, MonitorElement * > m_xSecObservedVsRecorLumi
const edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > m_menuToken
Definition: Run.h:45