Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:20

0001 // -*- C++ -*-
0002 //
0003 // Class:      L1TTwinMuxParamsESProducer
0004 //
0005 // Original Author:  Giannis Flouris
0006 //         Created:
0007 //
0008 //modifications: g karathanasis
0009 
0010 // system include files
0011 #include <memory>
0012 
0013 // user include files
0014 #include "FWCore/Framework/interface/ModuleFactory.h"
0015 #include "FWCore/Framework/interface/ESProducer.h"
0016 //#include "FWCore/Framework/interface/ESHandle.h"
0017 //#include "FWCore/Framework/interface/ESProducts.h"
0018 
0019 #include "CondFormats/L1TObjects/interface/L1TTwinMuxParams.h"
0020 #include "CondFormats/DataRecord/interface/L1TTwinMuxParamsRcd.h"
0021 
0022 // class declaration
0023 //
0024 typedef std::map<short, short, std::less<short> > LUT;
0025 
0026 class L1TTwinMuxParamsESProducer : public edm::ESProducer {
0027 public:
0028   L1TTwinMuxParamsESProducer(const edm::ParameterSet&);
0029   ~L1TTwinMuxParamsESProducer() override;
0030 
0031   using ReturnType = std::unique_ptr<L1TTwinMuxParams>;
0032 
0033   ReturnType produce(const L1TTwinMuxParamsRcd&);
0034 
0035 private:
0036   L1TTwinMuxParams m_params;
0037 };
0038 
0039 //
0040 // constants, enums and typedefs
0041 //
0042 
0043 //
0044 // static data member definitions
0045 //
0046 
0047 //
0048 // constructors and destructor
0049 //
0050 L1TTwinMuxParamsESProducer::L1TTwinMuxParamsESProducer(const edm::ParameterSet& iConfig) {
0051   //the following line is needed to tell the framework what
0052   // data is being produced
0053   setWhatProduced(this);
0054   // Firmware version
0055   unsigned fwVersion = iConfig.getParameter<unsigned>("fwVersion");
0056   unsigned useRpcBxForDtBelowQuality = iConfig.getParameter<unsigned>("useRpcBxForDtBelowQuality");
0057   bool useOnlyRPC = iConfig.getParameter<bool>("useOnlyRPC");
0058   bool useOnlyDT = iConfig.getParameter<bool>("useOnlyDT");
0059   bool useLowQDT = iConfig.getParameter<bool>("useLowQDT");
0060   bool CorrectDTBxwRPC = iConfig.getParameter<bool>("CorrectDTBxwRPC");
0061   bool Verbose = iConfig.getParameter<bool>("verbose");
0062   unsigned dphiWindowBxShift = iConfig.getParameter<unsigned>("dphiWindowBxShift");
0063 
0064   m_params.setFwVersion(fwVersion);
0065   m_params.set_USERPCBXFORDTBELOWQUALITY(useRpcBxForDtBelowQuality);
0066   m_params.set_UseOnlyRPC(useOnlyRPC);
0067   m_params.set_UseOnlyDT(useOnlyDT);
0068   m_params.set_UseLowQDT(useLowQDT);
0069   m_params.set_CorrectDTBxwRPC(CorrectDTBxwRPC);
0070   m_params.set_Verbose(Verbose);
0071   m_params.set_DphiWindowBxShift(dphiWindowBxShift);
0072 }
0073 
0074 L1TTwinMuxParamsESProducer::~L1TTwinMuxParamsESProducer() {}
0075 
0076 //
0077 // member functions
0078 //
0079 
0080 // ------------ method called to produce the data  ------------
0081 L1TTwinMuxParamsESProducer::ReturnType L1TTwinMuxParamsESProducer::produce(const L1TTwinMuxParamsRcd& iRecord) {
0082   return std::make_unique<L1TTwinMuxParams>(m_params);
0083 }
0084 
0085 //define this as a plug-in
0086 DEFINE_FWK_EVENTSETUP_MODULE(L1TTwinMuxParamsESProducer);