CMS 3D CMS Logo

ProducerES.cc
Go to the documentation of this file.
8 
9 #include <memory>
10 
11 using namespace std;
12 using namespace edm;
13 
14 namespace trackerDTC {
15 
21  class ProducerES : public ESProducer {
22  public:
23  ProducerES(const ParameterSet& iConfig);
24  ~ProducerES() override {}
25  unique_ptr<Setup> produce(const SetupRcd& setupRcd);
26 
27  private:
35  };
36 
37  ProducerES::ProducerES(const ParameterSet& iConfig) : iConfig_(iConfig) {
38  setWhatProduced(this)
39  .setConsumes(getTokenTTStubAlgorithm_)
40  .setConsumes(getTokenMagneticField_)
41  .setConsumes(getTokenTrackerGeometry_)
42  .setConsumes(getTokenTrackerTopology_)
43  .setConsumes(getTokenCablingMap_)
44  .setConsumes(getTokenGeometryConfiguration_);
45  }
46 
47  unique_ptr<Setup> ProducerES::produce(const SetupRcd& setupRcd) {
49  const TrackerGeometry& trackerGeometry = setupRcd.get(getTokenTrackerGeometry_);
50  const TrackerTopology& trackerTopology = setupRcd.get(getTokenTrackerTopology_);
51  const TrackerDetToDTCELinkCablingMap& cablingMap = setupRcd.get(getTokenCablingMap_);
52  const ESHandle<StubAlgorithm> handleStubAlgorithm = setupRcd.getHandle(getTokenTTStubAlgorithm_);
53  const ESHandle<DDCompactView> handleGeometryConfiguration = setupRcd.getHandle(getTokenGeometryConfiguration_);
54  const ParameterSetID& pSetIdTTStubAlgorithm = handleStubAlgorithm.description()->pid_;
55  const ParameterSetID& pSetIdGeometryConfiguration = handleGeometryConfiguration.description()->pid_;
56  const StubAlgorithmOfficial& stubAlgoritm =
57  *dynamic_cast<const StubAlgorithmOfficial*>(&setupRcd.get(getTokenTTStubAlgorithm_));
58  const ParameterSet& pSetStubAlgorithm = getParameterSet(handleStubAlgorithm.description()->pid_);
59  const ParameterSet& pSetGeometryConfiguration = getParameterSet(handleGeometryConfiguration.description()->pid_);
60  return make_unique<Setup>(iConfig_,
62  trackerGeometry,
63  trackerTopology,
64  cablingMap,
65  stubAlgoritm,
66  pSetStubAlgorithm,
67  pSetGeometryConfiguration,
68  pSetIdTTStubAlgorithm,
69  pSetIdGeometryConfiguration);
70  }
71 
72 } // namespace trackerDTC
73 
TrackerDetToDTCELinkCablingMap
Definition: TrackerDetToDTCELinkCablingMap.h:29
ESHandle.h
trackerDTC::ProducerES::produce
unique_ptr< Setup > produce(const SetupRcd &setupRcd)
Definition: ProducerES.cc:47
HLT_2018_cff.magneticField
magneticField
Definition: HLT_2018_cff.py:348
edm::eventsetup::DependentRecordImplementation::getHandle
ESHandle< ProductT > getHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:86
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:138
ESProducer.h
trackerDTC::ProducerES::getTokenGeometryConfiguration_
ESGetToken< DDCompactView, IdealGeometryRecord > getTokenGeometryConfiguration_
Definition: ProducerES.cc:34
TTStubAlgorithm_official
Class for "official" algorithm to be used in TTStubBuilder.
Definition: TTStubAlgorithm_official.h:37
ESGetToken.h
trackerDTC::ProducerES::getTokenTrackerGeometry_
ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > getTokenTrackerGeometry_
Definition: ProducerES.cc:31
trackerDTC::ProducerES
Class to produce setup of Track Trigger emulators.
Definition: ProducerES.cc:21
trackerDTC::ProducerES::~ProducerES
~ProducerES() override
Definition: ProducerES.cc:24
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:112
edm::ParameterSet
Definition: ParameterSet.h:36
trackerDTC::ProducerES::getTokenTrackerTopology_
ESGetToken< TrackerTopology, TrackerTopologyRcd > getTokenTrackerTopology_
Definition: ProducerES.cc:32
trackerDTC::SetupRcd
Definition: SetupRcd.h:25
edm::ESHandleBase::description
edm::eventsetup::ComponentDescription const * description() const
Definition: ESHandle.cc:9
trackerDTC
Definition: DTC.h:10
trackerDTC::ProducerES::iConfig_
const ParameterSet iConfig_
Definition: ProducerES.cc:28
edm::ESGetToken
Definition: EventSetup.h:48
trackerDTC::ProducerES::getTokenCablingMap_
ESGetToken< TrackerDetToDTCELinkCablingMap, TrackerDetToDTCELinkCablingMapRcd > getTokenCablingMap_
Definition: ProducerES.cc:33
Setup.h
trackerDTC::ProducerES::getTokenTTStubAlgorithm_
ESGetToken< StubAlgorithm, TTStubAlgorithmRecord > getTokenTTStubAlgorithm_
Definition: ProducerES.cc:29
edm::getParameterSet
ParameterSet const & getParameterSet(ParameterSetID const &id)
Definition: ParameterSet.cc:855
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:30
edm::eventsetup::ComponentDescription::pid_
ParameterSetID pid_
Definition: ComponentDescription.h:37
edm::ESProducer
Definition: ESProducer.h:101
ParameterSetID.h
ParameterSet.h
MagneticField
Definition: MagneticField.h:19
TrackerGeometry
Definition: TrackerGeometry.h:14