]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Bug in area of the ring. Protections are in now.
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 3 Oct 2007 13:24:55 +0000 (13:24 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 3 Oct 2007 13:24:55 +0000 (13:24 +0000)
HMPID/AliHMPIDRecon.cxx

index 7ec56e9ae2b6eaa1b4b635893a697e655bb4bb72..eb1bfa0eae8ad06829bfabdb0e3349c78fc4a997 100644 (file)
@@ -197,11 +197,15 @@ Double_t AliHMPIDRecon::FindRingArea(Double_t ckovAng)const
    
   const Int_t kN=100;
   Double_t area=0;
-  for(Int_t i=0;i<kN;i++){
-    TVector2 pos1=TracePhot(ckovAng,Double_t(TMath::TwoPi()*i    /kN));//trace this photon 
-    TVector2 pos2=TracePhot(ckovAng,Double_t(TMath::TwoPi()*(i+1)/kN));//trace the next photon 
-    area+=(pos1-fTrkPos)*(pos2-fTrkPos);                               //add area of the triangle... 
+  
+  TVector2 pos1=TracePhot(ckovAng,0);//trace the first photon 
+  for(Int_t i=1;i<kN;i++){
+    TVector2 pos2=TracePhot(ckovAng,Double_t(TMath::TwoPi()*(i+1)/kN));//trace the next photon
+    if(pos1.X()==-999||pos2.X()==-999) return 0;                       //no area: open ring
+    area+=TMath::Abs((pos1-fTrkPos).X()*(pos2-fTrkPos).Y()-(pos1-fTrkPos).Y()*(pos2-fTrkPos).X()); //add area of the triangle... 
+    pos1=pos2; // actual photon becomes the first one
   }
+  area*=0.5;
   return area;
 }//FindRingArea()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++