From 15d30ed49c0118c7b2efe3f68ab04ab2e5d148a1 Mon Sep 17 00:00:00 2001 From: ivana Date: Fri, 30 Nov 2007 16:25:19 +0000 Subject: [PATCH] - Modified the class AliMUONRecoParam to inherit from the new bass class AliDetectorRecoParam - Use the base class AliRecoParam to handle the class AliMUONRecoParam (Philippe P.) --- MUON/AliMUONRecoParam.cxx | 7 +++--- MUON/AliMUONRecoParam.h | 4 ++-- MUON/AliMUONReconstructor.cxx | 40 ++++++++++++++++++++++------------- MUON/AliMUONReconstructor.h | 4 +--- MUON/runReconstruction.C | 4 ++-- 5 files changed, 34 insertions(+), 25 deletions(-) diff --git a/MUON/AliMUONRecoParam.cxx b/MUON/AliMUONRecoParam.cxx index 2001c86d530..25b28d3912c 100644 --- a/MUON/AliMUONRecoParam.cxx +++ b/MUON/AliMUONRecoParam.cxx @@ -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<Set...(); // see methods in AliMUONRecoParam.h for details -/// AliMUONReconstructor::SetRecoParam(muonRecoParam); +/// AliRecoParam::Instance()->RegisterRecoParam(muonRecoParam); /// /// Valid modes are : /// @@ -99,12 +99,14 @@ #include "AliMpCDB.h" #include "AliMpConstants.h" +#include "AliRecoParam.h" #include "AliRawReader.h" #include "AliCDBManager.h" #include "AliCodeTimer.h" #include "AliLog.h" #include +#include #include #include #include @@ -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"<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"<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; diff --git a/MUON/AliMUONReconstructor.h b/MUON/AliMUONReconstructor.h index 3a20a065866..d8d0fa997d6 100644 --- a/MUON/AliMUONReconstructor.h +++ b/MUON/AliMUONReconstructor.h @@ -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 diff --git a/MUON/runReconstruction.C b/MUON/runReconstruction.C index e35e52a69a7..17cb69d3358 100644 --- a/MUON/runReconstruction.C +++ b/MUON/runReconstruction.C @@ -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(); -- 2.43.5