From 6f47f50dd0da7b6936400cc53904cea933d44e2d Mon Sep 17 00:00:00 2001 From: prsnko Date: Tue, 15 Sep 2009 14:21:50 +0000 Subject: [PATCH] Time treating corrected in simulated and real raw data --- PHOS/AliPHOS.cxx | 4 ++++ PHOS/AliPHOSCalibData.cxx | 24 ++++++++++++++++++++++-- PHOS/AliPHOSCalibData.h | 3 +++ PHOS/AliPHOSClusterizerv1.cxx | 33 +++++++++++++++++++++++++++------ PHOS/AliPHOSClusterizerv1.h | 3 ++- PHOS/AliPHOSDigitizer.cxx | 21 +++++++++++++++++++++ PHOS/AliPHOSDigitizer.h | 1 + PHOS/AliPHOSEmcCalibData.cxx | 19 ++++++++++++++++++- PHOS/AliPHOSEmcCalibData.h | 5 ++++- PHOS/AliPHOSEmcRecPoint.cxx | 23 +++++++++++++++++++---- PHOS/AliPHOSEmcRecPoint.h | 4 ++-- PHOS/AliPHOSPulseGenerator.cxx | 6 +++--- PHOS/AliPHOSPulseGenerator.h | 1 + PHOS/AliPHOSRawDigiProducer.cxx | 16 ++++++++++++++++ PHOS/AliPHOSRawDigiProducer.h | 1 + PHOS/AliPHOSRecPoint.h | 8 ++++---- PHOS/AliPHOSReconstructor.cxx | 25 +++++++++++++++++++++++-- PHOS/AliPHOSReconstructor.h | 1 + 18 files changed, 172 insertions(+), 26 deletions(-) diff --git a/PHOS/AliPHOS.cxx b/PHOS/AliPHOS.cxx index b0446783831..596e95e77ed 100644 --- a/PHOS/AliPHOS.cxx +++ b/PHOS/AliPHOS.cxx @@ -459,6 +459,9 @@ void AliPHOS::Digits2Raw() // Create a shaper pulse object AliPHOSPulseGenerator *pulse = new AliPHOSPulseGenerator(); + + //Set Time step of sample + pulse->SetTimeStep(TMath::Abs(fgCalibData->GetSampleTimeStep())) ; Int_t *adcValuesLow = new Int_t[pulse->GetRawFormatTimeBins()]; Int_t *adcValuesHigh= new Int_t[pulse->GetRawFormatTimeBins()]; @@ -559,6 +562,7 @@ void AliPHOS::Digits2Raw() pulse->SetHG2LGRatio(r) ; pulse->MakeSamples(); pulse->GetSamples(adcValuesHigh, adcValuesLow) ; + buffer[iDDL]->WriteChannel(relId[3]-1, relId[2]-1, 0, pulse->GetRawFormatTimeBins(), adcValuesLow , kAdcThreshold); buffer[iDDL]->WriteChannel(relId[3]-1, relId[2]-1, 1, diff --git a/PHOS/AliPHOSCalibData.cxx b/PHOS/AliPHOSCalibData.cxx index d18cae2dc28..695b682d454 100644 --- a/PHOS/AliPHOSCalibData.cxx +++ b/PHOS/AliPHOSCalibData.cxx @@ -344,6 +344,28 @@ void AliPHOSCalibData::SetTimeShiftEmc(Int_t module, Int_t column, Int_t row, Fl fCalibDataEmc->SetTimeShiftEmc(module,column,row,value); } //________________________________________________________________ +Float_t AliPHOSCalibData::GetSampleTimeStep() const +{ + //Get conversion coeff. from sample time step to seconds. + //Negative value means that it is not used in reconstruction + //but only in simulation of raw. + if(fCalibDataEmc) + return fCalibDataEmc->GetSampleTimeStep(); + else + return 0.0; // default width of one EMC ADC channel in GeV +} +//________________________________________________________________ +void AliPHOSCalibData::SetSampleTimeStep(Float_t step) +{ + //Set conversion coeff. from sample time step to seconds. + //Negative value means that it is not used in reconstruction + //but only in simulation of raw. + if(!fCalibDataEmc) + fCalibDataEmc = new AliPHOSEmcCalibData("PHOS-EMC"); + + fCalibDataEmc->SetSampleTimeStep(step) ; +} +//________________________________________________________________ Int_t AliPHOSCalibData::GetAltroOffsetEmc(Int_t module, Int_t column, Int_t row) const { // Return ALTRO pedestal coefficient @@ -479,7 +501,6 @@ void AliPHOSCalibData::RandomCpv(Float_t ccMin, Float_t ccMax) } } } - //________________________________________________________________ Bool_t AliPHOSCalibData::IsBadChannelEmc(Int_t module, Int_t col, Int_t row) const { @@ -499,7 +520,6 @@ Int_t AliPHOSCalibData::GetNumOfEmcBadChannels() const else return 0; } - //________________________________________________________________ void AliPHOSCalibData::EmcBadChannelIds(Int_t *badIds) { diff --git a/PHOS/AliPHOSCalibData.h b/PHOS/AliPHOSCalibData.h index 9f577797445..4db2c0e1787 100644 --- a/PHOS/AliPHOSCalibData.h +++ b/PHOS/AliPHOSCalibData.h @@ -54,6 +54,9 @@ class AliPHOSCalibData: public TNamed { Int_t GetAltroOffsetEmc(Int_t module, Int_t column, Int_t row) const; void SetAltroOffsetEmc(Int_t module, Int_t column, Int_t row, Int_t value) ; + Float_t GetSampleTimeStep() const ; + void SetSampleTimeStep(Float_t step) ; + //----Now CPV parameters----------- Float_t GetADCchannelCpv(Int_t module, Int_t column, Int_t row) const; void SetADCchannelCpv(Int_t module, Int_t column, Int_t row, Float_t value); diff --git a/PHOS/AliPHOSClusterizerv1.cxx b/PHOS/AliPHOSClusterizerv1.cxx index 14da5e12d91..892d9f935ad 100644 --- a/PHOS/AliPHOSClusterizerv1.cxx +++ b/PHOS/AliPHOSClusterizerv1.cxx @@ -396,7 +396,7 @@ void AliPHOSClusterizerv1::InitParameters() fW0 = recoParam->GetEMCLogWeight(); fW0CPV = recoParam->GetCPVLogWeight(); - fEmcTimeGate = 1.e-6 ; + fEmcTimeGate = 1.e-6 ; //10 sample steps fEcoreRadius = recoParam->GetEMCEcoreRadius(); fToUnfold = recoParam->EMCToUnfold() ; @@ -577,7 +577,7 @@ void AliPHOSClusterizerv1::MakeClusters() fEMCRecPoints->AddAt(new AliPHOSEmcRecPoint(""), fNumberOfEmcClusters) ; clu = static_cast( fEMCRecPoints->At(fNumberOfEmcClusters) ) ; fNumberOfEmcClusters++ ; - clu->AddDigit(*digit, Calibrate(digit->GetEnergy(),digit->GetId())) ; + clu->AddDigit(*digit, Calibrate(digit->GetEnergy(),digit->GetId()),CalibrateT(digit->GetTime(),digit->GetId())) ; clusterdigitslist[iDigitInCluster] = digit->GetIndexInList() ; iDigitInCluster++ ; fDigitsUsed[i]=kTRUE ; @@ -589,7 +589,7 @@ void AliPHOSClusterizerv1::MakeClusters() fCPVRecPoints->AddAt(new AliPHOSCpvRecPoint(""), fNumberOfCpvClusters) ; clu = static_cast( fCPVRecPoints->At(fNumberOfCpvClusters) ) ; fNumberOfCpvClusters++ ; - clu->AddDigit(*digit, Calibrate(digit->GetEnergy(),digit->GetId())) ; + clu->AddDigit(*digit, Calibrate(digit->GetEnergy(),digit->GetId()),0.) ; // no timing information in CPV clusterdigitslist[iDigitInCluster] = digit->GetIndexInList() ; iDigitInCluster++ ; fDigitsUsed[i]=kTRUE ; @@ -619,7 +619,7 @@ void AliPHOSClusterizerv1::MakeClusters() case 0 : // not a neighbour break ; case 1 : // are neighbours - clu->AddDigit(*digitN, Calibrate(digitN->GetEnergy(),digit->GetId())) ; + clu->AddDigit(*digitN, Calibrate(digitN->GetEnergy(),digit->GetId()),CalibrateT(digitN->GetTime(),digit->GetId())) ; clusterdigitslist[iDigitInCluster] = j ; iDigitInCluster++ ; fDigitsUsed[j]=kTRUE ; @@ -833,7 +833,7 @@ void AliPHOSClusterizerv1::UnfoldCluster(AliPHOSEmcRecPoint * iniEmc, // ratio = epar * ShowerShape(xDigit - xpar,zDigit - zpar,vIncid) / efit[iDigit] ; ratio = epar * ShowerShape(xDigit - xpar,zDigit - zpar) / efit[iDigit] ; eDigit = emcEnergies[iDigit] * ratio ; - emcRP->AddDigit( *digit, eDigit ) ; + emcRP->AddDigit( *digit, eDigit,CalibrateT(digit->GetTime(),digit->GetId()) ) ; } } @@ -1089,7 +1089,7 @@ void AliPHOSClusterizerv1::SetDistancesToBadChannels() } //================================================================================== -Float_t AliPHOSClusterizerv1::Calibrate(Float_t amp, Int_t absId){ +Float_t AliPHOSClusterizerv1::Calibrate(Float_t amp, Int_t absId) const{ // Calibrate EMC digit, i.e. multiply its Amp by a factor read from CDB const AliPHOSGeometry *geom = AliPHOSGeometry::GetInstance() ; @@ -1109,3 +1109,24 @@ Float_t AliPHOSClusterizerv1::Calibrate(Float_t amp, Int_t absId){ return amp*calibration ; } } +//================================================================================== +Float_t AliPHOSClusterizerv1::CalibrateT(Float_t time, Int_t absId)const{ + // Calibrate time in EMC digit + + const AliPHOSGeometry *geom = AliPHOSGeometry::GetInstance() ; + + //Determine rel.position of the cell absolute ID + Int_t relId[4]; + geom->AbsToRelNumbering(absId,relId); + Int_t module=relId[0]; + Int_t row =relId[2]; + Int_t column=relId[3]; + if(relId[1]){ //CPV + return 0. ; + } + else{ //EMC + time += fgCalibData->GetTimeShiftEmc(module,column,row); + return time ; + } +} + diff --git a/PHOS/AliPHOSClusterizerv1.h b/PHOS/AliPHOSClusterizerv1.h index ede666839e2..404741ab21f 100644 --- a/PHOS/AliPHOSClusterizerv1.h +++ b/PHOS/AliPHOSClusterizerv1.h @@ -124,7 +124,8 @@ protected: virtual Bool_t IsInCpv (AliPHOSDigit * digit)const ; // Tells if id digit is in CPV void CleanDigits(TClonesArray * digits) ; void SetDistancesToBadChannels(); - virtual Float_t Calibrate(Float_t amp, Int_t absId) ; // Tranforms ADC counts to energy + virtual Float_t Calibrate(Float_t amp, Int_t absId) const ; // Tranforms ADC counts to energy + virtual Float_t CalibrateT(Float_t amp, Int_t absId) const ; //Tranforms Sample counts to sec. private: AliPHOSClusterizerv1(const AliPHOSClusterizerv1 & clu) ; diff --git a/PHOS/AliPHOSDigitizer.cxx b/PHOS/AliPHOSDigitizer.cxx index 06d6f839928..88dabf0aa5d 100644 --- a/PHOS/AliPHOSDigitizer.cxx +++ b/PHOS/AliPHOSDigitizer.cxx @@ -436,6 +436,7 @@ void AliPHOSDigitizer::Digitize(Int_t event) curSDigit = dynamic_cast(dynamic_cast(sdigArray->At(i))->At(index[i])) ; if(AliPHOSSimParam::GetInstance()->IsStreamDigits(i)){ //This is Digits Stream curSDigit->SetEnergy(Calibrate(curSDigit->GetEnergy(),curSDigit->GetId())) ; + curSDigit->SetTime(CalibrateT(curSDigit->GetTime(),curSDigit->GetId())) ; } } else @@ -587,6 +588,9 @@ void AliPHOSDigitizer::Digitize(Int_t event) digits->RemoveAt(i) ; continue ; } + + digit->SetEnergy(TMath::Ceil(digit->GetEnergy())-0.9999) ; + Float_t tres = TimeResolution(digit->GetEnergy()) ; digit->SetTime(gRandom->Gaus(digit->GetTime(), tres) ) ; } @@ -644,9 +648,26 @@ void AliPHOSDigitizer::Decalibrate(AliPHOSDigit *digit) Float_t calibration = fcdb->GetADCchannelEmc(module,column,row); Float_t energy = digit->GetEnergy()/calibration; digit->SetEnergy(energy); //Now digit measures E in ADC counts + Float_t time = digit->GetTime() ; + time-=fcdb->GetTimeShiftEmc(module,column,row); + digit->SetTime(time) ; } } //____________________________________________________________________________ +Float_t AliPHOSDigitizer::CalibrateT(Float_t time,Int_t absId){ + //Apply time calibration + const AliPHOSGeometry *geom = AliPHOSGeometry::GetInstance() ; + + //Determine rel.position of the cell absolute ID + Int_t relId[4]; + geom->AbsToRelNumbering(absId,relId); + Int_t module=relId[0]; + Int_t row =relId[2]; + Int_t column=relId[3]; + time += fcdb->GetTimeShiftEmc(module,column,row); + return time ; +} +//____________________________________________________________________________ Int_t AliPHOSDigitizer::DigitizeCPV(Float_t charge, Int_t absId) { // Returns digitized value of the CPV charge in a pad absId diff --git a/PHOS/AliPHOSDigitizer.h b/PHOS/AliPHOSDigitizer.h index 77678ea704b..77d27d58cc5 100644 --- a/PHOS/AliPHOSDigitizer.h +++ b/PHOS/AliPHOSDigitizer.h @@ -88,6 +88,7 @@ private: // Float_t FrontEdgeTime(TClonesArray * ticks) const ; //Calculate digitized signal with gived ADC parameters Float_t Calibrate(Float_t amp, Int_t absId) ; + Float_t CalibrateT(Float_t time, Int_t absId) ; void Decalibrate(AliPHOSDigit * digit); Int_t DigitizeCPV(Float_t charge, Int_t absId) ; diff --git a/PHOS/AliPHOSEmcCalibData.cxx b/PHOS/AliPHOSEmcCalibData.cxx index 050017859ac..cc0c0606f7e 100644 --- a/PHOS/AliPHOSEmcCalibData.cxx +++ b/PHOS/AliPHOSEmcCalibData.cxx @@ -110,7 +110,7 @@ void AliPHOSEmcCalibData::Reset() } } } - + fSampleTimeStep=100.e-9 ; //100 ns } //________________________________________________________________ @@ -222,6 +222,14 @@ Float_t AliPHOSEmcCalibData::GetTimeShiftEmc(Int_t module, Int_t column, Int_t r return fTimeShiftEmc[module-1][column-1][row-1]; } //________________________________________________________________ +Float_t AliPHOSEmcCalibData::GetSampleTimeStep()const +{ + //Returns conversion coefficient from ALTRO smaple time step and secods + //Negative value not used in reconstruction (conversion taken from TRU trailer) + //and only in raw simulation + return fSampleTimeStep ; +} +//________________________________________________________________ Int_t AliPHOSEmcCalibData::GetAltroOffsetEmc(Int_t module, Int_t column, Int_t row) const { //Return EMC altro offsets @@ -273,3 +281,12 @@ void AliPHOSEmcCalibData::SetAltroOffsetEmc(Int_t module, Int_t column, Int_t ro //module 1:5, column 1:56, row 1:64 fAltroOffsets[module-1][column-1][row-1] = value; } +//________________________________________________________________ +void AliPHOSEmcCalibData::SetSampleTimeStep(Float_t step) +{ + //Sets conversion coefficient from ALTRO smaple time step and secods + //Negative value not used in reconstruction (conversion taken from TRU trailer) + //and only in raw simulation + fSampleTimeStep = step ; +} + diff --git a/PHOS/AliPHOSEmcCalibData.h b/PHOS/AliPHOSEmcCalibData.h index 8009fa870bf..f28df8ff45d 100644 --- a/PHOS/AliPHOSEmcCalibData.h +++ b/PHOS/AliPHOSEmcCalibData.h @@ -26,21 +26,24 @@ class AliPHOSEmcCalibData: public TNamed { Float_t GetHighLowRatioEmc(Int_t module, Int_t column, Int_t row) const; Float_t GetTimeShiftEmc(Int_t module, Int_t column, Int_t row) const; Int_t GetAltroOffsetEmc(Int_t module, Int_t column, Int_t row) const; + Float_t GetSampleTimeStep() const ; // void SetADCchannelEmc(Int_t module, Int_t column, Int_t row, Float_t value); void SetADCpedestalEmc(Int_t module, Int_t column, Int_t row, Float_t value); void SetHighLowRatioEmc(Int_t module, Int_t column, Int_t row, Float_t value); void SetTimeShiftEmc(Int_t module, Int_t column, Int_t row, Float_t value); void SetAltroOffsetEmc(Int_t module, Int_t column, Int_t row, Int_t value); + void SetSampleTimeStep(Float_t step) ; protected: + Float_t fSampleTimeStep ; // Conversion between ALTRO sample time step and seconds Float_t fADCchannelEmc[5][56][64] ; // width of one EMC ADC channel in GeV ([mod][col][row]) Float_t fADCpedestalEmc[5][56][64] ; // value of the EMC ADC pedestal ([mod][col][row]) Float_t fHighLowRatioEmc[5][56][64]; // ratio of High/Low gain ([mod][col][row]) Float_t fTimeShiftEmc[5][56][64] ; // channel-by-channel t0 shift ([mod][col][row]) UInt_t fAltroOffsets[5][56][64] ; // channel-by-channel offsets udes in ZS // - ClassDef(AliPHOSEmcCalibData,3) // PHOS EMC calibration data + ClassDef(AliPHOSEmcCalibData,4) // PHOS EMC calibration data }; #endif diff --git a/PHOS/AliPHOSEmcRecPoint.cxx b/PHOS/AliPHOSEmcRecPoint.cxx index a461d7ff9a2..9b11b71ad71 100644 --- a/PHOS/AliPHOSEmcRecPoint.cxx +++ b/PHOS/AliPHOSEmcRecPoint.cxx @@ -113,7 +113,7 @@ AliPHOSEmcRecPoint::~AliPHOSEmcRecPoint() } //____________________________________________________________________________ -void AliPHOSEmcRecPoint::AddDigit(AliPHOSDigit & digit, Float_t Energy) +void AliPHOSEmcRecPoint::AddDigit(AliPHOSDigit & digit, Float_t Energy, Float_t time) { // Adds a digit to the RecPoint // and accumulates the total amplitude and the multiplicity @@ -147,11 +147,24 @@ void AliPHOSEmcRecPoint::AddDigit(AliPHOSDigit & digit, Float_t Energy) delete [] tempoE ; } // if + //time + Bool_t isMax=kTRUE ; + for(Int_t index = 0 ; index < fMulDigit ; index++ ){ + if(fEnergyList[index]>Energy){ + isMax=kFALSE ; + break ; + } + } + if(isMax){ + fTime=time ; + } + //Alternative time calculation - still to be validated + // fTime = (fTime*fAmp + time*Energy)/(fAmp+Energy) ; + fDigitsList[fMulDigit] = digit.GetIndexInList() ; fEnergyList[fMulDigit] = Energy ; fMulDigit++ ; fAmp += Energy ; - EvalPHOSMod(&digit) ; } @@ -935,10 +948,12 @@ Int_t AliPHOSEmcRecPoint::GetNumberOfLocalMax( AliPHOSDigit ** maxAt, Float_t return iDigitN ; } //____________________________________________________________________________ -void AliPHOSEmcRecPoint::EvalTime(TClonesArray * digits) +void AliPHOSEmcRecPoint::EvalTime(TClonesArray * /*digits*/) { // Define a rec.point time as a time in the cell with the maximum energy + //Time already evaluated during AddDigit() +/* Float_t maxE = 0; Int_t maxAt = 0; for(Int_t idig=0; idig < fMulDigit; idig++){ @@ -948,7 +963,7 @@ void AliPHOSEmcRecPoint::EvalTime(TClonesArray * digits) } } fTime = ((AliPHOSDigit*) digits->At(fDigitsList[maxAt]))->GetTime() ; - +*/ } //____________________________________________________________________________ void AliPHOSEmcRecPoint::Purify(Float_t threshold){ diff --git a/PHOS/AliPHOSEmcRecPoint.h b/PHOS/AliPHOSEmcRecPoint.h index 58fb9e0ae78..eb8ea5b13f2 100644 --- a/PHOS/AliPHOSEmcRecPoint.h +++ b/PHOS/AliPHOSEmcRecPoint.h @@ -47,8 +47,8 @@ public: //This virtual function has signature different from AliPHOSRecPoint::AddDigit //it hides, not overrides. using - declaration should fix the problem, at least for //g++ - using AliPHOSRecPoint::AddDigit; - virtual void AddDigit(AliPHOSDigit & digit, Float_t Energy) ; // add a digit to the digits list +// using AliPHOSRecPoint::AddDigit; + virtual void AddDigit(AliPHOSDigit & digit, Float_t Energy, Float_t time=0.) ; // add a digit to the digits list Int_t Compare(const TObject * obj) const; // method for sorting virtual void EvalAll(TClonesArray * digits) ; //Those tasks which can be done without vertex diff --git a/PHOS/AliPHOSPulseGenerator.cxx b/PHOS/AliPHOSPulseGenerator.cxx index 607786cccb2..4fdb076bc41 100644 --- a/PHOS/AliPHOSPulseGenerator.cxx +++ b/PHOS/AliPHOSPulseGenerator.cxx @@ -169,10 +169,10 @@ void AliPHOSPulseGenerator::AddPretriggerSamples(Int_t nPresamples) //----------------------------------------------------------------------------- void AliPHOSPulseGenerator::Digitize() { - // Emulates ADC: rounds down to nearest integer value all amplitudes + // Emulates ADC: rounds up to nearest integer value all amplitudes for (Int_t i=0; iGetSampleTimeStep()>0.) + fSampleToSec=fgCalibData->GetSampleTimeStep() ; + else + fSampleToSec=fRawStream->GetTSample() ; //Temporary array for LowGain digits TClonesArray tmpLG("AliPHOSDigit",10000) ; @@ -211,6 +224,9 @@ void AliPHOSRawDigiProducer::MakeDigits(TClonesArray *digits, AliPHOSRawFitterv0 // energy = CalibrateE(energy,relId,lowGainFlag) ; // time = CalibrateT(time,relId,lowGainFlag) ; + + //convert time from sample bin units to s + time*=fSampleToSec ; if(energy <= 0.) continue; diff --git a/PHOS/AliPHOSRawDigiProducer.h b/PHOS/AliPHOSRawDigiProducer.h index 352641ce10d..06dc6c36739 100644 --- a/PHOS/AliPHOSRawDigiProducer.h +++ b/PHOS/AliPHOSRawDigiProducer.h @@ -51,6 +51,7 @@ private: Float_t fEmcMinE ; // minimum energy of digit (ADC) Float_t fCpvMinE ; // minimum energy of digit (ADC) Float_t fSampleQualityCut; // Cut on sample shapes: 0: no samples; 1: default parameterization; 999: accept even obviously bad + Float_t fSampleToSec ; // Conversion coeff from sample time step to seconds Int_t fEmcCrystals ; // number of EMC crystals AliPHOSGeometry * fGeom ; //! PHOS geometry static AliPHOSCalibData * fgCalibData ; //! Calibration database if avalable diff --git a/PHOS/AliPHOSRecPoint.h b/PHOS/AliPHOSRecPoint.h index eb099cc4836..eb99fda64e5 100644 --- a/PHOS/AliPHOSRecPoint.h +++ b/PHOS/AliPHOSRecPoint.h @@ -33,10 +33,10 @@ class AliPHOSRecPoint : public AliCluster { virtual ~AliPHOSRecPoint(); - virtual void AddDigit(AliDigitNew &){ - Fatal("AddDigit", "use AddDigit(AliPHOSDigit & digit, Float_t Energy)") ; - } - virtual void AddDigit(AliPHOSDigit & digit, Float_t Energy) = 0 ; +// virtual void AddDigit(AliDigitNew &){ +// Fatal("AddDigit", "use AddDigit(AliPHOSDigit & digit, Float_t Energy)") ; +// } + virtual void AddDigit(AliPHOSDigit & digit, Float_t Energy, Float_t time=0) = 0 ; virtual Int_t Compare(const TObject * obj) const = 0 ; virtual Int_t DistancetoPrimitive(Int_t px, Int_t py); virtual void Draw(Option_t * option="") ; diff --git a/PHOS/AliPHOSReconstructor.cxx b/PHOS/AliPHOSReconstructor.cxx index c588b2e3981..0834585af73 100644 --- a/PHOS/AliPHOSReconstructor.cxx +++ b/PHOS/AliPHOSReconstructor.cxx @@ -235,7 +235,8 @@ void AliPHOSReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree, const AliPHOSDigit * dig = (const AliPHOSDigit*)fgDigitsArray->At(idig); if(dig->GetId() <= knEMC && Calibrate(dig->GetEnergy(),dig->GetId()) > GetRecoParam()->GetEMCMinE() ){ - phsCells.SetCell(idignew,dig->GetId(), Calibrate(dig->GetEnergy(),dig->GetId()), dig->GetTime()); + phsCells.SetCell(idignew,dig->GetId(), Calibrate(dig->GetEnergy(),dig->GetId()), + CalibrateT(dig->GetTime(),dig->GetId())); idignew++; } } @@ -301,7 +302,7 @@ void AliPHOSReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree, ec->SetNExMax(emcRP->GetNExMax()); //number of local maxima ec->SetEmcCpvDistance(ts->GetCpvDistance("r")); //Only radius, what about separate x,z???? ec->SetClusterChi2(-1); //not yet implemented - ec->SetTOF(emcRP->GetTime()); //Time of flight + ec->SetTOF(emcRP->GetTime()); //Time of flight - already calibrated in EMCRecPoint //Cells contributing to clusters ec->SetNCells(cellMult); @@ -433,6 +434,26 @@ Float_t AliPHOSReconstructor::Calibrate(Float_t amp, Int_t absId)const{ } } //================================================================================== +Float_t AliPHOSReconstructor::CalibrateT(Float_t time, Int_t absId)const{ + // Calibrate EMC digit, i.e. multiply its Amp by a factor read from CDB + + const AliPHOSGeometry *geom = AliPHOSGeometry::GetInstance() ; + + //Determine rel.position of the cell absolute ID + Int_t relId[4]; + geom->AbsToRelNumbering(absId,relId); + Int_t module=relId[0]; + Int_t row =relId[2]; + Int_t column=relId[3]; + if(relId[1]){ //CPV + return 0. ; + } + else{ //EMC + time += fgCalibData->GetTimeShiftEmc(module,column,row); + return time ; + } +} +//================================================================================== void AliPHOSReconstructor::FillMisalMatrixes(AliESDEvent* esd)const{ //Store PHOS matrixes in ESD Header diff --git a/PHOS/AliPHOSReconstructor.h b/PHOS/AliPHOSReconstructor.h index 0122037f97d..8fea91249c6 100644 --- a/PHOS/AliPHOSReconstructor.h +++ b/PHOS/AliPHOSReconstructor.h @@ -95,6 +95,7 @@ public: virtual Bool_t HasDigitConversion() const {return kTRUE;}; virtual void ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const; virtual Float_t Calibrate(Float_t amp, Int_t absId) const ; + virtual Float_t CalibrateT(Float_t time, Int_t absId) const ; void FillMisalMatrixes(AliESDEvent* esd)const ; -- 2.39.3