CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ME0SegmentProducer.cc
Go to the documentation of this file.
1 
13 
18 
20 
22 
24 public:
26  explicit ME0SegmentProducer(const edm::ParameterSet&);
28  ~ME0SegmentProducer() override {}
30  void produce(edm::Event&, const edm::EventSetup&) override;
31 
32 private:
33  int iev; // events through
35  std::unique_ptr<ME0SegmentBuilder> segmentBuilder_;
36 };
37 
39  theME0RecHitToken = consumes<ME0RecHitCollection>(ps.getParameter<edm::InputTag>("me0RecHitLabel"));
40  segmentBuilder_ = std::make_unique<ME0SegmentBuilder>(ps); // pass on the Parameter Set
41 
42  // register what this produces
43  produces<ME0SegmentCollection>();
44 }
45 
47  LogDebug("ME0SegmentProducer") << "start producing segments for " << ++iev << "th event with ME0 data";
48 
49  // find the geometry (& conditions?) for this event & cache it in the builder
51  setup.get<MuonGeometryRecord>().get(me0g);
52  const ME0Geometry* mgeom = &*me0g;
53  segmentBuilder_->setGeometry(mgeom);
54 
55  // get the collection of ME0RecHit
57  ev.getByToken(theME0RecHitToken, me0RecHits);
58 
59  // create empty collection of Segments
60  auto oc = std::make_unique<ME0SegmentCollection>();
61 
62  // fill the collection
63  segmentBuilder_->build(me0RecHits.product(), *oc); //@@ FILL oc
64 
65  // put collection in event
66  ev.put(std::move(oc));
67 }
68 
#define LogDebug(id)
~ME0SegmentProducer() override
Destructor.
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
std::unique_ptr< ME0SegmentBuilder > segmentBuilder_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
bool ev
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
T const * product() const
Definition: Handle.h:69
T get() const
Definition: EventSetup.h:73
def move(src, dest)
Definition: eostools.py:511