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
 
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),
71 {
72 
74 
75  m_gtlAlgorithmOR.reset();
76  m_gtlDecisionWord.reset();
77 
78  // initialize cached IDs
79  m_l1GtMenuCacheID = 0ULL;
82 
83  // Counter for number of events board sees
85 
86  // Need to expand use with more than one uGt GlobalBoard for now assume 1
87  m_uGtBoardNumber = 0;
88  m_uGtFinalBoard = true;
89 
90 
91 }
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:278
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 94 of file GlobalBoard.cc.

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

94  {
95 
96  //reset(); //why would we need a reset?
97  delete m_candL1Mu;
98  delete m_candL1EG;
99  delete m_candL1Tau;
100  delete m_candL1Jet;
101  delete m_candL1EtSum;
102  delete m_candL1External;
103 
104 // delete m_gtEtaPhiConversions;
105 
106 }
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 1081 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().

1087 {
1088 
1089  if (m_verbosity) {
1090  LogDebug("L1TGlobal")
1091  << "\n**** GlobalBoard fill DAQ Records for bx= " << iBxInEvent
1092  << std::endl;
1093 
1094  }
1095 
1096 // Set header information
1097  m_uGtAlgBlk.setbxInEventNr((iBxInEvent & 0xF));
1098  m_uGtAlgBlk.setPreScColumn(prescaleSet);
1099  m_uGtAlgBlk.setL1MenuUUID(menuUUID);
1100  m_uGtAlgBlk.setL1FirmwareUUID(firmwareUUID);
1101 
1105 
1106 
1107  uGtAlgRecord->push_back(iBxInEvent, m_uGtAlgBlk);
1108 
1109 }
#define LogDebug(id)
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:266
void setFinalOR(bool fOR)
Definition: GlobalAlgBlk.h:60
void setFinalORVeto(bool fOR)
Definition: GlobalAlgBlk.h:58
GlobalAlgBlk m_uGtAlgBlk
Definition: GlobalBoard.h:252
void setL1FirmwareUUID(int fuuid)
Definition: GlobalAlgBlk.h:56
void setPreScColumn(int psC)
Definition: GlobalAlgBlk.h:61
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 121 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().

122  {
123 
124  setBxFirst(bxFirst);
125  setBxLast(bxLast);
126 
127  m_candL1Mu->setBXRange( m_bxFirst_, m_bxLast_ );
128  m_candL1EG->setBXRange( m_bxFirst_, m_bxLast_ );
129  m_candL1Tau->setBXRange( m_bxFirst_, m_bxLast_ );
130  m_candL1Jet->setBXRange( m_bxFirst_, m_bxLast_ );
131  m_candL1EtSum->setBXRange( m_bxFirst_, m_bxLast_ );
133 
134  m_uGtAlgBlk.reset();
135 
136  LogDebug("L1TGlobal") << "\t Initializing Board with bxFirst = " << m_bxFirst_ << ", bxLast = " << m_bxLast_ << std::endl;
137 
138 
139 }
#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:115
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:109
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 1160 of file GlobalBoard.cc.

References LogTrace, and m_candL1Mu.

1160  {
1161 
1162  LogTrace("L1TGlobal")
1163  << "\nl1t::L1GlobalTrigger: uGMT data received for BxInEvent = "
1164  << iBxInEvent << std::endl;
1165 
1166  int nrL1Mu = m_candL1Mu->size(iBxInEvent);
1167  LogTrace("L1TGlobal")
1168  << "Number of GMT muons = " << nrL1Mu << "\n"
1169  << std::endl;
1170 
1171  LogTrace("L1TGlobal") << std::endl;
1172 
1173 }
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 144 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.

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

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

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

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

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

clear uGT

Definition at line 1113 of file GlobalBoard.cc.

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

1113  {
1114 
1115  resetMu();
1116  resetCalo();
1117  resetExternal();
1118 
1119  m_uGtAlgBlk.reset();
1120 
1121  m_gtlDecisionWord.reset();
1122  m_gtlAlgorithmOR.reset();
1123 
1124 
1125 
1126 }
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 1137 of file GlobalBoard.cc.

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

Referenced by receiveCaloObjectData(), and reset().

1137  {
1138 
1139  m_candL1EG->clear();
1140  m_candL1Tau->clear();
1141  m_candL1Jet->clear();
1142  m_candL1EtSum->clear();
1143 
1144  m_candL1EG->setBXRange( m_bxFirst_, m_bxLast_ );
1145  m_candL1Tau->setBXRange( m_bxFirst_, m_bxLast_ );
1146  m_candL1Jet->setBXRange( m_bxFirst_, m_bxLast_ );
1147  m_candL1EtSum->setBXRange( m_bxFirst_, m_bxLast_ );
1148 
1149 }
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 1151 of file GlobalBoard.cc.

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

Referenced by receiveExternalData(), and reset().

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

Definition at line 1129 of file GlobalBoard.cc.

References m_bxFirst_, m_bxLast_, and m_candL1Mu.

Referenced by receiveMuonObjectData(), and reset().

1129  {
1130 
1131  m_candL1Mu->clear();
1132  m_candL1Mu->setBXRange( m_bxFirst_, m_bxLast_ );
1133 
1134 }
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 932 of file GlobalBoard.cc.

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

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

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

References m_bxFirst_.

Referenced by getCandL1External(), and init().

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

Definition at line 115 of file GlobalBoard.cc.

References m_bxLast_.

Referenced by getCandL1External(), and init().

115  {
116 
117  m_bxLast_ = bx;
118 
119 }
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:266

Member Data Documentation

bool l1t::GlobalBoard::m_algFinalOr
private

Definition at line 273 of file GlobalBoard.h.

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

bool l1t::GlobalBoard::m_algFinalOrVeto
private

Definition at line 274 of file GlobalBoard.h.

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

bool l1t::GlobalBoard::m_algInitialOr
private

Definition at line 270 of file GlobalBoard.h.

Referenced by runFDL(), and runGTL().

bool l1t::GlobalBoard::m_algIntermOr
private

Definition at line 271 of file GlobalBoard.h.

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

bool l1t::GlobalBoard::m_algPrescaledOr
private

Definition at line 272 of file GlobalBoard.h.

Referenced by runFDL(), and runGTL().

unsigned int l1t::GlobalBoard::m_boardEventCount
private

Definition at line 278 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().

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 267 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 281 of file GlobalBoard.h.

Referenced by GlobalBoard().

bool l1t::GlobalBoard::m_uGtFinalBoard
private

Definition at line 282 of file GlobalBoard.h.

Referenced by GlobalBoard().

int l1t::GlobalBoard::m_verbosity
private