CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
15 
17 
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 
45 
46 public:
47 
48  enum Errors{
49  UNKNOWN = 1,
51  };
52 
53 public:
54 
55  L1TRate_Offline(const edm::ParameterSet& ps); // Constructor
56  virtual ~L1TRate_Offline(); // Destructor
57 
58 protected:
59 
60  void analyze (const edm::Event& e, const edm::EventSetup& c); // Analyze
61  virtual void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run& run, const edm::EventSetup& iSetup) override;
62 
63  virtual void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
64  virtual void endLuminosityBlock (edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
65  virtual void dqmBeginRun(edm::Run const&, edm::EventSetup const&);
66 
67 // Private methods
68 //private:
69 
70  // bool getXSexFitsOMDS (const edm::ParameterSet& ps);
71  bool getXSexFitsPython(const edm::ParameterSet& ps);
72 
73 // Private variables
74 private:
75 
76  // bool
77  bool m_verbose;
78 
79  // int
80  int m_refPrescaleSet; // What is the reference prescale index to use for trigger choice
81  int m_maxNbins; // Maximum number of bins for MonitorElement
82  int m_lsShiftGTRates; // What shift (if any) to be applied to GT Rates LS number
83 
84  // string
85  std::string m_outputFile; // External output file name (for testiting)
86 
87  // Vectors
88  const std::vector< std::vector<int> >* m_listsPrescaleFactors; // Collection os all sets of prescales
89 
90  // Maps
91  std::map<int,double> m_lsDeadTime; // Map of dead time for each LS
92  std::map<int,int> m_lsPrescaleIndex; // Map of precale index for each LS
93  std::map<int,double> m_lsLuminosity; // Map of luminosity recorded for each LS
94  std::map<int,std::map<TString,double> > m_lsRates; // Map of rates (by bit) recorded for each LS
95  std::map<TString,int> m_algoBit; // Map of bit associated with a L1 Algo alias
96  std::map<TString,TF1*> m_algoFit; // Map of bit associated with a L1 Algo alias
97  std::map<std::string,bool> m_inputCategories; // Map of categories to monitor
98  std::map<std::string,std::string> m_selectedTriggers; // Map of what trigger to monitor for each category
99  std::map<TString,MonitorElement*> m_xSecObservedToExpected; // Monitor Elements for Observed to Expected Algo XSec
100  std::map<TString,MonitorElement*> m_xSecVsInstLumi; // Monitor Elements for Algo XSec vs Instant Luminosity
101 
102  std::map<TString,MonitorElement*> m_xSecObservedVsDelivLumi;
103  std::map<TString,MonitorElement*> m_xSecObservedVsRecorLumi;
104 
105 
106  std::map<TString,MonitorElement*> m_CountsVsLS; // Monitor Elements for counts
107  std::map<TString,MonitorElement*> m_InstLumiVsLS; // Monitor Elements for Instant Lumi
108  std::map<TString,MonitorElement*> m_PrescIndexVsLS; // Monitor Elements for Prescale Index
109  // std::map<TString,MonitorElement*> m_DeadTimeVsLS; // Monitor Elements (Check Purpose)
110 
111  std::map<TString,MonitorElement*> m_xSecObservedVsLS;
112  std::map<TString,MonitorElement*> m_DelivLumiVsLS;
113  std::map<TString,MonitorElement*> m_RecorLumiVsLS;
114 
115  std::map<TString,TF1*> m_templateFunctions; // For each trigger template f(InstLumi)=XSec
116 
117  std::map<int,std::map<TString,double> > m_lsCounts; // Map of counts (by bit) recorded for each LS
118 
119  // Input tags
123 
124  // ParameterSet
126 
127  // MonitorElement
129 };
130 
131 #endif
virtual void beginLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
edm::EDGetTokenT< Level1TriggerScalersCollection > m_scalersSource_L1TSCollection
MonitorElement * m_ErrorMonitor
virtual void dqmBeginRun(edm::Run const &, edm::EventSetup const &)
std::map< std::string, std::string > m_selectedTriggers
virtual void endLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
std::map< TString, MonitorElement * > m_RecorLumiVsLS
std::map< TString, TF1 * > m_templateFunctions
bool getXSexFitsPython(const edm::ParameterSet &ps)
std::map< TString, MonitorElement * > m_xSecVsInstLumi
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDataDaqInputTag
std::map< int, double > m_lsLuminosity
edm::ParameterSet m_parameters
std::map< TString, MonitorElement * > m_InstLumiVsLS
virtual ~L1TRate_Offline()
L1TRate_Offline(const edm::ParameterSet &ps)
void analyze(const edm::Event &e, const edm::EventSetup &c)
std::map< TString, MonitorElement * > m_PrescIndexVsLS
std::map< TString, MonitorElement * > m_xSecObservedVsDelivLumi
std::map< TString, MonitorElement * > m_xSecObservedVsLS
std::map< TString, MonitorElement * > m_xSecObservedToExpected
std::string m_outputFile
std::map< int, int > m_lsPrescaleIndex
std::map< std::string, bool > m_inputCategories
std::map< int, std::map< TString, double > > m_lsCounts
std::map< int, double > m_lsDeadTime
std::map< TString, MonitorElement * > m_CountsVsLS
virtual void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &run, const edm::EventSetup &iSetup) override
const std::vector< std::vector< int > > * m_listsPrescaleFactors
edm::EDGetTokenT< LumiScalersCollection > m_scalersSource_LSCollection
std::map< int, std::map< TString, double > > m_lsRates
std::map< TString, int > m_algoBit
std::map< TString, MonitorElement * > m_DelivLumiVsLS
std::map< TString, MonitorElement * > m_xSecObservedVsRecorLumi
Definition: Run.h:41
std::map< TString, TF1 * > m_algoFit