LDMX Software
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 addOutlierIndex (unsigned int measIdx)
 
std::vector< unsigned int > getOutlierIdxs () const
 
void addHoleIndex (unsigned int measIdx)
 
std::vector< unsigned int > getHoleIdxs () const
 
void addSharedIndex (unsigned int measIdx)
 
std::vector< unsigned int > getSharedIdxs () 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, 3)
 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_ {}
 
std::vector< unsigned int > outlier_idxs_ {}
 
std::vector< unsigned int > hole_idxs_ {}
 
std::vector< unsigned int > shared_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 53 of file Track.h.

Constructor & Destructor Documentation

◆ Track()

ldmx::Track::Track ( )
inline

Definition at line 65 of file Track.h.

65{};

◆ ~Track()

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

Destructor.

Currently, the destructor does nothing.

Definition at line 72 of file Track.h.

72{};

Member Function Documentation

◆ addHoleIndex()

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

Definition at line 136 of file Track.h.

136{ hole_idxs_.push_back(measIdx); }

◆ addMeasurementIndex()

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

Definition at line 126 of file Track.h.

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

◆ addOutlierIndex()

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

Definition at line 131 of file Track.h.

131 {
132 outlier_idxs_.push_back(measIdx);
133 }

◆ addSharedIndex()

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

Definition at line 139 of file Track.h.

139{ shared_idxs_.push_back(measIdx); }

◆ addTrackState()

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

Definition at line 203 of file Track.h.

203 {
204 trackStates_.push_back(ts);
205 };

◆ Clear()

void ldmx::Track::Clear ( )
inline

Definition at line 82 of file Track.h.

82{};

◆ getChi2()

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

Definition at line 107 of file Track.h.

107{ return chi2_; }

◆ getD0()

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

Definition at line 196 of file Track.h.

196{ return perigee_pars_[0]; };

◆ getHoleIdxs()

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

Definition at line 137 of file Track.h.

137{ return hole_idxs_; }

◆ getMeasurementsIdxs()

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

Definition at line 129 of file Track.h.

129{ return meas_idxs_; }

◆ getMomentum()

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

Definition at line 191 of file Track.h.

191{ return momentum_; };

◆ getNdf()

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

Definition at line 101 of file Track.h.

101{ return ndf_; };

◆ getNhits()

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

Definition at line 85 of file Track.h.

85{ return n_hits_; }

◆ getNoutliers()

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

Definition at line 98 of file Track.h.

98{ return n_outliers_; }

◆ getNsharedHits()

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

Definition at line 104 of file Track.h.

104{ return n_shared_hits_; }

◆ getOutlierIdxs()

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

Definition at line 134 of file Track.h.

134{ return outlier_idxs_; }

◆ getPdgID()

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

Definition at line 116 of file Track.h.

116{ return pdgID_; };

◆ getPerigeeCov()

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

Definition at line 162 of file Track.h.

162{ return perigee_cov_; }

◆ getPerigeeLocation()

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

Definition at line 186 of file Track.h.

186{ return perigee_; };

◆ getPerigeeParameters()

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

Definition at line 159 of file Track.h.

159{ return perigee_pars_; }

◆ getPerigeeX()

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

Definition at line 187 of file Track.h.

187{ return perigee_[0]; };

◆ getPerigeeY()

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

Definition at line 188 of file Track.h.

188{ return perigee_[1]; };

◆ getPerigeeZ()

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

Definition at line 189 of file Track.h.

189{ return perigee_[2]; };

◆ getPhi()

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

Definition at line 198 of file Track.h.

198{ return perigee_pars_[2]; };

◆ getPosition()

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

Definition at line 192 of file Track.h.

192{ return position_; };

◆ getQoP()

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

Definition at line 200 of file Track.h.

200{ return perigee_pars_[4]; };

◆ getSharedIdxs()

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

Definition at line 140 of file Track.h.

140{ return shared_idxs_; }

◆ getT()

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

Definition at line 201 of file Track.h.

201{ return perigee_pars_[5]; };

◆ getTheta()

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

Definition at line 199 of file Track.h.

199{ return perigee_pars_[3]; };

◆ getTrackID()

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

Definition at line 110 of file Track.h.

110{ return trackID_; };

◆ getTrackState()

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

Definition at line 87 of file Track.h.

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

◆ getTrackStates()

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

Definition at line 207 of file Track.h.

207{ return trackStates_; }

◆ getTruthProb()

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

Definition at line 113 of file Track.h.

113{ return truthProb_; };

◆ getZ0()

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

Definition at line 197 of file Track.h.

197{ 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 119 of file Track.h.

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

◆ setChi2()

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

Definition at line 106 of file Track.h.

106{ chi2_ = chi2; }

◆ setMomentum()

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

Definition at line 174 of file Track.h.

174 {
175 momentum_[0] = px;
176 momentum_[1] = py;
177 momentum_[2] = pz;
178 }

◆ setNdf()

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

Definition at line 100 of file Track.h.

100{ ndf_ = ndf; }

◆ setNhits()

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

Definition at line 84 of file Track.h.

84{ n_hits_ = nhits; }

◆ setNoutliers()

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

Definition at line 97 of file Track.h.

97{ n_outliers_ = nout; }

◆ setNsharedHits()

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

Definition at line 103 of file Track.h.

103{ n_shared_hits_ = nsh; }

◆ setPdgID()

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

Definition at line 115 of file Track.h.

115{ pdgID_ = pdgID; };

◆ setPerigeeCov()

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

Definition at line 161 of file Track.h.

161{ perigee_cov_ = cov; }

◆ setPerigeeLocation() [1/2]

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

Definition at line 168 of file Track.h.

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

◆ setPerigeeLocation() [2/2]

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

Definition at line 164 of file Track.h.

164 {
165 perigee_ = perigee;
166 }

◆ 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 180 of file Track.h.

180 {
181 position_[0] = x;
182 position_[1] = y;
183 position_[2] = z;
184 }

◆ setTrackID()

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

Definition at line 109 of file Track.h.

109{ trackID_ = trackid; };

◆ setTruthProb()

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

Definition at line 112 of file Track.h.

112{ truthProb_ = truthProb; };

Member Data Documentation

◆ chi2_

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

Definition at line 219 of file Track.h.

219{0};

◆ hole_idxs_

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

Definition at line 254 of file Track.h.

254{};

◆ meas_idxs_

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

Definition at line 248 of file Track.h.

248{};

◆ momentum_

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

Definition at line 242 of file Track.h.

242{0., 0., 0.};

◆ n_hits_

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

Definition at line 210 of file Track.h.

210{0};

◆ n_holes_

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

Definition at line 214 of file Track.h.

214{0};

◆ n_outliers_

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

Definition at line 211 of file Track.h.

211{0};

◆ n_shared_hits_

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

Definition at line 213 of file Track.h.

213{0};

◆ ndf_

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

Definition at line 212 of file Track.h.

212{0};

◆ outlier_idxs_

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

Definition at line 251 of file Track.h.

251{};

◆ pdgID_

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

Definition at line 266 of file Track.h.

266{0};

◆ perigee_

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

Definition at line 239 of file Track.h.

239{0., 0., 0.};

◆ perigee_cov_

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

Definition at line 236 of file Track.h.

◆ perigee_pars_

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

Definition at line 227 of file Track.h.

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

◆ position_

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

Definition at line 245 of file Track.h.

245{0., 0., 0.};

◆ shared_idxs_

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

Definition at line 257 of file Track.h.

257{};

◆ trackID_

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

Definition at line 260 of file Track.h.

260{-1};

◆ trackStates_

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

Definition at line 269 of file Track.h.

◆ truthProb_

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

Definition at line 263 of file Track.h.

263{0.};

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