CMS 3D CMS Logo

ME0SegmentProducer.cc
Go to the documentation of this file.
1 
13 
18 
20 
22 
23 
25 public:
27  explicit ME0SegmentProducer(const edm::ParameterSet&);
29  virtual ~ME0SegmentProducer() {}
31  void produce(edm::Event&, const edm::EventSetup&) override;
32 
33 private:
34  int iev; // events through
36  std::unique_ptr<ME0SegmentBuilder> segmentBuilder_;
37 };
38 
40 
41  theME0RecHitToken = consumes<ME0RecHitCollection>(ps.getParameter<edm::InputTag>("me0RecHitLabel"));
42  segmentBuilder_ = std::make_unique<ME0SegmentBuilder>(ps); // pass on the Parameter Set
43 
44  // register what this produces
45  produces<ME0SegmentCollection>();
46 }
47 
49 
50  LogDebug("ME0SegmentProducer") << "start producing segments for " << ++iev << "th event with ME0 data";
51 
52  // find the geometry (& conditions?) for this event & cache it in the builder
54  setup.get<MuonGeometryRecord>().get(me0g);
55  const ME0Geometry* mgeom = &*me0g;
56  segmentBuilder_->setGeometry(mgeom);
57 
58 
59  // get the collection of ME0RecHit
61  ev.getByToken(theME0RecHitToken,me0RecHits);
62 
63  // create empty collection of Segments
64  auto oc = std::make_unique<ME0SegmentCollection>();
65 
66  // fill the collection
67  segmentBuilder_->build(me0RecHits.product(), *oc); //@@ FILL oc
68 
69  // put collection in event
70  ev.put(std::move(oc));
71 }
72 
#define LogDebug(id)
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
std::unique_ptr< ME0SegmentBuilder > segmentBuilder_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
bool ev
ME0SegmentProducer(const edm::ParameterSet &)
Constructor.
void produce(edm::Event &, const edm::EventSetup &) override
Produce the ME0Segment collection.
edm::EDGetTokenT< ME0RecHitCollection > theME0RecHitToken
virtual ~ME0SegmentProducer()
Destructor.
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:56
def move(src, dest)
Definition: eostools.py:510