CMS 3D CMS Logo

L1TSync.h
Go to the documentation of this file.
1 #ifndef L1TSync_H
2 #define L1TSync_H
3 
4 /*
5  * \file L1TSync.h
6  *
7  * \author J. Pela
8  *
9 */
10 
11 // system include files
12 #include <memory>
13 #include <unistd.h>
14 
15 // user include files
22 
24 
28 
30 
31 //DataFormats
34 
36 
38 
39 #include <TString.h>
40 
41 #include <iostream>
42 #include <fstream>
43 #include <string>
44 #include <vector>
45 
46 class L1TSync : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> {
47 public:
48  enum BeamMode {
49  NOMODE = 1,
50  SETUP = 2,
51  INJPILOT = 3,
52  INJINTR = 4,
53  INJNOMN = 5,
54  PRERAMP = 6,
55  RAMP = 7,
56  FLATTOP = 8,
57  QUEEZE = 9,
58  ADJUST = 10,
59  STABLE = 11,
60  UNSTABLE = 12,
61  BEAMDUMP = 13,
62  RAMPDOWN = 14,
63  RECOVERY = 15,
64  INJDUMP = 16,
65  CIRCDUMP = 17,
66  ABORT = 18,
67  CYCLING = 19,
68  WBDUMP = 20,
69  NOBEAM = 21
70  };
71 
72  enum Errors {
73  UNKNOWN = 1,
80  };
81 
82 public:
83  L1TSync(const edm::ParameterSet& ps); // Constructor
84  ~L1TSync() override; // Destructor
85 
86 protected:
87  void analyze(const edm::Event& e, const edm::EventSetup& c) override; // Analyze
88 
89  void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
90  void endLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
91  void bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, const edm::EventSetup&) override;
92  void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override;
93 
94  // Private Methods
95 private:
96  void getBeamConfOMDS();
97  void doFractionInSync(bool iForce = false, bool iBad = false);
98  void certifyLSBlock(std::string iTrigger, int iInitLs, int iEndLs, float iValue);
99 
100  // Variables
101 private:
103 
104  std::string m_outputFile; // file name for ROOT ouput
105 
106  // bool
107  bool m_verbose;
110 
111  // Int
113  unsigned int m_currentLS; // Current LS
114  //unsigned int m_eventLS;
115  unsigned int m_lhcFill; //
116 
117  // Vectors
118  BeamConfiguration m_beamConfig; // Current Bunch Structure
119 
120  // Const Vectors
121  const std::vector<std::vector<int> >* ListsPrescaleFactors; // Collection os all sets of prescales
122 
123  // Maps
124  std::map<TString, int> m_algoBit;
125  std::map<TString, unsigned int> m_certFirstLS; // First uncertified LS
126  std::map<TString, unsigned int> m_certLastLS; // Last uncertified LS
127  std::map<TString, MonitorElement*> m_algoCertification;
128  std::map<TString, MonitorElement*> m_algoVsBunchStructure;
129  std::map<std::string, bool> m_algoAutoSelect; // Map of categories to monitor
130  std::map<std::string, std::string> m_selectedTriggers; // Map of what trigger to monitor for each category
131 
132  // MonitorElement
134 
135  // Input tags
138 
140 };
141 
142 #endif
int m_refPrescaleSet
Definition: L1TSync.h:112
std::map< TString, int > m_algoBit
Definition: L1TSync.h:124
const std::vector< std::vector< int > > * ListsPrescaleFactors
Definition: L1TSync.h:121
void doFractionInSync(bool iForce=false, bool iBad=false)
Definition: L1TSync.cc:675
~L1TSync() override
Definition: L1TSync.cc:300
L1TSync(const edm::ParameterSet &ps)
Definition: L1TSync.cc:40
unsigned int m_lhcFill
Definition: L1TSync.h:115
BeamMode
Definition: L1TSync.h:48
void beginLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) override
Definition: L1TSync.cc:385
BeamConfiguration m_beamConfig
Definition: L1TSync.h:118
bool m_verbose
Definition: L1TSync.h:107
std::map< TString, MonitorElement * > m_algoVsBunchStructure
Definition: L1TSync.h:128
std::string m_outputFile
Definition: L1TSync.h:104
bool * m_processedLS
Definition: L1TSync.h:109
void certifyLSBlock(std::string iTrigger, int iInitLs, int iEndLs, float iValue)
Definition: L1TSync.cc:778
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &, const edm::EventSetup &) override
Definition: L1TSync.cc:311
std::map< TString, unsigned int > m_certFirstLS
Definition: L1TSync.h:125
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDataDaqInputTag
Definition: L1TSync.h:137
std::map< std::string, bool > m_algoAutoSelect
Definition: L1TSync.h:129
edm::ParameterSet m_parameters
Definition: L1TSync.h:102
void getBeamConfOMDS()
Definition: L1TSync.cc:595
void endLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) override
Definition: L1TSync.cc:420
std::map< TString, MonitorElement * > m_algoCertification
Definition: L1TSync.h:127
L1GtUtils m_l1GtUtils
Definition: L1TSync.h:139
bool m_currentLSValid
Definition: L1TSync.h:108
std::map< TString, unsigned int > m_certLastLS
Definition: L1TSync.h:126
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: L1TSync.cc:482
MonitorElement * m_ErrorMonitor
Definition: L1TSync.h:133
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > m_l1GtEvmSource
Definition: L1TSync.h:136
std::map< std::string, std::string > m_selectedTriggers
Definition: L1TSync.h:130
Errors
Definition: L1TSync.h:72
Definition: Run.h:45
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
BeginRun.
Definition: L1TSync.cc:304
unsigned int m_currentLS
Definition: L1TSync.h:113