]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/src/AliL3RawDataFileHandler.h
Merged HLT tag v1-2 with ALIROOT tag v3-09-Release.
[u/mrichter/AliRoot.git] / HLT / src / AliL3RawDataFileHandler.h
1 // @(#) $Id$
2
3 #ifndef ALIL3RAWDATAFILEHANDLER_H
4 #define ALIL3RAWDATAFILEHANDLER_H
5
6 #include "AliL3MemHandler.h"
7
8 class AliL3RawDataFileHandler:public AliL3MemHandler{
9  private:
10   
11   FILE *fMapping;//!
12   ifstream *fInRaw;//!
13   ifstream *fInRawPed;//!
14   ofstream *fOutRaw;//!
15
16   //found in mapping file
17   UInt_t fNChannels; 
18   Byte_t *fRow;//!     //store the channeln to row mapping
19   Byte_t *fPad;//!     //store the channel to pad mapping
20   Short_t **fRowPad;//! //store the row-and-pad to channel mapping
21
22   Int_t fRowMinUsed; //min row val (found from mapping)
23   Int_t fRowMaxUsed; //max row val (found from mapping)
24   Int_t fPadMinUsed; //min pad val (found from mapping)
25   Int_t fPadMaxUsed; //max pad val (found from mapping)
26   Int_t fNPads[159]; //pads used (found from mapping)
27   Int_t fNTimeBins;  //stored in data header
28
29   Short_t **fPedestals;//! pedestal values, if not used, fPedVal is used
30   Short_t fPedVal;
31
32   Bool_t fConvert;
33   Int_t Convert4(Int_t i);     //big2little and vice versa
34   Short_t Convert2(Short_t i); //big2little and vice versa
35
36  public:
37   AliL3RawDataFileHandler();
38   virtual ~AliL3RawDataFileHandler();
39
40   void FreeAll(); //like AliL3MemHandler::Free() or AliL3FileHandler::FreeDigitsTree
41
42   Bool_t SetRawInput(Char_t *name);
43   Bool_t SetRawInput(ifstream *file);
44   void CloseRawInput(); 
45   Int_t ReadRawInput();
46   Short_t** GetRawData(Int_t &channels, Int_t & timebins);
47
48   Bool_t SetRawOutput(Char_t *name);
49   Bool_t SetRawOutput(ofstream *file);
50   void CloseRawOutput(); 
51   Int_t StoreRawData(Short_t **charges);
52
53   Bool_t SetMappingFile(Char_t *name);
54   Bool_t SetMappingFile(FILE *file);
55   void CloseMappingFile(); 
56   Int_t ReadMappingFile();
57   
58   Bool_t SetRawPedestalsInput(Char_t *name);
59   Bool_t SetRawPedestalsInput(ifstream *file);
60   void CloseRawPedestalsInput(); 
61   Int_t ReadRawPedestalsInput();
62
63   void SetBig2Little(Bool_t b){fConvert=b;}
64   void SetPedVal(Short_t val){fPedVal=val;}
65
66   Int_t GetRowMinUsed(){return fRowMinUsed;} //smallest row number used in the test
67   Int_t GetRowMaxUsed(){return fRowMaxUsed;} //hightest row number used in the test
68   Int_t GetPadMinUsed(){return fPadMinUsed;} 
69   Int_t GetPadMaxUsed(){return fPadMaxUsed;} 
70   Short_t GetPedVal(){return fPedVal;}
71   Int_t GetNChannels(){return fNChannels;}
72   //Int_t GetNTimeBins(){return fNTimeBins;}
73
74   AliL3DigitRowData* RawData2Memory(UInt_t &nrow,Int_t event=-1);
75
76   ClassDef(AliL3RawDataFileHandler,1)   //RawData Filehandler class
77 };
78 #endif
79