CMS 3D CMS Logo

L1TSync_Offline.h
Go to the documentation of this file.
1 #ifndef DQMOffline_L1Trigger_L1TSync_Offline_h
2 #define DQMOffline_L1Trigger_L1TSync_Offline_h
3 
4 /*
5  * \class L1TSync_Offline
6  *
7  *
8  * Description: offline DQM module for L1Trigger/bunchStructure synchronization
9  *
10  * Implementation:
11  * <TODO: enter implementation details>
12  *
13  * \author: Pietro Vischia - LIP Lisbon pietro.vischia@gmail.com
14  *
15  * Changelog:
16  * 2012/08/10 11:01:01: First creation. Dummy module with actual code commented.
17  *
18  * Todo:
19  * - implement the module in offline
20  * - check if there are user includes specific for offline/online that should be changed
21  *
22  *
23  */
24 
25 // System include files
26 #include <memory>
27 #include <unistd.h>
28 
29 // User include files
37 
39 
43 
44 //L1 includes and dataformats
48 
50 
52 
53 #include <TString.h>
54 
55 #include <iostream>
56 #include <fstream>
57 #include <string>
58 #include <vector>
59 
60 // Forward declarations
61 
62 // Class declaration
63 namespace ltso {
64  struct LSValid {
65  bool lsIsValid = true;
66  };
67 } // namespace ltso
68 class L1TSync_Offline : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<ltso::LSValid>> {
69 public:
70  enum BeamMode {
71  NOMODE = 1,
72  SETUP = 2,
73  INJPILOT = 3,
74  INJINTR = 4,
75  INJNOMN = 5,
76  PRERAMP = 6,
77  RAMP = 7,
78  FLATTOP = 8,
79  QUEEZE = 9,
80  ADJUST = 10,
81  STABLE = 11,
82  UNSTABLE = 12,
83  BEAMDUMP = 13,
84  RAMPDOWN = 14,
85  RECOVERY = 15,
86  INJDUMP = 16,
87  CIRCDUMP = 17,
88  ABORT = 18,
89  CYCLING = 19,
90  WBDUMP = 20,
91  NOBEAM = 21
92  };
93 
94  enum Errors {
95  UNKNOWN = 1,
96  WARNING_DB_CONN_FAILED = 2,
97  WARNING_DB_QUERY_FAILED = 3,
98  WARNING_DB_INCORRECT_NBUNCHES = 4,
99  ERROR_UNABLE_RETRIVE_PRODUCT = 5,
100  ERROR_TRIGGERALIAS_NOTVALID = 6,
101  ERROR_LSBLOCK_NOTVALID = 7
102  };
103 
104 public:
105  // Constructor
107  // Destructor
108  ~L1TSync_Offline() override;
109 
110 protected:
111  void analyze(const edm::Event& e, const edm::EventSetup& c) override; // Analyze
112  std::shared_ptr<ltso::LSValid> globalBeginLuminosityBlock(edm::LuminosityBlock const& lumiBlock,
113  edm::EventSetup const& c) const final;
114  void globalEndLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) final {}
115  void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override;
116  void bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, const edm::EventSetup&) override;
117 
118  // Private Methods
119 private:
120  void getBeamConfOffline(const edm::Event&);
121  // no lumi block // void doFractionInSync(bool iForce=false, bool iBad=false);
122  // no lumi block // void certifyLSBlock (std::string iTrigger, int iInitLs, int iEndLs ,float iValue);
123 
124  // Variables
125 private:
126  // Input parameters
128 
129  // bool
130  bool m_verbose;
131 
132  // Int
134  //unsigned int m_eventLS;
135  unsigned int m_lhcFill; //
136 
137  // Vectors
138  L1TBeamConfiguration m_beamConfig; // Current Bunch Structure
139 
140  // Const Vectors
141  const std::vector<std::vector<int>>* ListsPrescaleFactors; // Collection os all sets of prescales
142 
143  // Maps
144  std::map<TString, int> m_algoBit;
145  std::map<TString, unsigned int> m_certFirstLS; // First uncertified LS
146  std::map<TString, unsigned int> m_certLastLS; // Last uncertified LS
147  std::map<TString, MonitorElement*> m_algoCertification;
148  std::map<TString, MonitorElement*> m_algoVsBunchStructure;
149  std::map<std::string, bool> m_algoAutoSelect; // Map of categories to monitor
150  std::map<std::string, std::string> m_selectedTriggers; // Map of what trigger to monitor for each category
151 
152  // MonitorElement
154 
155  // Input tags
158 
160 };
161 
162 #endif
MonitorElement * m_ErrorMonitor
std::map< TString, MonitorElement * > m_algoCertification
const std::vector< std::vector< int > > * ListsPrescaleFactors
L1GtUtils m_l1GtUtils
edm::ParameterSet m_parameters
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
unsigned int m_lhcFill
std::map< TString, int > m_algoBit
std::map< std::string, bool > m_algoAutoSelect
std::map< TString, MonitorElement * > m_algoVsBunchStructure
example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
void globalEndLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) final
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDataDaqInputTag
std::map< std::string, std::string > m_selectedTriggers
std::map< TString, unsigned int > m_certFirstLS
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > m_l1GtEvmSource
L1TBeamConfiguration m_beamConfig
std::map< TString, unsigned int > m_certLastLS
Definition: Run.h:45