CMS 3D CMS Logo

MaskedMeasurementTrackerEventProducer.cc
Go to the documentation of this file.
6 
8 public:
11 
12 private:
13  void produce(edm::Event &, const edm::EventSetup &) override;
14 
18 
20 
23 
27 };
28 
30  : src_(consumes<MeasurementTrackerEvent>(iConfig.getParameter<edm::InputTag>("src"))),
31  skipClusters_(false),
32  phase2skipClusters_(false) {
33  //FIXME:temporary solution in order to use this class for both phase0/1 and phase2
34  if (iConfig.existsAs<edm::InputTag>("clustersToSkip")) {
35  skipClusters_ = true;
36  edm::InputTag clustersToSkip = iConfig.getParameter<edm::InputTag>("clustersToSkip");
37  maskPixels_ = consumes<PixelMask>(clustersToSkip);
38  maskStrips_ = consumes<StripMask>(clustersToSkip);
39  }
40  if (iConfig.existsAs<edm::InputTag>("phase2clustersToSkip")) {
41  phase2skipClusters_ = true;
42  edm::InputTag phase2clustersToSkip = iConfig.getParameter<edm::InputTag>("phase2clustersToSkip");
43  maskPixels_ = consumes<PixelMask>(phase2clustersToSkip);
44  maskPhase2OTs_ = consumes<Phase2OTMask>(phase2clustersToSkip);
45  }
46  produces<MeasurementTrackerEvent>();
47 }
48 
51  iEvent.getByToken(src_, mte);
52 
53  // prepare output
54  std::unique_ptr<MeasurementTrackerEvent> out;
55 
56  if (skipClusters_) {
57  edm::Handle<PixelMask> maskPixels;
58  iEvent.getByToken(maskPixels_, maskPixels);
59  edm::Handle<StripMask> maskStrips;
60  iEvent.getByToken(maskStrips_, maskStrips);
61 
62  out = std::make_unique<MeasurementTrackerEvent>(*mte, *maskStrips, *maskPixels);
63 
64  } else if (phase2skipClusters_) {
65  edm::Handle<PixelMask> maskPixels;
66  iEvent.getByToken(maskPixels_, maskPixels);
67  edm::Handle<Phase2OTMask> maskPhase2OTs;
68  iEvent.getByToken(maskPhase2OTs_, maskPhase2OTs);
69 
70  out = std::make_unique<MeasurementTrackerEvent>(*mte, *maskPixels, *maskPhase2OTs);
71  }
72 
73  // put into event
74  iEvent.put(std::move(out));
75 }
76 
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
void produce(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< MeasurementTrackerEvent > src_
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:172
MaskedMeasurementTrackerEventProducer(const edm::ParameterSet &iConfig)
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
#define dso_hidden
Definition: Visibility.h:12
edm::ContainerMask< edmNew::DetSetVector< Phase2TrackerCluster1D > > Phase2OTMask
edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > PixelMask
HLT enums.
def move(src, dest)
Definition: eostools.py:511
edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > StripMask