Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackFitUtils.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrackFitUtils.h
1 #ifndef TRACKBASE_TRACKFITUTILS_H
2 #define TRACKBASE_TRACKFITUTILS_H
3 
4 #include "TrkrDefs.h"
5 
7 
8 #include <tuple>
9 #include <utility>
10 #include <vector>
11 
12 class ActsGeometry;
14 
16 {
17  public:
18  using position_t = std::pair<double, double>;
19  using position_vector_t = std::vector<position_t>;
20 
22  using circle_fit_output_t = std::tuple<double, double, double>;
23 
37 
39  static circle_fit_output_t circle_fit_by_taubin(const std::vector<Acts::Vector3>&);
40 
42  using line_fit_output_t = std::tuple<double, double>;
43 
45 
50 
52  static line_fit_output_t line_fit(const std::vector<Acts::Vector3>&);
53 
55  using circle_circle_intersection_output_t = std::tuple<double, double, double, double>;
56 
70  static circle_circle_intersection_output_t circle_circle_intersection(double r1, double r2, double x2, double y2);
71 
72  static unsigned int addClusters(std::vector<float>& fitpars,
73  double dca_cut,
74  ActsGeometry* _tGeometry,
75  TrkrClusterContainer* _cluster_map,
76  std::vector<Acts::Vector3>& global_vec,
77  std::vector<TrkrDefs::cluskey>& cluskey_vec,
78  unsigned int startLayer,
79  unsigned int endLayer);
80 
81  static unsigned int addClustersOnLine(TrackFitUtils::line_fit_output_t& fitpars,
82  const bool& isXY,
83  const double& dca_cut,
85  TrkrClusterContainer* clusterContainer,
86  std::vector<Acts::Vector3>& global_vec,
87  std::vector<TrkrDefs::cluskey>& cluskey_vec,
88  const unsigned int& startLayer,
89  const unsigned int& endLayer);
90 
91  static std::pair<Acts::Vector3, Acts::Vector3> get_helix_tangent(const std::vector<float>& fitpars, Acts::Vector3& global);
92 
93  static Acts::Vector3 get_helix_pca(std::vector<float>& fitpars, Acts::Vector3 global);
94 
95  static Acts::Vector2 get_circle_point_pca(float radius, float x0, float y0, Acts::Vector3 global);
96 
97  static std::vector<float> fitClusters(std::vector<Acts::Vector3>& global_vec,
98  std::vector<TrkrDefs::cluskey> cluskey_vec);
99  static void getTrackletClusters(ActsGeometry* _tGeometry,
100  TrkrClusterContainer* _cluster_map,
101  std::vector<Acts::Vector3>& global_vec,
102  std::vector<TrkrDefs::cluskey>& cluskey_vec);
103 
105 
106  static std::vector<double> getLineClusterResiduals(position_vector_t& rz_pts, float slope, float intercept);
107  static std::vector<double> getCircleClusterResiduals(position_vector_t& xy_pts, float R, float X0, float Y0);
108 };
109 
110 #endif