CMS 3D CMS Logo

StandAloneMuonTrackToCandidate.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_StandAloneMuonTrackToCandidate_h
2 #define RecoAlgos_StandAloneMuonTrackToCandidate_h
9 
10 namespace converter {
11 
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> {
34  };
35  } // namespace helper
36 
37 } // namespace converter
38 
39 #endif
void convert(reco::TrackRef trkRef, reco::RecoStandAloneMuonCandidate &c) const
Definition: helper.py:1
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
int charge() const
track electric charge
Definition: TrackBase.h:596
T sqrt(T t)
Definition: SSEVec.h:19
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
fixed size matrix
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:77
StandAloneMuonTrackToCandidate(const edm::ParameterSet &cfg, edm::ConsumesCollector iC)