1 #ifndef ALIEMCALCALIBMAPAPD_H
2 #define ALIEMCALCALIBMAPAPD_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>
11 #include "AliEMCALGeoParams.h"
17 Objects of this class contain info on APD calibration and map info
20 // ******* internal class definition *************
21 // values per single APD
22 class AliEMCALCalibMapAPDVal : public TObject {
25 AliEMCALCalibMapAPDVal() : TObject(), // just init values
41 for (int i=0; i<3; i++) {
49 void SetHardWareId(Int_t i) { fHardWareId = i; }; //
50 Int_t GetHardWareId() const { return fHardWareId; }; //
51 void SetAPDNum(Int_t i) { fAPDNum = i; }; //
52 Int_t GetAPDNum() const { return fAPDNum; }; //
53 void SetV30(Float_t f) { fV30 = f; }; //
54 Float_t GetV30() const { return fV30; }; //
55 void SetPar(int ip, Float_t f) { fPar[ip] = f; }; //
56 Float_t GetPar(int ip) const { return fPar[ip]; }; //
57 void SetParErr(int ip, Float_t f) { fParErr[ip] = f; }; //
58 Float_t GetParErr(int ip) const { return fParErr[ip]; }; //
59 void SetBreakDown(Int_t i) { fBreakDown = i; }; //
60 Int_t GetBreakDown() const { return fBreakDown; }; //
61 void SetDarkCurrent(Float_t f) { fDarkCurrent = f; }; //
62 Float_t GetDarkCurrent() const { return fDarkCurrent; }; //
65 Int_t fHardWareId; // HardWareIndex
66 // info from APD calibrations
67 Int_t fAPDNum; // assigned APD-PA number; Catania 10000-, Houston: 20000-
68 Float_t fV30; // Catania/Houston Voltage V30 (V) at T = 25 deg C
69 Float_t fPar[3]; // fit parameters, p0,p1,p2 - for ADC vs bias measurement
70 Float_t fParErr[3]; // error on fit parameters
72 Int_t fBreakDown; // Hamamatsu Breakdown Voltage (V)
73 Float_t fDarkCurrent; // Hamamatsu Dark Current (A)
75 ClassDef(AliEMCALCalibMapAPDVal, 2) // help class
76 }; // AliEMCALCalibAPDVal
78 // 1 SuperModule's worth of info: info on where the different APDs are
79 class AliEMCALSuperModuleCalibMapAPD : public TObject {
81 AliEMCALSuperModuleCalibMapAPD(const int smNum=0) : TObject(), // just init values
82 fSuperModuleNum(smNum)
84 for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) {
85 for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) {
86 fAPDVal[icol][irow].Init();
92 void SetSuperModuleNum(Int_t i) { fSuperModuleNum = i;}; //
93 Int_t GetSuperModuleNum() const { return fSuperModuleNum;}; //
94 AliEMCALCalibMapAPDVal * GetAPDVal(int icol, int irow)
95 { return &fAPDVal[icol][irow]; };
98 Int_t fSuperModuleNum;
99 AliEMCALCalibMapAPDVal fAPDVal[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows];
101 ClassDef(AliEMCALSuperModuleCalibMapAPD, 2) // help class
103 // ******* end of internal class definition *************
105 class AliEMCALCalibMapAPD : public TObject {
109 enum kValType {kCalibTemp=25};// 25 deg C used for all APD calibrations
111 AliEMCALCalibMapAPD(const int nSM = AliEMCALGeoParams::fgkEMCALModules);
113 // Read and Write txt I/O methods are normally not used, but are useful for
114 // filling the object before it is saved in OCDB
115 void ReadTextCalibMapAPDInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
116 void WriteTextCalibMapAPDInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
117 void ReadRootCalibMapAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
118 void ReadTreeCalibMapAPDInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
119 void WriteRootCalibMapAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
121 virtual ~AliEMCALCalibMapAPD();
123 // pointer to stored info.
124 Int_t GetNSuperModule() const { return fNSuperModule; };
126 // - via the index in the stored array:
127 virtual AliEMCALSuperModuleCalibMapAPD * GetSuperModuleCalibMapAPDId(Int_t smIndex) const
128 { return (AliEMCALSuperModuleCalibMapAPD*) fSuperModuleData[smIndex]; };
130 // - or via the actual SM number
131 virtual AliEMCALSuperModuleCalibMapAPD * GetSuperModuleCalibMapAPDNum(Int_t smNum) const;
133 // method to calculate gain M from fit parameters, and HV value
134 Float_t GetGain(Float_t fitPar[3], Float_t HV) const
135 { return (fitPar[0] + fitPar[1] * exp(fitPar[2]*HV)); };
136 Float_t GetGain(Float_t fitPar0, Float_t fitPar1, Float_t fitPar2, Float_t HV) const
137 { return (fitPar0 + fitPar1 * exp(fitPar2*HV)); };
141 Int_t fNSuperModule; // Number of supermodules.
142 TObjArray fSuperModuleData; // SuperModule data
146 AliEMCALCalibMapAPD(const AliEMCALCalibMapAPD &);
147 AliEMCALCalibMapAPD &operator = (const AliEMCALCalibMapAPD &);
149 ClassDef(AliEMCALCalibMapAPD, 3) //CalibMapAPD data info