fRun(0),
fNEventsToAnalyze(0),
fSigmaClusterCut(0),
+ fScaleSigmaClusterCut(1.),
+ fGlobalTrackingDiverged(kFALSE),
fChi2GlobalCut(0),
fSigmaSpectrometerCut(0),
fVertexErrorX(0.015),
// load next muon track from the reconstructed event
- if (fCountRealTracksAnalyzed>fMaxNTracksToBeAnalyzed) return kFALSE;
-
+ if (fCountRealTracksAnalyzed>=fMaxNTracksToBeAnalyzed) return kFALSE;
if (!fCountRealTracksAnalyzed) if (!LoadNextEvent()) return kFALSE;
- if (fCountRealTracksAnalyzed==fMaxNTracksToBeAnalyzed) {
+
+ if (!fGlobalTrackingDiverged) {
+ while ( !(fMuonTrackReco = static_cast<AliMUONTrack*>(fNextTrack->Next())) ) if (!LoadNextEvent()) return kFALSE;
fCountRealTracksAnalyzed++;
- if (!LoadNextEvent()) return kFALSE;
+ fCountRealTracksAnalyzedOfEvent++;
}
- while ( !(fMuonTrackReco = static_cast<AliMUONTrack*>(fNextTrack->Next())) ) if (!LoadNextEvent()) return kFALSE;
-
AliDebug(1, "**************************************************************************************\n");
AliDebug(1, Form("*************************** MUON TRACK %3d ***************************************\n", fCountRealTracksAnalyzedOfEvent));
AliDebug(1, "**************************************************************************************\n");
- fCountRealTracksAnalyzed++;
-
fCandidateTracks -> Delete();
fLabelMC = -1;
Int_t motherPdg=0;
if (fLabelMC>=0) {
- fCountRealTracksWithRefMC++;
+ if (!fGlobalTrackingDiverged) fCountRealTracksWithRefMC++;
if (fStack->Particle(fLabelMC)->GetFirstMother() != -1) {
motherPdg = fStack->Particle(fStack->Particle(fLabelMC)->GetFirstMother())->GetPdgCode();
}
CheckCurrentMuonTrackable();
- if (fMuonTrackReco->GetMatchTrigger()) fCountRealTracksWithRefMC_andTrigger++;
+ if (!fGlobalTrackingDiverged) if (fMuonTrackReco->GetMatchTrigger()) fCountRealTracksWithRefMC_andTrigger++;
// the track we are going to build, starting from fMuonTrackReco and adding the MFT clusters
AliMuonForwardTrack *track = new ((*fCandidateTracks)[0]) AliMuonForwardTrack();
fCurrentTrack = (AliMuonForwardTrack*) fCandidateTracks->UncheckedAt(iTrack);
// if the old track is compatible with the new cluster, the track is updated and inserted as new track in the array
// (several new tracks can be created for one old track)
- FindClusterInPlane(iPlane);
+ if (FindClusterInPlane(iPlane) == 2) {
+ fGlobalTrackingDiverged = kTRUE;
+ if (fScaleSigmaClusterCut>0) fScaleSigmaClusterCut -= 0.1;
+ return 6;
+ }
if ((fNPlanesMFTAnalyzed-fCurrentTrack->GetNMFTClusters())>fNMaxMissingMFTClusters || fIsPlaneMandatory[iPlane]) {
fCandidateTracks->Remove(fCurrentTrack); // the old track is removed after the check;
}
// -------------------------- END OF THE CYCLE OVER THE MFT PLANES --------------------------------------------
+ fGlobalTrackingDiverged = kFALSE;
+ fScaleSigmaClusterCut = 1.0;
+
AliDebug(1, "Finished cycle over planes");
Double_t momentum = pt * TMath::CosH(eta);
fCandidateTracks->Delete();
fFinalBestCandidate = NULL;
- fCountRealTracksAnalyzedOfEvent++;
-
return 5;
}
//===========================================================================================================================================
-void AliMuonForwardTrackFinder::FindClusterInPlane(Int_t planeId) {
+Int_t AliMuonForwardTrackFinder::FindClusterInPlane(Int_t planeId) {
AliDebug(2, Form(">>>> executing AliMuonForwardTrackFinder::FindClusterInPlane(%d)\n", planeId));
//---------------------------------------------------------------------------------------
- Double_t chi2cut = 2.*fSigmaClusterCut*fSigmaClusterCut; // depends on the number of variables (here, 2)
+ Double_t chi2cut = 2.*fScaleSigmaClusterCut*fScaleSigmaClusterCut*fSigmaClusterCut*fSigmaClusterCut; // depends on the number of variables (here, 2)
// Analyizing the clusters: FRONT ACTIVE ELEMENTS
if (isGoodChi2) {
AliDebug(3, Form("accepting cluster: chi2=%f (cut = %f)\n", chi2, chi2cut));
AliMuonForwardTrack *newTrack = new ((*fCandidateTracks)[fCandidateTracks->GetEntriesFast()]) AliMuonForwardTrack(*fCurrentTrack);
+ if (fCandidateTracks->GetEntriesFast() > fMaxNCandidates) return 2;
newTrack->AddTrackParamAtMFTCluster(currentParamFront, *cluster); // creating new track param and attaching the cluster
AliDebug(2, Form("After plane %02d: newTrack->GetNMFTClusters() = %d (fCurrentTrack->GetNMFTClusters() = %d)",
planeId, newTrack->GetNMFTClusters(), fCurrentTrack->GetNMFTClusters()));
if (isGoodChi2) {
AliDebug(3,Form("accepting cluster: chi2=%f (cut = %f)\n", chi2, chi2cut));
AliMuonForwardTrack *newTrack = new ((*fCandidateTracks)[fCandidateTracks->GetEntriesFast()]) AliMuonForwardTrack(*fCurrentTrack);
+ if (fCandidateTracks->GetEntriesFast() > fMaxNCandidates) return 2;
newTrack->AddTrackParamAtMFTCluster(currentParamBack, *cluster); // creating new track param and attaching the cluster
AliDebug(2, Form("After plane %02d: newTrack->GetNMFTClusters() = %d (fCurrentTrack->GetNMFTClusters() = %d)",
planeId, newTrack->GetNMFTClusters(), fCurrentTrack->GetNMFTClusters()));
fHistDistanceGoodClusterFromTrackAtLastPlane -> Fill(fDistanceFromGoodClusterAndTrackAtLastPlane);
}
}
+
+ return 0;
}
if (fLabelMC>=0) part = fStack->Particle(fLabelMC);
AliDebug(1, Form("fStack->Particle(%d) = %p", fLabelMC, part));
- AliDebug(1, Form("fStack->Particle(%d)->GetPdgCode() = %d", fLabelMC, part->GetPdgCode()));
if (part) {
+ AliDebug(1, Form("fStack->Particle(%d)->GetPdgCode() = %d", fLabelMC, part->GetPdgCode()));
if (part->GetFirstMother() != -1) {
TParticle *partMother = fStack->Particle(part->GetFirstMother());
AliDebug(1, Form("fStack->Particle(%d) = %p", part->GetFirstMother(), partMother));