]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/src/AliL3RawDataFileHandler.h
Additional protection
[u/mrichter/AliRoot.git] / HLT / src / AliL3RawDataFileHandler.h
CommitLineData
3e87ef69 1// @(#) $Id$
2
3#ifndef ALIL3RAWDATAFILEHANDLER_H
4#define ALIL3RAWDATAFILEHANDLER_H
5
6#include "AliL3MemHandler.h"
7
b1ed0288 8class AliL3RawDataFileHandler:public AliL3MemHandler {
3e87ef69 9 private:
10
11 FILE *fMapping;//!
12 ifstream *fInRaw;//!
13 ifstream *fInRawPed;//!
14 ofstream *fOutRaw;//!
15
16 //found in mapping file
b1ed0288 17 UInt_t fNChannels; //number of channels
3e87ef69 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
b1ed0288 30 Short_t fPedVal; //ped val if not used per channel
3e87ef69 31
de3c3890 32 Short_t **fCharges;//! charge values read from pointer or from file
33
b1ed0288 34 Bool_t fConvert; //convert big/little
35 Int_t Convert4(Int_t i) const; //big2little and vice versa
36 Short_t Convert2(Short_t i) const; //big2little and vice versa
3e87ef69 37
38 public:
39 AliL3RawDataFileHandler();
40 virtual ~AliL3RawDataFileHandler();
41
42 void FreeAll(); //like AliL3MemHandler::Free() or AliL3FileHandler::FreeDigitsTree
43
44 Bool_t SetRawInput(Char_t *name);
de3c3890 45 Bool_t SetRawInput(STDIF *file);
3e87ef69 46 void CloseRawInput();
47 Int_t ReadRawInput();
de3c3890 48
e33f3609 49 Int_t ReadRawInputPointer(const Char_t *ptr);
de3c3890 50
3e87ef69 51 Short_t** GetRawData(Int_t &channels, Int_t & timebins);
52
53 Bool_t SetRawOutput(Char_t *name);
de3c3890 54 Bool_t SetRawOutput(STDOF *file);
3e87ef69 55 void CloseRawOutput();
56 Int_t StoreRawData(Short_t **charges);
57
58 Bool_t SetMappingFile(Char_t *name);
59 Bool_t SetMappingFile(FILE *file);
60 void CloseMappingFile();
61 Int_t ReadMappingFile();
62
63 Bool_t SetRawPedestalsInput(Char_t *name);
de3c3890 64 Bool_t SetRawPedestalsInput(STDIF *file);
3e87ef69 65 void CloseRawPedestalsInput();
66 Int_t ReadRawPedestalsInput();
67
68 void SetBig2Little(Bool_t b){fConvert=b;}
69 void SetPedVal(Short_t val){fPedVal=val;}
70
b1ed0288 71 Int_t GetRowMinUsed() const {return fRowMinUsed;} //smallest row number used in the test
72 Int_t GetRowMaxUsed() const {return fRowMaxUsed;} //hightest row number used in the test
73 Int_t GetPadMinUsed() const {return fPadMinUsed;}
74 Int_t GetPadMaxUsed() const {return fPadMaxUsed;}
75 Short_t GetPedVal() const {return fPedVal;}
76 Int_t GetNChannels() const {return fNChannels;}
3e87ef69 77
78 AliL3DigitRowData* RawData2Memory(UInt_t &nrow,Int_t event=-1);
240d63be 79 Bool_t RawData2CompBinary(Int_t event=-1);
3e87ef69 80
81 ClassDef(AliL3RawDataFileHandler,1) //RawData Filehandler class
82};
83#endif
84