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