From 0e76a7bfa3938c6e8829445d18bcabfa91d6522a Mon Sep 17 00:00:00 2001 From: loizides Date: Wed, 9 Mar 2011 13:14:17 +0000 Subject: [PATCH] Added function to make relative calibration objects --- EMCAL/AliEMCALCalibData.cxx | 60 ++++++++++++++++++++++++++++--------- EMCAL/AliEMCALCalibData.h | 2 ++ 2 files changed, 48 insertions(+), 14 deletions(-) diff --git a/EMCAL/AliEMCALCalibData.cxx b/EMCAL/AliEMCALCalibData.cxx index 453c0f0a5fc..17f795eecb2 100644 --- a/EMCAL/AliEMCALCalibData.cxx +++ b/EMCAL/AliEMCALCalibData.cxx @@ -117,20 +117,21 @@ 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)); - 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; - for (Int_t column=0; column= 10) + nRow = nRow2; + for (Int_t column=0; column= 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 8055c08eec8..1bbb4503401 100644 --- a/EMCAL/AliEMCALCalibData.h +++ b/EMCAL/AliEMCALCalibData.h @@ -29,6 +29,8 @@ class AliEMCALCalibData: public TNamed { // void SetADCchannel(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); + // Fill for (relative) recalibration (undo 1, apply 2) + void Fill(const AliEMCALCalibData *cd1, const AliEMCALCalibData *cd2, Bool_t print=0); protected: Float_t fADCchannel [AliEMCALGeoParams::fgkEMCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows] ; // width of one ADC channel in GeV ([mod][col][row]) -- 2.43.0