Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TpcDirectLaserReconstruction.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TpcDirectLaserReconstruction.h
1 #ifndef TPCCALIB_TPCDIRECTLASERRECONSTRUCTION_H
2 #define TPCCALIB_TPCDIRECTLASERRECONSTRUCTION_H
3 
10 #include <fun4all/SubsysReco.h>
11 #include <phparameter/PHParameterInterface.h>
13 
14 #include <memory>
15 
16 class SvtxTrack;
17 class SvtxTrackMap;
21 
22 class TFile;
23 class TH1;
24 class TH2;
25 class TH3;
26 class TH2;
27 class TVector3;
28 class TNtuple;
29 
31 {
32 
33  public:
34 
36  TpcDirectLaserReconstruction( const std::string& = "TpcDirectLaserReconstruction" );
37 
39  int Init(PHCompositeNode*) override;
40 
42  int InitRun(PHCompositeNode*) override;
43 
45  int process_event(PHCompositeNode*) override;
46 
48  int End(PHCompositeNode*) override;
49 
51  void SetDefaultParameters() override;
52 
54 
58  { m_outputfile = filename; }
59 
62 
64  void set_histogram_outputfile(const std::string &outputfile)
65  {m_histogramfilename = outputfile;}
66 
68  void set_grid_dimensions( int phibins, int rbins, int zbins );
69 
70  void set_max_zrange(float length)
71  {m_max_zrange = length;}
72 
73  void set_max_dca(float length)
74  {m_max_dca = length;}
75 
76  private:
77 
80 
82  void create_histograms();
83 
85  void process_tracks();
86 
88  void process_track( SvtxTrack* );
89 
91  int get_cell_index( const TVector3& ) const;
92 
94  int Locate(float r , float phi , float z);
95 
96  float GetRelPhi( float xorig, float yorig, float x, float y, float phiorig );
97 
98  float GetRelTheta( float xorig, float yorig, float zorig, float x, float y, float z, float thetaorig, float phiorig );
99 
100  bool sameSign(float num1, float num2);
101 
103  std::string m_outputfile = "TpcSpaceChargeMatrices.root";
104 
105  float m_max_zrange = 10.0; // cm
106 
108 
109  // residual cuts in r, phi plane
110  float m_max_dca = NAN;
111 
113  float m_max_drphi = NAN;
114 
116  float m_max_dz = NAN;
117 
118  float m_pedestal = 74.4; // pedestal for hit ASDC values
119 
121 
123  std::unique_ptr<TpcSpaceChargeMatrixContainer> m_matrix_container;
124 
126 
127  int m_total_hits = 0;
128  int m_matched_hits = 0;
131 
133 
134 
136 
139 
142 
145 
147 
149 
151 
152  bool m_savehistograms = false;
153  std::string m_histogramfilename = "TpcDirectLaserReconstruction.root";
154  std::unique_ptr<TFile> m_histogramfile = nullptr;
155 
157  TH2* h_dca_layer = nullptr;
158 
160  TH2 *h_deltarphi_layer_south = nullptr;
161  TH2 *h_deltarphi_layer_north = nullptr;
162 
164  TH2 *h_deltaz_layer = nullptr;
165 
166  TH2 *h_deltar_r = nullptr;
167 
169  TH3 *h_entries = nullptr;
170  TNtuple *h_hits = nullptr;
171  TNtuple *h_hits_reco = nullptr;
172  // adc spectra of ALL lasers
173  TH1 *h_adc = nullptr;
174  TH1 *h_adc_reco = nullptr;
175 
176  TH1 *h_adc_sum = nullptr;
177  TH1 *h_adc_sum_reco = nullptr;
178 
179  TH1 *h_adc_sum_ratio_true = nullptr;
180  TH1 *h_adc_sum_ratio = nullptr;
181 
182 //_______________________________________
183 
184  TH1 *h_num_sum = nullptr;
185  TH1 *h_num_sum_reco = nullptr;
186 
187  TH1 *h_num_sum_ratio_true = nullptr;
188  TH1 *h_num_sum_ratio = nullptr;
189 
190 //_______________________________________
191 
192  TH2 *h_adc_vs_DCA_true = nullptr;
195 
196  //TNtuple *h_origins = nullptr;
197  //TNtuple *h_assoc_hits = nullptr;
198  TNtuple *h_bright_hits_laser1 = nullptr;
199  TNtuple *h_bright_hits_laser2 = nullptr;
200  TNtuple *h_bright_hits_laser3 = nullptr;
201  TNtuple *h_bright_hits_laser4 = nullptr;
202 
204  TH2 *h_deltheta_delphi = nullptr;
205  TH2 *h_deltheta_delphi_1 = nullptr;
206  TH2 *h_deltheta_delphi_2 = nullptr;
207  TH2 *h_deltheta_delphi_3 = nullptr;
208  TH2 *h_deltheta_delphi_4 = nullptr;
209  TH2 *h_deltheta_delphi_5 = nullptr;
210  TH2 *h_deltheta_delphi_6 = nullptr;
211  TH2 *h_deltheta_delphi_7 = nullptr;
212  TH2 *h_deltheta_delphi_8 = nullptr;
213 
214  // for recording # of unique GEM modules hit for the number of associated hits (to be replaced with GEM Modules)
215  TH1 *h_GEMs_hit = nullptr;
216  TH1 *h_layers_hit = nullptr;
217 
218  TH2 *h_relangle_lasrangle = nullptr;
220  TH2 *h_relangle_phi_lasrangle = nullptr;
221 
222  TH2* h_xy = nullptr;
223  TH2* h_xz = nullptr;
224  TH2* h_xy_pca = nullptr;
225  TH2* h_xz_pca = nullptr;
226  TH2* h_dca_path = nullptr;
227  TH2* h_zr = nullptr;
228  TH2* h_zr_pca = nullptr;
229  TH2* h_dz_z = nullptr;
230  //TNtuple *h_clusters = nullptr;
231 
233 
234 };
235 
236 #endif