// Use case 0 - Retrieve L1 trigger configuration from L1GtTriggerMenuLite only bool useL1EventSetup = false; bool useL1GtTriggerMenuLite = true; // could be added in beginRun(...) - if not added, the caching will be done in analyze/produce/filter method m_l1GtUtils.getL1GtRunCache(iRun, evSetup, useL1EventSetup, useL1GtTriggerMenuLite); // must be added in analyze/produce/filter method m_l1GtUtils.getL1GtRunCache(iEvent, evSetup, useL1EventSetup, useL1GtTriggerMenuLite);Use case 100000
// Use case 100000 - Fall through: try first L1GtTriggerMenuLite; if not valid,try event setup. bool useL1EventSetup = true; bool useL1GtTriggerMenuLite = true; // could be added in beginRun(...) - if not added, the caching will be done in analyze/produce/filter method m_l1GtUtils.getL1GtRunCache(iRun, evSetup, useL1EventSetup, useL1GtTriggerMenuLite); // must be added in analyze/produce/filter method m_l1GtUtils.getL1GtRunCache(iEvent, evSetup, useL1EventSetup, useL1GtTriggerMenuLite);Use case 200000
// Use case 200000 - Retrieve L1 trigger configuration from event setup only. bool useL1EventSetup = true; bool useL1GtTriggerMenuLite = false; // could be added in beginRun(...) - if not added, the caching will be done in analyze/produce/filter method m_l1GtUtils.getL1GtRunCache(iRun, evSetup, useL1EventSetup, useL1GtTriggerMenuLite); // must be added in analyze/produce/filter method m_l1GtUtils.getL1GtRunCache(iEvent, evSetup, useL1EventSetup, useL1GtTriggerMenuLite);Use case 300000
// L1GtTriggerMenuLite input tag given in configuration file // could be added in beginRun(...) - if not added, the caching will be done in analyze/produce/filter method m_l1GtUtils.getL1GtRunCache(iRun, evSetup, useL1EventSetup, useL1GtTriggerMenuLite, m_l1GtTmLInputTag); // must be added in analyze/produce/filter method m_l1GtUtils.getL1GtRunCache(iEvent, evSetup, useL1EventSetup, useL1GtTriggerMenuLite, m_l1GtTmLInputTag);
Note:
in Version 3, one can not mix events with different input tags for the L1 GT records (anyhow, a very complex process, not really recommended). Runs with different input tags are OK.
const bool L1GtUtils::availableL1Configuration(int& errorCode, int& l1ConfCode) const
.
L1 configuration code returned by the method "const bool L1GtUtils::availableL1Configuration(int& errorCode, int& l1ConfCode) const"; Legend: 0 - Retrieve L1 trigger configuration from L1GtTriggerMenuLite only 10000 L1GtTriggerMenuLite product is valid 99999 L1GtTriggerMenuLite product not valid. Error. 100000 - Fall through: try first L1GtTriggerMenuLite; if not valid,try event setup. 110000 L1GtTriggerMenuLite product is valid 120000 L1GtTriggerMenuLite product not valid, event setup valid. 199999 L1GtTriggerMenuLite product not valid, event setup not valid. Error. 200000 - Retrieve L1 trigger configuration from event setup only. 210000 Event setup valid. 299999 Event setup not valid. Error. 300000 - No L1 trigger configuration requested to be retrieved. Error. Must call before using L1GtUtils methods at least one of the following: retrieveL1GtTriggerMenuLite or retrieveL1EventSetup.Use case 0
// Use case 0 - Retrieve L1 trigger configuration from L1GtTriggerMenuLite only m_l1GtUtils.retrieveL1GtTriggerMenuLite(iEvent, m_l1GtTmLInputTag);Use case 0 is recommended to be used always when analyzing MC samples produced with a given global tag and analyzed with the same release or another release and a different global tag. As explained in this FAQ or, directly, in Potential problem for static global tags
// Use case 100000 - Fall through: try first L1GtTriggerMenuLite; if not valid,try event setup. m_l1GtUtils.retrieveL1EventSetup(evSetup); m_l1GtUtils.retrieveL1GtTriggerMenuLite(iEvent, m_l1GtTmLInputTag);Use case 100000 is recommended to be used on data sets where not all the data have L1GtTriggerMenuLite available. Not recomended to be used on MC samples, as long as the global tags do not have a proper IoV association. Use case 200000
// Use case 200000 - Retrieve L1 trigger configuration from event setup only. m_l1GtUtils.retrieveL1EventSetup(evSetup);Use case 200000 is recommended to be used when the L1GtTriggerMenuLite is known to not be available, as for example online in HLT code. It is also safe to be used on data, where the global tags have a correct IoV association (although also here it is recommended to use use case 0). Use case 300000
#include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtUtils.h" class L1GtAnalyzer: public edm::EDAnalyzer { private: L1GtUtils m_l1GtUtils; }In the class implementation (e.g. L1GtAnalyzer.cc)
void L1GtAnalyzer::analyzeL1GtUtilsMenuLite(const edm::Event& iEvent, const edm::EventSetup& evSetup) { // before accessing any result from L1GtUtils, one must retrieve and cache // the L1GtTriggerMenuLite product // add this call in the analyze / produce / filter method of your // analyzer / producer / filter m_l1GtUtils.retrieveL1GtTriggerMenuLite(iEvent, m_l1GtTmLInputTag); // ...... // access L1 trigger results using public methods from L1GtUtils // always check on error code returned by that method int iErrorCode = -1; bool decisionBeforeMaskAlgTechTrig = m_l1GtUtils.decisionBeforeMask(iEvent, m_nameAlgTechTrig, iErrorCode); if (iErrorCode == 0) { // do something } else if (iErrorCode == 1) { // algorithm / technical trigger does not exist in the L1 menu // do something } else { // error - see error code // do whatever needed } // ...... } void L1GtAnalyzer::analyzeL1GtUtilsEventSetup(const edm::Event& iEvent, const edm::EventSetup& evSetup) { // before accessing any result from L1GtUtils, one must retrieve and cache // the L1 trigger event setup // add this call in the analyze / produce / filter method of your // analyzer / producer / filter m_l1GtUtils.retrieveL1EventSetup(evSetup); // access L1 trigger results using public methods from L1GtUtils // always check on error code returned by that method // see method analyzeL1GtUtilsMenuLite, code within // ...... // ...... } void L1GtAnalyzer::analyzeL1GtUtils(const edm::Event& iEvent, const edm::EventSetup& evSetup) { // before accessing any result from L1GtUtils, one must retrieve and cache // the L1 trigger event setup and the L1GtTriggerMenuLite product // add this call in the analyze / produce / filter method of your // analyzer / producer / filter m_l1GtUtils.retrieveL1EventSetup(evSetup); m_l1GtUtils.retrieveL1GtTriggerMenuLite(iEvent, m_l1GtTmLInputTag); // access L1 trigger results using public methods from L1GtUtils // always check on error code returned by that method // see method analyzeL1GtUtilsMenuLite, code within // ...... // ...... } // analyze each event: event loop void L1GtAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& evSetup) { // analyze: decision for a given algorithm using L1GtUtils functions // use only one of the following methods // Use case 0 - Retrieve L1 trigger configuration from L1GtTriggerMenuLite only // Use case 100000 - Fall through: try first L1GtTriggerMenuLite; if not valid,try event setup. // Use case 200000 - Retrieve L1 trigger configuration from event setup only. switch (m_l1GtUtilsConfiguration) { case 0: { analyzeL1GtUtilsMenuLite(iEvent, evSetup); } break; case 100000: { analyzeL1GtUtils(iEvent, evSetup); } break; case 200000: { analyzeL1GtUtilsEventSetup(iEvent, evSetup); } break; default: { // do nothing } break; } }The buildfile must include the GlobalTriggerAnalyzer library
<use name=L1Trigger/GlobalTriggerAnalyzer>m_l1GtUtilsConfiguration is a private member of the analyzer, read from the configuration file, see the L1GtAnalyzer example.
#include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtUtils.h" class L1GtAnalyzer: public edm::EDAnalyzer { private: L1GtUtils m_l1GtUtils; }In the class implementation (e.g. L1GtAnalyzer.cc)
void L1GtAnalyzer::analyzeL1GtUtils(const edm::Event& iEvent, const edm::EventSetup& evSetup) { // before accessing any result from L1GtUtils, one must retrieve and cache // the L1 trigger event setup // add this call in the analyze / produce / filter method of your // analyzer / producer / filter m_l1GtUtils.retrieveL1EventSetup(evSetup); // access L1 trigger results using public methods from L1GtUtils // always check on error code returned by that method int iErrorCode = -1; bool decisionBeforeMaskAlgTechTrig = m_l1GtUtils.decisionBeforeMask(iEvent, m_nameAlgTechTrig, iErrorCode); if (iErrorCode == 0) { // do something } else if (iErrorCode == 1) { // algorithm / technical trigger does not exist in the L1 menu // do something } else { // error - see error code // do whatever needed } } // analyze each event: event loop void L1GtAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& evSetup) { // analyze: decision for a given algorithm using L1GtUtils functions analyzeL1GtUtils(iEvent, evSetup); }The buildfile must include the GlobalTriggerAnalyzer library
<use name=L1Trigger/GlobalTriggerAnalyzer>
const edm::Event& iEvent
const edm::InputTag& l1GtRecordInputTag
const edm::InputTag& l1GtReadoutRecordInputTag
const std::string& nameAlgTechTrig
int& errorCode
/// return decision before trigger mask for a given algorithm or technical trigger const bool decisionBeforeMask(const edm::Event& iEvent, const edm::InputTag& l1GtRecordInputTag, const edm::InputTag& l1GtReadoutRecordInputTag, const std::string& nameAlgoTechTrig, int& errorCode) const; const bool decisionBeforeMask(const edm::Event& iEvent, const std::string& nameAlgoTechTrig, int& errorCode) const;
/// return decision after trigger mask for a given algorithm or technical trigger const bool decisionAfterMask(const edm::Event& iEvent, const edm::InputTag& l1GtRecordInputTag, const edm::InputTag& l1GtReadoutRecordInputTag, const std::string& nameAlgoTechTrig, int& errorCode) const; const bool decisionAfterMask(const edm::Event& iEvent, const std::string& nameAlgoTechTrig, int& errorCode) const; /// return decision after trigger mask for a given algorithm or technical trigger /// function identical with decisionAfterMask 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;
/// return prescale factor for a given algorithm or technical trigger const int prescaleFactor(const edm::Event& iEvent, const edm::InputTag& l1GtRecordInputTag, const edm::InputTag& l1GtReadoutRecordInputTag, const std::string& nameAlgoTechTrig, int& errorCode) const; const int prescaleFactor(const edm::Event& iEvent, const std::string& nameAlgoTechTrig, int& errorCode) const;
/// return trigger mask for a given algorithm or technical trigger const int triggerMask(const edm::Event& iEvent, const edm::InputTag& l1GtRecordInputTag, const edm::InputTag& l1GtReadoutRecordInputTag, const std::string& nameAlgoTechTrig, int& errorCode) const; const int triggerMask(const edm::Event& iEvent, const std::string& nameAlgoTechTrig, int& errorCode) const; /// faster than previous two methods - one needs in fact for the /// masks the event setup only const int triggerMask(const std::string& nameAlgoTechTrig, 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) /// /// enum TriggerCategory { /// AlgorithmTrigger = 0, /// TechnicalTrigger = 1 /// }; 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; /// deprecated versions in Version 2 of L1GtUtils /// triggerAlgTechTrig = "TechnicalTriggers" - index for technical triggers /// triggerAlgTechTrig = "PhysicsAlgorithms" - index for algorithm triggers const int prescaleFactorSetIndex(const edm::Event& iEvent, const edm::InputTag& l1GtRecordInputTag, const edm::InputTag& l1GtReadoutRecordInputTag, const std::string& triggerAlgoTechTrig, int& errorCode) const; const int prescaleFactorSetIndex(const edm::Event& iEvent, const std::string& triggerAlgoTechTrig, int& errorCode) const;
/// 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) 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); /// deprecated versions in Version 2 of L1GtUtils /// triggerAlgTechTrig = "TechnicalTriggers" - set for technical triggers /// triggerAlgTechTrig = "PhysicsAlgorithms" - set for algorithm triggers const std::vector<int>& prescaleFactorSet(const edm::Event& iEvent, const edm::InputTag& l1GtRecordInputTag, const edm::InputTag& l1GtReadoutRecordInputTag, const std::string& triggerAlgoTechTrig, int& errorCode); const std::vector<int>& prescaleFactorSet(const edm::Event& iEvent, const std::string& triggerAlgoTechTrig, 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) const std::vector<unsigned int>& triggerMaskSet( const TriggerCategory& trigCategory, int& errorCode); /// deprecated version in Version 2 of L1GtUtils /// triggerAlgTechTrig = "TechnicalTriggers" - set for technical triggers /// triggerAlgTechTrig = "PhysicsAlgorithms" - set for algorithm triggers const std::vector<unsigned int>& triggerMaskSet( const std::string& triggerAlgoTechTrig, int& errorCode);
/// return the L1 trigger menu name const std::string& l1TriggerMenu() const; /// return the L1 trigger menu implementation const std::string& l1TriggerMenuImplementation() const;
/// return a pointer to the L1 trigger menu from event setup const L1GtTriggerMenu* ptrL1TriggerMenuEventSetup(int& errorCode);
/// return a pointer to the L1GtTriggerMenuLite product const L1GtTriggerMenuLite* ptrL1GtTriggerMenuLite(int& errorCode);
/// check if L1 trigger configuration is available /// return false and an error code if configuration is not available const bool availableL1Configuration(int& errorCode, int& l1ConfCode) const;
Error code | Interpretation |
---|---|
L1 configuration code + 99999 | L1 configuration not valid |
99999 | L1 configuration not valid Use case: L1 configuration code = 0 Retrieve L1 trigger configuration from L1GtTriggerMenuLite only Error: L1GtTriggerMenuLite product not valid |
199999 | L1 configuration not valid Use case: L1 configuration code = 100000 Fall through: try first L1GtTriggerMenuLite; if not valid,try event setup Error: L1GtTriggerMenuLite product not valid, event setup not valid |
299999 | L1 configuration not valid Use case: L1 configuration code = 200000 Retrieve L1 trigger configuration from event setup only Error: Event setup not valid |
300000 | L1 configuration not valid Use case: L1 configuration code = 300000 No L1 trigger configuration requested to be retrieved. Error Error: No L1 trigger configuration requested to be retrieved |
L1 configuration code + 1 | L1 configuration valid Error: Algorithm/technical trigger not found in the trigger menu |
L1 configuration code + 2 | L1 configuration valid Error: Negative bit number for algorithm/technical trigger found from the L1 trigger menu retrieved |
L1 configuration code + 3 | L1 configuration valid Error: Invalid trigger category (nor AlgorithmTrigger neither TechnicalTrigger) for requested trigger name |
L1 configuration code + 10 | L1 configuration valid Error: L1GlobalTriggerRecord with requested InputTag not found in the event |
L1 configuration code + 100 | L1 configuration valid Error: L1GlobalTriggerReadoutRecord with requested InputTag not found in the event |
L1 configuration code + 1000 | L1 configuration valid Error: Index of prescale factor set retrieved from the data is less than zero |
L1 configuration code + 2000 | L1 configuration valid Error: Index of prescale factor set retrieved from the data is greater than the size of the vector of prescale factor sets |
L1 configuration code + 3000 | L1 configuration valid Error: bit number retrieved for the algorithm/technical trigger greater than size of L1 GT decision word Inconsistent L1 trigger configuration |
L1 configuration code + 4000 | L1 configuration valid Error: bit number retrieved for the algorithm/technical trigger greater than size of actual L1 GT prescale factor set Inconsistent L1 trigger configuration |
L1 configuration code + 5000 | L1 configuration valid Error: bit number retrieved for the algorithm/technical trigger greater than size of L1 GT trigger mask set Inconsistent L1 trigger configuration |
V01-04-00 L1Trigger/GlobalTriggerAnalyzerand ends with the tag
N/A L1Trigger/GlobalTriggerAnalyzerwhich are included in the following releases
V01-00-01 L1Trigger/GlobalTriggerAnalyzerand ends with the tag
V01-03-03 L1Trigger/GlobalTriggerAnalyzerThe tags are included in the following releases:
V07-15-09 FWCore/Framework V01-00-01-00 L1Trigger/GlobalTriggerAnalyzer
Reviewer/Editor and Date | Comments |
---|---|
VasileGhete - 25-Jan-2010 | Version 1 |
VasileGhete - 25-Jan-2010 | Version 2 |