Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include <iostream>
0002 #include <memory>
0003 #include <iostream>
0004 
0005 #include "FWCore/Framework/interface/ModuleFactory.h"
0006 #include "FWCore/Framework/interface/ESProducer.h"
0007 #include "FWCore/Framework/interface/ESHandle.h"
0008 #include "FWCore/Framework/interface/ESProducts.h"
0009 
0010 #include "CondFormats/L1TObjects/interface/L1TMuonEndCapParams.h"
0011 #include "CondFormats/DataRecord/interface/L1TMuonEndCapParamsRcd.h"
0012 #include "L1Trigger/L1TMuonEndCap/interface/EndCapParamsHelper.h"
0013 
0014 #include "FWCore/ParameterSet/interface/FileInPath.h"
0015 
0016 using namespace std;
0017 
0018 // Class declaration
0019 
0020 class L1TMuonEndCapParamsESProducer : public edm::ESProducer {
0021 public:
0022   L1TMuonEndCapParamsESProducer(const edm::ParameterSet&);
0023   ~L1TMuonEndCapParamsESProducer() override;
0024 
0025   using ReturnType = std::unique_ptr<L1TMuonEndCapParams>;
0026 
0027   ReturnType produce(const L1TMuonEndCapParamsRcd&);
0028 
0029 private:
0030   l1t::EndCapParamsHelper data_;
0031 };
0032 
0033 // Constructor
0034 
0035 L1TMuonEndCapParamsESProducer::L1TMuonEndCapParamsESProducer(const edm::ParameterSet& iConfig)
0036     : data_(new L1TMuonEndCapParams()) {
0037   // The following line is needed to tell the framework what data is being produced
0038   setWhatProduced(this);
0039 
0040   data_.SetPtAssignVersion(iConfig.getParameter<int>("PtAssignVersion"));
0041   data_.SetFirmwareVersion(iConfig.getParameter<int>("FirmwareVersion"));
0042   data_.SetPrimConvVersion(iConfig.getParameter<int>("PrimConvVersion"));
0043 }
0044 
0045 // Destructor
0046 
0047 L1TMuonEndCapParamsESProducer::~L1TMuonEndCapParamsESProducer() {}
0048 
0049 // Member functions
0050 
0051 // ------------ method called to produce the data  ------------
0052 L1TMuonEndCapParamsESProducer::ReturnType L1TMuonEndCapParamsESProducer::produce(const L1TMuonEndCapParamsRcd& iRecord) {
0053   return std::make_unique<L1TMuonEndCapParams>(*data_.getWriteInstance());
0054 }
0055 
0056 // Define this as a plug-in
0057 DEFINE_FWK_EVENTSETUP_MODULE(L1TMuonEndCapParamsESProducer);