CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TrackToCandidate.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_TrackToCandidate_h
2 #define RecoAlgos_TrackToCandidate_h
9 
10 namespace converter {
11 
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);
26  }
27  };
28 
29  namespace helper {
30  template <>
31  struct CandConverter<reco::Track> {
33  };
34  } // namespace helper
35 
36 } // namespace converter
37 
38 #endif
const edm::EventSetup & c
tuple cfg
Definition: looper.py:296
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:664
void setVertex(const Point &vertex) override
set vertex
void setCharge(Charge q) final
set electric charge
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
Definition: TrackBase.h:676
T sqrt(T t)
Definition: SSEVec.h:19
void convert(reco::TrackRef trkRef, reco::RecoChargedCandidate &c) const
TrackToCandidate(const edm::ParameterSet &cfg, edm::ConsumesCollector iC)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
reco::RecoChargedCandidate Candidate
int charge() const
track electric charge
Definition: TrackBase.h:596
reco::TrackCollection Components
void setTrack(const reco::TrackRef &r)
set reference to track
void setPdgId(int pdgId) final
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:77
void setP4(const LorentzVector &p4) final
set 4-momentum
int pdgId() const
PDG id.
Definition: PdtEntry.cc:5