47 #include <Riostream.h>
50 #include <TClonesArray.h>
80 TClonesArray *segments;
86 AliDebug(1,
"Enter MakeTrackCandidates");
89 Int_t firstChamber(0);
98 for (Int_t i = firstChamber; i <= lastChamber; ++i )
104 for (Int_t istat=4; istat>=3; istat--) {
110 for (Int_t iSegment=0; iSegment<segments->GetEntriesFast(); iSegment++) {
111 AliDebug(1,Form(
"Making primary candidate(1..) %d",++iCandidate));
129 AliError(Form(
"Too many track candidates (%d tracks). Stop tracking.",
fNRecTracks));
134 AliError(Form(
"Too many track candidates (%d tracks). Stop tracking.",
fNRecTracks + segments->GetEntriesFast() - iSegment - 1));
143 AliDebug(1,Form(
"Number of candidates before cleaning = %d",
fNRecTracks));
150 for (Int_t iRecTrack = 0; iRecTrack < nCurrentTracks; iRecTrack++) {
168 AliDebug(1,Form(
"Number of good candidates = %d",
fNRecTracks));
183 TClonesArray *segments;
186 Int_t iCandidate = 0, iCurrentTrack, nCurrentTracks;
190 AliDebug(1,
"Enter MakeMoreTrackCandidates");
193 for (Int_t ich1 = 6; ich1 <= 7; ich1++) {
194 for (Int_t ich2 = 8; ich2 <= 9; ich2++) {
203 for (Int_t iSegment=0; iSegment<segments->GetEntriesFast(); iSegment++) {
204 AliDebug(1,Form(
"Making primary candidate(1..) %d",++iCandidate));
216 if (
GetRecoParam()->TrackAllTracks() && clusterFound) iCurrentTrack++;
220 while (iCurrentTrack < nCurrentTracks) {
231 AliError(Form(
"Too many track candidates (%d tracks). Stop tracking.",
fNRecTracks + segments->GetEntriesFast() - iSegment - 1));
240 AliDebug(1,Form(
"Number of candidates before cleaning = %d",
fNRecTracks));
244 for (Int_t iRecTrack = initialNRecTracks; iRecTrack < nCurrentTracks; iRecTrack++) {
262 AliDebug(1,Form(
"Number of good candidates = %d",
fNRecTracks));
273 AliDebug(1,
"Enter RetraceTrack");
282 Double_t x2 = cluster2->
GetX();
283 Double_t y2 = cluster2->
GetY();
284 Double_t z2 = cluster2->
GetZ();
294 Double_t x1 = cluster1->
GetX();
295 Double_t y1 = cluster1->
GetY();
296 Double_t z1 = cluster1->
GetZ();
299 Double_t
dZ = z1 - z2;
302 lastTrackParam->
SetZ(z2);
310 TMatrixD lastParamCov(5,5);
313 lastParamCov(0,0) = cluster2->
GetErrX2();
314 lastParamCov(0,1) = - cluster2->
GetErrX2() /
dZ;
315 lastParamCov(1,0) = lastParamCov(0,1);
316 lastParamCov(1,1) = ( 1000. * cluster1->
GetErrX2() + cluster2->
GetErrX2() ) / dZ / dZ;
318 lastParamCov(2,2) = cluster2->
GetErrY2();
319 lastParamCov(2,3) = - cluster2->
GetErrY2() /
dZ;
320 lastParamCov(3,2) = lastParamCov(2,3);
321 lastParamCov(3,3) = ( 1000. * cluster1->
GetErrY2() + cluster2->
GetErrY2() ) / dZ / dZ;
326 (z1 * z1 * cluster2->
GetErrY2() + z2 * z2 * 1000. * cluster1->
GetErrY2()) / dZ / dZ) /
327 bendingImpact / bendingImpact + 0.1 * 0.1) * inverseBendingMomentum * inverseBendingMomentum;
328 lastParamCov(2,4) = z1 * cluster2->
GetErrY2() * inverseBendingMomentum / bendingImpact /
dZ;
329 lastParamCov(4,2) = lastParamCov(2,4);
330 lastParamCov(3,4) = - (z1 * cluster2->
GetErrY2() + z2 * 1000. * cluster1->
GetErrY2()) *
331 inverseBendingMomentum / bendingImpact / dZ / dZ;
332 lastParamCov(4,3) = lastParamCov(3,4);
333 }
else lastParamCov(4,4) = inverseBendingMomentum*inverseBendingMomentum;
351 AliDebug(1,
"Enter RetracePartialTrack");
354 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
355 cout <<
"RetracePartialTrack: track chi2 before re-tracking: " << trackCandidate.
GetGlobalChi2() << endl;
362 Bool_t extrapStatus = kTRUE;
364 Int_t currentChamber;
365 Double_t addChi2TrackAtCluster;
367 while (trackParamAtCluster) {
371 trackParamAtCluster->
SetZ(startingTrackParam->
GetZ());
382 while (currentChamber < expectedChamber) {
411 expectedChamber = currentChamber - 1;
412 startingTrackParam = trackParamAtCluster;
417 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
418 cout <<
"RetracePartialTrack: track chi2 after re-tracking: " << trackCandidate.
GetGlobalChi2() << endl;
431 AliDebug(1,
"Enter FollowTracks");
434 Int_t currentNRecTracks;
436 for (Int_t station = 2; station >= 0; station--) {
443 for (Int_t iRecTrack = 0; iRecTrack <currentNRecTracks; iRecTrack++) {
444 AliDebug(1,Form(
"FollowTracks: track candidate(1..) %d", iRecTrack+1));
479 AliError(Form(
"Too many track candidates (%d tracks). Stop tracking.",
fNRecTracks));
484 AliError(Form(
"Too many track candidates (%d tracks). Stop tracking.",
fNRecTracks + currentNRecTracks - iRecTrack - 1));
493 AliDebug(1,Form(
"In stations(1..) %d: Number of candidates before cleaning = %d",station+1,
fNRecTracks));
498 AliDebug(1,Form(
"In stations(1..) %d: Number of good candidates = %d",station+1,
fNRecTracks));
516 AliDebug(1,Form(
"Enter FollowTrackInChamber(1..) %d", nextChamber+1));
518 Double_t chi2OfCluster;
521 Double_t addChi2TrackAtCluster;
523 Bool_t foundOneCluster = kFALSE;
535 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 2) || (AliLog::GetGlobalDebugLevel() >= 2)) {
536 cout<<endl<<
"Track parameters and covariances at first cluster:"<<endl;
549 while (currentChamber > nextChamber + 1) {
563 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 2) || (AliLog::GetGlobalDebugLevel() >= 2)) {
570 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
571 cout <<
"FollowTrackInChamber: look for clusters in chamber(1..): " << nextChamber+1 << endl;
584 while ( ( cluster = static_cast<AliMUONVCluster*>(next()) ) ) {
590 chi2OfCluster =
TryOneCluster(extrapTrackParamAtCh, cluster, extrapTrackParamAtCluster,
594 if (chi2OfCluster < maxChi2OfCluster) {
611 foundOneCluster = kTRUE;
614 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
615 cout <<
"FollowTrackInChamber: found one cluster in chamber(1..): " << nextChamber+1
616 <<
" (Chi2 = " << chi2OfCluster <<
")" << endl;
623 UpdateTrack(*newTrack,extrapTrackParamAtCluster,addChi2TrackAtCluster);
627 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
628 cout <<
"FollowTrackInChamber: added one cluster in chamber(1..): " << nextChamber+1 << endl;
629 if (AliLog::GetGlobalDebugLevel() >= 3) newTrack->
RecursiveDump();
632 }
else if (addChi2TrackAtCluster < bestAddChi2TrackAtCluster) {
634 bestAddChi2TrackAtCluster = addChi2TrackAtCluster;
635 bestTrackParamAtCluster = extrapTrackParamAtCluster;
644 if (foundOneCluster) {
645 UpdateTrack(trackCandidate,bestTrackParamAtCluster,bestAddChi2TrackAtCluster);
648 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
649 cout <<
"FollowTrackInChamber: added the best cluster in chamber(1..): " << bestTrackParamAtCluster.
GetClusterPtr()->
GetChamberId()+1 << endl;
650 if (AliLog::GetGlobalDebugLevel() >= 3) trackCandidate.
RecursiveDump();
653 }
else return kFALSE;
655 }
else if (foundOneCluster) {
661 }
else return kFALSE;
677 AliDebug(1,Form(
"Enter FollowTrackInStation(1..) %d", nextStation+1));
683 if (nextStation==4) {
684 ch1 = 2*nextStation+1;
688 ch2 = 2*nextStation+1;
691 Double_t chi2OfCluster;
694 Double_t addChi2TrackAtCluster1;
695 Double_t addChi2TrackAtCluster2;
698 Bool_t foundOneCluster = kFALSE;
699 Bool_t foundTwoClusters = kFALSE;
714 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 2) || (AliLog::GetGlobalDebugLevel() >= 2)) {
715 cout<<endl<<
"Track parameters and covariances at first cluster:"<<endl;
728 while (ch1 < ch2 && currentChamber > ch2 + 1) {
742 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 2) || (AliLog::GetGlobalDebugLevel() >= 2)) {
749 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
750 cout <<
"FollowTrackInStation: look for clusters in chamber(1..): " << ch2+1 << endl;
759 Int_t nClusters = clusterStore.
GetSize();
760 Bool_t *clusterCh1Used =
new Bool_t[nClusters];
761 for (Int_t i = 0; i < nClusters; i++) clusterCh1Used[i] = kFALSE;
769 while ( ( clusterCh2 = static_cast<AliMUONVCluster*>(nextInCh2()) ) ) {
775 chi2OfCluster =
TryOneCluster(extrapTrackParamAtCh, clusterCh2, extrapTrackParamAtCluster2,
779 if (chi2OfCluster < maxChi2OfCluster) {
793 if (!
IsAcceptable(extrapTrackParamAtCluster2))
continue;
796 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
797 cout <<
"FollowTrackInStation: found one cluster in chamber(1..): " << ch2+1
798 <<
" (Chi2 = " << chi2OfCluster <<
")" << endl;
800 cout <<
" look for second clusters in chamber(1..): " << ch1+1 <<
" ..." << endl;
804 extrapTrackParam = extrapTrackParamAtCluster2;
821 Bool_t foundSecondCluster = kFALSE;
822 if (normalExtrap)
while ( ( clusterCh1 = static_cast<AliMUONVCluster*>(nextInCh1()) ) ) {
829 chi2OfCluster =
TryOneCluster(extrapTrackParam, clusterCh1, extrapTrackParamAtCluster1,
833 if (chi2OfCluster < maxChi2OfCluster) {
847 if (!
IsAcceptable(extrapTrackParamAtCluster1))
continue;
850 foundSecondCluster = kTRUE;
851 foundTwoClusters = kTRUE;
854 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
855 cout <<
"FollowTrackInStation: found one cluster in chamber(1..): " << ch1+1
856 <<
" (Chi2 = " << chi2OfCluster <<
")" << endl;
863 UpdateTrack(*newTrack,extrapTrackParamAtCluster1,extrapTrackParamAtCluster2,addChi2TrackAtCluster1,addChi2TrackAtCluster2);
867 clusterCh1Used[iCluster1] = kTRUE;
870 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
871 cout <<
"FollowTrackInStation: added two clusters in station(1..): " << nextStation+1 << endl;
872 if (AliLog::GetGlobalDebugLevel() >= 3) newTrack->
RecursiveDump();
875 }
else if (addChi2TrackAtCluster1+addChi2TrackAtCluster2 < bestAddChi2TrackAtCluster1+bestAddChi2TrackAtCluster2) {
877 bestAddChi2TrackAtCluster1 = addChi2TrackAtCluster1;
878 bestAddChi2TrackAtCluster2 = addChi2TrackAtCluster2;
879 bestTrackParamAtCluster1 = extrapTrackParamAtCluster1;
880 bestTrackParamAtCluster2 = extrapTrackParamAtCluster2;
888 if (!foundSecondCluster) {
891 foundOneCluster = kTRUE;
896 UpdateTrack(*newTrack,extrapTrackParamAtCluster2,addChi2TrackAtCluster2);
900 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
901 cout <<
"FollowTrackInStation: added one cluster in chamber(1..): " << ch2+1 << endl;
902 if (AliLog::GetGlobalDebugLevel() >= 3) newTrack->
RecursiveDump();
905 }
else if (!foundTwoClusters && addChi2TrackAtCluster2 < bestAddChi2TrackAtCluster1) {
907 bestAddChi2TrackAtCluster1 = addChi2TrackAtCluster2;
908 bestTrackParamAtCluster1 = extrapTrackParamAtCluster2;
919 if (
GetRecoParam()->TrackAllTracks() || !foundTwoClusters) {
929 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 2) || (AliLog::GetGlobalDebugLevel() >= 2)) {
936 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
937 cout <<
"FollowTrackInStation: look for single clusters in chamber(1..): " << ch1+1 << endl;
945 if (normalExtrap)
while ( ( clusterCh1 = static_cast<AliMUONVCluster*>(nextInCh1()) ) ) {
948 if (clusterCh1Used[iCluster1])
continue;
954 chi2OfCluster =
TryOneCluster(extrapTrackParamAtCh, clusterCh1, extrapTrackParamAtCluster1,
959 if (chi2OfCluster < maxChi2OfCluster) {
973 if (!
IsAcceptable(extrapTrackParamAtCluster1))
continue;
976 foundOneCluster = kTRUE;
979 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
980 cout <<
"FollowTrackInStation: found one cluster in chamber(1..): " << ch1+1
981 <<
" (Chi2 = " << chi2OfCluster <<
")" << endl;
988 UpdateTrack(*newTrack,extrapTrackParamAtCluster1,addChi2TrackAtCluster1);
992 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
993 cout <<
"FollowTrackInStation: added one cluster in chamber(1..): " << ch1+1 << endl;
994 if (AliLog::GetGlobalDebugLevel() >= 3) newTrack->
RecursiveDump();
997 }
else if (addChi2TrackAtCluster1 < bestAddChi2TrackAtCluster1) {
999 bestAddChi2TrackAtCluster1 = addChi2TrackAtCluster1;
1000 bestTrackParamAtCluster1 = extrapTrackParamAtCluster1;
1011 if (foundTwoClusters) {
1012 UpdateTrack(trackCandidate,bestTrackParamAtCluster1,bestTrackParamAtCluster2,bestAddChi2TrackAtCluster1,bestAddChi2TrackAtCluster2);
1015 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
1016 cout <<
"FollowTrackInStation: added the two best clusters in station(1..): " << nextStation+1 << endl;
1017 if (AliLog::GetGlobalDebugLevel() >= 3) trackCandidate.
RecursiveDump();
1020 }
else if (foundOneCluster) {
1021 UpdateTrack(trackCandidate,bestTrackParamAtCluster1,bestAddChi2TrackAtCluster1);
1024 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
1025 cout <<
"FollowTrackInStation: added the best cluster in chamber(1..): " << bestTrackParamAtCluster1.
GetClusterPtr()->
GetChamberId()+1 << endl;
1026 if (AliLog::GetGlobalDebugLevel() >= 3) trackCandidate.
RecursiveDump();
1030 delete [] clusterCh1Used;
1034 }
else if (foundOneCluster || foundTwoClusters) {
1041 delete [] clusterCh1Used;
1045 delete [] clusterCh1Used;
1055 AliDebug(1,
"Enter RunKalmanFilter");
1062 TMatrixD clusterParam(5,1);
1063 clusterParam.Zero();
1064 clusterParam(0,0) = cluster->GetX();
1065 clusterParam(2,0) = cluster->GetY();
1069 if (paramWeight.Determinant() != 0) {
1070 paramWeight.Invert();
1072 AliWarning(
" Determinant = 0");
1077 TMatrixD clusterWeight(5,5);
1078 clusterWeight.Zero();
1079 clusterWeight(0,0) = 1. / cluster->GetErrX2();
1080 clusterWeight(2,2) = 1. / cluster->GetErrY2();
1083 TMatrixD newParamCov(paramWeight,TMatrixD::kPlus,clusterWeight);
1084 if (newParamCov.Determinant() != 0) {
1085 newParamCov.Invert();
1087 AliWarning(
" Determinant = 0");
1095 TMatrixD tmp(clusterParam,TMatrixD::kMinus,param);
1096 TMatrixD tmp2(clusterWeight,TMatrixD::kMult,tmp);
1097 TMatrixD newParam(newParamCov,TMatrixD::kMult,tmp2);
1106 TMatrixD tmp3(paramWeight,TMatrixD::kMult,tmp);
1107 TMatrixD addChi2Track(tmp,TMatrixD::kTransposeMult,tmp3);
1109 tmp -= clusterParam;
1110 TMatrixD tmp4(clusterWeight,TMatrixD::kMult,tmp);
1111 addChi2Track += TMatrixD(tmp,TMatrixD::kTransposeMult,tmp4);
1113 return addChi2Track(0,0);
1142 Double_t addChi2AtCluster1, Double_t addChi2AtCluster2)
1151 Double_t localChi2AtCluster1 = deltaX*deltaX / cluster1->
GetErrX2() +
1152 deltaY*deltaY / cluster1->
GetErrY2();
1153 trackParamAtCluster1.
SetLocalChi2(localChi2AtCluster1);
1164 Double_t localChi2AtCluster2 = deltaX*deltaX / cluster2->
GetErrX2() +
1165 deltaY*deltaY / cluster2->
GetErrY2();
1166 trackParamAtCluster2.
SetLocalChi2(localChi2AtCluster2);
1192 AliDebug(1,
"Enter RecoverTrack");
1195 if (nextStation > 1)
return kFALSE;
1197 Int_t worstClusterNumber = -1;
1198 Double_t localChi2, worstLocalChi2 = -1.;
1201 for (Int_t clusterNumber = 0; clusterNumber < 2; clusterNumber++) {
1208 if (!trackParamAtCluster->
IsRemovable())
return kFALSE;
1215 if (localChi2 > worstLocalChi2) {
1216 worstLocalChi2 = localChi2;
1217 worstClusterNumber = clusterNumber;
1222 if (worstClusterNumber < 0)
return kFALSE;
1242 AliDebug(1,
"Enter UseSmoother");
1263 while (currentTrackParam) {
1267 const TMatrixD &filteredParameters = currentTrackParam->
GetParameters();
1269 const TMatrixD &propagator = previousTrackParam->
GetPropagator();
1271 const TMatrixD &filteredCovariances = currentTrackParam->
GetCovariances();
1275 TMatrixD extrapWeight(extrapCovariances);
1276 if (extrapWeight.Determinant() != 0) {
1277 extrapWeight.Invert();
1279 AliWarning(
" Determinant = 0");
1282 TMatrixD smootherGain(filteredCovariances,TMatrixD::kMultTranspose,propagator);
1283 smootherGain *= extrapWeight;
1286 TMatrixD tmpParam(previousSmoothParameters,TMatrixD::kMinus,extrapParameters);
1287 TMatrixD smoothParameters(smootherGain,TMatrixD::kMult,tmpParam);
1288 smoothParameters += filteredParameters;
1294 TMatrixD tmpCov(previousSmoothCovariances,TMatrixD::kMinus,extrapCovariances);
1295 TMatrixD tmpCov2(tmpCov,TMatrixD::kMultTranspose,smootherGain);
1296 TMatrixD smoothCovariances(smootherGain,TMatrixD::kMult,tmpCov2);
1297 smoothCovariances += filteredCovariances;
1304 TMatrixD smoothResidual(2,1);
1305 smoothResidual.Zero();
1306 smoothResidual(0,0) = cluster->
GetX() - smoothParameters(0,0);
1307 smoothResidual(1,0) = cluster->
GetY() - smoothParameters(2,0);
1310 TMatrixD smoothResidualWeight(2,2);
1311 smoothResidualWeight(0,0) = cluster->
GetErrX2() - smoothCovariances(0,0);
1312 smoothResidualWeight(0,1) = - smoothCovariances(0,2);
1313 smoothResidualWeight(1,0) = - smoothCovariances(2,0);
1314 smoothResidualWeight(1,1) = cluster->
GetErrY2() - smoothCovariances(2,2);
1315 if (smoothResidualWeight.Determinant() != 0) {
1316 smoothResidualWeight.Invert();
1318 AliWarning(
" Determinant = 0");
1323 TMatrixD tmpChi2(smoothResidual,TMatrixD::kTransposeMult,smoothResidualWeight);
1324 TMatrixD localChi2(tmpChi2,TMatrixD::kMult,smoothResidual);
1329 previousTrackParam = currentTrackParam;
1345 AliDebug(1,
"Enter ComplementTracks");
1347 Int_t chamberId, detElemId;
1348 Double_t chi2OfCluster, addChi2TrackAtCluster, bestAddChi2TrackAtCluster;
1351 Bool_t foundOneCluster, trackModified, hasChanged = kFALSE;
1353 AliMUONTrackParam *trackParam, *previousTrackParam, *nextTrackParam, trackParamAtCluster, bestTrackParamAtCluster;
1358 trackModified = kFALSE;
1361 previousTrackParam = trackParam;
1362 while (trackParam) {
1363 foundOneCluster = kFALSE;
1375 while ( ( cluster = static_cast<AliMUONVCluster*>(nextInCh()) ) ) {
1385 if (nextTrackParam) chi2OfCluster =
TryOneCluster(*trackParam, cluster, trackParamAtCluster);
1386 else chi2OfCluster =
TryOneCluster(*previousTrackParam, cluster, trackParamAtCluster);
1389 if (chi2OfCluster < maxChi2OfCluster) {
1395 if (addChi2TrackAtCluster < bestAddChi2TrackAtCluster) {
1396 bestAddChi2TrackAtCluster = addChi2TrackAtCluster;
1397 bestTrackParamAtCluster = trackParamAtCluster;
1398 foundOneCluster = kTRUE;
1406 if (foundOneCluster) {
1409 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
1410 cout <<
"ComplementTracks: found one cluster in chamber(1..): " << chamberId+1 << endl;
1412 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 2) || (AliLog::GetGlobalDebugLevel() >= 2)) {
1413 cout<<endl<<
"Track parameters and covariances at cluster:"<<endl;
1422 trackModified = kTRUE;
1426 previousTrackParam = trackParam;
1427 trackParam = nextTrackParam;
1435 AliWarning(
"track modified but problem occur during refitting --> remove track");
1454 AliDebug(1,
"Enter ImproveTrack");
1456 Double_t localChi2, worstLocalChi2;
1457 AliMUONTrackParam *trackParamAtCluster, *worstTrackParamAtCluster, *nextTrackParam, *next2nextTrackParam;
1458 Int_t nextChamber, next2nextChamber;
1477 AliWarning(
"unable to update track parameters and covariances --> stop improvement");
1488 worstTrackParamAtCluster = 0x0;
1489 worstLocalChi2 = -1.;
1491 while (trackParamAtCluster) {
1501 if (localChi2 > worstLocalChi2) {
1502 worstLocalChi2 = localChi2;
1503 worstTrackParamAtCluster = trackParamAtCluster;
1510 if (worstLocalChi2 < 2. * sigmaCut2) {
1532 Bool_t normalExtrap;
1533 if (smoothed && nextTrackParam) {
1536 next2nextTrackParam = nextTrackParam;
1542 }
while (next2nextTrackParam && (next2nextChamber == nextChamber));
1544 if (next2nextChamber == nextChamber) normalExtrap =
RetraceTrack(track,kTRUE);
1550 if (!normalExtrap) {
1551 AliWarning(
"track partially improved but problem occur during refitting --> stop improvement");
1556 if ((AliLog::GetDebugLevel(
"MUON",
"AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
1557 cout <<
"ImproveTracks: track " <<
fRecTracksPtr->IndexOf(&track)+1 <<
" improved " << endl;
1572 Bool_t smoothed = kFALSE;
1581 AliWarning(
"finalization failed due to extrapolation problem");
1591 while (trackParamAtCluster) {
1609 AliDebug(1,
"Enter RefitTrack");
1613 AliWarning(
"the track is not valid --> unable to refit");
1619 AliWarning(
"bad track refitting due to extrapolation failure");
1630 AliWarning(
"track not finalized due to extrapolation failure");
void AskForNewClustersInStation(const AliMUONTrackParam &trackParam, AliMUONVClusterStore &clusterStore, Int_t station)
Bool_t FollowLinearTrackInStation(AliMUONTrack &trackCandidate, const AliMUONVClusterStore &clusterStore, Int_t nextStation)
void SetSmoothParameters(const TMatrixD ¶meters)
Virtual class for the MUON track reconstruction.
void RemoveTrackParamAtCluster(AliMUONTrackParam *trackParam)
Int_t GetNClusters() const
return the number of clusters attached to the track
virtual Int_t Clusterize(Int_t chamberId, AliMUONVClusterStore &clusterStore, const AliMpArea &area, const AliMUONRecoParam *recoParam=0x0)=0
Find and add clusters from a given region of a given chamber to the store.
Double_t GetLocalChi2() const
return the local chi2 of the associated cluster with respect to the track
Double_t GetSigmaCutForTracking() const
return the cut in sigma to apply on cluster (local chi2) and track (global chi2) during tracking ...
virtual Double_t GetZ() const =0
Return coordinate Z (cm)
const TMatrixD & GetSmoothCovariances() const
Double_t GetBendingCoor() const
return bending coordinate (cm)
Double_t TryOneCluster(const AliMUONTrackParam &trackParam, AliMUONVCluster *cluster, AliMUONTrackParam &trackParamAtCluster, Bool_t updatePropagator=kFALSE)
const TMatrixD & GetParameters() const
return track parameters
void RemoveUsedSegments(TClonesArray &segments)
virtual Bool_t FollowTracks(AliMUONVClusterStore &clusterStore)
Follow tracks in stations(1..) 3, 2 and 1.
Interface of a cluster finder for combined tracking.
Bool_t RecoverTrack(AliMUONTrack &track, AliMUONVClusterStore &clusterStore, Int_t nextStation)
void RemoveIdenticalTracks()
virtual Int_t GetSize() const =0
The number of objects stored.
Double_t RunKalmanFilter(AliMUONTrackParam &trackParamAtCluster)
Double_t GetZ() const
return Z coordinate (cm)
const TMatrixD & GetExtrapCovariances() const
A rectangle area positioned in plane..
Track parameters in ALICE dimuon spectrometer.
Bool_t FollowTrackInChamber(AliMUONTrack &trackCandidate, AliMUONVClusterStore &clusterStore, Int_t nextChamber)
virtual Bool_t RefitTrack(AliMUONTrack &track, Bool_t enableImprovement=kTRUE)
Re-fit the given track.
Class with MUON reconstruction parameters.
Bool_t IsAcceptable(AliMUONTrackParam &trackParam)
virtual Double_t GetErrX2() const =0
Return resolution**2 (cm**2) on coordinate X.
void SetNonBendingCoor(Double_t nonBendingCoor)
set non bending coordinate (cm)
void SetLocalChi2(Double_t chi2)
set the local chi2 of the associated cluster with respect to the track
Bool_t RetracePartialTrack(AliMUONTrack &trackCandidate, const AliMUONTrackParam *startingTrackParam)
Bool_t TryOneClusterFast(const AliMUONTrackParam &trackParam, const AliMUONVCluster *cluster)
Bool_t ComputeLocalChi2(Bool_t accountForMCS)
Class for the MUON track reconstruction using kalman filter.
void SetExtrapParameters(const TMatrixD ¶meters)
void AskForNewClustersInChamber(const AliMUONTrackParam &trackParam, AliMUONVClusterStore &clusterStore, Int_t chamber)
Bool_t IsValid(UInt_t requestedStationMask, Bool_t request2ChInSameSt45=kFALSE)
Double_t GetBendingVertexDispersion() const
return the vertex dispersion (cm) in bending plane
Bool_t UpdateCovTrackParamAtCluster()
const AliMUONRecoParam * GetRecoParam() const
Return reco parameters.
Int_t GetMaxTrackCandidates() const
Get the maximum number of track candidates above which the tracking abort.
virtual void Print(Option_t *option="") const
void UseSmoother(Bool_t flag)
switch on/off the use of the smoother
Double_t GetBendingSlope() const
return bending slope (cm ** -1)
void SetSmoothCovariances(const TMatrixD &covariances)
void SetBendingSlope(Double_t bendingSlope)
set bending slope (cm ** -1)
virtual void ImproveTrack(AliMUONTrack &track)
Improve the given reconstructed track.
abstract base class for clusters
AliMUONVClusterServer * fClusterServer
reference to our cluster server
void SetImproved(Bool_t improved)
set the flag telling whether the track has been improved or not
Double_t GetGlobalChi2() const
return the minimum value of the function minimized by the fit
void SetExtrapCovariances(const TMatrixD &covariances)
Bool_t FollowLinearTrackInChamber(AliMUONTrack &trackCandidate, const AliMUONVClusterStore &clusterStore, Int_t nextChamber)
void AddTrackParamAtCluster(const AliMUONTrackParam &trackParam, AliMUONVCluster &cluster, Bool_t copy=kFALSE)
const TMatrixD & GetSmoothParameters() const
Bool_t IsRemovable() const
return kTRUE if the associated cluster can be removed from the track it belongs to ...
virtual ~AliMUONTrackReconstructorK()
TClonesArray * MakeSegmentsBetweenChambers(const AliMUONVClusterStore &clusterStore, Int_t ch1, Int_t ch2)
Interface of a cluster container.
virtual TIterator * CreateChamberIterator(Int_t firstChamberId, Int_t lastChamberId) const =0
Return an iterator to loop over the store in the given chamber range.
void SetNonBendingSlope(Double_t nonBendingSlope)
set non bending slope (cm ** -1)
virtual Bool_t FinalizeTrack(AliMUONTrack &track)
Finalize the given track.
Double_t GetTrackChi2() const
return the chi2 of the track when the associated cluster was attached
virtual Bool_t MakeMoreTrackCandidates(AliMUONVClusterStore &clusterStore)
Make extra track candidates from clusters in stations(1..) 4 and 5.
const TMatrixD & GetExtrapParameters() const
virtual Double_t GetErrY2() const =0
Return resolution**2 (cm**2) on coordinate Y.
Bool_t RunSmoother(AliMUONTrack &track)
Bool_t RetraceTrack(AliMUONTrack &trackCandidate, Bool_t resetSeed)
void SetParameters(const TMatrixD ¶meters)
set track parameters
static Int_t GetChamberId(UInt_t uniqueID)
Return chamber id (0..), part of the uniqueID.
void SetInverseBendingMomentum(Double_t inverseBendingMomentum)
set inverse bending momentum (GeV/c ** -1) times the charge (assumed forward motion) ...
virtual Double_t GetY() const =0
Return coordinate Y (cm)
void MakeTrackCandidatesFast(Bool_t flag)
switch on/off the fast building of track candidates (assuming linear propagation between stations 4 a...
void SetBendingCoor(Double_t bendingCoor)
set bending coordinate (cm)
static Float_t * DefaultChamberZ()
Return pointer to array of positions.
void RequestStation(Int_t iSt, Bool_t flag)
request or not at least one cluster in the station to validate the track
Double_t GetNonBendingCoor() const
return non bending coordinate (cm)
void RemoveDoubleTracks()
void SetRemovable(Bool_t removable)
set the flag telling whether the associated cluster can be removed from the track it belongs to or no...
AliMUONVCluster * GetClusterPtr() const
get pointeur to associated cluster
Int_t fNRecTracks
number of reconstructed tracks
static Double_t ChamberThicknessInX0(Int_t chId)
Return chamber thickness in X0.
void SetTrackChi2(Double_t chi2)
set the chi2 of the track when the associated cluster was attached
static Int_t GetDetElemId(UInt_t uniqueID)
Return detection element id, part of the uniqueID.
virtual Double_t GetX() const =0
Return coordinate X (cm)
void RecursiveDump(void) const
Reconstructed track in ALICE dimuon spectrometer.
Bool_t IsImproved() const
return kTRUE if the track has been improved
Double_t GetSigmaCutForImprovement() const
return the cut in sigma to apply on cluster (local chi2) during track improvement ...
virtual Bool_t MakeTrackCandidates(AliMUONVClusterStore &clusterStore)
Make track candidates from clusters in stations(1..) 4 and 5.
void SetCovariances(const TMatrixD &covariances)
Bool_t FollowTrackInStation(AliMUONTrack &trackCandidate, AliMUONVClusterStore &clusterStore, Int_t nextStation)
virtual Bool_t ComplementTracks(const AliMUONVClusterStore &clusterStore)
Complement the reconstructed tracks.
void SetZ(Double_t z)
set Z coordinate (cm)
void UpdateTrack(AliMUONTrack &track, AliMUONTrackParam &trackParamAtCluster, Double_t addChi2)
const TMatrixD & GetCovariances() const
TClonesArray * fRecTracksPtr
pointer to array of reconstructed tracks
The equivalent of a std::pair<TObject*,TObject*> ;-)
const TMatrixD & GetPropagator() const
void TagRemovableClusters(UInt_t requestedStationMask)
static Double_t MaxChi2()
return the maximum chi2 above which the track can be considered as abnormal (due to extrapolation fai...
TObjArray * GetTrackParamAtCluster() const
void SetGlobalChi2(Double_t chi2)
set the minimum value of the function minimized by the fit