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 //_________________________________________________________________________
19 ///*-- Author: Yves Schutz (SUBATECH)
20 // : Aleksei Pavlinov (WSU); Jun 30, 2006 - ALICE numbering scheme
21 ///////////////////////////////////////////////////////////////////////////////
23 // class for EMCAL calibration //
25 ///////////////////////////////////////////////////////////////////////////////
29 #include "AliEMCALCalibData.h"
31 ClassImp(AliEMCALCalibData)
33 //________________________________________________________________
34 AliEMCALCalibData::AliEMCALCalibData()
36 // Default constructor
40 //________________________________________________________________
41 AliEMCALCalibData::AliEMCALCalibData(const char* name)
44 TString namst = "Calib_";
46 SetName(namst.Data());
47 SetTitle(namst.Data());
51 //________________________________________________________________
52 AliEMCALCalibData::AliEMCALCalibData(const AliEMCALCalibData& calibda) :
56 SetName(calibda.GetName());
57 SetTitle(calibda.GetName());
63 Int_t nRow2 = 12; //Modules 11 and 12 are half modules
65 for(Int_t supermodule=0; supermodule<nSMod; supermodule++) {
68 for(Int_t column=0; column<nCol; column++) {
69 for(Int_t row=0; row<nRow; row++) {
70 fADCchannel[supermodule][column][row] =
71 calibda.GetADCchannel(supermodule,column,row);
72 fADCpedestal[supermodule][column][row] =
73 calibda.GetADCpedestal(supermodule,column,row);
80 //________________________________________________________________
81 AliEMCALCalibData &AliEMCALCalibData::operator =(const AliEMCALCalibData& calibda)
83 // assignment operator
84 SetName(calibda.GetName());
85 SetTitle(calibda.GetName());
91 Int_t nRow2 = 12; //Modules 11 and 12 are half modules
93 for(Int_t supermodule=0; supermodule<nSMod; supermodule++) {
96 for(Int_t column=0; column<nCol; column++) {
97 for(Int_t row=0; row<nRow; row++) {
98 fADCchannel[supermodule][column][row] =
99 calibda.GetADCchannel(supermodule,column,row);
100 fADCpedestal[supermodule][column][row] =
101 calibda.GetADCpedestal(supermodule,column,row);
108 //________________________________________________________________
109 AliEMCALCalibData::~AliEMCALCalibData()
114 //________________________________________________________________
115 void AliEMCALCalibData::Reset()
117 // Set all pedestals to 0 and all ADC channels widths to 1
118 memset(fADCchannel ,1,12*48*24*sizeof(Float_t));
119 memset(fADCpedestal,0,12*48*24*sizeof(Float_t));
122 //________________________________________________________________
123 void AliEMCALCalibData::Print(Option_t *option) const
125 // Print tables of pedestals and ADC channels widths
130 Int_t nRow2 = 12; //Modules 11 and 12 are half modules
131 if (strstr(option,"ped")) {
132 printf("\n ---- Pedestal values ----\n\n");
133 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
134 if(supermodule >= 10)
136 printf("============== Supermodule %d\n",supermodule+1);
137 for (Int_t column=0; column<nCol; column++){
138 for (Int_t row=0; row<nRow; row++){
139 printf("%4.1f",fADCpedestal[supermodule][column][row]);
147 if (strstr(option,"gain")) {
148 printf("\n ---- ADC channel values ----\n\n");
149 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
150 if(supermodule >= 10)
152 printf("============== Supermodule %d\n",supermodule+1);
153 for (Int_t column=0; column<nCol; column++){
154 for (Int_t row=0; row<nRow; row++){
155 printf("%4.1f",fADCchannel[supermodule][column][row]);
163 //________________________________________________________________
164 Float_t AliEMCALCalibData::GetADCchannel(Int_t supermodule, Int_t column, Int_t row) const
166 // Set ADC channel witdth values
167 // All indexes start from 0!
168 // Supermodule, column,raw should follow the ALICE convention:
169 // supermodule 0:11, column 0:47, row 0:23
171 return fADCchannel[supermodule][column][row];
174 //________________________________________________________________
175 Float_t AliEMCALCalibData::GetADCpedestal(Int_t supermodule, Int_t column, Int_t row) const
177 // Get ADC pedestal values
178 return fADCpedestal[supermodule][column][row];
181 //________________________________________________________________
182 void AliEMCALCalibData::SetADCchannel(Int_t supermodule, Int_t column, Int_t row, Float_t value)
184 // Set ADC channel width values
185 fADCchannel[supermodule][column][row] = value;
188 //________________________________________________________________
189 void AliEMCALCalibData::SetADCpedestal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
191 // Set ADC pedestal values
192 fADCpedestal[supermodule][column][row] = value;