ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Track.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Track.h
1 
7 #ifndef PHGENFIT2_TRACK_H
8 #define PHGENFIT2_TRACK_H
9 
10 #include <trackbase/TrkrDefs.h>
11 
12 #include <TMatrixDSymfwd.h>
13 #include <TVector3.h>
14 
15 //STL
16 #include <map>
17 #include <memory>
18 #include <vector>
19 
20 namespace PHGenFit
21 {
22  class Measurement;
23 }
24 
25 namespace genfit
26 {
27  class AbsTrackRep;
28  class MeasuredStateOnPlane;
29  class Track;
30 } // namespace genfit
31 
32 namespace PHGenFit2
33 {
34  class Track
35  {
36  public:
38  Track(genfit::AbsTrackRep* rep, TVector3 seed_pos, TVector3 seed_mom, TMatrixDSym seed_cov, const int v = 0);
39 
41  Track(const PHGenFit2::Track& t);
42 
44  ~Track();
45 
47  int addMeasurement(PHGenFit::Measurement* measurement, int id = -1);
48  int addMeasurements(std::vector<PHGenFit::Measurement*>& measurements, int id = -1);
49 
51 
54  const std::vector<PHGenFit::Measurement*>& measurements,
55  std::map<double, std::shared_ptr<PHGenFit2::Track> >& incr_chi2s_new_tracks,
56  const int base_tp_idx = -1,
57  const int direction = 1,
58  const float blowup_factor = 1.,
59  const bool use_fitted_state = false) const;
60 
64  double extrapolateToPlane(genfit::MeasuredStateOnPlane& state, TVector3 O, TVector3 n, const int tr_point_id = 0) const;
66  double extrapolateToLine(genfit::MeasuredStateOnPlane& state, TVector3 line_point, TVector3 line_direction, const int tr_point_id = 0) const;
68  double extrapolateToCylinder(genfit::MeasuredStateOnPlane& state, double radius, TVector3 line_point, TVector3 line_direction, const int tr_point_id = 0, const int direction = 1) const;
70  double extrapolateToPoint(genfit::MeasuredStateOnPlane& state, TVector3 P, const int tr_point_id = 0) const;
71 
73  genfit::MeasuredStateOnPlane* extrapolateToPlane(TVector3 O, TVector3 n, const int tr_point_id = 0) const;
75  genfit::MeasuredStateOnPlane* extrapolateToLine(TVector3 line_point, TVector3 line_direction, const int tr_point_id = 0) const;
77  genfit::MeasuredStateOnPlane* extrapolateToCylinder(double radius, TVector3 line_point, TVector3 line_direction, const int tr_point_id = 0, const int direction = 1) const;
79  genfit::MeasuredStateOnPlane* extrapolateToPoint(TVector3 P, const int tr_point_id = 0) const;
81  genfit::Track* getGenFitTrack() { return _track; }
82 
83  genfit::Track* getGenFitTrack() const { return _track; }
84 
85  double get_chi2() const;
86 
87  double get_ndf() const;
88 
89  double get_charge() const;
90 
91  TVector3 get_mom() const;
92 
93  bool get_track_info(TVector3& pos, TVector3& mom, double& charge, int& nhits, double& length);
94 
95  // old tracking
96  const std::vector<unsigned int>& get_cluster_IDs() const
97  {
98  return _clusterIDs;
99  }
100  void set_cluster_IDs(const std::vector<unsigned int>& clusterIDs)
101  {
102  _clusterIDs = clusterIDs;
103  }
104 
105  // new tracking
106  const std::vector<TrkrDefs::cluskey>& get_cluster_keys() const
107  {
108  return _clusterkeys;
109  }
110  void set_cluster_keys(const std::vector<TrkrDefs::cluskey>& clusterkeys)
111  {
112  _clusterkeys = clusterkeys;
113  }
114 
115  void set_vertex_id(const unsigned int vert_id)
116  {
117  _vertex_id = vert_id;
118  }
119 
120  unsigned int get_vertex_id() const
121  {
122  //std::cout << " Track: returning vertex_id = " << _vertex_id << std::endl;
123  return _vertex_id;
124  }
125 
126  int get_verbosity() const
127  {
128  return verbosity;
129  }
130 
132  {
133  this->verbosity = verbosity;
134  }
135 
136  private:
137  Track operator=(Track& trk) = delete;
138 
140 
141  genfit::Track* _track;
142 
143  std::vector<unsigned int> _clusterIDs;
144  std::vector<TrkrDefs::cluskey> _clusterkeys;
145  unsigned int _vertex_id;
146 
147  };
148 } // namespace PHGenFit2
149 
150 #endif