CMS 3D CMS Logo

MaskedMeasurementTrackerEventProducer.cc
Go to the documentation of this file.
7 
9 public:
12 
13 private:
14  void produce(edm::Event &, const edm::EventSetup &) override;
15 
19 
21 
24 
28 };
29 
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 
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 
MaskedMeasurementTrackerEventProducer
Definition: MaskedMeasurementTrackerEventProducer.cc:8
MeasurementTrackerEvent.h
funct::false
false
Definition: Factorize.h:34
edm::EDGetTokenT< MeasurementTrackerEvent >
edm
HLT enums.
Definition: AlignableModifier.h:19
ConversionStep_cff.phase2clustersToSkip
phase2clustersToSkip
Definition: ConversionStep_cff.py:301
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 &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:160
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
HLT_2018_cff.clustersToSkip
clustersToSkip
Definition: HLT_2018_cff.py:8689
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
MeasurementTrackerEvent
Definition: MeasurementTrackerEvent.h:15
edm::ParameterSet
Definition: ParameterSet.h:36
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:57
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
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
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
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