File indexing completed on 2025-08-06 08:17:59
0001
0002
0003
0004
0005
0006
0007 #ifndef PHGENFIT_TRACK_H
0008 #define PHGENFIT_TRACK_H
0009
0010 #include <trackbase/TrkrDefs.h>
0011
0012 #include <TMatrixDSymfwd.h>
0013 #include <TVector3.h>
0014
0015
0016 #include <iostream>
0017 #include <limits>
0018 #include <map>
0019 #include <memory>
0020 #include <vector>
0021
0022
0023
0024 namespace genfit
0025 {
0026 class AbsTrackRep;
0027 class MeasuredStateOnPlane;
0028 class Track;
0029 }
0030
0031 namespace PHGenFit
0032 {
0033 class Measurement;
0034
0035 class Track
0036 {
0037 public:
0038
0039 Track(genfit::AbsTrackRep* rep, const TVector3& seed_pos, const TVector3& seed_mom, const TMatrixDSym& seed_cov, const int v = 0);
0040
0041
0042 Track(const PHGenFit::Track& t);
0043
0044
0045 ~Track();
0046
0047
0048 int addMeasurement(PHGenFit::Measurement* measurement);
0049 int addMeasurements(std::vector<PHGenFit::Measurement*>& measurements);
0050
0051 int deleteLastMeasurement();
0052
0053
0054 int updateOneMeasurementKalman(
0055 const std::vector<PHGenFit::Measurement*>& measurements,
0056 std::map<double, std::shared_ptr<PHGenFit::Track> >& incr_chi2s_new_tracks,
0057 const int base_tp_idx = -1,
0058 const int direction = 1,
0059 const float blowup_factor = 1.,
0060 const bool use_fitted_state = false) const;
0061
0062
0063
0064
0065 double extrapolateToPlane(genfit::MeasuredStateOnPlane& state, const TVector3& O, const TVector3& n, const int tr_point_id = 0) const;
0066
0067 double extrapolateToLine(genfit::MeasuredStateOnPlane& state, const TVector3& line_point, const TVector3& line_direction, const int tr_point_id = 0) const;
0068
0069 double extrapolateToCylinder(genfit::MeasuredStateOnPlane& state, double radius, const TVector3& line_point, const TVector3& line_direction, const int tr_point_id = 0, const int direction = 1) const;
0070
0071 double extrapolateToPoint(genfit::MeasuredStateOnPlane& state, const TVector3& P, const int tr_point_id = 0) const;
0072
0073
0074 genfit::MeasuredStateOnPlane* extrapolateToPlane(const TVector3& O, const TVector3& n, const int tr_point_id = 0) const;
0075
0076 genfit::MeasuredStateOnPlane* extrapolateToLine(const TVector3& line_point, const TVector3& line_direction, const int tr_point_id = 0) const;
0077
0078 genfit::MeasuredStateOnPlane* extrapolateToCylinder(double radius, const TVector3& line_point, const TVector3& line_direction, const int tr_point_id = 0, const int direction = 1) const;
0079
0080 genfit::MeasuredStateOnPlane* extrapolateToPoint(const TVector3& P, const int tr_point_id = 0) const;
0081
0082 genfit::Track* getGenFitTrack() { return _track; }
0083
0084 genfit::Track* getGenFitTrack() const { return _track; }
0085
0086 double get_chi2() const;
0087
0088 double get_ndf() const;
0089
0090 double get_charge() const;
0091
0092 TVector3 get_mom() const;
0093
0094
0095 const std::vector<unsigned int>& get_cluster_IDs() const
0096 {
0097 return _clusterIDs;
0098 }
0099 void set_cluster_IDs(const std::vector<unsigned int>& clusterIDs)
0100 {
0101 _clusterIDs = clusterIDs;
0102 }
0103
0104
0105 const std::vector<TrkrDefs::cluskey>& get_cluster_keys() const
0106 {
0107 return _clusterkeys;
0108 }
0109 void set_cluster_keys(const std::vector<TrkrDefs::cluskey>& clusterkeys)
0110 {
0111 _clusterkeys = clusterkeys;
0112 }
0113
0114 void set_vertex_id(const unsigned int vert_id)
0115 {
0116 _vertex_id = vert_id;
0117 }
0118
0119 unsigned int get_vertex_id() const
0120 {
0121
0122 return _vertex_id;
0123 }
0124
0125 int get_verbosity() const
0126 {
0127 return verbosity;
0128 }
0129
0130 void set_verbosity(int v)
0131 {
0132 this->verbosity = v;
0133 }
0134
0135
0136
0137 private:
0138 Track operator=(Track& trk) = delete;
0139
0140 int verbosity;
0141
0142 genfit::Track* _track;
0143
0144 std::vector<unsigned int> _clusterIDs;
0145 std::vector<TrkrDefs::cluskey> _clusterkeys;
0146 unsigned int _vertex_id{std::numeric_limits<unsigned int>::max()};
0147
0148
0149 };
0150 }
0151
0152 #endif