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 
43  ReturnType produce(const DetIdAssociatorRecord&);
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
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
std::unique_ptr< DetIdAssociator > ReturnType
DetIdAssociatorESProducer(const edm::ParameterSet &)
ReturnType produce(const DetIdAssociatorRecord &)
std::unique_ptr< const DetIdAssociatorMaker > maker_
#define LogTrace(id)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60