--- PamelaDigitizer/Digitizer.h 2008/06/08 06:33:45 1.8 +++ PamelaDigitizer/Digitizer.h 2009/10/16 09:15:51 1.13 @@ -2,6 +2,7 @@ #define DIGITIZER_H #include +#include #include @@ -16,35 +17,40 @@ #include "TLeafI.h" #include "TH1.h" #include "TH2.h" +#include "TF1.h" #include "TMath.h" #include "TSQLServer.h" -// +#include "TGraph.h" +#include "GLTables.h" +#include "TSystem.h" +#include "TRandom.h" + #include "CRC.h" +#include +#include "CalibTrk1Event.h" +#include "CalibTrk2Event.h" class Digitizer{ - protected: // in and output data members TTree* fhBookTree; ofstream fOutputfile; - int nspe; - int ntof; - int ncat; - int ncas; - int ncar; - int ncal; - int nnd; - int nstr; - int *ntf; + int *nspe; + int *ntof; + int *ncat; + int *ncas; + int *ncar; + int *ncal; + int *nnd; + int *nstr; + int *comprcalomod; static const int fPSCUbuffer = 8; static const int fTRIGGERbuffer = 152; //(bytes) static const int fTOFbuffer = 276; //(bytes) - static const int fRunHeaderbuffer = 27; // ?? - static const int fRunTrailerbuffer = 17; static const int fACbuffer = 128; static const int fNDbuffer = 6; static const int fS4buffer = 3; @@ -86,9 +92,6 @@ UShort_t fDataPadding[fPADbuffer]; UInt_t fPadding; - UShort_t fDataRunHeader[fRunHeaderbuffer]; - UShort_t fDataRunTrailer[fRunTrailerbuffer]; - UChar_t fDataTrigger[fTRIGGERbuffer]; UChar_t fDataTof[fTOFbuffer]; @@ -101,7 +104,7 @@ UShort_t fSecCalo[4]; UShort_t fSecCALOLength[4]; UShort_t fCALOlength; - UShort_t fModCalo; + UShort_t fModCalo ; // 0 is RAW, 1 is COMPRESS, 2 is FULL Float_t fCalomip[2][22][96]; // ADC to MIP conversion values Float_t fcalped[4][11][96]; // pedestals Float_t fcalgood[4][11][96]; // used or not in the common noise calculation @@ -116,6 +119,7 @@ char* fFilename; UInt_t fLen; + UInt_t fEvent ; // cecilia, current evt nr // vectors, buffer, and variables for tracker @@ -146,8 +150,8 @@ Int_t Nthtof; UChar_t *Ipltof; UChar_t *Ipaddle; - UChar_t *Ipartof;//DPMJET - // UShort_t *Ipartof; + // UChar_t *Ipartof;//DPMJET + UShort_t *Ipartof; Float_t *Xintof; Float_t *Yintof; Float_t *Zintof; @@ -185,8 +189,8 @@ Float_t *Pathcas; Float_t *P0cas; Int_t Nthspe; - UChar_t *Iparspe;//DPMJET - // UShort_t *Iparspe; + // UChar_t *Iparspe;//DPMJET + // UShort_t *Iparspe; UChar_t *Itrpb; UChar_t *Itrsl; UChar_t *Itspa; @@ -377,10 +381,10 @@ TBranch *b_Pathcard; //! TBranch *b_P0card; //! // - + TF1 *attenAC; public: - 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,int); // constructor void Close(); void SetTree(TTree *tree) {fhBookTree = tree;}; @@ -388,12 +392,9 @@ void DigitizePSCU(UInt_t, UChar_t, UShort_t*); // digitizes the CPU header void AddPadding(); - void DigitizeRunHeader(); - void DigitizeRunTrailer(); - // void DigitizeTRIGGER(); // SO nov'07: included in DigitizeTOF void DigitizeTOF(int np,float *atte1,float *atte2,float *lambda1,float *lambda2); // digitizes the tof void LoadTOFCalib(int np,float *atte1,float *atte2,float *lambda1,float *lambda2); //load TOF calibration - void DigitizeAC(TF1*); // digitizes the anti-counter + void DigitizeAC(); // digitizes the anti-counter void DigitizeND(); // digitizes the ND void DigitizeS4(); // digitizes the S4 void DigitizeCALO(); // digitizes the calorimeter @@ -434,8 +435,6 @@ Float_t SaturationTracky(Float_t ADC); // Saturation simulation // end methods for Tracker - void WriteRunHeader(); - void WriteRunTrailer(); void WriteData(); // writes data to file void ReadData();