]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALCalibData.cxx
Moving the QA for raw data inside the event loop (Yves). The list of the detectors...
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALCalibData.cxx
index 7c2fcecbd0307289e5924b81c7c68584133d308d..480f89f1e3adcc37914774ef31b8d63e48d5ba57 100644 (file)
 
 /* $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)
@@ -58,7 +63,7 @@ AliEMCALCalibData::AliEMCALCalibData(const AliEMCALCalibData& calibda) :
   Int_t nRow2 = 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++) {
@@ -86,7 +91,7 @@ AliEMCALCalibData &AliEMCALCalibData::operator =(const AliEMCALCalibData& calibd
   Int_t nRow2 = 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++) {
@@ -126,7 +131,7 @@ void  AliEMCALCalibData::Print(Option_t *option) const
   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++){
@@ -142,7 +147,7 @@ void  AliEMCALCalibData::Print(Option_t *option) const
   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++){
@@ -159,29 +164,30 @@ void  AliEMCALCalibData::Print(Option_t *option) const
 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;
 }