From 4490791603d2813076987f16bf260daaa9d55dab Mon Sep 17 00:00:00 2001 From: gconesab Date: Sun, 28 Nov 2010 15:31:38 +0000 Subject: [PATCH] Move the non linearity correction after the cluster position recalculation. --- PWG4/CaloCalib/AliAnalysisTaskCaloFilter.cxx | 6 +++--- .../AliAnalysisTaskEMCALPi0CalibSelection.cxx | 7 ++++--- PWG4/PartCorrBase/AliCaloTrackReader.cxx | 14 +++++++------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/PWG4/CaloCalib/AliAnalysisTaskCaloFilter.cxx b/PWG4/CaloCalib/AliAnalysisTaskCaloFilter.cxx index 8e3c7ca1e3d..ea90e383a38 100644 --- a/PWG4/CaloCalib/AliAnalysisTaskCaloFilter.cxx +++ b/PWG4/CaloCalib/AliAnalysisTaskCaloFilter.cxx @@ -278,9 +278,7 @@ void AliAnalysisTaskCaloFilter::UserExec(Option_t */*option*/) fEMCALRecoUtils->RecalculateClusterShowerShapeParameters(fEMCALGeo, event->GetEMCALCells(),cluster); fEMCALRecoUtils->RecalculateClusterPID(cluster); } - - cluster->SetE(fEMCALRecoUtils->CorrectClusterEnergyLinearity(cluster)); - + fEMCALRecoUtils->RecalculateClusterPosition(fEMCALGeo, event->GetEMCALCells(),cluster); if(DebugLevel() > 2) @@ -291,6 +289,8 @@ void AliAnalysisTaskCaloFilter::UserExec(Option_t */*option*/) printf("Filter, after : i %d, x %f, y %f, z %f\n",cluster->GetID(), position[0], position[1], position[2]); } + cluster->SetE(fEMCALRecoUtils->CorrectClusterEnergyLinearity(cluster)); + } //Recalculate track-matching fEMCALRecoUtils->FindMatches(event); diff --git a/PWG4/CaloCalib/AliAnalysisTaskEMCALPi0CalibSelection.cxx b/PWG4/CaloCalib/AliAnalysisTaskEMCALPi0CalibSelection.cxx index 1cc7a009eb6..2ead2494e3c 100644 --- a/PWG4/CaloCalib/AliAnalysisTaskEMCALPi0CalibSelection.cxx +++ b/PWG4/CaloCalib/AliAnalysisTaskEMCALPi0CalibSelection.cxx @@ -456,13 +456,14 @@ void AliAnalysisTaskEMCALPi0CalibSelection::UserExec(Option_t* /* option */) if(DebugLevel() > 2) printf("Energy: after recalibration %f; ",c1->E()); + // Recalculate cluster position + fRecoUtils->RecalculateClusterPosition(fEMCALGeo, emCells,c1); + // Correct Non-Linearity c1->SetE(fRecoUtils->CorrectClusterEnergyLinearity(c1)); - if(DebugLevel() > 2) printf("after linearity correction %f\n",c1->E()); - // Recalculate cluster position - fRecoUtils->RecalculateClusterPosition(fEMCALGeo, emCells,c1); + if(DebugLevel() > 2) { printf("Cor : i %d, E %f, dispersion %f, m02 %f, m20 %f\n",c1->GetID(),c1->E(),c1->GetDispersion(),c1->GetM02(),c1->GetM20()); diff --git a/PWG4/PartCorrBase/AliCaloTrackReader.cxx b/PWG4/PartCorrBase/AliCaloTrackReader.cxx index a1c0f863ef2..aa9002a47ad 100755 --- a/PWG4/PartCorrBase/AliCaloTrackReader.cxx +++ b/PWG4/PartCorrBase/AliCaloTrackReader.cxx @@ -713,13 +713,7 @@ void AliCaloTrackReader::FillInputEMCAL() { //Recalculate distance to bad channels, if new list of bad channels provided GetCaloUtils()->RecalculateClusterDistanceToBadChannel(GetEMCALCells(),clus); - - //Correct non linearity - if(GetCaloUtils()->IsCorrectionOfClusterEnergyOn()){ - GetCaloUtils()->CorrectClusterEnergy(clus) ; - //printf("Linearity Corrected Energy %f\n",clus->E()); - } - + //Recalculate cluster position if(GetCaloUtils()->IsRecalculationOfClusterPositionOn()){ GetCaloUtils()->RecalculateClusterPosition(GetEMCALCells(),clus); @@ -727,6 +721,12 @@ void AliCaloTrackReader::FillInputEMCAL() { //printf("After Corrections: e %f, x %f, y %f, z %f\n",clus->E(),pos[0],pos[1],pos[2]); } + //Correct non linearity + if(GetCaloUtils()->IsCorrectionOfClusterEnergyOn()){ + GetCaloUtils()->CorrectClusterEnergy(clus) ; + //printf("Linearity Corrected Energy %f\n",clus->E()); + } + if (fMixedEvent) { clus->SetID(iclus) ; } -- 2.43.0