CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions
converter::TrackToCandidate Struct Reference

#include <TrackToCandidate.h>

Inheritance diagram for converter::TrackToCandidate:
converter::MassiveCandidateConverter

Public Types

typedef reco::RecoChargedCandidate Candidate
 
typedef reco::TrackCollection Components
 
typedef reco::Track value_type
 

Public Member Functions

void convert (reco::TrackRef trkRef, reco::RecoChargedCandidate &c) const
 
 TrackToCandidate (const edm::ParameterSet &cfg, edm::ConsumesCollector iC)
 
- Public Member Functions inherited from converter::MassiveCandidateConverter
void beginFirstRun (const edm::EventSetup &)
 
 MassiveCandidateConverter (const edm::ParameterSet &, edm::ConsumesCollector)
 

Additional Inherited Members

- Protected Attributes inherited from converter::MassiveCandidateConverter
double massSqr_
 
PdtEntry particle_
 

Detailed Description

Definition at line 12 of file TrackToCandidate.h.

Member Typedef Documentation

◆ Candidate

Definition at line 15 of file TrackToCandidate.h.

◆ Components

Definition at line 14 of file TrackToCandidate.h.

◆ value_type

Definition at line 13 of file TrackToCandidate.h.

Constructor & Destructor Documentation

◆ TrackToCandidate()

converter::TrackToCandidate::TrackToCandidate ( const edm::ParameterSet cfg,
edm::ConsumesCollector  iC 
)
inline

Definition at line 16 of file TrackToCandidate.h.

MassiveCandidateConverter(const edm::ParameterSet &, edm::ConsumesCollector)

Member Function Documentation

◆ convert()

void converter::TrackToCandidate::convert ( reco::TrackRef  trkRef,
reco::RecoChargedCandidate c 
) const
inline

Definition at line 17 of file TrackToCandidate.h.

References DummyCfis::c, reco::TrackBase::charge(), converter::MassiveCandidateConverter::massSqr_, reco::TrackBase::momentum(), AlCaHLTBitMon_ParallelJobs::p, converter::MassiveCandidateConverter::particle_, PdtEntry::pdgId(), mathSSE::sqrt(), submitPVValidationJobs::t, and reco::TrackBase::vertex().

17  {
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  }
int charge() const
track electric charge
Definition: TrackBase.h:596
T sqrt(T t)
Definition: SSEVec.h:23
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
Definition: TrackBase.h:676
int pdgId() const
PDG id.
Definition: PdtEntry.cc:5
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:664
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:77