RecoLocalMuon
CSCSegment
src
CSCSegmentProducer.cc
Go to the documentation of this file.
1
5
#include <
RecoLocalMuon/CSCSegment/src/CSCSegmentProducer.h
>
6
#include <
RecoLocalMuon/CSCSegment/src/CSCSegmentBuilder.h
>
7
8
#include <
DataFormats/Common/interface/Handle.h
>
9
#include <
FWCore/Framework/interface/ESHandle.h
>
10
#include <
FWCore/Utilities/interface/InputTag.h
>
11
#include <
FWCore/MessageLogger/interface/MessageLogger.h
>
12
13
#include <
Geometry/Records/interface/MuonGeometryRecord.h
>
14
15
#include <
DataFormats/CSCRecHit/interface/CSCSegmentCollection.h
>
16
#include <
DataFormats/CSCRecHit/interface/CSCSegment.h
>
17
18
CSCSegmentProducer::CSCSegmentProducer
(
const
edm::ParameterSet
& pas) : iev(0) {
19
m_token
= consumes<CSCRecHit2DCollection>(pas.
getParameter
<
edm::InputTag
>(
"inputObjects"
));
20
segmentBuilder_
=
new
CSCSegmentBuilder
(pas);
// pass on the PS
21
22
// register what this produces
23
produces<CSCSegmentCollection>();
24
}
25
26
CSCSegmentProducer::~CSCSegmentProducer
() {
27
LogDebug
(
"CSCSegment|CSC"
) <<
"deleting CSCSegmentBuilder after "
<<
iev
<<
" events w/csc data."
;
28
delete
segmentBuilder_
;
29
}
30
31
void
CSCSegmentProducer::produce
(
edm::Event
&
ev
,
const
edm::EventSetup
&
setup
) {
32
LogDebug
(
"CSCSegment|CSC"
) <<
"start producing segments for "
<< ++
iev
<<
"th event with csc data"
;
33
34
// find the geometry (& conditions?) for this event & cache it in the builder
35
36
edm::ESHandle<CSCGeometry>
h
;
37
setup
.get<
MuonGeometryRecord
>().
get
(
h
);
38
const
CSCGeometry
* pgeom = &*
h
;
39
segmentBuilder_
->
setGeometry
(pgeom);
40
41
// get the collection of CSCRecHit2D
42
edm::Handle<CSCRecHit2DCollection>
cscRecHits;
43
ev
.getByToken(
m_token
, cscRecHits);
44
45
// create empty collection of Segments
46
auto
oc = std::make_unique<CSCSegmentCollection>();
47
48
// fill the collection
49
segmentBuilder_
->
build
(cscRecHits.
product
(), *oc);
//@@ FILL oc
50
51
// put collection in event
52
ev
.put(
std::move
(oc));
53
}
Handle.h
CSCSegmentProducer::m_token
edm::EDGetTokenT< CSCRecHit2DCollection > m_token
Definition:
CSCSegmentProducer.h:31
CSCSegmentProducer::~CSCSegmentProducer
~CSCSegmentProducer() override
Destructor.
Definition:
CSCSegmentProducer.cc:26
MessageLogger.h
edm::Handle::product
T const * product() const
Definition:
Handle.h:70
ESHandle.h
CSCSegmentBuilder::setGeometry
void setGeometry(const CSCGeometry *geom)
Definition:
CSCSegmentBuilder.cc:103
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition:
L1TUtmAlgorithmRcd.h:4
CSCSegmentBuilder::build
void build(const CSCRecHit2DCollection *rechits, CSCSegmentCollection &oc)
Definition:
CSCSegmentBuilder.cc:61
edm::Handle< CSCRecHit2DCollection >
singleTopDQM_cfi.setup
setup
Definition:
singleTopDQM_cfi.py:37
CSCSegmentProducer::iev
int iev
Definition:
CSCSegmentProducer.h:29
CSCGeometry
Definition:
CSCGeometry.h:24
CSCSegmentProducer.h
edm::ESHandle< CSCGeometry >
CSCSegmentProducer::segmentBuilder_
CSCSegmentBuilder * segmentBuilder_
Definition:
CSCSegmentProducer.h:30
h
CSCSegmentProducer::CSCSegmentProducer
CSCSegmentProducer(const edm::ParameterSet &)
Constructor.
Definition:
CSCSegmentProducer.cc:18
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:670
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::EventSetup
Definition:
EventSetup.h:57
get
#define get
CSCSegmentBuilder.h
InputTag.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition:
eostools.py:511
ev
bool ev
Definition:
Hydjet2Hadronizer.cc:95
CSCSegmentProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Produce the CSCSegment collection.
Definition:
CSCSegmentProducer.cc:31
CSCSegmentBuilder
Definition:
CSCSegmentBuilder.h:25
CSCSegment.h
MuonGeometryRecord.h
edm::Event
Definition:
Event.h:73
MuonGeometryRecord
Definition:
MuonGeometryRecord.h:34
edm::InputTag
Definition:
InputTag.h:15
CSCSegmentCollection.h
Generated for CMSSW Reference Manual by
1.8.16