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

$Date$ $Revision$

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 48 of file L1GtUtils.h.

Member Enumeration Documentation

Enumerator
AlgorithmTrigger 
TechnicalTrigger 

Definition at line 60 of file L1GtUtils.h.

Constructor & Destructor Documentation

L1GtUtils::L1GtUtils ( )
explicit

constructor

Definition at line 50 of file L1GtUtils.cc.

50  :
51 
53 
55 
57 
59 
61 
62  m_l1GtMenuCacheID(0ULL),
63 
64  m_l1EventSetupValid(false),
65 
66  m_l1GtMenuLiteValid(false),
67 
68  m_beginRunCache(false),
69 
70  m_runIDCache(0),
71 
73 
75 
77 
79 
80  {
81 
82  // empty
83 }
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:535
edm::RunID m_runIDCache
run cache ID
Definition: L1GtUtils.h:521
unsigned long long m_l1GtMenuCacheID
Definition: L1GtUtils.h:485
unsigned long long m_l1GtPfAlgoCacheID
Definition: L1GtUtils.h:456
unsigned long long m_l1GtTmVetoTechCacheID
Definition: L1GtUtils.h:475
edm::RunID m_provRunIDCache
Definition: L1GtUtils.h:522
unsigned long long m_l1GtTmTechCacheID
Definition: L1GtUtils.h:469
unsigned long long m_l1GtTmAlgoCacheID
Definition: L1GtUtils.h:466
unsigned int m_numberTechnicalTriggers
number of technical triggers
Definition: L1GtUtils.h:452
bool m_retrieveL1EventSetup
flags to check which method was used to retrieve L1 trigger configuration
Definition: L1GtUtils.h:534
unsigned int m_physicsDaqPartition
index of physics DAQ partition
Definition: L1GtUtils.h:528
unsigned int m_numberAlgorithmTriggers
number of algorithm triggers
Definition: L1GtUtils.h:449
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:509
bool m_beginRunCache
flag for call of getL1GtRunCache in beginRun
Definition: L1GtUtils.h:512
unsigned long long m_l1GtPfTechCacheID
Definition: L1GtUtils.h:459
bool m_l1EventSetupValid
Definition: L1GtUtils.h:491
unsigned long long m_l1GtTmVetoAlgoCacheID
Definition: L1GtUtils.h:472
unsigned long long m_l1GtStableParCacheID
Definition: L1GtUtils.h:446
L1GtUtils::~L1GtUtils ( )
virtual

destructor

Definition at line 86 of file L1GtUtils.cc.

86  {
87 
88  // empty
89 
90 }

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

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

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

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

1453  {
1454 
1455  // initial values
1456  bool decisionBeforeMask = false;
1457  bool decisionAfterMask = false;
1458  int prescaleFactor = -1;
1459  int triggerMask = -1;
1460 
1461  errorCode = l1Results(iEvent, l1GtRecordInputTag,
1462  l1GtReadoutRecordInputTag, nameAlgoTechTrig, decisionBeforeMask,
1463  decisionAfterMask, prescaleFactor, triggerMask);
1464 
1465  return decisionAfterMask;
1466 
1467 }
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:1413
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:887
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:1376
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:1522
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:1487
const bool L1GtUtils::decision ( const edm::Event iEvent,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

Definition at line 1469 of file L1GtUtils.cc.

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

1470  {
1471 
1472  // initial values
1473  bool decisionBeforeMask = false;
1474  bool decisionAfterMask = false;
1475  int prescaleFactor = -1;
1476  int triggerMask = -1;
1477 
1478  errorCode = l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1479  decisionAfterMask, prescaleFactor, triggerMask);
1480 
1481  return decisionAfterMask;
1482 
1483 }
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:1413
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:887
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:1376
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:1522
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:1487
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 1413 of file L1GtUtils.cc.

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

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

1416  {
1417 
1418  // initial values
1419  bool decisionBeforeMask = false;
1420  bool decisionAfterMask = false;
1421  int prescaleFactor = -1;
1422  int triggerMask = -1;
1423 
1424  errorCode = l1Results(iEvent, l1GtRecordInputTag,
1425  l1GtReadoutRecordInputTag, nameAlgoTechTrig, decisionBeforeMask,
1426  decisionAfterMask, prescaleFactor, triggerMask);
1427 
1428  return decisionAfterMask;
1429 
1430 }
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:1413
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:887
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:1376
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:1522
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:1487
const bool L1GtUtils::decisionAfterMask ( const edm::Event iEvent,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

Definition at line 1432 of file L1GtUtils.cc.

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

1433  {
1434 
1435  // initial values
1436  bool decisionBeforeMask = false;
1437  bool decisionAfterMask = false;
1438  int prescaleFactor = -1;
1439  int triggerMask = -1;
1440 
1441  errorCode = l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1442  decisionAfterMask, prescaleFactor, triggerMask);
1443 
1444  return decisionAfterMask;
1445 
1446 }
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:1413
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:887
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:1376
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:1522
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:1487
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 1376 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().

1379  {
1380 
1381  // initial values
1382  bool decisionBeforeMask = false;
1383  bool decisionAfterMask = false;
1384  int prescaleFactor = -1;
1385  int triggerMask = -1;
1386 
1387  errorCode = l1Results(iEvent, l1GtRecordInputTag,
1388  l1GtReadoutRecordInputTag, nameAlgoTechTrig, decisionBeforeMask,
1389  decisionAfterMask, prescaleFactor, triggerMask);
1390 
1391  return decisionBeforeMask;
1392 
1393 }
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:1413
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:887
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:1376
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:1522
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:1487
const bool L1GtUtils::decisionBeforeMask ( const edm::Event iEvent,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

Definition at line 1395 of file L1GtUtils.cc.

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

1396  {
1397 
1398  // initial values
1399  bool decisionBeforeMask = false;
1400  bool decisionAfterMask = false;
1401  int prescaleFactor = -1;
1402  int triggerMask = -1;
1403 
1404  errorCode = l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1405  decisionAfterMask, prescaleFactor, triggerMask);
1406 
1407  return decisionBeforeMask;
1408 
1409 }
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:1413
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:887
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:1376
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:1522
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:1487
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 429 of file L1GtUtils.cc.

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

Referenced by getL1GtRunCache().

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

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

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

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

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

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

341  {
342 
345 
346  }
347 
350 
351 }
static const bool useL1GtTriggerMenuLite(false)
edm::InputTag m_provL1GtTriggerMenuLiteInputTag
Definition: L1GtUtils.h:518
void getL1GtTriggerMenuLiteInputTag(const edm::Run &iRun, edm::InputTag &l1GtTriggerMenuLiteInputTag) const
get the input tag for L1GtTriggerMenuLite
Definition: L1GtUtils.cc:496
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:313
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 355 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().

357  {
358 
359  // if there was no retrieval and caching in beginRun, do it here
360  if (!m_beginRunCache) {
361 
362  // if requested, retrieve and cache L1 event setup
363  // keep the caching based on cacheIdentifier() for each record
364  if (useL1EventSetup) {
365  retrieveL1EventSetup(evSetup);
366  }
367  }
368 
369  // cached per run
370 
371  const edm::Run& iRun = iEvent.getRun();
372  edm::RunID runID = iRun.runAuxiliary().id();
373 
374  if (runID != m_runIDCache) {
375 
376  if (!m_beginRunCache) {
377  // if requested, retrieve and cache the L1GtTriggerMenuLite
378  // L1GtTriggerMenuLite is defined per run and produced in prompt reco by L1Reco
379  // and put in the Run section
381  retrieveL1GtTriggerMenuLite(iRun, l1GtTmLInputTag);
382  }
383  }
384 
385  // find from provenance and cache the input tags for L1GlobalTriggerRecord and
386  // L1GlobalTriggerReadoutRecord
389 
390  //
391  m_runIDCache = runID;
392 
393  }
394 
395 }
edm::RunID m_runIDCache
run cache ID
Definition: L1GtUtils.h:521
static const bool useL1GtTriggerMenuLite(false)
edm::InputTag m_provL1GtReadoutRecordInputTag
Definition: L1GtUtils.h:517
void retrieveL1GtTriggerMenuLite(const edm::Run &, const edm::InputTag &)
retrieve L1GtTriggerMenuLite (per run product) and cache it to improve the speed
Definition: L1GtUtils.cc:271
Run const & getRun() const
Definition: Event.cc:45
RunID const & id() const
Definition: RunAuxiliary.h:37
void getL1GtRecordInputTag(const edm::Event &iEvent, edm::InputTag &l1GtRecordInputTag, edm::InputTag &l1GtReadoutRecordInputTag) const
Definition: L1GtUtils.cc:429
edm::InputTag m_provL1GtRecordInputTag
cached input tags from provenance - they are updated once per run only
Definition: L1GtUtils.h:516
void retrieveL1EventSetup(const edm::EventSetup &)
retrieve all the relevant L1 trigger event setup records and cache them to improve the speed ...
Definition: L1GtUtils.cc:113
static const bool useL1EventSetup(true)
RunAuxiliary const & runAuxiliary() const
Definition: Run.h:40
bool m_beginRunCache
flag for call of getL1GtRunCache in beginRun
Definition: L1GtUtils.h:512
Definition: Run.h:33
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 398 of file L1GtUtils.cc.

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

400  {
401 
402  // if the input tag for L1GtTriggerMenuLite was not found in beginRun, do it here
403  if (!m_beginRunCache) {
404 
405  const edm::Run& iRun = iEvent.getRun();
406  edm::RunID runID = iRun.runAuxiliary().id();
407 
408  if (runID != m_provRunIDCache) {
409 
411 
414  }
415 
416  //
417  m_provRunIDCache = runID;
418  }
419 
420  }
421 
422  // call now the general method for getL1GtRunCache
425 
426 }
static const bool useL1GtTriggerMenuLite(false)
edm::InputTag m_provL1GtTriggerMenuLiteInputTag
Definition: L1GtUtils.h:518
Run const & getRun() const
Definition: Event.cc:45
RunID const & id() const
Definition: RunAuxiliary.h:37
edm::RunID m_provRunIDCache
Definition: L1GtUtils.h:522
void getL1GtTriggerMenuLiteInputTag(const edm::Run &iRun, edm::InputTag &l1GtTriggerMenuLiteInputTag) const
get the input tag for L1GtTriggerMenuLite
Definition: L1GtUtils.cc:496
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:313
RunAuxiliary const & runAuxiliary() const
Definition: Run.h:40
bool m_beginRunCache
flag for call of getL1GtRunCache in beginRun
Definition: L1GtUtils.h:512
Definition: Run.h:33
void L1GtUtils::getL1GtTriggerMenuLiteInputTag ( const edm::Run iRun,
edm::InputTag l1GtTriggerMenuLiteInputTag 
) const

get the input tag for L1GtTriggerMenuLite

Definition at line 496 of file L1GtUtils.cc.

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

Referenced by getL1GtRunCache().

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

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

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

References l1Results(), m_provL1GtReadoutRecordInputTag, and m_provL1GtRecordInputTag.

1356  {
1357 
1358  // initial values for returned results
1359  decisionBeforeMask = false;
1360  decisionAfterMask = false;
1361  prescaleFactor = -1;
1362  triggerMask = -1;
1363 
1364  int l1ErrorCode = 0;
1365 
1366  l1ErrorCode = l1Results(iEvent, m_provL1GtRecordInputTag,
1369 
1370  return l1ErrorCode;
1371 
1372 }
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:1413
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:887
edm::InputTag m_provL1GtReadoutRecordInputTag
Definition: L1GtUtils.h:517
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:1376
edm::InputTag m_provL1GtRecordInputTag
cached input tags from provenance - they are updated once per run only
Definition: L1GtUtils.h:516
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:1522
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:1487
const std::string & L1GtUtils::l1TriggerMenu ( ) const

return the L1 trigger menu name

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

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

return the L1 trigger menu implementation

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

2205  {
2206 
2208  if (m_l1GtMenuLiteValid) {
2210 
2211  } else if (m_retrieveL1EventSetup) {
2213 
2214  } else {
2215  // only L1GtTriggerMenuLite requested, but it is not valid
2216  return EmptyString;
2217 
2218  }
2219  } else if (m_retrieveL1EventSetup) {
2221 
2222  } else {
2223  // L1 trigger configuration not retrieved
2224  return EmptyString;
2225 
2226  }
2227 
2228 }
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:535
const std::string & gtTriggerMenuImplementation() const
static const std::string EmptyString
Definition: L1GtUtils.h:430
bool m_retrieveL1EventSetup
flags to check which method was used to retrieve L1 trigger configuration
Definition: L1GtUtils.h:534
const L1GtTriggerMenuLite * m_l1GtMenuLite
L1GtTriggerMenuLite cached stuff.
Definition: L1GtUtils.h:497
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:509
const L1GtTriggerMenu * m_l1GtMenu
Definition: L1GtUtils.h:484
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 677 of file L1GtUtils.cc.

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

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

1490  {
1491 
1492  // initial values
1493  bool decisionBeforeMask = false;
1494  bool decisionAfterMask = false;
1495  int prescaleFactor = -1;
1496  int triggerMask = -1;
1497 
1498  errorCode = l1Results(iEvent, l1GtRecordInputTag,
1499  l1GtReadoutRecordInputTag, nameAlgoTechTrig, decisionBeforeMask,
1500  decisionAfterMask, prescaleFactor, triggerMask);
1501 
1502  return prescaleFactor;
1503 
1504 }
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:1413
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:887
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:1376
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:1522
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:1487
const int L1GtUtils::prescaleFactor ( const edm::Event iEvent,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

Definition at line 1506 of file L1GtUtils.cc.

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

1507  {
1508 
1509  // initial values
1510  bool decisionBeforeMask = false;
1511  bool decisionAfterMask = false;
1512  int prescaleFactor = -1;
1513  int triggerMask = -1;
1514 
1515  errorCode = l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1516  decisionAfterMask, prescaleFactor, triggerMask);
1517 
1518  return prescaleFactor;
1519 
1520 }
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:1413
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:887
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:1376
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:1522
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:1487
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 1986 of file L1GtUtils.cc.

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

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

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

Definition at line 2061 of file L1GtUtils.cc.

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

2062  {
2063 
2064  // clear the vector before filling it
2065  m_prescaleFactorSet.clear();
2066 
2067  // initialize error code
2068  int iError = 0;
2069 
2071  m_provL1GtReadoutRecordInputTag, trigCategory, iError);
2072 
2073  errorCode = iError;
2074  return m_prescaleFactorSet;
2075 
2076 }
edm::InputTag m_provL1GtReadoutRecordInputTag
Definition: L1GtUtils.h:517
edm::InputTag m_provL1GtRecordInputTag
cached input tags from provenance - they are updated once per run only
Definition: L1GtUtils.h:516
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:1986
std::vector< int > m_prescaleFactorSet
Definition: L1GtUtils.h:531
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 1762 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().

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

Definition at line 1967 of file L1GtUtils.cc.

References m_provL1GtReadoutRecordInputTag, m_provL1GtRecordInputTag, and prescaleFactorSetIndex().

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

Definition at line 244 of file L1GtUtils.h.

References m_provL1GtReadoutRecordInputTag.

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

return the input tags found from provenance

Definition at line 240 of file L1GtUtils.h.

References m_provL1GtRecordInputTag.

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

Definition at line 248 of file L1GtUtils.h.

References m_provL1GtTriggerMenuLiteInputTag.

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

return a pointer to the L1GtTriggerMenuLite product

Definition at line 2258 of file L1GtUtils.cc.

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

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

return a pointer to the L1 trigger menu from event setup

Definition at line 2230 of file L1GtUtils.cc.

References availableL1Configuration(), m_l1GtMenu, and m_retrieveL1EventSetup.

Referenced by IsolatedTracksNxN::analyze().

2230  {
2231 
2232  // initialize error code and return value
2233  int iError = 0;
2234  int l1ConfCode = 0;
2235 
2236  // check if L1 configuration is available
2237 
2238  if (!availableL1Configuration(iError, l1ConfCode)) {
2239  errorCode = iError;
2240  return 0;
2241  }
2242 
2243  if (m_retrieveL1EventSetup) {
2244  errorCode = iError;
2245  return m_l1GtMenu;
2246  } else {
2247  iError = l1ConfCode;
2248 
2249  errorCode = iError;
2250  return 0;
2251 
2252  }
2253 
2254  errorCode = iError;
2255  return m_l1GtMenu;
2256 }
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:2295
bool m_retrieveL1EventSetup
flags to check which method was used to retrieve L1 trigger configuration
Definition: L1GtUtils.h:534
const L1GtTriggerMenu * m_l1GtMenu
Definition: L1GtUtils.h:484
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 113 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, max(), and edm::ESHandle< class >::product().

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

113  {
114 
115  //
116  m_retrieveL1EventSetup = true;
117 
118  m_l1EventSetupValid = true;
119  // FIXME test for each record if valid; if not set m_l1EventSetupValid = false;
120 
121  // get / update the stable parameters from the EventSetup
122  // local cache & check on cacheIdentifier
123 
124  unsigned long long l1GtStableParCacheID =
125  evSetup.get<L1GtStableParametersRcd>().cacheIdentifier();
126 
127  if (m_l1GtStableParCacheID != l1GtStableParCacheID) {
128 
130  evSetup.get<L1GtStableParametersRcd>().get(l1GtStablePar);
131  m_l1GtStablePar = l1GtStablePar.product();
132 
133  // number of algorithm triggers
135 
136  // number of technical triggers
139 
140  int maxNumberTrigger = std::max(m_numberAlgorithmTriggers,
142 
143  m_triggerMaskSet.reserve(maxNumberTrigger);
144  m_prescaleFactorSet.reserve(maxNumberTrigger);
145 
146  //
147  m_l1GtStableParCacheID = l1GtStableParCacheID;
148 
149  }
150 
151  // get / update the prescale factors from the EventSetup
152  // local cache & check on cacheIdentifier
153 
154  unsigned long long l1GtPfAlgoCacheID =
155  evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().cacheIdentifier();
156 
157  if (m_l1GtPfAlgoCacheID != l1GtPfAlgoCacheID) {
158 
160  evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
161  m_l1GtPfAlgo = l1GtPfAlgo.product();
162 
164 
165  m_l1GtPfAlgoCacheID = l1GtPfAlgoCacheID;
166 
167  }
168 
169  unsigned long long l1GtPfTechCacheID = evSetup.get<
170  L1GtPrescaleFactorsTechTrigRcd>().cacheIdentifier();
171 
172  if (m_l1GtPfTechCacheID != l1GtPfTechCacheID) {
173 
175  evSetup.get<L1GtPrescaleFactorsTechTrigRcd>().get(l1GtPfTech);
176  m_l1GtPfTech = l1GtPfTech.product();
177 
179 
180  m_l1GtPfTechCacheID = l1GtPfTechCacheID;
181 
182  }
183 
184  // get / update the trigger mask from the EventSetup
185  // local cache & check on cacheIdentifier
186 
187  unsigned long long l1GtTmAlgoCacheID =
188  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().cacheIdentifier();
189 
190  if (m_l1GtTmAlgoCacheID != l1GtTmAlgoCacheID) {
191 
193  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().get(l1GtTmAlgo);
194  m_l1GtTmAlgo = l1GtTmAlgo.product();
195 
197 
198  m_l1GtTmAlgoCacheID = l1GtTmAlgoCacheID;
199 
200  }
201 
202  unsigned long long l1GtTmTechCacheID =
203  evSetup.get<L1GtTriggerMaskTechTrigRcd>().cacheIdentifier();
204 
205  if (m_l1GtTmTechCacheID != l1GtTmTechCacheID) {
206 
208  evSetup.get<L1GtTriggerMaskTechTrigRcd>().get(l1GtTmTech);
209  m_l1GtTmTech = l1GtTmTech.product();
210 
212 
213  m_l1GtTmTechCacheID = l1GtTmTechCacheID;
214 
215  }
216 
217  unsigned long long l1GtTmVetoAlgoCacheID =
218  evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().cacheIdentifier();
219 
220  if (m_l1GtTmVetoAlgoCacheID != l1GtTmVetoAlgoCacheID) {
221 
222  edm::ESHandle<L1GtTriggerMask> l1GtTmVetoAlgo;
223  evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().get(l1GtTmVetoAlgo);
224  m_l1GtTmVetoAlgo = l1GtTmVetoAlgo.product();
225 
227 
228  m_l1GtTmVetoAlgoCacheID = l1GtTmVetoAlgoCacheID;
229 
230  }
231 
232  unsigned long long l1GtTmVetoTechCacheID =
233  evSetup.get<L1GtTriggerMaskVetoTechTrigRcd>().cacheIdentifier();
234 
235  if (m_l1GtTmVetoTechCacheID != l1GtTmVetoTechCacheID) {
236 
237  edm::ESHandle<L1GtTriggerMask> l1GtTmVetoTech;
238  evSetup.get<L1GtTriggerMaskVetoTechTrigRcd>().get(l1GtTmVetoTech);
239  m_l1GtTmVetoTech = l1GtTmVetoTech.product();
240 
242 
243  m_l1GtTmVetoTechCacheID = l1GtTmVetoTechCacheID;
244 
245  }
246 
247  // get / update the trigger menu from the EventSetup
248  // local cache & check on cacheIdentifier
249 
250  unsigned long long l1GtMenuCacheID =
251  evSetup.get<L1GtTriggerMenuRcd>().cacheIdentifier();
252 
253  if (m_l1GtMenuCacheID != l1GtMenuCacheID) {
254 
256  evSetup.get<L1GtTriggerMenuRcd>().get(l1GtMenu);
257  m_l1GtMenu = l1GtMenu.product();
258 
261 
263 
264  m_l1GtMenuCacheID = l1GtMenuCacheID;
265 
266  }
267 
268 }
std::vector< unsigned int > m_triggerMaskSet
Definition: L1GtUtils.h:530
unsigned long long m_l1GtMenuCacheID
Definition: L1GtUtils.h:485
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
Definition: L1GtUtils.h:477
const std::vector< unsigned int > * m_triggerMaskTechTrig
Definition: L1GtUtils.h:478
const L1GtTriggerMask * m_l1GtTmVetoTech
Definition: L1GtUtils.h:474
const L1GtTriggerMask * m_l1GtTmAlgo
trigger masks &amp; veto masks
Definition: L1GtUtils.h:465
const AlgorithmMap * m_algorithmMap
Definition: L1GtUtils.h:487
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrig
Definition: L1GtUtils.h:462
const L1GtStableParameters * m_l1GtStablePar
event setup cached stuff
Definition: L1GtUtils.h:445
unsigned long long m_l1GtPfAlgoCacheID
Definition: L1GtUtils.h:456
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
Definition: L1GtUtils.h:461
unsigned int gtNumberTechnicalTriggers() const
get / set the number of technical triggers
unsigned long long m_l1GtTmVetoTechCacheID
Definition: L1GtUtils.h:475
unsigned int gtNumberPhysTriggers() const
get / set the number of physics trigger algorithms
const AlgorithmMap * m_algorithmAliasMap
Definition: L1GtUtils.h:488
unsigned long long m_l1GtTmTechCacheID
Definition: L1GtUtils.h:469
const T & max(const T &a, const T &b)
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
const L1GtTriggerMask * m_l1GtTmVetoAlgo
Definition: L1GtUtils.h:471
const L1GtPrescaleFactors * m_l1GtPfAlgo
prescale factors
Definition: L1GtUtils.h:455
unsigned long long m_l1GtTmAlgoCacheID
Definition: L1GtUtils.h:466
unsigned int m_numberTechnicalTriggers
number of technical triggers
Definition: L1GtUtils.h:452
bool m_retrieveL1EventSetup
flags to check which method was used to retrieve L1 trigger configuration
Definition: L1GtUtils.h:534
unsigned int m_numberAlgorithmTriggers
number of algorithm triggers
Definition: L1GtUtils.h:449
const L1GtTriggerMask * m_l1GtTmTech
Definition: L1GtUtils.h:468
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
const L1GtPrescaleFactors * m_l1GtPfTech
Definition: L1GtUtils.h:458
const AlgorithmMap * m_technicalTriggerMap
Definition: L1GtUtils.h:489
const T & get() const
Definition: EventSetup.h:55
const std::vector< unsigned int > * m_triggerMaskVetoAlgoTrig
Definition: L1GtUtils.h:480
T const * product() const
Definition: ESHandle.h:62
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
const L1GtTriggerMenu * m_l1GtMenu
Definition: L1GtUtils.h:484
unsigned long long m_l1GtPfTechCacheID
Definition: L1GtUtils.h:459
const AlgorithmMap & gtTechnicalTriggerMap() const
get / set the technical trigger map
bool m_l1EventSetupValid
Definition: L1GtUtils.h:491
unsigned long long m_l1GtTmVetoAlgoCacheID
Definition: L1GtUtils.h:472
std::vector< int > m_prescaleFactorSet
Definition: L1GtUtils.h:531
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
unsigned long long m_l1GtStableParCacheID
Definition: L1GtUtils.h:446
const std::vector< unsigned int > * m_triggerMaskVetoTechTrig
Definition: L1GtUtils.h:481
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 271 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().

272  {
273 
274  //
276 
277  // get L1GtTriggerMenuLite
279  iRun.getByLabel(l1GtMenuLiteInputTag, l1GtMenuLite);
280 
281  if (!l1GtMenuLite.isValid()) {
282 
283  LogDebug("L1GtUtils") << "\nL1GtTriggerMenuLite with \n "
284  << l1GtMenuLiteInputTag
285  << "\nrequested in configuration, but not found in the event."
286  << std::endl;
287 
288  m_l1GtMenuLiteValid = false;
289  } else {
290  m_l1GtMenuLite = l1GtMenuLite.product();
291  m_l1GtMenuLiteValid = true;
292 
293  LogDebug("L1GtUtils") << "\nL1GtTriggerMenuLite with \n "
294  << l1GtMenuLiteInputTag << "\nretrieved for run "
295  << iRun.runAuxiliary().run() << std::endl;
296 
300 
303 
308 
309  }
310 
311 }
#define LogDebug(id)
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:535
bool getByLabel(std::string const &label, Handle< PROD > &result) const
Definition: Run.h:177
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:506
const L1GtTriggerMenuLite::L1TriggerMap * m_algorithmAliasMapLite
Definition: L1GtUtils.h:500
const L1GtTriggerMenuLite::L1TriggerMap * m_algorithmMapLite
Definition: L1GtUtils.h:499
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrigLite
Definition: L1GtUtils.h:507
const std::vector< unsigned int > & gtTriggerMaskTechTrig() const
get the trigger mask for technical triggers
const L1TriggerMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
const std::vector< std::vector< int > > & gtPrescaleFactorsTechTrig() const
bool isValid() const
Definition: HandleBase.h:76
const L1GtTriggerMenuLite * m_l1GtMenuLite
L1GtTriggerMenuLite cached stuff.
Definition: L1GtUtils.h:497
const std::vector< unsigned int > * m_triggerMaskTechTrigLite
Definition: L1GtUtils.h:504
RunAuxiliary const & runAuxiliary() const
Definition: Run.h:40
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:509
T const * product() const
Definition: Handle.h:74
const std::vector< unsigned int > * m_triggerMaskAlgoTrigLite
Definition: L1GtUtils.h:503
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:501
RunNumber_t run() const
Definition: RunAuxiliary.h:41
const std::string L1GtUtils::triggerCategory ( const TriggerCategory trigCategory) const

public methods

Definition at line 92 of file L1GtUtils.cc.

References AlgorithmTrigger, EmptyString, and TechnicalTrigger.

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

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

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

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

1525  {
1526 
1527  // initial values
1528  bool decisionBeforeMask = false;
1529  bool decisionAfterMask = false;
1530  int prescaleFactor = -1;
1531  int triggerMask = -1;
1532 
1533  errorCode = l1Results(iEvent, l1GtRecordInputTag,
1534  l1GtReadoutRecordInputTag, nameAlgoTechTrig, decisionBeforeMask,
1535  decisionAfterMask, prescaleFactor, triggerMask);
1536 
1537  return triggerMask;
1538 
1539 }
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:1413
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:887
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:1376
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:1522
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:1487
const int L1GtUtils::triggerMask ( const edm::Event iEvent,
const std::string &  nameAlgoTechTrig,
int &  errorCode 
) const

Definition at line 1541 of file L1GtUtils.cc.

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

1542  {
1543 
1544  // initial values
1545  bool decisionBeforeMask = false;
1546  bool decisionAfterMask = false;
1547  int prescaleFactor = -1;
1548  int triggerMask = -1;
1549 
1550  errorCode = l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1551  decisionAfterMask, prescaleFactor, triggerMask);
1552 
1553  return triggerMask;
1554 
1555 }
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:1413
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:887
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:1376
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:1522
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:1487
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 1557 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().

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

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

References LogDebug, and triggerCategory().

Referenced by l1Results().

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

Member Data Documentation

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

Definition at line 430 of file L1GtUtils.h.

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

const int L1GtUtils::L1GtNotValidError = 99999
staticprivate

Definition at line 431 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 487 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 512 of file L1GtUtils.h.

Referenced by getL1GtRunCache().

bool L1GtUtils::m_l1EventSetupValid
private

Definition at line 491 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 485 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 455 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtUtils::m_l1GtPfAlgoCacheID
private

Definition at line 456 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

const L1GtPrescaleFactors* L1GtUtils::m_l1GtPfTech
private

Definition at line 458 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtUtils::m_l1GtPfTechCacheID
private

Definition at line 459 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

const L1GtStableParameters* L1GtUtils::m_l1GtStablePar
private

event setup cached stuff

stable parameters

Definition at line 445 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtUtils::m_l1GtStableParCacheID
private

Definition at line 446 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

const L1GtTriggerMask* L1GtUtils::m_l1GtTmAlgo
private

trigger masks & veto masks

Definition at line 465 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtUtils::m_l1GtTmAlgoCacheID
private

Definition at line 466 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

const L1GtTriggerMask* L1GtUtils::m_l1GtTmTech
private

Definition at line 468 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtUtils::m_l1GtTmTechCacheID
private

Definition at line 469 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

const L1GtTriggerMask* L1GtUtils::m_l1GtTmVetoAlgo
private

Definition at line 471 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtUtils::m_l1GtTmVetoAlgoCacheID
private

Definition at line 472 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

const L1GtTriggerMask* L1GtUtils::m_l1GtTmVetoTech
private

Definition at line 474 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtUtils::m_l1GtTmVetoTechCacheID
private

Definition at line 475 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned int L1GtUtils::m_numberAlgorithmTriggers
private

number of algorithm triggers

Definition at line 449 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned int L1GtUtils::m_numberTechnicalTriggers
private

number of technical triggers

Definition at line 452 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

unsigned int L1GtUtils::m_physicsDaqPartition
private

index of physics DAQ partition

Definition at line 528 of file L1GtUtils.h.

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

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

Definition at line 461 of file L1GtUtils.h.

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

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

Definition at line 506 of file L1GtUtils.h.

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

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

Definition at line 531 of file L1GtUtils.h.

Referenced by prescaleFactorSet(), and retrieveL1EventSetup().

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

Definition at line 462 of file L1GtUtils.h.

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

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

Definition at line 507 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 516 of file L1GtUtils.h.

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

edm::InputTag L1GtUtils::m_provL1GtTriggerMenuLiteInputTag
mutableprivate

Definition at line 518 of file L1GtUtils.h.

Referenced by getL1GtRunCache(), and provL1GtTriggerMenuLiteInputTag().

edm::RunID L1GtUtils::m_provRunIDCache
private

Definition at line 522 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 534 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 521 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 477 of file L1GtUtils.h.

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

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

Definition at line 503 of file L1GtUtils.h.

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

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

Definition at line 530 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup(), and triggerMaskSet().

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

Definition at line 478 of file L1GtUtils.h.

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

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

Definition at line 504 of file L1GtUtils.h.

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

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

Definition at line 480 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().

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

Definition at line 481 of file L1GtUtils.h.

Referenced by retrieveL1EventSetup().