/* $Id$ */
+//_________________________________________________________________________
+///*-- Author: Yves Schutz (SUBATECH)
+// : Aleksei Pavlinov (WSU); Jun 30, 2006 - ALICE numbering scheme
///////////////////////////////////////////////////////////////////////////////
// //
// class for EMCAL calibration //
// //
///////////////////////////////////////////////////////////////////////////////
+#include <TMath.h>
+
#include "AliEMCALCalibData.h"
ClassImp(AliEMCALCalibData)
SetTitle(calibda.GetName());
Reset();
- Int_t nSMod = 12;
- Int_t nCol = 48;
- Int_t nRow = 24;
- Int_t nRow2 = 12; //Modules 11 and 12 are half modules
+ Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
+ Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+ Int_t nRow2 = AliEMCALGeoParams::fgkEMCALRows; //12 - Modules 11 and 12 are half modules
for(Int_t supermodule=0; supermodule<nSMod; supermodule++) {
- if(supermodule > 10)
+ if(supermodule >= 10)
nRow = nRow2;
for(Int_t column=0; column<nCol; column++) {
for(Int_t row=0; row<nRow; row++) {
SetTitle(calibda.GetName());
Reset();
- Int_t nSMod = 12;
- Int_t nCol = 48;
- Int_t nRow = 24;
- Int_t nRow2 = 12; //Modules 11 and 12 are half modules
+ Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
+ Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+ Int_t nRow2 = AliEMCALGeoParams::fgkEMCALRows/2; //12 - Modules 11 and 12 are half modules
for(Int_t supermodule=0; supermodule<nSMod; supermodule++) {
- if(supermodule > 10)
+ if(supermodule >= 10)
nRow = nRow2;
for(Int_t column=0; column<nCol; column++) {
for(Int_t row=0; row<nRow; row++) {
void AliEMCALCalibData::Reset()
{
// Set all pedestals to 0 and all ADC channels widths to 1
- memset(fADCchannel ,1,12*48*24*sizeof(Float_t));
- memset(fADCpedestal,0,12*48*24*sizeof(Float_t));
+ //memset(fADCchannel ,1,12*48*24*sizeof(Float_t));
+ //memset(fADCpedestal,0,12*48*24*sizeof(Float_t));
+ Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
+ Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+ Int_t nRow2 = AliEMCALGeoParams::fgkEMCALRows/2; //12 - Modules 11 and 12 are half modules
+ for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
+ if(supermodule >= 10)
+ nRow = nRow2;
+ for (Int_t column=0; column<nCol; column++){
+ for (Int_t row=0; row<nRow; row++){
+ fADCpedestal[supermodule][column][row]=0.;
+ fADCchannel [supermodule][column][row]=1.;
+ }
+ }
+ }
}
//________________________________________________________________
{
// Print tables of pedestals and ADC channels widths
- Int_t nSMod = 12;
- Int_t nCol = 48;
- Int_t nRow = 24;
- Int_t nRow2 = 12; //Modules 11 and 12 are half modules
+ Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
+ Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+ Int_t nRow2 = AliEMCALGeoParams::fgkEMCALRows/2; //12 - Modules 11 and 12 are half modules
if (strstr(option,"ped")) {
printf("\n ---- Pedestal values ----\n\n");
for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
- if(supermodule > 10)
+ if(supermodule >= 10)
nRow = nRow2;
printf("============== Supermodule %d\n",supermodule+1);
for (Int_t column=0; column<nCol; column++){
if (strstr(option,"gain")) {
printf("\n ---- ADC channel values ----\n\n");
for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
- if(supermodule > 10)
+ if(supermodule >= 10)
nRow = nRow2;
printf("============== Supermodule %d\n",supermodule+1);
for (Int_t column=0; column<nCol; column++){
Float_t AliEMCALCalibData::GetADCchannel(Int_t supermodule, Int_t column, Int_t row) const
{
// Set ADC channel witdth values
- //supermodule, column,raw should follow the internal EMCAL convention:
- //supermodule 1:12, column 1:48, row 1:24
+ // All indexes start from 0!
+ // Supermodule, column,raw should follow the ALICE convention:
+ // supermodule 0:11, column 0:47, row 0:23
- return fADCchannel[supermodule-1][column-1][row-1];
+ return fADCchannel[supermodule][column][row];
}
//________________________________________________________________
Float_t AliEMCALCalibData::GetADCpedestal(Int_t supermodule, Int_t column, Int_t row) const
{
// Get ADC pedestal values
- return fADCpedestal[supermodule-1][column-1][row-1];
+ return fADCpedestal[supermodule][column][row];
}
//________________________________________________________________
void AliEMCALCalibData::SetADCchannel(Int_t supermodule, Int_t column, Int_t row, Float_t value)
{
// Set ADC channel width values
- fADCchannel[supermodule-1][column-1][row-1] = value;
+ fADCchannel[supermodule][column][row] = value;
}
//________________________________________________________________
void AliEMCALCalibData::SetADCpedestal(Int_t supermodule, Int_t column, Int_t row, Float_t value)
{
// Set ADC pedestal values
- fADCpedestal[supermodule-1][column-1][row-1] = value;
+ fADCpedestal[supermodule][column][row] = value;
}