FairShip
Loading...
Searching...
No Matches
SHiP::RecoTrack Class Reference

#include <RecoTrack.h>

Inheritance diagram for SHiP::RecoTrack:
[legend]
Collaboration diagram for SHiP::RecoTrack:
[legend]

Public Member Functions

 RecoTrack ()=default
 RecoTrack (const TVector3 &position, const TVector3 &momentum, Int_t charge, const std::array< Double_t, 21 > &covariance, Double_t chi2, Double_t nDoF, UInt_t nMeasurements, std::vector< Double_t > residuals, std::vector< Double_t > pulls)
 ~RecoTrack () override=default
Double_t x () const
Double_t y () const
Double_t z () const
Double_t px () const
Double_t py () const
Double_t pz () const
Int_t charge () const
Double_t err_x () const
Double_t err_y () const
Double_t err_z () const
Double_t err_px () const
Double_t err_py () const
Double_t err_pz () const
Double_t chi2 () const
Double_t nDoF () const
UInt_t nMeasurements () const
const std::vector< Double_t > & GetResiduals () const
 Residuals of the smoothed states, in cm, ordered along the track.
const std::vector< Double_t > & GetPulls () const
const std::vector< Double_t > & GetCovarianceElements () const
Bool_t ExtrapolateToZ (Double_t z, TVector3 &position) const

Private Member Functions

 ClassDefOverride (RecoTrack, 1)

Private Attributes

Double_t m_x {0.}
Double_t m_y {0.}
Double_t m_z {0.}
Double_t m_px {0.}
Double_t m_py {0.}
Double_t m_pz {0.}
Int_t m_charge {0}
Double_t m_err_x {0.}
Double_t m_err_y {0.}
Double_t m_err_z {0.}
Double_t m_err_px {0.}
Double_t m_err_py {0.}
Double_t m_err_pz {0.}
Double_t m_chi2 {0.}
Double_t m_nDoF {0.}
UInt_t m_nMeasurements {0}
std::vector< Double_t > m_residuals
std::vector< Double_t > m_pulls
std::vector< Double_t > m_cov_elements

Detailed Description

Fitted track from the ACTS straw tracker fit, in the SHiP frame.

The state is taken at the first measurement of the track. Positions are in cm, momenta in GeV. The covariance is the 6x6 matrix of (x, y, z, px, py, pz), stored as its upper triangle in row-major order, so the variances of px, py and pz are elements 15, 18 and 20.

The class does not depend on ACTS, so reco files can be read without it.

Definition at line 25 of file RecoTrack.h.

Constructor & Destructor Documentation

◆ RecoTrack() [1/2]

SHiP::RecoTrack::RecoTrack ( )
default

◆ RecoTrack() [2/2]

SHiP::RecoTrack::RecoTrack ( const TVector3 & position,
const TVector3 & momentum,
Int_t charge,
const std::array< Double_t, 21 > & covariance,
Double_t chi2,
Double_t nDoF,
UInt_t nMeasurements,
std::vector< Double_t > residuals,
std::vector< Double_t > pulls )

Definition at line 13 of file RecoTrack.cxx.

18 : TObject(),
19 m_x(position.X()),
20 m_y(position.Y()),
21 m_z(position.Z()),
22 m_px(momentum.X()),
23 m_py(momentum.Y()),
24 m_pz(momentum.Z()),
26 m_chi2(chi2),
27 m_nDoF(nDoF),
29 m_residuals(std::move(residuals)),
30 m_pulls(std::move(pulls)),
31 m_cov_elements(covariance.begin(), covariance.end()) {
32 // Diagonal of the upper triangle of a 6x6 matrix, row-major
33 auto sigma = [&covariance](int index) {
34 return std::sqrt(std::max(0.0, covariance[index]));
35 };
36 m_err_x = sigma(0);
37 m_err_y = sigma(6);
38 m_err_z = sigma(11);
39 m_err_px = sigma(15);
40 m_err_py = sigma(18);
41 m_err_pz = sigma(20);
42}
Double_t m_pz
Definition RecoTrack.h:70
Double_t m_err_py
Definition RecoTrack.h:76
Double_t m_y
Definition RecoTrack.h:66
Double_t m_nDoF
Definition RecoTrack.h:79
Double_t m_err_z
Definition RecoTrack.h:74
UInt_t m_nMeasurements
Definition RecoTrack.h:80
Double_t m_err_px
Definition RecoTrack.h:75
Double_t nDoF() const
Definition RecoTrack.h:48
Double_t m_chi2
Definition RecoTrack.h:78
Double_t chi2() const
Definition RecoTrack.h:47
std::vector< Double_t > m_pulls
Definition RecoTrack.h:82
Double_t m_x
Definition RecoTrack.h:65
UInt_t nMeasurements() const
Definition RecoTrack.h:49
Double_t m_err_y
Definition RecoTrack.h:73
std::vector< Double_t > m_residuals
Definition RecoTrack.h:81
Double_t m_z
Definition RecoTrack.h:67
Double_t m_err_pz
Definition RecoTrack.h:77
Double_t m_err_x
Definition RecoTrack.h:72
std::vector< Double_t > m_cov_elements
Definition RecoTrack.h:83
Double_t m_py
Definition RecoTrack.h:69
Double_t m_px
Definition RecoTrack.h:68
Int_t charge() const
Definition RecoTrack.h:40

◆ ~RecoTrack()

SHiP::RecoTrack::~RecoTrack ( )
overridedefault

Member Function Documentation

◆ charge()

Int_t SHiP::RecoTrack::charge ( ) const
inline

Definition at line 40 of file RecoTrack.h.

40{ return m_charge; }

◆ chi2()

Double_t SHiP::RecoTrack::chi2 ( ) const
inline

Definition at line 47 of file RecoTrack.h.

47{ return m_chi2; }

◆ ClassDefOverride()

SHiP::RecoTrack::ClassDefOverride ( RecoTrack ,
1  )
private

◆ err_px()

Double_t SHiP::RecoTrack::err_px ( ) const
inline

Definition at line 44 of file RecoTrack.h.

44{ return m_err_px; }

◆ err_py()

Double_t SHiP::RecoTrack::err_py ( ) const
inline

Definition at line 45 of file RecoTrack.h.

45{ return m_err_py; }

◆ err_pz()

Double_t SHiP::RecoTrack::err_pz ( ) const
inline

Definition at line 46 of file RecoTrack.h.

46{ return m_err_pz; }

◆ err_x()

Double_t SHiP::RecoTrack::err_x ( ) const
inline

Definition at line 41 of file RecoTrack.h.

41{ return m_err_x; }

◆ err_y()

Double_t SHiP::RecoTrack::err_y ( ) const
inline

Definition at line 42 of file RecoTrack.h.

42{ return m_err_y; }

◆ err_z()

Double_t SHiP::RecoTrack::err_z ( ) const
inline

Definition at line 43 of file RecoTrack.h.

43{ return m_err_z; }

◆ ExtrapolateToZ()

Bool_t SHiP::RecoTrack::ExtrapolateToZ ( Double_t z,
TVector3 & position ) const

Extrapolate the track along a straight line to the plane at z (cm).

The fitted state is taken at the first measurement, so this is only accurate where the field between that point and z can be neglected. Returns false if the track is parallel to the plane.

Definition at line 44 of file RecoTrack.cxx.

44 {
45 if (std::abs(m_pz) < 1e-10) {
46 return false;
47 }
48 const Double_t lambda = (z - m_z) / m_pz;
49 position.SetXYZ(m_x + lambda * m_px, m_y + lambda * m_py, z);
50 return true;
51}
Double_t z() const
Definition RecoTrack.h:36

◆ GetCovarianceElements()

const std::vector< Double_t > & SHiP::RecoTrack::GetCovarianceElements ( ) const
inline

Definition at line 53 of file RecoTrack.h.

53 {
54 return m_cov_elements;
55 }

◆ GetPulls()

const std::vector< Double_t > & SHiP::RecoTrack::GetPulls ( ) const
inline

Definition at line 52 of file RecoTrack.h.

52{ return m_pulls; }

◆ GetResiduals()

const std::vector< Double_t > & SHiP::RecoTrack::GetResiduals ( ) const
inline

Residuals of the smoothed states, in cm, ordered along the track.

Definition at line 51 of file RecoTrack.h.

51{ return m_residuals; }

◆ nDoF()

Double_t SHiP::RecoTrack::nDoF ( ) const
inline

Definition at line 48 of file RecoTrack.h.

48{ return m_nDoF; }

◆ nMeasurements()

UInt_t SHiP::RecoTrack::nMeasurements ( ) const
inline

Definition at line 49 of file RecoTrack.h.

49{ return m_nMeasurements; }

◆ px()

Double_t SHiP::RecoTrack::px ( ) const
inline

Definition at line 37 of file RecoTrack.h.

37{ return m_px; }

◆ py()

Double_t SHiP::RecoTrack::py ( ) const
inline

Definition at line 38 of file RecoTrack.h.

38{ return m_py; }

◆ pz()

Double_t SHiP::RecoTrack::pz ( ) const
inline

Definition at line 39 of file RecoTrack.h.

39{ return m_pz; }

◆ x()

Double_t SHiP::RecoTrack::x ( ) const
inline

Definition at line 34 of file RecoTrack.h.

34{ return m_x; }

◆ y()

Double_t SHiP::RecoTrack::y ( ) const
inline

Definition at line 35 of file RecoTrack.h.

35{ return m_y; }

◆ z()

Double_t SHiP::RecoTrack::z ( ) const
inline

Definition at line 36 of file RecoTrack.h.

36{ return m_z; }

Member Data Documentation

◆ m_charge

Int_t SHiP::RecoTrack::m_charge {0}
private

Definition at line 71 of file RecoTrack.h.

71{0};

◆ m_chi2

Double_t SHiP::RecoTrack::m_chi2 {0.}
private

Definition at line 78 of file RecoTrack.h.

78{0.};

◆ m_cov_elements

std::vector<Double_t> SHiP::RecoTrack::m_cov_elements
private

Definition at line 83 of file RecoTrack.h.

◆ m_err_px

Double_t SHiP::RecoTrack::m_err_px {0.}
private

Definition at line 75 of file RecoTrack.h.

75{0.};

◆ m_err_py

Double_t SHiP::RecoTrack::m_err_py {0.}
private

Definition at line 76 of file RecoTrack.h.

76{0.};

◆ m_err_pz

Double_t SHiP::RecoTrack::m_err_pz {0.}
private

Definition at line 77 of file RecoTrack.h.

77{0.};

◆ m_err_x

Double_t SHiP::RecoTrack::m_err_x {0.}
private

Definition at line 72 of file RecoTrack.h.

72{0.};

◆ m_err_y

Double_t SHiP::RecoTrack::m_err_y {0.}
private

Definition at line 73 of file RecoTrack.h.

73{0.};

◆ m_err_z

Double_t SHiP::RecoTrack::m_err_z {0.}
private

Definition at line 74 of file RecoTrack.h.

74{0.};

◆ m_nDoF

Double_t SHiP::RecoTrack::m_nDoF {0.}
private

Definition at line 79 of file RecoTrack.h.

79{0.};

◆ m_nMeasurements

UInt_t SHiP::RecoTrack::m_nMeasurements {0}
private

Definition at line 80 of file RecoTrack.h.

80{0};

◆ m_pulls

std::vector<Double_t> SHiP::RecoTrack::m_pulls
private

Definition at line 82 of file RecoTrack.h.

◆ m_px

Double_t SHiP::RecoTrack::m_px {0.}
private

Definition at line 68 of file RecoTrack.h.

68{0.};

◆ m_py

Double_t SHiP::RecoTrack::m_py {0.}
private

Definition at line 69 of file RecoTrack.h.

69{0.};

◆ m_pz

Double_t SHiP::RecoTrack::m_pz {0.}
private

Definition at line 70 of file RecoTrack.h.

70{0.};

◆ m_residuals

std::vector<Double_t> SHiP::RecoTrack::m_residuals
private

Definition at line 81 of file RecoTrack.h.

◆ m_x

Double_t SHiP::RecoTrack::m_x {0.}
private

Definition at line 65 of file RecoTrack.h.

65{0.};

◆ m_y

Double_t SHiP::RecoTrack::m_y {0.}
private

Definition at line 66 of file RecoTrack.h.

66{0.};

◆ m_z

Double_t SHiP::RecoTrack::m_z {0.}
private

Definition at line 67 of file RecoTrack.h.

67{0.};

The documentation for this class was generated from the following files: