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