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