Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "FWCore/Framework/interface/ESProducer.h"
0002 #include "FWCore/Framework/interface/ESHandle.h"
0003 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0004 #include "FWCore/Utilities/interface/ESGetToken.h"
0005 #include "FWCore/Utilities/interface/ESInputTag.h"
0006 #include "DataFormats/Provenance/interface/ParameterSetID.h"
0007 #include "L1Trigger/TrackerTFP/interface/DataFormats.h"
0008 
0009 #include <memory>
0010 
0011 using namespace std;
0012 using namespace edm;
0013 using namespace tt;
0014 
0015 namespace trackerTFP {
0016 
0017   /*! \class  trackerTFP::ProducerES
0018    *  \brief  Class to produce setup of Track Trigger emulator data formats
0019    *  \author Thomas Schuh
0020    *  \date   2020, June
0021    */
0022   class ProducerES : public ESProducer {
0023   public:
0024     ProducerES(const ParameterSet& iConfig);
0025     ~ProducerES() override {}
0026     unique_ptr<DataFormats> produce(const DataFormatsRcd& rcd);
0027 
0028   private:
0029     const ParameterSet iConfig_;
0030     ESGetToken<Setup, SetupRcd> esGetToken_;
0031   };
0032 
0033   ProducerES::ProducerES(const ParameterSet& iConfig) : iConfig_(iConfig) {
0034     auto cc = setWhatProduced(this);
0035     esGetToken_ = cc.consumes();
0036   }
0037 
0038   unique_ptr<DataFormats> ProducerES::produce(const DataFormatsRcd& rcd) {
0039     const Setup* setup = &rcd.get(esGetToken_);
0040     return make_unique<DataFormats>(iConfig_, setup);
0041   }
0042 
0043 }  // namespace trackerTFP
0044 
0045 DEFINE_FWK_EVENTSETUP_MODULE(trackerTFP::ProducerES);