CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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:
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();
46  getTokenGeometryConfiguration_ = 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 
Class for &quot;official&quot; algorithm to be used in TTStubBuilder.
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
ESGetToken< DDCompactView, IdealGeometryRecord > getTokenGeometryConfiguration_
Definition: ProducerES.cc:36
ESGetToken< TrackerTopology, TrackerTopologyRcd > getTokenTrackerTopology_
Definition: ProducerES.cc:34
ESGetToken< StubAlgorithm, TTStubAlgorithmRecord > getTokenTTStubAlgorithm_
Definition: ProducerES.cc:31
ParameterSet const & getParameterSet(ParameterSetID const &id)
~ProducerES() override
Definition: ProducerES.cc:26
const ParameterSet iConfig_
Definition: ProducerES.cc:30
ESHandle< ProductT > getHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
tuple magneticField
ESGetToken< MagneticField, IdealMagneticFieldRecord > getTokenMagneticField_
Definition: ProducerES.cc:32
edm::eventsetup::ComponentDescription const * description() const
Definition: ESHandle.cc:9
Class to produce setup of Track Trigger emulators.
Definition: ProducerES.cc:23
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
ESGetToken< TrackerDetToDTCELinkCablingMap, TrackerDetToDTCELinkCablingMapRcd > getTokenCablingMap_
Definition: ProducerES.cc:35
ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > getTokenTrackerGeometry_
Definition: ProducerES.cc:33
unique_ptr< Setup > produce(const SetupRcd &setupRcd)
Definition: ProducerES.cc:49
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60