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
36 
38 
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 }
68 class L1TSync_Offline : public one::DQMEDAnalyzer<edm::LuminosityBlockCache<ltso::LSValid>> {
69 
70  public:
71 
72  enum BeamMode{
73  NOMODE=1,
74  SETUP=2,
75  INJPILOT=3,
76  INJINTR=4,
77  INJNOMN=5,
78  PRERAMP=6,
79  RAMP=7,
80  FLATTOP=8,
81  QUEEZE=9,
82  ADJUST=10,
83  STABLE=11,
84  UNSTABLE=12,
85  BEAMDUMP=13,
86  RAMPDOWN=14,
87  RECOVERY=15,
88  INJDUMP=16,
89  CIRCDUMP=17,
90  ABORT=18,
91  CYCLING=19,
92  WBDUMP=20,
93  NOBEAM=21
94  };
95 
96  enum Errors{
97  UNKNOWN = 1,
98  WARNING_DB_CONN_FAILED = 2,
99  WARNING_DB_QUERY_FAILED = 3,
100  WARNING_DB_INCORRECT_NBUNCHES = 4,
101  ERROR_UNABLE_RETRIVE_PRODUCT = 5,
102  ERROR_TRIGGERALIAS_NOTVALID = 6,
103  ERROR_LSBLOCK_NOTVALID = 7
104  };
105 
106 
107  public:
108  // Constructor
110  // Destructor
111  ~L1TSync_Offline() override;
112 
113  protected:
114 
115  void analyze (const edm::Event& e, const edm::EventSetup& c) override; // Analyze
116  std::shared_ptr<ltso::LSValid> globalBeginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) const final;
117  void globalEndLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) final {}
118  void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override;
119  void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run&, const edm::EventSetup&) override;
120 
121 
122  // Private Methods
123  private:
124 
125  void getBeamConfOffline(const edm::Event&);
126 // no lumi block // void doFractionInSync(bool iForce=false, bool iBad=false);
127 // no lumi block // void certifyLSBlock (std::string iTrigger, int iInitLs, int iEndLs ,float iValue);
128 
129  // Variables
130  private:
131 
132  // Input parameters
134 
135  // bool
136  bool m_verbose;
137 
138  // Int
140  //unsigned int m_eventLS;
141  unsigned int m_lhcFill; //
142 
143  // Vectors
144  L1TBeamConfiguration m_beamConfig; // Current Bunch Structure
145 
146  // Const Vectors
147  const std::vector< std::vector<int> >* ListsPrescaleFactors; // Collection os all sets of prescales
148 
149  // Maps
150  std::map<TString,int> m_algoBit;
151  std::map<TString,unsigned int> m_certFirstLS; // First uncertified LS
152  std::map<TString,unsigned int> m_certLastLS; // Last uncertified LS
153  std::map<TString,MonitorElement*> m_algoCertification;
154  std::map<TString,MonitorElement*> m_algoVsBunchStructure;
155  std::map<std::string,bool> m_algoAutoSelect; // Map of categories to monitor
156  std::map<std::string,std::string> m_selectedTriggers; // Map of what trigger to monitor for each category
157 
158  // MonitorElement
160 
161  // Input tags
164 
166 };
167 
168 #endif
std::map< TString, unsigned int > m_certLastLS
MonitorElement * m_ErrorMonitor
std::map< std::string, std::string > m_selectedTriggers
std::map< TString, unsigned int > m_certFirstLS
0: Unidentified isolated particle
Definition: ParticleCode.h:19
L1GtUtils m_l1GtUtils
edm::ParameterSet m_parameters
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
std::map< TString, int > m_algoBit
unsigned int m_lhcFill
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< TString, MonitorElement * > m_algoCertification
std::map< std::string, bool > m_algoAutoSelect
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > m_l1GtEvmSource
L1TBeamConfiguration m_beamConfig
const std::vector< std::vector< int > > * ListsPrescaleFactors
std::map< TString, MonitorElement * > m_algoVsBunchStructure
Definition: Run.h:45