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 
40  theGEMRecHitToken = consumes<GEMRecHitCollection>(ps.getParameter<edm::InputTag>("gemRecHitLabel"));
41  segmentBuilder_ = std::make_unique<GEMSegmentBuilder>(ps); // pass on the Parameter Set
42 
43  // register what this produces
44  produces<GEMSegmentCollection>();
45 }
46 
48 
49  LogDebug("GEMSegmentProducer") << "start producing segments for " << ++iev << "th event with GEM data";
50 
51  // find the geometry (& conditions?) for this event & cache it in the builder
53  setup.get<MuonGeometryRecord>().get(gemg);
54  const GEMGeometry* mgeom = &*gemg;
55  segmentBuilder_->setGeometry(mgeom);
56 
57 
58  // get the collection of GEMRecHit
60  ev.getByToken(theGEMRecHitToken,gemRecHits);
61 
62  // create empty collection of Segments
63  auto oc = std::make_unique<GEMSegmentCollection>();
64 
65  // fill the collection
66  segmentBuilder_->build(gemRecHits.product(), *oc); //@@ FILL oc
67 
68  // put collection in event
69  ev.put(std::move(oc));
70 }
71 
#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:137
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
bool ev
~GEMSegmentProducer() override
Destructor.
std::unique_ptr< GEMSegmentBuilder > segmentBuilder_
GEMSegmentProducer(const edm::ParameterSet &)
Constructor.
edm::EDGetTokenT< GEMRecHitCollection > theGEMRecHitToken
T const * product() const
Definition: Handle.h:81
T get() const
Definition: EventSetup.h:68
def move(src, dest)
Definition: eostools.py:511