/************************************************************************** * 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/10/06 16:49:46 cblume Made Getters const Revision 1.1.2.1 2000/09/22 14:47:52 cblume Add the tracking code */ #include #include #include "AliTRD.h" #include "AliTRDgeometry.h" #include "AliTRDcluster.h" #include "AliTRDtrack.h" ClassImp(AliTRDtrack) //_____________________________________________________________________________ AliTRDtrack::AliTRDtrack(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; } //_____________________________________________________________________________ AliTRDtrack::AliTRDtrack(const AliTRDtrack& t) { // // 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()*12; 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.) { if (fN>4) cerr<GetSigmaY2(), r01=0., r11=c->GetSigmaZ2()*12; 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 AliTRDtrack::GetPxPyPz(Double_t& px, Double_t& py, Double_t& pz) const { // 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 AliTRDtrack::Streamer(TBuffer &R__b) { 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(AliTRDtrack::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; iGetNclusters(); Int_t swap;//stupid sorting do { swap=0; for (i=0; i