Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "FWCore/Framework/interface/ESProducer.h"
0002 #include "FWCore/Framework/interface/ModuleFactory.h"
0003 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0004 #include "FWCore/Utilities/interface/ESGetToken.h"
0005 #include "L1Trigger/TrackFindingTracklet/interface/ChannelAssignment.h"
0006 #include "L1Trigger/TrackTrigger/interface/Setup.h"
0007 
0008 #include <memory>
0009 
0010 using namespace std;
0011 using namespace edm;
0012 using namespace tt;
0013 
0014 namespace trklet {
0015 
0016   /*! \class  trklet::ProducerChannelAssignment
0017    *  \brief  Creates ChannelAssignment class that assigns tracklet tracks and stubs
0018    *          to output channel as well as DTC stubs to input channel
0019    *  \author Thomas Schuh
0020    *  \date   2020, Nov
0021    */
0022   class ProducerChannelAssignment : public ESProducer {
0023   public:
0024     ProducerChannelAssignment(const ParameterSet& iConfig);
0025     ~ProducerChannelAssignment() override {}
0026     unique_ptr<ChannelAssignment> produce(const ChannelAssignmentRcd& rcd);
0027 
0028   private:
0029     const ParameterSet iConfig_;
0030     ESGetToken<Setup, SetupRcd> esGetToken_;
0031   };
0032 
0033   ProducerChannelAssignment::ProducerChannelAssignment(const ParameterSet& iConfig) : iConfig_(iConfig) {
0034     auto cc = setWhatProduced(this);
0035     esGetToken_ = cc.consumes();
0036   }
0037 
0038   unique_ptr<ChannelAssignment> ProducerChannelAssignment::produce(const ChannelAssignmentRcd& rcd) {
0039     const Setup* setup = &rcd.get(esGetToken_);
0040     return make_unique<ChannelAssignment>(iConfig_, setup);
0041   }
0042 
0043 }  // namespace trklet
0044 
0045 DEFINE_FWK_EVENTSETUP_MODULE(trklet::ProducerChannelAssignment);