Geometry
MTDNumberingBuilder
plugins
MTDTopologyEP.cc
Go to the documentation of this file.
1
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
2
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
3
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
4
#include "
FWCore/Framework/interface/ModuleFactory.h
"
5
#include "
FWCore/Framework/interface/ESHandle.h
"
6
#include "
FWCore/Framework/interface/ESProducer.h
"
7
#include "
Geometry/MTDNumberingBuilder/interface/MTDTopology.h
"
8
#include "
Geometry/Records/interface/MTDTopologyRcd.h
"
9
#include "
CondFormats/GeometryObjects/interface/PMTDParameters.h
"
10
#include "
Geometry/Records/interface/PMTDParametersRcd.h
"
11
12
#include <memory>
13
//#define EDM_ML_DEBUG
14
15
class
MTDTopologyEP
:
public
edm::ESProducer
{
16
public
:
17
MTDTopologyEP
(
const
edm::ParameterSet
&);
18
19
using
ReturnType
= std::unique_ptr<MTDTopology>;
20
21
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions);
22
23
ReturnType
produce
(
const
MTDTopologyRcd
&);
24
25
private
:
26
void
fillParameters
(
const
PMTDParameters
&,
int
& mtdTopologyMode);
27
28
const
edm::ESGetToken<PMTDParameters, PMTDParametersRcd>
token_
;
29
};
30
31
MTDTopologyEP::MTDTopologyEP
(
const
edm::ParameterSet
& conf)
32
: token_{
setWhatProduced
(
this
).consumesFrom<
PMTDParameters
,
PMTDParametersRcd
>(
edm::ESInputTag
())} {}
33
34
void
MTDTopologyEP::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
35
edm::ParameterSetDescription
ttc;
36
descriptions.
add
(
"mtdTopology"
, ttc);
37
}
38
39
MTDTopologyEP::ReturnType
MTDTopologyEP::produce
(
const
MTDTopologyRcd
& iRecord) {
40
int
mtdTopologyMode;
41
42
fillParameters
(iRecord.
get
(
token_
), mtdTopologyMode);
43
44
return
std::make_unique<MTDTopology>(mtdTopologyMode);
45
}
46
47
void
MTDTopologyEP::fillParameters
(
const
PMTDParameters
& ptp,
int
& mtdTopologyMode) {
48
mtdTopologyMode = ptp.
topologyMode_
;
49
50
#ifdef EDM_ML_DEBUG
51
52
edm::LogInfo
(
"MTDTopologyEP"
) <<
"Topology mode = "
<< mtdTopologyMode;
53
54
#endif
55
}
56
57
DEFINE_FWK_EVENTSETUP_MODULE
(
MTDTopologyEP
);
ConfigurationDescriptions.h
PMTDParameters
Definition:
PMTDParameters.h:6
MTDTopologyEP::produce
ReturnType produce(const MTDTopologyRcd &)
Definition:
MTDTopologyEP.cc:39
MTDTopologyEP::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
MTDTopologyEP.cc:34
edm::ESInputTag
Definition:
ESInputTag.h:87
MessageLogger.h
MTDTopologyEP::token_
const edm::ESGetToken< PMTDParameters, PMTDParametersRcd > token_
Definition:
MTDTopologyEP.cc:28
ESHandle.h
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:163
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ESProducer.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition:
MessageLogger.h:125
MTDTopologyEP::ReturnType
std::unique_ptr< MTDTopology > ReturnType
Definition:
MTDTopologyEP.cc:19
MTDTopologyEP::fillParameters
void fillParameters(const PMTDParameters &, int &mtdTopologyMode)
Definition:
MTDTopologyEP.cc:47
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:57
ParameterSetDescription.h
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:109
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
MTDTopologyEP::MTDTopologyEP
MTDTopologyEP(const edm::ParameterSet &)
Definition:
MTDTopologyEP.cc:31
PMTDParametersRcd.h
edm::ParameterSet
Definition:
ParameterSet.h:47
MTDTopologyRcd
Definition:
MTDTopologyRcd.h:10
PMTDParametersRcd
Definition:
PMTDParametersRcd.h:9
PMTDParameters::topologyMode_
int topologyMode_
Definition:
PMTDParameters.h:20
edm::ESGetToken< PMTDParameters, PMTDParametersRcd >
ModuleFactory.h
MTDTopologyRcd.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
PMTDParameters.h
edm::ESProducer
Definition:
ESProducer.h:104
MTDTopologyEP
Definition:
MTDTopologyEP.cc:15
MTDTopology.h
Generated for CMSSW Reference Manual by
1.8.16