CMS 3D CMS Logo

GEMSegmentProducer.cc
Go to the documentation of this file.
1 
14 
19 
22 
24 public:
26  explicit GEMSegmentProducer(const edm::ParameterSet&);
28  ~GEMSegmentProducer() override {}
30  void produce(edm::Event&, const edm::EventSetup&) override;
31 
32 private:
33  int iev; // events through
35  std::unique_ptr<GEMSegmentBuilder> segmentBuilder_;
36 };
37 
39  theGEMRecHitToken = consumes<GEMRecHitCollection>(ps.getParameter<edm::InputTag>("gemRecHitLabel"));
40  segmentBuilder_ = std::make_unique<GEMSegmentBuilder>(ps); // pass on the Parameter Set
41 
42  // register what this produces
43  produces<GEMSegmentCollection>();
44 }
45 
47  LogDebug("GEMSegmentProducer") << "start producing segments for " << ++iev << "th event with GEM data";
48 
49  // find the geometry (& conditions?) for this event & cache it in the builder
51  setup.get<MuonGeometryRecord>().get(gemg);
52  const GEMGeometry* mgeom = &*gemg;
53  segmentBuilder_->setGeometry(mgeom);
54 
55  // get the collection of GEMRecHit
57  ev.getByToken(theGEMRecHitToken, gemRecHits);
58 
59  // create empty collection of Segments
60  auto oc = std::make_unique<GEMSegmentCollection>();
61 
62  // fill the collection
63  segmentBuilder_->build(gemRecHits.product(), *oc); //@@ FILL oc
64 
65  // put collection in event
66  ev.put(std::move(oc));
67 }
68 
#define LogDebug(id)
T getParameter(std::string const &) const
void produce(edm::Event &, const edm::EventSetup &) override
Produce the GEMSegment collection.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
bool ev
~GEMSegmentProducer() override
Destructor.
std::unique_ptr< GEMSegmentBuilder > segmentBuilder_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
GEMSegmentProducer(const edm::ParameterSet &)
Constructor.
edm::EDGetTokenT< GEMRecHitCollection > theGEMRecHitToken
T const * product() const
Definition: Handle.h:69
T get() const
Definition: EventSetup.h:73
def move(src, dest)
Definition: eostools.py:511