Analysis Software
Documentation for sPHENIX simulation 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 
4 #include "GPUTPCTrackParam.h"
7 #include <trackbase/TrkrDefs.h>
10 #include <phfield/PHField.h>
11 #include <phfield/PHFieldUtility.h>
12 #include <phfield/PHFieldConfigv1.h>
13 
15 
16 #include <Eigen/Core>
17 #include <Eigen/Dense>
18 
19 #include <vector>
20 #include <string>
21 #include <utility>
22 
23 using PositionMap = std::map<TrkrDefs::cluskey, Acts::Vector3>;
24 using TrackSeedAliceSeedMap = std::pair<std::vector<TrackSeed_v1>, std::vector<Eigen::Matrix<double,6,6>>>;
25 
26 class ALICEKF
27 {
28  public:
30  TrkrClusterContainer* cmap,
31  PHField *B,
32  double fieldDir,
33  unsigned int min_clusters,
34  double max_sin_phi,
35  int verbosity)
36  {
37  if(!topNode) std::cout << "no topnode, too bad..." << std::endl;
38  _B = B;
39  // _B = PHFieldUtility::GetFieldMapNode(nullptr,topNode);
40  _cluster_map = cmap;
41  _fieldDir = fieldDir;
42  _max_sin_phi = max_sin_phi;
43  _v = verbosity;
44  _min_clusters_per_track = min_clusters;
46  }
47 
48  ~ALICEKF() {delete _ClusErrPara;}
49 
50  explicit ALICEKF(const ALICEKF&) = delete;
51  ALICEKF& operator=(const ALICEKF&) = delete;
52 
53  TrackSeedAliceSeedMap ALICEKalmanFilter(const std::vector<std::vector<TrkrDefs::cluskey>>& chains, bool use_nhits_limit, const PositionMap& globalPositions, std::vector<float>& trackChi2) const;
54  bool covIsPosDef(Eigen::Matrix<double,6,6>& cov) const;
55  void repairCovariance(Eigen::Matrix<double,6,6>& cov) const;
56  bool checknan(double val, const std::string &msg, int num) const;
57  double get_Bz(double x, double y, double z) const;
58  void useConstBField(bool opt) {_use_const_field = opt;}
59  void setConstBField(float b) {_const_field = b; }
61  void setFixedClusterError(int i,double val) {_fixed_clus_error.at(i)=val;}
62  double getClusterError(TrkrCluster* c, TrkrDefs::cluskey key, Acts::Vector3 global, int i, int j) const;
63  std::vector<double> GetCircleClusterResiduals(const std::vector<std::pair<double,double>>& pts, double R, double X0, double Y0) const;
64  std::vector<double> GetLineClusterResiduals(const std::vector<std::pair<double,double>>& pts, double A, double B) const;
65  double get_Bzconst() const { return _Bzconst; }
66 
68  private:
69  PHField* _B = nullptr;
72  int Verbosity() const
73  { return _v; }
74 
75  int _v = 0;
76  double _Bzconst = 10*0.000299792458f;
77  double _fieldDir = -1;
78  double _max_sin_phi = 1.;
79  bool _use_const_field = false;
80  float _const_field = 1.4;
81  bool _use_fixed_clus_error = true;
82  std::array<double,3> _fixed_clus_error = {.1,.1,.1};
83 
84 };
85 
86 #endif