/// * ValidateTracksWithTrigger to match tracker/trigger tracks
///
/// Several options and adjustable parameters are available for both KALMAN and ORIGINAL
-/// tracking algorithms. They can be changed by using:
-/// AliMUONRecoParam *muonRecoParam = AliMUONRecoParam::GetLow(High)FluxParam();
-/// muonRecoParam->Set...(); // see methods in AliMUONRecoParam.h for details
-/// AliMUONReconstructor::SetRecoParam(muonRecoParam);
+/// tracking algorithms. They can be changed through the AliMUONRecoParam object
+/// set in the reconstruction macro or read from the CDB
+/// (see methods in AliMUONRecoParam.h file for details)
///
/// Main parameters and options are:
/// - *fgkSigmaToCutForTracking* : quality cut used to select new clusters to be
/// \endcond
//__________________________________________________________________________
-AliMUONVTrackReconstructor::AliMUONVTrackReconstructor(AliMUONVClusterServer& clusterServer)
- : TObject(),
- fRecTracksPtr(0x0),
- fNRecTracks(0),
- fClusterServer(clusterServer)
+AliMUONVTrackReconstructor::AliMUONVTrackReconstructor(const AliMUONRecoParam* recoParam,
+ AliMUONVClusterServer* clusterServer)
+: TObject(),
+fRecTracksPtr(0x0),
+fNRecTracks(0),
+fClusterServer(clusterServer),
+fRecoParam(recoParam)
{
/// Constructor for class AliMUONVTrackReconstructor
+ /// WARNING: if clusterServer=0x0, no clusterization will be possible at this level
// Memory allocation for the TClonesArray of reconstructed tracks
fRecTracksPtr = new TClonesArray("AliMUONTrack", 100);
MakeTrackCandidates(clusterStore);
// Look for extra candidates from clusters in stations(1..) 4 and 5
- if (AliMUONReconstructor::GetRecoParam()->MakeMoreTrackCandidates()) MakeMoreTrackCandidates(clusterStore);
+ if (GetRecoParam()->MakeMoreTrackCandidates()) MakeMoreTrackCandidates(clusterStore);
// Stop tracking if no candidate found
if (fRecTracksPtr->GetEntriesFast() == 0) return;
FollowTracks(clusterStore);
// Complement the reconstructed tracks
- if (AliMUONReconstructor::GetRecoParam()->ComplementTracks()) ComplementTracks(clusterStore);
+ if (GetRecoParam()->ComplementTracks()) ComplementTracks(clusterStore);
// Improve the reconstructed tracks
- if (AliMUONReconstructor::GetRecoParam()->ImproveTracks()) ImproveTracks();
+ if (GetRecoParam()->ImproveTracks()) ImproveTracks();
// Remove double tracks
RemoveDoubleTracks();
nonBendingSlope = (cluster1->GetX() - cluster2->GetX()) / (cluster1->GetZ() - cluster2->GetZ());
// check if non bending slope is within tolerances
- if (TMath::Abs(nonBendingSlope) > AliMUONReconstructor::GetRecoParam()->GetMaxNonBendingSlope()) continue;
+ if (TMath::Abs(nonBendingSlope) > GetRecoParam()->GetMaxNonBendingSlope()) continue;
// bending slope
bendingSlope = (cluster1->GetY() - cluster2->GetY()) / (cluster1->GetZ() - cluster2->GetZ());
bendingMomentum = TMath::Abs(AliMUONTrackExtrap::GetBendingMomentumFromImpactParam(impactParam));
// check if bending momentum is within tolerances
- if (bendingMomentum < AliMUONReconstructor::GetRecoParam()->GetMinBendingMomentum() ||
- bendingMomentum > AliMUONReconstructor::GetRecoParam()->GetMaxBendingMomentum()) continue;
+ if (bendingMomentum < GetRecoParam()->GetMinBendingMomentum() ||
+ bendingMomentum > GetRecoParam()->GetMaxBendingMomentum()) continue;
} else {
// check if non bending slope is within tolerances
- if (TMath::Abs(bendingSlope) > AliMUONReconstructor::GetRecoParam()->GetMaxBendingSlope()) continue;
+ if (TMath::Abs(bendingSlope) > GetRecoParam()->GetMaxBendingSlope()) continue;
}
// make new segment
/// Ask the clustering to reconstruct new clusters around the track candidate position
// check if the current chamber is useable
- if (!AliMUONReconstructor::GetRecoParam()->UseChamber(chamber)) return;
+ if (!fClusterServer || !GetRecoParam()->UseChamber(chamber)) return;
// maximum distance between the center of the chamber and a detection element
// (accounting for the inclination of the chamber)
- static const Double_t gkMaxDZ = 15.; // 15 cm
+ static const Double_t kMaxDZ = 15.; // 15 cm
// extrapolate track parameters to the chamber
AliMUONTrackParam extrapTrackParam(trackParam);
// build the searching area using the track resolution and the maximum-distance-to-track value
const TMatrixD& kParamCov = extrapTrackParam.GetCovariances();
- Double_t errX2 = kParamCov(0,0) + gkMaxDZ * gkMaxDZ * kParamCov(1,1) + 2. * gkMaxDZ * TMath::Abs(kParamCov(0,1));
- Double_t errY2 = kParamCov(2,2) + gkMaxDZ * gkMaxDZ * kParamCov(3,3) + 2. * gkMaxDZ * TMath::Abs(kParamCov(2,3));
- Double_t dX = TMath::Abs(trackParam.GetNonBendingSlope()) * gkMaxDZ +
- AliMUONReconstructor::GetRecoParam()->GetMaxNonBendingDistanceToTrack() +
- AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking() * TMath::Sqrt(errX2);
- Double_t dY = TMath::Abs(trackParam.GetBendingSlope()) * gkMaxDZ +
- AliMUONReconstructor::GetRecoParam()->GetMaxBendingDistanceToTrack() +
- AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking() * TMath::Sqrt(errY2);
+ Double_t errX2 = kParamCov(0,0) + kMaxDZ * kMaxDZ * kParamCov(1,1) + 2. * kMaxDZ * TMath::Abs(kParamCov(0,1));
+ Double_t errY2 = kParamCov(2,2) + kMaxDZ * kMaxDZ * kParamCov(3,3) + 2. * kMaxDZ * TMath::Abs(kParamCov(2,3));
+ Double_t dX = TMath::Abs(trackParam.GetNonBendingSlope()) * kMaxDZ +
+ GetRecoParam()->GetMaxNonBendingDistanceToTrack() +
+ GetRecoParam()->GetSigmaCutForTracking() * TMath::Sqrt(errX2);
+ Double_t dY = TMath::Abs(trackParam.GetBendingSlope()) * kMaxDZ +
+ GetRecoParam()->GetMaxBendingDistanceToTrack() +
+ GetRecoParam()->GetSigmaCutForTracking() * TMath::Sqrt(errY2);
TVector2 dimensions(dX, dY);
TVector2 position(extrapTrackParam.GetNonBendingCoor(), extrapTrackParam.GetBendingCoor());
AliMpArea area(position, dimensions);
// ask to cluterize in the given area of the given chamber
- fClusterServer.Clusterize(chamber, clusterStore, area);
+ fClusterServer->Clusterize(chamber, clusterStore, area, GetRecoParam());
}
Double_t errX2 = kParamCov(0,0) + dZ * dZ * kParamCov(1,1) + 2. * dZ * kParamCov(0,1);
Double_t errY2 = kParamCov(2,2) + dZ * dZ * kParamCov(3,3) + 2. * dZ * kParamCov(2,3);
- Double_t dXmax = AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking() * TMath::Sqrt(errX2) +
- AliMUONReconstructor::GetRecoParam()->GetMaxNonBendingDistanceToTrack();
- Double_t dYmax = AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking() * TMath::Sqrt(errY2) +
- AliMUONReconstructor::GetRecoParam()->GetMaxBendingDistanceToTrack();
+ Double_t dXmax = GetRecoParam()->GetSigmaCutForTracking() * TMath::Sqrt(errX2) +
+ GetRecoParam()->GetMaxNonBendingDistanceToTrack();
+ Double_t dYmax = GetRecoParam()->GetSigmaCutForTracking() * TMath::Sqrt(errY2) +
+ GetRecoParam()->GetMaxBendingDistanceToTrack();
if (TMath::Abs(dX) > dXmax || TMath::Abs(dY) > dYmax) return kFALSE;
AliDebug(1,Form("Enter FollowLinearTrackInChamber(1..) %d", nextChamber+1));
Double_t chi2WithOneCluster = 1.e10;
- Double_t maxChi2WithOneCluster = 2. * AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking() *
- AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking(); // 2 because 2 quantities in chi2
+ Double_t maxChi2WithOneCluster = 2. * GetRecoParam()->GetSigmaCutForTracking() *
+ GetRecoParam()->GetSigmaCutForTracking(); // 2 because 2 quantities in chi2
Double_t bestChi2WithOneCluster = maxChi2WithOneCluster;
Bool_t foundOneCluster = kFALSE;
AliMUONTrack *newTrack = 0x0;
cluster->Print();
}
- if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
+ if (GetRecoParam()->TrackAllTracks()) {
// copy trackCandidate into a new track put at the end of fRecTracksPtr and add the new cluster
newTrack = new ((*fRecTracksPtr)[fRecTracksPtr->GetLast()+1]) AliMUONTrack(trackCandidate);
- if (AliMUONReconstructor::GetRecoParam()->RequestStation(nextChamber/2))
+ if (GetRecoParam()->RequestStation(nextChamber/2))
extrapTrackParamAtCluster.SetRemovable(kFALSE);
else extrapTrackParamAtCluster.SetRemovable(kTRUE);
newTrack->AddTrackParamAtCluster(extrapTrackParamAtCluster,*cluster);
}
// fill out the best track if required else clean up the fRecTracksPtr array
- if (!AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
+ if (!GetRecoParam()->TrackAllTracks()) {
if (foundOneCluster) {
- if (AliMUONReconstructor::GetRecoParam()->RequestStation(nextChamber/2))
+ if (GetRecoParam()->RequestStation(nextChamber/2))
bestTrackParamAtCluster.SetRemovable(kFALSE);
else bestTrackParamAtCluster.SetRemovable(kTRUE);
trackCandidate.AddTrackParamAtCluster(bestTrackParamAtCluster,*(bestTrackParamAtCluster.GetClusterPtr()));
Double_t chi2WithOneCluster = 1.e10;
Double_t chi2WithTwoClusters = 1.e10;
- Double_t maxChi2WithOneCluster = 2. * AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking() *
- AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking(); // 2 because 2 quantities in chi2
- Double_t maxChi2WithTwoClusters = 4. * AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking() *
- AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking(); // 4 because 4 quantities in chi2
+ Double_t maxChi2WithOneCluster = 2. * GetRecoParam()->GetSigmaCutForTracking() *
+ GetRecoParam()->GetSigmaCutForTracking(); // 2 because 2 quantities in chi2
+ Double_t maxChi2WithTwoClusters = 4. * GetRecoParam()->GetSigmaCutForTracking() *
+ GetRecoParam()->GetSigmaCutForTracking(); // 4 because 4 quantities in chi2
Double_t bestChi2WithOneCluster = maxChi2WithOneCluster;
Double_t bestChi2WithTwoClusters = maxChi2WithTwoClusters;
Bool_t foundOneCluster = kFALSE;
clusterCh1->Print();
}
- if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
+ if (GetRecoParam()->TrackAllTracks()) {
// copy trackCandidate into a new track put at the end of fRecTracksPtr and add the new clusters
newTrack = new ((*fRecTracksPtr)[fRecTracksPtr->GetLast()+1]) AliMUONTrack(trackCandidate);
extrapTrackParamAtCluster1.SetRemovable(kTRUE);
if (!foundSecondCluster) {
foundOneCluster = kTRUE;
- if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
+ if (GetRecoParam()->TrackAllTracks()) {
// copy trackCandidate into a new track put at the end of fRecTracksPtr and add the new cluster
newTrack = new ((*fRecTracksPtr)[fRecTracksPtr->GetLast()+1]) AliMUONTrack(trackCandidate);
- if (AliMUONReconstructor::GetRecoParam()->RequestStation(nextStation))
+ if (GetRecoParam()->RequestStation(nextStation))
extrapTrackParamAtCluster2.SetRemovable(kFALSE);
else extrapTrackParamAtCluster2.SetRemovable(kTRUE);
newTrack->AddTrackParamAtCluster(extrapTrackParamAtCluster2,*clusterCh2);
// look for candidates in chamber 1 not already attached to a track
// if we want to keep all possible tracks or if no good couple of clusters has been found
- if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks() || !foundTwoClusters) {
+ if (GetRecoParam()->TrackAllTracks() || !foundTwoClusters) {
// Printout for debuging
if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
clusterCh1->Print();
}
- if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
+ if (GetRecoParam()->TrackAllTracks()) {
// copy trackCandidate into a new track put at the end of fRecTracksPtr and add the new cluster
newTrack = new ((*fRecTracksPtr)[fRecTracksPtr->GetLast()+1]) AliMUONTrack(trackCandidate);
- if (AliMUONReconstructor::GetRecoParam()->RequestStation(nextStation))
+ if (GetRecoParam()->RequestStation(nextStation))
extrapTrackParamAtCluster1.SetRemovable(kFALSE);
else extrapTrackParamAtCluster1.SetRemovable(kTRUE);
newTrack->AddTrackParamAtCluster(extrapTrackParamAtCluster1,*clusterCh1);
}
// fill out the best track if required else clean up the fRecTracksPtr array
- if (!AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
+ if (!GetRecoParam()->TrackAllTracks()) {
if (foundTwoClusters) {
bestTrackParamAtCluster1.SetRemovable(kTRUE);
trackCandidate.AddTrackParamAtCluster(bestTrackParamAtCluster1,*(bestTrackParamAtCluster1.GetClusterPtr()));
}
} else if (foundOneCluster) {
- if (AliMUONReconstructor::GetRecoParam()->RequestStation(nextStation))
+ if (GetRecoParam()->RequestStation(nextStation))
bestTrackParamAtCluster1.SetRemovable(kFALSE);
else bestTrackParamAtCluster1.SetRemovable(kTRUE);
trackCandidate.AddTrackParamAtCluster(bestTrackParamAtCluster1,*(bestTrackParamAtCluster1.GetClusterPtr()));