]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
new functionality added
authorkowal2 <kowal2@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 29 Sep 2003 11:27:00 +0000 (11:27 +0000)
committerkowal2 <kowal2@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 29 Sep 2003 11:27:00 +0000 (11:27 +0000)
TPC/AliTPCpolyTrack.cxx
TPC/AliTPCpolyTrack.h

index 4b707053c7a9b3a9948be2349ec916d9c7aacb28..577d861504aa3b9783c7c09dc4197aa51b54f46b 100644 (file)
@@ -90,12 +90,6 @@ void  AliTPCpolyTrack::UpdateParameters()
 }
 
 
-void AliTPCpolyTrack::GetFitPoint(Double_t x, Double_t &y, Double_t &z)
-{
-  y = fA+fB*x+fC*x*x;
-  z = fD+fE*x+fF*x*x;
-}
-
 
 void  AliTPCpolyTrack::Fit2(Double_t fSumY, Double_t fSumYX, Double_t fSumYX2,
            Double_t fSumX,  Double_t fSumX2, Double_t fSumX3, 
@@ -143,3 +137,37 @@ void  AliTPCpolyTrack::Fit1(Double_t fSumY, Double_t fSumYX,
   }
 
 }
+
+void AliTPCpolyTrack::Refit(AliTPCpolyTrack &track, Double_t deltay, Double_t deltaz)
+{
+  //
+  // refit with cut on distortion
+  //
+  track.Reset();
+  //first refit to temporary
+  AliTPCpolyTrack track0;
+  track0.Reset;
+  for (Int_t i=0;i<fNPoints;i++){
+    Double_t y,z;
+    GetFitPoint(fX[i],y,z);
+    if ( (TMath::Abs(y-fY[i])<deltay)&&(TMath::Abs(z-fZ[i])<deltaz)){
+      track0.AddPoint(fX[i],y,z);
+    }
+  }
+  if (track0.GetN()>2) 
+    track0.UpdateParameters();
+  else 
+    return;
+  //
+  for (Int_t i=0;i<fNPoints;i++){
+    Double_t y,z;
+    track0.GetFitPoint(fX[i],y,z);
+    if ( (TMath::Abs(y-fY[i])<deltay)&&(TMath::Abs(z-fZ[i])<deltaz)){
+      track.AddPoint(fX[i],y,z);
+    }
+  }
+  if (track.GetN()>2) 
+    track.UpdateParameters();
+
+}
+
index 1045d88feec0524071b9e2ad9f941b1403ca21bc..4599e71a37741d3448f1511976c582635d7e85ae 100644 (file)
@@ -15,10 +15,12 @@ public:
   AliTPCpolyTrack();
   void Reset();
   void AddPoint(Double_t x, Double_t y, Double_t z, Double_t sy=1, Double_t sz=1);
-  void GetFitPoint(Double_t x, Double_t &y, Double_t &z);
+  inline void GetFitPoint(Double_t x, Double_t &y, Double_t &z);
+  inline void GetFitDerivation(Double_t x, Double_t &y, Double_t &z);
   void UpdateParameters();
   Int_t GetN(){return fNPoints;}
   void GetBoundaries(Double_t &xmin, Double_t &xmax){xmin = fMinX;xmax=fMaxX;}
+  void Refit(AliTPCpolyTrack & track, Double_t deltay, Double_t deltaz); 
 private: 
   void   Fit2(Double_t fSumY, Double_t fSumYX, Double_t fSumYX2,
              Double_t fSumX,  Double_t fSumX2, Double_t fSumX3, 
@@ -60,6 +62,21 @@ private:
   ClassDef(AliTPCpolyTrack,1)  // Time Projection "polynomial track"
 };
 
+void AliTPCpolyTrack::GetFitPoint(Double_t x, Double_t &y, Double_t &z)
+{
+  y = fA+fB*x+fC*x*x;
+  z = fD+fE*x+fF*x*x;
+}
+
+
+void AliTPCpolyTrack::GetFitDerivation(Double_t x, Double_t &y, Double_t &z)
+{
+
+  y = fB+2.*fC*x;
+  z = fE+2.*fF*x;
+  
+}
+
 
 #endif