EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ALICEKF.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ALICEKF.h
1 #ifndef ALICEKF_H
2 #define ALICEKF_H
3 
5 #include <trackbase/TrkrDefs.h>
8 #include <phfield/PHField.h>
9 #include <phfield/PHFieldUtility.h>
10 
12 
13 #include <Eigen/Core>
14 #include <Eigen/Dense>
15 
16 #include <vector>
17 #include <string>
18 #include <utility>
19 
20 using PositionMap = std::map<TrkrDefs::cluskey, Acts::Vector3F>;
21 
22 class ALICEKF
23 {
24  public:
26  TrkrClusterContainer* cmap,
27  double fieldDir,
28  unsigned int min_clusters,
29  double max_sin_phi,
30  int verbosity)
31  {
32  _B = PHFieldUtility::GetFieldMapNode(nullptr,topNode);
33  _cluster_map = cmap;
34  _fieldDir = fieldDir;
35  _max_sin_phi = max_sin_phi;
36  _v = verbosity;
37  _min_clusters_per_track = min_clusters;
38  }
39  std::vector<SvtxTrack_v2> ALICEKalmanFilter(const std::vector<std::vector<TrkrDefs::cluskey>>& chains, bool use_nhits_limit, const PositionMap& globalPositions) const;
40  Eigen::Matrix<double,6,6> getEigenCov(const SvtxTrack_v2 &track) const;
41  bool covIsPosDef(const SvtxTrack_v2 &track) const;
42  void repairCovariance(SvtxTrack_v2 &track) const;
43  bool checknan(double val, const std::string &msg, int num) const;
44  double get_Bz(double x, double y, double z) const;
45  void CircleFitByTaubin(const std::vector<std::pair<double,double>>& pts, double &R, double &X0, double &Y0) const;
46  void useConstBField(bool opt) {_use_const_field = opt;}
48  void setFixedClusterError(int i,double val) {_fixed_clus_error.at(i)=val;}
49  double getClusterError(TrkrCluster* c, Acts::Vector3F global, int i, int j) const;
50  void line_fit(const std::vector<std::pair<double,double>>& pts, double& a, double& b) const;
51  std::vector<double> GetCircleClusterResiduals(const std::vector<std::pair<double,double>>& pts, double R, double X0, double Y0) const;
52  std::vector<double> GetLineClusterResiduals(const std::vector<std::pair<double,double>>& pts, double A, double B) const;
53  private:
54  PHField* _B = nullptr;
57  int Verbosity() const
58  { return _v; }
59 
60  int _v = 0;
61  double _Bzconst = 10*0.000299792458f;
62  double _fieldDir = -1;
63  double _max_sin_phi = 1.;
64  bool _use_const_field = false;
65  bool _use_fixed_clus_error = true;
66  std::array<double,3> _fixed_clus_error = {.1,.1,.1};
67 };
68 
69 #endif