Modifications by Thomas
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALCalibTimeDepCorrection.h
CommitLineData
d81e6423 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>
0c5b726e 10#include <TArrayF.h>
d81e6423 11#include "AliEMCALGeoParams.h"
12class TString;
61917ab3 13class TTree;
d81e6423 14
15/*
61917ab3 16 Objects of this class contain info on time-dependent corrections
d81e6423 17*/
18
61917ab3 19// ******* internal class definition *************
20// 1 SuperModule's worth of info
21class AliEMCALSuperModuleCalibTimeDepCorrection : public TObject {
22 public:
23 AliEMCALSuperModuleCalibTimeDepCorrection() : TObject(), // just init values
24 fSuperModuleNum(0)
25 {
26 for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) {
27 for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) {
28 fCorrection[icol][irow].Reset();
29 }
30 }
31 }
32
33 public:
34 Int_t fSuperModuleNum;
35 TArrayF fCorrection[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows];
36
37 ClassDef(AliEMCALSuperModuleCalibTimeDepCorrection, 1) // help class
38};
39// ******* end of internal class definition *************
40
d81e6423 41class AliEMCALCalibTimeDepCorrection : public TObject {
61917ab3 42 public:
d81e6423 43 AliEMCALCalibTimeDepCorrection();
44
45 // interface methods; getting the whole struct should be more efficient though
61917ab3 46 void InitCorrection(Int_t nSM, Int_t nBins, Float_t val); // assign a certain value to all
d81e6423 47 // use the methods below with caution: take care that your argument ranges are valid
48 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
49 Float_t GetCorrection(Int_t smIndex, Int_t iCol, Int_t iRow, Int_t iBin) const; // assign a certain value to a given bin
50
51
52 // Read and Write txt I/O methods are normally not used, but are useful for
53 // filling the object before it is saved in OCDB
61917ab3 54 void ReadTextInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
55 void WriteTextInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
56 void ReadRootInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
57 void ReadTreeInfo(TTree *treeGlob, TTree *treeCorr, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
58 void WriteRootInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
d81e6423 59
60 virtual ~AliEMCALCalibTimeDepCorrection();
61
d81e6423 62 // pointer to stored info.
63 Int_t GetNSuperModule() const { return fNSuperModule; };
64 AliEMCALSuperModuleCalibTimeDepCorrection * GetSuperModuleData() const { return fSuperModuleData; };
65
66 // - via the index in the stored array:
67 virtual AliEMCALSuperModuleCalibTimeDepCorrection GetSuperModuleCalibTimeDepCorrectionId(Int_t smIndex) const;
68 // - or via the actual SM number
69 virtual AliEMCALSuperModuleCalibTimeDepCorrection GetSuperModuleCalibTimeDepCorrectionNum(Int_t smNum) const;
70
220ed45a 71 void SetStartTime(UInt_t ui) { fStartTime = ui; } //
72 void SetNTimeBins(Int_t i) { fNTimeBins = i; } //
73 void SetTimeBinSize(Int_t i) { fTimeBinSize = i; } //
74
75 Int_t GetStartTime() const { return fStartTime; } //
76 Int_t GetNTimeBins() const { return fNTimeBins; } //
77 Int_t GetTimeBinSize() const { return fTimeBinSize; } //
78
61917ab3 79 static Int_t GetMaxTimeBins() { return fgkMaxTimeBins; }
80
d81e6423 81protected:
82
83 Int_t fNSuperModule; // Number of supermodules.
84 AliEMCALSuperModuleCalibTimeDepCorrection *fSuperModuleData; // SuperModule data
85
86private:
87
88 AliEMCALCalibTimeDepCorrection(const AliEMCALCalibTimeDepCorrection &);
89 AliEMCALCalibTimeDepCorrection &operator = (const AliEMCALCalibTimeDepCorrection &);
90
220ed45a 91 UInt_t fStartTime; // timestamp for start of run/first bin
92 Int_t fNTimeBins; // how many timestamp bins do we have
93 Int_t fTimeBinSize; // seconds per time-bin
94
61917ab3 95 static const Int_t fgkMaxTimeBins = 50; // we are not going to have more correction time bins than this for a single runnumber..
96
220ed45a 97 ClassDef(AliEMCALCalibTimeDepCorrection, 2) //
d81e6423 98};
99
100#endif