]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDtestBeam.h
Added setting the default CDB storage,
[u/mrichter/AliRoot.git] / TRD / AliTRDtestBeam.h
CommitLineData
0eedb47d 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/*
9The class to read the test beam 2007 data
10*/
11
6511d650 12//#define MAX_SI 2000
0eedb47d 13
14#include "TObject.h"
15
16class AliTRDrawStreamV2;
17class AliTRDRawStreamTB;
18using namespace std;
19
20class AliTRDtestBeam: public TObject {
21
22public:
6511d650 23
0eedb47d 24 AliTRDtestBeam(); // ctor
25 AliTRDtestBeam(const char *filename); // constructor
01abcaa3 26 AliTRDtestBeam(const AliTRDtestBeam &tb);
27 AliTRDtestBeam &operator=(const AliTRDtestBeam& /*tb*/) {return *this; }
6511d650 28 virtual ~AliTRDtestBeam(); // dtor
0eedb47d 29
30 Int_t NextEvent();
31
32 AliTRDRawStreamTB *GetTRDrawStream(); // needs RawStreamTB
33
34 // silicon
6511d650 35 Short_t GetNSi1() const {return fNSi1;}
36 Short_t GetNSi2() const {return fNSi2;}
0eedb47d 37
6511d650 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;};
0eedb47d 40
6511d650 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;};
0eedb47d 43
6511d650 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;}
0eedb47d 48
49 // calo
6511d650 50 Double_t GetCher() const {return fCher;}
51 Double_t GetPb() const {return fPb;}
0eedb47d 52
53protected:
54
6511d650 55 ifstream *fDataStream; // input data stream
0eedb47d 56
6511d650 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
0eedb47d 70
71 // silicon data
72
6511d650 73 Short_t fNSi1; // number of fired silicon pads from Si1
74 Short_t fNSi2; // fired pads in Si2
0eedb47d 75
6511d650 76 Int_t fSi1Address[1270]; // addresses of fires silicon pads Si1
77 Int_t fSi2Address[1270]; // addresses if fires silicon pads Si2
0eedb47d 78
6511d650 79 Int_t fSi1Charge[1270]; // charge collected on Si1
80 Int_t fSi2Charge[1270]; // charge collected on Si2
0eedb47d 81
82 // reconstructed Silicon data
83
6511d650 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
0eedb47d 88
89 // cherenkov glass
6511d650 90 Double_t fCher; // cherenkov signal
91 Double_t fPb; // lead glass signal
0eedb47d 92
93
94 // data reading
95
96 Int_t Int(Int_t i, Char_t *start);
97 Int_t DecodeSi();
98
99 //
6511d650 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
0eedb47d 106
107 //typedef char byte;
108
109 //offsets in bytes
6511d650 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!!!)
0eedb47d 114
115 ClassDef(AliTRDtestBeam,1) // description
6511d650 116
0eedb47d 117};
118
6511d650 119#endif
0eedb47d 120