/************************************************************************** * 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.2 2000/06/30 12:07:50 kowal2 Updated from the TPC-PreRelease branch Revision 1.1.2.2 2000/06/25 08:38:41 kowal2 Splitted from AliTPCtracking */ //----------------------------------------------------------------- // Implementation of the TPC track class // // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch //----------------------------------------------------------------- #include "AliTPCtrack.h" #include "AliTPCcluster.h" #include "AliTPCClustersRow.h" #include "AliTPCClustersArray.h" ClassImp(AliTPCtrack) //_________________________________________________________________________ AliTPCtrack::AliTPCtrack(UInt_t index, const Double_t xx[5], const Double_t cc[15], Double_t xref, Double_t alpha) { //----------------------------------------------------------------- // This is the main track constructor. //----------------------------------------------------------------- fLab=-1; fChi2=0.; fdEdx=0.; fAlpha=alpha; fX=xref; fY=xx[0]; fZ=xx[1]; fC=xx[2]; fE=xx[3]; fT=xx[4]; fCyy=cc[0]; fCzy=cc[1]; fCzz=cc[2]; fCcy=cc[3]; fCcz=cc[4]; fCcc=cc[5]; fCey=cc[6]; fCez=cc[7]; fCec=cc[8]; fCee=cc[9]; fCty=cc[10]; fCtz=cc[11]; fCtc=cc[12]; fCte=cc[13]; fCtt=cc[14]; fN=0; fIndex[fN++]=index; } //_____________________________________________________________________________ AliTPCtrack::AliTPCtrack(const AliTPCtrack& t) { //----------------------------------------------------------------- // This is a track copy constructor. //----------------------------------------------------------------- fLab=t.fLab; fChi2=t.fChi2; fdEdx=t.fdEdx; fAlpha=t.fAlpha; fX=t.fX; fY=t.fY; fZ=t.fZ; fC=t.fC; fE=t.fE; fT=t.fT; fCyy=t.fCyy; fCzy=t.fCzy; fCzz=t.fCzz; fCcy=t.fCcy; fCcz=t.fCcz; fCcc=t.fCcc; fCey=t.fCey; fCez=t.fCez; fCec=t.fCec; fCee=t.fCee; fCty=t.fCty; fCtz=t.fCtz; fCtc=t.fCtc; fCte=t.fCte; fCtt=t.fCtt; fN=t.fN; for (Int_t i=0; iGetSigmaY2(); //Double_t c =GetSigmaY2(); Double_t co=TMath::Abs(t->GetC()); Double_t c =TMath::Abs(GetC()); if (c>co) return 1; else if (c= 0.99999) { if (fN>4) cerr<GetSigmaY2(), r01=0., r11=c->GetSigmaZ2(); r00+=fCyy; r01+=fCzy; r11+=fCzz; Double_t det=r00*r11 - r01*r01; Double_t tmp=r00; r00=r11/det; r11=tmp/det; r01=-r01/det; Double_t k00=fCyy*r00+fCzy*r01, k01=fCyy*r01+fCzy*r11; Double_t k10=fCzy*r00+fCzz*r01, k11=fCzy*r01+fCzz*r11; Double_t k20=fCcy*r00+fCcz*r01, k21=fCcy*r01+fCcz*r11; Double_t k30=fCey*r00+fCez*r01, k31=fCey*r01+fCez*r11; Double_t k40=fCty*r00+fCtz*r01, k41=fCty*r01+fCtz*r11; Double_t dy=c->GetY() - fY, dz=c->GetZ() - fZ; Double_t cur=fC + k20*dy + k21*dz, eta=fE + k30*dy + k31*dz; if (TMath::Abs(cur*fX-eta) >= 0.99999) { if (fN>4) cerr<= 0.99999) { if (fN>4) cerr<= 0.) { if (fN>4) cerr<GetSigmaY2(), r01=0., r11=c->GetSigmaZ2(); r00+=fCyy; r01+=fCzy; r11+=fCzz; Double_t det=r00*r11 - r01*r01; if (TMath::Abs(det) < 1.e-10) { if (fN>4) cerr<GetY() - fY, dz=c->GetZ() - fZ; return (dy*r00*dy + 2*r01*dy*dz + dz*r11*dz)/det; } //_____________________________________________________________________________ void AliTPCtrack::GetPxPyPz(Double_t& px, Double_t& py, Double_t& pz) const { //----------------------------------------------------------------- // This function returns reconstructed track momentum in the global system. //----------------------------------------------------------------- Double_t pt=TMath::Abs(GetPt()); // GeV/c Double_t r=fC*fX-fE; Double_t y0=fY + sqrt(1.- r*r)/fC; px=-pt*(fY-y0)*fC; //cos(phi); py=-pt*(fE-fX*fC); //sin(phi); pz=pt*fT; Double_t tmp=px*TMath::Cos(fAlpha) - py*TMath::Sin(fAlpha); py=px*TMath::Sin(fAlpha) + py*TMath::Cos(fAlpha); px=tmp; } //_____________________________________________________________________________ void AliTPCtrack::CookLabel(AliTPCClustersArray *ca) { //----------------------------------------------------------------- // This function cooks the track label. If label<0, this track is fake. //----------------------------------------------------------------- Int_t *lb=new Int_t[fN]; Int_t *mx=new Int_t[fN]; AliTPCcluster **clusters=new AliTPCcluster*[fN]; Int_t i; Int_t sec,row,ncl; for (i=0; iGetRow(sec,row); clusters[i]=(AliTPCcluster*)(*clrow)[ncl]; } Int_t lab=123456789; for (i=0; iGetLabel(0)); Int_t j; for (j=0; jmax) {max=mx[i]; lab=lb[i];} for (i=0; iGetLabel(1)) == lab || TMath::Abs(c->GetLabel(2)) == lab ) max++; } SetLabel(-lab); if (1.-Float_t(max)/fN <= 0.10) { //Int_t tail=Int_t(0.08*fN); Int_t tail=14; max=0; for (i=1; i<=tail; i++) { AliTPCcluster *c=clusters[fN-i]; if (lab == TMath::Abs(c->GetLabel(0)) || lab == TMath::Abs(c->GetLabel(1)) || lab == TMath::Abs(c->GetLabel(2))) max++; } if (max >= Int_t(0.5*tail)) SetLabel(lab); } delete[] lb; delete[] mx; delete[] clusters; } //____________________________________________________________________________ void AliTPCtrack::Streamer(TBuffer &R__b) { //----------------------------------------------------- // This is AliTPCtrack streamer. //----------------------------------------------------- if (R__b.IsReading()) { Version_t R__v = R__b.ReadVersion(); if (R__v) { } TObject::Streamer(R__b); R__b >> fLab; R__b >> fChi2; R__b >> fdEdx; R__b >> fAlpha; R__b >> fX; R__b >> fY; R__b >> fZ; R__b >> fC; R__b >> fE; R__b >> fT; R__b >> fCyy; R__b >> fCzy; R__b >> fCzz; R__b >> fCcy; R__b >> fCcz; R__b >> fCcc; R__b >> fCey; R__b >> fCez; R__b >> fCec; R__b >> fCee; R__b >> fCty; R__b >> fCtz; R__b >> fCtc; R__b >> fCte; R__b >> fCtt; R__b >> fN; for (Int_t i=0; i> fIndex[i]; } else { R__b.WriteVersion(AliTPCtrack::IsA()); TObject::Streamer(R__b); R__b << fLab; R__b << fChi2; R__b << fdEdx; R__b << fAlpha; R__b << fX; R__b << fY; R__b << fZ; R__b << fC; R__b << fE; R__b << fT; R__b << fCyy; R__b << fCzy; R__b << fCzz; R__b << fCcy; R__b << fCcz; R__b << fCcc; R__b << fCey; R__b << fCez; R__b << fCec; R__b << fCee; R__b << fCty; R__b << fCtz; R__b << fCtc; R__b << fCte; R__b << fCtt; R__b << fN; for (Int_t i=0; i