CMS 3D CMS Logo

DetIdAssociatorESProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: DetIdAssociatorESProducer
4 // Class: DetIdAssociatorESProducer
5 //
13 //
14 // Original Author: Jean-Roch Vlimant
15 // Created: Thu Oct 4 02:28:48 CEST 2007
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 
22 // user include files
25 
27 #include "DetIdAssociatorFactory.h"
28 #include "DetIdAssociatorMaker.h"
29 
31 
32 //
33 // class decleration
34 //
35 
37 public:
39  ~DetIdAssociatorESProducer() override;
40 
41  typedef std::unique_ptr<DetIdAssociator> ReturnType;
42 
44 
45 private:
47  std::unique_ptr<const DetIdAssociatorMaker> maker_;
48 };
49 
50 //
51 // constants, enums and typedefs
52 //
53 
54 //
55 // static data member definitions
56 //
57 
58 //
59 // constructors and destructor
60 //
62  : cName{iConfig.getParameter<std::string>("ComponentName")},
63  maker_{DetIdAssociatorFactory::get()->create(cName, iConfig, setWhatProduced(this, cName))} {}
64 
66 
67 //
68 // member functions
69 //
70 
71 // ------------ method called to produce the data ------------
73  using namespace edm::es;
74  LogTrace("TrackAssociator") << "Making DetIdAssociatorRecord with label: " << cName;
75  ReturnType dia = maker_->make(iRecord);
76  dia->buildMap();
77  LogTrace("TrackAssociator") << "Map id built for DetIdAssociatorRecord with label: " << cName;
78  return dia;
79 }
80 
81 //define this as a plug-in
ESProducer.h
DetIdAssociatorESProducer::~DetIdAssociatorESProducer
~DetIdAssociatorESProducer() override
Definition: DetIdAssociatorESProducer.cc:65
DetIdAssociatorESProducer::produce
ReturnType produce(const DetIdAssociatorRecord &)
Definition: DetIdAssociatorESProducer.cc:72
DetIdAssociatorESProducer::maker_
std::unique_ptr< const DetIdAssociatorMaker > maker_
Definition: DetIdAssociatorESProducer.cc:47
DetIdAssociatorFactory.h
edm::ParameterSet
Definition: ParameterSet.h:47
DetIdAssociatorMaker.h
DetIdAssociatorESProducer::cName
const std::string cName
Definition: DetIdAssociatorESProducer.cc:46
DetIdAssociatorRecord.h
get
#define get
DetIdAssociatorRecord
Definition: DetIdAssociatorRecord.h:13
DetIdAssociatorESProducer
Definition: DetIdAssociatorESProducer.cc:36
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ModuleFactory.h
DetIdAssociatorESProducer::ReturnType
std::unique_ptr< DetIdAssociator > ReturnType
Definition: DetIdAssociatorESProducer.cc:41
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
DetIdAssociator.h
edm::es
Definition: es_Label.h:33
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESProducer
Definition: ESProducer.h:104
DetIdAssociatorESProducer::DetIdAssociatorESProducer
DetIdAssociatorESProducer(const edm::ParameterSet &)
Definition: DetIdAssociatorESProducer.cc:61
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234