]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HMPID/AliHMPIDReconHTA.cxx
Handle deletion of AliFMDAltroMapping object. If we make the object
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDReconHTA.cxx
index 6ba7dc1b751edcf12045265f4ab4fd892974016c..e1987eaf8d0afce0d3f5b6c87e3432dd3bf16366 100644 (file)
@@ -255,9 +255,10 @@ Bool_t AliHMPIDReconHTA::FindShape(Double_t &thTrkRec,Double_t &phiTrkRec,Double
     dMean2+=dist[indphi[i]]*dist[indphi[i]];
     np++;
   }
-  
-  dMean  /=(Double_t)np;
-  dMean2 /=(Double_t)np;
+  if(np>0){    
+   dMean  /=(Double_t)np;
+   dMean2 /=(Double_t)np;}
   Double_t rms = TMath::Sqrt(dMean2 - dMean*dMean);
   
   for(Int_t i=0;i<fNClu;i++) {
@@ -591,7 +592,7 @@ void AliHMPIDReconHTA::InitDatabase()
       Double_t xmip = xrad + sizeCh*TMath::Tan(thTrk)*TMath::Cos(phTrk);
       Double_t ymip = yrad + sizeCh*TMath::Tan(thTrk)*TMath::Sin(phTrk);
 
-      Double_t dist1,dist2;
+      Double_t dist2;
       //
       //first point at phi=0
       //
@@ -599,12 +600,15 @@ void AliHMPIDReconHTA::InitDatabase()
       TVector2 pos;
       pos=rec.TracePhot(thetaC,0);
 
-      if(pos.X()==-999) {
+      /*if(pos.X()==-999) {
         dist1 = 0;            //open ring...only the distance btw mip and point at 180 will be considered
       } else {
         x[0] = pos.X(); y[0] = pos.Y();
         dist1   = TMath::Sqrt((x[0]-xmip)*(x[0]-xmip)+(y[0]-ymip)*(y[0]-ymip));
-      }
+      }*/
+      
+      if(pos.X()!=-999) {x[0] = pos.X(); y[0] = pos.Y();}
+      
       //
       //second point at phi=180
       //
@@ -755,8 +759,10 @@ Double_t AliHMPIDReconHTA::FindSimmPhi()
   
   //_____calc. met min quadr using effective distance _________________________________________________
   
-  coeff2ord = xy-xrotsumm*yrotsumm/np;    
-  coeff1ord = yrotsumm*yrotsumm/np - xrotsumm*xrotsumm/np - yy + xx;
+  if(np>0){ 
+    coeff2ord = xy-xrotsumm*yrotsumm/np;    
+    coeff1ord = yrotsumm*yrotsumm/np - xrotsumm*xrotsumm/np - yy + xx;
+  }
   coeff0ord = -coeff2ord;
   
   AliDebug(1,Form(" a = %f b = %f c = %f",coeff2ord,coeff1ord,coeff0ord));
@@ -767,8 +773,9 @@ Double_t AliHMPIDReconHTA::FindSimmPhi()
   
   r2(coeff,m1,m2);
   
-  n1=(yrotsumm-m1*xrotsumm)/np;                         
-  n2=(yrotsumm-m2*xrotsumm)/np;
+  if(np>0){ 
+    n1=(yrotsumm-m1*xrotsumm)/np;                         
+    n2=(yrotsumm-m2*xrotsumm)/np;}
   // 2 solutions.................
   
   // negative angles solved...