RecoTracker
MeasurementDet
plugins
MaskedMeasurementTrackerEventProducer.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
2
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
3
#include "
FWCore/Framework/interface/Event.h
"
4
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
5
#include "
RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h
"
6
#include "
DataFormats/DetId/interface/DetIdCollection.h
"
7
8
class
dso_hidden
MaskedMeasurementTrackerEventProducer
final :
public
edm::stream::EDProducer
<> {
9
public
:
10
explicit
MaskedMeasurementTrackerEventProducer
(
const
edm::ParameterSet
&iConfig);
11
~MaskedMeasurementTrackerEventProducer
()
override
{}
12
13
private
:
14
void
produce(
edm::Event
&,
const
edm::EventSetup
&)
override
;
15
16
typedef
edm::ContainerMask<edmNew::DetSetVector<SiStripCluster>
>
StripMask
;
17
typedef
edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster>
>
PixelMask
;
18
typedef
edm::ContainerMask<edmNew::DetSetVector<Phase2TrackerCluster1D>
>
Phase2OTMask
;
19
20
edm::EDGetTokenT<MeasurementTrackerEvent>
src_
;
21
22
bool
skipClusters_
;
23
bool
phase2skipClusters_
;
24
25
edm::EDGetTokenT<StripMask>
maskStrips_
;
26
edm::EDGetTokenT<PixelMask>
maskPixels_
;
27
edm::EDGetTokenT<Phase2OTMask>
maskPhase2OTs_
;
28
};
29
30
MaskedMeasurementTrackerEventProducer::MaskedMeasurementTrackerEventProducer
(
const
edm::ParameterSet
&iConfig)
31
: src_(consumes<
MeasurementTrackerEvent
>(iConfig.getParameter<
edm
::
InputTag
>(
"src"
))),
32
skipClusters_(
false
),
33
phase2skipClusters_(
false
) {
34
//FIXME:temporary solution in order to use this class for both phase0/1 and phase2
35
if
(iConfig.
existsAs
<
edm::InputTag
>(
"clustersToSkip"
)) {
36
skipClusters_
=
true
;
37
edm::InputTag
clustersToSkip
= iConfig.
getParameter
<
edm::InputTag
>(
"clustersToSkip"
);
38
maskPixels_
= consumes<PixelMask>(
clustersToSkip
);
39
maskStrips_
= consumes<StripMask>(
clustersToSkip
);
40
}
41
if
(iConfig.
existsAs
<
edm::InputTag
>(
"phase2clustersToSkip"
)) {
42
phase2skipClusters_
=
true
;
43
edm::InputTag
phase2clustersToSkip
= iConfig.
getParameter
<
edm::InputTag
>(
"phase2clustersToSkip"
);
44
maskPixels_
= consumes<PixelMask>(
phase2clustersToSkip
);
45
maskPhase2OTs_
= consumes<Phase2OTMask>(
phase2clustersToSkip
);
46
}
47
produces<MeasurementTrackerEvent>();
48
}
49
50
void
MaskedMeasurementTrackerEventProducer::produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
&iSetup) {
51
edm::Handle<MeasurementTrackerEvent>
mte;
52
iEvent
.getByToken(
src_
, mte);
53
54
// prepare output
55
std::unique_ptr<MeasurementTrackerEvent>
out
;
56
57
if
(
skipClusters_
) {
58
edm::Handle<PixelMask>
maskPixels;
59
iEvent
.getByToken(
maskPixels_
, maskPixels);
60
edm::Handle<StripMask>
maskStrips;
61
iEvent
.getByToken(
maskStrips_
, maskStrips);
62
63
out
= std::make_unique<MeasurementTrackerEvent>(*mte, *maskStrips, *maskPixels);
64
65
}
else
if
(
phase2skipClusters_
) {
66
edm::Handle<PixelMask>
maskPixels;
67
iEvent
.getByToken(
maskPixels_
, maskPixels);
68
edm::Handle<Phase2OTMask>
maskPhase2OTs;
69
iEvent
.getByToken(
maskPhase2OTs_
, maskPhase2OTs);
70
71
out
= std::make_unique<MeasurementTrackerEvent>(*mte, *maskPixels, *maskPhase2OTs);
72
}
73
74
// put into event
75
iEvent
.put(
std::move
(
out
));
76
}
77
78
#include "
FWCore/Framework/interface/MakerMacros.h
"
79
DEFINE_FWK_MODULE
(
MaskedMeasurementTrackerEventProducer
);
MaskedMeasurementTrackerEventProducer
Definition:
MaskedMeasurementTrackerEventProducer.cc:8
MeasurementTrackerEvent.h
funct::false
false
Definition:
Factorize.h:29
HLT_FULL_cff.clustersToSkip
clustersToSkip
Definition:
HLT_FULL_cff.py:10020
edm::EDGetTokenT< MeasurementTrackerEvent >
edm
HLT enums.
Definition:
AlignableModifier.h:19
ConversionStep_cff.phase2clustersToSkip
phase2clustersToSkip
Definition:
ConversionStep_cff.py:304
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:89285
EDProducer.h
MaskedMeasurementTrackerEventProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
MaskedMeasurementTrackerEventProducer.cc:50
edm::ContainerMask
Definition:
ContainerMask.h:36
edm::ParameterSet::existsAs
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition:
ParameterSet.h:171
edm::Handle< MeasurementTrackerEvent >
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
MaskedMeasurementTrackerEventProducer::skipClusters_
bool skipClusters_
Definition:
MaskedMeasurementTrackerEventProducer.cc:22
MaskedMeasurementTrackerEventProducer::MaskedMeasurementTrackerEventProducer
MaskedMeasurementTrackerEventProducer(const edm::ParameterSet &iConfig)
Definition:
MaskedMeasurementTrackerEventProducer.cc:30
MaskedMeasurementTrackerEventProducer::StripMask
edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > StripMask
Definition:
MaskedMeasurementTrackerEventProducer.cc:16
dso_hidden
#define dso_hidden
Definition:
Visibility.h:12
MeasurementTrackerEvent
Definition:
MeasurementTrackerEvent.h:16
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
MaskedMeasurementTrackerEventProducer::src_
edm::EDGetTokenT< MeasurementTrackerEvent > src_
Definition:
MaskedMeasurementTrackerEventProducer.cc:20
iEvent
int iEvent
Definition:
GenABIO.cc:224
MaskedMeasurementTrackerEventProducer::~MaskedMeasurementTrackerEventProducer
~MaskedMeasurementTrackerEventProducer() override
Definition:
MaskedMeasurementTrackerEventProducer.cc:11
edm::stream::EDProducer
Definition:
EDProducer.h:38
edm::EventSetup
Definition:
EventSetup.h:58
MaskedMeasurementTrackerEventProducer::PixelMask
edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > PixelMask
Definition:
MaskedMeasurementTrackerEventProducer.cc:17
MaskedMeasurementTrackerEventProducer::maskPhase2OTs_
edm::EDGetTokenT< Phase2OTMask > maskPhase2OTs_
Definition:
MaskedMeasurementTrackerEventProducer.cc:27
MaskedMeasurementTrackerEventProducer::maskPixels_
edm::EDGetTokenT< PixelMask > maskPixels_
Definition:
MaskedMeasurementTrackerEventProducer.cc:26
MaskedMeasurementTrackerEventProducer::phase2skipClusters_
bool phase2skipClusters_
Definition:
MaskedMeasurementTrackerEventProducer.cc:23
eostools.move
def move(src, dest)
Definition:
eostools.py:511
MaskedMeasurementTrackerEventProducer::maskStrips_
edm::EDGetTokenT< StripMask > maskStrips_
Definition:
MaskedMeasurementTrackerEventProducer.cc:25
Frameworkfwd.h
MaskedMeasurementTrackerEventProducer::Phase2OTMask
edm::ContainerMask< edmNew::DetSetVector< Phase2TrackerCluster1D > > Phase2OTMask
Definition:
MaskedMeasurementTrackerEventProducer.cc:18
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
MillePedeFileConverter_cfg.out
out
Definition:
MillePedeFileConverter_cfg.py:31
ParameterSet.h
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
DetIdCollection.h
Generated for CMSSW Reference Manual by
1.8.16