CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
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, std::auto_ptr< 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::ConditionEvaluationMap
m_conditionResultMaps
 
L1GtEtaPhiConversionsm_gtEtaPhiConversions
 
std::bitset
< L1GlobalTriggerReadoutSetup::NumberPhysTriggers
m_gtlAlgorithmOR
 
std::bitset
< L1GlobalTriggerReadoutSetup::NumberPhysTriggers
m_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 ( )

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

References m_candL1Mu, m_gtEtaPhiConversions, and reset().

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

References m_gtlAlgorithmOR.

Referenced by L1GlobalTriggerFDL::run().

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

return global muon trigger candidate

Definition at line 102 of file L1GlobalTriggerGTL.h.

References m_candL1Mu.

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

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

return decision

Definition at line 90 of file L1GlobalTriggerGTL.h.

References m_gtlDecisionWord.

91  {
92  return m_gtlDecisionWord;
93  }
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 
119 }
std::vector< const L1MuGMTCand * > * m_candL1Mu
void L1GlobalTriggerGTL::printGmtData ( const int  iBxInEvent) const

print received Muon dataWord

Definition at line 745 of file L1GlobalTriggerGTL.cc.

References LogTrace, and m_candL1Mu.

Referenced by receiveGmtObjectData().

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

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

Referenced by L1GlobalTrigger::produce().

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

clear GTL

Definition at line 735 of file L1GlobalTriggerGTL.cc.

References m_candL1Mu, m_gtlAlgorithmOR, and m_gtlDecisionWord.

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

735  {
736 
737  m_candL1Mu->clear();
738 
739  m_gtlDecisionWord.reset();
740  m_gtlAlgorithmOR.reset();
741 
742 }
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,
std::auto_ptr< 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 174 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, l1CaloGeometry_cfi::l1CaloGeometry, 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(), reco::print(), L1GtHfBitCountsCondition::print(), L1GtHfRingEtSumsCondition::print(), L1GtCastorCondition::print(), L1GtExternalCondition::print(), L1GtBptxCondition::print(), L1GtJetCountsCondition::print(), L1GtEnergySumCondition::print(), L1GtCorrelationCondition::print(), L1GtMuonCondition::print(), L1GtCaloCondition::print(), L1GtEtaPhiConversions::print(), L1GtAlgorithmEvaluation::print(), L1GlobalTriggerObjectMap::print(), edm::ESHandle< class >::product(), L1GlobalTriggerObjectMap::setAlgoBitNumber(), L1GlobalTriggerObjectMap::setAlgoGtlResult(), L1GlobalTriggerObjectMap::setAlgoName(), L1GtMuonCondition::setGtCorrParDeltaPhiNrBins(), L1GtCaloCondition::setGtCorrParDeltaPhiNrBins(), L1GtEtaPhiConversions::setVerbosity(), L1GtConditionEvaluation::setVerbosity(), L1GlobalTriggerObjectMap::swapCombinationVector(), L1GlobalTriggerObjectMap::swapOperandTokenVector(), and TauJet.

Referenced by L1GlobalTrigger::produce().

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

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

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

Definition at line 139 of file L1GlobalTriggerGTL.h.

Referenced by run().

L1GtEtaPhiConversions* L1GlobalTriggerGTL::m_gtEtaPhiConversions
private

Definition at line 129 of file L1GlobalTriggerGTL.h.

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

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

Definition at line 135 of file L1GlobalTriggerGTL.h.

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

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

Definition at line 136 of file L1GlobalTriggerGTL.h.

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

bool L1GlobalTriggerGTL::m_isDebugEnabled
private

Definition at line 146 of file L1GlobalTriggerGTL.h.

Referenced by receiveGmtObjectData(), and run().

const L1CaloGeometry* L1GlobalTriggerGTL::m_l1CaloGeometry
private

Definition at line 122 of file L1GlobalTriggerGTL.h.

Referenced by run().

unsigned long long L1GlobalTriggerGTL::m_l1CaloGeometryCacheID
private

Definition at line 123 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), and run().

const L1GtTriggerMenu* L1GlobalTriggerGTL::m_l1GtMenu
private

Definition at line 118 of file L1GlobalTriggerGTL.h.

Referenced by run().

unsigned long long L1GlobalTriggerGTL::m_l1GtMenuCacheID
private

Definition at line 119 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), and run().

const L1MuTriggerScales* L1GlobalTriggerGTL::m_l1MuTriggerScales
private

Definition at line 125 of file L1GlobalTriggerGTL.h.

Referenced by run().

unsigned long long L1GlobalTriggerGTL::m_l1MuTriggerScalesCacheID
private

Definition at line 126 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), and run().

int L1GlobalTriggerGTL::m_verbosity
private

verbosity level

Definition at line 145 of file L1GlobalTriggerGTL.h.

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