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());
58 Int_t nRow2 = 12; //Modules 11 and 12 are half modules
60 for(Int_t supermodule=0; supermodule<nSMod; supermodule++) {
63 for(Int_t column=0; column<nCol; column++) {
64 for(Int_t row=0; row<nRow; row++) {
65 fADCchannel[supermodule][column][row] =
66 calibda.GetADCchannel(supermodule,column,row);
67 fADCpedestal[supermodule][column][row] =
68 calibda.GetADCpedestal(supermodule,column,row);
75 //________________________________________________________________
76 AliEMCALCalibData &AliEMCALCalibData::operator =(const AliEMCALCalibData& calibda)
78 // assignment operator
79 SetName(calibda.GetName());
80 SetTitle(calibda.GetName());
86 Int_t nRow2 = 12; //Modules 11 and 12 are half modules
88 for(Int_t supermodule=0; supermodule<nSMod; supermodule++) {
91 for(Int_t column=0; column<nCol; column++) {
92 for(Int_t row=0; row<nRow; row++) {
93 fADCchannel[supermodule][column][row] =
94 calibda.GetADCchannel(supermodule,column,row);
95 fADCpedestal[supermodule][column][row] =
96 calibda.GetADCpedestal(supermodule,column,row);
103 //________________________________________________________________
104 AliEMCALCalibData::~AliEMCALCalibData()
109 //________________________________________________________________
110 void AliEMCALCalibData::Reset()
112 // Set all pedestals to 0 and all ADC channels widths to 1
113 memset(fADCchannel ,1,12*48*24*sizeof(Float_t));
114 memset(fADCpedestal,0,12*48*24*sizeof(Float_t));
117 //________________________________________________________________
118 void AliEMCALCalibData::Print(Option_t *option) const
120 // Print tables of pedestals and ADC channels widths
125 Int_t nRow2 = 12; //Modules 11 and 12 are half modules
126 if (strstr(option,"ped")) {
127 printf("\n ---- Pedestal values ----\n\n");
128 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
131 printf("============== Supermodule %d\n",supermodule+1);
132 for (Int_t column=0; column<nCol; column++){
133 for (Int_t row=0; row<nRow; row++){
134 printf("%4.1f",fADCpedestal[supermodule][column][row]);
142 if (strstr(option,"gain")) {
143 printf("\n ---- ADC channel values ----\n\n");
144 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
147 printf("============== Supermodule %d\n",supermodule+1);
148 for (Int_t column=0; column<nCol; column++){
149 for (Int_t row=0; row<nRow; row++){
150 printf("%4.1f",fADCchannel[supermodule][column][row]);
158 //________________________________________________________________
159 Float_t AliEMCALCalibData::GetADCchannel(Int_t supermodule, Int_t column, Int_t row) const
161 // Set ADC channel witdth values
162 //supermodule, column,raw should follow the internal EMCAL convention:
163 //supermodule 1:12, column 1:48, row 1:24
165 return fADCchannel[supermodule-1][column-1][row-1];
168 //________________________________________________________________
169 Float_t AliEMCALCalibData::GetADCpedestal(Int_t supermodule, Int_t column, Int_t row) const
171 // Get ADC pedestal values
172 return fADCpedestal[supermodule-1][column-1][row-1];
175 //________________________________________________________________
176 void AliEMCALCalibData::SetADCchannel(Int_t supermodule, Int_t column, Int_t row, Float_t value)
178 // Set ADC channel width values
179 fADCchannel[supermodule-1][column-1][row-1] = value;
182 //________________________________________________________________
183 void AliEMCALCalibData::SetADCpedestal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
185 // Set ADC pedestal values
186 fADCpedestal[supermodule-1][column-1][row-1] = value;