From aaa41982c60eb4d59b15d9bd3ef7883eead803a9 Mon Sep 17 00:00:00 2001 From: gconesab Date: Fri, 4 May 2012 15:51:49 +0000 Subject: [PATCH] correct compilation warning due to missing initialization of recent data memeber, and profit to remove old unused method and to prepare the setting of time calibration parameters depending on the bunch cross number --- EMCAL/AliEMCALCalibData.cxx | 101 +++++++++++++----------------------- EMCAL/AliEMCALCalibData.h | 42 +++++++-------- 2 files changed, 55 insertions(+), 88 deletions(-) diff --git a/EMCAL/AliEMCALCalibData.cxx b/EMCAL/AliEMCALCalibData.cxx index 9931dd25e36..2fd4cbdbca8 100644 --- a/EMCAL/AliEMCALCalibData.cxx +++ b/EMCAL/AliEMCALCalibData.cxx @@ -31,30 +31,30 @@ ClassImp(AliEMCALCalibData) -//________________________________________________________________ -AliEMCALCalibData::AliEMCALCalibData() +//__________________________________________________________ + AliEMCALCalibData::AliEMCALCalibData() : fADCchannelRef(0) { // Default constructor Reset(); } -//________________________________________________________________ -AliEMCALCalibData::AliEMCALCalibData(const char* name) +//________________________________________________________________________ +AliEMCALCalibData::AliEMCALCalibData(const char* name) : fADCchannelRef(0) { // Constructor TString namst = "Calib_"; namst += name; - SetName(namst.Data()); + SetName (namst.Data()); SetTitle(namst.Data()); Reset(); } -//________________________________________________________________ +//______________________________________________________________________ AliEMCALCalibData::AliEMCALCalibData(const AliEMCALCalibData& calibda) : - TNamed(calibda) + TNamed(calibda), fADCchannelRef(calibda.fADCchannelRef) { // copy constructor - SetName(calibda.GetName()); + SetName (calibda.GetName()); SetTitle(calibda.GetName()); Reset(); @@ -81,12 +81,12 @@ AliEMCALCalibData::AliEMCALCalibData(const AliEMCALCalibData& calibda) : fADCpedestal[supermodule][column][row] = calibda.GetADCpedestal(supermodule,column,row); - fTimeChannel[supermodule][column][row] = - calibda.GetTimeChannel(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); } } @@ -98,10 +98,12 @@ AliEMCALCalibData::AliEMCALCalibData(const AliEMCALCalibData& calibda) : AliEMCALCalibData &AliEMCALCalibData::operator =(const AliEMCALCalibData& calibda) { // assignment operator - SetName(calibda.GetName()); + SetName (calibda.GetName()); SetTitle(calibda.GetName()); Reset(); + fADCchannelRef = calibda.fADCchannelRef ; + Int_t nSMod = AliEMCALGeoParams::fgkEMCALModules; //12 Int_t nCol = AliEMCALGeoParams::fgkEMCALCols; //48 Int_t nRow = AliEMCALGeoParams::fgkEMCALRows; //24 @@ -124,36 +126,33 @@ AliEMCALCalibData &AliEMCALCalibData::operator =(const AliEMCALCalibData& calibd fADCpedestal[supermodule][column][row] = calibda.GetADCpedestal(supermodule,column,row); - - fTimeChannel[supermodule][column][row] = - calibda.GetTimeChannel(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); + } } } - return *this; -} -//________________________________________________________________ -AliEMCALCalibData::~AliEMCALCalibData() -{ - // Destructor + return *this; } -//________________________________________________________________ +//_____________________________ 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)); + + fADCchannelRef = 0.0162; 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= 10) nRow = nRow2; @@ -166,14 +165,14 @@ void AliEMCALCalibData::Reset() fADCchannelDecal [supermodule][column][row]=1.; fADCchannel [supermodule][column][row]=1.; - fTimeChannel [supermodule][column][row]=0.; fTimeChannelDecal[supermodule][column][row]=0.; + for(Int_t bc = 0; bc < 4; bc++) + fTimeChannel[supermodule][column][row][bc]=0; + } } - } - - fADCchannelRef = .0162; + } } //________________________________________________________________ @@ -186,6 +185,7 @@ void AliEMCALCalibData::Print(Option_t *option) const 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= 10) - nRow = nRow2; - for (Int_t column=0; columnGetADCchannel(supermodule, column, row); - Double_t ped1 = cd1->GetADCpedestal(supermodule, column, row); - Double_t adc2 = cd2->GetADCchannel(supermodule, column, row); - Double_t ped2 = cd2->GetADCpedestal(supermodule, column, row); - Double_t adc = adc2/adc1; - Double_t ped = ped2-adc*ped1; - if (print) - printf("%d %d %d: %f %f %f %f -> %f %f\n",supermodule,column,row,adc1,ped1,adc2,ped2,adc,ped); - fADCchannel [supermodule][column][row]=adc; - fADCpedestal[supermodule][column][row]=ped; - } - } - } -} diff --git a/EMCAL/AliEMCALCalibData.h b/EMCAL/AliEMCALCalibData.h index d06fd1f51d9..cfb538e45f0 100644 --- a/EMCAL/AliEMCALCalibData.h +++ b/EMCAL/AliEMCALCalibData.h @@ -18,46 +18,44 @@ class AliEMCALCalibData: public TNamed { public: + AliEMCALCalibData(); AliEMCALCalibData(const char* name); AliEMCALCalibData(const AliEMCALCalibData &calibda); AliEMCALCalibData& operator= (const AliEMCALCalibData &calibda); - virtual ~AliEMCALCalibData(); - void Reset(); - virtual void Print(Option_t *option = "") const; + virtual ~AliEMCALCalibData() { ; } + + void Reset(); + void Print(Option_t *option = "") const; // All indexes start from 0! Float_t GetADCchannel (Int_t module, Int_t column, Int_t row) const; Float_t GetADCchannelDecal (Int_t module, Int_t column, Int_t row) const; Float_t GetADCpedestal (Int_t module, Int_t column, Int_t row) const; - Float_t GetTimeChannel (Int_t module, Int_t column, Int_t row) const; Float_t GetTimeChannelDecal(Int_t module, Int_t column, Int_t row) const; + Float_t GetTimeChannel (Int_t module, Int_t column, Int_t row, Int_t bc) const; - Float_t GetADCchannelRef () {return fADCchannelRef;} - - // - void SetADCchannel (Int_t module, Int_t column, Int_t row, Float_t value); - void SetADCchannelDecal (Int_t module, Int_t column, Int_t row, Float_t value); - void SetADCpedestal (Int_t module, Int_t column, Int_t row, Float_t value); - void SetTimeChannel (Int_t module, Int_t column, Int_t row, Float_t value); - void SetTimeChannelDecal(Int_t module, Int_t column, Int_t row, Float_t value); + Float_t GetADCchannelRef () { return fADCchannelRef ; } - void SetADCchannelRef (Float_t value) {fADCchannelRef = value;} + void SetADCchannel (Int_t module, Int_t column, Int_t row, Float_t value); + void SetADCchannelDecal (Int_t module, Int_t column, Int_t row, Float_t value); + void SetADCpedestal (Int_t module, Int_t column, Int_t row, Float_t value); + void SetTimeChannelDecal(Int_t module, Int_t column, Int_t row, Float_t value); + void SetTimeChannel (Int_t module, Int_t column, Int_t row, Int_t bc, Float_t value); - // Fill for (relative) recalibration (undo 1, apply 2) - void Fill(const AliEMCALCalibData *cd1, const AliEMCALCalibData *cd2, Bool_t print=0); + void SetADCchannelRef (Float_t value) { fADCchannelRef = value ; } protected: + + Float_t fADCchannelRef ; // base value of the ADC channel set from cosmics calibration + Float_t fADCchannel [AliEMCALGeoParams::fgkEMCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows] ; // width of one ADC channel in GeV ([mod][col][row]) Float_t fADCchannelDecal [AliEMCALGeoParams::fgkEMCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows] ; // decalibrate width of one ADC channel in GeV ([mod][col][row]) - Float_t fADCpedestal [AliEMCALGeoParams::fgkEMCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows] ; // value of the ADC pedestal ([mod][col][row]) - Float_t fTimeChannel [AliEMCALGeoParams::fgkEMCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows] ; // time width of one ADC channel ([mod][col][row]) - Float_t fTimeChannelDecal[AliEMCALGeoParams::fgkEMCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows] ; // time width of one ADC channel ([mod][col][row]) - - Float_t fADCchannelRef; + Float_t fADCpedestal [AliEMCALGeoParams::fgkEMCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows] ; // value of the ADC pedestal ([mod][col][row]), not used + Float_t fTimeChannelDecal[AliEMCALGeoParams::fgkEMCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows] ; // time shift of one ADC channel ([mod][col][row]) + Float_t fTimeChannel [AliEMCALGeoParams::fgkEMCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows][4] ; // time shift of one ADC channel ([mod][col][row][bunch crossing number]) - // - ClassDef(AliEMCALCalibData,3) // EMCAL Calibration data + ClassDef(AliEMCALCalibData,4) // EMCAL Calibration data }; #endif -- 2.43.0