ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FourHitSeedFinder.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FourHitSeedFinder.h
1 #ifndef __FOURHITSEEDFINDER__
2 #define __FOURHITSEEDFINDER__
3 
4 #include "HelixHough.h"
5 #include <vector>
6 #include <set>
7 
8 
10 {
11  public:
12  FourHitSeedFinder(std::vector<float>& detrad, unsigned int n_phi, unsigned int n_d, unsigned int n_k, unsigned int n_dzdl, unsigned int n_z0, HelixResolution& min_resolution, HelixResolution& max_resolution, HelixRange& range);
13  virtual ~FourHitSeedFinder(){}
14 
15  void finalize(std::vector<SimpleTrack3D>& input, std::vector<SimpleTrack3D>& output);
16  void findTracks(std::vector<SimpleHit3D>& hits, std::vector<SimpleTrack3D>& tracks, const HelixRange& range);
17  void initEvent(std::vector<SimpleHit3D>& hits, unsigned int min_hits)
18  {
19  combos.clear();
20  combos_3_pass.clear();
21  combos_3_fail.clear();
22  }
23 
24  void findTracks_3_4(std::vector<SimpleHit3D>& hits, std::vector<SimpleTrack3D>& tracks, const HelixRange& range);
25  void findTracks_6(std::vector<SimpleHit3D>& hits, std::vector<SimpleTrack3D>& tracks, const HelixRange& range);
26 
27  void setUsingVertex(bool usevtx){using_vertex = usevtx;}
28 
29  void setLayerResolution(std::vector<float>& lxy, std::vector<float>& lz)
30  {
31  layer_xy_resolution = lxy;
32  layer_z_resolution = lz;
33  }
34 
35  // for each detector layer, the material budget in radiation lengths
36  void setLayerMaterial(std::vector<float>& rl)
37  {
38  detector_material = rl;
39  detector_scatter.resize(rl.size(), 0.);
40  for(unsigned int l=0;l<rl.size();++l)
41  {
42  detector_scatter[l] = 1.41421356237309515*0.0136*sqrt(rl[l]);
43  }
44  }
45 
46  void setVertexResolution(float vxy, float vz)
47  {
48  vertex_sigma_xy = vxy;
49  vertex_sigma_z = vz;
50  }
51 
52  // magnetic field in Tesla
53  void setMagField(float B){Bfield = B;Bfield_inv = 1./B;}
54 
55  double fitTrack(SimpleTrack3D& track, std::vector<double>& chi2_hit);
56  double fitTrackLine(SimpleTrack3D& track, std::vector<double>& chi2_hit);
57 
58  void setChi2Cut(double c){chi2_cut=c;}
59 
60  bool breakRecursion(const std::vector<SimpleHit3D>& hits, const HelixRange& range);
61 
62  float phiError(SimpleHit3D& hit, float min_k, float max_k, float min_dzdl, float max_dzdl);
63  float dzdlError(SimpleHit3D& hit, float min_k, float max_k, float min_dzdl, float max_dzdl);
64 
65  private:
67  float Bfield;
68  float Bfield_inv;
69  std::vector<float> detector_radii;
70  std::vector<float> detector_radii_inv;
71  std::vector<float> detector_scatter;
72  std::vector<float> detector_material;
73  std::vector<float> layer_xy_resolution;
74  std::vector<float> layer_z_resolution;
76  double chi2_cut;
77  std::set<std::vector<unsigned int> > combos;
78  std::set<std::vector<unsigned int> > combos_3_pass;
79  std::set<std::vector<unsigned int> > combos_3_fail;
80 };
81 
82 
83 #endif