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 646 of file L1GlobalTriggerGTL.cc.

References LogTrace, and m_candL1Mu.

Referenced by receiveGmtObjectData().

646  {
647  LogTrace("L1GlobalTrigger") << "\nL1GlobalTrigger: GMT data received for BxInEvent = " << iBxInEvent << std::endl;
648 
649  int nrL1Mu = m_candL1Mu->size();
650  LogTrace("L1GlobalTrigger") << "Number of GMT muons = " << nrL1Mu << "\n" << std::endl;
651 
652  for (std::vector<const L1MuGMTCand *>::const_iterator iter = m_candL1Mu->begin(); iter != m_candL1Mu->end(); iter++) {
653  LogTrace("L1GlobalTrigger") << *(*iter) << std::endl;
654  }
655 
656  LogTrace("L1GlobalTrigger") << std::endl;
657 }
#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 638 of file L1GlobalTriggerGTL.cc.

References m_candL1Mu, m_gtlAlgorithmOR, and m_gtlDecisionWord.

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

638  {
639  m_candL1Mu->clear();
640 
641  m_gtlDecisionWord.reset();
642  m_gtlAlgorithmOR.reset();
643 }
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  // set convertScale to false to avoid executing the conversion
221  // more than once - in case the scales change it will be set to true
222  // in the cache check
223  convertScale = false;
224  }
225 
226  // loop over condition maps (one map per condition chip)
227  // then loop over conditions in the map
228  // save the results in temporary maps
229 
230  // never happens in production but at first event...
231  if (m_conditionResultMaps.size() != conditionMap.size()) {
232  m_conditionResultMaps.clear();
233  m_conditionResultMaps.resize(conditionMap.size());
234  }
235 
236  int iChip = -1;
237 
238  for (std::vector<ConditionMap>::const_iterator itCondOnChip = conditionMap.begin();
239  itCondOnChip != conditionMap.end();
240  itCondOnChip++) {
241  iChip++;
242 
243  // L1GtAlgorithmEvaluation::ConditionEvaluationMap cMapResults;
244  // L1GtAlgorithmEvaluation::ConditionEvaluationMap
245  // cMapResults((*itCondOnChip).size()); // hash map
247 
248  for (CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
249  // evaluate condition
250  switch ((itCond->second)->condCategory()) {
251  case CondMuon: {
252  L1GtMuonCondition *muCondition = new L1GtMuonCondition(itCond->second, this, nrL1Mu, ifMuEtaNumberBits);
253 
254  muCondition->setVerbosity(m_verbosity);
256  muCondition->evaluateConditionStoreResult();
257 
258  cMapResults[itCond->first] = muCondition;
259 
260  if (m_verbosity && m_isDebugEnabled) {
261  std::ostringstream myCout;
262  muCondition->print(myCout);
263 
264  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
265  }
266 
267  // delete muCondition;
268 
269  } break;
270  case CondCalo: {
271  L1GtCaloCondition *caloCondition = new L1GtCaloCondition(
272  itCond->second, ptrGtPSB, nrL1NoIsoEG, nrL1IsoEG, nrL1CenJet, nrL1ForJet, nrL1TauJet, ifCaloEtaNumberBits);
273 
274  caloCondition->setVerbosity(m_verbosity);
275  caloCondition->setGtCorrParDeltaPhiNrBins(
276  (m_gtEtaPhiConversions->gtObjectNrBinsPhi(((itCond->second)->objectType())[0])) / 2 + 1);
277  caloCondition->evaluateConditionStoreResult();
278 
279  cMapResults[itCond->first] = caloCondition;
280 
281  if (m_verbosity && m_isDebugEnabled) {
282  std::ostringstream myCout;
283  caloCondition->print(myCout);
284 
285  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
286  }
287  // delete caloCondition;
288 
289  } break;
290  case CondEnergySum: {
291  L1GtEnergySumCondition *eSumCondition = new L1GtEnergySumCondition(itCond->second, ptrGtPSB);
292 
293  eSumCondition->setVerbosity(m_verbosity);
294  eSumCondition->evaluateConditionStoreResult();
295 
296  cMapResults[itCond->first] = eSumCondition;
297 
298  if (m_verbosity && m_isDebugEnabled) {
299  std::ostringstream myCout;
300  eSumCondition->print(myCout);
301 
302  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
303  }
304  // delete eSumCondition;
305 
306  } break;
307  case CondJetCounts: {
308  L1GtJetCountsCondition *jcCondition = new L1GtJetCountsCondition(itCond->second, ptrGtPSB, nrL1JetCounts);
309 
310  jcCondition->setVerbosity(m_verbosity);
311  jcCondition->evaluateConditionStoreResult();
312 
313  cMapResults[itCond->first] = jcCondition;
314 
315  if (m_verbosity && m_isDebugEnabled) {
316  std::ostringstream myCout;
317  jcCondition->print(myCout);
318 
319  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
320  }
321 
322  // delete jcCondition;
323 
324  } break;
325  case CondHfBitCounts: {
326  L1GtHfBitCountsCondition *bcCondition = new L1GtHfBitCountsCondition(itCond->second, ptrGtPSB);
327 
328  bcCondition->setVerbosity(m_verbosity);
329  bcCondition->evaluateConditionStoreResult();
330 
331  cMapResults[itCond->first] = bcCondition;
332 
333  if (m_isDebugEnabled) {
334  std::ostringstream myCout;
335  bcCondition->print(myCout);
336 
337  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
338  }
339 
340  // delete bcCondition;
341 
342  } break;
343  case CondHfRingEtSums: {
344  L1GtHfRingEtSumsCondition *etCondition = new L1GtHfRingEtSumsCondition(itCond->second, ptrGtPSB);
345 
346  etCondition->setVerbosity(m_verbosity);
347  etCondition->evaluateConditionStoreResult();
348 
349  cMapResults[itCond->first] = etCondition;
350 
351  if (m_verbosity && m_isDebugEnabled) {
352  std::ostringstream myCout;
353  etCondition->print(myCout);
354 
355  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
356  }
357 
358  // delete etCondition;
359 
360  } break;
361  case CondCastor: {
362  bool castorCondResult = false;
363 
364  // FIXME need a solution to read CASTOR
365  // if (castorConditionFlag) {
366  // castorCondResult = castorData->conditionResult(itCond->first);
367  //}
368 
369  L1GtCastorCondition *castorCondition = new L1GtCastorCondition(itCond->second, castorCondResult);
370 
371  castorCondition->setVerbosity(m_verbosity);
372  castorCondition->evaluateConditionStoreResult();
373 
374  cMapResults[itCond->first] = castorCondition;
375 
376  if (m_verbosity && m_isDebugEnabled) {
377  std::ostringstream myCout;
378  castorCondition->print(myCout);
379 
380  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
381  }
382 
383  // delete castorCondition;
384 
385  } break;
386  case CondBptx: {
387  bool bptxCondResult = true;
388 
389  // FIXME need a solution to read BPTX with real value
390 
391  L1GtBptxCondition *bptxCondition = new L1GtBptxCondition(itCond->second, bptxCondResult);
392 
393  bptxCondition->setVerbosity(m_verbosity);
394  bptxCondition->evaluateConditionStoreResult();
395 
396  cMapResults[itCond->first] = bptxCondition;
397 
398  if (m_verbosity && m_isDebugEnabled) {
399  std::ostringstream myCout;
400  bptxCondition->print(myCout);
401 
402  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
403  }
404 
405  // delete bptxCondition;
406 
407  } break;
408  case CondExternal: {
409  bool externalCondResult = true;
410 
411  // FIXME need a solution to read External with real value
412 
413  L1GtExternalCondition *externalCondition = new L1GtExternalCondition(itCond->second, externalCondResult);
414 
415  externalCondition->setVerbosity(m_verbosity);
416  externalCondition->evaluateConditionStoreResult();
417 
418  cMapResults[itCond->first] = externalCondition;
419 
420  if (m_verbosity && m_isDebugEnabled) {
421  std::ostringstream myCout;
422  externalCondition->print(myCout);
423 
424  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
425  }
426 
427  // delete externalCondition;
428 
429  } break;
430  case CondCorrelation: {
431  // get first the sub-conditions
432  const L1GtCorrelationTemplate *corrTemplate = static_cast<const L1GtCorrelationTemplate *>(itCond->second);
433  const L1GtConditionCategory cond0Categ = corrTemplate->cond0Category();
434  const L1GtConditionCategory cond1Categ = corrTemplate->cond1Category();
435  const int cond0Ind = corrTemplate->cond0Index();
436  const int cond1Ind = corrTemplate->cond1Index();
437 
438  const L1GtCondition *cond0Condition = nullptr;
439  const L1GtCondition *cond1Condition = nullptr;
440 
441  // maximum number of objects received for evaluation of Type1s condition
442  int cond0NrL1Objects = 0;
443  int cond1NrL1Objects = 0;
444 
445  int cond0EtaBits = 0;
446  int cond1EtaBits = 0;
447 
448  switch (cond0Categ) {
449  case CondMuon: {
450  cond0Condition = &((corrMuon[iChip])[cond0Ind]);
451  cond0NrL1Objects = nrL1Mu;
452  cond0EtaBits = ifMuEtaNumberBits;
453  } break;
454  case CondCalo: {
455  cond0Condition = &((corrCalo[iChip])[cond0Ind]);
456 
457  switch ((cond0Condition->objectType())[0]) {
458  case NoIsoEG:
459  cond0NrL1Objects = nrL1NoIsoEG;
460  break;
461  case IsoEG:
462  cond0NrL1Objects = nrL1IsoEG;
463  break;
464  case CenJet:
465  cond0NrL1Objects = nrL1CenJet;
466  break;
467  case ForJet:
468  cond0NrL1Objects = nrL1ForJet;
469  break;
470  case TauJet:
471  cond0NrL1Objects = nrL1TauJet;
472  break;
473  default:
474  cond0NrL1Objects = 0;
475  break;
476  }
477 
478  cond0EtaBits = ifCaloEtaNumberBits;
479  } break;
480  case CondEnergySum: {
481  cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
482  cond0NrL1Objects = 1;
483  } break;
484  default: {
485  // do nothing, should not arrive here
486  } break;
487  }
488 
489  switch (cond1Categ) {
490  case CondMuon: {
491  cond1Condition = &((corrMuon[iChip])[cond1Ind]);
492  cond1NrL1Objects = nrL1Mu;
493  cond1EtaBits = ifMuEtaNumberBits;
494  } break;
495  case CondCalo: {
496  cond1Condition = &((corrCalo[iChip])[cond1Ind]);
497 
498  switch ((cond1Condition->objectType())[0]) {
499  case NoIsoEG:
500  cond1NrL1Objects = nrL1NoIsoEG;
501  break;
502  case IsoEG:
503  cond1NrL1Objects = nrL1IsoEG;
504  break;
505  case CenJet:
506  cond1NrL1Objects = nrL1CenJet;
507  break;
508  case ForJet:
509  cond1NrL1Objects = nrL1ForJet;
510  break;
511  case TauJet:
512  cond1NrL1Objects = nrL1TauJet;
513  break;
514  default:
515  cond1NrL1Objects = 0;
516  break;
517  }
518 
519  cond1EtaBits = ifCaloEtaNumberBits;
520  } break;
521  case CondEnergySum: {
522  cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
523  cond1NrL1Objects = 1;
524  } break;
525  default: {
526  // do nothing, should not arrive here
527  } break;
528  }
529 
530  L1GtCorrelationCondition *correlationCond = new L1GtCorrelationCondition(itCond->second,
531  cond0Condition,
532  cond1Condition,
533  cond0NrL1Objects,
534  cond1NrL1Objects,
535  cond0EtaBits,
536  cond1EtaBits,
537  this,
538  ptrGtPSB,
540 
541  correlationCond->setVerbosity(m_verbosity);
542  correlationCond->evaluateConditionStoreResult();
543 
544  cMapResults[itCond->first] = correlationCond;
545 
546  if (m_verbosity && m_isDebugEnabled) {
547  std::ostringstream myCout;
548  correlationCond->print(myCout);
549 
550  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
551  }
552 
553  // delete correlationCond;
554 
555  } break;
556  case CondNull: {
557  // do nothing
558 
559  } break;
560  default: {
561  // do nothing
562 
563  } break;
564  }
565  }
566  }
567 
568  // loop over algorithm map
569 
570  // empty vector for object maps - filled during loop
571  std::vector<L1GlobalTriggerObjectMap> objMapVec;
572  if (produceL1GtObjectMapRecord && (iBxInEvent == 0))
573  objMapVec.reserve(numberPhysTriggers);
574 
575  for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
576  L1GtAlgorithmEvaluation gtAlg(itAlgo->second);
577  gtAlg.evaluateAlgorithm((itAlgo->second).algoChipNumber(), m_conditionResultMaps);
578 
579  int algBitNumber = (itAlgo->second).algoBitNumber();
580  bool algResult = gtAlg.gtAlgoResult();
581 
582  if (algResult) {
583  m_gtlAlgorithmOR.set(algBitNumber);
584  }
585 
586  if (m_verbosity && m_isDebugEnabled) {
587  std::ostringstream myCout;
588  (itAlgo->second).print(myCout);
589  gtAlg.print(myCout);
590 
591  LogTrace("L1GlobalTrigger") << myCout.str() << std::endl;
592  }
593 
594  // object maps only for BxInEvent = 0
595  if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
596  // set object map
598 
599  objMap.setAlgoName(itAlgo->first);
600  objMap.setAlgoBitNumber(algBitNumber);
601  objMap.setAlgoGtlResult(algResult);
602  objMap.swapOperandTokenVector(gtAlg.operandTokenVector());
603  objMap.swapCombinationVector(gtAlg.gtAlgoCombinationVector());
604  // gtAlg is empty now...
605 
606  if (m_verbosity && m_isDebugEnabled) {
607  std::ostringstream myCout1;
608  objMap.print(myCout1);
609 
610  LogTrace("L1GlobalTrigger") << myCout1.str() << std::endl;
611  }
612 
613  objMapVec.push_back(objMap);
614  }
615  }
616 
617  // object maps only for BxInEvent = 0
618  if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
619  gtObjectMapRecord->swapGtObjectMap(objMapVec);
620  }
621 
622  // loop over condition maps (one map per condition chip)
623  // then loop over conditions in the map
624  // delete the conditions created with new, zero pointer, do not clear map,
625  // keep the vector as is...
626  for (std::vector<L1GtAlgorithmEvaluation::ConditionEvaluationMap>::iterator itCondOnChip =
627  m_conditionResultMaps.begin();
628  itCondOnChip != m_conditionResultMaps.end();
629  itCondOnChip++) {
630  for (L1GtAlgorithmEvaluation::ItEvalMap itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
631  delete itCond->second;
632  itCond->second = nullptr;
633  }
634  }
635 }
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().