/************************************************************************** * 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. * **************************************************************************/ /* $Id$ */ //------------------------------------------------------------------------- // Implementation of the AliKalmanTrack class // that is the base for AliTPCtrack, AliITStrackV2 and AliTRDtrack // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch //------------------------------------------------------------------------- #include #include #include "AliKalmanTrack.h" #include "AliCluster3D.h" ClassImp(AliKalmanTrack) //_______________________________________________________________________ AliKalmanTrack::AliKalmanTrack():AliExternalTrackParam(), fLab(-3141593), fFakeRatio(0), fChi2(0), fMass(AliPID::ParticleMass(AliPID::kPion)), fN(0), fStartTimeIntegral(kFALSE), fIntegratedLength(0) { // // Default constructor // for(Int_t i=0; iGetX(), GetY() - c->GetY(), GetZ() - c->GetZ() }; Double_t f=GetSnp(); if (TMath::Abs(f) >= kAlmost1) return kVeryBig; Double_t r=TMath::Sqrt(1.- f*f); Double_t a=f/r, b=GetTgl()/r; Double_t s2=333.*333.; //something reasonably big (cm^2) TMatrixDSym v(3); v(0,0)= s2; v(0,1)= a*s2; v(0,2)= b*s2;; v(1,0)=a*s2; v(1,1)=a*a*s2 + GetSigmaY2(); v(1,2)=a*b*s2 + GetSigmaZY(); v(2,0)=b*s2; v(2,1)=a*b*s2 + GetSigmaZY(); v(2,2)=b*b*s2 + GetSigmaZ2(); v(0,0)+=c->GetSigmaX2(); v(0,1)+=c->GetSigmaXY(); v(0,2)+=c->GetSigmaXZ(); v(1,0)+=c->GetSigmaXY(); v(1,1)+=c->GetSigmaY2(); v(1,2)+=c->GetSigmaYZ(); v(2,0)+=c->GetSigmaXZ(); v(2,1)+=c->GetSigmaYZ(); v(2,2)+=c->GetSigmaZ2(); v.Invert(); if (!v.IsValid()) return kVeryBig; Double_t chi2=0.; for (Int_t i = 0; i < 3; i++) for (Int_t j = 0; j < 3; j++) chi2 += res[i]*res[j]*v(i,j); return chi2; } //_______________________________________________________________________ void AliKalmanTrack::StartTimeIntegral() { // Sylwester Radomski, GSI // S.Radomski@gsi.de // // Start time integration // To be called at Vertex by ITS tracker // //if (fStartTimeIntegral) // AliWarning("Reseting Recorded Time."); fStartTimeIntegral = kTRUE; for(Int_t i=0; i 100) return; for (Int_t i=0; iInitTrack(start, dir); // printf("%s length=%f\n",gGeoManager->GetPath(),length); if (!startnode) { printf("ERROR: start point out of geometry\n"); return 0.0; } TGeoMaterial *material = startnode->GetVolume()->GetMedium()->GetMaterial(); lparam[0] = material->GetDensity(); lparam[1] = material->GetRadLen(); lparam[2] = material->GetA(); lparam[3] = material->GetZ(); lparam[4] = length; lparam[5] = lparam[3]/lparam[2]; if (material->IsMixture()) { lparam[1]*=lparam[0]; // different normalization in the modeler for mixture TGeoMixture * mixture = (TGeoMixture*)material; lparam[5] =0; Double_t sum =0; for (Int_t iel=0;ielGetNelements();iel++){ sum += mixture->GetWmixt()[iel]; lparam[5]+= mixture->GetZmixt()[iel]*mixture->GetWmixt()[iel]/mixture->GetAmixt()[iel]; } lparam[5]/=sum; } gGeoManager->FindNextBoundary(length); Double_t snext = gGeoManager->GetStep(); Double_t step = 0.0; // If no boundary within proposed length, return current density if (snext>=length) { for (Int_t ip=0;ip<5;ip++) mparam[ip] = lparam[ip]; return lparam[0]; } // Try to cross the boundary and see what is next while (length>TGeoShape::Tolerance()) { mparam[6]+=1.; currentnode = gGeoManager->Step(); step += snext+1.E-6; bparam[1] += snext*lparam[1]; bparam[2] += snext*lparam[2]; bparam[3] += snext*lparam[3]; bparam[5] += snext*lparam[5]; bparam[0] += snext*lparam[0]; if (snext>=length) break; if (!currentnode) break; // printf("%s snext=%f density=%f bparam[0]=%f\n", gGeoManager->GetPath(),snext,density,bparam[0]); if (!gGeoManager->IsEntering()) { gGeoManager->SetStep(1.E-3); currentnode = gGeoManager->Step(); if (!gGeoManager->IsEntering() || !currentnode) { // printf("ERROR: cannot cross boundary\n"); mparam[0] = bparam[0]/step; mparam[1] = bparam[1]/step; mparam[2] = bparam[2]/step; mparam[3] = bparam[3]/step; mparam[5] = bparam[5]/step; mparam[4] = step; mparam[0] = 0.; // if crash of navigation take mean density 0 mparam[1] = 1000000; // and infinite rad length return bparam[0]/step; } step += 1.E-3; snext += 1.E-3; bparam[0] += lparam[0]*1.E-3; bparam[1] += lparam[1]*1.E-3; bparam[2] += lparam[2]*1.E-3; bparam[3] += lparam[3]*1.E-3; bparam[5] += lparam[5]*1.E-3; } length -= snext; material = currentnode->GetVolume()->GetMedium()->GetMaterial(); lparam[0] = material->GetDensity(); lparam[1] = material->GetRadLen(); lparam[2] = material->GetA(); lparam[3] = material->GetZ(); lparam[5] = lparam[3]/lparam[2]; if (material->IsMixture()) { lparam[1]*=lparam[0]; TGeoMixture * mixture = (TGeoMixture*)material; lparam[5]=0; Double_t sum =0; for (Int_t iel=0;ielGetNelements();iel++){ sum+= mixture->GetWmixt()[iel]; lparam[5]+= mixture->GetZmixt()[iel]*mixture->GetWmixt()[iel]/mixture->GetAmixt()[iel]; } lparam[5]/=sum; } gGeoManager->FindNextBoundary(length); snext = gGeoManager->GetStep(); } mparam[0] = bparam[0]/step; mparam[1] = bparam[1]/step; mparam[2] = bparam[2]/step; mparam[3] = bparam[3]/step; mparam[5] = bparam[5]/step; return bparam[0]/step; }