RecoMuon
MuonIdentification
plugins
ME0MuonConverter.cc
Go to the documentation of this file.
1
6
#include <
FWCore/PluginManager/interface/ModuleDef.h
>
7
#include <
FWCore/Framework/interface/MakerMacros.h
>
8
9
#include <
DataFormats/Common/interface/Handle.h
>
10
#include <
FWCore/Framework/interface/ESHandle.h
>
11
#include <
FWCore/MessageLogger/interface/MessageLogger.h
>
12
13
#include <
Geometry/Records/interface/MuonGeometryRecord.h
>
14
15
#include "
DataFormats/GeometryVector/interface/GlobalVector.h
"
16
#include "
DataFormats/GeometryVector/interface/GlobalPoint.h
"
17
#include "
TrackingTools/GeomPropagators/interface/Propagator.h
"
18
#include "
TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h
"
19
#include "
DataFormats/TrajectorySeed/interface/PropagationDirection.h
"
20
21
#include "TLorentzVector.h"
22
23
#include "
DataFormats/TrackReco/interface/TrackFwd.h
"
24
#include "
DataFormats/TrackReco/interface/Track.h
"
25
26
#include "
TrackingTools/Records/interface/TrackingComponentsRecord.h
"
27
28
#include "
DataFormats/RecoCandidate/interface/RecoChargedCandidate.h
"
29
#include "
DataFormats/RecoCandidate/interface/RecoChargedCandidateFwd.h
"
30
38
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
39
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
40
#include "
FWCore/Framework/interface/Event.h
"
41
#include "
FWCore/Framework/interface/EventSetup.h
"
42
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
43
#include "
FWCore/Utilities/interface/InputTag.h
"
44
45
#include "
DataFormats/RecoCandidate/interface/RecoChargedCandidate.h
"
46
#include "
DataFormats/RecoCandidate/interface/RecoChargedCandidateFwd.h
"
47
48
#include "
FWCore/Framework/interface/EDProducer.h
"
49
#include "
FWCore/Utilities/interface/InputTag.h
"
50
51
#include <
DataFormats/GEMRecHit/interface/ME0SegmentCollection.h
>
52
53
#include <
DataFormats/MuonReco/interface/ME0Muon.h
>
54
#include <
DataFormats/MuonReco/interface/ME0MuonCollection.h
>
55
56
class
ME0MuonConverter
:
public
edm::stream::EDProducer
<> {
57
public
:
59
explicit
ME0MuonConverter
(
const
edm::ParameterSet
&);
61
~ME0MuonConverter
()
override
;
63
void
produce
(
edm::Event
&,
const
edm::EventSetup
&)
override
;
64
65
private
:
66
//edm::EDGetTokenT<std::vector<reco::ME0Muon>> OurMuonsToken_;
67
edm::EDGetTokenT<ME0MuonCollection>
OurMuonsToken_
;
68
};
69
70
ME0MuonConverter::ME0MuonConverter
(
const
edm::ParameterSet
& pas) {
71
produces<std::vector<reco::RecoChargedCandidate> >();
72
edm::InputTag
OurMuonsTag(
"me0SegmentMatching"
);
73
OurMuonsToken_
= consumes<ME0MuonCollection>(OurMuonsTag);
74
}
75
76
ME0MuonConverter::~ME0MuonConverter
() {}
77
78
void
ME0MuonConverter::produce
(
edm::Event
&
ev
,
const
edm::EventSetup
&
setup
) {
79
using namespace
edm
;
80
81
using namespace
reco
;
82
83
// Handle <std::vector<ME0Muon> > OurMuons;
84
// ev.getByToken <std::vector<ME0Muon> > (OurMuonsToken_, OurMuons);
85
86
Handle<ME0MuonCollection>
OurMuons;
87
ev
.getByToken(
OurMuonsToken_
, OurMuons);
88
89
auto
oc = std::make_unique<RecoChargedCandidateCollection>();
90
91
for
(std::vector<ME0Muon>::const_iterator thisMuon = OurMuons->begin(); thisMuon != OurMuons->end(); ++thisMuon) {
92
TrackRef
tkRef = thisMuon->innerTrack();
93
94
Particle::Charge
q
= tkRef->charge();
95
Particle::LorentzVector
p4
(tkRef->px(), tkRef->py(), tkRef->pz(), tkRef->p());
96
Particle::Point
vtx
(tkRef->vx(), tkRef->vy(), tkRef->vz());
97
98
int
pid = 0;
99
if
(
abs
(
q
) == 1)
100
pid =
q
< 0 ? 13 : -13;
101
reco::RecoChargedCandidate
cand
(
q
,
p4
,
vtx
, pid);
102
cand
.setTrack(thisMuon->innerTrack());
103
oc->push_back(
cand
);
104
}
105
106
ev
.put(
std::move
(oc));
107
}
108
109
DEFINE_FWK_MODULE
(
ME0MuonConverter
);
Propagator.h
TrajectoryStateOnSurface.h
Handle.h
MessageLogger.h
EDProducer.h
ESHandle.h
edm::EDGetTokenT< ME0MuonCollection >
edm
HLT enums.
Definition:
AlignableModifier.h:19
ME0SegmentCollection.h
data-class-funcs.q
q
Definition:
data-class-funcs.py:169
EDProducer.h
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:45
edm::Handle
Definition:
AssociativeIterator.h:50
singleTopDQM_cfi.setup
setup
Definition:
singleTopDQM_cfi.py:37
edm::Ref< TrackCollection >
MakerMacros.h
Point
math::XYZPoint Point
Definition:
TrackerDpgAnalysis.cc:107
Track.h
TrackFwd.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
ME0MuonConverter::OurMuonsToken_
edm::EDGetTokenT< ME0MuonCollection > OurMuonsToken_
Definition:
ME0MuonConverter.cc:67
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition:
badGlobalMuonTaggersAOD_cff.py:5
ME0MuonConverter::~ME0MuonConverter
~ME0MuonConverter() override
Destructor.
Definition:
ME0MuonConverter.cc:76
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
cand
Definition:
decayParser.h:34
ModuleDef.h
p4
double p4[4]
Definition:
TauolaWrapper.h:92
edm::stream::EDProducer
Definition:
EDProducer.h:38
reco::RecoChargedCandidate
Definition:
RecoChargedCandidate.h:15
edm::EventSetup
Definition:
EventSetup.h:57
ME0Muon.h
InputTag.h
PropagationDirection.h
reco::JetExtendedAssociation::LorentzVector
math::PtEtaPhiELorentzVectorF LorentzVector
Definition:
JetExtendedAssociation.h:25
ME0MuonConverter
Definition:
ME0MuonConverter.cc:56
eostools.move
def move(src, dest)
Definition:
eostools.py:511
RecoChargedCandidate.h
Frameworkfwd.h
TrackingComponentsRecord.h
ev
bool ev
Definition:
Hydjet2Hadronizer.cc:95
PixelTestBeamValidation_cfi.Charge
Charge
Definition:
PixelTestBeamValidation_cfi.py:78
GlobalVector.h
EventSetup.h
ME0MuonCollection.h
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
ParameterSet.h
MuonGeometryRecord.h
edm::Event
Definition:
Event.h:73
RecoChargedCandidateFwd.h
ME0MuonConverter::ME0MuonConverter
ME0MuonConverter(const edm::ParameterSet &)
Constructor.
Definition:
ME0MuonConverter.cc:70
GlobalPoint.h
edm::InputTag
Definition:
InputTag.h:15
ME0MuonConverter::produce
void produce(edm::Event &, const edm::EventSetup &) override
Produce the converted collection.
Definition:
ME0MuonConverter.cc:78
Generated for CMSSW Reference Manual by
1.8.16