RecoLocalMuon
GEMSegment
plugins
ME0SegmentProducer.cc
Go to the documentation of this file.
1
6
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
7
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
8
#include "
FWCore/Framework/interface/Event.h
"
9
#include "
FWCore/Framework/interface/ESHandle.h
"
10
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
11
#include "
FWCore/Utilities/interface/InputTag.h
"
12
#include "
FWCore/Utilities/interface/ESGetToken.h
"
13
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
14
15
#include "
DataFormats/GEMRecHit/interface/ME0RecHitCollection.h
"
16
#include "
DataFormats/GEMRecHit/interface/ME0SegmentCollection.h
"
17
#include "
DataFormats/GEMRecHit/interface/ME0Segment.h
"
18
#include "
DataFormats/Common/interface/Handle.h
"
19
20
#include "
RecoLocalMuon/GEMSegment/plugins/ME0SegmentBuilder.h
"
21
22
#include "
Geometry/Records/interface/MuonGeometryRecord.h
"
23
24
class
ME0SegmentProducer
:
public
edm::stream::EDProducer
<> {
25
public
:
27
explicit
ME0SegmentProducer
(
const
edm::ParameterSet
&);
29
~ME0SegmentProducer
()
override
{}
31
void
produce
(
edm::Event
&,
const
edm::EventSetup
&)
override
;
32
33
private
:
34
int
iev
;
// events through
35
edm::EDGetTokenT<ME0RecHitCollection>
theME0RecHitToken
;
36
std::unique_ptr<ME0SegmentBuilder>
segmentBuilder_
;
37
edm::ESGetToken<ME0Geometry, MuonGeometryRecord>
me0GeomToken_
;
38
};
39
40
ME0SegmentProducer::ME0SegmentProducer
(
const
edm::ParameterSet
& ps) : iev(0) {
41
theME0RecHitToken
= consumes<ME0RecHitCollection>(ps.
getParameter
<
edm::InputTag
>(
"me0RecHitLabel"
));
42
segmentBuilder_
= std::make_unique<ME0SegmentBuilder>(ps);
// pass on the Parameter Set
43
me0GeomToken_
= esConsumes<ME0Geometry, MuonGeometryRecord>();
44
// register what this produces
45
produces<ME0SegmentCollection>();
46
}
47
48
void
ME0SegmentProducer::produce
(
edm::Event
&
ev
,
const
edm::EventSetup
&
setup
) {
49
LogDebug
(
"ME0SegmentProducer"
) <<
"start producing segments for "
<< ++
iev
<<
"th event with ME0 data"
;
50
51
// find the geometry (& conditions?) for this event & cache it in the builder
52
edm::ESHandle<ME0Geometry>
me0g =
setup
.getHandle(
me0GeomToken_
);
53
const
ME0Geometry
* mgeom = &*me0g;
54
segmentBuilder_
->setGeometry(mgeom);
55
56
// get the collection of ME0RecHit
57
edm::Handle<ME0RecHitCollection>
me0RecHits
;
58
ev
.getByToken(
theME0RecHitToken
,
me0RecHits
);
59
60
// create empty collection of Segments
61
auto
oc = std::make_unique<ME0SegmentCollection>();
62
63
// fill the collection
64
segmentBuilder_
->build(
me0RecHits
.product(), *oc);
//@@ FILL oc
65
66
// put collection in event
67
ev
.put(
std::move
(oc));
68
}
69
70
#include "
FWCore/Framework/interface/MakerMacros.h
"
71
DEFINE_FWK_MODULE
(
ME0SegmentProducer
);
Handle.h
ME0RecHitCollection.h
MessageLogger.h
ME0SegmentProducer::ME0SegmentProducer
ME0SegmentProducer(const edm::ParameterSet &)
Constructor.
Definition:
ME0SegmentProducer.cc:40
ESHandle.h
edm::EDGetTokenT< ME0RecHitCollection >
ME0Geometry
Definition:
ME0Geometry.h:12
me0RecHits_cfi.me0RecHits
me0RecHits
Definition:
me0RecHits_cfi.py:3
ME0SegmentProducer::segmentBuilder_
std::unique_ptr< ME0SegmentBuilder > segmentBuilder_
Definition:
ME0SegmentProducer.cc:36
ME0SegmentCollection.h
EDProducer.h
edm::Handle
Definition:
AssociativeIterator.h:50
ESGetToken.h
ME0SegmentProducer
Definition:
ME0SegmentProducer.cc:24
singleTopDQM_cfi.setup
setup
Definition:
singleTopDQM_cfi.py:37
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
edm::ESHandle< ME0Geometry >
ME0SegmentProducer::iev
int iev
Definition:
ME0SegmentProducer.cc:34
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:223
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
edm::stream::EDProducer
Definition:
EDProducer.h:38
edm::EventSetup
Definition:
EventSetup.h:57
ME0Segment.h
ME0SegmentProducer::me0GeomToken_
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > me0GeomToken_
Definition:
ME0SegmentProducer.cc:37
edm::ESGetToken< ME0Geometry, MuonGeometryRecord >
InputTag.h
ME0SegmentProducer::theME0RecHitToken
edm::EDGetTokenT< ME0RecHitCollection > theME0RecHitToken
Definition:
ME0SegmentProducer.cc:35
eostools.move
def move(src, dest)
Definition:
eostools.py:511
Frameworkfwd.h
ev
bool ev
Definition:
Hydjet2Hadronizer.cc:95
ME0SegmentProducer::~ME0SegmentProducer
~ME0SegmentProducer() override
Destructor.
Definition:
ME0SegmentProducer.cc:29
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
ME0SegmentBuilder.h
ParameterSet.h
MuonGeometryRecord.h
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
ME0SegmentProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Produce the ME0Segment collection.
Definition:
ME0SegmentProducer.cc:48
Generated for CMSSW Reference Manual by
1.8.16