]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDtestBeam.h
QA implementation by Sylwester
[u/mrichter/AliRoot.git] / TRD / AliTRDtestBeam.h
1 #ifndef AliTRDtestBeam_h
2 #define AliTRDtestBeam_h
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 /*
9 The class to read the test beam 2007 data
10 */
11
12 //#define MAX_SI 2000
13
14 #include "TObject.h"
15
16 class AliTRDrawStreamV2;
17 class AliTRDRawStreamTB;
18 using namespace std;
19
20 class AliTRDtestBeam: public TObject {
21
22 public:
23
24   AliTRDtestBeam();       // ctor
25   AliTRDtestBeam(const char *filename); // constructor
26   AliTRDtestBeam(const AliTRDtestBeam &tb);  
27   AliTRDtestBeam &operator=(const AliTRDtestBeam& /*tb*/) {return *this; }
28   virtual ~AliTRDtestBeam(); // dtor
29
30   Int_t NextEvent();
31   
32   AliTRDRawStreamTB *GetTRDrawStream(); // needs RawStreamTB
33
34   // silicon
35   Short_t GetNSi1() const {return fNSi1;}
36   Short_t GetNSi2() const {return fNSi2;}
37   
38   Int_t GetSi1Address(Int_t i) const {return (i<fNSi1)? fSi1Address[i] : -1;};
39   Int_t GetSi2Address(Int_t i) const {return (i<fNSi2)? fSi2Address[i] : -1;};
40   
41   Int_t GetSi1Charge(Int_t i) const {return (i<fNSi1)? fSi1Charge[i] : -1;};
42   Int_t GetSi2Charge(Int_t i) const {return (i<fNSi2)? fSi1Charge[i] : -1;};
43   
44   Double_t GetX(Int_t n)   const {return (n<2)? fX[n] : -1;}
45   Double_t GetY(Int_t n)   const {return (n<2)? fY[n] : -1;}
46   Double_t GetQx(Int_t n)  const {return (n<2)? fQx[n] : -1;}
47   Double_t GetQy(Int_t n)  const {return (n<2)? fQy[n] : -1;}
48
49   // calo
50   Double_t GetCher() const {return fCher;}
51   Double_t GetPb() const {return fPb;}
52
53 protected:
54   
55   ifstream *fDataStream;      // input data stream
56   
57   Bool_t fHeaderIsRead;       // do we read Header ?
58   Int_t fEventCount;          // number of events
59   Int_t fLimit;               // = 4
60   Int_t fCurrent;             // ...
61
62   Int_t fDdlOff;              // offset to DDL data
63   Int_t fSiOff;               // offset to Silicon data
64   Int_t fQdcOff;              // offset to Cherenkov and LeadGlass data
65   Int_t fDdlSize;             // size of DDL data
66  
67   Char_t *fFileHeader;        // file header data
68   Char_t *fEventHeader;       // event header data 
69   Char_t *fEventData;         // actual event data
70
71   // silicon data
72   
73   Short_t fNSi1;              // number of fired silicon pads from Si1
74   Short_t fNSi2;              // fired pads in Si2 
75   
76   Int_t fSi1Address[1270];  // addresses of fires silicon pads Si1
77   Int_t fSi2Address[1270];  // addresses if fires silicon pads Si2
78   
79   Int_t fSi1Charge[1270];   // charge collected on Si1
80   Int_t fSi2Charge[1270];   // charge collected on Si2
81   
82   // reconstructed Silicon data 
83
84   Double_t fX[2];             // x position for Si1 and Si2
85   Double_t fY[2];             // y position
86   Double_t fQx[2];            // charge on X
87   Double_t fQy[2];            // charge on y 
88
89   // cherenkov glass
90   Double_t fCher;             // cherenkov signal
91   Double_t fPb;               // lead glass signal
92   
93
94   // data reading
95   
96   Int_t Int(Int_t i, Char_t *start);
97   Int_t DecodeSi();
98
99   //
100   static const Long_t fgkFileHeadSize; //= 544; // ?
101   static const Long_t fgkEventHeadSize; // = 68; //?
102   static const Long_t fgkLdcHeadSize; // = 68; //?
103   static const Long_t fgkEquipHeadSize; // = 28; //
104   static const Int_t fgkVmeIn; //=1; //VME event in
105   static const Int_t fgkSimIn; //=1; //Si-strips in
106   
107   //typedef char byte;
108   
109   //offsets in bytes
110   static const Int_t fgkPosRun; // = 20; //run nr. (in file and event header)
111   static const Int_t fgkPosLength; // = 0; //event/equip. length
112   static const Int_t fgkEqId; // = 8;  //equipment id.
113   static const Int_t fgkPosSiOff; // = 12;  //Si data size offset (3 extra words!!!)
114
115   ClassDef(AliTRDtestBeam,1)  // description 
116
117 };
118
119 #endif 
120