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 L1GtTriggerMenum_l1GtMenu
 
unsigned long long m_l1GtMenuCacheID
 
const L1MuTriggerScalesm_l1MuTriggerScales
 
unsigned long long m_l1MuTriggerScalesCacheID
 
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 45 of file L1GlobalTriggerGTL.h.

Constructor & Destructor Documentation

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

Definition at line 77 of file L1GlobalTriggerGTL.cc.

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

79  : m_candL1Mu(new std::vector<const L1MuGMTCand *>),
81 
82  m_gtlAlgorithmOR.reset();
83  m_gtlDecisionWord.reset();
84 
85  // initialize cached IDs
86  m_l1GtMenuCacheID = 0ULL;
89 
90  // pointer to conversion - actually done in the event loop (cached)
93 
94  iC.consumes<std::vector<L1MuGMTCand>>(m_muGmtInputTag);
95 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
bool isDebugEnabled()
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlAlgorithmOR
void setVerbosity(const int verbosity)
int m_verbosity
verbosity level
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlDecisionWord
unsigned long long m_l1GtMenuCacheID
std::vector< const L1MuGMTCand * > * m_candL1Mu
L1GtEtaPhiConversions * m_gtEtaPhiConversions
unsigned long long m_l1MuTriggerScalesCacheID
unsigned long long m_l1CaloGeometryCacheID
L1GlobalTriggerGTL::~L1GlobalTriggerGTL ( )
virtual

Definition at line 98 of file L1GlobalTriggerGTL.cc.

References m_candL1Mu, m_gtEtaPhiConversions, and reset().

98  {
99 
100  reset();
101  delete m_candL1Mu;
102  delete m_gtEtaPhiConversions;
103 }
std::vector< const L1MuGMTCand * > * m_candL1Mu
L1GtEtaPhiConversions * m_gtEtaPhiConversions
void reset()
clear GTL

Member Function Documentation

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

return algorithm OR decision

Definition at line 87 of file L1GlobalTriggerGTL.h.

References m_gtlAlgorithmOR.

Referenced by L1GlobalTriggerFDL::run().

87  {
88  return m_gtlAlgorithmOR;
89  }
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlAlgorithmOR
const std::vector<const L1MuGMTCand *>* L1GlobalTriggerGTL::getCandL1Mu ( ) const
inline

return global muon trigger candidate

Definition at line 92 of file L1GlobalTriggerGTL.h.

References m_candL1Mu.

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

92  {
93  return m_candL1Mu;
94  }
std::vector< const L1MuGMTCand * > * m_candL1Mu
const std::bitset<L1GlobalTriggerReadoutSetup::NumberPhysTriggers>& L1GlobalTriggerGTL::getDecisionWord ( ) const
inline

return decision

Definition at line 81 of file L1GlobalTriggerGTL.h.

References m_gtlDecisionWord.

81  {
82  return m_gtlDecisionWord;
83  }
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlDecisionWord
void L1GlobalTriggerGTL::init ( const int  nrL1Mu,
const int  numberPhysTriggers 
)

initialize the class (mainly reserve)

Definition at line 106 of file L1GlobalTriggerGTL.cc.

References m_candL1Mu.

Referenced by L1GlobalTrigger::produce().

106  {
107 
108  m_candL1Mu->reserve(nrL1Mu);
109 
110  // FIXME move from bitset to std::vector<bool> to be able to use
111  // numberPhysTriggers from EventSetup
112 
113  // m_gtlAlgorithmOR.reserve(numberPhysTriggers);
114  // m_gtlAlgorithmOR.assign(numberPhysTriggers, false);
115 
116  // m_gtlDecisionWord.reserve(numberPhysTriggers);
117  // m_gtlDecisionWord.assign(numberPhysTriggers, false);
118 }
std::vector< const L1MuGMTCand * > * m_candL1Mu
void L1GlobalTriggerGTL::printGmtData ( const int  iBxInEvent) const

print received Muon dataWord

Definition at line 704 of file L1GlobalTriggerGTL.cc.

References LogTrace, and m_candL1Mu.

Referenced by receiveGmtObjectData().

704  {
705 
706  LogTrace("L1GlobalTrigger")
707  << "\nL1GlobalTrigger: GMT data received for BxInEvent = " << iBxInEvent
708  << std::endl;
709 
710  int nrL1Mu = m_candL1Mu->size();
711  LogTrace("L1GlobalTrigger") << "Number of GMT muons = " << nrL1Mu << "\n"
712  << std::endl;
713 
714  for (std::vector<const L1MuGMTCand *>::const_iterator iter =
715  m_candL1Mu->begin();
716  iter != m_candL1Mu->end(); iter++) {
717 
718  LogTrace("L1GlobalTrigger") << *(*iter) << std::endl;
719  }
720 
721  LogTrace("L1GlobalTrigger") << std::endl;
722 }
#define LogTrace(id)
std::vector< const L1MuGMTCand * > * m_candL1Mu
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 121 of file L1GlobalTriggerGTL.cc.

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

Referenced by L1GlobalTrigger::produce().

123  {
124 
125  if (m_verbosity) {
126  LogDebug("L1GlobalTrigger")
127  << "\n**** L1GlobalTriggerGTL receiving muon data for BxInEvent = "
128  << iBxInEvent << "\n from input tag " << muGmtInputTag << "\n"
129  << std::endl;
130  }
131 
132  reset();
133 
134  // get data from Global Muon Trigger
135  if (receiveMu) {
136 
138  iEvent.getByLabel(muGmtInputTag, muonData);
139 
140  if (!muonData.isValid()) {
141  if (m_verbosity) {
142  edm::LogWarning("L1GlobalTrigger")
143  << "\nWarning: std::vector<L1MuGMTCand> with input tag "
144  << muGmtInputTag
145  << "\nrequested in configuration, but not found in the event.\n"
146  << std::endl;
147  }
148  } else {
149 
150  std::vector<L1MuGMTCand>::const_iterator itMuon;
151  for (itMuon = muonData->begin(); itMuon != muonData->end(); itMuon++) {
152  if ((*itMuon).bx() == iBxInEvent) {
153 
154  (*m_candL1Mu).push_back(&(*itMuon));
155  // LogTrace("L1GlobalTrigger") << (*itMuon)
156  // << std::endl;
157  }
158  }
159  }
160  }
161 
162  if (m_verbosity && m_isDebugEnabled) {
163  printGmtData(iBxInEvent);
164  }
165 }
#define LogDebug(id)
void printGmtData(const int iBxInEvent) const
print received Muon dataWord
int m_verbosity
verbosity level
bool isValid() const
Definition: HandleBase.h:74
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
void reset()
clear GTL
void L1GlobalTriggerGTL::reset ( void  )

clear GTL

Definition at line 695 of file L1GlobalTriggerGTL.cc.

References m_candL1Mu, m_gtlAlgorithmOR, and m_gtlDecisionWord.

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

695  {
696 
697  m_candL1Mu->clear();
698 
699  m_gtlDecisionWord.reset();
700  m_gtlAlgorithmOR.reset();
701 }
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlAlgorithmOR
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlDecisionWord
std::vector< const L1MuGMTCand * > * m_candL1Mu
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 168 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(), L1GtTriggerMenu::corCaloTemplate(), L1GtTriggerMenu::corEnergySumTemplate(), L1GtTriggerMenu::corMuonTemplate(), L1GtAlgorithmEvaluation::evaluateAlgorithm(), L1GtConditionEvaluation::evaluateConditionStoreResult(), ForJet, edm::EventSetup::get(), L1GtAlgorithmEvaluation::gtAlgoCombinationVector(), L1GtAlgorithmEvaluation::gtAlgoResult(), L1GtTriggerMenu::gtAlgorithmMap(), L1GtTriggerMenu::gtConditionMap(), L1GtEtaPhiConversions::gtObjectNrBinsPhi(), IsoEG, LogTrace, m_conditionResultMaps, m_gtEtaPhiConversions, m_gtlAlgorithmOR, m_isDebugEnabled, m_l1CaloGeometry, m_l1CaloGeometryCacheID, m_l1GtMenu, m_l1GtMenuCacheID, m_l1MuTriggerScales, m_l1MuTriggerScalesCacheID, m_verbosity, Mu, NoIsoEG, L1GtCondition::objectType(), L1GtAlgorithmEvaluation::operandTokenVector(), L1GtHfBitCountsCondition::print(), L1GtHfRingEtSumsCondition::print(), L1GtCastorCondition::print(), L1GtBptxCondition::print(), L1GtExternalCondition::print(), L1GtEnergySumCondition::print(), L1GtJetCountsCondition::print(), L1GtMuonCondition::print(), L1GtCaloCondition::print(), L1GtCorrelationCondition::print(), edm::print(), L1GtEtaPhiConversions::print(), L1GtAlgorithmEvaluation::print(), L1GlobalTriggerObjectMap::print(), edm::ESHandle< T >::product(), 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().

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

Member Data Documentation

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

Definition at line 117 of file L1GlobalTriggerGTL.h.

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

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

Definition at line 125 of file L1GlobalTriggerGTL.h.

Referenced by run().

L1GtEtaPhiConversions* L1GlobalTriggerGTL::m_gtEtaPhiConversions
private

Definition at line 114 of file L1GlobalTriggerGTL.h.

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

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

Definition at line 119 of file L1GlobalTriggerGTL.h.

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

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

Definition at line 121 of file L1GlobalTriggerGTL.h.

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

bool L1GlobalTriggerGTL::m_isDebugEnabled
private

Definition at line 130 of file L1GlobalTriggerGTL.h.

Referenced by receiveGmtObjectData(), and run().

const L1CaloGeometry* L1GlobalTriggerGTL::m_l1CaloGeometry
private

Definition at line 107 of file L1GlobalTriggerGTL.h.

Referenced by run().

unsigned long long L1GlobalTriggerGTL::m_l1CaloGeometryCacheID
private

Definition at line 108 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), and run().

const L1GtTriggerMenu* L1GlobalTriggerGTL::m_l1GtMenu
private

Definition at line 103 of file L1GlobalTriggerGTL.h.

Referenced by run().

unsigned long long L1GlobalTriggerGTL::m_l1GtMenuCacheID
private

Definition at line 104 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), and run().

const L1MuTriggerScales* L1GlobalTriggerGTL::m_l1MuTriggerScales
private

Definition at line 110 of file L1GlobalTriggerGTL.h.

Referenced by run().

unsigned long long L1GlobalTriggerGTL::m_l1MuTriggerScalesCacheID
private

Definition at line 111 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), and run().

int L1GlobalTriggerGTL::m_verbosity
private

verbosity level

Definition at line 129 of file L1GlobalTriggerGTL.h.

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