3 /**************************************************************************
4 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * Author: The ALICE Off-line Project. *
7 * Contributors are mentioned in the code where appropriate. *
9 * Permission to use, copy, modify and distribute this software and its *
10 * documentation strictly for non-commercial purposes is hereby granted *
11 * without fee, provided that the above copyright notice appears in all *
12 * copies and that both the copyright notice and this permission notice *
13 * appear in the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It is *
15 * provided "as is" without express or implied warranty. *
18 * Author: Per Thomas Hille *
19 * code modified to include the two differnt gains of each detection *
20 * channel and also to include the Pedestals loaded into the ALTRO *
21 * registers for basline subtraction and zero supression *
24 **************************************************************************/
26 ///////////////////////////////////////////////////////////////////////////////
28 // class for PHOS EmCal calibration //
30 ///////////////////////////////////////////////////////////////////////////////
32 #include "AliHLTPHOSEmcCalibData.h"
34 ClassImp(AliHLTPHOSEmcCalibData)
36 //________________________________________________________________
37 AliHLTPHOSEmcCalibData::AliHLTPHOSEmcCalibData(): TNamed()
39 // Default constructor
43 //________________________________________________________________
44 AliHLTPHOSEmcCalibData::AliHLTPHOSEmcCalibData(const char* name)
47 TString namst = "Calib_";
49 SetName(namst.Data());
50 SetTitle(namst.Data());
54 //________________________________________________________________
55 AliHLTPHOSEmcCalibData::AliHLTPHOSEmcCalibData(const AliHLTPHOSEmcCalibData& calibda) :
59 SetName(calibda.GetName());
60 SetTitle(calibda.GetName());
63 // for(Int_t gain = 0; gain < N_GAINS; gain ++){
64 for(Int_t module=0; module<NMODULES; module++) {
65 for(Int_t column=0; column< NXCOLUMNSMOD; column++) {
66 for(Int_t row=0; row<NZROWSMOD; row++) {
67 for(Int_t gain = 0; gain < NGAINS; gain ++){
68 fADCchannelEnergy[module][column][row][gain] = calibda.fADCchannelEnergy[module][column][row][gain];
69 fADCpedestalEmcMeasured[module][column][row][gain] = calibda.fADCpedestalEmcMeasured[module][column][row][gain];
76 //________________________________________________________________
77 AliHLTPHOSEmcCalibData &AliHLTPHOSEmcCalibData::operator =(const AliHLTPHOSEmcCalibData& calibda)
79 // assignment operator
81 if(this != &calibda) {
83 SetName(calibda.GetName());
84 SetTitle(calibda.GetName());
85 // for(Int_t gain = 0; gain < N_GAINS; gain ++){
86 for(Int_t module=0; module<NMODULES; module++) {
87 for(Int_t column=0; column< NXCOLUMNSMOD; column++) {
88 for(Int_t row=0; row<NZROWSMOD; row++) {
89 for(Int_t gain = 0; gain < NGAINS; gain ++){
90 fADCchannelEnergy[module][column][row][gain] = calibda.fADCchannelEnergy[module][column][row][gain];
91 fADCpedestalEmcMeasured[module][column][row][gain] = calibda.fADCpedestalEmcMeasured[module][column][row][gain];
100 //________________________________________________________________
101 AliHLTPHOSEmcCalibData::~AliHLTPHOSEmcCalibData()
106 //________________________________________________________________
107 void AliHLTPHOSEmcCalibData::Reset()
109 // Set all pedestals and all ADC channels to its ideal values = 1.
111 // for(Int_t gain = 0; gain < PHOS_GAINS; gain ++){
112 for (Int_t module=0; module<NMODULES; module++){
113 for (Int_t column=0; column< NXCOLUMNSMOD; column++){
114 for (Int_t row=0; row<NZROWSMOD; row++){
115 for(Int_t gain = 0; gain < NGAINS; gain ++){
116 fADCpedestalEmcMeasured[module][column][row][gain] = 0.;
117 fADCchannelEnergy[module][column][row][gain] = 1.;
124 //________________________________________________________________
125 void AliHLTPHOSEmcCalibData::Print(Option_t *option) const
127 // Print tables of pedestals and ADC channels
129 if (strstr(option,"ped")) {
130 printf("\n ---- EMC Pedestal values ----\n\n");
131 // for(Int_t gain = 0; gain < N_GAINS; gain ++){
132 for (Int_t module=0; module<NMODULES; module++){
133 printf("============== Module %d\n",module+1);
134 for (Int_t column=0; column< NXCOLUMNSMOD; column++){
135 for (Int_t row=0; row<NZROWSMOD; row++){
136 for(Int_t gain = 0; gain < NGAINS; gain ++){
137 printf("%4.1f",fADCpedestalEmcMeasured[module][column][row][gain]);
145 if (strstr(option,"gain")) {
146 printf("\n ---- EMC ADC channel values ----\n\n");
147 // for(Int_t gain = 0; gain < NGAINS; gain ++){
148 for (Int_t module=0; module<NMODULES; module++){
149 printf("============== Module %d\n",module+1);
150 for (Int_t column=0; column< NXCOLUMNSMOD; column++){
151 for (Int_t row=0; row<NZROWSMOD; row++){
152 for(Int_t gain = 0; gain < NGAINS; gain ++){
153 printf("%4.1f",fADCchannelEnergy[module][column][row][gain]);
162 //________________________________________________________________
164 AliHLTPHOSEmcCalibData::MakeADCpedestalCorrectionTable()
166 for (Int_t module=0; module<NMODULES; module++){
167 printf("============== Module %d\n",module+1);
168 for (Int_t column=0; column< NXCOLUMNSMOD; column++){
169 for (Int_t row=0; row<NZROWSMOD; row++){
170 for(Int_t gain = 0; gain < NGAINS; gain ++){
171 fADCpedestalCorrectionTable[module][column][row][gain] = fADCpedestalEmcMeasured[module][column][row][gain] - fADCpedestalAltroReg[module][column][row][gain];
172 // printf("%4.1f",fADCchannelEnergy[module][column][row][gain]);
182 //________________________________________________________________
183 Float_t AliHLTPHOSEmcCalibData::GetADCchannelEnergy(Int_t module, Int_t column, Int_t row, Int_t gain) const
185 //Return EMC calibration coefficient
186 //module, column,raw should follow the internal PHOS convention:
187 //module 1:5, column 1:56, row 1:64
189 return fADCchannelEnergy[module-1][column-1][row-1][gain];
192 //________________________________________________________________
193 Float_t AliHLTPHOSEmcCalibData::GetADCpedestalEmcMeasured(Int_t module, Int_t column, Int_t row, Int_t gain) const
195 //Return EMC pedestal
196 //module, column,raw should follow the internal PHOS convention:
197 //module 1:5, column 1:56, row 1:64
200 return fADCpedestalEmcMeasured[module-1][column-1][row-1][gain];
203 //________________________________________________________________
204 void AliHLTPHOSEmcCalibData::SetADCchannelEnergy(Int_t module, Int_t column, Int_t row, Int_t gain, Float_t value)
206 //Set EMC calibration coefficient
207 //module, column,raw should follow the internal PHOS convention:
208 //module 1:5, column 1:56, row 1:64
210 fADCchannelEnergy[module-1][column-1][row-1][gain] = value;
213 //________________________________________________________________
214 void AliHLTPHOSEmcCalibData::SetADCpedestalEmcMeasured(Int_t module, Int_t column, Int_t row, Int_t gain, Float_t value)
217 //module, column,raw should follow the internal PHOS convention:
218 //module 1:5, column 1:56, row 1:64
219 fADCpedestalEmcMeasured[module-1][column-1][row-1][gain] = value;