Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // Class:      L1TMuonBarrelKalmanParamsESProducer
0004 //
0005 // Original Author (of the base file):  Giannis Flouris
0006 // Kalman Mod & clean up:  Panos Katsoulis
0007 //         Created:
0008 //
0009 //
0010 
0011 // system include files
0012 #include <memory>
0013 
0014 // user include files
0015 #include "FWCore/Framework/interface/ModuleFactory.h"
0016 #include "FWCore/Framework/interface/ESProducer.h"
0017 
0018 #include "CondFormats/L1TObjects/interface/L1TMuonBarrelKalmanParams.h"
0019 #include "CondFormats/DataRecord/interface/L1TMuonBarrelKalmanParamsRcd.h"
0020 
0021 // for future, LUTs implementaion
0022 //#include "L1Trigger/L1TMuon/interface/MicroGMTLUTFactories.h"
0023 // for future, masks
0024 //#include "L1Trigger/L1TCommon/interface/Mask.h"
0025 
0026 // class declaration
0027 //
0028 
0029 class L1TMuonBarrelKalmanParamsESProducer : public edm::ESProducer {
0030 public:
0031   L1TMuonBarrelKalmanParamsESProducer(const edm::ParameterSet&);
0032   ~L1TMuonBarrelKalmanParamsESProducer() override;
0033 
0034   using ReturnType = std::unique_ptr<L1TMuonBarrelKalmanParams>;
0035   ReturnType produce(const L1TMuonBarrelKalmanParamsRcd&);
0036 
0037 private:
0038   L1TMuonBarrelKalmanParams kalman_params;
0039 };
0040 
0041 //
0042 // constants, enums and typedefs
0043 //
0044 
0045 //
0046 // static data member definitions
0047 //
0048 
0049 //
0050 // constructors and destructor
0051 //
0052 L1TMuonBarrelKalmanParamsESProducer::L1TMuonBarrelKalmanParamsESProducer(const edm::ParameterSet& iConfig) {
0053   // the following line is needed to tell the framework what data is being produced
0054   setWhatProduced(this);
0055 
0056   // basic configurables needed (now set static)
0057   kalman_params.pnodes_[kalman_params.CONFIG].fwVersion_ = iConfig.getParameter<unsigned>("fwVersion");
0058 
0059   // the LUTs
0060   kalman_params.pnodes_[kalman_params.CONFIG].kalmanLUTsPath_ = iConfig.getParameter<std::string>("LUTsPath");
0061 }
0062 
0063 L1TMuonBarrelKalmanParamsESProducer::~L1TMuonBarrelKalmanParamsESProducer() {}
0064 
0065 //
0066 // member functions
0067 //
0068 
0069 // ------------ method called to produce the data  ------------
0070 L1TMuonBarrelKalmanParamsESProducer::ReturnType L1TMuonBarrelKalmanParamsESProducer::produce(
0071     const L1TMuonBarrelKalmanParamsRcd& iRecord) {
0072   return std::make_unique<L1TMuonBarrelKalmanParams>(kalman_params);
0073 }
0074 
0075 //define this as a plug-in
0076 DEFINE_FWK_EVENTSETUP_MODULE(L1TMuonBarrelKalmanParamsESProducer);