CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
TestTrack.h
Go to the documentation of this file.
1#ifndef TESTTRACK
2#define TESTTRACK
3
9#include "GaudiKernel/INTupleSvc.h"
11
14#include <vector>
15#include <string>
16#include "TFile.h"
17#include "TTree.h"
18#include "TString.h"
20#include "TH1F.h"
21
22
23class IDataProviderSvc;
24#define MAXNOFCLUSTERS 500 // HACK THIS 10000
25#define MAXNOFHITS 2400
26#define MAXNOFFITPOINT 6
27#define MAXNOFLAYER 3
28#define MAXNOFSHEET 2
29
30class TestTrack : public Algorithm{
31public:
32 // Constructor
33 TestTrack(const std::string& name, ISvcLocator* pSvcLocator);
34 ~TestTrack();
35 // Executable
36 StatusCode initialize();
37 StatusCode execute ();
38 StatusCode finalize ();
39
40 void reset();
41 void reset_hit();
42 void reset_cluster_1d();
43 void reset_cluster_2d();
44 void reset_map();
45 void reset_track();
46
47private:
48
49 bool selDigi(CgemDigiCol::iterator iter, int sel);
50 void DefineHitTree();
51 void DefineClusterTree();
52 void DefineTrackTree();
53
54 std::map<int, std::vector< int > > *GetStripToHitMap(int ilayer, int isheet, int iview);
55 std::map<int, int> *GetStripToCounterMap(int ilayer, int isheet, int iview);
56
57 // computation of P.O.C.A. = Point Of Closest Approach of the found
58 // track to the origin (0, 0, 0,) in the global, aligned reference frame
59 // --> xP, yP, zP is in the aligned frame!
60 void ComputePOCA(double &xP, double &yP, double &zP);
61
62 // Compute the intersection of the fitted track on the layerid-ith layer
63 // * layerid = 0, 1, 2 means L1, L2, L3
64 // * if align flag is on --> the intersection x, y, z is in the alighed frame
65 // otherwise the intersection x, y, z are in the non aligned frame
66 // * phi1, v1 are always in the local frame of the layer
67 bool ComputeIntersection(int layerid,
68 double &x1, double &y1, double &z1, double& phi1, double &v1,
69 double &x2, double &y2, double &z2, double& phi2, double &v2,
70 double &angCR_xy, double &angCR_yz);
71
72 bool align_flag;
73
74 //µTPC debug
75 float get_Time(CgemDigiCol::iterator iDigiCol);
76 float get_TimeWalk(CgemDigiCol::iterator iDigiCol);
77 float get_TimeRising(CgemDigiCol::iterator iDigiCol);
78 float get_TimeReference(CgemDigiCol::iterator iDigiCol);
79
80 // A data server
81 IDataProviderSvc* m_evtSvc;
82
83 CgemLUTReader *lutreader;
84 string lutfile;
85
87 double anode_mid_gap_L1;
88 double anode_mid_gap_L2;
89 double anode_mid_gap_L3;
90
91 CgemMidDriftPlane* midplane;
92 CgemGeoAlign* alignment;
93
94 ICgemCalibFunSvc* myCgemCalibSvc;
95
96 // strip maps
97 std::map<int, std::vector< int > > map_L1_S1_stripx_to_hit;
98 std::map<int, std::vector< int > > map_L2_S1_stripx_to_hit;
99 std::map<int, std::vector< int > > map_L2_S2_stripx_to_hit;
100 std::map<int, std::vector< int > > map_L1_S1_stripv_to_hit;
101 std::map<int, std::vector< int > > map_L2_S1_stripv_to_hit;
102 std::map<int, std::vector< int > > map_L2_S2_stripv_to_hit;
103 std::map<int, std::vector< int > > map_L3_S1_stripx_to_hit;
104 std::map<int, std::vector< int > > map_L3_S2_stripx_to_hit;
105 std::map<int, std::vector< int > > map_L3_S1_stripv_to_hit;
106 std::map<int, std::vector< int > > map_L3_S2_stripv_to_hit;
107
108 int m_selGoodDigi; // 0: no selection, 1: select good digi, -1: noisy digi
109 // time window for digi [ns]
110 double m_minDigiTime;
111 double m_maxDigiTime;
112 // min charge for digi
113 double myQMin;
114
115
116 TFile *output;
117 TTree *tree;
118 string OutputFileName;
119
120 ICgemGeomSvc *m_SvcCgem;
121
122 // hit
123 int event;
124 int nhit;
125 int hit_strip[MAXNOFHITS];
126 int hit_view[MAXNOFHITS];
127 int hit_layer[MAXNOFHITS];
128 int hit_sheet[MAXNOFHITS];
129 double hit_length[MAXNOFHITS];
130 int hit_channel[MAXNOFHITS];
131 int hit_roc[MAXNOFHITS];
132 int hit_feb[MAXNOFHITS];
133 int hit_tiger[MAXNOFHITS];
134 int hit_chip[MAXNOFHITS];
135 double hit_t[MAXNOFHITS];
136 double hit_q[MAXNOFHITS];
137 double hit_x_tpc[MAXNOFHITS];
138 double hit_z_tpc[MAXNOFHITS];
139 double hit_ex_tpc[MAXNOFHITS];
140 double hit_ez_tpc[MAXNOFHITS];
141 double hit_deltax_tpc[MAXNOFHITS];
142 double hit_deltaz_tpc[MAXNOFHITS];
143 int hit_order[MAXNOFHITS];
144 int hit_quality[MAXNOFHITS];
145 int hit_selgooddigi[MAXNOFHITS];
146
147 // cluster
148 int ncluster;
149 int ncluster_1d;
150 int ncluster_2d;
151 int ncluster_2d_L1_S1;
152 int ncluster_2d_L2_S1;
153 int ncluster_2d_L2_S2;
154 int ncluster_2d_L3_S1;
155 int ncluster_2d_L3_S2;
156 int ncluster_1d_L1_S1_x;
157 int ncluster_1d_L2_S1_x;
158 int ncluster_1d_L2_S2_x;
159 int ncluster_1d_L3_S1_x;
160 int ncluster_1d_L3_S2_x;
161 int ncluster_1d_L1_S1_v;
162 int ncluster_1d_L2_S1_v;
163 int ncluster_1d_L2_S2_v;
164 int ncluster_1d_L3_S1_v;
165 int ncluster_1d_L3_S2_v;
166
167 // 1D cluster
168 double cluster_1d_t[MAXNOFCLUSTERS];
169 double cluster_1d_tmean[MAXNOFCLUSTERS];
170 double cluster_1d_tqmax[MAXNOFCLUSTERS];
171 double cluster_1d_q[MAXNOFCLUSTERS];
172 double cluster_1d_r[MAXNOFCLUSTERS];
173 double cluster_1d_phi[MAXNOFCLUSTERS];
174 double cluster_1d_v[MAXNOFCLUSTERS];
175 double cluster_1d_v_cc[MAXNOFCLUSTERS];
176 double cluster_1d_phi_cc[MAXNOFCLUSTERS];
177 double cluster_1d_v_tpc[MAXNOFCLUSTERS];
178 double cluster_1d_phi_tpc[MAXNOFCLUSTERS];
179 double cluster_1d_slope_tpc[MAXNOFCLUSTERS];
180 double cluster_1d_inter_tpc[MAXNOFCLUSTERS];
181 int cluster_1d_layerid[MAXNOFCLUSTERS];
182 int cluster_1d_sheetid[MAXNOFCLUSTERS];
183 int cluster_1d_view[MAXNOFCLUSTERS];
184 int cluster_1d_ID[MAXNOFCLUSTERS];
185 int cluster_1d_strip1[MAXNOFCLUSTERS];
186 int cluster_1d_strip2[MAXNOFCLUSTERS];
187 int cluster_1d_size[MAXNOFCLUSTERS];
188 int cluster_1d_size_real[MAXNOFCLUSTERS];
189 int cluster_1d_size_max[MAXNOFCLUSTERS];
190 int cluster_1d_hitindex[MAXNOFCLUSTERS][50];
191
192 // 2D cluster
193 double cluster_2d_t[MAXNOFCLUSTERS];
194 double cluster_2d_tmean[MAXNOFCLUSTERS];
195 double cluster_2d_tqmax[MAXNOFCLUSTERS];
196 double cluster_2d_q[MAXNOFCLUSTERS];
197 double cluster_2d_r[MAXNOFCLUSTERS];
198 double cluster_2d_phi[MAXNOFCLUSTERS];
199 double cluster_2d_z[MAXNOFCLUSTERS];
200 double cluster_2d_z_cc[MAXNOFCLUSTERS];
201 double cluster_2d_phi_cc[MAXNOFCLUSTERS];
202 double cluster_2d_z_tpc[MAXNOFCLUSTERS];
203 double cluster_2d_phi_tpc[MAXNOFCLUSTERS];
204 int cluster_2d_layerid[MAXNOFCLUSTERS];
205 int cluster_2d_sheetid[MAXNOFCLUSTERS];
206 int cluster_2d_view[MAXNOFCLUSTERS];
207 int cluster_2d_ID[MAXNOFCLUSTERS];
208 int cluster_2d_idx[MAXNOFCLUSTERS];
209 int cluster_2d_idv[MAXNOFCLUSTERS];
210 int cluster_2d_highest[MAXNOFCLUSTERS];
211
212 // track
213 double track_dr;
214 double track_phi0;
215 double track_dz;
216 double track_tanL;
217 double track_chi2;
218 int track_nfitpoint;
219 int track_clusterid[MAXNOFFITPOINT];
220 int track_layerid[MAXNOFFITPOINT];
221 int track_sheetid[MAXNOFFITPOINT];
222 int track_test_layerid;
223 int track_test_sheetid;
224 // poca
225 double track_xpoca_glo;
226 double track_ypoca_glo;
227 double track_zpoca_glo;
228 // L1 intersection
229 double track_x1top_glo;
230 double track_y1top_glo;
231 double track_z1top_glo;
232 double track_phi1top_loc;
233 double track_v1top_loc;
234 //
235 double track_x1bot_glo;
236 double track_y1bot_glo;
237 double track_z1bot_glo;
238 double track_phi1bot_loc;
239 double track_v1bot_loc;
240 // L2 intersection
241 double track_x2top_glo;
242 double track_y2top_glo;
243 double track_z2top_glo;
244 double track_phi2top_loc;
245 double track_v2top_loc;
246 //
247 double track_x2bot_glo;
248 double track_y2bot_glo;
249 double track_z2bot_glo;
250 double track_phi2bot_loc;
251 double track_v2bot_loc;
252 // L3 intersection
253 double track_x3top_glo;
254 double track_y3top_glo;
255 double track_z3top_glo;
256 double track_phi3top_loc;
257 double track_v3top_loc;
258 //
259 double track_x3bot_glo;
260 double track_y3bot_glo;
261 double track_z3bot_glo;
262 double track_phi3bot_loc;
263 double track_v3bot_loc;
264
265 double ang_xy_L1;
266 double ang_yz_L1;
267 double ang_xy_L2;
268 double ang_yz_L2;
269 double ang_xy_L3;
270 double ang_yz_L3;
271
272};
273#endif
Double_t phi2
Double_t phi1
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
#define MAXNOFFITPOINT
Definition TestTrack.h:26
#define MAXNOFCLUSTERS
Definition TestTrack.h:24
#define MAXNOFHITS
Definition TestTrack.h:25
void reset_cluster_2d()
void reset_cluster_1d()
StatusCode finalize()
void reset()
TestTrack(const std::string &name, ISvcLocator *pSvcLocator)
Definition TestTrack.cxx:47
void reset_map()
void reset_track()
StatusCode initialize()
StatusCode execute()
void reset_hit()