Line data Source code
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 <TObjArray.h>
11 : #include "AliEMCALGeoParams.h"
12 : #include <cmath>
13 : class TString;
14 : class TTree;
15 :
16 : /*
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.
20 : */
21 :
22 : // ******* internal class definition *************
23 : // values per single APD
24 0 : class AliEMCALCalibMapAPDVal : public TObject {
25 :
26 : public:
27 0 : AliEMCALCalibMapAPDVal() : TObject(), // just init values
28 0 : fHardWareId(0),
29 0 : fAPDNum(0),
30 0 : fV30(0),
31 0 : fBreakDown(0),
32 0 : fDarkCurrent(0)
33 0 : {
34 0 : Init();
35 0 : }
36 :
37 : void Init() {
38 0 : fHardWareId = 0;
39 0 : fAPDNum = 0;
40 0 : fV30 = 0;
41 0 : fBreakDown = 0;
42 0 : fDarkCurrent = 0;
43 0 : for (int i=0; i<3; i++) {
44 0 : fPar[i] = 0;
45 0 : fParErr[i] = 0;
46 : }
47 0 : return;
48 : }
49 :
50 : public:
51 0 : void SetHardWareId(Int_t i) { fHardWareId = i; }; //
52 0 : Int_t GetHardWareId() const { return fHardWareId; }; //
53 0 : void SetAPDNum(Int_t i) { fAPDNum = i; }; //
54 0 : Int_t GetAPDNum() const { return fAPDNum; }; //
55 0 : void SetV30(Float_t f) { fV30 = f; }; //
56 0 : Float_t GetV30() const { return fV30; }; //
57 0 : void SetPar(int ip, Float_t f) { fPar[ip] = f; }; //
58 0 : Float_t GetPar(int ip) const { return fPar[ip]; }; //
59 0 : void SetParErr(int ip, Float_t f) { fParErr[ip] = f; }; //
60 0 : Float_t GetParErr(int ip) const { return fParErr[ip]; }; //
61 0 : void SetBreakDown(Int_t i) { fBreakDown = i; }; //
62 0 : Int_t GetBreakDown() const { return fBreakDown; }; //
63 0 : void SetDarkCurrent(Float_t f) { fDarkCurrent = f; }; //
64 0 : Float_t GetDarkCurrent() const { return fDarkCurrent; }; //
65 :
66 : private:
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
73 :
74 : Int_t fBreakDown; // Hamamatsu Breakdown Voltage (V)
75 : Float_t fDarkCurrent; // Hamamatsu Dark Current (A)
76 :
77 42 : ClassDef(AliEMCALCalibMapAPDVal, 2) // help class
78 : }; // AliEMCALCalibAPDVal
79 :
80 : // 1 SuperModule's worth of info: info on where the different APDs are
81 0 : class AliEMCALSuperModuleCalibMapAPD : public TObject {
82 : public:
83 0 : AliEMCALSuperModuleCalibMapAPD(const int smNum=0) : TObject(), // just init values
84 0 : fSuperModuleNum(smNum)
85 0 : {
86 0 : for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) {
87 0 : for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) {
88 0 : fAPDVal[icol][irow].Init();
89 : }
90 : }
91 0 : }
92 :
93 : public:
94 0 : void SetSuperModuleNum(Int_t i) { fSuperModuleNum = i;}; //
95 0 : Int_t GetSuperModuleNum() const { return fSuperModuleNum;}; //
96 : AliEMCALCalibMapAPDVal * GetAPDVal(int icol, int irow)
97 0 : { return &fAPDVal[icol][irow]; };
98 :
99 : private:
100 : Int_t fSuperModuleNum; // SuperModule index
101 : AliEMCALCalibMapAPDVal fAPDVal[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; // APD calibration info
102 :
103 42 : ClassDef(AliEMCALSuperModuleCalibMapAPD, 2) // help class
104 : };
105 : // ******* end of internal class definition *************
106 :
107 : class AliEMCALCalibMapAPD : public TObject {
108 :
109 : public:
110 :
111 : enum kValType {kCalibTemp=25};// 25 deg C used for all APD calibrations
112 :
113 : AliEMCALCalibMapAPD(const int nSM = AliEMCALGeoParams::fgkEMCALModules);
114 :
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 fgkEMCALModules
118 : void WriteTextCalibMapAPDInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCALModules
119 : void ReadRootCalibMapAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCALModules
120 : void ReadTreeCalibMapAPDInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCALModules
121 : void WriteRootCalibMapAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCALModules
122 :
123 : virtual ~AliEMCALCalibMapAPD();
124 :
125 : // pointer to stored info.
126 0 : Int_t GetNSuperModule() const { return fNSuperModule; };
127 :
128 : // on a SuperModule level
129 : virtual AliEMCALSuperModuleCalibMapAPD * GetSuperModuleCalibMapAPDId(Int_t smIndex) const
130 0 : { return (AliEMCALSuperModuleCalibMapAPD*) fSuperModuleData[smIndex]; }; // - via the index in the stored array:
131 :
132 : virtual AliEMCALSuperModuleCalibMapAPD * GetSuperModuleCalibMapAPDNum(Int_t smNum) const; // - or via the actual SM number
133 :
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 0 : { 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 0 : { return (fitPar0 + fitPar1 * exp(fitPar2*HV)); };
139 :
140 : protected:
141 :
142 : Int_t fNSuperModule; // Number of supermodules.
143 : TObjArray fSuperModuleData; // SuperModule data
144 :
145 : private:
146 :
147 : AliEMCALCalibMapAPD(const AliEMCALCalibMapAPD &);
148 : AliEMCALCalibMapAPD &operator = (const AliEMCALCalibMapAPD &);
149 :
150 42 : ClassDef(AliEMCALCalibMapAPD, 3) //CalibMapAPD data info
151 : };
152 :
153 : #endif
|