]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSOnlineCalibrationSPDhandler.h
New SPD pre-processor (H. Tydesjo)
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineCalibrationSPDhandler.h
1 #ifndef ALI_ITS_ONLINECALIBRATIONSPDHANDLER_H
2 #define ALI_ITS_ONLINECALIBRATIONSPDHANDLER_H
3
4 //////////////////////////////////////////////////////////////////////
5 // Author: Henrik Tydesjo                                           //
6 // Class that  simplifies the managing of dead and noisy pixels.    //
7 // Interface to the AliITSOnlineCalibrationSPD container object     //
8 // through reading and writing to TFile.                            //
9 //////////////////////////////////////////////////////////////////////  
10
11
12 #include "AliITSIntMap.h"
13
14 class TArrayI;
15
16 class AliITSOnlineCalibrationSPDhandler {
17
18  public:
19   AliITSOnlineCalibrationSPDhandler();
20   AliITSOnlineCalibrationSPDhandler(UInt_t module);
21   AliITSOnlineCalibrationSPDhandler(const AliITSOnlineCalibrationSPDhandler& handle);
22   virtual ~AliITSOnlineCalibrationSPDhandler();
23   AliITSOnlineCalibrationSPDhandler& operator=(const AliITSOnlineCalibrationSPDhandler& handle);
24   void    ClearMaps();
25
26   void    WriteToFile();
27   void    WriteToFile(Char_t* fileName);
28   void    ReadFromFile();
29   void    ReadDeadFromFile();
30   void    ReadNoisyFromFile();
31   void    ReadFromFile(Char_t* fileName);
32   void    ReadDeadFromFile(Char_t* fileName);
33   void    ReadNoisyFromFile(Char_t* fileName);
34   void    SetModuleNr(UInt_t mod) {fModuleNr=mod;}
35   UInt_t  GetModuleNr() const {return fModuleNr;}
36   void    SetFileLocation(Char_t* loc) {sprintf(fFileLocation,"%s",loc);}
37   UInt_t  GetNrDead() const {return fDeadPixelMap.GetNrEntries();}
38   UInt_t  GetNrNoisy() const {return fNoisyPixelMap.GetNrEntries();}
39   TArrayI GetDeadArray();
40   TArrayI GetNoisyArray();
41
42   void    ResetDead();
43   Bool_t  SetDeadPixel(Int_t col, Int_t row);
44   Int_t   GetDeadColAt(UInt_t index) const;
45   Int_t   GetDeadRowAt(UInt_t index) const;
46   Bool_t  IsPixelDead(Int_t col, Int_t row) const;
47   void    ResetNoisy();
48   Bool_t  SetNoisyPixel(Int_t col, Int_t row);
49   Int_t   GetNoisyColAt(UInt_t index) const;
50   Int_t   GetNoisyRowAt(UInt_t index) const;
51   Bool_t  IsPixelNoisy(Int_t col, Int_t row) const;
52
53   void    PrintDead() const;
54   void    PrintNoisy() const;
55
56  private:
57   UInt_t fModuleNr;                 // module nr
58   AliITSIntMap fDeadPixelMap;       // list of dead pixels
59   AliITSIntMap fNoisyPixelMap;      // list of noisy pixels
60   Char_t  fFileLocation[200];       // location (dir) of file to read and write from
61
62   Int_t   GetKey(Int_t col, Int_t row) const {return col*256 + row;}
63   Int_t   GetColFromKey(Int_t key) const {return key/256;}
64   Int_t   GetRowFromKey(Int_t key) const {return key%256;}
65
66 };
67
68 #endif