Geometry
TrackerGeometryBuilder
plugins
TrackerParametersESModule.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/ESProducer.h
"
2
#include "
FWCore/Framework/interface/ModuleFactory.h
"
3
#include "
FWCore/Framework/interface/ESHandle.h
"
4
#include "
FWCore/Framework/interface/ESTransientHandle.h
"
5
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
6
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
7
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
8
#include "
DetectorDescription/Core/interface/DDCompactView.h
"
9
#include "
Geometry/Records/interface/IdealGeometryRecord.h
"
10
#include "
Geometry/Records/interface/PTrackerParametersRcd.h
"
11
#include "
Geometry/Records/interface/IdealGeometryRecord.h
"
12
#include "
Geometry/TrackerGeometryBuilder/interface/TrackerParametersFromDD.h
"
13
#include "
CondFormats/GeometryObjects/interface/PTrackerParameters.h
"
14
15
#include <memory>
16
17
namespace
edm
{
18
class
ConfigurationDescriptions
;
19
}
20
class
PTrackerParameters
;
21
class
PTrackerParametersRcd
;
22
23
class
TrackerParametersESModule
:
public
edm::ESProducer
{
24
public
:
25
TrackerParametersESModule
(
const
edm::ParameterSet
&);
26
~TrackerParametersESModule
(
void
)
override
;
27
28
using
ReturnType
= std::unique_ptr<PTrackerParameters>;
29
30
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
&);
31
32
ReturnType
produce
(
const
PTrackerParametersRcd
&);
33
34
private
:
35
edm::ESGetToken<DDCompactView, IdealGeometryRecord>
geomToken_
;
36
};
37
38
TrackerParametersESModule::TrackerParametersESModule
(
const
edm::ParameterSet
&) {
39
edm::LogInfo
(
"TRACKER"
) <<
"TrackerParametersESModule::TrackerParametersESModule"
;
40
41
setWhatProduced
(
this
).setConsumes(
geomToken_
);
42
}
43
44
TrackerParametersESModule::~TrackerParametersESModule
() {}
45
46
void
TrackerParametersESModule::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
47
edm::ParameterSetDescription
desc;
48
descriptions.
add
(
"trackerParameters"
, desc);
49
}
50
51
TrackerParametersESModule::ReturnType
TrackerParametersESModule::produce
(
const
PTrackerParametersRcd
& iRecord) {
52
edm::LogInfo
(
"TrackerParametersESModule"
)
53
<<
"TrackerParametersESModule::produce(const PTrackerParametersRcd& iRecord)"
<< std::endl;
54
edm::ESTransientHandle<DDCompactView>
cpv = iRecord.
getTransientHandle
(
geomToken_
);
55
56
auto
ptp = std::make_unique<PTrackerParameters>();
57
TrackerParametersFromDD
builder;
58
builder.
build
(&(*cpv), *ptp);
59
60
return
ptp;
61
}
62
63
DEFINE_FWK_EVENTSETUP_MODULE
(
TrackerParametersESModule
);
ConfigurationDescriptions.h
TrackerParametersFromDD.h
ESTransientHandle.h
PTrackerParameters
Definition:
PTrackerParameters.h:6
ESHandle.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::LogInfo
Definition:
MessageLogger.h:254
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:138
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
TrackerParametersESModule::ReturnType
std::unique_ptr< PTrackerParameters > ReturnType
Definition:
TrackerParametersESModule.cc:28
ESProducer.h
TrackerParametersESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition:
TrackerParametersESModule.cc:46
TrackerParametersESModule::~TrackerParametersESModule
~TrackerParametersESModule(void) override
Definition:
TrackerParametersESModule.cc:44
PTrackerParameters.h
DDCompactView.h
PTrackerParametersRcd
Definition:
PTrackerParametersRcd.h:9
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
edm::eventsetup::DependentRecordImplementation::getTransientHandle
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:99
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
TrackerParametersESModule::geomToken_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > geomToken_
Definition:
TrackerParametersESModule.cc:35
edm::ParameterSet
Definition:
ParameterSet.h:36
PTrackerParametersRcd.h
IdealGeometryRecord.h
edm::ESGetToken< DDCompactView, IdealGeometryRecord >
edm::ESTransientHandle
Definition:
ESTransientHandle.h:41
TrackerParametersESModule::TrackerParametersESModule
TrackerParametersESModule(const edm::ParameterSet &)
Definition:
TrackerParametersESModule.cc:38
ModuleFactory.h
ConfigurationDescriptions
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
TrackerParametersESModule::produce
ReturnType produce(const PTrackerParametersRcd &)
Definition:
TrackerParametersESModule.cc:51
TrackerParametersFromDD::build
bool build(const DDCompactView *, PTrackerParameters &)
Definition:
TrackerParametersFromDD.cc:9
edm::ESProducer
Definition:
ESProducer.h:101
TrackerParametersFromDD
Definition:
TrackerParametersFromDD.h:14
ParameterSet.h
TrackerParametersESModule
Definition:
TrackerParametersESModule.cc:23
Generated for CMSSW Reference Manual by
1.8.16