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 49 of file L1GtUtils.cc.

49  :
50 
52 
54 
56 
58 
60 
61  m_l1GtMenuCacheID(0ULL),
62 
63  m_l1EventSetupValid(false),
64 
65  m_l1GtMenuLiteValid(false),
66 
67  m_beginRunCache(false),
68 
69  m_runIDCache(0),
70 
72 
74 
76 
78 
79  {
80 
81  // empty
82 }
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 85 of file L1GtUtils.cc.

85  {
86 
87  // empty
88 
89 }

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

2416  {
2417 
2419  if (!m_retrieveL1EventSetup) {
2420  LogDebug("L1GtUtils")
2421  << "\nRetrieve L1 trigger configuration from L1GtTriggerMenuLite only.\n"
2422  << std::endl;
2423  l1ConfCode = 0;
2424  } else {
2425  LogDebug("L1GtUtils")
2426  << "\nFall through: retrieve L1 trigger configuration from L1GtTriggerMenuLite."
2427  << "\nIf L1GtTriggerMenuLite not valid, try to retrieve from event setup.\n"
2428  << std::endl;
2429  l1ConfCode = 100000;
2430  }
2431 
2432  if (m_l1GtMenuLiteValid) {
2433  LogDebug("L1GtUtils")
2434  << "\nRetrieve L1 trigger configuration from L1GtTriggerMenuLite, valid product.\n"
2435  << std::endl;
2436  l1ConfCode = l1ConfCode + 10000;
2437  errorCode = 0;
2438 
2439  return true;
2440 
2441  } else if (m_retrieveL1EventSetup) {
2442  if (m_l1EventSetupValid) {
2443  LogDebug("L1GtUtils")
2444  << "\nFall through: retrieve L1 trigger configuration from event setup."
2445  << "\nFirst option was L1GtTriggerMenuLite - but product is not valid.\n"
2446  << std::endl;
2447  l1ConfCode = l1ConfCode + 20000;
2448  errorCode = 0;
2449 
2450  return true;
2451 
2452  } else {
2453  LogDebug("L1GtUtils")
2454  << "\nFall through: L1GtTriggerMenuLite not valid, event setup not valid.\n"
2455  << std::endl;
2456  l1ConfCode = l1ConfCode + L1GtNotValidError;
2457  errorCode = l1ConfCode;
2458 
2459  return false;
2460 
2461 
2462  }
2463 
2464  } else {
2465  LogDebug("L1GtUtils")
2466  << "\nError: L1 trigger configuration requested from L1GtTriggerMenuLite only"
2467  << "\nbut L1GtTriggerMenuLite is not valid.\n" << std::endl;
2468  l1ConfCode = l1ConfCode + L1GtNotValidError;
2469  errorCode = l1ConfCode;
2470 
2471  return false;
2472 
2473  }
2474  } else if (m_retrieveL1EventSetup) {
2475 
2476  LogDebug("L1GtUtils")
2477  << "\nRetrieve L1 trigger configuration from event setup."
2478  << "\nL1GtTriggerMenuLite product was not requested.\n"
2479  << std::endl;
2480  l1ConfCode = 200000;
2481 
2482  if (m_l1EventSetupValid) {
2483  LogDebug("L1GtUtils")
2484  << "\nRetrieve L1 trigger configuration from event setup only."
2485  << "\nValid L1 trigger event setup.\n"
2486  << std::endl;
2487  l1ConfCode = l1ConfCode + 10000;
2488  errorCode = 0;
2489 
2490  return true;
2491 
2492  } else {
2493  LogDebug("L1GtUtils")
2494  << "\nRetrieve L1 trigger configuration from event setup only."
2495  << "\nNo valid L1 trigger event setup.\n"
2496  << std::endl;
2497  l1ConfCode = l1ConfCode + L1GtNotValidError;
2498  errorCode = l1ConfCode;
2499 
2500  return false;
2501 
2502 
2503  }
2504 
2505  } else {
2506  LogDebug("L1GtUtils")
2507  << "\nError: no L1 trigger configuration requested to be retrieved."
2508  << "\nMust call before getL1GtRunCache in beginRun and analyze.\n"
2509  << std::endl;
2510  l1ConfCode = 300000;
2511  errorCode = l1ConfCode;
2512 
2513  return false;
2514 
2515  }
2516 }
#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 1571 of file L1GtUtils.cc.

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

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

1574  {
1575 
1576  // initial values
1577  bool decisionBeforeMask = false;
1578  bool decisionAfterMask = false;
1579  int prescaleFactor = -1;
1580  int triggerMask = -1;
1581 
1582  errorCode = l1Results(iEvent, l1GtRecordInputTag,
1583  l1GtReadoutRecordInputTag, nameAlgoTechTrig, decisionBeforeMask,
1584  decisionAfterMask, prescaleFactor, triggerMask);
1585 
1586  return decisionAfterMask;
1587 
1588 }
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:1534
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:1008
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:1497
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:1643
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:1608
const bool L1GtUtils::decision ( const edm::Event iEvent,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

Definition at line 1590 of file L1GtUtils.cc.

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

1591  {
1592 
1593  // initial values
1594  bool decisionBeforeMask = false;
1595  bool decisionAfterMask = false;
1596  int prescaleFactor = -1;
1597  int triggerMask = -1;
1598 
1599  errorCode = l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1600  decisionAfterMask, prescaleFactor, triggerMask);
1601 
1602  return decisionAfterMask;
1603 
1604 }
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:1534
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:1008
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:1497
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:1643
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:1608
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 1534 of file L1GtUtils.cc.

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

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

1537  {
1538 
1539  // initial values
1540  bool decisionBeforeMask = false;
1541  bool decisionAfterMask = false;
1542  int prescaleFactor = -1;
1543  int triggerMask = -1;
1544 
1545  errorCode = l1Results(iEvent, l1GtRecordInputTag,
1546  l1GtReadoutRecordInputTag, nameAlgoTechTrig, decisionBeforeMask,
1547  decisionAfterMask, prescaleFactor, triggerMask);
1548 
1549  return decisionAfterMask;
1550 
1551 }
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:1534
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:1008
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:1497
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:1643
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:1608
const bool L1GtUtils::decisionAfterMask ( const edm::Event iEvent,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

Definition at line 1553 of file L1GtUtils.cc.

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

1554  {
1555 
1556  // initial values
1557  bool decisionBeforeMask = false;
1558  bool decisionAfterMask = false;
1559  int prescaleFactor = -1;
1560  int triggerMask = -1;
1561 
1562  errorCode = l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1563  decisionAfterMask, prescaleFactor, triggerMask);
1564 
1565  return decisionAfterMask;
1566 
1567 }
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:1534
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:1008
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:1497
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:1643
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:1608
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 1497 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().

1500  {
1501 
1502  // initial values
1503  bool decisionBeforeMask = false;
1504  bool decisionAfterMask = false;
1505  int prescaleFactor = -1;
1506  int triggerMask = -1;
1507 
1508  errorCode = l1Results(iEvent, l1GtRecordInputTag,
1509  l1GtReadoutRecordInputTag, nameAlgoTechTrig, decisionBeforeMask,
1510  decisionAfterMask, prescaleFactor, triggerMask);
1511 
1512  return decisionBeforeMask;
1513 
1514 }
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:1534
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:1008
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:1497
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:1643
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:1608
const bool L1GtUtils::decisionBeforeMask ( const edm::Event iEvent,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

Definition at line 1516 of file L1GtUtils.cc.

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

1517  {
1518 
1519  // initial values
1520  bool decisionBeforeMask = false;
1521  bool decisionAfterMask = false;
1522  int prescaleFactor = -1;
1523  int triggerMask = -1;
1524 
1525  errorCode = l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1526  decisionAfterMask, prescaleFactor, triggerMask);
1527 
1528  return decisionBeforeMask;
1529 
1530 }
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:1534
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:1008
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:1497
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:1643
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:1608
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 428 of file L1GtUtils.cc.

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

Referenced by getL1GtRunCache().

430  {
431 
432  typedef std::vector<edm::Provenance const*> Provenances;
433  Provenances provenances;
435  std::string modLabel;
436  std::string instanceName;
438 
439  bool foundL1GtRecord = false;
440  bool foundL1GtReadoutRecord = false;
441 
442  bool foundMultipleL1GtRecord = false;
443  bool foundMultipleL1GtReadoutRecord = false;
444 
445  // use vector here, InputTag has no '<' operator to use std::set
446  std::vector<edm::InputTag> inputTagsL1GtRecord;
447  std::vector<edm::InputTag> inputTagsL1GtReadoutRecord;
448 
449  // TODO decide if the preferred input tags must be given as input parameters
450  // or stay hardwired
451  std::vector<edm::InputTag> preferredL1GtRecordInputTag;
452  preferredL1GtRecordInputTag.reserve(5);
453  preferredL1GtRecordInputTag.push_back(edm::InputTag("gtDigis"));
454  preferredL1GtRecordInputTag.push_back(edm::InputTag("hltGtDigis"));
455 
456  std::vector<edm::InputTag> preferredL1GtReadoutRecordInputTag;
457  preferredL1GtReadoutRecordInputTag.reserve(5);
458  preferredL1GtReadoutRecordInputTag.push_back(edm::InputTag("gtDigis"));
459  preferredL1GtReadoutRecordInputTag.push_back(edm::InputTag("hltGtDigis"));
460 
461  LogDebug("L1GtUtils") << "\nTry to get AllProvenance for event "
462  << iEvent.id().event() << std::endl;
463 
464  iEvent.getAllProvenance(provenances);
465 
466  LogTrace("L1GtUtils") << "\n" << "Event contains " << provenances.size()
467  << " product" << (provenances.size() == 1 ? "" : "s")
468  << " with friendlyClassName, moduleLabel, productInstanceName and processName:\n"
469  << std::endl;
470 
471  for (Provenances::iterator itProv = provenances.begin(), itProvEnd =
472  provenances.end(); itProv != itProvEnd; ++itProv) {
473 
474  friendlyName = (*itProv)->friendlyClassName();
475  modLabel = (*itProv)->moduleLabel();
476  instanceName = (*itProv)->productInstanceName();
477  processName = (*itProv)->processName();
478 
479  LogTrace("L1GtUtils") << friendlyName << "\t \"" << modLabel
480  << "\" \t \"" << instanceName << "\" \t \"" << processName
481  << "\"" << std::endl;
482 
483  if (friendlyName == "L1GlobalTriggerRecord") {
484  l1GtRecordInputTag = edm::InputTag(modLabel, instanceName,
485  processName);
486  inputTagsL1GtRecord.push_back(l1GtRecordInputTag);
487 
488  foundL1GtRecord = true;
489  if (inputTagsL1GtRecord.size() > 1) {
490  foundMultipleL1GtRecord = true;
491  }
492  } else if (friendlyName == "L1GlobalTriggerReadoutRecord") {
493  l1GtReadoutRecordInputTag = edm::InputTag(modLabel, instanceName,
494  processName);
495  inputTagsL1GtReadoutRecord.push_back(l1GtReadoutRecordInputTag);
496 
497  foundL1GtReadoutRecord = true;
498 
499  if (inputTagsL1GtReadoutRecord.size() > 1) {
500  foundMultipleL1GtReadoutRecord = true;
501  }
502 
503  }
504  }
505 
506  // print statistics of L1GlobalTriggerReadoutRecord input tags
507  int nrInpuTags = inputTagsL1GtReadoutRecord.size();
508  if (nrInpuTags == 1) {
509  LogDebug("L1GtUtils") << "\n Unique L1GlobalTriggerReadoutRecord product found in the event."
510  << std::endl;
511 
512  } else if (nrInpuTags > 1) {
513  LogDebug("L1GtUtils") << "\nWARNING: Multiple L1GlobalTriggerReadoutRecord products found in the event.\n "
514  << nrInpuTags
515  << " L1GlobalTriggerReadoutRecord products:"
516  << std::endl;
517  } else {
518  LogDebug("L1GtUtils") << "\nWARNING: No L1GlobalTriggerReadoutRecord product found in the event.\n "
519  << std::endl;
520  }
521 
522  for (int iTag = 0; iTag < nrInpuTags; ++iTag) {
523  edm::LogPrint("L1GtUtils")
524  << inputTagsL1GtReadoutRecord[iTag]
525  << std::endl;
526  }
527 
528  // if L1GlobalTriggerRecord and L1GlobalTriggerReadoutRecord are not found, return empty input tags
529  // if multiple tags are found, write a warning and check if a "preferred input tag" is
530  // among the tags - if true, take this tag, otherwise return an empty tag.
531  if (!foundL1GtRecord) {
532  l1GtRecordInputTag = edm::InputTag();
533  } else if (foundMultipleL1GtRecord) {
534 
535  bool foundPreferredInputTag = false;
536  for (std::vector<edm::InputTag>::const_iterator itTag = inputTagsL1GtRecord.begin(), itTagEnd =
537  inputTagsL1GtRecord.end(); itTag != itTagEnd; ++itTag) {
538 
539  for (std::vector<edm::InputTag>::const_iterator itPrefTag = preferredL1GtRecordInputTag.begin(), itPrefTagEnd =
540  preferredL1GtRecordInputTag.end(); itPrefTag != itPrefTagEnd; ++itPrefTag) {
541 
542  if (itTag->label() == itPrefTag->label()) {
543  LogDebug("L1GtUtils")
544  << "\nWARNING: multiple L1GlobalTriggerRecord products found in the event."
545  << "\nInput tag set to the preferred input tag" << (*itTag)
546  << std::endl;
547  l1GtRecordInputTag = *itTag;
548  foundPreferredInputTag = true;
549  break;
550  }
551  }
552 
553  if (foundPreferredInputTag) {
554  break;
555  }
556  }
557 
558  if (!foundPreferredInputTag) {
559  LogDebug("L1GtUtils")
560  << "\nWARNING: multiple L1GlobalTriggerRecord products found in the event."
561  << "\nNo preferred input tag within the found values"
562  << "\n Input tag put to empty input tag."
563  << std::endl;
564  l1GtRecordInputTag = edm::InputTag();
565  }
566 
567  } else {
568  LogTrace("L1GtUtils")
569  << "\nUnique L1GlobalTriggerRecord found in the event with \n "
570  << l1GtRecordInputTag << std::endl;
571  }
572 
573  if (!foundL1GtReadoutRecord) {
574  l1GtReadoutRecordInputTag = edm::InputTag();
575  } else if (foundMultipleL1GtReadoutRecord) {
576 
577  bool foundPreferredInputTag = false;
578  for (std::vector<edm::InputTag>::const_iterator itTag = inputTagsL1GtReadoutRecord.begin(), itTagEnd =
579  inputTagsL1GtReadoutRecord.end(); itTag != itTagEnd; ++itTag) {
580 
581  for (std::vector<edm::InputTag>::const_iterator itPrefTag = preferredL1GtReadoutRecordInputTag.begin(), itPrefTagEnd =
582  preferredL1GtReadoutRecordInputTag.end(); itPrefTag != itPrefTagEnd; ++itPrefTag) {
583 
584  if (itTag->label() == itPrefTag->label()) {
585  LogDebug("L1GtUtils")
586  << "\nWARNING: multiple L1GlobalTriggerReadoutRecord products found in the event."
587  << "\nInput tag set to the preferred input tag" << (*itTag)
588  << std::endl;
589  l1GtReadoutRecordInputTag = *itTag;
590  foundPreferredInputTag = true;
591  break;
592  }
593  }
594 
595  if (foundPreferredInputTag) {
596  break;
597  }
598  }
599 
600  if (!foundPreferredInputTag) {
601  LogDebug("L1GtUtils")
602  << "\nWARNING: multiple L1GlobalTriggerReadoutRecord products found in the event."
603  << "\nNo preferred input tag within the found values"
604  << "\n Input tag put to empty input tag."
605  << std::endl;
606  l1GtReadoutRecordInputTag = edm::InputTag();
607  }
608 
609  } else {
610  LogTrace("L1GtUtils")
611  << "\nUnique L1GlobalTriggerReadoutRecord found in the event with \n "
612  << l1GtReadoutRecordInputTag << std::endl;
613  }
614 
615 }
#define LogDebug(id)
EventNumber_t event() const
Definition: EventID.h:41
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Event.cc:83
std::string friendlyName(std::string const &iFullName)
#define LogTrace(id)
edm::EventID id() const
Definition: EventBase.h:60
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 312 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().

314  {
315 
316  // first call will turn this to true: the quantities which can be cached in
317  // beginRun will not be cached then in analyze
318  m_beginRunCache = true;
319 
320  // if requested, retrieve and cache L1 event setup
321  // keep the caching based on cacheIdentifier() for each record
322  if (useL1EventSetup) {
323  retrieveL1EventSetup(evSetup);
324  }
325 
326  // cached per run
327 
328  // if requested, retrieve and cache the L1GtTriggerMenuLite
329  // L1GtTriggerMenuLite is defined per run and produced in prompt reco by L1Reco
330  // and put in the Run section
332  retrieveL1GtTriggerMenuLite(iRun, l1GtTmLInputTag);
333  }
334 
335 }
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:270
void retrieveL1EventSetup(const edm::EventSetup &)
retrieve all the relevant L1 trigger event setup records and cache them to improve the speed ...
Definition: L1GtUtils.cc:112
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 338 of file L1GtUtils.cc.

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

340  {
341 
344 
345  }
346 
349 
350 }
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:617
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:312
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 354 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().

356  {
357 
358  // if there was no retrieval and caching in beginRun, do it here
359  if (!m_beginRunCache) {
360 
361  // if requested, retrieve and cache L1 event setup
362  // keep the caching based on cacheIdentifier() for each record
363  if (useL1EventSetup) {
364  retrieveL1EventSetup(evSetup);
365  }
366  }
367 
368  // cached per run
369 
370  const edm::Run& iRun = iEvent.getRun();
371  edm::RunID runID = iRun.runAuxiliary().id();
372 
373  if (runID != m_runIDCache) {
374 
375  if (!m_beginRunCache) {
376  // if requested, retrieve and cache the L1GtTriggerMenuLite
377  // L1GtTriggerMenuLite is defined per run and produced in prompt reco by L1Reco
378  // and put in the Run section
380  retrieveL1GtTriggerMenuLite(iRun, l1GtTmLInputTag);
381  }
382  }
383 
384  // find from provenance and cache the input tags for L1GlobalTriggerRecord and
385  // L1GlobalTriggerReadoutRecord
388 
389  //
390  m_runIDCache = runID;
391 
392  }
393 
394 }
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:270
Run const & getRun() const
Definition: Event.cc:58
RunID const & id() const
Definition: RunAuxiliary.h:37
void getL1GtRecordInputTag(const edm::Event &iEvent, edm::InputTag &l1GtRecordInputTag, edm::InputTag &l1GtReadoutRecordInputTag) const
Definition: L1GtUtils.cc:428
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:112
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 397 of file L1GtUtils.cc.

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

399  {
400 
401  // if the input tag for L1GtTriggerMenuLite was not found in beginRun, do it here
402  if (!m_beginRunCache) {
403 
404  const edm::Run& iRun = iEvent.getRun();
405  edm::RunID runID = iRun.runAuxiliary().id();
406 
407  if (runID != m_provRunIDCache) {
408 
410 
413  }
414 
415  //
416  m_provRunIDCache = runID;
417  }
418 
419  }
420 
421  // call now the general method for getL1GtRunCache
424 
425 }
static const bool useL1GtTriggerMenuLite(false)
edm::InputTag m_provL1GtTriggerMenuLiteInputTag
Definition: L1GtUtils.h:516
Run const & getRun() const
Definition: Event.cc:58
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:617
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:312
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 617 of file L1GtUtils.cc.

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

Referenced by getL1GtRunCache().

618  {
619 
620  typedef std::vector<edm::Provenance const*> Provenances;
621  Provenances provenances;
623  std::string modLabel;
624  std::string instanceName;
626 
627  bool foundL1GtTriggerMenuLite = false;
628 
629  LogDebug("L1GtUtils") << "\nTry to get AllProvenance for run "
630  << iRun.runAuxiliary().run() << std::endl;
631 
632  iRun.getAllProvenance(provenances);
633 
634  LogTrace("L1GtUtils") << "\n" << "Run contains " << provenances.size()
635  << " product" << (provenances.size() == 1 ? "" : "s")
636  << " with friendlyClassName, moduleLabel, productInstanceName and processName:\n"
637  << std::endl;
638 
639  for (Provenances::iterator itProv = provenances.begin(), itProvEnd =
640  provenances.end(); itProv != itProvEnd; ++itProv) {
641 
642  friendlyName = (*itProv)->friendlyClassName();
643  modLabel = (*itProv)->moduleLabel();
644  instanceName = (*itProv)->productInstanceName();
645  processName = (*itProv)->processName();
646 
647  LogTrace("L1GtUtils") << friendlyName << "\t \"" << modLabel
648  << "\" \t \"" << instanceName << "\" \t \"" << processName
649  << "\"" << std::endl;
650 
651  if (friendlyName == "L1GtTriggerMenuLite") {
652  l1GtTriggerMenuLiteInputTag = edm::InputTag(modLabel, instanceName,
653  processName);
654  foundL1GtTriggerMenuLite = true;
655  }
656 
657  }
658 
659  if (!foundL1GtTriggerMenuLite) {
660  l1GtTriggerMenuLiteInputTag = edm::InputTag();
661  LogTrace("L1GtUtils") << "\nL1GtTriggerMenuLite not found in Run"
662  << std::endl;
663  } else {
664  LogTrace("L1GtUtils") << "\nL1GtTriggerMenuLite found in Run with \n "
665  << l1GtTriggerMenuLiteInputTag << std::endl;
666  }
667 
668 }
#define LogDebug(id)
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Run.cc:41
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 671 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().

673  {
674 
675  trigCategory = AlgorithmTrigger;
676  bitNumber = -1;
677 
679  if (m_l1GtMenuLiteValid) {
680 
681  // test if the name is an algorithm alias
682  for (L1GtTriggerMenuLite::CItL1Trig itTrig =
683  m_algorithmAliasMapLite->begin(); itTrig
684  != m_algorithmAliasMapLite->end(); itTrig++) {
685 
686  if (itTrig->second == nameAlgoTechTrig) {
687 
688  trigCategory = AlgorithmTrigger;
689  bitNumber = itTrig->first;
690 
691  return true;
692  }
693  }
694 
695  // test if the name is an algorithm name
696  for (L1GtTriggerMenuLite::CItL1Trig itTrig =
697  m_algorithmMapLite->begin(); itTrig
698  != m_algorithmMapLite->end(); itTrig++) {
699 
700  if (itTrig->second == nameAlgoTechTrig) {
701 
702  trigCategory = AlgorithmTrigger;
703  bitNumber = itTrig->first;
704 
705  return true;
706  }
707  }
708 
709  // test if the name is a technical trigger
710  for (L1GtTriggerMenuLite::CItL1Trig itTrig =
711  m_technicalTriggerMapLite->begin(); itTrig
712  != m_technicalTriggerMapLite->end(); itTrig++) {
713 
714  if (itTrig->second == nameAlgoTechTrig) {
715 
716  trigCategory = TechnicalTrigger;
717  bitNumber = itTrig->first;
718 
719  return true;
720  }
721  }
722 
723  } else if (m_retrieveL1EventSetup) {
724 
725  // test if the name is an algorithm alias
726  CItAlgo itAlgo = m_algorithmAliasMap->find(nameAlgoTechTrig);
727  if (itAlgo != m_algorithmAliasMap->end()) {
728  trigCategory = AlgorithmTrigger;
729  bitNumber = (itAlgo->second).algoBitNumber();
730 
731  return true;
732  }
733 
734  // test if the name is an algorithm name
735  itAlgo = m_algorithmMap->find(nameAlgoTechTrig);
736  if (itAlgo != m_algorithmMap->end()) {
737  trigCategory = AlgorithmTrigger;
738  bitNumber = (itAlgo->second).algoBitNumber();
739 
740  return true;
741  }
742 
743  // test if the name is a technical trigger
744  itAlgo = m_technicalTriggerMap->find(nameAlgoTechTrig);
745  if (itAlgo != m_technicalTriggerMap->end()) {
746  trigCategory = TechnicalTrigger;
747  bitNumber = (itAlgo->second).algoBitNumber();
748 
749  return true;
750  }
751 
752  } else {
753  // only L1GtTriggerMenuLite requested, but it is not valid
754  return false;
755 
756  }
757  } else if (m_retrieveL1EventSetup) {
758 
759  // test if the name is an algorithm alias
760  CItAlgo itAlgo = m_algorithmAliasMap->find(nameAlgoTechTrig);
761  if (itAlgo != m_algorithmAliasMap->end()) {
762  trigCategory = AlgorithmTrigger;
763  bitNumber = (itAlgo->second).algoBitNumber();
764 
765  return true;
766  }
767 
768  // test if the name is an algorithm name
769  itAlgo = m_algorithmMap->find(nameAlgoTechTrig);
770  if (itAlgo != m_algorithmMap->end()) {
771  trigCategory = AlgorithmTrigger;
772  bitNumber = (itAlgo->second).algoBitNumber();
773 
774  return true;
775  }
776 
777  // test if the name is a technical trigger
778  itAlgo = m_technicalTriggerMap->find(nameAlgoTechTrig);
779  if (itAlgo != m_technicalTriggerMap->end()) {
780  trigCategory = TechnicalTrigger;
781  bitNumber = (itAlgo->second).algoBitNumber();
782 
783  return true;
784  }
785 
786  } else {
787  // L1 trigger configuration not retrieved
788  return false;
789 
790  }
791 
792  // all possibilities already tested, so it should not arrive here
793  return false;
794 
795 
796 }
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 1008 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().

1012  {
1013 
1014  // initial values for returned results
1015  decisionBeforeMask = false;
1016  decisionAfterMask = false;
1017  prescaleFactor = -1;
1018  triggerMask = -1;
1019 
1020  // initialize error code and L1 configuration code
1021  int iError = 0;
1022  int l1ConfCode = 0;
1023 
1024  // check if L1 configuration is available
1025 
1026  if (!availableL1Configuration(iError, l1ConfCode)) {
1027  return iError;
1028  }
1029 
1030  // at this point, a valid L1 configuration is available, so the if/else if/else
1031  // can be simplified
1032 
1033  // if the given name is not an algorithm trigger alias, an algorithm trigger name
1034  // or a technical trigger in the current menu, return with error code 1
1035 
1036  TriggerCategory trigCategory = AlgorithmTrigger;
1037  int bitNumber = -1;
1038 
1039 
1040  if (!l1AlgoTechTrigBitNumber(nameAlgoTechTrig, trigCategory, bitNumber)) {
1041 
1042  iError = l1ConfCode + 1;
1043 
1045  if (m_l1GtMenuLiteValid) {
1046 
1047  LogDebug("L1GtUtils") << "\nAlgorithm/technical trigger \n "
1048  << nameAlgoTechTrig
1049  << "\not found in the trigger menu \n "
1051  << "\nretrieved from L1GtTriggerMenuLite" << std::endl;
1052 
1053  } else {
1054 
1055  // fall through: L1 trigger configuration from event setup
1056  LogDebug("L1GtUtils") << "\nAlgorithm/technical trigger \n "
1057  << nameAlgoTechTrig
1058  << "\not found in the trigger menu \n "
1060  << "\nretrieved from Event Setup" << std::endl;
1061 
1062  }
1063 
1064  } else {
1065  // L1 trigger configuration from event setup only
1066  LogDebug("L1GtUtils") << "\nAlgorithm/technical trigger \n "
1067  << nameAlgoTechTrig
1068  << "\not found in the trigger menu \n "
1070  << "\nretrieved from Event Setup" << std::endl;
1071 
1072  }
1073 
1074  return iError;
1075 
1076  }
1077 
1078  // check here if a positive bit number was retrieved
1079  // exit in case of negative bit number, before retrieving L1 GT products, saving time
1080 
1081  if (bitNumber < 0) {
1082 
1083  iError = l1ConfCode + 2;
1084 
1086  if (m_l1GtMenuLiteValid) {
1087  LogDebug("L1GtUtils") << "\nNegative bit number for "
1088  << triggerCategory(trigCategory) << "\n "
1089  << nameAlgoTechTrig << "\nfrom menu \n "
1091  << "\nretrieved from L1GtTriggerMenuLite" << std::endl;
1092 
1093  } else {
1094  // fall through: L1 trigger configuration from event setup
1095  LogDebug("L1GtUtils") << "\nNegative bit number for "
1096  << triggerCategory(trigCategory) << "\n "
1097  << nameAlgoTechTrig << "\nfrom menu \n "
1099  << "\nretrieved from Event Setup" << std::endl;
1100 
1101  }
1102 
1103  } else {
1104  // L1 trigger configuration from event setup only
1105  LogDebug("L1GtUtils") << "\nNegative bit number for "
1106  << triggerCategory(trigCategory) << "\n "
1107  << nameAlgoTechTrig << "\nfrom menu \n "
1109  << "\nretrieved from Event Setup" << std::endl;
1110 
1111  }
1112 
1113  return iError;
1114  }
1115 
1116 
1117  // retrieve L1GlobalTriggerRecord and 1GlobalTriggerReadoutRecord product
1118  // intermediate error code for the records
1119  // the module returns an error code only if both the lite and the readout record are missing
1120 
1121  int iErrorRecord = 0;
1122 
1123  bool validRecord = false;
1124  bool gtReadoutRecordValid = false;
1125 
1127  iEvent.getByLabel(l1GtRecordInputTag, gtRecord);
1128 
1129  if (gtRecord.isValid()) {
1130 
1131  validRecord = true;
1132 
1133  } else {
1134 
1135  iErrorRecord = 10;
1136  LogDebug("L1GtUtils") << "\nL1GlobalTriggerRecord with \n "
1137  << l1GtRecordInputTag << "\nnot found in the event."
1138  << std::endl;
1139  }
1140 
1142  iEvent.getByLabel(l1GtReadoutRecordInputTag, gtReadoutRecord);
1143 
1144  if (gtReadoutRecord.isValid()) {
1145 
1146  gtReadoutRecordValid = true;
1147  validRecord = true;
1148 
1149  } else {
1150 
1151  iErrorRecord = iErrorRecord + 100;
1152  LogDebug("L1GtUtils") << "\nL1GlobalTriggerReadoutRecord with \n "
1153  << l1GtReadoutRecordInputTag << "\nnot found in the event."
1154  << std::endl;
1155 
1156  }
1157 
1158  // get the prescale factor index from
1159  // L1GlobalTriggerReadoutRecord if valid
1160  // if not, from L1GlobalTriggerRecord if valid
1161  // else return an error
1162 
1163 
1164  int pfIndexTechTrig = -1;
1165  int pfIndexAlgoTrig = -1;
1166 
1167  if (validRecord) {
1168  if (gtReadoutRecordValid) {
1169 
1170  pfIndexTechTrig
1171  = (gtReadoutRecord->gtFdlWord()).gtPrescaleFactorIndexTech();
1172  pfIndexAlgoTrig
1173  = (gtReadoutRecord->gtFdlWord()).gtPrescaleFactorIndexAlgo();
1174 
1175  } else {
1176 
1177  pfIndexTechTrig
1178  = static_cast<int> (gtRecord->gtPrescaleFactorIndexTech());
1179  pfIndexAlgoTrig
1180  = static_cast<int> (gtRecord->gtPrescaleFactorIndexAlgo());
1181 
1182  }
1183 
1184  } else {
1185 
1186  LogDebug("L1GtUtils") << "\nError: "
1187  << "\nNo valid L1GlobalTriggerRecord with \n "
1188  << l1GtRecordInputTag << "\nfound in the event."
1189  << "\nNo valid L1GlobalTriggerReadoutRecord with \n "
1190  << l1GtReadoutRecordInputTag << "\nfound in the event."
1191  << std::endl;
1192 
1193  iError = l1ConfCode + iErrorRecord;
1194  return iError;
1195 
1196  }
1197 
1198  // depending on trigger category (algorithm trigger or technical trigger)
1199  // get the correct quantities
1200 
1201  // number of sets of prescale factors
1202  // index of prescale factor set retrieved from data
1203  // pointer to the actual prescale factor set
1204  // pointer to the set of trigger masks
1205 
1206  size_t pfSetsSize = 0;
1207  int pfIndex = -1;
1208  const std::vector<int>* prescaleFactorsSubset = 0;
1209  const std::vector<unsigned int>* triggerMasksSet = 0;
1210 
1211  switch (trigCategory) {
1212  case AlgorithmTrigger: {
1214  if (m_l1GtMenuLiteValid) {
1215  pfSetsSize = m_prescaleFactorsAlgoTrigLite->size();
1216  triggerMasksSet = m_triggerMaskAlgoTrigLite;
1217 
1218  } else {
1219  // fall through: L1 trigger configuration from event setup
1220  pfSetsSize = m_prescaleFactorsAlgoTrig->size();
1221  triggerMasksSet = m_triggerMaskAlgoTrig;
1222 
1223  }
1224 
1225  } else {
1226  // L1 trigger configuration from event setup only
1227  pfSetsSize = m_prescaleFactorsAlgoTrig->size();
1228  triggerMasksSet = m_triggerMaskAlgoTrig;
1229 
1230  }
1231 
1232  pfIndex = pfIndexAlgoTrig;
1233 
1234  }
1235  break;
1236  case TechnicalTrigger: {
1238  if (m_l1GtMenuLiteValid) {
1239  pfSetsSize = m_prescaleFactorsTechTrigLite->size();
1240  triggerMasksSet = m_triggerMaskTechTrigLite;
1241 
1242  } else {
1243  // fall through: L1 trigger configuration from event setup
1244  pfSetsSize = m_prescaleFactorsTechTrig->size();
1245  triggerMasksSet = m_triggerMaskTechTrig;
1246 
1247  }
1248 
1249  } else {
1250  // L1 trigger configuration from event setup only
1251  pfSetsSize = m_prescaleFactorsTechTrig->size();
1252  triggerMasksSet = m_triggerMaskTechTrig;
1253 
1254  }
1255 
1256  pfIndex = pfIndexTechTrig;
1257 
1258  }
1259  break;
1260  default: {
1261  // should not be the case
1262  iError = l1ConfCode + iErrorRecord + 3;
1263  return iError;
1264 
1265  }
1266  break;
1267  }
1268 
1269 
1270  // test prescale factor set index correctness, then retrieve the actual set of prescale factors
1271 
1272  if (pfIndex < 0) {
1273 
1274  iError = l1ConfCode + iErrorRecord + 1000;
1275  LogDebug("L1GtUtils")
1276  << "\nError: index of prescale factor set retrieved from the data \n"
1277  << "less than zero."
1278  << "\n Value of index retrieved from data = " << pfIndex
1279  << std::endl;
1280 
1281  return iError;
1282 
1283  } else if (pfIndex >= (static_cast<int>(pfSetsSize))) {
1284  iError = l1ConfCode + iErrorRecord + 2000;
1285  LogDebug("L1GtUtils")
1286  << "\nError: index of prescale factor set retrieved from the data \n"
1287  << "greater than the size of the vector of prescale factor sets."
1288  << "\n Value of index retrieved from data = " << pfIndex
1289  << "\n Vector size = " << pfSetsSize << std::endl;
1290 
1291  return iError;
1292 
1293  } else {
1294  switch (trigCategory) {
1295  case AlgorithmTrigger: {
1297  if (m_l1GtMenuLiteValid) {
1298  prescaleFactorsSubset
1299  = &((*m_prescaleFactorsAlgoTrigLite).at(pfIndex));
1300 
1301  } else {
1302  // fall through: L1 trigger configuration from event setup
1303  prescaleFactorsSubset
1304  = &((*m_prescaleFactorsAlgoTrig).at(pfIndex));
1305 
1306  }
1307 
1308  } else {
1309  // L1 trigger configuration from event setup only
1310  prescaleFactorsSubset
1311  = &((*m_prescaleFactorsAlgoTrig).at(pfIndex));
1312 
1313  }
1314 
1315  }
1316  break;
1317  case TechnicalTrigger: {
1319  if (m_l1GtMenuLiteValid) {
1320  prescaleFactorsSubset
1321  = &((*m_prescaleFactorsTechTrigLite).at(pfIndex));
1322 
1323  } else {
1324  // fall through: L1 trigger configuration from event setup
1325  prescaleFactorsSubset
1326  = &((*m_prescaleFactorsTechTrig).at(pfIndex));
1327 
1328  }
1329 
1330  } else {
1331  // L1 trigger configuration from event setup only
1332  prescaleFactorsSubset
1333  = &((*m_prescaleFactorsTechTrig).at(pfIndex));
1334 
1335  }
1336 
1337  }
1338  break;
1339  default: {
1340  // do nothing - it was tested before, with return
1341 
1342  }
1343  break;
1344  }
1345 
1346  }
1347 
1348 
1349  // algorithm result before applying the trigger masks
1350  // the bit number is positive (tested previously)
1351 
1352  switch (trigCategory) {
1353  case AlgorithmTrigger: {
1354  if (gtReadoutRecordValid) {
1355  const DecisionWord& decWord = gtReadoutRecord->decisionWord();
1356  decisionBeforeMask = trigResult(decWord, bitNumber,
1357  nameAlgoTechTrig, trigCategory, iError);
1358  if (iError) {
1359  return (iError + l1ConfCode + iErrorRecord);
1360  }
1361 
1362  } else {
1363 
1364  const DecisionWord& decWord =
1365  gtRecord->decisionWordBeforeMask();
1366  decisionBeforeMask = trigResult(decWord, bitNumber,
1367  nameAlgoTechTrig, trigCategory, iError);
1368  if (iError) {
1369  return (iError + l1ConfCode + iErrorRecord);
1370  }
1371 
1372  }
1373 
1374  }
1375  break;
1376  case TechnicalTrigger: {
1377  if (gtReadoutRecordValid) {
1378  const DecisionWord& decWord =
1379  gtReadoutRecord->technicalTriggerWord();
1380  decisionBeforeMask = trigResult(decWord, bitNumber,
1381  nameAlgoTechTrig, trigCategory, iError);
1382  if (iError) {
1383  return (iError + l1ConfCode + iErrorRecord);
1384  }
1385 
1386  } else {
1387 
1388  const DecisionWord& decWord =
1389  gtRecord->technicalTriggerWordBeforeMask();
1390  decisionBeforeMask = trigResult(decWord, bitNumber,
1391  nameAlgoTechTrig, trigCategory, iError);
1392  if (iError) {
1393  return (iError + l1ConfCode + iErrorRecord);
1394  }
1395 
1396  }
1397 
1398  }
1399  break;
1400  default: {
1401  // do nothing - it was tested before, with return
1402 
1403  }
1404  break;
1405  }
1406 
1407  // prescale factor
1408  // the bit number is positive (tested previously)
1409 
1410  if (bitNumber < (static_cast<int> (prescaleFactorsSubset->size()))) {
1411  prescaleFactor = (*prescaleFactorsSubset)[bitNumber];
1412  } else {
1413  iError = l1ConfCode + iErrorRecord + 4000;
1414  LogDebug("L1GtUtils") << "\nError: bit number " << bitNumber
1415  << " retrieved for " << triggerCategory(trigCategory) << "\n "
1416  << nameAlgoTechTrig
1417  << "\ngreater than size of actual L1 GT prescale factor set: "
1418  << prescaleFactorsSubset->size()
1419  << "\nError: Inconsistent L1 trigger configuration!"
1420  << std::endl;
1421 
1422  return iError;
1423  }
1424 
1425  // trigger mask and trigger result after applying the trigger masks
1426 
1427  if (bitNumber < (static_cast<int> ((*triggerMasksSet).size()))) {
1428 
1430  if (m_l1GtMenuLiteValid) {
1431  triggerMask = (*triggerMasksSet)[bitNumber];
1432 
1433  } else {
1434  // fall through: L1 trigger configuration from event setup
1435  // masks in event setup are for all partitions
1436  triggerMask = ((*triggerMasksSet)[bitNumber]) & (1
1438 
1439  }
1440 
1441  } else {
1442  // L1 trigger configuration from event setup only
1443  // masks in event setup are for all partitions
1444  triggerMask = ((*triggerMasksSet)[bitNumber]) & (1
1446 
1447  }
1448 
1449 
1450  } else {
1451  iError = l1ConfCode + iErrorRecord + 5000;
1452  LogDebug("L1GtUtils") << "\nError: bit number " << bitNumber
1453  << " retrieved for " << triggerCategory(trigCategory) << "\n "
1454  << nameAlgoTechTrig
1455  << "\ngreater than size of L1 GT trigger mask set: "
1456  << (*triggerMasksSet).size()
1457  << "\nError: Inconsistent L1 trigger configuration!"
1458  << std::endl;
1459 
1460  return iError;
1461 
1462  }
1463 
1465 
1466  if (triggerMask) {
1467  decisionAfterMask = false;
1468  }
1469 
1470  return iError;
1471 
1472 }
#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:1534
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:671
TriggerCategory
Definition: L1GtUtils.h:58
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:2416
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:1497
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:91
bool isValid() const
Definition: HandleBase.h:75
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:405
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:1643
const bool trigResult(const DecisionWord &decWord, const int bitNumber, const std::string &nameAlgoTechTrig, const TriggerCategory &trigCategory, int &errorCode) const
Definition: L1GtUtils.cc:2520
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:1608
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 1475 of file L1GtUtils.cc.

References l1Results(), m_provL1GtReadoutRecordInputTag, and m_provL1GtRecordInputTag.

1477  {
1478 
1479  // initial values for returned results
1480  decisionBeforeMask = false;
1481  decisionAfterMask = false;
1482  prescaleFactor = -1;
1483  triggerMask = -1;
1484 
1485  int l1ErrorCode = 0;
1486 
1487  l1ErrorCode = l1Results(iEvent, m_provL1GtRecordInputTag,
1490 
1491  return l1ErrorCode;
1492 
1493 }
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:1534
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:1008
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:1497
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:1643
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:1608
const std::string & L1GtUtils::l1TriggerMenu ( ) const

return the L1 trigger menu name

Definition at line 2301 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().

2301  {
2302 
2304  if (m_l1GtMenuLiteValid) {
2306 
2307  } else if (m_retrieveL1EventSetup) {
2308  return m_l1GtMenu->gtTriggerMenuName();
2309 
2310  } else {
2311  // only L1GtTriggerMenuLite requested, but it is not valid
2312  return EmptyString;
2313 
2314  }
2315  } else if (m_retrieveL1EventSetup) {
2316  return m_l1GtMenu->gtTriggerMenuName();
2317 
2318  } else {
2319  // L1 trigger configuration not retrieved
2320  return EmptyString;
2321 
2322  }
2323 
2324 }
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 2326 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().

2326  {
2327 
2329  if (m_l1GtMenuLiteValid) {
2331 
2332  } else if (m_retrieveL1EventSetup) {
2334 
2335  } else {
2336  // only L1GtTriggerMenuLite requested, but it is not valid
2337  return EmptyString;
2338 
2339  }
2340  } else if (m_retrieveL1EventSetup) {
2342 
2343  } else {
2344  // L1 trigger configuration not retrieved
2345  return EmptyString;
2346 
2347  }
2348 
2349 }
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 798 of file L1GtUtils.cc.

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

800  {
801 
802  aliasL1Trigger.clear();
803  nameL1Trigger.clear();
804 
806  if (m_l1GtMenuLiteValid) {
807 
808  // for an algorithm trigger
809  if (trigCategory == AlgorithmTrigger) {
810 
811  bool trigAliasFound = false;
812  bool trigNameFound = false;
813 
814  for (L1GtTriggerMenuLite::CItL1Trig itTrig =
815  m_algorithmAliasMapLite->begin();
816  itTrig != m_algorithmAliasMapLite->end(); itTrig++) {
817 
818  if (static_cast<int>(itTrig->first) == bitNumber) {
819  aliasL1Trigger = itTrig->second;
820  trigAliasFound = true;
821  break;
822  }
823  }
824 
825  for (L1GtTriggerMenuLite::CItL1Trig itTrig =
826  m_algorithmMapLite->begin();
827  itTrig != m_algorithmMapLite->end(); itTrig++) {
828 
829  if (static_cast<int>(itTrig->first) == bitNumber) {
830  nameL1Trigger = itTrig->second;
831  trigNameFound = true;
832  break;
833  }
834  }
835 
836  if (!(trigAliasFound && trigNameFound)) {
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 (L1GtTriggerMenuLite::CItL1Trig itTrig =
849  m_technicalTriggerMapLite->begin();
850  itTrig != m_technicalTriggerMapLite->end(); itTrig++) {
851 
852  if (static_cast<int>(itTrig->first) == bitNumber) {
853  nameL1Trigger = itTrig->second;
854 
855  // technically, no alias is defined for technical triggers
856  // users use mainly aliases, so just return the name here
857  aliasL1Trigger = itTrig->second;
858 
859  trigNameFound = true;
860  break;
861  }
862  }
863 
864  if (!(trigNameFound)) {
865  return false;
866  }
867 
868  return true;
869 
870  } else {
871 
872  // non-existing trigger category...
873  return false;
874  }
875 
876  } else if (m_retrieveL1EventSetup) {
877 
878  // for an algorithm trigger
879  if (trigCategory == AlgorithmTrigger) {
880 
881  bool trigAliasFound = false;
882 
883  for (CItAlgo itTrig = m_algorithmAliasMap->begin();
884  itTrig != m_algorithmAliasMap->end(); itTrig++) {
885 
886  if ((itTrig->second).algoBitNumber() == bitNumber) {
887  aliasL1Trigger = itTrig->first;
888  // get the name here, avoiding a loop on m_algorithmMap
889  nameL1Trigger = (itTrig->second).algoName();
890 
891  trigAliasFound = true;
892  break;
893  }
894  }
895 
896  if (!(trigAliasFound)) {
897  return false;
898  }
899 
900  return true;
901 
902  } else if (trigCategory == TechnicalTrigger) {
903 
904  // for a technical trigger
905 
906  bool trigNameFound = false;
907 
908  for (CItAlgo itTrig = m_technicalTriggerMap->begin();
909  itTrig != m_technicalTriggerMap->end(); itTrig++) {
910 
911  if ((itTrig->second).algoBitNumber() == bitNumber) {
912  nameL1Trigger = (itTrig->second).algoName();
913  // technically, no alias is defined for technical triggers
914  // users use mainly aliases, so just return the name here
915  aliasL1Trigger = nameL1Trigger;
916 
917  trigNameFound = true;
918  break;
919  }
920  }
921 
922  if (!(trigNameFound)) {
923  return false;
924  }
925 
926  return true;
927 
928  } else {
929 
930  // non-existing trigger category...
931  return false;
932  }
933 
934  } else {
935  // only L1GtTriggerMenuLite requested, but it is not valid
936  return false;
937 
938  }
939  } else if (m_retrieveL1EventSetup) {
940 
941  // for an algorithm trigger
942  if (trigCategory == AlgorithmTrigger) {
943 
944  bool trigAliasFound = false;
945 
946  for (CItAlgo itTrig = m_algorithmAliasMap->begin();
947  itTrig != m_algorithmAliasMap->end(); itTrig++) {
948 
949  if ((itTrig->second).algoBitNumber() == bitNumber) {
950  aliasL1Trigger = itTrig->first;
951  // get the name here, avoiding a loop on m_algorithmMap
952  nameL1Trigger = (itTrig->second).algoName();
953 
954  trigAliasFound = true;
955  break;
956  }
957  }
958 
959  if (!(trigAliasFound)) {
960  return false;
961  }
962 
963  return true;
964 
965  } else if (trigCategory == TechnicalTrigger) {
966 
967  // for a technical trigger
968 
969  bool trigNameFound = false;
970 
971  for (CItAlgo itTrig = m_technicalTriggerMap->begin();
972  itTrig != m_technicalTriggerMap->end(); itTrig++) {
973 
974  if ((itTrig->second).algoBitNumber() == bitNumber) {
975  nameL1Trigger = (itTrig->second).algoName();
976  // technically, no alias is defined for technical triggers
977  // users use mainly aliases, so just return the name here
978  aliasL1Trigger = itTrig->first;
979 
980  trigNameFound = true;
981  break;
982  }
983  }
984 
985  if (!(trigNameFound)) {
986  return false;
987  }
988 
989  return true;
990 
991  } else {
992 
993  // non-existing trigger category...
994  return false;
995  }
996 
997  } else {
998  // L1 trigger configuration not retrieved
999  return false;
1000 
1001  }
1002 
1003  // all possibilities already tested, so it should not arrive here
1004  return false;
1005 
1006 }
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 1608 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().

1611  {
1612 
1613  // initial values
1614  bool decisionBeforeMask = false;
1615  bool decisionAfterMask = false;
1616  int prescaleFactor = -1;
1617  int triggerMask = -1;
1618 
1619  errorCode = l1Results(iEvent, l1GtRecordInputTag,
1620  l1GtReadoutRecordInputTag, nameAlgoTechTrig, decisionBeforeMask,
1621  decisionAfterMask, prescaleFactor, triggerMask);
1622 
1623  return prescaleFactor;
1624 
1625 }
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:1534
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:1008
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:1497
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:1643
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:1608
const int L1GtUtils::prescaleFactor ( const edm::Event iEvent,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

Definition at line 1627 of file L1GtUtils.cc.

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

1628  {
1629 
1630  // initial values
1631  bool decisionBeforeMask = false;
1632  bool decisionAfterMask = false;
1633  int prescaleFactor = -1;
1634  int triggerMask = -1;
1635 
1636  errorCode = l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1637  decisionAfterMask, prescaleFactor, triggerMask);
1638 
1639  return prescaleFactor;
1640 
1641 }
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:1534
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:1008
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:1497
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:1643
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:1608
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 2107 of file L1GtUtils.cc.

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

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

2110  {
2111 
2112  // clear the vector before filling it
2113  m_prescaleFactorSet.clear();
2114 
2115  // initialize error code
2116  int iError = 0;
2117 
2118  const int pfIndex = prescaleFactorSetIndex(iEvent, l1GtRecordInputTag,
2119  l1GtReadoutRecordInputTag, trigCategory, iError);
2120 
2121  if (iError == 0) {
2122 
2123  switch (trigCategory) {
2124  case AlgorithmTrigger: {
2126  if (m_l1GtMenuLiteValid) {
2128  = (*m_prescaleFactorsAlgoTrigLite).at(pfIndex);
2129 
2130  } else {
2131  // fall through: L1 trigger configuration from event setup
2132  m_prescaleFactorSet = (*m_prescaleFactorsAlgoTrig).at(
2133  pfIndex);
2134 
2135  }
2136 
2137  } else {
2138  // L1 trigger configuration from event setup only
2139  m_prescaleFactorSet = (*m_prescaleFactorsAlgoTrig).at(
2140  pfIndex);
2141 
2142  }
2143 
2144  }
2145  break;
2146  case TechnicalTrigger: {
2148  if (m_l1GtMenuLiteValid) {
2150  = (*m_prescaleFactorsTechTrigLite).at(pfIndex);
2151 
2152  } else {
2153  // fall through: L1 trigger configuration from event setup
2154  m_prescaleFactorSet = (*m_prescaleFactorsTechTrig).at(
2155  pfIndex);
2156 
2157  }
2158 
2159  } else {
2160  // L1 trigger configuration from event setup only
2161  m_prescaleFactorSet = (*m_prescaleFactorsTechTrig).at(
2162  pfIndex);
2163 
2164  }
2165 
2166  }
2167  break;
2168  default: {
2169  // do nothing - it was tested before, with return
2170 
2171  }
2172  break;
2173  }
2174 
2175  }
2176 
2177  errorCode = iError;
2178  return m_prescaleFactorSet;
2179 
2180 }
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:1883
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 2182 of file L1GtUtils.cc.

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

2183  {
2184 
2185  // clear the vector before filling it
2186  m_prescaleFactorSet.clear();
2187 
2188  // initialize error code
2189  int iError = 0;
2190 
2192  m_provL1GtReadoutRecordInputTag, trigCategory, iError);
2193 
2194  errorCode = iError;
2195  return m_prescaleFactorSet;
2196 
2197 }
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:2107
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 1883 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().

1886  {
1887 
1888  // initialize the index to a negative value
1889  int pfIndex = -1;
1890 
1891  // initialize error code and L1 configuration code
1892  int iError = 0;
1893  int l1ConfCode = 0;
1894 
1895  // check if L1 configuration is available
1896 
1897  if (!availableL1Configuration(iError, l1ConfCode)) {
1898  errorCode = iError;
1899  return pfIndex;
1900  }
1901 
1902  // at this point, a valid L1 configuration is available, so the if/else if/else
1903  // can be simplified
1904 
1905  // retrieve L1GlobalTriggerRecord and 1GlobalTriggerReadoutRecord product
1906  // intermediate error code for the records
1907  // the module returns an error code only if both the lite and the readout record are missing
1908 
1909  int iErrorRecord = 0;
1910 
1911  bool validRecord = false;
1912  bool gtReadoutRecordValid = false;
1913 
1915  iEvent.getByLabel(l1GtRecordInputTag, gtRecord);
1916 
1917  if (gtRecord.isValid()) {
1918 
1919  validRecord = true;
1920 
1921  } else {
1922 
1923  iErrorRecord = 10;
1924  LogDebug("L1GtUtils") << "\nL1GlobalTriggerRecord with \n "
1925  << l1GtRecordInputTag << "\nnot found in the event."
1926  << std::endl;
1927  }
1928 
1930  iEvent.getByLabel(l1GtReadoutRecordInputTag, gtReadoutRecord);
1931 
1932  if (gtReadoutRecord.isValid()) {
1933 
1934  gtReadoutRecordValid = true;
1935  validRecord = true;
1936 
1937  } else {
1938 
1939  iErrorRecord = iErrorRecord + 100;
1940  LogDebug("L1GtUtils") << "\nL1GlobalTriggerReadoutRecord with \n "
1941  << l1GtReadoutRecordInputTag << "\nnot found in the event."
1942  << std::endl;
1943 
1944  }
1945 
1946  // get the prescale factor index from
1947  // L1GlobalTriggerReadoutRecord if valid
1948  // if not, from L1GlobalTriggerRecord if valid
1949  // else return an error
1950 
1951 
1952  int pfIndexTechTrig = -1;
1953  int pfIndexAlgoTrig = -1;
1954 
1955  if (validRecord) {
1956  if (gtReadoutRecordValid) {
1957 
1958  pfIndexTechTrig
1959  = (gtReadoutRecord->gtFdlWord()).gtPrescaleFactorIndexTech();
1960  pfIndexAlgoTrig
1961  = (gtReadoutRecord->gtFdlWord()).gtPrescaleFactorIndexAlgo();
1962 
1963  } else {
1964 
1965  pfIndexTechTrig
1966  = static_cast<int> (gtRecord->gtPrescaleFactorIndexTech());
1967  pfIndexAlgoTrig
1968  = static_cast<int> (gtRecord->gtPrescaleFactorIndexAlgo());
1969 
1970  }
1971 
1972  } else {
1973 
1974  LogDebug("L1GtUtils") << "\nError: "
1975  << "\nNo valid L1GlobalTriggerRecord with \n "
1976  << l1GtRecordInputTag << "\nfound in the event."
1977  << "\nNo valid L1GlobalTriggerReadoutRecord with \n "
1978  << l1GtReadoutRecordInputTag << "\nfound in the event."
1979  << std::endl;
1980 
1981  iError = l1ConfCode + iErrorRecord;
1982 
1983  errorCode = iError;
1984  return pfIndex;
1985 
1986  }
1987 
1988  // depending on trigger category (algorithm trigger or technical trigger)
1989  // get the correct quantities
1990 
1991  // number of sets of prescale factors
1992  // index of prescale factor set retrieved from data
1993  // pointer to the actual prescale factor set
1994  // pointer to the set of trigger masks
1995 
1996  size_t pfSetsSize = 0;
1997 
1998  switch (trigCategory) {
1999  case AlgorithmTrigger: {
2001  if (m_l1GtMenuLiteValid) {
2002  pfSetsSize = m_prescaleFactorsAlgoTrigLite->size();
2003 
2004  } else {
2005  // fall through: L1 trigger configuration from event setup
2006  pfSetsSize = m_prescaleFactorsAlgoTrig->size();
2007 
2008  }
2009 
2010  } else {
2011  // L1 trigger configuration from event setup only
2012  pfSetsSize = m_prescaleFactorsAlgoTrig->size();
2013 
2014  }
2015 
2016  pfIndex = pfIndexAlgoTrig;
2017 
2018  }
2019  break;
2020  case TechnicalTrigger: {
2022  if (m_l1GtMenuLiteValid) {
2023  pfSetsSize = m_prescaleFactorsTechTrigLite->size();
2024 
2025  } else {
2026  // fall through: L1 trigger configuration from event setup
2027  pfSetsSize = m_prescaleFactorsTechTrig->size();
2028 
2029  }
2030 
2031  } else {
2032  // L1 trigger configuration from event setup only
2033  pfSetsSize = m_prescaleFactorsTechTrig->size();
2034 
2035  }
2036 
2037  pfIndex = pfIndexTechTrig;
2038 
2039  }
2040  break;
2041  default: {
2042  // should not be the case
2043  iError = l1ConfCode + iErrorRecord + 3;
2044  return iError;
2045 
2046  }
2047  break;
2048  }
2049 
2050 
2051  // test prescale factor set index correctness, then retrieve the actual set of prescale factors
2052 
2053  if (pfIndex < 0) {
2054 
2055  iError = l1ConfCode + iErrorRecord + 1000;
2056  LogDebug("L1GtUtils")
2057  << "\nError: index of prescale factor set retrieved from the data \n"
2058  << "less than zero."
2059  << "\n Value of index retrieved from data = " << pfIndex
2060  << std::endl;
2061 
2062  errorCode = iError;
2063  return pfIndex;
2064 
2065  } else if (pfIndex >= (static_cast<int>(pfSetsSize))) {
2066  iError = l1ConfCode + iErrorRecord + 2000;
2067  LogDebug("L1GtUtils")
2068  << "\nError: index of prescale factor set retrieved from the data \n"
2069  << "greater than the size of the vector of prescale factor sets."
2070  << "\n Value of index retrieved from data = " << pfIndex
2071  << "\n Vector size = " << pfSetsSize << std::endl;
2072 
2073  errorCode = iError;
2074  return pfIndex;
2075 
2076  } else {
2077 
2078  errorCode = iError;
2079  return pfIndex;
2080  }
2081 
2082  errorCode = iError;
2083  return pfIndex;
2084 
2085 }
#define LogDebug(id)
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:533
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:2416
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:75
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:405
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:507
const int L1GtUtils::prescaleFactorSetIndex ( const edm::Event iEvent,
const TriggerCategory trigCategory,
int &  errorCode 
) const

Definition at line 2088 of file L1GtUtils.cc.

References m_provL1GtReadoutRecordInputTag, m_provL1GtRecordInputTag, and prescaleFactorSetIndex().

2089  {
2090 
2091  // initialize error code and return value
2092  int iError = 0;
2093  int pfIndex = -1;
2094 
2096  m_provL1GtReadoutRecordInputTag, trigCategory, iError);
2097 
2098  // return the error code and the index value
2099  // if the error code is 0, the index returned is -1
2100  errorCode = iError;
2101  return pfIndex;
2102 
2103 }
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:1883
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 2379 of file L1GtUtils.cc.

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

2379  {
2380 
2381  // initialize error code and return value
2382  int iError = 0;
2383  int l1ConfCode = 0;
2384 
2385  // check if L1 configuration is available
2386 
2387  if (!availableL1Configuration(iError, l1ConfCode)) {
2388  errorCode = iError;
2389  return 0;
2390  }
2391 
2393  if (m_l1GtMenuLiteValid) {
2394 
2395  errorCode = iError;
2396  return m_l1GtMenuLite;
2397 
2398  } else {
2399  iError = l1ConfCode;
2400 
2401  errorCode = iError;
2402  return 0;
2403  }
2404  } else {
2405  iError = l1ConfCode;
2406 
2407  errorCode = iError;
2408  return 0;
2409  }
2410 
2411  errorCode = iError;
2412  return m_l1GtMenuLite;
2413 
2414 }
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:533
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:2416
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 2351 of file L1GtUtils.cc.

References availableL1Configuration(), m_l1GtMenu, and m_retrieveL1EventSetup.

Referenced by IsolatedTracksNxN::analyze().

2351  {
2352 
2353  // initialize error code and return value
2354  int iError = 0;
2355  int l1ConfCode = 0;
2356 
2357  // check if L1 configuration is available
2358 
2359  if (!availableL1Configuration(iError, l1ConfCode)) {
2360  errorCode = iError;
2361  return 0;
2362  }
2363 
2364  if (m_retrieveL1EventSetup) {
2365  errorCode = iError;
2366  return m_l1GtMenu;
2367  } else {
2368  iError = l1ConfCode;
2369 
2370  errorCode = iError;
2371  return 0;
2372 
2373  }
2374 
2375  errorCode = iError;
2376  return m_l1GtMenu;
2377 }
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:2416
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 112 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().

112  {
113 
114  //
115  m_retrieveL1EventSetup = true;
116 
117  m_l1EventSetupValid = true;
118  // FIXME test for each record if valid; if not set m_l1EventSetupValid = false;
119 
120  // get / update the stable parameters from the EventSetup
121  // local cache & check on cacheIdentifier
122 
123  unsigned long long l1GtStableParCacheID =
124  evSetup.get<L1GtStableParametersRcd>().cacheIdentifier();
125 
126  if (m_l1GtStableParCacheID != l1GtStableParCacheID) {
127 
129  evSetup.get<L1GtStableParametersRcd>().get(l1GtStablePar);
130  m_l1GtStablePar = l1GtStablePar.product();
131 
132  // number of algorithm triggers
134 
135  // number of technical triggers
138 
139  int maxNumberTrigger = std::max(m_numberAlgorithmTriggers,
141 
142  m_triggerMaskSet.reserve(maxNumberTrigger);
143  m_prescaleFactorSet.reserve(maxNumberTrigger);
144 
145  //
146  m_l1GtStableParCacheID = l1GtStableParCacheID;
147 
148  }
149 
150  // get / update the prescale factors from the EventSetup
151  // local cache & check on cacheIdentifier
152 
153  unsigned long long l1GtPfAlgoCacheID =
154  evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().cacheIdentifier();
155 
156  if (m_l1GtPfAlgoCacheID != l1GtPfAlgoCacheID) {
157 
159  evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
160  m_l1GtPfAlgo = l1GtPfAlgo.product();
161 
163 
164  m_l1GtPfAlgoCacheID = l1GtPfAlgoCacheID;
165 
166  }
167 
168  unsigned long long l1GtPfTechCacheID = evSetup.get<
169  L1GtPrescaleFactorsTechTrigRcd>().cacheIdentifier();
170 
171  if (m_l1GtPfTechCacheID != l1GtPfTechCacheID) {
172 
174  evSetup.get<L1GtPrescaleFactorsTechTrigRcd>().get(l1GtPfTech);
175  m_l1GtPfTech = l1GtPfTech.product();
176 
178 
179  m_l1GtPfTechCacheID = l1GtPfTechCacheID;
180 
181  }
182 
183  // get / update the trigger mask from the EventSetup
184  // local cache & check on cacheIdentifier
185 
186  unsigned long long l1GtTmAlgoCacheID =
187  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().cacheIdentifier();
188 
189  if (m_l1GtTmAlgoCacheID != l1GtTmAlgoCacheID) {
190 
192  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().get(l1GtTmAlgo);
193  m_l1GtTmAlgo = l1GtTmAlgo.product();
194 
196 
197  m_l1GtTmAlgoCacheID = l1GtTmAlgoCacheID;
198 
199  }
200 
201  unsigned long long l1GtTmTechCacheID =
202  evSetup.get<L1GtTriggerMaskTechTrigRcd>().cacheIdentifier();
203 
204  if (m_l1GtTmTechCacheID != l1GtTmTechCacheID) {
205 
207  evSetup.get<L1GtTriggerMaskTechTrigRcd>().get(l1GtTmTech);
208  m_l1GtTmTech = l1GtTmTech.product();
209 
211 
212  m_l1GtTmTechCacheID = l1GtTmTechCacheID;
213 
214  }
215 
216  unsigned long long l1GtTmVetoAlgoCacheID =
217  evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().cacheIdentifier();
218 
219  if (m_l1GtTmVetoAlgoCacheID != l1GtTmVetoAlgoCacheID) {
220 
221  edm::ESHandle<L1GtTriggerMask> l1GtTmVetoAlgo;
222  evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().get(l1GtTmVetoAlgo);
223  m_l1GtTmVetoAlgo = l1GtTmVetoAlgo.product();
224 
226 
227  m_l1GtTmVetoAlgoCacheID = l1GtTmVetoAlgoCacheID;
228 
229  }
230 
231  unsigned long long l1GtTmVetoTechCacheID =
232  evSetup.get<L1GtTriggerMaskVetoTechTrigRcd>().cacheIdentifier();
233 
234  if (m_l1GtTmVetoTechCacheID != l1GtTmVetoTechCacheID) {
235 
236  edm::ESHandle<L1GtTriggerMask> l1GtTmVetoTech;
237  evSetup.get<L1GtTriggerMaskVetoTechTrigRcd>().get(l1GtTmVetoTech);
238  m_l1GtTmVetoTech = l1GtTmVetoTech.product();
239 
241 
242  m_l1GtTmVetoTechCacheID = l1GtTmVetoTechCacheID;
243 
244  }
245 
246  // get / update the trigger menu from the EventSetup
247  // local cache & check on cacheIdentifier
248 
249  unsigned long long l1GtMenuCacheID =
250  evSetup.get<L1GtTriggerMenuRcd>().cacheIdentifier();
251 
252  if (m_l1GtMenuCacheID != l1GtMenuCacheID) {
253 
255  evSetup.get<L1GtTriggerMenuRcd>().get(l1GtMenu);
256  m_l1GtMenu = l1GtMenu.product();
257 
260 
262 
263  m_l1GtMenuCacheID = l1GtMenuCacheID;
264 
265  }
266 
267 }
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:86
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 270 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().

271  {
272 
273  //
275 
276  // get L1GtTriggerMenuLite
278  iRun.getByLabel(l1GtMenuLiteInputTag, l1GtMenuLite);
279 
280  if (!l1GtMenuLite.isValid()) {
281 
282  LogDebug("L1GtUtils") << "\nL1GtTriggerMenuLite with \n "
283  << l1GtMenuLiteInputTag
284  << "\nrequested in configuration, but not found in the event."
285  << std::endl;
286 
287  m_l1GtMenuLiteValid = false;
288  } else {
289  m_l1GtMenuLite = l1GtMenuLite.product();
290  m_l1GtMenuLiteValid = true;
291 
292  LogDebug("L1GtUtils") << "\nL1GtTriggerMenuLite with \n "
293  << l1GtMenuLiteInputTag << "\nretrieved for run "
294  << iRun.runAuxiliary().run() << std::endl;
295 
299 
302 
307 
308  }
309 
310 }
#define LogDebug(id)
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:533
bool getByLabel(std::string const &label, Handle< PROD > &result) const
Definition: Run.h:214
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:75
const L1GtTriggerMenuLite * m_l1GtMenuLite
L1GtTriggerMenuLite cached stuff.
Definition: L1GtUtils.h:495
T const * product() const
Definition: Handle.h:81
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
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 91 of file L1GtUtils.cc.

References AlgorithmTrigger, EmptyString, and TechnicalTrigger.

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

92  {
93 
94  switch (trigCategory) {
95  case AlgorithmTrigger: {
96  return "Algorithm Trigger";
97  }
98  break;
99  case TechnicalTrigger: {
100  return "Technical Trigger";
101  }
102 
103  break;
104  default: {
105  return EmptyString;
106  }
107  break;
108  }
109 }
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 1643 of file L1GtUtils.cc.

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

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

1646  {
1647 
1648  // initial values
1649  bool decisionBeforeMask = false;
1650  bool decisionAfterMask = false;
1651  int prescaleFactor = -1;
1652  int triggerMask = -1;
1653 
1654  errorCode = l1Results(iEvent, l1GtRecordInputTag,
1655  l1GtReadoutRecordInputTag, nameAlgoTechTrig, decisionBeforeMask,
1656  decisionAfterMask, prescaleFactor, triggerMask);
1657 
1658  return triggerMask;
1659 
1660 }
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:1534
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:1008
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:1497
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:1643
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:1608
const int L1GtUtils::triggerMask ( const edm::Event iEvent,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

Definition at line 1662 of file L1GtUtils.cc.

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

1663  {
1664 
1665  // initial values
1666  bool decisionBeforeMask = false;
1667  bool decisionAfterMask = false;
1668  int prescaleFactor = -1;
1669  int triggerMask = -1;
1670 
1671  errorCode = l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1672  decisionAfterMask, prescaleFactor, triggerMask);
1673 
1674  return triggerMask;
1675 
1676 }
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:1534
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:1008
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:1497
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:1643
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:1608
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 1678 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().

1679  {
1680 
1681  // initial values for returned results
1682  int triggerMaskValue = -1;
1683 
1684  // initialize error code and L1 configuration code
1685  int iError = 0;
1686  int l1ConfCode = 0;
1687 
1688  // check if L1 configuration is available
1689 
1690  if (!availableL1Configuration(iError, l1ConfCode)) {
1691  errorCode = iError;
1692  return triggerMaskValue;
1693  }
1694 
1695  // at this point, a valid L1 configuration is available, so the if/else if/else
1696  // can be simplified
1697 
1698  // if the given name is not an algorithm trigger alias, an algorithm trigger name
1699  // or a technical trigger in the current menu, return with error code 1
1700 
1701  TriggerCategory trigCategory = AlgorithmTrigger;
1702  int bitNumber = -1;
1703 
1704  if (!l1AlgoTechTrigBitNumber(nameAlgoTechTrig, trigCategory, bitNumber)) {
1705 
1706  iError = l1ConfCode + 1;
1707 
1709  if (m_l1GtMenuLiteValid) {
1710 
1711  LogDebug("L1GtUtils") << "\nAlgorithm/technical trigger \n "
1712  << nameAlgoTechTrig
1713  << "\not found in the trigger menu \n "
1715  << "\nretrieved from L1GtTriggerMenuLite" << std::endl;
1716 
1717  } else {
1718 
1719  // fall through: L1 trigger configuration from event setup
1720  LogDebug("L1GtUtils") << "\nAlgorithm/technical trigger \n "
1721  << nameAlgoTechTrig
1722  << "\not found in the trigger menu \n "
1724  << "\nretrieved from Event Setup" << std::endl;
1725 
1726  }
1727 
1728  } else {
1729  // L1 trigger configuration from event setup only
1730  LogDebug("L1GtUtils") << "\nAlgorithm/technical trigger \n "
1731  << nameAlgoTechTrig
1732  << "\not found in the trigger menu \n "
1734  << "\nretrieved from Event Setup" << std::endl;
1735 
1736  }
1737 
1738  errorCode = iError;
1739  return triggerMaskValue;
1740 
1741  }
1742 
1743  // check here if a positive bit number was retrieved
1744  // exit in case of negative bit number, before retrieving L1 GT products, saving time
1745 
1746  if (bitNumber < 0) {
1747 
1748  iError = l1ConfCode + 2;
1749 
1751  if (m_l1GtMenuLiteValid) {
1752  LogDebug("L1GtUtils") << "\nNegative bit number for "
1753  << triggerCategory(trigCategory) << "\n "
1754  << nameAlgoTechTrig << "\nfrom menu \n "
1756  << "\nretrieved from L1GtTriggerMenuLite" << std::endl;
1757 
1758  } else {
1759  // fall through: L1 trigger configuration from event setup
1760  LogDebug("L1GtUtils") << "\nNegative bit number for "
1761  << triggerCategory(trigCategory) << "\n "
1762  << nameAlgoTechTrig << "\nfrom menu \n "
1764  << "\nretrieved from Event Setup" << std::endl;
1765 
1766  }
1767 
1768  } else {
1769  // L1 trigger configuration from event setup only
1770  LogDebug("L1GtUtils") << "\nNegative bit number for "
1771  << triggerCategory(trigCategory) << "\n "
1772  << nameAlgoTechTrig << "\nfrom menu \n "
1774  << "\nretrieved from Event Setup" << std::endl;
1775 
1776  }
1777 
1778  errorCode = iError;
1779  return triggerMaskValue;
1780  }
1781 
1782  // depending on trigger category (algorithm trigger or technical trigger)
1783  // get the correct quantities
1784 
1785  // pointer to the set of trigger masks
1786 
1787  const std::vector<unsigned int>* triggerMasksSet = 0;
1788 
1789  switch (trigCategory) {
1790  case AlgorithmTrigger: {
1792  if (m_l1GtMenuLiteValid) {
1793  triggerMasksSet = m_triggerMaskAlgoTrigLite;
1794 
1795  } else {
1796  // fall through: L1 trigger configuration from event setup
1797  triggerMasksSet = m_triggerMaskAlgoTrig;
1798 
1799  }
1800 
1801  } else {
1802  // L1 trigger configuration from event setup only
1803  triggerMasksSet = m_triggerMaskAlgoTrig;
1804 
1805  }
1806 
1807  }
1808  break;
1809  case TechnicalTrigger: {
1811  if (m_l1GtMenuLiteValid) {
1812  triggerMasksSet = m_triggerMaskTechTrigLite;
1813 
1814  } else {
1815  // fall through: L1 trigger configuration from event setup
1816  triggerMasksSet = m_triggerMaskTechTrig;
1817 
1818  }
1819 
1820  } else {
1821  // L1 trigger configuration from event setup only
1822  triggerMasksSet = m_triggerMaskTechTrig;
1823 
1824  }
1825 
1826  }
1827  break;
1828  default: {
1829  // should not be the case
1830  iError = l1ConfCode + 3;
1831 
1832  errorCode = iError;
1833  return triggerMaskValue;
1834 
1835  }
1836  break;
1837  }
1838 
1839  // trigger mask
1840 
1841  if (bitNumber < (static_cast<int> ((*triggerMasksSet).size()))) {
1842 
1844  if (m_l1GtMenuLiteValid) {
1845  triggerMaskValue = (*triggerMasksSet)[bitNumber];
1846 
1847  } else {
1848  // fall through: L1 trigger configuration from event setup
1849  // masks in event setup are for all partitions
1850  triggerMaskValue = ((*triggerMasksSet)[bitNumber]) & (1
1852 
1853  }
1854 
1855  } else {
1856  // L1 trigger configuration from event setup only
1857  // masks in event setup are for all partitions
1858  triggerMaskValue = ((*triggerMasksSet)[bitNumber]) & (1
1860 
1861  }
1862 
1863  } else {
1864  iError = l1ConfCode + 5000;
1865  LogDebug("L1GtUtils") << "\nError: bit number " << bitNumber
1866  << " retrieved for " << triggerCategory(trigCategory) << "\n "
1867  << nameAlgoTechTrig
1868  << "\ngreater than size of L1 GT trigger mask set: "
1869  << (*triggerMasksSet).size()
1870  << "\nError: Inconsistent L1 trigger configuration!"
1871  << std::endl;
1872 
1873  errorCode = iError;
1874  return triggerMaskValue;
1875 
1876  }
1877 
1878  errorCode = iError;
1879  return triggerMaskValue;
1880 
1881 }
#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:671
TriggerCategory
Definition: L1GtUtils.h:58
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:2416
const std::string & gtTriggerMenuImplementation() const
const std::string triggerCategory(const TriggerCategory &) const
public methods
Definition: L1GtUtils.cc:91
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 2202 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().

2203  {
2204 
2205  // clear the vector before filling it
2206  m_triggerMaskSet.clear();
2207 
2208  // initialize error code and L1 configuration code
2209  int iError = 0;
2210  int l1ConfCode = 0;
2211 
2212  // check if L1 configuration is available
2213 
2214  if (!availableL1Configuration(iError, l1ConfCode)) {
2215  errorCode = iError;
2216  return m_triggerMaskSet;
2217  }
2218 
2219  // at this point, a valid L1 configuration is available, so the if/else if/else
2220  // can be simplified
2221 
2222 
2223  // depending on trigger category (algorithm trigger or technical trigger)
2224  // get the correct quantities
2225 
2226  // pointer to the set of trigger masks
2227 
2228  switch (trigCategory) {
2229  case AlgorithmTrigger: {
2231  // L1GtTriggerMenuLite has masks for physics partition only
2232  // avoid copy to m_triggerMaskSet, return directly m_triggerMaskAlgoTrigLite
2233  if (m_l1GtMenuLiteValid) {
2234  errorCode = iError;
2235  return (*m_triggerMaskAlgoTrigLite);
2236 
2237  } else {
2238  // fall through: L1 trigger configuration from event setup
2239  for (unsigned i = 0; i < m_triggerMaskAlgoTrig->size(); i++) {
2240  m_triggerMaskSet.push_back(
2241  ((*m_triggerMaskAlgoTrig)[i]) & (1
2242  << m_physicsDaqPartition));
2243  }
2244 
2245  }
2246 
2247  } else {
2248  // L1 trigger configuration from event setup only
2249  for (unsigned i = 0; i < m_triggerMaskAlgoTrig->size(); i++) {
2250  m_triggerMaskSet.push_back(((*m_triggerMaskAlgoTrig)[i])
2251  & (1 << m_physicsDaqPartition));
2252  }
2253 
2254  }
2255  }
2256  break;
2257  case TechnicalTrigger: {
2259  if (m_l1GtMenuLiteValid) {
2260  errorCode = iError;
2261  return (*m_triggerMaskTechTrigLite);
2262 
2263  } else {
2264  // fall through: L1 trigger configuration from event setup
2265  for (unsigned i = 0; i < m_triggerMaskTechTrig->size(); i++) {
2266  m_triggerMaskSet.push_back(
2267  ((*m_triggerMaskTechTrig)[i]) & (1
2268  << m_physicsDaqPartition));
2269  }
2270 
2271  }
2272 
2273  } else {
2274  // L1 trigger configuration from event setup only
2275  for (unsigned i = 0; i < m_triggerMaskTechTrig->size(); i++) {
2276  m_triggerMaskSet.push_back(((*m_triggerMaskTechTrig)[i])
2277  & (1 << m_physicsDaqPartition));
2278  }
2279 
2280  }
2281  }
2282  break;
2283  default: {
2284  // should not be the case
2285  iError = l1ConfCode + 3;
2286 
2287  errorCode = iError;
2288  return m_triggerMaskSet;
2289 
2290  }
2291  break;
2292  }
2293 
2294  errorCode = iError;
2295  return m_triggerMaskSet;
2296 
2297 }
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:2416
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 2520 of file L1GtUtils.cc.

References LogDebug, and triggerCategory().

Referenced by l1Results().

2522  {
2523 
2524  bool trigRes = false;
2525  errorCode = 0;
2526 
2527  if (bitNumber < (static_cast<int> (decWord.size()))) {
2528  trigRes = decWord[bitNumber];
2529  } else {
2530  errorCode = 3000;
2531  LogDebug("L1GtUtils") << "\nError: bit number " << bitNumber
2532  << " retrieved for " << triggerCategory(trigCategory) << "\n "
2533  << nameAlgoTechTrig
2534  << "\ngreater than size of L1 GT decision word: "
2535  << decWord.size()
2536  << "\nError: Inconsistent L1 trigger configuration!"
2537  << std::endl;
2538  }
2539 
2540  return trigRes;
2541 }
#define LogDebug(id)
const std::string triggerCategory(const TriggerCategory &) const
public methods
Definition: L1GtUtils.cc:91

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