BadMap test moved after misalignment
authorprsnko <Dmitri.Peressounko@cern.ch>
Mon, 9 Jun 2014 13:37:28 +0000 (17:37 +0400)
committerprsnko <Dmitri.Peressounko@cern.ch>
Mon, 9 Jun 2014 13:39:28 +0000 (17:39 +0400)
ANALYSIS/TenderSupplies/AliPHOSTenderSupply.cxx

index ac77835..7fb9eb6 100644 (file)
@@ -290,8 +290,17 @@ void AliPHOSTenderSupply::ProcessEvent()
       AliESDCaloCluster *clu = esd->GetCaloCluster(i);    
       if ( !clu->IsPHOS()) continue;
       
+    
+      //Apply re-Calibreation
+      AliPHOSEsdCluster cluPHOS(*clu);
+      cluPHOS.Recalibrate(fPHOSCalibData,cells); // modify the cell energies
+      cluPHOS.EvalAll(logWeight,vertex);         // recalculate the cluster parameters
+      cluPHOS.SetE(CorrectNonlinearity(cluPHOS.E()));// Users's nonlinearity
+
       Float_t  position[3];
-      clu->GetPosition(position);
+      cluPHOS.GetPosition(position);
+      clu->SetPosition(position);                       //rec.point position in MARS
+      
       TVector3 global(position) ;
       Int_t relId[4] ;
       fPHOSGeo->GlobalPos2RelId(global,relId) ;
@@ -302,13 +311,7 @@ void AliPHOSTenderSupply::ProcessEvent()
         clu->SetE(0.) ;
         continue ;
       }  
-    
-      //Apply re-Calibreation
-      AliPHOSEsdCluster cluPHOS(*clu);
-      cluPHOS.Recalibrate(fPHOSCalibData,cells); // modify the cell energies
-      cluPHOS.EvalAll(logWeight,vertex);         // recalculate the cluster parameters
-      cluPHOS.SetE(CorrectNonlinearity(cluPHOS.E()));// Users's nonlinearity
-
+            
       Double_t ecore=CoreEnergy(&cluPHOS) ; 
       ecore=CorrectNonlinearity(ecore) ;
       
@@ -324,9 +327,6 @@ void AliPHOSTenderSupply::ProcessEvent()
       EvalLambdas(&cluPHOS,m02, m20);   
       clu->SetDispersion(TestLambda(clu->E(),m20,m02)) ;
       
-      Float_t  xyz[3];
-      cluPHOS.GetPosition(xyz);
-      clu->SetPosition(xyz);                       //rec.point position in MARS
       clu->SetE(cluPHOS.E());                      //total particle energy
       clu->SetMCEnergyFraction(ecore);                            //core particle energy
       
@@ -365,8 +365,16 @@ void AliPHOSTenderSupply::ProcessEvent()
       AliAODCaloCluster *clu = aod->GetCaloCluster(i);    
       if ( !clu->IsPHOS()) continue;
       
+    
+      //Apply re-Calibreation
+      AliPHOSAodCluster cluPHOS(*clu);
+      cluPHOS.Recalibrate(fPHOSCalibData,cells); // modify the cell energies
+      cluPHOS.EvalAll(logWeight,vertex);         // recalculate the cluster parameters
+      cluPHOS.SetE(CorrectNonlinearity(cluPHOS.E()));// Users's nonlinearity
+
       Float_t  position[3];
-      clu->GetPosition(position);
+      cluPHOS.GetPosition(position);
+      clu->SetPosition(position);                       //rec.point position in MARS
       TVector3 global(position) ;
       Int_t relId[4] ;
       fPHOSGeo->GlobalPos2RelId(global,relId) ;
@@ -379,13 +387,7 @@ void AliPHOSTenderSupply::ProcessEvent()
       }  
       TVector3 locPosOld; //Use it to re-calculate distance to track
       fPHOSGeo->Global2Local(locPosOld,global,mod) ;
-    
-      //Apply re-Calibreation
-      AliPHOSAodCluster cluPHOS(*clu);
-      cluPHOS.Recalibrate(fPHOSCalibData,cells); // modify the cell energies
-      cluPHOS.EvalAll(logWeight,vertex);         // recalculate the cluster parameters
-      cluPHOS.SetE(CorrectNonlinearity(cluPHOS.E()));// Users's nonlinearity
-
+      
       Double_t ecore=CoreEnergy(&cluPHOS) ; 
       ecore=CorrectNonlinearity(ecore) ;
 
@@ -398,7 +400,6 @@ void AliPHOSTenderSupply::ProcessEvent()
 //      position[1]=global.Y() ;
 //      position[2]=global.Z() ;
 
-      clu->SetPosition(position);                       //rec.point position in MARS
       clu->SetE(cluPHOS.E());                           //total particle energy
       clu->SetCoreEnergy(ecore);                  //core particle energy
       clu->SetDispersion(cluPHOS.GetDispersion());  //cluster dispersion