EIC 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 <fun4all/SubsysReco.h>
12 
14 #include <trackbase/TrkrDefs.h>
16 
20 
25 
28 
29 #include <boost/bimap.hpp>
30 
31 #include <memory>
32 #include <string>
33 #include <TFile.h>
34 #include <TH1.h>
35 #include <TH2.h>
36 
37 namespace ActsExamples
38 {
39  class TrkrClusterSourceLink;
40 }
41 
42 class MakeActsGeometry;
43 class SvtxTrack;
44 class SvtxTrackMap;
47 
55 using SurfacePtrVec = std::vector<const Acts::Surface*>;
56 using SourceLinkVec = std::vector<SourceLink>;
57 
59 {
60  public:
62  PHActsTrkFitter(const std::string& name = "PHActsTrkFitter");
63 
65  ~PHActsTrkFitter() override = default;
66 
68  int End(PHCompositeNode *topNode) override;
69 
71  int InitRun(PHCompositeNode* topNode) override;
72 
74  int process_event(PHCompositeNode *topNode) override;
75 
76  int ResetEvent(PHCompositeNode *topNode) override;
77 
79  void doTimeAnalysis(bool timeAnalysis){m_timeAnalysis = timeAnalysis;}
80 
84 
86  void setUseMicromegas( bool value )
87  { m_useMicromegas = value; }
88 
89  void setUpdateSvtxTrackStates(bool fillSvtxTrackStates)
90  { m_fillSvtxTrackStates = fillSvtxTrackStates; }
91 
92  void useActsEvaluator(bool actsEvaluator)
93  { m_actsEvaluator = actsEvaluator; }
94 
95  void setFieldMap(std::string& fieldMap)
96  { m_fieldMap = fieldMap; }
97 
98  void setAbsPdgHypothesis(unsigned int pHypothesis)
99  { m_pHypothesis = pHypothesis; }
100 
101  void SetIteration(int iter){_n_iteration = iter;}
102  void set_track_map_name(const std::string &map_name) { _track_map_name = map_name; }
103  void set_seed_track_map_name(const std::string &map_name) { _seed_track_map_name = map_name; }
104 
105  private:
106 
108  int getNodes(PHCompositeNode *topNode);
109 
111  int createNodes(PHCompositeNode *topNode);
112 
113  void loopTracks(Acts::Logging::Level logLevel);
115 
117  void updateSvtxTrack(Trajectory traj, SvtxTrack* track);
118 
122  const SourceLinkVec& sourceLinks,
123  const ActsExamples::TrackParameters& seed,
125  kfOptions,
126  const SurfacePtrVec& surfSequence);
127 
130  SourceLinkVec getSurfaceVector(const SourceLinkVec& sourceLinks,
131  SurfacePtrVec& surfaces) const;
132  void checkSurfaceVec(SurfacePtrVec& surfaces) const;
133  void getTrackFitResult(const FitResult& fitOutput,
134  SvtxTrack* track);
135 
140 
142  void printTrackSeed(const SvtxTrack* seed) const;
143 
145  int m_event = 0;
146 
149 
152 
158 
160  int m_nBadFits = 0;
161 
164  bool m_fitSiliconMMs = false;
165 
167  bool m_useMicromegas = true;
168 
171 
172  bool m_actsEvaluator = false;
173  std::map<const unsigned int, Trajectory> *m_trajectories = nullptr;
175 
176  std::string m_fieldMap = "";
178  int _n_iteration = 0;
179  std::string _track_map_name = "SvtxTrackMap";
180  std::string _seed_track_map_name = "SeedTrackMap";
181 
183  unsigned int m_pHypothesis = 211;
184 
186  bool m_timeAnalysis = false;
187  TFile *m_timeFile = nullptr;
188  TH1 *h_eventTime = nullptr;
189  TH2 *h_fitTime = nullptr;
190  TH1 *h_updateTime = nullptr;
191  TH1 *h_stateTime = nullptr;
192  TH1 *h_rotTime = nullptr;
193 };
194 
195 #endif