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 |
#include <CalibTrk1Event.h> |
13 |
#include <CalibTrk2Event.h> |
14 |
|
15 |
#include <TString.h> |
16 |
#include <TFile.h> |
17 |
#include <TTree.h> |
18 |
|
19 |
#include <fstream> |
20 |
#include <iostream> |
21 |
/** |
22 |
* \brief Struct to pass calibration parameters to F77 routines |
23 |
*/ |
24 |
struct cTrkCalib { |
25 |
|
26 |
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 |
|
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 |
}; |
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 |
}; |
128 |
// ================================================================== |
129 |
/** |
130 |
* \brief Struct to pass calibration/parameter file paths to F77 routines |
131 |
*/ |
132 |
struct cPath { |
133 |
char path[80]; |
134 |
int pathlen; |
135 |
int error; |
136 |
/** |
137 |
* Fill the struct variables from a TString object |
138 |
*/ |
139 |
void FillWith(TString s){ |
140 |
pathlen = s.Length(); |
141 |
const char *pc = s.Data(); |
142 |
for(Int_t i=0; i<=pathlen; i++) path[i] = *pc++; |
143 |
}; |
144 |
|
145 |
|
146 |
}; |
147 |
|
148 |
// ================================================================== |
149 |
/** |
150 |
* \brief Struct to pass magnetic-field file paths to F77 routines |
151 |
*/ |
152 |
struct cBPath { |
153 |
char b_path[80]; |
154 |
int b_pathlen; |
155 |
int b_error; |
156 |
int b_loaded; |
157 |
/** |
158 |
* Fill the struct variables from a TString object and set |
159 |
* the load flag to FALSE. |
160 |
*/ |
161 |
void FillWith(TString s){ |
162 |
b_loaded = 0; |
163 |
b_pathlen = s.Length(); |
164 |
const char *pc = s.Data(); |
165 |
for(Int_t i=0; i<=b_pathlen; i++) b_path[i] = *pc++; |
166 |
}; |
167 |
/** |
168 |
* Fill the struct variables from a TString object |
169 |
*/ |
170 |
int BIsLoaded(){ return b_loaded; }; |
171 |
|
172 |
}; |
173 |
|
174 |
// ================================================================== |
175 |
/** |
176 |
* \brief Struct to set debug mode in F77 routines |
177 |
*/ |
178 |
struct cDbg { |
179 |
int debug; |
180 |
int verbose; |
181 |
int warning; |
182 |
// bool debug; |
183 |
// bool verbose; |
184 |
void SetNone() {debug=0; verbose=0; warning=0;}; |
185 |
void SetWarning(){debug=0; verbose=0; warning=1;}; |
186 |
void SetVerbose(){debug=0; verbose=1; warning=1;}; |
187 |
void SetDebug() {debug=1; verbose=1; warning=1;}; |
188 |
}; |
189 |
|
190 |
extern "C" { |
191 |
extern struct cTrkCalib pedsigbad_; |
192 |
extern struct cTrkLevel0 level0event_; |
193 |
extern struct cTrkLevel1 level1event_; |
194 |
extern struct cTrkLevel2 level2event_; |
195 |
extern struct cPath path_; |
196 |
extern struct cBPath bpath_; |
197 |
extern struct cDbg dbg_; |
198 |
void fillpedsigfromdefault_(); |
199 |
int readmipparam_(); |
200 |
int readchargeparam_(); |
201 |
int readvkmask_(); |
202 |
int readalignparam_(); |
203 |
int readetaparam_(); |
204 |
void reductionflight_(int*); |
205 |
int analysisflight_(); |
206 |
} |
207 |
|
208 |
|
209 |
#endif |
210 |
|