New class AliMUONRecoParamto handle reconstruction parameters
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Oct 2007 10:34:22 +0000 (10:34 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Oct 2007 10:34:22 +0000 (10:34 +0000)
- now  parameters can be tuned from the macro runReconstruction.C
- note that this class also handles clustering and tracking modes (MLEM, KALMAN, ...)
(Philippe P.)

15 files changed:
MUON/AliMUONRecoParam.cxx [new file with mode: 0644]
MUON/AliMUONRecoParam.h [new file with mode: 0644]
MUON/AliMUONReconstructor.cxx
MUON/AliMUONReconstructor.h
MUON/AliMUONTrackReconstructor.cxx
MUON/AliMUONTrackReconstructor.h
MUON/AliMUONTrackReconstructorK.cxx
MUON/AliMUONTrackReconstructorK.h
MUON/AliMUONTracker.cxx
MUON/AliMUONTracker.h
MUON/AliMUONVTrackReconstructor.cxx
MUON/AliMUONVTrackReconstructor.h
MUON/MUONrecLinkDef.h
MUON/libMUONrec.pkg
MUON/runReconstruction.C

diff --git a/MUON/AliMUONRecoParam.cxx b/MUON/AliMUONRecoParam.cxx
new file mode 100644 (file)
index 0000000..f193eae
--- /dev/null
@@ -0,0 +1,203 @@
+/**************************************************************************
+* 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;
+  
+}
+
diff --git a/MUON/AliMUONRecoParam.h b/MUON/AliMUONRecoParam.h
new file mode 100644 (file)
index 0000000..68a147b
--- /dev/null
@@ -0,0 +1,154 @@
+#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
+
index a06e87d..1b32c18 100644 (file)
@@ -84,6 +84,7 @@
 #include "AliMUONTriggerCrateStore.h"
 #include "AliMUONTriggerStoreV1.h"
 #include "AliMUONVClusterFinder.h"
+#include "AliMUONRecoParam.h"
 #include "AliMpCDB.h"
 #include "AliRawReader.h"
 #include "AliCodeTimer.h"
@@ -96,6 +97,8 @@
 ClassImp(AliMUONReconstructor)
 /// \endcond 
 
+AliMUONRecoParam* AliMUONReconstructor::fgRecoParam = 0x0; // reconstruction parameters
+
 //_____________________________________________________________________________
 AliMUONReconstructor::AliMUONReconstructor() : 
 AliReconstructor(),
@@ -122,6 +125,11 @@ fTrigChamberEff(0x0)
   // 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();
+  }
   
 }
 
@@ -144,6 +152,20 @@ AliMUONReconstructor::~AliMUONReconstructor()
 }
 
 //_____________________________________________________________________________
+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
 {
@@ -163,14 +185,14 @@ AliMUONReconstructor::Clusterize(const AliMUONVDigitStore& digitStore,
 {
   /// 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()))
@@ -289,14 +311,12 @@ AliTracker*
 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;
 }
@@ -305,7 +325,7 @@ AliMUONReconstructor::CreateTracker() const
 void
 AliMUONReconstructor::CreateClusterReconstructor() const
 {
-  /// Create cluster reconstructor, depending on GetOption()
+  /// Create cluster reconstructor, depending on clustering mode set in RecoParam
   
   AliCodeTimerAuto("")
 
@@ -313,7 +333,7 @@ AliMUONReconstructor::CreateClusterReconstructor() const
   
   AliMUONVClusterFinder* clusterFinder(0x0);
   
-  TString opt(GetOption());
+  TString opt(fgRecoParam->GetClusteringMode());
   opt.ToUpper();
   
   if ( strstr(opt,"PRECLUSTERV2") )
@@ -358,14 +378,11 @@ AliMUONReconstructor::CreateClusterReconstructor() const
   } 
   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);
 }
index 56ea533..245ecd4 100644 (file)
@@ -38,6 +38,8 @@ class AliMUONVTrackStore;
 
 class AliMUONTriggerChamberEff;
 
+class AliMUONRecoParam;
+
 class AliMUONReconstructor : public AliReconstructor
 {
 public:
@@ -53,7 +55,11 @@ 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&);
@@ -93,6 +99,8 @@ private:
   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
 };
 
index 74a9f20..96aac39 100644 (file)
@@ -48,11 +48,6 @@ void TrackChi2(Int_t &nParam, Double_t *gradient, Double_t &chi2, Double_t *para
 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()
@@ -105,7 +100,7 @@ void AliMUONTrackReconstructor::MakeTrackCandidates()
       }
       
       // 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
@@ -123,7 +118,7 @@ void AliMUONTrackReconstructor::MakeTrackCandidates()
   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));
@@ -141,6 +136,9 @@ void AliMUONTrackReconstructor::FollowTracks()
   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
@@ -164,14 +162,14 @@ void AliMUONTrackReconstructor::FollowTracks()
       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
          
@@ -225,7 +223,7 @@ void AliMUONTrackReconstructor::FollowTracks()
       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) {
@@ -239,7 +237,7 @@ void AliMUONTrackReconstructor::FollowTracks()
     fRecTracksPtr->Compress();
     
     // Keep only the best tracks if required
-    if (!fgkTrackAllTracks) RemoveDoubleTracks();
+    if (!AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) RemoveDoubleTracks();
     
   }
   
@@ -262,13 +260,13 @@ void AliMUONTrackReconstructor::FollowTracks()
     } 
     
     // 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();
@@ -328,8 +326,10 @@ Bool_t AliMUONTrackReconstructor::FollowTrackInStation(AliMUONTrack &trackCandid
   
   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;
@@ -424,7 +424,7 @@ Bool_t AliMUONTrackReconstructor::FollowTrackInStation(AliMUONTrack &trackCandid
                 << " (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);
@@ -454,7 +454,7 @@ Bool_t AliMUONTrackReconstructor::FollowTrackInStation(AliMUONTrack &trackCandid
       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);
@@ -480,7 +480,7 @@ Bool_t AliMUONTrackReconstructor::FollowTrackInStation(AliMUONTrack &trackCandid
   
   // 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)) {
@@ -516,7 +516,7 @@ Bool_t AliMUONTrackReconstructor::FollowTrackInStation(AliMUONTrack &trackCandid
               << " (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);
@@ -541,7 +541,7 @@ Bool_t AliMUONTrackReconstructor::FollowTrackInStation(AliMUONTrack &trackCandid
   }
   
   // 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);
       
@@ -804,8 +804,10 @@ void AliMUONTrackReconstructor::SetVertexForFit(AliMUONTrack &trackCandidate)
   /// 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
@@ -968,6 +970,8 @@ void AliMUONTrackReconstructor::ComplementTracks()
   AliMUONTrackParam copyOfTrackParam;
   AliMUONTrackParam trackParamAtHit;
   AliMUONTrackParam bestTrackParamAtHit;
+  Double_t sigmaCut2 = AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking() *
+                       AliMUONReconstructor::GetRecoParam()->GetSigmaCutForTracking();
   
   // Remove double track to complete only "good" tracks
   RemoveDoubleTracks();
@@ -979,7 +983,7 @@ void AliMUONTrackReconstructor::ComplementTracks()
     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);
@@ -1045,6 +1049,8 @@ void AliMUONTrackReconstructor::ImproveTracks()
   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();
@@ -1086,7 +1092,7 @@ void AliMUONTrackReconstructor::ImproveTracks()
       }
       
       // 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;
       }
index c7e782a..fb9f282 100644 (file)
@@ -36,12 +36,6 @@ class AliMUONTrackReconstructor : public AliMUONVTrackReconstructor
 
  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
index 09ae226..1320e84 100644 (file)
 ClassImp(AliMUONTrackReconstructorK) // Class implementation in ROOT context
 /// \endcond
 
-//************* Defaults parameters for reconstruction
-const Bool_t AliMUONTrackReconstructorK::fgkRunSmoother = kTRUE;
-
-
   //__________________________________________________________________________
 AliMUONTrackReconstructorK::AliMUONTrackReconstructorK()
   : AliMUONVTrackReconstructor()
@@ -99,7 +95,7 @@ void AliMUONTrackReconstructorK::MakeTrackCandidates()
       }
       
       // 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)
@@ -120,7 +116,7 @@ void AliMUONTrackReconstructorK::MakeTrackCandidates()
   
   
   // 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;
@@ -131,7 +127,8 @@ void AliMUONTrackReconstructorK::MakeTrackCandidates()
       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--;
       }
@@ -143,7 +140,7 @@ void AliMUONTrackReconstructorK::MakeTrackCandidates()
   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));
@@ -219,22 +216,24 @@ void AliMUONTrackReconstructorK::RetracePartialTrack(AliMUONTrack &trackCandidat
     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());
       
@@ -294,7 +293,7 @@ void AliMUONTrackReconstructorK::FollowTracks()
       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) {
@@ -307,7 +306,7 @@ void AliMUONTrackReconstructorK::FollowTracks()
     fRecTracksPtr->Compress(); // this is essential before checking tracks
     
     // Keep only the best tracks if required
-    if (!fgkTrackAllTracks) RemoveDoubleTracks();
+    if (!AliMUONReconstructor::GetRecoParam()->TrackAllTracks()) RemoveDoubleTracks();
     
   }
   
@@ -338,7 +337,8 @@ Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandi
   }
   
   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;
@@ -362,18 +362,20 @@ Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandi
   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)) {
@@ -395,7 +397,8 @@ Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandi
     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) {
@@ -408,7 +411,7 @@ Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandi
         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());
         
@@ -426,10 +429,11 @@ Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandi
       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++) {
         
@@ -439,7 +443,8 @@ Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandi
        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) {
@@ -452,7 +457,7 @@ Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandi
                 << " (Chi2 = " << chi2OfHitForRec << ")" << endl;
          }
           
-          if (fgkRunSmoother) {
+          if (AliMUONReconstructor::GetRecoParam()->UseSmoother()) {
             // save extrapolated parameters for smoother
             extrapTrackParamAtHit1.SetExtrapParameters(extrapTrackParamAtHit1.GetParameters());
             
@@ -463,7 +468,7 @@ Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandi
           // 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);
@@ -498,7 +503,7 @@ Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandi
       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);
@@ -528,7 +533,7 @@ Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandi
   
   // 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)) {
@@ -539,7 +544,8 @@ Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandi
     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++) {
       
@@ -551,7 +557,8 @@ Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandi
       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
@@ -564,7 +571,7 @@ Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandi
               << " (Chi2 = " << chi2OfHitForRec << ")" << endl;
        }
         
-       if (fgkRunSmoother) {
+       if (AliMUONReconstructor::GetRecoParam()->UseSmoother()) {
           // save extrapolated parameters for smoother
           extrapTrackParamAtHit1.SetExtrapParameters(extrapTrackParamAtHit1.GetParameters());
           
@@ -575,7 +582,7 @@ Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandi
         // 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);
@@ -604,7 +611,7 @@ Bool_t AliMUONTrackReconstructorK::FollowTrackInStation(AliMUONTrack &trackCandi
   }
   
   // 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);
       
@@ -833,7 +840,7 @@ Bool_t AliMUONTrackReconstructorK::RecoverTrack(AliMUONTrack &trackCandidate, In
 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();
   
@@ -935,7 +942,8 @@ void AliMUONTrackReconstructorK::ComplementTracks()
   
   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;
@@ -1026,6 +1034,8 @@ void AliMUONTrackReconstructorK::ImproveTracks()
   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();
@@ -1040,7 +1050,7 @@ void AliMUONTrackReconstructorK::ImproveTracks()
       
       // 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) {
@@ -1075,7 +1085,7 @@ void AliMUONTrackReconstructorK::ImproveTracks()
       }
       
       // 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;
       }
@@ -1169,7 +1179,7 @@ void AliMUONTrackReconstructorK::Finalize()
     // 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();
     }
     
index 75c5ffc..bf1492f 100644 (file)
@@ -35,11 +35,6 @@ class AliMUONTrackReconstructorK : public AliMUONVTrackReconstructor
 
  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
index ad0bcfc..d54051a 100644 (file)
@@ -28,6 +28,8 @@
 
 #include "AliMUONTracker.h"
 
+#include "AliMUONReconstructor.h"
+#include "AliMUONRecoParam.h"
 #include "AliMUONTrack.h"
 #include "AliMUONTrackExtrap.h"
 #include "AliMUONTrackHitPattern.h"
@@ -72,9 +74,7 @@ AliMUONTracker::AliMUONTracker(const AliMUONDigitMaker* digitMaker,
 {
   /// constructor
   if (fTransformer && fDigitMaker)
-  {
     fTrackHitPatternMaker = new AliMUONTrackHitPattern(*fTransformer,*fDigitMaker);
-  }
 }
 
 //_____________________________________________________________________________
@@ -88,8 +88,7 @@ AliMUONTracker::~AliMUONTracker()
 }
 
 //_____________________________________________________________________________
-Int_t 
-AliMUONTracker::LoadClusters(TTree* clustersTree)
+Int_t AliMUONTracker::LoadClusters(TTree* clustersTree)
 {
   /// Load clusterStore and triggerStore from clustersTree
   delete fClusterStore;
@@ -123,54 +122,51 @@ AliMUONTracker::LoadClusters(TTree* clustersTree)
 }
 
 //_____________________________________________________________________________
-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
@@ -181,8 +177,7 @@ AliMUONTracker::Clusters2Tracks(AliESDEvent* esd)
 }
 
 //_____________________________________________________________________________
-void 
-AliMUONTracker::FillESD(AliMUONVTrackStore& trackStore, AliESDEvent* esd) const
+void AliMUONTracker::FillESD(AliMUONVTrackStore& trackStore, AliESDEvent* esd) const
 {
   /// Fill the ESD from the trackStore
   AliDebug(1,"");
@@ -237,23 +232,32 @@ AliMUONTracker::FillESD(AliMUONVTrackStore& trackStore, AliESDEvent* esd) const
 }
 
 //_____________________________________________________________________________
-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;
index b46ec6b..20af046 100644 (file)
@@ -34,13 +34,10 @@ class AliMUONTracker : public AliTracker
                 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
@@ -49,8 +46,6 @@ class AliMUONTracker : public AliTracker
   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
@@ -58,15 +53,17 @@ private:
   /// 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
   
index 63a2365..682733d 100644 (file)
 ///   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),
@@ -279,9 +262,9 @@ void AliMUONVTrackReconstructor::MakeTracks()
   // 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
@@ -335,7 +318,8 @@ TClonesArray* AliMUONVTrackReconstructor::MakeSegmentsInStation(Int_t station)
         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);
@@ -492,7 +476,8 @@ Bool_t AliMUONVTrackReconstructor::TryOneHitForRecFast(const AliMUONTrackParam &
   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;
   
@@ -567,8 +552,10 @@ Bool_t AliMUONVTrackReconstructor::FollowLinearTrackInStation(AliMUONTrack &trac
   
   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;
@@ -641,7 +628,7 @@ Bool_t AliMUONVTrackReconstructor::FollowLinearTrackInStation(AliMUONTrack &trac
                 << " (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);
@@ -675,7 +662,7 @@ Bool_t AliMUONVTrackReconstructor::FollowLinearTrackInStation(AliMUONTrack &trac
       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);
@@ -703,7 +690,7 @@ Bool_t AliMUONVTrackReconstructor::FollowLinearTrackInStation(AliMUONTrack &trac
   
   // 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)) {
@@ -741,7 +728,7 @@ Bool_t AliMUONVTrackReconstructor::FollowLinearTrackInStation(AliMUONTrack &trac
               << " (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);
@@ -768,7 +755,7 @@ Bool_t AliMUONVTrackReconstructor::FollowLinearTrackInStation(AliMUONTrack &trac
   }
   
   // 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());
@@ -859,10 +846,10 @@ void AliMUONVTrackReconstructor::ValidateTracksWithTrigger(AliMUONVTrackStore& t
       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)
           {
index 4e65100..a8d0366 100644 (file)
 ///
 //  Author: Philippe Pillot
 
+#include "AliMUONReconstructor.h"
+#include "AliMUONRecoParam.h"
+
 #include <TObject.h>
 
-class TClonesArray;
 class AliMUONTrack;
 class AliMUONTrackParam;
 class AliMUONHitForRec;
@@ -26,6 +28,7 @@ class AliMUONVTriggerStore;
 class AliMUONGeometryTransformer;
 class AliMUONDigitMaker;
 class AliMUONTriggerCircuit;
+class TClonesArray;
 
 class AliMUONVTrackReconstructor : public TObject {
 
@@ -36,7 +39,7 @@ 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
@@ -62,27 +65,6 @@ class AliMUONVTrackReconstructor : public TObject {
   
  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
index d0a1574..9e550ae 100644 (file)
@@ -45,6 +45,8 @@
 #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+;
index f1c11fc..b39a2f0 100644 (file)
@@ -36,7 +36,8 @@ SRCS:= AliMUONClusterReconstructor.cxx \
        AliMUONClusterStoreV2.cxx \
        AliMUONClusterStoreV2Iterator.cxx \
        AliMUONVTrackStore.cxx \
-       AliMUONTrackStoreV1.cxx
+       AliMUONTrackStoreV1.cxx \
+       AliMUONRecoParam.cxx
        
 HDRS:= $(SRCS:.cxx=.h)
 
index 73bb2dc..e4bc284 100644 (file)
 // 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);
@@ -43,8 +49,15 @@ void runReconstruction(int run, int seed, const char* input, const char* recopti
   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();
 }