9 |
#define NTRKMAX 10 |
#define NTRKMAX 10 |
10 |
#define NSINGMAX 100 |
#define NSINGMAX 100 |
11 |
|
|
12 |
|
#define NCLMAX_VIEW 200 |
13 |
|
#define NCLSTR 19 |
14 |
|
#define NCLMAX (NCLMAX_VIEW*12) |
15 |
|
#define NCLBUFF (NCLMAX*NCLSTR) |
16 |
|
|
17 |
|
#include <CalibTrk1Event.h> |
18 |
|
#include <CalibTrk2Event.h> |
19 |
|
|
20 |
#include <TString.h> |
#include <TString.h> |
21 |
#include <TFile.h> |
#include <TFile.h> |
22 |
|
#include <TTree.h> |
23 |
|
|
24 |
|
#include <fstream> |
25 |
|
#include <iostream> |
26 |
/** |
/** |
27 |
* \brief Struct to pass calibration data to F77 routines |
* \brief Struct to pass calibration parameters to F77 routines |
28 |
*/ |
*/ |
29 |
struct cTrkCalib { |
struct cTrkCalib { |
30 |
|
|
31 |
float pedestal[128][24][12]; |
float pedestal[128][24][12]; |
32 |
float pedestal_t[128][24][12]; |
float pedestal_t[128][24][12]; |
33 |
float sigma[128][24][12]; |
float sigma[128][24][12]; |
34 |
float sigma_t[128][24][12]; |
float sigma_t[128][24][12]; |
35 |
int bad[128][24][12]; |
int bad[128][24][12]; |
36 |
|
|
37 |
void FillFrom(TFile* , Int_t , Int_t ); |
void FillACalibFrom(TFile* , Int_t , Int_t ); |
38 |
|
void FillFCalibFrom(TFile* , Int_t , Int_t ); |
39 |
|
void FillTCalibFrom(TFile* , Int_t , Int_t ); |
40 |
|
void FillTCalibFrom(TString); |
41 |
|
|
42 |
}; |
}; |
43 |
// ================================================================== |
// ================================================================== |
44 |
/** |
/** |
78 |
* \brief Struct to pass tracker LEVEL1 data to F77 routines |
* \brief Struct to pass tracker LEVEL1 data to F77 routines |
79 |
*/ |
*/ |
80 |
struct cTrkLevel1 { |
struct cTrkLevel1 { |
81 |
int good1; |
// int good1; |
82 |
|
int good[12]; |
83 |
int nclstr1; |
int nclstr1; |
84 |
int view[500]; |
int view[NCLMAX]; |
85 |
int ladder[500]; |
int ladder[NCLMAX]; |
86 |
int maxs[500]; |
int maxs[NCLMAX]; |
87 |
int mult[500]; |
int mult[NCLMAX]; |
88 |
float dedx[500]; |
float dedx[NCLMAX]; |
89 |
int indstart[500]; |
int indstart[NCLMAX]; |
90 |
int indmax[500]; |
int indmax[NCLMAX]; |
91 |
int totCLlength; |
int totCLlength; |
92 |
float clsignal[8500]; |
float clsignal[NCLBUFF]; |
93 |
float cnev[24][12]; |
float clsigma[NCLBUFF]; |
94 |
|
int cladc[NCLBUFF]; |
95 |
|
int clbad[NCLBUFF]; |
96 |
|
float cnev[24][12]; |
97 |
|
int cnnev[24][12]; |
98 |
|
int fshower[12]; |
99 |
|
int whichtrack[NCLMAX]; |
100 |
}; |
}; |
101 |
// ================================================================== |
// ================================================================== |
102 |
/** |
/** |
103 |
* \brief Struct to pass tracker LEVEL2 data to F77 routines |
* \brief Struct to pass tracker LEVEL2 data to F77 routines |
104 |
*/ |
*/ |
105 |
struct cTrkLevel2 { |
struct cTrkLevel2 { |
106 |
int good2; |
// int good2; |
107 |
int crc[12]; |
// int crc[12]; |
108 |
|
int good[12]; |
109 |
// ---------------------------- |
// ---------------------------- |
110 |
int nclsx; |
int nclsx; |
111 |
int planex[NSINGMAX]; |
int planex[NSINGMAX]; |
112 |
float xs[NSINGMAX][2]; |
float xs[NSINGMAX][2]; |
113 |
float signlxs[NSINGMAX]; |
float signlxs[NSINGMAX]; |
114 |
|
int clsx[NSINGMAX]; |
115 |
// ---------------------------- |
// ---------------------------- |
116 |
int nclsy; |
int nclsy; |
117 |
int planey[NSINGMAX]; |
int planey[NSINGMAX]; |
118 |
float ys[NSINGMAX][2]; |
float ys[NSINGMAX][2]; |
119 |
float signlys[NSINGMAX]; |
float signlys[NSINGMAX]; |
120 |
|
int clsy[NSINGMAX]; |
121 |
// ---------------------------- |
// ---------------------------- |
122 |
int ntrk; |
int ntrk; |
123 |
int image[NTRKMAX]; |
int image[NTRKMAX]; |
129 |
float al_nt[NTRKMAX][5]; |
float al_nt[NTRKMAX][5]; |
130 |
float coval[NTRKMAX][5][5]; |
float coval[NTRKMAX][5][5]; |
131 |
float chi2_nt[NTRKMAX]; |
float chi2_nt[NTRKMAX]; |
132 |
int xgood_nt[NTRKMAX][6]; |
int nstep_nt[NTRKMAX]; |
133 |
|
int xgood_nt[NTRKMAX][6]; |
134 |
int ygood_nt[NTRKMAX][6]; |
int ygood_nt[NTRKMAX][6]; |
135 |
float xv_nt[NTRKMAX][6]; |
float xv_nt[NTRKMAX][6]; |
136 |
float yv_nt[NTRKMAX][6]; |
float yv_nt[NTRKMAX][6]; |
139 |
float ayv_nt[NTRKMAX][6]; |
float ayv_nt[NTRKMAX][6]; |
140 |
float dedx_x[NTRKMAX][6]; |
float dedx_x[NTRKMAX][6]; |
141 |
float dedx_y[NTRKMAX][6]; |
float dedx_y[NTRKMAX][6]; |
142 |
float bdl[NTRKMAX]; |
int cltrx[NTRKMAX][6]; |
143 |
|
int cltry[NTRKMAX][6]; |
144 |
|
// float bdl[NTRKMAX]; |
145 |
|
|
146 |
|
void InitcTrkLevel2(){ |
147 |
|
|
148 |
|
// good2 = 0; |
149 |
|
for(Int_t i=0; i<12 ; i++) |
150 |
|
// crc[i] = 0; |
151 |
|
good[i] = 0; |
152 |
|
// ---------------------------- |
153 |
|
nclsx = 0; |
154 |
|
nclsy = 0; |
155 |
|
for(Int_t i=0; i<NSINGMAX ; i++){ |
156 |
|
planex[i] = 0; |
157 |
|
xs[i][0] = 0; |
158 |
|
xs[i][1] = 0; |
159 |
|
signlxs[i] = 0; |
160 |
|
planey[i] = 0; |
161 |
|
ys[i][0] = 0; |
162 |
|
ys[i][1] = 0; |
163 |
|
signlys[i] = 0; |
164 |
|
} |
165 |
|
// ---------------------------- |
166 |
|
ntrk =0 ; |
167 |
|
|
168 |
|
for(Int_t i=0; i<NTRKMAX ; i++){ |
169 |
|
image[i] = 0; |
170 |
|
chi2_nt[i] = 0; |
171 |
|
// bdl[i] = 0; |
172 |
|
|
173 |
|
for(Int_t ii=0; ii<5 ; ii++){ |
174 |
|
al_nt[i][ii] = 0; |
175 |
|
for(Int_t iii=0; iii<5 ; iii++) |
176 |
|
coval[i][ii][iii] = 0; |
177 |
|
} |
178 |
|
|
179 |
|
for(Int_t ii=0; ii<6 ; ii++){ |
180 |
|
xm_nt[i][ii] = 0; |
181 |
|
ym_nt[i][ii] = 0; |
182 |
|
zm_nt[i][ii] = 0; |
183 |
|
resx_nt[i][ii] = 0; |
184 |
|
resy_nt[i][ii] = 0; |
185 |
|
xgood_nt[i][ii] = 0; |
186 |
|
ygood_nt[i][ii] = 0; |
187 |
|
xv_nt[i][ii] = 0; |
188 |
|
yv_nt[i][ii] = 0; |
189 |
|
zv_nt[i][ii] = 0; |
190 |
|
axv_nt[i][ii] = 0; |
191 |
|
ayv_nt[i][ii] = 0; |
192 |
|
dedx_x[i][ii] = 0; |
193 |
|
dedx_y[i][ii] = 0; |
194 |
|
} |
195 |
|
} |
196 |
|
} |
197 |
|
|
198 |
}; |
}; |
199 |
// ================================================================== |
// ================================================================== |
200 |
/** |
/** |
203 |
struct cPath { |
struct cPath { |
204 |
char path[80]; |
char path[80]; |
205 |
int pathlen; |
int pathlen; |
206 |
int error; |
int error; |
|
int debug; |
|
207 |
/** |
/** |
208 |
* Fill the struct variables from a TString object |
* Fill the struct variables from a TString object |
209 |
*/ |
*/ |
210 |
void FillWith(TString s){ |
void FillWith(TString s){ |
211 |
pathlen = s.Length(); |
pathlen = s.Length(); |
212 |
const char *pc = s.Data(); |
const char *pc = s.Data(); |
213 |
for(Int_t i=0; i<=pathlen; i++) path[i] = *pc++; |
for(Int_t i=0; i<=pathlen; i++) path[i] = *pc++; |
214 |
}; |
}; |
215 |
|
|
216 |
void SetDebug(){ debug=1;}; |
|
|
|
|
217 |
}; |
}; |
218 |
|
|
219 |
// ================================================================== |
// ================================================================== |
224 |
char b_path[80]; |
char b_path[80]; |
225 |
int b_pathlen; |
int b_pathlen; |
226 |
int b_error; |
int b_error; |
|
int b_debug; |
|
227 |
int b_loaded; |
int b_loaded; |
228 |
/** |
/** |
229 |
* Fill the struct variables from a TString object and set |
* Fill the struct variables from a TString object and set |
239 |
* Fill the struct variables from a TString object |
* Fill the struct variables from a TString object |
240 |
*/ |
*/ |
241 |
int BIsLoaded(){ return b_loaded; }; |
int BIsLoaded(){ return b_loaded; }; |
|
void SetDebug(){ b_debug=1; }; |
|
242 |
|
|
243 |
}; |
}; |
244 |
|
|
245 |
|
// ================================================================== |
246 |
|
/** |
247 |
|
* \brief Struct to set debug mode in F77 routines |
248 |
|
*/ |
249 |
|
struct cDbg { |
250 |
|
int debug; |
251 |
|
int verbose; |
252 |
|
int warning; |
253 |
|
// bool debug; |
254 |
|
// bool verbose; |
255 |
|
void SetNone() {debug=0; verbose=0; warning=0;}; |
256 |
|
void SetWarning(){debug=0; verbose=0; warning=1;}; |
257 |
|
void SetVerbose(){debug=0; verbose=1; warning=1;}; |
258 |
|
void SetDebug() {debug=1; verbose=1; warning=1;}; |
259 |
|
}; |
260 |
|
|
261 |
|
extern "C" { |
262 |
|
extern struct cTrkCalib pedsigbad_; |
263 |
|
extern struct cTrkLevel0 level0event_; |
264 |
|
extern struct cTrkLevel1 level1event_; |
265 |
|
extern struct cTrkLevel2 level2event_; |
266 |
|
extern struct cPath path_; |
267 |
|
extern struct cBPath bpath_; |
268 |
|
extern struct cDbg dbg_; |
269 |
|
|
270 |
|
void fillpedsigfromdefault_(); |
271 |
|
int readmipparam_(); |
272 |
|
int readchargeparam_(); |
273 |
|
int readvkmask_(); |
274 |
|
int readalignparam_(); |
275 |
|
int readetaparam_(); |
276 |
|
void reductionflight_(int*); |
277 |
|
int analysisflight_(); |
278 |
|
} |
279 |
|
|
280 |
|
|
281 |
#endif |
#endif |
282 |
|
|