]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSCompressRawDataSDD.h
Protection against division by zero.
[u/mrichter/AliRoot.git] / ITS / AliITSCompressRawDataSDD.h
1 #ifndef ALIITSCOMPRESSRAWDATASDD_H
2 #define ALIITSCOMPRESSRAWDATASDD_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 /* $Id$ */
8
9 #include<TObject.h>
10 #include<TString.h>
11 #include"AliRawReader.h"
12
13 ///////////////////////////////////////////////////////////////////
14 //                                                               //
15 // Class to decode the SDD Raw Data from the CarlosRX format to  //
16 // a compressed format consisting in a word of 32 bit per cell   //
17 // Origin: F.Prino, Torino, prino@to.infn.it                     //
18 //                                                               //
19 ///////////////////////////////////////////////////////////////////
20
21 class AliITSCompressRawDataSDD : public TObject {
22
23  public:
24   AliITSCompressRawDataSDD();
25   AliITSCompressRawDataSDD(TString filename);
26   ~AliITSCompressRawDataSDD();
27   void SetEventRange(Int_t first, Int_t last){
28     fEventRange=kTRUE;
29     fFirstEvent=first;
30     fLastEvent=last;
31   }
32   void SetRawReader(AliRawReader* rd){
33     fRawReader=rd;
34   }
35   void SetPointerToData(UChar_t* pt){
36     fPointerToData=pt;
37   }
38   void SetSize(UInt_t siz){
39     fSizeInMemory=siz;
40   }
41
42   void Compress();
43   UInt_t CompressEvent(UChar_t* inputPtr);
44
45  protected:
46
47  private:
48   AliITSCompressRawDataSDD(const AliITSCompressRawDataSDD& /*c*/);
49
50   AliITSCompressRawDataSDD& operator=(const AliITSCompressRawDataSDD& /*c*/);
51  
52
53   AliRawReader* fRawReader; // pointer to raw reader
54   UChar_t* fPointerToData;   // pointer to the start of data in memory
55   UInt_t  fSizeInMemory;    // free space in memory in Bytes
56   Bool_t  fEventRange;      // flag to select a range of events
57   Int_t   fFirstEvent;      // first event (used only if fEventRange==kTRUE)
58   Int_t   fLastEvent;       // first event (used only if fEventRange==kTRUE)
59   TString fNameFile;        // name of the raw data file
60
61   ClassDef(AliITSCompressRawDataSDD, 0)
62 };
63
64 #endif