CMS 3D CMS Logo

ME0SegmentProducer.cc
Go to the documentation of this file.
1 
14 
19 
21 
23 
25 public:
27  explicit ME0SegmentProducer(const edm::ParameterSet&);
29  ~ME0SegmentProducer() override {}
31  void produce(edm::Event&, const edm::EventSetup&) override;
32 
33 private:
34  int iev; // events through
36  std::unique_ptr<ME0SegmentBuilder> segmentBuilder_;
38 };
39 
41  theME0RecHitToken = consumes<ME0RecHitCollection>(ps.getParameter<edm::InputTag>("me0RecHitLabel"));
42  segmentBuilder_ = std::make_unique<ME0SegmentBuilder>(ps); // pass on the Parameter Set
43  me0GeomToken_ = esConsumes<ME0Geometry, MuonGeometryRecord>();
44  // register what this produces
45  produces<ME0SegmentCollection>();
46 }
47 
49  LogDebug("ME0SegmentProducer") << "start producing segments for " << ++iev << "th event with ME0 data";
50 
51  // find the geometry (& conditions?) for this event & cache it in the builder
53  const ME0Geometry* mgeom = &*me0g;
54  segmentBuilder_->setGeometry(mgeom);
55 
56  // get the collection of ME0RecHit
58  ev.getByToken(theME0RecHitToken, me0RecHits);
59 
60  // create empty collection of Segments
61  auto oc = std::make_unique<ME0SegmentCollection>();
62 
63  // fill the collection
64  segmentBuilder_->build(me0RecHits.product(), *oc); //@@ FILL oc
65 
66  // put collection in event
67  ev.put(std::move(oc));
68 }
69 
~ME0SegmentProducer() override
Destructor.
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< ME0SegmentBuilder > segmentBuilder_
TkSoAView< TrackerTraits > HitToTuple< TrackerTraits > const *__restrict__ int32_t int32_t int iev
ME0SegmentProducer(const edm::ParameterSet &)
Constructor.
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void produce(edm::Event &, const edm::EventSetup &) override
Produce the ME0Segment collection.
edm::EDGetTokenT< ME0RecHitCollection > theME0RecHitToken
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > me0GeomToken_
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)