1 |
#ifndef DIGITIZER_H |
#ifndef DIGITIZER_H |
2 |
#define DIGITIZER_H |
#define DIGITIZER_H |
|
#define nspe 200 |
|
|
#define ntof 200 |
|
|
#define ncat 50 |
|
|
#define ncas 50 |
|
|
#define ncar 100 |
|
|
#define ncal 1000 |
|
|
#define nnd 200 |
|
|
#define nstr 1000 |
|
3 |
|
|
4 |
#include <iostream> |
#include <iostream> |
5 |
#include <fstream> |
#include <fstream> |
16 |
#include "TLeafI.h" |
#include "TLeafI.h" |
17 |
#include "TH1.h" |
#include "TH1.h" |
18 |
#include "TH2.h" |
#include "TH2.h" |
19 |
|
#include "TF1.h" |
20 |
#include "TMath.h" |
#include "TMath.h" |
21 |
#include "TSQLServer.h" |
#include "TSQLServer.h" |
22 |
// |
#include "TGraph.h" |
23 |
|
#include "GLTables.h" |
24 |
|
#include "TSystem.h" |
25 |
|
#include "TRandom.h" |
26 |
|
|
27 |
#include "CRC.h" |
#include "CRC.h" |
28 |
|
#include <CalibCalPedEvent.h> |
29 |
|
#include "CalibTrk1Event.h" |
30 |
|
#include "CalibTrk2Event.h" |
31 |
|
|
32 |
class Digitizer{ |
class Digitizer{ |
33 |
|
|
|
|
|
34 |
protected: |
protected: |
35 |
|
|
36 |
// in and output data members |
// in and output data members |
37 |
|
|
38 |
TTree* fhBookTree; |
TTree* fhBookTree; |
39 |
ofstream fOutputfile; |
ofstream fOutputfile; |
40 |
|
int *nspe; |
41 |
|
int *ntof; |
42 |
|
int *ncat; |
43 |
|
int *ncas; |
44 |
|
int *ncar; |
45 |
|
int *ncal; |
46 |
|
int *nnd; |
47 |
|
int *nstr; |
48 |
|
|
49 |
static const int fPSCUbuffer = 8; |
static const int fPSCUbuffer = 8; |
50 |
static const int fTRIGGERbuffer = 152; //(bytes) |
static const int fTRIGGERbuffer = 152; //(bytes) |
150 |
Float_t Phi; |
Float_t Phi; |
151 |
Float_t P0; |
Float_t P0; |
152 |
Int_t Nthtof; |
Int_t Nthtof; |
153 |
UChar_t Ipltof[ntof]; |
UChar_t *Ipltof; |
154 |
UChar_t Ipaddle[ntof]; |
UChar_t *Ipaddle; |
155 |
UChar_t Ipartof[ntof]; |
// UChar_t *Ipartof;//DPMJET |
156 |
Float_t Xintof[ntof]; |
UShort_t *Ipartof; |
157 |
Float_t Yintof[ntof]; |
Float_t *Xintof; |
158 |
Float_t Zintof[ntof]; |
Float_t *Yintof; |
159 |
Float_t Xouttof[ntof]; |
Float_t *Zintof; |
160 |
Float_t Youttof[ntof]; |
Float_t *Xouttof; |
161 |
Float_t Zouttof[ntof]; |
Float_t *Youttof; |
162 |
Float_t Ereltof[ntof]; |
Float_t *Zouttof; |
163 |
Float_t Timetof[ntof]; |
Float_t *Ereltof; |
164 |
Float_t Pathtof[ntof]; |
Float_t *Timetof; |
165 |
Float_t P0tof[ntof]; |
Float_t *Pathtof; |
166 |
|
Float_t *P0tof; |
167 |
Int_t Nthcat; |
Int_t Nthcat; |
168 |
UChar_t Iparcat[ncat]; |
UChar_t *Iparcat; |
169 |
UChar_t Icat[ncat]; |
UChar_t *Icat; |
170 |
Float_t Xincat[ncat]; |
Float_t *Xincat; |
171 |
Float_t Yincat[ncat]; |
Float_t *Yincat; |
172 |
Float_t Zincat[ncat]; |
Float_t *Zincat; |
173 |
Float_t Xoutcat[ncat]; |
Float_t *Xoutcat; |
174 |
Float_t Youtcat[ncat]; |
Float_t *Youtcat; |
175 |
Float_t Zoutcat[ncat]; |
Float_t *Zoutcat; |
176 |
Float_t Erelcat[ncat]; |
Float_t *Erelcat; |
177 |
Float_t Timecat[ncat]; |
Float_t *Timecat; |
178 |
Float_t Pathcat[ncat]; |
Float_t *Pathcat; |
179 |
Float_t P0cat[ncat]; |
Float_t *P0cat; |
180 |
Int_t Nthcas; |
Int_t Nthcas; |
181 |
UChar_t Iparcas[ncas]; |
UChar_t *Iparcas; |
182 |
UChar_t Icas[ncas]; |
UChar_t *Icas; |
183 |
Float_t Xincas[ncas]; |
Float_t *Xincas; |
184 |
Float_t Yincas[ncas]; |
Float_t *Yincas; |
185 |
Float_t Zincas[ncas]; |
Float_t *Zincas; |
186 |
Float_t Xoutcas[ncas]; |
Float_t *Xoutcas; |
187 |
Float_t Youtcas[ncas]; |
Float_t *Youtcas; |
188 |
Float_t Zoutcas[ncas]; |
Float_t *Zoutcas; |
189 |
Float_t Erelcas[ncas]; |
Float_t *Erelcas; |
190 |
Float_t Timecas[ncas]; |
Float_t *Timecas; |
191 |
Float_t Pathcas[ncas]; |
Float_t *Pathcas; |
192 |
Float_t P0cas[ncas]; |
Float_t *P0cas; |
193 |
Int_t Nthspe; |
Int_t Nthspe; |
194 |
UChar_t Iparspe[nspe]; |
// UChar_t *Iparspe;//DPMJET |
195 |
UChar_t Itrpb[nspe]; |
// UShort_t *Iparspe; |
196 |
UChar_t Itrsl[nspe]; |
UChar_t *Itrpb; |
197 |
UChar_t Itspa[nspe]; |
UChar_t *Itrsl; |
198 |
Float_t Xinspe[nspe]; |
UChar_t *Itspa; |
199 |
Float_t Yinspe[nspe]; |
Float_t *Xinspe; |
200 |
Float_t Zinspe[nspe]; |
Float_t *Yinspe; |
201 |
Float_t Xoutspe[nspe]; |
Float_t *Zinspe; |
202 |
Float_t Youtspe[nspe]; |
Float_t *Xoutspe; |
203 |
Float_t Zoutspe[nspe]; |
Float_t *Youtspe; |
204 |
Float_t Xavspe[nspe]; |
Float_t *Zoutspe; |
205 |
Float_t Yavspe[nspe]; |
Float_t *Xavspe; |
206 |
Float_t Zavspe[nspe]; |
Float_t *Yavspe; |
207 |
Float_t Erelspe[nspe]; |
Float_t *Zavspe; |
208 |
Float_t Pathspe[nspe]; |
Float_t *Erelspe; |
209 |
Float_t P0spe[nspe]; |
Float_t *Pathspe; |
210 |
UChar_t Nxmult[nspe]; |
Float_t *P0spe; |
211 |
UChar_t Nymult[nspe]; |
UChar_t *Nxmult; |
212 |
|
UChar_t *Nymult; |
213 |
Int_t Nstrpx; |
Int_t Nstrpx; |
214 |
UChar_t Npstripx[nstr]; |
UChar_t *Npstripx; |
215 |
UChar_t Ntstripx[nstr]; |
UChar_t *Ntstripx; |
216 |
UShort_t Istripx[nstr]; |
UShort_t *Istripx; |
217 |
//UInt_t Istripx[nstr]; |
Float_t *Qstripx; |
218 |
Float_t Qstripx[nstr]; |
Float_t *Xstripx; |
|
Float_t Xstripx[nstr]; |
|
219 |
Int_t Nstrpy; |
Int_t Nstrpy; |
220 |
UChar_t Npstripy[nstr]; |
UChar_t *Npstripy; |
221 |
UChar_t Ntstripy[nstr]; |
UChar_t *Ntstripy; |
222 |
UShort_t Istripy[nstr]; |
UShort_t *Istripy; |
223 |
//UInt_t Istripy[nstr]; |
Float_t *Qstripy; |
224 |
Float_t Qstripy[nstr]; |
Float_t *Ystripy; |
|
Float_t Ystripy[nstr]; |
|
225 |
Int_t Nthcali; |
Int_t Nthcali; |
226 |
UChar_t Icaplane[4224]; |
UChar_t Icaplane[4224]; |
227 |
UChar_t Icastrip[4224]; |
UChar_t Icastrip[4224]; |
228 |
Int_t Icamod[4224]; |
Int_t Icamod[4224]; |
229 |
Float_t Enestrip[4224]; |
Float_t Enestrip[4224]; |
230 |
Int_t Nthcal; |
Int_t Nthcal; |
231 |
UChar_t Icapl[ncal]; |
UChar_t *Icapl; |
232 |
UChar_t Icasi[ncal]; |
UChar_t *Icasi; |
233 |
UChar_t Icast[ncal]; |
UChar_t *Icast; |
234 |
Float_t Xincal[ncal]; |
Float_t *Xincal; |
235 |
Float_t Yincal[ncal]; |
Float_t *Yincal; |
236 |
Float_t Zincal[ncal]; |
Float_t *Zincal; |
237 |
Float_t Erelcal[ncal]; |
Float_t *Erelcal; |
238 |
Int_t Nthnd; |
Int_t Nthnd; |
239 |
UChar_t Itubend[nnd]; |
UChar_t *Itubend; |
240 |
UChar_t Iparnd[nnd]; |
UChar_t *Iparnd; |
241 |
Float_t Xinnd[nnd]; |
Float_t *Xinnd; |
242 |
Float_t Yinnd[nnd]; |
Float_t *Yinnd; |
243 |
Float_t Zinnd[nnd]; |
Float_t *Zinnd; |
244 |
Float_t Xoutnd[nnd]; |
Float_t *Xoutnd; |
245 |
Float_t Youtnd[nnd]; |
Float_t *Youtnd; |
246 |
Float_t Zoutnd[nnd]; |
Float_t *Zoutnd; |
247 |
Float_t Erelnd[nnd]; |
Float_t *Erelnd; |
248 |
Float_t Timend[nnd]; |
Float_t *Timend; |
249 |
Float_t Pathnd[nnd]; |
Float_t *Pathnd; |
250 |
Float_t P0nd[nnd]; |
Float_t *P0nd; |
251 |
Int_t Nthcard; |
Int_t Nthcard; |
252 |
UChar_t Iparcard[ncar]; |
UChar_t *Iparcard; |
253 |
UChar_t Icard[ncar]; |
UChar_t *Icard; |
254 |
Float_t Xincard[ncar]; |
Float_t *Xincard; |
255 |
Float_t Yincard[ncar]; |
Float_t *Yincard; |
256 |
Float_t Zincard[ncar]; |
Float_t *Zincard; |
257 |
Float_t Xoutcard[ncar]; |
Float_t *Xoutcard; |
258 |
Float_t Youtcard[ncar]; |
Float_t *Youtcard; |
259 |
Float_t Zoutcard[ncar]; |
Float_t *Zoutcard; |
260 |
Float_t Erelcard[ncar]; |
Float_t *Erelcard; |
261 |
Float_t Timecard[ncar]; |
Float_t *Timecard; |
262 |
Float_t Pathcard[ncar]; |
Float_t *Pathcard; |
263 |
Float_t P0card[ncar]; |
Float_t *P0card; |
264 |
|
|
265 |
// List of branches |
// List of branches |
266 |
TBranch *b_Irun; //! |
TBranch *b_Irun; //! |
383 |
TBranch *b_Pathcard; //! |
TBranch *b_Pathcard; //! |
384 |
TBranch *b_P0card; //! |
TBranch *b_P0card; //! |
385 |
// |
// |
386 |
|
TF1 *attenAC; |
387 |
public: |
public: |
388 |
|
|
389 |
Digitizer(TTree *tree, char* &file_raw); // constructor |
Digitizer(TTree*,char*&,int,int,int,int,int,int,int,int); // constructor |
390 |
|
|
391 |
void Close(); |
void Close(); |
392 |
void SetTree(TTree *tree) {fhBookTree = tree;}; |
void SetTree(TTree *tree) {fhBookTree = tree;}; |