RecoLocalMuon
GEMSegment
plugins
GEMSegmentProducer.cc
Go to the documentation of this file.
1
7
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
8
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
9
#include "
FWCore/Framework/interface/Event.h
"
10
#include "
FWCore/Framework/interface/ESHandle.h
"
11
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
12
#include "
FWCore/Utilities/interface/InputTag.h
"
13
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
14
15
#include "
DataFormats/Common/interface/Handle.h
"
16
#include "
DataFormats/GEMRecHit/interface/GEMRecHitCollection.h
"
17
#include "
DataFormats/GEMRecHit/interface/GEMSegmentCollection.h
"
18
#include "
DataFormats/GEMRecHit/interface/GEMSegment.h
"
19
20
#include "
RecoLocalMuon/GEMSegment/plugins/GEMSegmentBuilder.h
"
21
#include "
Geometry/Records/interface/MuonGeometryRecord.h
"
22
23
class
GEMSegmentProducer
:
public
edm::stream::EDProducer
<> {
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
34
edm::EDGetTokenT<GEMRecHitCollection>
theGEMRecHitToken
;
35
std::unique_ptr<GEMSegmentBuilder>
segmentBuilder_
;
36
};
37
38
GEMSegmentProducer::GEMSegmentProducer
(
const
edm::ParameterSet
& ps) : iev(0) {
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
46
void
GEMSegmentProducer::produce
(
edm::Event
&
ev
,
const
edm::EventSetup
&
setup
) {
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
50
edm::ESHandle<GEMGeometry>
gemg;
51
setup
.get<
MuonGeometryRecord
>().
get
(gemg);
52
const
GEMGeometry
* mgeom = &*gemg;
53
segmentBuilder_
->setGeometry(mgeom);
54
55
// get the collection of GEMRecHit
56
edm::Handle<GEMRecHitCollection>
gemRecHits
;
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
69
#include "
FWCore/Framework/interface/MakerMacros.h
"
70
DEFINE_FWK_MODULE
(
GEMSegmentProducer
);
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
Generated for CMSSW Reference Manual by
1.8.16