src
CommonTools
RecoAlgos
src
StandAloneMuonTrackToCandidate.h
Go to the documentation of this file.
1
#ifndef RecoAlgos_StandAloneMuonTrackToCandidate_h
2
#define RecoAlgos_StandAloneMuonTrackToCandidate_h
3
#include "
CommonTools/RecoAlgos/interface/MassiveCandidateConverter.h
"
4
#include "
CommonTools/RecoAlgos/interface/CandidateProducer.h
"
5
#include "
DataFormats/TrackReco/interface/Track.h
"
6
#include "
DataFormats/RecoCandidate/interface/RecoStandAloneMuonCandidate.h
"
7
#include "
DataFormats/RecoCandidate/interface/RecoStandAloneMuonCandidateFwd.h
"
8
#include "
DataFormats/Candidate/interface/CandidateFwd.h
"
9
10
namespace
converter
{
11
12
struct
StandAloneMuonTrackToCandidate
:
public
MassiveCandidateConverter
{
13
typedef
reco::Track
value_type
;
14
typedef
reco::TrackCollection
Components
;
15
typedef
reco::RecoStandAloneMuonCandidate
Candidate
;
16
StandAloneMuonTrackToCandidate
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
iC)
17
:
MassiveCandidateConverter
(
cfg
, iC) {}
18
void
convert
(
reco::TrackRef
trkRef,
reco::RecoStandAloneMuonCandidate
&
c
)
const
{
19
const
reco::Track
& trk = *trkRef;
20
c
.setCharge(trk.
charge
());
21
c
.setVertex(trk.
vertex
());
22
const
reco::Track::Vector
&
p
= trk.
momentum
();
23
double
t
=
sqrt
(
massSqr_
+
p
.mag2());
24
c
.setP4(
reco::Candidate::LorentzVector
(
p
.x(),
p
.y(),
p
.z(),
t
));
25
c
.setTrack(trkRef);
26
c
.setPdgId(
particle_
.
pdgId
());
27
}
28
};
29
30
namespace
helper
{
31
template
<>
32
struct
CandConverter<
reco
::Track> {
33
typedef
StandAloneMuonTrackToCandidate
type
;
34
};
35
}
// namespace helper
36
37
}
// namespace converter
38
39
#endif
RecoStandAloneMuonCandidateFwd.h
converter::StandAloneMuonTrackToCandidate::convert
void convert(reco::TrackRef trkRef, reco::RecoStandAloneMuonCandidate &c) const
Definition:
StandAloneMuonTrackToCandidate.h:18
helper
Definition:
helper.py:1
submitPVValidationJobs.t
string t
Definition:
submitPVValidationJobs.py:651
edm::Ref< TrackCollection >
converter::helper::CandConverter< reco::Track >::type
StandAloneMuonTrackToCandidate type
Definition:
StandAloneMuonTrackToCandidate.h:33
converter::StandAloneMuonTrackToCandidate::value_type
reco::Track value_type
Definition:
StandAloneMuonTrackToCandidate.h:13
converter::StandAloneMuonTrackToCandidate::Candidate
reco::RecoStandAloneMuonCandidate Candidate
Definition:
StandAloneMuonTrackToCandidate.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition:
TrackFwd.h:14
converter::MassiveCandidateConverter
Definition:
MassiveCandidateConverter.h:15
converter::StandAloneMuonTrackToCandidate
Definition:
StandAloneMuonTrackToCandidate.h:12
reco::RecoStandAloneMuonCandidate
Definition:
RecoStandAloneMuonCandidate.h:15
HltBtagPostValidation_cff.c
c
Definition:
HltBtagPostValidation_cff.py:31
converter::MassiveCandidateConverter::massSqr_
double massSqr_
Definition:
MassiveCandidateConverter.h:20
converter
Definition:
CandidateProducer.h:25
RecoStandAloneMuonCandidate.h
reco::TrackBase::charge
int charge() const
track electric charge
Definition:
TrackBase.h:596
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:19
reco::TrackBase::vertex
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
Definition:
TrackBase.h:676
looper.cfg
cfg
Definition:
looper.py:296
MassiveCandidateConverter.h
converter::StandAloneMuonTrackToCandidate::Components
reco::TrackCollection Components
Definition:
StandAloneMuonTrackToCandidate.h:14
PdtEntry::pdgId
int pdgId() const
PDG id.
Definition:
PdtEntry.cc:5
reco::Track
Definition:
Track.h:27
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition:
Candidate.h:36
reco::TrackBase::momentum
const Vector & momentum() const
track momentum vector
Definition:
TrackBase.h:664
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:46
CandidateProducer.h
Track.h
edm::ParameterSet
Definition:
ParameterSet.h:47
CandidateFwd.h
converter::MassiveCandidateConverter::particle_
PdtEntry particle_
Definition:
MassiveCandidateConverter.h:21
reco::TrackBase::Vector
math::XYZVector Vector
spatial vector
Definition:
TrackBase.h:77
converter::StandAloneMuonTrackToCandidate::StandAloneMuonTrackToCandidate
StandAloneMuonTrackToCandidate(const edm::ParameterSet &cfg, edm::ConsumesCollector iC)
Definition:
StandAloneMuonTrackToCandidate.h:16
AlCaHLTBitMon_ParallelJobs.p
def p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
Generated for CMSSW Reference Manual by
1.8.14