]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSEmcCalibData.cxx
New default calibration parameters (Yu.Kharlov)
[u/mrichter/AliRoot.git] / PHOS / AliPHOSEmcCalibData.cxx
CommitLineData
fc6706cb 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16///////////////////////////////////////////////////////////////////////////////
17// //
18// class for PHOS EmCal calibration //
19// //
20///////////////////////////////////////////////////////////////////////////////
21
22#include "AliPHOSEmcCalibData.h"
23
24ClassImp(AliPHOSEmcCalibData)
25
26//________________________________________________________________
27AliPHOSEmcCalibData::AliPHOSEmcCalibData()
28{
29 // Default constructor
30 Reset();
31}
32
33//________________________________________________________________
34AliPHOSEmcCalibData::AliPHOSEmcCalibData(const char* name)
35{
36 // Constructor
37 TString namst = "Calib_";
38 namst += name;
39 SetName(namst.Data());
40 SetTitle(namst.Data());
41 Reset();
42}
43
44//________________________________________________________________
45AliPHOSEmcCalibData::AliPHOSEmcCalibData(const AliPHOSEmcCalibData& calibda) :
46 TNamed(calibda)
47{
48 // copy constructor
49 SetName(calibda.GetName());
50 SetTitle(calibda.GetName());
51 Reset();
52 for(Int_t module=0; module<5; module++) {
53 for(Int_t column=0; column<56; column++) {
54 for(Int_t row=0; row<64; row++) {
55 fADCchannelEmc[module][column][row] = calibda.GetADCchannelEmc(module,column,row);
56 fADCpedestalEmc[module][column][row] = calibda.GetADCpedestalEmc(module,column,row);
57 }
58 }
59 }
60}
61
62//________________________________________________________________
63AliPHOSEmcCalibData &AliPHOSEmcCalibData::operator =(const AliPHOSEmcCalibData& calibda)
64{
65 // assignment operator
66 SetName(calibda.GetName());
67 SetTitle(calibda.GetName());
68 Reset();
69 for(Int_t module=0; module<5; module++) {
70 for(Int_t column=0; column<56; column++) {
71 for(Int_t row=0; row<64; row++) {
72 fADCchannelEmc[module][column][row] = calibda.GetADCchannelEmc(module,column,row);
73 fADCpedestalEmc[module][column][row] = calibda.GetADCpedestalEmc(module,column,row);
74 }
75 }
76 }
77 return *this;
78}
79
80//________________________________________________________________
81AliPHOSEmcCalibData::~AliPHOSEmcCalibData()
82{
83 // Destructor
84}
85
86//________________________________________________________________
87void AliPHOSEmcCalibData::Reset()
88{
72e5feac 89 // Set all pedestals and all ADC channels to its ideal values = 1.
fc6706cb 90
91 for (Int_t module=0; module<5; module++){
92 for (Int_t column=0; column<56; column++){
93 for (Int_t row=0; row<64; row++){
72e5feac 94 fADCpedestalEmc[module][column][row] = 0.;
95 fADCchannelEmc[module][column][row] = 1.;
fc6706cb 96 }
97 }
98 }
99
100}
101
102//________________________________________________________________
103void AliPHOSEmcCalibData::Print(Option_t *option) const
104{
105 // Print tables of pedestals and ADC channels
106
107 if (strstr(option,"ped")) {
108 printf("\n ---- EMC Pedestal values ----\n\n");
109 for (Int_t module=0; module<5; module++){
110 printf("============== Module %d\n",module+1);
111 for (Int_t column=0; column<56; column++){
112 for (Int_t row=0; row<64; row++){
113 printf("%4.1f",fADCpedestalEmc[module][column][row]);
114 }
115 printf("\n");
116 }
117 }
118 }
119
120 if (strstr(option,"gain")) {
121 printf("\n ---- EMC ADC channel values ----\n\n");
122 for (Int_t module=0; module<5; module++){
123 printf("============== Module %d\n",module+1);
124 for (Int_t column=0; column<56; column++){
125 for (Int_t row=0; row<64; row++){
126 printf("%4.1f",fADCchannelEmc[module][column][row]);
127 }
128 printf("\n");
129 }
130 }
131 }
132}
133
1fdb1c5e 134//________________________________________________________________
fc6706cb 135Float_t AliPHOSEmcCalibData::GetADCchannelEmc(Int_t module, Int_t column, Int_t row) const
136{
1fdb1c5e 137 //Return EMC calibration coefficient
fc6706cb 138 //module, column,raw should follow the internal PHOS convention:
139 //module 1:5, column 1:56, row 1:64
140
141 return fADCchannelEmc[module-1][column-1][row-1];
142}
143
1fdb1c5e 144//________________________________________________________________
fc6706cb 145Float_t AliPHOSEmcCalibData::GetADCpedestalEmc(Int_t module, Int_t column, Int_t row) const
146{
1fdb1c5e 147 //Return EMC pedestal
148 //module, column,raw should follow the internal PHOS convention:
149 //module 1:5, column 1:56, row 1:64
150
fc6706cb 151 return fADCpedestalEmc[module-1][column-1][row-1];
152}
153
1fdb1c5e 154//________________________________________________________________
fc6706cb 155void AliPHOSEmcCalibData::SetADCchannelEmc(Int_t module, Int_t column, Int_t row, Float_t value)
156{
1fdb1c5e 157 //Set EMC calibration coefficient
158 //module, column,raw should follow the internal PHOS convention:
159 //module 1:5, column 1:56, row 1:64
160
fc6706cb 161 fADCchannelEmc[module-1][column-1][row-1] = value;
162}
163
1fdb1c5e 164//________________________________________________________________
fc6706cb 165void AliPHOSEmcCalibData::SetADCpedestalEmc(Int_t module, Int_t column, Int_t row, Float_t value)
166{
1fdb1c5e 167 //Set EMC pedestal
168 //module, column,raw should follow the internal PHOS convention:
169 //module 1:5, column 1:56, row 1:64
fc6706cb 170 fADCpedestalEmc[module-1][column-1][row-1] = value;
171}