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 PHGENFIT_TRACK_H
8 #define PHGENFIT_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 #include <iostream>
20 
21 //GenFit
22 
23 namespace genfit
24 {
25 class AbsTrackRep;
26 class MeasuredStateOnPlane;
27 class Track;
28 } // namespace genfit
29 
30 namespace PHGenFit
31 {
32 class Measurement;
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 PHGenFit::Track& t);
42 
44  ~Track();
45 
47  int addMeasurement(PHGenFit::Measurement* measurement);
48  int addMeasurements(std::vector<PHGenFit::Measurement*>& measurements);
49 
51 
54  const std::vector<PHGenFit::Measurement*>& measurements,
55  std::map<double, std::shared_ptr<PHGenFit::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;
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  // old tracking
94  const std::vector<unsigned int>& get_cluster_IDs() const
95  {
96  return _clusterIDs;
97  }
98  void set_cluster_IDs(const std::vector<unsigned int>& clusterIDs)
99  {
100  _clusterIDs = clusterIDs;
101  }
102 
103  // new tracking
104  const std::vector<TrkrDefs::cluskey>& get_cluster_keys() const
105  {
106  return _clusterkeys;
107  }
108  void set_cluster_keys(const std::vector<TrkrDefs::cluskey>& clusterkeys)
109  {
110  _clusterkeys = clusterkeys;
111  }
112 
113  void set_vertex_id(const unsigned int vert_id)
114  {
115  _vertex_id = vert_id;
116  }
117 
118  unsigned int get_vertex_id()
119  {
120  //std::cout << " Track: returning vertex_id = " << _vertex_id << std::endl;
121  return _vertex_id;
122  }
123 
124 
125  int get_verbosity() const
126  {
127  return verbosity;
128  }
129 
131  {
132  this->verbosity = verbosity;
133  }
134 
135  //SMART(genfit::Track) getGenFitTrack() {return _track;}
136 
137  private:
138  Track operator=(Track &trk) = delete;
139 
141 
143  //std::vector<PHGenFit::Measurement*> _measurements;
144  std::vector<unsigned int> _clusterIDs;
145  std::vector<TrkrDefs::cluskey> _clusterkeys;
146  unsigned int _vertex_id;
147 
148  //SMART(genfit::Track) _track;
149 };
150 } // namespace PHGenFit
151 
152 #endif