Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:45

0001 #ifndef EventFilter_L1GlobalTriggerRawToDigi_L1GtTriggerMenuLiteProducer_h
0002 #define EventFilter_L1GlobalTriggerRawToDigi_L1GtTriggerMenuLiteProducer_h
0003 
0004 /**
0005  * \class L1GtTriggerMenuLiteProducer
0006  * 
0007  * 
0008  * Description: L1GtTriggerMenuLite producer.
0009  *
0010  * Implementation:
0011  *    Read the L1 trigger menu, the trigger masks and the prescale factor sets
0012  *    from event setup and save a lite version (top level menu, trigger masks
0013  *    for physics partition and prescale factor set) in Run Data.
0014  *   
0015  * \author: Vasile Mihai Ghete - HEPHY Vienna 
0016  * 
0017  *
0018  */
0019 
0020 // system include files
0021 #include <memory>
0022 
0023 // user include files
0024 #include "FWCore/Framework/interface/Frameworkfwd.h"
0025 #include "FWCore/Framework/interface/one/EDProducer.h"
0026 
0027 #include "FWCore/Framework/interface/Event.h"
0028 #include "FWCore/Framework/interface/MakerMacros.h"
0029 
0030 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0031 #include "FWCore/Utilities/interface/InputTag.h"
0032 #include "FWCore/Utilities/interface/ESGetToken.h"
0033 
0034 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenuFwd.h"
0035 #include "CondFormats/L1TObjects/interface/L1GtTriggerMask.h"
0036 #include "CondFormats/DataRecord/interface/L1GtTriggerMaskAlgoTrigRcd.h"
0037 #include "CondFormats/DataRecord/interface/L1GtTriggerMaskTechTrigRcd.h"
0038 #include "CondFormats/L1TObjects/interface/L1GtPrescaleFactors.h"
0039 #include "CondFormats/DataRecord/interface/L1GtPrescaleFactorsAlgoTrigRcd.h"
0040 #include "CondFormats/DataRecord/interface/L1GtPrescaleFactorsTechTrigRcd.h"
0041 #include "CondFormats/L1TObjects/interface/L1GtStableParameters.h"
0042 #include "CondFormats/DataRecord/interface/L1GtStableParametersRcd.h"
0043 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h"
0044 #include "CondFormats/DataRecord/interface/L1GtTriggerMenuRcd.h"
0045 
0046 // forward declarations
0047 class L1GtStableParameters;
0048 class L1GtTriggerMenu;
0049 class L1GtTriggerMask;
0050 class L1GtPrescaleFactors;
0051 
0052 // class declaration
0053 class L1GtTriggerMenuLiteProducer : public edm::one::EDProducer<edm::BeginRunProducer> {
0054 public:
0055   /// constructor(s)
0056   explicit L1GtTriggerMenuLiteProducer(const edm::ParameterSet&);
0057 
0058   /// destructor
0059   ~L1GtTriggerMenuLiteProducer() override;
0060 
0061 private:
0062   /// retrieve all the relevant L1 trigger event setup records
0063   /// and cache them to improve the speed
0064   void retrieveL1EventSetup(const edm::EventSetup&);
0065 
0066   void beginJob() final;
0067   void beginRunProduce(edm::Run&, const edm::EventSetup&) final;
0068 
0069   void produce(edm::Event&, const edm::EventSetup&) final;
0070 
0071   void endJob() override;
0072 
0073 private:
0074   /// cached stuff
0075 
0076   /// stable parameters
0077   const L1GtStableParameters* m_l1GtStablePar;
0078   unsigned long long m_l1GtStableParCacheID;
0079 
0080   /// number of physics triggers
0081   unsigned int m_numberPhysTriggers;
0082 
0083   /// number of technical triggers
0084   unsigned int m_numberTechnicalTriggers;
0085 
0086   // trigger menu
0087   const L1GtTriggerMenu* m_l1GtMenu;
0088   unsigned long long m_l1GtMenuCacheID;
0089 
0090   const AlgorithmMap* m_algorithmMap;
0091   const AlgorithmMap* m_algorithmAliasMap;
0092   const AlgorithmMap* m_technicalTriggerMap;
0093 
0094   /// trigger masks
0095   const L1GtTriggerMask* m_l1GtTmAlgo;
0096   unsigned long long m_l1GtTmAlgoCacheID;
0097 
0098   const L1GtTriggerMask* m_l1GtTmTech;
0099   unsigned long long m_l1GtTmTechCacheID;
0100 
0101   const std::vector<unsigned int>* m_triggerMaskAlgoTrig;
0102   const std::vector<unsigned int>* m_triggerMaskTechTrig;
0103 
0104   /// prescale factors
0105   const L1GtPrescaleFactors* m_l1GtPfAlgo;
0106   unsigned long long m_l1GtPfAlgoCacheID;
0107 
0108   const L1GtPrescaleFactors* m_l1GtPfTech;
0109   unsigned long long m_l1GtPfTechCacheID;
0110 
0111   const std::vector<std::vector<int> >* m_prescaleFactorsAlgoTrig;
0112   const std::vector<std::vector<int> >* m_prescaleFactorsTechTrig;
0113 
0114   /// EventSetup Tokens
0115   const edm::ESGetToken<L1GtStableParameters, L1GtStableParametersRcd> m_l1GtStableParamToken;
0116   const edm::ESGetToken<L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd> m_l1GtPfAlgoToken;
0117   const edm::ESGetToken<L1GtPrescaleFactors, L1GtPrescaleFactorsTechTrigRcd> m_l1GtPfTechToken;
0118   const edm::ESGetToken<L1GtTriggerMask, L1GtTriggerMaskAlgoTrigRcd> m_l1GtTmAlgoToken;
0119   const edm::ESGetToken<L1GtTriggerMask, L1GtTriggerMaskTechTrigRcd> m_l1GtTmTechToken;
0120   const edm::ESGetToken<L1GtTriggerMenu, L1GtTriggerMenuRcd> m_l1GtMenuToken;
0121 
0122 private:
0123   /// index of physics DAQ partition
0124   unsigned int m_physicsDaqPartition;
0125 };
0126 
0127 #endif  // EventFilter_L1GlobalTriggerRawToDigi_L1GtTriggerMenuLiteProducer_h