CMS 3D CMS Logo

GEMSegmentProducer.cc
Go to the documentation of this file.
1 
17 
22 
25 
27 public:
29  explicit GEMSegmentProducer(const edm::ParameterSet&);
31  ~GEMSegmentProducer() override {}
33  void produce(edm::Event&, const edm::EventSetup&) override;
34 
35  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
36 
37 private:
38  int iev; // events through
40  std::unique_ptr<GEMSegmentBuilder> segmentBuilder_;
42 };
43 
45  theGEMRecHitToken = consumes<GEMRecHitCollection>(ps.getParameter<edm::InputTag>("gemRecHitLabel"));
46  segmentBuilder_ = std::make_unique<GEMSegmentBuilder>(ps); // pass on the Parameter Set
47  gemGeomToken_ = esConsumes<GEMGeometry, MuonGeometryRecord>();
48  // register what this produces
49  produces<GEMSegmentCollection>();
50 }
51 
54  desc.add<edm::InputTag>("gemRecHitLabel", edm::InputTag("gemRecHits"));
56  descriptions.add("gemSegments", desc);
57 }
58 
60  LogDebug("GEMSegmentProducer") << "start producing segments for " << ++iev << "th event with GEM data";
61 
62  // find the geometry (& conditions?) for this event & cache it in the builder
64  const GEMGeometry* mgeom = &*gemg;
65  segmentBuilder_->setGeometry(mgeom);
66 
67  // get the collection of GEMRecHit
69  ev.getByToken(theGEMRecHitToken, gemRecHits);
70 
71  // create empty collection of Segments
72  auto oc = std::make_unique<GEMSegmentCollection>();
73 
74  // fill the collection
75  segmentBuilder_->build(gemRecHits.product(), *oc); //@@ FILL oc
76 
77  // put collection in event
78  ev.put(std::move(oc));
79 }
80 
static void fillDescription(edm::ParameterSetDescription &descriptions)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
void produce(edm::Event &, const edm::EventSetup &) override
Produce the GEMSegment collection.
TkSoAView< TrackerTraits > HitToTuple< TrackerTraits > const *__restrict__ int32_t int32_t int iev
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > gemGeomToken_
~GEMSegmentProducer() override
Destructor.
std::unique_ptr< GEMSegmentBuilder > segmentBuilder_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
GEMSegmentProducer(const edm::ParameterSet &)
Constructor.
edm::EDGetTokenT< GEMRecHitCollection > theGEMRecHitToken
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void add(std::string const &label, ParameterSetDescription const &psetDescription)
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)