CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
l1t::GlobalBoard Class Reference

#include <GlobalBoard.h>

Public Member Functions

void fillAlgRecord (int iBxInEvent, std::unique_ptr< GlobalAlgBlkBxCollection > &uGtAlgRecord, int prescaleSet, int menuUUID, int firmwareUUID)
 Fill the Daq Records. More...
 
const std::bitset
< GlobalAlgBlk::maxPhysicsTriggers > & 
getAlgorithmOR () const
 return algorithm OR decision More...
 
const BXVector< const
l1t::L1Candidate * > * 
getCandL1EG () const
 pointer to EG data list More...
 
const BXVector< const
l1t::EtSum * > * 
getCandL1EtSum () const
 pointer to Tau data list More...
 
const BXVector< const
GlobalExtBlk * > * 
getCandL1External () const
 pointer to Tau data list More...
 
const BXVector< const
l1t::L1Candidate * > * 
getCandL1Jet () const
 pointer to Jet data list More...
 
const BXVector< const
l1t::Muon * > * 
getCandL1Mu () const
 return global muon trigger candidate More...
 
const BXVector< const
l1t::L1Candidate * > * 
getCandL1Tau () const
 pointer to Tau data list More...
 
const std::bitset
< GlobalAlgBlk::maxPhysicsTriggers > & 
getDecisionWord () const
 return decision More...
 
 GlobalBoard ()
 
void init (const int numberPhysTriggers, const int nrL1Mu, const int nrL1EG, const int nrL1Tau, const int nrL1Jet, int bxFirst, int bxLast)
 initialize the class (mainly reserve) More...
 
void printGmtData (const int iBxInEvent) const
 print received Muon dataWord More...
 
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 More...
 
void receiveExternalData (edm::Event &, const edm::EDGetTokenT< BXVector< GlobalExtBlk >> &, const bool receiveExt)
 
void receiveMuonObjectData (edm::Event &, const edm::EDGetTokenT< BXVector< l1t::Muon >> &, const bool receiveMu, const int nrL1Mu)
 
void reset ()
 clear uGT More...
 
void resetCalo ()
 
void resetExternal ()
 
void resetMu ()
 
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) More...
 
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 nrL1EG, const int nrL1Tau, const int nrL1Jet)
 run the uGT GTL (Conditions and Algorithms) More...
 
void setBxFirst (int bx)
 
void setBxLast (int bx)
 
void setVerbosity (const int verbosity)
 
virtual ~GlobalBoard ()
 

Private Attributes

bool m_algFinalOr
 
bool m_algFinalOrVeto
 
bool m_algInitialOr
 
bool m_algIntermOr
 
bool m_algPrescaledOr
 
unsigned int m_boardEventCount
 
int m_bxFirst_
 
int m_bxLast_
 
BXVector< const
l1t::L1Candidate * > * 
m_candL1EG
 
BXVector< const l1t::EtSum * > * m_candL1EtSum
 
BXVector< const GlobalExtBlk * > * m_candL1External
 
BXVector< const
l1t::L1Candidate * > * 
m_candL1Jet
 
BXVector< const l1t::Muon * > * m_candL1Mu
 
BXVector< const
l1t::L1Candidate * > * 
m_candL1Tau
 
std::vector
< AlgorithmEvaluation::ConditionEvaluationMap
m_conditionResultMaps
 
uint m_currentLumi
 
bool m_firstEv
 
bool m_firstEvLumiSegment
 
std::bitset
< GlobalAlgBlk::maxPhysicsTriggers
m_gtlAlgorithmOR
 
std::bitset
< GlobalAlgBlk::maxPhysicsTriggers
m_gtlDecisionWord
 
bool m_isDebugEnabled
 
const L1CaloGeometrym_l1CaloGeometry
 
unsigned long long m_l1CaloGeometryCacheID
 
const TriggerMenum_l1GtMenu
 
unsigned long long m_l1GtMenuCacheID
 
const L1MuTriggerScalesm_l1MuTriggerScales
 
unsigned long long m_l1MuTriggerScalesCacheID
 
std::vector< std::vector
< double > > 
m_prescaleCounterAlgoTrig
 prescale counters: NumberPhysTriggers counters per bunch cross in event More...
 
GlobalAlgBlk m_uGtAlgBlk
 
int m_uGtBoardNumber
 
bool m_uGtFinalBoard
 
int m_verbosity
 verbosity level More...
 

Detailed Description

Definition at line 52 of file GlobalBoard.h.

Constructor & Destructor Documentation

GlobalBoard::GlobalBoard ( )

Definition at line 61 of file GlobalBoard.cc.

References m_boardEventCount, m_gtlAlgorithmOR, m_gtlDecisionWord, m_l1CaloGeometryCacheID, m_l1GtMenuCacheID, m_l1MuTriggerScalesCacheID, m_uGtAlgBlk, m_uGtBoardNumber, m_uGtFinalBoard, and GlobalAlgBlk::reset().

68  m_firstEv(true),
70  m_currentLumi(0),
73 
74  m_gtlAlgorithmOR.reset();
75  m_gtlDecisionWord.reset();
76 
77  // initialize cached IDs
78  m_l1GtMenuCacheID = 0ULL;
81 
82  // Counter for number of events board sees
84 
85  // Need to expand use with more than one uGt GlobalBoard for now assume 1
86  m_uGtBoardNumber = 0;
87  m_uGtFinalBoard = true;
88 }
bool isDebugEnabled()
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GlobalBoard.h:205
BXVector< const l1t::L1Candidate * > * m_candL1EG
Definition: GlobalBoard.h:206
unsigned long long m_l1MuTriggerScalesCacheID
Definition: GlobalBoard.h:199
unsigned long long m_l1GtMenuCacheID
Definition: GlobalBoard.h:192
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlDecisionWord
Definition: GlobalBoard.h:221
unsigned int m_boardEventCount
Definition: GlobalBoard.h:248
BXVector< const l1t::EtSum * > * m_candL1EtSum
Definition: GlobalBoard.h:209
void reset()
reset the content of a GlobalAlgBlk
unsigned long long m_l1CaloGeometryCacheID
Definition: GlobalBoard.h:196
BXVector< const l1t::L1Candidate * > * m_candL1Jet
Definition: GlobalBoard.h:208
GlobalAlgBlk m_uGtAlgBlk
Definition: GlobalBoard.h:223
BXVector< const GlobalExtBlk * > * m_candL1External
Definition: GlobalBoard.h:210
bool m_firstEvLumiSegment
Definition: GlobalBoard.h:232
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlAlgorithmOR
Definition: GlobalBoard.h:220
BXVector< const l1t::L1Candidate * > * m_candL1Tau
Definition: GlobalBoard.h:207
GlobalBoard::~GlobalBoard ( )
virtual

Definition at line 91 of file GlobalBoard.cc.

91  {
92  //reset(); //why would we need a reset?
93  delete m_candL1Mu;
94  delete m_candL1EG;
95  delete m_candL1Tau;
96  delete m_candL1Jet;
97  delete m_candL1EtSum;
98  delete m_candL1External;
99 
100  // delete m_gtEtaPhiConversions;
101 }
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GlobalBoard.h:205
BXVector< const l1t::L1Candidate * > * m_candL1EG
Definition: GlobalBoard.h:206
BXVector< const l1t::EtSum * > * m_candL1EtSum
Definition: GlobalBoard.h:209
BXVector< const l1t::L1Candidate * > * m_candL1Jet
Definition: GlobalBoard.h:208
BXVector< const GlobalExtBlk * > * m_candL1External
Definition: GlobalBoard.h:210
BXVector< const l1t::L1Candidate * > * m_candL1Tau
Definition: GlobalBoard.h:207

Member Function Documentation

void GlobalBoard::fillAlgRecord ( int  iBxInEvent,
std::unique_ptr< GlobalAlgBlkBxCollection > &  uGtAlgRecord,
int  prescaleSet,
int  menuUUID,
int  firmwareUUID 
)

Fill the Daq Records.

Definition at line 1017 of file GlobalBoard.cc.

References LogDebug.

1021  {
1022  if (m_verbosity) {
1023  LogDebug("L1TGlobal") << "\n**** GlobalBoard fill DAQ Records for bx= " << iBxInEvent << std::endl;
1024  }
1025 
1026  // Set header information
1027  m_uGtAlgBlk.setbxInEventNr((iBxInEvent & 0xF));
1028  m_uGtAlgBlk.setPreScColumn(prescaleSet);
1029  m_uGtAlgBlk.setL1MenuUUID(menuUUID);
1030  m_uGtAlgBlk.setL1FirmwareUUID(firmwareUUID);
1031 
1035 
1036  uGtAlgRecord->push_back(iBxInEvent, m_uGtAlgBlk);
1037 }
void setL1MenuUUID(int uuid)
set simple members
Definition: GlobalAlgBlk.h:55
void setFinalORPreVeto(bool fOR)
Definition: GlobalAlgBlk.h:59
void setbxInEventNr(int bxNr)
Definition: GlobalAlgBlk.h:57
int m_verbosity
verbosity level
Definition: GlobalBoard.h:237
void setFinalOR(bool fOR)
Definition: GlobalAlgBlk.h:60
void setFinalORVeto(bool fOR)
Definition: GlobalAlgBlk.h:58
GlobalAlgBlk m_uGtAlgBlk
Definition: GlobalBoard.h:223
void setL1FirmwareUUID(int fuuid)
Definition: GlobalAlgBlk.h:56
void setPreScColumn(int psC)
Definition: GlobalAlgBlk.h:61
#define LogDebug(id)
const std::bitset<GlobalAlgBlk::maxPhysicsTriggers>& l1t::GlobalBoard::getAlgorithmOR ( ) const
inline

return algorithm OR decision

Definition at line 135 of file GlobalBoard.h.

References m_gtlAlgorithmOR.

135 { return m_gtlAlgorithmOR; }
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlAlgorithmOR
Definition: GlobalBoard.h:220
const BXVector<const l1t::L1Candidate*>* l1t::GlobalBoard::getCandL1EG ( ) const
inline

pointer to EG data list

Definition at line 141 of file GlobalBoard.h.

References m_candL1EG.

141 { return m_candL1EG; }
BXVector< const l1t::L1Candidate * > * m_candL1EG
Definition: GlobalBoard.h:206
const BXVector<const l1t::EtSum*>* l1t::GlobalBoard::getCandL1EtSum ( ) const
inline

pointer to Tau data list

Definition at line 150 of file GlobalBoard.h.

References m_candL1EtSum.

150 { return m_candL1EtSum; }
BXVector< const l1t::EtSum * > * m_candL1EtSum
Definition: GlobalBoard.h:209
const BXVector<const GlobalExtBlk*>* l1t::GlobalBoard::getCandL1External ( ) const
inline

pointer to Tau data list

Definition at line 153 of file GlobalBoard.h.

References m_candL1External.

153 { return m_candL1External; }
BXVector< const GlobalExtBlk * > * m_candL1External
Definition: GlobalBoard.h:210
const BXVector<const l1t::L1Candidate*>* l1t::GlobalBoard::getCandL1Jet ( ) const
inline

pointer to Jet data list

Definition at line 144 of file GlobalBoard.h.

References m_candL1Jet.

144 { return m_candL1Jet; }
BXVector< const l1t::L1Candidate * > * m_candL1Jet
Definition: GlobalBoard.h:208
const BXVector<const l1t::Muon*>* l1t::GlobalBoard::getCandL1Mu ( ) const
inline

return global muon trigger candidate

Definition at line 138 of file GlobalBoard.h.

References m_candL1Mu.

138 { return m_candL1Mu; }
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GlobalBoard.h:205
const BXVector<const l1t::L1Candidate*>* l1t::GlobalBoard::getCandL1Tau ( ) const
inline

pointer to Tau data list

Definition at line 147 of file GlobalBoard.h.

References m_candL1Tau.

147 { return m_candL1Tau; }
BXVector< const l1t::L1Candidate * > * m_candL1Tau
Definition: GlobalBoard.h:207
const std::bitset<GlobalAlgBlk::maxPhysicsTriggers>& l1t::GlobalBoard::getDecisionWord ( ) const
inline

return decision

Definition at line 132 of file GlobalBoard.h.

References m_gtlDecisionWord.

132 { return m_gtlDecisionWord; }
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlDecisionWord
Definition: GlobalBoard.h:221
void GlobalBoard::init ( const int  numberPhysTriggers,
const int  nrL1Mu,
const int  nrL1EG,
const int  nrL1Tau,
const int  nrL1Jet,
int  bxFirst,
int  bxLast 
)

initialize the class (mainly reserve)

Definition at line 108 of file GlobalBoard.cc.

References LogDebug.

114  {
115  setBxFirst(bxFirst);
116  setBxLast(bxLast);
117 
118  m_candL1Mu->setBXRange(m_bxFirst_, m_bxLast_);
119  m_candL1EG->setBXRange(m_bxFirst_, m_bxLast_);
120  m_candL1Tau->setBXRange(m_bxFirst_, m_bxLast_);
121  m_candL1Jet->setBXRange(m_bxFirst_, m_bxLast_);
122  m_candL1EtSum->setBXRange(m_bxFirst_, m_bxLast_);
124 
125  m_uGtAlgBlk.reset();
126 
127  LogDebug("L1TGlobal") << "\t Initializing Board with bxFirst = " << m_bxFirst_ << ", bxLast = " << m_bxLast_
128  << std::endl;
129 }
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GlobalBoard.h:205
BXVector< const l1t::L1Candidate * > * m_candL1EG
Definition: GlobalBoard.h:206
void setBxLast(int bx)
Definition: GlobalBoard.cc:106
BXVector< const l1t::EtSum * > * m_candL1EtSum
Definition: GlobalBoard.h:209
void reset()
reset the content of a GlobalAlgBlk
BXVector< const l1t::L1Candidate * > * m_candL1Jet
Definition: GlobalBoard.h:208
GlobalAlgBlk m_uGtAlgBlk
Definition: GlobalBoard.h:223
BXVector< const GlobalExtBlk * > * m_candL1External
Definition: GlobalBoard.h:210
void setBxFirst(int bx)
Definition: GlobalBoard.cc:104
void setBXRange(int bxFirst, int bxLast)
BXVector< const l1t::L1Candidate * > * m_candL1Tau
Definition: GlobalBoard.h:207
#define LogDebug(id)
void GlobalBoard::printGmtData ( const int  iBxInEvent) const

print received Muon dataWord

Definition at line 1076 of file GlobalBoard.cc.

References LogTrace.

1076  {
1077  LogTrace("L1TGlobal") << "\nl1t::L1GlobalTrigger: uGMT data received for BxInEvent = " << iBxInEvent << std::endl;
1078 
1079  int nrL1Mu = m_candL1Mu->size(iBxInEvent);
1080  LogTrace("L1TGlobal") << "Number of GMT muons = " << nrL1Mu << "\n" << std::endl;
1081 
1082  LogTrace("L1TGlobal") << std::endl;
1083 }
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GlobalBoard.h:205
#define LogTrace(id)
void GlobalBoard::receiveCaloObjectData ( edm::Event iEvent,
const edm::EDGetTokenT< BXVector< l1t::EGamma >> &  egInputToken,
const edm::EDGetTokenT< BXVector< l1t::Tau >> &  tauInputToken,
const edm::EDGetTokenT< BXVector< l1t::Jet >> &  jetInputToken,
const edm::EDGetTokenT< BXVector< l1t::EtSum >> &  sumInputToken,
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 at line 132 of file GlobalBoard.cc.

References edm::Event::getByToken(), mps_fire::i, edm::HandleBase::isValid(), metsig::jet, LogDebug, LogTrace, and metsig::tau.

143  {
144  if (m_verbosity) {
145  LogDebug("L1TGlobal") << "\n**** Board receiving Calo Data "
146  //<< "\n from input tag " << caloInputTag << "\n"
147  << std::endl;
148  }
149 
150  resetCalo();
151 
152  // get data from Calorimeter
153  if (receiveEG) {
155  iEvent.getByToken(egInputToken, egData);
156 
157  if (!egData.isValid()) {
158  if (m_verbosity) {
159  edm::LogWarning("L1TGlobal") << "\nWarning: BXVector<l1t::EGamma> with input tag "
160  //<< caloInputTag
161  << "\nrequested in configuration, but not found in the event.\n"
162  << std::endl;
163  }
164  } else {
165  // bx in EG data
166  for (int i = egData->getFirstBX(); i <= egData->getLastBX(); ++i) {
167  // Prevent from pushing back bx that is outside of allowed range
168  if (i < m_bxFirst_ || i > m_bxLast_)
169  continue;
170 
171  //Loop over EG in this bx
172  int nObj = 0;
173  for (std::vector<l1t::EGamma>::const_iterator eg = egData->begin(i); eg != egData->end(i); ++eg) {
174  if (nObj < nrL1EG) {
175  (*m_candL1EG).push_back(i, &(*eg));
176  } else {
177  edm::LogWarning("L1TGlobal") << " Too many EG (" << nObj << ") for uGT Configuration maxEG =" << nrL1EG
178  << std::endl;
179  }
180  LogDebug("L1TGlobal") << "EG Pt " << eg->hwPt() << " Eta " << eg->hwEta() << " Phi " << eg->hwPhi()
181  << " Qual " << eg->hwQual() << " Iso " << eg->hwIso() << std::endl;
182 
183  nObj++;
184  } //end loop over EG in bx
185  } //end loop over bx
186 
187  } //end if over valid EG data
188 
189  } //end if ReveiveEG data
190 
191  if (receiveTau) {
193  iEvent.getByToken(tauInputToken, tauData);
194 
195  if (!tauData.isValid()) {
196  if (m_verbosity) {
197  edm::LogWarning("L1TGlobal") << "\nWarning: BXVector<l1t::Tau> with input tag "
198  //<< caloInputTag
199  << "\nrequested in configuration, but not found in the event.\n"
200  << std::endl;
201  }
202  } else {
203  // bx in tau data
204  for (int i = tauData->getFirstBX(); i <= tauData->getLastBX(); ++i) {
205  // Prevent from pushing back bx that is outside of allowed range
206  if (i < m_bxFirst_ || i > m_bxLast_)
207  continue;
208 
209  //Loop over tau in this bx
210  int nObj = 0;
211  for (std::vector<l1t::Tau>::const_iterator tau = tauData->begin(i); tau != tauData->end(i); ++tau) {
212  if (nObj < nrL1Tau) {
213  (*m_candL1Tau).push_back(i, &(*tau));
214  } else {
215  LogTrace("L1TGlobal") << " Too many Tau (" << nObj << ") for uGT Configuration maxTau =" << nrL1Tau
216  << std::endl;
217  }
218 
219  LogDebug("L1TGlobal") << "tau Pt " << tau->hwPt() << " Eta " << tau->hwEta() << " Phi " << tau->hwPhi()
220  << " Qual " << tau->hwQual() << " Iso " << tau->hwIso() << std::endl;
221  nObj++;
222 
223  } //end loop over tau in bx
224  } //end loop over bx
225 
226  } //end if over valid tau data
227 
228  } //end if ReveiveTau data
229 
230  if (receiveJet) {
232  iEvent.getByToken(jetInputToken, jetData);
233 
234  if (!jetData.isValid()) {
235  if (m_verbosity) {
236  edm::LogWarning("L1TGlobal") << "\nWarning: BXVector<l1t::Jet> with input tag "
237  //<< caloInputTag
238  << "\nrequested in configuration, but not found in the event.\n"
239  << std::endl;
240  }
241  } else {
242  // bx in jet data
243  for (int i = jetData->getFirstBX(); i <= jetData->getLastBX(); ++i) {
244  // Prevent from pushing back bx that is outside of allowed range
245  if (i < m_bxFirst_ || i > m_bxLast_)
246  continue;
247 
248  //Loop over jet in this bx
249  int nObj = 0;
250  for (std::vector<l1t::Jet>::const_iterator jet = jetData->begin(i); jet != jetData->end(i); ++jet) {
251  if (nObj < nrL1Jet) {
252  (*m_candL1Jet).push_back(i, &(*jet));
253  } else {
254  edm::LogWarning("L1TGlobal") << " Too many Jets (" << nObj << ") for uGT Configuration maxJet =" << nrL1Jet
255  << std::endl;
256  }
257 
258  LogDebug("L1TGlobal") << "Jet Pt " << jet->hwPt() << " Eta " << jet->hwEta() << " Phi " << jet->hwPhi()
259  << " Qual " << jet->hwQual() << " Iso " << jet->hwIso() << std::endl;
260  nObj++;
261  } //end loop over jet in bx
262  } //end loop over bx
263 
264  } //end if over valid jet data
265 
266  } //end if ReveiveJet data
267 
268  if (receiveEtSums) {
270  iEvent.getByToken(sumInputToken, etSumData);
271 
272  if (!etSumData.isValid()) {
273  if (m_verbosity) {
274  edm::LogWarning("L1TGlobal") << "\nWarning: BXVector<l1t::EtSum> with input tag "
275  //<< caloInputTag
276  << "\nrequested in configuration, but not found in the event.\n"
277  << std::endl;
278  }
279  } else {
280  for (int i = etSumData->getFirstBX(); i <= etSumData->getLastBX(); ++i) {
281  // Prevent from pushing back bx that is outside of allowed range
282  if (i < m_bxFirst_ || i > m_bxLast_)
283  continue;
284 
285  //Loop over jet in this bx
286  for (std::vector<l1t::EtSum>::const_iterator etsum = etSumData->begin(i); etsum != etSumData->end(i); ++etsum) {
287  (*m_candL1EtSum).push_back(i, &(*etsum));
288 
289  /* In case we need to split these out
290  switch ( etsum->getType() ) {
291  case l1t::EtSum::EtSumType::kMissingEt:
292  {
293  //(*m_candETM).push_back(i,&(*etsum));
294  LogDebug("L1TGlobal") << "ETM: Pt " << etsum->hwPt() << " Phi " << etsum->hwPhi() << std::endl;
295  }
296  break;
297  case l1t::EtSum::EtSumType::kMissingHt:
298  {
299  //(*m_candHTM).push_back(i,&(*etsum));
300  LogDebug("L1TGlobal") << "HTM: Pt " << etsum->hwPt() << " Phi " << etsum->hwPhi() << std::endl;
301  }
302  break;
303  case l1t::EtSum::EtSumType::kTotalEt:
304  {
305  //(*m_candETT).push_back(i,&(*etsum));
306  LogDebug("L1TGlobal") << "ETT: Pt " << etsum->hwPt() << std::endl;
307  }
308  break;
309  case l1t::EtSum::EtSumType::kTotalHt:
310  {
311  //(*m_candHTT).push_back(i,&(*etsum));
312  LogDebug("L1TGlobal") << "HTT: Pt " << etsum->hwPt() << std::endl;
313  }
314  break;
315  case l1t::EtSum::EtSumType::kTowerCount:
316  {
317  //(*m_candTowerCount).push_back(i,&(*etsum));
318  LogDebug("L1TGlobal") << "TowerCount: " << etsum->hwPt() << std::endl;
319  }
320  break;
321  default:
322  LogDebug("L1TGlobal") << "Default encounted " << std::endl;
323  break;
324  }
325 */
326 
327  } //end loop over jet in bx
328  } //end loop over Bx
329  }
330  }
331 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
#define LogTrace(id)
int m_verbosity
verbosity level
Definition: GlobalBoard.h:237
bool isValid() const
Definition: HandleBase.h:70
Log< level::Warning, false > LogWarning
#define LogDebug(id)
void GlobalBoard::receiveExternalData ( edm::Event iEvent,
const edm::EDGetTokenT< BXVector< GlobalExtBlk >> &  extInputToken,
const bool  receiveExt 
)

Definition at line 388 of file GlobalBoard.cc.

References edm::Event::getByToken(), mps_fire::i, edm::HandleBase::isValid(), and LogDebug.

390  {
391  if (m_verbosity) {
392  LogDebug("L1TGlobal") << "\n**** GlobalBoard receiving external data = "
393  //<< "\n from input tag " << muInputTag << "\n"
394  << std::endl;
395  }
396 
397  resetExternal();
398 
399  // get data from Global Muon Trigger
400  if (receiveExt) {
402  iEvent.getByToken(extInputToken, extData);
403 
404  if (!extData.isValid()) {
405  if (m_verbosity) {
406  edm::LogWarning("L1TGlobal") << "\nWarning: BXVector<GlobalExtBlk> with input tag "
407  //<< muInputTag
408  << "\nrequested in configuration, but not found in the event.\n"
409  << std::endl;
410  }
411  } else {
412  // bx in muon data
413  for (int i = extData->getFirstBX(); i <= extData->getLastBX(); ++i) {
414  // Prevent from pushing back bx that is outside of allowed range
415  if (i < m_bxFirst_ || i > m_bxLast_)
416  continue;
417 
418  //Loop over ext in this bx
419  for (std::vector<GlobalExtBlk>::const_iterator ext = extData->begin(i); ext != extData->end(i); ++ext) {
420  (*m_candL1External).push_back(i, &(*ext));
421  } //end loop over ext in bx
422  } //end loop over bx
423 
424  } //end if over valid ext data
425 
426  } //end if ReveiveExt data
427 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
int m_verbosity
verbosity level
Definition: GlobalBoard.h:237
bool isValid() const
Definition: HandleBase.h:70
Log< level::Warning, false > LogWarning
#define LogDebug(id)
void GlobalBoard::receiveMuonObjectData ( edm::Event iEvent,
const edm::EDGetTokenT< BXVector< l1t::Muon >> &  muInputToken,
const bool  receiveMu,
const int  nrL1Mu 
)

Definition at line 334 of file GlobalBoard.cc.

References edm::Event::getByToken(), mps_fire::i, edm::HandleBase::isValid(), LogDebug, and RPCpg::mu.

337  {
338  if (m_verbosity) {
339  LogDebug("L1TGlobal") << "\n**** GlobalBoard receiving muon data = "
340  //<< "\n from input tag " << muInputTag << "\n"
341  << std::endl;
342  }
343 
344  resetMu();
345 
346  // get data from Global Muon Trigger
347  if (receiveMu) {
349  iEvent.getByToken(muInputToken, muonData);
350 
351  if (!muonData.isValid()) {
352  if (m_verbosity) {
353  edm::LogWarning("L1TGlobal") << "\nWarning: BXVector<l1t::Muon> with input tag "
354  //<< muInputTag
355  << "\nrequested in configuration, but not found in the event.\n"
356  << std::endl;
357  }
358  } else {
359  // bx in muon data
360  for (int i = muonData->getFirstBX(); i <= muonData->getLastBX(); ++i) {
361  // Prevent from pushing back bx that is outside of allowed range
362  if (i < m_bxFirst_ || i > m_bxLast_)
363  continue;
364 
365  //Loop over Muons in this bx
366  int nObj = 0;
367  for (std::vector<l1t::Muon>::const_iterator mu = muonData->begin(i); mu != muonData->end(i); ++mu) {
368  if (nObj < nrL1Mu) {
369  (*m_candL1Mu).push_back(i, &(*mu));
370  } else {
371  edm::LogWarning("L1TGlobal") << " Too many Muons (" << nObj << ") for uGT Configuration maxMu =" << nrL1Mu
372  << std::endl;
373  }
374 
375  LogDebug("L1TGlobal") << "Muon Pt " << mu->hwPt() << " EtaAtVtx " << mu->hwEtaAtVtx() << " PhiAtVtx "
376  << mu->hwPhiAtVtx() << " Qual " << mu->hwQual() << " Iso " << mu->hwIso()
377  << std::endl;
378  nObj++;
379  } //end loop over muons in bx
380  } //end loop over bx
381 
382  } //end if over valid muon data
383 
384  } //end if ReveiveMuon data
385 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
int m_verbosity
verbosity level
Definition: GlobalBoard.h:237
const int mu
Definition: Constants.h:22
bool isValid() const
Definition: HandleBase.h:70
Log< level::Warning, false > LogWarning
#define LogDebug(id)
void GlobalBoard::reset ( void  )

clear uGT

Definition at line 1040 of file GlobalBoard.cc.

1040  {
1041  resetMu();
1042  resetCalo();
1043  resetExternal();
1044 
1045  m_uGtAlgBlk.reset();
1046 
1047  m_gtlDecisionWord.reset();
1048  m_gtlAlgorithmOR.reset();
1049 }
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlDecisionWord
Definition: GlobalBoard.h:221
void reset()
reset the content of a GlobalAlgBlk
GlobalAlgBlk m_uGtAlgBlk
Definition: GlobalBoard.h:223
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlAlgorithmOR
Definition: GlobalBoard.h:220
void GlobalBoard::resetCalo ( )

Definition at line 1058 of file GlobalBoard.cc.

1058  {
1059  m_candL1EG->clear();
1060  m_candL1Tau->clear();
1061  m_candL1Jet->clear();
1062  m_candL1EtSum->clear();
1063 
1064  m_candL1EG->setBXRange(m_bxFirst_, m_bxLast_);
1065  m_candL1Tau->setBXRange(m_bxFirst_, m_bxLast_);
1066  m_candL1Jet->setBXRange(m_bxFirst_, m_bxLast_);
1067  m_candL1EtSum->setBXRange(m_bxFirst_, m_bxLast_);
1068 }
BXVector< const l1t::L1Candidate * > * m_candL1EG
Definition: GlobalBoard.h:206
BXVector< const l1t::EtSum * > * m_candL1EtSum
Definition: GlobalBoard.h:209
BXVector< const l1t::L1Candidate * > * m_candL1Jet
Definition: GlobalBoard.h:208
BXVector< const l1t::L1Candidate * > * m_candL1Tau
Definition: GlobalBoard.h:207
void GlobalBoard::resetExternal ( )

Definition at line 1070 of file GlobalBoard.cc.

1070  {
1073 }
BXVector< const GlobalExtBlk * > * m_candL1External
Definition: GlobalBoard.h:210
void clear()
void setBXRange(int bxFirst, int bxLast)
void GlobalBoard::resetMu ( )

Definition at line 1052 of file GlobalBoard.cc.

1052  {
1053  m_candL1Mu->clear();
1054  m_candL1Mu->setBXRange(m_bxFirst_, m_bxLast_);
1055 }
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GlobalBoard.h:205
void GlobalBoard::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)

if we are masking.

Definition at line 885 of file GlobalBoard.cc.

References LogDebug, and edm::EventBase::luminosityBlock().

893  {
894  if (m_verbosity) {
895  LogDebug("L1TGlobal") << "\n**** GlobalBoard apply Final Decision Logic " << std::endl;
896  }
897 
898  // prescale counters are reset at the beginning of the luminosity segment
899  if (m_firstEv) {
900  // prescale counters: numberPhysTriggers counters per bunch cross
901  m_prescaleCounterAlgoTrig.reserve(numberPhysTriggers * totalBxInEvent);
902 
903  for (int iBxInEvent = 0; iBxInEvent <= totalBxInEvent; ++iBxInEvent) {
904  m_prescaleCounterAlgoTrig.push_back(prescaleFactorsAlgoTrig);
905  }
906  m_firstEv = false;
907  m_currentLumi = iEvent.luminosityBlock();
908  }
909 
910  // update and clear prescales at the beginning of the luminosity segment
913  for (int iBxInEvent = 0; iBxInEvent <= totalBxInEvent; ++iBxInEvent) {
914  m_prescaleCounterAlgoTrig.push_back(prescaleFactorsAlgoTrig);
915  }
916 
917  m_firstEvLumiSegment = false;
918  m_currentLumi = iEvent.luminosityBlock();
919  }
920 
921  // Copy Algorithm bits to Prescaled word
922  // Prescaling and Masking done below if requested.
924 
925  // -------------------------------------------
926  // Apply Prescales or skip if turned off
927  // -------------------------------------------
928  if (!algorithmTriggersUnprescaled) {
929  // iBxInEvent is ... -2 -1 0 1 2 ... while counters are 0 1 2 3 4 ...
930  int inBxInEvent = totalBxInEvent / 2 + iBxInEvent;
931 
932  bool temp_algPrescaledOr = false;
933  bool alreadyReported = false;
934  for (unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
935  bool bitValue = m_uGtAlgBlk.getAlgoDecisionInitial(iBit);
936  if (bitValue) {
937  // Make sure algo bit in range, warn otherwise
938  if (iBit < prescaleFactorsAlgoTrig.size()) {
939  if (prescaleFactorsAlgoTrig.at(iBit) != 1) {
940  (m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit))--;
941  if (m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit) == 0) {
942  // bit already true in algoDecisionWord, just reset counter
943  m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit) = prescaleFactorsAlgoTrig.at(iBit);
944  temp_algPrescaledOr = true;
945  } else {
946  // change bit to false in prescaled word and final decision word
947  m_uGtAlgBlk.setAlgoDecisionInterm(iBit, false);
948 
949  } //if Prescale counter reached zero
950  } //if prescale factor is not 1 (ie. no prescale)
951  else {
952  temp_algPrescaledOr = true;
953  }
954  } // require bit in range
955  else if (!alreadyReported) {
956  alreadyReported = true;
957  edm::LogWarning("L1TGlobal") << "\nWarning: algoBit >= prescaleFactorsAlgoTrig.size() in bx " << iBxInEvent
958  << std::endl;
959  }
960  } //if algo bit is set true
961  } //loop over alg bits
962 
963  m_algPrescaledOr = temp_algPrescaledOr; //temp
964 
965  } else {
966  // Since not Prescaling just take OR of Initial Work
968 
969  } //if we are going to apply prescales.
970 
971  // Copy Algorithm bits fron Prescaled word to Final Word
972  // Masking done below if requested.
974 
975  if (!algorithmTriggersUnmasked) {
976  bool temp_algFinalOr = false;
977  bool alreadyReported = false;
978  for (unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
979  bool bitValue = m_uGtAlgBlk.getAlgoDecisionInterm(iBit);
980 
981  if (bitValue) {
982  //bool isMasked = ( triggerMaskAlgoTrig.at(iBit) == 0 );
983  bool isMasked = false;
984  if (iBit < triggerMaskAlgoTrig.size())
985  isMasked = (triggerMaskAlgoTrig.at(iBit) == 0);
986  else if (!alreadyReported) {
987  alreadyReported = true;
988  edm::LogWarning("L1TGlobal") << "\nWarning: algoBit >= triggerMaskAlgoTrig.size() in bx " << iBxInEvent
989  << std::endl;
990  }
991 
992  bool passMask = (bitValue && !isMasked);
993 
994  if (passMask)
995  temp_algFinalOr = true;
996  else
997  m_uGtAlgBlk.setAlgoDecisionFinal(iBit, false);
998 
999  // Check if veto mask is true, if it is, set the event veto flag.
1000  if (triggerMaskVetoAlgoTrig.at(iBit) == 1)
1001  m_algFinalOrVeto = true;
1002  }
1003  }
1004 
1005  m_algIntermOr = temp_algFinalOr;
1006 
1007  } else {
1009 
1010  }
1011 
1012  // Set FinalOR for this board
1014 }
std::vector< bool > const & getAlgoDecisionInitial() const
Get decision bits.
Definition: GlobalAlgBlk.h:82
void copyIntermToFinal()
Definition: GlobalAlgBlk.h:74
std::vector< std::vector< double > > m_prescaleCounterAlgoTrig
prescale counters: NumberPhysTriggers counters per bunch cross in event
Definition: GlobalBoard.h:229
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
void copyInitialToInterm()
Copy vectors words.
Definition: GlobalAlgBlk.h:73
int m_verbosity
verbosity level
Definition: GlobalBoard.h:237
void setAlgoDecisionInterm(unsigned int bit, bool val)
Definition: GlobalAlgBlk.cc:84
GlobalAlgBlk m_uGtAlgBlk
Definition: GlobalBoard.h:223
bool m_firstEvLumiSegment
Definition: GlobalBoard.h:232
std::vector< bool > const & getAlgoDecisionInterm() const
Definition: GlobalAlgBlk.h:83
Log< level::Warning, false > LogWarning
void setAlgoDecisionFinal(unsigned int bit, bool val)
Definition: GlobalAlgBlk.cc:94
#define LogDebug(id)
void GlobalBoard::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  nrL1EG,
const int  nrL1Tau,
const int  nrL1Jet 
)

run the uGT GTL (Conditions and Algorithms)

DMP Start debugging here

Definition at line 430 of file GlobalBoard.cc.

References CorrelationThreeBodyTemplate::cond0Category(), CorrelationTemplate::cond0Category(), CorrelationWithOverlapRemovalTemplate::cond0Category(), CorrelationThreeBodyTemplate::cond0Index(), CorrelationTemplate::cond0Index(), CorrelationWithOverlapRemovalTemplate::cond0Index(), CorrelationThreeBodyTemplate::cond1Category(), CorrelationTemplate::cond1Category(), CorrelationWithOverlapRemovalTemplate::cond1Category(), CorrelationThreeBodyTemplate::cond1Index(), CorrelationTemplate::cond1Index(), CorrelationWithOverlapRemovalTemplate::cond1Index(), CorrelationThreeBodyTemplate::cond2Category(), CorrelationWithOverlapRemovalTemplate::cond2Category(), CorrelationThreeBodyTemplate::cond2Index(), CorrelationWithOverlapRemovalTemplate::cond2Index(), l1t::CondCalo, l1t::CondCorrelation, l1t::CondCorrelationThreeBody, l1t::CondCorrelationWithOverlapRemoval, l1t::CondEnergySum, l1t::CondExternal, l1t::CondMuon, l1t::CondNull, TriggerMenu::corCaloTemplate(), TriggerMenu::corEnergySumTemplate(), TriggerMenu::corMuonTemplate(), l1t::AlgorithmEvaluation::evaluateAlgorithm(), l1t::ConditionEvaluation::evaluateConditionStoreResult(), newFWLiteAna::found, l1t::GlobalScales::getScalesName(), l1t::AlgorithmEvaluation::gtAlgoCombinationVector(), l1t::AlgorithmEvaluation::gtAlgoResult(), TriggerMenu::gtAlgorithmMap(), TriggerMenu::gtConditionMap(), TriggerMenu::gtScales(), LogDebug, LogTrace, match(), l1t::AlgorithmEvaluation::operandTokenVector(), print(), l1t::EnergySumCondition::print(), l1t::MuCondition::print(), l1t::ExternalCondition::print(), l1t::CorrCondition::print(), l1t::CaloCondition::print(), l1t::CorrThreeBodyCondition::print(), l1t::CorrWithOverlapRemovalCondition::print(), l1t::AlgorithmEvaluation::print(), GlobalObjectMap::print(), GlobalObjectMap::setAlgoBitNumber(), GlobalObjectMap::setAlgoGtlResult(), GlobalObjectMap::setAlgoName(), l1t::CorrCondition::setScales(), l1t::CorrThreeBodyCondition::setScales(), l1t::CorrWithOverlapRemovalCondition::setScales(), l1t::ConditionEvaluation::setVerbosity(), AlCaHLTBitMon_QueryRunRegistry::string, GlobalObjectMap::swapCombinationVector(), GlobalObjectMap::swapObjectTypeVector(), and GlobalObjectMap::swapOperandTokenVector().

440  {
441  const std::vector<ConditionMap>& conditionMap = m_l1GtMenu->gtConditionMap();
442  const AlgorithmMap& algorithmMap = m_l1GtMenu->gtAlgorithmMap();
443  const GlobalScales& gtScales = m_l1GtMenu->gtScales();
444  const std::string scaleSetName = gtScales.getScalesName();
445  LogDebug("L1TGlobal") << " L1 Menu Scales -- Set Name: " << scaleSetName << std::endl;
446 
447  // Reset AlgBlk for this bx
448  m_uGtAlgBlk.reset();
449  m_algInitialOr = false;
450  m_algPrescaledOr = false;
451  m_algIntermOr = false;
452  m_algFinalOr = false;
453  m_algFinalOrVeto = false;
454 
455  const std::vector<std::vector<MuonTemplate>>& corrMuon = m_l1GtMenu->corMuonTemplate();
456 
457  // Comment out for now
458  const std::vector<std::vector<CaloTemplate>>& corrCalo = m_l1GtMenu->corCaloTemplate();
459 
460  const std::vector<std::vector<EnergySumTemplate>>& corrEnergySum = m_l1GtMenu->corEnergySumTemplate();
461 
462  LogDebug("L1TGlobal") << "Size corrMuon " << corrMuon.size() << "\nSize corrCalo " << corrCalo.size()
463  << "\nSize corrSums " << corrEnergySum.size() << std::endl;
464 
465  // loop over condition maps (one map per condition chip)
466  // then loop over conditions in the map
467  // save the results in temporary maps
468 
469  // never happens in production but at first event...
470  if (m_conditionResultMaps.size() != conditionMap.size()) {
471  m_conditionResultMaps.clear();
472  m_conditionResultMaps.resize(conditionMap.size());
473  }
474 
475  int iChip = -1;
476 
477  for (std::vector<ConditionMap>::const_iterator itCondOnChip = conditionMap.begin();
478  itCondOnChip != conditionMap.end();
479  itCondOnChip++) {
480  iChip++;
481 
483 
484  for (CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
485  // evaluate condition
486  switch ((itCond->second)->condCategory()) {
487  case CondMuon: {
488  // BLW Not sure what to do with this for now
489  const int ifMuEtaNumberBits = 0;
490 
491  MuCondition* muCondition = new MuCondition(itCond->second, this, nrL1Mu, ifMuEtaNumberBits);
492 
493  muCondition->setVerbosity(m_verbosity);
494 
495  muCondition->evaluateConditionStoreResult(iBxInEvent);
496 
497  // BLW COmment out for now
498  cMapResults[itCond->first] = muCondition;
499 
500  if (m_verbosity && m_isDebugEnabled) {
501  std::ostringstream myCout;
502  muCondition->print(myCout);
503 
504  LogTrace("L1TGlobal") << myCout.str() << std::endl;
505  }
506  //delete muCondition;
507 
508  } break;
509  case CondCalo: {
510  // BLW Not sure w hat to do with this for now
511  const int ifCaloEtaNumberBits = 0;
512 
513  CaloCondition* caloCondition =
514  new CaloCondition(itCond->second, this, nrL1EG, nrL1Jet, nrL1Tau, ifCaloEtaNumberBits);
515 
516  caloCondition->setVerbosity(m_verbosity);
517 
518  caloCondition->evaluateConditionStoreResult(iBxInEvent);
519 
520  cMapResults[itCond->first] = caloCondition;
521 
522  if (m_verbosity && m_isDebugEnabled) {
523  std::ostringstream myCout;
524  caloCondition->print(myCout);
525 
526  LogTrace("L1TGlobal") << myCout.str() << std::endl;
527  }
528  // delete caloCondition;
529 
530  } break;
531  case CondEnergySum: {
532  EnergySumCondition* eSumCondition = new EnergySumCondition(itCond->second, this);
533 
534  eSumCondition->setVerbosity(m_verbosity);
535  eSumCondition->evaluateConditionStoreResult(iBxInEvent);
536 
537  cMapResults[itCond->first] = eSumCondition;
538 
539  if (m_verbosity && m_isDebugEnabled) {
540  std::ostringstream myCout;
541  eSumCondition->print(myCout);
542 
543  LogTrace("L1TGlobal") << myCout.str() << std::endl;
544  }
545  // delete eSumCondition;
546 
547  } break;
548 
549  case CondExternal: {
550  ExternalCondition* extCondition = new ExternalCondition(itCond->second, this);
551 
552  extCondition->setVerbosity(m_verbosity);
553  extCondition->evaluateConditionStoreResult(iBxInEvent);
554 
555  cMapResults[itCond->first] = extCondition;
556 
557  if (m_verbosity && m_isDebugEnabled) {
558  std::ostringstream myCout;
559  extCondition->print(myCout);
560 
561  LogTrace("L1TGlobal") << myCout.str() << std::endl;
562  }
563  // delete extCondition;
564 
565  } break;
566  case CondCorrelation: {
567  // get first the sub-conditions
568  const CorrelationTemplate* corrTemplate = static_cast<const CorrelationTemplate*>(itCond->second);
569  const GtConditionCategory cond0Categ = corrTemplate->cond0Category();
570  const GtConditionCategory cond1Categ = corrTemplate->cond1Category();
571  const int cond0Ind = corrTemplate->cond0Index();
572  const int cond1Ind = corrTemplate->cond1Index();
573 
574  const GlobalCondition* cond0Condition = nullptr;
575  const GlobalCondition* cond1Condition = nullptr;
576 
577  // maximum number of objects received for evaluation of l1t::Type1s condition
578  int cond0NrL1Objects = 0;
579  int cond1NrL1Objects = 0;
580  LogDebug("L1TGlobal") << " cond0NrL1Objects" << cond0NrL1Objects << " cond1NrL1Objects " << cond1NrL1Objects
581  << std::endl;
582 
583  switch (cond0Categ) {
584  case CondMuon: {
585  cond0Condition = &((corrMuon[iChip])[cond0Ind]);
586  } break;
587  case CondCalo: {
588  cond0Condition = &((corrCalo[iChip])[cond0Ind]);
589  } break;
590  case CondEnergySum: {
591  cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
592  } break;
593  default: {
594  // do nothing, should not arrive here
595  } break;
596  }
597 
598  switch (cond1Categ) {
599  case CondMuon: {
600  cond1Condition = &((corrMuon[iChip])[cond1Ind]);
601  } break;
602  case CondCalo: {
603  cond1Condition = &((corrCalo[iChip])[cond1Ind]);
604  } break;
605  case CondEnergySum: {
606  cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
607  } break;
608  default: {
609  // do nothing, should not arrive here
610  } break;
611  }
612 
613  CorrCondition* correlationCond = new CorrCondition(itCond->second, cond0Condition, cond1Condition, this);
614 
615  correlationCond->setVerbosity(m_verbosity);
616  correlationCond->setScales(&gtScales);
617  correlationCond->evaluateConditionStoreResult(iBxInEvent);
618 
619  cMapResults[itCond->first] = correlationCond;
620 
621  if (m_verbosity && m_isDebugEnabled) {
622  std::ostringstream myCout;
623  correlationCond->print(myCout);
624 
625  LogTrace("L1TGlobal") << myCout.str() << std::endl;
626  }
627 
628  // delete correlationCond;
629 
630  } break;
632  // get first the sub-conditions
633  const CorrelationThreeBodyTemplate* corrTemplate =
634  static_cast<const CorrelationThreeBodyTemplate*>(itCond->second);
635  const GtConditionCategory cond0Categ = corrTemplate->cond0Category();
636  const GtConditionCategory cond1Categ = corrTemplate->cond1Category();
637  const GtConditionCategory cond2Categ = corrTemplate->cond2Category();
638  const int cond0Ind = corrTemplate->cond0Index();
639  const int cond1Ind = corrTemplate->cond1Index();
640  const int cond2Ind = corrTemplate->cond2Index();
641 
642  const GlobalCondition* cond0Condition = nullptr;
643  const GlobalCondition* cond1Condition = nullptr;
644  const GlobalCondition* cond2Condition = nullptr;
645 
646  // maximum number of objects received for evaluation of l1t::Type1s condition
647  int cond0NrL1Objects = 0;
648  int cond1NrL1Objects = 0;
649  int cond2NrL1Objects = 0;
650  LogDebug("L1TGlobal") << " cond0NrL1Objects " << cond0NrL1Objects << " cond1NrL1Objects "
651  << cond1NrL1Objects << " cond2NrL1Objects " << cond2NrL1Objects << std::endl;
652  if (cond0Categ == CondMuon) {
653  cond0Condition = &((corrMuon[iChip])[cond0Ind]);
654  } else {
655  LogDebug("L1TGlobal") << "No muon0 to evaluate three-body correlation condition";
656  }
657  if (cond1Categ == CondMuon) {
658  cond1Condition = &((corrMuon[iChip])[cond1Ind]);
659  } else {
660  LogDebug("L1TGlobal") << "No muon1 to evaluate three-body correlation condition";
661  }
662  if (cond2Categ == CondMuon) {
663  cond2Condition = &((corrMuon[iChip])[cond2Ind]);
664  } else {
665  LogDebug("L1TGlobal") << "No muon2 to evaluate three-body correlation condition";
666  }
667 
668  CorrThreeBodyCondition* correlationThreeBodyCond =
669  new CorrThreeBodyCondition(itCond->second, cond0Condition, cond1Condition, cond2Condition, this);
670 
671  correlationThreeBodyCond->setVerbosity(m_verbosity);
672  correlationThreeBodyCond->setScales(&gtScales);
673  correlationThreeBodyCond->evaluateConditionStoreResult(iBxInEvent);
674  cMapResults[itCond->first] = correlationThreeBodyCond;
675 
676  if (m_verbosity && m_isDebugEnabled) {
677  std::ostringstream myCout;
678  correlationThreeBodyCond->print(myCout);
679 
680  LogTrace("L1TGlobal") << myCout.str() << std::endl;
681  }
682  // delete correlationThreeBodyCond;
683  } break;
684 
686  // get first the sub-conditions
687  const CorrelationWithOverlapRemovalTemplate* corrTemplate =
688  static_cast<const CorrelationWithOverlapRemovalTemplate*>(itCond->second);
689  const GtConditionCategory cond0Categ = corrTemplate->cond0Category();
690  const GtConditionCategory cond1Categ = corrTemplate->cond1Category();
691  const GtConditionCategory cond2Categ = corrTemplate->cond2Category();
692  const int cond0Ind = corrTemplate->cond0Index();
693  const int cond1Ind = corrTemplate->cond1Index();
694  const int cond2Ind = corrTemplate->cond2Index();
695 
696  const GlobalCondition* cond0Condition = nullptr;
697  const GlobalCondition* cond1Condition = nullptr;
698  const GlobalCondition* cond2Condition = nullptr;
699 
700  // maximum number of objects received for evaluation of l1t::Type1s condition
701  int cond0NrL1Objects = 0;
702  int cond1NrL1Objects = 0;
703  int cond2NrL1Objects = 0;
704  LogDebug("L1TGlobal") << " cond0NrL1Objects" << cond0NrL1Objects << " cond1NrL1Objects " << cond1NrL1Objects
705  << " cond2NrL1Objects " << cond2NrL1Objects << std::endl;
706 
707  switch (cond0Categ) {
708  case CondMuon: {
709  cond0Condition = &((corrMuon[iChip])[cond0Ind]);
710  } break;
711  case CondCalo: {
712  cond0Condition = &((corrCalo[iChip])[cond0Ind]);
713  } break;
714  case CondEnergySum: {
715  cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
716  } break;
717  default: {
718  // do nothing, should not arrive here
719  } break;
720  }
721 
722  switch (cond1Categ) {
723  case CondMuon: {
724  cond1Condition = &((corrMuon[iChip])[cond1Ind]);
725  } break;
726  case CondCalo: {
727  cond1Condition = &((corrCalo[iChip])[cond1Ind]);
728  } break;
729  case CondEnergySum: {
730  cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
731  } break;
732  default: {
733  // do nothing, should not arrive here
734  } break;
735  }
736 
737  switch (cond2Categ) {
738  case CondMuon: {
739  cond2Condition = &((corrMuon[iChip])[cond2Ind]);
740  } break;
741  case CondCalo: {
742  cond2Condition = &((corrCalo[iChip])[cond2Ind]);
743  } break;
744  case CondEnergySum: {
745  cond2Condition = &((corrEnergySum[iChip])[cond2Ind]);
746  } break;
747  default: {
748  // do nothing, should not arrive here
749  } break;
750  }
751 
752  CorrWithOverlapRemovalCondition* correlationCondWOR =
753  new CorrWithOverlapRemovalCondition(itCond->second, cond0Condition, cond1Condition, cond2Condition, this);
754 
755  correlationCondWOR->setVerbosity(m_verbosity);
756  correlationCondWOR->setScales(&gtScales);
757  correlationCondWOR->evaluateConditionStoreResult(iBxInEvent);
758 
759  cMapResults[itCond->first] = correlationCondWOR;
760 
761  if (m_verbosity && m_isDebugEnabled) {
762  std::ostringstream myCout;
763  correlationCondWOR->print(myCout);
764 
765  LogTrace("L1TGlobal") << myCout.str() << std::endl;
766  }
767 
768  // delete correlationCondWOR;
769 
770  } break;
771  case CondNull: {
772  // do nothing
773 
774  } break;
775  default: {
776  // do nothing
777 
778  } break;
779  }
780  }
781  }
782 
783  // loop over algorithm map
785  // empty vector for object maps - filled during loop
786  std::vector<GlobalObjectMap> objMapVec;
787  if (produceL1GtObjectMapRecord && (iBxInEvent == 0))
788  objMapVec.reserve(numberPhysTriggers);
789 
790  for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
791  AlgorithmEvaluation gtAlg(itAlgo->second);
792  gtAlg.evaluateAlgorithm((itAlgo->second).algoChipNumber(), m_conditionResultMaps);
793 
794  int algBitNumber = (itAlgo->second).algoBitNumber();
795  bool algResult = gtAlg.gtAlgoResult();
796 
797  LogDebug("L1TGlobal") << " ===> for iBxInEvent = " << iBxInEvent << ":\t algBitName = " << itAlgo->first
798  << ",\t algBitNumber = " << algBitNumber << ",\t algResult = " << algResult << std::endl;
799 
800  if (algResult) {
801  // m_gtlAlgorithmOR.set(algBitNumber);
802  m_uGtAlgBlk.setAlgoDecisionInitial(algBitNumber, algResult);
803  m_algInitialOr = true;
804  }
805 
806  if (m_verbosity && m_isDebugEnabled) {
807  std::ostringstream myCout;
808  (itAlgo->second).print(myCout);
809  gtAlg.print(myCout);
810 
811  LogTrace("L1TGlobal") << myCout.str() << std::endl;
812  }
813 
814  // object maps only for BxInEvent = 0
815  if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
816  std::vector<L1TObjectTypeInCond> otypes;
817  for (auto iop = gtAlg.operandTokenVector().begin(); iop != gtAlg.operandTokenVector().end(); ++iop) {
818  //cout << "INFO: operand name: " << iop->tokenName << "\n";
819  int myChip = -1;
820  int found = 0;
821  L1TObjectTypeInCond otype;
822  for (auto imap = conditionMap.begin(); imap != conditionMap.end(); imap++) {
823  myChip++;
824  auto match = imap->find(iop->tokenName);
825 
826  if (match != imap->end()) {
827  found = 1;
828  //cout << "DEBUG: found match for " << iop->tokenName << " at " << match->first << "\n";
829 
830  otype = match->second->objectType();
831 
832  for (auto itype = otype.begin(); itype != otype.end(); itype++) {
833  //cout << "type: " << *itype << "\n";
834  }
835  }
836  }
837  if (!found) {
838  edm::LogWarning("L1TGlobal") << "\n Failed to find match for operand token " << iop->tokenName << "\n";
839  } else {
840  otypes.push_back(otype);
841  }
842  }
843 
844  // set object map
845  GlobalObjectMap objMap;
846 
847  objMap.setAlgoName(itAlgo->first);
848  objMap.setAlgoBitNumber(algBitNumber);
849  objMap.setAlgoGtlResult(algResult);
850  objMap.swapOperandTokenVector(gtAlg.operandTokenVector());
851  objMap.swapCombinationVector(gtAlg.gtAlgoCombinationVector());
852  // gtAlg is empty now...
853  objMap.swapObjectTypeVector(otypes);
854 
855  if (m_verbosity && m_isDebugEnabled) {
856  std::ostringstream myCout1;
857  objMap.print(myCout1);
858 
859  LogTrace("L1TGlobal") << myCout1.str() << std::endl;
860  }
861 
862  objMapVec.push_back(objMap);
863  }
864  }
865 
866  // object maps only for BxInEvent = 0
867  if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
868  gtObjectMapRecord->swapGtObjectMap(objMapVec);
869  }
870 
871  // loop over condition maps (one map per condition chip)
872  // then loop over conditions in the map
873  // delete the conditions created with new, zero pointer, do not clear map, keep the vector as is...
874  for (std::vector<AlgorithmEvaluation::ConditionEvaluationMap>::iterator itCondOnChip = m_conditionResultMaps.begin();
875  itCondOnChip != m_conditionResultMaps.end();
876  itCondOnChip++) {
877  for (AlgorithmEvaluation::ItEvalMap itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
878  delete itCond->second;
879  itCond->second = nullptr;
880  }
881  }
882 }
void setAlgoBitNumber(int algoBitNumberValue)
std::vector< l1t::GlobalObject > L1TObjectTypeInCond
void swapOperandTokenVector(std::vector< GlobalLogicParser::OperandToken > &operandTokenVectorValue)
const l1t::GtConditionCategory cond0Category() const
get / set the category of the three subconditions
const l1t::GlobalScales & gtScales() const
get the scales
Definition: TriggerMenu.h:182
void setAlgoDecisionInitial(unsigned int bit, bool val)
Set decision bits.
Definition: GlobalAlgBlk.cc:73
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
ConditionMap::const_iterator CItCond
iterators through map containing the conditions
const l1t::GtConditionCategory cond2Category() const
const l1t::GtConditionCategory cond1Category() const
const l1t::GtConditionCategory cond0Category() const
get / set the category of the two sub-conditions
const std::vector< std::vector< EnergySumTemplate > > & corEnergySumTemplate() const
Definition: TriggerMenu.h:165
void swapObjectTypeVector(std::vector< L1TObjectTypeInCond > &objectTypeVectorValue)
void swapCombinationVector(std::vector< CombinationsInCond > &combinationVectorValue)
ConditionEvaluationMap::iterator ItEvalMap
#define LogTrace(id)
const std::vector< std::vector< CaloTemplate > > & corCaloTemplate() const
Definition: TriggerMenu.h:159
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
GtConditionCategory
condition categories
int m_verbosity
verbosity level
Definition: GlobalBoard.h:237
void print(std::ostream &myCout) const
print the full object map
const l1t::GtConditionCategory cond1Category() const
void reset()
reset the content of a GlobalAlgBlk
const int cond0Index() const
get / set the index of the two sub-conditions in the cor* vector from menu
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
const l1t::GtConditionCategory cond1Category() const
void setAlgoGtlResult(bool algoGtlResultValue)
const l1t::AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
Definition: TriggerMenu.h:172
const int cond1Index() const
const std::vector< l1t::ConditionMap > & gtConditionMap() const
get / set / build the condition maps
Definition: TriggerMenu.h:77
const l1t::GtConditionCategory cond0Category() const
get / set the category of the thre sub-conditions
GlobalAlgBlk m_uGtAlgBlk
Definition: GlobalBoard.h:223
const int cond0Index() const
get / set the index of the three subconditions in the cor* vector from menu
void setAlgoName(const std::string &algoNameValue)
const l1t::GtConditionCategory cond2Category() const
const int cond0Index() const
get / set the index of the two sub-conditions in the cor* vector from menu
const std::vector< std::vector< MuonTemplate > > & corMuonTemplate() const
Definition: TriggerMenu.h:154
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
std::unordered_map< std::string, ConditionEvaluation * > ConditionEvaluationMap
copy constructor
Log< level::Warning, false > LogWarning
#define LogDebug(id)
std::vector< AlgorithmEvaluation::ConditionEvaluationMap > m_conditionResultMaps
Definition: GlobalBoard.h:226
void GlobalBoard::setBxFirst ( int  bx)

Definition at line 104 of file GlobalBoard.cc.

References makePileupJSON::bx.

104 { m_bxFirst_ = bx; }
void GlobalBoard::setBxLast ( int  bx)

Definition at line 106 of file GlobalBoard.cc.

References makePileupJSON::bx.

106 { m_bxLast_ = bx; }
void l1t::GlobalBoard::setVerbosity ( const int  verbosity)
inline

Definition at line 185 of file GlobalBoard.h.

References m_verbosity, and HLT_FULL_cff::verbosity.

185 { m_verbosity = verbosity; }
int m_verbosity
verbosity level
Definition: GlobalBoard.h:237

Member Data Documentation

bool l1t::GlobalBoard::m_algFinalOr
private

Definition at line 244 of file GlobalBoard.h.

bool l1t::GlobalBoard::m_algFinalOrVeto
private

Definition at line 245 of file GlobalBoard.h.

bool l1t::GlobalBoard::m_algInitialOr
private

Definition at line 241 of file GlobalBoard.h.

bool l1t::GlobalBoard::m_algIntermOr
private

Definition at line 242 of file GlobalBoard.h.

bool l1t::GlobalBoard::m_algPrescaledOr
private

Definition at line 243 of file GlobalBoard.h.

unsigned int l1t::GlobalBoard::m_boardEventCount
private

Definition at line 248 of file GlobalBoard.h.

Referenced by GlobalBoard().

int l1t::GlobalBoard::m_bxFirst_
private

Definition at line 217 of file GlobalBoard.h.

int l1t::GlobalBoard::m_bxLast_
private

Definition at line 218 of file GlobalBoard.h.

BXVector<const l1t::L1Candidate*>* l1t::GlobalBoard::m_candL1EG
private

Definition at line 206 of file GlobalBoard.h.

Referenced by getCandL1EG().

BXVector<const l1t::EtSum*>* l1t::GlobalBoard::m_candL1EtSum
private

Definition at line 209 of file GlobalBoard.h.

Referenced by getCandL1EtSum().

BXVector<const GlobalExtBlk*>* l1t::GlobalBoard::m_candL1External
private

Definition at line 210 of file GlobalBoard.h.

Referenced by getCandL1External().

BXVector<const l1t::L1Candidate*>* l1t::GlobalBoard::m_candL1Jet
private

Definition at line 208 of file GlobalBoard.h.

Referenced by getCandL1Jet().

BXVector<const l1t::Muon*>* l1t::GlobalBoard::m_candL1Mu
private

Definition at line 205 of file GlobalBoard.h.

Referenced by getCandL1Mu().

BXVector<const l1t::L1Candidate*>* l1t::GlobalBoard::m_candL1Tau
private

Definition at line 207 of file GlobalBoard.h.

Referenced by getCandL1Tau().

std::vector<AlgorithmEvaluation::ConditionEvaluationMap> l1t::GlobalBoard::m_conditionResultMaps
private

Definition at line 226 of file GlobalBoard.h.

uint l1t::GlobalBoard::m_currentLumi
private

Definition at line 233 of file GlobalBoard.h.

bool l1t::GlobalBoard::m_firstEv
private

Definition at line 231 of file GlobalBoard.h.

bool l1t::GlobalBoard::m_firstEvLumiSegment
private

Definition at line 232 of file GlobalBoard.h.

std::bitset<GlobalAlgBlk::maxPhysicsTriggers> l1t::GlobalBoard::m_gtlAlgorithmOR
private

Definition at line 220 of file GlobalBoard.h.

Referenced by getAlgorithmOR(), and GlobalBoard().

std::bitset<GlobalAlgBlk::maxPhysicsTriggers> l1t::GlobalBoard::m_gtlDecisionWord
private

Definition at line 221 of file GlobalBoard.h.

Referenced by getDecisionWord(), and GlobalBoard().

bool l1t::GlobalBoard::m_isDebugEnabled
private

Definition at line 238 of file GlobalBoard.h.

const L1CaloGeometry* l1t::GlobalBoard::m_l1CaloGeometry
private

Definition at line 195 of file GlobalBoard.h.

unsigned long long l1t::GlobalBoard::m_l1CaloGeometryCacheID
private

Definition at line 196 of file GlobalBoard.h.

Referenced by GlobalBoard().

const TriggerMenu* l1t::GlobalBoard::m_l1GtMenu
private

Definition at line 191 of file GlobalBoard.h.

unsigned long long l1t::GlobalBoard::m_l1GtMenuCacheID
private

Definition at line 192 of file GlobalBoard.h.

Referenced by GlobalBoard().

const L1MuTriggerScales* l1t::GlobalBoard::m_l1MuTriggerScales
private

Definition at line 198 of file GlobalBoard.h.

unsigned long long l1t::GlobalBoard::m_l1MuTriggerScalesCacheID
private

Definition at line 199 of file GlobalBoard.h.

Referenced by GlobalBoard().

std::vector<std::vector<double> > l1t::GlobalBoard::m_prescaleCounterAlgoTrig
private

prescale counters: NumberPhysTriggers counters per bunch cross in event

Definition at line 229 of file GlobalBoard.h.

GlobalAlgBlk l1t::GlobalBoard::m_uGtAlgBlk
private

Definition at line 223 of file GlobalBoard.h.

Referenced by GlobalBoard().

int l1t::GlobalBoard::m_uGtBoardNumber
private

Definition at line 251 of file GlobalBoard.h.

Referenced by GlobalBoard().

bool l1t::GlobalBoard::m_uGtFinalBoard
private

Definition at line 252 of file GlobalBoard.h.

Referenced by GlobalBoard().

int l1t::GlobalBoard::m_verbosity
private

verbosity level

Definition at line 237 of file GlobalBoard.h.

Referenced by setVerbosity().