CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/L1Trigger/GlobalTriggerAnalyzer/interface/L1GtUtils.h

Go to the documentation of this file.
00001 #ifndef GlobalTriggerAnalyzer_L1GtUtils_h
00002 #define GlobalTriggerAnalyzer_L1GtUtils_h
00003 
00020 // system include files
00021 #include <string>
00022 
00023 // user include files
00024 
00025 #include "DataFormats/L1GlobalTrigger/interface/L1GtTriggerMenuLite.h"
00026 
00027 #include "FWCore/Framework/interface/Event.h"
00028 #include "FWCore/Framework/interface/EventSetup.h"
00029 #include "FWCore/Framework/interface/Run.h"
00030 
00031 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00032 #include "FWCore/Utilities/interface/InputTag.h"
00033 
00034 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenuFwd.h"
00035 
00036 // forward declarations
00037 class L1GtStableParameters;
00038 class L1GtPrescaleFactors;
00039 class L1GtTriggerMask;
00040 class L1GtTriggerMenu;
00041 
00042 class L1GlobalTriggerReadoutRecord;
00043 class L1GlobalTriggerRecord;
00044 
00045 // class declaration
00046 
00047 class L1GtUtils {
00048 
00049 public:
00050 
00052     explicit L1GtUtils();
00053 
00055     virtual ~L1GtUtils();
00056 
00057 public:
00058 
00059     enum TriggerCategory {
00060         AlgorithmTrigger = 0, TechnicalTrigger = 1
00061     };
00062 
00064 
00065     // enum to string for TriggerCategory
00066     const std::string triggerCategory(const TriggerCategory&) const;
00067 
00069     void retrieveL1EventSetup(const edm::EventSetup&);
00070 
00072 
00075     void retrieveL1GtTriggerMenuLite(const edm::Run&, const edm::InputTag&);
00076 
00078 
00081     void getL1GtRunCache(const edm::Run&, const edm::EventSetup&, const bool,
00082             const bool, const edm::InputTag&);
00084     void getL1GtRunCache(const edm::Run&, const edm::EventSetup&, const bool,
00085             const bool);
00086 
00089     void getL1GtRunCache(const edm::Event&, const edm::EventSetup&, const bool,
00090             const bool, const edm::InputTag&);
00092     void getL1GtRunCache(const edm::Event&, const edm::EventSetup&, const bool,
00093             const bool);
00094 
00098     void getL1GtRecordInputTag(const edm::Event& iEvent,
00099             edm::InputTag& l1GtRecordInputTag,
00100             edm::InputTag& l1GtReadoutRecordInputTag) const;
00101 
00103     void getL1GtTriggerMenuLiteInputTag(const edm::Run& iRun,
00104             edm::InputTag& l1GtTriggerMenuLiteInputTag) const;
00105 
00114 
00115     const bool l1AlgoTechTrigBitNumber(const std::string& nameAlgoTechTrig,
00116             TriggerCategory& trigCategory, int& bitNumber) const;
00117 
00130 
00131     const int
00132             l1Results(const edm::Event& iEvent,
00133                     const edm::InputTag& l1GtRecordInputTag,
00134                     const edm::InputTag& l1GtReadoutRecordInputTag,
00135                     const std::string& nameAlgoTechTrig,
00136                     bool& decisionBeforeMask, bool& decisionAfterMask,
00137                     int& prescaleFactor, int& triggerMask) const;
00138 
00150 
00151     const int
00152             l1Results(const edm::Event& iEvent,
00153                     const std::string& nameAlgoTechTrig,
00154                     bool& decisionBeforeMask, bool& decisionAfterMask,
00155                     int& prescaleFactor, int& triggerMask) const;
00156 
00171 
00173     const bool decisionBeforeMask(const edm::Event& iEvent,
00174             const edm::InputTag& l1GtRecordInputTag,
00175             const edm::InputTag& l1GtReadoutRecordInputTag,
00176             const std::string& nameAlgoTechTrig, int& errorCode) const;
00177 
00178     const bool decisionBeforeMask(const edm::Event& iEvent,
00179             const std::string& nameAlgoTechTrig, int& errorCode) const;
00180 
00182     const bool decisionAfterMask(const edm::Event& iEvent,
00183             const edm::InputTag& l1GtRecordInputTag,
00184             const edm::InputTag& l1GtReadoutRecordInputTag,
00185             const std::string& nameAlgoTechTrig, int& errorCode) const;
00186 
00187     const bool decisionAfterMask(const edm::Event& iEvent,
00188             const std::string& nameAlgoTechTrig, int& errorCode) const;
00189 
00192     const bool decision(const edm::Event& iEvent,
00193             const edm::InputTag& l1GtRecordInputTag,
00194             const edm::InputTag& l1GtReadoutRecordInputTag,
00195             const std::string& nameAlgoTechTrig, int& errorCode) const;
00196 
00197     const bool decision(const edm::Event& iEvent,
00198             const std::string& nameAlgoTechTrig, int& errorCode) const;
00199 
00201     const int prescaleFactor(const edm::Event& iEvent,
00202             const edm::InputTag& l1GtRecordInputTag,
00203             const edm::InputTag& l1GtReadoutRecordInputTag,
00204             const std::string& nameAlgoTechTrig, int& errorCode) const;
00205 
00206     const int prescaleFactor(const edm::Event& iEvent,
00207             const std::string& nameAlgoTechTrig, int& errorCode) const;
00208 
00210     const int triggerMask(const edm::Event& iEvent,
00211             const edm::InputTag& l1GtRecordInputTag,
00212             const edm::InputTag& l1GtReadoutRecordInputTag,
00213             const std::string& nameAlgoTechTrig, int& errorCode) const;
00214 
00215     const int triggerMask(const edm::Event& iEvent,
00216             const std::string& nameAlgoTechTrig, int& errorCode) const;
00217 
00220     const int
00221             triggerMask(const std::string& nameAlgoTechTrig, int& errorCode) const;
00222 
00227 
00228     const int prescaleFactorSetIndex(const edm::Event& iEvent,
00229             const edm::InputTag& l1GtRecordInputTag,
00230             const edm::InputTag& l1GtReadoutRecordInputTag,
00231             const TriggerCategory& trigCategory, int& errorCode) const;
00232 
00233     const int prescaleFactorSetIndex(const edm::Event& iEvent,
00234             const TriggerCategory& trigCategory, int& errorCode) const;
00235 
00236 
00240 
00241     const std::vector<int>& prescaleFactorSet(const edm::Event& iEvent,
00242             const edm::InputTag& l1GtRecordInputTag,
00243             const edm::InputTag& l1GtReadoutRecordInputTag,
00244             const TriggerCategory& trigCategory, int& errorCode);
00245 
00246     const std::vector<int>& prescaleFactorSet(const edm::Event& iEvent,
00247             const TriggerCategory& trigCategory, int& errorCode);
00248 
00249 
00252     const std::vector<unsigned int>& triggerMaskSet(
00253             const TriggerCategory& trigCategory, int& errorCode);
00254 
00255 
00257     const std::string& l1TriggerMenu() const;
00258 
00260     const std::string& l1TriggerMenuImplementation() const;
00261 
00263     const L1GtTriggerMenu* ptrL1TriggerMenuEventSetup(int& errorCode);
00264 
00266     const L1GtTriggerMenuLite* ptrL1GtTriggerMenuLite(int& errorCode);
00267 
00270     const bool availableL1Configuration(int& errorCode, int& l1ConfCode) const;
00271 
00272 private:
00273 
00274     static const std::string EmptyString;
00275     static const int L1GtNotValidError;
00276 
00280     const bool trigResult(const DecisionWord& decWord, const int bitNumber,
00281             const std::string& nameAlgoTechTrig,
00282             const TriggerCategory& trigCategory, int& errorCode) const;
00283 
00284 private:
00285 
00287 
00289     const L1GtStableParameters* m_l1GtStablePar;
00290     unsigned long long m_l1GtStableParCacheID;
00291 
00293     unsigned int m_numberAlgorithmTriggers;
00294 
00296     unsigned int m_numberTechnicalTriggers;
00297 
00299     const L1GtPrescaleFactors* m_l1GtPfAlgo;
00300     unsigned long long m_l1GtPfAlgoCacheID;
00301 
00302     const L1GtPrescaleFactors* m_l1GtPfTech;
00303     unsigned long long m_l1GtPfTechCacheID;
00304 
00305     const std::vector<std::vector<int> >* m_prescaleFactorsAlgoTrig;
00306     const std::vector<std::vector<int> >* m_prescaleFactorsTechTrig;
00307 
00309     const L1GtTriggerMask* m_l1GtTmAlgo;
00310     unsigned long long m_l1GtTmAlgoCacheID;
00311 
00312     const L1GtTriggerMask* m_l1GtTmTech;
00313     unsigned long long m_l1GtTmTechCacheID;
00314 
00315     const L1GtTriggerMask* m_l1GtTmVetoAlgo;
00316     unsigned long long m_l1GtTmVetoAlgoCacheID;
00317 
00318     const L1GtTriggerMask* m_l1GtTmVetoTech;
00319     unsigned long long m_l1GtTmVetoTechCacheID;
00320 
00321     const std::vector<unsigned int>* m_triggerMaskAlgoTrig;
00322     const std::vector<unsigned int>* m_triggerMaskTechTrig;
00323 
00324     const std::vector<unsigned int>* m_triggerMaskVetoAlgoTrig;
00325     const std::vector<unsigned int>* m_triggerMaskVetoTechTrig;
00326 
00327     // trigger menu
00328     const L1GtTriggerMenu* m_l1GtMenu;
00329     unsigned long long m_l1GtMenuCacheID;
00330 
00331     const AlgorithmMap* m_algorithmMap;
00332     const AlgorithmMap* m_algorithmAliasMap;
00333     const AlgorithmMap* m_technicalTriggerMap;
00334 
00335     bool m_l1EventSetupValid;
00336 
00338 
00339 
00341     const L1GtTriggerMenuLite* m_l1GtMenuLite;
00342 
00343     const L1GtTriggerMenuLite::L1TriggerMap* m_algorithmMapLite;
00344     const L1GtTriggerMenuLite::L1TriggerMap* m_algorithmAliasMapLite;
00345     const L1GtTriggerMenuLite::L1TriggerMap* m_technicalTriggerMapLite;
00346 
00347     const std::vector<unsigned int>* m_triggerMaskAlgoTrigLite;
00348     const std::vector<unsigned int>* m_triggerMaskTechTrigLite;
00349 
00350     const std::vector<std::vector<int> >* m_prescaleFactorsAlgoTrigLite;
00351     const std::vector<std::vector<int> >* m_prescaleFactorsTechTrigLite;
00352 
00353     edm::RunID m_runIDCache;
00354     edm::RunID m_provRunIDCache;
00355 
00356     bool m_l1GtMenuLiteValid;
00357 
00359     bool m_beginRunCache;
00360 
00362 
00363     mutable edm::InputTag m_provL1GtRecordInputTag;
00364     mutable edm::InputTag m_provL1GtReadoutRecordInputTag;
00365     mutable edm::InputTag m_provL1GtTriggerMenuLiteInputTag;
00366 
00367 private:
00368 
00370     unsigned int m_physicsDaqPartition;
00371 
00372     std::vector<unsigned int> m_triggerMaskSet;
00373     std::vector<int> m_prescaleFactorSet;
00374 
00376     bool m_retrieveL1EventSetup;
00377     bool m_retrieveL1GtTriggerMenuLite;
00378 
00379 };
00380 
00381 #endif /*GlobalTriggerAnalyzer_L1GtUtils_h*/