Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHActsSiliconSeeding.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHActsSiliconSeeding.h
1 #ifndef TRACKRECO_PHACTSSILICONSEEDING_H
2 #define TRACKRECO_PHACTSSILICONSEEDING_H
3 
4 #include <fun4all/SubsysReco.h>
5 #include <trackbase/TrkrDefs.h>
8 
13 
16 
17 #include <trackbase/SpacePoint.h>
18 
19 #include <string>
20 #include <map>
21 #include <TFile.h>
22 #include <TH1.h>
23 #include <TH2.h>
24 
25 class PHCompositeNode;
27 class TrackSeed;
28 class TrackSeedContainer;
29 class TrkrCluster;
32 
33 using GridSeeds = std::vector<std::vector<Acts::Seed<SpacePoint>>>;
34 
42 {
43  public:
44  PHActsSiliconSeeding(const std::string& name = "PHActsSiliconSeeding");
45  int Init(PHCompositeNode *topNode) override;
46  int InitRun(PHCompositeNode *topNode) override;
47  int process_event(PHCompositeNode *topNode) override;
48  int End(PHCompositeNode *topNode) override;
49 
50  void setunc(float unc) { m_uncfactor = unc; }
54 
58 
59 
60  void setRPhiSearchWindow(const float win)
61  {
62  m_rPhiSearchWin = win;
63  std::cout << "Search window is " << m_rPhiSearchWin<<std::endl;
64  }
65 
66 
71 
72  void rMax(const float rMax)
73  { m_rMax = rMax; }
74  void rMin(const float rMin)
75  { m_rMin = rMin; }
76  void zMax(const float zMax)
77  {m_zMax = zMax; }
78  void zMin(const float zMin)
79  {m_zMin = zMin; }
80  void deltaRMax(const float deltaRMax)
82  void cotThetaMax(const float cotThetaMax)
84  void gridFactor(const float gridFactor)
86  void sigmaScattering(const float sigma)
88  void maxPtScattering(const float pt)
89  { m_maxPtScattering = pt; }
90  void sigmaError(const float sigma)
91  { m_sigmaError = sigma; }
92  void zalign(const float z)
93  { m_zalign = z; }
94  void ralign(const float r)
95  { m_ralign = r; }
96  void tolerance(const float tolerance)
97  { m_tolerance = tolerance; }
98  void helixcut(const float cut)
99  { m_helixcut = cut; }
100 
101 
104  void largeGridSpacing(const bool spacing);
105 
106  void set_track_map_name(const std::string &map_name) { _track_map_name = map_name; }
107  void iteration(int iter){m_nIteration = iter;}
108  void searchInIntt() { m_searchInIntt = true; }
109 
110  private:
111 
112  int getNodes(PHCompositeNode *topNode);
113  int createNodes(PHCompositeNode *topNode);
114 
115  GridSeeds runSeeder(std::vector<const SpacePoint*>& spVec);
116 
119  void configureSeeder();
120  void configureSPGrid();
122 
124  void makeSvtxTracks(GridSeeds& seedVector);
125 
128  const Surface& surf,
129  const TrkrDefs::cluskey,
130  // const TrkrCluster* clus);
131  TrkrCluster* clus);
132 
134  std::vector<const SpacePoint*> getSiliconSpacePoints(Acts::Extent& rRangeSPExtent);
136 
139  std::vector<TrkrDefs::cluskey> findInttMatches(
140  std::vector<Acts::Vector3>& clusters,
141  TrackSeed& seed);
142 
143  std::vector<TrkrDefs::cluskey> matchInttClusters(std::vector<Acts::Vector3>& clusters,
144  TrackSeed& seed,
145  const double xProj[],
146  const double yProj[],
147  const double zProj[]);
148 
149  void createHistograms();
150  void writeHistograms();
151  double normPhi2Pi(const double phi);
152 
157 
163 
165  bool m_searchInIntt = false;
166 
170  float m_uncfactor = 3.18;
171 
175 
181 
183  float m_helixcut = 1;
185  float m_ralign = 0;
186  float m_zalign = 0;
187  float m_maxPtScattering = 10;
188  float m_sigmaScattering = 5.;
189  float m_sigmaError = 5;
190 
193  float m_gridFactor = 2.3809;
194 
199  float m_cotThetaMax = 2.9;
200 
203 
207 
211  std::vector<std::pair<int, int> > zBinNeighborsTop;
212  std::vector<std::pair<int, int> > zBinNeighborsBottom;
213  int nphineighbors = 1;
214  std::shared_ptr<const Acts::BinFinder<SpacePoint>>
216 
217  int m_event = 0;
218 
220  double m_maxSeedPCA = 2.;
221 
223  const static unsigned int m_nInttLayers = 4;
225 
227  double m_rPhiSearchWin = 0.1;
228 
230  bool m_useTruthClusters = false;
231 
232  bool m_cleanSeeds = false;
233 
234  int m_nBadUpdates = 0;
237  int m_nIteration = 0;
238  std::string _track_map_name = "SiliconTrackSeedContainer";
240 
241  bool m_seedAnalysis = false;
242  TFile *m_file = nullptr;
243  TH2 *h_nInttProj = nullptr;
244  TH1 *h_nMvtxHits = nullptr;
245  TH1 *h_nInttHits = nullptr;
246  TH1 *h_nMatchedClusters = nullptr;
247  TH2 *h_nHits = nullptr;
248  TH1 *h_nSeeds = nullptr;
249  TH1 *h_nActsSeeds = nullptr;
250  TH1 *h_nTotSeeds = nullptr;
251  TH1 *h_nInputMeas = nullptr;
252  TH1 *h_nInputMvtxMeas = nullptr;
253  TH1 *h_nInputInttMeas = nullptr;
254  TH2 *h_hits = nullptr;
255  TH2 *h_zhits = nullptr;
256  TH2 *h_projHits = nullptr;
257  TH2 *h_zprojHits = nullptr;
258  TH2 *h_resids = nullptr;
259 
260 };
261 
262 
263 #endif