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

$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 47 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, m_l1MuTriggerScalesCacheID, m_verbosity, and L1GtEtaPhiConversions::setVerbosity().

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)
95 
96 }
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 98 of file L1GlobalTriggerGTL.h.

References m_gtlAlgorithmOR.

Referenced by L1GlobalTriggerFDL::run().

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

return global muon trigger candidate

Definition at line 104 of file L1GlobalTriggerGTL.h.

References m_candL1Mu.

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

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

return decision

Definition at line 92 of file L1GlobalTriggerGTL.h.

References m_gtlDecisionWord.

93  {
94  return m_gtlDecisionWord;
95  }
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 747 of file L1GlobalTriggerGTL.cc.

References LogTrace, and m_candL1Mu.

Referenced by receiveGmtObjectData().

747  {
748 
749  LogTrace("L1GlobalTrigger")
750  << "\nL1GlobalTrigger: GMT data received for BxInEvent = "
751  << iBxInEvent << std::endl;
752 
753  int nrL1Mu = m_candL1Mu->size();
754  LogTrace("L1GlobalTrigger")
755  << "Number of GMT muons = " << nrL1Mu << "\n"
756  << std::endl;
757 
758  for (std::vector<const L1MuGMTCand*>::const_iterator iter =
759  m_candL1Mu->begin(); iter != m_candL1Mu->end(); iter++) {
760 
761  LogTrace("L1GlobalTrigger") << *(*iter) << std::endl;
762 
763  }
764 
765  LogTrace("L1GlobalTrigger") << std::endl;
766 
767 }
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:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
void reset()
clear GTL
void L1GlobalTriggerGTL::reset ( void  )

clear GTL

Definition at line 737 of file L1GlobalTriggerGTL.cc.

References m_candL1Mu, m_gtlAlgorithmOR, and m_gtlDecisionWord.

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

737  {
738 
739  m_candL1Mu->clear();
740 
741  m_gtlDecisionWord.reset();
742  m_gtlAlgorithmOR.reset();
743 
744 }
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 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, 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().

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

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

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

Definition at line 141 of file L1GlobalTriggerGTL.h.

Referenced by run().

L1GtEtaPhiConversions* L1GlobalTriggerGTL::m_gtEtaPhiConversions
private

Definition at line 131 of file L1GlobalTriggerGTL.h.

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

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

Definition at line 137 of file L1GlobalTriggerGTL.h.

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

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

Definition at line 138 of file L1GlobalTriggerGTL.h.

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

bool L1GlobalTriggerGTL::m_isDebugEnabled
private

Definition at line 148 of file L1GlobalTriggerGTL.h.

Referenced by receiveGmtObjectData(), and run().

const L1CaloGeometry* L1GlobalTriggerGTL::m_l1CaloGeometry
private

Definition at line 124 of file L1GlobalTriggerGTL.h.

Referenced by run().

unsigned long long L1GlobalTriggerGTL::m_l1CaloGeometryCacheID
private

Definition at line 125 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), and run().

const L1GtTriggerMenu* L1GlobalTriggerGTL::m_l1GtMenu
private

Definition at line 120 of file L1GlobalTriggerGTL.h.

Referenced by run().

unsigned long long L1GlobalTriggerGTL::m_l1GtMenuCacheID
private

Definition at line 121 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), and run().

const L1MuTriggerScales* L1GlobalTriggerGTL::m_l1MuTriggerScales
private

Definition at line 127 of file L1GlobalTriggerGTL.h.

Referenced by run().

unsigned long long L1GlobalTriggerGTL::m_l1MuTriggerScalesCacheID
private

Definition at line 128 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), and run().

int L1GlobalTriggerGTL::m_verbosity
private

verbosity level

Definition at line 147 of file L1GlobalTriggerGTL.h.

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