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
 
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

$Date$ $Revision$

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

$Date$ $Revision$

Definition at line 45 of file L1GlobalTriggerGTL.h.

Constructor & Destructor Documentation

L1GlobalTriggerGTL::L1GlobalTriggerGTL ( )

Definition at line 79 of file L1GlobalTriggerGTL.cc.

References m_gtEtaPhiConversions, m_gtlAlgorithmOR, m_gtlDecisionWord, m_l1CaloGeometryCacheID, m_l1GtMenuCacheID, and m_l1MuTriggerScalesCacheID.

79  :
80  m_candL1Mu( new std::vector<const L1MuGMTCand*>),
82 {
83 
84  m_gtlAlgorithmOR.reset();
85  m_gtlDecisionWord.reset();
86 
87  // initialize cached IDs
88  m_l1GtMenuCacheID = 0ULL;
91 
92  // pointer to conversion - actually done in the event loop (cached)
94 
95 }
bool isDebugEnabled()
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlAlgorithmOR
std::vector< const L1MuGMTCand * > * m_candL1Mu
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 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 
104 }
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 107 of file L1GlobalTriggerGTL.cc.

References m_candL1Mu.

Referenced by L1GlobalTrigger::produce().

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

print received Muon dataWord

Definition at line 727 of file L1GlobalTriggerGTL.cc.

References LogTrace, and m_candL1Mu.

Referenced by receiveGmtObjectData().

727  {
728 
729  LogTrace("L1GlobalTriggerGTL")
730  << "\nL1GlobalTrigger: GMT data received for BxInEvent = "
731  << iBxInEvent << std::endl;
732 
733  int nrL1Mu = m_candL1Mu->size();
734  LogTrace("L1GlobalTriggerGTL")
735  << "Number of GMT muons = " << nrL1Mu << "\n"
736  << std::endl;
737 
738  for (std::vector<const L1MuGMTCand*>::const_iterator iter =
739  m_candL1Mu->begin(); iter != m_candL1Mu->end(); iter++) {
740 
741  LogTrace("L1GlobalTriggerGTL") << *(*iter) << std::endl;
742 
743  }
744 
745  LogTrace("L1GlobalTriggerGTL") << std::endl;
746 
747 }
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 123 of file L1GlobalTriggerGTL.cc.

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

Referenced by L1GlobalTrigger::produce().

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

clear GTL

Definition at line 717 of file L1GlobalTriggerGTL.cc.

References m_candL1Mu, m_gtlAlgorithmOR, and m_gtlDecisionWord.

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

717  {
718 
719  m_candL1Mu->clear();
720 
721  m_gtlDecisionWord.reset();
722  m_gtlAlgorithmOR.reset();
723 
724 }
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 175 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::convert(), L1GtTriggerMenu::corCaloTemplate(), L1GtTriggerMenu::corEnergySumTemplate(), L1GtTriggerMenu::corMuonTemplate(), L1GtAlgorithmEvaluation::evaluateAlgorithm(), L1GtConditionEvaluation::evaluateConditionStoreResult(), ForJet, edm::EventSetup::get(), L1GtAlgorithmEvaluation::gtAlgoCombinationVector(), L1GtAlgorithmEvaluation::gtAlgoResult(), L1GtTriggerMenu::gtAlgorithmMap(), L1GtTriggerMenu::gtConditionMap(), IsoEG, l1CaloGeometry_cfi::l1CaloGeometry, LogTrace, m_gtEtaPhiConversions, m_gtlAlgorithmOR, m_isDebugEnabled, m_l1CaloGeometry, m_l1CaloGeometryCacheID, m_l1GtMenu, m_l1GtMenuCacheID, m_l1MuTriggerScales, m_l1MuTriggerScalesCacheID, m_verbosity, NoIsoEG, L1GtCondition::objectType(), L1GtLogicParser::operandTokenVector(), reco::print(), L1GtHfRingEtSumsCondition::print(), L1GtCastorCondition::print(), L1GtBptxCondition::print(), L1GtExternalCondition::print(), L1GtHfBitCountsCondition::print(), L1GtEnergySumCondition::print(), L1GtJetCountsCondition::print(), L1GtMuonCondition::print(), L1GtCorrelationCondition::print(), L1GtCaloCondition::print(), L1GtAlgorithmEvaluation::print(), L1GlobalTriggerObjectMap::print(), edm::ESHandle< class >::product(), L1GlobalTriggerObjectMap::setAlgoBitNumber(), L1GlobalTriggerObjectMap::setAlgoGtlResult(), L1GlobalTriggerObjectMap::setAlgoName(), L1GlobalTriggerObjectMap::setCombinationVector(), L1GlobalTriggerObjectMap::setOperandTokenVector(), L1GtConditionEvaluation::setVerbosity(), and TauJet.

Referenced by L1GlobalTrigger::produce().

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

Definition at line 109 of file L1GlobalTriggerGTL.h.

References m_verbosity, and verbosity.

Referenced by L1GlobalTrigger::L1GlobalTrigger().

109  {
111  }
int m_verbosity
verbosity level
const int verbosity

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

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 142 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 141 of file L1GlobalTriggerGTL.h.

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