65 std::vector<double> pos_{-666., -666.,
67 std::vector<double> mom_{-666., -666.,
77 std::vector<double> pos_mom_cov_;
78 TrackStateType ts_type_;
100 void setNhits(
int nhits) { n_hits_ = nhits; }
101 int getNhits()
const {
return n_hits_; }
103 std::optional<TrackState> getTrackState(TrackStateType tstype)
const {
104 for (
auto ts : track_states_)
105 if (ts.ts_type_ == tstype)
return std::optional<TrackState>(ts);
113 void setNoutliers(
int nout) { n_outliers_ = nout; }
114 int getNoutliers()
const {
return n_outliers_; }
116 void setNdf(
int ndf) { ndf_ = ndf; }
117 int getNdf()
const {
return ndf_; };
119 void setNsharedHits(
int nsh) { n_shared_hits_ = nsh; }
120 int getNsharedHits()
const {
return n_shared_hits_; }
122 void setChi2(
double chi2) { chi2_ = chi2; }
123 double getChi2()
const {
return chi2_; }
125 void setTrackID(
int trackid) { track_id_ = trackid; };
126 int getTrackID()
const {
return track_id_; };
128 void setTruthProb(
double truthProb) { truth_prob_ = truthProb; };
129 double getTruthProb()
const {
return truth_prob_; };
131 void setPdgID(
int pdgID) { pdg_id_ = pdgID; };
132 int getPdgID()
const {
return pdg_id_; };
139 void addDedxMeasurement(
float path_length) {
140 dedx_measurements_.push_back(path_length);
142 std::vector<float> getDedxMeasurements()
const {
return dedx_measurements_; }
144 void addMeasurementIndex(
unsigned int measIdx) {
145 meas_idxs_.push_back(measIdx);
147 std::vector<unsigned int> getMeasurementsIdxs()
const {
return meas_idxs_; }
149 void addOutlierIndex(
unsigned int measIdx) {
150 outlier_idxs_.push_back(measIdx);
152 std::vector<unsigned int> getOutlierIdxs()
const {
return outlier_idxs_; }
154 void addHoleIndex(
unsigned int measIdx) { hole_idxs_.push_back(measIdx); }
155 std::vector<unsigned int> getHoleIdxs()
const {
return hole_idxs_; }
157 void addSharedIndex(
unsigned int measIdx) { shared_idxs_.push_back(measIdx); }
158 std::vector<unsigned int> getSharedIdxs()
const {
return shared_idxs_; }
160 void setCharge(
int q) { charge_ = q; }
161 double getCharge()
const {
return charge_; }
163 void setTime(
double time) { time_ = time; }
164 double getTime()
const {
return time_; }
167 void setPerigeeParameters(
const std::vector<double>& par) {
170 std::vector<double> getPerigeeParameters()
const {
return perigee_pars_; }
172 void setPerigeeCov(
const std::vector<double>& cov) { perigee_cov_ = cov; }
173 std::vector<double> getPerigeeCov()
const {
return perigee_cov_; }
175 void setPerigeeLocation(
const std::vector<double>& perigee) {
178 void setPerigeeLocation(
const double& x,
const double& y,
const double& z) {
183 std::vector<double> getPerigeeLocation()
const {
return perigee_; }
184 double getPerigeeX()
const {
return perigee_[0]; }
185 double getPerigeeY()
const {
return perigee_[1]; }
186 double getPerigeeZ()
const {
return perigee_[2]; }
188 double getD0()
const {
return perigee_pars_[0]; }
189 double getZ0()
const {
return perigee_pars_[1]; }
190 double getPhi()
const {
return perigee_pars_[2]; }
191 double getTheta()
const {
return perigee_pars_[3]; }
192 double getQoP()
const {
return perigee_pars_[4]; }
193 double getT()
const {
return perigee_pars_[5]; }
196 track_states_.push_back(ts);
199 std::vector<TrackState> getTrackStates()
const {
return track_states_; }
204 for (
const auto& ts : track_states_)
205 if (ts.ts_type_ == AtTarget)
return ts.mom_;
212 for (
const auto& ts : track_states_)
213 if (ts.ts_type_ == AtTarget)
return ts.pos_;
221 for (
const auto& ts : track_states_)
222 if (ts.ts_type_ == tstype)
return ts.mom_;
230 for (
const auto& ts : track_states_)
231 if (ts.ts_type_ == tstype)
return ts.pos_;
240 for (
const auto& ts : track_states_)
241 if (ts.ts_type_ == tstype)
return ts.pos_mom_cov_;
249 int n_shared_hits_{0};
262 std::vector<double> perigee_pars_{0., 0., 0., 0., 0., 0.};
263 std::vector<double> perigee_cov_;
264 std::vector<double> perigee_{0., 0.,
268 std::vector<float> dedx_measurements_{};
271 std::vector<unsigned int> meas_idxs_{};
274 std::vector<unsigned int> outlier_idxs_{};
277 std::vector<unsigned int> hole_idxs_{};
280 std::vector<unsigned int> shared_idxs_{};
286 double truth_prob_{0.};
295 double time_{-666.0};
298 std::vector<TrackState> track_states_;
std::vector< double > getMomentum(TrackStateType tstype) const
Returns the momentum (px, py, pz) in MeV in the LDMX global frame for the requested TrackState type.
std::vector< double > getCovariance(TrackStateType tstype) const
Returns the 21-element upper-triangular covariance vector over (x, y, z, px, py, pz) in LDMX global c...
std::vector< double > getPosition(TrackStateType tstype) const
Returns the position (x, y, z) in mm in the LDMX global frame for the requested TrackState type.