1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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. *
16 * Author: Per Thomas Hille *
17 * code modified to include the two differnt gains of each detection *
18 * channel and also to include the Pedestals loaded into the ALTRO *
19 * registers for basline subtraction and zero supression *
22 **************************************************************************/
24 ///////////////////////////////////////////////////////////////////////////////
26 // class for PHOS EmCal calibration //
28 ///////////////////////////////////////////////////////////////////////////////
30 #include "AliHLTPHOSEmcCalibData.h"
32 ClassImp(AliHLTPHOSEmcCalibData)
34 //________________________________________________________________
35 AliHLTPHOSEmcCalibData::AliHLTPHOSEmcCalibData(): TNamed()
37 // Default constructor
41 //________________________________________________________________
42 AliHLTPHOSEmcCalibData::AliHLTPHOSEmcCalibData(const char* name)
45 TString namst = "Calib_";
47 SetName(namst.Data());
48 SetTitle(namst.Data());
52 //________________________________________________________________
53 AliHLTPHOSEmcCalibData::AliHLTPHOSEmcCalibData(const AliHLTPHOSEmcCalibData& calibda) :
57 SetName(calibda.GetName());
58 SetTitle(calibda.GetName());
61 // for(Int_t gain = 0; gain < N_GAINS; gain ++){
62 for(Int_t module=0; module<N_MODULES; module++) {
63 for(Int_t column=0; column< N_COLUMNS_MOD; column++) {
64 for(Int_t row=0; row<N_ROWS_MOD; row++) {
65 for(Int_t gain = 0; gain < N_GAINS; gain ++){
66 fADCchannelEnergy[module][column][row][gain] = calibda.fADCchannelEnergy[module][column][row][gain];
67 fADCpedestalEmcMeasured[module][column][row][gain] = calibda.fADCpedestalEmcMeasured[module][column][row][gain];
74 //________________________________________________________________
75 AliHLTPHOSEmcCalibData &AliHLTPHOSEmcCalibData::operator =(const AliHLTPHOSEmcCalibData& calibda)
77 // assignment operator
79 if(this != &calibda) {
81 SetName(calibda.GetName());
82 SetTitle(calibda.GetName());
83 // for(Int_t gain = 0; gain < N_GAINS; gain ++){
84 for(Int_t module=0; module<N_MODULES; module++) {
85 for(Int_t column=0; column< N_COLUMNS_MOD; column++) {
86 for(Int_t row=0; row<N_ROWS_MOD; row++) {
87 for(Int_t gain = 0; gain < N_GAINS; gain ++){
88 fADCchannelEnergy[module][column][row][gain] = calibda.fADCchannelEnergy[module][column][row][gain];
89 fADCpedestalEmcMeasured[module][column][row][gain] = calibda.fADCpedestalEmcMeasured[module][column][row][gain];
98 //________________________________________________________________
99 AliHLTPHOSEmcCalibData::~AliHLTPHOSEmcCalibData()
104 //________________________________________________________________
105 void AliHLTPHOSEmcCalibData::Reset()
107 // Set all pedestals and all ADC channels to its ideal values = 1.
109 // for(Int_t gain = 0; gain < PHOS_GAINS; gain ++){
110 for (Int_t module=0; module<N_MODULES; module++){
111 for (Int_t column=0; column< N_COLUMNS_MOD; column++){
112 for (Int_t row=0; row<N_ROWS_MOD; row++){
113 for(Int_t gain = 0; gain < N_GAINS; gain ++){
114 fADCpedestalEmcMeasured[module][column][row][gain] = 0.;
115 fADCchannelEnergy[module][column][row][gain] = 1.;
122 //________________________________________________________________
123 void AliHLTPHOSEmcCalibData::Print(Option_t *option) const
125 // Print tables of pedestals and ADC channels
127 if (strstr(option,"ped")) {
128 printf("\n ---- EMC Pedestal values ----\n\n");
129 // for(Int_t gain = 0; gain < N_GAINS; gain ++){
130 for (Int_t module=0; module<N_MODULES; module++){
131 printf("============== Module %d\n",module+1);
132 for (Int_t column=0; column< N_COLUMNS_MOD; column++){
133 for (Int_t row=0; row<N_ROWS_MOD; row++){
134 for(Int_t gain = 0; gain < N_GAINS; gain ++){
135 printf("%4.1f",fADCpedestalEmcMeasured[module][column][row][gain]);
143 if (strstr(option,"gain")) {
144 printf("\n ---- EMC ADC channel values ----\n\n");
145 // for(Int_t gain = 0; gain < N_GAINS; gain ++){
146 for (Int_t module=0; module<N_MODULES; module++){
147 printf("============== Module %d\n",module+1);
148 for (Int_t column=0; column< N_COLUMNS_MOD; column++){
149 for (Int_t row=0; row<N_ROWS_MOD; row++){
150 for(Int_t gain = 0; gain < N_GAINS; gain ++){
151 printf("%4.1f",fADCchannelEnergy[module][column][row][gain]);
162 AliHLTPHOSEmcCalibData::MakeADCpedestalCorrectionTable()
164 for (Int_t module=0; module<N_MODULES; module++){
165 printf("============== Module %d\n",module+1);
166 for (Int_t column=0; column< N_COLUMNS_MOD; column++){
167 for (Int_t row=0; row<N_ROWS_MOD; row++){
168 for(Int_t gain = 0; gain < N_GAINS; gain ++){
169 fADCpedestalCorrectionTable[module][column][row][gain] = fADCpedestalEmcMeasured[module][column][row][gain] - fADCpedestalAltroReg[module][column][row][gain];
170 // printf("%4.1f",fADCchannelEnergy[module][column][row][gain]);
180 //________________________________________________________________
181 Float_t AliHLTPHOSEmcCalibData::GetADCchannelEnergy(Int_t module, Int_t column, Int_t row, Int_t gain) const
183 //Return EMC calibration coefficient
184 //module, column,raw should follow the internal PHOS convention:
185 //module 1:5, column 1:56, row 1:64
187 return fADCchannelEnergy[module-1][column-1][row-1][gain];
190 //________________________________________________________________
191 Float_t AliHLTPHOSEmcCalibData::GetADCpedestalEmcMeasured(Int_t module, Int_t column, Int_t row, Int_t gain) const
193 //Return EMC pedestal
194 //module, column,raw should follow the internal PHOS convention:
195 //module 1:5, column 1:56, row 1:64
198 return fADCpedestalEmcMeasured[module-1][column-1][row-1][gain];
201 //________________________________________________________________
202 void AliHLTPHOSEmcCalibData::SetADCchannelEnergy(Int_t module, Int_t column, Int_t row, Int_t gain, Float_t value)
204 //Set EMC calibration coefficient
205 //module, column,raw should follow the internal PHOS convention:
206 //module 1:5, column 1:56, row 1:64
208 fADCchannelEnergy[module-1][column-1][row-1][gain] = value;
211 //________________________________________________________________
212 void AliHLTPHOSEmcCalibData::SetADCpedestalEmcMeasured(Int_t module, Int_t column, Int_t row, Int_t gain, Float_t value)
215 //module, column,raw should follow the internal PHOS convention:
216 //module 1:5, column 1:56, row 1:64
217 fADCpedestalEmcMeasured[module-1][column-1][row-1][gain] = value;