-Bool_t AliHMPIDtrack::Intersect(AliHMPIDtrack *pTrk,Double_t pnt[3], Double_t norm[3]) {
- // Finds point of intersection (if exists) of the helix with the plane.
- // Stores result in fX and fP.
- // Arguments: planePoint,planeNorm - the plane defined by any plane's point
- // and vector, normal to the plane
- // Returns: kTrue if helix intersects the plane, kFALSE otherwise.
-
- Double_t x0[3]; pTrk->GetXYZ(x0); //get track position in MARS
- Double_t dist=99999,distPrev=dist;
- Double_t x[3],p[3],
- pntrad= TMath::Sqrt(pnt[0]*pnt[0]+pnt[1]*pnt[1]);
- while(TMath::Abs(dist)> 0.000001){//0.00001){
- //calculates helix at the distance s from x0 ALONG the helix
- pTrk->PropagateTo(pntrad);pTrk->GetXYZ(x);pTrk->GetPxPyPz(p);
- //distance between current helix position and plane
- dist=(x[0]-pnt[0])*norm[0]+(x[1]-pnt[1])*norm[1]+(x[2]-pnt[2])*norm[2];
- pntrad=pntrad-dist*0.7;
- //Printf("--- 111 --- dist %lf",dist);
- if(TMath::Abs(2.0*dist) >= TMath::Abs(distPrev)) {return kFALSE;}
- distPrev=dist;
- }
- //on exit pnt is intersection point,norm is track vector at that point,
- //Printf("--- 222 --- dist %lf",dist);
-// Printf("");
- for (Int_t i=0; i<3; i++) {pnt[i]=x[i]; norm[i]=p[i];}
- return kTRUE;
-}//Intersect()
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-void AliHMPIDtrack::Propagate(Double_t len, Double_t x[3],Double_t p[3], Double_t bz) const {