TrackingTools
TrackAssociator
plugins
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
23
#include "
FWCore/Framework/interface/ModuleFactory.h
"
24
#include "
FWCore/Framework/interface/ESProducer.h
"
25
26
#include "
TrackingTools/TrackAssociator/interface/DetIdAssociator.h
"
27
#include "
DetIdAssociatorFactory.h
"
28
#include "
DetIdAssociatorMaker.h
"
29
30
#include "
TrackingTools/Records/interface/DetIdAssociatorRecord.h
"
31
32
//
33
// class decleration
34
//
35
36
class
DetIdAssociatorESProducer
:
public
edm::ESProducer
{
37
public
:
38
DetIdAssociatorESProducer
(
const
edm::ParameterSet
&);
39
~DetIdAssociatorESProducer
()
override
;
40
41
typedef
std::unique_ptr<DetIdAssociator>
ReturnType
;
42
43
ReturnType
produce
(
const
DetIdAssociatorRecord
&);
44
45
private
:
46
const
std::string
cName
;
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
//
61
DetIdAssociatorESProducer::DetIdAssociatorESProducer
(
const
edm::ParameterSet
& iConfig)
62
: cName{iConfig.
getParameter
<
std::string
>(
"ComponentName"
)},
63
maker_{
DetIdAssociatorFactory::get
()->create(cName, iConfig, setWhatProduced(
this
, cName))} {}
64
65
DetIdAssociatorESProducer::~DetIdAssociatorESProducer
() {}
66
67
//
68
// member functions
69
//
70
71
// ------------ method called to produce the data ------------
72
DetIdAssociatorESProducer::ReturnType
DetIdAssociatorESProducer::produce
(
const
DetIdAssociatorRecord
& iRecord) {
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
82
DEFINE_FWK_EVENTSETUP_MODULE
(
DetIdAssociatorESProducer
);
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
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
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
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:224
Generated for CMSSW Reference Manual by
1.8.16