RecoMuon
MuonSeedGenerator
plugins
MuonSeedProducer.cc
Go to the documentation of this file.
1
7
#include "
RecoMuon/MuonSeedGenerator/plugins/MuonSeedProducer.h
"
8
#include "
RecoMuon/MuonSeedGenerator/src/MuonSeedBuilder.h
"
9
10
// Data Formats
11
#include "
DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h
"
12
13
// Magnetic Field
14
#include "
MagneticField/Engine/interface/MagneticField.h
"
15
#include "
MagneticField/Records/interface/IdealMagneticFieldRecord.h
"
16
17
// Geometry
18
#include "
Geometry/CommonDetUnit/interface/GeomDet.h
"
19
#include "
TrackingTools/DetLayers/interface/DetLayer.h
"
20
21
#include "
RecoMuon/DetLayers/interface/MuonDetLayerGeometry.h
"
22
#include "
RecoMuon/Records/interface/MuonRecoGeometryRecord.h
"
23
24
// Framework
25
#include "
FWCore/Framework/interface/EventSetup.h
"
26
#include "
FWCore/Framework/interface/Event.h
"
27
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
28
#include "
FWCore/Framework/interface/ESHandle.h
"
29
#include <
DataFormats/Common/interface/Handle.h
>
30
// C++
31
#include <vector>
32
33
/*
34
* Constructor
35
*/
36
MuonSeedProducer::MuonSeedProducer
(
const
edm::ParameterSet
&
pset
) {
37
// Register what this produces
38
produces<TrajectorySeedCollection>();
39
40
// Local Debug flag
41
debug
=
pset
.getParameter<
bool
>(
"DebugMuonSeed"
);
42
43
edm::ConsumesCollector
iC = consumesCollector();
44
45
// Builder which returns seed collection
46
muonSeedBuilder_
=
new
MuonSeedBuilder
(
pset
, iC);
47
}
48
49
/*
50
* Destructor
51
*/
52
MuonSeedProducer::~MuonSeedProducer
() {
delete
muonSeedBuilder_
; }
53
54
/*
55
* Producer (the main)
56
*/
57
void
MuonSeedProducer::produce
(
edm::Event
&
event
,
const
edm::EventSetup
& eSetup) {
58
// Muon Geometry
59
edm::ESHandle<MuonDetLayerGeometry>
muonLayers;
60
eSetup.
get
<
MuonRecoGeometryRecord
>().
get
(muonLayers);
61
const
MuonDetLayerGeometry
* lgeom = &*muonLayers;
62
muonSeedBuilder_
->
setGeometry
(lgeom);
63
64
// Magnetic field
65
edm::ESHandle<MagneticField>
field;
66
eSetup.
get
<
IdealMagneticFieldRecord
>().
get
(field);
67
const
MagneticField
* theField = &*field;
68
muonSeedBuilder_
->
setBField
(theField);
69
70
// Create pointer to the seed container
71
72
auto
output
= std::make_unique<TrajectorySeedCollection>();
73
74
//UNUED: int nSeeds = 0;
75
//UNUSED: nSeeds =
76
muonSeedBuilder_
->
build
(
event
, eSetup, *
output
);
77
78
// Append muon seed collection to event
79
event
.put(
std::move
(
output
));
80
}
Handle.h
ESHandle.h
convertSQLitetoXML_cfg.output
output
Definition:
convertSQLitetoXML_cfg.py:32
MuonSeedProducer.h
MuonDetLayerGeometry.h
MuonSeedBuilder::setGeometry
void setGeometry(const MuonDetLayerGeometry *lgeom)
Cache pointer to geometry.
Definition:
MuonSeedBuilder.h:44
MuonSeedProducer::~MuonSeedProducer
~MuonSeedProducer() override
Destructor.
Definition:
MuonSeedProducer.cc:52
IdealMagneticFieldRecord
Definition:
IdealMagneticFieldRecord.h:11
MuonRecoGeometryRecord
Definition:
MuonRecoGeometryRecord.h:17
MuonDetLayerGeometry
Definition:
MuonDetLayerGeometry.h:21
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:73
MuonSeedProducer::debug
bool debug
Definition:
MuonSeedProducer.h:40
MuonSeedBuilder
Definition:
MuonSeedBuilder.h:30
MuonSeedBuilder::setBField
void setBField(const MagneticField *theField)
Cache pointer to Magnetic field.
Definition:
MuonSeedBuilder.h:47
IdealMagneticFieldRecord.h
edm::ESHandle< MuonDetLayerGeometry >
MuonSeedProducer::MuonSeedProducer
MuonSeedProducer(const edm::ParameterSet &)
Constructor.
Definition:
MuonSeedProducer.cc:36
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
MuonSeedBuilder.h
MuonRecoGeometryRecord.h
MagneticField.h
edm::EventSetup
Definition:
EventSetup.h:57
get
#define get
TrajectorySeedCollection.h
GeomDet.h
eostools.move
def move(src, dest)
Definition:
eostools.py:511
DetLayer.h
EventSetup.h
MuonSeedProducer::muonSeedBuilder_
MuonSeedBuilder * muonSeedBuilder_
Builder where seeds are formed.
Definition:
MuonSeedProducer.h:43
MuonSeedBuilder::build
int build(edm::Event &event, const edm::EventSetup &eventSetup, TrajectorySeedCollection &seeds)
Build seed collection.
Definition:
MuonSeedBuilder.cc:119
ParameterSet.h
event
Definition:
event.py:1
edm::Event
Definition:
Event.h:73
MagneticField
Definition:
MagneticField.h:19
edm::ConsumesCollector
Definition:
ConsumesCollector.h:39
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
MuonSeedProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Get event properties to send to builder to fill seed collection.
Definition:
MuonSeedProducer.cc:57
Generated for CMSSW Reference Manual by
1.8.16