Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 ///
0002 /// \class L1TCaloConfigESProducer
0003 ///
0004 /// Description: Produces configuration of Calo Trigger
0005 ///
0006 /// Implementation:
0007 ///    Dummy producer for L1 calo upgrade runtime configuration
0008 ///
0009 
0010 // system include files
0011 #include <memory>
0012 #include <iostream>
0013 #include <fstream>
0014 
0015 // user include files
0016 #include "FWCore/Framework/interface/ModuleFactory.h"
0017 #include "FWCore/Framework/interface/ESProducer.h"
0018 #include "FWCore/Framework/interface/ESHandle.h"
0019 #include "FWCore/Framework/interface/ESProducts.h"
0020 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0021 
0022 #include "FWCore/ParameterSet/interface/FileInPath.h"
0023 
0024 #include "CondFormats/L1TObjects/interface/CaloConfig.h"
0025 #include "L1Trigger/L1TCalorimeter/interface/CaloConfigHelper.h"
0026 #include "CondFormats/DataRecord/interface/L1TCaloConfigRcd.h"
0027 
0028 using namespace std;
0029 
0030 //
0031 // class declaration
0032 //
0033 
0034 using namespace l1t;
0035 
0036 class L1TCaloConfigESProducer : public edm::ESProducer {
0037 public:
0038   L1TCaloConfigESProducer(const edm::ParameterSet&);
0039   ~L1TCaloConfigESProducer() override;
0040 
0041   using ReturnType = std::unique_ptr<CaloConfig>;
0042 
0043   ReturnType produce(const L1TCaloConfigRcd&);
0044 
0045 private:
0046   CaloConfig m_params;
0047   std::string m_label;
0048 };
0049 
0050 //
0051 // constants, enums and typedefs
0052 //
0053 
0054 //
0055 // static data member definitions
0056 //
0057 
0058 //
0059 // constructors and destructor
0060 //
0061 L1TCaloConfigESProducer::L1TCaloConfigESProducer(const edm::ParameterSet& conf) {
0062   //the following line is needed to tell the framework what
0063   // data is being produced
0064   setWhatProduced(this);
0065   //setWhatProduced(this, conf.getParameter<std::string>("label"));
0066 
0067   std::string l1epoch = conf.getParameter<string>("l1Epoch");
0068   unsigned fwv = conf.getParameter<unsigned>("fwVersionLayer2");
0069   CaloConfigHelper h(m_params, fwv, l1epoch);
0070 }
0071 
0072 L1TCaloConfigESProducer::~L1TCaloConfigESProducer() {
0073   // do anything here that needs to be done at desctruction time
0074   // (e.g. close files, deallocate resources etc.)
0075 }
0076 
0077 //
0078 // member functions
0079 //
0080 
0081 // ------------ method called to produce the data  ------------
0082 L1TCaloConfigESProducer::ReturnType L1TCaloConfigESProducer::produce(const L1TCaloConfigRcd& iRecord) {
0083   return std::make_unique<CaloConfig>(m_params);
0084 }
0085 
0086 //define this as a plug-in
0087 DEFINE_FWK_EVENTSETUP_MODULE(L1TCaloConfigESProducer);