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 59 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().

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

Definition at line 89 of file GlobalBoard.cc.

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

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

Member Function Documentation

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

Fill the Daq Records.

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

959  {
960  if (m_verbosity) {
961  LogDebug("L1TGlobal") << "\n**** GlobalBoard fill DAQ Records for bx= " << iBxInEvent << std::endl;
962  }
963 
964  // Set header information
965  m_uGtAlgBlk.setbxInEventNr((iBxInEvent & 0xF));
966  m_uGtAlgBlk.setPreScColumn(prescaleSet);
967  m_uGtAlgBlk.setL1MenuUUID(menuUUID);
968  m_uGtAlgBlk.setL1FirmwareUUID(firmwareUUID);
969 
973 
974  uGtAlgRecord->push_back(iBxInEvent, m_uGtAlgBlk);
975 }
#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:237
void setFinalOR(bool fOR)
Definition: GlobalAlgBlk.h:60
void setFinalORVeto(bool fOR)
Definition: GlobalAlgBlk.h:58
GlobalAlgBlk m_uGtAlgBlk
Definition: GlobalBoard.h:223
void setL1FirmwareUUID(int fuuid)
Definition: GlobalAlgBlk.h:56
void setPreScColumn(int psC)
Definition: GlobalAlgBlk.h:61
const std::bitset<GlobalAlgBlk::maxPhysicsTriggers>& l1t::GlobalBoard::getAlgorithmOR ( ) const
inline

return algorithm OR decision

Definition at line 135 of file GlobalBoard.h.

References m_gtlAlgorithmOR.

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

pointer to Tau data list

Definition at line 150 of file GlobalBoard.h.

References m_candL1EtSum.

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

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

pointer to Tau data list

Definition at line 153 of file GlobalBoard.h.

References l1GtPatternGenerator_cfi::bx, m_candL1External, setBxFirst(), and setBxLast().

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

153 { return m_candL1External; }
BXVector< const GlobalExtBlk * > * m_candL1External
Definition: GlobalBoard.h:210
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 138 of file GlobalBoard.h.

References m_candL1Mu.

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

138 { return m_candL1Mu; }
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GlobalBoard.h:205
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 132 of file GlobalBoard.h.

References m_gtlDecisionWord.

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

initialize the class (mainly reserve)

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

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

print received Muon dataWord

Definition at line 1014 of file GlobalBoard.cc.

References LogTrace, and m_candL1Mu.

1014  {
1015  LogTrace("L1TGlobal") << "\nl1t::L1GlobalTrigger: uGMT data received for BxInEvent = " << iBxInEvent << std::endl;
1016 
1017  int nrL1Mu = m_candL1Mu->size(iBxInEvent);
1018  LogTrace("L1TGlobal") << "Number of GMT muons = " << nrL1Mu << "\n" << std::endl;
1019 
1020  LogTrace("L1TGlobal") << std::endl;
1021 }
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GlobalBoard.h:205
#define LogTrace(id)
void GlobalBoard::receiveCaloObjectData ( edm::Event iEvent,
const edm::EDGetTokenT< BXVector< l1t::EGamma >> &  egInputToken,
const edm::EDGetTokenT< BXVector< l1t::Tau >> &  tauInputToken,
const edm::EDGetTokenT< BXVector< l1t::Jet >> &  jetInputToken,
const edm::EDGetTokenT< BXVector< l1t::EtSum >> &  sumInputToken,
const bool  receiveEG,
const int  nrL1EG,
const bool  receiveTau,
const int  nrL1Tau,
const bool  receiveJet,
const int  nrL1Jet,
const bool  receiveEtSums 
)

receive data from Global Muon Trigger

Definition at line 130 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.

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

Definition at line 386 of file GlobalBoard.cc.

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

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

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

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

clear uGT

Definition at line 978 of file GlobalBoard.cc.

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

978  {
979  resetMu();
980  resetCalo();
981  resetExternal();
982 
983  m_uGtAlgBlk.reset();
984 
985  m_gtlDecisionWord.reset();
986  m_gtlAlgorithmOR.reset();
987 }
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlDecisionWord
Definition: GlobalBoard.h:221
void reset()
reset the content of a GlobalAlgBlk
GlobalAlgBlk m_uGtAlgBlk
Definition: GlobalBoard.h:223
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlAlgorithmOR
Definition: GlobalBoard.h:220
void GlobalBoard::resetCalo ( )

Definition at line 996 of file GlobalBoard.cc.

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

Referenced by receiveCaloObjectData(), and reset().

996  {
997  m_candL1EG->clear();
998  m_candL1Tau->clear();
999  m_candL1Jet->clear();
1000  m_candL1EtSum->clear();
1001 
1002  m_candL1EG->setBXRange(m_bxFirst_, m_bxLast_);
1003  m_candL1Tau->setBXRange(m_bxFirst_, m_bxLast_);
1004  m_candL1Jet->setBXRange(m_bxFirst_, m_bxLast_);
1005  m_candL1EtSum->setBXRange(m_bxFirst_, m_bxLast_);
1006 }
BXVector< const l1t::L1Candidate * > * m_candL1EG
Definition: GlobalBoard.h:206
BXVector< const l1t::EtSum * > * m_candL1EtSum
Definition: GlobalBoard.h:209
BXVector< const l1t::L1Candidate * > * m_candL1Jet
Definition: GlobalBoard.h:208
BXVector< const l1t::L1Candidate * > * m_candL1Tau
Definition: GlobalBoard.h:207
void GlobalBoard::resetExternal ( )

Definition at line 1008 of file GlobalBoard.cc.

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

Referenced by receiveExternalData(), and reset().

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

Definition at line 990 of file GlobalBoard.cc.

References m_bxFirst_, m_bxLast_, and m_candL1Mu.

Referenced by receiveMuonObjectData(), and reset().

990  {
991  m_candL1Mu->clear();
992  m_candL1Mu->setBXRange(m_bxFirst_, m_bxLast_);
993 }
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GlobalBoard.h:205
void GlobalBoard::runFDL ( edm::Event iEvent,
const int  iBxInEvent,
const int  totalBxInEvent,
const unsigned int  numberPhysTriggers,
const std::vector< 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 829 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().

837  {
838  if (m_verbosity) {
839  LogDebug("L1TGlobal") << "\n**** GlobalBoard apply Final Decision Logic " << std::endl;
840  }
841 
842  // prescale counters are reset at the beginning of the luminosity segment
843  if (m_firstEv) {
844  // prescale counters: numberPhysTriggers counters per bunch cross
845  m_prescaleCounterAlgoTrig.reserve(numberPhysTriggers * totalBxInEvent);
846 
847  for (int iBxInEvent = 0; iBxInEvent <= totalBxInEvent; ++iBxInEvent) {
848  m_prescaleCounterAlgoTrig.push_back(prescaleFactorsAlgoTrig);
849  }
850  m_firstEv = false;
851  m_currentLumi = iEvent.luminosityBlock();
852  }
853 
854  // update and clear prescales at the beginning of the luminosity segment
857  for (int iBxInEvent = 0; iBxInEvent <= totalBxInEvent; ++iBxInEvent) {
858  m_prescaleCounterAlgoTrig.push_back(prescaleFactorsAlgoTrig);
859  }
860 
861  m_firstEvLumiSegment = false;
862  m_currentLumi = iEvent.luminosityBlock();
863  }
864 
865  // Copy Algorithm bits to Prescaled word
866  // Prescaling and Masking done below if requested.
868 
869  // -------------------------------------------
870  // Apply Prescales or skip if turned off
871  // -------------------------------------------
872  if (!algorithmTriggersUnprescaled) {
873  // iBxInEvent is ... -2 -1 0 1 2 ... while counters are 0 1 2 3 4 ...
874  int inBxInEvent = totalBxInEvent / 2 + iBxInEvent;
875 
876  bool temp_algPrescaledOr = false;
877  for (unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
878  bool bitValue = m_uGtAlgBlk.getAlgoDecisionInitial(iBit);
879  if (bitValue) {
880  // Make sure algo bit in range, warn otherwise
881  if (iBit < prescaleFactorsAlgoTrig.size()) {
882  if (prescaleFactorsAlgoTrig.at(iBit) != 1) {
883  (m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit))--;
884  if (m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit) == 0) {
885  // bit already true in algoDecisionWord, just reset counter
886  m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit) = prescaleFactorsAlgoTrig.at(iBit);
887  temp_algPrescaledOr = true;
888  } else {
889  // change bit to false in prescaled word and final decision word
890  m_uGtAlgBlk.setAlgoDecisionInterm(iBit, false);
891 
892  } //if Prescale counter reached zero
893  } //if prescale factor is not 1 (ie. no prescale)
894  else {
895  temp_algPrescaledOr = true;
896  }
897  } // require bit in range
898  else {
899  edm::LogWarning("L1TGlobal") << "\nWarning: algoBit >= prescaleFactorsAlgoTrig.size() " << std::endl;
900  }
901  } //if algo bit is set true
902  } //loop over alg bits
903 
904  m_algPrescaledOr = temp_algPrescaledOr; //temp
905 
906  } else {
907  // Since not Prescaling just take OR of Initial Work
909 
910  } //if we are going to apply prescales.
911 
912  // Copy Algorithm bits fron Prescaled word to Final Word
913  // Masking done below if requested.
915 
916  if (!algorithmTriggersUnmasked) {
917  bool temp_algFinalOr = false;
918  for (unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
919  bool bitValue = m_uGtAlgBlk.getAlgoDecisionInterm(iBit);
920 
921  if (bitValue) {
922  //bool isMasked = ( triggerMaskAlgoTrig.at(iBit) == 0 );
923  bool isMasked = false;
924  if (iBit < triggerMaskAlgoTrig.size())
925  isMasked = (triggerMaskAlgoTrig.at(iBit) == 0);
926  else {
927  edm::LogWarning("L1TGlobal") << "\nWarning: algoBit >= triggerMaskAlgoTrig.size() " << std::endl;
928  }
929 
930  bool passMask = (bitValue && !isMasked);
931 
932  if (passMask)
933  temp_algFinalOr = true;
934  else
935  m_uGtAlgBlk.setAlgoDecisionFinal(iBit, false);
936 
937  // Check if veto mask is true, if it is, set the event veto flag.
938  if (triggerMaskVetoAlgoTrig.at(iBit) == 1)
939  m_algFinalOrVeto = true;
940  }
941  }
942 
943  m_algIntermOr = temp_algFinalOr;
944 
945  } else {
947 
948  }
949 
950  // Set FinalOR for this board
952 }
#define LogDebug(id)
std::vector< bool > const & getAlgoDecisionInitial() const
Get decision bits.
Definition: GlobalAlgBlk.h:82
void copyIntermToFinal()
Definition: GlobalAlgBlk.h:74
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
void copyInitialToInterm()
Copy vectors words.
Definition: GlobalAlgBlk.h:73
int m_verbosity
verbosity level
Definition: GlobalBoard.h:237
std::vector< std::vector< int > > m_prescaleCounterAlgoTrig
prescale counters: NumberPhysTriggers counters per bunch cross in event
Definition: GlobalBoard.h:229
void setAlgoDecisionInterm(unsigned int bit, bool val)
Definition: GlobalAlgBlk.cc:84
GlobalAlgBlk m_uGtAlgBlk
Definition: GlobalBoard.h:223
bool m_firstEvLumiSegment
Definition: GlobalBoard.h:232
std::vector< bool > const & getAlgoDecisionInterm() const
Definition: GlobalAlgBlk.h:83
void setAlgoDecisionFinal(unsigned int bit, bool val)
Definition: GlobalAlgBlk.cc:94
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 428 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(), newFWLiteAna::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(), CalibrationSummaryClient_cfi::otype, l1t::EnergySumCondition::print(), l1t::MuCondition::print(), l1t::ExternalCondition::print(), l1t::CorrCondition::print(), l1t::CaloCondition::print(), edm::print(), l1t::CorrWithOverlapRemovalCondition::print(), GlobalObjectMap::print(), l1t::AlgorithmEvaluation::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().

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

Member Data Documentation

bool l1t::GlobalBoard::m_algFinalOr
private

Definition at line 244 of file GlobalBoard.h.

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

bool l1t::GlobalBoard::m_algFinalOrVeto
private

Definition at line 245 of file GlobalBoard.h.

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

bool l1t::GlobalBoard::m_algInitialOr
private

Definition at line 241 of file GlobalBoard.h.

Referenced by runFDL(), and runGTL().

bool l1t::GlobalBoard::m_algIntermOr
private

Definition at line 242 of file GlobalBoard.h.

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

bool l1t::GlobalBoard::m_algPrescaledOr
private

Definition at line 243 of file GlobalBoard.h.

Referenced by runFDL(), and runGTL().

unsigned int l1t::GlobalBoard::m_boardEventCount
private

Definition at line 248 of file GlobalBoard.h.

Referenced by GlobalBoard().

int l1t::GlobalBoard::m_bxFirst_
private

Definition at line 217 of file GlobalBoard.h.

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

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

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

Definition at line 209 of file GlobalBoard.h.

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

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

Definition at line 210 of file GlobalBoard.h.

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

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

Definition at line 208 of file GlobalBoard.h.

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

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

Definition at line 205 of file GlobalBoard.h.

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

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

Definition at line 207 of file GlobalBoard.h.

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

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

Definition at line 226 of file GlobalBoard.h.

Referenced by runGTL().

uint l1t::GlobalBoard::m_currentLumi
private

Definition at line 233 of file GlobalBoard.h.

Referenced by runFDL().

bool l1t::GlobalBoard::m_firstEv
private

Definition at line 231 of file GlobalBoard.h.

Referenced by runFDL().

bool l1t::GlobalBoard::m_firstEvLumiSegment
private

Definition at line 232 of file GlobalBoard.h.

Referenced by runFDL().

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

Definition at line 220 of file GlobalBoard.h.

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

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

Definition at line 221 of file GlobalBoard.h.

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

bool l1t::GlobalBoard::m_isDebugEnabled
private

Definition at line 238 of file GlobalBoard.h.

Referenced by runGTL().

const L1CaloGeometry* l1t::GlobalBoard::m_l1CaloGeometry
private

Definition at line 195 of file GlobalBoard.h.

unsigned long long l1t::GlobalBoard::m_l1CaloGeometryCacheID
private

Definition at line 196 of file GlobalBoard.h.

Referenced by GlobalBoard().

const TriggerMenu* l1t::GlobalBoard::m_l1GtMenu
private

Definition at line 191 of file GlobalBoard.h.

unsigned long long l1t::GlobalBoard::m_l1GtMenuCacheID
private

Definition at line 192 of file GlobalBoard.h.

Referenced by GlobalBoard().

const L1MuTriggerScales* l1t::GlobalBoard::m_l1MuTriggerScales
private

Definition at line 198 of file GlobalBoard.h.

unsigned long long l1t::GlobalBoard::m_l1MuTriggerScalesCacheID
private

Definition at line 199 of file GlobalBoard.h.

Referenced by GlobalBoard().

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

prescale counters: NumberPhysTriggers counters per bunch cross in event

Definition at line 229 of file GlobalBoard.h.

Referenced by runFDL().

GlobalAlgBlk l1t::GlobalBoard::m_uGtAlgBlk
private

Definition at line 223 of file GlobalBoard.h.

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

int l1t::GlobalBoard::m_uGtBoardNumber
private

Definition at line 251 of file GlobalBoard.h.

Referenced by GlobalBoard().

bool l1t::GlobalBoard::m_uGtFinalBoard
private

Definition at line 252 of file GlobalBoard.h.

Referenced by GlobalBoard().

int l1t::GlobalBoard::m_verbosity
private