Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:25:42

0001 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0002 #include "TrackingTools/Records/interface/TransientRecHitRecord.h"
0003 
0004 #include "RecoMTD/TransientTrackingRecHit/interface/MTDTransientTrackingRecHitBuilder.h"
0005 
0006 #include "FWCore/Framework/interface/EventSetup.h"
0007 #include "FWCore/Framework/interface/ESHandle.h"
0008 
0009 #include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"
0010 #include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
0011 #include "TrackingTools/Records/interface/TransientRecHitRecord.h"
0012 
0013 #include <memory>
0014 
0015 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h"
0016 
0017 #include "FWCore/Framework/interface/ESProducer.h"
0018 #include "FWCore/Utilities/interface/ESGetToken.h"
0019 
0020 class TransientRecHitRecord;
0021 
0022 class MTDTransientTrackingRecHitBuilderESProducer : public edm::ESProducer {
0023 public:
0024   /// Constructor
0025   MTDTransientTrackingRecHitBuilderESProducer(const edm::ParameterSet&);
0026 
0027   /// Destructor
0028   ~MTDTransientTrackingRecHitBuilderESProducer() override = default;
0029 
0030   // Operations
0031   std::unique_ptr<TransientTrackingRecHitBuilder> produce(const TransientRecHitRecord&);
0032 
0033 private:
0034   const edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> geomToken_;
0035 };
0036 
0037 using namespace edm;
0038 using namespace std;
0039 
0040 MTDTransientTrackingRecHitBuilderESProducer::MTDTransientTrackingRecHitBuilderESProducer(
0041     const ParameterSet& parameterSet)
0042     : geomToken_(setWhatProduced(this, parameterSet.getParameter<string>("ComponentName")).consumes()) {}
0043 
0044 std::unique_ptr<TransientTrackingRecHitBuilder> MTDTransientTrackingRecHitBuilderESProducer::produce(
0045     const TransientRecHitRecord& iRecord) {
0046   return std::make_unique<MTDTransientTrackingRecHitBuilder>(iRecord.getHandle(geomToken_));
0047 }
0048 
0049 #include "FWCore/Framework/interface/ModuleFactory.h"
0050 #include "FWCore/Utilities/interface/typelookup.h"
0051 
0052 DEFINE_FWK_EVENTSETUP_MODULE(MTDTransientTrackingRecHitBuilderESProducer);