CMS 3D CMS Logo

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< int > &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::ConditionEvaluationMapm_conditionResultMaps
 
uint m_currentLumi
 
bool m_firstEv
 
bool m_firstEvLumiSegment
 
std::bitset< GlobalAlgBlk::maxPhysicsTriggersm_gtlAlgorithmOR
 
std::bitset< GlobalAlgBlk::maxPhysicsTriggersm_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< int > > 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().

61  :
68  m_firstEv(true),
70  m_currentLumi(0),
72 {
73 
75 
76  m_gtlAlgorithmOR.reset();
77  m_gtlDecisionWord.reset();
78 
79  // initialize cached IDs
80  m_l1GtMenuCacheID = 0ULL;
83 
84  // Counter for number of events board sees
86 
87  // Need to expand use with more than one uGt GlobalBoard for now assume 1
88  m_uGtBoardNumber = 0;
89  m_uGtFinalBoard = true;
90 
91 
92 }
bool isDebugEnabled()
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GlobalBoard.h:234
BXVector< const l1t::L1Candidate * > * m_candL1EG
Definition: GlobalBoard.h:235
unsigned long long m_l1MuTriggerScalesCacheID
Definition: GlobalBoard.h:227
unsigned long long m_l1GtMenuCacheID
Definition: GlobalBoard.h:220
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlDecisionWord
Definition: GlobalBoard.h:250
unsigned int m_boardEventCount
Definition: GlobalBoard.h:279
BXVector< const l1t::EtSum * > * m_candL1EtSum
Definition: GlobalBoard.h:238
void reset()
reset the content of a GlobalAlgBlk
unsigned long long m_l1CaloGeometryCacheID
Definition: GlobalBoard.h:224
BXVector< const l1t::L1Candidate * > * m_candL1Jet
Definition: GlobalBoard.h:237
GlobalAlgBlk m_uGtAlgBlk
Definition: GlobalBoard.h:252
BXVector< const GlobalExtBlk * > * m_candL1External
Definition: GlobalBoard.h:239
bool m_firstEvLumiSegment
Definition: GlobalBoard.h:261
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlAlgorithmOR
Definition: GlobalBoard.h:249
BXVector< const l1t::L1Candidate * > * m_candL1Tau
Definition: GlobalBoard.h:236
GlobalBoard::~GlobalBoard ( )
virtual

Definition at line 95 of file GlobalBoard.cc.

References m_candL1EG, m_candL1EtSum, m_candL1External, m_candL1Jet, m_candL1Mu, and m_candL1Tau.

95  {
96 
97  //reset(); //why would we need a reset?
98  delete m_candL1Mu;
99  delete m_candL1EG;
100  delete m_candL1Tau;
101  delete m_candL1Jet;
102  delete m_candL1EtSum;
103  delete m_candL1External;
104 
105 // delete m_gtEtaPhiConversions;
106 
107 }
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GlobalBoard.h:234
BXVector< const l1t::L1Candidate * > * m_candL1EG
Definition: GlobalBoard.h:235
BXVector< const l1t::EtSum * > * m_candL1EtSum
Definition: GlobalBoard.h:238
BXVector< const l1t::L1Candidate * > * m_candL1Jet
Definition: GlobalBoard.h:237
BXVector< const GlobalExtBlk * > * m_candL1External
Definition: GlobalBoard.h:239
BXVector< const l1t::L1Candidate * > * m_candL1Tau
Definition: GlobalBoard.h:236

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 1084 of file GlobalBoard.cc.

References LogDebug, m_algFinalOr, m_algFinalOrVeto, m_algIntermOr, m_uGtAlgBlk, m_verbosity, GlobalAlgBlk::setbxInEventNr(), GlobalAlgBlk::setFinalOR(), GlobalAlgBlk::setFinalORPreVeto(), GlobalAlgBlk::setFinalORVeto(), GlobalAlgBlk::setL1FirmwareUUID(), GlobalAlgBlk::setL1MenuUUID(), and GlobalAlgBlk::setPreScColumn().

1090 {
1091 
1092  if (m_verbosity) {
1093  LogDebug("L1TGlobal")
1094  << "\n**** GlobalBoard fill DAQ Records for bx= " << iBxInEvent
1095  << std::endl;
1096 
1097  }
1098 
1099 // Set header information
1100  m_uGtAlgBlk.setbxInEventNr((iBxInEvent & 0xF));
1101  m_uGtAlgBlk.setPreScColumn(prescaleSet);
1102  m_uGtAlgBlk.setL1MenuUUID(menuUUID);
1103  m_uGtAlgBlk.setL1FirmwareUUID(firmwareUUID);
1104 
1108 
1109 
1110  uGtAlgRecord->push_back(iBxInEvent, m_uGtAlgBlk);
1111 
1112 }
#define LogDebug(id)
void setL1MenuUUID(int uuid)
set simple members
Definition: GlobalAlgBlk.h:57
void setFinalORPreVeto(bool fOR)
Definition: GlobalAlgBlk.h:61
void setbxInEventNr(int bxNr)
Definition: GlobalAlgBlk.h:59
int m_verbosity
verbosity level
Definition: GlobalBoard.h:267
void setFinalOR(bool fOR)
Definition: GlobalAlgBlk.h:62
void setFinalORVeto(bool fOR)
Definition: GlobalAlgBlk.h:60
GlobalAlgBlk m_uGtAlgBlk
Definition: GlobalBoard.h:252
void setL1FirmwareUUID(int fuuid)
Definition: GlobalAlgBlk.h:58
void setPreScColumn(int psC)
Definition: GlobalAlgBlk.h:63
const std::bitset<GlobalAlgBlk::maxPhysicsTriggers>& l1t::GlobalBoard::getAlgorithmOR ( ) const
inline

return algorithm OR decision

Definition at line 137 of file GlobalBoard.h.

References m_gtlAlgorithmOR.

138  {
139  return m_gtlAlgorithmOR;
140  }
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlAlgorithmOR
Definition: GlobalBoard.h:249
const BXVector<const l1t::L1Candidate*>* l1t::GlobalBoard::getCandL1EG ( ) const
inline
const BXVector<const l1t::EtSum*>* l1t::GlobalBoard::getCandL1EtSum ( ) const
inline

pointer to Tau data list

Definition at line 168 of file GlobalBoard.h.

References m_candL1EtSum.

Referenced by l1t::EnergySumCondition::evaluateCondition(), l1t::CorrCondition::evaluateCondition(), and l1t::CorrWithOverlapRemovalCondition::evaluateCondition().

169  {
170  return m_candL1EtSum;
171  }
BXVector< const l1t::EtSum * > * m_candL1EtSum
Definition: GlobalBoard.h:238
const BXVector<const GlobalExtBlk*>* l1t::GlobalBoard::getCandL1External ( ) const
inline

pointer to Tau data list

Definition at line 174 of file GlobalBoard.h.

References m_candL1External, setBxFirst(), and setBxLast().

Referenced by l1t::ExternalCondition::evaluateCondition().

175  {
176  return m_candL1External;
177  }
BXVector< const GlobalExtBlk * > * m_candL1External
Definition: GlobalBoard.h:239
const BXVector<const l1t::L1Candidate*>* l1t::GlobalBoard::getCandL1Jet ( ) const
inline
const BXVector<const l1t::Muon*>* l1t::GlobalBoard::getCandL1Mu ( ) const
inline

return global muon trigger candidate

Definition at line 143 of file GlobalBoard.h.

References m_candL1Mu.

Referenced by l1t::MuCondition::evaluateCondition(), l1t::CorrCondition::evaluateCondition(), l1t::CorrWithOverlapRemovalCondition::evaluateCondition(), and l1t::MuCondition::getCandidate().

144  {
145  return m_candL1Mu;
146  }
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GlobalBoard.h:234
const BXVector<const l1t::L1Candidate*>* l1t::GlobalBoard::getCandL1Tau ( ) const
inline
const std::bitset<GlobalAlgBlk::maxPhysicsTriggers>& l1t::GlobalBoard::getDecisionWord ( ) const
inline

return decision

Definition at line 131 of file GlobalBoard.h.

References m_gtlDecisionWord.

132  {
133  return m_gtlDecisionWord;
134  }
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlDecisionWord
Definition: GlobalBoard.h:250
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 122 of file GlobalBoard.cc.

References LogDebug, m_bxFirst_, m_bxLast_, m_candL1EG, m_candL1EtSum, m_candL1External, m_candL1Jet, m_candL1Mu, m_candL1Tau, m_uGtAlgBlk, GlobalAlgBlk::reset(), setBxFirst(), setBxLast(), and BXVector< T >::setBXRange().

123  {
124 
125  setBxFirst(bxFirst);
126  setBxLast(bxLast);
127 
128  m_candL1Mu->setBXRange( m_bxFirst_, m_bxLast_ );
129  m_candL1EG->setBXRange( m_bxFirst_, m_bxLast_ );
130  m_candL1Tau->setBXRange( m_bxFirst_, m_bxLast_ );
131  m_candL1Jet->setBXRange( m_bxFirst_, m_bxLast_ );
132  m_candL1EtSum->setBXRange( m_bxFirst_, m_bxLast_ );
134 
135  m_uGtAlgBlk.reset();
136 
137  LogDebug("L1TGlobal") << "\t Initializing Board with bxFirst = " << m_bxFirst_ << ", bxLast = " << m_bxLast_ << std::endl;
138 
139 
140 }
#define LogDebug(id)
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GlobalBoard.h:234
BXVector< const l1t::L1Candidate * > * m_candL1EG
Definition: GlobalBoard.h:235
void setBxLast(int bx)
Definition: GlobalBoard.cc:116
BXVector< const l1t::EtSum * > * m_candL1EtSum
Definition: GlobalBoard.h:238
void reset()
reset the content of a GlobalAlgBlk
BXVector< const l1t::L1Candidate * > * m_candL1Jet
Definition: GlobalBoard.h:237
GlobalAlgBlk m_uGtAlgBlk
Definition: GlobalBoard.h:252
BXVector< const GlobalExtBlk * > * m_candL1External
Definition: GlobalBoard.h:239
void setBxFirst(int bx)
Definition: GlobalBoard.cc:110
void setBXRange(int bxFirst, int bxLast)
BXVector< const l1t::L1Candidate * > * m_candL1Tau
Definition: GlobalBoard.h:236
void GlobalBoard::printGmtData ( const int  iBxInEvent) const

print received Muon dataWord

Definition at line 1163 of file GlobalBoard.cc.

References LogTrace, and m_candL1Mu.

1163  {
1164 
1165  LogTrace("L1TGlobal")
1166  << "\nl1t::L1GlobalTrigger: uGMT data received for BxInEvent = "
1167  << iBxInEvent << std::endl;
1168 
1169  int nrL1Mu = m_candL1Mu->size(iBxInEvent);
1170  LogTrace("L1TGlobal")
1171  << "Number of GMT muons = " << nrL1Mu << "\n"
1172  << std::endl;
1173 
1174  LogTrace("L1TGlobal") << std::endl;
1175 
1176 }
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GlobalBoard.h:234
#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 145 of file GlobalBoard.cc.

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

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

Definition at line 414 of file GlobalBoard.cc.

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

416  {
417 
418  if (m_verbosity) {
419  LogDebug("L1TGlobal")
420  << "\n**** GlobalBoard receiving external data = "
421  //<< "\n from input tag " << muInputTag << "\n"
422  << std::endl;
423  }
424 
425  resetExternal();
426 
427  // get data from Global Muon Trigger
428  if (receiveExt) {
430  iEvent.getByToken(extInputToken, extData);
431 
432  if (!extData.isValid()) {
433  if (m_verbosity) {
434  edm::LogWarning("L1TGlobal")
435  << "\nWarning: BXVector<GlobalExtBlk> with input tag "
436  //<< muInputTag
437  << "\nrequested in configuration, but not found in the event.\n"
438  << std::endl;
439  }
440  } else {
441  // bx in muon data
442  for(int i = extData->getFirstBX(); i <= extData->getLastBX(); ++i) {
443 
444  // Prevent from pushing back bx that is outside of allowed range
445  if( i < m_bxFirst_ || i > m_bxLast_ ) continue;
446 
447  //Loop over ext in this bx
448  for(std::vector<GlobalExtBlk>::const_iterator ext = extData->begin(i); ext != extData->end(i); ++ext) {
449 
450  (*m_candL1External).push_back(i,&(*ext));
451  } //end loop over ext in bx
452  } //end loop over bx
453 
454  } //end if over valid ext data
455 
456  } //end if ReveiveExt data
457 
458 }
#define LogDebug(id)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
int m_verbosity
verbosity level
Definition: GlobalBoard.h:267
bool isValid() const
Definition: HandleBase.h:74
Definition: memstream.h:15
void GlobalBoard::receiveMuonObjectData ( edm::Event iEvent,
const edm::EDGetTokenT< BXVector< l1t::Muon > > &  muInputToken,
const bool  receiveMu,
const int  nrL1Mu 
)

Definition at line 358 of file GlobalBoard.cc.

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

360  {
361 
362  if (m_verbosity) {
363  LogDebug("L1TGlobal")
364  << "\n**** GlobalBoard receiving muon data = "
365  //<< "\n from input tag " << muInputTag << "\n"
366  << std::endl;
367  }
368 
369  resetMu();
370 
371  // get data from Global Muon Trigger
372  if (receiveMu) {
374  iEvent.getByToken(muInputToken, muonData);
375 
376  if (!muonData.isValid()) {
377  if (m_verbosity) {
378  edm::LogWarning("L1TGlobal")
379  << "\nWarning: BXVector<l1t::Muon> with input tag "
380  //<< muInputTag
381  << "\nrequested in configuration, but not found in the event.\n"
382  << std::endl;
383  }
384  } else {
385  // bx in muon data
386  for(int i = muonData->getFirstBX(); i <= muonData->getLastBX(); ++i) {
387 
388  // Prevent from pushing back bx that is outside of allowed range
389  if( i < m_bxFirst_ || i > m_bxLast_ ) continue;
390 
391  //Loop over Muons in this bx
392  int nObj = 0;
393  for(std::vector<l1t::Muon>::const_iterator mu = muonData->begin(i); mu != muonData->end(i); ++mu) {
394 
395  if(nObj<nrL1Mu) {
396  (*m_candL1Mu).push_back(i,&(*mu));
397  } else {
398  edm::LogWarning("L1TGlobal") << " Too many Muons ("<<nObj<<") for uGT Configuration maxMu =" <<nrL1Mu << std::endl;
399  }
400 
401  LogDebug("L1TGlobal") << "Muon Pt " << mu->hwPt() << " EtaAtVtx " << mu->hwEtaAtVtx() << " PhiAtVtx " << mu->hwPhiAtVtx() << " Qual " << mu->hwQual() <<" Iso " << mu->hwIso() << std::endl;
402  nObj++;
403  } //end loop over muons in bx
404  } //end loop over bx
405 
406  } //end if over valid muon data
407 
408  } //end if ReveiveMuon data
409 
410 
411 }
#define LogDebug(id)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
int m_verbosity
verbosity level
Definition: GlobalBoard.h:267
const int mu
Definition: Constants.h:22
bool isValid() const
Definition: HandleBase.h:74
void GlobalBoard::reset ( void  )

clear uGT

Definition at line 1116 of file GlobalBoard.cc.

References m_gtlAlgorithmOR, m_gtlDecisionWord, m_uGtAlgBlk, GlobalAlgBlk::reset(), resetCalo(), resetExternal(), and resetMu().

1116  {
1117 
1118  resetMu();
1119  resetCalo();
1120  resetExternal();
1121 
1122  m_uGtAlgBlk.reset();
1123 
1124  m_gtlDecisionWord.reset();
1125  m_gtlAlgorithmOR.reset();
1126 
1127 
1128 
1129 }
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlDecisionWord
Definition: GlobalBoard.h:250
void reset()
reset the content of a GlobalAlgBlk
GlobalAlgBlk m_uGtAlgBlk
Definition: GlobalBoard.h:252
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlAlgorithmOR
Definition: GlobalBoard.h:249
void GlobalBoard::resetCalo ( )

Definition at line 1140 of file GlobalBoard.cc.

References m_bxFirst_, m_bxLast_, m_candL1EG, m_candL1EtSum, m_candL1Jet, and m_candL1Tau.

Referenced by receiveCaloObjectData(), and reset().

1140  {
1141 
1142  m_candL1EG->clear();
1143  m_candL1Tau->clear();
1144  m_candL1Jet->clear();
1145  m_candL1EtSum->clear();
1146 
1147  m_candL1EG->setBXRange( m_bxFirst_, m_bxLast_ );
1148  m_candL1Tau->setBXRange( m_bxFirst_, m_bxLast_ );
1149  m_candL1Jet->setBXRange( m_bxFirst_, m_bxLast_ );
1150  m_candL1EtSum->setBXRange( m_bxFirst_, m_bxLast_ );
1151 
1152 }
BXVector< const l1t::L1Candidate * > * m_candL1EG
Definition: GlobalBoard.h:235
BXVector< const l1t::EtSum * > * m_candL1EtSum
Definition: GlobalBoard.h:238
BXVector< const l1t::L1Candidate * > * m_candL1Jet
Definition: GlobalBoard.h:237
BXVector< const l1t::L1Candidate * > * m_candL1Tau
Definition: GlobalBoard.h:236
void GlobalBoard::resetExternal ( )

Definition at line 1154 of file GlobalBoard.cc.

References BXVector< T >::clear(), m_bxFirst_, m_bxLast_, m_candL1External, and BXVector< T >::setBXRange().

Referenced by receiveExternalData(), and reset().

1154  {
1155 
1158 
1159 }
BXVector< const GlobalExtBlk * > * m_candL1External
Definition: GlobalBoard.h:239
void clear()
void setBXRange(int bxFirst, int bxLast)
void GlobalBoard::resetMu ( )

Definition at line 1132 of file GlobalBoard.cc.

References m_bxFirst_, m_bxLast_, and m_candL1Mu.

Referenced by receiveMuonObjectData(), and reset().

1132  {
1133 
1134  m_candL1Mu->clear();
1135  m_candL1Mu->setBXRange( m_bxFirst_, m_bxLast_ );
1136 
1137 }
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GlobalBoard.h:234
void GlobalBoard::runFDL ( edm::Event iEvent,
const int  iBxInEvent,
const int  totalBxInEvent,
const unsigned int  numberPhysTriggers,
const std::vector< int > &  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 933 of file GlobalBoard.cc.

References GlobalAlgBlk::copyInitialToInterm(), GlobalAlgBlk::copyIntermToFinal(), GlobalAlgBlk::getAlgoDecisionInitial(), GlobalAlgBlk::getAlgoDecisionInterm(), LogDebug, edm::EventBase::luminosityBlock(), m_algFinalOr, m_algFinalOrVeto, m_algInitialOr, m_algIntermOr, m_algPrescaledOr, m_currentLumi, m_firstEv, m_firstEvLumiSegment, m_prescaleCounterAlgoTrig, m_uGtAlgBlk, m_verbosity, GlobalAlgBlk::setAlgoDecisionFinal(), and GlobalAlgBlk::setAlgoDecisionInterm().

941  {
942 
943 
944  if (m_verbosity) {
945  LogDebug("L1TGlobal")
946  << "\n**** GlobalBoard apply Final Decision Logic "
947  << std::endl;
948 
949  }
950 
951 
952  // prescale counters are reset at the beginning of the luminosity segment
953  if( m_firstEv ){
954  // prescale counters: numberPhysTriggers counters per bunch cross
955  m_prescaleCounterAlgoTrig.reserve(numberPhysTriggers*totalBxInEvent);
956 
957  for( int iBxInEvent = 0; iBxInEvent <= totalBxInEvent; ++iBxInEvent ){
958  m_prescaleCounterAlgoTrig.push_back(prescaleFactorsAlgoTrig);
959  }
960  m_firstEv = false;
962  }
963 
964  // update and clear prescales at the beginning of the luminosity segment
966 
968  for( int iBxInEvent = 0; iBxInEvent <= totalBxInEvent; ++iBxInEvent ){
969  m_prescaleCounterAlgoTrig.push_back(prescaleFactorsAlgoTrig);
970  }
971 
972  m_firstEvLumiSegment = false;
974  }
975 
976  // Copy Algorithm bits to Prescaled word
977  // Prescaling and Masking done below if requested.
979 
980 
981  // -------------------------------------------
982  // Apply Prescales or skip if turned off
983  // -------------------------------------------
984  if( !algorithmTriggersUnprescaled ){
985 
986  // iBxInEvent is ... -2 -1 0 1 2 ... while counters are 0 1 2 3 4 ...
987  int inBxInEvent = totalBxInEvent/2 + iBxInEvent;
988 
989  bool temp_algPrescaledOr = false;
990  for( unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit ){
991 
992  bool bitValue = m_uGtAlgBlk.getAlgoDecisionInitial( iBit );
993  if( bitValue ){
994  // Make sure algo bit in range, warn otherwise
995  if( iBit < prescaleFactorsAlgoTrig.size() ){
996  if( prescaleFactorsAlgoTrig.at(iBit) != 1 ){
997 
998  (m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit))--;
999  if( m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit) == 0 ){
1000 
1001  // bit already true in algoDecisionWord, just reset counter
1002  m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit) = prescaleFactorsAlgoTrig.at(iBit);
1003  temp_algPrescaledOr = true;
1004  }
1005  else {
1006 
1007  // change bit to false in prescaled word and final decision word
1008  m_uGtAlgBlk.setAlgoDecisionInterm(iBit,false);
1009 
1010  } //if Prescale counter reached zero
1011  } //if prescale factor is not 1 (ie. no prescale)
1012  else {
1013 
1014  temp_algPrescaledOr = true;
1015  }
1016  } // require bit in range
1017  else{
1018  edm::LogWarning("L1TGlobal")
1019  << "\nWarning: algoBit >= prescaleFactorsAlgoTrig.size() "
1020  << std::endl;
1021  }
1022  } //if algo bit is set true
1023  } //loop over alg bits
1024 
1025  m_algPrescaledOr = temp_algPrescaledOr; //temp
1026 
1027  }
1028  else {
1029  // Since not Prescaling just take OR of Initial Work
1031 
1032  }//if we are going to apply prescales.
1033 
1034 
1035  // Copy Algorithm bits fron Prescaled word to Final Word
1036  // Masking done below if requested.
1038 
1039  if( !algorithmTriggersUnmasked ){
1040 
1041  bool temp_algFinalOr = false;
1042  for( unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit ){
1043 
1044  bool bitValue = m_uGtAlgBlk.getAlgoDecisionInterm( iBit );
1045 
1046  if( bitValue ){
1047  //bool isMasked = ( triggerMaskAlgoTrig.at(iBit) == 0 );
1048  bool isMasked = false;
1049  if( iBit < triggerMaskAlgoTrig.size() ) isMasked = ( triggerMaskAlgoTrig.at(iBit) == 0 );
1050  else{
1051  edm::LogWarning("L1TGlobal")
1052  << "\nWarning: algoBit >= triggerMaskAlgoTrig.size() "
1053  << std::endl;
1054  }
1055 
1056  bool passMask = ( bitValue && !isMasked );
1057 
1058  if( passMask ) temp_algFinalOr = true;
1059  else m_uGtAlgBlk.setAlgoDecisionFinal(iBit,false);
1060 
1061  // Check if veto mask is true, if it is, set the event veto flag.
1062  if ( triggerMaskVetoAlgoTrig.at(iBit) == 1 ) m_algFinalOrVeto = true;
1063 
1064  }
1065  }
1066 
1067  m_algIntermOr = temp_algFinalOr;
1068 
1069  }
1070  else {
1071 
1073 
1074  }
1075 
1076 // Set FinalOR for this board
1078 
1079 
1080 
1081 }
#define LogDebug(id)
std::vector< bool > const & getAlgoDecisionInitial() const
Get decision bits.
Definition: GlobalAlgBlk.h:84
void copyIntermToFinal()
Definition: GlobalAlgBlk.h:76
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
void copyInitialToInterm()
Copy vectors words.
Definition: GlobalAlgBlk.h:75
int m_verbosity
verbosity level
Definition: GlobalBoard.h:267
std::vector< std::vector< int > > m_prescaleCounterAlgoTrig
prescale counters: NumberPhysTriggers counters per bunch cross in event
Definition: GlobalBoard.h:258
void setAlgoDecisionInterm(unsigned int bit, bool val)
Definition: GlobalAlgBlk.cc:96
GlobalAlgBlk m_uGtAlgBlk
Definition: GlobalBoard.h:252
bool m_firstEvLumiSegment
Definition: GlobalBoard.h:261
std::vector< bool > const & getAlgoDecisionInterm() const
Definition: GlobalAlgBlk.h:87
void setAlgoDecisionFinal(unsigned int bit, bool val)
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 462 of file GlobalBoard.cc.

References CorrelationTemplate::cond0Category(), CorrelationWithOverlapRemovalTemplate::cond0Category(), CorrelationTemplate::cond0Index(), CorrelationWithOverlapRemovalTemplate::cond0Index(), CorrelationTemplate::cond1Category(), CorrelationWithOverlapRemovalTemplate::cond1Category(), CorrelationTemplate::cond1Index(), CorrelationWithOverlapRemovalTemplate::cond1Index(), CorrelationWithOverlapRemovalTemplate::cond2Category(), CorrelationWithOverlapRemovalTemplate::cond2Index(), l1t::CondCalo, l1t::CondCorrelation, l1t::CondCorrelationWithOverlapRemoval, l1t::CondEnergySum, l1t::CondExternal, l1t::CondMuon, l1t::CondNull, TriggerMenu::corCaloTemplate(), TriggerMenu::corEnergySumTemplate(), TriggerMenu::corMuonTemplate(), l1t::AlgorithmEvaluation::evaluateAlgorithm(), l1t::ConditionEvaluation::evaluateConditionStoreResult(), runEdmFileComparison::found, l1t::GlobalScales::getScalesName(), l1t::AlgorithmEvaluation::gtAlgoCombinationVector(), l1t::AlgorithmEvaluation::gtAlgoResult(), TriggerMenu::gtAlgorithmMap(), TriggerMenu::gtConditionMap(), TriggerMenu::gtScales(), LogDebug, LogTrace, m_algFinalOr, m_algFinalOrVeto, m_algInitialOr, m_algIntermOr, m_algPrescaledOr, m_conditionResultMaps, m_isDebugEnabled, m_uGtAlgBlk, m_verbosity, match(), l1t::AlgorithmEvaluation::operandTokenVector(), l1t::ExternalCondition::print(), l1t::EnergySumCondition::print(), l1t::MuCondition::print(), edm::print(), l1t::CaloCondition::print(), l1t::CorrCondition::print(), l1t::CorrWithOverlapRemovalCondition::print(), l1t::AlgorithmEvaluation::print(), GlobalObjectMap::print(), GlobalAlgBlk::reset(), GlobalObjectMap::setAlgoBitNumber(), GlobalAlgBlk::setAlgoDecisionInitial(), GlobalObjectMap::setAlgoGtlResult(), GlobalObjectMap::setAlgoName(), l1t::CorrCondition::setScales(), l1t::CorrWithOverlapRemovalCondition::setScales(), l1t::ConditionEvaluation::setVerbosity(), AlCaHLTBitMon_QueryRunRegistry::string, GlobalObjectMap::swapCombinationVector(), GlobalObjectMap::swapObjectTypeVector(), and GlobalObjectMap::swapOperandTokenVector().

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

Definition at line 110 of file GlobalBoard.cc.

References m_bxFirst_.

Referenced by getCandL1External(), and init().

110  {
111 
112  m_bxFirst_ = bx;
113 
114 }
void GlobalBoard::setBxLast ( int  bx)

Definition at line 116 of file GlobalBoard.cc.

References m_bxLast_.

Referenced by getCandL1External(), and init().

116  {
117 
118  m_bxLast_ = bx;
119 
120 }
void l1t::GlobalBoard::setVerbosity ( const int  verbosity)
inline

Definition at line 210 of file GlobalBoard.h.

References m_verbosity, and HIPAlignmentAlgorithm_cfi::verbosity.

210  {
212  }
int m_verbosity
verbosity level
Definition: GlobalBoard.h:267

Member Data Documentation

bool l1t::GlobalBoard::m_algFinalOr
private

Definition at line 274 of file GlobalBoard.h.

Referenced by fillAlgRecord(), runFDL(), and runGTL().

bool l1t::GlobalBoard::m_algFinalOrVeto
private

Definition at line 275 of file GlobalBoard.h.

Referenced by fillAlgRecord(), runFDL(), and runGTL().

bool l1t::GlobalBoard::m_algInitialOr
private

Definition at line 271 of file GlobalBoard.h.

Referenced by runFDL(), and runGTL().

bool l1t::GlobalBoard::m_algIntermOr
private

Definition at line 272 of file GlobalBoard.h.

Referenced by fillAlgRecord(), runFDL(), and runGTL().

bool l1t::GlobalBoard::m_algPrescaledOr
private

Definition at line 273 of file GlobalBoard.h.

Referenced by runFDL(), and runGTL().

unsigned int l1t::GlobalBoard::m_boardEventCount
private

Definition at line 279 of file GlobalBoard.h.

Referenced by GlobalBoard().

int l1t::GlobalBoard::m_bxFirst_
private

Definition at line 246 of file GlobalBoard.h.

Referenced by init(), resetCalo(), resetExternal(), resetMu(), and setBxFirst().

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

Definition at line 235 of file GlobalBoard.h.

Referenced by getCandL1EG(), init(), resetCalo(), and ~GlobalBoard().

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

Definition at line 238 of file GlobalBoard.h.

Referenced by getCandL1EtSum(), init(), resetCalo(), and ~GlobalBoard().

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

Definition at line 239 of file GlobalBoard.h.

Referenced by getCandL1External(), init(), resetExternal(), and ~GlobalBoard().

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

Definition at line 237 of file GlobalBoard.h.

Referenced by getCandL1Jet(), init(), resetCalo(), and ~GlobalBoard().

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

Definition at line 234 of file GlobalBoard.h.

Referenced by getCandL1Mu(), init(), printGmtData(), resetMu(), and ~GlobalBoard().

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

Definition at line 236 of file GlobalBoard.h.

Referenced by getCandL1Tau(), init(), resetCalo(), and ~GlobalBoard().

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

Definition at line 255 of file GlobalBoard.h.

Referenced by runGTL().

uint l1t::GlobalBoard::m_currentLumi
private

Definition at line 262 of file GlobalBoard.h.

Referenced by runFDL().

bool l1t::GlobalBoard::m_firstEv
private

Definition at line 260 of file GlobalBoard.h.

Referenced by runFDL().

bool l1t::GlobalBoard::m_firstEvLumiSegment
private

Definition at line 261 of file GlobalBoard.h.

Referenced by runFDL().

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

Definition at line 249 of file GlobalBoard.h.

Referenced by getAlgorithmOR(), GlobalBoard(), and reset().

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

Definition at line 250 of file GlobalBoard.h.

Referenced by getDecisionWord(), GlobalBoard(), and reset().

bool l1t::GlobalBoard::m_isDebugEnabled
private

Definition at line 268 of file GlobalBoard.h.

Referenced by runGTL().

const L1CaloGeometry* l1t::GlobalBoard::m_l1CaloGeometry
private

Definition at line 223 of file GlobalBoard.h.

unsigned long long l1t::GlobalBoard::m_l1CaloGeometryCacheID
private

Definition at line 224 of file GlobalBoard.h.

Referenced by GlobalBoard().

const TriggerMenu* l1t::GlobalBoard::m_l1GtMenu
private

Definition at line 219 of file GlobalBoard.h.

unsigned long long l1t::GlobalBoard::m_l1GtMenuCacheID
private

Definition at line 220 of file GlobalBoard.h.

Referenced by GlobalBoard().

const L1MuTriggerScales* l1t::GlobalBoard::m_l1MuTriggerScales
private

Definition at line 226 of file GlobalBoard.h.

unsigned long long l1t::GlobalBoard::m_l1MuTriggerScalesCacheID
private

Definition at line 227 of file GlobalBoard.h.

Referenced by GlobalBoard().

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

prescale counters: NumberPhysTriggers counters per bunch cross in event

Definition at line 258 of file GlobalBoard.h.

Referenced by runFDL().

GlobalAlgBlk l1t::GlobalBoard::m_uGtAlgBlk
private

Definition at line 252 of file GlobalBoard.h.

Referenced by fillAlgRecord(), GlobalBoard(), init(), reset(), runFDL(), and runGTL().

int l1t::GlobalBoard::m_uGtBoardNumber
private

Definition at line 282 of file GlobalBoard.h.

Referenced by GlobalBoard().

bool l1t::GlobalBoard::m_uGtFinalBoard
private

Definition at line 283 of file GlobalBoard.h.

Referenced by GlobalBoard().

int l1t::GlobalBoard::m_verbosity
private