EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHActsInitialVertexFinder.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHActsInitialVertexFinder.h
1 #ifndef TRACKRECO_PHACTSINITIALVERTEXFINDER_H
2 #define TRACKRECO_PHACTSINITIALVERTEXFINDER_H
3 
4 #include "PHInitVertexing.h"
6 
7 #include <trackbase/TrkrDefs.h>
8 
11 
14 
15 #include <random>
16 
17 class PHCompositeNode;
18 class SvtxTrack;
19 class SvtxTrackMap;
20 class SvtxVertexMap;
21 class SvtxVertex;
22 
23 using VertexVector = std::vector<Acts::Vertex<Acts::BoundTrackParameters>>;
24 
25 using TrackParamVec = std::vector<const Acts::BoundTrackParameters*>;
26 
27 using InitKeyMap = std::map<const Acts::BoundTrackParameters*, const unsigned int>;
28 
29 using CentroidMap = std::map<unsigned int, std::vector<SvtxTrack*>>;
30 
32 {
33  public:
34  PHActsInitialVertexFinder(const std::string& name="PHActsInitialVertexFinder");
36 
37  void setMaxVertices(const int maxVertices)
38  { m_maxVertices = maxVertices;}
39 
40  void setSvtxVertexMapName(const std::string& name)
42 
43  void setSvtxTrackMapName(const std::string& name)
45 
46  void disablePtWeights(const bool weight)
47  { m_disableWeights = weight; }
48 
49  void resetTrackCovariance(const bool initial)
50  { m_resetTrackCovariance = initial; }
51 
52  void setCentroids(const int centroids)
53  { m_nCentroids = centroids;}
54 
55  void setIterations(const int iterations)
56  {m_nIterations = iterations;}
57 
58  void removeSiliconSeeds(const bool removeSeeds)
59  {m_removeSeeds = removeSeeds;}
60  void magFieldName(const std::string& magfield)
61  {m_magField = magfield;}
62 
63  void setPCACut(const float pcaCut)
64  {m_pcaCut = pcaCut;}
65 
66  protected:
67  int Setup(PHCompositeNode *topNode) override;
68  int Process(PHCompositeNode *topNode) override;
69  int ResetEvent(PHCompositeNode *topNode) override;
70  int End(PHCompositeNode *topNode) override;
71 
72  private:
73  int getNodes(PHCompositeNode *topNode);
74  int createNodes(PHCompositeNode *topNode);
75 
78 
81 
83  void fillVertexMap(VertexVector& vertices, InitKeyMap& keyMap);
84 
87  void createDummyVertex(const float x, const float y, const float z);
88 
91 
94  std::vector<SvtxTrack*> sortTracks();
95 
97  CentroidMap createCentroidMap(std::vector<Acts::Vector3D>& centroids);
98 
99  std::vector<SvtxTrack*> getIVFTracks(CentroidMap& clusters,
100  std::vector<Acts::Vector3D>& centroids);
101 
103  int m_nCentroids = 5;
105  int m_nIterations = 15;
107  int m_maxVertices = 5;
109  float m_pcaCut = 0.03; // cm
111  int m_event = 0;
113  unsigned int m_totVertexFits = 0;
114  unsigned int m_successFits = 0;
115 
116  unsigned int m_seed = 0;
118 
119  std::string m_svtxTrackMapName = "SvtxSiliconTrackMap";
120  std::string m_svtxVertexMapName = "SvtxVertexMap";
121  std::string m_magField = "";
123  bool m_disableWeights = true;
124  bool m_removeSeeds = false;
125 
129 
130 };
131 
132 
133 #endif