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 |
/** |
/** |
80 |
struct cTrkLevel1 { |
struct cTrkLevel1 { |
81 |
int good1; |
int good1; |
82 |
int nclstr1; |
int nclstr1; |
83 |
int view[500]; |
int view[NCLMAX]; |
84 |
int ladder[500]; |
int ladder[NCLMAX]; |
85 |
int maxs[500]; |
int maxs[NCLMAX]; |
86 |
int mult[500]; |
int mult[NCLMAX]; |
87 |
float dedx[500]; |
float dedx[NCLMAX]; |
88 |
int indstart[500]; |
int indstart[NCLMAX]; |
89 |
int indmax[500]; |
int indmax[NCLMAX]; |
90 |
int totCLlength; |
int totCLlength; |
91 |
float clsignal[8500]; |
float clsignal[NCLBUFF]; |
92 |
float cnev[24][12]; |
float clsigma[NCLBUFF]; |
93 |
|
int cladc[NCLBUFF]; |
94 |
|
int clbad[NCLBUFF]; |
95 |
|
float cnev[24][12]; |
96 |
|
int cnnev[24][12]; |
97 |
|
int fshower[12]; |
98 |
|
int whichtrack[NCLMAX]; |
99 |
}; |
}; |
100 |
// ================================================================== |
// ================================================================== |
101 |
/** |
/** |
109 |
int planex[NSINGMAX]; |
int planex[NSINGMAX]; |
110 |
float xs[NSINGMAX][2]; |
float xs[NSINGMAX][2]; |
111 |
float signlxs[NSINGMAX]; |
float signlxs[NSINGMAX]; |
112 |
|
int clsx[NSINGMAX]; |
113 |
// ---------------------------- |
// ---------------------------- |
114 |
int nclsy; |
int nclsy; |
115 |
int planey[NSINGMAX]; |
int planey[NSINGMAX]; |
116 |
float ys[NSINGMAX][2]; |
float ys[NSINGMAX][2]; |
117 |
float signlys[NSINGMAX]; |
float signlys[NSINGMAX]; |
118 |
|
int clsy[NSINGMAX]; |
119 |
// ---------------------------- |
// ---------------------------- |
120 |
int ntrk; |
int ntrk; |
121 |
int image[NTRKMAX]; |
int image[NTRKMAX]; |
136 |
float ayv_nt[NTRKMAX][6]; |
float ayv_nt[NTRKMAX][6]; |
137 |
float dedx_x[NTRKMAX][6]; |
float dedx_x[NTRKMAX][6]; |
138 |
float dedx_y[NTRKMAX][6]; |
float dedx_y[NTRKMAX][6]; |
139 |
float bdl[NTRKMAX]; |
int cltrx[NTRKMAX][6]; |
140 |
|
int cltry[NTRKMAX][6]; |
141 |
|
// float bdl[NTRKMAX]; |
142 |
|
|
143 |
|
void InitcTrkLevel2(){ |
144 |
|
|
145 |
|
good2 = 0; |
146 |
|
for(Int_t i=0; i<12 ; i++) |
147 |
|
crc[i] = 0; |
148 |
|
// ---------------------------- |
149 |
|
nclsx = 0; |
150 |
|
nclsy = 0; |
151 |
|
for(Int_t i=0; i<NSINGMAX ; i++){ |
152 |
|
planex[i] = 0; |
153 |
|
xs[i][0] = 0; |
154 |
|
xs[i][1] = 0; |
155 |
|
signlxs[i] = 0; |
156 |
|
planey[i] = 0; |
157 |
|
ys[i][0] = 0; |
158 |
|
ys[i][1] = 0; |
159 |
|
signlys[i] = 0; |
160 |
|
} |
161 |
|
// ---------------------------- |
162 |
|
ntrk =0 ; |
163 |
|
|
164 |
|
for(Int_t i=0; i<NTRKMAX ; i++){ |
165 |
|
image[i] = 0; |
166 |
|
chi2_nt[i] = 0; |
167 |
|
// bdl[i] = 0; |
168 |
|
|
169 |
|
for(Int_t ii=0; ii<5 ; ii++){ |
170 |
|
al_nt[i][ii] = 0; |
171 |
|
for(Int_t iii=0; iii<5 ; iii++) |
172 |
|
coval[i][ii][iii] = 0; |
173 |
|
} |
174 |
|
|
175 |
|
for(Int_t ii=0; ii<6 ; ii++){ |
176 |
|
xm_nt[i][ii] = 0; |
177 |
|
ym_nt[i][ii] = 0; |
178 |
|
zm_nt[i][ii] = 0; |
179 |
|
resx_nt[i][ii] = 0; |
180 |
|
resy_nt[i][ii] = 0; |
181 |
|
xgood_nt[i][ii] = 0; |
182 |
|
ygood_nt[i][ii] = 0; |
183 |
|
xv_nt[i][ii] = 0; |
184 |
|
yv_nt[i][ii] = 0; |
185 |
|
zv_nt[i][ii] = 0; |
186 |
|
axv_nt[i][ii] = 0; |
187 |
|
ayv_nt[i][ii] = 0; |
188 |
|
dedx_x[i][ii] = 0; |
189 |
|
dedx_y[i][ii] = 0; |
190 |
|
} |
191 |
|
} |
192 |
|
} |
193 |
|
|
194 |
}; |
}; |
195 |
// ================================================================== |
// ================================================================== |
196 |
/** |
/** |
199 |
struct cPath { |
struct cPath { |
200 |
char path[80]; |
char path[80]; |
201 |
int pathlen; |
int pathlen; |
202 |
int error; |
int error; |
|
int debug; |
|
203 |
/** |
/** |
204 |
* Fill the struct variables from a TString object |
* Fill the struct variables from a TString object |
205 |
*/ |
*/ |
206 |
void FillWith(TString s){ |
void FillWith(TString s){ |
207 |
pathlen = s.Length(); |
pathlen = s.Length(); |
208 |
const char *pc = s.Data(); |
const char *pc = s.Data(); |
209 |
for(Int_t i=0; i<=pathlen; i++) path[i] = *pc++; |
for(Int_t i=0; i<=pathlen; i++) path[i] = *pc++; |
210 |
}; |
}; |
211 |
|
|
212 |
void SetDebug(){ debug=1;}; |
|
|
|
|
213 |
}; |
}; |
214 |
|
|
215 |
// ================================================================== |
// ================================================================== |
220 |
char b_path[80]; |
char b_path[80]; |
221 |
int b_pathlen; |
int b_pathlen; |
222 |
int b_error; |
int b_error; |
|
int b_debug; |
|
223 |
int b_loaded; |
int b_loaded; |
224 |
/** |
/** |
225 |
* Fill the struct variables from a TString object and set |
* Fill the struct variables from a TString object and set |
235 |
* Fill the struct variables from a TString object |
* Fill the struct variables from a TString object |
236 |
*/ |
*/ |
237 |
int BIsLoaded(){ return b_loaded; }; |
int BIsLoaded(){ return b_loaded; }; |
|
void SetDebug(){ b_debug=1; }; |
|
238 |
|
|
239 |
}; |
}; |
240 |
|
|
241 |
|
// ================================================================== |
242 |
|
/** |
243 |
|
* \brief Struct to set debug mode in F77 routines |
244 |
|
*/ |
245 |
|
struct cDbg { |
246 |
|
int debug; |
247 |
|
int verbose; |
248 |
|
int warning; |
249 |
|
// bool debug; |
250 |
|
// bool verbose; |
251 |
|
void SetNone() {debug=0; verbose=0; warning=0;}; |
252 |
|
void SetWarning(){debug=0; verbose=0; warning=1;}; |
253 |
|
void SetVerbose(){debug=0; verbose=1; warning=1;}; |
254 |
|
void SetDebug() {debug=1; verbose=1; warning=1;}; |
255 |
|
}; |
256 |
|
|
257 |
|
extern "C" { |
258 |
|
extern struct cTrkCalib pedsigbad_; |
259 |
|
extern struct cTrkLevel0 level0event_; |
260 |
|
extern struct cTrkLevel1 level1event_; |
261 |
|
extern struct cTrkLevel2 level2event_; |
262 |
|
extern struct cPath path_; |
263 |
|
extern struct cBPath bpath_; |
264 |
|
extern struct cDbg dbg_; |
265 |
|
void fillpedsigfromdefault_(); |
266 |
|
int readmipparam_(); |
267 |
|
int readchargeparam_(); |
268 |
|
int readvkmask_(); |
269 |
|
int readalignparam_(); |
270 |
|
int readetaparam_(); |
271 |
|
void reductionflight_(int*); |
272 |
|
int analysisflight_(); |
273 |
|
} |
274 |
|
|
275 |
|
|
276 |
#endif |
#endif |
277 |
|
|