/*
$Log$
+Revision 1.37 2003/07/22 15:56:14 hristov
+Implementing ESD functionality in the NewIO (Yu.Belikov)
+
+Revision 1.35.2.3 2003/07/15 09:58:03 hristov
+Corrected back-propagation (Yu.Belikov)
+
+Revision 1.35.2.2 2003/07/14 09:19:33 hristov
+TOF included in the combined PID (Yu.Belikov)
+
+Revision 1.35.2.1 2003/07/11 10:53:01 hristov
+Inward refit for TPC and TRD in the ESD schema (T.Kuhr)
+
+Revision 1.35 2003/05/23 10:08:51 hristov
+SetLabel replaced by SetNumber (Yu.Belikov)
+
+Revision 1.34 2003/05/22 13:57:48 hristov
+First implementation of ESD classes (Yu.Belikov)
+
Revision 1.32 2003/04/10 10:36:54 hristov
Code for unified TPC/TRD tracking (S.Radomski)
// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
//-------------------------------------------------------
#include <TObjArray.h>
+#include <TError.h>
#include <TFile.h>
#include <TTree.h>
-#include <Riostream.h>
+#include <stdlib.h>
#include "AliESD.h"
#include "AliTPCParam.h"
#include "AliClusters.h"
-#include "TVector2.h"
-
-#include <stdlib.h>
-
ClassImp(AliTPCtracker)
//_____________________________________________________________________________
return (z1 - z2)/sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
-Int_t AliTPCtracker::LoadClusters() {
- return LoadClusters(gFile);
-}
-
//_____________________________________________________________________________
-Int_t AliTPCtracker::LoadClusters(const TFile *cf) {
+Int_t AliTPCtracker::LoadClusters(TTree *cTree) {
//-----------------------------------------------------------------
// This function loads TPC clusters.
//-----------------------------------------------------------------
- if (!((TFile*)cf)->IsOpen()) {
- cerr<<"AliTPCtracker::LoadClusters : "<<
- "file with clusters has not been open !\n";
- return 1;
- }
-
- Char_t name[100];
- sprintf(name,"TreeC_TPC_%d",GetEventNumber());
- TTree *cTree=(TTree*)((TFile*)cf)->Get(name);
- if (!cTree) {
- cerr<<"AliTPCtracker::LoadClusters : "<<
- "can't get the tree with TPC clusters !\n";
- return 2;
- }
-
TBranch *branch=cTree->GetBranch("Segment");
if (!branch) {
- cerr<<"AliTPCtracker::LoadClusters : "<<
- "can't get the segment branch !\n";
- return 3;
+ Error("LoadClusters","Can't get the branch !");
+ return 1;
}
AliClusters carray, *addr=&carray;
Int_t nir=fInnerSec->GetNRows(), nor=fOuterSec->GetNRows();
Int_t id=carray.GetID();
if ((id<0) || (id>2*(fkNIS*nir + fkNOS*nor))) {
- cerr<<"AliTPCtracker::LoadClusters : "<<
- "wrong index !\n";
+ Error("LoadClusters","Wrong index !");
exit(1);
}
Int_t outindex = 2*fkNIS*nir;
}
carray.GetArray()->Clear();
}
- delete cTree;
+
return 0;
}
if (road>kMaxROAD) {
if (t.GetNumberOfClusters()>4)
- cerr<<t.GetNumberOfClusters()
- <<"FindProlongation warning: Too broad road !\n";
+ Warning("FindProlongation","Too broad road !");
return 0;
}
- //if (fSectors == fInnerSec && (nr == 63 || nr == 0)) {
- // cout << nr << "\t" << krow << endl;
- //}
-
if (krow) {
for (Int_t i=krow.Find(y-road); i<krow; i++) {
AliTPCcluster *c=(AliTPCcluster*)(krow[i]);
// 26.02.2003
//
- Double_t alpha=seed->GetAlpha() - fSectors->GetAlphaShift();
- TVector2::Phi_0_2pi(alpha);
- Int_t s=Int_t(alpha/fSectors->GetAlpha())%fN;
+ // loop over rows
- Int_t idx=-1, sec=-1, row=-1;
- Int_t nc = seed->GetNumber();
+ Int_t nRows = fSectors->GetNRows();
+ for (Int_t iRow = nRows; iRow >= 0; iRow--) {
- idx=track->GetClusterIndex(nc);
- sec=(idx&0xff000000)>>24;
- row=(idx&0x00ff0000)>>16;
-
- if (fSectors==fInnerSec) { if (sec >= fkNIS) row=-1; }
- else { if (sec < fkNIS) row=-1; }
-
- Int_t nr=fSectors->GetNRows();
- for (Int_t i=nr-1; i>=0; i--) {
-
- //cout << endl;
- //cout << i << "\t" << nc << "\t"<< row << "\t" << seed->Pt() << "\t" << track->Pt() << "\t\t";
-
- Double_t x=fSectors->GetX(i);
+ Double_t x = fSectors->GetX(iRow);
if (!seed->PropagateTo(x)) return 0;
- // Change sector and rotate seed if necessary
-
- Double_t ymax=fSectors->GetMaxY(i);
- Double_t y=seed->GetY();
-
- if (y > ymax) {
- s = (s+1) % fN;
- if (!seed->Rotate(fSectors->GetAlpha())) return 0;
- } else if (y <-ymax) {
- s = (s-1+fN) % fN;
- if (!seed->Rotate(-fSectors->GetAlpha())) return 0;
+ // try to find an assigned cluster in this row
+
+ AliTPCcluster* cluster = NULL;
+ Int_t idx = -1;
+ Int_t sec = -1;
+ for (Int_t iCluster = 0; iCluster < track->GetNumberOfClusters(); iCluster++) {
+ idx = track->GetClusterIndex(iCluster);
+ sec = (idx&0xff000000)>>24;
+ Int_t row = (idx&0x00ff0000)>>16;
+ if (((fSectors == fInnerSec) && (sec >= fkNIS)) ||
+ ((fSectors == fOuterSec) && (sec < fkNIS))) continue;
+ if (row == iRow) {
+ cluster = (AliTPCcluster*) GetCluster(idx);
+ break;
+ }
}
- // try to find a cluster
-
- AliTPCcluster *cl=0;
- Int_t index = 0;
- Double_t maxchi2 = kMaxCHI2;
-
- if (row==i) {
+ // update the track seed with the found cluster
- //cout << row << endl;
- // accept already found cluster
- AliTPCcluster *c=(AliTPCcluster*)GetCluster(idx);
- Double_t chi2 = seed->GetPredictedChi2(c);
-
- index=idx;
- cl=c;
- maxchi2=chi2;
-
- //cout << c->GetY() << "\t" << seed->GetY() << "\t" << track->GetY();
-
- if (--nc >= 0 /* track->GetNumberOfClusters()*/ ) {
- idx=track->GetClusterIndex(nc);
- sec=(idx&0xff000000)>>24;
- row=(idx&0x00ff0000)>>16;
+ if (cluster) {
+ Double_t dAlpha = fParam->GetAngle(sec) - seed->GetAlpha();
+ if (TMath::Abs(dAlpha) > 0.0001) {
+ if (!seed->Rotate(dAlpha)) return 0;
+ if (!seed->PropagateTo(x)) return 0;
}
-
- if (fSectors==fInnerSec) { if (sec >= fkNIS) row=-1; }
- else { if (sec < fkNIS) row=-1; }
-
- }
-
- if (cl) {
- Float_t l=fSectors->GetPadPitchWidth();
- Float_t corr=1.; if (i>63) corr=0.67; // new (third) pad response !
- seed->SetSampledEdx(cl->GetQ()/l*corr,seed->GetNumberOfClusters());
- seed->Update(cl,maxchi2,index);
+
+ seed->Update(cluster, seed->GetPredictedChi2(cluster), idx);
}
}
- seed->SetNumber(nc);
return 1;
}
Int_t s=Int_t(alpha/fSectors->GetAlpha())%fN;
Int_t idx=-1, sec=-1, row=-1;
- //Int_t nc=seed.GetLabel(); //index of the cluster to start with
Int_t nc=seed.GetNumber();
if (nc--) {
Int_t nr=fSectors->GetNRows();
for (Int_t i=0; i<nr; i++) {
Double_t x=fSectors->GetX(i), ymax=fSectors->GetMaxY(i);
-
- //cout << i << "\t" << nc << "\t" << row << "\t" << track.GetNumberOfClusters() << endl;
-
- if (!seed.PropagateTo(x)) return 0;
-
- Double_t y=seed.GetY();
+ Double_t y=seed.GetYat(x);
+
if (y > ymax) {
s = (s+1) % fN;
if (!seed.Rotate(fSectors->GetAlpha())) return 0;
if (!seed.Rotate(-fSectors->GetAlpha())) return 0;
}
+ if (!seed.PropagateTo(x)) return 0;
+
AliTPCcluster *cl=0;
Int_t index=0;
Double_t maxchi2=kMaxCHI2;
Double_t sz2=SigmaZ2(seed.GetX(),seed.GetTgl());
Double_t road=4.*sqrt(seed.GetSigmaY2() + sy2), z=seed.GetZ();
if (road>kMaxROAD) {
- cerr<<seed.GetNumberOfClusters()
- <<"AliTPCtracker::FollowBackProlongation: Too broad road !\n";
+ Warning("FollowBackProlongation","Too broad road !");
return 0;
}
Int_t accepted=seed.GetNumberOfClusters();
if (row==i) {
-
- //if (fSectors == fInnerSec && row == 0)
- //cout << "row == " << row << endl;
-
//try to accept already found cluster
AliTPCcluster *c=(AliTPCcluster*)GetCluster(idx);
Double_t chi2;
}
- //seed.SetLabel(nc);
seed.SetNumber(nc);
return 1;
if (TMath::Abs(zz-z2)>5.) continue;
Double_t d=(x2-x1)*(0.-y2)-(0.-x2)*(y2-y1);
- if (d==0.) {cerr<<"MakeSeeds warning: Straight seed !\n"; continue;}
-
+ if (d==0.) {
+ Warning("MakeSeeds","Straight seed !");
+ continue;
+ }
x[0]=y1;
x[1]=z1;
x[4]=f1(x1,y1,x2,y2,x3,y3);
TFile *in=(TFile*)inp;
if (!in->IsOpen()) {
- cerr<<"AliTPCtracker::ReadSeeds(): input file is not open !\n";
+ Error("ReadSeeds","Input file has not been open !");
return 1;
}
in->cd();
TTree *seedTree=(TTree*)in->Get("Seeds");
if (!seedTree) {
- cerr<<"AliTPCtracker::ReadSeeds(): ";
- cerr<<"can't get a tree with track seeds !\n";
+ Error("ReadSeeds","Can't get a tree with track seeds !");
return 2;
}
AliTPCtrack *seed=new AliTPCtrack;
}
//_____________________________________________________________________________
-Int_t AliTPCtracker::Clusters2Tracks(const TFile *inp, TFile *out) {
+Int_t AliTPCtracker::Clusters2Tracks(AliESD *event) {
//-----------------------------------------------------------------
// This is a track finder.
+ // The clusters must be already loaded !
//-----------------------------------------------------------------
- TDirectory *savedir=gDirectory;
- if (inp) {
- TFile *in=(TFile*)inp;
- if (!in->IsOpen()) {
- cerr<<"AliTPCtracker::Clusters2Tracks(): input file is not open !\n";
- return 1;
- }
+ //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();
- if (!out->IsOpen()) {
- cerr<<"AliTPCtracker::Clusters2Tracks(): output file is not open !\n";
- return 2;
+ 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());
+ AliESDtrack iotrack;
+ iotrack.UpdateTrackParams(pt,AliESDtrack::kTPCin);
+
+ event->AddTrack(&iotrack);
+
+ UseClusters(&t);
+ }
+ }
+ }
+ delete fSeeds->RemoveAt(i);
}
- LoadClusters();
+ Info("Clusters2Tracks","Number of found tracks : %d",
+ event->GetNumberOfTracks());
- out->cd();
+ fSeeds->Clear(); delete fSeeds; fSeeds=0;
+
+ return 0;
+}
+
+//_____________________________________________________________________________
+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;
+ }
- char tname[100];
- sprintf(tname,"TreeT_TPC_%d",GetEventNumber());
- TTree tracktree(tname,"Tree with TPC tracks");
AliTPCtrack *iotrack=0;
- tracktree.Branch("tracks","AliTPCtrack",&iotrack,32000,3);
+ 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 found=0;
Int_t nseed=fSeeds->GetEntriesFast();
- cout << fInnerSec->GetNRows() << " " << fOuterSec->GetNRows() << endl;
-
for (Int_t i=0; i<nseed; i++) {
//tracking in the outer sectors
fSectors=fOuterSec; fN=fkNOS;
CookLabel(pt,0.1); //For comparison only
pt->PropagateTo(fParam->GetInnerRadiusLow());
iotrack=pt;
- tracktree.Fill();
+ tTree->Fill();
UseClusters(&t);
found++;
-// cerr<<found<<'\r';
}
}
}
delete fSeeds->RemoveAt(i);
}
- tracktree.Write();
-
- cerr<<"Number of found tracks : "<<found<<endl;
-
- savedir->cd();
+ Info("Clusters2Tracks","Number of found tracks : %d",found);
UnloadClusters();
+
fSeeds->Clear(); delete fSeeds; fSeeds=0;
return 0;
}
-//_____________________________________________________________________________
-Int_t AliTPCtracker::RefitInward(TFile *in, TFile *out) {
+//_____________________________________________________________________________
+Int_t AliTPCtracker::RefitInward(AliESD* event) {
//
// The function propagates tracks throught TPC inward
// using already associated clusters.
+ // The clusters must be already loaded !
//
- // in - file with back propagated tracks
- // outs - file with inward propagation
+
+ Int_t nTracks = event->GetNumberOfTracks();
+ Int_t nRefited = 0;
+
+ for (Int_t i = 0; i < nTracks; i++) {
+ AliESDtrack* track = event->GetTrack(i);
+ ULong_t status = track->GetStatus();
+
+ if ( (status & AliESDtrack::kTPCout ) == 0 ) continue;
+ if ( (status & AliESDtrack::kTPCrefit) != 0 ) continue;
+
+ AliTPCtrack* tpcTrack = new AliTPCtrack(*track);
+ AliTPCseed* seed = new AliTPCseed(*tpcTrack, tpcTrack->GetAlpha());
+
+ fSectors = fOuterSec;
+
+ Int_t res = FollowRefitInward(seed, tpcTrack);
+ UseClusters(seed);
+ Int_t nc = seed->GetNumberOfClusters();
+
+ fSectors = fInnerSec;
+
+ res = FollowRefitInward(seed, tpcTrack);
+ UseClusters(seed, nc);
+
+ if (res) {
+ seed->PropagateTo(fParam->GetInnerRadiusLow());
+ seed->SetLabel(tpcTrack->GetLabel());
+ seed->SetdEdx(tpcTrack->GetdEdx());
+ track->UpdateTrackParams(seed, AliESDtrack::kTPCrefit);
+ nRefited++;
+ }
+
+ delete seed;
+ delete tpcTrack;
+ }
+
+ Info("RefitInward","Number of refitted tracks : %d",nRefited);
+
+ return 0;
+}
+
+//_____________________________________________________________________________
+Int_t AliTPCtracker::RefitInward(TTree */*in*/, TTree */*out*/) {
//
- // Sylwester Radomski, GSI
- // 26.02.2003
+ // The function propagates tracks throught TPC inward
+ // using already associated clusters.
//
-
- if (!in->IsOpen()) {
- cout << "Input File not open !\n" << endl;
+ 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 (!out->IsOpen()) {
- cout << "Output File not open !\n" << endl;
+ 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
- in->cd();
- TTree *inputTree = (TTree*)in->Get("seedsTPCtoTRD_0");
+ 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
- out->cd();
+ outTracks->cd();
AliTPCtrack *outTrack = new AliTPCtrack();
- TTree *outputTree = new TTree("tracksTPC_0","Refited TPC tracks");
+ 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");
- Int_t nRefited = 0;
-
- for(Int_t t=0; t < nTracks; t++) {
+ for(Int_t t=0; t < nSeeds; t++) {
- cout << t << "\r";
-
- inputTree->GetEvent(t);
- inTrack->ResetCovariance();
- AliTPCseed *seed = new AliTPCseed(*inTrack, inTrack->GetAlpha());
-
- /*
- //cout << inTrack->GetNumberOfClusters() << endl;
- if (inTrack->GetNumberOfClusters() == 158) {
- cout << inTrack->GetNumberOfClusters() << endl;
- cout << endl;
- for(Int_t c=0; c<inTrack->GetNumberOfClusters(); c++) {
- Int_t idx = inTrack->GetClusterIndex(c);
- Int_t row=(idx&0x00ff0000)>>16;
- cout << c << " " << row << endl;
+ 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);
- seed->SetNumber(inTrack->GetNumberOfClusters()-1);
fSectors = fOuterSec;
+
Int_t res = FollowRefitInward(seed, inTrack);
UseClusters(seed);
Int_t nc = seed->GetNumberOfClusters();
if (IsStoringBarrel()) StoreBarrelTrack(seed, 2, 2);
fSectors = fInnerSec;
+
res = FollowRefitInward(seed, inTrack);
UseClusters(seed, nc);
seed->PropagateTo(fParam->GetInnerRadiusLow());
outTrack = (AliTPCtrack*)seed;
outTrack->SetLabel(inTrack->GetLabel());
+ outTrack->SetdEdx(inTrack->GetdEdx());
outputTree->Fill();
nRefited++;
}
cout << "Refitted " << nRefited << " tracks." << endl;
- out->cd();
+ outTracks->cd();
outputTree->Write();
+ delete[] inLab;
+
// [SR, 01.04.2003]
if (IsStoringBarrel()) {
fBarrelFile->cd();
UnloadClusters();
return 0;
+ */
}
-//_____________________________________________________________________________
-Int_t AliTPCtracker::PropagateBack(const TFile *inp, TFile *out) {
+Int_t AliTPCtracker::PropagateBack(AliESD *event) {
//-----------------------------------------------------------------
// This function propagates tracks back through the TPC.
+ // The clusters must be already loaded !
//-----------------------------------------------------------------
- return PropagateBack(inp, NULL, out);
+ Int_t nentr=event->GetNumberOfTracks();
+ Info("PropagateBack", "Number of ESD tracks: %d\n", nentr);
+
+ Int_t ntrk=0;
+ for (Int_t i=0; i<nentr; i++) {
+ AliESDtrack *esd=event->GetTrack(i);
+ ULong_t status=esd->GetStatus();
+
+ if ( (status & AliESDtrack::kTPCin ) == 0 ) continue;
+ if ( (status & AliESDtrack::kTPCout) != 0 ) continue;
+
+ const AliTPCtrack t(*esd);
+ AliTPCseed s(t,t.GetAlpha());
+
+ if ( (status & AliESDtrack::kITSout) == 0 ) s.ResetCovariance();
+
+ s.ResetNWrong();
+ s.ResetNRotation();
+
+ Int_t nc=t.GetNumberOfClusters();
+ s.SetNumber(nc); //set number of the cluster to start with
+
+ //inner sectors
+ fSectors=fInnerSec; fN=fkNIS;
+
+ 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)) continue;
+ if (!FollowBackProlongation(s,t)) continue;
+
+ UseClusters(&s);
+
+ //outer sectors
+ fSectors=fOuterSec; fN=fkNOS;
+
+ nc=s.GetNumberOfClusters();
+
+ alpha=s.GetAlpha() - fSectors->GetAlphaShift();
+ if (alpha > 2.*TMath::Pi()) alpha -= 2.*TMath::Pi();
+ if (alpha < 0. ) alpha += 2.*TMath::Pi();
+ ns=Int_t(alpha/fSectors->GetAlpha())%fN;
+
+ alpha =ns*fSectors->GetAlpha() + fSectors->GetAlphaShift();
+ alpha-=s.GetAlpha();
+
+ if (!s.Rotate(alpha)) continue;
+ if (!FollowBackProlongation(s,t)) continue;
+ {
+ Int_t nrows=fOuterSec->GetNRows()+fInnerSec->GetNRows();
+ if (s.GetNumberOfClusters() < Int_t(0.4*nrows)) continue;
+ }
+ s.PropagateTo(fParam->GetOuterRadiusUp());
+ s.CookdEdx();
+ CookLabel(&s,0.1); //For comparison only
+ UseClusters(&s,nc);
+ esd->UpdateTrackParams(&s,AliESDtrack::kTPCout);
+ ntrk++;
+ }
+ Info("PropagateBack","Number of back propagated tracks: %d",ntrk);
+
+ return 0;
}
//_____________________________________________________________________________
-Int_t AliTPCtracker::PropagateBack(const TFile *inp, const TFile *inp2, TFile *out) {
+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;
// [SR, 01.04.2003] - Barrel tracks
if (IsStoringBarrel()) SetBarrelTree("back");
- //*** Prepare an array of tracks to be back propagated
+ // Prepare an array of tracks to be back propagated
Int_t nup=fOuterSec->GetNRows(), nlow=fInnerSec->GetNRows();
Int_t nrows=nlow+nup;
// end of matching
- /*
- TObjArray tracks(15000);
- Int_t i=0, j=0;
- Int_t tpcN=(Int_t)tpcTree->GetEntries();
- Int_t bckN=(Int_t)bckTree->GetEntries();
- if (j<bckN) bckTree->GetEvent(j++);
- for (i=0; i<tpcN; i++) {
- tpcTree->GetEvent(i);
- Double_t alpha=tpcTrack->GetAlpha();
- if (j<bckN &&
- TMath::Abs(tpcTrack->GetLabel())==TMath::Abs(bckTrack->GetLabel())) {
- if (!bckTrack->Rotate(alpha-bckTrack->GetAlpha())) continue;
- fSeeds->AddLast(new AliTPCseed(*bckTrack,bckTrack->GetAlpha()));
- bckTree->GetEvent(j++);
- } else {
- tpcTrack->ResetCovariance();
- fSeeds->AddLast(new AliTPCseed(*tpcTrack,alpha));
- }
- tracks.AddLast(new AliTPCtrack(*tpcTrack));
- }
- */
-
out->cd();
// tree name seedsTPCtoTRD as expected by TRD and as
UnloadClusters();
return 0;
+ */
}
//_________________________________________________________________________
// Insert a cluster into this pad row in accordence with its y-coordinate
//-----------------------------------------------------------------------
if (fN==kMaxClusterPerRow) {
- cerr<<"AliTPCRow::InsertCluster(): Too many clusters !\n"; return;
+ ::Error("InsertCluster","Too many clusters !");
+ return;
}
Int_t index=(((sec<<8)+row)<<16)+fN;
if (fN==0) {
+ fSize=kMaxClusterPerRow/8;
+ fClusterArray=new AliTPCcluster[fSize];
fIndex[0]=index;
fClusterArray[0]=*c; fClusters[fN++]=fClusterArray;
return;