]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fix for wrong track lenght calculation (at the moment somewhat clumsy,
authorshahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 3 Jun 2013 15:20:12 +0000 (15:20 +0000)
committershahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 3 Jun 2013 15:20:12 +0000 (15:20 +0000)
need to redesign internal track classes)

ITS/UPGRADE/AliITSUTrackHyp.cxx
ITS/UPGRADE/AliITSUTrackHyp.h
ITS/UPGRADE/AliITSUTrackerGlo.cxx
ITS/UPGRADE/AliITSUTrackerGlo.h

index aef366ca693f2e6706d4c8713f46b50bcdeb0a9d..fcbf4ce99262362a896c770e5ad20860265cec39 100644 (file)
@@ -54,6 +54,44 @@ AliITSUTrackHyp::AliITSUTrackHyp(const AliITSUTrackHyp &src)
   }
   //
 }
+
+//__________________________________________________________________
+AliITSUTrackHyp::AliITSUTrackHyp(const AliKalmanTrack &src)
+  : AliKalmanTrack(src)
+  , fNLayers(0)
+  , fITSLabel(0)
+  , fESDTrack(0)
+  , fWinner(0)
+  , fTPCSeed(0)
+  , fLayerSeeds(0)
+{
+  // copy c-tor. from KalmanTrack
+  //
+}
+
+//__________________________________________________________________
+AliITSUTrackHyp::AliITSUTrackHyp(const AliESDtrack &src)
+  : AliKalmanTrack()
+  , fNLayers(0)
+  , fITSLabel(0)
+  , fESDTrack(0)
+  , fWinner(0)
+  , fTPCSeed(0)
+  , fLayerSeeds(0)
+{
+  // copy c-tor. from ESD track: take only kinematics, mass and time integral
+  AliExternalTrackParam::operator=((const AliExternalTrackParam&)src);
+  SetMass(src.GetMass());
+  if (src.IsOn(AliESDtrack::kTIME)) {
+    StartTimeIntegral();
+    SetIntegratedLength(src.GetIntegratedLength());
+    double times[AliPID::kSPECIES];
+    src.GetIntegratedTimes(times);
+    SetIntegratedTimes(times);
+  }
+  //
+}
+
 //__________________________________________________________________
 void AliITSUTrackHyp::InitFrom(const AliITSUTrackHyp *src)
 {
@@ -77,6 +115,34 @@ AliITSUTrackHyp &AliITSUTrackHyp::operator=(const AliITSUTrackHyp &src)
   //
 }
 
+//__________________________________________________________________
+AliITSUTrackHyp &AliITSUTrackHyp::operator=(const AliKalmanTrack &src)
+{ 
+  // copy kinematics only
+  if (this == &src) return *this;
+  AliKalmanTrack::operator=(src);
+  return *this;
+  //
+}
+
+//__________________________________________________________________
+AliITSUTrackHyp &AliITSUTrackHyp::operator=(const AliESDtrack &src)
+{
+  // copy oparator from ESD track: take only kinematics, mass and time integral
+  AliExternalTrackParam::operator=((const AliExternalTrackParam&)src);
+  SetMass(src.GetMass());
+  if (src.IsOn(AliESDtrack::kTIME)) {
+    StartTimeIntegral();
+    SetIntegratedLength(src.GetIntegratedLength());
+    double times[AliPID::kSPECIES];
+    src.GetIntegratedTimes(times);
+    SetIntegratedTimes(times);
+  }
+  //
+  return *this;
+}
+
+
 //__________________________________________________________________
 void AliITSUTrackHyp::Print(Option_t* opt) const
 {
index d8f6fce1ac7af0cc9506a8ed20e55036f4115104..8f615ca20ba54eb1415c19aeb2626e70286996c6 100644 (file)
@@ -16,7 +16,11 @@ class AliITSUTrackHyp: public AliKalmanTrack
   enum {kSkip=BIT(14)};
   AliITSUTrackHyp(Int_t nlr=0);
   AliITSUTrackHyp(const AliITSUTrackHyp& src);
+  AliITSUTrackHyp(const AliKalmanTrack& src);
+  AliITSUTrackHyp(const AliESDtrack& src);
   AliITSUTrackHyp &operator=(const AliITSUTrackHyp &src);
+  AliITSUTrackHyp &operator=(const AliESDtrack &src);
+  AliITSUTrackHyp &operator=(const AliKalmanTrack &src);
   virtual ~AliITSUTrackHyp();
   //
   void               InitFrom(const AliITSUTrackHyp *src);
@@ -37,10 +41,14 @@ class AliITSUTrackHyp: public AliKalmanTrack
   //
   void               SetChi2(Double_t chi2) {fChi2 = chi2;}
   Double_t           Update(const AliCluster* c);
+  Bool_t             Update(Double_t p[2],Double_t cov[3])                  {return AliExternalTrackParam::Update(p,cov);}
+  Double_t           GetPredictedChi2(Double_t p[2],Double_t cov[3])  const {return AliExternalTrackParam::GetPredictedChi2(p,cov);}
+  Double_t           GetPredictedChi2(const AliExternalTrackParam *t) const {return AliExternalTrackParam::GetPredictedChi2(t);}
   AliExternalTrackParam* GetTPCSeed() const {return fTPCSeed;}
   void               SetTPCSeed(AliExternalTrackParam* seed) {fTPCSeed = seed;}
   //
   virtual Double_t   GetPredictedChi2(const AliCluster *c) const;
+  
   virtual Bool_t     PropagateTo(Double_t xr, Double_t x0, Double_t rho);
   virtual Bool_t     Update(const AliCluster* c, Double_t chi2, Int_t index);
   virtual Int_t      GetNumberOfClusters()   const;
index 7d79705fd7cdea486b1c74c030d48635c22e8e5b..ae07327886ac7193627a8f39f86f12d8ce0b3804 100644 (file)
@@ -297,7 +297,7 @@ Int_t AliITSUTrackerGlo::PropagateBack(AliESDEvent *esdEv)
     {
       double dxs = xyzTrk[0] - xyzVtx[0];
       double dys = xyzTrk[1] - xyzVtx[1];
-      double dzs = xyzTrk[2] - xyzVtx[2];
+      //      double dzs = xyzTrk[2] - xyzVtx[2];
       // RS: for large segment steps d use approximation of cicrular arc s by
       // s = 2R*asin(d/2R) = d/p asin(p) \approx d/p (p + 1/6 p^3) = d (1+1/6 p^2)
       // where R is the track radius, p = d/2R = 2C*d (C is the abs curvature)
@@ -308,7 +308,9 @@ Int_t AliITSUTrackerGlo::PropagateBack(AliESDEvent *esdEv)
        double fcarc = 1.+crv*crv*dst/6.;
        dst *= fcarc*fcarc;
       }
-      dst += dzs*dzs;
+      // RS: temporary hack since we don't have SPD vertex:      
+      //      dst += dzs*dzs;
+      dst *= 1+fCurrESDtrack->GetTgl()*fCurrESDtrack->GetTgl();
       dst = Sqrt(dst); 
     }
     //    
@@ -373,9 +375,9 @@ Int_t AliITSUTrackerGlo::RefitInward(AliESDEvent *esdEv)
     if (   trStat & AliESDtrack::kITSrefit ) continue; // already done
     if (  (trStat & AliESDtrack::kTPCout) && !(trStat & AliESDtrack::kTPCrefit) ) continue;
     //
-    fCurrHyp = GetTrackHyp(itr);
-    fCurrHyp->AliExternalTrackParam::operator=(*fCurrESDtrack);  // fetch current ESDtrack kinematics
+    fCurrHyp  = GetTrackHyp(itr);
     fCurrMass = fCurrHyp->GetMass();
+    *fCurrHyp = *fCurrESDtrack;  // fetch current ESDtrack kinematics
     //
     int nclFit = 0;
     double chi2 = RefitTrack(fCurrHyp,fITS->GetRMin(),nclFit);
@@ -1363,7 +1365,7 @@ void AliITSUTrackerGlo::UpdateESDTrack(AliITSUTrackHyp* hyp,Int_t flag)
 }
 
 //______________________________________________________________________________
-Double_t AliITSUTrackerGlo::RefitTrack(AliExternalTrackParam* trc, Double_t rDest, Int_t &nclFit, Int_t stopCond)
+Double_t AliITSUTrackerGlo::RefitTrack(AliITSUTrackHyp* trc, Double_t rDest, Int_t &nclFit, Int_t stopCond)
 {
   // refit track till radius rDest. The cluster,mass info is taken from fCurrHyp (and its winner seed)
   // if stopCond<0 : propagate till last cluster then stop
@@ -1386,7 +1388,7 @@ Double_t AliITSUTrackerGlo::RefitTrack(AliExternalTrackParam* trc, Double_t rDes
   Int_t clInfo[2*AliITSUAux::kMaxLayers];
   Int_t nCl = fCurrHyp->FetchClusterInfo(clInfo);
   fCurrMass = fCurrHyp->GetMass();
-  AliExternalTrackParam tmpTr(*trc);
+  AliITSUTrackHyp tmpTr(*(AliKalmanTrack*)trc);
   double chi2 = 0;
   int iclLr[2],nclLr;
   nclFit = 0;
@@ -1472,7 +1474,7 @@ Double_t AliITSUTrackerGlo::RefitTrack(AliExternalTrackParam* trc, Double_t rDes
        printf("AfterRefit: "); tmpTr.Print();
       }
       if (++nclFit==nCl && stopCond<0) {
-       *trc = tmpTr;
+       *trc = (AliKalmanTrack&)tmpTr;
        return chi2; // it was requested to not propagate after last update
       }
     }
@@ -1495,7 +1497,7 @@ Double_t AliITSUTrackerGlo::RefitTrack(AliExternalTrackParam* trc, Double_t rDes
   if (!tmpTr.GetXatLabR(rDest,rDest,GetBz(),0) || !PropagateSeed(&tmpTr,rDest,fCurrMass, 100, kFALSE)) {
     return (stopCond>0) ? -chi2 : chi2; // rDest was obligatory
   }
-  *trc=tmpTr;
+  *trc = (AliKalmanTrack&)tmpTr;
   if (AliDebugLevelClass()>2) {
     printf("After refit (now at lr %d): ",lrStop); trc->Print();
   }
@@ -1649,8 +1651,8 @@ Bool_t AliITSUTrackerGlo::CheckBackwardMatching(AliITSUSeed* seed)
   // check seed backward propagation chi2 and matching to TPC 
   double bz0 = GetBz();
   double rDest = fITS->GetRITSTPCRef(); // reference radius for comparison
-  static AliExternalTrackParam trback;
-  trback = *seed;
+  AliITSUTrackHyp trback;
+  trback.AliExternalTrackParam::operator=(*seed);
   trback.ResetCovariance(10000);
   int nclFit = 0;
   double chi2sa = RefitTrack(&trback,rDest,nclFit,1);
index 99035a4d6a9e0bb46531116af084abcefb3c0577..0b8ddbf02eada3a7ab1cb90b3c782f0747de8b33 100644 (file)
@@ -75,7 +75,7 @@ class AliITSUTrackerGlo : public AliTracker {
   Bool_t                 GoToEntranceToLayer(AliExternalTrackParam* seed, AliITSURecoLayer* lr, Int_t dir, Bool_t check=kFALSE);
   Bool_t                 PropagateSeed(AliITSUSeed *seed, Double_t xToGo, Double_t mass, Double_t maxStep=1.0, Bool_t matCorr=kTRUE);
   Bool_t                 PropagateSeed(AliExternalTrackParam *seed, Double_t xToGo, Double_t mass, Double_t maxStep=1.0, Bool_t matCorr=kTRUE);
-  Double_t               RefitTrack(AliExternalTrackParam* trc, Double_t r, Int_t& nclFit, Int_t stopCond=0);
+  Double_t               RefitTrack(AliITSUTrackHyp* trc, Double_t r, Int_t& nclFit, Int_t stopCond=0);
   Int_t                  GetTrackingPhase()                 const {return fTrackPhaseID;}
 
   //