]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALTowerRecPoint.cxx
corrected a bug in dispersion calculations (replaced Sin by Cos)
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALTowerRecPoint.cxx
index f5d7f6749f60a1ea628c2da5af95ece0c987fd27..d430599e27315cd9a8d0fa8a6459fcc55060f692 100644 (file)
@@ -301,6 +301,7 @@ void AliEMCALTowerRecPoint::ExecuteEvent(Int_t event, Int_t px, Int_t py) const
 void  AliEMCALTowerRecPoint::EvalDispersion(Float_t logWeight,TClonesArray * digits)
 {
   // Calculates the dispersion of the shower at the origine of the RecPoint
+  printf("**************** EVAL Dispersion *****************") ; 
 
   Float_t d    = 0. ;
   Float_t wtot = 0. ;
@@ -344,7 +345,7 @@ void  AliEMCALTowerRecPoint::EvalDispersion(Float_t logWeight,TClonesArray * dig
   
   Float_t cyl_radius = emcalgeom->GetIPDistance()+emcalgeom->GetAirGap() ;
   Float_t x =  cyl_radius * TMath::Cos(fPhi * kDeg2Rad ) ;
-  Float_t y =  cyl_radius * TMath::Cos(fPhi * kDeg2Rad ) ; 
+  Float_t y =  cyl_radius * TMath::Sin(fPhi * kDeg2Rad ) ; 
   Float_t z =  cyl_radius * TMath::Tan(fTheta * kDeg2Rad ) ; 
   
 // Calculates the dispersion in coordinates 
@@ -362,6 +363,7 @@ void  AliEMCALTowerRecPoint::EvalDispersion(Float_t logWeight,TClonesArray * dig
     Float_t w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
     d += w*((xi-x)*(xi-x) + (yi-y)*(yi-y)+ (zi-z)*(zi-z) ) ; 
     wtot+=w ;
+    printf("xi=%f, x=%f\n yi=%f, y=%f\n zi=%f, z=%f\n phi=%f phii=%f theta=%f thetaii=%f\n\n",xi,x,yi,y,zi,z, fPhi, phii, fTheta, thetai) ;  
   }
   
   if ( wtot > 0 )