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,
18 such as V30 and other parameters from the tests in Catania/Houston,
19 as well as info on which APD is located where.
22 // ******* internal class definition *************
23 // values per single APD
24 class AliEMCALCalibMapAPDVal : public TObject {
27 AliEMCALCalibMapAPDVal() : TObject(), // just init values
43 for (int i=0; i<3; i++) {
51 void SetHardWareId(Int_t i) { fHardWareId = i; }; //
52 Int_t GetHardWareId() const { return fHardWareId; }; //
53 void SetAPDNum(Int_t i) { fAPDNum = i; }; //
54 Int_t GetAPDNum() const { return fAPDNum; }; //
55 void SetV30(Float_t f) { fV30 = f; }; //
56 Float_t GetV30() const { return fV30; }; //
57 void SetPar(int ip, Float_t f) { fPar[ip] = f; }; //
58 Float_t GetPar(int ip) const { return fPar[ip]; }; //
59 void SetParErr(int ip, Float_t f) { fParErr[ip] = f; }; //
60 Float_t GetParErr(int ip) const { return fParErr[ip]; }; //
61 void SetBreakDown(Int_t i) { fBreakDown = i; }; //
62 Int_t GetBreakDown() const { return fBreakDown; }; //
63 void SetDarkCurrent(Float_t f) { fDarkCurrent = f; }; //
64 Float_t GetDarkCurrent() const { return fDarkCurrent; }; //
67 Int_t fHardWareId; // HardWareIndex
68 // info from APD calibrations
69 Int_t fAPDNum; // assigned APD-PA number; Catania 10000-, Houston: 20000-
70 Float_t fV30; // Catania/Houston Voltage V30 (V) at T = 25 deg C
71 Float_t fPar[3]; // fit parameters, p0,p1,p2 - for ADC vs bias measurement
72 Float_t fParErr[3]; // error on fit parameters
74 Int_t fBreakDown; // Hamamatsu Breakdown Voltage (V)
75 Float_t fDarkCurrent; // Hamamatsu Dark Current (A)
77 ClassDef(AliEMCALCalibMapAPDVal, 2) // help class
78 }; // AliEMCALCalibAPDVal
80 // 1 SuperModule's worth of info: info on where the different APDs are
81 class AliEMCALSuperModuleCalibMapAPD : public TObject {
83 AliEMCALSuperModuleCalibMapAPD(const int smNum=0) : TObject(), // just init values
84 fSuperModuleNum(smNum)
86 for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) {
87 for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) {
88 fAPDVal[icol][irow].Init();
94 void SetSuperModuleNum(Int_t i) { fSuperModuleNum = i;}; //
95 Int_t GetSuperModuleNum() const { return fSuperModuleNum;}; //
96 AliEMCALCalibMapAPDVal * GetAPDVal(int icol, int irow)
97 { return &fAPDVal[icol][irow]; };
100 Int_t fSuperModuleNum; // SuperModule index
101 AliEMCALCalibMapAPDVal fAPDVal[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; // APD calibration info
103 ClassDef(AliEMCALSuperModuleCalibMapAPD, 2) // help class
105 // ******* end of internal class definition *************
107 class AliEMCALCalibMapAPD : public TObject {
111 enum kValType {kCalibTemp=25};// 25 deg C used for all APD calibrations
113 AliEMCALCalibMapAPD(const int nSM = AliEMCALGeoParams::fgkEMCALModules);
115 // Read and Write txt I/O methods are normally not used, but are useful for
116 // filling the object before it is saved in OCDB
117 void ReadTextCalibMapAPDInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
118 void WriteTextCalibMapAPDInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
119 void ReadRootCalibMapAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
120 void ReadTreeCalibMapAPDInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
121 void WriteRootCalibMapAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
123 virtual ~AliEMCALCalibMapAPD();
125 // pointer to stored info.
126 Int_t GetNSuperModule() const { return fNSuperModule; };
128 // on a SuperModule level
129 virtual AliEMCALSuperModuleCalibMapAPD * GetSuperModuleCalibMapAPDId(Int_t smIndex) const
130 { return (AliEMCALSuperModuleCalibMapAPD*) fSuperModuleData[smIndex]; }; // - via the index in the stored array:
132 virtual AliEMCALSuperModuleCalibMapAPD * GetSuperModuleCalibMapAPDNum(Int_t smNum) const; // - or via the actual SM number
134 // method to calculate gain M from fit parameters, and HV value
135 Float_t GetGain(Float_t fitPar[3], Float_t HV) const
136 { return (fitPar[0] + fitPar[1] * exp(fitPar[2]*HV)); };
137 Float_t GetGain(Float_t fitPar0, Float_t fitPar1, Float_t fitPar2, Float_t HV) const
138 { return (fitPar0 + fitPar1 * exp(fitPar2*HV)); };
142 Int_t fNSuperModule; // Number of supermodules.
143 TObjArray fSuperModuleData; // SuperModule data
147 AliEMCALCalibMapAPD(const AliEMCALCalibMapAPD &);
148 AliEMCALCalibMapAPD &operator = (const AliEMCALCalibMapAPD &);
150 ClassDef(AliEMCALCalibMapAPD, 3) //CalibMapAPD data info