]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New PropagateToX method (Alex)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 Feb 2008 09:00:27 +0000 (09:00 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 Feb 2008 09:00:27 +0000 (09:00 +0000)
TRD/AliTRDtrackerV1.cxx
TRD/AliTRDtrackerV1.h

index 235262db39d23b94cd91b602c147913ccbd840bf..26b4f0c4267a26c368808dee30586bf008a25e75 100644 (file)
@@ -797,6 +797,72 @@ Int_t AliTRDtrackerV1::FollowBackProlongation(AliTRDtrackV1 &t)
        return nClustersExpected;
 }
 
+//_____________________________________________________________________________
+Int_t AliTRDtrackerV1::PropagateToX(AliTRDtrackV1 &t, Double_t xToGo, Double_t maxStep)
+{
+  //
+  // Starting from current X-position of track <t> this function
+  // extrapolates the track up to radial position <xToGo>. 
+  // Returns 1 if track reaches the plane, and 0 otherwise 
+  //
+
+  const Double_t kEpsilon = 0.00001;
+
+  // Current track X-position
+  Double_t xpos = t.GetX();
+
+  // Direction: inward or outward
+  Double_t dir  = (xpos < xToGo) ? 1.0 : -1.0;
+
+  while (((xToGo - xpos) * dir) > kEpsilon) {
+
+    Double_t xyz0[3];
+    Double_t xyz1[3];
+    Double_t param[7];
+    Double_t x;
+    Double_t y;
+    Double_t z;
+
+    // The next step size
+    Double_t step = dir * TMath::Min(TMath::Abs(xToGo-xpos),maxStep);
+
+    // Get the global position of the starting point
+    t.GetXYZ(xyz0);
+
+    // X-position after next step
+    x = xpos + step;
+
+    // Get local Y and Z at the X-position of the next step
+    if (!t.GetProlongation(x,y,z)) {
+      return 0; // No prolongation possible
+    }
+
+    // The global position of the end point of this prolongation step
+    xyz1[0] =  x * TMath::Cos(t.GetAlpha()) - y * TMath::Sin(t.GetAlpha()); 
+    xyz1[1] = +x * TMath::Sin(t.GetAlpha()) + y * TMath::Cos(t.GetAlpha());
+    xyz1[2] =  z;
+
+    // Calculate the mean material budget between start and
+    // end point of this prolongation step
+    AliTracker::MeanMaterialBudget(xyz0,xyz1,param);
+
+    // Propagate the track to the X-position after the next step
+    if (!t.PropagateTo(x,param[1],param[0]*param[4])) {
+      return 0;
+    }
+
+    // Rotate the track if necessary
+    AdjustSector(&t);
+
+    // New track X-position
+    xpos = t.GetX();
+
+  }
+
+  return 1;
+
+}
+
 //____________________________________________________________________
 void AliTRDtrackerV1::UnloadClusters() 
 { 
index e28b9ea53111769d43f6d7d3e91988676375466f..26cb1ce02f86d891b0b6a450bf6951a48887ee3c 100644 (file)
@@ -78,6 +78,7 @@ class AliTRDtrackerV1 : public AliTRDtracker
        AliTRDstackLayer *MakeSeedingLayer(AliTRDstackLayer *layers, Int_t Plane);
        Int_t          MakeSeeds(AliTRDstackLayer *layers, AliTRDseedV1 *sseed, Int_t *ipar);
        AliTRDtrackV1*   MakeTrack(AliTRDseedV1 *seeds, Double_t *params);
+  Int_t          PropagateToX(AliTRDtrackV1 &t, Double_t xToGo, Double_t maxStep);
        Int_t          SetTracklet(AliTRDseedV1 *tracklet);
 
 private: