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
#include "
CondFormats/DataRecord/interface/SiPhase2OuterTrackerLorentzAngleRcd.h
"
11
12
#include "
RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h
"
13
#include "
RecoLocalTracker/ClusterParameterEstimator/interface/ClusterParameterEstimator.h
"
14
#include "
RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h
"
15
#include "
RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPEGeometric.h
"
16
17
#include "
DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h
"
18
19
#include <memory>
20
#include <map>
21
22
class
Phase2StripCPEESProducer
:
public
edm::ESProducer
{
23
public
:
24
Phase2StripCPEESProducer
(
const
edm::ParameterSet
&);
25
std::unique_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> >
produce
(
const
TkPhase2OTCPERecord
& iRecord);
26
27
private
:
28
enum
CPE_t
{
DEFAULT
,
GEOMETRIC
};
29
30
edm::ESGetToken<MagneticField, IdealMagneticFieldRecord>
magfieldToken_
;
31
edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord>
pDDToken_
;
32
edm::ESGetToken<SiPhase2OuterTrackerLorentzAngle, SiPhase2OuterTrackerLorentzAngleRcd>
lorentzAngleToken_
;
33
CPE_t
cpeNum_
;
34
edm::ParameterSet
pset_
;
35
};
36
37
Phase2StripCPEESProducer::Phase2StripCPEESProducer
(
const
edm::ParameterSet
&
p
) {
38
std::string
name
=
p
.getParameter<
std::string
>(
"ComponentType"
);
39
40
std::map<std::string, CPE_t> enumMap;
41
enumMap[
std::string
(
"Phase2StripCPE"
)] =
DEFAULT
;
42
enumMap[
std::string
(
"Phase2StripCPEGeometric"
)] =
GEOMETRIC
;
43
if
(enumMap.find(
name
) == enumMap.end())
44
throw
cms::Exception
(
"Unknown StripCPE type"
) <<
name
;
45
46
cpeNum_
= enumMap[
name
];
47
pset_
=
p
.getParameter<
edm::ParameterSet
>(
"parameters"
);
48
auto
c
=
setWhatProduced
(
this
,
name
);
49
if
(
cpeNum_
!=
GEOMETRIC
) {
50
magfieldToken_
=
c
.consumes();
51
pDDToken_
=
c
.consumes();
52
lorentzAngleToken_
=
c
.consumes();
53
}
54
}
55
56
std::unique_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> >
Phase2StripCPEESProducer::produce
(
57
const
TkPhase2OTCPERecord
& iRecord) {
58
std::unique_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> > cpe_;
59
switch
(
cpeNum_
) {
60
case
DEFAULT
:
61
cpe_ = std::make_unique<Phase2StripCPE>(
62
pset_
, iRecord.
get
(
magfieldToken_
), iRecord.
get
(
pDDToken_
), iRecord.
get
(
lorentzAngleToken_
));
63
break
;
64
65
case
GEOMETRIC
:
66
cpe_ = std::make_unique<Phase2StripCPEGeometric>(
pset_
);
67
break
;
68
}
69
return
cpe_;
70
}
71
72
#include "
FWCore/Framework/interface/ModuleFactory.h
"
73
DEFINE_FWK_EVENTSETUP_MODULE
(
Phase2StripCPEESProducer
);
Phase2StripCPEESProducer::GEOMETRIC
Definition:
Phase2StripCPEESProducer.cc:28
Phase2StripCPEESProducer::cpeNum_
CPE_t cpeNum_
Definition:
Phase2StripCPEESProducer.cc:33
TrackerGeometry.h
ESHandle.h
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
TkPhase2OTCPERecord.h
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:163
ESProducer.h
Phase2StripCPEESProducer::produce
std::unique_ptr< ClusterParameterEstimator< Phase2TrackerCluster1D > > produce(const TkPhase2OTCPERecord &iRecord)
Definition:
Phase2StripCPEESProducer.cc:56
SiPhase2OuterTrackerLorentzAngleRcd.h
TrackerTopology.h
Phase2StripCPEESProducer
Definition:
Phase2StripCPEESProducer.cc:22
Phase2StripCPEGeometric.h
IdealMagneticFieldRecord.h
Phase2StripCPEESProducer::magfieldToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
Definition:
Phase2StripCPEESProducer.cc:30
Phase2StripCPE.h
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:103
TkPhase2OTCPERecord
Definition:
TkPhase2OTCPERecord.h:12
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
Phase2StripCPEESProducer::pDDToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > pDDToken_
Definition:
Phase2StripCPEESProducer.cc:31
edm::ParameterSet
Definition:
ParameterSet.h:47
Phase2StripCPEESProducer::lorentzAngleToken_
edm::ESGetToken< SiPhase2OuterTrackerLorentzAngle, SiPhase2OuterTrackerLorentzAngleRcd > lorentzAngleToken_
Definition:
Phase2StripCPEESProducer.cc:32
MagneticField.h
Phase2StripCPEESProducer::CPE_t
CPE_t
Definition:
Phase2StripCPEESProducer.cc:28
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:28
Skims_PA_cff.name
name
Definition:
Skims_PA_cff.py:17
edm::ESProducer
Definition:
ESProducer.h:104
cms::Exception
Definition:
Exception.h:70
ClusterParameterEstimator.h
ParameterSet.h
Phase2StripCPEESProducer::pset_
edm::ParameterSet pset_
Definition:
Phase2StripCPEESProducer.cc:34
Phase2StripCPEESProducer::Phase2StripCPEESProducer
Phase2StripCPEESProducer(const edm::ParameterSet &)
Definition:
Phase2StripCPEESProducer.cc:37
Generated for CMSSW Reference Manual by
1.8.16