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 |
|
|
#define NTRKMAX 10 |
10 |
|
|
#define NSINGMAX 100 |
11 |
|
|
|
12 |
pam-fi |
1.2 |
#include <CalibTrk1Event.h> |
13 |
|
|
#include <CalibTrk2Event.h> |
14 |
|
|
|
15 |
mocchiut |
1.1 |
#include <TString.h> |
16 |
|
|
#include <TFile.h> |
17 |
pam-fi |
1.2 |
#include <TTree.h> |
18 |
mocchiut |
1.1 |
|
19 |
pam-fi |
1.2 |
#include <fstream> |
20 |
|
|
#include <iostream> |
21 |
mocchiut |
1.1 |
/** |
22 |
pam-fi |
1.2 |
* \brief Struct to pass calibration parameters to F77 routines |
23 |
mocchiut |
1.1 |
*/ |
24 |
pam-fi |
1.2 |
struct cTrkCalib { |
25 |
|
|
|
26 |
mocchiut |
1.1 |
float pedestal[128][24][12]; |
27 |
|
|
float pedestal_t[128][24][12]; |
28 |
|
|
float sigma[128][24][12]; |
29 |
|
|
float sigma_t[128][24][12]; |
30 |
|
|
int bad[128][24][12]; |
31 |
pam-fi |
1.2 |
|
32 |
|
|
void FillACalibFrom(TFile* , Int_t , Int_t ); |
33 |
|
|
void FillFCalibFrom(TFile* , Int_t , Int_t ); |
34 |
|
|
void FillTCalibFrom(TFile* , Int_t , Int_t ); |
35 |
|
|
void FillTCalibFrom(TString); |
36 |
|
|
|
37 |
mocchiut |
1.1 |
}; |
38 |
|
|
// ================================================================== |
39 |
|
|
/** |
40 |
|
|
* \brief Struct to pass tracker LEVEL0 data to F77 routines |
41 |
|
|
*/ |
42 |
|
|
struct cTrkLevel0 { |
43 |
|
|
int DAQmode[12]; |
44 |
|
|
int DSPnumber[12]; |
45 |
|
|
int DATAlength[12]; |
46 |
|
|
int eventn[12]; |
47 |
|
|
int nclust[12]; |
48 |
|
|
int cutc[12]; |
49 |
|
|
int cutcl[12]; |
50 |
|
|
int addrcluster[3][12]; |
51 |
|
|
int signcluster[3][12]; |
52 |
|
|
int fc[12]; |
53 |
|
|
int compressiontime[12]; |
54 |
|
|
int fl5[12]; |
55 |
|
|
int fl4[12]; |
56 |
|
|
int fl3[12]; |
57 |
|
|
int fl2[12]; |
58 |
|
|
int fl1[12]; |
59 |
|
|
int fl6[12]; |
60 |
|
|
int checksum[12]; |
61 |
|
|
int TOTDATAlength; |
62 |
|
|
int datatracker[49152]; |
63 |
|
|
int pnum[12]; |
64 |
|
|
int cmdnum[12]; |
65 |
|
|
int bid[12]; |
66 |
|
|
int alarm[12]; |
67 |
|
|
int aswr[12]; |
68 |
|
|
int good0; |
69 |
|
|
int crc[12]; |
70 |
|
|
}; |
71 |
|
|
// ================================================================== |
72 |
|
|
/** |
73 |
|
|
* \brief Struct to pass tracker LEVEL1 data to F77 routines |
74 |
|
|
*/ |
75 |
|
|
struct cTrkLevel1 { |
76 |
|
|
int good1; |
77 |
|
|
int nclstr1; |
78 |
|
|
int view[500]; |
79 |
|
|
int ladder[500]; |
80 |
|
|
int maxs[500]; |
81 |
|
|
int mult[500]; |
82 |
|
|
float dedx[500]; |
83 |
|
|
int indstart[500]; |
84 |
|
|
int indmax[500]; |
85 |
|
|
int totCLlength; |
86 |
|
|
float clsignal[8500]; |
87 |
|
|
float cnev[24][12]; |
88 |
|
|
}; |
89 |
|
|
// ================================================================== |
90 |
|
|
/** |
91 |
|
|
* \brief Struct to pass tracker LEVEL2 data to F77 routines |
92 |
|
|
*/ |
93 |
|
|
struct cTrkLevel2 { |
94 |
|
|
int good2; |
95 |
|
|
int crc[12]; |
96 |
|
|
// ---------------------------- |
97 |
|
|
int nclsx; |
98 |
|
|
int planex[NSINGMAX]; |
99 |
|
|
float xs[NSINGMAX][2]; |
100 |
|
|
float signlxs[NSINGMAX]; |
101 |
|
|
// ---------------------------- |
102 |
|
|
int nclsy; |
103 |
|
|
int planey[NSINGMAX]; |
104 |
|
|
float ys[NSINGMAX][2]; |
105 |
|
|
float signlys[NSINGMAX]; |
106 |
|
|
// ---------------------------- |
107 |
|
|
int ntrk; |
108 |
|
|
int image[NTRKMAX]; |
109 |
|
|
float xm_nt[NTRKMAX][6]; |
110 |
|
|
float ym_nt[NTRKMAX][6]; |
111 |
|
|
float zm_nt[NTRKMAX][6]; |
112 |
|
|
float resx_nt[NTRKMAX][6]; |
113 |
|
|
float resy_nt[NTRKMAX][6]; |
114 |
|
|
float al_nt[NTRKMAX][5]; |
115 |
|
|
float coval[NTRKMAX][5][5]; |
116 |
|
|
float chi2_nt[NTRKMAX]; |
117 |
|
|
int xgood_nt[NTRKMAX][6]; |
118 |
|
|
int ygood_nt[NTRKMAX][6]; |
119 |
|
|
float xv_nt[NTRKMAX][6]; |
120 |
|
|
float yv_nt[NTRKMAX][6]; |
121 |
|
|
float zv_nt[NTRKMAX][6]; |
122 |
|
|
float axv_nt[NTRKMAX][6]; |
123 |
|
|
float ayv_nt[NTRKMAX][6]; |
124 |
|
|
float dedx_x[NTRKMAX][6]; |
125 |
|
|
float dedx_y[NTRKMAX][6]; |
126 |
|
|
float bdl[NTRKMAX]; |
127 |
pam-fi |
1.3 |
|
128 |
|
|
void InitcTrkLevel2(){ |
129 |
|
|
|
130 |
|
|
good2 = 0; |
131 |
|
|
for(Int_t i=0; i<12 ; i++) |
132 |
|
|
crc[i] = 0; |
133 |
|
|
// ---------------------------- |
134 |
|
|
nclsx = 0; |
135 |
|
|
nclsy = 0; |
136 |
|
|
for(Int_t i=0; i<NSINGMAX ; i++){ |
137 |
|
|
planex[i] = 0; |
138 |
|
|
xs[i][0] = 0; |
139 |
|
|
xs[i][1] = 0; |
140 |
|
|
signlxs[i] = 0; |
141 |
|
|
planey[i] = 0; |
142 |
|
|
ys[i][0] = 0; |
143 |
|
|
ys[i][1] = 0; |
144 |
|
|
signlys[i] = 0; |
145 |
|
|
} |
146 |
|
|
// ---------------------------- |
147 |
|
|
ntrk =0 ; |
148 |
|
|
|
149 |
|
|
for(Int_t i=0; i<NTRKMAX ; i++){ |
150 |
|
|
image[i] = 0; |
151 |
|
|
chi2_nt[i] = 0; |
152 |
|
|
bdl[i] = 0; |
153 |
|
|
|
154 |
|
|
for(Int_t ii=0; ii<5 ; ii++){ |
155 |
|
|
al_nt[i][ii] = 0; |
156 |
|
|
for(Int_t iii=0; iii<5 ; iii++) |
157 |
|
|
coval[i][ii][iii] = 0; |
158 |
|
|
} |
159 |
|
|
|
160 |
|
|
for(Int_t ii=0; ii<6 ; ii++){ |
161 |
|
|
xm_nt[i][ii] = 0; |
162 |
|
|
ym_nt[i][ii] = 0; |
163 |
|
|
zm_nt[i][ii] = 0; |
164 |
|
|
resx_nt[i][ii] = 0; |
165 |
|
|
resy_nt[i][ii] = 0; |
166 |
|
|
xgood_nt[i][ii] = 0; |
167 |
|
|
ygood_nt[i][ii] = 0; |
168 |
|
|
xv_nt[i][ii] = 0; |
169 |
|
|
yv_nt[i][ii] = 0; |
170 |
|
|
zv_nt[i][ii] = 0; |
171 |
|
|
axv_nt[i][ii] = 0; |
172 |
|
|
ayv_nt[i][ii] = 0; |
173 |
|
|
dedx_x[i][ii] = 0; |
174 |
|
|
dedx_y[i][ii] = 0; |
175 |
|
|
} |
176 |
|
|
} |
177 |
|
|
} |
178 |
|
|
|
179 |
mocchiut |
1.1 |
}; |
180 |
|
|
// ================================================================== |
181 |
|
|
/** |
182 |
|
|
* \brief Struct to pass calibration/parameter file paths to F77 routines |
183 |
|
|
*/ |
184 |
|
|
struct cPath { |
185 |
|
|
char path[80]; |
186 |
|
|
int pathlen; |
187 |
pam-fi |
1.2 |
int error; |
188 |
mocchiut |
1.1 |
/** |
189 |
|
|
* Fill the struct variables from a TString object |
190 |
|
|
*/ |
191 |
|
|
void FillWith(TString s){ |
192 |
pam-fi |
1.2 |
pathlen = s.Length(); |
193 |
|
|
const char *pc = s.Data(); |
194 |
|
|
for(Int_t i=0; i<=pathlen; i++) path[i] = *pc++; |
195 |
mocchiut |
1.1 |
}; |
196 |
pam-fi |
1.2 |
|
197 |
|
|
|
198 |
mocchiut |
1.1 |
}; |
199 |
|
|
|
200 |
|
|
// ================================================================== |
201 |
|
|
/** |
202 |
|
|
* \brief Struct to pass magnetic-field file paths to F77 routines |
203 |
|
|
*/ |
204 |
|
|
struct cBPath { |
205 |
|
|
char b_path[80]; |
206 |
|
|
int b_pathlen; |
207 |
|
|
int b_error; |
208 |
|
|
int b_loaded; |
209 |
|
|
/** |
210 |
|
|
* Fill the struct variables from a TString object and set |
211 |
|
|
* the load flag to FALSE. |
212 |
|
|
*/ |
213 |
|
|
void FillWith(TString s){ |
214 |
|
|
b_loaded = 0; |
215 |
|
|
b_pathlen = s.Length(); |
216 |
|
|
const char *pc = s.Data(); |
217 |
|
|
for(Int_t i=0; i<=b_pathlen; i++) b_path[i] = *pc++; |
218 |
|
|
}; |
219 |
|
|
/** |
220 |
|
|
* Fill the struct variables from a TString object |
221 |
|
|
*/ |
222 |
|
|
int BIsLoaded(){ return b_loaded; }; |
223 |
|
|
|
224 |
|
|
}; |
225 |
|
|
|
226 |
pam-fi |
1.2 |
// ================================================================== |
227 |
|
|
/** |
228 |
|
|
* \brief Struct to set debug mode in F77 routines |
229 |
|
|
*/ |
230 |
|
|
struct cDbg { |
231 |
|
|
int debug; |
232 |
|
|
int verbose; |
233 |
|
|
int warning; |
234 |
|
|
// bool debug; |
235 |
|
|
// bool verbose; |
236 |
|
|
void SetNone() {debug=0; verbose=0; warning=0;}; |
237 |
|
|
void SetWarning(){debug=0; verbose=0; warning=1;}; |
238 |
|
|
void SetVerbose(){debug=0; verbose=1; warning=1;}; |
239 |
|
|
void SetDebug() {debug=1; verbose=1; warning=1;}; |
240 |
|
|
}; |
241 |
|
|
|
242 |
|
|
extern "C" { |
243 |
|
|
extern struct cTrkCalib pedsigbad_; |
244 |
|
|
extern struct cTrkLevel0 level0event_; |
245 |
|
|
extern struct cTrkLevel1 level1event_; |
246 |
|
|
extern struct cTrkLevel2 level2event_; |
247 |
|
|
extern struct cPath path_; |
248 |
|
|
extern struct cBPath bpath_; |
249 |
|
|
extern struct cDbg dbg_; |
250 |
|
|
void fillpedsigfromdefault_(); |
251 |
|
|
int readmipparam_(); |
252 |
|
|
int readchargeparam_(); |
253 |
|
|
int readvkmask_(); |
254 |
|
|
int readalignparam_(); |
255 |
|
|
int readetaparam_(); |
256 |
|
|
void reductionflight_(int*); |
257 |
|
|
int analysisflight_(); |
258 |
|
|
} |
259 |
|
|
|
260 |
mocchiut |
1.1 |
|
261 |
|
|
#endif |
262 |
|
|
|