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. *
14 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // class for EMCAL calibration //
22 ///////////////////////////////////////////////////////////////////////////////
24 #include "AliEMCALCalibData.h"
26 ClassImp(AliEMCALCalibData)
28 //________________________________________________________________
29 AliEMCALCalibData::AliEMCALCalibData()
31 // Default constructor
35 //________________________________________________________________
36 AliEMCALCalibData::AliEMCALCalibData(const char* name)
39 TString namst = "Calib_";
41 SetName(namst.Data());
42 SetTitle(namst.Data());
46 //________________________________________________________________
47 AliEMCALCalibData::AliEMCALCalibData(const AliEMCALCalibData& calibda) :
51 SetName(calibda.GetName());
52 SetTitle(calibda.GetName());
59 for(Int_t supermodule=0; supermodule<nSMod; supermodule++) {
62 for(Int_t column=0; column<nCol; column++) {
63 for(Int_t row=0; row<nRow; row++) {
64 fADCchannel[supermodule][column][row] =
65 calibda.GetADCchannel(supermodule,column,row);
66 fADCpedestal[supermodule][column][row] =
67 calibda.GetADCpedestal(supermodule,column,row);
74 //________________________________________________________________
75 AliEMCALCalibData &AliEMCALCalibData::operator =(const AliEMCALCalibData& calibda)
77 // assignment operator
78 SetName(calibda.GetName());
79 SetTitle(calibda.GetName());
86 for(Int_t supermodule=0; supermodule<nSMod; supermodule++) {
89 for(Int_t column=0; column<nCol; column++) {
90 for(Int_t row=0; row<nRow; row++) {
91 fADCchannel[supermodule][column][row] =
92 calibda.GetADCchannel(supermodule,column,row);
93 fADCpedestal[supermodule][column][row] =
94 calibda.GetADCpedestal(supermodule,column,row);
101 //________________________________________________________________
102 AliEMCALCalibData::~AliEMCALCalibData()
107 //________________________________________________________________
108 void AliEMCALCalibData::Reset()
110 // Set all pedestals to 0 and all ADC channels widths to 1
111 memset(fADCchannel ,1,12*48*24*sizeof(Float_t));
112 memset(fADCpedestal,0,12*48*24*sizeof(Float_t));
115 //________________________________________________________________
116 void AliEMCALCalibData::Print(Option_t *option) const
118 // Print tables of pedestals and ADC channels widths
124 if (strstr(option,"ped")) {
125 printf("\n ---- Pedestal values ----\n\n");
126 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
129 printf("============== Supermodule %d\n",supermodule+1);
130 for (Int_t column=0; column<nCol; column++){
131 for (Int_t row=0; row<nRow; row++){
132 printf("%4.1f",fADCpedestal[supermodule][column][row]);
140 if (strstr(option,"gain")) {
141 printf("\n ---- ADC channel values ----\n\n");
142 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
145 printf("============== Supermodule %d\n",supermodule+1);
146 for (Int_t column=0; column<nCol; column++){
147 for (Int_t row=0; row<nRow; row++){
148 printf("%4.1f",fADCchannel[supermodule][column][row]);
156 //________________________________________________________________
157 Float_t AliEMCALCalibData::GetADCchannel(Int_t supermodule, Int_t column, Int_t row) const
159 // Set ADC channel witdth values
160 //supermodule, column,raw should follow the internal EMCAL convention:
161 //supermodule 1:12, column 1:48, row 1:24
163 return fADCchannel[supermodule-1][column-1][row-1];
166 //________________________________________________________________
167 Float_t AliEMCALCalibData::GetADCpedestal(Int_t supermodule, Int_t column, Int_t row) const
169 // Get ADC pedestal values
170 return fADCpedestal[supermodule-1][column-1][row-1];
173 //________________________________________________________________
174 void AliEMCALCalibData::SetADCchannel(Int_t supermodule, Int_t column, Int_t row, Float_t value)
176 // Set ADC channel width values
177 fADCchannel[supermodule-1][column-1][row-1] = value;
180 //________________________________________________________________
181 void AliEMCALCalibData::SetADCpedestal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
183 // Set ADC pedestal values
184 fADCpedestal[supermodule-1][column-1][row-1] = value;