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