]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDtestBeam.h
Coding rule violations
[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   AliTRDtestBeam();       // ctor
24   AliTRDtestBeam(const char *filename); // constructor
25   //AliTRDtestBeam(const AliTRDtestBeam &tb);  
26   //AliTRDtestBeam& operator = (const AliTRDtestBeam& tb) {return *this}
27   virtual ~AliTRDtestBeam() {;} // dtor
28
29   Int_t NextEvent();
30   
31   AliTRDRawStreamTB *GetTRDrawStream(); // needs RawStreamTB
32
33   // silicon
34   Short_t GetNSi1() {return fNSi1;}
35   Short_t GetNSi2() {return fNSi2;}
36   
37   Int_t GetSi1Address(Int_t i) {return (i<fNSi1)? fSi1Address[i] : -1;};
38   Int_t GetSi2Address(Int_t i) {return (i<fNSi2)? fSi2Address[i] : -1;};
39   
40   Int_t GetSi1Charge(Int_t i) {return (i<fNSi1)? fSi1Charge[i] : -1;};
41   Int_t GetSi2Charge(Int_t i) {return (i<fNSi2)? fSi1Charge[i] : -1;};
42   
43   Double_t GetX(Int_t n) {return (n<2)? fX[n] : -1;}
44   Double_t GetY(Int_t n) {return (n<2)? fY[n] : -1;}
45   Double_t GetQx(Int_t n) {return (n<2)? fQx[n] : -1;}
46   Double_t GetQy(Int_t n) {return (n<2)? fQy[n] : -1;}
47
48   // calo
49   Double_t GetCher() {return fCher;}
50   Double_t GetPb() {return fPb;}
51
52 protected:
53   
54   ifstream *fDataStream;
55   
56   Bool_t fHeaderIsRead;
57   Int_t fEventCount;
58   Int_t fLimit; // = 4
59   Int_t fCurrent;
60
61   Int_t fDdlOff;
62   Int_t fSiOff;
63   Int_t fQdcOff;
64   Int_t fDdlSize;
65
66   Char_t *fFileHeader;
67   Char_t *fEventHeader;
68   Char_t *fEventData;
69
70   // silicon data
71   
72   Short_t fNSi1;
73   Short_t fNSi2;
74   
75   Int_t fSi1Address[MAX_SI];
76   Int_t fSi2Address[MAX_SI];
77   
78   Int_t fSi1Charge[MAX_SI];
79   Int_t fSi2Charge[MAX_SI];
80   
81   // reconstructed Silicon data 
82
83   Double_t fX[2];
84   Double_t fY[2];
85   Double_t fQx[2];
86   Double_t fQy[2];
87
88   // cherenkov glass
89   Double_t fCher;
90   Double_t fPb;
91   
92
93   // data reading
94   
95   Int_t Int(Int_t i, Char_t *start);
96   Int_t DecodeSi();
97
98   //
99   static const Long_t file_head_size; //= 544; // ?
100   static const Long_t event_head_size; // = 68; //?
101   static const Long_t ldc_head_size; // = 68; //?
102   static const Long_t equip_head_size; // = 28; //
103   static const Int_t vme_in; //=1; //VME event in
104   static const Int_t sim_in; //=1; //Si-strips in
105   
106   //typedef char byte;
107   
108   //offsets in bytes
109   static const Int_t pos_run; // = 20; //run nr. (in file and event header)
110   static const Int_t pos_length; // = 0; //event/equip. length
111   static const Int_t pos_eqid; // = 8;  //equipment id.
112   static const Int_t pos_sioff; // = 12;  //Si data size offset (3 extra words!!!)
113
114   ClassDef(AliTRDtestBeam,1)  // description 
115 };
116
117 #endif // AliTRDQADatamaker_H
118