]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
A bug concerning the calculation of the track length and time-of-flight hypotheses...
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 30 Apr 2003 14:35:11 +0000 (14:35 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 30 Apr 2003 14:35:11 +0000 (14:35 +0000)
ITS/AliITStrackerV2.cxx
ITS/AliITStrackerV2.h

index 9f1d8f274cc515cc59924728a0cef2fbcbba1ced..b20e726525bfa9896bf159cfa4af0ffcd4c81cbc 100644 (file)
@@ -265,7 +265,9 @@ Int_t AliITStrackerV2::Clusters2Tracks(const TFile *inp, TFile *out) {
        if (fBestTrack.GetNumberOfClusters() == 0) continue;
 
        if (fConstraint[fPass]) {
-         if (!RefitAt(3.7, t, &fBestTrack)) continue;
+          ResetTrackToFollow(*t);
+         if (!RefitAt(3.7, &fTrackToFollow, &fBestTrack)) continue;
+          ResetBestTrack();
        }
 
        fBestTrack.SetLabel(tpcLabel);
@@ -344,8 +346,8 @@ Int_t AliITStrackerV2::PropagateBack(const TFile *inp, TFile *out) {
     fTrackToFollow.PropagateTo(3.,-0.0028,65.19);
     //
 
-    itrack->ResetCovariance(); itrack->ResetClusters();
-    if (!RefitAt(49.,itrack,&fTrackToFollow)) continue;
+    fTrackToFollow.ResetCovariance(); fTrackToFollow.ResetClusters();
+    if (!RefitAt(49.,&fTrackToFollow,itrack)) continue;
 
     if (CorrectForDeadZoneMaterial(&fTrackToFollow)!=0) {
        Warning("PropagateBack",
@@ -456,16 +458,15 @@ Int_t AliITStrackerV2::RefitInward(const TFile *inp, TFile *out) {
 
   for (i=0; i<ntpc; i++) {
     tpcTree->GetEvent(i);
-    AliITStrackV2 *t=0;
     try {
-      t=new AliITStrackV2(*itrack);
+      otrack=new AliITStrackV2(*itrack);
     } catch (const Char_t *msg) {
       Warning("RefitInward",msg);
-      delete t;
+      delete otrack;
       continue;
     }
     //check if this track was reconstructed in the ITS
-    Int_t lab=TMath::Abs(t->GetLabel());
+    Int_t lab=TMath::Abs(otrack->GetLabel());
     if (lab >= nLab) {
       Warning("RefitInward","Too big TPC track label: %d\n!",lab); 
       continue;
@@ -473,20 +474,22 @@ Int_t AliITStrackerV2::RefitInward(const TFile *inp, TFile *out) {
     Int_t idx=lut[lab];
     if (idx<0) continue; //no prolongation in the ITS for this track
     
-    if (CorrectForDeadZoneMaterial(t)!=0) {
+    if (CorrectForDeadZoneMaterial(otrack)!=0) {
        Warning("RefitInward",
                "failed to correct for the material in the dead zone !\n");
        continue;
     }
 
     //Refitting...
-    otrack=(AliITStrackV2*)itsTracks.UncheckedAt(idx);
-    if (!RefitAt(3.7, t, otrack)) continue;
+    {
+    AliITStrackV2 *ctrack=(AliITStrackV2*)itsTracks.UncheckedAt(idx);
+    if (!RefitAt(3.7, otrack, ctrack)) continue;
+    }
     otrack->SetLabel(itrack->GetLabel()); //For comparison only
     otrack->CookdEdx();
     CookLabel(otrack,0.); //For comparison only
     outTree.Fill();
-    delete t;
+    delete otrack;
   }
   i=(Int_t)outTree.GetEntries();
   Info("RefitInward","Number of inward refitted ITS tracks: %d\n",i);
@@ -970,20 +973,19 @@ Int_t AliITStrackerV2::AliITSlayer::InRoad() const {
 }
 
 Bool_t 
-AliITStrackerV2::RefitAt(Double_t x,const AliITStrackV2 *s,AliITStrackV2 *ot) {
+AliITStrackerV2::RefitAt(Double_t x,AliITStrackV2 *t,const AliITStrackV2 *c) {
   //--------------------------------------------------------------------
-  // This function refits a track at a given position
+  // This function refits the track "t" at the position "x" using
+  // the clusters from "c"
   //--------------------------------------------------------------------
-  AliITStrackV2 save(*ot), *t=&save;
   Int_t index[kMaxLayer];
   Int_t k;
   for (k=0; k<kMaxLayer; k++) index[k]=-1;
-  Int_t nc=t->GetNumberOfClusters();
+  Int_t nc=c->GetNumberOfClusters();
   for (k=0; k<nc; k++) { 
-    Int_t idx=t->GetClusterIndex(k),nl=(idx&0xf0000000)>>28;
+    Int_t idx=c->GetClusterIndex(k),nl=(idx&0xf0000000)>>28;
     index[nl]=idx; 
   }
-  t->~AliITStrackV2(); new (t) AliITStrackV2(*s);
 
   Int_t from, to, step;
   if (x > t->GetX()) {
@@ -1096,7 +1098,6 @@ AliITStrackerV2::RefitAt(Double_t x,const AliITStrackV2 *s,AliITStrackV2 *ot) {
   }
 
   if (!t->PropagateTo(x,0.,0.)) return kFALSE;
-  ot->~AliITStrackV2(); new (ot) AliITStrackV2(*t);
   return kTRUE;
 }
 
index fee6c81f7454a1e34fdad9e0641244eaff9f15b2..9cfbe40b35d73bb575656fccc9c4473fe0f39804 100644 (file)
@@ -28,6 +28,7 @@ public:
   Int_t Clusters2Tracks(const TFile *in, TFile *out);
   Int_t PropagateBack(const TFile *in, TFile *out);
   Int_t RefitInward(const TFile *in, TFile *out);
+  Bool_t RefitAt(Double_t x, AliITStrackV2 *seed, const AliITStrackV2 *t);
   void SetupFirstPass(Int_t *flags, Double_t *cuts=0);
   void SetupSecondPass(Int_t *flags, Double_t *cuts=0);
 
@@ -91,7 +92,6 @@ private:
   Double_t GetEffectiveThickness(Double_t y, Double_t z) const;
   void  FollowProlongation();
   Int_t TakeNextProlongation();
-  Bool_t RefitAt(Double_t x, const AliITStrackV2 *t, AliITStrackV2 *tt);
   void ResetBestTrack() {
      fBestTrack.~AliITStrackV2();
      new(&fBestTrack) AliITStrackV2(fTrackToFollow);