CMS 3D CMS Logo

ProducerES.cc
Go to the documentation of this file.
10 
11 #include <memory>
12 
13 using namespace std;
14 using namespace edm;
15 
16 namespace trackerDTC {
17 
23  class ProducerES : public ESProducer {
24  public:
25  ProducerES(const ParameterSet& iConfig);
26  ~ProducerES() override {}
27  unique_ptr<Setup> produce(const SetupRcd& setupRcd);
28 
29  private:
37  };
38 
39  ProducerES::ProducerES(const ParameterSet& iConfig) : iConfig_(iConfig) {
40  auto cc = setWhatProduced(this);
41  getTokenTTStubAlgorithm_ = cc.consumes();
42  getTokenMagneticField_ = cc.consumes();
43  getTokenTrackerGeometry_ = cc.consumes();
44  getTokenTrackerTopology_ = cc.consumes();
45  getTokenCablingMap_ = cc.consumes();
47  }
48 
49  unique_ptr<Setup> ProducerES::produce(const SetupRcd& setupRcd) {
51  const TrackerGeometry& trackerGeometry = setupRcd.get(getTokenTrackerGeometry_);
52  const TrackerTopology& trackerTopology = setupRcd.get(getTokenTrackerTopology_);
53  const TrackerDetToDTCELinkCablingMap& cablingMap = setupRcd.get(getTokenCablingMap_);
54  const ESHandle<StubAlgorithm> handleStubAlgorithm = setupRcd.getHandle(getTokenTTStubAlgorithm_);
55  const ESHandle<DDCompactView> handleGeometryConfiguration = setupRcd.getHandle(getTokenGeometryConfiguration_);
56  const ParameterSetID& pSetIdTTStubAlgorithm = handleStubAlgorithm.description()->pid_;
57  const ParameterSetID& pSetIdGeometryConfiguration = handleGeometryConfiguration.description()->pid_;
58  const StubAlgorithmOfficial& stubAlgoritm =
59  *dynamic_cast<const StubAlgorithmOfficial*>(&setupRcd.get(getTokenTTStubAlgorithm_));
60  const ParameterSet& pSetStubAlgorithm = getParameterSet(handleStubAlgorithm.description()->pid_);
61  const ParameterSet& pSetGeometryConfiguration = getParameterSet(handleGeometryConfiguration.description()->pid_);
62  return make_unique<Setup>(iConfig_,
64  trackerGeometry,
65  trackerTopology,
66  cablingMap,
67  stubAlgoritm,
68  pSetStubAlgorithm,
69  pSetGeometryConfiguration,
70  pSetIdTTStubAlgorithm,
71  pSetIdGeometryConfiguration);
72  }
73 
74 } // namespace trackerDTC
75 
TrackerDetToDTCELinkCablingMap
Definition: TrackerDetToDTCELinkCablingMap.h:29
ESHandle.h
trackerDTC::ProducerES::produce
unique_ptr< Setup > produce(const SetupRcd &setupRcd)
Definition: ProducerES.cc:49
edm::eventsetup::DependentRecordImplementation::getHandle
ESHandle< ProductT > getHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:87
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackerTopology
Definition: TrackerTopology.h:16
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
ESProducer.h
trackerDTC::ProducerES::getTokenGeometryConfiguration_
ESGetToken< DDCompactView, IdealGeometryRecord > getTokenGeometryConfiguration_
Definition: ProducerES.cc:36
HLT_FULL_cff.magneticField
magneticField
Definition: HLT_FULL_cff.py:348
TTStubAlgorithm_official
Class for "official" algorithm to be used in TTStubBuilder.
Definition: TTStubAlgorithm_official.h:37
ESGetToken.h
cc
trackerDTC::ProducerES::getTokenTrackerGeometry_
ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > getTokenTrackerGeometry_
Definition: ProducerES.cc:33
trackerDTC::ProducerES
Class to produce setup of Track Trigger emulators.
Definition: ProducerES.cc:23
trackerDTC::ProducerES::~ProducerES
~ProducerES() override
Definition: ProducerES.cc:26
IdealMagneticFieldRecord.h
edm::ESHandle
Definition: DTSurvey.h:22
edm::Hash< ParameterSetType >
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:109
edm::ParameterSet
Definition: ParameterSet.h:47
trackerDTC::ProducerES::getTokenTrackerTopology_
ESGetToken< TrackerTopology, TrackerTopologyRcd > getTokenTrackerTopology_
Definition: ProducerES.cc:34
trackerDTC::SetupRcd
Definition: SetupRcd.h:25
edm::ESHandleBase::description
edm::eventsetup::ComponentDescription const * description() const
Definition: ESHandle.cc:9
MagneticField.h
trackerDTC
Definition: DTC.h:10
trackerDTC::ProducerES::iConfig_
const ParameterSet iConfig_
Definition: ProducerES.cc:30
edm::ESGetToken
Definition: EventSetup.h:48
trackerDTC::ProducerES::getTokenCablingMap_
ESGetToken< TrackerDetToDTCELinkCablingMap, TrackerDetToDTCELinkCablingMapRcd > getTokenCablingMap_
Definition: ProducerES.cc:35
Setup.h
trackerDTC::ProducerES::getTokenTTStubAlgorithm_
ESGetToken< StubAlgorithm, TTStubAlgorithmRecord > getTokenTTStubAlgorithm_
Definition: ProducerES.cc:31
edm::getParameterSet
ParameterSet const & getParameterSet(ParameterSetID const &id)
Definition: ParameterSet.cc:862
ESInputTag.h
std
Definition: JetResolutionObject.h:76
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
trackerDTC::ProducerES::getTokenMagneticField_
ESGetToken< MagneticField, IdealMagneticFieldRecord > getTokenMagneticField_
Definition: ProducerES.cc:32
edm::eventsetup::ComponentDescription::pid_
ParameterSetID pid_
Definition: ComponentDescription.h:37
edm::ESProducer
Definition: ESProducer.h:104
ParameterSetID.h
ParameterSet.h
MagneticField
Definition: MagneticField.h:19
TrackerGeometry
Definition: TrackerGeometry.h:14