]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALAodCluster.cxx
bug in loop, wrong varialble in increment
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALAodCluster.cxx
index 0de255ff1ee7e3ed22b3b6eeb8a7a08ab99f9d99..f8bfc5c3def1540494cb0a0bcb92214bdba91807 100644 (file)
@@ -67,8 +67,7 @@ void AliEMCALAodCluster::Recalibrate(AliEMCALCalibData * calibData, AliAODCaloCe
     return ;
 
   AliEMCALGeometry * emcalgeo =  AliEMCALGeometry::GetInstance(emcalGeoName) ;
-  if(!emcalgeo)
-    AliFatal("AliEMCALGeometry was not constructed\n") ;
+  if(emcalgeo){
        
   Double32_t * cellsAmpFraction = GetCellsAmplitudeFraction(); 
   Int_t iSupMod = -1;
@@ -94,6 +93,10 @@ void AliEMCALAodCluster::Recalibrate(AliEMCALCalibData * calibData, AliAODCaloCe
        
   SetCellsAmplitudeFraction(cellsAmpFraction);
   fRecalibrated=kTRUE; 
+    
+  }
+  else  AliFatal("AliEMCALGeometry was not constructed\n") ;
+
 }
 //____________________________________________________________________________
 void  AliEMCALAodCluster::EvalAll(Float_t logWeight, TString geoname){
@@ -177,8 +180,7 @@ void AliEMCALAodCluster::EvalPositionAndShowerShape(Float_t logWeight, TString e
   Double_t zmean = 0.;
 
   AliEMCALGeometry * emcalgeo =  AliEMCALGeometry::GetInstance(emcalGeoName) ;
-  if(!emcalgeo)
-    AliFatal("AliEMCALGeometry was not constructed\n") ;
+  if(emcalgeo){
        
   Double_t dist  = TmaxInCm(E(),0);
   for(Int_t iDigit=0; iDigit < GetNCells(); iDigit++) {
@@ -224,9 +226,9 @@ void AliEMCALAodCluster::EvalPositionAndShowerShape(Float_t logWeight, TString e
   TVector3 gpos ;
   emcalgeo->GetGlobal(clXYZ, gpos, iSupMod);
 
-  SetPosition(0,gpos[0]) ;
-  SetPosition(1,gpos[1]) ;  
-  SetPosition(2,gpos[2]) ;
+  SetPositionAt(gpos[0],0) ;
+  SetPositionAt(gpos[1],1) ;  
+  SetPositionAt(gpos[2],2) ;
 
   //Calculate dispersion       
   for(Int_t iDigit=0; iDigit < GetNCells(); iDigit++) {
@@ -268,6 +270,11 @@ void AliEMCALAodCluster::EvalPositionAndShowerShape(Float_t logWeight, TString e
          SetDispersion(TMath::Sqrt(d)) ;
   else    
          SetDispersion(0) ;
+  }
+  else {
+    AliFatal("AliEMCALGeometry was not constructed\n") ;
+  }
+
 
 }