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 
GEMSegmentProducer
Definition: GEMSegmentProducer.cc:23
Handle.h
MessageLogger.h
ESHandle.h
edm::EDGetTokenT< GEMRecHitCollection >
EDProducer.h
GEMSegmentProducer::~GEMSegmentProducer
~GEMSegmentProducer() override
Destructor.
Definition: GEMSegmentProducer.cc:28
edm::Handle< GEMRecHitCollection >
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
MakerMacros.h
GEMSegmentProducer::iev
int iev
Definition: GEMSegmentProducer.cc:33
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ESHandle< GEMGeometry >
GEMSegmentProducer::segmentBuilder_
std::unique_ptr< GEMSegmentBuilder > segmentBuilder_
Definition: GEMSegmentProducer.cc:35
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
edm::stream::EDProducer
Definition: EDProducer.h:38
GEMSegmentProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Produce the GEMSegment collection.
Definition: GEMSegmentProducer.cc:46
GEMRecHitCollection.h
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
InputTag.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
Frameworkfwd.h
GEMSegmentCollection.h
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
GEMSegmentProducer::GEMSegmentProducer
GEMSegmentProducer(const edm::ParameterSet &)
Constructor.
Definition: GEMSegmentProducer.cc:38
GEMGeometry
Definition: GEMGeometry.h:24
GEMSegmentBuilder.h
gemRecHits_cfi.gemRecHits
gemRecHits
Definition: gemRecHits_cfi.py:7
ParameterSet.h
MuonGeometryRecord.h
edm::Event
Definition: Event.h:73
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
edm::InputTag
Definition: InputTag.h:15
GEMSegmentProducer::theGEMRecHitToken
edm::EDGetTokenT< GEMRecHitCollection > theGEMRecHitToken
Definition: GEMSegmentProducer.cc:34
GEMSegment.h