#ifndef ALIEMCALBIASAPD_H
#define ALIEMCALBIASAPD_H
#include <TObject.h>
#include <TObjArray.h>
#include "AliEMCALGeoParams.h"
class TString;
class TTree;
class AliEMCALSuperModuleBiasAPD : public TObject {
public:
AliEMCALSuperModuleBiasAPD(const int smNum=0) : TObject(),
fSuperModuleNum(smNum)
{
for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) {
for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) {
fElecId[icol][irow] = 0;
fDAC[icol][irow] = 0;
fVoltage[icol][irow] = 0;
}
}
}
public:
void SetSuperModuleNum(Int_t i) { fSuperModuleNum = i;};
Int_t GetSuperModuleNum() const { return fSuperModuleNum;};
void SetElecId(int icol, int irow, Int_t i) { fElecId[icol][irow] = i; };
Int_t GetElecId(int icol, int irow) const { return fElecId[icol][irow]; };
void SetDAC(int icol, int irow, Int_t i) { fDAC[icol][irow] = i; };
Int_t GetDAC(int icol, int irow) const { return fDAC[icol][irow]; };
void SetVoltage(int icol, int irow, Float_t f) { fVoltage[icol][irow] = f; };
Float_t GetVoltage(int icol, int irow) const { return fVoltage[icol][irow]; };
private:
Int_t fSuperModuleNum;
Int_t fElecId[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows];
Int_t fDAC[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows];
Float_t fVoltage[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows];
ClassDef(AliEMCALSuperModuleBiasAPD, 2)
};
class AliEMCALBiasAPD : public TObject {
public:
AliEMCALBiasAPD(const int nSM = AliEMCALGeoParams::fgkEMCALModules);
void ReadTextBiasAPDInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE);
void WriteTextBiasAPDInfo(const TString &txtFileName, Bool_t swapSides=kFALSE);
void ReadRootBiasAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE);
void ReadTreeBiasAPDInfo(TTree *tree, Bool_t swapSides=kFALSE);
void WriteRootBiasAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE);
virtual ~AliEMCALBiasAPD();
Int_t GetNSuperModule() const { return fNSuperModule; };
virtual AliEMCALSuperModuleBiasAPD * GetSuperModuleBiasAPDId(Int_t smIndex) const
{ return (AliEMCALSuperModuleBiasAPD*) fSuperModuleData[smIndex]; };
virtual AliEMCALSuperModuleBiasAPD * GetSuperModuleBiasAPDNum(Int_t smNum) const;
protected:
Int_t fNSuperModule;
TObjArray fSuperModuleData;
private:
AliEMCALBiasAPD(const AliEMCALBiasAPD &);
AliEMCALBiasAPD &operator = (const AliEMCALBiasAPD &);
ClassDef(AliEMCALBiasAPD, 3)
};
#endif