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/MessageLogger/interface/MessageLogger.h
"
13
14
#include "
DataFormats/GEMRecHit/interface/ME0RecHitCollection.h
"
15
#include "
DataFormats/GEMRecHit/interface/ME0SegmentCollection.h
"
16
#include "
DataFormats/GEMRecHit/interface/ME0Segment.h
"
17
#include "
DataFormats/Common/interface/Handle.h
"
18
19
#include "
RecoLocalMuon/GEMSegment/plugins/ME0SegmentBuilder.h
"
20
21
#include "
Geometry/Records/interface/MuonGeometryRecord.h
"
22
23
class
ME0SegmentProducer
:
public
edm::stream::EDProducer
<> {
24
public
:
26
explicit
ME0SegmentProducer
(
const
edm::ParameterSet
&);
28
~ME0SegmentProducer
()
override
{}
30
void
produce
(
edm::Event
&,
const
edm::EventSetup
&)
override
;
31
32
private
:
33
int
iev
;
// events through
34
edm::EDGetTokenT<ME0RecHitCollection>
theME0RecHitToken
;
35
std::unique_ptr<ME0SegmentBuilder>
segmentBuilder_
;
36
};
37
38
ME0SegmentProducer::ME0SegmentProducer
(
const
edm::ParameterSet
& ps) : iev(0) {
39
theME0RecHitToken
= consumes<ME0RecHitCollection>(ps.
getParameter
<
edm::InputTag
>(
"me0RecHitLabel"
));
40
segmentBuilder_
= std::make_unique<ME0SegmentBuilder>(ps);
// pass on the Parameter Set
41
42
// register what this produces
43
produces<ME0SegmentCollection>();
44
}
45
46
void
ME0SegmentProducer::produce
(
edm::Event
&
ev
,
const
edm::EventSetup
&
setup
) {
47
LogDebug
(
"ME0SegmentProducer"
) <<
"start producing segments for "
<< ++
iev
<<
"th event with ME0 data"
;
48
49
// find the geometry (& conditions?) for this event & cache it in the builder
50
edm::ESHandle<ME0Geometry>
me0g;
51
setup
.get<
MuonGeometryRecord
>().
get
(me0g);
52
const
ME0Geometry
* mgeom = &*me0g;
53
segmentBuilder_
->setGeometry(mgeom);
54
55
// get the collection of ME0RecHit
56
edm::Handle<ME0RecHitCollection>
me0RecHits
;
57
ev
.getByToken(
theME0RecHitToken
,
me0RecHits
);
58
59
// create empty collection of Segments
60
auto
oc = std::make_unique<ME0SegmentCollection>();
61
62
// fill the collection
63
segmentBuilder_
->build(
me0RecHits
.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
(
ME0SegmentProducer
);
Handle.h
ME0RecHitCollection.h
MessageLogger.h
ME0SegmentProducer::ME0SegmentProducer
ME0SegmentProducer(const edm::ParameterSet &)
Constructor.
Definition:
ME0SegmentProducer.cc:38
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:35
ME0SegmentCollection.h
EDProducer.h
edm::Handle
Definition:
AssociativeIterator.h:50
ME0SegmentProducer
Definition:
ME0SegmentProducer.cc:23
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:33
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:670
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
edm::stream::EDProducer
Definition:
EDProducer.h:38
edm::EventSetup
Definition:
EventSetup.h:57
ME0Segment.h
get
#define get
InputTag.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ME0SegmentProducer::theME0RecHitToken
edm::EDGetTokenT< ME0RecHitCollection > theME0RecHitToken
Definition:
ME0SegmentProducer.cc:34
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:28
ME0SegmentBuilder.h
ParameterSet.h
MuonGeometryRecord.h
edm::Event
Definition:
Event.h:73
MuonGeometryRecord
Definition:
MuonGeometryRecord.h:34
edm::InputTag
Definition:
InputTag.h:15
ME0SegmentProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Produce the ME0Segment collection.
Definition:
ME0SegmentProducer.cc:46
Generated for CMSSW Reference Manual by
1.8.16