]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALCalibTimeDepCorrection.h
Removing comment for "magic" lines to correctly read raw tag files.
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALCalibTimeDepCorrection.h
1 #ifndef ALIEMCALCALIBTIMEDEPCORRECTION_H
2 #define ALIEMCALCALIBTIMEDEPCORRECTION_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 <TArrayF.h>
11 #include "AliEMCALGeoParams.h"
12 class TString;
13 class TArrayF;
14
15 /*
16   Objects of this class read txt file with APD data
17   AliEMCALCalibTimeDepCorrection inherits TObject only to use AliLog "functions".
18 */
19
20 class AliEMCALCalibTimeDepCorrection : public TObject {
21 public:
22   AliEMCALCalibTimeDepCorrection();
23
24   // interface methods; getting the whole struct should be more efficient though
25   void InitCorrection(Int_t nSM, Int_t nBins, Float_t val=1.0); // assign a certain value to all 
26   // use the methods below with caution: take care that your argument ranges are valid
27   void SetCorrection(Int_t smIndex, Int_t iCol, Int_t iRow, Int_t iBin, Float_t val=1.0); // assign a certain value to a given bin
28   Float_t GetCorrection(Int_t smIndex, Int_t iCol, Int_t iRow, Int_t iBin) const; // assign a certain value to a given bin
29  
30
31   // Read and Write txt I/O methods are normally not used, but are useful for 
32   // filling the object before it is saved in OCDB 
33   void ReadCalibTimeDepCorrectionInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
34
35   void WriteCalibTimeDepCorrectionInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
36
37   virtual ~AliEMCALCalibTimeDepCorrection();
38
39   struct AliEMCALSuperModuleCalibTimeDepCorrection {
40     Int_t fSuperModuleNum;
41     TArrayF fCorrection[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; 
42   };
43
44   // pointer to stored info.
45   Int_t GetNSuperModule() const { return fNSuperModule; }; 
46   AliEMCALSuperModuleCalibTimeDepCorrection * GetSuperModuleData() const { return fSuperModuleData; };
47
48   // - via the index in the stored array:
49   virtual AliEMCALSuperModuleCalibTimeDepCorrection GetSuperModuleCalibTimeDepCorrectionId(Int_t smIndex) const;
50   // - or via the actual SM number
51   virtual AliEMCALSuperModuleCalibTimeDepCorrection GetSuperModuleCalibTimeDepCorrectionNum(Int_t smNum) const;
52
53   void SetStartTime(UInt_t ui) { fStartTime = ui; } //
54   void SetNTimeBins(Int_t i) { fNTimeBins = i; } // 
55   void SetTimeBinSize(Int_t i) { fTimeBinSize = i; } // 
56
57   Int_t GetStartTime() const { return fStartTime; } //
58   Int_t GetNTimeBins() const { return fNTimeBins; } // 
59   Int_t GetTimeBinSize() const { return fTimeBinSize; } // 
60
61 protected:
62
63   Int_t           fNSuperModule; // Number of supermodules.
64   AliEMCALSuperModuleCalibTimeDepCorrection *fSuperModuleData; // SuperModule data
65
66 private:
67
68   AliEMCALCalibTimeDepCorrection(const AliEMCALCalibTimeDepCorrection &);
69   AliEMCALCalibTimeDepCorrection &operator = (const AliEMCALCalibTimeDepCorrection &);
70
71   UInt_t fStartTime; // timestamp for start of run/first bin
72   Int_t fNTimeBins; // how many timestamp bins do we have
73   Int_t fTimeBinSize; // seconds per time-bin
74
75   ClassDef(AliEMCALCalibTimeDepCorrection, 2) //
76 };
77
78 #endif