]>
Commit | Line | Data |
---|---|---|
5590a2e3 | 1 | #ifndef ALIITSSPDTESTBEAM_H |
2 | #define ALIITSSPDTESTBEAM_H | |
3 | ||
4 | /* Copyright (c) 1998-2001, ALICE Experiment at CERN, All rights reserved * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
bf6adc12 | 7 | /* $Id$ */ |
8 | ||
9 | // | |
10 | // Class for the reading of the SPD | |
11 | // Test beam data | |
12 | // More information on this class will follow | |
13 | // | |
14 | ||
15 | #include <Rtypes.h> | |
5590a2e3 | 16 | #include <TTask.h> |
17 | ||
5590a2e3 | 18 | class AliITS; |
19 | class AliITSspdTestBeamHeader; | |
20 | class AliITSspdTestBeamTail; | |
21 | class AliITSspdTestBeamBurst; | |
22 | class AliITSspdTestBeamData; | |
23 | ||
bf6adc12 | 24 | class AliITSspdTestBeam : public TTask |
25 | { | |
26 | public: | |
5590a2e3 | 27 | AliITSspdTestBeam(); |
28 | AliITSspdTestBeam(const Char_t *filename,const Char_t *opt="2002", | |
29 | AliITS *its=0); | |
30 | virtual ~AliITSspdTestBeam(); | |
31 | // | |
32 | virtual Int_t OpenInputFile(const Char_t *filename,Int_t start=0, | |
33 | Int_t end=-1); | |
34 | virtual Int_t Read(Int_t i=0); | |
d2f55a22 | 35 | virtual Int_t Read(const char *name) {return TObject::Read(name);} |
5590a2e3 | 36 | virtual Int_t Decode(); |
888c388d | 37 | virtual Int_t GetNumberOfPilots()const{return 3;} |
bf6adc12 | 38 | private: |
39 | AliITSspdTestBeam(const AliITSspdTestBeam &); | |
40 | AliITSspdTestBeam & operator=(const AliITSspdTestBeam &); | |
5590a2e3 | 41 | void SetTerminationWord(){fTermination=0xffffd9f0;} |
42 | // | |
43 | AliITSspdTestBeamHeader *fRH; //! Run Header | |
44 | AliITSspdTestBeamTail *fRT; //! Run Trailer | |
45 | Int_t fNBrst; //! Number of burts (size of array). | |
46 | Int_t **fBrstSize; //! Size of each burst for each pilot | |
47 | AliITSspdTestBeamBurst **fBrst; //! Array of bursts. | |
48 | Int_t **fNData; //! array of the number of data points | |
49 | AliITSspdTestBeamData ***fData; //! Data | |
50 | AliITSspdTestBeamData ***fHData; //! pointer to headers | |
51 | AliITSspdTestBeamData ***fTData; //! pointer to Tail and Aborts | |
52 | UInt_t fTermination; //! Termination word | |
53 | Int_t fNEvents; // Number of events in file | |
54 | Int_t fBuffSize; // Read Buffere Size | |
55 | UChar_t *fBuff; // Read buffer | |
56 | AliITS *fITS; // Pointer to the ITS. | |
57 | Int_t fNfiles; // Number of input files to read from | |
58 | Int_t fMaxFiles; // The size of the pointer array fFiles. | |
59 | ifstream **fFiles; //! Array of Pointer to the input streams | |
60 | Int_t *fNeventsStart; // Starting event number for each file | |
61 | Int_t *fNeventsEnd; // Ending number of events for each file. | |
888c388d | 62 | |
5590a2e3 | 63 | ClassDef(AliITSspdTestBeam,1) // Task to read SPD test beam data |
64 | }; | |
65 | #endif | |
37c3bb97 | 66 | //====================================================================== |
67 | #ifndef ALIITSTESTBEAMDATA_H | |
68 | #define ALIITSTESTBEAMDATA_H | |
69 | ||
70 | /* Copyright (c) 1998-2001, ALICE Experiment at CERN, All rights reserved * | |
71 | * See cxx source for full Copyright notice */ | |
72 | ||
73 | /* | |
74 | $Id$ | |
75 | */ | |
76 | ||
77 | // Pure virtual class, no data | |
78 | class AliITSTestBeamData{ | |
79 | public: | |
80 | AliITSTestBeamData(){}; | |
81 | virtual ~AliITSTestBeamData(){}; | |
888c388d | 82 | virtual Int_t SizeOf()const{return 0;} |
37c3bb97 | 83 | enum {kData,kHead,kTail,kAbort,kFail}; |
84 | private: | |
85 | }; | |
86 | ||
87 | #endif | |
88 | //====================================================================== | |
89 | #ifndef ALIITSSPDTESTBEAMHEADER_H | |
90 | #define ALIITSSPDTESTBEAMHEADER_H | |
91 | ||
37c3bb97 | 92 | /* Copyright (c) 1998-2001, ALICE Experiment at CERN, All rights reserved * |
93 | * See cxx source for full Copyright notice */ | |
94 | ||
bf6adc12 | 95 | #include <Riostream.h> |
96 | ||
37c3bb97 | 97 | class AliITSspdTestBeamHeader : public AliITSTestBeamData{ |
98 | public: | |
5590a2e3 | 99 | AliITSspdTestBeamHeader(){}; |
100 | virtual ~AliITSspdTestBeamHeader(){}; | |
888c388d | 101 | virtual void Print(ostream *os)const; |
102 | virtual Int_t GetNumberOfEvents()const{return fUnion.fHead.fNEvents;}; | |
103 | virtual Int_t GetBurstSize(Int_t i=0)const{return fUnion.fHead.fBuffSize[i];}; | |
104 | virtual Int_t SizeOf()const{return sizeof(AliITSspdTestBeamHeader);}; | |
37c3bb97 | 105 | private: |
106 | union headder{ | |
107 | struct { | |
108 | // Double_t must be 8 bytes long, Char_t 1 byte long, | |
109 | // Int_t 4 bytes long. 8*1+4*26+1*(2*12+3*20+3*44+3*8192)=24904 by | |
110 | Double_t fVersion; // Version number | |
111 | Char_t fDate[12];// Date Field | |
112 | Char_t fTime[12];// Time Field | |
113 | UInt_t fBuffSize[3]; // Buffer Sizes | |
114 | UInt_t fTestPulse; // Test Pulse flag | |
115 | UInt_t fTrigger[3]; // Array of triggers | |
116 | UInt_t fTriggerMode; // Trigger mode flag | |
117 | UInt_t fBurstSize; // Burst Size | |
118 | UInt_t fNEvents; // Number of event to write | |
888c388d | 119 | UInt_t fRes[16]; // not sure |
120 | UChar_t fMBDACS[3][20]; // not sure | |
121 | UChar_t fA1DACS[3][44]; // not sure | |
122 | UChar_t fA12Matrix[3][8192]; // not sure | |
37c3bb97 | 123 | } fHead; |
888c388d | 124 | UChar_t fBuf[24904]; // Equivalent char buffer |
5590a2e3 | 125 | } fUnion; |
37c3bb97 | 126 | }; |
127 | ostream &operator<<(ostream &os,AliITSspdTestBeamHeader &source); | |
128 | #endif | |
129 | //---------------------------------------------------------------------- | |
130 | #ifndef ALIITSSPDTESTBEAMTAIL_H | |
131 | #define ALIITSSPDTESTBEAMTAIL_H | |
132 | ||
133 | /* Copyright (c) 1998-2001, ALICE Experiment at CERN, All rights reserved * | |
134 | * See cxx source for full Copyright notice */ | |
888c388d | 135 | |
136 | #include <Riostream.h> | |
137 | ||
37c3bb97 | 138 | class AliITSspdTestBeamTail : public AliITSTestBeamData{ |
139 | public: | |
5590a2e3 | 140 | AliITSspdTestBeamTail(){}; |
141 | virtual ~AliITSspdTestBeamTail(){}; | |
888c388d | 142 | virtual Int_t SizeOf()const{return sizeof(AliITSspdTestBeamTail);} |
143 | virtual void Print(ostream *os)const; | |
37c3bb97 | 144 | private: |
145 | union tail{ | |
146 | struct { | |
147 | // Char_t 1 byte long, | |
148 | // UInt_t 4 bytes long. size = 4+4+12*1+12*1 = 32 bytes | |
149 | UInt_t fEvents; // number of events written | |
150 | UInt_t fTermMode;// Termination flag | |
151 | Char_t fDate[12];// Date Field | |
152 | Char_t fTime[12];// Time Field | |
153 | } fTail; | |
888c388d | 154 | UChar_t fBuf[32]; //Equivalent char buffer |
5590a2e3 | 155 | } fUnion; |
37c3bb97 | 156 | }; |
157 | ostream &operator<<(ostream &os,AliITSspdTestBeamTail &source); | |
158 | #endif | |
159 | //---------------------------------------------------------------------- | |
160 | #ifndef ALIITSSPDTESTBEAMBURST_H | |
161 | #define ALIITSSPDTESTBEAMBURST_H | |
162 | ||
163 | /* Copyright (c) 1998-2001, ALICE Experiment at CERN, All rights reserved * | |
164 | * See cxx source for full Copyright notice */ | |
888c388d | 165 | |
166 | #include <Riostream.h> | |
167 | ||
37c3bb97 | 168 | class AliITSspdTestBeamBurst : public AliITSTestBeamData{ |
169 | public: | |
5590a2e3 | 170 | AliITSspdTestBeamBurst(){}; |
171 | virtual ~AliITSspdTestBeamBurst(){}; | |
888c388d | 172 | virtual Int_t SizeOf()const{return sizeof(AliITSspdTestBeamBurst);} |
173 | virtual void Print(ostream *os)const; | |
37c3bb97 | 174 | private: |
175 | union tail{ | |
176 | struct { | |
177 | // UInt_t 4 bytes long. | |
178 | UInt_t fNumber; // Burst Number | |
179 | UInt_t fTransfers;// Number of Transfers | |
180 | } fBrst; | |
181 | ULong64_t fBuf; // a strictly 64 bit long unsinged int | |
5590a2e3 | 182 | } fUnion; |
37c3bb97 | 183 | }; |
184 | ostream &operator<<(ostream &os,AliITSspdTestBeamBurst &source); | |
185 | #endif | |
186 | //---------------------------------------------------------------------- | |
187 | #ifndef ALIITSSPDTESTBEAMDATA_H | |
188 | #define ALIITSSPDTESTBEAMDATA_H | |
189 | ||
190 | /* Copyright (c) 1998-2001, ALICE Experiment at CERN, All rights reserved * | |
191 | * See cxx source for full Copyright notice */ | |
888c388d | 192 | |
193 | #include <Riostream.h> | |
194 | ||
37c3bb97 | 195 | //class ostream; |
196 | ||
197 | class AliITSspdTestBeamData : public AliITSTestBeamData { | |
198 | public: | |
199 | // | |
5590a2e3 | 200 | AliITSspdTestBeamData(){}; |
201 | //AliITSspdTestBeamData(UInt_t *i){SetAddress(i);} | |
888c388d | 202 | virtual Int_t SizeOf()const{return sizeof(AliITSspdTestBeamData);} |
37c3bb97 | 203 | virtual ~AliITSspdTestBeamData(){}; |
204 | // | |
888c388d | 205 | virtual Bool_t IsHeader()const{return (fUnion.fDataH.fFlag==2||fUnion.fDataH.fFlag==3);} |
206 | virtual Bool_t IsData()const{return (fUnion.fDataD.fFlag>3)&&(fUnion.fDataD.fFlag<8);} | |
207 | virtual Bool_t IsTrailer()const{return (fUnion.fDataT.fFlag==0);} | |
208 | virtual Bool_t IsAbort()const{return (fUnion.fDataA.fFlag==1);} | |
209 | virtual Int_t Mode()const{if(IsData()) return kData;else if(IsHeader()) return kHead;else if(IsTrailer()) return kTail;else if(IsAbort()) return kAbort;else return kFail;} | |
210 | virtual Int_t TransWordCount()const{if(IsTrailer()||IsAbort()) return fUnion.fDataT.fTrans;else return -1;} | |
211 | virtual Int_t EventCounter()const{if(IsHeader()) return fUnion.fDataH.fEventSync;else return -1;} | |
212 | virtual Int_t Chip()const{if(IsData()) return fUnion.fDataD.fChip;else return -1;} | |
213 | virtual Int_t Row() const{if(IsData()) return fUnion.fDataD.fRow; else return -1;} | |
214 | virtual Int_t Colm()const{if(IsData()) return fUnion.fDataD.fColm;else return -1;} | |
215 | virtual void Dataconst(Int_t &ch,Int_t &rw,Int_t &cl)const{ch=Chip();rw=Row();cl=Colm();} | |
216 | virtual void Print(ostream *os)const; | |
37c3bb97 | 217 | private: |
218 | union data{ | |
5590a2e3 | 219 | struct { |
220 | unsigned fDate:12; // Not Used | |
37c3bb97 | 221 | unsigned fEventSync:6;// Event syncronization counter |
222 | unsigned fFlag:3; // =2or3 Header | |
223 | unsigned fPadding:12; // Not used | |
224 | } fDataH; | |
5590a2e3 | 225 | struct { |
37c3bb97 | 226 | unsigned fColm:5; // Pixel (Hit) Column Address |
227 | unsigned fRow:8; // Pixel Row Adress | |
228 | unsigned fChip:4; // Pixel Chip Address | |
229 | unsigned fFlag:3; // =4or5or6or7 Data | |
230 | unsigned fPadding:12; // Not used | |
231 | } fDataD; | |
5590a2e3 | 232 | struct { |
37c3bb97 | 233 | unsigned fTrans:17; // Transmitted word count |
234 | unsigned fFlag:3; // =0 Trialer | |
235 | unsigned fPadding:12; // Not used | |
236 | } fDataT; | |
5590a2e3 | 237 | struct { |
37c3bb97 | 238 | unsigned fTrans:17; // Transmitted word count |
239 | unsigned fFlag:3; // =1 Abort | |
240 | unsigned fPadding:12; // Not used | |
241 | } fDataA; | |
888c388d | 242 | UChar_t fBuf[4]; // Equivalent char buffer |
5590a2e3 | 243 | } fUnion; |
37c3bb97 | 244 | }; |
245 | ostream &operator<<(ostream &os,AliITSspdTestBeamData &source); | |
246 | #endif |