+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+Revision 1.15 1999/10/08 06:26:53 fca
+Removed ClustersIndex - not used anymore
+
+Revision 1.14 1999/09/29 09:24:33 fca
+Introduction of the Copyright and cvs Log
+
+*/
+
///////////////////////////////////////////////////////////////////////////////
// //
// Time Projection Chamber //
#include "AliTPCRF1D.h"
+
ClassImp(AliTPC)
//_____________________________________________________________________________
fNsectors = 0;
fNtracks = 0;
fNclusters= 0;
- //MI changes
+
fDigParam= new AliTPCD();
fDigits = fDigParam->GetArray();
}
//MI change
fDigParam= new AliTPCD;
fDigits = fDigParam->GetArray();
+
+ AliTPCParam *fTPCParam = &(fDigParam->GetParam());
+
//
// Initialise counters
+ //
fClusters = 0;
fTracks = 0;
- fNsectors = 72;
+ fNsectors = fTPCParam->GetNSector();
fNtracks = 0;
fNclusters= 0;
fDigitsIndex = new Int_t[fNsectors+1];
- fClustersIndex = new Int_t[fNsectors+1];
//
fIshunt = 0;
//
delete fTracks;
delete fDigParam;
if (fDigitsIndex) delete [] fDigitsIndex;
- if (fClustersIndex) delete [] fClustersIndex;
}
//_____________________________________________________________________________
TTUBS *tubs;
Int_t i;
const int kColorTPC=19;
- char name[5], title[20];
+ char name[5], title[25];
const Double_t kDegrad=TMath::Pi()/180;
- const Double_t loAng=30;
- const Double_t hiAng=15;
- const Int_t nLo = Int_t (360/loAng+0.5);
- const Int_t nHi = Int_t (360/hiAng+0.5);
+ const Double_t kRaddeg=180./TMath::Pi();
+
+ AliTPCParam * fTPCParam = &(fDigParam->GetParam());
+
+ Float_t InnerOpenAngle = fTPCParam->GetInnerAngle();
+ Float_t OuterOpenAngle = fTPCParam->GetOuterAngle();
+
+ Float_t InnerAngleShift = fTPCParam->GetInnerAngleShift();
+ Float_t OuterAngleShift = fTPCParam->GetOuterAngleShift();
+
+ Int_t nLo = fTPCParam->GetNInnerSector()/2;
+ Int_t nHi = fTPCParam->GetNOuterSector()/2;
+
+ const Double_t loAng = (Double_t)TMath::Nint(InnerOpenAngle*kRaddeg);
+ const Double_t hiAng = (Double_t)TMath::Nint(OuterOpenAngle*kRaddeg);
+ const Double_t loAngSh = (Double_t)TMath::Nint(InnerAngleShift*kRaddeg);
+ const Double_t hiAngSh = (Double_t)TMath::Nint(OuterAngleShift*kRaddeg);
+
+
const Double_t loCorr = 1/TMath::Cos(0.5*loAng*kDegrad);
const Double_t hiCorr = 1/TMath::Cos(0.5*hiAng*kDegrad);
+
+ Double_t rl,ru;
+
+
//
// Get ALICE top node
- Top=gAlice->GetGeometry()->GetNode("alice");
//
- // Inner sectors
+
+ Top=gAlice->GetGeometry()->GetNode("alice");
+
+ // inner sectors
+
+ rl = fTPCParam->GetInSecLowEdge();
+ ru = fTPCParam->GetInSecUpEdge();
+
+
for(i=0;i<nLo;i++) {
sprintf(name,"LS%2.2d",i);
- sprintf(title,"TPC low sector %d",i);
- tubs = new TTUBS(name,title,"void",88*loCorr,136*loCorr,250,loAng*(i-0.5),loAng*(i+0.5));
+ name[4]='\0';
+ sprintf(title,"TPC low sector %3d",i);
+ title[24]='\0';
+
+ tubs = new TTUBS(name,title,"void",rl*loCorr,ru*loCorr,250.,
+ loAng*(i-0.5)+loAngSh,loAng*(i+0.5)+loAngSh);
tubs->SetNumberOfDivisions(1);
Top->cd();
Node = new TNode(name,title,name,0,0,0,"");
Node->SetLineColor(kColorTPC);
fNodes->Add(Node);
}
+
// Outer sectors
+
+ rl = fTPCParam->GetOuSecLowEdge();
+ ru = fTPCParam->GetOuSecUpEdge();
+
for(i=0;i<nHi;i++) {
sprintf(name,"US%2.2d",i);
+ name[4]='\0';
sprintf(title,"TPC upper sector %d",i);
- tubs = new TTUBS(name,title,"void",142*hiCorr,250*hiCorr,250,hiAng*(i-0.5),hiAng*(i+0.5));
+ title[24]='\0';
+ tubs = new TTUBS(name,title,"void",rl*hiCorr,ru*hiCorr,250,
+ hiAng*(i-0.5)+hiAngSh,hiAng*(i+0.5)+hiAngSh);
tubs->SetNumberOfDivisions(1);
Top->cd();
Node = new TNode(name,title,name,0,0,0,"");
Node->SetLineColor(kColorTPC);
fNodes->Add(Node);
}
-}
+}
+
+
+
//_____________________________________________________________________________
Int_t AliTPC::DistancetoPrimitive(Int_t , Int_t )
{
return 9999;
}
-//_____________________________________________________________________________
-//const int MAX_CLUSTER=nrow_low+nrow_up;
-const int MAX_CLUSTER=200;
-const int S_MAXSEC=24;
-const int L_MAXSEC=48;
-const int ROWS_TO_SKIP=21;
-const Float_t MAX_CHI2=12.;
-
-
//_____________________________________________________________________________
static Double_t SigmaY2(Double_t r, Double_t tgl, Double_t pt)
{
//
- // Calculate spread in Y
+ // Parametrised error of the cluster reconstruction (pad direction)
//
pt=TMath::Abs(pt)*1000.;
Double_t x=r/pt;
tgl=TMath::Abs(tgl);
Double_t s=a_rphi - b_rphi*r*tgl + c_rphi*x*x + d_rphi*x;
if (s<0.4e-3) s=0.4e-3;
+ s*=1.3; //Iouri Belikov
return s;
}
static Double_t SigmaZ2(Double_t r, Double_t tgl)
{
//
- // Calculate spread in Z
+ // Parametrised error of the cluster reconstruction (drift direction)
//
tgl=TMath::Abs(tgl);
Double_t s=a_z - b_z*r*tgl + c_z*tgl*tgl;
if (s<0.4e-3) s=0.4e-3;
+ s*=1.3; //Iouri Belikov
return s;
}
//_____________________________________________________________________________
-inline Double_t f1(Double_t x1,Double_t y1, //C
+inline Double_t f1(Double_t x1,Double_t y1,
Double_t x2,Double_t y2,
Double_t x3,Double_t y3)
{
+ //-----------------------------------------------------------------
+ // Initial approximation of the track curvature
//
- // Function f1
- //
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
Double_t d=(x2-x1)*(y3-y2)-(x3-x2)*(y2-y1);
Double_t a=0.5*((y3-y2)*(y2*y2-y1*y1+x2*x2-x1*x1)-
(y2-y1)*(y3*y3-y2*y2+x3*x3-x2*x2));
//_____________________________________________________________________________
-inline Double_t f2(Double_t x1,Double_t y1, //eta=C*x0
+inline Double_t f2(Double_t x1,Double_t y1,
Double_t x2,Double_t y2,
Double_t x3,Double_t y3)
{
+ //-----------------------------------------------------------------
+ // Initial approximation of the track curvature times center of curvature
//
- // Function f2
- //
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
Double_t d=(x2-x1)*(y3-y2)-(x3-x2)*(y2-y1);
Double_t a=0.5*((y3-y2)*(y2*y2-y1*y1+x2*x2-x1*x1)-
(y2-y1)*(y3*y3-y2*y2+x3*x3-x2*x2));
}
//_____________________________________________________________________________
-inline Double_t f3(Double_t x1,Double_t y1, //tgl
+inline Double_t f3(Double_t x1,Double_t y1,
Double_t x2,Double_t y2,
Double_t z1,Double_t z2)
{
+ //-----------------------------------------------------------------
+ // Initial approximation of the tangent of the track dip angle
//
- // Function f3
- //
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
return (z1 - z2)/sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
//_____________________________________________________________________________
-static int FindProlongation(AliTPCtrack& t, const AliTPCSector *sec,
- int s, int ri, int rf=0)
+static int FindProlongation(AliTPCtrack& t, const AliTPCSector *sec,
+ int s, int rf=0)
{
+ //-----------------------------------------------------------------
+ // This function tries to find a track prolongation.
//
- // Propagate track
- //
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
+ const int ROWS_TO_SKIP=int(0.5*sec->GetNRows());
+ const Float_t MAX_CHI2=12.;
int try_again=ROWS_TO_SKIP;
Double_t alpha=sec->GetAlpha();
- int ns=int(2*TMath::Pi()/alpha)+1;
+ int ns=int(2*TMath::Pi()/alpha+0.5);
- for (int nr=ri; nr>=rf; nr--) {
- Double_t x=sec[s].GetX(nr), ymax=sec[s].GetMaxY(nr);
- if (!t.PropagateTo(x)) return -1;
+ for (int nr=sec->GetRowNumber(t.GetX())-1; nr>=rf; nr--) {
+ Double_t x=sec->GetX(nr), ymax=sec->GetMaxY(nr);
+ if (!t.PropagateTo(x)) return 0;
- const AliTPCcluster *cl=0;
+ AliTPCcluster *cl=0;
Double_t max_chi2=MAX_CHI2;
const AliTPCRow& row=sec[s][nr];
Double_t sy2=SigmaY2(t.GetX(),t.GetTgl(),t.GetPt());
Double_t sz2=SigmaZ2(t.GetX(),t.GetTgl());
- Double_t road=3.*sqrt(t.GetSigmaY2() + 4*sy2), y=t.GetY(), z=t.GetZ();
+ Double_t road=5.*sqrt(t.GetSigmaY2() + sy2), y=t.GetY(), z=t.GetZ();
if (road>30) {
- if (t>3) cerr<<t<<" AliTPCtrack warning: Too broad road !\n";
- return -1;
+ if (t>4) cerr<<t<<" FindProlongation warning: Too broad road !\n";
+ return 0;
}
if (row) {
AliTPCcluster* c=(AliTPCcluster*)(row[i]);
if (c->fY > y+road) break;
if (c->IsUsed()) continue;
- if ((c->fZ - z)*(c->fZ - z) > 9.*(t.GetSigmaZ2() + 4*sz2)) continue;
+ if ((c->fZ - z)*(c->fZ - z) > 25.*(t.GetSigmaZ2() + sz2)) continue;
Double_t chi2=t.GetPredictedChi2(c);
if (chi2 > max_chi2) continue;
max_chi2=chi2;
}
if (cl) {
t.Update(cl,max_chi2);
+ Double_t ll=TMath::Sqrt((1+t.GetTgl()*t.GetTgl())/
+ (1-(t.GetC()*x-t.GetEta())*(t.GetC()*x-t.GetEta())));
+ cl->fdEdX = cl->fQ/ll;
try_again=ROWS_TO_SKIP;
} else {
if (try_again==0) break;
if (y > ymax) {
s = (s+1) % ns;
- if (!t.Rotate(alpha)) return -1;
+ if (!t.Rotate(alpha)) return 0;
} else if (y <-ymax) {
- s = (s-1+ns) % ns;
- if (!t.Rotate(-alpha)) return -1;
+ s = (s-1+ns) % ns;
+ if (!t.Rotate(-alpha)) return 0;
}
try_again--;
}
}
- return s;
+ return 1;
}
//_____________________________________________________________________________
-static void MakeSeeds(TObjArray& seeds,const AliTPCSector* sec,int i1,int i2,
-const AliTPCParam *p)
+static void MakeSeeds(TObjArray& seeds,const AliTPCSector *sec, int max_sec,
+int i1, int i2)
{
+ //-----------------------------------------------------------------
+ // This function creates track seeds.
//
- // Find seed for tracking
- //
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
TMatrix C(5,5); TVector x(5);
- int max_sec=L_MAXSEC/2;
+ double alpha=sec->GetAlpha(), shift=sec->GetAlphaShift();
+ double cs=cos(alpha), sn=sin(alpha);
for (int ns=0; ns<max_sec; ns++) {
int nl=sec[(ns-1+max_sec)%max_sec][i2];
int nm=sec[ns][i2];
int nu=sec[(ns+1)%max_sec][i2];
- Double_t alpha=sec[ns].GetAlpha();
const AliTPCRow& r1=sec[ns][i1];
for (int is=0; is < r1; is++) {
- Double_t x1=sec[ns].GetX(i1), y1=r1[is]->fY, z1=r1[is]->fZ;
+ double x1=sec->GetX(i1), y1=r1[is]->fY, z1=r1[is]->fZ;
for (int js=0; js < nl+nm+nu; js++) {
const AliTPCcluster *cl;
- Double_t cs,sn;
int ks;
-
+ double x2=sec->GetX(i2), y2, z2, tmp;
+
if (js<nl) {
ks=(ns-1+max_sec)%max_sec;
const AliTPCRow& r2=sec[(ns-1+max_sec)%max_sec][i2];
cl=r2[js];
- cs=cos(alpha); sn=sin(alpha);
+ y2=cl->fY; z2=cl->fZ;
+ tmp= x2*cs+y2*sn;
+ y2 =-x2*sn+y2*cs; x2=tmp;
} else
if (js<nl+nm) {
ks=ns;
const AliTPCRow& r2=sec[ns][i2];
cl=r2[js-nl];
- cs=1; sn=0.;
+ y2=cl->fY; z2=cl->fZ;
} else {
ks=(ns+1)%max_sec;
const AliTPCRow& r2=sec[(ns+1)%max_sec][i2];
cl=r2[js-nl-nm];
- cs=cos(alpha); sn=-sin(alpha);
+ y2=cl->fY; z2=cl->fZ;
+ tmp=x2*cs-y2*sn;
+ y2 =x2*sn+y2*cs; x2=tmp;
}
- Double_t x2=sec[ns].GetX(i2), y2=cl->fY, z2=cl->fZ;
- //if (z1*z2 < 0) continue;
- //if (TMath::Abs(z1) < TMath::Abs(z2)) continue;
-
- Double_t tmp= x2*cs+y2*sn;
- y2 =-x2*sn+y2*cs;
- x2=tmp;
-
+
+ double d=(x2-x1)*(0.-y2)-(0.-x2)*(y2-y1);
+ if (d==0.) {cerr<<"MakeSeeds warning: Straight seed !\n"; continue;}
+
x(0)=y1;
x(1)=z1;
x(2)=f1(x1,y1,x2,y2,0.,0.);
TMatrix t(F,TMatrix::kMult,X);
C.Mult(t,TMatrix(TMatrix::kTransposed,F));
- TrackSeed *track=new TrackSeed(*(r1[is]),x,C,p);
- int rc=FindProlongation(*track,sec,ns,i1-1,i2);
+ AliTPCtrack *track=new AliTPCtrack(r1[is], x, C, x1, ns*alpha+shift);
+ int rc=FindProlongation(*track,sec,ns,i2);
if (rc<0 || *track<(i1-i2)/2) delete track;
else seeds.AddLast(track);
}
}
//_____________________________________________________________________________
+AliTPCParam *AliTPCSector::param;
void AliTPC::Clusters2Tracks()
{
+ //-----------------------------------------------------------------
+ // This is a track finder.
//
- // TPC Track finder from clusters.
- //
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
if (!fClusters) return;
AliTPCParam *p=&fDigParam->GetParam();
- Int_t nrow_low=p->GetNRowLow();
- Int_t nrow_up=p->GetNRowUp();
+ AliTPCSector::SetParam(p);
- AliTPCSSector ssec[S_MAXSEC/2];
- for (int i=0; i<S_MAXSEC/2; i++) ssec[i].SetUp(p);
+ const int nis=p->GetNInnerSector()/2;
+ AliTPCSSector *ssec=new AliTPCSSector[nis];
+ int nrow_low=ssec->GetNRows();
- AliTPCLSector lsec[L_MAXSEC/2];
- for (int j=0; j<L_MAXSEC/2; j++) lsec[j].SetUp(p);
+ const int nos=p->GetNOuterSector()/2;
+ AliTPCLSector *lsec=new AliTPCLSector[nos];
+ int nrow_up=lsec->GetNRows();
int ncl=fClusters->GetEntriesFast();
while (ncl--) {
AliTPCcluster *c=(AliTPCcluster*)fClusters->UncheckedAt(ncl);
-
- int sec=int(c->fSector)-1, row=int(c->fPadRow)-1;
-
- if (sec<24) {
- if (row<0 || row>nrow_low) {cerr<<"low !!!"<<row<<endl; continue;}
- ssec[sec%12][row].InsertCluster(c);
+ Int_t sec=c->fSector, row=c->fPadRow;
+ if (sec<nis*2) {
+ ssec[sec%nis][row].InsertCluster(c);
} else {
- if (row<0 || row>nrow_up ) {cerr<<"up !!!"<<row<<endl; continue;}
- sec -= 24;
- lsec[sec%24][row].InsertCluster(c);
+ sec -= nis*2;
+ lsec[sec%nos][row].InsertCluster(c);
}
}
-
TObjArray seeds(20000);
- MakeSeeds(seeds,lsec,nrow_up-1,nrow_up-1-8,p);
- MakeSeeds(seeds,lsec,nrow_up-1-4,nrow_up-1-4-8,p);
+
+ int nrows=nrow_low+nrow_up;
+ int gap=int(0.125*nrows), shift=int(0.5*gap);
+ MakeSeeds(seeds, lsec, nos, nrow_up-1, nrow_up-1-gap);
+ MakeSeeds(seeds, lsec, nos, nrow_up-1-shift, nrow_up-1-shift-gap);
seeds.Sort();
for (int s=0; s<nseed; s++) {
AliTPCtrack& t=*((AliTPCtrack*)seeds.UncheckedAt(s));
- Double_t alpha=t.GetAlpha();
+ double alpha=t.GetAlpha();
if (alpha > 2.*TMath::Pi()) alpha -= 2.*TMath::Pi();
if (alpha < 0. ) alpha += 2.*TMath::Pi();
- int ns=int(alpha/lsec->GetAlpha() + 0.5);
-
- Double_t x=t.GetX();
- int nr;
- if (x<p->GetPadRowRadiiUp(nrow_up-1-4-7)) nr=nrow_up-1-4-8;
- else if (x<p->GetPadRowRadiiUp(nrow_up-1-7)) nr=nrow_up-1-8;
- else {cerr<<x<<" =x !!!\n"; continue;}
-
- int ls=FindProlongation(t,lsec,ns,nr-1);
- if (ls<0) continue;
- x=t.GetX(); alpha=lsec[ls].GetAlpha(); //
- Double_t phi=ls*alpha + atan(t.GetY()/x); // Find S-sector
- int ss=int(0.5*(phi/alpha+1)); //
- alpha *= 2*(ss-0.5*ls); // and rotation angle
- if (!t.Rotate(alpha)) continue; //
- ss %= (S_MAXSEC/2); //
+ int ns=int(alpha/lsec->GetAlpha())%nos;
+
+ if (!FindProlongation(t,lsec,ns)) continue;
+
+ alpha=t.GetAlpha() + 0.5*ssec->GetAlpha() - ssec->GetAlphaShift();
+ if (alpha > 2.*TMath::Pi()) alpha -= 2.*TMath::Pi();
+ if (alpha < 0. ) alpha += 2.*TMath::Pi();
+ ns=int(alpha/ssec->GetAlpha())%nis; //index of the inner sector needed
+
+ alpha=ns*ssec->GetAlpha() - t.GetAlpha();
+ if (!t.Rotate(alpha)) continue;
+
+ if (!FindProlongation(t,ssec,ns)) continue;
- if (FindProlongation(t,ssec,ss,nrow_low-1)<0) continue;
- if (t < 30) continue;
+ if (t < int(0.4*nrows)) continue;
AddTrack(t);
t.UseClusters();
cerr<<found++<<'\r';
}
+
+ delete[] ssec;
+ delete[] lsec;
}
//_____________________________________________________________________________
//-----------------------------------------------------------------
// Origin: Marek Kowalski IFJ, Krakow, Marek.Kowalski@ifj.edu.pl
//-----------------------------------------------------------------
-
- AliMC* pMC = AliMC::GetMC();
Int_t ISXFLD=gAlice->Field()->Integ();
Float_t SXMGMX=gAlice->Field()->Max();
+
+ Float_t amat[5]; // atomic numbers
+ Float_t zmat[5]; // z
+ Float_t wmat[5]; // proportions
+
+ Float_t density;
+
+ // ********************* Gases *******************
+
+ //--------------------------------------------------------------
+ // pure gases
+ //--------------------------------------------------------------
+
+ // Ne
+
+
+ Float_t a_ne = 20.18;
+ Float_t z_ne = 10.;
- Float_t absl, radl, a, d, z;
- Float_t dg;
- Float_t x0ne;
- Float_t buf[1];
- Int_t nbuf;
+ density = 0.0009;
+
+ AliMaterial(20,"Ne",a_ne,z_ne,density,999.,999.);
+
+ // Ar
+
+ Float_t a_ar = 39.948;
+ Float_t z_ar = 18.;
+
+ density = 0.001782;
+
+ AliMaterial(21,"Ar",a_ar,z_ar,density,999.,999.);
+
+ Float_t a_pure[2];
- // --- Methane (CH4) ---
- Float_t am[2] = { 12.,1. };
- Float_t zm[2] = { 6.,1. };
- Float_t wm[2] = { 1.,4. };
- Float_t dm = 7.17e-4;
- // --- The Neon CO2 90/10 mixture ---
- Float_t ag[2] = { 20.18 };
- Float_t zg[2] = { 10. };
- Float_t wg[2] = { .8,.2 };
- Float_t dne = 9e-4; // --- Neon density in g/cm3 ---
-
- // --- Mylar (C5H4O2) ---
- Float_t amy[3] = { 12.,1.,16. };
- Float_t zmy[3] = { 6.,1.,8. };
- Float_t wmy[3] = { 5.,4.,2. };
- Float_t dmy = 1.39;
- // --- CO2 ---
- Float_t ac[2] = { 12.,16. };
- Float_t zc[2] = { 6.,8. };
- Float_t wc[2] = { 1.,2. };
- Float_t dc = .001977;
- // --- Carbon density and radiation length ---
- Float_t densc = 2.265;
- Float_t radlc = 18.8;
- // --- Silicon ---
- Float_t asi = 28.09;
- Float_t zsi = 14.;
- Float_t desi = 2.33;
- Float_t radsi = 9.36;
-
- // --- Define the various materials for GEANT ---
- AliMaterial(0, "Al $", 26.98, 13., 2.7, 8.9, 37.2);
- x0ne = 28.94 / dne;
- AliMaterial(1, "Ne $", 20.18, 10., dne, x0ne, 999.);
-
- // -- Methane, defined by the proportions of atoms
-
- AliMixture(2, "Methane$", am, zm, dm, -2, wm);
-
- // --- CO2, defined by the proportion of atoms
-
- AliMixture(7, "CO2$", ac, zc, dc, -2, wc);
-
- // -- Get A,Z etc. for CO2
+ a_pure[0] = a_ne;
+ a_pure[1] = a_ar;
+
+ //--------------------------------------------------------------
+ // gases - compounds
+ //--------------------------------------------------------------
+
+ Float_t amol[3];
+
+ // CO2
+
+ amat[0]=12.011;
+ amat[1]=15.9994;
+
+ zmat[0]=6.;
+ zmat[1]=8.;
+
+ wmat[0]=1.;
+ wmat[1]=2.;
+
+ density=0.001977;
+
+ amol[0] = amat[0]*wmat[0]+amat[1]*wmat[1];
+
+ AliMixture(10,"CO2",amat,zmat,density,-2,wmat);
+
+ // CF4
+
+ amat[0]=12.011;
+ amat[1]=18.998;
+
+ zmat[0]=6.;
+ zmat[1]=9.;
+
+ wmat[0]=1.;
+ wmat[1]=4.;
+
+ density=0.003034;
+
+ amol[1] = amat[0]*wmat[0]+amat[1]*wmat[1];
+
+ AliMixture(11,"CF4",amat,zmat,density,-2,wmat);
+
+ // CH4
+
+ amat[0]=12.011;
+ amat[1]=1.;
+
+ zmat[0]=6.;
+ zmat[1]=1.;
+
+ wmat[0]=1.;
+ wmat[1]=4.;
+
+ density=0.000717;
+
+ amol[2] = amat[0]*wmat[0]+amat[1]*wmat[1];
+
+ AliMixture(12,"CH4",amat,zmat,density,-2,wmat);
+
+ //----------------------------------------------------------------
+ // gases - mixtures, ID >= 20 pure gases, <= 10 ID < 20 -compounds
+ //----------------------------------------------------------------
+
char namate[21];
- pMC->Gfmate((*fIdmate)[7], namate, a, z, d, radl, absl, buf, nbuf);
- ag[1] = a;
- zg[1] = z;
- dg = dne * .9 + dc * .1;
-
- // -- Create Ne/CO2 90/10 mixture
-
- AliMixture(3, "Gas-mixt $", ag, zg, dg, 2, wg);
- AliMixture(4, "Gas-mixt $", ag, zg, dg, 2, wg);
-
- AliMaterial(5, "G10$", 20., 10., 1.7, 19.4, 999.);
- AliMixture(6, "Mylar$", amy, zmy, dmy, -3, wmy);
-
- a = ac[0];
- z = zc[0];
- AliMaterial(8, "Carbon", a, z, densc, radlc, 999.);
-
- AliMaterial(9, "Silicon", asi, zsi, desi, radsi, 999.);
- AliMaterial(99, "Air$", 14.61, 7.3, .001205, 30420., 67500.);
-
- AliMedium(400, "Al wall$", 0, 0, ISXFLD, SXMGMX, 10., .1, .1, .1, .1);
- AliMedium(402, "Gas mix1$", 3, 0, ISXFLD, SXMGMX, 10., .01,.1, .001, .01);
- AliMedium(403, "Gas mix2$", 3, 0, ISXFLD, SXMGMX, 10., .01,.1, .001, .01);
- AliMedium(404, "Gas mix3$", 4, 1, ISXFLD, SXMGMX, 10., .01,.1, .001, .01);
- AliMedium(405, "G10 pln$", 5, 0, ISXFLD, SXMGMX, 10., .1, .1, .1, .1 );
- AliMedium(406, "Mylar $", 6, 0, ISXFLD, SXMGMX, 10., .01,.1, .001, .01);
- AliMedium(407, "CO2 $", 7, 0, ISXFLD, SXMGMX, 10., .01,.1, .01, .01);
- AliMedium(408, "Carbon $", 8, 0, ISXFLD, SXMGMX, 10., .1, .1, .1, .1 );
- AliMedium(409, "Silicon$", 9, 0, ISXFLD, SXMGMX, 10., .1, .1, .1, .1 );
- AliMedium(499, "Air gap$", 99, 0, ISXFLD, SXMGMX, 10., .1, .1, .1, .1 );
+
+ density = 0.;
+ Float_t am=0;
+ Int_t nc;
+
+ Float_t a,z,rho,absl,X0,buf[1];
+ Int_t nbuf;
+
+ for(nc = 0;nc<fNoComp;nc++)
+ {
+
+ // retrive material constants
+
+ gMC->Gfmate((*fIdmate)[fMixtComp[nc]],namate,a,z,rho,X0,absl,buf,nbuf);
+
+ amat[nc] = a;
+ zmat[nc] = z;
+
+ Int_t nnc = (fMixtComp[nc]>=20) ? fMixtComp[nc]%20 : fMixtComp[nc]%10;
+
+ am += fMixtProp[nc]*((fMixtComp[nc]>=20) ? a_pure[nnc] : amol[nnc]);
+ density += fMixtProp[nc]*rho; // density of the mixture
+
+ }
+
+ // mixture proportions by weight!
+
+ for(nc = 0;nc<fNoComp;nc++)
+ {
+
+ Int_t nnc = (fMixtComp[nc]>=20) ? fMixtComp[nc]%20 : fMixtComp[nc]%10;
+
+ wmat[nc] = fMixtProp[nc]*((fMixtComp[nc]>=20) ? a_pure[nnc] : amol[nnc])/am;
+
+ }
+
+ AliMixture(31,"Drift gas 1",amat,zmat,density,fNoComp,wmat);
+ AliMixture(32,"Drift gas 2",amat,zmat,density,fNoComp,wmat);
+ AliMixture(33,"Drift gas 3",amat,zmat,density,fNoComp,wmat);
+
+ AliMedium(2, "Drift gas 1", 31, 0, ISXFLD, SXMGMX, 10., 999.,.1, .001, .001);
+ AliMedium(3, "Drift gas 2", 32, 0, ISXFLD, SXMGMX, 10., 999.,.1, .001, .001);
+ AliMedium(4, "Drift gas 3", 33, 1, ISXFLD, SXMGMX, 10., 999.,.1, .001, .001);
+
+ // Air
+
+ AliMaterial(24, "Air", 14.61, 7.3, .001205, 30420., 67500.);
+
+ AliMedium(24, "Air", 24, 0, ISXFLD, SXMGMX, 10., .1, .1, .1, .1);
+
+ //----------------------------------------------------------------------
+ // solid materials
+ //----------------------------------------------------------------------
+
+ // Al
+
+ AliMaterial(30, "Al", 26.98, 13., 2.7, 8.9, 37.2);
+
+ AliMedium(0, "Al",30, 0, ISXFLD, SXMGMX, 10., .1, .1, .1, .1);
+
+ // Si
+
+ AliMaterial(31, "Si", 28.086, 14.,2.33, 9.36, 999.);
+
+ AliMedium(7, "Al",31, 0, ISXFLD, SXMGMX, 10., .1, .1, .1, .1);
+
+
+ // Mylar C5H4O2
+
+ amat[0]=12.011;
+ amat[1]=1.;
+ amat[2]=15.9994;
+
+ zmat[0]=6.;
+ zmat[1]=1.;
+ zmat[2]=8.;
+
+ wmat[0]=5.;
+ wmat[1]=4.;
+ wmat[2]=2.;
+
+ density = 1.39;
+
+ AliMixture(32, "Mylar",amat,zmat,density,-3,wmat);
+
+ AliMedium(5, "Mylar",32, 0, ISXFLD, SXMGMX, 10., .1, .1, .001, .01);
+
+
+
+
+ // Carbon (normal)
+
+ AliMaterial(33,"C normal",12.011,6.,2.265,18.8,999.);
+
+ AliMedium(6,"C normal",33,0, ISXFLD, SXMGMX, 10., .1, .1, .001, .01);
+
+ // G10 for inner and outr field cage
+ // G10 is 60% SiO2 + 40% epoxy, right now I use A and Z for SiO2
+
+ Float_t rhoFactor;
+
+ amat[0]=28.086;
+ amat[1]=15.9994;
+
+ zmat[0]=14.;
+ zmat[1]=8.;
+
+ wmat[0]=1.;
+ wmat[1]=2.;
+
+ density = 1.7;
+
+
+ AliMixture(34,"G10 aux.",amat,zmat,density,-2,wmat);
+
+
+ gMC->Gfmate((*fIdmate)[34],namate,a,z,rho,X0,absl,buf,nbuf);
+
+ Float_t thickX0 = 0.0052; // field cage in X0 units
+
+ Float_t thick = 2.; // in cm
+
+ X0=19.4; // G10
+
+ rhoFactor = X0*thickX0/thick;
+ density = rho*rhoFactor;
+
+ AliMaterial(35,"G10-fc",a,z,density,999.,999.);
+
+ AliMedium(8,"G10-fc",35,0, ISXFLD, SXMGMX, 10., .1, .1, .001, .01);
+
+ thickX0 = 0.0027; // inner vessel (eta <0.9)
+ thick=0.5;
+ rhoFactor = X0*thickX0/thick;
+ density = rho*rhoFactor;
+
+ AliMaterial(36,"G10-iv",a,z,density,999.,999.);
+
+ AliMedium(9,"G10-iv",36,0, ISXFLD, SXMGMX, 10., .1, .1, .001, .01);
+
+ // Carbon fibre
+
+ gMC->Gfmate((*fIdmate)[33],namate,a,z,rho,X0,absl,buf,nbuf);
+
+ thickX0 = 0.0133; // outer vessel
+ thick=3.0;
+ rhoFactor = X0*thickX0/thick;
+ density = rho*rhoFactor;
+
+
+ AliMaterial(37,"C-ov",a,z,density,999.,999.);
+
+ AliMedium(10,"C-ov",37,0, ISXFLD, SXMGMX, 10., .1, .1, .001, .01);
+
+ thickX0=0.015; // inner vessel (cone, eta > 0.9)
+ thick=1.5;
+ rhoFactor = X0*thickX0/thick;
+ density = rho*rhoFactor;
+
+ AliMaterial(38,"C-ivc",a,z,density,999.,999.);
+
+ AliMedium(11,"C-ivc",38,0, ISXFLD, SXMGMX, 10., .1, .1, .001, .01);
+
+ //
+
+ AliMedium(12,"CO2",10,0, ISXFLD, SXMGMX, 10., 999.,.1, .001, .001);
+
+
+
}
//_____________________________________________________________________________
};
struct PreCluster : public AliTPCcluster {
- const AliTPCdigit* summit;
- int idx;
- int cut;
- int npeaks;
- PreCluster();
+ const AliTPCdigit* summit; //pointer to the maximum digit of this precluster
+ int idx; //index in AliTPC::fClusters
+ int npeaks; //number of peaks in this precluster
+ int ndigits; //number of digits in this precluster
+ PreCluster();
};
-PreCluster::PreCluster() : AliTPCcluster() {cut=npeaks=0;}
-
+PreCluster::PreCluster() : AliTPCcluster() {npeaks=ndigits=0;}
//_____________________________________________________________________________
-static void FindCluster(int i, int j, Bin bins[][MAXTPCTBK+2], PreCluster &c)
+static void FindPreCluster(int i,int j,int maxj,Bin *bins,PreCluster &c)
{
+ //-----------------------------------------------------------------
+ // This function looks for "preclusters".
//
- // Find clusters
- //
- Bin& b=bins[i][j];
- double q=double(b.dig->fSignal);
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
+ Bin& b=bins[i*maxj+j];
+ double q=(double)TMath::Abs(b.dig->fSignal);
- if (q<0) { // digit is at the edge of the pad row
- q=-q;
- c.cut=1;
- }
if (b.idx >= 0 && b.idx != c.idx) {
c.idx=b.idx;
c.npeaks++;
c.fSigmaY2 += i*i*q;
c.fSigmaZ2 += j*j*q;
c.fQ += q;
+ c.ndigits++;
b.dig = 0; b.idx = c.idx;
- if (bins[i-1][j].dig) FindCluster(i-1,j,bins,c);
- if (bins[i][j-1].dig) FindCluster(i,j-1,bins,c);
- if (bins[i+1][j].dig) FindCluster(i+1,j,bins,c);
- if (bins[i][j+1].dig) FindCluster(i,j+1,bins,c);
+ if (bins[(i-1)*maxj+j].dig) FindPreCluster(i-1,j,maxj,bins,c);
+ if (bins[i*maxj+(j-1)].dig) FindPreCluster(i,j-1,maxj,bins,c);
+ if (bins[(i+1)*maxj+j].dig) FindPreCluster(i+1,j,maxj,bins,c);
+ if (bins[i*maxj+(j+1)].dig) FindPreCluster(i,j+1,maxj,bins,c);
}
//_____________________________________________________________________________
void AliTPC::Digits2Clusters()
{
+ //-----------------------------------------------------------------
+ // This is a simple cluster finder.
//
- // simple TPC cluster finder from digits.
- //
- //
- AliTPCParam * fTPCParam = &(fDigParam->GetParam());
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
+ AliTPCParam *par = &(fDigParam->GetParam());
- const Int_t MAX_PAD=200+2, MAX_BUCKET=MAXTPCTBK+2;
- const Int_t Q_min=60;
- const Int_t THRESHOLD=20;
+ int inp=par->GetNPads(0, par->GetNRowLow()-1);
+ int onp=par->GetNPads(par->GetNSector()-1,par->GetNRowUp() -1);
+ const int MAXY=(inp>onp) ? inp+2 : onp+2;
+ const int MAXTBKT=int((z_end+6*par->GetZSigma())/par->GetZWidth())+1;
+ const int MAXZ=MAXTBKT+2;
+ const int THRESHOLD=20;
TTree *t=(TTree*)gDirectory->Get("TreeD0_Param1");
t->GetBranch("Digits")->SetAddress(&fDigits);
for (Int_t n=0; n<sectors_by_rows; n++) {
if (!t->GetEvent(n)) continue;
- Bin bins[MAX_PAD][MAX_BUCKET];
+ Bin *bins=new Bin[MAXY*MAXZ];
AliTPCdigit *dig=(AliTPCdigit*)fDigits->UncheckedAt(0);
- Int_t nsec=dig->fSector, nrow=dig->fPadRow;
- Int_t ndigits=fDigits->GetEntriesFast();
+ int sec=dig->fSector, row=dig->fPadRow;
+ int ndigits=fDigits->GetEntriesFast();
- int npads; int sign_z;
- if (nsec<25) {
- sign_z=(nsec<13) ? 1 : -1;
- npads=fTPCParam->GetNPadsLow(nrow-1);
- } else {
- sign_z=(nsec<49) ? 1 : -1;
- npads=fTPCParam->GetNPadsUp(nrow-1);
+ int npads, sign;
+ {
+ int nis=par->GetNInnerSector(), nos=par->GetNOuterSector();
+ if (sec < nis) {
+ npads = par->GetNPadsLow(row);
+ sign = (sec < nis/2) ? 1 : -1;
+ } else {
+ npads = par->GetNPadsUp(row);
+ sign = ((sec-nis) < nos/2) ? 1 : -1;
+ }
}
-
+
int ndig;
for (ndig=0; ndig<ndigits; ndig++) {
dig=(AliTPCdigit*)fDigits->UncheckedAt(ndig);
- int i=dig->fPad, j=dig->fTime;
- if (dig->fSignal >= THRESHOLD) bins[i][j].dig=dig;
- if (i==1 || i==npads || j==1 || j==MAXTPCTBK) dig->fSignal*=-1;
+ int i=dig->fPad+1, j=dig->fTime+1;
+ if (i > npads) {
+ cerr<<"AliTPC::Digits2Clusters error: pad number is out of range ! ";
+ cerr<<i<<' '<<npads<<endl;
+ continue;
+ }
+ if (j > MAXTBKT) {
+ cerr<<"AliTPC::Digits2Clusters error: time bucket is out of range ! ";
+ cerr<<j<<' '<<MAXTBKT<<endl;
+ continue;
+ }
+ if (dig->fSignal >= THRESHOLD) bins[i*MAXZ+j].dig=dig;
+ if (i==1 || i==npads || j==1 || j==MAXTBKT) dig->fSignal*=-1;
}
-
+
int ncl=0;
int i,j;
- for (i=1; i<MAX_PAD-1; i++) {
- for (j=1; j<MAX_BUCKET-1; j++) {
- if (bins[i][j].dig == 0) continue;
- PreCluster c; c.summit=bins[i][j].dig; c.idx=ncls;
- FindCluster(i, j, bins, c);
+ for (i=1; i<MAXY-1; i++) {
+ for (j=1; j<MAXZ-1; j++) {
+ if (bins[i*MAXZ+j].dig == 0) continue;
+ PreCluster c; c.summit=bins[i*MAXZ+j].dig; c.idx=ncls;
+ FindPreCluster(i, j, MAXZ, bins, c);
c.fY /= c.fQ;
c.fZ /= c.fQ;
double s2 = c.fSigmaY2/c.fQ - c.fY*c.fY;
c.fSigmaY2 = s2 + 1./12.;
- c.fSigmaY2 *= fTPCParam->GetPadPitchWidth()*
- fTPCParam->GetPadPitchWidth();
- if (s2 != 0.) c.fSigmaY2 *= 0.022*8*4;
+ c.fSigmaY2 *= par->GetPadPitchWidth()*par->GetPadPitchWidth();
+ if (s2 != 0.) c.fSigmaY2 *= 0.17;
s2 = c.fSigmaZ2/c.fQ - c.fZ*c.fZ;
c.fSigmaZ2 = s2 + 1./12.;
- c.fSigmaZ2 *= fTPCParam->GetZWidth()*fTPCParam->GetZWidth();
- if (s2 != 0.) c.fSigmaZ2 *= 0.068*4*4;
-
- c.fY = (c.fY - 0.5 - 0.5*npads)*fTPCParam->GetPadPitchWidth();
- c.fZ = fTPCParam->GetZWidth()*(c.fZ+1);
- c.fZ -= 3.*fTPCParam->GetZSigma(); // PASA delay
- c.fZ = sign_z*(z_end - c.fZ);
- //c.fZ += 0.023;
- c.fSector=nsec;
- c.fPadRow=nrow;
+ c.fSigmaZ2 *= par->GetZWidth()*par->GetZWidth();
+ if (s2 != 0.) c.fSigmaZ2 *= 0.41;
+
+ c.fY = (c.fY - 0.5 - 0.5*npads)*par->GetPadPitchWidth();
+ c.fZ = par->GetZWidth()*c.fZ;
+ c.fZ -= 3.*par->GetZSigma(); // PASA delay
+ c.fZ = sign*(z_end - c.fZ);
+
+ c.fSector=sec;
+ c.fPadRow=row;
c.fTracks[0]=c.summit->fTracks[0];
c.fTracks[1]=c.summit->fTracks[1];
c.fTracks[2]=c.summit->fTracks[2];
- if (c.cut) {
+ if (c.summit->fSignal<0) {
c.fSigmaY2 *= 25.;
c.fSigmaZ2 *= 4.;
}
AddCluster(c); ncls++; ncl++;
}
}
-
+
for (ndig=0; ndig<ndigits; ndig++) {
dig=(AliTPCdigit*)fDigits->UncheckedAt(ndig);
- if (TMath::Abs(dig->fSignal) >= 0)
- bins[dig->fPad][dig->fTime].dig=dig;
+ int i=dig->fPad+1, j=dig->fTime+1;
+ if (i > npads) {
+ cerr<<"AliTPC::Digits2Clusters error: pad number is out of range ! ";
+ cerr<<i<<' '<<npads<<endl;
+ continue;
+ }
+ if (j > MAXTBKT) {
+ cerr<<"AliTPC::Digits2Clusters error: time bucket is out of range ! ";
+ cerr<<j<<' '<<MAXTBKT<<endl;
+ continue;
+ }
+ if (TMath::Abs(dig->fSignal)>=par->GetZeroSup()) bins[i*MAXZ+j].dig=dig;
}
- for (i=1; i<MAX_PAD-1; i++) {
- for (j=1; j<MAX_BUCKET-1; j++) {
- if (bins[i][j].dig == 0) continue;
- PreCluster c; c.summit=bins[i][j].dig; c.idx=ncls;
- FindCluster(i, j, bins, c);
- if (c.fQ <= Q_min) continue; //noise cluster
+ for (i=1; i<MAXY-1; i++) {
+ for (j=1; j<MAXZ-1; j++) {
+ if (bins[i*MAXZ+j].dig == 0) continue;
+ PreCluster c; c.summit=bins[i*MAXZ+j].dig; c.idx=ncls;
+ FindPreCluster(i, j, MAXZ, bins, c);
+ if (c.ndigits < 2) continue; //noise cluster
if (c.npeaks>1) continue; //overlapped cluster
c.fY /= c.fQ;
c.fZ /= c.fQ;
double s2 = c.fSigmaY2/c.fQ - c.fY*c.fY;
c.fSigmaY2 = s2 + 1./12.;
- c.fSigmaY2 *= fTPCParam->GetPadPitchWidth()*
- fTPCParam->GetPadPitchWidth();
- if (s2 != 0.) c.fSigmaY2 *= 0.022*4*0.6*4;
+ c.fSigmaY2 *= par->GetPadPitchWidth()*par->GetPadPitchWidth();
+ if (s2 != 0.) c.fSigmaY2 *= 0.04;
s2 = c.fSigmaZ2/c.fQ - c.fZ*c.fZ;
c.fSigmaZ2 = s2 + 1./12.;
- c.fSigmaZ2 *= fTPCParam->GetZWidth()*fTPCParam->GetZWidth();
- if (s2 != 0.) c.fSigmaZ2 *= 0.068*4*0.4;
-
- c.fY = (c.fY - 0.5 - 0.5*npads)*fTPCParam->GetPadPitchWidth();
- c.fZ = fTPCParam->GetZWidth()*(c.fZ+1);
- c.fZ -= 3.*fTPCParam->GetZSigma(); // PASA delay
- c.fZ = sign_z*(z_end - c.fZ);
- //c.fZ += 0.023;
- c.fSector=nsec;
- c.fPadRow=nrow;
+ c.fSigmaZ2 *= par->GetZWidth()*par->GetZWidth();
+ if (s2 != 0.) c.fSigmaZ2 *= 0.10;
+
+ c.fY = (c.fY - 0.5 - 0.5*npads)*par->GetPadPitchWidth();
+ c.fZ = par->GetZWidth()*c.fZ;
+ c.fZ -= 3.*par->GetZSigma(); // PASA delay
+ c.fZ = sign*(z_end - c.fZ);
+
+ c.fSector=sec;
+ c.fPadRow=row;
c.fTracks[0]=c.summit->fTracks[0];
c.fTracks[1]=c.summit->fTracks[1];
c.fTracks[2]=c.summit->fTracks[2];
- if (c.cut) {
+ if (c.summit->fSignal<0) {
c.fSigmaY2 *= 25.;
c.fSigmaZ2 *= 4.;
}
-
+
if (c.npeaks==0) {AddCluster(c); ncls++; ncl++;}
else {
new ((*fClusters)[c.idx]) AliTPCcluster(c);
}
cerr<<"sector, row, digits, clusters: "
- <<nsec<<' '<<nrow<<' '<<ndigits<<' '<<ncl<<" \r";
+ <<sec<<' '<<row<<' '<<ndigits<<' '<<ncl<<" \r";
fDigits->Clear();
-
+
+ delete[] bins;
}
}
//-----------------------------------------------------------------
// Origin: Marek Kowalski IFJ, Krakow, Marek.Kowalski@ifj.edu.pl
//-----------------------------------------------------------------
+
AliTPCParam * fTPCParam = &(fDigParam->GetParam());
Float_t sigma_rphi,sigma_z,cl_rphi,cl_z;
//
TTree *TH = gAlice->TreeH();
Stat_t ntracks = TH->GetEntries();
+ Particles=gAlice->Particles();
//------------------------------------------------------------
// Loop over all sectors (72 sectors)
- // Sectors 1-24 are lower sectors, 1-12 z>0, 13-24 z<0
- // Sectors 25-72 are upper sectors, 25-48 z>0, 49-72 z<0
+ // Sectors 0-35 are lower sectors, 0-17 z>0, 18-35 z<0
+ // Sectors 36-71 are upper sectors, 36-53 z>0, 54-71 z<0
//
- // First cluster for sector 1 starts at "0"
+ // First cluster for sector 0 starts at "0"
//------------------------------------------------------------
- fClustersIndex[0] = 0;
-
//
- for(Int_t isec=1;isec<fNsectors+1;isec++){
+ int Nsectors=fDigParam->GetParam().GetNSector();
+ for(Int_t isec=0; isec<Nsectors; isec++){
//MI change
fTPCParam->AdjustAngles(isec,cph,sph);
// to the particles
//
nhits=fHits->GetEntriesFast();
- Particles=gAlice->Particles();
//
// Loop over hits
//
if(cl_z < 0.) cl_z=2.5e-5;
//
-
- //
- // smearing --> rotate to the 1 (13) or to the 25 (49) sector,
+ // smearing --> rotate sectors firstly,
// then the inaccuracy in a X-Y plane is only along Y (pad row)!
//
Float_t xprim= tpcHit->fX*cph + tpcHit->fY*sph;
Float_t yprim=-tpcHit->fX*sph + tpcHit->fY*cph;
xyz[0]=gRandom->Gaus(yprim,TMath::Sqrt(sigma_rphi)); // y
- Double_t alpha=(sector<25) ? alpha_low : alpha_up;
+ Double_t alpha=(sector < fTPCParam->GetNInnerSector()) ?
+ fTPCParam->GetInnerAngle() : fTPCParam->GetOuterAngle();
if (TMath::Abs(xyz[0]/xprim) > TMath::Tan(0.5*alpha)) xyz[0]=yprim;
xyz[1]=gRandom->Gaus(tpcHit->fZ,TMath::Sqrt(sigma_z)); // z
if (TMath::Abs(xyz[1]) > 250) xyz[1]=tpcHit->fZ;
- xyz[2]=tpcHit->fQ; // q
+ xyz[2]=tpcHit->fQ+1;// q; let it be not equal to zero (Y.Belikov)
xyz[3]=sigma_rphi; // fSigmaY2
xyz[4]=sigma_z; // fSigmaZ2
-
- //find row number
- //MI we must change
- Int_t row = fTPCParam->GetPadRow(sector,xprim) ;
+
// and finally add the cluster
- Int_t tracks[5]={tpcHit->fTrack, -1, -1, sector, row+1};
+ Int_t tracks[5]={tpcHit->fTrack, -1, -1, sector, tpcHit->fPadRow};
AddCluster(xyz,tracks);
} // end of loop over hits
} // end of loop over tracks
- fClustersIndex[isec] = fNclusters; // update clusters index
} // end of loop over sectors
- fClustersIndex[fNsectors]--; // set end of the clusters buffer
}
//----------------------------------------------------
// Loop over all sectors (72 sectors)
- // Sectors 1-24 are lower sectors, 1-12 z>0, 13-24 z<0
- // Sectors 25-72 are upper sectors, 25-48 z>0, 49-72 z<0
+ // Sectors 0-35 are lower sectors, 0-17 z>0, 18-35 z<0
+ // Sectors 36-71 are upper sectors, 36-53 z>0, 54-71 z<0
//----
- for(Int_t isec=1;isec<fNsectors+1;isec++) Hits2DigitsSector(isec);
+ int Nsectors=fDigParam->GetParam().GetNSector();
+ for(Int_t isec=0;isec<Nsectors;isec++) Hits2DigitsSector(isec);
}
Float_t chipgain= fTPCParam->GetChipGain();
Float_t zerosup = fTPCParam->GetZeroSup();
Int_t nrows =fTPCParam->GetNRow(isec);
+ const int MAXTBKT=
+ int((z_end+6*fTPCParam->GetZSigma())/fTPCParam->GetZWidth())+1;
Int_t nTracks[3];
Int_t n_of_pads[3];
// and a single track signal
//
- TMatrix *m1 = new TMatrix(1,n_of_pads[iFlag],1,MAXTPCTBK); // integrated
- TMatrix *m2 = new TMatrix(1,n_of_pads[iFlag],1,MAXTPCTBK); // single
+ TMatrix *m1 = new TMatrix(0,n_of_pads[iFlag]-1,0,MAXTBKT-1); // integrated
+ TMatrix *m2 = new TMatrix(0,n_of_pads[iFlag]-1,0,MAXTBKT-1); // single
//
// Array of pointers to the label-signal list
- Int_t NofDigits = n_of_pads[iFlag]*MAXTPCTBK; // number of digits for this row
+ Int_t NofDigits = n_of_pads[iFlag]*MAXTBKT; // number of digits for this row
Float_t **pList = new Float_t* [NofDigits];
// Cross talk from the neighbouring pad-rows
//
- TMatrix *m3 = new TMatrix(1,n_of_pads[iFlag],1,MAXTPCTBK); // cross-talk
+ TMatrix *m3 = new TMatrix(0,n_of_pads[iFlag]-1,0,MAXTBKT-1); // cross-talk
TMatrix &Cross = *m3;
Int_t digits[5];
- for(Int_t ip=1;ip<n_of_pads[iFlag]+1;ip++){
- for(Int_t it=1;it<MAXTPCTBK+1;it++){
+ for(Int_t ip=0;ip<n_of_pads[iFlag];ip++){
+ for(Int_t it=0;it<MAXTBKT;it++){
Float_t q = Total(ip,it);
- Int_t gi =(it-1)*n_of_pads[iFlag]+ip-1; // global index
+ Int_t gi =it*n_of_pads[iFlag]+ip; // global index
q = gRandom->Gaus(q,fTPCParam->GetNoise()); // apply noise
q *= (q_el*1.e15); // convert to fC
}
digits[0]=isec;
- digits[1]=irow+1;
+ digits[1]=irow;
digits[2]=ip;
digits[3]=it;
digits[4]= (Int_t)q;
AliTPCParam * fTPCParam = &(fDigParam->GetParam());
AliTPCPRF2D * fPRF2D = &(fDigParam->GetPRF2D());
AliTPCRF1D * fRF = &(fDigParam->GetRF());
+ const int MAXTBKT=
+ int((z_end+6*fTPCParam->GetZSigma())/fTPCParam->GetZWidth())+1;
//to make the code faster we put parameters to the stack
Float_t label = v(0);
- Int_t CentralPad = (np+1)/2;
+ Int_t CentralPad = (np-1)/2;
Int_t PadNumber;
Int_t nElectrons = (tv->GetNrows()-1)/4;
Float_t range=((np-1)/2 + 0.5)*fTPCParam->GetPadPitchWidth(); // pad range
- range -= 0.5; // dead zone, 5mm from the edge, according to H.G. Fischer
+ range -= 0.5; // dead zone, 5mm from the edge, according to H.G. Fischer
+
Float_t IneffFactor = 0.5; // inefficiency in the gain close to the edge, as above
PadNumber=CentralPad;
}
else if (absy < range){
- PadNumber=(Int_t) ((absy-0.5*fTPCParam->GetPadPitchWidth())/fTPCParam->GetPadPitchWidth() +1.);
+ PadNumber=(Int_t) ((absy-0.5*fTPCParam->GetPadPitchWidth())/fTPCParam->GetPadPitchWidth()+1.);
PadNumber=(Int_t) (TMath::Sign((Float_t)PadNumber, y)+CentralPad);
}
else continue; // electron out of pad-range , lost at the sector edge
Float_t dist = y - (Float_t)(PadNumber-CentralPad)*fTPCParam->GetPadPitchWidth();
for (Int_t i=0;i<7;i++){
- PadSignal[i]=fPRF2D->GetPRF(dist+(i-3)*fTPCParam->GetPadPitchWidth(),xwire)*aval;
+ PadSignal[i]=fPRF2D->GetPRF(-dist+(i-3)*fTPCParam->GetPadPitchWidth(),xwire)*aval;
PadSignal[i] *= fTPCParam->GetPadCoupling();
}
- Int_t LeftPad = TMath::Max(1,PadNumber-3);
- Int_t RightPad = TMath::Min(np,PadNumber+3);
+ Int_t LeftPad = TMath::Max(0,PadNumber-3);
+ Int_t RightPad = TMath::Min(np-1,PadNumber+3);
Int_t pmin=LeftPad-PadNumber+3; // lower index of the pad_signal vector
Int_t pmax=RightPad-PadNumber+3; // upper index
- Float_t z_drift = (z_end-z)*zwidthm1;
+ Float_t z_drift = z*zwidthm1;
Float_t z_offset = z_drift-(Int_t)z_drift;
- //distance to the centre of nearest time bin (in time bin units)
- Int_t FirstBucket = (Int_t)z_drift+1;
+
+ Int_t FirstBucket = (Int_t)z_drift; // numbering starts from "0"
// loop over time bins (4 bins is enough - 3 sigma truncated Gaussian)
+
for (Int_t i2=0;i2<4;i2++){
Int_t TrueTime = FirstBucket+i2; // current time bucket
- Float_t dz = (Float_t(i2)+z_offset)*zwidth;
+ Float_t dz = (Float_t(i2)+1.-z_offset)*zwidth;
Float_t ampl = fRF->GetRF(dz);
- if( (TrueTime>MAXTPCTBK) ) break; // beyond the time range
+ if( (TrueTime>MAXTBKT-1) ) break; // beyond the time range
IndexRange[2]=TMath::Min(IndexRange[2],TrueTime); // min time
IndexRange[3]=TMath::Max(IndexRange[3],TrueTime); // max time
for(Int_t ip=IndexRange[0];ip<IndexRange[1]+1;ip++){
- Int_t GlobalIndex = (it-1)*np+ip-1; // GlobalIndex starts from 0!
+ // accept only the contribution larger than 500 electrons (1/2 s_noise)
+
+ if(signal(ip,it)<500.) continue;
+
+
+ Int_t GlobalIndex = it*np+ip; // GlobalIndex starts from 0!
if(!pList[GlobalIndex]){
//
// Create new list (6 elements - 3 signals and 3 labels),
- // but only if the signal is > 0.
//
- if(signal(ip,it)>0.){
-
pList[GlobalIndex] = new Float_t [6];
// set list to -1
*pList[GlobalIndex] = label;
- *(pList[GlobalIndex]+3) = signal(ip,it);}
+ *(pList[GlobalIndex]+3) = signal(ip,it);
}
else{
AliTPCParam * fTPCParam = &(fDigParam->GetParam());
AliTPCPRF2D * fPRF2D = &(fDigParam->GetPRF2D());
AliTPCRF1D * fRF = &(fDigParam->GetRF());
+ const int MAXTBKT=
+ int((z_end+6*fTPCParam->GetZSigma())/fTPCParam->GetZWidth())+1;
//to make code faster
TVector *tv;
TMatrix &signal = *m;
- Int_t CentralPad = (nPadsSignal+1)/2;
+ Int_t CentralPad = (nPadsSignal-1)/2;
Float_t PadSignal[7]; // signal from a single electron
// Loop over tracks
for(Int_t nt=0;nt<ntracks;nt++){
Float_t dist = y - (Float_t)(PadNumber-CentralPad)*fTPCParam->GetPadPitchWidth();
for (Int_t i=0;i<7;i++){
- PadSignal[i]=fPRF2D->GetPRF(dist+(3-i)*fTPCParam->GetPadPitchWidth(),xwire)*aval;
+ PadSignal[i]=fPRF2D->GetPRF(-dist+(i-3)*fTPCParam->GetPadPitchWidth(),xwire)*aval;
PadSignal[i] *= fTPCParam->GetPadCoupling();
}
// real pad range
- Int_t LeftPad = TMath::Max(1,PadNumber-3);
- Int_t RightPad = TMath::Min(nPadsSignal,PadNumber+3);
+ Int_t LeftPad = TMath::Max(0,PadNumber-3);
+ Int_t RightPad = TMath::Min(nPadsSignal-1,PadNumber+3);
Int_t pmin=LeftPad-PadNumber+3; // lower index of the pad_signal vector
Int_t pmax=RightPad-PadNumber+3; // upper index
- Float_t z_drift = (z_end-z)*zwidthm1;
+ Float_t z_drift = z*zwidthm1;
Float_t z_offset = z_drift-(Int_t)z_drift;
- //distance to the centre of nearest time bin (in time bin units)
- Int_t FirstBucket = (Int_t)z_drift+1;
- // MI check it --time offset
+
+ Int_t FirstBucket = (Int_t)z_drift; // numbering starts from "0"
+
for (Int_t i2=0;i2<4;i2++){
Int_t TrueTime = FirstBucket+i2; // current time bucket
- Float_t dz = (Float_t(i2)+z_offset)*zwidth;
+ Float_t dz = (Float_t(i2)+1.- z_offset)*zwidth;
Float_t ampl = fRF->GetRF(dz);
- if((TrueTime>MAXTPCTBK)) break; // beyond the time range
+ if((TrueTime>MAXTBKT-1)) break; // beyond the time range
// loop over pads, from pmin to pmax
for(Int_t i3=pmin;i3<pmax+1;i3++){
Int_t TruePad = LeftPad+i3-pmin;
- if(TruePad<nPadsDiff+1 || TruePad > nPadsSignal-nPadsDiff) continue;
+ if(TruePad<nPadsDiff || TruePad > nPadsSignal-nPadsDiff-1) continue;
TruePad -= nPadsDiff;
signal(TruePad,TrueTime)+=(PadSignal[i3]*ampl); // not converted to charge!
fSens = sens;
}
+
+void AliTPC::SetSide(Float_t side)
+{
+ fSide = side;
+
+}
+//____________________________________________________________________________
+void AliTPC::SetGasMixt(Int_t nc,Int_t c1,Int_t c2,Int_t c3,Float_t p1,
+ Float_t p2,Float_t p3)
+{
+ fNoComp = nc;
+
+ fMixtComp[0]=c1;
+ fMixtComp[1]=c2;
+ fMixtComp[2]=c3;
+
+ fMixtProp[0]=p1;
+ fMixtProp[1]=p2;
+ fMixtProp[2]=p3;
+
+
+}
//_____________________________________________________________________________
void AliTPC::Streamer(TBuffer &R__b)
{
R__b >> fNsectors;
R__b >> fNclusters;
R__b >> fNtracks;
- fClustersIndex = new Int_t[fNsectors+1];
fDigitsIndex = new Int_t[fNsectors+1];
} else {
R__b.WriteVersion(AliTPC::IsA());
//
// Transformation from local to global coordinate system
//
- x[0]=par->GetPadRowRadii(fSector,fPadRow-1);
+ x[0]=par->GetPadRowRadii(fSector,fPadRow);
x[1]=fY;
x[2]=fZ;
- par->CRXYZtoXYZ(x,fSector,fPadRow-1,1);
+ par->CRXYZtoXYZ(x,fSector,fPadRow,1);
+ x[2]=fZ;
}
//_____________________________________________________________________________
{
//
// compare two clusters according y coordinata
+ //
AliTPCcluster *cl= (AliTPCcluster *)o;
if (fY<cl->fY) return -1;
if (fY==cl->fY) return 0;
{
//
//make AliTPCcluster sortabale
+ //
return kTRUE;
}
//
// Default creator for a TPC reconstructed track object
//
- ref=hits[0]; // This is dummy code !
+ fX=hits[0]; // This is dummy code !
}
-AliTPCtrack::AliTPCtrack(const AliTPCcluster& c,const TVector& xx,
- const TMatrix& CC, const AliTPCParam *p):
- x(xx),C(CC),clusters(MAX_CLUSTER)
+AliTPCtrack::AliTPCtrack(const AliTPCcluster *c,const TVector& xx,
+ const TMatrix& CC, Double_t xref, Double_t alpha):
+ x(xx),C(CC),fClusters(200)
{
+ //-----------------------------------------------------------------
+ // This is the main track constructor.
//
- // Standard creator for a TPC reconstructed track object
- //
- chi2=0.;
- int sec=c.fSector-1, row=c.fPadRow-1;
- ref=p->GetPadRowRadii(sec+1,row);
-
- if (sec<24) {
- fAlpha=(sec%12)*alpha_low;
- } else {
- fAlpha=(sec%24)*alpha_up;
- }
- clusters.AddLast((AliTPCcluster*)(&c));
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
+ fX=xref;
+ fAlpha=alpha;
+ fChi2=0.;
+ fClusters.AddLast((AliTPCcluster*)(c));
}
//_____________________________________________________________________________
AliTPCtrack::AliTPCtrack(const AliTPCtrack& t) : x(t.x), C(t.C),
- clusters(t.clusters.GetEntriesFast())
+ fClusters(t.fClusters.GetEntriesFast())
{
+ //-----------------------------------------------------------------
+ // This is a track copy constructor.
//
- // Copy creator for a TPC reconstructed track
- //
- ref=t.ref;
- chi2=t.chi2;
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
+ fX=t.fX;
+ fChi2=t.fChi2;
fAlpha=t.fAlpha;
- int n=t.clusters.GetEntriesFast();
- for (int i=0; i<n; i++) clusters.AddLast(t.clusters.UncheckedAt(i));
+ int n=t.fClusters.GetEntriesFast();
+ for (int i=0; i<n; i++) fClusters.AddLast(t.fClusters.UncheckedAt(i));
}
//_____________________________________________________________________________
-Double_t AliTPCtrack::GetY(Double_t xk) const
-{
- //
- //
+Int_t AliTPCtrack::Compare(TObject *o) {
+ //-----------------------------------------------------------------
+ // This function compares tracks according to their curvature.
//
- Double_t c2=x(2)*xk - x(3);
- if (TMath::Abs(c2) >= 0.999) {
- if (*this>10) cerr<<*this<<" AliTPCtrack warning: No y for this x !\n";
- return 0.;
- }
- Double_t c1=x(2)*ref - x(3);
- Double_t r1=sqrt(1.-c1*c1), r2=sqrt(1.-c2*c2);
- Double_t dx=xk-ref;
- return x(0) + dx*(c1+c2)/(r1+r2);
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
+ AliTPCtrack *t=(AliTPCtrack*)o;
+ Double_t co=t->GetSigmaY2();
+ Double_t c =GetSigmaY2();
+ if (c>co) return 1;
+ else if (c<co) return -1;
+ return 0;
}
//_____________________________________________________________________________
int AliTPCtrack::PropagateTo(Double_t xk,Double_t x0,Double_t rho,Double_t pm)
{
+ //-----------------------------------------------------------------
+ // This function propagates a track to a reference plane x=xk.
//
- // Propagate a TPC reconstructed track
- //
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
if (TMath::Abs(x(2)*xk - x(3)) >= 0.999) {
- if (*this>3) cerr<<*this<<" AliTPCtrack warning: Propagation failed !\n";
+ if (*this>4) cerr<<*this<<" AliTPCtrack warning: Propagation failed !\n";
return 0;
}
- Double_t x1=ref, x2=x1+0.5*(xk-x1), dx=x2-x1, y1=x(0), z1=x(1);
+ Double_t x1=fX, x2=x1+0.5*(xk-x1), dx=x2-x1, y1=x(0), z1=x(1);
Double_t c1=x(2)*x1 - x(3), r1=sqrt(1.- c1*c1);
Double_t c2=x(2)*x2 - x(3), r2=sqrt(1.- c2*c2);
TMatrix tmp(F,TMatrix::kMult,C);
C.Mult(tmp,TMatrix(TMatrix::kTransposed,F));
- ref=x2;
+ fX=x2;
//Multiple scattering******************
- Double_t ey=x(2)*ref - x(3);
+ Double_t ey=x(2)*fX - x(3);
Double_t ex=sqrt(1-ey*ey);
Double_t ez=x(4);
TMatrix Q(5,5); Q=0.;
F=0;
F(2,2)=-x(2)*ex; F(2,3)=-x(2)*ey;
- F(3,2)=-ex*(x(2)*ref-ey); F(3,3)=-(1.+ x(2)*ref*ey - ey*ey);
+ F(3,2)=-ex*(x(2)*fX-ey); F(3,3)=-(1.+ x(2)*fX*ey - ey*ey);
F(4,2)=-ez*ex; F(4,3)=-ez*ey; F(4,4)=1.;
tmp.Mult(F,Q);
Double_t p2=GetPt()*GetPt()*(1.+x(4)*x(4));
Double_t beta2=p2/(p2 + pm*pm);
- Double_t d=sqrt((x1-ref)*(x1-ref)+(y1-x(0))*(y1-x(0))+(z1-x(1))*(z1-x(1)));
+ Double_t d=sqrt((x1-fX)*(x1-fX)+(y1-x(0))*(y1-x(0))+(z1-x(1))*(z1-x(1)));
d*=2.;
Double_t theta2=14.1*14.1/(beta2*p2*1e6)*d/x0*rho;
Q*=theta2;
x(2)*=(1.- sqrt(p2+pm*pm)/p2*dE);
//x(3)*=(1.- sqrt(p2+pm*pm)/p2*dE);
- x1=ref; x2=xk; y1=x(0); z1=x(1);
+ x1=fX; x2=xk; y1=x(0); z1=x(1);
c1=x(2)*x1 - x(3); r1=sqrt(1.- c1*c1);
c2=x(2)*x2 - x(3); r2=sqrt(1.- c2*c2);
tmp.Mult(F,C);
C.Mult(tmp,TMatrix(TMatrix::kTransposed,F));
- ref=x2;
+ fX=x2;
return 1;
}
//_____________________________________________________________________________
void AliTPCtrack::PropagateToVertex(Double_t x0,Double_t rho,Double_t pm)
{
+ //-----------------------------------------------------------------
+ // This function propagates tracks to the "vertex".
//
- // Propagate a reconstructed track from the vertex
- //
- Double_t c=x(2)*ref - x(3);
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
+ Double_t c=x(2)*fX - x(3);
Double_t tgf=-x(3)/(x(2)*x(0) + sqrt(1-c*c));
Double_t snf=tgf/sqrt(1.+ tgf*tgf);
Double_t xv=(x(3)+snf)/x(2);
//_____________________________________________________________________________
void AliTPCtrack::Update(const AliTPCcluster *c, Double_t chisq)
{
+ //-----------------------------------------------------------------
+ // This function associates a clusters with this track.
//
- // Update statistics for a reconstructed TPC track
- //
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
TMatrix H(2,5); H.UnitMatrix();
TMatrix Ht(TMatrix::kTransposed,H);
TVector m(2); m(0)=c->fY; m(1)=c->fZ;
TVector savex=x;
x*=H; x-=m; x*=-1; x*=K; x+=savex;
- if (TMath::Abs(x(2)*ref-x(3)) >= 0.999) {
- if (*this>3) cerr<<*this<<" AliTPCtrack warning: Filtering failed !\n";
+ if (TMath::Abs(x(2)*fX-x(3)) >= 0.999) {
+ if (*this>4) cerr<<*this<<" AliTPCtrack warning: Filtering failed !\n";
x=savex;
return;
}
TMatrix saveC=C;
C.Mult(K,tmp); C-=saveC; C*=-1;
- clusters.AddLast((AliTPCcluster*)c);
- chi2 += chisq;
+ fClusters.AddLast((AliTPCcluster*)c);
+ fChi2 += chisq;
}
//_____________________________________________________________________________
int AliTPCtrack::Rotate(Double_t alpha)
{
+ //-----------------------------------------------------------------
+ // This function rotates this track.
//
- // Rotate a reconstructed TPC track
- //
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
fAlpha += alpha;
- Double_t x1=ref, y1=x(0);
+ Double_t x1=fX, y1=x(0);
Double_t ca=cos(alpha), sa=sin(alpha);
- Double_t r1=x(2)*ref - x(3);
+ Double_t r1=x(2)*fX - x(3);
- ref = x1*ca + y1*sa;
+ fX = x1*ca + y1*sa;
x(0)=-x1*sa + y1*ca;
x(3)=x(3)*ca + (x(2)*y1 + sqrt(1.- r1*r1))*sa;
- Double_t r2=x(2)*ref - x(3);
+ Double_t r2=x(2)*fX - x(3);
if (TMath::Abs(r2) >= 0.999) {
- if (*this>3) cerr<<*this<<" AliTPCtrack warning: Rotation failed !\n";
+ if (*this>4) cerr<<*this<<" AliTPCtrack warning: Rotation failed !\n";
return 0;
}
Double_t y0=x(0) + sqrt(1.- r2*r2)/x(2);
if ((x(0)-y0)*x(2) >= 0.) {
- if (*this>3) cerr<<*this<<" AliTPCtrack warning: Rotation failed !!!\n";
+ if (*this>4) cerr<<*this<<" AliTPCtrack warning: Rotation failed !!!\n";
return 0;
}
//_____________________________________________________________________________
void AliTPCtrack::UseClusters() const
{
+ //-----------------------------------------------------------------
+ // This function marks clusters associated with this track.
//
- //
- //
- int num_of_clusters=clusters.GetEntriesFast();
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
+ int num_of_clusters=fClusters.GetEntriesFast();
for (int i=0; i<num_of_clusters; i++) {
//if (i<=14) continue;
- AliTPCcluster *c=(AliTPCcluster*)clusters.UncheckedAt(i);
+ AliTPCcluster *c=(AliTPCcluster*)fClusters.UncheckedAt(i);
c->Use();
}
}
//_____________________________________________________________________________
Double_t AliTPCtrack::GetPredictedChi2(const AliTPCcluster *c) const
{
+ //-----------------------------------------------------------------
+ // This function calculates a predicted chi2 increment.
//
- // Calculate chi2 for a reconstructed TPC track
- //
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
TMatrix H(2,5); H.UnitMatrix();
TVector m(2); m(0)=c->fY; m(1)=c->fZ;
TMatrix V(2,2); V(0,0)=c->fSigmaY2; V(0,1)=0.; V(1,0)=0.; V(1,1)=c->fSigmaZ2;
Double_t det=(Double_t)R(0,0)*R(1,1) - (Double_t)R(0,1)*R(1,0);
if (TMath::Abs(det) < 1.e-10) {
- if (*this>3) cerr<<*this<<" AliTPCtrack warning: Singular matrix !\n";
+ if (*this>4) cerr<<*this<<" AliTPCtrack warning: Singular matrix !\n";
return 1e10;
}
R(0,1)=R(0,0); R(0,0)=R(1,1); R(1,1)=R(0,1);
}
//_____________________________________________________________________________
-int AliTPCtrack::GetLab() const
+struct S { int lab; int max; };
+int AliTPCtrack::GetLabel(int nrows) const
{
+ //-----------------------------------------------------------------
+ // This function returns the track label. If label<0, this track is fake.
//
- //
- //
- int lab=123456789;
- struct {
- int lab;
- int max;
- } s[MAX_CLUSTER]={{0,0}};
-
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
+ int num_of_clusters=fClusters.GetEntriesFast();
+ S *s=new S[num_of_clusters];
int i;
- int num_of_clusters=clusters.GetEntriesFast();
+ for (i=0; i<num_of_clusters; i++) s[i].lab=s[i].max=0;
+
+ int lab=123456789;
for (i=0; i<num_of_clusters; i++) {
- AliTPCcluster *c=(AliTPCcluster*)clusters.UncheckedAt(i);
+ AliTPCcluster *c=(AliTPCcluster*)fClusters.UncheckedAt(i);
lab=TMath::Abs(c->fTracks[0]);
int j;
- for (j=0; j<MAX_CLUSTER; j++)
+ for (j=0; j<num_of_clusters; j++)
if (s[j].lab==lab || s[j].max==0) break;
s[j].lab=lab;
s[j].max++;
int max=0;
for (i=0; i<num_of_clusters; i++)
if (s[i].max>max) {max=s[i].max; lab=s[i].lab;}
-
+
+ delete[] s;
+
for (i=0; i<num_of_clusters; i++) {
- AliTPCcluster *c=(AliTPCcluster*)clusters.UncheckedAt(i);
+ AliTPCcluster *c=(AliTPCcluster*)fClusters.UncheckedAt(i);
if (TMath::Abs(c->fTracks[1]) == lab ||
TMath::Abs(c->fTracks[2]) == lab ) max++;
}
if (1.-float(max)/num_of_clusters > 0.10) return -lab;
- if (num_of_clusters < 6) return lab;
+ int tail=int(0.08*nrows);
+ if (num_of_clusters < tail) return lab;
max=0;
- for (i=1; i<=6; i++) {
- AliTPCcluster *c=(AliTPCcluster*)clusters.UncheckedAt(num_of_clusters-i);
+ for (i=1; i<=tail; i++) {
+ AliTPCcluster *c=(AliTPCcluster*)fClusters.UncheckedAt(num_of_clusters-i);
if (lab == TMath::Abs(c->fTracks[0]) ||
lab == TMath::Abs(c->fTracks[1]) ||
lab == TMath::Abs(c->fTracks[2])) max++;
}
- if (max<3) return -lab;
+ if (max < int(0.5*tail)) return -lab;
return lab;
}
//_____________________________________________________________________________
void AliTPCtrack::GetPxPyPz(Double_t& px, Double_t& py, Double_t& pz) const
{
+ //-----------------------------------------------------------------
+ // This function returns reconstructed track momentum in the global system.
//
- // Get reconstructed TPC track momentum
- //
- Double_t pt=0.3*FIELD/TMath::Abs(x(2))/100; // GeV/c
- Double_t r=x(2)*ref-x(3);
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
+ Double_t pt=TMath::Abs(GetPt()); // GeV/c
+ Double_t r=x(2)*fX-x(3);
Double_t y0=x(0) + sqrt(1.- r*r)/x(2);
px=-pt*(x(0)-y0)*x(2); //cos(phi);
- py=-pt*(x(3)-ref*x(2)); //sin(phi);
+ py=-pt*(x(3)-fX*x(2)); //sin(phi);
pz=pt*x(4);
Double_t tmp=px*TMath::Cos(fAlpha) - py*TMath::Sin(fAlpha);
py=px*TMath::Sin(fAlpha) + py*TMath::Cos(fAlpha);
}
//_____________________________________________________________________________
-//
-// Classes for internal tracking use
-//
-
-//_____________________________________________________________________________
-void AliTPCRow::InsertCluster(const AliTPCcluster* c)
-{
- //
- // Insert a cluster in the list
+Double_t AliTPCtrack::GetdEdX(Double_t low, Double_t up) const {
+ //-----------------------------------------------------------------
+ // This funtion calculates dE/dX within the "low" and "up" cuts.
//
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------
+ int ncl=fClusters.GetEntriesFast();
+ int n=0;
+ Double_t *q=new Double_t[ncl];
+ int i;
+ for (i=0; i<ncl; i++) {
+ AliTPCcluster *cl=(AliTPCcluster*)(fClusters.UncheckedAt(i));
+ // if (cl->fdEdX > 3000) continue;
+ if (cl->fdEdX <= 0) continue;
+ q[n++]=cl->fdEdX;
+ }
+
+ //stupid sorting
+ int swap;
+ do {
+ swap=0;
+ for (i=0; i<n-1; i++) {
+ if (q[i]<=q[i+1]) continue;
+ Double_t tmp=q[i]; q[i]=q[i+1]; q[i+1]=tmp;
+ swap++;
+ }
+ } while (swap);
+
+ int nl=int(low*n), nu=int(up *n);
+ Double_t dedx=0.;
+ for (i=nl; i<=nu; i++) dedx += q[i];
+ dedx /= (nu-nl+1);
+ return dedx;
+}
+
+//_________________________________________________________________________
+//
+// Classes for internal tracking use
+//_________________________________________________________________________
+void AliTPCRow::InsertCluster(const AliTPCcluster* c) {
+ //-----------------------------------------------------------------------
+ // Insert a cluster into this pad row in accordence with its y-coordinate
+ //
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------------
if (num_of_clusters==MAX_CLUSTER_PER_ROW) {
cerr<<"AliTPCRow::InsertCluster(): Too many clusters !\n"; return;
}
clusters[i]=c; num_of_clusters++;
}
-//_____________________________________________________________________________
-int AliTPCRow::Find(Double_t y) const
-{
- //
- //
+int AliTPCRow::Find(Double_t y) const {
+ //-----------------------------------------------------------------------
+ // Return the index of the nearest cluster
//
+ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+ //-----------------------------------------------------------------------
if (y <= clusters[0]->fY) return 0;
if (y > clusters[num_of_clusters-1]->fY) return num_of_clusters;
int b=0, e=num_of_clusters-1, m=(b+e)/2;