]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALCalibMapAPD.h
intermediate calibration class commit: struct changed to classes and added root i/o
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALCalibMapAPD.h
CommitLineData
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>
12class TString;
61917ab3 13class TTree;
d81e6423 14
15/*
61917ab3 16 Objects of this class contain info on APD calibration and map info
d81e6423 17*/
18
61917ab3 19// ******* internal class definition *************
20// values per single APD
21class AliEMCALCalibMapAPDVal : public TObject {
22
23 public:
24 AliEMCALCalibMapAPDVal() : TObject(), // just init values
25 fHardWareId(0),
26 fAPDNum(0),
27 fV30(0),
28 fBreakDown(0),
29 fDarkCurrent(0)
30 {
31 Init();
32 }
33
34 void Init() {
35 fHardWareId = 0;
36 fAPDNum = 0;
37 fV30 = 0;
38 fBreakDown = 0;
39 fDarkCurrent = 0;
40 for (int i=0; i<3; i++) {
41 fPar[i] = 0;
42 fParErr[i] = 0;
43 }
44 return;
45 }
46
47 public:
48 Int_t fHardWareId; // HardWareIndex
49 // info from APD calibrations
50 Int_t fAPDNum; // assigned APD-PA number; Catania 10000-, Houston: 20000-
51 Float_t fV30; // Catania/Houston Voltage V30 (V) at T = 25 deg C
52 Float_t fPar[3]; // fit parameters, p0,p1,p2 - for ADC vs bias measurement
53 Float_t fParErr[3]; // error on fit parameters
54
55 Int_t fBreakDown; // Hamamatsu Breakdown Voltage (V)
56 Float_t fDarkCurrent; // Hamamatsu Dark Current (A)
57
58 ClassDef(AliEMCALCalibMapAPDVal, 1) // help class
59}; // AliEMCALCalibAPDVal
60
61// 1 SuperModule's worth of info: info on where the different APDs are
62class AliEMCALSuperModuleCalibMapAPD : public TObject {
63 public:
64 // AliEMCALSuperModuleCalibMapAPD(Int_t nSM = 0);
65 AliEMCALSuperModuleCalibMapAPD() : TObject(), // just init values
66 fSuperModuleNum(0)
67 {
68 for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) {
69 for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) {
70 fAPDVal[icol][irow].Init();
71 }
72 }
73 }
74
75 public:
76 Int_t fSuperModuleNum;
77 AliEMCALCalibMapAPDVal fAPDVal[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows];
78
79 ClassDef(AliEMCALSuperModuleCalibMapAPD, 1) // help class
80};
81// ******* end of internal class definition *************
82
d81e6423 83class AliEMCALCalibMapAPD : public TObject {
84
85public:
86
87 enum kValType {kCalibTemp=25};// 25 deg C used for all APD calibrations
88
89 AliEMCALCalibMapAPD();
90
91 // Read and Write txt I/O methods are normally not used, but are useful for
92 // filling the object before it is saved in OCDB
61917ab3 93 void ReadTextCalibMapAPDInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
94 void WriteTextCalibMapAPDInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
95 void ReadRootCalibMapAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
96 void ReadTreeCalibMapAPDInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
97 void WriteRootCalibMapAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
d81e6423 98
99 virtual ~AliEMCALCalibMapAPD();
100
d81e6423 101 // pointer to stored info.
d81e6423 102 Int_t GetNSuperModule() const { return fNSuperModule; };
103 AliEMCALSuperModuleCalibMapAPD * GetSuperModuleData() const { return fSuperModuleData; };
104
105 // - via the index in the stored array:
106 virtual AliEMCALSuperModuleCalibMapAPD GetSuperModuleCalibMapAPDId(Int_t smIndex) const;
107 // - or via the actual SM number
108 virtual AliEMCALSuperModuleCalibMapAPD GetSuperModuleCalibMapAPDNum(Int_t smNum) const;
109
110 // method to calculate gain M from fit parameters, and HV value
111 Float_t GetGain(Float_t fitPar[3], Float_t HV) const
112 { return (fitPar[0] + fitPar[1] * exp(fitPar[2]*HV)); };
113 Float_t GetGain(Float_t fitPar0, Float_t fitPar1, Float_t fitPar2, Float_t HV) const
114 { return (fitPar0 + fitPar1 * exp(fitPar2*HV)); };
115
116protected:
117
118 Int_t fNSuperModule; // Number of supermodules.
119 AliEMCALSuperModuleCalibMapAPD *fSuperModuleData; // SuperModule data
120
121private:
122
123 AliEMCALCalibMapAPD(const AliEMCALCalibMapAPD &);
124 AliEMCALCalibMapAPD &operator = (const AliEMCALCalibMapAPD &);
125
61917ab3 126 ClassDef(AliEMCALCalibMapAPD, 2) //CalibMapAPD data info
d81e6423 127};
128
129#endif