]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
moved recparam retrieval inside event loop so they are properly set by the framework
authorjklay <jklay@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 26 Sep 2008 21:55:51 +0000 (21:55 +0000)
committerjklay <jklay@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 26 Sep 2008 21:55:51 +0000 (21:55 +0000)
EMCAL/AliEMCALClusterizer.h
EMCAL/AliEMCALClusterizerv1.cxx
EMCAL/AliEMCALClusterizerv1.h
EMCAL/AliEMCALReconstructor.cxx
EMCAL/AliEMCALReconstructor.h
EMCAL/AliEMCALTracker.cxx

index 7a29f42bd488ece8258c3cb5c7259d6b23eb93ab..388213f078a0ad188f49a84695f8585c4b5feb15 100644 (file)
@@ -12,7 +12,7 @@
 //  August 2002 Yves Schutz: clone PHOS as closely as possible and intoduction
 //                           of new  IO (à la PHOS)
 // --- ROOT system ---
-
+#include "AliLog.h"
 #include "TObject.h" 
 class TTree;
 
@@ -41,6 +41,7 @@ public:
 
   virtual void SetInput(TTree *digitsTree);
   virtual void SetOutput(TTree *clustersTree);
+  virtual void InitParameters() { AliInfo("Overload this method."); }
 
 protected:
 
index de902b3f67c491583908c07a86d6eaa5ae048390..ed4b4ee1a3a4de1980dbc25809a7a242d6085eb1 100644 (file)
@@ -94,7 +94,6 @@ AliEMCALClusterizerv1::AliEMCALClusterizerv1()
 {
   // ctor with the indication of the file where header Tree and digits Tree are stored
   
-  InitParameters() ; 
   Init() ;
 }
 
@@ -112,8 +111,6 @@ AliEMCALClusterizerv1::AliEMCALClusterizerv1(AliEMCALGeometry* geometry)
   // use this contructor to avoid usage of Init() which uses runloader
   // change needed by HLT - MP
 
-  InitParameters() ;
-
   // Note for the future: the use on runloader should be avoided or optional at least
   // another way is to make Init virtual and protected at least such that the deriving classes can overload
   // Init() ;
@@ -372,17 +369,16 @@ void AliEMCALClusterizerv1::InitParameters()
   const AliEMCALRecParam* recParam = AliEMCALReconstructor::GetRecParam();
   if(!recParam) {
     AliFatal("Reconstruction parameters for EMCAL not set!");
-  }
-  else {
+  } else {
     fECAClusteringThreshold = recParam->GetClusteringThreshold();
     fECAW0                  = recParam->GetW0();
     fMinECut                = recParam->GetMinECut();    
     fToUnfold               = recParam->GetUnfold();
     if(fToUnfold) AliWarning("Cluster Unfolding ON. Implementing only for eta=0 case!!!"); 
     fECALocMaxCut           = recParam->GetLocMaxCut();
-
+    
     AliDebug(1,Form("Reconstruction parameters: fECAClusteringThreshold=%.3f, fECAW=%.3f, fMinECut=%.3f, fToUnfold=%d, fECALocMaxCut=%.3f",
-                fECAClusteringThreshold,fECAW0,fMinECut,fToUnfold,fECALocMaxCut));
+                   fECAClusteringThreshold,fECAW0,fMinECut,fToUnfold,fECALocMaxCut));
   }
 
 }
index afeefc7e2e09382e5952ca5464b67381d885e3cd..137a1a53c9afbd0b0aa71bf2da665a9390e47e0b 100644 (file)
@@ -84,7 +84,7 @@ private:
   Bool_t  FindFit(AliEMCALRecPoint * emcRP, AliEMCALDigit ** MaxAt, Float_t * maxAtEnergy, 
                  Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
   void Init() ;
-  void InitParameters() ;
+  void InitParameters();
 
   virtual void   MakeUnfolding();
   void           UnfoldCluster(AliEMCALRecPoint * iniEmc, Int_t Nmax, 
index eab5af81de27f7309ab98c8468f948a5cea04d31..759a7634f8f41b80299ccd0b1e5f863e22d79a66 100644 (file)
@@ -49,7 +49,6 @@
 #include "AliRawReader.h"
 #include "AliCDBEntry.h"
 #include "AliCDBManager.h"
-#include "AliEMCALRecParam.h"
 #include "AliEMCALGeometry.h"
 #include "AliEMCAL.h"
 #include "AliEMCALHistoUtilities.h"
@@ -69,7 +68,6 @@ AliEMCALReconstructor::AliEMCALReconstructor()
   : fDebug(kFALSE), fList(0), fGeom(0) 
 {
   // ctor
-  InitRecParam();
 
   fgRawUtils = new AliEMCALRawUtils;
   fgClusterizer = new AliEMCALClusterizerv1;
@@ -113,23 +111,6 @@ void AliEMCALReconstructor::Init()
   fList = AliEMCALHistoUtilities::GetTriggersListOfHists(kTRUE);
 }
 
-//____________________________________________________________________________
-void AliEMCALReconstructor::InitRecParam() const
-{
-  // Check if the instance of AliEMCALRecParam exists, 
-  // if not, get it from OCDB if available, otherwise create a default one
-
-  if(!fgkRecParam) {
-    fgkRecParam = dynamic_cast<const AliEMCALRecParam*>(AliReconstructor::GetRecoParam(6));
-  }
-  
-  if(!fgkRecParam){
-    AliWarning("The Reconstruction parameters for EMCAL nonitialized - Used default one");
-    fgkRecParam = new AliEMCALRecParam();
-  }
-
-}
-
 //____________________________________________________________________________
 void AliEMCALReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) const
 {
@@ -142,7 +123,7 @@ void AliEMCALReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree)
   AliCodeTimerAuto("")
 
   ReadDigitsArrayFromTree(digitsTree);
-
+  fgClusterizer->InitParameters();
   fgClusterizer->SetOutput(clustersTree);
 
   if(fgDigitsArr && fgDigitsArr->GetEntries()) {
@@ -177,11 +158,11 @@ void AliEMCALReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digits
   //must be done here because, in constructor, option is not yet known
   fgRawUtils->SetOption(GetOption());
 
-  fgRawUtils->SetRawFormatHighLowGainFactor(fgkRecParam->GetHighLowGainFactor());
-  fgRawUtils->SetRawFormatOrder(fgkRecParam->GetOrderParameter());
-  fgRawUtils->SetRawFormatTau(fgkRecParam->GetTau());
-  fgRawUtils->SetNoiseThreshold(fgkRecParam->GetNoiseThreshold());
-  fgRawUtils->SetNPedSamples(fgkRecParam->GetNPedSamples());
+  fgRawUtils->SetRawFormatHighLowGainFactor(GetRecParam()->GetHighLowGainFactor());
+  fgRawUtils->SetRawFormatOrder(GetRecParam()->GetOrderParameter());
+  fgRawUtils->SetRawFormatTau(GetRecParam()->GetTau());
+  fgRawUtils->SetNoiseThreshold(GetRecParam()->GetNoiseThreshold());
+  fgRawUtils->SetNPedSamples(GetRecParam()->GetNPedSamples());
 
   fgRawUtils->Raw2Digits(rawReader,digitsArr);
 
index ca4f49e6572e46b6b93778dc57c8320eebba16c8..76830df6c31c6bb06e33b76b9062118541fc31a4 100644 (file)
@@ -12,7 +12,7 @@
 //*--         Dmitri Peressounko (SUBATECH & Kurchatov Institute)
 
 // --- ROOT system ---
-
+#include "AliEMCALRecParam.h"
 #include "AliReconstructor.h" 
 #include "AliEMCALTracker.h" 
 
@@ -67,11 +67,11 @@ public:
 
   void   ReadDigitsArrayFromTree(TTree *digitsTree) const;
 
-  void InitRecParam() const;
-
   TList *GetList() {return fList;}
 
-  static const AliEMCALRecParam* GetRecParam(){ return fgkRecParam;}
+  static const AliEMCALRecParam* GetRecParam() { 
+    return dynamic_cast<const AliEMCALRecParam*>(AliReconstructor::GetRecoParam(6)); }
+
   static TClonesArray* GetDigitsArr() {return fgDigitsArr;}
 
 private:
@@ -82,7 +82,8 @@ private:
   AliEMCALGeometry         *fGeom;           // pointer to the EMCAL geometry
 
   static AliEMCALClusterizer* fgClusterizer; // clusterizer
-  static const AliEMCALRecParam*   fgkRecParam; // reconstruction parameters for EMCAL
+  static const AliEMCALRecParam*   fgkRecParam; // reconstruction
+                                               // parameters for EMCAL
   static AliEMCALRawUtils*   fgRawUtils;  // raw utilities class -
                                          // only need one per reco
   static TClonesArray*       fgDigitsArr; // Array with EMCAL digits
index eea5888a210cf3d1161d741dc749754a46c12a91..9e08247faa3f137ebe0318f277d1c7c77c1e8a8a 100644 (file)
@@ -85,8 +85,7 @@ AliEMCALTracker::AliEMCALTracker()
        // and all collections to NULL.
        // Output file name is set to a default value.
        //
-       
-       InitParameters();
+  InitParameters();
 }
 //
 //------------------------------------------------------------------------------