CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MaskedMeasurementTrackerEventProducer.cc
Go to the documentation of this file.
7 
9 public:
12 private:
13  virtual void produce(edm::Event&, const edm::EventSetup&);
14 
18 
20  bool onDemand_;
21 
25 };
26 
27 
29  src_(consumes<MeasurementTrackerEvent>(iConfig.getParameter<edm::InputTag>("src"))),
30  onDemand_(iConfig.getParameter<bool>("OnDemand"))
31 {
32  edm::InputTag clustersToSkip = iConfig.getParameter<edm::InputTag>("clustersToSkip");
33  if (onDemand_) {
34  maskStripsLazy_ = consumes<StripLazyMask>(clustersToSkip);
35  } else {
36  maskStrips_ = consumes<StripMask>(clustersToSkip);
37  }
38  maskPixels_ = consumes<PixelMask>(clustersToSkip);
39 
40  produces<MeasurementTrackerEvent>();
41 }
42 
43 void
45 {
47  iEvent.getByToken(src_, mte);
48 
49  // prepare output
50  std::auto_ptr<MeasurementTrackerEvent> out;
51 
52  edm::Handle<PixelMask> maskPixels;
53  iEvent.getByToken(maskPixels_, maskPixels);
54 
55  if (onDemand_) {
56  edm::Handle<StripLazyMask> maskStripsLazy;
57  iEvent.getByToken(maskStripsLazy_, maskStripsLazy);
58  out.reset(new MeasurementTrackerEvent(*mte, *maskStripsLazy, *maskPixels));
59  } else {
60  edm::Handle<StripMask> maskStrips;
61  iEvent.getByToken(maskStrips_, maskStrips);
62  out.reset(new MeasurementTrackerEvent(*mte, *maskStrips, *maskPixels));
63  }
64 
65  // put into event
66  iEvent.put(out);
67 }
68 
T getParameter(std::string const &) const
edm::EDGetTokenT< MeasurementTrackerEvent > src_
virtual void produce(edm::Event &, const edm::EventSetup &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
MaskedMeasurementTrackerEventProducer(const edm::ParameterSet &iConfig)
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
edm::ContainerMask< edm::LazyGetter< SiStripCluster > > StripLazyMask
tuple out
Definition: dbtoconf.py:99
edm::ContainerMask< edmNew::DetSetVector< SiPixelCluster > > PixelMask
edm::ContainerMask< edmNew::DetSetVector< SiStripCluster > > StripMask