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 ///////////////////////////////////////////////////////////////////////////////
27 #include "AliEMCALCalibData.h"
29 ClassImp(AliEMCALCalibData)
31 //________________________________________________________________
32 AliEMCALCalibData::AliEMCALCalibData()
34 // Default constructor
38 //________________________________________________________________
39 AliEMCALCalibData::AliEMCALCalibData(const char* name)
42 TString namst = "Calib_";
44 SetName(namst.Data());
45 SetTitle(namst.Data());
49 //________________________________________________________________
50 AliEMCALCalibData::AliEMCALCalibData(const AliEMCALCalibData& calibda) :
54 SetName(calibda.GetName());
55 SetTitle(calibda.GetName());
61 Int_t nRow2 = 12; //Modules 11 and 12 are half modules
63 for(Int_t supermodule=0; supermodule<nSMod; supermodule++) {
66 for(Int_t column=0; column<nCol; column++) {
67 for(Int_t row=0; row<nRow; row++) {
68 fADCchannel[supermodule][column][row] =
69 calibda.GetADCchannel(supermodule,column,row);
70 fADCpedestal[supermodule][column][row] =
71 calibda.GetADCpedestal(supermodule,column,row);
78 //________________________________________________________________
79 AliEMCALCalibData &AliEMCALCalibData::operator =(const AliEMCALCalibData& calibda)
81 // assignment operator
82 SetName(calibda.GetName());
83 SetTitle(calibda.GetName());
89 Int_t nRow2 = 12; //Modules 11 and 12 are half modules
91 for(Int_t supermodule=0; supermodule<nSMod; supermodule++) {
94 for(Int_t column=0; column<nCol; column++) {
95 for(Int_t row=0; row<nRow; row++) {
96 fADCchannel[supermodule][column][row] =
97 calibda.GetADCchannel(supermodule,column,row);
98 fADCpedestal[supermodule][column][row] =
99 calibda.GetADCpedestal(supermodule,column,row);
106 //________________________________________________________________
107 AliEMCALCalibData::~AliEMCALCalibData()
112 //________________________________________________________________
113 void AliEMCALCalibData::Reset()
115 // Set all pedestals to 0 and all ADC channels widths to 1
116 memset(fADCchannel ,1,12*48*24*sizeof(Float_t));
117 memset(fADCpedestal,0,12*48*24*sizeof(Float_t));
120 //________________________________________________________________
121 void AliEMCALCalibData::Print(Option_t *option) const
123 // Print tables of pedestals and ADC channels widths
128 Int_t nRow2 = 12; //Modules 11 and 12 are half modules
129 if (strstr(option,"ped")) {
130 printf("\n ---- Pedestal values ----\n\n");
131 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
134 printf("============== Supermodule %d\n",supermodule+1);
135 for (Int_t column=0; column<nCol; column++){
136 for (Int_t row=0; row<nRow; row++){
137 printf("%4.1f",fADCpedestal[supermodule][column][row]);
145 if (strstr(option,"gain")) {
146 printf("\n ---- ADC channel values ----\n\n");
147 for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
150 printf("============== Supermodule %d\n",supermodule+1);
151 for (Int_t column=0; column<nCol; column++){
152 for (Int_t row=0; row<nRow; row++){
153 printf("%4.1f",fADCchannel[supermodule][column][row]);
161 //________________________________________________________________
162 Float_t AliEMCALCalibData::GetADCchannel(Int_t supermodule, Int_t column, Int_t row) const
164 // Set ADC channel witdth values
165 // All indexes start from 0!
166 // Supermodule, column,raw should follow the ALICE convention:
167 // supermodule 0:11, column 0:47, row 0:23
169 return fADCchannel[supermodule][column][row];
172 //________________________________________________________________
173 Float_t AliEMCALCalibData::GetADCpedestal(Int_t supermodule, Int_t column, Int_t row) const
175 // Get ADC pedestal values
176 return fADCpedestal[supermodule][column][row];
179 //________________________________________________________________
180 void AliEMCALCalibData::SetADCchannel(Int_t supermodule, Int_t column, Int_t row, Float_t value)
182 // Set ADC channel width values
183 fADCchannel[supermodule][column][row] = value;
186 //________________________________________________________________
187 void AliEMCALCalibData::SetADCpedestal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
189 // Set ADC pedestal values
190 fADCpedestal[supermodule][column][row] = value;