Removing file based inter-detector communications (Yu.Belikov)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 Nov 2003 08:03:45 +0000 (08:03 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 Nov 2003 08:03:45 +0000 (08:03 +0000)
ITS/AliCascadeVertexer.cxx
ITS/AliITStrackerV2.cxx
ITS/AliITStrackerV2.h
ITS/AliV0vertexer.cxx
TPC/AliTPCtrack.cxx
TPC/AliTPCtracker.cxx
TPC/AliTPCtracker.h

index e808bbd..3ac3ea8 100644 (file)
@@ -57,11 +57,13 @@ Int_t AliCascadeVertexer::V0sTracks2CascadeVertices(AliESD *event) {
            continue;
 
        AliITStrackV2 *iotrack=new AliITStrackV2(*esdtr);
+       iotrack->SetLabel(i);  // now it is the index in array of ESD tracks
        if ((status&AliESDtrack::kITSrefit)==0)   //correction for the beam pipe
-          iotrack->PropagateTo(3.,0.0023,65.19); //material 
-       iotrack->PropagateTo(2.5,0.,0.);
+          if (!iotrack->PropagateTo(3.,0.0023,65.19)) continue; 
+       if (!iotrack->PropagateTo(2.5,0.,0.)) continue;
        trks.AddLast(iotrack);
    }   
+   ntr=trks.GetEntriesFast();
 
    Double_t massLambda=1.11568;
    Int_t ncasc=0;
@@ -171,6 +173,9 @@ V0sTracks2CascadeVertices(TTree *vTree,TTree *tTree, TTree *xTree) {
   //--------------------------------------------------------------------
   // This function reconstructs cascade vertices
   //--------------------------------------------------------------------
+  Warning("V0sTracks2CascadeVertices(TTree*,TTree*,TTree*)",
+  "Will be removed soon !  Use V0sTracks2CascadeVertices(AliESD*) instead");
+
    TBranch *branch=vTree->GetBranch("vertices");
    if (!branch) {
       Error("V0sTracks2CascadeVertices","Can't get the V0 branch !");
@@ -212,7 +217,8 @@ V0sTracks2CascadeVertices(TTree *vTree,TTree *tTree, TTree *xTree) {
        branch->SetAddress(&iotrack);
        tTree->GetEvent(i);
 
-       iotrack->PropagateTo(3.,0.0023,65.19); iotrack->PropagateTo(2.5,0.,0.);
+       if (!iotrack->PropagateTo(3.,0.0023,65.19)) continue; 
+       if (!iotrack->PropagateTo(2.5,0.,0.)) continue;
 
        ntrack++; trks.AddLast(iotrack);
        
index 768ca5f..e12775e 100644 (file)
@@ -259,6 +259,9 @@ Int_t AliITStrackerV2::Clusters2Tracks(TTree *tpcTree, TTree *itsTree) {
   //--------------------------------------------------------------------
   Int_t nentr=0; TObjArray itsTracks(15000);
 
+   Warning("Clusters2Tracks(TTree *, TTree *)",
+      "Will be removed soon !   Use Clusters2Tracks(AliESD *) instead.");
+
   {/* Read TPC tracks */ 
     AliTPCtrack *itrack=new AliTPCtrack; 
     TBranch *branch=tpcTree->GetBranch("tracks");
@@ -397,94 +400,6 @@ Int_t AliITStrackerV2::PropagateBack(AliESD *event) {
   return 0;
 }
 
-Int_t AliITStrackerV2::PropagateBack(TTree *inp, TTree *out) {
-  //--------------------------------------------------------------------
-  //This functions propagates reconstructed ITS tracks back
-  //--------------------------------------------------------------------
-  Error("PropagateBack","This method is not converted to NewIO yet (Args: %x , %x )\n",inp,out);
-  return 1;
-  /*
-  TFile *in=(TFile*)inp;
-  TDirectory *savedir=gDirectory; 
-
-  if (LoadClusters()!=0) return 1;
-
-  if (!in->IsOpen()) {
-    Error("PropagateBack","file with ITS tracks is not open !\n");
-    return 1;
-  }
-
-  if (!out->IsOpen()) {
-  Error("PropagateBack","file for back propagated ITS tracks is not open !\n");
-  return 2;
-  }
-
-  in->cd();
-
-  Char_t tname[100];
-  sprintf(tname,"TreeT_ITS_%d",GetEventNumber());
-  TTree *itsTree=(TTree*)in->Get(tname);
-  if (!itsTree) {
-    Error("PropagateBack","can't get a tree with ITS tracks !\n");
-    return 3;
-  }
-  AliITStrackV2 *itrack=new AliITStrackV2; 
-  itsTree->SetBranchAddress("tracks",&itrack);
-
-  out->cd();
-
-  sprintf(tname,"TreeT_ITSb_%d",GetEventNumber());
-  TTree backTree(tname,"Tree with back propagated ITS tracks");
-  AliTPCtrack *otrack=0;
-  backTree.Branch("tracks","AliTPCtrack",&otrack,32000,2);
-
-  Int_t nentr=(Int_t)itsTree->GetEntries();
-  Int_t i;
-  for (i=0; i<nentr; i++) {
-    itsTree->GetEvent(i);
-    Int_t itsLabel=itrack->GetLabel(); //save the ITS track label
-    ResetTrackToFollow(*itrack);
-
-    // propagete to vertex [SR, GSI 17.02.2003]
-    fTrackToFollow.PropagateTo(3.,0.0028,65.19);
-    fTrackToFollow.PropagateToVertex();
-
-    // Start Time measurement [SR, GSI 17.02.2003]
-    fTrackToFollow.StartTimeIntegral();
-    fTrackToFollow.PropagateTo(3.,-0.0028,65.19);
-    //
-
-    fTrackToFollow.ResetCovariance(); fTrackToFollow.ResetClusters();
-    if (!RefitAt(49.,&fTrackToFollow,itrack)) continue;
-
-    if (CorrectForDeadZoneMaterial(&fTrackToFollow)!=0) {
-       Warning("PropagateBack",
-               "failed to correct for the material in the dead zone !\n");
-       continue;
-    }
-   
-    fTrackToFollow.SetLabel(itsLabel);
-    otrack=new AliTPCtrack(fTrackToFollow,fTrackToFollow.GetAlpha()); 
-    backTree.Fill(); delete otrack;
-    UseClusters(&fTrackToFollow);
-  }
-  i=(Int_t)backTree.GetEntries();
-  backTree.Write();
-
-  Info("PropagateBack","Number of ITS tracks: %d\n",nentr);
-  Info("PropagateBack","Number of back propagated ITS tracks: %d\n",i);
-
-  delete itrack;
-  delete itsTree; //Thanks to Mariana Bondila
-
-  UnloadClusters();
-
-  savedir->cd();
-
-  return 0;
-  */
-}
-
 Int_t AliITStrackerV2::RefitInward(AliESD *event) {
   //--------------------------------------------------------------------
   // This functions refits ITS tracks using the 
@@ -528,12 +443,12 @@ Int_t AliITStrackerV2::RefitInward(AliESD *event) {
        fTrackToFollow.CookdEdx();
        CookLabel(&fTrackToFollow,0.); //For comparison only
 
-       fTrackToFollow.PropagateTo(3.,0.0028,65.19); //The beam pipe
-       fTrackToFollow.PropagateToVertex();
-
-       fTrackToFollow.UpdateESDtrack(AliESDtrack::kITSrefit);
-       UseClusters(&fTrackToFollow);
-       ntrk++;
+       if (fTrackToFollow.PropagateTo(3.,0.0028,65.19)) //The beam pipe    
+        if (fTrackToFollow.PropagateToVertex()) {
+            fTrackToFollow.UpdateESDtrack(AliESDtrack::kITSrefit);
+            UseClusters(&fTrackToFollow);
+            ntrk++;
+         }
     }
     delete t;
   }
@@ -543,144 +458,6 @@ Int_t AliITStrackerV2::RefitInward(AliESD *event) {
   return 0;
 }
 
-Int_t AliITStrackerV2::RefitInward(TTree *in, TTree *out) {
-  //--------------------------------------------------------------------
-  // This functions refits ITS tracks using the 
-  // "inward propagated" TPC tracks
-  //--------------------------------------------------------------------
-  Error("RefitInward","This method is not converted to NewIO yet (Args: %x , %x )\n",in,out);
-  return 1;
-  /*
-  TFile *in=(TFile*)inp;
-  TDirectory *savedir=gDirectory; 
-
-  if (LoadClusters()!=0) return 1;
-
-  if (!inSeeds->IsOpen()) {
-    Error("RefitInward","file with inward TPC tracks is not open !\n");
-    return 2;
-  }
-
-  if (!in->IsOpen()) {
-    Error("RefitInward","file with ITS tracks is not open !\n");
-    return 2;
-  }
-
-  if (!out->IsOpen()) {
-    Error("RefitInward","file for inward ITS tracks is not open !\n");
-    return 3;
-  }
-
-  Int_t i;
-
-  //LUT used for the track matching (S.Radomski's idea)
-  const Int_t nLab = 400000; // limit on the number of track labels
-  Int_t lut[nLab];
-  for(i=0; i<nLab; i++) lut[i] = -1;
-
-  Char_t tname[100];
-
-  TObjArray itsTracks(15000);
-  {// Read the ITS tracks  
-    sprintf(tname,"TreeT_ITS_%d",GetEventNumber());
-    TTree *itsTree=(TTree*)in->Get(tname);
-    if (!itsTree) {
-      Error("RefitInward","can't get a tree with ITS tracks !\n");
-      return 3;
-    }
-    AliITStrackV2 *itrack=new AliITStrackV2; 
-    itsTree->SetBranchAddress("tracks",&itrack);
-    Int_t nits=(Int_t)itsTree->GetEntries();
-
-    Info("RefitInward","Number of ITS tracks: %d\n",nits);
-
-    for (Int_t i=0; i<nits; i++) {
-       itsTree->GetEvent(i);
-       Int_t lab=TMath::Abs(itrack->GetLabel());
-       if (lab < nLab) {
-         if (lut[lab]>=0) Warning("RefitInward","double track %d\n",lab);
-         lut[lab]=i;
-       } else {
-         Warning("RefitInward","Too big ITS track label: %d\n!",lab);
-         continue;
-       } 
-       itsTracks.AddLast(new AliITStrackV2(*itrack));
-    }
-    delete itsTree;
-    delete itrack;
-  }
-
-  //Get the input seeds tree
-  inSeeds->cd();
-  sprintf(tname,"tracksTPC_%d",GetEventNumber());
-  TTree *tpcTree=(TTree*)inSeeds->Get(tname);
-  if (!tpcTree) {
-     Error("RefitInward","can't get a tree with TPC tracks !\n");
-     return 3;
-  }
-  AliTPCtrack *itrack=new AliTPCtrack; 
-  tpcTree->SetBranchAddress("tracks",&itrack);
-  Int_t ntpc=(Int_t)tpcTree->GetEntries();
-
-  Info("RefitInward","Number of TPC tracks: %d\n",ntpc);
-
-  //Create the output tree
-  out->cd();
-  sprintf(tname,"TreeT_ITSinward_%d",GetEventNumber());
-  TTree outTree(tname,"Tree with inward refitted ITS tracks");
-  AliITStrackV2 *otrack=0;
-  outTree.Branch("tracks","AliITStrackV2",&otrack,32000,0);
-
-  for (i=0; i<ntpc; i++) {
-    tpcTree->GetEvent(i);
-    try {
-      otrack=new AliITStrackV2(*itrack);
-    } catch (const Char_t *msg) {
-      Warning("RefitInward",msg);
-      delete otrack;
-      continue;
-    }
-    //check if this track was reconstructed in the ITS
-    Int_t lab=TMath::Abs(otrack->GetLabel());
-    if (lab >= nLab) {
-      Warning("RefitInward","Too big TPC track label: %d\n!",lab); 
-      continue;
-    }
-    Int_t idx=lut[lab];
-    if (idx<0) continue; //no prolongation in the ITS for this track
-    
-    if (CorrectForDeadZoneMaterial(otrack)!=0) {
-       Warning("RefitInward",
-               "failed to correct for the material in the dead zone !\n");
-       continue;
-    }
-
-    //Refitting...
-    {
-    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 otrack;
-  }
-  i=(Int_t)outTree.GetEntries();
-  Info("RefitInward","Number of inward refitted ITS tracks: %d\n",i);
-  outTree.Write();
-
-  delete tpcTree;
-  delete itrack;
-  UnloadClusters();
-  itsTracks.Delete();
-
-  savedir->cd();
-
-  return 0;
-  */
-}
-
 AliCluster *AliITStrackerV2::GetCluster(Int_t index) const {
   //--------------------------------------------------------------------
   //       Return pointer to a given cluster
index e821cd4..bfe80ff 100644 (file)
@@ -28,9 +28,7 @@ public:
   void UnloadClusters();
   Int_t Clusters2Tracks(TTree *in, TTree *out);
   Int_t Clusters2Tracks(AliESD *event);
-  Int_t PropagateBack(TTree *in, TTree *out);
   Int_t PropagateBack(AliESD *event);
-  Int_t RefitInward(TTree *in, TTree *out);
   Int_t RefitInward(AliESD *event);
   Bool_t RefitAt(Double_t x, AliITStrackV2 *seed, const AliITStrackV2 *t);
   void SetupFirstPass(Int_t *flags, Double_t *cuts=0);
index 139d3b9..f8ec53c 100644 (file)
@@ -54,8 +54,8 @@ Int_t AliV0vertexer::Tracks2V0vertices(AliESD *event) {
      AliITStrackV2 *iotrack=new AliITStrackV2(*esd);
      iotrack->SetLabel(i);  // now it is the index in array of ESD tracks
      if ((status&AliESDtrack::kITSrefit)==0)   //correction for the beam pipe
-        iotrack->PropagateTo(3.,0.0023,65.19); //material
-     iotrack->PropagateTo(2.5,0.,0.);
+        if (!iotrack->PropagateTo(3.,0.0023,65.19)) continue;
+     if (!iotrack->PropagateTo(2.5,0.,0.)) continue;
 
      if (iotrack->Get1Pt() > 0.) {nneg++; negtrks.AddLast(iotrack);}
      else {npos++; postrks.AddLast(iotrack);}
@@ -125,6 +125,9 @@ Int_t AliV0vertexer::Tracks2V0vertices(TTree *tTree, TTree *vTree) {
   //--------------------------------------------------------------------
   //This function reconstructs V0 vertices
   //--------------------------------------------------------------------
+  Warning("Tracks2V0vertices(TTree*,TTree*)",
+         "Will be removed soon !  Use Tracks2V0vertices(AliESD*) instead");
+
    TBranch *branch=tTree->GetBranch("tracks");
    if (!branch) {
       Error("Tracks2V0vertices","Can't get the branch !");
@@ -143,7 +146,8 @@ Int_t AliV0vertexer::Tracks2V0vertices(TTree *tTree, TTree *vTree) {
        branch->SetAddress(&iotrack);
        tTree->GetEvent(i);
 
-       iotrack->PropagateTo(3.,0.0023,65.19); iotrack->PropagateTo(2.5,0.,0.);
+       if (!iotrack->PropagateTo(3.,0.0023,65.19)) continue; 
+       if (!iotrack->PropagateTo(2.5,0.,0.)) continue;
 
        if (iotrack->Get1Pt() > 0.) {nneg++; negtrks.AddLast(iotrack);}
        else {npos++; postrks.AddLast(iotrack);}
index 63340ef..59478bf 100644 (file)
@@ -299,7 +299,13 @@ Double_t AliTPCtrack::GetYat(Double_t xk) const {
 // This function calculates the Y-coordinate of a track at the plane x=xk.
 //-----------------------------------------------------------------
     Double_t c1=fP4*fX - fP2, r1=TMath::Sqrt(1.- c1*c1);
-    Double_t c2=fP4*xk - fP2, r2=TMath::Sqrt(1.- c2*c2);
+    Double_t c2=fP4*xk - fP2;
+    if (c2*c2>0.99999) {
+       Int_t n=GetNumberOfClusters();
+       if (n>4) cerr<<n<<"AliTPCtrack::GetYat: can't evaluate the y-coord !\n";
+       return 1e10;
+    } 
+    Double_t r2=TMath::Sqrt(1.- c2*c2);
     return fP0 + (xk-fX)*(c1+c2)/(r1+r2);
 }
 
index 3cb2293..26f968c 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.39  2003/11/06 07:40:05  kowal2
+Removed dependencies
+
 Revision 1.38  2003/10/17 12:01:16  kowal2
 Removed compiler warning.
 
@@ -127,7 +130,6 @@ Splitted from AliTPCtracking
 #include <TError.h>
 #include <TFile.h>
 #include <TTree.h>
-#include <stdlib.h>
 
 #include "AliESD.h"
 
@@ -347,8 +349,7 @@ Int_t AliTPCtracker::LoadClusters(TTree *cTree) {
       Int_t nir=fInnerSec->GetNRows(), nor=fOuterSec->GetNRows();
       Int_t id=carray.GetID();
       if ((id<0) || (id>2*(fkNIS*nir + fkNOS*nor))) {
-        Error("LoadClusters","Wrong index !");
-         exit(1);
+        Fatal("LoadClusters","Wrong index !");
       }
       Int_t outindex = 2*fkNIS*nir;
       if (id<outindex) {
@@ -821,81 +822,6 @@ Int_t AliTPCtracker::Clusters2Tracks(AliESD *event) {
 }
 
 //_____________________________________________________________________________
-Int_t AliTPCtracker::Clusters2Tracks(TTree *cTree, TTree *tTree) {
-  //-----------------------------------------------------------------
-  // This is a track finder.
-  //-----------------------------------------------------------------
-  if (LoadClusters(cTree)) {
-    Error("Clusters2Tracks","Problem with loading the clusters...");
-    return 1;
-  }
-
-  AliTPCtrack *iotrack=0;
-  TBranch *branch=tTree->GetBranch("tracks");
-  if (!branch) tTree->Branch("tracks","AliTPCtrack",&iotrack,32000,3);
-  else branch->SetAddress(&iotrack);
-
-  //find track seeds
-  Int_t nup=fOuterSec->GetNRows(), nlow=fInnerSec->GetNRows();
-  Int_t nrows=nlow+nup;
-  if (fSeeds==0) {
-     Int_t gap=Int_t(0.125*nrows), shift=Int_t(0.5*gap);
-     fSectors=fOuterSec; fN=fkNOS;
-     fSeeds=new TObjArray(15000);     
-     MakeSeeds(nup-1, nup-1-gap);
-     MakeSeeds(nup-1-shift, nup-1-shift-gap);
-  }
-  fSeeds->Sort();
-
-  Int_t found=0;
-  Int_t nseed=fSeeds->GetEntriesFast();
-
-  for (Int_t i=0; i<nseed; i++) {
-    //tracking in the outer sectors
-    fSectors=fOuterSec; fN=fkNOS;
-
-    AliTPCseed *pt=(AliTPCseed*)fSeeds->UncheckedAt(i), &t=*pt;
-    if (!FollowProlongation(t)) {
-       delete fSeeds->RemoveAt(i);
-       continue;
-    }
-
-    //tracking in the inner sectors
-    fSectors=fInnerSec; fN=fkNIS;
-
-    Double_t alpha=t.GetAlpha() - fInnerSec->GetAlphaShift();
-    if (alpha > 2.*TMath::Pi()) alpha -= 2.*TMath::Pi();
-    if (alpha < 0.            ) alpha += 2.*TMath::Pi();
-    Int_t ns=Int_t(alpha/fInnerSec->GetAlpha())%fkNIS;
-
-    alpha=ns*fInnerSec->GetAlpha()+fInnerSec->GetAlphaShift()-t.GetAlpha();
-
-    if (t.Rotate(alpha)) {
-      if (FollowProlongation(t)) {
-        if (t.GetNumberOfClusters() >= Int_t(0.4*nrows)) {
-          t.CookdEdx();
-          CookLabel(pt,0.1); //For comparison only
-          pt->PropagateTo(fParam->GetInnerRadiusLow());
-          iotrack=pt;
-          tTree->Fill();
-          UseClusters(&t);
-         found++;
-        }
-      }
-    }
-    delete fSeeds->RemoveAt(i); 
-  }
-  
-  Info("Clusters2Tracks","Number of found tracks : %d",found);
-
-  UnloadClusters();
-
-  fSeeds->Clear(); delete fSeeds; fSeeds=0;
-
-  return 0;
-}
-
-//_____________________________________________________________________________
 Int_t AliTPCtracker::RefitInward(AliESD* event) {
   //
   // The function propagates tracks throught TPC inward
@@ -944,146 +870,6 @@ Int_t AliTPCtracker::RefitInward(AliESD* event) {
   return 0;
 }
 
-//_____________________________________________________________________________
-Int_t AliTPCtracker::RefitInward(TTree */*in*/, TTree */*out*/) {
-  //
-  // The function propagates tracks throught TPC inward
-  // using already associated clusters.
-  //
-  Error("RefitInward","This method is not converted to NewIO yet\n");
-  return 1;
-  /*
-  if (!inSeeds->IsOpen()) {
-    cout << "Input File with seeds not open !\n" << endl;
-    return 1;
-  }
-  
-  if (!inTracks->IsOpen()) {
-    cout << "Input File not open !\n" << endl;
-    return 2;
-  }
-  
-  if (!outTracks->IsOpen()) {
-    cout << "Output File not open !\n" << endl;
-    return 3;
-  }
-
-  TDirectory *savedir = gDirectory; 
-  LoadClusters();
-
-  // Connect to input seeds tree
-  inSeeds->cd();
-  char tname[100];
-  sprintf(tname, "seedTRDtoTPC_%d", GetEventNumber()); 
-  TTree *seedsTree = (TTree*)inSeeds->Get(tname);
-  TBranch *inSeedBranch = seedsTree->GetBranch("tracks");
-  AliTPCtrack *inSeedTrack = 0;
-  inSeedBranch->SetAddress(&inSeedTrack);
-
-  Int_t nSeeds = (Int_t)seedsTree->GetEntries();
-
-  // Connect to input tree
-  inTracks->cd();
-  sprintf(tname,"TreeT_TPC_%d",GetEventNumber());
-//  sprintf(tname,"seedsTPCtoTRD_%d",GetEventNumber());
-  TTree *inputTree = (TTree*)inTracks->Get(tname);
-  TBranch *inBranch = inputTree->GetBranch("tracks");
-  AliTPCtrack *inTrack = 0;
-  inBranch->SetAddress(&inTrack);
-
-  Int_t nTracks = (Int_t)inputTree->GetEntries();
-
-  // Create output tree
-  outTracks->cd(); 
-  AliTPCtrack *outTrack = new AliTPCtrack();
-  sprintf(tname, "tracksTPC_%d", GetEventNumber()); 
-  TTree *outputTree = new TTree(tname,"Refited TPC tracks");
-  outputTree->Branch("tracks", "AliTPCtrack", &outTrack, 32000, 3);
-
-  Int_t nRefited = 0;
-
-  // create table of track labels
-  Int_t* inLab = new Int_t[nTracks];
-  for (Int_t i = 0; i < nTracks; i++) inLab[i] = -1;
-
-  // [SR, 01.04.2003] - Barrel tracks
-  if (IsStoringBarrel()) SetBarrelTree("refit");
-
-  for(Int_t t=0; t < nSeeds; t++) {
-    
-    seedsTree->GetEntry(t);
-    // find TPC track for seed
-    Int_t lab = TMath::Abs(inSeedTrack->GetLabel());
-    for(Int_t i=0; i < nTracks; i++) {
-      if (inLab[i] == lab) {
-       inputTree->GetEntry(i);
-       break;
-      } else if (inLab[i] < 0) {
-       inputTree->GetEntry(i);
-       inLab[i] = TMath::Abs(inTrack->GetLabel());
-       if (inLab[i] == lab) break;
-      }
-    }
-    if (TMath::Abs(inTrack->GetLabel()) != lab) continue;
-    AliTPCseed *seed = new AliTPCseed(*inSeedTrack, inTrack->GetAlpha());
-    if (IsStoringBarrel()) StoreBarrelTrack(seed, 4, 2);
-
-    fSectors = fOuterSec;
-
-    Int_t res = FollowRefitInward(seed, inTrack);
-    UseClusters(seed);
-    Int_t nc = seed->GetNumberOfClusters();
-
-    if (IsStoringBarrel()) StoreBarrelTrack(seed, 3, 2);
-    if (IsStoringBarrel()) StoreBarrelTrack(seed, 2, 2);
-
-    fSectors = fInnerSec;
-
-    res = FollowRefitInward(seed, inTrack);
-    UseClusters(seed, nc);
-
-    if (IsStoringBarrel()) StoreBarrelTrack(seed, 1, 2);
-
-    if (res) {
-      seed->PropagateTo(fParam->GetInnerRadiusLow());
-      outTrack = (AliTPCtrack*)seed;
-      outTrack->SetLabel(inTrack->GetLabel());
-      outTrack->SetdEdx(inTrack->GetdEdx());
-      outputTree->Fill();
-      nRefited++;
-    }
-
-    if (IsStoringBarrel()) fBarrelTree->Fill();
-    delete seed;
-  }
-
-  cout << "Refitted " << nRefited << " tracks." << endl;
-
-  outTracks->cd();
-  outputTree->Write();
-  
-  delete[] inLab;
-  
-  // [SR, 01.04.2003]
-  if (IsStoringBarrel()) {
-    fBarrelFile->cd();
-    fBarrelTree->Write();
-    fBarrelFile->Flush();  
-    
-    delete fBarrelArray;
-    delete fBarrelTree;
-  }
-  
-  if (inputTree) delete inputTree;
-  if (outputTree) delete outputTree;
-
-  savedir->cd();
-  UnloadClusters();
-
-  return 0;
-  */
-}
-
 Int_t AliTPCtracker::PropagateBack(AliESD *event) {
   //-----------------------------------------------------------------
   // This function propagates tracks back through the TPC.
@@ -1157,243 +943,6 @@ Int_t AliTPCtracker::PropagateBack(AliESD *event) {
   return 0;
 }
 
-//_____________________________________________________________________________
-Int_t AliTPCtracker::PropagateBack(TTree */*in*/, TTree */*out*/) {
-  //-----------------------------------------------------------------
-  // This function propagates tracks back through the TPC.
-  //-----------------------------------------------------------------
-  Error("PropagateBack","This method is not converted to NewIO yet\n");
-  return 1;
-  /*
-  fSeeds=new TObjArray(15000);
-
-  TFile *in=(TFile*)inp;
-  TFile *in2=(TFile*)inp2;
-  TDirectory *savedir=gDirectory; 
-
-  if (!in->IsOpen()) {
-     cerr<<"AliTPCtracker::PropagateBack(): ";
-     cerr<<"file with TPC (or back propagated ITS) tracks is not open !\n";
-     return 1;
-  }
-
-  if (!out->IsOpen()) {
-     cerr<<"AliTPCtracker::PropagateBack(): ";
-     cerr<<"file for back propagated TPC tracks is not open !\n";
-     return 2;
-  }
-
-  LoadClusters();
-
-  in->cd();
-  char tName[100];
-  sprintf(tName,"TreeT_ITSb_%d",GetEventNumber());
-  TTree *bckTree=(TTree*)in->Get(tName);
-  if (!bckTree && inp2) bckTree=(TTree*)in2->Get(tName);
-  if (!bckTree) {
-     cerr<<"AliTPCtracker::PropagateBack() ";
-     cerr<<"can't get a tree with back propagated ITS tracks !\n";
-     //return 3;
-  }
-  AliTPCtrack *bckTrack=new AliTPCtrack; 
-  if (bckTree) bckTree->SetBranchAddress("tracks",&bckTrack);
-
-  sprintf(tName,"TreeT_TPC_%d",GetEventNumber());
-  TTree *tpcTree=(TTree*)in->Get(tName);
-  if (!tpcTree) {
-     cerr<<"AliTPCtracker::PropagateBack() ";
-     cerr<<"can't get a tree with TPC tracks !\n";
-     return 4;
-  }
-  AliTPCtrack *tpcTrack=new AliTPCtrack; 
-  tpcTree->SetBranchAddress("tracks",&tpcTrack);
-
-  // [SR, 01.04.2003] - Barrel tracks
-  if (IsStoringBarrel()) SetBarrelTree("back");
-  
-  // Prepare an array of tracks to be back propagated
-  Int_t nup=fOuterSec->GetNRows(), nlow=fInnerSec->GetNRows();
-  Int_t nrows=nlow+nup;
-
-  //
-  // Match ITS tracks with old TPC tracks
-  // the tracks do not have to be sorted [SR, GSI, 18.02.2003]
-  //
-  // the algorithm is linear and uses LUT for sorting
-  // cost of the algorithm: 2 * number of tracks
-  //
-
-  TObjArray tracks(15000);
-  Int_t i=0;
-  Int_t tpcN= (Int_t)tpcTree->GetEntries();
-  Int_t bckN= (bckTree)? (Int_t)bckTree->GetEntries() : 0;
-
-  // look up table   
-  const Int_t nLab = 200000; // limit on number of primaries (arbitrary)
-  Int_t lut[nLab];
-  for(Int_t i=0; i<nLab; i++) lut[i] = -1;
-    
-  if (bckTree) {
-    for(Int_t i=0; i<bckN; i++) {
-      bckTree->GetEvent(i);
-      Int_t lab = TMath::Abs(bckTrack->GetLabel());
-      if (lab < nLab) lut[lab] = i;
-      else {
-       cerr << "AliTPCtracker: The size of the LUT is too small\n";
-      }
-    }
-  }
-  
-  for (Int_t i=0; i<tpcN; i++) {
-    tpcTree->GetEvent(i);
-    Double_t alpha=tpcTrack->GetAlpha();
-    
-    if (!bckTree) { 
-
-      // No ITS - use TPC track only
-      
-      tpcTrack->ResetCovariance();
-      AliTPCseed * seed = new AliTPCseed(*tpcTrack, tpcTrack->GetAlpha());
-
-      fSeeds->AddLast(seed);
-      tracks.AddLast(new AliTPCtrack(*tpcTrack));
-    
-    } else {  
-      
-      // with ITS
-      // discard not prolongated tracks (to be discussed)
-
-      Int_t lab = TMath::Abs(tpcTrack->GetLabel());
-      if (lab > nLab || lut[lab] < 0) continue;
-
-      bckTree->GetEvent(lut[lab]);   
-      bckTrack->Rotate(alpha-bckTrack->GetAlpha());
-
-      fSeeds->AddLast(new AliTPCseed(*bckTrack,bckTrack->GetAlpha()));
-      tracks.AddLast(new AliTPCtrack(*tpcTrack));
-    }
-  }
-
-  // end of matching
-
-  out->cd();
-
-  // tree name seedsTPCtoTRD as expected by TRD and as 
-  // discussed and decided in Strasbourg (May 2002)
-  // [SR, GSI, 18.02.2003]
-  
-  sprintf(tName,"seedsTPCtoTRD_%d",GetEventNumber());
-  TTree backTree(tName,"Tree with back propagated TPC tracks");
-
-  AliTPCtrack *otrack=0;
-  backTree.Branch("tracks","AliTPCtrack",&otrack,32000,0);
-
-  //
-  Int_t nRefPlane;
-  Int_t found=0;
-  Int_t nseed=fSeeds->GetEntriesFast();
-      
-  // loop changed [SR, 01.04.2003]
-
-  for (i=0; i<nseed; i++) {
-
-    nRefPlane = 1;
-    if (IsStoringBarrel()) fBarrelArray->Clear();
-
-     AliTPCseed *ps=(AliTPCseed*)fSeeds->UncheckedAt(i), &s=*ps;
-     const AliTPCtrack *pt=(AliTPCtrack*)tracks.UncheckedAt(i), &t=*pt;
-
-    ps->ResetNWrong();
-    ps->ResetNRotation();
-    
-    if (IsStoringBarrel()) StoreBarrelTrack(ps, 1, 1);
-
-    // Load outer sectors
-    fSectors=fInnerSec;
-    fN=fkNIS;
-       
-     Int_t nc=t.GetNumberOfClusters();
-    //s.SetLabel(nc-1); //set number of the cluster to start with
-    s.SetNumber(nc);
-
-    if (FollowBackProlongation(s,t)) UseClusters(&s);    
-    else {
-      fSeeds->RemoveAt(i);
-        continue;
-     }
-
-    if (IsStoringBarrel()) StoreBarrelTrack(ps, 2, 1);
-    if (IsStoringBarrel()) StoreBarrelTrack(ps, 3, 1);
-
-    // Load outer sectors
-    fSectors=fOuterSec; 
-    fN=fkNOS;
-    
-    nc=s.GetNumberOfClusters();
-
-     Double_t alpha=s.GetAlpha() - fSectors->GetAlphaShift();
-     if (alpha > 2.*TMath::Pi()) alpha -= 2.*TMath::Pi();
-     if (alpha < 0.            ) alpha += 2.*TMath::Pi();
-     Int_t ns=Int_t(alpha/fSectors->GetAlpha())%fN;
-
-     alpha =ns*fSectors->GetAlpha() + fSectors->GetAlphaShift();
-     alpha-=s.GetAlpha();
-
-     if (s.Rotate(alpha)) {
-       if (FollowBackProlongation(s,t)) {
-         if (s.GetNumberOfClusters() >= Int_t(0.4*nrows)) {
-           s.CookdEdx();
-           s.SetLabel(t.GetLabel());
-           UseClusters(&s,nc);
-           
-           // Propagate to outer reference plane for comparison reasons
-           // reason for keeping fParam object [SR, GSI, 18.02.2003] 
-         
-           ps->PropagateTo(fParam->GetOuterRadiusUp()); 
-           otrack=ps;
-           backTree.Fill();
-
-          if (IsStoringBarrel()) StoreBarrelTrack(ps, 4, 1);
-          cerr<<found++<<'\r';
-         }
-       }
-     }
-    
-    if (IsStoringBarrel()) fBarrelTree->Fill();
-     delete fSeeds->RemoveAt(i);
-  }  
-
-
-  out->cd();
-  backTree.Write();
-
-  // [SR, 01.04.2003]
-  if (IsStoringBarrel()) {
-    fBarrelFile->cd();
-    fBarrelTree->Write();
-    fBarrelFile->Flush();  
-
-    delete fBarrelArray;
-    delete fBarrelTree;
-  }
-
-  savedir->cd();
-  cerr<<"Number of seeds: "<<nseed<<endl;
-  cerr<<"Number of back propagated ITS tracks: "<<bckN<<endl;
-  cerr<<"Number of back propagated TPC tracks: "<<found<<endl;
-
-  delete bckTrack;
-  delete tpcTrack;
-
-  if (bckTree) delete bckTree; //Thanks to Mariana Bondila
-  delete tpcTree; //Thanks to Mariana Bondila
-
-  UnloadClusters();  
-
-  return 0;
-  */
-}
-
 //_________________________________________________________________________
 AliCluster *AliTPCtracker::GetCluster(Int_t index) const {
   //--------------------------------------------------------------------
index d2727a9..b2891e0 100644 (file)
@@ -39,11 +39,8 @@ public:
    void UnloadClusters();
 
    AliCluster *GetCluster(Int_t index) const;
-   Int_t Clusters2Tracks(TTree *in, TTree *out);
    Int_t Clusters2Tracks(AliESD *event);
-   Int_t PropagateBack(TTree *in, TTree *out);
    Int_t PropagateBack(AliESD *event);
-   Int_t RefitInward(TTree *inTracks, TTree *outTracks);
    Int_t RefitInward(AliESD *event);
 
    virtual void  CookLabel(AliKalmanTrack *t,Float_t wrong) const;