]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- Modified the class AliMUONRecoParam to inherit from the new bass
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 30 Nov 2007 16:25:19 +0000 (16:25 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 30 Nov 2007 16:25:19 +0000 (16:25 +0000)
  class AliDetectorRecoParam
- Use the base class AliRecoParam to handle the class AliMUONRecoParam
(Philippe P.)

MUON/AliMUONRecoParam.cxx
MUON/AliMUONRecoParam.h
MUON/AliMUONReconstructor.cxx
MUON/AliMUONReconstructor.h
MUON/runReconstruction.C

index 2001c86d530421efc614e95e892f189ae2f573c5..25b28d3912c58266360edaf580a055d30cf71f9a 100644 (file)
@@ -35,7 +35,7 @@ ClassImp(AliMUONRecoParam)
 
 //_____________________________________________________________________________
 AliMUONRecoParam::AliMUONRecoParam()
-: TObject(),
+: AliDetectorRecoParam(),
   fClusteringMode("MLEM"),
   fTrackingMode("KALMAN"),
   fMinBendingMomentum(0.),
@@ -57,6 +57,7 @@ AliMUONRecoParam::AliMUONRecoParam()
   fUseSmoother(kFALSE)
 {
   /// Constructor
+  SetNameTitle("MUON","MUON");
   
   // use the default parameters for low flux environment
   SetLowFluxParam();
@@ -150,8 +151,8 @@ void AliMUONRecoParam::Print(Option_t *option) const
   
   cout<<Form("Tracking mode = %s",fTrackingMode.Data())<<endl;
   
-  if (fCombinedClusterTrackReco) cout<<"Combined cluster/track reconstruction is on"<<endl;
-  else cout<<"Combined cluster/track reconstruction is off"<<endl;
+  if (fCombinedClusterTrackReco) cout<<"Combined cluster/track reconstruction: ON"<<endl;
+  else cout<<"Combined cluster/track reconstruction: OFF"<<endl;
   
   cout<<Form("Bending momentum range = [%5.2f,%5.2f]",fMinBendingMomentum,fMaxBendingMomentum)<<endl;
   
index ea21a2f2d637d1c8a8c4964fb6ef91c196f39536..0c618346ba0f6d20366bb646db46ea02cd1520ff 100644 (file)
@@ -9,10 +9,10 @@
 ///
 //  Author: Philippe Pillot
 
-#include "TObject.h"
+#include "AliDetectorRecoParam.h"
 #include "TString.h"
 
-class AliMUONRecoParam : public TObject
+class AliMUONRecoParam : public AliDetectorRecoParam
 {
  public: 
   AliMUONRecoParam();
index 91406d2e9a9d7bb6c85b7743fb228c36ff193377..691613603671418468e20c32a4c85e1887327ab7 100644 (file)
@@ -22,7 +22,7 @@
 /// The clustering mode and the associated parameters can be changed by using
 /// AliMUONRecoParam *muonRecoParam = AliMUONRecoParam::GetLow(High)FluxParam();
 /// muonRecoParam->Set...(); // see methods in AliMUONRecoParam.h for details
-/// AliMUONReconstructor::SetRecoParam(muonRecoParam);
+/// AliRecoParam::Instance()->RegisterRecoParam(muonRecoParam);
 ///
 /// Valid modes are :
 ///
 #include "AliMpCDB.h"
 #include "AliMpConstants.h"
 
+#include "AliRecoParam.h"
 #include "AliRawReader.h"
 #include "AliCDBManager.h"
 #include "AliCodeTimer.h"
 #include "AliLog.h"
 
 #include <Riostream.h>
+#include <TObjArray.h>
 #include <TClonesArray.h>
 #include <TString.h>
 #include <TTree.h>
@@ -140,12 +142,6 @@ 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();
-  }
-  
 }
 
 //_____________________________________________________________________________
@@ -166,17 +162,31 @@ AliMUONReconstructor::~AliMUONReconstructor()
 }
 
 //_____________________________________________________________________________
-void AliMUONReconstructor::SetRecoParam(AliMUONRecoParam *param)
+const AliMUONRecoParam* AliMUONReconstructor::GetRecoParam()
 {
-  /// set reconstruction parameters
+  /// get reconstruction parameters
   
-  // remove existing parameters
-  if (fgRecoParam) {
-    cout<<"AliMUONReconstructor::SetRecoParam: Reconstruction parameters already initialized - overwrite them"<<endl;
-    delete fgRecoParam;
+  if (!fgRecoParam) {
+    
+    // get reconstruction parameters from AliRecoParam if any
+    TObjArray *recoParams = AliRecoParam::Instance()->GetRecoParam("MUON");
+    
+    if (recoParams) {
+      
+      fgRecoParam = (AliMUONRecoParam*) recoParams->Last();
+      
+    } else {
+      
+      // initialize reconstruction parameters if not already done
+      cout<<"W-AliMUONReconstructor::GetRecoParam: Reconstruction parameters not initialized - Use default one"<<endl;
+      fgRecoParam = AliMUONRecoParam::GetLowFluxParam();
+      AliRecoParam::Instance()->RegisterRecoParam(fgRecoParam);
+      
+    }
+    
   }
   
-  fgRecoParam = param;
+  return fgRecoParam;
 }
 
 //_____________________________________________________________________________
@@ -389,7 +399,7 @@ AliMUONReconstructor::CreateClusterServer() const
 
   AliDebug(1,"");
   
-  AliMUONVClusterFinder* clusterFinder = CreateClusterFinder(fgRecoParam->GetClusteringMode());
+  AliMUONVClusterFinder* clusterFinder = CreateClusterFinder(GetRecoParam()->GetClusteringMode());
   
   if ( !clusterFinder ) return;
   
index 3a20a065866cd7b96d9f78c2c11c817c20021b40..d8d0fa997d6da643288deedc36010effc305c094 100644 (file)
@@ -57,9 +57,7 @@ public:
   
   virtual AliTracker* CreateTracker() const;
   
-  static void SetRecoParam(AliMUONRecoParam *param);
-  /// return reconstruction parametres
-  static const AliMUONRecoParam* GetRecoParam() {return fgRecoParam;}
+  static const AliMUONRecoParam* GetRecoParam();
   
 private:
   /// Not implemented
index e35e52a69a7d961df4c5681b2a77a88c13b009c5..17cb69d3358c47464cbb56b0ed8a9f9f5384b4e8 100644 (file)
@@ -21,6 +21,7 @@
 #if !defined(__CINT__) || defined(__MAKECINT__)
 #include "AliMUONReconstructor.h"
 #include "AliMUONRecoParam.h"
+#include "AliRecoParam.h"
 #include "AliCDBManager.h"
 #include "AliMagFMaps.h"
 #include "AliTracker.h"
@@ -53,9 +54,8 @@ void runReconstruction(int seed, const char* input, const char* recoptions)
   
   AliMUONRecoParam *muonRecoParam = AliMUONRecoParam::GetLowFluxParam();
   muonRecoParam->CombineClusterTrackReco(kTRUE);
-
-  AliMUONReconstructor::SetRecoParam(muonRecoParam);
   muonRecoParam->Print("FULL");
+  AliRecoParam::Instance()->RegisterRecoParam(muonRecoParam);
   
   MuonRec->Run();