Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
d
e
f
l
m
o
p
s
t
u
v
Related Functions
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Package Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Geometry
EcalCommonData
plugins
EcalSimParametersESModule.cc
Go to the documentation of this file.
1
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
2
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
3
#include "
FWCore/Framework/interface/ModuleFactory.h
"
4
#include "
FWCore/Framework/interface/ESProducer.h
"
5
#include "
FWCore/Framework/interface/ESTransientHandle.h
"
6
#include "
CondFormats/GeometryObjects/interface/EcalSimulationParameters.h
"
7
#include "
DetectorDescription/Core/interface/DDCompactView.h
"
8
#include "
DetectorDescription/DDCMS/interface/DDCompactView.h
"
9
#include "
Geometry/Records/interface/IdealGeometryRecord.h
"
10
#include "
Geometry/EcalCommonData/interface/EcalSimParametersFromDD.h
"
11
12
#include <memory>
13
14
//#define EDM_ML_DEBUG
15
16
class
EcalSimParametersESModule
:
public
edm::ESProducer
{
17
public
:
18
EcalSimParametersESModule
(
const
edm::ParameterSet
&);
19
20
using
ReturnType
= std::unique_ptr<EcalSimulationParameters>;
21
22
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
&);
23
24
ReturnType
produce
(
const
IdealGeometryRecord
&);
25
26
private
:
27
edm::ESGetToken<DDCompactView, IdealGeometryRecord>
cpvTokenDDD_
;
28
edm::ESGetToken<cms::DDCompactView, IdealGeometryRecord>
cpvTokenDD4Hep_
;
29
const
bool
fromDD4Hep_
;
30
const
std::string
name_
;
31
};
32
33
EcalSimParametersESModule::EcalSimParametersESModule
(
const
edm::ParameterSet
& ps)
34
: fromDD4Hep_(ps.getParameter<
bool
>(
"fromDD4Hep"
)), name_(ps.getParameter<
std
::
string
>(
"name"
)) {
35
auto
cc
=
setWhatProduced
(
this
,
name_
);
36
if
(
fromDD4Hep_
) {
37
cpvTokenDD4Hep_
=
cc
.consumesFrom<
cms::DDCompactView
,
IdealGeometryRecord
>(
edm::ESInputTag
());
38
}
else
{
39
cpvTokenDDD_
=
cc
.consumesFrom<
DDCompactView
,
IdealGeometryRecord
>(
edm::ESInputTag
());
40
}
41
42
#ifdef EDM_ML_DEBUG
43
edm::LogVerbatim
(
"EcalGeom"
) <<
"EcalSimParametersESModule::EcalSimParametersESModule called with dd4hep: "
44
<<
fromDD4Hep_
<<
" for "
<<
name_
;
45
#endif
46
}
47
48
void
EcalSimParametersESModule::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
49
edm::ParameterSetDescription
desc
;
50
desc
.add<
bool
>(
"fromDD4Hep"
,
false
);
51
desc
.add<
std::string
>(
"name"
,
"EcalHitsEB"
);
52
descriptions.
add
(
"ecalSimulationParametersEB"
,
desc
);
53
}
54
55
EcalSimParametersESModule::ReturnType
EcalSimParametersESModule::produce
(
const
IdealGeometryRecord
& iRecord) {
56
#ifdef EDM_ML_DEBUG
57
edm::LogVerbatim
(
"EcalGeom"
) <<
"EcalSimParametersESModule::produce(const IdealGeometryRecord& iRecord)"
;
58
#endif
59
60
auto
ptp = std::make_unique<EcalSimulationParameters>();
61
EcalSimParametersFromDD
builder;
62
if
(
fromDD4Hep_
) {
63
#ifdef EDM_ML_DEBUG
64
edm::LogVerbatim
(
"EcalGeom"
) <<
"EcalSimParametersESModule::Try to access cms::DDCompactView"
;
65
#endif
66
edm::ESTransientHandle<cms::DDCompactView>
cpv = iRecord.
getTransientHandle
(
cpvTokenDD4Hep_
);
67
builder.
build
(&(*cpv),
name_
, *ptp);
68
}
else
{
69
#ifdef EDM_ML_DEBUG
70
edm::LogVerbatim
(
"EcalGeom"
) <<
"EcalSimParametersESModule::Try to access DDCompactView"
;
71
#endif
72
edm::ESTransientHandle<DDCompactView>
cpv = iRecord.
getTransientHandle
(
cpvTokenDDD_
);
73
builder.
build
(&(*cpv),
name_
, *ptp);
74
}
75
return
ptp;
76
}
77
78
DEFINE_FWK_EVENTSETUP_MODULE
(
EcalSimParametersESModule
);
ConfigurationDescriptions.h
electrons_cff.bool
bool
Definition:
electrons_cff.py:366
edm::ESInputTag
Definition:
ESInputTag.h:87
ESTransientHandle.h
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:163
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ESProducer.h
EcalSimParametersESModule::name_
const std::string name_
Definition:
EcalSimParametersESModule.cc:30
DDCompactView.h
EcalSimParametersFromDD
Definition:
EcalSimParametersFromDD.h:14
EcalSimParametersESModule::cpvTokenDD4Hep_
edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > cpvTokenDD4Hep_
Definition:
EcalSimParametersESModule.cc:28
EcalSimParametersESModule
Definition:
EcalSimParametersESModule.cc:16
EcalSimParametersESModule::fromDD4Hep_
const bool fromDD4Hep_
Definition:
EcalSimParametersESModule.cc:29
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition:
DDCompactView.h:81
edm::eventsetup::DependentRecordImplementation::getTransientHandle
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:98
EcalSimParametersESModule::cpvTokenDDD_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > cpvTokenDDD_
Definition:
EcalSimParametersESModule.cc:27
DDCompactView.h
ParameterSetDescription.h
EcalSimParametersFromDD::build
bool build(const DDCompactView *, const std::string &name, EcalSimulationParameters &)
Definition:
EcalSimParametersFromDD.cc:23
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
EcalSimParametersESModule::EcalSimParametersESModule
EcalSimParametersESModule(const edm::ParameterSet &)
Definition:
EcalSimParametersESModule.cc:33
EcalSimParametersFromDD.h
edm::ParameterSet
Definition:
ParameterSet.h:47
EcalSimulationParameters.h
IdealGeometryRecord.h
EcalSimParametersESModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition:
EcalSimParametersESModule.cc:48
cc
EcalSimParametersESModule::ReturnType
std::unique_ptr< EcalSimulationParameters > ReturnType
Definition:
EcalSimParametersESModule.cc:20
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ESGetToken< DDCompactView, IdealGeometryRecord >
edm::ESTransientHandle
Definition:
ESTransientHandle.h:41
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
std
Definition:
JetResolutionObject.h:76
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition:
MessageLogger.h:128
cms::DDCompactView
Definition:
DDCompactView.h:31
edm::ESProducer
Definition:
ESProducer.h:104
EcalSimParametersESModule::produce
ReturnType produce(const IdealGeometryRecord &)
Definition:
EcalSimParametersESModule.cc:55
IdealGeometryRecord
Definition:
IdealGeometryRecord.h:25
Generated for CMSSW Reference Manual by
1.8.16