Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHTpcResiduals.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHTpcResiduals.h
1 #ifndef TRACKRECO_PHTPCRESIDUALS_H
2 #define TRACKRECO_PHTPCRESIDUALS_H
3 
4 #include <fun4all/SubsysReco.h>
9 #include <trackbase/TrkrDefs.h>
11 
14 
15 #include <memory>
16 #include <optional>
17 
18 class PHCompositeNode;
19 class SvtxTrack;
20 class SvtxTrackMap;
22 class TrkrCluster;
24 
25 class TFile;
26 class TH1;
27 class TH2;
28 class TTree;
29 
36 class PHTpcResiduals : public SubsysReco
37 {
38 
39  public:
40 
41  PHTpcResiduals(const std::string &name = "PHTpcResiduals");
42  ~PHTpcResiduals() override = default;
43 
44  int Init(PHCompositeNode *topNode) override;
45  int InitRun(PHCompositeNode *topNode) override;
46  int process_event(PHCompositeNode *topNode) override;
47  int End(PHCompositeNode *topNode) override;
48 
50 
51  void setMaxTrackAlpha(float maxTAlpha)
52  { m_maxTAlpha = maxTAlpha;}
53 
54  void setMaxTrackBeta(float maxTBeta)
55  { m_maxTBeta = maxTBeta; }
56 
57  void setMaxTrackResidualDrphi(float maxResidualDrphi)
58  { m_maxResidualDrphi = maxResidualDrphi;}
59 
60  void setMaxTrackResidualDz(float maxResidualDz)
61  { m_maxResidualDz = maxResidualDz; }
62 
64 
66  void setMinPt( double value )
67  { m_minPt = value; }
68 
70  void setGridDimensions(const int phiBins, const int rBins, const int zBins);
71 
73  void setSavehistograms( bool ) {}
74 
77 
79  void setOutputfile(const std::string &outputfile)
80  {m_outputfile = outputfile;}
81 
83  void setUseMicromegas( bool value )
84  { m_useMicromegas = value; }
85 
86  private:
87 
88  using BoundTrackParam =
90 
92  using BoundTrackParamPair = std::pair<float,BoundTrackParam>;
93 
94  int getNodes(PHCompositeNode *topNode);
95  int createNodes(PHCompositeNode *topNode);
96 
98 
101  Acts::Vector3 getGlobalPosition(TrkrDefs::cluskey, TrkrCluster*, short int crossing) const;
102 
103  int processTracks(PHCompositeNode *topNode);
104 
105  bool checkTrack(SvtxTrack* track) const;
106  void processTrack(SvtxTrack* track);
107 
109  void addTrackState( SvtxTrack* track, TrkrDefs::cluskey key, float pathlength, const Acts::BoundTrackParameters& params );
110 
112  int getCell(const Acts::Vector3& loc);
113 
116 
119 
125 
126  // crossing z correction
128 
129  // distortion corrections
133 
136 
137  float m_maxTAlpha = 0.6;
138  float m_maxResidualDrphi = 0.5; // cm
139  float m_maxTBeta = 1.5;
140  float m_maxResidualDz = 0.5; // cm
141 
142  static constexpr float m_phiMin = 0;
143  static constexpr float m_phiMax = 2. * M_PI;
144 
145  static constexpr float m_rMin = 20; // cm
146  static constexpr float m_rMax = 78; // cm
147 
148  static constexpr int m_minClusCount = 10;
149 
151  static constexpr unsigned int m_nLayersTpc = 48;
152  static constexpr float m_zMin = -105.5; // cm
153  static constexpr float m_zMax = 105.5; // cm
154 
157 
159  std::unique_ptr<TpcSpaceChargeMatrixContainer> m_matrix_container;
160 
161  // TODO: check if needed
162  int m_event = 0;
163 
165  bool m_useMicromegas = true;
166 
168  double m_minPt = 0.5;
169 
171  std::string m_outputfile = "TpcSpaceChargeMatrices.root";
172 
174  short int m_crossing = 0;
175 
177 
178  int m_total_tracks = 0;
180 
184 
185 };
186 
187 #endif
188