Main Page
Namespaces
Classes
Package Documentation
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
);
TrackingComponentsRecord.h
MessageLogger.h
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition:
Event.h:131
ME0MuonCollection.h
RecoChargedCandidate.h
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition:
Event.h:525
edm::Ref< TrackCollection >
MuonGeometryRecord.h
Event.h
MakerMacros.h
edm::Handle
Definition:
AssociativeIterator.h:49
EventSetup.h
ev
bool ev
Definition:
Hydjet2Hadronizer.cc:95
TrackFwd.h
edm::EDGetTokenT< ME0MuonCollection >
Frameworkfwd.h
ME0MuonConverter::~ME0MuonConverter
~ME0MuonConverter() override
Destructor.
Definition:
ME0MuonConverter.cc:76
ParameterSet.h
EDProducer.h
ME0SegmentCollection.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
p4
double p4[4]
Definition:
TauolaWrapper.h:92
PropagationDirection.h
Point
math::XYZPoint Point
Definition:
TrackerDpgAnalysis.cc:107
reco::RecoChargedCandidate
Definition:
RecoChargedCandidate.h:15
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
ESHandle.h
ME0MuonConverter::produce
void produce(edm::Event &, const edm::EventSetup &) override
Produce the converted collection.
Definition:
ME0MuonConverter.cc:78
ME0MuonConverter
Definition:
ME0MuonConverter.cc:56
edm::EventSetup
Definition:
EventSetup.h:57
singleTopDQM_cfi.setup
setup
SETUP
Definition:
singleTopDQM_cfi.py:36
Propagator.h
GlobalVector.h
EDProducer.h
edm::stream::EDProducer
Definition:
EDProducer.h:38
ME0MuonConverter::OurMuonsToken_
edm::EDGetTokenT< ME0MuonCollection > OurMuonsToken_
Definition:
ME0MuonConverter.cc:67
ME0MuonConverter::ME0MuonConverter
ME0MuonConverter(const edm::ParameterSet &)
Constructor.
Definition:
ME0MuonConverter.cc:70
RecoChargedCandidateFwd.h
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:45
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::InputTag
Definition:
InputTag.h:15
ME0Muon.h
InputTag.h
TrajectoryStateOnSurface.h
edm::ParameterSet
Definition:
ParameterSet.h:36
cand
Definition:
decayParser.h:34
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition:
badGlobalMuonTaggersAOD_cff.py:5
data-class-funcs.q
q
Definition:
data-class-funcs.py:169
edm::Event
Definition:
Event.h:72
reco::RecoChargedCandidate::setTrack
void setTrack(const reco::TrackRef &r)
set reference to track
Definition:
RecoChargedCandidate.h:32
Track.h
ModuleDef.h
eostools.move
def move(src, dest)
Definition:
eostools.py:511
reco::JetExtendedAssociation::LorentzVector
math::PtEtaPhiELorentzVectorF LorentzVector
Definition:
JetExtendedAssociation.h:25
Handle.h
GlobalPoint.h
Generated for CMSSW Reference Manual by
1.8.11