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  void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override;
59 
60  // Private methods
61  //private:
62 
63  // bool getXSexFitsOMDS (const edm::ParameterSet& ps);
64  bool getXSexFitsPython(const edm::ParameterSet& ps);
65 
66  // Private variables
67 private:
68  // bool
69  bool m_verbose;
70 
71  // int
72  int m_refPrescaleSet; // What is the reference prescale index to use for trigger choice
73  int m_maxNbins; // Maximum number of bins for MonitorElement
74  int m_lsShiftGTRates; // What shift (if any) to be applied to GT Rates LS number
75 
76  // string
77  std::string m_outputFile; // External output file name (for testiting)
78 
79  // Vectors
80  const std::vector<std::vector<int> >* m_listsPrescaleFactors; // Collection os all sets of prescales
81 
82  // Maps
83  std::map<int, double> m_lsDeadTime; // Map of dead time for each LS
84  std::map<int, int> m_lsPrescaleIndex; // Map of precale index for each LS
85  std::map<int, double> m_lsLuminosity; // Map of luminosity recorded for each LS
86  std::map<int, std::map<TString, double> > m_lsRates; // Map of rates (by bit) recorded for each LS
87  std::map<TString, int> m_algoBit; // Map of bit associated with a L1 Algo alias
88  std::map<TString, TF1*> m_algoFit; // 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 
94  std::map<TString, MonitorElement*> m_xSecObservedVsDelivLumi;
95  std::map<TString, MonitorElement*> m_xSecObservedVsRecorLumi;
96 
97  std::map<TString, MonitorElement*> m_CountsVsLS; // Monitor Elements for counts
98  std::map<TString, MonitorElement*> m_InstLumiVsLS; // Monitor Elements for Instant Lumi
99  std::map<TString, MonitorElement*> m_PrescIndexVsLS; // Monitor Elements for Prescale Index
100  // std::map<TString,MonitorElement*> m_DeadTimeVsLS; // Monitor Elements (Check Purpose)
101 
102  std::map<TString, MonitorElement*> m_xSecObservedVsLS;
103  std::map<TString, MonitorElement*> m_DelivLumiVsLS;
104  std::map<TString, MonitorElement*> m_RecorLumiVsLS;
105 
106  std::map<TString, TF1*> m_templateFunctions; // For each trigger template f(InstLumi)=XSec
107 
108  std::map<int, std::map<TString, double> > m_lsCounts; // Map of counts (by bit) recorded for each LS
109 
110  // Input tags
114 
115  // ParameterSet
117 
118  // MonitorElement
120 
122 };
123 
124 #endif
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
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)
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
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
Definition: Run.h:45