ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHRTreeSeeding.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHRTreeSeeding.h
1 #ifndef TRACKRECO_PHRTREESEEDING_H
2 #define TRACKRECO_PHRTREESEEDING_H
3 
11 //begin
12 
13 #include "PHTrackSeeding.h" // for PHTrackSeeding
14 
15 #include <trackbase/TrkrDefs.h> // for cluskey
16 
17 #include <boost/geometry/geometries/box.hpp> // for box
18 #include <boost/geometry/geometries/point.hpp> // for point
19 #include <boost/geometry/index/rtree.hpp> // for rtree
20 
21 #include <cstdint> // for uint64_t
22 #include <map> // for map
23 #include <string> // for string
24 #include <utility> // for pair
25 #include <vector> // for vector
26 
27 class PHCompositeNode; // lines 196-196
28 class SvtxClusterMap; // lines 202-202
29 class SvtxHitMap; // lines 211-211
30 class SvtxTrackMap; // lines 204-204
31 class SvtxVertexMap; // lines 206-206
32 
33 #define LogDebug(exp) std::cout << "DEBUG: " << __FILE__ << ": " << __LINE__ << ": " << exp
34 #define LogError(exp) std::cout << "ERROR: " << __FILE__ << ": " << __LINE__ << ": " << exp
35 #define LogWarning(exp) std::cout << "WARNING: " << __FILE__ << ": " << __LINE__ << ": " << exp
36 
37 //#define _DEBUG_
38 
39 //#define _USE_ALAN_FULL_VERTEXING_
40 #define _USE_ALAN_TRACK_REFITTING_
41 
42 //#define _MEARGE_SEED_CLUSTER_
43 //#define _USE_ZERO_SEED_
44 
45 //#define _USE_CONSTANT_SEARCH_WIN_
46 
47 //#define _DO_FULL_FITTING_
48 
49 //end
50 
51 namespace bg = boost::geometry;
52 namespace bgi = boost::geometry::index;
53 typedef bg::model::point<float, 3, bg::cs::cartesian> point;
54 typedef bg::model::box<point> box;
55 typedef std::pair<point, TrkrDefs::cluskey> pointKey;
56 
57 typedef uint64_t cluskey;
58 
60 {
61  public:
63  const std::string &name = "PHRTreeSeeding",
64  unsigned int nlayers_maps = 3,
65  unsigned int nlayers_intt = 4,
66  unsigned int nlayers_tpc = 48,
67  unsigned int start_layer = 53);
68 
69  double chisq(const double *xx);
70  //vector<TrkrCluster*> clusterpoints;
71  void set_phi_scale(float scale) { _phi_scale = scale; }
72  void set_z_scale(float scale) { _z_scale = scale; }
73 
74  ~PHRTreeSeeding() override
75  {
76  }
77 
78  protected:
79  int Setup(PHCompositeNode *topNode) override;
80  int GetNodes(PHCompositeNode *topNode);
81  int Process();
82  int Process(PHCompositeNode *topNode) override;
83  int InitializeGeometry(PHCompositeNode *topNode);
84 
85  int End() override;
86 
87  private:
89 
90  // node pointers
91  SvtxClusterMap *_g4clusters;
95  //nodes to get norm vector
96  SvtxHitMap *_svtxhitsmap;
99 
100  //seed searching parameters
102 
103  std::vector<float> _radii_all;
104 
105  double phiadd(double phi1, double phi2);
106  double phidiff(double phi1, double phi2);
107  double costfunction(const double *xx);
108  void FillTree();
109 
110  double pointKeyToTuple(pointKey *pK);
111  void QueryTree(const bgi::rtree<pointKey, bgi::quadratic<16>> &rtree, double phimin, double etamin, double lmin, double phimax, double etamax, double lmax, std::vector<pointKey> &returned_values);
112 
113  private:
114  std::map<int, unsigned int> _layer_ilayer_map_all;
115  std::map<int, unsigned int> _layer_ilayer_map;
116 
117  //int _nlayers_all;
118  //unsigned int _nlayers_seeding;
119  //std::vector<int> _seeding_layer;
120 
121  unsigned int _nlayers_maps;
122  unsigned int _nlayers_intt;
123  unsigned int _nlayers_tpc;
124  unsigned int _start_layer;
125  float _phi_scale;
126  float _z_scale;
127  //std::vector<float> _radii_all;
128 
129  bgi::rtree<pointKey, bgi::quadratic<16>> _rtree;
130 };
131 
132 #endif