CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
L1GtUtils Class Reference

#include <L1GtUtils.h>

Classes

class  LogicalExpressionL1Results
 

Public Types

enum  TriggerCategory { AlgorithmTrigger = 0, TechnicalTrigger = 1 }
 

Public Member Functions

const bool availableL1Configuration (int &errorCode, int &l1ConfCode) const
 
const bool decision (const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
 
const bool decision (const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
 
const bool decisionAfterMask (const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
 return decision after trigger mask for a given algorithm or technical trigger More...
 
const bool decisionAfterMask (const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
 
const bool decisionBeforeMask (const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
 return decision before trigger mask for a given algorithm or technical trigger More...
 
const bool decisionBeforeMask (const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
 
void getL1GtRecordInputTag (const edm::Event &iEvent, edm::InputTag &l1GtRecordInputTag, edm::InputTag &l1GtReadoutRecordInputTag) const
 
void getL1GtRunCache (const edm::Run &, const edm::EventSetup &, const bool, const bool, const edm::InputTag &)
 get all the run-constant quantities for L1 trigger and cache them More...
 
void getL1GtRunCache (const edm::Run &, const edm::EventSetup &, const bool, const bool)
 input tag for L1GtTriggerMenuLite found from provenance More...
 
void getL1GtRunCache (const edm::Event &, const edm::EventSetup &, const bool, const bool, const edm::InputTag &)
 
void getL1GtRunCache (const edm::Event &, const edm::EventSetup &, const bool, const bool)
 input tag for L1GtTriggerMenuLite found from provenance More...
 
void getL1GtTriggerMenuLiteInputTag (const edm::Run &iRun, edm::InputTag &l1GtTriggerMenuLiteInputTag) const
 get the input tag for L1GtTriggerMenuLite More...
 
const bool l1AlgoTechTrigBitNumber (const std::string &nameAlgoTechTrig, TriggerCategory &trigCategory, int &bitNumber) const
 
 L1GtUtils ()
 constructor More...
 
const int l1Results (const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
 
const int l1Results (const edm::Event &iEvent, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
 
const std::string & l1TriggerMenu () const
 return the L1 trigger menu name More...
 
const std::string & l1TriggerMenuImplementation () const
 return the L1 trigger menu implementation More...
 
const bool l1TriggerNameFromBit (const int &bitNumber, const TriggerCategory &trigCategory, std::string &aliasL1Trigger, std::string &nameL1Trigger) const
 
const int prescaleFactor (const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
 return prescale factor for a given algorithm or technical trigger More...
 
const int prescaleFactor (const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
 
const std::vector< int > & prescaleFactorSet (const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const TriggerCategory &trigCategory, int &errorCode)
 
const std::vector< int > & prescaleFactorSet (const edm::Event &iEvent, const TriggerCategory &trigCategory, int &errorCode)
 
const int prescaleFactorSetIndex (const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const TriggerCategory &trigCategory, int &errorCode) const
 
const int prescaleFactorSetIndex (const edm::Event &iEvent, const TriggerCategory &trigCategory, int &errorCode) const
 
const edm::InputTagprovL1GtReadoutRecordInputTag ()
 
const edm::InputTagprovL1GtRecordInputTag ()
 return the input tags found from provenance More...
 
const edm::InputTagprovL1GtTriggerMenuLiteInputTag ()
 
const L1GtTriggerMenuLiteptrL1GtTriggerMenuLite (int &errorCode)
 return a pointer to the L1GtTriggerMenuLite product More...
 
const L1GtTriggerMenuptrL1TriggerMenuEventSetup (int &errorCode)
 return a pointer to the L1 trigger menu from event setup More...
 
void retrieveL1EventSetup (const edm::EventSetup &)
 retrieve all the relevant L1 trigger event setup records and cache them to improve the speed More...
 
void retrieveL1GtTriggerMenuLite (const edm::Run &, const edm::InputTag &)
 retrieve L1GtTriggerMenuLite (per run product) and cache it to improve the speed More...
 
const std::string triggerCategory (const TriggerCategory &) const
 public methods More...
 
const int triggerMask (const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
 return trigger mask for a given algorithm or technical trigger More...
 
const int triggerMask (const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
 
const int triggerMask (const std::string &nameAlgoTechTrig, int &errorCode) const
 
const std::vector< unsigned int > & triggerMaskSet (const TriggerCategory &trigCategory, int &errorCode)
 
virtual ~L1GtUtils ()
 destructor More...
 

Private Member Functions

const bool trigResult (const DecisionWord &decWord, const int bitNumber, const std::string &nameAlgoTechTrig, const TriggerCategory &trigCategory, int &errorCode) const
 

Private Attributes

const AlgorithmMapm_algorithmAliasMap
 
const
L1GtTriggerMenuLite::L1TriggerMap
m_algorithmAliasMapLite
 
const AlgorithmMapm_algorithmMap
 
const
L1GtTriggerMenuLite::L1TriggerMap
m_algorithmMapLite
 
bool m_beginRunCache
 flag for call of getL1GtRunCache in beginRun More...
 
bool m_l1EventSetupValid
 
const L1GtTriggerMenum_l1GtMenu
 
unsigned long long m_l1GtMenuCacheID
 
const L1GtTriggerMenuLitem_l1GtMenuLite
 L1GtTriggerMenuLite cached stuff. More...
 
bool m_l1GtMenuLiteValid
 
const L1GtPrescaleFactorsm_l1GtPfAlgo
 prescale factors More...
 
unsigned long long m_l1GtPfAlgoCacheID
 
const L1GtPrescaleFactorsm_l1GtPfTech
 
unsigned long long m_l1GtPfTechCacheID
 
const L1GtStableParametersm_l1GtStablePar
 event setup cached stuff More...
 
unsigned long long m_l1GtStableParCacheID
 
const L1GtTriggerMaskm_l1GtTmAlgo
 trigger masks & veto masks More...
 
unsigned long long m_l1GtTmAlgoCacheID
 
const L1GtTriggerMaskm_l1GtTmTech
 
unsigned long long m_l1GtTmTechCacheID
 
const L1GtTriggerMaskm_l1GtTmVetoAlgo
 
unsigned long long m_l1GtTmVetoAlgoCacheID
 
const L1GtTriggerMaskm_l1GtTmVetoTech
 
unsigned long long m_l1GtTmVetoTechCacheID
 
unsigned int m_numberAlgorithmTriggers
 number of algorithm triggers More...
 
unsigned int m_numberTechnicalTriggers
 number of technical triggers More...
 
unsigned int m_physicsDaqPartition
 index of physics DAQ partition More...
 
const std::vector< std::vector
< int > > * 
m_prescaleFactorsAlgoTrig
 
const std::vector< std::vector
< int > > * 
m_prescaleFactorsAlgoTrigLite
 
std::vector< int > m_prescaleFactorSet
 
const std::vector< std::vector
< int > > * 
m_prescaleFactorsTechTrig
 
const std::vector< std::vector
< int > > * 
m_prescaleFactorsTechTrigLite
 
edm::InputTag m_provL1GtReadoutRecordInputTag
 
edm::InputTag m_provL1GtRecordInputTag
 cached input tags from provenance - they are updated once per run only More...
 
edm::InputTag m_provL1GtTriggerMenuLiteInputTag
 
edm::RunID m_provRunIDCache
 
bool m_retrieveL1EventSetup
 flags to check which method was used to retrieve L1 trigger configuration More...
 
bool m_retrieveL1GtTriggerMenuLite
 
edm::RunID m_runIDCache
 run cache ID More...
 
const AlgorithmMapm_technicalTriggerMap
 
const
L1GtTriggerMenuLite::L1TriggerMap
m_technicalTriggerMapLite
 
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
 
const std::vector< unsigned int > * m_triggerMaskAlgoTrigLite
 
std::vector< unsigned int > m_triggerMaskSet
 
const std::vector< unsigned int > * m_triggerMaskTechTrig
 
const std::vector< unsigned int > * m_triggerMaskTechTrigLite
 
const std::vector< unsigned int > * m_triggerMaskVetoAlgoTrig
 
const std::vector< unsigned int > * m_triggerMaskVetoTechTrig
 

Static Private Attributes

static const std::string EmptyString = ""
 
static const int L1GtNotValidError = 99999
 

Detailed Description

Description: various methods for L1 GT, to be called in an EDM analyzer, producer or filter.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Description: return L1 trigger results for a logical expression.

Implementation: Return L1 trigger results for a logical expression of algorithm or technical triggers. Mixture of algorithm and technical triggers in the logical expression is allowed only if trigger names or aliases are used. Mixing bit numbers and names or aliases is not supported. If the expression has bit numbers, they are assumed to be technical triggers.

Author
: Vasile Mihai Ghete - HEPHY Vienna

Definition at line 46 of file L1GtUtils.h.

Member Enumeration Documentation

Enumerator
AlgorithmTrigger 
TechnicalTrigger 

Definition at line 58 of file L1GtUtils.h.

Constructor & Destructor Documentation

L1GtUtils::L1GtUtils ( )
explicit

constructor

Definition at line 48 of file L1GtUtils.cc.

48  :
49 
51 
53 
55 
57 
59 
60  m_l1GtMenuCacheID(0ULL),
61 
62  m_l1EventSetupValid(false),
63 
64  m_l1GtMenuLiteValid(false),
65 
66  m_beginRunCache(false),
67 
68  m_runIDCache(0),
69 
71 
73 
75 
77 
78  {
79 
80  // empty
81 }
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:533
edm::RunID m_runIDCache
run cache ID
Definition: L1GtUtils.h:519
unsigned long long m_l1GtMenuCacheID
Definition: L1GtUtils.h:483
unsigned long long m_l1GtPfAlgoCacheID
Definition: L1GtUtils.h:454
unsigned long long m_l1GtTmVetoTechCacheID
Definition: L1GtUtils.h:473
edm::RunID m_provRunIDCache
Definition: L1GtUtils.h:520
unsigned long long m_l1GtTmTechCacheID
Definition: L1GtUtils.h:467
unsigned long long m_l1GtTmAlgoCacheID
Definition: L1GtUtils.h:464
unsigned int m_numberTechnicalTriggers
number of technical triggers
Definition: L1GtUtils.h:450
bool m_retrieveL1EventSetup
flags to check which method was used to retrieve L1 trigger configuration
Definition: L1GtUtils.h:532
unsigned int m_physicsDaqPartition
index of physics DAQ partition
Definition: L1GtUtils.h:526
unsigned int m_numberAlgorithmTriggers
number of algorithm triggers
Definition: L1GtUtils.h:447
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:507
bool m_beginRunCache
flag for call of getL1GtRunCache in beginRun
Definition: L1GtUtils.h:510
unsigned long long m_l1GtPfTechCacheID
Definition: L1GtUtils.h:457
bool m_l1EventSetupValid
Definition: L1GtUtils.h:489
unsigned long long m_l1GtTmVetoAlgoCacheID
Definition: L1GtUtils.h:470
unsigned long long m_l1GtStableParCacheID
Definition: L1GtUtils.h:444
L1GtUtils::~L1GtUtils ( )
virtual

destructor

Definition at line 84 of file L1GtUtils.cc.

84  {
85 
86  // empty
87 
88 }

Member Function Documentation

const bool L1GtUtils::availableL1Configuration ( int &  errorCode,
int &  l1ConfCode 
) const

check if L1 trigger configuration is available return false and an error code if configuration is not available

Definition at line 2293 of file L1GtUtils.cc.

References L1GtNotValidError, LogDebug, m_l1EventSetupValid, m_l1GtMenuLiteValid, m_retrieveL1EventSetup, and m_retrieveL1GtTriggerMenuLite.

Referenced by IsolatedTracksNxN::analyze(), L1GtAnalyzer::analyzeL1GtUtilsCore(), L1GtAnalyzer::analyzeTrigger(), l1Results(), prescaleFactorSetIndex(), ptrL1GtTriggerMenuLite(), ptrL1TriggerMenuEventSetup(), triggerMask(), and triggerMaskSet().

2293  {
2294 
2296  if (!m_retrieveL1EventSetup) {
2297  LogDebug("L1GtUtils")
2298  << "\nRetrieve L1 trigger configuration from L1GtTriggerMenuLite only.\n"
2299  << std::endl;
2300  l1ConfCode = 0;
2301  } else {
2302  LogDebug("L1GtUtils")
2303  << "\nFall through: retrieve L1 trigger configuration from L1GtTriggerMenuLite."
2304  << "\nIf L1GtTriggerMenuLite not valid, try to retrieve from event setup.\n"
2305  << std::endl;
2306  l1ConfCode = 100000;
2307  }
2308 
2309  if (m_l1GtMenuLiteValid) {
2310  LogDebug("L1GtUtils")
2311  << "\nRetrieve L1 trigger configuration from L1GtTriggerMenuLite, valid product.\n"
2312  << std::endl;
2313  l1ConfCode = l1ConfCode + 10000;
2314  errorCode = 0;
2315 
2316  return true;
2317 
2318  } else if (m_retrieveL1EventSetup) {
2319  if (m_l1EventSetupValid) {
2320  LogDebug("L1GtUtils")
2321  << "\nFall through: retrieve L1 trigger configuration from event setup."
2322  << "\nFirst option was L1GtTriggerMenuLite - but product is not valid.\n"
2323  << std::endl;
2324  l1ConfCode = l1ConfCode + 20000;
2325  errorCode = 0;
2326 
2327  return true;
2328 
2329  } else {
2330  LogDebug("L1GtUtils")
2331  << "\nFall through: L1GtTriggerMenuLite not valid, event setup not valid.\n"
2332  << std::endl;
2333  l1ConfCode = l1ConfCode + L1GtNotValidError;
2334  errorCode = l1ConfCode;
2335 
2336  return false;
2337 
2338 
2339  }
2340 
2341  } else {
2342  LogDebug("L1GtUtils")
2343  << "\nError: L1 trigger configuration requested from L1GtTriggerMenuLite only"
2344  << "\nbut L1GtTriggerMenuLite is not valid.\n" << std::endl;
2345  l1ConfCode = l1ConfCode + L1GtNotValidError;
2346  errorCode = l1ConfCode;
2347 
2348  return false;
2349 
2350  }
2351  } else if (m_retrieveL1EventSetup) {
2352 
2353  LogDebug("L1GtUtils")
2354  << "\nRetrieve L1 trigger configuration from event setup."
2355  << "\nL1GtTriggerMenuLite product was not requested.\n"
2356  << std::endl;
2357  l1ConfCode = 200000;
2358 
2359  if (m_l1EventSetupValid) {
2360  LogDebug("L1GtUtils")
2361  << "\nRetrieve L1 trigger configuration from event setup only."
2362  << "\nValid L1 trigger event setup.\n"
2363  << std::endl;
2364  l1ConfCode = l1ConfCode + 10000;
2365  errorCode = 0;
2366 
2367  return true;
2368 
2369  } else {
2370  LogDebug("L1GtUtils")
2371  << "\nRetrieve L1 trigger configuration from event setup only."
2372  << "\nNo valid L1 trigger event setup.\n"
2373  << std::endl;
2374  l1ConfCode = l1ConfCode + L1GtNotValidError;
2375  errorCode = l1ConfCode;
2376 
2377  return false;
2378 
2379 
2380  }
2381 
2382  } else {
2383  LogDebug("L1GtUtils")
2384  << "\nError: no L1 trigger configuration requested to be retrieved."
2385  << "\nMust call before getL1GtRunCache in beginRun and analyze.\n"
2386  << std::endl;
2387  l1ConfCode = 300000;
2388  errorCode = l1ConfCode;
2389 
2390  return false;
2391 
2392  }
2393 }
#define LogDebug(id)
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:533
bool m_retrieveL1EventSetup
flags to check which method was used to retrieve L1 trigger configuration
Definition: L1GtUtils.h:532
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:507
static const int L1GtNotValidError
Definition: L1GtUtils.h:429
bool m_l1EventSetupValid
Definition: L1GtUtils.h:489
const bool L1GtUtils::decision ( const edm::Event iEvent,
const edm::InputTag l1GtRecordInputTag,
const edm::InputTag l1GtReadoutRecordInputTag,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

return decision after trigger mask for a given algorithm or technical trigger function identical with decisionAfterMask

Definition at line 1448 of file L1GtUtils.cc.

References decisionAfterMask(), decisionBeforeMask(), l1Results(), prescaleFactor(), and triggerMask().

Referenced by TriggerHelper::acceptL1LogicalExpression(), IsolatedTracksNxN::analyze(), L1GtAnalyzer::analyzeL1GtUtilsCore(), L1GtAnalyzer::analyzeTrigger(), and PrescaleWeightProvider::prescaleWeight().

1451  {
1452 
1453  // initial values
1454  bool decisionBeforeMask = false;
1455  bool decisionAfterMask = false;
1456  int prescaleFactor = -1;
1457  int triggerMask = -1;
1458 
1459  errorCode = l1Results(iEvent, l1GtRecordInputTag,
1460  l1GtReadoutRecordInputTag, nameAlgoTechTrig, decisionBeforeMask,
1461  decisionAfterMask, prescaleFactor, triggerMask);
1462 
1463  return decisionAfterMask;
1464 
1465 }
const bool decisionAfterMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1411
const int l1Results(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
Definition: L1GtUtils.cc:885
const bool decisionBeforeMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1374
const int triggerMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1520
const int prescaleFactor(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1485
const bool L1GtUtils::decision ( const edm::Event iEvent,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

Definition at line 1467 of file L1GtUtils.cc.

References decisionAfterMask(), decisionBeforeMask(), l1Results(), prescaleFactor(), and triggerMask().

1468  {
1469 
1470  // initial values
1471  bool decisionBeforeMask = false;
1472  bool decisionAfterMask = false;
1473  int prescaleFactor = -1;
1474  int triggerMask = -1;
1475 
1476  errorCode = l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1477  decisionAfterMask, prescaleFactor, triggerMask);
1478 
1479  return decisionAfterMask;
1480 
1481 }
const bool decisionAfterMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1411
const int l1Results(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
Definition: L1GtUtils.cc:885
const bool decisionBeforeMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1374
const int triggerMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1520
const int prescaleFactor(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1485
const bool L1GtUtils::decisionAfterMask ( const edm::Event iEvent,
const edm::InputTag l1GtRecordInputTag,
const edm::InputTag l1GtReadoutRecordInputTag,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

return decision after trigger mask for a given algorithm or technical trigger

Definition at line 1411 of file L1GtUtils.cc.

References decisionBeforeMask(), l1Results(), prescaleFactor(), and triggerMask().

Referenced by GenericTriggerEventFlag::acceptL1LogicalExpression(), L1GtAnalyzer::analyzeL1GtUtilsCore(), L1GtAnalyzer::analyzeTrigger(), decision(), decisionAfterMask(), decisionBeforeMask(), prescaleFactor(), and triggerMask().

1414  {
1415 
1416  // initial values
1417  bool decisionBeforeMask = false;
1418  bool decisionAfterMask = false;
1419  int prescaleFactor = -1;
1420  int triggerMask = -1;
1421 
1422  errorCode = l1Results(iEvent, l1GtRecordInputTag,
1423  l1GtReadoutRecordInputTag, nameAlgoTechTrig, decisionBeforeMask,
1424  decisionAfterMask, prescaleFactor, triggerMask);
1425 
1426  return decisionAfterMask;
1427 
1428 }
const bool decisionAfterMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1411
const int l1Results(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
Definition: L1GtUtils.cc:885
const bool decisionBeforeMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1374
const int triggerMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1520
const int prescaleFactor(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1485
const bool L1GtUtils::decisionAfterMask ( const edm::Event iEvent,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

Definition at line 1430 of file L1GtUtils.cc.

References decisionAfterMask(), decisionBeforeMask(), l1Results(), prescaleFactor(), and triggerMask().

1431  {
1432 
1433  // initial values
1434  bool decisionBeforeMask = false;
1435  bool decisionAfterMask = false;
1436  int prescaleFactor = -1;
1437  int triggerMask = -1;
1438 
1439  errorCode = l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1440  decisionAfterMask, prescaleFactor, triggerMask);
1441 
1442  return decisionAfterMask;
1443 
1444 }
const bool decisionAfterMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1411
const int l1Results(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
Definition: L1GtUtils.cc:885
const bool decisionBeforeMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1374
const int triggerMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1520
const int prescaleFactor(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1485
const bool L1GtUtils::decisionBeforeMask ( const edm::Event iEvent,
const edm::InputTag l1GtRecordInputTag,
const edm::InputTag l1GtReadoutRecordInputTag,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

return decision before trigger mask for a given algorithm or technical trigger

for the functions decisionBeforeMask, decisionAfterMask, decision prescaleFactor, trigger mask:

input: event, event setup input tag for the L1GlobalTriggerRecord product input tag for the L1GlobalTriggerReadoutRecord product algorithm trigger name or alias, or technical trigger name output (by reference): error code return: the corresponding quantity

if input tags are not given, they are found for the appropriate EDM products from provenance

Definition at line 1374 of file L1GtUtils.cc.

References decisionAfterMask(), l1Results(), prescaleFactor(), and triggerMask().

Referenced by GenericTriggerEventFlag::acceptL1LogicalExpression(), L1GtAnalyzer::analyzeL1GtUtilsCore(), L1GtAnalyzer::analyzeTrigger(), decision(), decisionAfterMask(), decisionBeforeMask(), l1Results(), prescaleFactor(), and triggerMask().

1377  {
1378 
1379  // initial values
1380  bool decisionBeforeMask = false;
1381  bool decisionAfterMask = false;
1382  int prescaleFactor = -1;
1383  int triggerMask = -1;
1384 
1385  errorCode = l1Results(iEvent, l1GtRecordInputTag,
1386  l1GtReadoutRecordInputTag, nameAlgoTechTrig, decisionBeforeMask,
1387  decisionAfterMask, prescaleFactor, triggerMask);
1388 
1389  return decisionBeforeMask;
1390 
1391 }
const bool decisionAfterMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1411
const int l1Results(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
Definition: L1GtUtils.cc:885
const bool decisionBeforeMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1374
const int triggerMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1520
const int prescaleFactor(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1485
const bool L1GtUtils::decisionBeforeMask ( const edm::Event iEvent,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

Definition at line 1393 of file L1GtUtils.cc.

References decisionAfterMask(), decisionBeforeMask(), l1Results(), prescaleFactor(), and triggerMask().

1394  {
1395 
1396  // initial values
1397  bool decisionBeforeMask = false;
1398  bool decisionAfterMask = false;
1399  int prescaleFactor = -1;
1400  int triggerMask = -1;
1401 
1402  errorCode = l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1403  decisionAfterMask, prescaleFactor, triggerMask);
1404 
1405  return decisionBeforeMask;
1406 
1407 }
const bool decisionAfterMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1411
const int l1Results(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
Definition: L1GtUtils.cc:885
const bool decisionBeforeMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1374
const int triggerMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1520
const int prescaleFactor(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1485
void L1GtUtils::getL1GtRecordInputTag ( const edm::Event iEvent,
edm::InputTag l1GtRecordInputTag,
edm::InputTag l1GtReadoutRecordInputTag 
) const

find from provenance the input tags for L1GlobalTriggerRecord and L1GlobalTriggerReadoutRecord if the product does not exist, return empty input tags

Definition at line 427 of file L1GtUtils.cc.

References edm::EventID::event(), edm::friendlyname::friendlyName(), edm::Event::getAllProvenance(), edm::EventBase::id(), LogDebug, LogTrace, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getL1GtRunCache().

429  {
430 
431  typedef std::vector<edm::Provenance const*> Provenances;
432  Provenances provenances;
434  std::string modLabel;
435  std::string instanceName;
436  std::string processName;
437 
438  bool foundL1GtRecord = false;
439  bool foundL1GtReadoutRecord = false;
440 
441  LogDebug("L1GtUtils") << "\nTry to get AllProvenance for event "
442  << iEvent.id().event() << std::endl;
443 
444  iEvent.getAllProvenance(provenances);
445 
446  LogTrace("L1GtUtils") << "\n" << "Event contains " << provenances.size()
447  << " product" << (provenances.size() == 1 ? "" : "s")
448  << " with friendlyClassName, moduleLabel, productInstanceName and processName:\n"
449  << std::endl;
450 
451  for (Provenances::iterator itProv = provenances.begin(), itProvEnd =
452  provenances.end(); itProv != itProvEnd; ++itProv) {
453 
454  friendlyName = (*itProv)->friendlyClassName();
455  modLabel = (*itProv)->moduleLabel();
456  instanceName = (*itProv)->productInstanceName();
457  processName = (*itProv)->processName();
458 
459  LogTrace("L1GtUtils") << friendlyName << "\t \"" << modLabel
460  << "\" \t \"" << instanceName << "\" \t \"" << processName
461  << "\"" << std::endl;
462 
463  if (friendlyName == "L1GlobalTriggerRecord") {
464  l1GtRecordInputTag = edm::InputTag(modLabel, instanceName,
465  processName);
466  foundL1GtRecord = true;
467  } else if (friendlyName == "L1GlobalTriggerReadoutRecord") {
468 
469  l1GtReadoutRecordInputTag = edm::InputTag(modLabel, instanceName,
470  processName);
471  foundL1GtReadoutRecord = true;
472  }
473  }
474 
475  // if not found, return empty input tags
476  if (!foundL1GtRecord) {
477  l1GtRecordInputTag = edm::InputTag();
478  } else {
479  LogTrace("L1GtUtils")
480  << "\nL1GlobalTriggerRecord found in the event with \n "
481  << l1GtRecordInputTag << std::endl;
482  }
483 
484  if (!foundL1GtReadoutRecord) {
485  l1GtReadoutRecordInputTag = edm::InputTag();
486  } else {
487  LogTrace("L1GtUtils")
488  << "\nL1GlobalTriggerReadoutRecord found in the event with \n "
489  << l1GtReadoutRecordInputTag << std::endl;
490  }
491 
492 }
#define LogDebug(id)
EventNumber_t event() const
Definition: EventID.h:44
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Event.cc:86
std::string friendlyName(std::string const &iFullName)
#define LogTrace(id)
edm::EventID id() const
Definition: EventBase.h:56
void L1GtUtils::getL1GtRunCache ( const edm::Run iRun,
const edm::EventSetup evSetup,
const bool  useL1EventSetup,
const bool  useL1GtTriggerMenuLite,
const edm::InputTag l1GtTmLInputTag 
)

get all the run-constant quantities for L1 trigger and cache them

for use in beginRun(const edm::Run&, const edm::EventSetup&); input tag for L1GtTriggerMenuLite explicitly given

Definition at line 311 of file L1GtUtils.cc.

References m_beginRunCache, retrieveL1EventSetup(), and retrieveL1GtTriggerMenuLite().

Referenced by GenericTriggerEventFlag::acceptL1(), HLTInfo::analyze(), IsolatedTracksNxN::analyze(), L1GtAnalyzer::analyzeL1GtUtils(), L1GtAnalyzer::analyzeL1GtUtilsEventSetup(), L1GtAnalyzer::analyzeL1GtUtilsMenuLite(), L1GtAnalyzer::analyzeTrigger(), L1GtAnalyzer::beginRun(), getL1GtRunCache(), GenericTriggerEventFlag::initRun(), and pat::PATTriggerProducer::produce().

313  {
314 
315  // first call will turn this to true: the quantities which can be cached in
316  // beginRun will not be cached then in analyze
317  m_beginRunCache = true;
318 
319  // if requested, retrieve and cache L1 event setup
320  // keep the caching based on cacheIdentifier() for each record
321  if (useL1EventSetup) {
322  retrieveL1EventSetup(evSetup);
323  }
324 
325  // cached per run
326 
327  // if requested, retrieve and cache the L1GtTriggerMenuLite
328  // L1GtTriggerMenuLite is defined per run and produced in prompt reco by L1Reco
329  // and put in the Run section
331  retrieveL1GtTriggerMenuLite(iRun, l1GtTmLInputTag);
332  }
333 
334 }
static const bool useL1GtTriggerMenuLite(false)
void retrieveL1GtTriggerMenuLite(const edm::Run &, const edm::InputTag &)
retrieve L1GtTriggerMenuLite (per run product) and cache it to improve the speed
Definition: L1GtUtils.cc:269
void retrieveL1EventSetup(const edm::EventSetup &)
retrieve all the relevant L1 trigger event setup records and cache them to improve the speed ...
Definition: L1GtUtils.cc:111
static const bool useL1EventSetup(true)
bool m_beginRunCache
flag for call of getL1GtRunCache in beginRun
Definition: L1GtUtils.h:510
void L1GtUtils::getL1GtRunCache ( const edm::Run iRun,
const edm::EventSetup evSetup,
const bool  useL1EventSetup,
const bool  useL1GtTriggerMenuLite 
)

input tag for L1GtTriggerMenuLite found from provenance

Definition at line 337 of file L1GtUtils.cc.

References getL1GtRunCache(), getL1GtTriggerMenuLiteInputTag(), and m_provL1GtTriggerMenuLiteInputTag.

339  {
340 
343 
344  }
345 
348 
349 }
static const bool useL1GtTriggerMenuLite(false)
edm::InputTag m_provL1GtTriggerMenuLiteInputTag
Definition: L1GtUtils.h:516
void getL1GtTriggerMenuLiteInputTag(const edm::Run &iRun, edm::InputTag &l1GtTriggerMenuLiteInputTag) const
get the input tag for L1GtTriggerMenuLite
Definition: L1GtUtils.cc:494
static const bool useL1EventSetup(true)
void getL1GtRunCache(const edm::Run &, const edm::EventSetup &, const bool, const bool, const edm::InputTag &)
get all the run-constant quantities for L1 trigger and cache them
Definition: L1GtUtils.cc:311
void L1GtUtils::getL1GtRunCache ( const edm::Event iEvent,
const edm::EventSetup evSetup,
const bool  useL1EventSetup,
const bool  useL1GtTriggerMenuLite,
const edm::InputTag l1GtTmLInputTag 
)

for use in analyze(const edm::Event&, const edm::EventSetup&) input tag for L1GtTriggerMenuLite explicitly given

Definition at line 353 of file L1GtUtils.cc.

References getL1GtRecordInputTag(), edm::Event::getRun(), edm::RunAuxiliary::id(), m_beginRunCache, m_provL1GtReadoutRecordInputTag, m_provL1GtRecordInputTag, m_runIDCache, retrieveL1EventSetup(), retrieveL1GtTriggerMenuLite(), and edm::Run::runAuxiliary().

355  {
356 
357  // if there was no retrieval and caching in beginRun, do it here
358  if (!m_beginRunCache) {
359 
360  // if requested, retrieve and cache L1 event setup
361  // keep the caching based on cacheIdentifier() for each record
362  if (useL1EventSetup) {
363  retrieveL1EventSetup(evSetup);
364  }
365  }
366 
367  // cached per run
368 
369  const edm::Run& iRun = iEvent.getRun();
370  edm::RunID runID = iRun.runAuxiliary().id();
371 
372  if (runID != m_runIDCache) {
373 
374  if (!m_beginRunCache) {
375  // if requested, retrieve and cache the L1GtTriggerMenuLite
376  // L1GtTriggerMenuLite is defined per run and produced in prompt reco by L1Reco
377  // and put in the Run section
379  retrieveL1GtTriggerMenuLite(iRun, l1GtTmLInputTag);
380  }
381  }
382 
383  // find from provenance and cache the input tags for L1GlobalTriggerRecord and
384  // L1GlobalTriggerReadoutRecord
387 
388  //
389  m_runIDCache = runID;
390 
391  }
392 
393 }
edm::RunID m_runIDCache
run cache ID
Definition: L1GtUtils.h:519
static const bool useL1GtTriggerMenuLite(false)
edm::InputTag m_provL1GtReadoutRecordInputTag
Definition: L1GtUtils.h:515
void retrieveL1GtTriggerMenuLite(const edm::Run &, const edm::InputTag &)
retrieve L1GtTriggerMenuLite (per run product) and cache it to improve the speed
Definition: L1GtUtils.cc:269
Run const & getRun() const
Definition: Event.cc:61
RunID const & id() const
Definition: RunAuxiliary.h:37
void getL1GtRecordInputTag(const edm::Event &iEvent, edm::InputTag &l1GtRecordInputTag, edm::InputTag &l1GtReadoutRecordInputTag) const
Definition: L1GtUtils.cc:427
edm::InputTag m_provL1GtRecordInputTag
cached input tags from provenance - they are updated once per run only
Definition: L1GtUtils.h:514
void retrieveL1EventSetup(const edm::EventSetup &)
retrieve all the relevant L1 trigger event setup records and cache them to improve the speed ...
Definition: L1GtUtils.cc:111
static const bool useL1EventSetup(true)
RunAuxiliary const & runAuxiliary() const
Definition: Run.h:55
bool m_beginRunCache
flag for call of getL1GtRunCache in beginRun
Definition: L1GtUtils.h:510
Definition: Run.h:41
void L1GtUtils::getL1GtRunCache ( const edm::Event iEvent,
const edm::EventSetup evSetup,
const bool  useL1EventSetup,
const bool  useL1GtTriggerMenuLite 
)

input tag for L1GtTriggerMenuLite found from provenance

Definition at line 396 of file L1GtUtils.cc.

References getL1GtRunCache(), getL1GtTriggerMenuLiteInputTag(), edm::Event::getRun(), edm::RunAuxiliary::id(), m_beginRunCache, m_provL1GtTriggerMenuLiteInputTag, m_provRunIDCache, and edm::Run::runAuxiliary().

398  {
399 
400  // if the input tag for L1GtTriggerMenuLite was not found in beginRun, do it here
401  if (!m_beginRunCache) {
402 
403  const edm::Run& iRun = iEvent.getRun();
404  edm::RunID runID = iRun.runAuxiliary().id();
405 
406  if (runID != m_provRunIDCache) {
407 
409 
412  }
413 
414  //
415  m_provRunIDCache = runID;
416  }
417 
418  }
419 
420  // call now the general method for getL1GtRunCache
423 
424 }
static const bool useL1GtTriggerMenuLite(false)
edm::InputTag m_provL1GtTriggerMenuLiteInputTag
Definition: L1GtUtils.h:516
Run const & getRun() const
Definition: Event.cc:61
RunID const & id() const
Definition: RunAuxiliary.h:37
edm::RunID m_provRunIDCache
Definition: L1GtUtils.h:520
void getL1GtTriggerMenuLiteInputTag(const edm::Run &iRun, edm::InputTag &l1GtTriggerMenuLiteInputTag) const
get the input tag for L1GtTriggerMenuLite
Definition: L1GtUtils.cc:494
static const bool useL1EventSetup(true)
void getL1GtRunCache(const edm::Run &, const edm::EventSetup &, const bool, const bool, const edm::InputTag &)
get all the run-constant quantities for L1 trigger and cache them
Definition: L1GtUtils.cc:311
RunAuxiliary const & runAuxiliary() const
Definition: Run.h:55
bool m_beginRunCache
flag for call of getL1GtRunCache in beginRun
Definition: L1GtUtils.h:510
Definition: Run.h:41
void L1GtUtils::getL1GtTriggerMenuLiteInputTag ( const edm::Run iRun,
edm::InputTag l1GtTriggerMenuLiteInputTag 
) const

get the input tag for L1GtTriggerMenuLite

Definition at line 494 of file L1GtUtils.cc.

References edm::friendlyname::friendlyName(), edm::Run::getAllProvenance(), LogDebug, LogTrace, edm::RunAuxiliary::run(), edm::Run::runAuxiliary(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getL1GtRunCache().

495  {
496 
497  typedef std::vector<edm::Provenance const*> Provenances;
498  Provenances provenances;
500  std::string modLabel;
501  std::string instanceName;
502  std::string processName;
503 
504  bool foundL1GtTriggerMenuLite = false;
505 
506  LogDebug("L1GtUtils") << "\nTry to get AllProvenance for run "
507  << iRun.runAuxiliary().run() << std::endl;
508 
509  iRun.getAllProvenance(provenances);
510 
511  LogTrace("L1GtUtils") << "\n" << "Run contains " << provenances.size()
512  << " product" << (provenances.size() == 1 ? "" : "s")
513  << " with friendlyClassName, moduleLabel, productInstanceName and processName:\n"
514  << std::endl;
515 
516  for (Provenances::iterator itProv = provenances.begin(), itProvEnd =
517  provenances.end(); itProv != itProvEnd; ++itProv) {
518 
519  friendlyName = (*itProv)->friendlyClassName();
520  modLabel = (*itProv)->moduleLabel();
521  instanceName = (*itProv)->productInstanceName();
522  processName = (*itProv)->processName();
523 
524  LogTrace("L1GtUtils") << friendlyName << "\t \"" << modLabel
525  << "\" \t \"" << instanceName << "\" \t \"" << processName
526  << "\"" << std::endl;
527 
528  if (friendlyName == "L1GtTriggerMenuLite") {
529  l1GtTriggerMenuLiteInputTag = edm::InputTag(modLabel, instanceName,
530  processName);
531  foundL1GtTriggerMenuLite = true;
532  }
533 
534  }
535 
536  if (!foundL1GtTriggerMenuLite) {
537  l1GtTriggerMenuLiteInputTag = edm::InputTag();
538  LogTrace("L1GtUtils") << "\nL1GtTriggerMenuLite not found in Run"
539  << std::endl;
540  } else {
541  LogTrace("L1GtUtils") << "\nL1GtTriggerMenuLite found in Run with \n "
542  << l1GtTriggerMenuLiteInputTag << std::endl;
543  }
544 
545 }
#define LogDebug(id)
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Run.cc:44
std::string friendlyName(std::string const &iFullName)
#define LogTrace(id)
RunAuxiliary const & runAuxiliary() const
Definition: Run.h:55
RunNumber_t run() const
Definition: RunAuxiliary.h:41
const bool L1GtUtils::l1AlgoTechTrigBitNumber ( const std::string &  nameAlgoTechTrig,
TriggerCategory trigCategory,
int &  bitNumber 
) const

return the trigger "category" trigCategory algorithm trigger alias or algorithm trigger name AlgorithmTrigger = 0, technical trigger TechnicalTrigger = 1 and its bit number

in case the algorithm trigger / technical trigger is not in the menu, the returned function is false, the trigger category is irrelevant (default value is AlgorithmTrigger), and the value of the bit number is -1

Definition at line 548 of file L1GtUtils.cc.

References AlgorithmTrigger, m_algorithmAliasMap, m_algorithmAliasMapLite, m_algorithmMap, m_algorithmMapLite, m_l1GtMenuLiteValid, m_retrieveL1EventSetup, m_retrieveL1GtTriggerMenuLite, m_technicalTriggerMap, m_technicalTriggerMapLite, and TechnicalTrigger.

Referenced by l1Results(), pat::PATTriggerProducer::produce(), and triggerMask().

550  {
551 
552  trigCategory = AlgorithmTrigger;
553  bitNumber = -1;
554 
556  if (m_l1GtMenuLiteValid) {
557 
558  // test if the name is an algorithm alias
559  for (L1GtTriggerMenuLite::CItL1Trig itTrig =
560  m_algorithmAliasMapLite->begin(); itTrig
561  != m_algorithmAliasMapLite->end(); itTrig++) {
562 
563  if (itTrig->second == nameAlgoTechTrig) {
564 
565  trigCategory = AlgorithmTrigger;
566  bitNumber = itTrig->first;
567 
568  return true;
569  }
570  }
571 
572  // test if the name is an algorithm name
573  for (L1GtTriggerMenuLite::CItL1Trig itTrig =
574  m_algorithmMapLite->begin(); itTrig
575  != m_algorithmMapLite->end(); itTrig++) {
576 
577  if (itTrig->second == nameAlgoTechTrig) {
578 
579  trigCategory = AlgorithmTrigger;
580  bitNumber = itTrig->first;
581 
582  return true;
583  }
584  }
585 
586  // test if the name is a technical trigger
587  for (L1GtTriggerMenuLite::CItL1Trig itTrig =
588  m_technicalTriggerMapLite->begin(); itTrig
589  != m_technicalTriggerMapLite->end(); itTrig++) {
590 
591  if (itTrig->second == nameAlgoTechTrig) {
592 
593  trigCategory = TechnicalTrigger;
594  bitNumber = itTrig->first;
595 
596  return true;
597  }
598  }
599 
600  } else if (m_retrieveL1EventSetup) {
601 
602  // test if the name is an algorithm alias
603  CItAlgo itAlgo = m_algorithmAliasMap->find(nameAlgoTechTrig);
604  if (itAlgo != m_algorithmAliasMap->end()) {
605  trigCategory = AlgorithmTrigger;
606  bitNumber = (itAlgo->second).algoBitNumber();
607 
608  return true;
609  }
610 
611  // test if the name is an algorithm name
612  itAlgo = m_algorithmMap->find(nameAlgoTechTrig);
613  if (itAlgo != m_algorithmMap->end()) {
614  trigCategory = AlgorithmTrigger;
615  bitNumber = (itAlgo->second).algoBitNumber();
616 
617  return true;
618  }
619 
620  // test if the name is a technical trigger
621  itAlgo = m_technicalTriggerMap->find(nameAlgoTechTrig);
622  if (itAlgo != m_technicalTriggerMap->end()) {
623  trigCategory = TechnicalTrigger;
624  bitNumber = (itAlgo->second).algoBitNumber();
625 
626  return true;
627  }
628 
629  } else {
630  // only L1GtTriggerMenuLite requested, but it is not valid
631  return false;
632 
633  }
634  } else if (m_retrieveL1EventSetup) {
635 
636  // test if the name is an algorithm alias
637  CItAlgo itAlgo = m_algorithmAliasMap->find(nameAlgoTechTrig);
638  if (itAlgo != m_algorithmAliasMap->end()) {
639  trigCategory = AlgorithmTrigger;
640  bitNumber = (itAlgo->second).algoBitNumber();
641 
642  return true;
643  }
644 
645  // test if the name is an algorithm name
646  itAlgo = m_algorithmMap->find(nameAlgoTechTrig);
647  if (itAlgo != m_algorithmMap->end()) {
648  trigCategory = AlgorithmTrigger;
649  bitNumber = (itAlgo->second).algoBitNumber();
650 
651  return true;
652  }
653 
654  // test if the name is a technical trigger
655  itAlgo = m_technicalTriggerMap->find(nameAlgoTechTrig);
656  if (itAlgo != m_technicalTriggerMap->end()) {
657  trigCategory = TechnicalTrigger;
658  bitNumber = (itAlgo->second).algoBitNumber();
659 
660  return true;
661  }
662 
663  } else {
664  // L1 trigger configuration not retrieved
665  return false;
666 
667  }
668 
669  // all possibilities already tested, so it should not arrive here
670  return false;
671 
672 
673 }
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:533
const AlgorithmMap * m_algorithmMap
Definition: L1GtUtils.h:485
const L1GtTriggerMenuLite::L1TriggerMap * m_algorithmAliasMapLite
Definition: L1GtUtils.h:498
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
const L1GtTriggerMenuLite::L1TriggerMap * m_algorithmMapLite
Definition: L1GtUtils.h:497
const AlgorithmMap * m_algorithmAliasMap
Definition: L1GtUtils.h:486
bool m_retrieveL1EventSetup
flags to check which method was used to retrieve L1 trigger configuration
Definition: L1GtUtils.h:532
L1TriggerMap::const_iterator CItL1Trig
iterators through map containing the physics algorithms or the technical triggers ...
const AlgorithmMap * m_technicalTriggerMap
Definition: L1GtUtils.h:487
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:507
const L1GtTriggerMenuLite::L1TriggerMap * m_technicalTriggerMapLite
Definition: L1GtUtils.h:499
const int L1GtUtils::l1Results ( const edm::Event iEvent,
const edm::InputTag l1GtRecordInputTag,
const edm::InputTag l1GtReadoutRecordInputTag,
const std::string &  nameAlgoTechTrig,
bool &  decisionBeforeMask,
bool &  decisionAfterMask,
int &  prescaleFactor,
int &  triggerMask 
) const

return results for a given algorithm or technical trigger: input: event input tag for the L1GlobalTriggerRecord product input tag for the L1GlobalTriggerReadoutRecord product algorithm trigger name or alias, or technical trigger name output (by reference): decision before mask, decision after mask, prescale factor trigger mask return: integer error code

Definition at line 885 of file L1GtUtils.cc.

References AlgorithmTrigger, availableL1Configuration(), decisionBeforeMask(), edm::Event::getByLabel(), L1GtTriggerMenuLite::gtTriggerMenuImplementation(), L1GtTriggerMenu::gtTriggerMenuImplementation(), edm::HandleBase::isValid(), l1AlgoTechTrigBitNumber(), LogDebug, m_l1GtMenu, m_l1GtMenuLite, m_l1GtMenuLiteValid, m_physicsDaqPartition, m_prescaleFactorsAlgoTrig, m_prescaleFactorsAlgoTrigLite, m_prescaleFactorsTechTrig, m_prescaleFactorsTechTrigLite, m_retrieveL1GtTriggerMenuLite, m_triggerMaskAlgoTrig, m_triggerMaskAlgoTrigLite, m_triggerMaskTechTrig, m_triggerMaskTechTrigLite, TechnicalTrigger, triggerCategory(), and trigResult().

Referenced by decision(), decisionAfterMask(), decisionBeforeMask(), L1GtUtils::LogicalExpressionL1Results::errorCodes(), l1Results(), prescaleFactor(), pat::PATTriggerProducer::produce(), and triggerMask().

889  {
890 
891  // initial values for returned results
892  decisionBeforeMask = false;
893  decisionAfterMask = false;
894  prescaleFactor = -1;
895  triggerMask = -1;
896 
897  // initialize error code and L1 configuration code
898  int iError = 0;
899  int l1ConfCode = 0;
900 
901  // check if L1 configuration is available
902 
903  if (!availableL1Configuration(iError, l1ConfCode)) {
904  return iError;
905  }
906 
907  // at this point, a valid L1 configuration is available, so the if/else if/else
908  // can be simplified
909 
910  // if the given name is not an algorithm trigger alias, an algorithm trigger name
911  // or a technical trigger in the current menu, return with error code 1
912 
913  TriggerCategory trigCategory = AlgorithmTrigger;
914  int bitNumber = -1;
915 
916 
917  if (!l1AlgoTechTrigBitNumber(nameAlgoTechTrig, trigCategory, bitNumber)) {
918 
919  iError = l1ConfCode + 1;
920 
922  if (m_l1GtMenuLiteValid) {
923 
924  LogDebug("L1GtUtils") << "\nAlgorithm/technical trigger \n "
925  << nameAlgoTechTrig
926  << "\not found in the trigger menu \n "
928  << "\nretrieved from L1GtTriggerMenuLite" << std::endl;
929 
930  } else {
931 
932  // fall through: L1 trigger configuration from event setup
933  LogDebug("L1GtUtils") << "\nAlgorithm/technical trigger \n "
934  << nameAlgoTechTrig
935  << "\not found in the trigger menu \n "
937  << "\nretrieved from Event Setup" << std::endl;
938 
939  }
940 
941  } else {
942  // L1 trigger configuration from event setup only
943  LogDebug("L1GtUtils") << "\nAlgorithm/technical trigger \n "
944  << nameAlgoTechTrig
945  << "\not found in the trigger menu \n "
947  << "\nretrieved from Event Setup" << std::endl;
948 
949  }
950 
951  return iError;
952 
953  }
954 
955  // check here if a positive bit number was retrieved
956  // exit in case of negative bit number, before retrieving L1 GT products, saving time
957 
958  if (bitNumber < 0) {
959 
960  iError = l1ConfCode + 2;
961 
963  if (m_l1GtMenuLiteValid) {
964  LogDebug("L1GtUtils") << "\nNegative bit number for "
965  << triggerCategory(trigCategory) << "\n "
966  << nameAlgoTechTrig << "\nfrom menu \n "
968  << "\nretrieved from L1GtTriggerMenuLite" << std::endl;
969 
970  } else {
971  // fall through: L1 trigger configuration from event setup
972  LogDebug("L1GtUtils") << "\nNegative bit number for "
973  << triggerCategory(trigCategory) << "\n "
974  << nameAlgoTechTrig << "\nfrom menu \n "
976  << "\nretrieved from Event Setup" << std::endl;
977 
978  }
979 
980  } else {
981  // L1 trigger configuration from event setup only
982  LogDebug("L1GtUtils") << "\nNegative bit number for "
983  << triggerCategory(trigCategory) << "\n "
984  << nameAlgoTechTrig << "\nfrom menu \n "
986  << "\nretrieved from Event Setup" << std::endl;
987 
988  }
989 
990  return iError;
991  }
992 
993 
994  // retrieve L1GlobalTriggerRecord and 1GlobalTriggerReadoutRecord product
995  // intermediate error code for the records
996  // the module returns an error code only if both the lite and the readout record are missing
997 
998  int iErrorRecord = 0;
999 
1000  bool validRecord = false;
1001  bool gtReadoutRecordValid = false;
1002 
1004  iEvent.getByLabel(l1GtRecordInputTag, gtRecord);
1005 
1006  if (gtRecord.isValid()) {
1007 
1008  validRecord = true;
1009 
1010  } else {
1011 
1012  iErrorRecord = 10;
1013  LogDebug("L1GtUtils") << "\nL1GlobalTriggerRecord with \n "
1014  << l1GtRecordInputTag << "\nnot found in the event."
1015  << std::endl;
1016  }
1017 
1019  iEvent.getByLabel(l1GtReadoutRecordInputTag, gtReadoutRecord);
1020 
1021  if (gtReadoutRecord.isValid()) {
1022 
1023  gtReadoutRecordValid = true;
1024  validRecord = true;
1025 
1026  } else {
1027 
1028  iErrorRecord = iErrorRecord + 100;
1029  LogDebug("L1GtUtils") << "\nL1GlobalTriggerReadoutRecord with \n "
1030  << l1GtReadoutRecordInputTag << "\nnot found in the event."
1031  << std::endl;
1032 
1033  }
1034 
1035  // get the prescale factor index from
1036  // L1GlobalTriggerReadoutRecord if valid
1037  // if not, from L1GlobalTriggerRecord if valid
1038  // else return an error
1039 
1040 
1041  int pfIndexTechTrig = -1;
1042  int pfIndexAlgoTrig = -1;
1043 
1044  if (validRecord) {
1045  if (gtReadoutRecordValid) {
1046 
1047  pfIndexTechTrig
1048  = (gtReadoutRecord->gtFdlWord()).gtPrescaleFactorIndexTech();
1049  pfIndexAlgoTrig
1050  = (gtReadoutRecord->gtFdlWord()).gtPrescaleFactorIndexAlgo();
1051 
1052  } else {
1053 
1054  pfIndexTechTrig
1055  = static_cast<int> (gtRecord->gtPrescaleFactorIndexTech());
1056  pfIndexAlgoTrig
1057  = static_cast<int> (gtRecord->gtPrescaleFactorIndexAlgo());
1058 
1059  }
1060 
1061  } else {
1062 
1063  LogDebug("L1GtUtils") << "\nError: "
1064  << "\nNo valid L1GlobalTriggerRecord with \n "
1065  << l1GtRecordInputTag << "\nfound in the event."
1066  << "\nNo valid L1GlobalTriggerReadoutRecord with \n "
1067  << l1GtReadoutRecordInputTag << "\nfound in the event."
1068  << std::endl;
1069 
1070  iError = l1ConfCode + iErrorRecord;
1071  return iError;
1072 
1073  }
1074 
1075  // depending on trigger category (algorithm trigger or technical trigger)
1076  // get the correct quantities
1077 
1078  // number of sets of prescale factors
1079  // index of prescale factor set retrieved from data
1080  // pointer to the actual prescale factor set
1081  // pointer to the set of trigger masks
1082 
1083  size_t pfSetsSize = 0;
1084  int pfIndex = -1;
1085  const std::vector<int>* prescaleFactorsSubset = 0;
1086  const std::vector<unsigned int>* triggerMasksSet = 0;
1087 
1088  switch (trigCategory) {
1089  case AlgorithmTrigger: {
1091  if (m_l1GtMenuLiteValid) {
1092  pfSetsSize = m_prescaleFactorsAlgoTrigLite->size();
1093  triggerMasksSet = m_triggerMaskAlgoTrigLite;
1094 
1095  } else {
1096  // fall through: L1 trigger configuration from event setup
1097  pfSetsSize = m_prescaleFactorsAlgoTrig->size();
1098  triggerMasksSet = m_triggerMaskAlgoTrig;
1099 
1100  }
1101 
1102  } else {
1103  // L1 trigger configuration from event setup only
1104  pfSetsSize = m_prescaleFactorsAlgoTrig->size();
1105  triggerMasksSet = m_triggerMaskAlgoTrig;
1106 
1107  }
1108 
1109  pfIndex = pfIndexAlgoTrig;
1110 
1111  }
1112  break;
1113  case TechnicalTrigger: {
1115  if (m_l1GtMenuLiteValid) {
1116  pfSetsSize = m_prescaleFactorsTechTrigLite->size();
1117  triggerMasksSet = m_triggerMaskTechTrigLite;
1118 
1119  } else {
1120  // fall through: L1 trigger configuration from event setup
1121  pfSetsSize = m_prescaleFactorsTechTrig->size();
1122  triggerMasksSet = m_triggerMaskTechTrig;
1123 
1124  }
1125 
1126  } else {
1127  // L1 trigger configuration from event setup only
1128  pfSetsSize = m_prescaleFactorsTechTrig->size();
1129  triggerMasksSet = m_triggerMaskTechTrig;
1130 
1131  }
1132 
1133  pfIndex = pfIndexTechTrig;
1134 
1135  }
1136  break;
1137  default: {
1138  // should not be the case
1139  iError = l1ConfCode + iErrorRecord + 3;
1140  return iError;
1141 
1142  }
1143  break;
1144  }
1145 
1146 
1147  // test prescale factor set index correctness, then retrieve the actual set of prescale factors
1148 
1149  if (pfIndex < 0) {
1150 
1151  iError = l1ConfCode + iErrorRecord + 1000;
1152  LogDebug("L1GtUtils")
1153  << "\nError: index of prescale factor set retrieved from the data \n"
1154  << "less than zero."
1155  << "\n Value of index retrieved from data = " << pfIndex
1156  << std::endl;
1157 
1158  return iError;
1159 
1160  } else if (pfIndex >= (static_cast<int>(pfSetsSize))) {
1161  iError = l1ConfCode + iErrorRecord + 2000;
1162  LogDebug("L1GtUtils")
1163  << "\nError: index of prescale factor set retrieved from the data \n"
1164  << "greater than the size of the vector of prescale factor sets."
1165  << "\n Value of index retrieved from data = " << pfIndex
1166  << "\n Vector size = " << pfSetsSize << std::endl;
1167 
1168  return iError;
1169 
1170  } else {
1171  switch (trigCategory) {
1172  case AlgorithmTrigger: {
1174  if (m_l1GtMenuLiteValid) {
1175  prescaleFactorsSubset
1176  = &((*m_prescaleFactorsAlgoTrigLite).at(pfIndex));
1177 
1178  } else {
1179  // fall through: L1 trigger configuration from event setup
1180  prescaleFactorsSubset
1181  = &((*m_prescaleFactorsAlgoTrig).at(pfIndex));
1182 
1183  }
1184 
1185  } else {
1186  // L1 trigger configuration from event setup only
1187  prescaleFactorsSubset
1188  = &((*m_prescaleFactorsAlgoTrig).at(pfIndex));
1189 
1190  }
1191 
1192  }
1193  break;
1194  case TechnicalTrigger: {
1196  if (m_l1GtMenuLiteValid) {
1197  prescaleFactorsSubset
1198  = &((*m_prescaleFactorsTechTrigLite).at(pfIndex));
1199 
1200  } else {
1201  // fall through: L1 trigger configuration from event setup
1202  prescaleFactorsSubset
1203  = &((*m_prescaleFactorsTechTrig).at(pfIndex));
1204 
1205  }
1206 
1207  } else {
1208  // L1 trigger configuration from event setup only
1209  prescaleFactorsSubset
1210  = &((*m_prescaleFactorsTechTrig).at(pfIndex));
1211 
1212  }
1213 
1214  }
1215  break;
1216  default: {
1217  // do nothing - it was tested before, with return
1218 
1219  }
1220  break;
1221  }
1222 
1223  }
1224 
1225 
1226  // algorithm result before applying the trigger masks
1227  // the bit number is positive (tested previously)
1228 
1229  switch (trigCategory) {
1230  case AlgorithmTrigger: {
1231  if (gtReadoutRecordValid) {
1232  const DecisionWord& decWord = gtReadoutRecord->decisionWord();
1233  decisionBeforeMask = trigResult(decWord, bitNumber,
1234  nameAlgoTechTrig, trigCategory, iError);
1235  if (iError) {
1236  return (iError + l1ConfCode + iErrorRecord);
1237  }
1238 
1239  } else {
1240 
1241  const DecisionWord& decWord =
1242  gtRecord->decisionWordBeforeMask();
1243  decisionBeforeMask = trigResult(decWord, bitNumber,
1244  nameAlgoTechTrig, trigCategory, iError);
1245  if (iError) {
1246  return (iError + l1ConfCode + iErrorRecord);
1247  }
1248 
1249  }
1250 
1251  }
1252  break;
1253  case TechnicalTrigger: {
1254  if (gtReadoutRecordValid) {
1255  const DecisionWord& decWord =
1256  gtReadoutRecord->technicalTriggerWord();
1257  decisionBeforeMask = trigResult(decWord, bitNumber,
1258  nameAlgoTechTrig, trigCategory, iError);
1259  if (iError) {
1260  return (iError + l1ConfCode + iErrorRecord);
1261  }
1262 
1263  } else {
1264 
1265  const DecisionWord& decWord =
1266  gtRecord->technicalTriggerWordBeforeMask();
1267  decisionBeforeMask = trigResult(decWord, bitNumber,
1268  nameAlgoTechTrig, trigCategory, iError);
1269  if (iError) {
1270  return (iError + l1ConfCode + iErrorRecord);
1271  }
1272 
1273  }
1274 
1275  }
1276  break;
1277  default: {
1278  // do nothing - it was tested before, with return
1279 
1280  }
1281  break;
1282  }
1283 
1284  // prescale factor
1285  // the bit number is positive (tested previously)
1286 
1287  if (bitNumber < (static_cast<int> (prescaleFactorsSubset->size()))) {
1288  prescaleFactor = (*prescaleFactorsSubset)[bitNumber];
1289  } else {
1290  iError = l1ConfCode + iErrorRecord + 4000;
1291  LogDebug("L1GtUtils") << "\nError: bit number " << bitNumber
1292  << " retrieved for " << triggerCategory(trigCategory) << "\n "
1293  << nameAlgoTechTrig
1294  << "\ngreater than size of actual L1 GT prescale factor set: "
1295  << prescaleFactorsSubset->size()
1296  << "\nError: Inconsistent L1 trigger configuration!"
1297  << std::endl;
1298 
1299  return iError;
1300  }
1301 
1302  // trigger mask and trigger result after applying the trigger masks
1303 
1304  if (bitNumber < (static_cast<int> ((*triggerMasksSet).size()))) {
1305 
1307  if (m_l1GtMenuLiteValid) {
1308  triggerMask = (*triggerMasksSet)[bitNumber];
1309 
1310  } else {
1311  // fall through: L1 trigger configuration from event setup
1312  // masks in event setup are for all partitions
1313  triggerMask = ((*triggerMasksSet)[bitNumber]) & (1
1315 
1316  }
1317 
1318  } else {
1319  // L1 trigger configuration from event setup only
1320  // masks in event setup are for all partitions
1321  triggerMask = ((*triggerMasksSet)[bitNumber]) & (1
1323 
1324  }
1325 
1326 
1327  } else {
1328  iError = l1ConfCode + iErrorRecord + 5000;
1329  LogDebug("L1GtUtils") << "\nError: bit number " << bitNumber
1330  << " retrieved for " << triggerCategory(trigCategory) << "\n "
1331  << nameAlgoTechTrig
1332  << "\ngreater than size of L1 GT trigger mask set: "
1333  << (*triggerMasksSet).size()
1334  << "\nError: Inconsistent L1 trigger configuration!"
1335  << std::endl;
1336 
1337  return iError;
1338 
1339  }
1340 
1342 
1343  if (triggerMask) {
1344  decisionAfterMask = false;
1345  }
1346 
1347  return iError;
1348 
1349 }
#define LogDebug(id)
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:533
const bool decisionAfterMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1411
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
Definition: L1GtUtils.h:475
const std::vector< unsigned int > * m_triggerMaskTechTrig
Definition: L1GtUtils.h:476
const bool l1AlgoTechTrigBitNumber(const std::string &nameAlgoTechTrig, TriggerCategory &trigCategory, int &bitNumber) const
Definition: L1GtUtils.cc:548
TriggerCategory
Definition: L1GtUtils.h:58
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:2293
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrigLite
Definition: L1GtUtils.h:504
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrig
Definition: L1GtUtils.h:460
const std::string & gtTriggerMenuImplementation() const
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
Definition: L1GtUtils.h:459
const bool decisionBeforeMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1374
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrigLite
Definition: L1GtUtils.h:505
std::vector< bool > DecisionWord
typedefs
const std::string triggerCategory(const TriggerCategory &) const
public methods
Definition: L1GtUtils.cc:90
bool isValid() const
Definition: HandleBase.h:76
unsigned int m_physicsDaqPartition
index of physics DAQ partition
Definition: L1GtUtils.h:526
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
const L1GtTriggerMenuLite * m_l1GtMenuLite
L1GtTriggerMenuLite cached stuff.
Definition: L1GtUtils.h:495
const std::vector< unsigned int > * m_triggerMaskTechTrigLite
Definition: L1GtUtils.h:502
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:507
const std::vector< unsigned int > * m_triggerMaskAlgoTrigLite
Definition: L1GtUtils.h:501
const int triggerMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1520
const bool trigResult(const DecisionWord &decWord, const int bitNumber, const std::string &nameAlgoTechTrig, const TriggerCategory &trigCategory, int &errorCode) const
Definition: L1GtUtils.cc:2397
const L1GtTriggerMenu * m_l1GtMenu
Definition: L1GtUtils.h:482
const int prescaleFactor(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1485
const std::string & gtTriggerMenuImplementation() const
const int L1GtUtils::l1Results ( const edm::Event iEvent,
const std::string &  nameAlgoTechTrig,
bool &  decisionBeforeMask,
bool &  decisionAfterMask,
int &  prescaleFactor,
int &  triggerMask 
) const

return results for a given algorithm or technical trigger, input tag for the an appropriate EDM product will be found from provenance input: event algorithm trigger name or alias, or technical trigger name output (by reference): decision before mask, decision after mask, prescale factor trigger mask return: integer error code

Definition at line 1352 of file L1GtUtils.cc.

References l1Results(), m_provL1GtReadoutRecordInputTag, and m_provL1GtRecordInputTag.

1354  {
1355 
1356  // initial values for returned results
1357  decisionBeforeMask = false;
1358  decisionAfterMask = false;
1359  prescaleFactor = -1;
1360  triggerMask = -1;
1361 
1362  int l1ErrorCode = 0;
1363 
1364  l1ErrorCode = l1Results(iEvent, m_provL1GtRecordInputTag,
1367 
1368  return l1ErrorCode;
1369 
1370 }
const bool decisionAfterMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1411
const int l1Results(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
Definition: L1GtUtils.cc:885
edm::InputTag m_provL1GtReadoutRecordInputTag
Definition: L1GtUtils.h:515
const bool decisionBeforeMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1374
edm::InputTag m_provL1GtRecordInputTag
cached input tags from provenance - they are updated once per run only
Definition: L1GtUtils.h:514
const int triggerMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1520
const int prescaleFactor(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1485
const std::string & L1GtUtils::l1TriggerMenu ( ) const

return the L1 trigger menu name

Definition at line 2178 of file L1GtUtils.cc.

References EmptyString, L1GtTriggerMenuLite::gtTriggerMenuName(), L1GtTriggerMenu::gtTriggerMenuName(), m_l1GtMenu, m_l1GtMenuLite, m_l1GtMenuLiteValid, m_retrieveL1EventSetup, and m_retrieveL1GtTriggerMenuLite.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore(), and L1GtAnalyzer::analyzeTrigger().

2178  {
2179 
2181  if (m_l1GtMenuLiteValid) {
2183 
2184  } else if (m_retrieveL1EventSetup) {
2185  return m_l1GtMenu->gtTriggerMenuName();
2186 
2187  } else {
2188  // only L1GtTriggerMenuLite requested, but it is not valid
2189  return EmptyString;
2190 
2191  }
2192  } else if (m_retrieveL1EventSetup) {
2193  return m_l1GtMenu->gtTriggerMenuName();
2194 
2195  } else {
2196  // L1 trigger configuration not retrieved
2197  return EmptyString;
2198 
2199  }
2200 
2201 }
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:533
const std::string & gtTriggerMenuName() const
const std::string & gtTriggerMenuName() const
static const std::string EmptyString
Definition: L1GtUtils.h:428
bool m_retrieveL1EventSetup
flags to check which method was used to retrieve L1 trigger configuration
Definition: L1GtUtils.h:532
const L1GtTriggerMenuLite * m_l1GtMenuLite
L1GtTriggerMenuLite cached stuff.
Definition: L1GtUtils.h:495
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:507
const L1GtTriggerMenu * m_l1GtMenu
Definition: L1GtUtils.h:482
const std::string & L1GtUtils::l1TriggerMenuImplementation ( ) const

return the L1 trigger menu implementation

Definition at line 2203 of file L1GtUtils.cc.

References EmptyString, L1GtTriggerMenuLite::gtTriggerMenuImplementation(), L1GtTriggerMenu::gtTriggerMenuImplementation(), m_l1GtMenu, m_l1GtMenuLite, m_l1GtMenuLiteValid, m_retrieveL1EventSetup, and m_retrieveL1GtTriggerMenuLite.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore(), and L1GtAnalyzer::analyzeTrigger().

2203  {
2204 
2206  if (m_l1GtMenuLiteValid) {
2208 
2209  } else if (m_retrieveL1EventSetup) {
2211 
2212  } else {
2213  // only L1GtTriggerMenuLite requested, but it is not valid
2214  return EmptyString;
2215 
2216  }
2217  } else if (m_retrieveL1EventSetup) {
2219 
2220  } else {
2221  // L1 trigger configuration not retrieved
2222  return EmptyString;
2223 
2224  }
2225 
2226 }
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:533
const std::string & gtTriggerMenuImplementation() const
static const std::string EmptyString
Definition: L1GtUtils.h:428
bool m_retrieveL1EventSetup
flags to check which method was used to retrieve L1 trigger configuration
Definition: L1GtUtils.h:532
const L1GtTriggerMenuLite * m_l1GtMenuLite
L1GtTriggerMenuLite cached stuff.
Definition: L1GtUtils.h:495
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:507
const L1GtTriggerMenu * m_l1GtMenu
Definition: L1GtUtils.h:482
const std::string & gtTriggerMenuImplementation() const
const bool L1GtUtils::l1TriggerNameFromBit ( const int &  bitNumber,
const TriggerCategory trigCategory,
std::string &  aliasL1Trigger,
std::string &  nameL1Trigger 
) const

return the trigger name and alias for a given trigger category and a given bit number

in case no algorithm trigger / technical trigger is defined for that bit in the menu, the returned function is false, and the name and the alias is empty

Definition at line 675 of file L1GtUtils.cc.

References AlgorithmTrigger, m_algorithmAliasMap, m_algorithmAliasMapLite, m_algorithmMapLite, m_l1GtMenuLiteValid, m_retrieveL1EventSetup, m_retrieveL1GtTriggerMenuLite, m_technicalTriggerMap, m_technicalTriggerMapLite, and TechnicalTrigger.

677  {
678 
679  aliasL1Trigger.clear();
680  nameL1Trigger.clear();
681 
683  if (m_l1GtMenuLiteValid) {
684 
685  // for an algorithm trigger
686  if (trigCategory == AlgorithmTrigger) {
687 
688  bool trigAliasFound = false;
689  bool trigNameFound = false;
690 
691  for (L1GtTriggerMenuLite::CItL1Trig itTrig =
692  m_algorithmAliasMapLite->begin();
693  itTrig != m_algorithmAliasMapLite->end(); itTrig++) {
694 
695  if (static_cast<int>(itTrig->first) == bitNumber) {
696  aliasL1Trigger = itTrig->second;
697  trigAliasFound = true;
698  break;
699  }
700  }
701 
702  for (L1GtTriggerMenuLite::CItL1Trig itTrig =
703  m_algorithmMapLite->begin();
704  itTrig != m_algorithmMapLite->end(); itTrig++) {
705 
706  if (static_cast<int>(itTrig->first) == bitNumber) {
707  nameL1Trigger = itTrig->second;
708  trigNameFound = true;
709  break;
710  }
711  }
712 
713  if (!(trigAliasFound && trigNameFound)) {
714  return false;
715  }
716 
717  return true;
718 
719  } else if (trigCategory == TechnicalTrigger) {
720 
721  // for a technical trigger
722 
723  bool trigNameFound = false;
724 
725  for (L1GtTriggerMenuLite::CItL1Trig itTrig =
726  m_technicalTriggerMapLite->begin();
727  itTrig != m_technicalTriggerMapLite->end(); itTrig++) {
728 
729  if (static_cast<int>(itTrig->first) == bitNumber) {
730  nameL1Trigger = itTrig->second;
731 
732  // technically, no alias is defined for technical triggers
733  // users use mainly aliases, so just return the name here
734  aliasL1Trigger = itTrig->second;
735 
736  trigNameFound = true;
737  break;
738  }
739  }
740 
741  if (!(trigNameFound)) {
742  return false;
743  }
744 
745  return true;
746 
747  } else {
748 
749  // non-existing trigger category...
750  return false;
751  }
752 
753  } else if (m_retrieveL1EventSetup) {
754 
755  // for an algorithm trigger
756  if (trigCategory == AlgorithmTrigger) {
757 
758  bool trigAliasFound = false;
759 
760  for (CItAlgo itTrig = m_algorithmAliasMap->begin();
761  itTrig != m_algorithmAliasMap->end(); itTrig++) {
762 
763  if ((itTrig->second).algoBitNumber() == bitNumber) {
764  aliasL1Trigger = itTrig->first;
765  // get the name here, avoiding a loop on m_algorithmMap
766  nameL1Trigger = (itTrig->second).algoName();
767 
768  trigAliasFound = true;
769  break;
770  }
771  }
772 
773  if (!(trigAliasFound)) {
774  return false;
775  }
776 
777  return true;
778 
779  } else if (trigCategory == TechnicalTrigger) {
780 
781  // for a technical trigger
782 
783  bool trigNameFound = false;
784 
785  for (CItAlgo itTrig = m_technicalTriggerMap->begin();
786  itTrig != m_technicalTriggerMap->end(); itTrig++) {
787 
788  if ((itTrig->second).algoBitNumber() == bitNumber) {
789  nameL1Trigger = (itTrig->second).algoName();
790  // technically, no alias is defined for technical triggers
791  // users use mainly aliases, so just return the name here
792  aliasL1Trigger = nameL1Trigger;
793 
794  trigNameFound = true;
795  break;
796  }
797  }
798 
799  if (!(trigNameFound)) {
800  return false;
801  }
802 
803  return true;
804 
805  } else {
806 
807  // non-existing trigger category...
808  return false;
809  }
810 
811  } else {
812  // only L1GtTriggerMenuLite requested, but it is not valid
813  return false;
814 
815  }
816  } else if (m_retrieveL1EventSetup) {
817 
818  // for an algorithm trigger
819  if (trigCategory == AlgorithmTrigger) {
820 
821  bool trigAliasFound = false;
822 
823  for (CItAlgo itTrig = m_algorithmAliasMap->begin();
824  itTrig != m_algorithmAliasMap->end(); itTrig++) {
825 
826  if ((itTrig->second).algoBitNumber() == bitNumber) {
827  aliasL1Trigger = itTrig->first;
828  // get the name here, avoiding a loop on m_algorithmMap
829  nameL1Trigger = (itTrig->second).algoName();
830 
831  trigAliasFound = true;
832  break;
833  }
834  }
835 
836  if (!(trigAliasFound)) {
837  return false;
838  }
839 
840  return true;
841 
842  } else if (trigCategory == TechnicalTrigger) {
843 
844  // for a technical trigger
845 
846  bool trigNameFound = false;
847 
848  for (CItAlgo itTrig = m_technicalTriggerMap->begin();
849  itTrig != m_technicalTriggerMap->end(); itTrig++) {
850 
851  if ((itTrig->second).algoBitNumber() == bitNumber) {
852  nameL1Trigger = (itTrig->second).algoName();
853  // technically, no alias is defined for technical triggers
854  // users use mainly aliases, so just return the name here
855  aliasL1Trigger = itTrig->first;
856 
857  trigNameFound = true;
858  break;
859  }
860  }
861 
862  if (!(trigNameFound)) {
863  return false;
864  }
865 
866  return true;
867 
868  } else {
869 
870  // non-existing trigger category...
871  return false;
872  }
873 
874  } else {
875  // L1 trigger configuration not retrieved
876  return false;
877 
878  }
879 
880  // all possibilities already tested, so it should not arrive here
881  return false;
882 
883 }
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:533
const L1GtTriggerMenuLite::L1TriggerMap * m_algorithmAliasMapLite
Definition: L1GtUtils.h:498
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
const L1GtTriggerMenuLite::L1TriggerMap * m_algorithmMapLite
Definition: L1GtUtils.h:497
const AlgorithmMap * m_algorithmAliasMap
Definition: L1GtUtils.h:486
bool m_retrieveL1EventSetup
flags to check which method was used to retrieve L1 trigger configuration
Definition: L1GtUtils.h:532
L1TriggerMap::const_iterator CItL1Trig
iterators through map containing the physics algorithms or the technical triggers ...
const AlgorithmMap * m_technicalTriggerMap
Definition: L1GtUtils.h:487
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:507
const L1GtTriggerMenuLite::L1TriggerMap * m_technicalTriggerMapLite
Definition: L1GtUtils.h:499
const int L1GtUtils::prescaleFactor ( const edm::Event iEvent,
const edm::InputTag l1GtRecordInputTag,
const edm::InputTag l1GtReadoutRecordInputTag,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

return prescale factor for a given algorithm or technical trigger

Definition at line 1485 of file L1GtUtils.cc.

References decisionAfterMask(), decisionBeforeMask(), l1Results(), and triggerMask().

Referenced by HLTInfo::analyze(), IsolatedTracksNxN::analyze(), L1GtAnalyzer::analyzeL1GtUtilsCore(), L1GtAnalyzer::analyzeTrigger(), decision(), decisionAfterMask(), decisionBeforeMask(), prescaleFactor(), PrescaleWeightProvider::prescaleWeight(), and triggerMask().

1488  {
1489 
1490  // initial values
1491  bool decisionBeforeMask = false;
1492  bool decisionAfterMask = false;
1493  int prescaleFactor = -1;
1494  int triggerMask = -1;
1495 
1496  errorCode = l1Results(iEvent, l1GtRecordInputTag,
1497  l1GtReadoutRecordInputTag, nameAlgoTechTrig, decisionBeforeMask,
1498  decisionAfterMask, prescaleFactor, triggerMask);
1499 
1500  return prescaleFactor;
1501 
1502 }
const bool decisionAfterMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1411
const int l1Results(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
Definition: L1GtUtils.cc:885
const bool decisionBeforeMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1374
const int triggerMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1520
const int prescaleFactor(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1485
const int L1GtUtils::prescaleFactor ( const edm::Event iEvent,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

Definition at line 1504 of file L1GtUtils.cc.

References decisionAfterMask(), decisionBeforeMask(), l1Results(), prescaleFactor(), and triggerMask().

1505  {
1506 
1507  // initial values
1508  bool decisionBeforeMask = false;
1509  bool decisionAfterMask = false;
1510  int prescaleFactor = -1;
1511  int triggerMask = -1;
1512 
1513  errorCode = l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1514  decisionAfterMask, prescaleFactor, triggerMask);
1515 
1516  return prescaleFactor;
1517 
1518 }
const bool decisionAfterMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1411
const int l1Results(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
Definition: L1GtUtils.cc:885
const bool decisionBeforeMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1374
const int triggerMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1520
const int prescaleFactor(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1485
const std::vector< int > & L1GtUtils::prescaleFactorSet ( const edm::Event iEvent,
const edm::InputTag l1GtRecordInputTag,
const edm::InputTag l1GtReadoutRecordInputTag,
const TriggerCategory trigCategory,
int &  errorCode 
)

return the actual set of prescale factors used for the event (must be the same for all events in the luminosity block, if no errors)

Definition at line 1984 of file L1GtUtils.cc.

References AlgorithmTrigger, m_l1GtMenuLiteValid, m_prescaleFactorSet, m_retrieveL1GtTriggerMenuLite, prescaleFactorSetIndex(), and TechnicalTrigger.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore(), and prescaleFactorSet().

1987  {
1988 
1989  // clear the vector before filling it
1990  m_prescaleFactorSet.clear();
1991 
1992  // initialize error code
1993  int iError = 0;
1994 
1995  const int pfIndex = prescaleFactorSetIndex(iEvent, l1GtRecordInputTag,
1996  l1GtReadoutRecordInputTag, trigCategory, iError);
1997 
1998  if (iError == 0) {
1999 
2000  switch (trigCategory) {
2001  case AlgorithmTrigger: {
2003  if (m_l1GtMenuLiteValid) {
2005  = (*m_prescaleFactorsAlgoTrigLite).at(pfIndex);
2006 
2007  } else {
2008  // fall through: L1 trigger configuration from event setup
2009  m_prescaleFactorSet = (*m_prescaleFactorsAlgoTrig).at(
2010  pfIndex);
2011 
2012  }
2013 
2014  } else {
2015  // L1 trigger configuration from event setup only
2016  m_prescaleFactorSet = (*m_prescaleFactorsAlgoTrig).at(
2017  pfIndex);
2018 
2019  }
2020 
2021  }
2022  break;
2023  case TechnicalTrigger: {
2025  if (m_l1GtMenuLiteValid) {
2027  = (*m_prescaleFactorsTechTrigLite).at(pfIndex);
2028 
2029  } else {
2030  // fall through: L1 trigger configuration from event setup
2031  m_prescaleFactorSet = (*m_prescaleFactorsTechTrig).at(
2032  pfIndex);
2033 
2034  }
2035 
2036  } else {
2037  // L1 trigger configuration from event setup only
2038  m_prescaleFactorSet = (*m_prescaleFactorsTechTrig).at(
2039  pfIndex);
2040 
2041  }
2042 
2043  }
2044  break;
2045  default: {
2046  // do nothing - it was tested before, with return
2047 
2048  }
2049  break;
2050  }
2051 
2052  }
2053 
2054  errorCode = iError;
2055  return m_prescaleFactorSet;
2056 
2057 }
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:533
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:507
const int prescaleFactorSetIndex(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const TriggerCategory &trigCategory, int &errorCode) const
Definition: L1GtUtils.cc:1760
std::vector< int > m_prescaleFactorSet
Definition: L1GtUtils.h:529
const std::vector< int > & L1GtUtils::prescaleFactorSet ( const edm::Event iEvent,
const TriggerCategory trigCategory,
int &  errorCode 
)

Definition at line 2059 of file L1GtUtils.cc.

References m_prescaleFactorSet, m_provL1GtReadoutRecordInputTag, m_provL1GtRecordInputTag, and prescaleFactorSet().

2060  {
2061 
2062  // clear the vector before filling it
2063  m_prescaleFactorSet.clear();
2064 
2065  // initialize error code
2066  int iError = 0;
2067 
2069  m_provL1GtReadoutRecordInputTag, trigCategory, iError);
2070 
2071  errorCode = iError;
2072  return m_prescaleFactorSet;
2073 
2074 }
edm::InputTag m_provL1GtReadoutRecordInputTag
Definition: L1GtUtils.h:515
edm::InputTag m_provL1GtRecordInputTag
cached input tags from provenance - they are updated once per run only
Definition: L1GtUtils.h:514
const std::vector< int > & prescaleFactorSet(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const TriggerCategory &trigCategory, int &errorCode)
Definition: L1GtUtils.cc:1984
std::vector< int > m_prescaleFactorSet
Definition: L1GtUtils.h:529
const int L1GtUtils::prescaleFactorSetIndex ( const edm::Event iEvent,
const edm::InputTag l1GtRecordInputTag,
const edm::InputTag l1GtReadoutRecordInputTag,
const TriggerCategory trigCategory,
int &  errorCode 
) const

return the index of the actual set of prescale factors used for the event (must be the same for all events in the luminosity block, if no errors)

Definition at line 1760 of file L1GtUtils.cc.

References AlgorithmTrigger, availableL1Configuration(), edm::Event::getByLabel(), edm::HandleBase::isValid(), LogDebug, m_l1GtMenuLiteValid, m_prescaleFactorsAlgoTrig, m_prescaleFactorsAlgoTrigLite, m_prescaleFactorsTechTrig, m_prescaleFactorsTechTrigLite, m_retrieveL1GtTriggerMenuLite, and TechnicalTrigger.

Referenced by HLTInfo::analyze(), L1GtAnalyzer::analyzeL1GtUtilsCore(), prescaleFactorSet(), and prescaleFactorSetIndex().

1763  {
1764 
1765  // initialize the index to a negative value
1766  int pfIndex = -1;
1767 
1768  // initialize error code and L1 configuration code
1769  int iError = 0;
1770  int l1ConfCode = 0;
1771 
1772  // check if L1 configuration is available
1773 
1774  if (!availableL1Configuration(iError, l1ConfCode)) {
1775  errorCode = iError;
1776  return pfIndex;
1777  }
1778 
1779  // at this point, a valid L1 configuration is available, so the if/else if/else
1780  // can be simplified
1781 
1782  // retrieve L1GlobalTriggerRecord and 1GlobalTriggerReadoutRecord product
1783  // intermediate error code for the records
1784  // the module returns an error code only if both the lite and the readout record are missing
1785 
1786  int iErrorRecord = 0;
1787 
1788  bool validRecord = false;
1789  bool gtReadoutRecordValid = false;
1790 
1792  iEvent.getByLabel(l1GtRecordInputTag, gtRecord);
1793 
1794  if (gtRecord.isValid()) {
1795 
1796  validRecord = true;
1797 
1798  } else {
1799 
1800  iErrorRecord = 10;
1801  LogDebug("L1GtUtils") << "\nL1GlobalTriggerRecord with \n "
1802  << l1GtRecordInputTag << "\nnot found in the event."
1803  << std::endl;
1804  }
1805 
1807  iEvent.getByLabel(l1GtReadoutRecordInputTag, gtReadoutRecord);
1808 
1809  if (gtReadoutRecord.isValid()) {
1810 
1811  gtReadoutRecordValid = true;
1812  validRecord = true;
1813 
1814  } else {
1815 
1816  iErrorRecord = iErrorRecord + 100;
1817  LogDebug("L1GtUtils") << "\nL1GlobalTriggerReadoutRecord with \n "
1818  << l1GtReadoutRecordInputTag << "\nnot found in the event."
1819  << std::endl;
1820 
1821  }
1822 
1823  // get the prescale factor index from
1824  // L1GlobalTriggerReadoutRecord if valid
1825  // if not, from L1GlobalTriggerRecord if valid
1826  // else return an error
1827 
1828 
1829  int pfIndexTechTrig = -1;
1830  int pfIndexAlgoTrig = -1;
1831 
1832  if (validRecord) {
1833  if (gtReadoutRecordValid) {
1834 
1835  pfIndexTechTrig
1836  = (gtReadoutRecord->gtFdlWord()).gtPrescaleFactorIndexTech();
1837  pfIndexAlgoTrig
1838  = (gtReadoutRecord->gtFdlWord()).gtPrescaleFactorIndexAlgo();
1839 
1840  } else {
1841 
1842  pfIndexTechTrig
1843  = static_cast<int> (gtRecord->gtPrescaleFactorIndexTech());
1844  pfIndexAlgoTrig
1845  = static_cast<int> (gtRecord->gtPrescaleFactorIndexAlgo());
1846 
1847  }
1848 
1849  } else {
1850 
1851  LogDebug("L1GtUtils") << "\nError: "
1852  << "\nNo valid L1GlobalTriggerRecord with \n "
1853  << l1GtRecordInputTag << "\nfound in the event."
1854  << "\nNo valid L1GlobalTriggerReadoutRecord with \n "
1855  << l1GtReadoutRecordInputTag << "\nfound in the event."
1856  << std::endl;
1857 
1858  iError = l1ConfCode + iErrorRecord;
1859 
1860  errorCode = iError;
1861  return pfIndex;
1862 
1863  }
1864 
1865  // depending on trigger category (algorithm trigger or technical trigger)
1866  // get the correct quantities
1867 
1868  // number of sets of prescale factors
1869  // index of prescale factor set retrieved from data
1870  // pointer to the actual prescale factor set
1871  // pointer to the set of trigger masks
1872 
1873  size_t pfSetsSize = 0;
1874 
1875  switch (trigCategory) {
1876  case AlgorithmTrigger: {
1878  if (m_l1GtMenuLiteValid) {
1879  pfSetsSize = m_prescaleFactorsAlgoTrigLite->size();
1880 
1881  } else {
1882  // fall through: L1 trigger configuration from event setup
1883  pfSetsSize = m_prescaleFactorsAlgoTrig->size();
1884 
1885  }
1886 
1887  } else {
1888  // L1 trigger configuration from event setup only
1889  pfSetsSize = m_prescaleFactorsAlgoTrig->size();
1890 
1891  }
1892 
1893  pfIndex = pfIndexAlgoTrig;
1894 
1895  }
1896  break;
1897  case TechnicalTrigger: {
1899  if (m_l1GtMenuLiteValid) {
1900  pfSetsSize = m_prescaleFactorsTechTrigLite->size();
1901 
1902  } else {
1903  // fall through: L1 trigger configuration from event setup
1904  pfSetsSize = m_prescaleFactorsTechTrig->size();
1905 
1906  }
1907 
1908  } else {
1909  // L1 trigger configuration from event setup only
1910  pfSetsSize = m_prescaleFactorsTechTrig->size();
1911 
1912  }
1913 
1914  pfIndex = pfIndexTechTrig;
1915 
1916  }
1917  break;
1918  default: {
1919  // should not be the case
1920  iError = l1ConfCode + iErrorRecord + 3;
1921  return iError;
1922 
1923  }
1924  break;
1925  }
1926 
1927 
1928  // test prescale factor set index correctness, then retrieve the actual set of prescale factors
1929 
1930  if (pfIndex < 0) {
1931 
1932  iError = l1ConfCode + iErrorRecord + 1000;
1933  LogDebug("L1GtUtils")
1934  << "\nError: index of prescale factor set retrieved from the data \n"
1935  << "less than zero."
1936  << "\n Value of index retrieved from data = " << pfIndex
1937  << std::endl;
1938 
1939  errorCode = iError;
1940  return pfIndex;
1941 
1942  } else if (pfIndex >= (static_cast<int>(pfSetsSize))) {
1943  iError = l1ConfCode + iErrorRecord + 2000;
1944  LogDebug("L1GtUtils")
1945  << "\nError: index of prescale factor set retrieved from the data \n"
1946  << "greater than the size of the vector of prescale factor sets."
1947  << "\n Value of index retrieved from data = " << pfIndex
1948  << "\n Vector size = " << pfSetsSize << std::endl;
1949 
1950  errorCode = iError;
1951  return pfIndex;
1952 
1953  } else {
1954 
1955  errorCode = iError;
1956  return pfIndex;
1957  }
1958 
1959  errorCode = iError;
1960  return pfIndex;
1961 
1962 }
#define LogDebug(id)
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:533
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:2293
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrigLite
Definition: L1GtUtils.h:504
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrig
Definition: L1GtUtils.h:460
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
Definition: L1GtUtils.h:459
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrigLite
Definition: L1GtUtils.h:505
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:507
const int L1GtUtils::prescaleFactorSetIndex ( const edm::Event iEvent,
const TriggerCategory trigCategory,
int &  errorCode 
) const

Definition at line 1965 of file L1GtUtils.cc.

References m_provL1GtReadoutRecordInputTag, m_provL1GtRecordInputTag, and prescaleFactorSetIndex().

1966  {
1967 
1968  // initialize error code and return value
1969  int iError = 0;
1970  int pfIndex = -1;
1971 
1973  m_provL1GtReadoutRecordInputTag, trigCategory, iError);
1974 
1975  // return the error code and the index value
1976  // if the error code is 0, the index returned is -1
1977  errorCode = iError;
1978  return pfIndex;
1979 
1980 }
edm::InputTag m_provL1GtReadoutRecordInputTag
Definition: L1GtUtils.h:515
edm::InputTag m_provL1GtRecordInputTag
cached input tags from provenance - they are updated once per run only
Definition: L1GtUtils.h:514
const int prescaleFactorSetIndex(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const TriggerCategory &trigCategory, int &errorCode) const
Definition: L1GtUtils.cc:1760
const edm::InputTag& L1GtUtils::provL1GtReadoutRecordInputTag ( )
inline

Definition at line 242 of file L1GtUtils.h.

References m_provL1GtReadoutRecordInputTag.

242  {
244  }
edm::InputTag m_provL1GtReadoutRecordInputTag
Definition: L1GtUtils.h:515
const edm::InputTag& L1GtUtils::provL1GtRecordInputTag ( )
inline

return the input tags found from provenance

Definition at line 238 of file L1GtUtils.h.

References m_provL1GtRecordInputTag.

238  {
240  }
edm::InputTag m_provL1GtRecordInputTag
cached input tags from provenance - they are updated once per run only
Definition: L1GtUtils.h:514
const edm::InputTag& L1GtUtils::provL1GtTriggerMenuLiteInputTag ( )
inline

Definition at line 246 of file L1GtUtils.h.

References m_provL1GtTriggerMenuLiteInputTag.

246  {
248  }
edm::InputTag m_provL1GtTriggerMenuLiteInputTag
Definition: L1GtUtils.h:516
const L1GtTriggerMenuLite * L1GtUtils::ptrL1GtTriggerMenuLite ( int &  errorCode)

return a pointer to the L1GtTriggerMenuLite product

Definition at line 2256 of file L1GtUtils.cc.

References availableL1Configuration(), m_l1GtMenuLite, m_l1GtMenuLiteValid, and m_retrieveL1GtTriggerMenuLite.

2256  {
2257 
2258  // initialize error code and return value
2259  int iError = 0;
2260  int l1ConfCode = 0;
2261 
2262  // check if L1 configuration is available
2263 
2264  if (!availableL1Configuration(iError, l1ConfCode)) {
2265  errorCode = iError;
2266  return 0;
2267  }
2268 
2270  if (m_l1GtMenuLiteValid) {
2271 
2272  errorCode = iError;
2273  return m_l1GtMenuLite;
2274 
2275  } else {
2276  iError = l1ConfCode;
2277 
2278  errorCode = iError;
2279  return 0;
2280  }
2281  } else {
2282  iError = l1ConfCode;
2283 
2284  errorCode = iError;
2285  return 0;
2286  }
2287 
2288  errorCode = iError;
2289  return m_l1GtMenuLite;
2290 
2291 }
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:533
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:2293
const L1GtTriggerMenuLite * m_l1GtMenuLite
L1GtTriggerMenuLite cached stuff.
Definition: L1GtUtils.h:495
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:507
const L1GtTriggerMenu * L1GtUtils::ptrL1TriggerMenuEventSetup ( int &  errorCode)

return a pointer to the L1 trigger menu from event setup

Definition at line 2228 of file L1GtUtils.cc.

References availableL1Configuration(), m_l1GtMenu, and m_retrieveL1EventSetup.

Referenced by IsolatedTracksNxN::analyze().

2228  {
2229 
2230  // initialize error code and return value
2231  int iError = 0;
2232  int l1ConfCode = 0;
2233 
2234  // check if L1 configuration is available
2235 
2236  if (!availableL1Configuration(iError, l1ConfCode)) {
2237  errorCode = iError;
2238  return 0;
2239  }
2240 
2241  if (m_retrieveL1EventSetup) {
2242  errorCode = iError;
2243  return m_l1GtMenu;
2244  } else {
2245  iError = l1ConfCode;
2246 
2247  errorCode = iError;
2248  return 0;
2249 
2250  }
2251 
2252  errorCode = iError;
2253  return m_l1GtMenu;
2254 }
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:2293
bool m_retrieveL1EventSetup
flags to check which method was used to retrieve L1 trigger configuration
Definition: L1GtUtils.h:532
const L1GtTriggerMenu * m_l1GtMenu
Definition: L1GtUtils.h:482
void L1GtUtils::retrieveL1EventSetup ( const edm::EventSetup evSetup)

retrieve all the relevant L1 trigger event setup records and cache them to improve the speed

Definition at line 111 of file L1GtUtils.cc.

References edm::EventSetup::get(), L1GtTriggerMenu::gtAlgorithmAliasMap(), L1GtTriggerMenu::gtAlgorithmMap(), L1GtStableParameters::gtNumberPhysTriggers(), L1GtStableParameters::gtNumberTechnicalTriggers(), L1GtPrescaleFactors::gtPrescaleFactors(), L1GtTriggerMenu::gtTechnicalTriggerMap(), L1GtTriggerMask::gtTriggerMask(), m_algorithmAliasMap, m_algorithmMap, m_l1EventSetupValid, m_l1GtMenu, m_l1GtMenuCacheID, m_l1GtPfAlgo, m_l1GtPfAlgoCacheID, m_l1GtPfTech, m_l1GtPfTechCacheID, m_l1GtStablePar, m_l1GtStableParCacheID, m_l1GtTmAlgo, m_l1GtTmAlgoCacheID, m_l1GtTmTech, m_l1GtTmTechCacheID, m_l1GtTmVetoAlgo, m_l1GtTmVetoAlgoCacheID, m_l1GtTmVetoTech, m_l1GtTmVetoTechCacheID, m_numberAlgorithmTriggers, m_numberTechnicalTriggers, m_prescaleFactorsAlgoTrig, m_prescaleFactorSet, m_prescaleFactorsTechTrig, m_retrieveL1EventSetup, m_technicalTriggerMap, m_triggerMaskAlgoTrig, m_triggerMaskSet, m_triggerMaskTechTrig, m_triggerMaskVetoAlgoTrig, m_triggerMaskVetoTechTrig, bookConverter::max, and edm::ESHandle< class >::product().

Referenced by TriggerHelper::acceptL1(), getL1GtRunCache(), and PrescaleWeightProvider::prescaleWeight().

111  {
112 
113  //
114  m_retrieveL1EventSetup = true;
115 
116  m_l1EventSetupValid = true;
117  // FIXME test for each record if valid; if not set m_l1EventSetupValid = false;
118 
119  // get / update the stable parameters from the EventSetup
120  // local cache & check on cacheIdentifier
121 
122  unsigned long long l1GtStableParCacheID =
123  evSetup.get<L1GtStableParametersRcd>().cacheIdentifier();
124 
125  if (m_l1GtStableParCacheID != l1GtStableParCacheID) {
126 
128  evSetup.get<L1GtStableParametersRcd>().get(l1GtStablePar);
129  m_l1GtStablePar = l1GtStablePar.product();
130 
131  // number of algorithm triggers
133 
134  // number of technical triggers
137 
138  int maxNumberTrigger = std::max(m_numberAlgorithmTriggers,
140 
141  m_triggerMaskSet.reserve(maxNumberTrigger);
142  m_prescaleFactorSet.reserve(maxNumberTrigger);
143 
144  //
145  m_l1GtStableParCacheID = l1GtStableParCacheID;
146 
147  }
148 
149  // get / update the prescale factors from the EventSetup
150  // local cache & check on cacheIdentifier
151 
152  unsigned long long l1GtPfAlgoCacheID =
153  evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().cacheIdentifier();
154 
155  if (m_l1GtPfAlgoCacheID != l1GtPfAlgoCacheID) {
156 
158  evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
159  m_l1GtPfAlgo = l1GtPfAlgo.product();
160 
162 
163  m_l1GtPfAlgoCacheID = l1GtPfAlgoCacheID;
164 
165  }
166 
167  unsigned long long l1GtPfTechCacheID = evSetup.get<
168  L1GtPrescaleFactorsTechTrigRcd>().cacheIdentifier();
169 
170  if (m_l1GtPfTechCacheID != l1GtPfTechCacheID) {
171 
173  evSetup.get<L1GtPrescaleFactorsTechTrigRcd>().get(l1GtPfTech);
174  m_l1GtPfTech = l1GtPfTech.product();
175 
177 
178  m_l1GtPfTechCacheID = l1GtPfTechCacheID;
179 
180  }
181 
182  // get / update the trigger mask from the EventSetup
183  // local cache & check on cacheIdentifier
184 
185  unsigned long long l1GtTmAlgoCacheID =
186  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().cacheIdentifier();
187 
188  if (m_l1GtTmAlgoCacheID != l1GtTmAlgoCacheID) {
189 
191  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().get(l1GtTmAlgo);
192  m_l1GtTmAlgo = l1GtTmAlgo.product();
193 
195 
196  m_l1GtTmAlgoCacheID = l1GtTmAlgoCacheID;
197 
198  }
199 
200  unsigned long long l1GtTmTechCacheID =
201  evSetup.get<L1GtTriggerMaskTechTrigRcd>().cacheIdentifier();
202 
203  if (m_l1GtTmTechCacheID != l1GtTmTechCacheID) {
204 
206  evSetup.get<L1GtTriggerMaskTechTrigRcd>().get(l1GtTmTech);
207  m_l1GtTmTech = l1GtTmTech.product();
208 
210 
211  m_l1GtTmTechCacheID = l1GtTmTechCacheID;
212 
213  }
214 
215  unsigned long long l1GtTmVetoAlgoCacheID =
216  evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().cacheIdentifier();
217 
218  if (m_l1GtTmVetoAlgoCacheID != l1GtTmVetoAlgoCacheID) {
219 
220  edm::ESHandle<L1GtTriggerMask> l1GtTmVetoAlgo;
221  evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().get(l1GtTmVetoAlgo);
222  m_l1GtTmVetoAlgo = l1GtTmVetoAlgo.product();
223 
225 
226  m_l1GtTmVetoAlgoCacheID = l1GtTmVetoAlgoCacheID;
227 
228  }
229 
230  unsigned long long l1GtTmVetoTechCacheID =
231  evSetup.get<L1GtTriggerMaskVetoTechTrigRcd>().cacheIdentifier();
232 
233  if (m_l1GtTmVetoTechCacheID != l1GtTmVetoTechCacheID) {
234 
235  edm::ESHandle<L1GtTriggerMask> l1GtTmVetoTech;
236  evSetup.get<L1GtTriggerMaskVetoTechTrigRcd>().get(l1GtTmVetoTech);
237  m_l1GtTmVetoTech = l1GtTmVetoTech.product();
238 
240 
241  m_l1GtTmVetoTechCacheID = l1GtTmVetoTechCacheID;
242 
243  }
244 
245  // get / update the trigger menu from the EventSetup
246  // local cache & check on cacheIdentifier
247 
248  unsigned long long l1GtMenuCacheID =
249  evSetup.get<L1GtTriggerMenuRcd>().cacheIdentifier();
250 
251  if (m_l1GtMenuCacheID != l1GtMenuCacheID) {
252 
254  evSetup.get<L1GtTriggerMenuRcd>().get(l1GtMenu);
255  m_l1GtMenu = l1GtMenu.product();
256 
259 
261 
262  m_l1GtMenuCacheID = l1GtMenuCacheID;
263 
264  }
265 
266 }
std::vector< unsigned int > m_triggerMaskSet
Definition: L1GtUtils.h:528
unsigned long long m_l1GtMenuCacheID
Definition: L1GtUtils.h:483
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
Definition: L1GtUtils.h:475
const std::vector< unsigned int > * m_triggerMaskTechTrig
Definition: L1GtUtils.h:476
const L1GtTriggerMask * m_l1GtTmVetoTech
Definition: L1GtUtils.h:472
const L1GtTriggerMask * m_l1GtTmAlgo
trigger masks &amp; veto masks
Definition: L1GtUtils.h:463
const AlgorithmMap * m_algorithmMap
Definition: L1GtUtils.h:485
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrig
Definition: L1GtUtils.h:460
const L1GtStableParameters * m_l1GtStablePar
event setup cached stuff
Definition: L1GtUtils.h:443
unsigned long long m_l1GtPfAlgoCacheID
Definition: L1GtUtils.h:454
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
Definition: L1GtUtils.h:459
unsigned int gtNumberTechnicalTriggers() const
get / set the number of technical triggers
unsigned long long m_l1GtTmVetoTechCacheID
Definition: L1GtUtils.h:473
unsigned int gtNumberPhysTriggers() const
get / set the number of physics trigger algorithms
const AlgorithmMap * m_algorithmAliasMap
Definition: L1GtUtils.h:486
unsigned long long m_l1GtTmTechCacheID
Definition: L1GtUtils.h:467
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
const L1GtTriggerMask * m_l1GtTmVetoAlgo
Definition: L1GtUtils.h:469
const L1GtPrescaleFactors * m_l1GtPfAlgo
prescale factors
Definition: L1GtUtils.h:453
unsigned long long m_l1GtTmAlgoCacheID
Definition: L1GtUtils.h:464
unsigned int m_numberTechnicalTriggers
number of technical triggers
Definition: L1GtUtils.h:450
bool m_retrieveL1EventSetup
flags to check which method was used to retrieve L1 trigger configuration
Definition: L1GtUtils.h:532
unsigned int m_numberAlgorithmTriggers
number of algorithm triggers
Definition: L1GtUtils.h:447
const L1GtTriggerMask * m_l1GtTmTech
Definition: L1GtUtils.h:466
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
const L1GtPrescaleFactors * m_l1GtPfTech
Definition: L1GtUtils.h:456
const AlgorithmMap * m_technicalTriggerMap
Definition: L1GtUtils.h:487
const T & get() const
Definition: EventSetup.h:55
const std::vector< unsigned int > * m_triggerMaskVetoAlgoTrig
Definition: L1GtUtils.h:478
T const * product() const
Definition: ESHandle.h:62
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
const L1GtTriggerMenu * m_l1GtMenu
Definition: L1GtUtils.h:482
unsigned long long m_l1GtPfTechCacheID
Definition: L1GtUtils.h:457
const AlgorithmMap & gtTechnicalTriggerMap() const
get / set the technical trigger map
bool m_l1EventSetupValid
Definition: L1GtUtils.h:489
unsigned long long m_l1GtTmVetoAlgoCacheID
Definition: L1GtUtils.h:470
std::vector< int > m_prescaleFactorSet
Definition: L1GtUtils.h:529
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
unsigned long long m_l1GtStableParCacheID
Definition: L1GtUtils.h:444
const std::vector< unsigned int > * m_triggerMaskVetoTechTrig
Definition: L1GtUtils.h:479
void L1GtUtils::retrieveL1GtTriggerMenuLite ( const edm::Run iRun,
const edm::InputTag l1GtMenuLiteInputTag 
)

retrieve L1GtTriggerMenuLite (per run product) and cache it to improve the speed

for use in beginRun(const edm::Run&, const edm::EventSetup&); input tag explicitly given

Definition at line 269 of file L1GtUtils.cc.

References edm::Run::getByLabel(), L1GtTriggerMenuLite::gtAlgorithmAliasMap(), L1GtTriggerMenuLite::gtAlgorithmMap(), L1GtTriggerMenuLite::gtPrescaleFactorsAlgoTrig(), L1GtTriggerMenuLite::gtPrescaleFactorsTechTrig(), L1GtTriggerMenuLite::gtTechnicalTriggerMap(), L1GtTriggerMenuLite::gtTriggerMaskAlgoTrig(), L1GtTriggerMenuLite::gtTriggerMaskTechTrig(), edm::HandleBase::isValid(), LogDebug, m_algorithmAliasMapLite, m_algorithmMapLite, m_l1GtMenuLite, m_l1GtMenuLiteValid, m_prescaleFactorsAlgoTrigLite, m_prescaleFactorsTechTrigLite, m_retrieveL1GtTriggerMenuLite, m_technicalTriggerMapLite, m_triggerMaskAlgoTrigLite, m_triggerMaskTechTrigLite, edm::Handle< T >::product(), edm::RunAuxiliary::run(), and edm::Run::runAuxiliary().

Referenced by getL1GtRunCache().

270  {
271 
272  //
274 
275  // get L1GtTriggerMenuLite
277  iRun.getByLabel(l1GtMenuLiteInputTag, l1GtMenuLite);
278 
279  if (!l1GtMenuLite.isValid()) {
280 
281  LogDebug("L1GtUtils") << "\nL1GtTriggerMenuLite with \n "
282  << l1GtMenuLiteInputTag
283  << "\nrequested in configuration, but not found in the event."
284  << std::endl;
285 
286  m_l1GtMenuLiteValid = false;
287  } else {
288  m_l1GtMenuLite = l1GtMenuLite.product();
289  m_l1GtMenuLiteValid = true;
290 
291  LogDebug("L1GtUtils") << "\nL1GtTriggerMenuLite with \n "
292  << l1GtMenuLiteInputTag << "\nretrieved for run "
293  << iRun.runAuxiliary().run() << std::endl;
294 
298 
301 
306 
307  }
308 
309 }
#define LogDebug(id)
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:533
bool getByLabel(std::string const &label, Handle< PROD > &result) const
Definition: Run.h:200
const std::vector< unsigned int > & gtTriggerMaskAlgoTrig() const
get the trigger mask for physics algorithms
const std::vector< std::vector< int > > & gtPrescaleFactorsAlgoTrig() const
get the prescale factors by reference / set the prescale factors
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrigLite
Definition: L1GtUtils.h:504
const L1GtTriggerMenuLite::L1TriggerMap * m_algorithmAliasMapLite
Definition: L1GtUtils.h:498
const L1GtTriggerMenuLite::L1TriggerMap * m_algorithmMapLite
Definition: L1GtUtils.h:497
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrigLite
Definition: L1GtUtils.h:505
const std::vector< unsigned int > & gtTriggerMaskTechTrig() const
get the trigger mask for technical triggers
const L1TriggerMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
const std::vector< std::vector< int > > & gtPrescaleFactorsTechTrig() const
bool isValid() const
Definition: HandleBase.h:76
const L1GtTriggerMenuLite * m_l1GtMenuLite
L1GtTriggerMenuLite cached stuff.
Definition: L1GtUtils.h:495
const std::vector< unsigned int > * m_triggerMaskTechTrigLite
Definition: L1GtUtils.h:502
RunAuxiliary const & runAuxiliary() const
Definition: Run.h:55
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:507
T const * product() const
Definition: Handle.h:81
const std::vector< unsigned int > * m_triggerMaskAlgoTrigLite
Definition: L1GtUtils.h:501
const L1TriggerMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
const L1TriggerMap & gtTechnicalTriggerMap() const
get / set the technical trigger map
const L1GtTriggerMenuLite::L1TriggerMap * m_technicalTriggerMapLite
Definition: L1GtUtils.h:499
RunNumber_t run() const
Definition: RunAuxiliary.h:41
const std::string L1GtUtils::triggerCategory ( const TriggerCategory trigCategory) const

public methods

Definition at line 90 of file L1GtUtils.cc.

References AlgorithmTrigger, EmptyString, and TechnicalTrigger.

Referenced by l1Results(), triggerMask(), and trigResult().

91  {
92 
93  switch (trigCategory) {
94  case AlgorithmTrigger: {
95  return "Algorithm Trigger";
96  }
97  break;
98  case TechnicalTrigger: {
99  return "Technical Trigger";
100  }
101 
102  break;
103  default: {
104  return EmptyString;
105  }
106  break;
107  }
108 }
static const std::string EmptyString
Definition: L1GtUtils.h:428
const int L1GtUtils::triggerMask ( const edm::Event iEvent,
const edm::InputTag l1GtRecordInputTag,
const edm::InputTag l1GtReadoutRecordInputTag,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

return trigger mask for a given algorithm or technical trigger

Definition at line 1520 of file L1GtUtils.cc.

References decisionAfterMask(), decisionBeforeMask(), l1Results(), and prescaleFactor().

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore(), L1GtAnalyzer::analyzeTrigger(), decision(), decisionAfterMask(), decisionBeforeMask(), prescaleFactor(), and triggerMask().

1523  {
1524 
1525  // initial values
1526  bool decisionBeforeMask = false;
1527  bool decisionAfterMask = false;
1528  int prescaleFactor = -1;
1529  int triggerMask = -1;
1530 
1531  errorCode = l1Results(iEvent, l1GtRecordInputTag,
1532  l1GtReadoutRecordInputTag, nameAlgoTechTrig, decisionBeforeMask,
1533  decisionAfterMask, prescaleFactor, triggerMask);
1534 
1535  return triggerMask;
1536 
1537 }
const bool decisionAfterMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1411
const int l1Results(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
Definition: L1GtUtils.cc:885
const bool decisionBeforeMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1374
const int triggerMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1520
const int prescaleFactor(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1485
const int L1GtUtils::triggerMask ( const edm::Event iEvent,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

Definition at line 1539 of file L1GtUtils.cc.

References decisionAfterMask(), decisionBeforeMask(), l1Results(), prescaleFactor(), and triggerMask().

1540  {
1541 
1542  // initial values
1543  bool decisionBeforeMask = false;
1544  bool decisionAfterMask = false;
1545  int prescaleFactor = -1;
1546  int triggerMask = -1;
1547 
1548  errorCode = l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1549  decisionAfterMask, prescaleFactor, triggerMask);
1550 
1551  return triggerMask;
1552 
1553 }
const bool decisionAfterMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1411
const int l1Results(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
Definition: L1GtUtils.cc:885
const bool decisionBeforeMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1374
const int triggerMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1520
const int prescaleFactor(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1485
const int L1GtUtils::triggerMask ( const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

faster than previous two methods - one needs in fact for the masks the event setup only

Definition at line 1555 of file L1GtUtils.cc.

References AlgorithmTrigger, availableL1Configuration(), L1GtTriggerMenuLite::gtTriggerMenuImplementation(), L1GtTriggerMenu::gtTriggerMenuImplementation(), l1AlgoTechTrigBitNumber(), LogDebug, m_l1GtMenu, m_l1GtMenuLite, m_l1GtMenuLiteValid, m_physicsDaqPartition, m_retrieveL1GtTriggerMenuLite, m_triggerMaskAlgoTrig, m_triggerMaskAlgoTrigLite, m_triggerMaskTechTrig, m_triggerMaskTechTrigLite, TechnicalTrigger, and triggerCategory().

1556  {
1557 
1558  // initial values for returned results
1559  int triggerMaskValue = -1;
1560 
1561  // initialize error code and L1 configuration code
1562  int iError = 0;
1563  int l1ConfCode = 0;
1564 
1565  // check if L1 configuration is available
1566 
1567  if (!availableL1Configuration(iError, l1ConfCode)) {
1568  errorCode = iError;
1569  return triggerMaskValue;
1570  }
1571 
1572  // at this point, a valid L1 configuration is available, so the if/else if/else
1573  // can be simplified
1574 
1575  // if the given name is not an algorithm trigger alias, an algorithm trigger name
1576  // or a technical trigger in the current menu, return with error code 1
1577 
1578  TriggerCategory trigCategory = AlgorithmTrigger;
1579  int bitNumber = -1;
1580 
1581  if (!l1AlgoTechTrigBitNumber(nameAlgoTechTrig, trigCategory, bitNumber)) {
1582 
1583  iError = l1ConfCode + 1;
1584 
1586  if (m_l1GtMenuLiteValid) {
1587 
1588  LogDebug("L1GtUtils") << "\nAlgorithm/technical trigger \n "
1589  << nameAlgoTechTrig
1590  << "\not found in the trigger menu \n "
1592  << "\nretrieved from L1GtTriggerMenuLite" << std::endl;
1593 
1594  } else {
1595 
1596  // fall through: L1 trigger configuration from event setup
1597  LogDebug("L1GtUtils") << "\nAlgorithm/technical trigger \n "
1598  << nameAlgoTechTrig
1599  << "\not found in the trigger menu \n "
1601  << "\nretrieved from Event Setup" << std::endl;
1602 
1603  }
1604 
1605  } else {
1606  // L1 trigger configuration from event setup only
1607  LogDebug("L1GtUtils") << "\nAlgorithm/technical trigger \n "
1608  << nameAlgoTechTrig
1609  << "\not found in the trigger menu \n "
1611  << "\nretrieved from Event Setup" << std::endl;
1612 
1613  }
1614 
1615  errorCode = iError;
1616  return triggerMaskValue;
1617 
1618  }
1619 
1620  // check here if a positive bit number was retrieved
1621  // exit in case of negative bit number, before retrieving L1 GT products, saving time
1622 
1623  if (bitNumber < 0) {
1624 
1625  iError = l1ConfCode + 2;
1626 
1628  if (m_l1GtMenuLiteValid) {
1629  LogDebug("L1GtUtils") << "\nNegative bit number for "
1630  << triggerCategory(trigCategory) << "\n "
1631  << nameAlgoTechTrig << "\nfrom menu \n "
1633  << "\nretrieved from L1GtTriggerMenuLite" << std::endl;
1634 
1635  } else {
1636  // fall through: L1 trigger configuration from event setup
1637  LogDebug("L1GtUtils") << "\nNegative bit number for "
1638  << triggerCategory(trigCategory) << "\n "
1639  << nameAlgoTechTrig << "\nfrom menu \n "
1641  << "\nretrieved from Event Setup" << std::endl;
1642 
1643  }
1644 
1645  } else {
1646  // L1 trigger configuration from event setup only
1647  LogDebug("L1GtUtils") << "\nNegative bit number for "
1648  << triggerCategory(trigCategory) << "\n "
1649  << nameAlgoTechTrig << "\nfrom menu \n "
1651  << "\nretrieved from Event Setup" << std::endl;
1652 
1653  }
1654 
1655  errorCode = iError;
1656  return triggerMaskValue;
1657  }
1658 
1659  // depending on trigger category (algorithm trigger or technical trigger)
1660  // get the correct quantities
1661 
1662  // pointer to the set of trigger masks
1663 
1664  const std::vector<unsigned int>* triggerMasksSet = 0;
1665 
1666  switch (trigCategory) {
1667  case AlgorithmTrigger: {
1669  if (m_l1GtMenuLiteValid) {
1670  triggerMasksSet = m_triggerMaskAlgoTrigLite;
1671 
1672  } else {
1673  // fall through: L1 trigger configuration from event setup
1674  triggerMasksSet = m_triggerMaskAlgoTrig;
1675 
1676  }
1677 
1678  } else {
1679  // L1 trigger configuration from event setup only
1680  triggerMasksSet = m_triggerMaskAlgoTrig;
1681 
1682  }
1683 
1684  }
1685  break;
1686  case TechnicalTrigger: {
1688  if (m_l1GtMenuLiteValid) {
1689  triggerMasksSet = m_triggerMaskTechTrigLite;
1690 
1691  } else {
1692  // fall through: L1 trigger configuration from event setup
1693  triggerMasksSet = m_triggerMaskTechTrig;
1694 
1695  }
1696 
1697  } else {
1698  // L1 trigger configuration from event setup only
1699  triggerMasksSet = m_triggerMaskTechTrig;
1700 
1701  }
1702 
1703  }
1704  break;
1705  default: {
1706  // should not be the case
1707  iError = l1ConfCode + 3;
1708 
1709  errorCode = iError;
1710  return triggerMaskValue;
1711 
1712  }
1713  break;
1714  }
1715 
1716  // trigger mask
1717 
1718  if (bitNumber < (static_cast<int> ((*triggerMasksSet).size()))) {
1719 
1721  if (m_l1GtMenuLiteValid) {
1722  triggerMaskValue = (*triggerMasksSet)[bitNumber];
1723 
1724  } else {
1725  // fall through: L1 trigger configuration from event setup
1726  // masks in event setup are for all partitions
1727  triggerMaskValue = ((*triggerMasksSet)[bitNumber]) & (1
1729 
1730  }
1731 
1732  } else {
1733  // L1 trigger configuration from event setup only
1734  // masks in event setup are for all partitions
1735  triggerMaskValue = ((*triggerMasksSet)[bitNumber]) & (1
1737 
1738  }
1739 
1740  } else {
1741  iError = l1ConfCode + 5000;
1742  LogDebug("L1GtUtils") << "\nError: bit number " << bitNumber
1743  << " retrieved for " << triggerCategory(trigCategory) << "\n "
1744  << nameAlgoTechTrig
1745  << "\ngreater than size of L1 GT trigger mask set: "
1746  << (*triggerMasksSet).size()
1747  << "\nError: Inconsistent L1 trigger configuration!"
1748  << std::endl;
1749 
1750  errorCode = iError;
1751  return triggerMaskValue;
1752 
1753  }
1754 
1755  errorCode = iError;
1756  return triggerMaskValue;
1757 
1758 }
#define LogDebug(id)
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:533
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
Definition: L1GtUtils.h:475
const std::vector< unsigned int > * m_triggerMaskTechTrig
Definition: L1GtUtils.h:476
const bool l1AlgoTechTrigBitNumber(const std::string &nameAlgoTechTrig, TriggerCategory &trigCategory, int &bitNumber) const
Definition: L1GtUtils.cc:548
TriggerCategory
Definition: L1GtUtils.h:58
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:2293
const std::string & gtTriggerMenuImplementation() const
const std::string triggerCategory(const TriggerCategory &) const
public methods
Definition: L1GtUtils.cc:90
unsigned int m_physicsDaqPartition
index of physics DAQ partition
Definition: L1GtUtils.h:526
const L1GtTriggerMenuLite * m_l1GtMenuLite
L1GtTriggerMenuLite cached stuff.
Definition: L1GtUtils.h:495
const std::vector< unsigned int > * m_triggerMaskTechTrigLite
Definition: L1GtUtils.h:502
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:507
const std::vector< unsigned int > * m_triggerMaskAlgoTrigLite
Definition: L1GtUtils.h:501
const L1GtTriggerMenu * m_l1GtMenu
Definition: L1GtUtils.h:482
const std::string & gtTriggerMenuImplementation() const
const std::vector< unsigned int > & L1GtUtils::triggerMaskSet ( const TriggerCategory trigCategory,
int &  errorCode 
)

return the set of trigger masks for the physics partition (partition zero) used for the event (remain the same in the whole run, if no errors)

Definition at line 2079 of file L1GtUtils.cc.

References AlgorithmTrigger, availableL1Configuration(), i, m_l1GtMenuLiteValid, m_physicsDaqPartition, m_retrieveL1GtTriggerMenuLite, m_triggerMaskAlgoTrig, m_triggerMaskAlgoTrigLite, m_triggerMaskSet, m_triggerMaskTechTrig, m_triggerMaskTechTrigLite, and TechnicalTrigger.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore().

2080  {
2081 
2082  // clear the vector before filling it
2083  m_triggerMaskSet.clear();
2084 
2085  // initialize error code and L1 configuration code
2086  int iError = 0;
2087  int l1ConfCode = 0;
2088 
2089  // check if L1 configuration is available
2090 
2091  if (!availableL1Configuration(iError, l1ConfCode)) {
2092  errorCode = iError;
2093  return m_triggerMaskSet;
2094  }
2095 
2096  // at this point, a valid L1 configuration is available, so the if/else if/else
2097  // can be simplified
2098 
2099 
2100  // depending on trigger category (algorithm trigger or technical trigger)
2101  // get the correct quantities
2102 
2103  // pointer to the set of trigger masks
2104 
2105  switch (trigCategory) {
2106  case AlgorithmTrigger: {
2108  // L1GtTriggerMenuLite has masks for physics partition only
2109  // avoid copy to m_triggerMaskSet, return directly m_triggerMaskAlgoTrigLite
2110  if (m_l1GtMenuLiteValid) {
2111  errorCode = iError;
2112  return (*m_triggerMaskAlgoTrigLite);
2113 
2114  } else {
2115  // fall through: L1 trigger configuration from event setup
2116  for (unsigned i = 0; i < m_triggerMaskAlgoTrig->size(); i++) {
2117  m_triggerMaskSet.push_back(
2118  ((*m_triggerMaskAlgoTrig)[i]) & (1
2119  << m_physicsDaqPartition));
2120  }
2121 
2122  }
2123 
2124  } else {
2125  // L1 trigger configuration from event setup only
2126  for (unsigned i = 0; i < m_triggerMaskAlgoTrig->size(); i++) {
2127  m_triggerMaskSet.push_back(((*m_triggerMaskAlgoTrig)[i])
2128  & (1 << m_physicsDaqPartition));
2129  }
2130 
2131  }
2132  }
2133  break;
2134  case TechnicalTrigger: {
2136  if (m_l1GtMenuLiteValid) {
2137  errorCode = iError;
2138  return (*m_triggerMaskTechTrigLite);
2139 
2140  } else {
2141  // fall through: L1 trigger configuration from event setup
2142  for (unsigned i = 0; i < m_triggerMaskTechTrig->size(); i++) {
2143  m_triggerMaskSet.push_back(
2144  ((*m_triggerMaskTechTrig)[i]) & (1
2145  << m_physicsDaqPartition));
2146  }
2147 
2148  }
2149 
2150  } else {
2151  // L1 trigger configuration from event setup only
2152  for (unsigned i = 0; i < m_triggerMaskTechTrig->size(); i++) {
2153  m_triggerMaskSet.push_back(((*m_triggerMaskTechTrig)[i])
2154  & (1 << m_physicsDaqPartition));
2155  }
2156 
2157  }
2158  }
2159  break;
2160  default: {
2161  // should not be the case
2162  iError = l1ConfCode + 3;
2163 
2164  errorCode = iError;
2165  return m_triggerMaskSet;
2166 
2167  }
2168  break;
2169  }
2170 
2171  errorCode = iError;
2172  return m_triggerMaskSet;
2173 
2174 }
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:533
int i
Definition: DBlmapReader.cc:9
std::vector< unsigned int > m_triggerMaskSet
Definition: L1GtUtils.h:528
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
Definition: L1GtUtils.h:475
const std::vector< unsigned int > * m_triggerMaskTechTrig
Definition: L1GtUtils.h:476
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:2293
unsigned int m_physicsDaqPartition
index of physics DAQ partition
Definition: L1GtUtils.h:526
const std::vector< unsigned int > * m_triggerMaskTechTrigLite
Definition: L1GtUtils.h:502
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:507
const std::vector< unsigned int > * m_triggerMaskAlgoTrigLite
Definition: L1GtUtils.h:501
const bool L1GtUtils::trigResult ( const DecisionWord decWord,
const int  bitNumber,
const std::string &  nameAlgoTechTrig,
const TriggerCategory trigCategory,
int &  errorCode 
) const
private

return the trigger result given bit number and decision word errorCode != 0 if bit number greater than size of decision word print in debug mode a message in case of error

Definition at line 2397 of file L1GtUtils.cc.

References LogDebug, and triggerCategory().

Referenced by l1Results().

2399  {
2400 
2401  bool trigRes = false;
2402  errorCode = 0;
2403 
2404  if (bitNumber < (static_cast<int> (decWord.size()))) {
2405  trigRes = decWord[bitNumber];
2406  } else {
2407  errorCode = 3000;
2408  LogDebug("L1GtUtils") << "\nError: bit number " << bitNumber
2409  << " retrieved for " << triggerCategory(trigCategory) << "\n "
2410  << nameAlgoTechTrig
2411  << "\ngreater than size of L1 GT decision word: "
2412  << decWord.size()
2413  << "\nError: Inconsistent L1 trigger configuration!"
2414  << std::endl;
2415  }
2416 
2417  return trigRes;
2418 }
#define LogDebug(id)
const std::string triggerCategory(const TriggerCategory &) const
public methods
Definition: L1GtUtils.cc:90

Member Data Documentation

const std::string L1GtUtils::EmptyString = ""
staticprivate

Definition at line 428 of file L1GtUtils.h.

Referenced by l1TriggerMenu(), l1TriggerMenuImplementation(), and triggerCategory().

const int L1GtUtils::L1GtNotValidError = 99999
staticprivate

Definition at line 429 of file L1GtUtils.h.

Referenced by availableL1Configuration().

const AlgorithmMap* L1GtUtils::m_algorithmAliasMap
private
const L1GtTriggerMenuLite::L1TriggerMap* L1GtUtils::m_algorithmAliasMapLite
private
const AlgorithmMap* L1GtUtils::m_algorithmMap
private

Definition at line 485 of file L1GtUtils.h.

Referenced by l1AlgoTechTrigBitNumber(), and retrieveL1EventSetup().

const L1GtTriggerMenuLite::L1TriggerMap* L1GtUtils::m_algorithmMapLite
private
bool L1GtUtils::m_beginRunCache
private

flag for call of getL1GtRunCache in beginRun

Definition at line 510 of file L1GtUtils.h.

Referenced by getL1GtRunCache().

bool L1GtUtils::m_l1EventSetupValid
private

Definition at line 489 of file L1GtUtils.h.

Referenced by availableL1Configuration(), and retrieveL1EventSetup().

const L1GtTriggerMenu* L1GtUtils::m_l1GtMenu
private
unsigned long long L1GtUtils::m_l1GtMenuCacheID
private

Definition at line 483 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

const L1GtTriggerMenuLite* L1GtUtils::m_l1GtMenuLite
private
bool L1GtUtils::m_l1GtMenuLiteValid
private
const L1GtPrescaleFactors* L1GtUtils::m_l1GtPfAlgo
private

prescale factors

Definition at line 453 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtUtils::m_l1GtPfAlgoCacheID
private

Definition at line 454 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

const L1GtPrescaleFactors* L1GtUtils::m_l1GtPfTech
private

Definition at line 456 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtUtils::m_l1GtPfTechCacheID
private

Definition at line 457 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

const L1GtStableParameters* L1GtUtils::m_l1GtStablePar
private

event setup cached stuff

stable parameters

Definition at line 443 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtUtils::m_l1GtStableParCacheID
private

Definition at line 444 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

const L1GtTriggerMask* L1GtUtils::m_l1GtTmAlgo
private

trigger masks & veto masks

Definition at line 463 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtUtils::m_l1GtTmAlgoCacheID
private

Definition at line 464 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

const L1GtTriggerMask* L1GtUtils::m_l1GtTmTech
private

Definition at line 466 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtUtils::m_l1GtTmTechCacheID
private

Definition at line 467 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

const L1GtTriggerMask* L1GtUtils::m_l1GtTmVetoAlgo
private

Definition at line 469 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtUtils::m_l1GtTmVetoAlgoCacheID
private

Definition at line 470 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

const L1GtTriggerMask* L1GtUtils::m_l1GtTmVetoTech
private

Definition at line 472 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtUtils::m_l1GtTmVetoTechCacheID
private

Definition at line 473 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned int L1GtUtils::m_numberAlgorithmTriggers
private

number of algorithm triggers

Definition at line 447 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned int L1GtUtils::m_numberTechnicalTriggers
private

number of technical triggers

Definition at line 450 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned int L1GtUtils::m_physicsDaqPartition
private

index of physics DAQ partition

Definition at line 526 of file L1GtUtils.h.

Referenced by l1Results(), triggerMask(), and triggerMaskSet().

const std::vector<std::vector<int> >* L1GtUtils::m_prescaleFactorsAlgoTrig
private

Definition at line 459 of file L1GtUtils.h.

Referenced by l1Results(), prescaleFactorSetIndex(), and retrieveL1EventSetup().

const std::vector<std::vector<int> >* L1GtUtils::m_prescaleFactorsAlgoTrigLite
private

Definition at line 504 of file L1GtUtils.h.

Referenced by l1Results(), prescaleFactorSetIndex(), and retrieveL1GtTriggerMenuLite().

std::vector<int> L1GtUtils::m_prescaleFactorSet
private

Definition at line 529 of file L1GtUtils.h.

Referenced by prescaleFactorSet(), and retrieveL1EventSetup().

const std::vector<std::vector<int> >* L1GtUtils::m_prescaleFactorsTechTrig
private

Definition at line 460 of file L1GtUtils.h.

Referenced by l1Results(), prescaleFactorSetIndex(), and retrieveL1EventSetup().

const std::vector<std::vector<int> >* L1GtUtils::m_prescaleFactorsTechTrigLite
private

Definition at line 505 of file L1GtUtils.h.

Referenced by l1Results(), prescaleFactorSetIndex(), and retrieveL1GtTriggerMenuLite().

edm::InputTag L1GtUtils::m_provL1GtReadoutRecordInputTag
mutableprivate
edm::InputTag L1GtUtils::m_provL1GtRecordInputTag
mutableprivate

cached input tags from provenance - they are updated once per run only

Definition at line 514 of file L1GtUtils.h.

Referenced by getL1GtRunCache(), l1Results(), prescaleFactorSet(), prescaleFactorSetIndex(), and provL1GtRecordInputTag().

edm::InputTag L1GtUtils::m_provL1GtTriggerMenuLiteInputTag
mutableprivate

Definition at line 516 of file L1GtUtils.h.

Referenced by getL1GtRunCache(), and provL1GtTriggerMenuLiteInputTag().

edm::RunID L1GtUtils::m_provRunIDCache
private

Definition at line 520 of file L1GtUtils.h.

Referenced by getL1GtRunCache().

bool L1GtUtils::m_retrieveL1EventSetup
private

flags to check which method was used to retrieve L1 trigger configuration

Definition at line 532 of file L1GtUtils.h.

Referenced by availableL1Configuration(), l1AlgoTechTrigBitNumber(), l1TriggerMenu(), l1TriggerMenuImplementation(), l1TriggerNameFromBit(), ptrL1TriggerMenuEventSetup(), and retrieveL1EventSetup().

bool L1GtUtils::m_retrieveL1GtTriggerMenuLite
private
edm::RunID L1GtUtils::m_runIDCache
private

run cache ID

Definition at line 519 of file L1GtUtils.h.

Referenced by getL1GtRunCache().

const AlgorithmMap* L1GtUtils::m_technicalTriggerMap
private
const L1GtTriggerMenuLite::L1TriggerMap* L1GtUtils::m_technicalTriggerMapLite
private
const std::vector<unsigned int>* L1GtUtils::m_triggerMaskAlgoTrig
private

Definition at line 475 of file L1GtUtils.h.

Referenced by l1Results(), retrieveL1EventSetup(), triggerMask(), and triggerMaskSet().

const std::vector<unsigned int>* L1GtUtils::m_triggerMaskAlgoTrigLite
private

Definition at line 501 of file L1GtUtils.h.

Referenced by l1Results(), retrieveL1GtTriggerMenuLite(), triggerMask(), and triggerMaskSet().

std::vector<unsigned int> L1GtUtils::m_triggerMaskSet
private

Definition at line 528 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup(), and triggerMaskSet().

const std::vector<unsigned int>* L1GtUtils::m_triggerMaskTechTrig
private

Definition at line 476 of file L1GtUtils.h.

Referenced by l1Results(), retrieveL1EventSetup(), triggerMask(), and triggerMaskSet().

const std::vector<unsigned int>* L1GtUtils::m_triggerMaskTechTrigLite
private

Definition at line 502 of file L1GtUtils.h.

Referenced by l1Results(), retrieveL1GtTriggerMenuLite(), triggerMask(), and triggerMaskSet().

const std::vector<unsigned int>* L1GtUtils::m_triggerMaskVetoAlgoTrig
private

Definition at line 478 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

const std::vector<unsigned int>* L1GtUtils::m_triggerMaskVetoTechTrig
private

Definition at line 479 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().