Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHActsTrkFitter.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHActsTrkFitter.h
1 
8 #ifndef TRACKRECO_ACTSTRKFITTER_H
9 #define TRACKRECO_ACTSTRKFITTER_H
10 
11 #include "ActsAlignmentStates.h"
12 #include "ActsEvaluator.h"
13 
14 #include <fun4all/SubsysReco.h>
15 
16 #include <trackbase/ActsGeometry.h>
21 
24 
29 
31 
32 #include <TFile.h>
33 #include <TH1.h>
34 #include <TH2.h>
35 #include <memory>
36 #include <string>
37 
39 
40 class MakeActsGeometry;
41 class SvtxTrack;
42 class SvtxTrackMap;
43 class TrackSeed;
44 class TrackSeedContainer;
48 
53 using SurfacePtrVec = std::vector<const Acts::Surface*>;
54 using SourceLinkVec = std::vector<Acts::SourceLink>;
55 
57 {
58  public:
60  PHActsTrkFitter(const std::string& name = "PHActsTrkFitter");
61 
63  ~PHActsTrkFitter() override = default;
64 
66  int End(PHCompositeNode* topNode) override;
67 
69  int InitRun(PHCompositeNode* topNode) override;
70 
72  int process_event(PHCompositeNode* topNode) override;
73 
74  int ResetEvent(PHCompositeNode* topNode) override;
75 
77  void doTimeAnalysis(bool timeAnalysis) { m_timeAnalysis = timeAnalysis; }
78 
81  {
83  }
84 
87  {
89  }
90 
91  void setUpdateSvtxTrackStates(bool fillSvtxTrackStates)
92  {
93  m_fillSvtxTrackStates = fillSvtxTrackStates;
94  }
95 
96  void useActsEvaluator(bool actsEvaluator)
97  {
98  m_actsEvaluator = actsEvaluator;
99  }
100 
102  void setFieldMap(const std::string &fieldMap)
103  {
104  m_fieldMap = fieldMap;
105  }
106 
107  void setAbsPdgHypothesis(unsigned int pHypothesis)
108  {
109  m_pHypothesis = pHypothesis;
110  }
111 
113 
114  void useOutlierFinder(bool outlier) { m_useOutlierFinder = outlier; }
115 
116  void SetIteration(int iter) { _n_iteration = iter; }
117  void set_track_map_name(const std::string& map_name) { _track_map_name = map_name; }
118  void set_seed_track_map_name(const std::string& map_name) { _seed_track_map_name = map_name; }
119 
121  void set_pp_mode(bool ispp) { m_pp_mode = ispp; }
122 
123  void ignoreLayer(int layer) { m_ignoreLayer.insert(layer); }
124 
125  private:
127  int getNodes(PHCompositeNode* topNode);
128 
130  int createNodes(PHCompositeNode* topNode);
131 
133 
135  void updateSvtxTrack(std::vector<Acts::MultiTrajectoryTraits::IndexType>& tips,
138  SvtxTrack* track);
139 
143  const std::vector<Acts::SourceLink>& sourceLinks,
146  kfOptions,
147  const SurfacePtrVec& surfSequence,
148  const CalibratorAdapter& calibrator,
150 
153  SourceLinkVec getSurfaceVector(const SourceLinkVec& sourceLinks,
154  SurfacePtrVec& surfaces) const;
155  void checkSurfaceVec(SurfacePtrVec& surfaces) const;
156 
157  bool getTrackFitResult(FitResult& fitOutput, TrackSeed* seed,
158  SvtxTrack* track,
161 
164 
166  int m_event = 0;
167 
170 
173 
175  alignmentTransformationContainer* m_alignmentTransformationMap = nullptr; // added for testing purposes
177  std::set< Acts::GeometryIdentifier> m_transient_id_set;
185 
187  int m_nBadFits = 0;
188 
191  bool m_fitSiliconMMs = false;
192 
194  bool m_useMicromegas = true;
195 
198 
200  bool m_useOutlierFinder = false;
202 
204  bool m_pp_mode = false;
205 
206  // max variation of bunch crossing away from crossing_estimate
207  short int max_bunch_search = 2;
208 
209  bool m_actsEvaluator = false;
210  std::unique_ptr<ActsEvaluator> m_evaluator = nullptr;
211  std::string m_evalname = "ActsEvaluator.root";
212 
213  std::map<const unsigned int, Trajectory>* m_trajectories = nullptr;
215 
220 
223 
225 
226  std::set<int> m_ignoreLayer;
227 
229 
230  int _n_iteration = 0;
231  std::string _track_map_name = "SvtxTrackMap";
233 
235  unsigned int m_pHypothesis = 211;
236 
239  bool m_commissioning = false;
240 
242  bool m_timeAnalysis = false;
243  TFile* m_timeFile = nullptr;
244  TH1* h_eventTime = nullptr;
245  TH2* h_fitTime = nullptr;
246  TH1* h_updateTime = nullptr;
247  TH1* h_stateTime = nullptr;
248  TH1* h_rotTime = nullptr;
249 };
250 
251 #endif