/*
$Log$
+Revision 1.6 2001/03/13 14:25:47 hristov
+New design of tracking classes (Yu.Belikov)
+
+Revision 1.5 2000/12/20 07:51:59 kowal2
+Changes suggested by Alessandra and Paolo to avoid overlapped
+data fields in encapsulated classes.
+
+Revision 1.4 2000/11/02 07:27:16 kowal2
+code corrections
+
Revision 1.2 2000/06/30 12:07:50 kowal2
Updated from the TPC-PreRelease branch
// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
//-------------------------------------------------------
-#include "AliTPCtracker.h"
-#include "AliTPCcluster.h"
#include <TObjArray.h>
#include <TFile.h>
+#include <TTree.h>
+#include <iostream.h>
+
+#include "AliTPCtracker.h"
+#include "AliTPCcluster.h"
#include "AliTPCClustersArray.h"
#include "AliTPCClustersRow.h"
-#include <TTree.h>
const AliTPCParam *AliTPCtracker::AliTPCSector::fgParam;
//-----------------------------------------------------------------
// This function tries to find a track prolongation.
//-----------------------------------------------------------------
- const Int_t kSKIP=(t.GetNumberOfClusters()<10) ?
- 10 : Int_t(0.5*sec->GetNRows());
+ const Int_t kSKIP=(t.GetNumberOfClusters()<10) ? 10 :
+ Int_t(0.5*sec->GetNRows());
Int_t tryAgain=kSKIP;
Double_t alpha=sec->GetAlpha();
Int_t ns=Int_t(2*TMath::Pi()/alpha+0.5);
UInt_t index=0;
Double_t maxchi2=12.;
const AliTPCRow &krow=sec[s][nr];
- Double_t sy2=SigmaY2(t.GetX(),t.GetTgl(),t.GetPt());
+ Double_t sy2=SigmaY2(t.GetX(),t.GetTgl(),1./t.Get1Pt());
Double_t sz2=SigmaZ2(t.GetX(),t.GetTgl());
Double_t road=4.*sqrt(t.GetSigmaY2() + sy2), y=t.GetY(), z=t.GetZ();
if (krow) {
for (Int_t i=krow.Find(y-road); i<krow; i++) {
- AliTPCcluster* c=(AliTPCcluster*)(krow[i]);
+ AliTPCcluster *c=(AliTPCcluster*)(krow[i]);
if (c->GetY() > y+road) break;
if (c->IsUsed()) continue;
if ((c->GetZ()-z)*(c->GetZ()-z) > 16.*(t.GetSigmaZ2()+sz2)) continue;
if (cl) {
Float_t l=sec->GetPadPitchWidth();
t.SetSampledEdx(cl->GetQ()/l,t.GetNumberOfClusters());
- t.Update(cl,maxchi2,index);
- tryAgain=kSKIP;
+ if (!t.Update(cl,maxchi2,index)) {
+ if (!tryAgain--) return 0;
+ } else tryAgain=kSKIP;
} else {
if (tryAgain==0) break;
if (y > ymax) {
x[0]=y1;
x[1]=z1;
- x[2]=f1(x1,y1,x2,y2,x3,y3);
- if (TMath::Abs(x[2]) >= 0.0066) continue;
- x[3]=f2(x1,y1,x2,y2,x3,y3);
- //if (TMath::Abs(x[2]*x1-x[3]) >= 0.99999) continue;
+ x[3]=f1(x1,y1,x2,y2,x3,y3);
+ if (TMath::Abs(x[3]) >= 0.0066) continue;
+ x[2]=f2(x1,y1,x2,y2,x3,y3);
+ //if (TMath::Abs(x[3]*x1-x[2]) >= 0.99999) continue;
x[4]=f3(x1,y1,x2,y2,z1,z2);
if (TMath::Abs(x[4]) > 1.2) continue;
- Double_t a=asin(x[3]);
- Double_t zv=z1 - x[4]/x[2]*(a+asin(x[2]*x1-x[3]));
+ Double_t a=asin(x[2]);
+ Double_t zv=z1 - x[4]/x[3]*(a+asin(x[3]*x1-x[2]));
if (TMath::Abs(zv)>10.) continue;
Double_t sy1=kr1[is]->GetSigmaY2(), sz1=kr1[is]->GetSigmaZ2();
Double_t sy2=kcl->GetSigmaY2(), sz2=kcl->GetSigmaZ2();
Double_t sy3=100*0.025, sy=0.1, sz=0.1;
- Double_t f20=(f1(x1,y1+sy,x2,y2,x3,y3)-x[2])/sy;
- Double_t f22=(f1(x1,y1,x2,y2+sy,x3,y3)-x[2])/sy;
- Double_t f24=(f1(x1,y1,x2,y2,x3,y3+sy)-x[2])/sy;
- Double_t f30=(f2(x1,y1+sy,x2,y2,x3,y3)-x[3])/sy;
- Double_t f32=(f2(x1,y1,x2,y2+sy,x3,y3)-x[3])/sy;
- Double_t f34=(f2(x1,y1,x2,y2,x3,y3+sy)-x[3])/sy;
+ Double_t f30=(f1(x1,y1+sy,x2,y2,x3,y3)-x[3])/sy;
+ Double_t f32=(f1(x1,y1,x2,y2+sy,x3,y3)-x[3])/sy;
+ Double_t f34=(f1(x1,y1,x2,y2,x3,y3+sy)-x[3])/sy;
+ Double_t f20=(f2(x1,y1+sy,x2,y2,x3,y3)-x[2])/sy;
+ Double_t f22=(f2(x1,y1,x2,y2+sy,x3,y3)-x[2])/sy;
+ Double_t f24=(f2(x1,y1,x2,y2,x3,y3+sy)-x[2])/sy;
Double_t f40=(f3(x1,y1+sy,x2,y2,z1,z2)-x[4])/sy;
Double_t f41=(f3(x1,y1,x2,y2,z1+sz,z2)-x[4])/sz;
Double_t f42=(f3(x1,y1,x2,y2+sy,z1,z2)-x[4])/sy;
track->SetSampledEdx(kr1[is]->GetQ()/l,0);
Int_t rc=FindProlongation(*track,sec,ns,i2);
- if (rc<0 || track->GetNumberOfClusters()<(i1-i2)/2) delete track;
+ if (rc==0 || track->GetNumberOfClusters()<(i1-i2)/2) delete track;
else seeds.AddLast(track);
}
}
}
//_____________________________________________________________________________
-void AliTPCtracker::Clusters2Tracks(const AliTPCParam *par, TFile *of) {
+Int_t AliTPCtracker::Clusters2Tracks(const AliTPCParam *par, TFile *of) {
//-----------------------------------------------------------------
// This is a track finder.
//-----------------------------------------------------------------
TDirectory *savedir=gDirectory;
if (!of->IsOpen()) {
- cerr<<"AliTPC::Clusters2Tracks(): output file not open !\n";
- return;
+ cerr<<"AliTPCtracker::Clusters2Tracks(): output file not open !\n";
+ return 1;
}
AliTPCClustersArray carray;
iotrack=pt;
tracktree.Fill();
t.UseClusters(&carray,nc);
- cerr<<found++<<'\r';
+ found++;
}
}
}
delete[] lsec;
savedir->cd();
+
+ return 0;
}
//_________________________________________________________________________
// This funtion calculates dE/dX within the "low" and "up" cuts.
//-----------------------------------------------------------------
Int_t i;
+ Int_t nc=GetNumberOfClusters();
Int_t swap;//stupid sorting
do {
swap=0;
- for (i=0; i<fN-1; i++) {
- if (fdEdx[i]<=fdEdx[i+1]) continue;
- Float_t tmp=fdEdx[i]; fdEdx[i]=fdEdx[i+1]; fdEdx[i+1]=tmp;
+ for (i=0; i<nc-1; i++) {
+ if (fdEdxSample[i]<=fdEdxSample[i+1]) continue;
+ Float_t tmp=fdEdxSample[i];
+ fdEdxSample[i]=fdEdxSample[i+1]; fdEdxSample[i+1]=tmp;
swap++;
}
} while (swap);
- Int_t nl=Int_t(low*fN), nu=Int_t(up*fN);
+ Int_t nl=Int_t(low*nc), nu=Int_t(up*nc);
Float_t dedx=0;
- for (i=nl; i<=nu; i++) dedx += fdEdx[i];
+ for (i=nl; i<=nu; i++) dedx += fdEdxSample[i];
dedx /= (nu-nl+1);
SetdEdx(dedx);
}
//-----------------------------------------------------------------
// This function marks clusters associated with this track.
//-----------------------------------------------------------------
+ Int_t nc=GetNumberOfClusters();
Int_t sec,row,ncl;
- for (Int_t i=n; i<fN; i++) {
+
+ for (Int_t i=n; i<nc; i++) {
GetCluster(i,sec,row,ncl);
AliTPCClustersRow *clrow=ca->GetRow(sec,row);
AliTPCcluster *c=(AliTPCcluster*)(*clrow)[ncl];