CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1GlobalTriggerGTL Class Reference

#include <L1GlobalTriggerGTL.h>

Public Member Functions

const std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > & getAlgorithmOR () const
 return algorithm OR decision More...
 
const std::vector< const L1MuGMTCand * > * getCandL1Mu () const
 return global muon trigger candidate More...
 
const std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > & getDecisionWord () const
 return decision More...
 
void init (const int nrL1Mu, const int numberPhysTriggers)
 initialize the class (mainly reserve) More...
 
 L1GlobalTriggerGTL (const edm::InputTag &mutag, edm::ConsumesCollector &&iC)
 
void printGmtData (const int iBxInEvent) const
 print received Muon dataWord More...
 
void receiveGmtObjectData (edm::Event &, const edm::InputTag &, const int iBxInEvent, const bool receiveMu, const int nrL1Mu)
 receive data from Global Muon Trigger More...
 
void reset ()
 clear GTL More...
 
void run (edm::Event &iEvent, const edm::EventSetup &evSetup, const L1GlobalTriggerPSB *ptrGtPSB, const bool produceL1GtObjectMapRecord, const int iBxInEvent, L1GlobalTriggerObjectMapRecord *gtObjectMapRecord, const unsigned int numberPhysTriggers, const int nrL1Mu, const int nrL1NoIsoEG, const int nrL1IsoEG, const int nrL1CenJet, const int nrL1ForJet, const int nrL1TauJet, const int nrL1JetCounts, const int ifMuEtaNumberBits, const int ifCaloEtaNumberBits)
 run the GTL More...
 
void setVerbosity (const int verbosity)
 
virtual ~L1GlobalTriggerGTL ()
 

Private Attributes

std::vector< const L1MuGMTCand * > * m_candL1Mu
 
std::vector< L1GtAlgorithmEvaluation::ConditionEvaluationMapm_conditionResultMaps
 
L1GtEtaPhiConversionsm_gtEtaPhiConversions
 
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggersm_gtlAlgorithmOR
 
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggersm_gtlDecisionWord
 
bool m_isDebugEnabled
 
const L1CaloGeometrym_l1CaloGeometry
 
unsigned long long m_l1CaloGeometryCacheID
 
const edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecordm_l1CaloGeometryToken
 
const edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcdm_l1GtMenuToken
 
const L1MuTriggerScalesm_l1MuTriggerScales
 
unsigned long long m_l1MuTriggerScalesCacheID
 
const edm::ESGetToken< L1MuTriggerScales, L1MuTriggerScalesRcdm_l1MuTriggerScalesToken
 
int m_verbosity
 verbosity level More...
 

Detailed Description

Description: Global Trigger Logic board.

Implementation: <TODO: enter implementation details>

Author
: M. Fierro - HEPHY Vienna - ORCA version
: Vasile Mihai Ghete - HEPHY Vienna - CMSSW version

Description: Global Trigger Logic board, see header file for details.

Implementation: <TODO: enter implementation details>

Author
: M. Fierro - HEPHY Vienna - ORCA version
: Vasile Mihai Ghete - HEPHY Vienna - CMSSW version

Definition at line 48 of file L1GlobalTriggerGTL.h.

Constructor & Destructor Documentation

◆ L1GlobalTriggerGTL()

L1GlobalTriggerGTL::L1GlobalTriggerGTL ( const edm::InputTag mutag,
edm::ConsumesCollector &&  iC 
)

Definition at line 69 of file L1GlobalTriggerGTL.cc.

References m_gtEtaPhiConversions, m_gtlAlgorithmOR, m_gtlDecisionWord, m_l1CaloGeometryCacheID, m_l1MuTriggerScalesCacheID, m_verbosity, and L1GtEtaPhiConversions::setVerbosity().

73  m_candL1Mu(new std::vector<const L1MuGMTCand *>),
75  m_gtlAlgorithmOR.reset();
76  m_gtlDecisionWord.reset();
77 
78  // initialize cached IDs
81 
82  // pointer to conversion - actually done in the event loop (cached)
85 
86  iC.consumes<std::vector<L1MuGMTCand>>(m_muGmtInputTag);
87 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
bool isDebugEnabled()
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlAlgorithmOR
const edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecord > m_l1CaloGeometryToken
const edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > m_l1GtMenuToken
void setVerbosity(const int verbosity)
int m_verbosity
verbosity level
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlDecisionWord
const edm::ESGetToken< L1MuTriggerScales, L1MuTriggerScalesRcd > m_l1MuTriggerScalesToken
std::vector< const L1MuGMTCand * > * m_candL1Mu
L1GtEtaPhiConversions * m_gtEtaPhiConversions
unsigned long long m_l1MuTriggerScalesCacheID
unsigned long long m_l1CaloGeometryCacheID

◆ ~L1GlobalTriggerGTL()

L1GlobalTriggerGTL::~L1GlobalTriggerGTL ( )
virtual

Definition at line 90 of file L1GlobalTriggerGTL.cc.

References m_candL1Mu, m_gtEtaPhiConversions, and reset().

90  {
91  reset();
92  delete m_candL1Mu;
93  delete m_gtEtaPhiConversions;
94 }
std::vector< const L1MuGMTCand * > * m_candL1Mu
L1GtEtaPhiConversions * m_gtEtaPhiConversions
void reset()
clear GTL

Member Function Documentation

◆ getAlgorithmOR()

const std::bitset<L1GlobalTriggerReadoutSetup::NumberPhysTriggers>& L1GlobalTriggerGTL::getAlgorithmOR ( ) const
inline

return algorithm OR decision

Definition at line 94 of file L1GlobalTriggerGTL.h.

References m_gtlAlgorithmOR.

Referenced by L1GlobalTriggerFDL::run().

94  {
95  return m_gtlAlgorithmOR;
96  }
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlAlgorithmOR

◆ getCandL1Mu()

const std::vector<const L1MuGMTCand *>* L1GlobalTriggerGTL::getCandL1Mu ( ) const
inline

return global muon trigger candidate

Definition at line 99 of file L1GlobalTriggerGTL.h.

References m_candL1Mu.

Referenced by L1GtMuonCondition::evaluateCondition(), L1GtCorrelationCondition::evaluateCondition(), and L1GtMuonCondition::getCandidate().

99 { return m_candL1Mu; }
std::vector< const L1MuGMTCand * > * m_candL1Mu

◆ getDecisionWord()

const std::bitset<L1GlobalTriggerReadoutSetup::NumberPhysTriggers>& L1GlobalTriggerGTL::getDecisionWord ( ) const
inline

return decision

Definition at line 89 of file L1GlobalTriggerGTL.h.

References m_gtlDecisionWord.

89  {
90  return m_gtlDecisionWord;
91  }
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlDecisionWord

◆ init()

void L1GlobalTriggerGTL::init ( const int  nrL1Mu,
const int  numberPhysTriggers 
)

initialize the class (mainly reserve)

Definition at line 97 of file L1GlobalTriggerGTL.cc.

References m_candL1Mu.

Referenced by L1GlobalTrigger::produce().

97  {
98  m_candL1Mu->reserve(nrL1Mu);
99 
100  // FIXME move from bitset to std::vector<bool> to be able to use
101  // numberPhysTriggers from EventSetup
102 
103  // m_gtlAlgorithmOR.reserve(numberPhysTriggers);
104  // m_gtlAlgorithmOR.assign(numberPhysTriggers, false);
105 
106  // m_gtlDecisionWord.reserve(numberPhysTriggers);
107  // m_gtlDecisionWord.assign(numberPhysTriggers, false);
108 }
std::vector< const L1MuGMTCand * > * m_candL1Mu

◆ printGmtData()

void L1GlobalTriggerGTL::printGmtData ( const int  iBxInEvent) const

print received Muon dataWord

Definition at line 641 of file L1GlobalTriggerGTL.cc.

References LogTrace, and m_candL1Mu.

Referenced by receiveGmtObjectData().

641  {
642  LogTrace("L1GlobalTrigger") << "\nL1GlobalTrigger: GMT data received for BxInEvent = " << iBxInEvent << std::endl;
643 
644  int nrL1Mu = m_candL1Mu->size();
645  LogTrace("L1GlobalTrigger") << "Number of GMT muons = " << nrL1Mu << "\n" << std::endl;
646 
647  for (std::vector<const L1MuGMTCand *>::const_iterator iter = m_candL1Mu->begin(); iter != m_candL1Mu->end(); iter++) {
648  LogTrace("L1GlobalTrigger") << *(*iter) << std::endl;
649  }
650 
651  LogTrace("L1GlobalTrigger") << std::endl;
652 }
#define LogTrace(id)
std::vector< const L1MuGMTCand * > * m_candL1Mu

◆ receiveGmtObjectData()

void L1GlobalTriggerGTL::receiveGmtObjectData ( edm::Event iEvent,
const edm::InputTag muGmtInputTag,
const int  iBxInEvent,
const bool  receiveMu,
const int  nrL1Mu 
)

receive data from Global Muon Trigger

Definition at line 111 of file L1GlobalTriggerGTL.cc.

References iEvent, edm::HandleBase::isValid(), LogDebug, m_isDebugEnabled, m_verbosity, printGmtData(), and reset().

Referenced by L1GlobalTrigger::produce().

115  {
116  if (m_verbosity) {
117  LogDebug("L1GlobalTrigger") << "\n**** L1GlobalTriggerGTL receiving muon data for BxInEvent = " << iBxInEvent
118  << "\n from input tag " << muGmtInputTag << "\n"
119  << std::endl;
120  }
121 
122  reset();
123 
124  // get data from Global Muon Trigger
125  if (receiveMu) {
127  iEvent.getByLabel(muGmtInputTag, muonData);
128 
129  if (!muonData.isValid()) {
130  if (m_verbosity) {
131  edm::LogWarning("L1GlobalTrigger") << "\nWarning: std::vector<L1MuGMTCand> with input tag " << muGmtInputTag
132  << "\nrequested in configuration, but not found in the event.\n"
133  << std::endl;
134  }
135  } else {
136  std::vector<L1MuGMTCand>::const_iterator itMuon;
137  for (itMuon = muonData->begin(); itMuon != muonData->end(); itMuon++) {
138  if ((*itMuon).bx() == iBxInEvent) {
139  (*m_candL1Mu).push_back(&(*itMuon));
140  // LogTrace("L1GlobalTrigger") << (*itMuon)
141  // << std::endl;
142  }
143  }
144  }
145  }
146 
147  if (m_verbosity && m_isDebugEnabled) {
148  printGmtData(iBxInEvent);
149  }
150 }
int iEvent
Definition: GenABIO.cc:224
int m_verbosity
verbosity level
bool isValid() const
Definition: HandleBase.h:70
void printGmtData(const int iBxInEvent) const
print received Muon dataWord
Log< level::Warning, false > LogWarning
#define LogDebug(id)
void reset()
clear GTL

◆ reset()

void L1GlobalTriggerGTL::reset ( void  )

clear GTL

Definition at line 633 of file L1GlobalTriggerGTL.cc.

References m_candL1Mu, m_gtlAlgorithmOR, and m_gtlDecisionWord.

Referenced by L1GlobalTrigger::produce(), receiveGmtObjectData(), and ~L1GlobalTriggerGTL().

633  {
634  m_candL1Mu->clear();
635 
636  m_gtlDecisionWord.reset();
637  m_gtlAlgorithmOR.reset();
638 }
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlAlgorithmOR
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlDecisionWord
std::vector< const L1MuGMTCand * > * m_candL1Mu

◆ run()

void L1GlobalTriggerGTL::run ( edm::Event iEvent,
const edm::EventSetup evSetup,
const L1GlobalTriggerPSB ptrGtPSB,
const bool  produceL1GtObjectMapRecord,
const int  iBxInEvent,
L1GlobalTriggerObjectMapRecord gtObjectMapRecord,
const unsigned int  numberPhysTriggers,
const int  nrL1Mu,
const int  nrL1NoIsoEG,
const int  nrL1IsoEG,
const int  nrL1CenJet,
const int  nrL1ForJet,
const int  nrL1TauJet,
const int  nrL1JetCounts,
const int  ifMuEtaNumberBits,
const int  ifCaloEtaNumberBits 
)

run the GTL

Definition at line 153 of file L1GlobalTriggerGTL.cc.

References CenJet, L1GtCorrelationTemplate::cond0Category(), L1GtCorrelationTemplate::cond0Index(), L1GtCorrelationTemplate::cond1Category(), L1GtCorrelationTemplate::cond1Index(), CondBptx, CondCalo, CondCastor, CondCorrelation, CondEnergySum, CondExternal, CondHfBitCounts, CondHfRingEtSums, CondJetCounts, CondMuon, CondNull, L1GtEtaPhiConversions::convertL1Scales(), L1GtAlgorithmEvaluation::evaluateAlgorithm(), L1GtConditionEvaluation::evaluateConditionStoreResult(), ForJet, edm::EventSetup::get(), edm::EventSetup::getData(), L1GtAlgorithmEvaluation::gtAlgoCombinationVector(), L1GtAlgorithmEvaluation::gtAlgoResult(), L1GtEtaPhiConversions::gtObjectNrBinsPhi(), IsoEG, LogTrace, m_conditionResultMaps, m_gtEtaPhiConversions, m_gtlAlgorithmOR, m_isDebugEnabled, m_l1CaloGeometry, m_l1CaloGeometryCacheID, m_l1CaloGeometryToken, m_l1GtMenuToken, m_l1MuTriggerScales, m_l1MuTriggerScalesCacheID, m_l1MuTriggerScalesToken, m_verbosity, Mu, NoIsoEG, L1GtCondition::objectType(), L1GtAlgorithmEvaluation::operandTokenVector(), print(), L1GtHfRingEtSumsCondition::print(), L1GtCastorCondition::print(), L1GtBptxCondition::print(), L1GtExternalCondition::print(), L1GtHfBitCountsCondition::print(), L1GtEnergySumCondition::print(), L1GtJetCountsCondition::print(), L1GtMuonCondition::print(), L1GtCaloCondition::print(), L1GtCorrelationCondition::print(), L1GtAlgorithmEvaluation::print(), L1GtEtaPhiConversions::print(), L1GlobalTriggerObjectMap::print(), L1GlobalTriggerObjectMap::setAlgoBitNumber(), L1GlobalTriggerObjectMap::setAlgoGtlResult(), L1GlobalTriggerObjectMap::setAlgoName(), L1GtMuonCondition::setGtCorrParDeltaPhiNrBins(), L1GtCaloCondition::setGtCorrParDeltaPhiNrBins(), L1GtEtaPhiConversions::setVerbosity(), L1GtConditionEvaluation::setVerbosity(), L1GlobalTriggerObjectMap::swapCombinationVector(), L1GlobalTriggerObjectMapRecord::swapGtObjectMap(), L1GlobalTriggerObjectMap::swapOperandTokenVector(), and TauJet.

Referenced by L1GlobalTrigger::produce().

168  {
169  // get / update the trigger menu from the EventSetup
170  const auto &l1GtMenu = evSetup.getData(m_l1GtMenuToken);
171 
172  const std::vector<ConditionMap> &conditionMap = l1GtMenu.gtConditionMap();
173  const AlgorithmMap &algorithmMap = l1GtMenu.gtAlgorithmMap();
174 
175  const std::vector<std::vector<L1GtMuonTemplate>> &corrMuon = l1GtMenu.corMuonTemplate();
176 
177  const std::vector<std::vector<L1GtCaloTemplate>> &corrCalo = l1GtMenu.corCaloTemplate();
178 
179  const std::vector<std::vector<L1GtEnergySumTemplate>> &corrEnergySum = l1GtMenu.corEnergySumTemplate();
180 
181  // conversion needed for correlation conditions
182  // done in the condition loop when the first correlation template is in the
183  // menu
184  bool convertScale = false;
185 
186  // get / update the calorimeter geometry from the EventSetup
187  // local cache & check on cacheIdentifier
188  unsigned long long l1CaloGeometryCacheID = evSetup.get<L1CaloGeometryRecord>().cacheIdentifier();
189 
190  if (m_l1CaloGeometryCacheID != l1CaloGeometryCacheID) {
192  m_l1CaloGeometryCacheID = l1CaloGeometryCacheID;
193  convertScale = true;
194  }
195 
196  // get / update the eta and phi muon trigger scales from the EventSetup
197  // local cache & check on cacheIdentifier
198  unsigned long long l1MuTriggerScalesCacheID = evSetup.get<L1MuTriggerScalesRcd>().cacheIdentifier();
199 
200  if (m_l1MuTriggerScalesCacheID != l1MuTriggerScalesCacheID) {
202  m_l1MuTriggerScalesCacheID = l1MuTriggerScalesCacheID;
203  convertScale = true;
204  }
205 
206  if (convertScale) {
209  m_l1CaloGeometry, m_l1MuTriggerScales, ifCaloEtaNumberBits, ifMuEtaNumberBits);
210 
211  // print the conversions if DEBUG and verbosity enabled
212 
213  if (m_verbosity && m_isDebugEnabled) {
214  std::ostringstream myCout;
215  m_gtEtaPhiConversions->print(myCout);
216 
217  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
218  }
219  }
220 
221  // loop over condition maps (one map per condition chip)
222  // then loop over conditions in the map
223  // save the results in temporary maps
224 
225  // never happens in production but at first event...
226  if (m_conditionResultMaps.size() != conditionMap.size()) {
227  m_conditionResultMaps.clear();
228  m_conditionResultMaps.resize(conditionMap.size());
229  }
230 
231  int iChip = -1;
232 
233  for (std::vector<ConditionMap>::const_iterator itCondOnChip = conditionMap.begin();
234  itCondOnChip != conditionMap.end();
235  itCondOnChip++) {
236  iChip++;
237 
238  // L1GtAlgorithmEvaluation::ConditionEvaluationMap cMapResults;
239  // L1GtAlgorithmEvaluation::ConditionEvaluationMap
240  // cMapResults((*itCondOnChip).size()); // hash map
242 
243  for (CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
244  // evaluate condition
245  switch ((itCond->second)->condCategory()) {
246  case CondMuon: {
247  L1GtMuonCondition *muCondition = new L1GtMuonCondition(itCond->second, this, nrL1Mu, ifMuEtaNumberBits);
248 
249  muCondition->setVerbosity(m_verbosity);
251  muCondition->evaluateConditionStoreResult();
252 
253  cMapResults[itCond->first] = muCondition;
254 
255  if (m_verbosity && m_isDebugEnabled) {
256  std::ostringstream myCout;
257  muCondition->print(myCout);
258 
259  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
260  }
261 
262  // delete muCondition;
263 
264  } break;
265  case CondCalo: {
266  L1GtCaloCondition *caloCondition = new L1GtCaloCondition(
267  itCond->second, ptrGtPSB, nrL1NoIsoEG, nrL1IsoEG, nrL1CenJet, nrL1ForJet, nrL1TauJet, ifCaloEtaNumberBits);
268 
269  caloCondition->setVerbosity(m_verbosity);
270  caloCondition->setGtCorrParDeltaPhiNrBins(
271  (m_gtEtaPhiConversions->gtObjectNrBinsPhi(((itCond->second)->objectType())[0])) / 2 + 1);
272  caloCondition->evaluateConditionStoreResult();
273 
274  cMapResults[itCond->first] = caloCondition;
275 
276  if (m_verbosity && m_isDebugEnabled) {
277  std::ostringstream myCout;
278  caloCondition->print(myCout);
279 
280  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
281  }
282  // delete caloCondition;
283 
284  } break;
285  case CondEnergySum: {
286  L1GtEnergySumCondition *eSumCondition = new L1GtEnergySumCondition(itCond->second, ptrGtPSB);
287 
288  eSumCondition->setVerbosity(m_verbosity);
289  eSumCondition->evaluateConditionStoreResult();
290 
291  cMapResults[itCond->first] = eSumCondition;
292 
293  if (m_verbosity && m_isDebugEnabled) {
294  std::ostringstream myCout;
295  eSumCondition->print(myCout);
296 
297  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
298  }
299  // delete eSumCondition;
300 
301  } break;
302  case CondJetCounts: {
303  L1GtJetCountsCondition *jcCondition = new L1GtJetCountsCondition(itCond->second, ptrGtPSB, nrL1JetCounts);
304 
305  jcCondition->setVerbosity(m_verbosity);
306  jcCondition->evaluateConditionStoreResult();
307 
308  cMapResults[itCond->first] = jcCondition;
309 
310  if (m_verbosity && m_isDebugEnabled) {
311  std::ostringstream myCout;
312  jcCondition->print(myCout);
313 
314  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
315  }
316 
317  // delete jcCondition;
318 
319  } break;
320  case CondHfBitCounts: {
321  L1GtHfBitCountsCondition *bcCondition = new L1GtHfBitCountsCondition(itCond->second, ptrGtPSB);
322 
323  bcCondition->setVerbosity(m_verbosity);
324  bcCondition->evaluateConditionStoreResult();
325 
326  cMapResults[itCond->first] = bcCondition;
327 
328  if (m_isDebugEnabled) {
329  std::ostringstream myCout;
330  bcCondition->print(myCout);
331 
332  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
333  }
334 
335  // delete bcCondition;
336 
337  } break;
338  case CondHfRingEtSums: {
339  L1GtHfRingEtSumsCondition *etCondition = new L1GtHfRingEtSumsCondition(itCond->second, ptrGtPSB);
340 
341  etCondition->setVerbosity(m_verbosity);
342  etCondition->evaluateConditionStoreResult();
343 
344  cMapResults[itCond->first] = etCondition;
345 
346  if (m_verbosity && m_isDebugEnabled) {
347  std::ostringstream myCout;
348  etCondition->print(myCout);
349 
350  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
351  }
352 
353  // delete etCondition;
354 
355  } break;
356  case CondCastor: {
357  bool castorCondResult = false;
358 
359  // FIXME need a solution to read CASTOR
360  // if (castorConditionFlag) {
361  // castorCondResult = castorData->conditionResult(itCond->first);
362  //}
363 
364  L1GtCastorCondition *castorCondition = new L1GtCastorCondition(itCond->second, castorCondResult);
365 
366  castorCondition->setVerbosity(m_verbosity);
367  castorCondition->evaluateConditionStoreResult();
368 
369  cMapResults[itCond->first] = castorCondition;
370 
371  if (m_verbosity && m_isDebugEnabled) {
372  std::ostringstream myCout;
373  castorCondition->print(myCout);
374 
375  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
376  }
377 
378  // delete castorCondition;
379 
380  } break;
381  case CondBptx: {
382  bool bptxCondResult = true;
383 
384  // FIXME need a solution to read BPTX with real value
385 
386  L1GtBptxCondition *bptxCondition = new L1GtBptxCondition(itCond->second, bptxCondResult);
387 
388  bptxCondition->setVerbosity(m_verbosity);
389  bptxCondition->evaluateConditionStoreResult();
390 
391  cMapResults[itCond->first] = bptxCondition;
392 
393  if (m_verbosity && m_isDebugEnabled) {
394  std::ostringstream myCout;
395  bptxCondition->print(myCout);
396 
397  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
398  }
399 
400  // delete bptxCondition;
401 
402  } break;
403  case CondExternal: {
404  bool externalCondResult = true;
405 
406  // FIXME need a solution to read External with real value
407 
408  L1GtExternalCondition *externalCondition = new L1GtExternalCondition(itCond->second, externalCondResult);
409 
410  externalCondition->setVerbosity(m_verbosity);
411  externalCondition->evaluateConditionStoreResult();
412 
413  cMapResults[itCond->first] = externalCondition;
414 
415  if (m_verbosity && m_isDebugEnabled) {
416  std::ostringstream myCout;
417  externalCondition->print(myCout);
418 
419  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
420  }
421 
422  // delete externalCondition;
423 
424  } break;
425  case CondCorrelation: {
426  // get first the sub-conditions
427  const L1GtCorrelationTemplate *corrTemplate = static_cast<const L1GtCorrelationTemplate *>(itCond->second);
428  const L1GtConditionCategory cond0Categ = corrTemplate->cond0Category();
429  const L1GtConditionCategory cond1Categ = corrTemplate->cond1Category();
430  const int cond0Ind = corrTemplate->cond0Index();
431  const int cond1Ind = corrTemplate->cond1Index();
432 
433  const L1GtCondition *cond0Condition = nullptr;
434  const L1GtCondition *cond1Condition = nullptr;
435 
436  // maximum number of objects received for evaluation of Type1s condition
437  int cond0NrL1Objects = 0;
438  int cond1NrL1Objects = 0;
439 
440  int cond0EtaBits = 0;
441  int cond1EtaBits = 0;
442 
443  switch (cond0Categ) {
444  case CondMuon: {
445  cond0Condition = &((corrMuon[iChip])[cond0Ind]);
446  cond0NrL1Objects = nrL1Mu;
447  cond0EtaBits = ifMuEtaNumberBits;
448  } break;
449  case CondCalo: {
450  cond0Condition = &((corrCalo[iChip])[cond0Ind]);
451 
452  switch ((cond0Condition->objectType())[0]) {
453  case NoIsoEG:
454  cond0NrL1Objects = nrL1NoIsoEG;
455  break;
456  case IsoEG:
457  cond0NrL1Objects = nrL1IsoEG;
458  break;
459  case CenJet:
460  cond0NrL1Objects = nrL1CenJet;
461  break;
462  case ForJet:
463  cond0NrL1Objects = nrL1ForJet;
464  break;
465  case TauJet:
466  cond0NrL1Objects = nrL1TauJet;
467  break;
468  default:
469  cond0NrL1Objects = 0;
470  break;
471  }
472 
473  cond0EtaBits = ifCaloEtaNumberBits;
474  } break;
475  case CondEnergySum: {
476  cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
477  cond0NrL1Objects = 1;
478  } break;
479  default: {
480  // do nothing, should not arrive here
481  } break;
482  }
483 
484  switch (cond1Categ) {
485  case CondMuon: {
486  cond1Condition = &((corrMuon[iChip])[cond1Ind]);
487  cond1NrL1Objects = nrL1Mu;
488  cond1EtaBits = ifMuEtaNumberBits;
489  } break;
490  case CondCalo: {
491  cond1Condition = &((corrCalo[iChip])[cond1Ind]);
492 
493  switch ((cond1Condition->objectType())[0]) {
494  case NoIsoEG:
495  cond1NrL1Objects = nrL1NoIsoEG;
496  break;
497  case IsoEG:
498  cond1NrL1Objects = nrL1IsoEG;
499  break;
500  case CenJet:
501  cond1NrL1Objects = nrL1CenJet;
502  break;
503  case ForJet:
504  cond1NrL1Objects = nrL1ForJet;
505  break;
506  case TauJet:
507  cond1NrL1Objects = nrL1TauJet;
508  break;
509  default:
510  cond1NrL1Objects = 0;
511  break;
512  }
513 
514  cond1EtaBits = ifCaloEtaNumberBits;
515  } break;
516  case CondEnergySum: {
517  cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
518  cond1NrL1Objects = 1;
519  } break;
520  default: {
521  // do nothing, should not arrive here
522  } break;
523  }
524 
525  L1GtCorrelationCondition *correlationCond = new L1GtCorrelationCondition(itCond->second,
526  cond0Condition,
527  cond1Condition,
528  cond0NrL1Objects,
529  cond1NrL1Objects,
530  cond0EtaBits,
531  cond1EtaBits,
532  this,
533  ptrGtPSB,
535 
536  correlationCond->setVerbosity(m_verbosity);
537  correlationCond->evaluateConditionStoreResult();
538 
539  cMapResults[itCond->first] = correlationCond;
540 
541  if (m_verbosity && m_isDebugEnabled) {
542  std::ostringstream myCout;
543  correlationCond->print(myCout);
544 
545  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
546  }
547 
548  // delete correlationCond;
549 
550  } break;
551  case CondNull: {
552  // do nothing
553 
554  } break;
555  default: {
556  // do nothing
557 
558  } break;
559  }
560  }
561  }
562 
563  // loop over algorithm map
564 
565  // empty vector for object maps - filled during loop
566  std::vector<L1GlobalTriggerObjectMap> objMapVec;
567  if (produceL1GtObjectMapRecord && (iBxInEvent == 0))
568  objMapVec.reserve(numberPhysTriggers);
569 
570  for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
571  L1GtAlgorithmEvaluation gtAlg(itAlgo->second);
572  gtAlg.evaluateAlgorithm((itAlgo->second).algoChipNumber(), m_conditionResultMaps);
573 
574  int algBitNumber = (itAlgo->second).algoBitNumber();
575  bool algResult = gtAlg.gtAlgoResult();
576 
577  if (algResult) {
578  m_gtlAlgorithmOR.set(algBitNumber);
579  }
580 
581  if (m_verbosity && m_isDebugEnabled) {
582  std::ostringstream myCout;
583  (itAlgo->second).print(myCout);
584  gtAlg.print(myCout);
585 
586  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
587  }
588 
589  // object maps only for BxInEvent = 0
590  if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
591  // set object map
593 
594  objMap.setAlgoName(itAlgo->first);
595  objMap.setAlgoBitNumber(algBitNumber);
596  objMap.setAlgoGtlResult(algResult);
597  objMap.swapOperandTokenVector(gtAlg.operandTokenVector());
598  objMap.swapCombinationVector(gtAlg.gtAlgoCombinationVector());
599  // gtAlg is empty now...
600 
601  if (m_verbosity && m_isDebugEnabled) {
602  std::ostringstream myCout1;
603  objMap.print(myCout1);
604 
605  LogTrace("L1GlobalTrigger") << myCout1.str() << std::endl;
606  }
607 
608  objMapVec.push_back(objMap);
609  }
610  }
611 
612  // object maps only for BxInEvent = 0
613  if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
614  gtObjectMapRecord->swapGtObjectMap(objMapVec);
615  }
616 
617  // loop over condition maps (one map per condition chip)
618  // then loop over conditions in the map
619  // delete the conditions created with new, zero pointer, do not clear map,
620  // keep the vector as is...
621  for (std::vector<L1GtAlgorithmEvaluation::ConditionEvaluationMap>::iterator itCondOnChip =
622  m_conditionResultMaps.begin();
623  itCondOnChip != m_conditionResultMaps.end();
624  itCondOnChip++) {
625  for (L1GtAlgorithmEvaluation::ItEvalMap itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
626  delete itCond->second;
627  itCond->second = nullptr;
628  }
629  }
630 }
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlAlgorithmOR
std::vector< L1GtAlgorithmEvaluation::ConditionEvaluationMap > m_conditionResultMaps
void print(std::ostream &myCout) const
print the full object map
const L1GtConditionCategory cond0Category() const
get / set the category of the two sub-conditions
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecord > m_l1CaloGeometryToken
void swapCombinationVector(std::vector< CombinationsInCond > &combinationVectorValue)
void setAlgoName(const std::string &algoNameValue)
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
ConditionMap::const_iterator CItCond
iterators through map containing the conditions
Definition: L1GtObject.h:29
void swapGtObjectMap(std::vector< L1GlobalTriggerObjectMap > &gtObjectMapValue)
void setVerbosity(const int verbosity)
void swapOperandTokenVector(std::vector< L1GtLogicParser::OperandToken > &operandTokenVectorValue)
const L1GtConditionCategory cond1Category() const
void print(std::ostream &myCout) const override
print condition
const edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > m_l1GtMenuToken
#define LogTrace(id)
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
void evaluateConditionStoreResult()
call evaluateCondition and save last result
const unsigned int gtObjectNrBinsPhi(const L1GtObject &) const
return the number of phi bins for a GT object
void setVerbosity(const int verbosity)
void convertL1Scales(const L1CaloGeometry *, const L1MuTriggerScales *, const int, const int)
perform all scale conversions
void print(std::ostream &myCout) const override
print condition
int m_verbosity
verbosity level
virtual void print(std::ostream &myCout) const
print all the performed conversions
const int cond0Index() const
get / set the index of the two sub-conditions in the cor* vector from menu
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
T get() const
Definition: EventSetup.h:79
void print(std::ostream &myCout) const override
print condition
const edm::ESGetToken< L1MuTriggerScales, L1MuTriggerScalesRcd > m_l1MuTriggerScalesToken
std ::unordered_map< std::string, L1GtConditionEvaluation * > ConditionEvaluationMap
copy constructor
const L1MuTriggerScales * m_l1MuTriggerScales
void setAlgoGtlResult(bool algoGtlResultValue)
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
Definition: L1GtCondition.h:67
void print(std::ostream &myCout) const override
print condition
void print(std::ostream &myCout) const override
print condition
L1GtEtaPhiConversions * m_gtEtaPhiConversions
void print(std::ostream &myCout) const override
print condition
void setAlgoBitNumber(int algoBitNumberValue)
void print(std::ostream &myCout) const override
print condition
void setGtCorrParDeltaPhiNrBins(const int &)
ConditionEvaluationMap::iterator ItEvalMap
const L1CaloGeometry * m_l1CaloGeometry
L1GtConditionCategory
condition categories
void print(std::ostream &myCout) const override
print condition
void print(std::ostream &myCout) const override
print condition
void print(std::ostream &myCout) const override
print condition
unsigned long long m_l1MuTriggerScalesCacheID
unsigned long long m_l1CaloGeometryCacheID
void setGtCorrParDeltaPhiNrBins(const int &)

◆ setVerbosity()

void L1GlobalTriggerGTL::setVerbosity ( const int  verbosity)
inline

Definition at line 102 of file L1GlobalTriggerGTL.h.

References m_verbosity, and verbosity.

Referenced by L1GlobalTrigger::L1GlobalTrigger().

102 { m_verbosity = verbosity; }
int m_verbosity
verbosity level
const int verbosity

Member Data Documentation

◆ m_candL1Mu

std::vector<const L1MuGMTCand *>* L1GlobalTriggerGTL::m_candL1Mu
private

Definition at line 123 of file L1GlobalTriggerGTL.h.

Referenced by getCandL1Mu(), init(), printGmtData(), reset(), and ~L1GlobalTriggerGTL().

◆ m_conditionResultMaps

std::vector<L1GtAlgorithmEvaluation::ConditionEvaluationMap> L1GlobalTriggerGTL::m_conditionResultMaps
private

Definition at line 129 of file L1GlobalTriggerGTL.h.

Referenced by run().

◆ m_gtEtaPhiConversions

L1GtEtaPhiConversions* L1GlobalTriggerGTL::m_gtEtaPhiConversions
private

Definition at line 120 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), run(), and ~L1GlobalTriggerGTL().

◆ m_gtlAlgorithmOR

std::bitset<L1GlobalTriggerReadoutSetup::NumberPhysTriggers> L1GlobalTriggerGTL::m_gtlAlgorithmOR
private

Definition at line 125 of file L1GlobalTriggerGTL.h.

Referenced by getAlgorithmOR(), L1GlobalTriggerGTL(), reset(), and run().

◆ m_gtlDecisionWord

std::bitset<L1GlobalTriggerReadoutSetup::NumberPhysTriggers> L1GlobalTriggerGTL::m_gtlDecisionWord
private

Definition at line 126 of file L1GlobalTriggerGTL.h.

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

◆ m_isDebugEnabled

bool L1GlobalTriggerGTL::m_isDebugEnabled
private

Definition at line 134 of file L1GlobalTriggerGTL.h.

Referenced by receiveGmtObjectData(), and run().

◆ m_l1CaloGeometry

const L1CaloGeometry* L1GlobalTriggerGTL::m_l1CaloGeometry
private

Definition at line 112 of file L1GlobalTriggerGTL.h.

Referenced by run().

◆ m_l1CaloGeometryCacheID

unsigned long long L1GlobalTriggerGTL::m_l1CaloGeometryCacheID
private

Definition at line 113 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), and run().

◆ m_l1CaloGeometryToken

const edm::ESGetToken<L1CaloGeometry, L1CaloGeometryRecord> L1GlobalTriggerGTL::m_l1CaloGeometryToken
private

Definition at line 111 of file L1GlobalTriggerGTL.h.

Referenced by run().

◆ m_l1GtMenuToken

const edm::ESGetToken<L1GtTriggerMenu, L1GtTriggerMenuRcd> L1GlobalTriggerGTL::m_l1GtMenuToken
private

Definition at line 108 of file L1GlobalTriggerGTL.h.

Referenced by run().

◆ m_l1MuTriggerScales

const L1MuTriggerScales* L1GlobalTriggerGTL::m_l1MuTriggerScales
private

Definition at line 116 of file L1GlobalTriggerGTL.h.

Referenced by run().

◆ m_l1MuTriggerScalesCacheID

unsigned long long L1GlobalTriggerGTL::m_l1MuTriggerScalesCacheID
private

Definition at line 117 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), and run().

◆ m_l1MuTriggerScalesToken

const edm::ESGetToken<L1MuTriggerScales, L1MuTriggerScalesRcd> L1GlobalTriggerGTL::m_l1MuTriggerScalesToken
private

Definition at line 115 of file L1GlobalTriggerGTL.h.

Referenced by run().

◆ m_verbosity

int L1GlobalTriggerGTL::m_verbosity
private

verbosity level

Definition at line 133 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), receiveGmtObjectData(), run(), and setVerbosity().