]>
Commit | Line | Data |
---|---|---|
d81e6423 | 1 | #ifndef ALIEMCALCALIBMAPAPD_H |
2 | #define ALIEMCALCALIBMAPAPD_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> | |
10 | #include "AliEMCALGeoParams.h" | |
11 | #include <cmath> | |
12 | class TString; | |
13 | ||
14 | /* | |
15 | Objects of this class read txt file with APD data | |
16 | AliEMCALCalibMapAPD inherits TObject only to use AliLog "functions". | |
17 | */ | |
18 | ||
19 | class AliEMCALCalibMapAPD : public TObject { | |
20 | ||
21 | public: | |
22 | ||
23 | enum kValType {kCalibTemp=25};// 25 deg C used for all APD calibrations | |
24 | ||
25 | AliEMCALCalibMapAPD(); | |
26 | ||
27 | // Read and Write txt I/O methods are normally not used, but are useful for | |
28 | // filling the object before it is saved in OCDB | |
29 | void ReadCalibMapAPDInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules | |
30 | ||
31 | void WriteCalibMapAPDInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules | |
32 | ||
33 | virtual ~AliEMCALCalibMapAPD(); | |
34 | ||
35 | // values per single APD | |
36 | struct AliEMCALCalibMapAPDVal { | |
37 | ||
38 | Int_t fHardWareId; // HardWareIndex | |
39 | // info from APD calibrations | |
40 | Int_t fAPDNum; // assigned APD-PA number; Catania 10000-, Houston: 20000- | |
41 | Float_t fV30; // Catania/Houston Voltage V30 (V) at T = 25 deg C | |
42 | Float_t fPar[3]; // fit parameters, p0,p1,p2 - for ADC vs bias measurement | |
43 | Float_t fParErr[3]; // error on fit parameters | |
44 | ||
45 | Int_t fBreakDown; // Hamamatsu Breakdown Voltage (V) | |
46 | Float_t fDarkCurrent; // Hamamatsu Dark Current (A) | |
47 | }; | |
48 | ||
49 | // 1 SuperModule's worth of info: info on where the different APDs are | |
50 | struct AliEMCALSuperModuleCalibMapAPD { | |
51 | Int_t fSuperModuleNum; | |
52 | AliEMCALCalibMapAPDVal fAPDVal[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; | |
53 | }; | |
54 | ||
55 | // pointer to stored info. | |
56 | ||
57 | Int_t GetNSuperModule() const { return fNSuperModule; }; | |
58 | AliEMCALSuperModuleCalibMapAPD * GetSuperModuleData() const { return fSuperModuleData; }; | |
59 | ||
60 | // - via the index in the stored array: | |
61 | virtual AliEMCALSuperModuleCalibMapAPD GetSuperModuleCalibMapAPDId(Int_t smIndex) const; | |
62 | // - or via the actual SM number | |
63 | virtual AliEMCALSuperModuleCalibMapAPD GetSuperModuleCalibMapAPDNum(Int_t smNum) const; | |
64 | ||
65 | // method to calculate gain M from fit parameters, and HV value | |
66 | Float_t GetGain(Float_t fitPar[3], Float_t HV) const | |
67 | { return (fitPar[0] + fitPar[1] * exp(fitPar[2]*HV)); }; | |
68 | Float_t GetGain(Float_t fitPar0, Float_t fitPar1, Float_t fitPar2, Float_t HV) const | |
69 | { return (fitPar0 + fitPar1 * exp(fitPar2*HV)); }; | |
70 | ||
71 | protected: | |
72 | ||
73 | Int_t fNSuperModule; // Number of supermodules. | |
74 | AliEMCALSuperModuleCalibMapAPD *fSuperModuleData; // SuperModule data | |
75 | ||
76 | private: | |
77 | ||
78 | AliEMCALCalibMapAPD(const AliEMCALCalibMapAPD &); | |
79 | AliEMCALCalibMapAPD &operator = (const AliEMCALCalibMapAPD &); | |
80 | ||
81 | ClassDef(AliEMCALCalibMapAPD, 1) //MapAPD data reader | |
82 | }; | |
83 | ||
84 | #endif |