#ifndef ALIEMCALCALIBMAPAPD_H
#define ALIEMCALCALIBMAPAPD_H
#include <TObject.h>
#include <TObjArray.h>
#include "AliEMCALGeoParams.h"
#include <cmath>
class TString;
class TTree;
class AliEMCALCalibMapAPDVal : public TObject {
public:
AliEMCALCalibMapAPDVal() : TObject(),
fHardWareId(0),
fAPDNum(0),
fV30(0),
fBreakDown(0),
fDarkCurrent(0)
{
Init();
}
void Init() {
fHardWareId = 0;
fAPDNum = 0;
fV30 = 0;
fBreakDown = 0;
fDarkCurrent = 0;
for (int i=0; i<3; i++) {
fPar[i] = 0;
fParErr[i] = 0;
}
return;
}
public:
void SetHardWareId(Int_t i) { fHardWareId = i; };
Int_t GetHardWareId() const { return fHardWareId; };
void SetAPDNum(Int_t i) { fAPDNum = i; };
Int_t GetAPDNum() const { return fAPDNum; };
void SetV30(Float_t f) { fV30 = f; };
Float_t GetV30() const { return fV30; };
void SetPar(int ip, Float_t f) { fPar[ip] = f; };
Float_t GetPar(int ip) const { return fPar[ip]; };
void SetParErr(int ip, Float_t f) { fParErr[ip] = f; };
Float_t GetParErr(int ip) const { return fParErr[ip]; };
void SetBreakDown(Int_t i) { fBreakDown = i; };
Int_t GetBreakDown() const { return fBreakDown; };
void SetDarkCurrent(Float_t f) { fDarkCurrent = f; };
Float_t GetDarkCurrent() const { return fDarkCurrent; };
private:
Int_t fHardWareId;
Int_t fAPDNum;
Float_t fV30;
Float_t fPar[3];
Float_t fParErr[3];
Int_t fBreakDown;
Float_t fDarkCurrent;
ClassDef(AliEMCALCalibMapAPDVal, 2)
};
class AliEMCALSuperModuleCalibMapAPD : public TObject {
public:
AliEMCALSuperModuleCalibMapAPD(const int smNum=0) : TObject(),
fSuperModuleNum(smNum)
{
for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) {
for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) {
fAPDVal[icol][irow].Init();
}
}
}
public:
void SetSuperModuleNum(Int_t i) { fSuperModuleNum = i;};
Int_t GetSuperModuleNum() const { return fSuperModuleNum;};
AliEMCALCalibMapAPDVal * GetAPDVal(int icol, int irow)
{ return &fAPDVal[icol][irow]; };
private:
Int_t fSuperModuleNum;
AliEMCALCalibMapAPDVal fAPDVal[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows];
ClassDef(AliEMCALSuperModuleCalibMapAPD, 2)
};
class AliEMCALCalibMapAPD : public TObject {
public:
enum kValType {kCalibTemp=25};
AliEMCALCalibMapAPD(const int nSM = AliEMCALGeoParams::fgkEMCALModules);
void ReadTextCalibMapAPDInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE);
void WriteTextCalibMapAPDInfo(const TString &txtFileName, Bool_t swapSides=kFALSE);
void ReadRootCalibMapAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE);
void ReadTreeCalibMapAPDInfo(TTree *tree, Bool_t swapSides=kFALSE);
void WriteRootCalibMapAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE);
virtual ~AliEMCALCalibMapAPD();
Int_t GetNSuperModule() const { return fNSuperModule; };
virtual AliEMCALSuperModuleCalibMapAPD * GetSuperModuleCalibMapAPDId(Int_t smIndex) const
{ return (AliEMCALSuperModuleCalibMapAPD*) fSuperModuleData[smIndex]; };
virtual AliEMCALSuperModuleCalibMapAPD * GetSuperModuleCalibMapAPDNum(Int_t smNum) const;
Float_t GetGain(Float_t fitPar[3], Float_t HV) const
{ return (fitPar[0] + fitPar[1] * exp(fitPar[2]*HV)); };
Float_t GetGain(Float_t fitPar0, Float_t fitPar1, Float_t fitPar2, Float_t HV) const
{ return (fitPar0 + fitPar1 * exp(fitPar2*HV)); };
protected:
Int_t fNSuperModule;
TObjArray fSuperModuleData;
private:
AliEMCALCalibMapAPD(const AliEMCALCalibMapAPD &);
AliEMCALCalibMapAPD &operator = (const AliEMCALCalibMapAPD &);
ClassDef(AliEMCALCalibMapAPD, 3)
};
#endif
AliEMCALCalibMapAPD.h:100 AliEMCALCalibMapAPD.h:101 AliEMCALCalibMapAPD.h:102 AliEMCALCalibMapAPD.h:103 AliEMCALCalibMapAPD.h:104 AliEMCALCalibMapAPD.h:105 AliEMCALCalibMapAPD.h:106 AliEMCALCalibMapAPD.h:107 AliEMCALCalibMapAPD.h:108 AliEMCALCalibMapAPD.h:109 AliEMCALCalibMapAPD.h:110 AliEMCALCalibMapAPD.h:111 AliEMCALCalibMapAPD.h:112 AliEMCALCalibMapAPD.h:113 AliEMCALCalibMapAPD.h:114 AliEMCALCalibMapAPD.h:115 AliEMCALCalibMapAPD.h:116 AliEMCALCalibMapAPD.h:117 AliEMCALCalibMapAPD.h:118 AliEMCALCalibMapAPD.h:119 AliEMCALCalibMapAPD.h:120 AliEMCALCalibMapAPD.h:121 AliEMCALCalibMapAPD.h:122 AliEMCALCalibMapAPD.h:123 AliEMCALCalibMapAPD.h:124 AliEMCALCalibMapAPD.h:125 AliEMCALCalibMapAPD.h:126 AliEMCALCalibMapAPD.h:127 AliEMCALCalibMapAPD.h:128 AliEMCALCalibMapAPD.h:129 AliEMCALCalibMapAPD.h:130 AliEMCALCalibMapAPD.h:131 AliEMCALCalibMapAPD.h:132 AliEMCALCalibMapAPD.h:133 AliEMCALCalibMapAPD.h:134 AliEMCALCalibMapAPD.h:135 AliEMCALCalibMapAPD.h:136 AliEMCALCalibMapAPD.h:137 AliEMCALCalibMapAPD.h:138 AliEMCALCalibMapAPD.h:139 AliEMCALCalibMapAPD.h:140 AliEMCALCalibMapAPD.h:141 AliEMCALCalibMapAPD.h:142 AliEMCALCalibMapAPD.h:143 AliEMCALCalibMapAPD.h:144 AliEMCALCalibMapAPD.h:145 AliEMCALCalibMapAPD.h:146 AliEMCALCalibMapAPD.h:147 AliEMCALCalibMapAPD.h:148 AliEMCALCalibMapAPD.h:149 AliEMCALCalibMapAPD.h:150 AliEMCALCalibMapAPD.h:151 AliEMCALCalibMapAPD.h:152 AliEMCALCalibMapAPD.h:153