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; |
int *nspe; |
41 |
int ntof; |
int *ntof; |
42 |
int ncat; |
int *ncat; |
43 |
int ncas; |
int *ncas; |
44 |
int ncar; |
int *ncar; |
45 |
int ncal; |
int *ncal; |
46 |
int nnd; |
int *nnd; |
47 |
int nstr; |
int *nstr; |
|
int *ntf; |
|
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) |
51 |
static const int fTOFbuffer = 276; //(bytes) |
static const int fTOFbuffer = 276; //(bytes) |
|
static const int fRunHeaderbuffer = 27; // ?? |
|
|
static const int fRunTrailerbuffer = 17; |
|
52 |
static const int fACbuffer = 128; |
static const int fACbuffer = 128; |
53 |
static const int fNDbuffer = 6; |
static const int fNDbuffer = 6; |
54 |
static const int fS4buffer = 3; |
static const int fS4buffer = 3; |
90 |
UShort_t fDataPadding[fPADbuffer]; |
UShort_t fDataPadding[fPADbuffer]; |
91 |
UInt_t fPadding; |
UInt_t fPadding; |
92 |
|
|
|
UShort_t fDataRunHeader[fRunHeaderbuffer]; |
|
|
UShort_t fDataRunTrailer[fRunTrailerbuffer]; |
|
|
|
|
93 |
UChar_t fDataTrigger[fTRIGGERbuffer]; |
UChar_t fDataTrigger[fTRIGGERbuffer]; |
94 |
UChar_t fDataTof[fTOFbuffer]; |
UChar_t fDataTof[fTOFbuffer]; |
95 |
|
|
147 |
Int_t Nthtof; |
Int_t Nthtof; |
148 |
UChar_t *Ipltof; |
UChar_t *Ipltof; |
149 |
UChar_t *Ipaddle; |
UChar_t *Ipaddle; |
150 |
UChar_t *Ipartof;//DPMJET |
// UChar_t *Ipartof;//DPMJET |
151 |
// UShort_t *Ipartof; |
UShort_t *Ipartof; |
152 |
Float_t *Xintof; |
Float_t *Xintof; |
153 |
Float_t *Yintof; |
Float_t *Yintof; |
154 |
Float_t *Zintof; |
Float_t *Zintof; |
186 |
Float_t *Pathcas; |
Float_t *Pathcas; |
187 |
Float_t *P0cas; |
Float_t *P0cas; |
188 |
Int_t Nthspe; |
Int_t Nthspe; |
189 |
UChar_t *Iparspe;//DPMJET |
// UChar_t *Iparspe;//DPMJET |
190 |
// UShort_t *Iparspe; |
// UShort_t *Iparspe; |
191 |
UChar_t *Itrpb; |
UChar_t *Itrpb; |
192 |
UChar_t *Itrsl; |
UChar_t *Itrsl; |
193 |
UChar_t *Itspa; |
UChar_t *Itspa; |
378 |
TBranch *b_Pathcard; //! |
TBranch *b_Pathcard; //! |
379 |
TBranch *b_P0card; //! |
TBranch *b_P0card; //! |
380 |
// |
// |
381 |
|
TF1 *attenAC; |
382 |
public: |
public: |
383 |
|
|
384 |
Digitizer(TTree *tree, char* &file_raw,int nspe=200,int ntof=200,int ncat=50,int ncas=50,int ncar=100,int ncal=1000,int nnd=200,int nstr=1000); // constructor |
Digitizer(TTree*,char*&,int,int,int,int,int,int,int,int); // constructor |
385 |
|
|
386 |
void Close(); |
void Close(); |
387 |
void SetTree(TTree *tree) {fhBookTree = tree;}; |
void SetTree(TTree *tree) {fhBookTree = tree;}; |
389 |
|
|
390 |
void DigitizePSCU(UInt_t, UChar_t, UShort_t*); // digitizes the CPU header |
void DigitizePSCU(UInt_t, UChar_t, UShort_t*); // digitizes the CPU header |
391 |
void AddPadding(); |
void AddPadding(); |
|
void DigitizeRunHeader(); |
|
|
void DigitizeRunTrailer(); |
|
|
// void DigitizeTRIGGER(); // SO nov'07: included in DigitizeTOF |
|
392 |
void DigitizeTOF(int np,float *atte1,float *atte2,float *lambda1,float *lambda2); // digitizes the tof |
void DigitizeTOF(int np,float *atte1,float *atte2,float *lambda1,float *lambda2); // digitizes the tof |
393 |
void LoadTOFCalib(int np,float *atte1,float *atte2,float *lambda1,float *lambda2); //load TOF calibration |
void LoadTOFCalib(int np,float *atte1,float *atte2,float *lambda1,float *lambda2); //load TOF calibration |
394 |
void DigitizeAC(TF1*); // digitizes the anti-counter |
void DigitizeAC(); // digitizes the anti-counter |
395 |
void DigitizeND(); // digitizes the ND |
void DigitizeND(); // digitizes the ND |
396 |
void DigitizeS4(); // digitizes the S4 |
void DigitizeS4(); // digitizes the S4 |
397 |
void DigitizeCALO(); // digitizes the calorimeter |
void DigitizeCALO(); // digitizes the calorimeter |
432 |
Float_t SaturationTracky(Float_t ADC); // Saturation simulation |
Float_t SaturationTracky(Float_t ADC); // Saturation simulation |
433 |
// end methods for Tracker |
// end methods for Tracker |
434 |
|
|
|
void WriteRunHeader(); |
|
|
void WriteRunTrailer(); |
|
435 |
void WriteData(); // writes data to file |
void WriteData(); // writes data to file |
436 |
void ReadData(); |
void ReadData(); |
437 |
|
|