CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
RecoTracktoTP Class Reference

#include <RecoTracktoTP.h>

Public Member Functions

bool allmatched () const
 
math::XYZPoint BeamSpot () const
 
float GetShared () const
 
bool hasPCA () const
 
bool hasRV () const
 
bool hasTPMother () const
 
bool matched () const
 
int numTPMothers () const
 
int numTPSourceTracks () const
 
double r_d0 () const
 
double r_d02 () const
 
double r_dsz () const
 
double r_dxy () const
 
double r_dz () const
 
double r_dz2 () const
 
 RecoTracktoTP ()
 
reco::Track RT () const
 
reco::Vertex RV () const
 
double s_d0 () const
 
double s_dsz () const
 
double s_dxy () const
 
double s_dz () const
 
double s_eta () const
 
double s_lambda () const
 
GlobalVector s_p () const
 
GlobalPoint s_pca () const
 
double s_phi () const
 
double s_qoverp () const
 
double s_theta () const
 
GlobalPoint s_v () const
 
void SetBeamSpot (const math::XYZPoint &bs)
 
void SetRecoTrack (reco::TrackBaseRef track)
 
void SetRecoVertex (reco::VertexRef vertex)
 
void SetShared (const float &m)
 
void SetTrackingParticle (TrackingParticleRef tp)
 
void SetTrackingParticleMomentumPCA (const GlobalVector &p)
 
void SetTrackingParticlePCA (const GlobalPoint &v)
 
TrackingParticle TP () const
 
TrackingParticle TPMother (unsigned short i) const
 
TrackingParticle TPMother () const
 
 ~RecoTracktoTP ()
 

Protected Attributes

math::XYZPoint beamSpot_
 
reco::TrackBaseRef recoTrack
 
reco::VertexRef recoVertex
 
float shared_
 
GlobalVector simMomPCA_
 
GlobalPoint simPCA_
 
TrackingParticleRef trackingParticle_
 

Detailed Description

Definition at line 20 of file RecoTracktoTP.h.

Constructor & Destructor Documentation

◆ RecoTracktoTP()

RecoTracktoTP::RecoTracktoTP ( )

Definition at line 4 of file RecoTracktoTP.cc.

References SetBeamSpot(), SetTrackingParticleMomentumPCA(), and SetTrackingParticlePCA().

4  {
5  SetBeamSpot(math::XYZPoint(-9999.0, -9999.0, -9999.0));
6  SetTrackingParticlePCA(GlobalPoint(-9999.0, -9999.0, -9999.0));
7  SetTrackingParticleMomentumPCA(GlobalVector(-9999.0, -9999.0, -9999.0));
8 }
void SetTrackingParticleMomentumPCA(const GlobalVector &p)
Definition: RecoTracktoTP.h:55
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
void SetTrackingParticlePCA(const GlobalPoint &v)
Definition: RecoTracktoTP.h:56
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
void SetBeamSpot(const math::XYZPoint &bs)
Definition: RecoTracktoTP.h:28
Global3DVector GlobalVector
Definition: GlobalVector.h:10

◆ ~RecoTracktoTP()

RecoTracktoTP::~RecoTracktoTP ( )

Definition at line 10 of file RecoTracktoTP.cc.

10 {}

Member Function Documentation

◆ allmatched()

bool RecoTracktoTP::allmatched ( ) const
inline

Definition at line 42 of file RecoTracktoTP.h.

References hasRV(), and matched().

42 { return matched() && hasRV(); }
bool hasRV() const
Definition: RecoTracktoTP.h:38
bool matched() const
Definition: RecoTracktoTP.h:37

◆ BeamSpot()

math::XYZPoint RecoTracktoTP::BeamSpot ( ) const
inline

Definition at line 35 of file RecoTracktoTP.h.

References beamSpot_.

Referenced by r_dsz(), r_dxy(), r_dz(), and s_v().

35 { return beamSpot_; }
math::XYZPoint beamSpot_
Definition: RecoTracktoTP.h:96

◆ GetShared()

float RecoTracktoTP::GetShared ( ) const
inline

Definition at line 79 of file RecoTracktoTP.h.

References shared_.

79 { return shared_; }

◆ hasPCA()

bool RecoTracktoTP::hasPCA ( ) const
inline

Definition at line 41 of file RecoTracktoTP.h.

References PV3DBase< T, PVType, FrameType >::mag(), and s_pca().

41 { return s_pca().mag() < 9999.0; }
GlobalPoint s_pca() const
Definition: RecoTracktoTP.h:59
T mag() const
Definition: PV3DBase.h:64

◆ hasRV()

bool RecoTracktoTP::hasRV ( ) const
inline

Definition at line 38 of file RecoTracktoTP.h.

References edm::Ref< C, T, F >::isNonnull(), and recoVertex.

Referenced by allmatched().

38  {
39  return recoVertex.isNonnull() && fabs(recoVertex->position().Mag2()) > 0.0;
40  } // position is ROOT::MATH::Cartesian3D<double>
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
reco::VertexRef recoVertex
Definition: RecoTracktoTP.h:90

◆ hasTPMother()

bool RecoTracktoTP::hasTPMother ( ) const
inline

Definition at line 86 of file RecoTracktoTP.h.

References numTPMothers().

86 { return numTPMothers() > 0; }
int numTPMothers() const

◆ matched()

bool RecoTracktoTP::matched ( ) const
inline

Definition at line 37 of file RecoTracktoTP.h.

References edm::RefToBase< T >::isNonnull(), edm::Ref< C, T, F >::isNonnull(), recoTrack, and trackingParticle_.

Referenced by allmatched().

bool isNonnull() const
Checks for non-null.
Definition: RefToBase.h:303
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
reco::TrackBaseRef recoTrack
Definition: RecoTracktoTP.h:89
TrackingParticleRef trackingParticle_
Definition: RecoTracktoTP.h:92

◆ numTPMothers()

int RecoTracktoTP::numTPMothers ( ) const

Definition at line 41 of file RecoTracktoTP.cc.

References submitPVResolutionJobs::count, TrackingParticle::parentVertex(), and TP().

Referenced by hasTPMother(), and TPMother().

41  {
42  int count = 0;
43  for (TrackingParticleRefVector::iterator si = TP().parentVertex()->sourceTracks_begin();
44  si != TP().parentVertex()->sourceTracks_end();
45  ++si) {
46  for (TrackingParticleRefVector::iterator di = TP().parentVertex()->daughterTracks_begin();
47  di != TP().parentVertex()->daughterTracks_end();
48  ++di) {
49  if (si != di)
50  count++;
51  break;
52  }
53  if (count > 0)
54  break;
55  }
56  return count;
57 }
TrackingParticle TP() const
Definition: RecoTracktoTP.h:33
const TrackingVertexRef & parentVertex() const

◆ numTPSourceTracks()

int RecoTracktoTP::numTPSourceTracks ( ) const
inline

Definition at line 84 of file RecoTracktoTP.h.

References TrackingParticle::parentVertex(), and TP().

84 { return TP().parentVertex()->nSourceTracks(); }
TrackingParticle TP() const
Definition: RecoTracktoTP.h:33
const TrackingVertexRef & parentVertex() const

◆ r_d0()

double RecoTracktoTP::r_d0 ( ) const
inline

Definition at line 47 of file RecoTracktoTP.h.

References r_dxy().

47 { return -1.0 * r_dxy(); }
double r_dxy() const
Definition: RecoTracktoTP.h:45

◆ r_d02()

double RecoTracktoTP::r_d02 ( ) const
inline

Definition at line 51 of file RecoTracktoTP.h.

References reco::TrackBase::dxy(), position, RT(), and RV().

51 { return -1.0 * RT().dxy(RV().position()); }
reco::Vertex RV() const
Definition: RecoTracktoTP.h:34
static int position[264][3]
Definition: ReadPGInfo.cc:289
reco::Track RT() const
Definition: RecoTracktoTP.h:32
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:608

◆ r_dsz()

double RecoTracktoTP::r_dsz ( ) const
inline

Definition at line 46 of file RecoTracktoTP.h.

References BeamSpot(), reco::TrackBase::dsz(), and RT().

46 { return RT().dsz(BeamSpot()); }
math::XYZPoint BeamSpot() const
Definition: RecoTracktoTP.h:35
double dsz() const
dsz parameter (THIS IS NOT the SZ impact parameter to (0,0,0) if refPoint is far from (0...
Definition: TrackBase.h:614
reco::Track RT() const
Definition: RecoTracktoTP.h:32

◆ r_dxy()

double RecoTracktoTP::r_dxy ( ) const
inline

Definition at line 45 of file RecoTracktoTP.h.

References BeamSpot(), reco::TrackBase::dxy(), and RT().

Referenced by r_d0().

45 { return RT().dxy(BeamSpot()); }
math::XYZPoint BeamSpot() const
Definition: RecoTracktoTP.h:35
reco::Track RT() const
Definition: RecoTracktoTP.h:32
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:608

◆ r_dz()

double RecoTracktoTP::r_dz ( ) const
inline

Definition at line 48 of file RecoTracktoTP.h.

References BeamSpot(), reco::TrackBase::dz(), and RT().

48 { return RT().dz(BeamSpot()); }
math::XYZPoint BeamSpot() const
Definition: RecoTracktoTP.h:35
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:622
reco::Track RT() const
Definition: RecoTracktoTP.h:32

◆ r_dz2()

double RecoTracktoTP::r_dz2 ( ) const
inline

Definition at line 52 of file RecoTracktoTP.h.

References reco::TrackBase::dz(), position, RT(), and RV().

52 { return RT().dz(RV().position()); }
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:622
reco::Vertex RV() const
Definition: RecoTracktoTP.h:34
static int position[264][3]
Definition: ReadPGInfo.cc:289
reco::Track RT() const
Definition: RecoTracktoTP.h:32

◆ RT()

reco::Track RecoTracktoTP::RT ( ) const
inline

Definition at line 32 of file RecoTracktoTP.h.

References edm::RefToBase< T >::isNonnull(), and recoTrack.

Referenced by r_d02(), r_dsz(), r_dxy(), r_dz(), and r_dz2().

32 { return recoTrack.isNonnull() ? *recoTrack : reco::Track(); }
bool isNonnull() const
Checks for non-null.
Definition: RefToBase.h:303
reco::TrackBaseRef recoTrack
Definition: RecoTracktoTP.h:89

◆ RV()

reco::Vertex RecoTracktoTP::RV ( ) const
inline

Definition at line 34 of file RecoTracktoTP.h.

References edm::Ref< C, T, F >::isNonnull(), recoVertex, and HltBtagValidation_cff::Vertex.

Referenced by r_d02(), and r_dz2().

34 { return recoVertex.isNonnull() ? *recoVertex : reco::Vertex(); }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
reco::VertexRef recoVertex
Definition: RecoTracktoTP.h:90

◆ s_d0()

double RecoTracktoTP::s_d0 ( ) const
inline

Definition at line 75 of file RecoTracktoTP.h.

References s_dxy().

75 { return -1.0 * s_dxy(); }
double s_dxy() const
Definition: RecoTracktoTP.h:70

◆ s_dsz()

double RecoTracktoTP::s_dsz ( ) const
inline

Definition at line 71 of file RecoTracktoTP.h.

References PV3DBase< T, PVType, FrameType >::mag(), PV3DBase< T, PVType, FrameType >::perp(), s_p(), s_v(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

71  {
72  return s_v().z() * s_p().perp() / s_p().mag() -
73  ((s_v().x() * s_p().x() + s_v().y() * s_p().y()) / s_p().perp()) * s_p().z() / s_p().mag();
74  }
T perp() const
Definition: PV3DBase.h:69
T z() const
Definition: PV3DBase.h:61
GlobalPoint s_v() const
Definition: RecoTracktoTP.h:60
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
T mag() const
Definition: PV3DBase.h:64
GlobalVector s_p() const
Definition: RecoTracktoTP.h:58

◆ s_dxy()

double RecoTracktoTP::s_dxy ( ) const
inline

Definition at line 70 of file RecoTracktoTP.h.

References PV3DBase< T, PVType, FrameType >::perp(), s_p(), s_v(), x, and y.

Referenced by s_d0().

70 { return (-s_v().x() * s_p().y() + s_v().y() * s_p().x()) / s_p().perp(); }
T perp() const
Definition: PV3DBase.h:69
GlobalPoint s_v() const
Definition: RecoTracktoTP.h:60
GlobalVector s_p() const
Definition: RecoTracktoTP.h:58

◆ s_dz()

double RecoTracktoTP::s_dz ( ) const
inline

Definition at line 76 of file RecoTracktoTP.h.

References PV3DBase< T, PVType, FrameType >::perp(), s_p(), s_v(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

76  {
77  return s_v().z() - (s_v().x() * s_p().x() + s_v().y() * s_p().y()) / s_p().perp() * s_p().z() / s_p().perp();
78  }
T perp() const
Definition: PV3DBase.h:69
T z() const
Definition: PV3DBase.h:61
GlobalPoint s_v() const
Definition: RecoTracktoTP.h:60
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
GlobalVector s_p() const
Definition: RecoTracktoTP.h:58

◆ s_eta()

double RecoTracktoTP::s_eta ( ) const
inline

Definition at line 68 of file RecoTracktoTP.h.

References dqm-mbProfile::log, s_p(), funct::tan(), and theta().

68 { return -1.0 * log(tan(0.5 * s_p().theta())); }
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
GlobalVector s_p() const
Definition: RecoTracktoTP.h:58
Geom::Theta< T > theta() const

◆ s_lambda()

double RecoTracktoTP::s_lambda ( ) const
inline

Definition at line 66 of file RecoTracktoTP.h.

References M_PI, s_p(), and PV3DBase< T, PVType, FrameType >::theta().

66 { return M_PI / 2 - s_p().theta(); }
#define M_PI
GlobalVector s_p() const
Definition: RecoTracktoTP.h:58
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72

◆ s_p()

GlobalVector RecoTracktoTP::s_p ( ) const
inline

Definition at line 58 of file RecoTracktoTP.h.

References simMomPCA_.

Referenced by s_dsz(), s_dxy(), s_dz(), s_eta(), s_lambda(), s_phi(), s_qoverp(), and s_theta().

58 { return simMomPCA_; }
GlobalVector simMomPCA_
Definition: RecoTracktoTP.h:94

◆ s_pca()

GlobalPoint RecoTracktoTP::s_pca ( ) const
inline

Definition at line 59 of file RecoTracktoTP.h.

References simPCA_.

Referenced by hasPCA(), and s_v().

59 { return simPCA_; }
GlobalPoint simPCA_
Definition: RecoTracktoTP.h:95

◆ s_phi()

double RecoTracktoTP::s_phi ( ) const
inline

Definition at line 67 of file RecoTracktoTP.h.

References PV3DBase< T, PVType, FrameType >::phi(), and s_p().

67 { return s_p().phi(); }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
GlobalVector s_p() const
Definition: RecoTracktoTP.h:58

◆ s_qoverp()

double RecoTracktoTP::s_qoverp ( ) const
inline

Definition at line 64 of file RecoTracktoTP.h.

References TrackingParticle::charge(), PV3DBase< T, PVType, FrameType >::mag(), s_p(), and TP().

64 { return TP().charge() / s_p().mag(); }
TrackingParticle TP() const
Definition: RecoTracktoTP.h:33
T mag() const
Definition: PV3DBase.h:64
GlobalVector s_p() const
Definition: RecoTracktoTP.h:58
float charge() const
Electric charge. Note this is taken from the first SimTrack only.

◆ s_theta()

double RecoTracktoTP::s_theta ( ) const
inline

Definition at line 65 of file RecoTracktoTP.h.

References s_p(), and PV3DBase< T, PVType, FrameType >::theta().

65 { return s_p().theta(); }
GlobalVector s_p() const
Definition: RecoTracktoTP.h:58
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72

◆ s_v()

GlobalPoint RecoTracktoTP::s_v ( ) const
inline

Definition at line 60 of file RecoTracktoTP.h.

References BeamSpot(), s_pca(), x, y, and z.

Referenced by s_dsz(), s_dxy(), and s_dz().

60  {
61  return GlobalPoint(s_pca().x() - BeamSpot().x(), s_pca().y() - BeamSpot().y(), s_pca().z() - BeamSpot().z());
62  }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
math::XYZPoint BeamSpot() const
Definition: RecoTracktoTP.h:35
GlobalPoint s_pca() const
Definition: RecoTracktoTP.h:59

◆ SetBeamSpot()

void RecoTracktoTP::SetBeamSpot ( const math::XYZPoint bs)
inline

Definition at line 28 of file RecoTracktoTP.h.

References beamSpot_, and cms::cuda::bs.

Referenced by TrackAlgoCompareUtil::produce(), and RecoTracktoTP().

28 { beamSpot_ = bs; }
math::XYZPoint beamSpot_
Definition: RecoTracktoTP.h:96

◆ SetRecoTrack()

void RecoTracktoTP::SetRecoTrack ( reco::TrackBaseRef  track)
inline

Definition at line 26 of file RecoTracktoTP.h.

References recoTrack, and HLT_2024v11_cff::track.

Referenced by TrackAlgoCompareUtil::produce().

26 { recoTrack = track; }
reco::TrackBaseRef recoTrack
Definition: RecoTracktoTP.h:89

◆ SetRecoVertex()

void RecoTracktoTP::SetRecoVertex ( reco::VertexRef  vertex)
inline

Definition at line 27 of file RecoTracktoTP.h.

References recoVertex, and bphysicsOniaDQM_cfi::vertex.

Referenced by TrackAlgoCompareUtil::produce().

◆ SetShared()

void RecoTracktoTP::SetShared ( const float &  m)
inline

◆ SetTrackingParticle()

void RecoTracktoTP::SetTrackingParticle ( TrackingParticleRef  tp)
inline

Definition at line 25 of file RecoTracktoTP.h.

References cmsswSequenceInfo::tp, and trackingParticle_.

Referenced by TrackAlgoCompareUtil::produce().

25 { trackingParticle_ = tp; }
TrackingParticleRef trackingParticle_
Definition: RecoTracktoTP.h:92

◆ SetTrackingParticleMomentumPCA()

void RecoTracktoTP::SetTrackingParticleMomentumPCA ( const GlobalVector p)
inline

◆ SetTrackingParticlePCA()

void RecoTracktoTP::SetTrackingParticlePCA ( const GlobalPoint v)
inline

Definition at line 56 of file RecoTracktoTP.h.

References simPCA_, and findQualityFiles::v.

Referenced by RecoTracktoTP(), and TrackAlgoCompareUtil::SetTrackingParticleD0Dz().

◆ TP()

TrackingParticle RecoTracktoTP::TP ( ) const
inline

Definition at line 33 of file RecoTracktoTP.h.

References edm::Ref< C, T, F >::isNonnull(), ProducerSetup_cfi::TrackingParticle, and trackingParticle_.

Referenced by numTPMothers(), numTPSourceTracks(), s_qoverp(), and TPMother().

bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
TrackingParticleRef trackingParticle_
Definition: RecoTracktoTP.h:92

◆ TPMother() [1/2]

TrackingParticle RecoTracktoTP::TPMother ( unsigned short  i) const

Definition at line 12 of file RecoTracktoTP.cc.

References mps_fire::i, TrackingParticle::parentVertex(), mps_fire::result, TP(), and ProducerSetup_cfi::TrackingParticle.

12  {
13  std::vector<TrackingParticle> result;
14 
15  if (TP().parentVertex().isNonnull()) {
16  if (TP().parentVertex()->nSourceTracks() > 0) {
17  for (TrackingParticleRefVector::iterator si = TP().parentVertex()->sourceTracks_begin();
18  si != TP().parentVertex()->sourceTracks_end();
19  ++si) {
20  for (TrackingParticleRefVector::iterator di = TP().parentVertex()->daughterTracks_begin();
21  di != TP().parentVertex()->daughterTracks_end();
22  ++di) {
23  if (si != di) {
24  result.push_back(**si);
25  break;
26  }
27  }
28  if (!result.empty())
29  break;
30  }
31  } else {
32  return TrackingParticle();
33  }
34  } else {
35  return TrackingParticle();
36  }
37 
38  return i < result.size() ? result[i] : TrackingParticle();
39 }
TrackingParticle TP() const
Definition: RecoTracktoTP.h:33
const TrackingVertexRef & parentVertex() const

◆ TPMother() [2/2]

TrackingParticle RecoTracktoTP::TPMother ( ) const
inline

Definition at line 83 of file RecoTracktoTP.h.

References numTPMothers(), TPMother(), and ProducerSetup_cfi::TrackingParticle.

Referenced by TPMother().

83 { return numTPMothers() == 1 ? TPMother(0) : TrackingParticle(); }
int numTPMothers() const
TrackingParticle TPMother() const
Definition: RecoTracktoTP.h:83
Monte Carlo truth information used for tracking validation.

Member Data Documentation

◆ beamSpot_

math::XYZPoint RecoTracktoTP::beamSpot_
protected

Definition at line 96 of file RecoTracktoTP.h.

Referenced by BeamSpot(), and SetBeamSpot().

◆ recoTrack

reco::TrackBaseRef RecoTracktoTP::recoTrack
protected

Definition at line 89 of file RecoTracktoTP.h.

Referenced by matched(), RT(), and SetRecoTrack().

◆ recoVertex

reco::VertexRef RecoTracktoTP::recoVertex
protected

Definition at line 90 of file RecoTracktoTP.h.

Referenced by hasRV(), RV(), and SetRecoVertex().

◆ shared_

float RecoTracktoTP::shared_
protected

Definition at line 97 of file RecoTracktoTP.h.

Referenced by GetShared(), and SetShared().

◆ simMomPCA_

GlobalVector RecoTracktoTP::simMomPCA_
protected

Definition at line 94 of file RecoTracktoTP.h.

Referenced by s_p(), and SetTrackingParticleMomentumPCA().

◆ simPCA_

GlobalPoint RecoTracktoTP::simPCA_
protected

Definition at line 95 of file RecoTracktoTP.h.

Referenced by s_pca(), and SetTrackingParticlePCA().

◆ trackingParticle_

TrackingParticleRef RecoTracktoTP::trackingParticle_
protected

Definition at line 92 of file RecoTracktoTP.h.

Referenced by matched(), SetTrackingParticle(), and TP().