1 #ifndef ALIEMCALCALIBTIMEDEPCORRECTION_H
2 #define ALIEMCALCALIBTIMEDEPCORRECTION_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 #include <TObjArray.h>
12 #include "AliEMCALGeoParams.h"
17 Objects of this class contain info on time-dependent corrections
20 // ******* internal class definition *************
21 // 1 SuperModule's worth of info
22 class AliEMCALSuperModuleCalibTimeDepCorrection : public TObject {
24 AliEMCALSuperModuleCalibTimeDepCorrection(const int smNum=0) : TObject(), // just init values
25 fSuperModuleNum(smNum)
27 for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) {
28 for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) {
29 fCorrection[icol][irow].Reset();
35 void SetSuperModuleNum(Int_t i) { fSuperModuleNum = i;}; //
36 Int_t GetSuperModuleNum() const { return fSuperModuleNum;}; //
37 TArrayF * GetCorrection(int icol, int irow)
38 { return &fCorrection[icol][irow]; };
41 Int_t fSuperModuleNum; // SM id
42 TArrayF fCorrection[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; // values
44 ClassDef(AliEMCALSuperModuleCalibTimeDepCorrection, 2) // help class
46 // ******* end of internal class definition *************
48 class AliEMCALCalibTimeDepCorrection : public TObject {
50 AliEMCALCalibTimeDepCorrection(const int nSM = AliEMCALGeoParams::fgkEMCALModules);
52 // interface methods; getting the whole struct should be more efficient though
53 void InitCorrection(Int_t nSM, Int_t nBins, Float_t val=1.0); // assign a certain value to all
54 // use the methods below with caution: take care that your argument ranges are valid
55 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
56 Float_t GetCorrection(Int_t smIndex, Int_t iCol, Int_t iRow, Int_t iBin) const; // assign a certain value to a given bin
58 // Read and Write txt I/O methods are normally not used, but are useful for
59 // filling the object before it is saved in OCDB
60 void ReadTextInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
61 void WriteTextInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
62 void ReadRootInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
63 void ReadTreeInfo(TTree *treeGlob, TTree *treeCorr, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
64 void WriteRootInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
66 virtual ~AliEMCALCalibTimeDepCorrection();
68 // pointer to stored info.
69 Int_t GetNSuperModule() const { return fNSuperModule; };
71 // - via the index in the stored array:
72 virtual AliEMCALSuperModuleCalibTimeDepCorrection * GetSuperModuleCalibTimeDepCorrectionId(Int_t smIndex) const
73 { return (AliEMCALSuperModuleCalibTimeDepCorrection*) fSuperModuleData[smIndex]; };
75 // - or via the actual SM number
76 virtual AliEMCALSuperModuleCalibTimeDepCorrection * GetSuperModuleCalibTimeDepCorrectionNum(Int_t smNum) const;
78 void SetStartTime(UInt_t ui) { fStartTime = ui; } //
79 void SetNTimeBins(Int_t i) { fNTimeBins = i; } //
80 void SetTimeBinSize(Int_t i) { fTimeBinSize = i; } //
82 Int_t GetStartTime() const { return fStartTime; } //
83 Int_t GetNTimeBins() const { return fNTimeBins; } //
84 Int_t GetTimeBinSize() const { return fTimeBinSize; } //
86 static Int_t GetMaxTimeBins() { return fgkMaxTimeBins; }
90 Int_t fNSuperModule; // Number of supermodules.
91 TObjArray fSuperModuleData; // SuperModule data
95 AliEMCALCalibTimeDepCorrection(const AliEMCALCalibTimeDepCorrection &);
96 AliEMCALCalibTimeDepCorrection &operator = (const AliEMCALCalibTimeDepCorrection &);
98 UInt_t fStartTime; // timestamp for start of run/first bin
99 Int_t fNTimeBins; // how many timestamp bins do we have
100 Int_t fTimeBinSize; // seconds per time-bin
102 static const Int_t fgkMaxTimeBins = 50; // we are not going to have more correction time bins than this for a single runnumber..
104 ClassDef(AliEMCALCalibTimeDepCorrection, 3) //