CMS 3D CMS Logo

GEMSegmentProducer.cc
Go to the documentation of this file.
1 
15 
20 
23 
25 public:
27  explicit GEMSegmentProducer(const edm::ParameterSet&);
29  ~GEMSegmentProducer() override {}
31  void produce(edm::Event&, const edm::EventSetup&) override;
32 
33 private:
34  int iev; // events through
36  std::unique_ptr<GEMSegmentBuilder> segmentBuilder_;
38 };
39 
41  theGEMRecHitToken = consumes<GEMRecHitCollection>(ps.getParameter<edm::InputTag>("gemRecHitLabel"));
42  segmentBuilder_ = std::make_unique<GEMSegmentBuilder>(ps); // pass on the Parameter Set
43  gemGeomToken_ = esConsumes<GEMGeometry, MuonGeometryRecord>();
44  // register what this produces
45  produces<GEMSegmentCollection>();
46 }
47 
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  const GEMGeometry* mgeom = &*gemg;
54  segmentBuilder_->setGeometry(mgeom);
55 
56  // get the collection of GEMRecHit
58  ev.getByToken(theGEMRecHitToken, gemRecHits);
59 
60  // create empty collection of Segments
61  auto oc = std::make_unique<GEMSegmentCollection>();
62 
63  // fill the collection
64  segmentBuilder_->build(gemRecHits.product(), *oc); //@@ FILL oc
65 
66  // put collection in event
67  ev.put(std::move(oc));
68 }
69 
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void produce(edm::Event &, const edm::EventSetup &) override
Produce the GEMSegment collection.
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > gemGeomToken_
~GEMSegmentProducer() override
Destructor.
std::unique_ptr< GEMSegmentBuilder > segmentBuilder_
GEMSegmentProducer(const edm::ParameterSet &)
Constructor.
edm::EDGetTokenT< GEMRecHitCollection > theGEMRecHitToken
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
HitContainer const *__restrict__ TkSoA const *__restrict__ Quality const *__restrict__ CAHitNtupletGeneratorKernelsGPU::HitToTuple const *__restrict__ int32_t int32_t int iev
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)