///*-- Author: Yves Schutz (SUBATECH)
// : Aleksei Pavlinov (WSU); Jun 30, 2006 - ALICE numbering scheme
// : Add decalibration and time calibration arrays: Jul 21, 2011 (GCB)
+// : adapted for DCAL by M.L. Wang CCNU & Subatech Oct-18-2012
///////////////////////////////////////////////////////////////////////////////
// //
// class for EMCAL calibration //
ClassImp(AliEMCALCalibData)
//__________________________________________________________
- AliEMCALCalibData::AliEMCALCalibData() : fADCchannelRef(0)
+AliEMCALCalibData::AliEMCALCalibData() :
+TNamed(), fADCchannelRef(0)
{
// Default constructor
Reset();
}
//________________________________________________________________________
-AliEMCALCalibData::AliEMCALCalibData(const char* name) : fADCchannelRef(0)
+AliEMCALCalibData::AliEMCALCalibData(const char* name) :
+TNamed(name,name),fADCchannelRef(0)
{
// Constructor
- TString namst = "Calib_";
- namst += name;
- SetName (namst.Data());
- SetTitle(namst.Data());
Reset();
}
//______________________________________________________________________
AliEMCALCalibData::AliEMCALCalibData(const AliEMCALCalibData& calibda) :
- TNamed(calibda), fADCchannelRef(calibda.fADCchannelRef)
+TNamed(calibda), fADCchannelRef(calibda.fADCchannelRef)
{
// copy constructor
SetName (calibda.GetName());
SetTitle(calibda.GetName());
Reset();
-
- Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
+
+ Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //22
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)
- nRow = nRow2;
+ for(Int_t supermodule = 0; supermodule < nSMod; supermodule++) {
+ nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+ // in reality they are 1/3 but leave them as 1/2
+
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11 && supermodule < 18)
+ nCol = nCol*2/3;
for(Int_t column = 0; column<nCol; column++) {
fTimeChannelDecal[supermodule][column][row] =
calibda.GetTimeChannelDecal(supermodule,column,row);
-
- for(Int_t bc = 0; bc < 4; bc++)
- fTimeChannel[supermodule][column][row][bc] =
- calibda.GetTimeChannel(supermodule,column,row,bc);
+
+ for(Int_t bc = 0; bc < 4; bc++)
+ fTimeChannel[supermodule][column][row][bc] =
+ calibda.GetTimeChannel(supermodule,column,row,bc);
}
}
}
}
-
//________________________________________________________________
AliEMCALCalibData &AliEMCALCalibData::operator =(const AliEMCALCalibData& calibda)
{
SetName (calibda.GetName());
SetTitle(calibda.GetName());
Reset();
-
- fADCchannelRef = calibda.fADCchannelRef ;
-
- Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
+
+ fADCchannelRef = calibda.GetADCchannelRef() ;
+
+ Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //22
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 supermodule = 0; supermodule < nSMod; supermodule++) {
+ nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+ // in reality they are 1/3 but leave them as 1/2
+
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11 && supermodule < 18)
+ nCol = nCol*2/3;
for(Int_t column = 0; column<nCol; column++) {
fADCpedestal[supermodule][column][row] =
calibda.GetADCpedestal(supermodule,column,row);
-
+
fTimeChannelDecal[supermodule][column][row] =
calibda.GetTimeChannelDecal(supermodule,column,row);
- for(Int_t bc = 0; bc < 4; bc++)
- fTimeChannel[supermodule][column][row][bc] =
- calibda.GetTimeChannel(supermodule,column,row,bc);
-
+ for(Int_t bc = 0; bc < 4; bc++)
+ fTimeChannel[supermodule][column][row][bc] =
+ calibda.GetTimeChannel(supermodule,column,row,bc);
+
}
}
}
-
+
return *this;
}
void AliEMCALCalibData::Reset()
{
// Set all pedestals to 0 and all ADC channels widths to 1
-
+
fADCchannelRef = 0.0162;
-
- Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
+
+ Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //22
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 supermodule=0; supermodule<nSMod; supermodule++){
+ nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+ // in reality they are 1/3 but leave them as 1/2
+
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11 && supermodule < 18)
+ nCol = nCol*2/3;
+
for (Int_t column=0; column < nCol; column++){
for (Int_t row = 0; row < nRow; row++){
fADCchannel [supermodule][column][row]=1.;
fTimeChannelDecal[supermodule][column][row]=0.;
-
- for(Int_t bc = 0; bc < 4; bc++)
- fTimeChannel[supermodule][column][row][bc]=0;
-
+
+ for(Int_t bc = 0; bc < 4; bc++)
+ fTimeChannel[supermodule][column][row][bc]=0;
+
}
}
}
}
-//________________________________________________________________
+//____________________________________________________
void AliEMCALCalibData::Print(Option_t *option) const
{
// Print tables of pedestals and ADC channels widths
// options are: "gain", "ped", "decal", "time", "all"
- Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12
+ Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //22
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") || strstr(option,"all")) {
printf("\n ---- Pedestal values ----\n\n");
for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
- if(supermodule >= 10)
- nRow = nRow2;
+ nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+ // in reality they are 1/3 but leave them as 1/2
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11 && supermodule < 18)
+ nCol = nCol*2/3;
printf("============== Supermodule %d\n",supermodule+1);
for (Int_t column=0; column<nCol; column++){
for (Int_t row=0; row<nRow; row++){
if (strstr(option,"gain") || strstr(option,"all")) {
printf("\n ---- ADC channel values ----\n\n");
for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
- if(supermodule >= 10)
- nRow = nRow2;
+ nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+
+ // in reality they are 1/3 but leave them as 1/2
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11 && supermodule < 18)
+ nCol = nCol*2/3;
printf("============== Supermodule %d\n",supermodule+1);
for (Int_t column=0; column<nCol; column++){
for (Int_t row=0; row<nRow; row++){
if (strstr(option,"adcdecal") || strstr(option,"all")) {
printf("\n ---- ADC decalibration channel values ----\n\n");
for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
- if(supermodule >= 10)
- nRow = nRow2;
+ nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+ // in reality they are 1/3 but leave them as 1/2
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11 && supermodule < 18)
+ nCol = nCol*2/3;
printf("============== Supermodule %d\n",supermodule+1);
for (Int_t column=0; column<nCol; column++){
for (Int_t row=0; row<nRow; row++){
if (strstr(option,"time") || strstr(option,"all")) {
printf("\n ---- time channel values ----\n\n");
for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
- if(supermodule >= 10)
- nRow = nRow2;
+ nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+ // in reality they are 1/3 but leave them as 1/2
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11 && supermodule < 18)
+ nCol = nCol*2/3;
printf("============== Supermodule %d\n",supermodule+1);
for (Int_t column=0; column<nCol; column++){
for (Int_t row=0; row<nRow; row++){
- for(Int_t bc = 0; bc < 4; bc++)
- printf(" %2.4f ",fTimeChannel[supermodule][column][row][bc]);
+ for(Int_t bc = 0; bc < 4; bc++)
+ printf(" %2.4f ",fTimeChannel[supermodule][column][row][bc]);
}
printf("\n");
}
if (strstr(option,"time") || strstr(option,"all")) {
printf("\n ---- time decalibration channel values ----\n\n");
for (Int_t supermodule=0; supermodule<nSMod; supermodule++){
- if(supermodule >= 10)
- nRow = nRow2;
+ nCol = AliEMCALGeoParams::fgkEMCALCols; //48
+ nRow = AliEMCALGeoParams::fgkEMCALRows; //24
+ // in reality they are 1/3 but leave them as 1/2
+ if(supermodule /2 == 5)
+ nRow = nRow/2;
+ if(supermodule > 11 && supermodule < 18)
+ nCol = nCol*2/3;
printf("============== Supermodule %d\n",supermodule+1);
for (Int_t column=0; column<nCol; column++){
for (Int_t row=0; row<nRow; row++){
// 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][column][row];
}
Float_t AliEMCALCalibData::GetADCpedestal(Int_t supermodule, Int_t column, Int_t row) const
{
// Get ADC pedestal values
- return fADCpedestal[supermodule][column][row];
+ return fADCpedestal[supermodule][column][row];
}
//________________________________________________________________