Introduction of AliSurveyObj
[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//________________________________________________________________
27f8cf68 27 AliPHOSEmcCalibData::AliPHOSEmcCalibData(): TNamed()
fc6706cb 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());
27f8cf68 51
fc6706cb 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++) {
27f8cf68 55 fADCchannelEmc[module][column][row] = calibda.fADCchannelEmc[module][column][row];
56 fADCpedestalEmc[module][column][row] = calibda.fADCpedestalEmc[module][column][row];
fc6706cb 57 }
58 }
59 }
60}
61
62//________________________________________________________________
63AliPHOSEmcCalibData &AliPHOSEmcCalibData::operator =(const AliPHOSEmcCalibData& calibda)
64{
65 // assignment operator
27f8cf68 66
67 if(this != &calibda) {
68
69 SetName(calibda.GetName());
70 SetTitle(calibda.GetName());
71
72 for(Int_t module=0; module<5; module++) {
73 for(Int_t column=0; column<56; column++) {
74 for(Int_t row=0; row<64; row++) {
75 fADCchannelEmc[module][column][row] = calibda.fADCchannelEmc[module][column][row];
76 fADCpedestalEmc[module][column][row] = calibda.fADCpedestalEmc[module][column][row];
77 }
fc6706cb 78 }
79 }
80 }
27f8cf68 81
fc6706cb 82 return *this;
83}
84
85//________________________________________________________________
86AliPHOSEmcCalibData::~AliPHOSEmcCalibData()
87{
88 // Destructor
89}
90
91//________________________________________________________________
92void AliPHOSEmcCalibData::Reset()
93{
72e5feac 94 // Set all pedestals and all ADC channels to its ideal values = 1.
fc6706cb 95
96 for (Int_t module=0; module<5; module++){
97 for (Int_t column=0; column<56; column++){
98 for (Int_t row=0; row<64; row++){
72e5feac 99 fADCpedestalEmc[module][column][row] = 0.;
100 fADCchannelEmc[module][column][row] = 1.;
fc6706cb 101 }
102 }
103 }
104
105}
106
107//________________________________________________________________
108void AliPHOSEmcCalibData::Print(Option_t *option) const
109{
110 // Print tables of pedestals and ADC channels
111
112 if (strstr(option,"ped")) {
113 printf("\n ---- EMC Pedestal values ----\n\n");
114 for (Int_t module=0; module<5; module++){
115 printf("============== Module %d\n",module+1);
116 for (Int_t column=0; column<56; column++){
117 for (Int_t row=0; row<64; row++){
118 printf("%4.1f",fADCpedestalEmc[module][column][row]);
119 }
120 printf("\n");
121 }
122 }
123 }
124
125 if (strstr(option,"gain")) {
126 printf("\n ---- EMC ADC channel values ----\n\n");
127 for (Int_t module=0; module<5; module++){
128 printf("============== Module %d\n",module+1);
129 for (Int_t column=0; column<56; column++){
130 for (Int_t row=0; row<64; row++){
131 printf("%4.1f",fADCchannelEmc[module][column][row]);
132 }
133 printf("\n");
134 }
135 }
136 }
137}
138
1fdb1c5e 139//________________________________________________________________
fc6706cb 140Float_t AliPHOSEmcCalibData::GetADCchannelEmc(Int_t module, Int_t column, Int_t row) const
141{
1fdb1c5e 142 //Return EMC calibration coefficient
fc6706cb 143 //module, column,raw should follow the internal PHOS convention:
144 //module 1:5, column 1:56, row 1:64
145
146 return fADCchannelEmc[module-1][column-1][row-1];
147}
148
1fdb1c5e 149//________________________________________________________________
fc6706cb 150Float_t AliPHOSEmcCalibData::GetADCpedestalEmc(Int_t module, Int_t column, Int_t row) const
151{
1fdb1c5e 152 //Return EMC pedestal
153 //module, column,raw should follow the internal PHOS convention:
154 //module 1:5, column 1:56, row 1:64
155
fc6706cb 156 return fADCpedestalEmc[module-1][column-1][row-1];
157}
158
1fdb1c5e 159//________________________________________________________________
fc6706cb 160void AliPHOSEmcCalibData::SetADCchannelEmc(Int_t module, Int_t column, Int_t row, Float_t value)
161{
1fdb1c5e 162 //Set EMC calibration coefficient
163 //module, column,raw should follow the internal PHOS convention:
164 //module 1:5, column 1:56, row 1:64
165
fc6706cb 166 fADCchannelEmc[module-1][column-1][row-1] = value;
167}
168
1fdb1c5e 169//________________________________________________________________
fc6706cb 170void AliPHOSEmcCalibData::SetADCpedestalEmc(Int_t module, Int_t column, Int_t row, Float_t value)
171{
1fdb1c5e 172 //Set EMC pedestal
173 //module, column,raw should follow the internal PHOS convention:
174 //module 1:5, column 1:56, row 1:64
fc6706cb 175 fADCpedestalEmc[module-1][column-1][row-1] = value;
176}