LDMX Software
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ldmx::Track Class Reference

Implementation of a track object. More...

#include <Track.h>

Classes

struct  TrackState
 

Public Member Functions

virtual ~Track ()
 Destructor.
 
void Print () const
 Print the string representation of this object.
 
void Clear ()
 
void setNhits (int nhits)
 
int getNhits () const
 
std::optional< TrackStategetTrackState (TrackStateType tstype) const
 
void setNoutliers (int nout)
 
int getNoutliers () const
 
void setNdf (int ndf)
 
int getNdf () const
 
void setNsharedHits (int nsh)
 
int getNsharedHits () const
 
void setChi2 (double chi2)
 
double getChi2 () const
 
void setTrackID (int trackid)
 
int getTrackID () const
 
void setTruthProb (double truthProb)
 
double getTruthProb () const
 
void setPdgID (int pdgID)
 
int getPdgID () const
 
int q () const
 
void addMeasurementIndex (unsigned int measIdx)
 
std::vector< unsigned int > getMeasurementsIdxs () const
 
void setPerigeeParameters (const std::vector< double > &par)
 d_0 z_0 phi_0 theta q/p t
 
std::vector< double > getPerigeeParameters () const
 
void setPerigeeCov (const std::vector< double > &cov)
 
std::vector< double > getPerigeeCov () const
 
void setPerigeeLocation (const std::vector< double > &perigee)
 
void setPerigeeLocation (const double &x, const double &y, const double &z)
 
void setMomentum (const double &px, const double &py, const double &pz)
 
void setPosition (const double &x, const double &y, const double &z)
 
std::vector< double > getPerigeeLocation () const
 
double getPerigeeX () const
 
double getPerigeeY () const
 
double getPerigeeZ () const
 
std::vector< double > getMomentum () const
 
std::vector< double > getPosition () const
 
double getD0 () const
 
double getZ0 () const
 
double getPhi () const
 
double getTheta () const
 
double getQoP () const
 
double getT () const
 
void addTrackState (const ldmx::Track::TrackState &ts)
 
std::vector< TrackStategetTrackStates () const
 

Protected Member Functions

 ClassDef (Track, 2)
 Class declaration needed by the ROOT dictionary.
 

Protected Attributes

int n_hits_ {0}
 
int n_outliers_ {0}
 
int ndf_ {0}
 
int n_shared_hits_ {0}
 
int n_holes_ {0}
 
double chi2_ {0}
 
std::vector< double > perigee_pars_ {0., 0., 0., 0., 0., 0.}
 
std::vector< double > perigee_cov_
 
std::vector< double > perigee_ {0., 0., 0.}
 
std::vector< double > momentum_ {0., 0., 0.}
 
std::vector< double > position_ {0., 0., 0.}
 
std::vector< unsigned int > meas_idxs_ {}
 
int trackID_ {-1}
 
double truthProb_ {0.}
 
int pdgID_ {0}
 
std::vector< TrackStatetrackStates_
 

Detailed Description

Implementation of a track object.

This class encapsulates all the information of a particle trajectory in the tracker

Definition at line 52 of file Track.h.

Constructor & Destructor Documentation

◆ Track()

ldmx::Track::Track ( )
inline

Definition at line 64 of file Track.h.

64{};

◆ ~Track()

virtual ldmx::Track::~Track ( )
inlinevirtual

Destructor.

Currently, the destructor does nothing.

Definition at line 71 of file Track.h.

71{};

Member Function Documentation

◆ addMeasurementIndex()

void ldmx::Track::addMeasurementIndex ( unsigned int  measIdx)
inline

Definition at line 125 of file Track.h.

125 {
126 meas_idxs_.push_back(measIdx);
127 }

◆ addTrackState()

void ldmx::Track::addTrackState ( const ldmx::Track::TrackState ts)
inline

Definition at line 191 of file Track.h.

191 {
192 trackStates_.push_back(ts);
193 };

◆ Clear()

void ldmx::Track::Clear ( )
inline

Definition at line 81 of file Track.h.

81{};

◆ getChi2()

double ldmx::Track::getChi2 ( ) const
inline

Definition at line 106 of file Track.h.

106{ return chi2_; }

◆ getD0()

double ldmx::Track::getD0 ( ) const
inline

Definition at line 184 of file Track.h.

184{ return perigee_pars_[0]; };

◆ getMeasurementsIdxs()

std::vector< unsigned int > ldmx::Track::getMeasurementsIdxs ( ) const
inline

Definition at line 128 of file Track.h.

128{ return meas_idxs_; }

◆ getMomentum()

std::vector< double > ldmx::Track::getMomentum ( ) const
inline

Definition at line 179 of file Track.h.

179{ return momentum_; };

◆ getNdf()

int ldmx::Track::getNdf ( ) const
inline

Definition at line 100 of file Track.h.

100{ return ndf_; };

◆ getNhits()

int ldmx::Track::getNhits ( ) const
inline

Definition at line 84 of file Track.h.

84{ return n_hits_; }

◆ getNoutliers()

int ldmx::Track::getNoutliers ( ) const
inline

Definition at line 97 of file Track.h.

97{ return n_outliers_; }

◆ getNsharedHits()

int ldmx::Track::getNsharedHits ( ) const
inline

Definition at line 103 of file Track.h.

103{ return n_shared_hits_; }

◆ getPdgID()

int ldmx::Track::getPdgID ( ) const
inline

Definition at line 115 of file Track.h.

115{ return pdgID_; };

◆ getPerigeeCov()

std::vector< double > ldmx::Track::getPerigeeCov ( ) const
inline

Definition at line 150 of file Track.h.

150{ return perigee_cov_; }

◆ getPerigeeLocation()

std::vector< double > ldmx::Track::getPerigeeLocation ( ) const
inline

Definition at line 174 of file Track.h.

174{ return perigee_; };

◆ getPerigeeParameters()

std::vector< double > ldmx::Track::getPerigeeParameters ( ) const
inline

Definition at line 147 of file Track.h.

147{ return perigee_pars_; }

◆ getPerigeeX()

double ldmx::Track::getPerigeeX ( ) const
inline

Definition at line 175 of file Track.h.

175{ return perigee_[0]; };

◆ getPerigeeY()

double ldmx::Track::getPerigeeY ( ) const
inline

Definition at line 176 of file Track.h.

176{ return perigee_[1]; };

◆ getPerigeeZ()

double ldmx::Track::getPerigeeZ ( ) const
inline

Definition at line 177 of file Track.h.

177{ return perigee_[2]; };

◆ getPhi()

double ldmx::Track::getPhi ( ) const
inline

Definition at line 186 of file Track.h.

186{ return perigee_pars_[2]; };

◆ getPosition()

std::vector< double > ldmx::Track::getPosition ( ) const
inline

Definition at line 180 of file Track.h.

180{ return position_; };

◆ getQoP()

double ldmx::Track::getQoP ( ) const
inline

Definition at line 188 of file Track.h.

188{ return perigee_pars_[4]; };

◆ getT()

double ldmx::Track::getT ( ) const
inline

Definition at line 189 of file Track.h.

189{ return perigee_pars_[5]; };

◆ getTheta()

double ldmx::Track::getTheta ( ) const
inline

Definition at line 187 of file Track.h.

187{ return perigee_pars_[3]; };

◆ getTrackID()

int ldmx::Track::getTrackID ( ) const
inline

Definition at line 109 of file Track.h.

109{ return trackID_; };

◆ getTrackState()

std::optional< TrackState > ldmx::Track::getTrackState ( TrackStateType  tstype) const
inline

Definition at line 86 of file Track.h.

86 {
87 for (auto ts : trackStates_)
88 if (ts.ts_type == tstype) return std::optional<TrackState>(ts);
89
90 return std::nullopt;
91 }

◆ getTrackStates()

std::vector< TrackState > ldmx::Track::getTrackStates ( ) const
inline

Definition at line 195 of file Track.h.

195{ return trackStates_; }

◆ getTruthProb()

double ldmx::Track::getTruthProb ( ) const
inline

Definition at line 112 of file Track.h.

112{ return truthProb_; };

◆ getZ0()

double ldmx::Track::getZ0 ( ) const
inline

Definition at line 185 of file Track.h.

185{ return perigee_pars_[1]; };

◆ Print()

void ldmx::Track::Print ( ) const

Print the string representation of this object.

This class is needed by ROOT when building the dictionary.

◆ q()

int ldmx::Track::q ( ) const
inline

Definition at line 118 of file Track.h.

118{ return perigee_pars_[4] > 0 ? 1 : -1; }

◆ setChi2()

void ldmx::Track::setChi2 ( double  chi2)
inline

Definition at line 105 of file Track.h.

105{ chi2_ = chi2; }

◆ setMomentum()

void ldmx::Track::setMomentum ( const double &  px,
const double &  py,
const double &  pz 
)
inline

Definition at line 162 of file Track.h.

162 {
163 momentum_[0] = px;
164 momentum_[1] = py;
165 momentum_[2] = pz;
166 }

◆ setNdf()

void ldmx::Track::setNdf ( int  ndf)
inline

Definition at line 99 of file Track.h.

99{ ndf_ = ndf; }

◆ setNhits()

void ldmx::Track::setNhits ( int  nhits)
inline

Definition at line 83 of file Track.h.

83{ n_hits_ = nhits; }

◆ setNoutliers()

void ldmx::Track::setNoutliers ( int  nout)
inline

Definition at line 96 of file Track.h.

96{ n_outliers_ = nout; }

◆ setNsharedHits()

void ldmx::Track::setNsharedHits ( int  nsh)
inline

Definition at line 102 of file Track.h.

102{ n_shared_hits_ = nsh; }

◆ setPdgID()

void ldmx::Track::setPdgID ( int  pdgID)
inline

Definition at line 114 of file Track.h.

114{ pdgID_ = pdgID; };

◆ setPerigeeCov()

void ldmx::Track::setPerigeeCov ( const std::vector< double > &  cov)
inline

Definition at line 149 of file Track.h.

149{ perigee_cov_ = cov; }

◆ setPerigeeLocation() [1/2]

void ldmx::Track::setPerigeeLocation ( const double &  x,
const double &  y,
const double &  z 
)
inline

Definition at line 156 of file Track.h.

156 {
157 perigee_[0] = x;
158 perigee_[1] = y;
159 perigee_[2] = z;
160 }

◆ setPerigeeLocation() [2/2]

void ldmx::Track::setPerigeeLocation ( const std::vector< double > &  perigee)
inline

Definition at line 152 of file Track.h.

152 {
153 perigee_ = perigee;
154 }

◆ setPerigeeParameters()

void ldmx::Track::setPerigeeParameters ( const std::vector< double > &  par)
inline

◆ setPosition()

void ldmx::Track::setPosition ( const double &  x,
const double &  y,
const double &  z 
)
inline

Definition at line 168 of file Track.h.

168 {
169 position_[0] = x;
170 position_[1] = y;
171 position_[2] = z;
172 }

◆ setTrackID()

void ldmx::Track::setTrackID ( int  trackid)
inline

Definition at line 108 of file Track.h.

108{ trackID_ = trackid; };

◆ setTruthProb()

void ldmx::Track::setTruthProb ( double  truthProb)
inline

Definition at line 111 of file Track.h.

111{ truthProb_ = truthProb; };

Member Data Documentation

◆ chi2_

double ldmx::Track::chi2_ {0}
protected

Definition at line 207 of file Track.h.

207{0};

◆ meas_idxs_

std::vector<unsigned int> ldmx::Track::meas_idxs_ {}
protected

Definition at line 236 of file Track.h.

236{};

◆ momentum_

std::vector<double> ldmx::Track::momentum_ {0., 0., 0.}
protected

Definition at line 230 of file Track.h.

230{0., 0., 0.};

◆ n_hits_

int ldmx::Track::n_hits_ {0}
protected

Definition at line 198 of file Track.h.

198{0};

◆ n_holes_

int ldmx::Track::n_holes_ {0}
protected

Definition at line 202 of file Track.h.

202{0};

◆ n_outliers_

int ldmx::Track::n_outliers_ {0}
protected

Definition at line 199 of file Track.h.

199{0};

◆ n_shared_hits_

int ldmx::Track::n_shared_hits_ {0}
protected

Definition at line 201 of file Track.h.

201{0};

◆ ndf_

int ldmx::Track::ndf_ {0}
protected

Definition at line 200 of file Track.h.

200{0};

◆ pdgID_

int ldmx::Track::pdgID_ {0}
protected

Definition at line 245 of file Track.h.

245{0};

◆ perigee_

std::vector<double> ldmx::Track::perigee_ {0., 0., 0.}
protected

Definition at line 227 of file Track.h.

227{0., 0., 0.};

◆ perigee_cov_

std::vector<double> ldmx::Track::perigee_cov_
protected

Definition at line 224 of file Track.h.

◆ perigee_pars_

std::vector<double> ldmx::Track::perigee_pars_ {0., 0., 0., 0., 0., 0.}
protected

Definition at line 215 of file Track.h.

215{0., 0., 0., 0., 0., 0.};

◆ position_

std::vector<double> ldmx::Track::position_ {0., 0., 0.}
protected

Definition at line 233 of file Track.h.

233{0., 0., 0.};

◆ trackID_

int ldmx::Track::trackID_ {-1}
protected

Definition at line 239 of file Track.h.

239{-1};

◆ trackStates_

std::vector<TrackState> ldmx::Track::trackStates_
protected

Definition at line 248 of file Track.h.

◆ truthProb_

double ldmx::Track::truthProb_ {0.}
protected

Definition at line 242 of file Track.h.

242{0.};

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