RecoLocalTracker
Phase2TrackerRecHits
plugins
Phase2StripCPEESProducer.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/ESProducer.h
"
2
#include "
FWCore/Framework/interface/ESHandle.h
"
3
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
4
#include "
FWCore/Framework/interface/ModuleFactory.h
"
5
6
#include "
Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h
"
7
#include "
DataFormats/TrackerCommon/interface/TrackerTopology.h
"
8
#include "
MagneticField/Engine/interface/MagneticField.h
"
9
#include "
MagneticField/Records/interface/IdealMagneticFieldRecord.h
"
10
11
#include "
RecoLocalTracker/Records/interface/TkStripCPERecord.h
"
12
#include "
RecoLocalTracker/ClusterParameterEstimator/interface/ClusterParameterEstimator.h
"
13
#include "
RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h
"
14
#include "
RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPEGeometric.h
"
15
16
#include "
DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h
"
17
18
#include <memory>
19
#include <map>
20
21
class
Phase2StripCPEESProducer
:
public
edm::ESProducer
{
22
public
:
23
Phase2StripCPEESProducer
(
const
edm::ParameterSet
&);
24
std::unique_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> >
produce
(
const
TkStripCPERecord
& iRecord);
25
26
private
:
27
enum
CPE_t
{
DEFAULT
,
GEOMETRIC
};
28
29
edm::ESGetToken<MagneticField, IdealMagneticFieldRecord>
magfieldToken_
;
30
edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord>
pDDToken_
;
31
CPE_t
cpeNum_
;
32
edm::ParameterSet
pset_
;
33
};
34
35
Phase2StripCPEESProducer::Phase2StripCPEESProducer
(
const
edm::ParameterSet
&
p
) {
36
std::string
name
=
p
.getParameter<
std::string
>(
"ComponentType"
);
37
38
std::map<std::string, CPE_t> enumMap;
39
enumMap[
std::string
(
"Phase2StripCPE"
)] =
DEFAULT
;
40
enumMap[
std::string
(
"Phase2StripCPEGeometric"
)] =
GEOMETRIC
;
41
if
(enumMap.find(
name
) == enumMap.end())
42
throw
cms::Exception
(
"Unknown StripCPE type"
) <<
name
;
43
44
cpeNum_
= enumMap[
name
];
45
pset_
=
p
.getParameter<
edm::ParameterSet
>(
"parameters"
);
46
auto
c
=
setWhatProduced
(
this
,
name
);
47
if
(
cpeNum_
!=
GEOMETRIC
) {
48
c
.setConsumes(
magfieldToken_
);
49
c
.setConsumes(
pDDToken_
);
50
}
51
}
52
53
std::unique_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> >
Phase2StripCPEESProducer::produce
(
54
const
TkStripCPERecord
& iRecord) {
55
std::unique_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> > cpe_;
56
switch
(
cpeNum_
) {
57
case
DEFAULT
:
58
cpe_ = std::make_unique<Phase2StripCPE>(
pset_
, iRecord.
get
(
magfieldToken_
), iRecord.
get
(
pDDToken_
));
59
break
;
60
61
case
GEOMETRIC
:
62
cpe_ = std::make_unique<Phase2StripCPEGeometric>(
pset_
);
63
break
;
64
}
65
return
cpe_;
66
}
67
68
#include "
FWCore/Framework/interface/ModuleFactory.h
"
69
DEFINE_FWK_EVENTSETUP_MODULE
(
Phase2StripCPEESProducer
);
Phase2StripCPEESProducer::GEOMETRIC
Definition:
Phase2StripCPEESProducer.cc:27
Phase2StripCPEESProducer::cpeNum_
CPE_t cpeNum_
Definition:
Phase2StripCPEESProducer.cc:31
TrackerGeometry.h
ESHandle.h
TkStripCPERecord.h
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
TkStripCPERecord
Definition:
TkStripCPERecord.h:13
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:138
ESProducer.h
TrackerTopology.h
Phase2StripCPEESProducer::produce
std::unique_ptr< ClusterParameterEstimator< Phase2TrackerCluster1D > > produce(const TkStripCPERecord &iRecord)
Definition:
Phase2StripCPEESProducer.cc:53
Phase2StripCPEESProducer
Definition:
Phase2StripCPEESProducer.cc:21
Phase2StripCPEGeometric.h
IdealMagneticFieldRecord.h
Phase2StripCPEESProducer::magfieldToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
Definition:
Phase2StripCPEESProducer.cc:29
Phase2StripCPE.h
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:112
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
Phase2StripCPEESProducer::pDDToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > pDDToken_
Definition:
Phase2StripCPEESProducer.cc:30
edm::ParameterSet
Definition:
ParameterSet.h:36
MagneticField.h
Phase2StripCPEESProducer::CPE_t
CPE_t
Definition:
Phase2StripCPEESProducer.cc:27
HltBtagPostValidation_cff.c
c
Definition:
HltBtagPostValidation_cff.py:31
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord >
ModuleFactory.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
Phase2TrackerCluster1D.h
Phase2StripCPEESProducer::DEFAULT
Definition:
Phase2StripCPEESProducer.cc:27
Skims_PA_cff.name
name
Definition:
Skims_PA_cff.py:17
edm::ESProducer
Definition:
ESProducer.h:101
cms::Exception
Definition:
Exception.h:70
ClusterParameterEstimator.h
ParameterSet.h
Phase2StripCPEESProducer::pset_
edm::ParameterSet pset_
Definition:
Phase2StripCPEESProducer.cc:32
Phase2StripCPEESProducer::Phase2StripCPEESProducer
Phase2StripCPEESProducer(const edm::ParameterSet &)
Definition:
Phase2StripCPEESProducer.cc:35
Generated for CMSSW Reference Manual by
1.8.16