fRun(0),
fNEventsToAnalyze(0),
fSigmaClusterCut(0),
+ fScaleSigmaClusterCut(1.),
+ fGlobalTrackingDiverged(kFALSE),
fChi2GlobalCut(0),
fSigmaSpectrometerCut(0),
fVertexErrorX(0.015),
fMuonForwardTracks(0),
fMatchingMode(-1),
fGRPData(0),
- fRunInfo(0)
+ fRunInfo(0),
+ fBransonCorrection(kTRUE)
{
AliInfo(Form(" **** analyzing event # %d \n", fEv));
- fTrackStore = fMuonRecoCheck->ReconstructedTracks(fEv);
- if (fTrackStore->IsEmpty()) return kFALSE;
+ fTrackStore = fMuonRecoCheck->ReconstructedTracks(fEv);
+ if (fTrackStore->IsEmpty()) {
+ AliInfo("fTrackStore Is Empty: exiting NOW!");
+ return kFALSE;
+ }
+ AliInfo("fTrackStore contains tracks!");
+
+ AliDebug(2, Form("Getting fMuonRecoCheck->ReconstructibleTracks(%d)", fEv));
fTrackRefStore = fMuonRecoCheck->ReconstructibleTracks(fEv);
+ AliDebug(2, Form("Getting fRunLoader->GetEvent(%d)", fEv));
fRunLoader->GetEvent(fEv);
+
+ AliDebug(2, Form("fMFTLoader->TreeR() = %p",fMFTLoader->TreeR()));
if (!fMFTLoader->TreeR()->GetEvent()) return kFALSE;
for (Int_t iPlane=0; iPlane<fNPlanesMFT; iPlane++) {
AliDebug(1, Form("plane %02d: nClusters = %d\n", iPlane, (fMFT->GetRecPointsList(iPlane))->GetEntries()));
// 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();
- track -> SetMUONTrack(fMuonTrackReco);
- if (fLabelMC>=0 && fStack->Particle(fLabelMC)) track->SetMCTrackRef(fStack->Particle(fLabelMC));
+ track -> SetMUONTrack(new AliMUONTrack(*fMuonTrackReco));
+ if (fLabelMC>=0 && fStack->Particle(fLabelMC)) track->SetMCTrackRef(new TParticle(*(fStack->Particle(fLabelMC))));
track -> SetMCLabel(fMuonTrackReco->GetMCLabel());
track -> SetMatchTrigger(fMuonTrackReco->GetMatchTrigger());
Double_t yEndOfAbsorber = trackParamEndOfAbsorber.GetBendingCoor();
Double_t rAbsorber = TMath::Sqrt(xEndOfAbsorber*xEndOfAbsorber + yEndOfAbsorber*yEndOfAbsorber);
fHistRadiusEndOfAbsorber -> Fill(rAbsorber);
+ track -> SetRAtAbsorberEnd(rAbsorber);
// if the radial distance of the track at the end of the absorber is smaller than a given radius, skip to the next track
if (rAbsorber < fRAbsorberCut) return 4;
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) == kDiverged) {
+ 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);
// fOutputQAFile->cd();
- Float_t finalCandidatesInfo[] = {Double_t(fRun),
- Double_t(fEv),
- Double_t(fCountRealTracksAnalyzedOfEvent),
- Double_t(nFinalTracks),
- Double_t(fLabelMC>=0),
- xVtx, yVtx, zVtx,
- motherPdg,
- Double_t(fMuonTrackReco->GetMatchTrigger()),
- Double_t(nClustersMC),
- Double_t(nGoodClusters),
- pt, theta, eta,
- chi2AtPlane[0],
- chi2AtPlane[1],
- chi2AtPlane[2],
- chi2AtPlane[3],
- chi2AtPlane[4],
- chi2AtPlane[5],
- chi2AtPlane[6],
- chi2AtPlane[7],
- chi2AtPlane[8]};
+ Float_t finalCandidatesInfo[] = {static_cast<Float_t>(fRun),
+ static_cast<Float_t>(fEv),
+ static_cast<Float_t>(fCountRealTracksAnalyzedOfEvent),
+ static_cast<Float_t>(nFinalTracks),
+ static_cast<Float_t>(fLabelMC>=0),
+ static_cast<Float_t>(xVtx), static_cast<Float_t>(yVtx), static_cast<Float_t>(zVtx),
+ static_cast<Float_t>(motherPdg),
+ static_cast<Float_t>(fMuonTrackReco->GetMatchTrigger()),
+ static_cast<Float_t>(nClustersMC),
+ static_cast<Float_t>(nGoodClusters),
+ static_cast<Float_t>(pt), static_cast<Float_t>(theta), static_cast<Float_t>(eta),
+ static_cast<Float_t>(chi2AtPlane[0]),
+ static_cast<Float_t>(chi2AtPlane[1]),
+ static_cast<Float_t>(chi2AtPlane[2]),
+ static_cast<Float_t>(chi2AtPlane[3]),
+ static_cast<Float_t>(chi2AtPlane[4]),
+ static_cast<Float_t>(chi2AtPlane[5]),
+ static_cast<Float_t>(chi2AtPlane[6]),
+ static_cast<Float_t>(chi2AtPlane[7]),
+ static_cast<Float_t>(chi2AtPlane[8])};
fNtuFinalCandidates -> Fill(finalCandidatesInfo);
FillPlanesWithTrackHistory();
AliMuonForwardTrack *newTrack = (AliMuonForwardTrack*) fCandidateTracks->UncheckedAt(idBestCandidate);
newTrack -> SetNWrongClustersMC(newTrack->GetNMFTClusters() - nGoodClustersBestCandidate);
+ newTrack -> SetTrackMCId(fRun*100000+fEv*1000+fCountRealTracksAnalyzedOfEvent);
new ((*fMuonForwardTracks)[fMuonForwardTracks->GetEntries()]) AliMuonForwardTrack(*newTrack);
}
// fOutputQAFile->cd();
- Float_t finalBestCandidatesInfo[] = {Double_t(fRun),
- Double_t(fEv),
- Double_t(fCountRealTracksAnalyzedOfEvent),
- Double_t(nFinalTracks),
- Double_t(fLabelMC>=0),
- xVtx, yVtx, zVtx,
- motherPdg,
- Double_t(fMuonTrackReco->GetMatchTrigger()),
- Double_t(nClustersMC),
- Double_t(nGoodClustersBestCandidate),
- pt, theta, eta,
- chi2HistoryForBestCandidate[0],
- chi2HistoryForBestCandidate[1],
- chi2HistoryForBestCandidate[2],
- chi2HistoryForBestCandidate[3],
- chi2HistoryForBestCandidate[4],
- chi2HistoryForBestCandidate[5],
- chi2HistoryForBestCandidate[6],
- chi2HistoryForBestCandidate[7],
- chi2HistoryForBestCandidate[8],
- nClustersPerPlane[0],
- nClustersPerPlane[1],
- nClustersPerPlane[2],
- nClustersPerPlane[3],
- nClustersPerPlane[4],
- nClustersPerPlane[5],
- nClustersPerPlane[6],
- nClustersPerPlane[7],
- nClustersPerPlane[8]};
+ Float_t finalBestCandidatesInfo[] = {static_cast<Float_t>(fRun),
+ static_cast<Float_t>(fEv),
+ static_cast<Float_t>(fCountRealTracksAnalyzedOfEvent),
+ static_cast<Float_t>(nFinalTracks),
+ static_cast<Float_t>(fLabelMC>=0),
+ static_cast<Float_t>(xVtx), static_cast<Float_t>(yVtx), static_cast<Float_t>(zVtx),
+ static_cast<Float_t>(motherPdg),
+ static_cast<Float_t>(fMuonTrackReco->GetMatchTrigger()),
+ static_cast<Float_t>(nClustersMC),
+ static_cast<Float_t>(nGoodClustersBestCandidate),
+ static_cast<Float_t>(pt), static_cast<Float_t>(theta), static_cast<Float_t>(eta),
+ static_cast<Float_t>(chi2HistoryForBestCandidate[0]),
+ static_cast<Float_t>(chi2HistoryForBestCandidate[1]),
+ static_cast<Float_t>(chi2HistoryForBestCandidate[2]),
+ static_cast<Float_t>(chi2HistoryForBestCandidate[3]),
+ static_cast<Float_t>(chi2HistoryForBestCandidate[4]),
+ static_cast<Float_t>(chi2HistoryForBestCandidate[5]),
+ static_cast<Float_t>(chi2HistoryForBestCandidate[6]),
+ static_cast<Float_t>(chi2HistoryForBestCandidate[7]),
+ static_cast<Float_t>(chi2HistoryForBestCandidate[8]),
+ static_cast<Float_t>(nClustersPerPlane[0]),
+ static_cast<Float_t>(nClustersPerPlane[1]),
+ static_cast<Float_t>(nClustersPerPlane[2]),
+ static_cast<Float_t>(nClustersPerPlane[3]),
+ static_cast<Float_t>(nClustersPerPlane[4]),
+ static_cast<Float_t>(nClustersPerPlane[5]),
+ static_cast<Float_t>(nClustersPerPlane[6]),
+ static_cast<Float_t>(nClustersPerPlane[7]),
+ static_cast<Float_t>(nClustersPerPlane[8])};
fNtuFinalBestCandidates -> Fill(finalBestCandidatesInfo);
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 xExtrap = gRandom->Gaus(0,fVertexErrorX);
Double_t yExtrap = gRandom->Gaus(0,fVertexErrorY);
Double_t zExtrap = gRandom->Gaus(0,fVertexErrorZ);
- AliMUONTrackExtrap::ExtrapToVertex(¤tParamFront, xExtrap, yExtrap, zExtrap, fVertexErrorX, fVertexErrorY);
- AliMUONTrackExtrap::ExtrapToVertex(¤tParamBack, xExtrap, yExtrap, zExtrap, fVertexErrorX, fVertexErrorY);
+ if (fBransonCorrection) {
+ AliMUONTrackExtrap::ExtrapToVertex(¤tParamFront, xExtrap, yExtrap, zExtrap, fVertexErrorX, fVertexErrorY);
+ AliMUONTrackExtrap::ExtrapToVertex(¤tParamBack, xExtrap, yExtrap, zExtrap, fVertexErrorX, fVertexErrorY);
+ }
+ else {
+ AliMUONTrackExtrap::ExtrapToVertexWithoutBranson(¤tParamFront, zExtrap);
+ AliMUONTrackExtrap::ExtrapToVertexWithoutBranson(¤tParamBack, zExtrap);
+ }
AliMUONTrackExtrap::ExtrapToVertex(¤tParamForResearchFront, xExtrap, yExtrap, zExtrap, fVertexErrorX, fVertexErrorY);
AliMUONTrackExtrap::ExtrapToVertex(¤tParamForResearchBack, xExtrap, yExtrap, zExtrap, fVertexErrorX, fVertexErrorY);
}
//---------------------------------------------------------------------------------------
- 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 kDiverged;
newTrack->AddTrackParamAtMFTCluster(currentParamFront, *cluster); // creating new track param and attaching the cluster
- AliDebug(1, Form("After plane %02d: newTrack->GetNMFTClusters() = %d (fCurrentTrack->GetNMFTClusters() = %d)",
+ AliDebug(2, Form("After plane %02d: newTrack->GetNMFTClusters() = %d (fCurrentTrack->GetNMFTClusters() = %d)",
planeId, newTrack->GetNMFTClusters(), fCurrentTrack->GetNMFTClusters()));
newTrack->SetPlaneExists(planeId);
AliDebug(2, Form("current muon is trackable: %d\n", fIsCurrentMuonTrackable));
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 kDiverged;
newTrack->AddTrackParamAtMFTCluster(currentParamBack, *cluster); // creating new track param and attaching the cluster
- AliDebug(1, Form("After plane %02d: newTrack->GetNMFTClusters() = %d (fCurrentTrack->GetNMFTClusters() = %d)",
+ AliDebug(2, Form("After plane %02d: newTrack->GetNMFTClusters() = %d (fCurrentTrack->GetNMFTClusters() = %d)",
planeId, newTrack->GetNMFTClusters(), fCurrentTrack->GetNMFTClusters()));
newTrack->SetPlaneExists(planeId);
AliDebug(2, Form("current muon is trackable: %d\n", fIsCurrentMuonTrackable));
fHistDistanceGoodClusterFromTrackAtLastPlane -> Fill(fDistanceFromGoodClusterAndTrackAtLastPlane);
}
}
+
+ return kConverged;
}
void AliMuonForwardTrackFinder::SeparateFrontBackClusters() {
for (Int_t iPlane=0; iPlane<fNPlanesMFT; iPlane++) {
+ printf("Separating front/back clusters\n");
fMFTClusterArrayFront[iPlane]->Delete();
fMFTClusterArrayBack[iPlane] ->Delete();
for (Int_t iCluster=0; iCluster<fMFTClusterArray[iPlane]->GetEntries(); iCluster++) {
TParticle *part = 0;
if (fLabelMC>=0) part = fStack->Particle(fLabelMC);
- AliDebug(1, Form("fStack->Particle(fLabelMC) = %p", part));
+ AliDebug(1, Form("fStack->Particle(%d) = %p", fLabelMC, part));
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(part->GetFirstMother() = %p", partMother));
+ AliDebug(1, Form("fStack->Particle(%d) = %p", part->GetFirstMother(), partMother));
if (partMother) {
Char_t newName[100];
if (partMother->GetFirstMother() != -1) history += "... #rightarrow ";
}
}
Char_t newName[100];
+ AliDebug(1, Form("fStack->Particle(%d)->GetPdgCode() = %d", fLabelMC, part->GetPdgCode()));
+ AliDebug(1, Form("fStack->Particle(%d)->GetName() = %s", fLabelMC, part->GetName()));
PDGNameConverter(part->GetName(), newName);
history += Form("%s at z = %5.1f cm", newName, part->Vz());
// printf("%s", history.Data());