src
CommonTools
RecoAlgos
src
TrackToCandidate.h
Go to the documentation of this file.
1
#ifndef RecoAlgos_TrackToCandidate_h
2
#define RecoAlgos_TrackToCandidate_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/RecoChargedCandidate.h
"
7
#include "
DataFormats/RecoCandidate/interface/RecoChargedCandidateFwd.h
"
8
#include "
DataFormats/Candidate/interface/CandidateFwd.h
"
9
10
namespace
converter
{
11
12
struct
TrackToCandidate
:
public
MassiveCandidateConverter
{
13
typedef
reco::Track
value_type
;
14
typedef
reco::TrackCollection
Components
;
15
typedef
reco::RecoChargedCandidate
Candidate
;
16
TrackToCandidate
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
iC) :
MassiveCandidateConverter
(
cfg
, iC) {}
17
void
convert
(
reco::TrackRef
trkRef,
reco::RecoChargedCandidate
&
c
)
const
{
18
const
reco::Track
& trk = *trkRef;
19
c
.setCharge(trk.
charge
());
20
c
.setVertex(trk.
vertex
());
21
const
reco::Track::Vector
&
p
= trk.
momentum
();
22
double
t
=
sqrt
(
massSqr_
+
p
.mag2());
23
c
.setP4(
reco::Candidate::LorentzVector
(
p
.x(),
p
.y(),
p
.z(),
t
));
24
c
.setTrack(trkRef);
25
c
.setPdgId(
particle_
.
pdgId
());
26
}
27
};
28
29
namespace
helper
{
30
template
<>
31
struct
CandConverter<
reco
::Track> {
32
typedef
TrackToCandidate
type
;
33
};
34
}
// namespace helper
35
36
}
// namespace converter
37
38
#endif
helper
Definition:
helper.py:1
RecoChargedCandidate.h
submitPVValidationJobs.t
string t
Definition:
submitPVValidationJobs.py:649
edm::Ref< TrackCollection >
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition:
TrackFwd.h:14
converter::MassiveCandidateConverter
Definition:
MassiveCandidateConverter.h:15
converter::helper::CandConverter< reco::Track >::type
TrackToCandidate type
Definition:
TrackToCandidate.h:32
HltBtagPostValidation_cff.c
c
Definition:
HltBtagPostValidation_cff.py:35
converter::MassiveCandidateConverter::massSqr_
double massSqr_
Definition:
MassiveCandidateConverter.h:20
converter::TrackToCandidate
Definition:
TrackToCandidate.h:12
converter
Definition:
CandidateProducer.h:25
reco::TrackBase::charge
int charge() const
track electric charge
Definition:
TrackBase.h:596
converter::TrackToCandidate::convert
void convert(reco::TrackRef trkRef, reco::RecoChargedCandidate &c) const
Definition:
TrackToCandidate.h:17
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:19
reco::RecoChargedCandidate
Definition:
RecoChargedCandidate.h:15
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::TrackToCandidate::value_type
reco::Track value_type
Definition:
TrackToCandidate.h:13
converter::TrackToCandidate::TrackToCandidate
TrackToCandidate(const edm::ParameterSet &cfg, edm::ConsumesCollector iC)
Definition:
TrackToCandidate.h:16
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
converter::TrackToCandidate::Candidate
reco::RecoChargedCandidate Candidate
Definition:
TrackToCandidate.h:15
RecoChargedCandidateFwd.h
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:46
CandidateProducer.h
Track.h
edm::ParameterSet
Definition:
ParameterSet.h:48
CandidateFwd.h
converter::TrackToCandidate::Components
reco::TrackCollection Components
Definition:
TrackToCandidate.h:14
converter::MassiveCandidateConverter::particle_
PdtEntry particle_
Definition:
MassiveCandidateConverter.h:21
reco::TrackBase::Vector
math::XYZVector Vector
spatial vector
Definition:
TrackBase.h:77
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