CMS 3D CMS Logo

GlobalBoard.h
Go to the documentation of this file.
1 #ifndef GtBoard_h
2 #define GtBoard_h
3 
15 // system include files
16 #include <bitset>
17 #include <cassert>
18 #include <vector>
19 
20 // user include files
23 
25 
26 // Trigger Objects
34 
35 // Objects to produce for the output record.
38 
43 
44 // forward declarations
45 class TriggerMenu;
46 class L1CaloGeometry;
47 class L1MuTriggerScales;
48 //class L1GtEtaPhiConversions;
49 
50 // class declaration
51 
52 namespace l1t {
53 
54  class GlobalBoard {
55  public:
56  // constructors
57  GlobalBoard();
58 
59  // destructor
60  virtual ~GlobalBoard();
61 
62  public:
69  const bool receiveEG,
70  const int nrL1EG,
71  const bool receiveTau,
72  const int nrL1Tau,
73  const bool receiveJet,
74  const int nrL1Jet,
75  const bool receiveEtSums);
76 
79  const bool receiveMu,
80  const int nrL1Mu);
81 
84  const bool receiveMuShower,
85  const int nrL1MuShower);
86 
87  void receiveExternalData(edm::Event&, const edm::EDGetTokenT<BXVector<GlobalExtBlk>>&, const bool receiveExt);
88 
90  void init(const int numberPhysTriggers,
91  const int nrL1Mu,
92  const int nrL1MuShower,
93  const int nrL1EG,
94  const int nrL1Tau,
95  const int nrL1Jet,
96  int bxFirst,
97  int bxLast);
98 
100  void runGTL(edm::Event& iEvent,
101  const edm::EventSetup& evSetup,
102  const TriggerMenu* m_l1GtMenu,
103  const bool produceL1GtObjectMapRecord,
104  const int iBxInEvent,
105  std::unique_ptr<GlobalObjectMapRecord>& gtObjectMapRecord, //GTO
106  const unsigned int numberPhysTriggers,
107  const int nrL1Mu,
108  const int nrL1MuShower,
109  const int nrL1EG,
110  const int nrL1Tau,
111  const int nrL1Jet);
112 
114  void runFDL(edm::Event& iEvent,
115  const int iBxInEvent,
116  const int totalBxInEvent,
117  const unsigned int numberPhysTriggers,
118  const std::vector<double>& prescaleFactorsAlgoTrig,
119  const std::vector<unsigned int>& triggerMaskAlgoTrig,
120  const std::vector<int>& triggerMaskVetoAlgoTrig,
121  const bool algorithmTriggersUnprescaled,
122  const bool algorithmTriggersUnmasked);
123 
125  void fillAlgRecord(int iBxInEvent,
126  std::unique_ptr<GlobalAlgBlkBxCollection>& uGtAlgRecord,
127  int prescaleSet,
128  int menuUUID,
129  int firmwareUUID);
130 
132  void reset();
133  void resetMu();
134  void resetMuonShower();
135  void resetCalo();
136  void resetExternal();
137 
139  void printGmtData(const int iBxInEvent) const;
140 
142  inline const std::bitset<GlobalAlgBlk::maxPhysicsTriggers>& getDecisionWord() const { return m_gtlDecisionWord; }
143 
145  inline const std::bitset<GlobalAlgBlk::maxPhysicsTriggers>& getAlgorithmOR() const { return m_gtlAlgorithmOR; }
146 
148  inline const BXVector<const l1t::Muon*>* getCandL1Mu() const { return m_candL1Mu; }
149 
152 
154  inline const BXVector<const l1t::L1Candidate*>* getCandL1EG() const { return m_candL1EG; }
155 
158 
161 
163  inline const BXVector<const l1t::EtSum*>* getCandL1EtSum() const { return m_candL1EtSum; }
164 
167 
168  //initializer prescale counter using a semi-random value between [1, prescale value]
169  static const std::vector<double> semirandomNumber(const edm::Event& iEvent,
170  const std::vector<double>& prescaleFactorsAlgoTrig);
171 
172  /* Drop individual EtSums for Now
174  inline const l1t::EtSum* getCandL1ETM() const
175  {
176  return m_candETM;
177  }
178 
180  inline const l1t::EtSum* getCandL1ETT() const
181  {
182  return m_candETT;
183  }
184 
186  inline const l1t::EtSum* getCandL1HTT() const
187  {
188  return m_candHTT;
189  }
190 
192  inline const l1t::EtSum* getCandL1HTM() const
193  {
194  return m_candHTM;
195  }
196 */
197 
198  void setBxFirst(int bx);
199  void setBxLast(int bx);
200 
203 
204  public:
205  inline void setVerbosity(const int verbosity) { m_verbosity = verbosity; }
206 
207  private:
208  // cached stuff
209 
210  // trigger menu
212  unsigned long long m_l1GtMenuCacheID;
213 
214  // L1 scales (phi, eta) for Mu, Calo and EnergySum objects
216  unsigned long long m_l1CaloGeometryCacheID;
217 
219  unsigned long long m_l1MuTriggerScalesCacheID;
220 
221  // conversions for eta and phi
222  // L1GtEtaPhiConversions* m_gtEtaPhiConversions;
223 
224  private:
232 
233  // BXVector<const l1t::EtSum*>* m_candETM;
234  // BXVector<const l1t::EtSum*>* m_candETT;
235  // BXVector<const l1t::EtSum*>* m_candHTM;
236  // BXVector<const l1t::EtSum*>* m_candHTT;
237 
240 
241  std::bitset<GlobalAlgBlk::maxPhysicsTriggers> m_gtlAlgorithmOR;
242  std::bitset<GlobalAlgBlk::maxPhysicsTriggers> m_gtlDecisionWord;
243 
245 
246  // cache of maps
247  std::vector<AlgorithmEvaluation::ConditionEvaluationMap> m_conditionResultMaps;
248 
250  std::vector<std::vector<double>> m_prescaleCounterAlgoTrig;
251 
252  bool m_firstEv;
255 
256  private:
260 
261  // Flags for the OR of all algorithms at various stages. (Single bx)
267 
268  // Counter for number of events seen by this board
269  unsigned int m_boardEventCount;
270 
271  // Information about board
274 
275  //whether we reset the prescales each lumi or not
277 
278  // start the PS counter from a random value between [1,PS] instead of PS
280  };
281 
282 } // namespace l1t
283 #endif
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GlobalBoard.h:225
const std::bitset< GlobalAlgBlk::maxPhysicsTriggers > & getDecisionWord() const
return decision
Definition: GlobalBoard.h:142
const std::bitset< GlobalAlgBlk::maxPhysicsTriggers > & getAlgorithmOR() const
return algorithm OR decision
Definition: GlobalBoard.h:145
std::vector< std::vector< double > > m_prescaleCounterAlgoTrig
prescale counters: NumberPhysTriggers counters per bunch cross in event
Definition: GlobalBoard.h:250
void setSemiRandomInitialPSCounters(bool val)
Definition: GlobalBoard.h:202
BXVector< const l1t::L1Candidate * > * m_candL1EG
Definition: GlobalBoard.h:227
void fillAlgRecord(int iBxInEvent, std::unique_ptr< GlobalAlgBlkBxCollection > &uGtAlgRecord, int prescaleSet, int menuUUID, int firmwareUUID)
Fill the Daq Records.
const L1MuTriggerScales * m_l1MuTriggerScales
Definition: GlobalBoard.h:218
static const std::vector< double > semirandomNumber(const edm::Event &iEvent, const std::vector< double > &prescaleFactorsAlgoTrig)
unsigned long long m_l1MuTriggerScalesCacheID
Definition: GlobalBoard.h:219
delete x;
Definition: CaloConfig.h:22
void setBxLast(int bx)
Definition: GlobalBoard.cc:110
const BXVector< const l1t::L1Candidate * > * getCandL1Tau() const
pointer to Tau data list
Definition: GlobalBoard.h:160
const BXVector< const l1t::MuonShower * > * getCandL1MuShower() const
return global muon trigger candidate
Definition: GlobalBoard.h:151
bool m_semiRandomInitialPSCounters
Definition: GlobalBoard.h:279
void printGmtData(const int iBxInEvent) const
print received Muon dataWord
unsigned long long m_l1GtMenuCacheID
Definition: GlobalBoard.h:212
void receiveCaloObjectData(edm::Event &, const edm::EDGetTokenT< BXVector< l1t::EGamma >> &, const edm::EDGetTokenT< BXVector< l1t::Tau >> &, const edm::EDGetTokenT< BXVector< l1t::Jet >> &, const edm::EDGetTokenT< BXVector< l1t::EtSum >> &, const bool receiveEG, const int nrL1EG, const bool receiveTau, const int nrL1Tau, const bool receiveJet, const int nrL1Jet, const bool receiveEtSums)
receive data from Global Muon Trigger
Definition: GlobalBoard.cc:138
void setVerbosity(const int verbosity)
Definition: GlobalBoard.h:205
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlDecisionWord
Definition: GlobalBoard.h:242
int m_verbosity
verbosity level
Definition: GlobalBoard.h:258
int iEvent
Definition: GenABIO.cc:224
unsigned int m_boardEventCount
Definition: GlobalBoard.h:269
BXVector< const l1t::EtSum * > * m_candL1EtSum
Definition: GlobalBoard.h:230
const TriggerMenu * m_l1GtMenu
Definition: GlobalBoard.h:211
void runFDL(edm::Event &iEvent, const int iBxInEvent, const int totalBxInEvent, const unsigned int numberPhysTriggers, const std::vector< double > &prescaleFactorsAlgoTrig, const std::vector< unsigned int > &triggerMaskAlgoTrig, const std::vector< int > &triggerMaskVetoAlgoTrig, const bool algorithmTriggersUnprescaled, const bool algorithmTriggersUnmasked)
run the uGT FDL (Apply Prescales and Veto)
Definition: GlobalBoard.cc:958
const L1CaloGeometry * m_l1CaloGeometry
Definition: GlobalBoard.h:215
BXVector< const l1t::MuonShower * > * m_candL1MuShower
Definition: GlobalBoard.h:226
void reset()
clear uGT
unsigned long long m_l1CaloGeometryCacheID
Definition: GlobalBoard.h:216
void runGTL(edm::Event &iEvent, const edm::EventSetup &evSetup, const TriggerMenu *m_l1GtMenu, const bool produceL1GtObjectMapRecord, const int iBxInEvent, std::unique_ptr< GlobalObjectMapRecord > &gtObjectMapRecord, const unsigned int numberPhysTriggers, const int nrL1Mu, const int nrL1MuShower, const int nrL1EG, const int nrL1Tau, const int nrL1Jet)
run the uGT GTL (Conditions and Algorithms)
Definition: GlobalBoard.cc:484
const BXVector< const GlobalExtBlk * > * getCandL1External() const
pointer to Tau data list
Definition: GlobalBoard.h:166
BXVector< const l1t::L1Candidate * > * m_candL1Jet
Definition: GlobalBoard.h:229
GlobalAlgBlk m_uGtAlgBlk
Definition: GlobalBoard.h:244
BXVector< const GlobalExtBlk * > * m_candL1External
Definition: GlobalBoard.h:231
void setBxFirst(int bx)
Definition: GlobalBoard.cc:108
const BXVector< const l1t::L1Candidate * > * getCandL1Jet() const
pointer to Jet data list
Definition: GlobalBoard.h:157
void setResetPSCountersEachLumiSec(bool val)
Definition: GlobalBoard.h:201
const BXVector< const l1t::EtSum * > * getCandL1EtSum() const
pointer to Tau data list
Definition: GlobalBoard.h:163
const BXVector< const l1t::Muon * > * getCandL1Mu() const
return global muon trigger candidate
Definition: GlobalBoard.h:148
bool m_firstEvLumiSegment
Definition: GlobalBoard.h:253
void receiveMuonObjectData(edm::Event &, const edm::EDGetTokenT< BXVector< l1t::Muon >> &, const bool receiveMu, const int nrL1Mu)
Definition: GlobalBoard.cc:340
virtual ~GlobalBoard()
Definition: GlobalBoard.cc:94
void init(const int numberPhysTriggers, const int nrL1Mu, const int nrL1MuShower, const int nrL1EG, const int nrL1Tau, const int nrL1Jet, int bxFirst, int bxLast)
initialize the class (mainly reserve)
Definition: GlobalBoard.cc:112
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlAlgorithmOR
Definition: GlobalBoard.h:241
void receiveMuonShowerObjectData(edm::Event &, const edm::EDGetTokenT< BXVector< l1t::MuonShower >> &, const bool receiveMuShower, const int nrL1MuShower)
Definition: GlobalBoard.cc:394
bool m_resetPSCountersEachLumiSec
Definition: GlobalBoard.h:276
void receiveExternalData(edm::Event &, const edm::EDGetTokenT< BXVector< GlobalExtBlk >> &, const bool receiveExt)
Definition: GlobalBoard.cc:442
const BXVector< const l1t::L1Candidate * > * getCandL1EG() const
pointer to EG data list
Definition: GlobalBoard.h:154
BXVector< const l1t::L1Candidate * > * m_candL1Tau
Definition: GlobalBoard.h:228
std::vector< AlgorithmEvaluation::ConditionEvaluationMap > m_conditionResultMaps
Definition: GlobalBoard.h:247