--- /dev/null
+/**************************************************************************
+* Copyright(c) 1998-2007, 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. *
+**************************************************************************/
+
+
+//-----------------------------------------------------------------------------
+/// \class AliMUONRecoParam
+///
+/// Class with MUON reconstruction parameters
+///
+/// \author Philippe Pillot
+//-----------------------------------------------------------------------------
+
+
+
+#include "AliMUONRecoParam.h"
+
+#include "AliLog.h"
+
+#include <Riostream.h>
+
+ClassImp(AliMUONRecoParam)
+
+
+//_____________________________________________________________________________
+AliMUONRecoParam::AliMUONRecoParam()
+: TObject(),
+ fClusteringMode("MLEM"),
+ fTrackingMode("KALMAN"),
+ fMinBendingMomentum(0.),
+ fMaxBendingMomentum(0.),
+ fNonBendingVertexDispersion(0.),
+ fBendingVertexDispersion(0.),
+ fMaxNonBendingDistanceToTrack(0.),
+ fMaxBendingDistanceToTrack(0.),
+ fSigmaCutForTracking(0.),
+ fSigmaCutForImprovement(0.),
+ fMaxNormChi2MatchTrigger(0.),
+ fTrackAllTracks(kFALSE),
+ fRecoverTracks(kFALSE),
+ fMakeTrackCandidatesFast(kFALSE),
+ fComplementTracks(kFALSE),
+ fImproveTracks(kFALSE),
+ fUseSmoother(kFALSE)
+{
+ /// Constructor
+
+ // use the default parameters for low flux environment
+ SetLowFluxParam();
+}
+
+//_____________________________________________________________________________
+AliMUONRecoParam::~AliMUONRecoParam()
+{
+ /// Destructor
+}
+
+//_____________________________________________________________________________
+AliMUONRecoParam *AliMUONRecoParam::GetLowFluxParam()
+{
+ /// Return default reconstruction parameters for low flux environment
+
+ AliMUONRecoParam *param = new AliMUONRecoParam();
+ param->SetLowFluxParam();
+
+ return param;
+}
+
+//_____________________________________________________________________________
+AliMUONRecoParam *AliMUONRecoParam::GetHighFluxParam()
+{
+ /// Return default reconstruction parameters for high flux environment
+
+ AliMUONRecoParam *param = new AliMUONRecoParam();
+ param->SetHighFluxParam();
+
+ return param;
+}
+
+//_____________________________________________________________________________
+void AliMUONRecoParam::SetLowFluxParam()
+{
+ /// Set reconstruction parameters for low flux environment
+
+ fMinBendingMomentum = 3.;
+ fMaxBendingMomentum = 3000.;
+ fNonBendingVertexDispersion = 10.;
+ fBendingVertexDispersion = 10.;
+ fMaxNonBendingDistanceToTrack = 2.;
+ fMaxBendingDistanceToTrack = 2.;
+ fSigmaCutForTracking = 6.;
+ fSigmaCutForImprovement = 5.;
+ fMaxNormChi2MatchTrigger = 16.;
+ fTrackAllTracks = kTRUE;
+ fRecoverTracks = kTRUE;
+ fMakeTrackCandidatesFast = kFALSE;
+ fComplementTracks = kTRUE;
+ fImproveTracks = kTRUE;
+ fUseSmoother = kTRUE;
+
+}
+
+//_____________________________________________________________________________
+void AliMUONRecoParam::SetHighFluxParam()
+{
+ /// Set reconstruction parameters for high flux environment
+
+ fMinBendingMomentum = 3.;
+ fMaxBendingMomentum = 3000.;
+ fNonBendingVertexDispersion = 10.;
+ fBendingVertexDispersion = 10.;
+ fMaxNonBendingDistanceToTrack = 2.;
+ fMaxBendingDistanceToTrack = 2.;
+ fSigmaCutForTracking = 6.;
+ fSigmaCutForImprovement = 5.;
+ fMaxNormChi2MatchTrigger = 16.;
+ fTrackAllTracks = kTRUE;
+ fRecoverTracks = kTRUE;
+ fMakeTrackCandidatesFast = kFALSE;
+ fComplementTracks = kTRUE;
+ fImproveTracks = kTRUE;
+ fUseSmoother = kTRUE;
+
+}
+
+//_____________________________________________________________________________
+void AliMUONRecoParam::Print(Option_t *option) const
+{
+ /// print reconstruction parameters
+ /// if option = FULL then print also unused parameters
+
+ cout<<endl<<"\t------Reconstruction parameters------"<<endl;
+
+ cout<<Form("Clustering mode = %s",fClusteringMode.Data())<<endl;
+
+ cout<<Form("Tracking mode = %s",fTrackingMode.Data())<<endl;
+
+ cout<<Form("Bending momentum range = [%5.2f,%5.2f]",fMinBendingMomentum,fMaxBendingMomentum)<<endl;
+
+ if (strstr(fTrackingMode,"ORIGINAL"))
+ cout<<Form("Vertex dispertion = (%5.2f,%5.2f)",fNonBendingVertexDispersion,fBendingVertexDispersion)<<endl;
+ else if (strstr(option,"FULL"))
+ cout<<Form("Vertex dispertion (used for original tracking only) = (%5.2f,%5.2f)",fNonBendingVertexDispersion,fBendingVertexDispersion)<<endl;
+
+ cout<<Form("Maximum distance to track = (%5.2f,%5.2f)",fMaxNonBendingDistanceToTrack,fMaxBendingDistanceToTrack)<<endl;
+
+ cout<<Form("Sigma cut for tracking = %5.2f",fSigmaCutForTracking)<<endl;
+
+ if (fTrackAllTracks) cout<<"Track all the possible candidates"<<endl;
+ else cout<<"Track only the best candidates"<<endl;
+
+ if (strstr(option,"FULL")) {
+ cout<<"Make track candidates assuming linear propagation between stations 4 and 5: ";
+ if (fMakeTrackCandidatesFast) cout<<"ON"<<endl;
+ else cout<<"OFF"<<endl;
+ } else if (fMakeTrackCandidatesFast)
+ cout<<"Make track candidates assuming linear propagation between stations 4 and 5"<<endl;
+
+ if (strstr(option,"FULL")) {
+ cout<<"Try to recover tracks getting lost during tracking: ";
+ if (fRecoverTracks) cout<<"ON"<<endl;
+ else cout<<"OFF"<<endl;
+ } else if (fRecoverTracks)
+ cout<<"Try to recover tracks getting lost during tracking"<<endl;
+
+ if (strstr(option,"FULL")) {
+ cout<<"Try to complete the reconstructed tracks by adding missing clusters: ";
+ if (fComplementTracks) cout<<"ON"<<endl;
+ else cout<<"OFF"<<endl;
+ } else if (fComplementTracks)
+ cout<<"Try to complete the reconstructed tracks by adding missing clusters"<<endl;
+
+ if (strstr(option,"FULL")) {
+ cout<<"Try to improve the reconstructed tracks by removing bad clusters: ";
+ if (fImproveTracks) cout<<Form("ON (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
+ else cout<<"OFF"<<endl;
+ } else if (fImproveTracks)
+ cout<<Form("Try to improve the reconstructed tracks by removing bad clusters (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
+
+ if (strstr(option,"FULL")) {
+ cout<<"Use smoother to compute final track parameters, etc, at each cluster (used for Kalman tracking only): ";
+ if (fUseSmoother) cout<<"ON"<<endl;
+ else cout<<"OFF"<<endl;
+ } else if (fUseSmoother)
+ cout<<"Use smoother to compute final track parameters, etc, at each cluster"<<endl;
+
+ cout<<Form("Maximum normalized chi2 of tracking/trigger track matching = %5.2f",fMaxNormChi2MatchTrigger)<<endl;
+
+ cout<<"\t-------------------------------------"<<endl<<endl;
+
+}
+
--- /dev/null
+#ifndef AliMUONRecoParam_H
+#define AliMUONRecoParam_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+* See cxx source for full Copyright notice */
+
+/// \ingroup rec
+/// \class AliMUONRecoParam
+/// \brief Class with MUON reconstruction parameters
+///
+// Author: Philippe Pillot
+
+#include "TObject.h"
+#include "TString.h"
+
+class AliMUONRecoParam : public TObject
+{
+ public:
+ AliMUONRecoParam();
+ virtual ~AliMUONRecoParam();
+
+ static AliMUONRecoParam *GetLowFluxParam();
+ static AliMUONRecoParam *GetHighFluxParam();
+
+ /// set the clustering (pre-clustering) mode
+ void SetClusteringMode(Option_t* mode) {fClusteringMode = mode;}
+ /// get the clustering (pre-clustering) mode
+ Option_t* GetClusteringMode() const {return fClusteringMode.Data();}
+
+ /// set the tracking mode
+ void SetTrackingMode(Option_t* mode) {fTrackingMode = mode;}
+ /// get the tracking mode
+ Option_t* GetTrackingMode() const {return fTrackingMode.Data();}
+
+ /// set the minimum value (GeV/c) of momentum in bending plane
+ void SetMinBendingMomentum(Double_t val) {fMinBendingMomentum = val;}
+ /// return the minimum value (GeV/c) of momentum in bending plane
+ Double_t GetMinBendingMomentum() const {return fMinBendingMomentum;}
+ /// set the maximum value (GeV/c) of momentum in bending plane
+ void SetMaxBendingMomentum(Double_t val) {fMaxBendingMomentum = val;}
+ /// return the maximum value (GeV/c) of momentum in bending plane
+ Double_t GetMaxBendingMomentum() const {return fMaxBendingMomentum;}
+
+ /// set the vertex dispersion (cm) in non bending plane (used for original tracking only)
+ void SetNonBendingVertexDispersion(Double_t val) {fNonBendingVertexDispersion = val;}
+ /// return the vertex dispersion (cm) in bending plane (used for original tracking only)
+ Double_t GetNonBendingVertexDispersion() const {return fNonBendingVertexDispersion;}
+ /// set the vertex dispersion (cm) in non bending plane (used for original tracking only)
+ void SetBendingVertexDispersion(Double_t val) {fBendingVertexDispersion = val;}
+ /// return the vertex dispersion (cm) in bending plane (used for original tracking only)
+ Double_t GetBendingVertexDispersion() const {return fBendingVertexDispersion;}
+
+ /// set the maximum distance to the track to search for compatible cluster(s) in non bending direction
+ void SetMaxNonBendingDistanceToTrack(Double_t val) {fMaxNonBendingDistanceToTrack = val;}
+ /// return the maximum distance to the track to search for compatible cluster(s) in non bending direction
+ Double_t GetMaxNonBendingDistanceToTrack() const {return fMaxNonBendingDistanceToTrack;}
+ /// set the maximum distance to the track to search for compatible cluster(s) in bending direction
+ void SetMaxBendingDistanceToTrack(Double_t val) {fMaxBendingDistanceToTrack = val;}
+ /// return the maximum distance to the track to search for compatible cluster(s) in bending direction
+ Double_t GetMaxBendingDistanceToTrack() const {return fMaxBendingDistanceToTrack;}
+
+ /// set the cut in sigma to apply on cluster (local chi2) and track (global chi2) during tracking
+ void SetSigmaCutForTracking(Double_t val) {fSigmaCutForTracking = val;}
+ /// return the cut in sigma to apply on cluster (local chi2) and track (global chi2) during tracking
+ Double_t GetSigmaCutForTracking() const {return fSigmaCutForTracking;}
+
+ /// switch on/off the track improvement and keep the default cut in sigma to apply on cluster (local chi2)
+ void ImproveTracks(Bool_t flag) {fImproveTracks = flag;}
+ /// switch on/off the track improvement and set the cut in sigma to apply on cluster (local chi2)
+ void ImproveTracks(Bool_t flag, Double_t sigmaCut) {fImproveTracks = flag; fSigmaCutForImprovement = sigmaCut;}
+ /// return kTRUE/kFALSE if the track improvement is switch on/off
+ Bool_t ImproveTracks() const {return fImproveTracks;}
+ /// return the cut in sigma to apply on cluster (local chi2) during track improvement
+ Double_t GetSigmaCutForImprovement() const {return fSigmaCutForImprovement;}
+
+ /// set the maximum normalized chi2 of tracking/trigger track matching
+ void SetMaxNormChi2MatchTrigger(Double_t val) {fMaxNormChi2MatchTrigger = val;}
+ /// return the maximum normalized chi2 of tracking/trigger track matching
+ Double_t GetMaxNormChi2MatchTrigger() const {return fMaxNormChi2MatchTrigger;}
+
+ /// switch on/off the tracking of all the possible candidates (track only the best one if switched off)
+ void TrackAllTracks(Bool_t flag) {fTrackAllTracks = flag;}
+ /// return kTRUE/kFALSE if the tracking of all the possible candidates is switch on/off
+ Bool_t TrackAllTracks() const {return fTrackAllTracks;}
+
+ /// switch on/off the recovering of tracks being lost during reconstruction
+ void RecoverTracks(Bool_t flag) {fRecoverTracks = flag;}
+ /// return kTRUE/kFALSE if the recovering of tracks being lost during reconstruction is switch on/off
+ Bool_t RecoverTracks() const {return fRecoverTracks;}
+
+ /// switch on/off the fast building of track candidates (assuming linear propagation between stations 4 and 5)
+ void MakeTrackCandidatesFast(Bool_t flag) {fMakeTrackCandidatesFast = flag;}
+ /// return kTRUE/kFALSE if the fast building of track candidates is switch on/off
+ Bool_t MakeTrackCandidatesFast() const {return fMakeTrackCandidatesFast;}
+
+ /// switch on/off the completion of reconstructed track
+ void ComplementTracks(Bool_t flag) {fComplementTracks = flag;}
+ /// return kTRUE/kFALSE if completion of the reconstructed track is switch on/off
+ Bool_t ComplementTracks() const {return fComplementTracks;}
+
+ /// switch on/off the use of the smoother
+ void UseSmoother(Bool_t flag) {fUseSmoother = flag;}
+ /// return kTRUE/kFALSE if the use of the smoother is switch on/off
+ Bool_t UseSmoother() const {return fUseSmoother;}
+
+ virtual void Print(Option_t *option = "") const;
+
+
+ private:
+
+ /// clustering mode: NOCLUSTERING, PRECLUSTER, PRECLUSTERV2, PRECLUSTERV3, COG, <pre>
+ /// SIMPLEFIT, SIMPLEFITV3, MLEM:DRAW, MLEM, MLEMV2, MLEMV3 </pre>
+ TString fClusteringMode; ///< \brief name of the clustering (+ pre-clustering) mode
+
+ /// tracking mode: ORIGINAL, KALMAN
+ TString fTrackingMode; ///< \brief name of the tracking mode
+
+ Double32_t fMinBendingMomentum; ///< minimum value (GeV/c) of momentum in bending plane
+ Double32_t fMaxBendingMomentum; ///< maximum value (GeV/c) of momentum in bending plane
+
+ Double32_t fNonBendingVertexDispersion; ///< vertex dispersion (cm) in non bending plane (used for original tracking only)
+ Double32_t fBendingVertexDispersion; ///< vertex dispersion (cm) in bending plane (used for original tracking only)
+
+ Double32_t fMaxNonBendingDistanceToTrack; ///< maximum distance to the track to search for compatible cluster(s) in non bending direction
+ Double32_t fMaxBendingDistanceToTrack; ///< maximum distance to the track to search for compatible cluster(s) in bending direction
+
+ Double32_t fSigmaCutForTracking; ///< cut in sigma to apply on cluster (local chi2) and track (global chi2) during tracking
+
+ Double32_t fSigmaCutForImprovement; ///< cut in sigma to apply on cluster (local chi2) during track improvement
+
+ Double32_t fMaxNormChi2MatchTrigger; ///< maximum normalized chi2 of tracking/trigger track matching
+
+ Bool_t fTrackAllTracks; ///< kTRUE to track all the possible candidates; kFALSE to track only the best ones
+
+ Bool_t fRecoverTracks; ///< kTRUE to try to recover the tracks getting lost during reconstruction
+
+ Bool_t fMakeTrackCandidatesFast; ///< kTRUE to make candidate tracks assuming linear propagation between stations 4 and 5
+
+ Bool_t fComplementTracks; ///< kTRUE to try to complete the reconstructed tracks by adding missing clusters
+
+ Bool_t fImproveTracks; ///< kTRUE to try to improve the reconstructed tracks by removing bad clusters
+
+ Bool_t fUseSmoother; ///< kTRUE to use the smoother to compute track parameters/covariances and local chi2 at each cluster (used for Kalman tracking only)
+
+
+ // functions
+ void SetLowFluxParam();
+ void SetHighFluxParam();
+
+
+ ClassDef(AliMUONRecoParam,1) // MUON reco parameters
+};
+
+#endif
+
#include "AliMUONTriggerCrateStore.h"
#include "AliMUONTriggerStoreV1.h"
#include "AliMUONVClusterFinder.h"
+#include "AliMUONRecoParam.h"
#include "AliMpCDB.h"
#include "AliRawReader.h"
#include "AliCodeTimer.h"
ClassImp(AliMUONReconstructor)
/// \endcond
+AliMUONRecoParam* AliMUONReconstructor::fgRecoParam = 0x0; // reconstruction parameters
+
//_____________________________________________________________________________
AliMUONReconstructor::AliMUONReconstructor() :
AliReconstructor(),
// Load geometry data
fTransformer->LoadGeometryData();
+ // initialize reconstruction parameters in not already done
+ if (!fgRecoParam) {
+ AliWarning("Reconstruction parameters not initialized - Use default one");
+ fgRecoParam = AliMUONRecoParam::GetLowFluxParam();
+ }
}
delete fTrigChamberEff;
}
+//_____________________________________________________________________________
+void AliMUONReconstructor::SetRecoParam(AliMUONRecoParam *param)
+{
+ /// set reconstruction parameters
+
+ // remove existing parameters
+ if (fgRecoParam) {
+ cout<<"AliMUONReconstructor::SetRecoParam: Reconstruction parameters already initialized - overwrite them"<<endl;
+ delete fgRecoParam;
+ }
+
+ fgRecoParam = param;
+}
+
//_____________________________________________________________________________
void
AliMUONReconstructor::Calibrate(AliMUONVDigitStore& digitStore) const
{
/// Creates clusters from digits.
- TString sopt(GetOption());
+ TString sopt(fgRecoParam->GetClusteringMode());
sopt.ToUpper();
if ( sopt.Contains("NOCLUSTERING") ) return;
- if (!fClusterReconstructor)
- {
- CreateClusterReconstructor();
- }
+ if (!fClusterReconstructor) CreateClusterReconstructor();
+
+ // if the required clustering mode does not exist
+ if (!fClusterReconstructor) return;
AliCodeTimerAuto(Form("%s::Digits2Clusters(const AliMUONVDigitStore&,AliMUONVClusterStore&)",
fClusterReconstructor->ClassName()))
AliMUONReconstructor::CreateTracker() const
{
/// Create the MUONTracker object
- /// The MUONTracker is passed the GetOption(), i.e. our own options
CreateTriggerCircuit();
CreateDigitMaker();
CreateTriggerChamberEff();
AliMUONTracker* tracker = new AliMUONTracker(fDigitMaker,fTransformer,fTriggerCircuit,fTrigChamberEff);
- tracker->SetOption(GetOption());
return tracker;
}
void
AliMUONReconstructor::CreateClusterReconstructor() const
{
- /// Create cluster reconstructor, depending on GetOption()
+ /// Create cluster reconstructor, depending on clustering mode set in RecoParam
AliCodeTimerAuto("")
AliMUONVClusterFinder* clusterFinder(0x0);
- TString opt(GetOption());
+ TString opt(fgRecoParam->GetClusteringMode());
opt.ToUpper();
if ( strstr(opt,"PRECLUSTERV2") )
}
else
{
- // default is currently MLEM
- clusterFinder = new AliMUONClusterFinderMLEM(kFALSE,new AliMUONPreClusterFinder);
+ AliError(Form("clustering mode \"%s\" does not exist",opt.Data()));
+ return;
}
- if ( clusterFinder )
- {
- AliInfo(Form("Will use %s for clusterizing",clusterFinder->ClassName()));
- }
+ AliInfo(Form("Will use %s for clusterizing",clusterFinder->ClassName()));
fClusterReconstructor = new AliMUONClusterReconstructor(clusterFinder,fTransformer);
}
class AliMUONTriggerChamberEff;
+class AliMUONRecoParam;
+
class AliMUONReconstructor : public AliReconstructor
{
public:
virtual void Reconstruct(TTree* digitsTree, TTree* clustersTree) const;
virtual AliTracker* CreateTracker() const;
-
+
+ static void SetRecoParam(AliMUONRecoParam *param);
+ /// return reconstruction parametres
+ static const AliMUONRecoParam* GetRecoParam() {return fgRecoParam;}
+
private:
/// Not implemented
AliMUONReconstructor(const AliMUONReconstructor&);
mutable AliMUONVTrackStore* fTrackStore; //!< Track container
mutable AliMUONTriggerChamberEff* fTrigChamberEff; //!< pointer to trigger chamber efficiency class
+ static AliMUONRecoParam* fgRecoParam; //!< parameters used to tune the MUON reconstruction
+
ClassDef(AliMUONReconstructor,3) // Implementation of AliReconstructor
};
ClassImp(AliMUONTrackReconstructor) // Class implementation in ROOT context
/// \endcond
-//************* Parameters for reconstruction
-const Double_t AliMUONTrackReconstructor::fgkBendingVertexDispersion = 10.;
-const Double_t AliMUONTrackReconstructor::fgkNonBendingVertexDispersion = 10.;
-
-
//__________________________________________________________________________
AliMUONTrackReconstructor::AliMUONTrackReconstructor()
: AliMUONVTrackReconstructor()
}
// Look for compatible hitForRec(s) in the other station
- if (fgkMakeTrackCandidatesFast) hitFound = FollowLinearTrackInStation(*track,7-istat);
+ if (AliMUONReconstructor::GetRecoParam()->MakeTrackCandidatesFast()) hitFound = FollowLinearTrackInStation(*track,7-istat);
else hitFound = FollowTrackInStation(*track,7-istat);
// Remove track if no hit found
fRecTracksPtr->Compress(); // this is essential before checking tracks
// Keep all different tracks or only the best ones as required
- if (fgkTrackAllTracks) RemoveIdenticalTracks();
+ if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) RemoveIdenticalTracks();
else RemoveDoubleTracks();
AliDebug(1,Form("Number of good candidates = %d",fNRecTracks));
Int_t currentNRecTracks;
Bool_t hitFound;
+ Double_t sigmaCut2 = AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking() *
+ AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking();
+
for (Int_t station = 2; station >= 0; station--) {
// Save the actual number of reconstructed track in case of
Fit(*track, kFALSE, kTRUE);
// Remove the track if the normalized chi2 is too high
- if (track->GetNormalizedChi2() > fgkSigmaToCutForTracking * fgkSigmaToCutForTracking) {
+ if (track->GetNormalizedChi2() > sigmaCut2) {
fRecTracksPtr->Remove(track);
fNRecTracks--;
continue;
}
// save parameters from fit into smoothed parameters to complete track afterward
- if (fgkComplementTracks) {
+ if (AliMUONReconstructor::GetRecoParam()->ComplementTracks()) {
if (station==2) { // save track parameters on stations 4 and 5
hitFound = FollowTrackInStation(*track,station);
// Try to recover track if required
- if (!hitFound && fgkRecoverTracks) hitFound = RecoverTrack(*track,station);
+ if (!hitFound && AliMUONReconstructor::GetRecoParam()->RecoverTracks()) hitFound = RecoverTrack(*track,station);
// remove track if no hit found
if (!hitFound) {
fRecTracksPtr->Compress();
// Keep only the best tracks if required
- if (!fgkTrackAllTracks) RemoveDoubleTracks();
+ if (!AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) RemoveDoubleTracks();
}
}
// Remove the track if the normalized chi2 is too high
- if (track->GetNormalizedChi2() > fgkSigmaToCutForTracking * fgkSigmaToCutForTracking) {
+ if (track->GetNormalizedChi2() > sigmaCut2) {
fRecTracksPtr->Remove(track);
fNRecTracks--;
}
// save parameters from fit into smoothed parameters to complete track afterward
- if (fgkComplementTracks) {
+ if (AliMUONReconstructor::GetRecoParam()->ComplementTracks()) {
// save parameters from fit
trackParam = (AliMUONTrackParam*) track->GetTrackParamAtHit()->First();
Double_t chi2WithOneHitForRec = 1.e10;
Double_t chi2WithTwoHitForRec = 1.e10;
- Double_t maxChi2WithOneHitForRec = 2. * fgkSigmaToCutForTracking * fgkSigmaToCutForTracking; // 2 because 2 quantities in chi2
- Double_t maxChi2WithTwoHitForRec = 4. * fgkSigmaToCutForTracking * fgkSigmaToCutForTracking; // 4 because 4 quantities in chi2
+ Double_t maxChi2WithOneHitForRec = 2. * AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking() *
+ AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking(); // 2 because 2 quantities in chi2
+ Double_t maxChi2WithTwoHitForRec = 4. * AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking() *
+ AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking(); // 4 because 4 quantities in chi2
Double_t bestChi2WithOneHitForRec = maxChi2WithOneHitForRec;
Double_t bestChi2WithTwoHitForRec = maxChi2WithTwoHitForRec;
Bool_t foundOneHit = kFALSE;
<< " (Global Chi2 = " << chi2WithTwoHitForRec << ")" << endl;
}
- if (fgkTrackAllTracks) {
+ if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
// copy trackCandidate into a new track put at the end of fRecTracksPtr and add the new hitForRec's
newTrack = new ((*fRecTracksPtr)[fRecTracksPtr->GetLast()+1]) AliMUONTrack(trackCandidate);
UpdateTrack(*newTrack,extrapTrackParamAtHit1,extrapTrackParamAtHit2);
if (!foundSecondHit) {
foundOneHit = kTRUE;
- if (fgkTrackAllTracks) {
+ if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
// copy trackCandidate into a new track put at the end of fRecTracksPtr and add the new hitForRec's
newTrack = new ((*fRecTracksPtr)[fRecTracksPtr->GetLast()+1]) AliMUONTrack(trackCandidate);
UpdateTrack(*newTrack,extrapTrackParamAtHit2);
// 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 hitForRec has been found
- if (fgkTrackAllTracks || !foundTwoHits) {
+ if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks() || !foundTwoHits) {
// Printout for debuging
if ((AliLog::GetDebugLevel("MUON","AliMUONTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
<< " (Chi2 = " << chi2WithOneHitForRec << ")" << endl;
}
- if (fgkTrackAllTracks) {
+ if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
// copy trackCandidate into a new track put at the end of fRecTracksPtr and add the new hitForRec's
newTrack = new ((*fRecTracksPtr)[fRecTracksPtr->GetLast()+1]) AliMUONTrack(trackCandidate);
UpdateTrack(*newTrack,extrapTrackParamAtHit1);
}
// fill out the best track if required else clean up the fRecTracksPtr array
- if (!fgkTrackAllTracks) {
+ if (!AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
if (foundTwoHits) {
UpdateTrack(trackCandidate,bestTrackParamAtHit1,bestTrackParamAtHit2);
/// the "trackCandidate" to do not influence the result by changing track resolution at vertex
AliDebug(1,"Enter SetVertexForFit");
- Double_t nonBendingReso2 = fgkNonBendingVertexDispersion * fgkNonBendingVertexDispersion;
- Double_t bendingReso2 = fgkBendingVertexDispersion * fgkBendingVertexDispersion;
+ Double_t nonBendingReso2 = AliMUONReconstructor::GetRecoParam()->GetNonBendingVertexDispersion() *
+ AliMUONReconstructor::GetRecoParam()->GetNonBendingVertexDispersion();
+ Double_t bendingReso2 = AliMUONReconstructor::GetRecoParam()->GetBendingVertexDispersion() *
+ AliMUONReconstructor::GetRecoParam()->GetBendingVertexDispersion();
// add multiple scattering effets
AliMUONTrackParam paramAtVertex(*((AliMUONTrackParam*)(trackCandidate.GetTrackParamAtHit()->First())));
paramAtVertex.DeleteCovariances(); // to be sure to account only for multiple scattering
AliMUONTrackParam copyOfTrackParam;
AliMUONTrackParam trackParamAtHit;
AliMUONTrackParam bestTrackParamAtHit;
+ Double_t sigmaCut2 = AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking() *
+ AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking();
// Remove double track to complete only "good" tracks
RemoveDoubleTracks();
trackParam = (AliMUONTrackParam*)track->GetTrackParamAtHit()->First();
while (trackParam) {
foundOneHit = kFALSE;
- bestChi2OfHitForRec = 2. * fgkSigmaToCutForTracking * fgkSigmaToCutForTracking; // 2 because 2 quantities in chi2
+ bestChi2OfHitForRec = 2. * sigmaCut2; // 2 because 2 quantities in chi2
// prepare nextTrackParam before adding new cluster because of the sorting
nextTrackParam = (AliMUONTrackParam*)track->GetTrackParamAtHit()->After(trackParam);
Int_t worstChamber, previousChamber;
AliMUONTrack *track, *nextTrack;
AliMUONTrackParam *trackParamAtHit, *worstTrackParamAtHit, *previousTrackParam, *nextTrackParam;
+ Double_t sigmaCut2 = AliMUONReconstructor::GetRecoParam()->GetSigmaCutForImprovement() *
+ AliMUONReconstructor::GetRecoParam()->GetSigmaCutForImprovement();
// Remove double track to improve only "good" tracks
RemoveDoubleTracks();
}
// Check whether the worst chi2 is under requirement or not
- if (worstLocalChi2 < 2. * fgkSigmaToCutForImprovement * fgkSigmaToCutForImprovement) { // 2 because 2 quantities in chi2
+ if (worstLocalChi2 < 2. * sigmaCut2) { // 2 because 2 quantities in chi2
track->SetImproved(kTRUE);
break;
}
private:
- // Parameters for track reconstruction
- static const Double_t fgkBendingVertexDispersion; ///< Vertex dispersion (cm) in bending plane for reconstruction
- static const Double_t fgkNonBendingVertexDispersion; ///< Vertex dispersion (cm) in non bending plane for reconstruction
-
-
- // Functions
/// Not implemented copy constructor
AliMUONTrackReconstructor (const AliMUONTrackReconstructor& rhs);
/// Not implemented copy assignment operator
ClassImp(AliMUONTrackReconstructorK) // Class implementation in ROOT context
/// \endcond
-//************* Defaults parameters for reconstruction
-const Bool_t AliMUONTrackReconstructorK::fgkRunSmoother = kTRUE;
-
-
//__________________________________________________________________________
AliMUONTrackReconstructorK::AliMUONTrackReconstructorK()
: AliMUONVTrackReconstructor()
}
// Look for compatible hitForRec(s) in the other station
- if (fgkMakeTrackCandidatesFast) hitFound = FollowLinearTrackInStation(*track,7-istat);
+ if (AliMUONReconstructor::GetRecoParam()->MakeTrackCandidatesFast()) hitFound = FollowLinearTrackInStation(*track,7-istat);
else {
// First recompute track parameters and covariances on station(1..) 5 using Kalman filter
// (to make sure all tracks are treated in the same way)
// Retrace tracks using Kalman filter and remove bad ones
- if (fgkMakeTrackCandidatesFast) {
+ if (AliMUONReconstructor::GetRecoParam()->MakeTrackCandidatesFast()) {
fRecTracksPtr->Compress(); // this is essential before checking tracks
Int_t currentNRecTracks = fNRecTracks;
RetraceTrack(*track,kTRUE);
// Remove the track if the normalized chi2 is too high
- if (track->GetNormalizedChi2() > fgkSigmaToCutForTracking * fgkSigmaToCutForTracking) {
+ if (track->GetNormalizedChi2() > AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking() *
+ AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking()) {
fRecTracksPtr->Remove(track);
fNRecTracks--;
}
fRecTracksPtr->Compress(); // this is essential before checking tracks
// Keep all different tracks or only the best ones as required
- if (fgkTrackAllTracks) RemoveIdenticalTracks();
+ if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) RemoveIdenticalTracks();
else RemoveDoubleTracks();
AliDebug(1,Form("Number of good candidates = %d",fNRecTracks));
AliMUONTrackExtrap::AddMCSEffect(trackParamAtHit,AliMUONConstants::ChamberThicknessInX0(),1.);
// reset propagator for smoother
- if (fgkRunSmoother) trackParamAtHit->ResetPropagator();
+ if (AliMUONReconstructor::GetRecoParam()->UseSmoother()) trackParamAtHit->ResetPropagator();
// add MCS in missing chambers if any (at most 2 chambers can be missing according to tracking criteria)
currentChamber = trackParamAtHit->GetHitForRecPtr()->GetChamberNumber();
while (currentChamber < expectedChamber) {
// extrapolation to the missing chamber (update the propagator)
- AliMUONTrackExtrap::ExtrapToZCov(trackParamAtHit, AliMUONConstants::DefaultChamberZ(expectedChamber), fgkRunSmoother);
+ AliMUONTrackExtrap::ExtrapToZCov(trackParamAtHit, AliMUONConstants::DefaultChamberZ(expectedChamber),
+ AliMUONReconstructor::GetRecoParam()->UseSmoother());
// add MCS effect
AliMUONTrackExtrap::AddMCSEffect(trackParamAtHit,AliMUONConstants::ChamberThicknessInX0(),1.);
expectedChamber--;
}
// extrapolation to the plane of the hitForRec attached to the current trackParamAtHit (update the propagator)
- AliMUONTrackExtrap::ExtrapToZCov(trackParamAtHit, trackParamAtHit->GetHitForRecPtr()->GetZ(), fgkRunSmoother);
+ AliMUONTrackExtrap::ExtrapToZCov(trackParamAtHit, trackParamAtHit->GetHitForRecPtr()->GetZ(),
+ AliMUONReconstructor::GetRecoParam()->UseSmoother());
- if (fgkRunSmoother) {
+ if (AliMUONReconstructor::GetRecoParam()->UseSmoother()) {
// save extrapolated parameters for smoother
trackParamAtHit->SetExtrapParameters(trackParamAtHit->GetParameters());
hitFound = FollowTrackInStation(*track,station);
// Try to recover track if required
- if (!hitFound && fgkRecoverTracks) hitFound = RecoverTrack(*track,station);
+ if (!hitFound && AliMUONReconstructor::GetRecoParam()->RecoverTracks()) hitFound = RecoverTrack(*track,station);
// remove track if no hit found
if (!hitFound) {
fRecTracksPtr->Compress(); // this is essential before checking tracks
// Keep only the best tracks if required
- if (!fgkTrackAllTracks) RemoveDoubleTracks();
+ if (!AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) RemoveDoubleTracks();
}
}
Double_t chi2OfHitForRec;
- Double_t maxChi2OfHitForRec = 2. * fgkSigmaToCutForTracking * fgkSigmaToCutForTracking; // 2 because 2 quantities in chi2
+ Double_t maxChi2OfHitForRec = 2. * AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking() *
+ AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking(); // 2 because 2 quantities in chi2
Double_t addChi2TrackAtHit1;
Double_t addChi2TrackAtHit2;
Double_t bestAddChi2TrackAtHit1 = 1.e10;
AliMUONTrackExtrap::AddMCSEffect(&extrapTrackParamAtCh,AliMUONConstants::ChamberThicknessInX0(),1.);
// reset propagator for smoother
- if (fgkRunSmoother) extrapTrackParamAtCh.ResetPropagator();
+ if (AliMUONReconstructor::GetRecoParam()->UseSmoother()) extrapTrackParamAtCh.ResetPropagator();
// Add MCS in the missing chamber if any (only 1 chamber can be missing according to tracking criteria)
if (ch1 < ch2 && extrapTrackParamAtCh.GetHitForRecPtr()->GetChamberNumber() > ch2 + 1) {
// extrapolation to the missing chamber
- AliMUONTrackExtrap::ExtrapToZCov(&extrapTrackParamAtCh, AliMUONConstants::DefaultChamberZ(ch2 + 1), fgkRunSmoother);
+ AliMUONTrackExtrap::ExtrapToZCov(&extrapTrackParamAtCh, AliMUONConstants::DefaultChamberZ(ch2 + 1),
+ AliMUONReconstructor::GetRecoParam()->UseSmoother());
// add MCS effect
AliMUONTrackExtrap::AddMCSEffect(&extrapTrackParamAtCh,AliMUONConstants::ChamberThicknessInX0(),1.);
}
//Extrapolate trackCandidate to chamber "ch2"
- AliMUONTrackExtrap::ExtrapToZCov(&extrapTrackParamAtCh, AliMUONConstants::DefaultChamberZ(ch2), fgkRunSmoother);
+ AliMUONTrackExtrap::ExtrapToZCov(&extrapTrackParamAtCh, AliMUONConstants::DefaultChamberZ(ch2),
+ AliMUONReconstructor::GetRecoParam()->UseSmoother());
// Printout for debuging
if ((AliLog::GetDebugLevel("MUON","AliMUONTrackReconstructorK") >= 2) || (AliLog::GetGlobalDebugLevel() >= 2)) {
if (!TryOneHitForRecFast(extrapTrackParamAtCh, hitForRecCh2)) continue;
// try to add the current hit accuratly
- chi2OfHitForRec = TryOneHitForRec(extrapTrackParamAtCh, hitForRecCh2, extrapTrackParamAtHit2, fgkRunSmoother);
+ chi2OfHitForRec = TryOneHitForRec(extrapTrackParamAtCh, hitForRecCh2, extrapTrackParamAtHit2,
+ AliMUONReconstructor::GetRecoParam()->UseSmoother());
// if good chi2 then try to attach a hitForRec in the other chamber too
if (chi2OfHitForRec < maxChi2OfHitForRec) {
cout << " look for second hits in chamber(1..): " << ch1+1 << " ..." << endl;
}
- if (fgkRunSmoother) {
+ if (AliMUONReconstructor::GetRecoParam()->UseSmoother()) {
// save extrapolated parameters for smoother
extrapTrackParamAtHit2.SetExtrapParameters(extrapTrackParamAtHit2.GetParameters());
AliMUONTrackExtrap::AddMCSEffect(&extrapTrackParam,AliMUONConstants::ChamberThicknessInX0(),1.);
// reset propagator for smoother
- if (fgkRunSmoother) extrapTrackParam.ResetPropagator();
+ if (AliMUONReconstructor::GetRecoParam()->UseSmoother()) extrapTrackParam.ResetPropagator();
//Extrapolate track parameters to chamber "ch1"
- AliMUONTrackExtrap::ExtrapToZCov(&extrapTrackParam, AliMUONConstants::DefaultChamberZ(ch1), fgkRunSmoother);
+ AliMUONTrackExtrap::ExtrapToZCov(&extrapTrackParam, AliMUONConstants::DefaultChamberZ(ch1),
+ AliMUONReconstructor::GetRecoParam()->UseSmoother());
for (Int_t hit1 = 0; hit1 < fNHitsForRecPerChamber[ch1]; hit1++) {
if (!TryOneHitForRecFast(extrapTrackParam, hitForRecCh1)) continue;
// try to add the current hit accuratly
- chi2OfHitForRec = TryOneHitForRec(extrapTrackParam, hitForRecCh1, extrapTrackParamAtHit1, fgkRunSmoother);
+ chi2OfHitForRec = TryOneHitForRec(extrapTrackParam, hitForRecCh1, extrapTrackParamAtHit1,
+ AliMUONReconstructor::GetRecoParam()->UseSmoother());
// if good chi2 then consider to add the 2 hitForRec to the "trackCandidate"
if (chi2OfHitForRec < maxChi2OfHitForRec) {
<< " (Chi2 = " << chi2OfHitForRec << ")" << endl;
}
- if (fgkRunSmoother) {
+ if (AliMUONReconstructor::GetRecoParam()->UseSmoother()) {
// save extrapolated parameters for smoother
extrapTrackParamAtHit1.SetExtrapParameters(extrapTrackParamAtHit1.GetParameters());
// Compute new track parameters including "hitForRecCh1" using kalman filter
addChi2TrackAtHit1 = RunKalmanFilter(extrapTrackParamAtHit1);
- if (fgkTrackAllTracks) {
+ if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
// copy trackCandidate into a new track put at the end of fRecTracksPtr and add the new hitForRec's
newTrack = new ((*fRecTracksPtr)[fRecTracksPtr->GetLast()+1]) AliMUONTrack(trackCandidate);
UpdateTrack(*newTrack,extrapTrackParamAtHit1,extrapTrackParamAtHit2,addChi2TrackAtHit1,addChi2TrackAtHit2);
if (!foundSecondHit) {
foundOneHit = kTRUE;
- if (fgkTrackAllTracks) {
+ if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
// copy trackCandidate into a new track put at the end of fRecTracksPtr and add the new hitForRec's
newTrack = new ((*fRecTracksPtr)[fRecTracksPtr->GetLast()+1]) AliMUONTrack(trackCandidate);
UpdateTrack(*newTrack,extrapTrackParamAtHit2,addChi2TrackAtHit2);
// 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 hitForRec has been found
- if (fgkTrackAllTracks || !foundTwoHits) {
+ if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks() || !foundTwoHits) {
// Printout for debuging
if ((AliLog::GetDebugLevel("MUON","AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
AliMUONTrackExtrap::AddMCSEffect(&extrapTrackParamAtCh,AliMUONConstants::ChamberThicknessInX0(),1.);
//Extrapolate trackCandidate to chamber "ch1"
- AliMUONTrackExtrap::ExtrapToZCov(&extrapTrackParamAtCh, AliMUONConstants::DefaultChamberZ(ch1), fgkRunSmoother);
+ AliMUONTrackExtrap::ExtrapToZCov(&extrapTrackParamAtCh, AliMUONConstants::DefaultChamberZ(ch1),
+ AliMUONReconstructor::GetRecoParam()->UseSmoother());
for (Int_t hit1 = 0; hit1 < fNHitsForRecPerChamber[ch1]; hit1++) {
if (!TryOneHitForRecFast(extrapTrackParamAtCh, hitForRecCh1)) continue;
// try to add the current hit accuratly
- chi2OfHitForRec = TryOneHitForRec(extrapTrackParamAtCh, hitForRecCh1, extrapTrackParamAtHit1, fgkRunSmoother);
+ chi2OfHitForRec = TryOneHitForRec(extrapTrackParamAtCh, hitForRecCh1, extrapTrackParamAtHit1,
+ AliMUONReconstructor::GetRecoParam()->UseSmoother());
// if good chi2 then consider to add hitForRecCh1
// We do not try to attach a hitForRec in the other chamber too since it has already been done above
<< " (Chi2 = " << chi2OfHitForRec << ")" << endl;
}
- if (fgkRunSmoother) {
+ if (AliMUONReconstructor::GetRecoParam()->UseSmoother()) {
// save extrapolated parameters for smoother
extrapTrackParamAtHit1.SetExtrapParameters(extrapTrackParamAtHit1.GetParameters());
// Compute new track parameters including "hitForRecCh1" using kalman filter
addChi2TrackAtHit1 = RunKalmanFilter(extrapTrackParamAtHit1);
- if (fgkTrackAllTracks) {
+ if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
// copy trackCandidate into a new track put at the end of fRecTracksPtr and add the new hitForRec's
newTrack = new ((*fRecTracksPtr)[fRecTracksPtr->GetLast()+1]) AliMUONTrack(trackCandidate);
UpdateTrack(*newTrack,extrapTrackParamAtHit1,addChi2TrackAtHit1);
}
// fill out the best track if required else clean up the fRecTracksPtr array
- if (!fgkTrackAllTracks) {
+ if (!AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
if (foundTwoHits) {
UpdateTrack(trackCandidate,bestTrackParamAtHit1,bestTrackParamAtHit2,bestAddChi2TrackAtHit1,bestAddChi2TrackAtHit2);
Bool_t AliMUONTrackReconstructorK::RunSmoother(AliMUONTrack &track)
{
/// Compute new track parameters and their covariances using smoother
- AliDebug(1,"Enter RunSmoother");
+ AliDebug(1,"Enter UseSmoother");
AliMUONTrackParam *previousTrackParam = (AliMUONTrackParam*) track.GetTrackParamAtHit()->First();
Int_t chamberId, detElemId;
Double_t chi2OfHitForRec, addChi2TrackAtHit, bestAddChi2TrackAtHit;
- Double_t maxChi2OfHitForRec = 2. * fgkSigmaToCutForTracking * fgkSigmaToCutForTracking; // 2 because 2 quantities in chi2
+ Double_t maxChi2OfHitForRec = 2. * AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking() *
+ AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking(); // 2 because 2 quantities in chi2
Bool_t foundOneHit, trackModified;
AliMUONHitForRec *hitForRec;
AliMUONTrackParam *trackParam, *previousTrackParam, *nextTrackParam;
AliMUONTrack *track, *nextTrack;
AliMUONTrackParam *trackParamAtHit, *worstTrackParamAtHit, *previousTrackParam, *nextTrackParam;
Bool_t smoothed;
+ Double_t sigmaCut2 = AliMUONReconstructor::GetRecoParam()->GetSigmaCutForImprovement() *
+ AliMUONReconstructor::GetRecoParam()->GetSigmaCutForImprovement();
// Remove double track to improve only "good" tracks
RemoveDoubleTracks();
// Run smoother if required
smoothed = kFALSE;
- if (fgkRunSmoother) smoothed = RunSmoother(*track);
+ if (AliMUONReconstructor::GetRecoParam()->UseSmoother()) smoothed = RunSmoother(*track);
// Use standard procedure to compute local chi2 if smoother not required or not working
if (!smoothed) {
}
// Check whether the worst chi2 is under requirement or not
- if (worstLocalChi2 < 2. * fgkSigmaToCutForImprovement * fgkSigmaToCutForImprovement) { // 2 because 2 quantities in chi2
+ if (worstLocalChi2 < 2. * sigmaCut2) { // 2 because 2 quantities in chi2
track->SetImproved(kTRUE);
break;
}
// update track parameters (using smoother if required) if not already done
if (!track->IsImproved()) {
smoothed = kFALSE;
- if (fgkRunSmoother) smoothed = RunSmoother(*track);
+ if (AliMUONReconstructor::GetRecoParam()->UseSmoother()) smoothed = RunSmoother(*track);
if (!smoothed) track->UpdateCovTrackParamAtHit();
}
private:
- // Parameters for track reconstruction
- static const Bool_t fgkRunSmoother; ///< kTRUE to run the smoother
-
-
- // Functions
/// Not implemented copy constructor
AliMUONTrackReconstructorK (const AliMUONTrackReconstructorK& rhs);
/// Not implemented copy assignment operator
#include "AliMUONTracker.h"
+#include "AliMUONReconstructor.h"
+#include "AliMUONRecoParam.h"
#include "AliMUONTrack.h"
#include "AliMUONTrackExtrap.h"
#include "AliMUONTrackHitPattern.h"
{
/// constructor
if (fTransformer && fDigitMaker)
- {
fTrackHitPatternMaker = new AliMUONTrackHitPattern(*fTransformer,*fDigitMaker);
- }
}
//_____________________________________________________________________________
}
//_____________________________________________________________________________
-Int_t
-AliMUONTracker::LoadClusters(TTree* clustersTree)
+Int_t AliMUONTracker::LoadClusters(TTree* clustersTree)
{
/// Load clusterStore and triggerStore from clustersTree
delete fClusterStore;
}
//_____________________________________________________________________________
-Int_t
-AliMUONTracker::Clusters2Tracks(AliESDEvent* esd)
+Int_t AliMUONTracker::Clusters2Tracks(AliESDEvent* esd)
{
- /// Performs the tracking and store the resulting tracks in
- /// the ESD
+ /// Performs the tracking and store the resulting tracks in the ESD
+ AliDebug(1,"");
+ AliCodeTimerAuto("")
- if (!fClusterStore)
- {
+ if (!fTrackReco) CreateTrackReconstructor();
+
+ // if the required tracking mode does not exist
+ if (!fTrackReco) return 1;
+
+ if (!fClusterStore) {
AliError("ClusterStore is NULL");
return 2;
}
- if (!fTriggerStore)
- {
+ if (!fTriggerStore) {
AliError("TriggerStore is NULL");
return 3;
}
- AliMUONVTrackStore* trackStore(0x0);
- AliMUONVTriggerTrackStore* triggerTrackStore(0x0);
-
// Make tracker tracks
- if ( fClusterStore )
- {
- trackStore = new AliMUONTrackStoreV1;
- Bool_t alone = ( ( fTriggerStore && fTriggerCircuit ) ? kFALSE : kTRUE );
- fTrackReco->EventReconstruct(*fClusterStore,*trackStore);
- }
+ AliMUONVTrackStore* trackStore = new AliMUONTrackStoreV1;
+ fTrackReco->EventReconstruct(*fClusterStore,*trackStore);
- if ( fTriggerStore && fTriggerCircuit )
- {
- // Make trigger tracks
+ // Make trigger tracks
+ AliMUONVTriggerTrackStore* triggerTrackStore(0x0);
+ if ( fTriggerCircuit ) {
triggerTrackStore = new AliMUONTriggerTrackStoreV1;
- Bool_t alone = ( fClusterStore ? kFALSE : kTRUE );
fTrackReco->EventReconstructTrigger(*fTriggerCircuit,*fTriggerStore,*triggerTrackStore);
}
- if ( trackStore && triggerTrackStore && fTriggerStore && fTrackHitPatternMaker )
- {
+ // Match tracker/trigger tracks
+ if ( triggerTrackStore && fTrackHitPatternMaker ) {
fTrackReco->ValidateTracksWithTrigger(*trackStore,*triggerTrackStore,*fTriggerStore,*fTrackHitPatternMaker);
}
- if( trackStore && triggerTrackStore && fTriggerStore && fTrigChamberEff){
+ // Compute trigger chamber efficiency
+ if( triggerTrackStore && fTrigChamberEff){
AliCodeTimerStart("EventChamberEff");
fTrigChamberEff->EventChamberEff(*fTriggerStore,*triggerTrackStore,*trackStore);
AliCodeTimerStop("EventChamberEff");
}
-
+
+ // Fill ESD
FillESD(*trackStore,esd);
// cleanup
}
//_____________________________________________________________________________
-void
-AliMUONTracker::FillESD(AliMUONVTrackStore& trackStore, AliESDEvent* esd) const
+void AliMUONTracker::FillESD(AliMUONVTrackStore& trackStore, AliESDEvent* esd) const
{
/// Fill the ESD from the trackStore
AliDebug(1,"");
}
//_____________________________________________________________________________
-void AliMUONTracker::SetOption(Option_t* option)
+void AliMUONTracker::CreateTrackReconstructor()
{
- /// set reconstructor class
+ /// Create track reconstructor, depending on tracking mode set in RecoParam
+
+ TString opt(AliMUONReconstructor::GetRecoParam()->GetTrackingMode());
+ opt.ToUpper();
- if (strstr(option,"Original"))
+ if (strstr(opt,"ORIGINAL"))
{
- fTrackReco = new AliMUONTrackReconstructor;
+ fTrackReco = new AliMUONTrackReconstructor();
}
- else
+ else if (strstr(opt,"KALMAN"))
{
fTrackReco = new AliMUONTrackReconstructorK();
}
+ else
+ {
+ AliError(Form("tracking mode \"%s\" does not exist",opt.Data()));
+ return;
+ }
+
+ AliInfo(Form("Will use %s for tracking",fTrackReco->ClassName()));
}
//_____________________________________________________________________________
-void
-AliMUONTracker::UnloadClusters()
+void AliMUONTracker::UnloadClusters()
{
/// Delete internal clusterStore
delete fClusterStore;
AliMUONTriggerChamberEff* chamberEff=0);
virtual ~AliMUONTracker();
- /// Main entry point.
virtual Int_t Clusters2Tracks(AliESDEvent* esd);
- ///
virtual Int_t LoadClusters(TTree* clustersTree);
- ///
virtual void UnloadClusters();
/// Dummy implementation
virtual Int_t RefitInward(AliESDEvent* /*event*/) {return 0;}
/// Dummy implementation
virtual AliCluster *GetCluster(Int_t /*index*/) const {return 0;}
- /// Set option
- void SetOption(Option_t* opt);
private:
/// Not implemented
/// Not implemented
AliMUONTracker& operator=(const AliMUONTracker& rhs);
+ void CreateTrackReconstructor();
+
void FillESD(AliMUONVTrackStore& trackStore, AliESDEvent* esd) const;
private:
const AliMUONDigitMaker* fDigitMaker; //!< digit maker (not owner)
const AliMUONGeometryTransformer* fTransformer; //!< geometry transformer (not owner)
- const AliMUONTriggerCircuit* fTriggerCircuit; //!< trigger circuit (not owner)
+ const AliMUONTriggerCircuit* fTriggerCircuit; //!< trigger circuit (not owner)
AliMUONTriggerChamberEff* fTrigChamberEff; //!< trigger efficiency (not owner)
AliMUONTrackHitPattern* fTrackHitPatternMaker; //!< trigger hit pattern maker
- AliMUONVTrackReconstructor* fTrackReco; //!< track reconstructor
+ AliMUONVTrackReconstructor* fTrackReco; //!< track reconstructor
AliMUONVClusterStore* fClusterStore; //!< cluster container
AliMUONVTriggerStore* fTriggerStore; //!< trigger information
/// previous station.
/// - *fgkImproveTracks* : if this flag is set to 'true', we try to improve the quality
/// of the tracks at the end of the tracking by removing clusters that do not pass
-/// new quality cut (within the limit that we must keep at least one cluster per
-/// the station).
+/// new quality cut (the track is removed is it does not contain enough cluster anymore).
+/// - *fgkComplementTracks* : if this flag is set to 'true', we try to improve the quality
+/// of the tracks at the end of the tracking by adding potentially missing clusters
+/// (we may have 2 clusters in the same chamber because of the overlapping of detection
+/// elements, which is not handle by the tracking algorithm).
/// - *fgkSigmaToCutForImprovement* : quality cut used when we try to improve the
/// quality of the tracks.
///
ClassImp(AliMUONVTrackReconstructor) // Class implementation in ROOT context
/// \endcond
-
-//************* Defaults parameters for reconstruction
-const Double_t AliMUONVTrackReconstructor::fgkDefaultMinBendingMomentum = 3.0;
-const Double_t AliMUONVTrackReconstructor::fgkDefaultMaxBendingMomentum = 3000.0;
-const Double_t AliMUONVTrackReconstructor::fgkDefaultMaxNormChi2MatchTrigger = 16.0;
-const Double_t AliMUONVTrackReconstructor::fgkMaxTrackingDistanceBending = 2.;
-const Double_t AliMUONVTrackReconstructor::fgkMaxTrackingDistanceNonBending = 2.;
-
-const Double_t AliMUONVTrackReconstructor::fgkSigmaToCutForTracking = 6.0;
-const Bool_t AliMUONVTrackReconstructor::fgkMakeTrackCandidatesFast = kFALSE;
-const Bool_t AliMUONVTrackReconstructor::fgkTrackAllTracks = kTRUE;
-const Bool_t AliMUONVTrackReconstructor::fgkRecoverTracks = kTRUE;
-const Bool_t AliMUONVTrackReconstructor::fgkComplementTracks = kTRUE;
-const Bool_t AliMUONVTrackReconstructor::fgkImproveTracks = kTRUE;
-const Double_t AliMUONVTrackReconstructor::fgkSigmaToCutForImprovement = 5.0;
-
-
//__________________________________________________________________________
AliMUONVTrackReconstructor::AliMUONVTrackReconstructor()
: TObject(),
- fMinBendingMomentum(fgkDefaultMinBendingMomentum),
- fMaxBendingMomentum(fgkDefaultMaxBendingMomentum),
- fMaxNormChi2MatchTrigger(fgkDefaultMaxNormChi2MatchTrigger),
fHitsForRecPtr(0x0),
fNHitsForRec(0),
fNHitsForRecPerChamber(0x0),
// Follow tracks in stations(1..) 3, 2 and 1
FollowTracks();
// Complement the reconstructed tracks
- if (fgkComplementTracks) ComplementTracks();
+ if (AliMUONReconstructor::GetRecoParam()->ComplementTracks()) ComplementTracks();
// Improve the reconstructed tracks
- if (fgkImproveTracks) ImproveTracks();
+ if (AliMUONReconstructor::GetRecoParam()->ImproveTracks()) ImproveTracks();
// Remove double tracks
RemoveDoubleTracks();
// Fill AliMUONTrack data members
continue;
}
// check for bending momentum within tolerances
- if ((bendingMomentum < fMaxBendingMomentum) && (bendingMomentum > fMinBendingMomentum))
+ if ((bendingMomentum < AliMUONReconstructor::GetRecoParam()->GetMaxBendingMomentum()) &&
+ (bendingMomentum > AliMUONReconstructor::GetRecoParam()->GetMinBendingMomentum()))
{
// make new segment
segment = new ((*segments)[segments->GetLast()+1]) AliMUONObjectPair(hit1Ptr, hit2Ptr, kFALSE, kFALSE);
Double_t dX = hitForRec->GetNonBendingCoor() - (trackParam.GetNonBendingCoor() + trackParam.GetNonBendingSlope() * dZ);
Double_t dY = hitForRec->GetBendingCoor() - (trackParam.GetBendingCoor() + trackParam.GetBendingSlope() * dZ);
- if (TMath::Abs(dX) > fgkMaxTrackingDistanceNonBending || TMath::Abs(dY) > fgkMaxTrackingDistanceBending) return kFALSE;
+ if (TMath::Abs(dX) > AliMUONReconstructor::GetRecoParam()->GetMaxNonBendingDistanceToTrack() ||
+ TMath::Abs(dY) > AliMUONReconstructor::GetRecoParam()->GetMaxBendingDistanceToTrack()) return kFALSE;
return kTRUE;
Double_t chi2WithOneHitForRec = 1.e10;
Double_t chi2WithTwoHitForRec = 1.e10;
- Double_t maxChi2WithOneHitForRec = 2. * fgkSigmaToCutForTracking * fgkSigmaToCutForTracking; // 2 because 2 quantities in chi2
- Double_t maxChi2WithTwoHitForRec = 4. * fgkSigmaToCutForTracking * fgkSigmaToCutForTracking; // 4 because 4 quantities in chi2
+ Double_t maxChi2WithOneHitForRec = 2. * AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking() *
+ AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking(); // 2 because 2 quantities in chi2
+ Double_t maxChi2WithTwoHitForRec = 4. * AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking() *
+ AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking(); // 4 because 4 quantities in chi2
Double_t bestChi2WithOneHitForRec = maxChi2WithOneHitForRec;
Double_t bestChi2WithTwoHitForRec = maxChi2WithTwoHitForRec;
Bool_t foundOneHit = kFALSE;
<< " (Chi2 = " << chi2WithTwoHitForRec << ")" << endl;
}
- if (fgkTrackAllTracks) {
+ if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
// copy trackCandidate into a new track put at the end of fRecTracksPtr and add the new hitForRec's
newTrack = new ((*fRecTracksPtr)[fRecTracksPtr->GetLast()+1]) AliMUONTrack(trackCandidate);
extrapTrackParamAtHit1.SetRemovable(kTRUE);
if (!foundSecondHit) {
foundOneHit = kTRUE;
- if (fgkTrackAllTracks) {
+ if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
// copy trackCandidate into a new track put at the end of fRecTracksPtr and add the new hitForRec's
newTrack = new ((*fRecTracksPtr)[fRecTracksPtr->GetLast()+1]) AliMUONTrack(trackCandidate);
extrapTrackParamAtHit2.SetRemovable(kFALSE);
// 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 hitForRec has been found
- if (fgkTrackAllTracks || !foundTwoHits) {
+ if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks() || !foundTwoHits) {
// Printout for debuging
if ((AliLog::GetDebugLevel("MUON","AliMUONVTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
<< " (Chi2 = " << chi2WithOneHitForRec << ")" << endl;
}
- if (fgkTrackAllTracks) {
+ if (AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
// copy trackCandidate into a new track put at the end of fRecTracksPtr and add the new hitForRec's
newTrack = new ((*fRecTracksPtr)[fRecTracksPtr->GetLast()+1]) AliMUONTrack(trackCandidate);
extrapTrackParamAtHit1.SetRemovable(kFALSE);
}
// fill out the best track if required else clean up the fRecTracksPtr array
- if (!fgkTrackAllTracks) {
+ if (!AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) {
if (foundTwoHits) {
bestTrackParamAtHit1.SetRemovable(kTRUE);
trackCandidate.AddTrackParamAtHit(&bestTrackParamAtHit1,bestTrackParamAtHit1.GetHitForRecPtr());
chi2 = 0.;
for (Int_t iVar = 0; iVar < 3; iVar++) chi2 += distTriggerTrack[iVar]*distTriggerTrack[iVar];
chi2 /= 3.; // Normalized Chi2: 3 degrees of freedom (X,Y,slopeY)
- if (chi2 < fMaxNormChi2MatchTrigger)
+ if (chi2 < AliMUONReconstructor::GetRecoParam()->GetMaxNormChi2MatchTrigger())
{
Bool_t isDoubleTrack = (TMath::Abs(chi2 - minChi2MatchTrigger)<1.);
- if (chi2 < minChi2MatchTrigger && chi2 < fMaxNormChi2MatchTrigger)
+ if (chi2 < minChi2MatchTrigger && chi2 < AliMUONReconstructor::GetRecoParam()->GetMaxNormChi2MatchTrigger())
{
if(isDoubleTrack)
{
///
// Author: Philippe Pillot
+#include "AliMUONReconstructor.h"
+#include "AliMUONRecoParam.h"
+
#include <TObject.h>
-class TClonesArray;
class AliMUONTrack;
class AliMUONTrackParam;
class AliMUONHitForRec;
class AliMUONGeometryTransformer;
class AliMUONDigitMaker;
class AliMUONTriggerCircuit;
+class TClonesArray;
class AliMUONVTrackReconstructor : public TObject {
// Parameters for track reconstruction: public methods
// Get and Set, Set to defaults
/// Return minimum value (GeV/c) of momentum in bending plane
- Double_t GetMinBendingMomentum() const {return fMinBendingMomentum;}
+ Double_t GetMinBendingMomentum() const {return AliMUONReconstructor::GetRecoParam()->GetMinBendingMomentum();}
// Reconstructed tracks
/// Return number of reconstructed tracks
protected:
- // Defaults parameters for reconstruction
- static const Double_t fgkDefaultMinBendingMomentum; ///< default min. bending momentum for reconstruction
- static const Double_t fgkDefaultMaxBendingMomentum; ///< default max. bending momentum for reconstruction
- static const Double_t fgkDefaultMaxNormChi2MatchTrigger; ///< default maximum normalized chi2 of tracking/trigger track matching
-
- // Parameters for track reconstruction
- static const Double_t fgkSigmaToCutForTracking; ///< cut in sigma to apply on cluster local chi2 and track global chi2 during tracking
- static const Double_t fgkSigmaToCutForImprovement; ///< cut in sigma to apply on cluster local chi2 during track improvement
- static const Bool_t fgkMakeTrackCandidatesFast; ///< kTRUE to make track candidates assuming linear propagation between stations 4 and 5
- static const Bool_t fgkTrackAllTracks; ///< kTRUE to track all the possible candidates; kFALSE to track only the best ones
- static const Double_t fgkMaxTrackingDistanceBending; ///< Maximum distance to the track to search for compatible hitForRec(s) in bending direction
- static const Double_t fgkMaxTrackingDistanceNonBending; ///< Maximum distance to the track to search for compatible hitForRec(s) in non bending direction
- static const Bool_t fgkRecoverTracks; ///< kTRUE to try to recover the tracks being lost during reconstruction
- static const Bool_t fgkComplementTracks; ///< kTRUE to try to complete the reconstructed tracks by adding missing clusters
- static const Bool_t fgkImproveTracks; ///< kTRUE to try to improve the reconstructed tracks by removing bad clusters
-
- // Parameters for track reconstruction
- Double_t fMinBendingMomentum; ///< minimum value (GeV/c) of momentum in bending plane
- Double_t fMaxBendingMomentum; ///< maximum value (GeV/c) of momentum in bending plane
- Double_t fMaxNormChi2MatchTrigger; ///< maximum normalized chi2 of tracking/trigger track matching
-
TClonesArray* fHitsForRecPtr; ///< pointer to the array of hits for reconstruction
Int_t fNHitsForRec; ///< number of hits for reconstruction
Int_t* fNHitsForRecPerChamber; ///< number of HitsForRec
#pragma link C++ class AliMUONVTriggerTrackStore+;
#pragma link C++ class AliMUONTriggerTrackStoreV1+;
+#pragma link C++ class AliMUONRecoParam+;
+
// calibration
#pragma link C++ class AliMUONDigitCalibrator+;
#pragma link C++ class AliMUONPadStatusMaker+;
AliMUONClusterStoreV2.cxx \
AliMUONClusterStoreV2Iterator.cxx \
AliMUONVTrackStore.cxx \
- AliMUONTrackStoreV1.cxx
+ AliMUONTrackStoreV1.cxx \
+ AliMUONRecoParam.cxx
HDRS:= $(SRCS:.cxx=.h)
// By Laurent Aphecetche
#if !defined(__CINT__) || defined(__MAKECINT__)
+#include "AliMUONReconstructor.h"
+#include "AliMUONRecoParam.h"
#include "AliCDBManager.h"
#include "AliMagFMaps.h"
#include "AliTracker.h"
#include "AliReconstruction.h"
#include <TRandom.h>
+//#include <TObjectTable.h>
#endif
void runReconstruction(int run, int seed, const char* input, const char* recoptions)
{
AliCDBManager::Instance()->SetRun(run);
+
gRandom->SetSeed(seed);
+
AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
AliTracker::SetFieldMap(field, kFALSE);
+
AliReconstruction* MuonRec = new AliReconstruction("galice.root");
MuonRec->SetInput(input);
MuonRec->SetRunVertexFinder(kFALSE);
MuonRec->SetOption("MUON",recoptions);
// MuonRec->SetEventRange(319,319);
MuonRec->SetWriteAOD();
+
+ AliMUONRecoParam *muonRecoParam = AliMUONRecoParam::GetLowFluxParam();
+ AliMUONReconstructor::SetRecoParam(muonRecoParam);
+ muonRecoParam->Print("FULL");
+
MuonRec->Run();
+
delete MuonRec;
+
//gObjectTable->Print();
}