1 |
mocchiut |
1.1 |
/** |
2 |
|
|
* \file TrkStruct.h |
3 |
|
|
* \author Elena Vannuccini |
4 |
|
|
* \date |
5 |
|
|
*/ |
6 |
|
|
#ifndef trkstruct_h |
7 |
|
|
#define trkstruct_h |
8 |
|
|
|
9 |
pam-fi |
1.9 |
#define NPLANE 6 |
10 |
pam-fi |
1.14 |
#define NVIEW 12 |
11 |
|
|
#define NVK 24 |
12 |
pam-fi |
1.15 |
#define NLADDER 3 |
13 |
pam-fi |
1.32 |
#define NSENSOR 2 |
14 |
pam-fi |
1.9 |
|
15 |
|
|
#define NCLMAX_VIEW 200 //max n.clusters per view |
16 |
|
|
#define NCLSTR 20 //max n.strip per cluster |
17 |
|
|
#define NCLMAX (NCLMAX_VIEW*12) //max n.clusters total |
18 |
|
|
#define NCLBUFF (NCLMAX*NCLSTR) |
19 |
|
|
|
20 |
|
|
#define NDBLT_MAX_NT 1000 // 0.2*ndblt_max |
21 |
|
|
#define NTRPT_MAX_NT 10000 // 0.2*ntrpt_max |
22 |
|
|
#define NCLOYZ_MAX 200 |
23 |
|
|
#define NCLOXZ_MAX 200 |
24 |
|
|
|
25 |
mocchiut |
1.1 |
#define NTRKMAX 10 |
26 |
pam-fi |
1.9 |
#define NSINGMAX NCLMAX //100 |
27 |
mocchiut |
1.1 |
|
28 |
pam-fi |
1.15 |
#define NANGMAX 21 |
29 |
pam-fi |
1.16 |
#define NETAVALMAX 500 |
30 |
pam-fi |
1.5 |
|
31 |
pam-fi |
1.28 |
#define NTRACKSMAX (NCLOYZ_MAX*NCLOXZ_MAX) |
32 |
pam-fi |
1.8 |
|
33 |
pam-fi |
1.16 |
#include <CalibTrk1Event.h> |
34 |
|
|
#include <CalibTrk2Event.h> |
35 |
|
|
using namespace pamela; |
36 |
|
|
//#include <TrkCalib.h> |
37 |
pam-fi |
1.2 |
|
38 |
mocchiut |
1.1 |
#include <TString.h> |
39 |
|
|
#include <TFile.h> |
40 |
pam-fi |
1.2 |
#include <TTree.h> |
41 |
mocchiut |
1.1 |
|
42 |
pam-fi |
1.16 |
|
43 |
pam-fi |
1.28 |
|
44 |
pam-fi |
1.2 |
#include <fstream> |
45 |
|
|
#include <iostream> |
46 |
mocchiut |
1.1 |
/** |
47 |
pam-fi |
1.2 |
* \brief Struct to pass calibration parameters to F77 routines |
48 |
mocchiut |
1.1 |
*/ |
49 |
pam-fi |
1.2 |
struct cTrkCalib { |
50 |
|
|
|
51 |
mocchiut |
1.1 |
float pedestal[128][24][12]; |
52 |
|
|
float pedestal_t[128][24][12]; |
53 |
|
|
float sigma[128][24][12]; |
54 |
|
|
float sigma_t[128][24][12]; |
55 |
|
|
int bad[128][24][12]; |
56 |
pam-fi |
1.2 |
|
57 |
pam-fi |
1.23 |
void Reset(){ |
58 |
|
|
for(int is=0; is<128; is++){ |
59 |
|
|
for(int ivk=0; ivk<24; ivk++){ |
60 |
|
|
for(int iv=0; iv<12; iv++){ |
61 |
|
|
pedestal[is][ivk][iv]=0.; |
62 |
|
|
pedestal_t[is][ivk][iv]=0.; |
63 |
|
|
sigma[is][ivk][iv]=0.; |
64 |
|
|
sigma_t[is][ivk][iv]=0.; |
65 |
|
|
bad[is][ivk][iv]=1; |
66 |
|
|
} |
67 |
|
|
} |
68 |
|
|
} |
69 |
|
|
} |
70 |
|
|
|
71 |
pam-fi |
1.16 |
/* void FillACalibFrom(TFile* , Int_t , Int_t ); */ |
72 |
|
|
/* void FillFCalibFrom(TFile* , Int_t , Int_t ); */ |
73 |
|
|
/* void FillTCalibFrom(TFile* , Int_t , Int_t ); */ |
74 |
|
|
/* void FillTCalibFrom(TString); */ |
75 |
pam-fi |
1.2 |
|
76 |
mocchiut |
1.1 |
}; |
77 |
|
|
// ================================================================== |
78 |
|
|
/** |
79 |
|
|
* \brief Struct to pass tracker LEVEL0 data to F77 routines |
80 |
|
|
*/ |
81 |
|
|
struct cTrkLevel0 { |
82 |
|
|
int DAQmode[12]; |
83 |
|
|
int DSPnumber[12]; |
84 |
|
|
int DATAlength[12]; |
85 |
|
|
int eventn[12]; |
86 |
|
|
int nclust[12]; |
87 |
|
|
int cutc[12]; |
88 |
|
|
int cutcl[12]; |
89 |
|
|
int addrcluster[3][12]; |
90 |
|
|
int signcluster[3][12]; |
91 |
|
|
int fc[12]; |
92 |
|
|
int compressiontime[12]; |
93 |
|
|
int fl5[12]; |
94 |
|
|
int fl4[12]; |
95 |
|
|
int fl3[12]; |
96 |
|
|
int fl2[12]; |
97 |
|
|
int fl1[12]; |
98 |
|
|
int fl6[12]; |
99 |
|
|
int checksum[12]; |
100 |
|
|
int TOTDATAlength; |
101 |
|
|
int datatracker[49152]; |
102 |
|
|
int pnum[12]; |
103 |
|
|
int cmdnum[12]; |
104 |
|
|
int bid[12]; |
105 |
|
|
int alarm[12]; |
106 |
|
|
int aswr[12]; |
107 |
|
|
int good0; |
108 |
|
|
int crc[12]; |
109 |
|
|
}; |
110 |
|
|
// ================================================================== |
111 |
|
|
/** |
112 |
|
|
* \brief Struct to pass tracker LEVEL1 data to F77 routines |
113 |
|
|
*/ |
114 |
|
|
struct cTrkLevel1 { |
115 |
pam-fi |
1.6 |
// int good1; |
116 |
pam-fi |
1.8 |
int good[12]; |
117 |
mocchiut |
1.1 |
int nclstr1; |
118 |
pam-fi |
1.8 |
int view[NCLMAX]; |
119 |
|
|
int ladder[NCLMAX]; |
120 |
|
|
int maxs[NCLMAX]; |
121 |
|
|
int mult[NCLMAX]; |
122 |
|
|
float dedx[NCLMAX]; |
123 |
|
|
int indstart[NCLMAX]; |
124 |
|
|
int indmax[NCLMAX]; |
125 |
mocchiut |
1.1 |
int totCLlength; |
126 |
pam-fi |
1.8 |
float clsignal[NCLBUFF]; |
127 |
|
|
float clsigma[NCLBUFF]; |
128 |
|
|
int cladc[NCLBUFF]; |
129 |
|
|
int clbad[NCLBUFF]; |
130 |
|
|
float cnev[24][12]; |
131 |
|
|
int cnnev[24][12]; |
132 |
|
|
float cnrmsev[24][12]; |
133 |
|
|
int fshower[12]; |
134 |
|
|
int whichtrack[NCLMAX]; |
135 |
pam-fi |
1.16 |
|
136 |
mocchiut |
1.1 |
}; |
137 |
|
|
// ================================================================== |
138 |
|
|
/** |
139 |
|
|
* \brief Struct to pass tracker LEVEL2 data to F77 routines |
140 |
|
|
*/ |
141 |
|
|
struct cTrkLevel2 { |
142 |
pam-fi |
1.6 |
// int good2; |
143 |
|
|
// int crc[12]; |
144 |
pam-fi |
1.19 |
int good[12]; |
145 |
|
|
int vkflag[24][12]; |
146 |
mocchiut |
1.1 |
// ---------------------------- |
147 |
|
|
int nclsx; |
148 |
|
|
int planex[NSINGMAX]; |
149 |
|
|
float xs[NSINGMAX][2]; |
150 |
|
|
float signlxs[NSINGMAX]; |
151 |
pam-fi |
1.8 |
int clsx[NSINGMAX]; |
152 |
pam-fi |
1.31 |
int sxbad[NSINGMAX]; |
153 |
|
|
int multmaxsx[NSINGMAX]; |
154 |
mocchiut |
1.1 |
// ---------------------------- |
155 |
|
|
int nclsy; |
156 |
|
|
int planey[NSINGMAX]; |
157 |
|
|
float ys[NSINGMAX][2]; |
158 |
|
|
float signlys[NSINGMAX]; |
159 |
pam-fi |
1.8 |
int clsy[NSINGMAX]; |
160 |
pam-fi |
1.31 |
int sybad[NSINGMAX]; |
161 |
|
|
int multmaxsy[NSINGMAX]; |
162 |
mocchiut |
1.1 |
// ---------------------------- |
163 |
|
|
int ntrk; |
164 |
|
|
int image[NTRKMAX]; |
165 |
|
|
float xm_nt[NTRKMAX][6]; |
166 |
|
|
float ym_nt[NTRKMAX][6]; |
167 |
|
|
float zm_nt[NTRKMAX][6]; |
168 |
|
|
float resx_nt[NTRKMAX][6]; |
169 |
|
|
float resy_nt[NTRKMAX][6]; |
170 |
pam-fi |
1.19 |
float tailx[NTRKMAX][6]; |
171 |
|
|
float taily[NTRKMAX][6]; |
172 |
mocchiut |
1.1 |
float al_nt[NTRKMAX][5]; |
173 |
|
|
float coval[NTRKMAX][5][5]; |
174 |
|
|
float chi2_nt[NTRKMAX]; |
175 |
pam-fi |
1.8 |
int nstep_nt[NTRKMAX]; |
176 |
|
|
int xgood_nt[NTRKMAX][6]; |
177 |
mocchiut |
1.1 |
int ygood_nt[NTRKMAX][6]; |
178 |
pam-fi |
1.19 |
int ls[NTRKMAX][6]; |
179 |
|
|
int xbad[NTRKMAX][6]; |
180 |
|
|
int ybad[NTRKMAX][6]; |
181 |
mocchiut |
1.1 |
float xv_nt[NTRKMAX][6]; |
182 |
|
|
float yv_nt[NTRKMAX][6]; |
183 |
|
|
float zv_nt[NTRKMAX][6]; |
184 |
|
|
float axv_nt[NTRKMAX][6]; |
185 |
|
|
float ayv_nt[NTRKMAX][6]; |
186 |
|
|
float dedx_x[NTRKMAX][6]; |
187 |
|
|
float dedx_y[NTRKMAX][6]; |
188 |
pam-fi |
1.8 |
int cltrx[NTRKMAX][6]; |
189 |
|
|
int cltry[NTRKMAX][6]; |
190 |
pam-fi |
1.27 |
int multmaxx[NTRKMAX][6]; |
191 |
|
|
int multmaxy[NTRKMAX][6]; |
192 |
|
|
float seedx[NTRKMAX][6]; |
193 |
|
|
float seedy[NTRKMAX][6]; |
194 |
|
|
float xpu[NTRKMAX][6]; |
195 |
|
|
float ypu[NTRKMAX][6]; |
196 |
pam-fi |
1.5 |
// float bdl[NTRKMAX]; |
197 |
pam-fi |
1.3 |
|
198 |
pam-fi |
1.19 |
void InitcTrkLevel2(){ |
199 |
|
|
|
200 |
pam-fi |
1.6 |
// good2 = 0; |
201 |
pam-fi |
1.19 |
for(Int_t i=0; i<12 ; i++){ |
202 |
|
|
good[i] = 0; |
203 |
|
|
for(Int_t ii=0; ii<24 ; ii++)vkflag[ii][i]=0; |
204 |
|
|
} |
205 |
|
|
// ---------------------------- |
206 |
|
|
nclsx = 0; |
207 |
|
|
nclsy = 0; |
208 |
|
|
for(Int_t i=0; i<NSINGMAX ; i++){ |
209 |
|
|
planex[i] = 0; |
210 |
|
|
xs[i][0] = 0; |
211 |
|
|
xs[i][1] = 0; |
212 |
|
|
signlxs[i] = 0; |
213 |
pam-fi |
1.31 |
clsx[i] = 0; |
214 |
|
|
sxbad[i] = 0; |
215 |
pam-fi |
1.19 |
planey[i] = 0; |
216 |
|
|
ys[i][0] = 0; |
217 |
|
|
ys[i][1] = 0; |
218 |
|
|
signlys[i] = 0; |
219 |
pam-fi |
1.31 |
clsy[i] = 0; |
220 |
|
|
sybad[i] = 0; |
221 |
pam-fi |
1.19 |
} |
222 |
|
|
// ---------------------------- |
223 |
|
|
ntrk =0 ; |
224 |
|
|
|
225 |
|
|
for(Int_t i=0; i<NTRKMAX ; i++){ |
226 |
|
|
image[i] = 0; |
227 |
|
|
chi2_nt[i] = 0; |
228 |
|
|
// bdl[i] = 0; |
229 |
|
|
|
230 |
|
|
for(Int_t ii=0; ii<5 ; ii++){ |
231 |
|
|
al_nt[i][ii] = 0; |
232 |
|
|
for(Int_t iii=0; iii<5 ; iii++) |
233 |
|
|
coval[i][ii][iii] = 0; |
234 |
|
|
} |
235 |
|
|
|
236 |
|
|
for(Int_t ii=0; ii<6 ; ii++){ |
237 |
|
|
xm_nt[i][ii] = 0; |
238 |
|
|
ym_nt[i][ii] = 0; |
239 |
|
|
zm_nt[i][ii] = 0; |
240 |
|
|
resx_nt[i][ii] = 0; |
241 |
|
|
resy_nt[i][ii] = 0; |
242 |
|
|
xgood_nt[i][ii] = 0; |
243 |
|
|
ygood_nt[i][ii] = 0; |
244 |
|
|
xv_nt[i][ii] = 0; |
245 |
|
|
yv_nt[i][ii] = 0; |
246 |
|
|
zv_nt[i][ii] = 0; |
247 |
|
|
axv_nt[i][ii] = 0; |
248 |
|
|
ayv_nt[i][ii] = 0; |
249 |
|
|
dedx_x[i][ii] = 0; |
250 |
|
|
dedx_y[i][ii] = 0; |
251 |
pam-fi |
1.27 |
multmaxx[i][ii] = 0; |
252 |
|
|
multmaxy[i][ii] = 0; |
253 |
|
|
seedx[i][ii] = 0; |
254 |
|
|
seedy[i][ii] = 0; |
255 |
|
|
xpu[i][ii] = 0; |
256 |
|
|
ypu[i][ii] = 0; |
257 |
pam-fi |
1.19 |
} |
258 |
|
|
} |
259 |
pam-fi |
1.3 |
} |
260 |
|
|
|
261 |
mocchiut |
1.1 |
}; |
262 |
|
|
// ================================================================== |
263 |
|
|
/** |
264 |
|
|
* \brief Struct to pass calibration/parameter file paths to F77 routines |
265 |
|
|
*/ |
266 |
|
|
struct cPath { |
267 |
pam-fi |
1.8 |
char path[256]; |
268 |
mocchiut |
1.1 |
int pathlen; |
269 |
pam-fi |
1.2 |
int error; |
270 |
mocchiut |
1.1 |
/** |
271 |
|
|
* Fill the struct variables from a TString object |
272 |
|
|
*/ |
273 |
|
|
void FillWith(TString s){ |
274 |
pam-fi |
1.2 |
pathlen = s.Length(); |
275 |
|
|
const char *pc = s.Data(); |
276 |
|
|
for(Int_t i=0; i<=pathlen; i++) path[i] = *pc++; |
277 |
mocchiut |
1.1 |
}; |
278 |
pam-fi |
1.11 |
|
279 |
mocchiut |
1.1 |
}; |
280 |
|
|
|
281 |
|
|
// ================================================================== |
282 |
pam-fi |
1.11 |
/* /\** */ |
283 |
|
|
/* * \brief Struct to pass magnetic-field file paths to F77 routines */ |
284 |
|
|
/* *\/ */ |
285 |
|
|
/* struct cBPath { */ |
286 |
|
|
/* char b_path[256]; */ |
287 |
|
|
/* int b_pathlen; */ |
288 |
|
|
/* int b_error; */ |
289 |
|
|
/* int b_loaded; */ |
290 |
|
|
/* /\** */ |
291 |
|
|
/* * Fill the struct variables from a TString object and set */ |
292 |
|
|
/* * the load flag to FALSE. */ |
293 |
|
|
/* *\/ */ |
294 |
|
|
/* void FillWith(TString s){ */ |
295 |
|
|
/* b_loaded = 0; */ |
296 |
|
|
/* b_pathlen = s.Length(); */ |
297 |
|
|
/* const char *pc = s.Data(); */ |
298 |
|
|
/* for(Int_t i=0; i<=b_pathlen; i++) b_path[i] = *pc++; */ |
299 |
|
|
/* }; */ |
300 |
|
|
/* /\** */ |
301 |
|
|
/* * Fill the struct variables from a TString object */ |
302 |
|
|
/* *\/ */ |
303 |
|
|
/* int BIsLoaded(){ return b_loaded; }; */ |
304 |
mocchiut |
1.1 |
|
305 |
pam-fi |
1.11 |
/* }; */ |
306 |
mocchiut |
1.1 |
|
307 |
pam-fi |
1.2 |
// ================================================================== |
308 |
|
|
/** |
309 |
|
|
* \brief Struct to set debug mode in F77 routines |
310 |
|
|
*/ |
311 |
|
|
struct cDbg { |
312 |
|
|
int debug; |
313 |
|
|
int verbose; |
314 |
|
|
int warning; |
315 |
|
|
// bool debug; |
316 |
|
|
// bool verbose; |
317 |
|
|
void SetNone() {debug=0; verbose=0; warning=0;}; |
318 |
|
|
void SetWarning(){debug=0; verbose=0; warning=1;}; |
319 |
|
|
void SetVerbose(){debug=0; verbose=1; warning=1;}; |
320 |
|
|
void SetDebug() {debug=1; verbose=1; warning=1;}; |
321 |
|
|
}; |
322 |
|
|
|
323 |
pam-fi |
1.8 |
|
324 |
|
|
// ================================================================== |
325 |
|
|
/** |
326 |
|
|
* \brief Struct to pass mini2 track parameters to F77 routines |
327 |
|
|
*/ |
328 |
|
|
struct cMini2track { |
329 |
|
|
double al[5]; |
330 |
|
|
double xm[NPLANE],ym[NPLANE],zm[NPLANE]; |
331 |
pam-fi |
1.32 |
double xm_a[NPLANE],ym_a[NPLANE],zm_a[NPLANE]; |
332 |
|
|
double xm_b[NPLANE],ym_b[NPLANE],zm_b[NPLANE]; |
333 |
pam-fi |
1.8 |
double resx[NPLANE],resy[NPLANE]; |
334 |
pam-fi |
1.22 |
double tailx[NPLANE],taily[NPLANE]; |
335 |
pam-fi |
1.8 |
double xgood[NPLANE],ygood[NPLANE]; |
336 |
|
|
double dedxtrk_x[NPLANE]; |
337 |
|
|
double dedxtrk_y[NPLANE]; |
338 |
|
|
double zini; |
339 |
|
|
double pfixed; |
340 |
|
|
double chi2; |
341 |
|
|
double xv[NPLANE],yv[NPLANE],zv[NPLANE]; |
342 |
|
|
double axv[NPLANE],ayv[NPLANE]; |
343 |
|
|
double cov[5][5]; |
344 |
pam-fi |
1.18 |
double fact; |
345 |
pam-fi |
1.8 |
int nstep; |
346 |
|
|
int idcand; |
347 |
pam-fi |
1.17 |
int trackmode; |
348 |
pam-fi |
1.18 |
int istepmin; |
349 |
pam-fi |
1.20 |
|
350 |
|
|
/* cMini2track(){ */ |
351 |
|
|
/* // -------------------------- */ |
352 |
|
|
/* // fitting routine parameters */ |
353 |
|
|
/* // -------------------------- */ |
354 |
|
|
/* zini = 23.5; */ |
355 |
|
|
/* trackmode = 0; */ |
356 |
|
|
/* istepmin = 3; */ |
357 |
|
|
/* // -------------------------- */ |
358 |
|
|
/* pfixed = 0.; */ |
359 |
|
|
/* chi2 = 0; */ |
360 |
|
|
/* nstep = 0; */ |
361 |
|
|
/* for(int it1=0;it1<5;it1++){ */ |
362 |
|
|
/* al[it1] = 0; */ |
363 |
|
|
/* for(int it2=0;it2<5;it2++)cov[it1][it2] = 0; */ |
364 |
|
|
/* }; */ |
365 |
|
|
/* for(int ip=0;ip<6;ip++){ */ |
366 |
|
|
/* xgood[ip] = 0; */ |
367 |
|
|
/* ygood[ip] = 0; */ |
368 |
|
|
/* xm[ip] = 0; */ |
369 |
|
|
/* ym[ip] = 0; */ |
370 |
|
|
/* xm_a[ip] = 0; */ |
371 |
|
|
/* ym_a[ip] = 0; */ |
372 |
|
|
/* xm_b[ip] = 0; */ |
373 |
|
|
/* ym_b[ip] = 0; */ |
374 |
|
|
/* zm[ip] = 0; */ |
375 |
|
|
/* resx[ip] = 0; */ |
376 |
|
|
/* resy[ip] = 0; */ |
377 |
|
|
/* xv[ip] = 0; */ |
378 |
|
|
/* yv[ip] = 0; */ |
379 |
|
|
/* zv[ip] = 0; */ |
380 |
|
|
/* axv[ip] = 0; */ |
381 |
|
|
/* ayv[ip] = 0; */ |
382 |
|
|
/* dedxtrk_x[ip] = 0; */ |
383 |
|
|
/* dedxtrk_y[ip] = 0; */ |
384 |
|
|
/* }; */ |
385 |
|
|
|
386 |
|
|
/* } */ |
387 |
|
|
|
388 |
|
|
|
389 |
pam-fi |
1.8 |
}; |
390 |
pam-fi |
1.29 |
|
391 |
|
|
// ================================================================== |
392 |
|
|
/** |
393 |
|
|
* \brief Struct to pass DELTAB parameters to F77 routines |
394 |
|
|
*/ |
395 |
|
|
struct cDeltaB { |
396 |
|
|
double delta0; |
397 |
|
|
double delta1; |
398 |
pam-fi |
1.30 |
double dlt; |
399 |
pam-fi |
1.29 |
}; |
400 |
|
|
|
401 |
pam-fi |
1.8 |
// |
402 |
pam-fi |
1.9 |
/** |
403 |
|
|
* \Struct for the hough transform variables |
404 |
|
|
*/ |
405 |
|
|
|
406 |
|
|
struct cTrkHough { |
407 |
|
|
|
408 |
pam-fi |
1.12 |
int ndblt_nt; |
409 |
|
|
float alfayz1_nt[NDBLT_MAX_NT]; |
410 |
|
|
float alfayz2_nt[NDBLT_MAX_NT]; |
411 |
|
|
int db_cloud_nt[NDBLT_MAX_NT]; |
412 |
|
|
int ntrpt_nt; |
413 |
|
|
float alfaxz1_nt[NTRPT_MAX_NT]; |
414 |
|
|
float alfaxz2_nt[NTRPT_MAX_NT]; |
415 |
|
|
float alfaxz3_nt[NTRPT_MAX_NT]; |
416 |
|
|
int tr_cloud_nt[NTRPT_MAX_NT]; |
417 |
|
|
int nclouds_yz_nt; |
418 |
|
|
float alfayz1_av_nt[NCLOYZ_MAX]; |
419 |
|
|
float alfayz2_av_nt[NCLOYZ_MAX]; |
420 |
|
|
int ptcloud_yz_nt[NCLOYZ_MAX]; |
421 |
|
|
int nclouds_xz_nt; |
422 |
|
|
float alfaxz1_av_nt[NCLOXZ_MAX]; |
423 |
|
|
float alfaxz2_av_nt[NCLOXZ_MAX]; |
424 |
|
|
float alfaxz3_av_nt[NCLOXZ_MAX]; |
425 |
|
|
int ptcloud_xz_nt[NCLOXZ_MAX]; |
426 |
pam-fi |
1.9 |
int nclstr; |
427 |
|
|
float totaltime; |
428 |
|
|
float houghtime; |
429 |
|
|
float fittime; |
430 |
|
|
|
431 |
|
|
|
432 |
|
|
void InitcTrkHough(){ |
433 |
|
|
|
434 |
pam-fi |
1.12 |
ndblt_nt = 0; |
435 |
|
|
ntrpt_nt = 0; |
436 |
|
|
nclouds_yz_nt = 0; |
437 |
|
|
nclouds_xz_nt = 0; |
438 |
pam-fi |
1.9 |
nclstr = 0; |
439 |
|
|
totaltime = 0; |
440 |
|
|
houghtime = 0; |
441 |
|
|
fittime = 0; |
442 |
|
|
for(int i=0;i<NDBLT_MAX_NT ;i++){ |
443 |
pam-fi |
1.12 |
alfayz1_nt[i] = 0; |
444 |
|
|
alfayz2_nt[i] = 0; |
445 |
|
|
db_cloud_nt[i] = 0; |
446 |
pam-fi |
1.9 |
} |
447 |
|
|
for(int i=0;i<NTRPT_MAX_NT ;i++){ |
448 |
pam-fi |
1.12 |
alfaxz1_nt[i] = 0; |
449 |
|
|
alfaxz2_nt[i] = 0; |
450 |
|
|
alfaxz3_nt[i] = 0; |
451 |
|
|
tr_cloud_nt[i] = 0; |
452 |
pam-fi |
1.9 |
} |
453 |
|
|
for(int i=0;i<NCLOYZ_MAX ;i++){ |
454 |
pam-fi |
1.12 |
alfayz1_av_nt[i] = 0; |
455 |
|
|
alfayz2_av_nt[i] = 0; |
456 |
|
|
ptcloud_yz_nt[i] = 0; |
457 |
pam-fi |
1.9 |
} |
458 |
|
|
for(int i=0;i<NCLOXZ_MAX ;i++){ |
459 |
pam-fi |
1.12 |
ptcloud_xz_nt[i] = 0; |
460 |
|
|
alfaxz1_av_nt[i] = 0; |
461 |
|
|
alfaxz2_av_nt[i] = 0; |
462 |
|
|
alfaxz3_av_nt[i] = 0; |
463 |
pam-fi |
1.9 |
} |
464 |
|
|
} |
465 |
|
|
|
466 |
|
|
}; |
467 |
pam-fi |
1.8 |
|
468 |
pam-fi |
1.14 |
/** |
469 |
pam-fi |
1.28 |
* \Struct for track candidates after hough transform |
470 |
|
|
*/ |
471 |
|
|
struct cTrkCandidates { |
472 |
|
|
int ntracks; |
473 |
|
|
float al[NTRACKSMAX][5]; |
474 |
|
|
float xm[NTRACKSMAX][NPLANE]; |
475 |
|
|
float ym[NTRACKSMAX][NPLANE]; |
476 |
|
|
float zm[NTRACKSMAX][NPLANE]; |
477 |
|
|
float resx[NTRACKSMAX][NPLANE]; |
478 |
|
|
float resy[NTRACKSMAX][NPLANE]; |
479 |
|
|
float xv[NTRACKSMAX][NPLANE]; |
480 |
|
|
float yv[NTRACKSMAX][NPLANE]; |
481 |
|
|
float zv[NTRACKSMAX][NPLANE]; |
482 |
|
|
float axv[NTRACKSMAX][NPLANE]; |
483 |
|
|
float ayv[NTRACKSMAX][NPLANE]; |
484 |
|
|
float xgood[NTRACKSMAX][NPLANE]; |
485 |
|
|
float ygood[NTRACKSMAX][NPLANE]; |
486 |
|
|
int cp[NTRACKSMAX][NPLANE]; |
487 |
|
|
int cls[NTRACKSMAX][NPLANE]; |
488 |
|
|
int sensor[NTRACKSMAX][NPLANE]; |
489 |
|
|
int ladder[NTRACKSMAX][NPLANE]; |
490 |
|
|
float bx[NTRACKSMAX][NPLANE]; |
491 |
|
|
float by[NTRACKSMAX][NPLANE]; |
492 |
|
|
float chi2[NTRACKSMAX]; |
493 |
|
|
|
494 |
|
|
void Init(){ |
495 |
|
|
ntracks=0; |
496 |
|
|
for(int i=0; i<NTRACKSMAX; i++){ |
497 |
|
|
for(int ii=0; ii<5; ii++)al[i][ii]=0; |
498 |
|
|
chi2[i]=0; |
499 |
|
|
for(int ip=0; ip<NPLANE; ip++){ |
500 |
|
|
xm[i][ip]=0; |
501 |
|
|
ym[i][ip]=0; |
502 |
|
|
zm[i][ip]=0; |
503 |
|
|
resx[i][ip]=0; |
504 |
|
|
resy[i][ip]=0; |
505 |
|
|
xv[i][ip]=0; |
506 |
|
|
yv[i][ip]=0; |
507 |
|
|
zv[i][ip]=0; |
508 |
|
|
axv[i][ip]=0; |
509 |
|
|
ayv[i][ip]=0; |
510 |
|
|
xgood[i][ip]=0; |
511 |
|
|
ygood[i][ip]=0; |
512 |
|
|
cp[i][ip]=0; |
513 |
|
|
cls[i][ip]=0; |
514 |
|
|
sensor[i][ip]=0; |
515 |
|
|
ladder[i][ip]=0; |
516 |
|
|
bx[i][ip]=0; |
517 |
|
|
by[i][ip]=0; |
518 |
|
|
} |
519 |
|
|
} |
520 |
|
|
|
521 |
|
|
}; |
522 |
|
|
|
523 |
|
|
|
524 |
|
|
}; |
525 |
|
|
|
526 |
|
|
/** |
527 |
pam-fi |
1.14 |
* \brief Struct to pass VA1-mask to F77 routines |
528 |
|
|
*/ |
529 |
|
|
struct cTrkMask { |
530 |
|
|
|
531 |
|
|
int mask_vk[NVK][NVIEW]; |
532 |
|
|
int mask_vk_run[NVK][NVIEW]; |
533 |
|
|
|
534 |
pam-fi |
1.16 |
// void Set(TFile* , Int_t , Int_t ); |
535 |
pam-fi |
1.14 |
|
536 |
pam-fi |
1.23 |
void Reset(){ |
537 |
|
|
for(int ivk=0; ivk<NVK; ivk++){ |
538 |
|
|
for(int iv=0; iv<NVIEW; iv++){ |
539 |
|
|
// mask_vk[ivk][iv]=0; |
540 |
|
|
mask_vk_run[ivk][iv]=0; |
541 |
|
|
} |
542 |
|
|
} |
543 |
|
|
} |
544 |
|
|
|
545 |
pam-fi |
1.24 |
void Dump(){ |
546 |
|
|
} |
547 |
|
|
|
548 |
pam-fi |
1.14 |
}; |
549 |
pam-fi |
1.8 |
|
550 |
pam-fi |
1.15 |
/** |
551 |
|
|
* \brief Struct for pfa parameters |
552 |
|
|
*/ |
553 |
|
|
struct cTrkETA { |
554 |
|
|
|
555 |
|
|
int nangbin; |
556 |
|
|
float angL[NANGMAX],angR[NANGMAX]; |
557 |
|
|
int netaval; |
558 |
|
|
float eta2[NANGMAX][NETAVALMAX]; |
559 |
|
|
float feta2[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; |
560 |
|
|
float eta3[NANGMAX][NETAVALMAX]; |
561 |
|
|
float feta3[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; |
562 |
|
|
float eta4[NANGMAX][NETAVALMAX]; |
563 |
|
|
float feta4[NANGMAX][NLADDER][NVIEW][NETAVALMAX]; |
564 |
pam-fi |
1.25 |
float fcorr[NANGMAX][NLADDER][NVIEW]; |
565 |
pam-fi |
1.26 |
float e234ax[6];//F77: e2fax,e2tax,e3fax,e3tax,e4fax,e4tax |
566 |
|
|
float e234ay[6];//F77: e2fay,e2tay,e3fay,e3tay,e4fay,e4tay |
567 |
pam-fi |
1.15 |
|
568 |
|
|
}; |
569 |
pam-fi |
1.20 |
/** |
570 |
|
|
* \brief Struct to configure data reduction |
571 |
|
|
*/ |
572 |
|
|
struct cTrkSW{ |
573 |
|
|
int pfaid; |
574 |
|
|
}; |
575 |
pam-fi |
1.32 |
/** |
576 |
|
|
* \brief Struct to read alignment parameters |
577 |
|
|
*/ |
578 |
|
|
struct cTrkAlign { |
579 |
|
|
|
580 |
|
|
double omega[NSENSOR][NLADDER][NPLANE]; |
581 |
|
|
double beta[NSENSOR][NLADDER][NPLANE]; |
582 |
|
|
double gamma[NSENSOR][NLADDER][NPLANE]; |
583 |
|
|
double dx[NSENSOR][NLADDER][NPLANE]; |
584 |
|
|
double dy[NSENSOR][NLADDER][NPLANE]; |
585 |
|
|
double dz[NSENSOR][NLADDER][NPLANE]; |
586 |
|
|
|
587 |
|
|
}; |
588 |
pam-fi |
1.15 |
|
589 |
pam-fi |
1.2 |
extern "C" { |
590 |
pam-fi |
1.8 |
|
591 |
pam-fi |
1.9 |
extern struct cTrkCalib pedsigbad_; |
592 |
pam-fi |
1.16 |
extern struct cTrkMask mask_; |
593 |
pam-fi |
1.9 |
extern struct cTrkLevel0 level0event_; |
594 |
|
|
extern struct cTrkLevel1 level1event_; |
595 |
|
|
extern struct cTrkLevel2 level2event_; |
596 |
|
|
extern struct cPath path_; |
597 |
|
|
extern struct cDbg dbg_; |
598 |
pam-fi |
1.12 |
extern struct cTrkHough houghevent_; |
599 |
pam-fi |
1.28 |
extern struct cTrkCandidates trackcandidates_; |
600 |
pam-fi |
1.8 |
extern struct cMini2track track_; |
601 |
pam-fi |
1.15 |
extern struct cTrkETA pfa_; |
602 |
pam-fi |
1.20 |
extern struct cTrkSW sw_; |
603 |
pam-fi |
1.29 |
extern struct cDeltaB deltab_; |
604 |
pam-fi |
1.32 |
extern struct cTrkAlign alignparameters_; |
605 |
pam-fi |
1.7 |
|
606 |
pam-fi |
1.2 |
void fillpedsigfromdefault_(); |
607 |
|
|
int readmipparam_(); |
608 |
|
|
int readchargeparam_(); |
609 |
|
|
int readvkmask_(); |
610 |
|
|
int readalignparam_(); |
611 |
|
|
int readetaparam_(); |
612 |
|
|
void reductionflight_(int*); |
613 |
pam-fi |
1.20 |
int analysisflight_(); |
614 |
pam-fi |
1.16 |
int readb_(); |
615 |
pam-fi |
1.20 |
void gufld_(float*, float*); |
616 |
|
|
void xyzpam_(int*,int*,int*,int*,int*,float*,float*,float*,float*); |
617 |
pam-fi |
1.21 |
float riseta_(int*,float*); |
618 |
pam-fi |
1.29 |
void chisq_(int*, int*); |
619 |
pam-fi |
1.16 |
|
620 |
pam-fi |
1.32 |
}; |
621 |
pam-fi |
1.2 |
|
622 |
mocchiut |
1.1 |
#endif |