1 |
#ifndef DIGITIZER_H |
#ifndef DIGITIZER_H |
2 |
#define DIGITIZER_H |
#define DIGITIZER_H |
3 |
#include <iostream> |
|
4 |
#include <fstream> |
#include <iostream> |
5 |
|
#include <fstream> |
6 |
|
|
7 |
#include <stdlib.h> |
|
8 |
#include <string.h> |
#include <stdlib.h> |
9 |
#include <ctype.h> |
#include <string.h> |
10 |
|
#include <ctype.h> |
11 |
#include "Riostream.h" |
|
12 |
#include "TFile.h" |
#include "Riostream.h" |
13 |
#include "TDirectory.h" |
#include "TFile.h" |
14 |
#include "TTree.h" |
#include "TDirectory.h" |
15 |
#include "TLeafI.h" |
#include "TTree.h" |
16 |
#include "TH1.h" |
#include "TLeafI.h" |
17 |
#include "TH2.h" |
#include "TH1.h" |
18 |
#include "TMath.h" |
#include "TH2.h" |
19 |
#include "TSQLServer.h" |
#include "TF1.h" |
20 |
// |
#include "TMath.h" |
21 |
#include "CRC.h" |
#include "TSQLServer.h" |
22 |
|
#include "TGraph.h" |
23 |
class Digitizer{ |
#include "GLTables.h" |
24 |
|
#include "TSystem.h" |
25 |
|
#include "TRandom.h" |
26 |
protected: |
|
27 |
|
#include "CRC.h" |
28 |
// in and output data members |
#include <CalibCalPedEvent.h> |
29 |
|
#include "CalibTrk1Event.h" |
30 |
TTree* fhBookTree; |
#include "CalibTrk2Event.h" |
31 |
ofstream fOutputfile; |
|
32 |
|
class Digitizer{ |
33 |
|
|
34 |
static const int fPSCUbuffer = 8; |
protected: |
35 |
static const int fTRIGGERbuffer = 153; //(bytes) |
|
36 |
static const int fTOFbuffer = 276; //(bytes) |
// in and output data members |
37 |
static const int fACbuffer = 128; |
|
38 |
static const int fNDbuffer = 6; |
TTree* fhBookTree; |
39 |
static const int fS4buffer = 3; |
ofstream fOutputfile; |
40 |
static const int fPADbuffer = 64; // changed from 32! |
int *nspe; |
41 |
static const int fCALObuffer = 10000; |
int *ntof; |
42 |
static const float fCALOGeV2MIPratio = 0.0001059994; |
int *ncat; |
43 |
|
int *ncas; |
44 |
static const int fDummybuffer = 64; |
int *ncar; |
45 |
|
int *ncal; |
46 |
// dimensions of vectors and buffer, parameter for tracker |
int *nnd; |
47 |
static const int fTRACKbuffer = 50000; // to be optimized |
int *nstr; |
48 |
static const int fNviews = 12; |
|
49 |
static const int fNstrips_view = 3072; |
static const int fPSCUbuffer = 8; |
50 |
static const int fNladder=3; |
static const int fTRIGGERbuffer = 152; //(bytes) |
51 |
static const int fNstrips_ladder = 1024; |
static const int fTOFbuffer = 276; //(bytes) |
52 |
static const int fCutzop= 4; |
static const int fRunHeaderbuffer = 37; // 37 not 27 |
53 |
static const int fCutclu= 7; |
static const int fRunTrailerbuffer = 25; // 25 not 17 |
54 |
static const int fNclst = 2; |
static const int fACbuffer = 128; |
55 |
|
static const int fNDbuffer = 6; |
56 |
|
static const int fS4buffer = 3; |
57 |
static const float fAvePedex = 1200.; // to be adjusted |
static const int fPADbuffer = 64; // changed from 32! |
58 |
static const float fSigmaPedex = 1.; // to be adjusted |
static const int fCALObuffer = 10000; |
59 |
static const float fAveSigmax = 4.3; // to be adjusted |
static const float fCALOGeV2MIPratio = 0.0001059994; |
60 |
static const float fSigmaSigmax =0.1; // to be adjusted |
|
61 |
static const float fAvePedey = 2800.; // to be adjusted |
static const int fDummybuffer = 64; |
62 |
static const float fSigmaPedey = 1.; // to be adjusted |
|
63 |
static const float fAveSigmay = 8.; // to be adjusted |
// dimensions of vectors and buffer, parameter for tracker |
64 |
static const float fSigmaSigmay =0.1; // to be adjusted |
static const int fTRACKbuffer = 50000; // to be optimized |
65 |
static const float fSigmaCommon = 25.; // to be adjusted |
static const int fNviews = 12; |
66 |
|
static const int fNstrips_view = 3072; |
67 |
|
static const int fNladder=3; |
68 |
// end dimensions of vectors and buffer, parameter for tracker |
static const int fNstrips_ladder = 1024; |
69 |
|
static const int fCutzop= 4; |
70 |
UShort_t fDataPSCU[fPSCUbuffer]; |
static const int fCutclu= 7; |
71 |
UInt_t fCounter; |
static const int fNclst = 2; |
72 |
UInt_t fOBT; |
|
73 |
|
|
74 |
UShort_t fDataPadding[fPADbuffer]; |
static const float fAvePedex = 1200.; // to be adjusted |
75 |
UInt_t fPadding; |
static const float fSigmaPedex = 1.; // to be adjusted |
76 |
|
static const float fAveSigmax = 4.3; // to be adjusted |
77 |
UChar_t fDataTrigger[fTRIGGERbuffer]; |
static const float fSigmaSigmax =0.1; // to be adjusted |
78 |
|
static const float fAvePedey = 2800.; // to be adjusted |
79 |
UChar_t fDataTof[fTOFbuffer]; |
static const float fSigmaPedey = 1.; // to be adjusted |
80 |
|
static const float fAveSigmay = 8.; // to be adjusted |
81 |
UShort_t fDataAC[fACbuffer]; |
static const float fSigmaSigmay =0.1; // to be adjusted |
82 |
UShort_t fDataND[fNDbuffer]; |
static const float fSigmaCommon = 25.; // to be adjusted |
83 |
UShort_t fDataS4[fS4buffer]; |
|
84 |
UShort_t fDataDummy[fDummybuffer]; |
|
85 |
|
// end dimensions of vectors and buffer, parameter for tracker |
86 |
UShort_t fDataCALO[fCALObuffer]; |
|
87 |
UShort_t fSecCalo[4]; |
UShort_t fDataPSCU[fPSCUbuffer]; |
88 |
UShort_t fSecCALOLength[4]; |
UInt_t fCounter; |
89 |
UShort_t fCALOlength; |
UInt_t fCounterPhys; |
90 |
UShort_t fModCalo; |
UInt_t fOBT; |
91 |
Float_t fCalomip[2][22][96]; // ADC to MIP conversion values |
|
92 |
Float_t fcalped[4][11][96]; // pedestals |
UShort_t fDataPadding[fPADbuffer]; |
93 |
Float_t fcalgood[4][11][96]; // used or not in the common noise calculation |
UInt_t fPadding; |
94 |
Float_t fcalthr[4][11][6]; // thresholds |
|
95 |
Float_t fcalrms[4][11][96]; // rms |
UShort_t fDataRunHeader[fRunHeaderbuffer]; |
96 |
Float_t fcalbase[4][11][6]; // baselines (common noise) during calibration |
UShort_t fDataRunTrailer[fRunTrailerbuffer]; |
97 |
Float_t fcalvar[4][11][6]; // variance |
|
98 |
Float_t fcstwerr[4]; // status word |
UChar_t fDataTrigger[fTRIGGERbuffer]; |
99 |
Float_t fcperror[4]; // unpacking error flag |
UChar_t fDataTof[fTOFbuffer]; |
100 |
UInt_t fGivenCaloCalib; |
|
101 |
|
UShort_t fDataAC[fACbuffer]; |
102 |
char* fFilename; |
UShort_t fDataND[fNDbuffer]; |
103 |
UInt_t fLen; |
UShort_t fDataS4[fS4buffer]; |
104 |
|
UShort_t fDataDummy[fDummybuffer]; |
105 |
|
|
106 |
// vectors, buffer, and variables for tracker |
UShort_t fDataCALO[fCALObuffer]; |
107 |
UShort_t fDataTrack[fTRACKbuffer]; |
UShort_t fSecCalo[4]; |
108 |
UInt_t fTracklength; // Actual length of buffer |
UShort_t fSecCALOLength[4]; |
109 |
Float_t fPedeTrack[fNviews][fNstrips_view]; |
UShort_t fCALOlength; |
110 |
Float_t fSigmaTrack[fNviews][fNstrips_view]; |
UShort_t fModCalo; |
111 |
Float_t fMipCor[fNladder][fNviews] ; |
Float_t fCalomip[2][22][96]; // ADC to MIP conversion values |
112 |
// end vectors, buffer, and variables for tracker |
Float_t fcalped[4][11][96]; // pedestals |
113 |
|
Float_t fcalgood[4][11][96]; // used or not in the common noise calculation |
114 |
|
Float_t fcalthr[4][11][6]; // thresholds |
115 |
|
Float_t fcalrms[4][11][96]; // rms |
116 |
// |
Float_t fcalbase[4][11][6]; // baselines (common noise) during calibration |
117 |
// db variables |
Float_t fcalvar[4][11][6]; // variance |
118 |
// |
Float_t fcstwerr[4]; // status word |
119 |
TSQLServer *fDbc; |
Float_t fcperror[4]; // unpacking error flag |
120 |
// Declaration of leave types |
UInt_t fGivenCaloCalib; |
121 |
Int_t Irun; |
|
122 |
Int_t Ievnt; |
char* fFilename; |
123 |
Int_t Ipa; |
UInt_t fLen; |
124 |
Float_t X0; |
|
125 |
Float_t Y0; |
|
126 |
Float_t Z0; |
|
127 |
Float_t Theta; |
// vectors, buffer, and variables for tracker |
128 |
Float_t Phi; |
UShort_t fDataTrack[fTRACKbuffer]; |
129 |
Float_t P0; |
UInt_t fTracklength; // Actual length of buffer |
130 |
Int_t Nthtof; |
Float_t fPedeTrack[fNviews][fNstrips_view]; |
131 |
UChar_t Ipltof[100]; //[Nthtof] |
Float_t fSigmaTrack[fNviews][fNstrips_view]; |
132 |
UChar_t Ipaddle[100]; //[Nthtof] |
// UShort_t fBadTrack[fNviews][fNstrips_view]; |
133 |
UChar_t Ipartof[100]; //[Nthtof] |
Float_t fMipCor[fNladder][fNviews] ; |
134 |
Float_t Xintof[100]; //[Nthtof] |
// end vectors, buffer, and variables for tracker |
135 |
Float_t Yintof[100]; //[Nthtof] |
|
136 |
Float_t Zintof[100]; //[Nthtof] |
|
137 |
Float_t Xouttof[100]; //[Nthtof] |
|
138 |
Float_t Youttof[100]; //[Nthtof] |
// |
139 |
Float_t Zouttof[100]; //[Nthtof] |
// db variables |
140 |
Float_t Ereltof[100]; //[Nthtof] |
// |
141 |
Float_t Timetof[100]; //[Nthtof] |
TSQLServer *fDbc; |
142 |
Float_t Pathtof[100]; //[Nthtof] |
// Declaration of leave types |
143 |
Float_t P0tof[100]; //[Nthtof] |
Int_t Irun; |
144 |
Int_t Nthcat; |
Int_t Ievnt; |
145 |
UChar_t Iparcat[50]; //[Nthcat] |
Int_t Ipa; |
146 |
UChar_t Icat[50]; //[Nthcat] |
Float_t X0; |
147 |
Float_t Xincat[50]; //[Nthcat] |
Float_t Y0; |
148 |
Float_t Yincat[50]; //[Nthcat] |
Float_t Z0; |
149 |
Float_t Zincat[50]; //[Nthcat] |
Float_t Theta; |
150 |
Float_t Xoutcat[50]; //[Nthcat] |
Float_t Phi; |
151 |
Float_t Youtcat[50]; //[Nthcat] |
Float_t P0; |
152 |
Float_t Zoutcat[50]; //[Nthcat] |
Int_t Nthtof; |
153 |
Float_t Erelcat[50]; //[Nthcat] |
UChar_t *Ipltof; |
154 |
Float_t Timecat[50]; //[Nthcat] |
UChar_t *Ipaddle; |
155 |
Float_t Pathcat[50]; //[Nthcat] |
// UChar_t *Ipartof;//DPMJET |
156 |
Float_t P0cat[50]; //[Nthcat] |
UShort_t *Ipartof; |
157 |
Int_t Nthcas; |
Float_t *Xintof; |
158 |
UChar_t Iparcas[50]; //[Nthcas] |
Float_t *Yintof; |
159 |
UChar_t Icas[50]; //[Nthcas] |
Float_t *Zintof; |
160 |
Float_t Xincas[50]; //[Nthcas] |
Float_t *Xouttof; |
161 |
Float_t Yincas[50]; //[Nthcas] |
Float_t *Youttof; |
162 |
Float_t Zincas[50]; //[Nthcas] |
Float_t *Zouttof; |
163 |
Float_t Xoutcas[50]; //[Nthcas] |
Float_t *Ereltof; |
164 |
Float_t Youtcas[50]; //[Nthcas] |
Float_t *Timetof; |
165 |
Float_t Zoutcas[50]; //[Nthcas] |
Float_t *Pathtof; |
166 |
Float_t Erelcas[50]; //[Nthcas] |
Float_t *P0tof; |
167 |
Float_t Timecas[50]; //[Nthcas] |
Int_t Nthcat; |
168 |
Float_t Pathcas[50]; //[Nthcas] |
UChar_t *Iparcat; |
169 |
Float_t P0cas[50]; //[Nthcas] |
UChar_t *Icat; |
170 |
Int_t Nthspe; |
Float_t *Xincat; |
171 |
UChar_t Iparspe[100]; //[Nthspe] |
Float_t *Yincat; |
172 |
UChar_t Itrpb[100]; //[Nthspe] |
Float_t *Zincat; |
173 |
UChar_t Itrsl[100]; //[Nthspe] |
Float_t *Xoutcat; |
174 |
UChar_t Itspa[100]; //[Nthspe] |
Float_t *Youtcat; |
175 |
Float_t Xinspe[100]; //[Nthspe] |
Float_t *Zoutcat; |
176 |
Float_t Yinspe[100]; //[Nthspe] |
Float_t *Erelcat; |
177 |
Float_t Zinspe[100]; //[Nthspe] |
Float_t *Timecat; |
178 |
Float_t Xoutspe[100]; //[Nthspe] |
Float_t *Pathcat; |
179 |
Float_t Youtspe[100]; //[Nthspe] |
Float_t *P0cat; |
180 |
Float_t Zoutspe[100]; //[Nthspe] |
Int_t Nthcas; |
181 |
Float_t Xavspe[100]; //[Nthspe] |
UChar_t *Iparcas; |
182 |
Float_t Yavspe[100]; //[Nthspe] |
UChar_t *Icas; |
183 |
Float_t Zavspe[100]; //[Nthspe] |
Float_t *Xincas; |
184 |
Float_t Erelspe[100]; //[Nthspe] |
Float_t *Yincas; |
185 |
Float_t Pathspe[100]; //[Nthspe] |
Float_t *Zincas; |
186 |
Float_t P0spe[100]; //[Nthspe] |
Float_t *Xoutcas; |
187 |
UChar_t Nxmult[100]; //[Nthspe] |
Float_t *Youtcas; |
188 |
UChar_t Nymult[100]; //[Nthspe] |
Float_t *Zoutcas; |
189 |
Int_t Nstrpx; |
Float_t *Erelcas; |
190 |
UChar_t Npstripx[1000]; //[Nstrpx] |
Float_t *Timecas; |
191 |
UChar_t Ntstripx[1000]; //[Nstrpx] |
Float_t *Pathcas; |
192 |
UShort_t Istripx[1000]; //[Nstrpx] |
Float_t *P0cas; |
193 |
//UInt_t Istripx[1000]; //[Nstrpx] |
Int_t Nthspe; |
194 |
Float_t Qstripx[1000]; //[Nstrpx] |
// UChar_t *Iparspe;//DPMJET |
195 |
Float_t Xstripx[1000]; //[Nstrpx] |
// UShort_t *Iparspe; |
196 |
Int_t Nstrpy; |
UChar_t *Itrpb; |
197 |
UChar_t Npstripy[1000]; //[Nstrpy] |
UChar_t *Itrsl; |
198 |
UChar_t Ntstripy[1000]; //[Nstrpy] |
UChar_t *Itspa; |
199 |
UShort_t Istripy[1000]; //[Nstrpy] |
Float_t *Xinspe; |
200 |
//UInt_t Istripy[1000]; //[Nstrpy] |
Float_t *Yinspe; |
201 |
Float_t Qstripy[1000]; //[Nstrpy] |
Float_t *Zinspe; |
202 |
Float_t Ystripy[1000]; //[Nstrpy] |
Float_t *Xoutspe; |
203 |
Int_t Nthcali; |
Float_t *Youtspe; |
204 |
UChar_t Icaplane[4224]; //[Nthcali] |
Float_t *Zoutspe; |
205 |
UChar_t Icastrip[4224]; //[Nthcali] |
Float_t *Xavspe; |
206 |
Int_t Icamod[4224]; //[Nthcali] |
Float_t *Yavspe; |
207 |
Float_t Enestrip[4224]; //[Nthcali] |
Float_t *Zavspe; |
208 |
Int_t Nthcal; |
Float_t *Erelspe; |
209 |
UChar_t Icapl[1000]; //[Nthcal] |
Float_t *Pathspe; |
210 |
UChar_t Icasi[1000]; //[Nthcal] |
Float_t *P0spe; |
211 |
UChar_t Icast[1000]; //[Nthcal] |
UChar_t *Nxmult; |
212 |
Float_t Xincal[1000]; //[Nthcal] |
UChar_t *Nymult; |
213 |
Float_t Yincal[1000]; //[Nthcal] |
Int_t Nstrpx; |
214 |
Float_t Zincal[1000]; //[Nthcal] |
UChar_t *Npstripx; |
215 |
Float_t Erelcal[1000]; //[Nthcal] |
UChar_t *Ntstripx; |
216 |
Int_t Nthnd; |
UShort_t *Istripx; |
217 |
UChar_t Itubend[200]; //[Nthnd] |
Float_t *Qstripx; |
218 |
UChar_t Iparnd[200]; //[Nthnd] |
Float_t *Xstripx; |
219 |
Float_t Xinnd[200]; //[Nthnd] |
Int_t Nstrpy; |
220 |
Float_t Yinnd[200]; //[Nthnd] |
UChar_t *Npstripy; |
221 |
Float_t Zinnd[200]; //[Nthnd] |
UChar_t *Ntstripy; |
222 |
Float_t Xoutnd[200]; //[Nthnd] |
UShort_t *Istripy; |
223 |
Float_t Youtnd[200]; //[Nthnd] |
Float_t *Qstripy; |
224 |
Float_t Zoutnd[200]; //[Nthnd] |
Float_t *Ystripy; |
225 |
Float_t Erelnd[200]; //[Nthnd] |
Int_t Nthcali; |
226 |
Float_t Timend[200]; //[Nthnd] |
UChar_t Icaplane[4224]; |
227 |
Float_t Pathnd[200]; //[Nthnd] |
UChar_t Icastrip[4224]; |
228 |
Float_t P0nd[200]; //[Nthnd] |
Int_t Icamod[4224]; |
229 |
Int_t Nthcard; |
Float_t Enestrip[4224]; |
230 |
UChar_t Iparcard[100]; //[Nthcard] |
Int_t Nthcal; |
231 |
UChar_t Icard[100]; //[Nthcard] |
UChar_t *Icapl; |
232 |
Float_t Xincard[100]; //[Nthcard] |
UChar_t *Icasi; |
233 |
Float_t Yincard[100]; //[Nthcard] |
UChar_t *Icast; |
234 |
Float_t Zincard[100]; //[Nthcard] |
Float_t *Xincal; |
235 |
Float_t Xoutcard[100]; //[Nthcard] |
Float_t *Yincal; |
236 |
Float_t Youtcard[100]; //[Nthcard] |
Float_t *Zincal; |
237 |
Float_t Zoutcard[100]; //[Nthcard] |
Float_t *Erelcal; |
238 |
Float_t Erelcard[100]; //[Nthcard] |
Int_t Nthnd; |
239 |
Float_t Timecard[100]; //[Nthcard] |
UChar_t *Itubend; |
240 |
Float_t Pathcard[100]; //[Nthcard] |
UChar_t *Iparnd; |
241 |
Float_t P0card[100]; //[Nthcard] |
Float_t *Xinnd; |
242 |
|
Float_t *Yinnd; |
243 |
// List of branches |
Float_t *Zinnd; |
244 |
TBranch *b_Irun; //! |
Float_t *Xoutnd; |
245 |
TBranch *b_Ievnt; //! |
Float_t *Youtnd; |
246 |
TBranch *b_Ipa; //! |
Float_t *Zoutnd; |
247 |
TBranch *b_X0; //! |
Float_t *Erelnd; |
248 |
TBranch *b_Y0; //! |
Float_t *Timend; |
249 |
TBranch *b_Z0; //! |
Float_t *Pathnd; |
250 |
TBranch *b_Theta; //! |
Float_t *P0nd; |
251 |
TBranch *b_Phi; //! |
Int_t Nthcard; |
252 |
TBranch *b_P0; //! |
UChar_t *Iparcard; |
253 |
TBranch *b_Nthtof; //! |
UChar_t *Icard; |
254 |
TBranch *b_Ipltof; //! |
Float_t *Xincard; |
255 |
TBranch *b_Ipaddle; //! |
Float_t *Yincard; |
256 |
TBranch *b_Ipartof; //! |
Float_t *Zincard; |
257 |
TBranch *b_Xintof; //! |
Float_t *Xoutcard; |
258 |
TBranch *b_Yintof; //! |
Float_t *Youtcard; |
259 |
TBranch *b_Zintof; //! |
Float_t *Zoutcard; |
260 |
TBranch *b_Xouttof; //! |
Float_t *Erelcard; |
261 |
TBranch *b_Youttof; //! |
Float_t *Timecard; |
262 |
TBranch *b_Zouttof; //! |
Float_t *Pathcard; |
263 |
TBranch *b_Ereltof; //! |
Float_t *P0card; |
264 |
TBranch *b_Timetof; //! |
|
265 |
TBranch *b_Pathtof; //! |
// List of branches |
266 |
TBranch *b_P0tof; //! |
TBranch *b_Irun; //! |
267 |
TBranch *b_Nthcat; //! |
TBranch *b_Ievnt; //! |
268 |
TBranch *b_Iparcat; //! |
TBranch *b_Ipa; //! |
269 |
TBranch *b_Icat; //! |
TBranch *b_X0; //! |
270 |
TBranch *b_Xincat; //! |
TBranch *b_Y0; //! |
271 |
TBranch *b_Yincat; //! |
TBranch *b_Z0; //! |
272 |
TBranch *b_Zincat; //! |
TBranch *b_Theta; //! |
273 |
TBranch *b_Xoutcat; //! |
TBranch *b_Phi; //! |
274 |
TBranch *b_Youtcat; //! |
TBranch *b_P0; //! |
275 |
TBranch *b_Zoutcat; //! |
TBranch *b_Nthtof; //! |
276 |
TBranch *b_Erelcat; //! |
TBranch *b_Ipltof; //! |
277 |
TBranch *b_Timecat; //! |
TBranch *b_Ipaddle; //! |
278 |
TBranch *b_Pathcat; //! |
TBranch *b_Ipartof; //! |
279 |
TBranch *b_P0cat; //! |
TBranch *b_Xintof; //! |
280 |
TBranch *b_Nthcas; //! |
TBranch *b_Yintof; //! |
281 |
TBranch *b_Iparcas; //! |
TBranch *b_Zintof; //! |
282 |
TBranch *b_Icas; //! |
TBranch *b_Xouttof; //! |
283 |
TBranch *b_Xincas; //! |
TBranch *b_Youttof; //! |
284 |
TBranch *b_Yincas; //! |
TBranch *b_Zouttof; //! |
285 |
TBranch *b_Zincas; //! |
TBranch *b_Ereltof; //! |
286 |
TBranch *b_Xoutcas; //! |
TBranch *b_Timetof; //! |
287 |
TBranch *b_Youtcas; //! |
TBranch *b_Pathtof; //! |
288 |
TBranch *b_Zoutcas; //! |
TBranch *b_P0tof; //! |
289 |
TBranch *b_Erelcas; //! |
TBranch *b_Nthcat; //! |
290 |
TBranch *b_Timecas; //! |
TBranch *b_Iparcat; //! |
291 |
TBranch *b_Pathcas; //! |
TBranch *b_Icat; //! |
292 |
TBranch *b_P0cas; //! |
TBranch *b_Xincat; //! |
293 |
TBranch *b_Nthspe; //! |
TBranch *b_Yincat; //! |
294 |
TBranch *b_Iparspe; //! |
TBranch *b_Zincat; //! |
295 |
TBranch *b_Itrpb; //! |
TBranch *b_Xoutcat; //! |
296 |
TBranch *b_Itrsl; //! |
TBranch *b_Youtcat; //! |
297 |
TBranch *b_Itspa; //! |
TBranch *b_Zoutcat; //! |
298 |
TBranch *b_Xinspe; //! |
TBranch *b_Erelcat; //! |
299 |
TBranch *b_Yinspe; //! |
TBranch *b_Timecat; //! |
300 |
TBranch *b_Zinspe; //! |
TBranch *b_Pathcat; //! |
301 |
TBranch *b_Xoutspe; //! |
TBranch *b_P0cat; //! |
302 |
TBranch *b_Youtspe; //! |
TBranch *b_Nthcas; //! |
303 |
TBranch *b_Zoutspe; //! |
TBranch *b_Iparcas; //! |
304 |
TBranch *b_Xavspe; //! |
TBranch *b_Icas; //! |
305 |
TBranch *b_Yavspe; //! |
TBranch *b_Xincas; //! |
306 |
TBranch *b_Zavspe; //! |
TBranch *b_Yincas; //! |
307 |
TBranch *b_Erelspe; //! |
TBranch *b_Zincas; //! |
308 |
TBranch *b_Pathspe; //! |
TBranch *b_Xoutcas; //! |
309 |
TBranch *b_P0spe; //! |
TBranch *b_Youtcas; //! |
310 |
TBranch *b_Nxmult; //! |
TBranch *b_Zoutcas; //! |
311 |
TBranch *b_Nymult; //! |
TBranch *b_Erelcas; //! |
312 |
TBranch *b_Nstrpx; //! |
TBranch *b_Timecas; //! |
313 |
TBranch *b_Npstripx; //! |
TBranch *b_Pathcas; //! |
314 |
TBranch *b_Ntstripx; //! |
TBranch *b_P0cas; //! |
315 |
TBranch *b_Istripx; //! |
TBranch *b_Nthspe; //! |
316 |
TBranch *b_Qstripx; //! |
TBranch *b_Iparspe; //! |
317 |
TBranch *b_Xstripx; //! |
TBranch *b_Itrpb; //! |
318 |
TBranch *b_Nstrpy; //! |
TBranch *b_Itrsl; //! |
319 |
TBranch *b_Npstripy; //! |
TBranch *b_Itspa; //! |
320 |
TBranch *b_Ntstripy; //! |
TBranch *b_Xinspe; //! |
321 |
TBranch *b_Istripy; //! |
TBranch *b_Yinspe; //! |
322 |
TBranch *b_Qstripy; //! |
TBranch *b_Zinspe; //! |
323 |
TBranch *b_Ystripy; //! |
TBranch *b_Xoutspe; //! |
324 |
TBranch *b_Nthcali; //! |
TBranch *b_Youtspe; //! |
325 |
TBranch *b_Icaplane; //! |
TBranch *b_Zoutspe; //! |
326 |
TBranch *b_Icastrip; //! |
TBranch *b_Xavspe; //! |
327 |
TBranch *b_Icamod; //! |
TBranch *b_Yavspe; //! |
328 |
TBranch *b_Enestrip; //! |
TBranch *b_Zavspe; //! |
329 |
TBranch *b_Nthcal; //! |
TBranch *b_Erelspe; //! |
330 |
TBranch *b_Icapl; //! |
TBranch *b_Pathspe; //! |
331 |
TBranch *b_Icasi; //! |
TBranch *b_P0spe; //! |
332 |
TBranch *b_Icast; //! |
TBranch *b_Nxmult; //! |
333 |
TBranch *b_Xincal; //! |
TBranch *b_Nymult; //! |
334 |
TBranch *b_Yincal; //! |
TBranch *b_Nstrpx; //! |
335 |
TBranch *b_Zincal; //! |
TBranch *b_Npstripx; //! |
336 |
TBranch *b_Erelcal; //! |
TBranch *b_Ntstripx; //! |
337 |
TBranch *b_Nthnd; //! |
TBranch *b_Istripx; //! |
338 |
TBranch *b_Itubend; //! |
TBranch *b_Qstripx; //! |
339 |
TBranch *b_Iparnd; //! |
TBranch *b_Xstripx; //! |
340 |
TBranch *b_Xinnd; //! |
TBranch *b_Nstrpy; //! |
341 |
TBranch *b_Yinnd; //! |
TBranch *b_Npstripy; //! |
342 |
TBranch *b_Zinnd; //! |
TBranch *b_Ntstripy; //! |
343 |
TBranch *b_Xoutnd; //! |
TBranch *b_Istripy; //! |
344 |
TBranch *b_Youtnd; //! |
TBranch *b_Qstripy; //! |
345 |
TBranch *b_Zoutnd; //! |
TBranch *b_Ystripy; //! |
346 |
TBranch *b_Erelnd; //! |
TBranch *b_Nthcali; //! |
347 |
TBranch *b_Timend; //! |
TBranch *b_Icaplane; //! |
348 |
TBranch *b_Pathnd; //! |
TBranch *b_Icastrip; //! |
349 |
TBranch *b_P0nd; //! |
TBranch *b_Icamod; //! |
350 |
TBranch *b_Nthcard; //! |
TBranch *b_Enestrip; //! |
351 |
TBranch *b_Iparcard; //! |
TBranch *b_Nthcal; //! |
352 |
TBranch *b_Icard; //! |
TBranch *b_Icapl; //! |
353 |
TBranch *b_Xincard; //! |
TBranch *b_Icasi; //! |
354 |
TBranch *b_Yincard; //! |
TBranch *b_Icast; //! |
355 |
TBranch *b_Zincard; //! |
TBranch *b_Xincal; //! |
356 |
TBranch *b_Xoutcard; //! |
TBranch *b_Yincal; //! |
357 |
TBranch *b_Youtcard; //! |
TBranch *b_Zincal; //! |
358 |
TBranch *b_Zoutcard; //! |
TBranch *b_Erelcal; //! |
359 |
TBranch *b_Erelcard; //! |
TBranch *b_Nthnd; //! |
360 |
TBranch *b_Timecard; //! |
TBranch *b_Itubend; //! |
361 |
TBranch *b_Pathcard; //! |
TBranch *b_Iparnd; //! |
362 |
TBranch *b_P0card; //! |
TBranch *b_Xinnd; //! |
363 |
// |
TBranch *b_Yinnd; //! |
364 |
|
TBranch *b_Zinnd; //! |
365 |
public: |
TBranch *b_Xoutnd; //! |
366 |
|
TBranch *b_Youtnd; //! |
367 |
Digitizer(TTree *tree, char* &file_raw); // constructor |
TBranch *b_Zoutnd; //! |
368 |
|
TBranch *b_Erelnd; //! |
369 |
void Close(); |
TBranch *b_Timend; //! |
370 |
|
TBranch *b_Pathnd; //! |
371 |
void SetTree(TTree *tree) {fhBookTree = tree;}; |
TBranch *b_P0nd; //! |
372 |
|
TBranch *b_Nthcard; //! |
373 |
|
TBranch *b_Iparcard; //! |
374 |
void Loop(); // does the looping over events |
TBranch *b_Icard; //! |
375 |
|
TBranch *b_Xincard; //! |
376 |
|
TBranch *b_Yincard; //! |
377 |
|
TBranch *b_Zincard; //! |
378 |
void DigitizePSCU(UInt_t, UChar_t); // digitizes the CPU header |
TBranch *b_Xoutcard; //! |
379 |
void AddPadding(); |
TBranch *b_Youtcard; //! |
380 |
void DigitizeTRIGGER(); // digitizes the trigger |
TBranch *b_Zoutcard; //! |
381 |
Int_t DigitizeTOF(); // digitizes the tof |
TBranch *b_Erelcard; //! |
382 |
void DigitizeAC(); // digitizes the anti-counter |
TBranch *b_Timecard; //! |
383 |
void DigitizeND(); // digitizes the ND |
TBranch *b_Pathcard; //! |
384 |
void DigitizeS4(); // digitizes the S4 |
TBranch *b_P0card; //! |
385 |
void DigitizeCALO(); // digitizes the calorimeter |
// |
386 |
void DigitizeCALOCALIB(); // digitizes the calorimeter calibration |
TF1 *attenAC; |
387 |
void DigitizeCALORAW(); // digitizes the calorimeter |
public: |
388 |
void DigitizeCALOCOMPRESS(); // digitizes the calorimeter |
|
389 |
void DigitizeCALOFULL(); // digitizes the calorimeter |
Digitizer(TTree*,char*&,int,int,int,int,int,int,int,int); // constructor |
390 |
|
|
391 |
Float_t GetCALOen(Int_t sec, Int_t plane, Int_t strip); // retrieve calorimeter strip energy from the simulation |
void Close(); |
392 |
void ClearCaloCalib(Int_t s); // clear calorimeter calibration variables for section s |
void SetTree(TTree *tree) {fhBookTree = tree;}; |
393 |
Int_t CaloLoadCalib(Int_t s,TString fcalname, UInt_t calibno); // load calorimeter calibration variables for section s from file fcalname entry calibno |
void Loop(); // does the looping over events |
394 |
void CaloLoadCalib(); |
|
395 |
|
void DigitizePSCU(UInt_t, UChar_t, UShort_t*); // digitizes the CPU header |
396 |
void DigitizeDummy(); // digitizes the dummy detector |
void AddPadding(); |
397 |
|
void DigitizeRunHeader(); |
398 |
// ToF methods: |
void DigitizeRunTrailer(); |
399 |
UChar_t EvaluateCrcTof(UChar_t*); |
// void DigitizeTRIGGER(); // SO nov'07: included in DigitizeTOF |
400 |
void Paddle2Pmt(Int_t, Int_t, Int_t*, Int_t*); |
void DigitizeTOF(int np,float *atte1,float *atte2,float *lambda1,float *lambda2); // digitizes the tof |
401 |
//void Paddle2Pmt(Int_t, Int_t, Int_t &pmtleft, Int_t &pmtright); |
void LoadTOFCalib(int np,float *atte1,float *atte2,float *lambda1,float *lambda2); //load TOF calibration |
402 |
UChar_t Bin2GrayTof(UChar_t, UChar_t); |
void DigitizeAC(); // digitizes the anti-counter |
403 |
void Crc8Tof(UChar_t*, UChar_t*); |
void DigitizeND(); // digitizes the ND |
404 |
|
void DigitizeS4(); // digitizes the S4 |
405 |
UShort_t* GetDataAC(){return(fDataAC);}; // retrieve AC data (not used right now) |
void DigitizeCALO(); // digitizes the calorimeter |
406 |
|
void DigitizeCALOCALIB(); // digitizes the calorimeter calibration |
407 |
UShort_t* GetDataCALO(){return(fDataCALO);}; // retrieve AC data (not used right now) |
void DigitizeCALORAW(); // digitizes the calorimeter |
408 |
|
void DigitizeCALOCOMPRESS(); // digitizes the calorimeter |
409 |
// methods for Tracker |
void DigitizeCALOFULL(); // digitizes the calorimeter |
410 |
void DigitizeTrack(); // digitizes the Tracker data |
|
411 |
void DigitizeTrackCalib(Int_t ii); // digitizes the Tracker calibration (x view or y view) |
Float_t GetCALOen(Int_t sec, Int_t plane, Int_t strip); // retrieve calorimeter strip energy from the simulation |
412 |
void WriteTrackCalib(); // writes Tracker calibration to file |
void ClearCaloCalib(Int_t s); // clear calorimeter calibration variables for section s |
413 |
void ClearTrackCalib(); // clear tracker calibration |
Int_t CaloLoadCalib(Int_t s,TString fcalname, UInt_t calibno); // load calorimeter calibration variables for section s from file fcalname entry calibno |
414 |
void LoadTrackCalib(); // load in memmory tracker calibration |
void CaloLoadCalib(); |
415 |
void CompressTrackData(Float_t AdcTrack[fNviews][fNstrips_view]); // Compress and Digitize data of one Ladder in turn |
|
416 |
void LoadMipCor(); // Load the strip calibration in memory |
void DigitizeDummy(); // digitizes the dummy detector |
417 |
Float_t SaturationTrack(Float_t ADC); // Saturation simulation |
|
418 |
// end methods for Tracker |
// ToF methods: |
419 |
|
UChar_t EvaluateCrcTof(UChar_t*); |
420 |
void WriteData(); // writes data to file |
void Paddle2Pmt(Int_t, Int_t, Int_t*, Int_t*); |
421 |
void ReadData(); |
//void Paddle2Pmt(Int_t, Int_t, Int_t &pmtleft, Int_t &pmtright); |
422 |
|
UChar_t Bin2GrayTof(UChar_t, UChar_t); |
423 |
// |
void Crc8Tof(UChar_t*, UChar_t*); |
424 |
|
|
425 |
}; |
UChar_t EvaluateCrcTrigger(UChar_t*, Int_t); |
426 |
|
|
427 |
#endif /* DIGITIZER_H */ |
UShort_t* GetDataAC(){return(fDataAC);}; // retrieve AC data (not used right now) |
428 |
|
|
429 |
|
UShort_t* GetDataCALO(){return(fDataCALO);}; // retrieve AC data (not used right now) |
430 |
|
|
431 |
|
// methods for Tracker |
432 |
|
void DigitizeTrack(); // digitizes the Tracker data |
433 |
|
void DigitizeTrackCalib(Int_t ii); // digitizes the Tracker calibration (x view or y view) |
434 |
|
void WriteTrackCalib(); // writes Tracker calibration to file |
435 |
|
void ClearTrackCalib(); // clear tracker calibration |
436 |
|
void LoadTrackCalib(); // load in memmory tracker calibration |
437 |
|
void CompressTrackData(Float_t AdcTrack[fNviews][fNstrips_view]); // Compress and Digitize data of one Ladder in turn |
438 |
|
void LoadMipCor(); // Load the strip calibration in memory |
439 |
|
Float_t SaturationTrackx(Float_t ADC); // Saturation simulation |
440 |
|
Float_t SaturationTracky(Float_t ADC); // Saturation simulation |
441 |
|
// end methods for Tracker |
442 |
|
|
443 |
|
void WriteRunHeader(); |
444 |
|
void WriteRunTrailer(); |
445 |
|
void WriteData(); // writes data to file |
446 |
|
void ReadData(); |
447 |
|
|
448 |
|
// |
449 |
|
|
450 |
|
}; |
451 |
|
|
452 |
|
#endif /* DIGITIZER_H */ |
453 |
|
|
454 |
|
|
455 |
|
|