Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHCosmicsTrkFitter.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHCosmicsTrkFitter.h
1 
2 #ifndef TRACKRECO_PHCOSMICSTRKFITTER_H
3 #define TRACKRECO_PHCOSMICSTRKFITTER_H
4 
5 #include "ActsAlignmentStates.h"
6 #include "ActsEvaluator.h"
7 
8 #include <fun4all/SubsysReco.h>
9 
10 #include <trackbase/ActsGeometry.h>
15 
16 #include <tpc/TpcClusterMover.h>
19 
24 
26 
27 #include <memory>
28 #include <string>
29 
30 #include <TFile.h>
31 #include <TTree.h>
32 
34 
35 class MakeActsGeometry;
36 class SvtxTrack;
37 class SvtxTrackMap;
38 class TrackSeed;
39 class TrackSeedContainer;
43 
48 using SurfacePtrVec = std::vector<const Acts::Surface*>;
49 using SourceLinkVec = std::vector<Acts::SourceLink>;
50 
52 {
53  public:
55  PHCosmicsTrkFitter(const std::string& name = "PHCosmicsTrkFitter");
56 
58  ~PHCosmicsTrkFitter() override = default;
59 
61  int End(PHCompositeNode* topNode) override;
62 
64  int InitRun(PHCompositeNode* topNode) override;
65 
67  int process_event(PHCompositeNode* topNode) override;
68 
69  int ResetEvent(PHCompositeNode* topNode) override;
70 
71  void setUpdateSvtxTrackStates(bool fillSvtxTrackStates)
72  {
73  m_fillSvtxTrackStates = fillSvtxTrackStates;
74  }
75 
76  void useActsEvaluator(bool actsEvaluator)
77  {
78  m_actsEvaluator = actsEvaluator;
79  }
80 
82  void setFieldMap(const std::string &fieldMap)
83  {
84  m_fieldMap = fieldMap;
85  }
86 
87  void setAbsPdgHypothesis(unsigned int pHypothesis)
88  {
89  m_pHypothesis = pHypothesis;
90  }
91  void seedAnalysis() { m_seedClusAnalysis = true; }
93 
94  void useOutlierFinder(bool outlier) { m_useOutlierFinder = outlier; }
95 
96  void SetIteration(int iter) { _n_iteration = iter; }
97  void set_track_map_name(const std::string& map_name) { _track_map_name = map_name; }
98  void set_seed_track_map_name(const std::string& map_name) { _seed_track_map_name = map_name; }
99 
100  void ignoreLayer(int layer) { m_ignoreLayer.insert(layer); }
101  void setVertexRadius(const float rad) { m_vertexRadius = rad; }
102 
103  void getCharge(TrackSeed* track, int& charge, float& cosmicslope );
104 
105  private:
107  int getNodes(PHCompositeNode* topNode);
108 
110  int createNodes(PHCompositeNode* topNode);
111 
113 
114  // SourceLinkVec getSourceLinks(TrackSeed* track,
115  // ActsTrackFittingAlgorithm::MeasurementContainer& measurements,
116  // short int crossing,
117  // int& charge,
118  // float& cosmicslope);
119 
121  void updateSvtxTrack(std::vector<Acts::MultiTrajectoryTraits::IndexType>& tips,
124  SvtxTrack* track);
125 
129  const std::vector<Acts::SourceLink>& sourceLinks,
132  kfOptions,
133  const CalibratorAdapter& calibrator,
135 
136  bool getTrackFitResult(FitResult& fitOutput, TrackSeed* seed,
137  SvtxTrack* track,
140 
143  void makeBranches();
144 
146  int m_event = 0;
147 
150 
153 
161 
162  // Used for distortion correction transformations
163  alignmentTransformationContainer* m_alignmentTransformationMap = nullptr; // added for testing purposes
165  std::set< Acts::GeometryIdentifier> m_transient_id_set;
167 
169  int m_nBadFits = 0;
170 
172  bool m_commissioning = true;
173 
176 
178  bool m_useOutlierFinder = false;
180 
181  float m_vertexRadius = 80;
182 
183  bool m_actsEvaluator = false;
184  std::unique_ptr<ActsEvaluator> m_evaluator = nullptr;
185  std::string m_evalname = "ActsEvaluator.root";
186 
187  std::map<const unsigned int, Trajectory>* m_trajectories = nullptr;
189 
194 
197 
198  // cluster mover utility class
199  // TpcClusterMover _clusterMover;
201 
202  std::set<int> m_ignoreLayer;
203 
205 
206 
207  int _n_iteration = 0;
208  std::string _track_map_name = "SvtxTrackMap";
210 
212  unsigned int m_pHypothesis = 13;
213 
216 
217 
219  bool m_seedClusAnalysis = false;
220  std::unique_ptr<TFile> m_outfile = nullptr;
221  std::unique_ptr<TTree> m_tree = nullptr;
222  int m_seed = std::numeric_limits<int>::max();
223  float m_R = NAN;
224  float m_X0 = NAN;
225  float m_Y0 = NAN;
226  float m_Z0 = NAN;
227  float m_slope = NAN;
228  float m_pcax = NAN;
229  float m_pcay = NAN;
230  float m_pcaz = NAN;
231  float m_px = NAN;
232  float m_py = NAN;
233  float m_pz = NAN;
234  int m_charge = std::numeric_limits<int>::max();
235  int m_nmaps = std::numeric_limits<int>::max();
236  int m_nintt = std::numeric_limits<int>::max();
237  int m_ntpc = std::numeric_limits<int>::max();
238  int m_nmm = std::numeric_limits<int>::max();
239  std::vector<float> m_locx, m_locy, m_x, m_y, m_z, m_r, m_layer,m_phi, m_eta,
241  void clearVectors();
242  void fillVectors(TrackSeed* tpcseed, TrackSeed *siseed);
244 
245 };
246 
247 #endif