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

77  :
78  m_candL1Mu( new std::vector<const L1MuGMTCand*>),
80 {
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 
96 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
bool isDebugEnabled()
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlAlgorithmOR
std::vector< const L1MuGMTCand * > * m_candL1Mu
void setVerbosity(const int verbosity)
int m_verbosity
verbosity level
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlDecisionWord
unsigned long long m_l1GtMenuCacheID
L1GtEtaPhiConversions * m_gtEtaPhiConversions
unsigned long long m_l1MuTriggerScalesCacheID
unsigned long long m_l1CaloGeometryCacheID
L1GlobalTriggerGTL::~L1GlobalTriggerGTL ( )
virtual

Definition at line 99 of file L1GlobalTriggerGTL.cc.

References m_candL1Mu, m_gtEtaPhiConversions, and reset().

99  {
100 
101  reset();
102  delete m_candL1Mu;
103  delete m_gtEtaPhiConversions;
104 
105 }
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 97 of file L1GlobalTriggerGTL.h.

References m_gtlAlgorithmOR.

Referenced by L1GlobalTriggerFDL::run().

98  {
99  return m_gtlAlgorithmOR;
100  }
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlAlgorithmOR
const std::vector<const L1MuGMTCand*>* L1GlobalTriggerGTL::getCandL1Mu ( ) const
inline

return global muon trigger candidate

Definition at line 103 of file L1GlobalTriggerGTL.h.

References m_candL1Mu.

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

104  {
105  return m_candL1Mu;
106  }
std::vector< const L1MuGMTCand * > * m_candL1Mu
const std::bitset<L1GlobalTriggerReadoutSetup::NumberPhysTriggers>& L1GlobalTriggerGTL::getDecisionWord ( ) const
inline

return decision

Definition at line 91 of file L1GlobalTriggerGTL.h.

References m_gtlDecisionWord.

92  {
93  return m_gtlDecisionWord;
94  }
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlDecisionWord
void L1GlobalTriggerGTL::init ( const int  nrL1Mu,
const int  numberPhysTriggers 
)

initialize the class (mainly reserve)

Definition at line 108 of file L1GlobalTriggerGTL.cc.

References m_candL1Mu.

Referenced by L1GlobalTrigger::produce().

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

print received Muon dataWord

Definition at line 744 of file L1GlobalTriggerGTL.cc.

References LogTrace, and m_candL1Mu.

Referenced by receiveGmtObjectData().

744  {
745 
746  LogTrace("L1GlobalTrigger")
747  << "\nL1GlobalTrigger: GMT data received for BxInEvent = "
748  << iBxInEvent << std::endl;
749 
750  int nrL1Mu = m_candL1Mu->size();
751  LogTrace("L1GlobalTrigger")
752  << "Number of GMT muons = " << nrL1Mu << "\n"
753  << std::endl;
754 
755  for (std::vector<const L1MuGMTCand*>::const_iterator iter =
756  m_candL1Mu->begin(); iter != m_candL1Mu->end(); iter++) {
757 
758  LogTrace("L1GlobalTrigger") << *(*iter) << std::endl;
759 
760  }
761 
762  LogTrace("L1GlobalTrigger") << std::endl;
763 
764 }
std::vector< const L1MuGMTCand * > * m_candL1Mu
#define LogTrace(id)
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 124 of file L1GlobalTriggerGTL.cc.

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

Referenced by L1GlobalTrigger::produce().

126  {
127 
128  if (m_verbosity) {
129  LogDebug("L1GlobalTrigger")
130  << "\n**** L1GlobalTriggerGTL receiving muon data for BxInEvent = "
131  << iBxInEvent << "\n from input tag " << muGmtInputTag << "\n"
132  << std::endl;
133 
134  }
135 
136  reset();
137 
138  // get data from Global Muon Trigger
139  if (receiveMu) {
140 
142  iEvent.getByLabel(muGmtInputTag, muonData);
143 
144  if (!muonData.isValid()) {
145  if (m_verbosity) {
146  edm::LogWarning("L1GlobalTrigger")
147  << "\nWarning: std::vector<L1MuGMTCand> with input tag "
148  << muGmtInputTag
149  << "\nrequested in configuration, but not found in the event.\n"
150  << std::endl;
151  }
152  } else {
153 
154  std::vector<L1MuGMTCand>::const_iterator itMuon;
155  for (itMuon = muonData->begin(); itMuon != muonData->end(); itMuon++) {
156  if ((*itMuon).bx() == iBxInEvent) {
157 
158  (*m_candL1Mu).push_back(&(*itMuon));
159  //LogTrace("L1GlobalTrigger") << (*itMuon)
160  // << std::endl;
161 
162  }
163 
164  }
165 
166  }
167  }
168 
169  if (m_verbosity && m_isDebugEnabled) {
170  printGmtData(iBxInEvent);
171  }
172 
173 }
#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:535
void reset()
clear GTL
void L1GlobalTriggerGTL::reset ( void  )

clear GTL

Definition at line 734 of file L1GlobalTriggerGTL.cc.

References m_candL1Mu, m_gtlAlgorithmOR, and m_gtlDecisionWord.

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

734  {
735 
736  m_candL1Mu->clear();
737 
738  m_gtlDecisionWord.reset();
739  m_gtlAlgorithmOR.reset();
740 
741 }
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlAlgorithmOR
std::vector< const L1MuGMTCand * > * m_candL1Mu
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlDecisionWord
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 176 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(), L1GtCorrelationCondition::print(), L1GtMuonCondition::print(), edm::print(), L1GtCaloCondition::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().

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

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

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

Definition at line 140 of file L1GlobalTriggerGTL.h.

Referenced by run().

L1GtEtaPhiConversions* L1GlobalTriggerGTL::m_gtEtaPhiConversions
private

Definition at line 130 of file L1GlobalTriggerGTL.h.

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

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

Definition at line 136 of file L1GlobalTriggerGTL.h.

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

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

Definition at line 137 of file L1GlobalTriggerGTL.h.

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

bool L1GlobalTriggerGTL::m_isDebugEnabled
private

Definition at line 147 of file L1GlobalTriggerGTL.h.

Referenced by receiveGmtObjectData(), and run().

const L1CaloGeometry* L1GlobalTriggerGTL::m_l1CaloGeometry
private

Definition at line 123 of file L1GlobalTriggerGTL.h.

Referenced by run().

unsigned long long L1GlobalTriggerGTL::m_l1CaloGeometryCacheID
private

Definition at line 124 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), and run().

const L1GtTriggerMenu* L1GlobalTriggerGTL::m_l1GtMenu
private

Definition at line 119 of file L1GlobalTriggerGTL.h.

Referenced by run().

unsigned long long L1GlobalTriggerGTL::m_l1GtMenuCacheID
private

Definition at line 120 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), and run().

const L1MuTriggerScales* L1GlobalTriggerGTL::m_l1MuTriggerScales
private

Definition at line 126 of file L1GlobalTriggerGTL.h.

Referenced by run().

unsigned long long L1GlobalTriggerGTL::m_l1MuTriggerScalesCacheID
private

Definition at line 127 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), and run().

int L1GlobalTriggerGTL::m_verbosity
private

verbosity level

Definition at line 146 of file L1GlobalTriggerGTL.h.

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