Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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/TrackerDTC/interface/LayerEncoding.h"
0008 
0009 #include <memory>
0010 
0011 using namespace std;
0012 using namespace edm;
0013 using namespace tt;
0014 
0015 namespace trackerDTC {
0016 
0017   /*! \class  trackerDTC::ProducerLayerEncoding
0018    *  \brief  Class to produce layer encoding used between DTC and TFP in Hybrid
0019    *  \author Thomas Schuh
0020    *  \date   2021, April
0021    */
0022   class ProducerLayerEncoding : public ESProducer {
0023   public:
0024     ProducerLayerEncoding(const ParameterSet& iConfig);
0025     ~ProducerLayerEncoding() override {}
0026     unique_ptr<LayerEncoding> produce(const LayerEncodingRcd& rcd);
0027 
0028   private:
0029     const ParameterSet iConfig_;
0030     ESGetToken<Setup, SetupRcd> esGetToken_;
0031   };
0032 
0033   ProducerLayerEncoding::ProducerLayerEncoding(const ParameterSet& iConfig) : iConfig_(iConfig) {
0034     auto cc = setWhatProduced(this);
0035     esGetToken_ = cc.consumes();
0036   }
0037 
0038   unique_ptr<LayerEncoding> ProducerLayerEncoding::produce(const LayerEncodingRcd& rcd) {
0039     const Setup* setup = &rcd.get(esGetToken_);
0040     return make_unique<LayerEncoding>(iConfig_, setup);
0041   }
0042 
0043 }  // namespace trackerDTC
0044 
0045 DEFINE_FWK_EVENTSETUP_MODULE(trackerDTC::ProducerLayerEncoding);