]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Moved reading corrections into base class AliForwardMultiplicityBase.
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 27 Jan 2011 15:12:54 +0000 (15:12 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 27 Jan 2011 15:12:54 +0000 (15:12 +0000)
Fixes to AliFMDMCDensityCalculator - didn't call parent Init.
Provide options for enabling/disabling corrections

PWG2/FORWARD/analysis2/AddTaskFMD.C
PWG2/FORWARD/analysis2/AliFMDCorrector.cxx
PWG2/FORWARD/analysis2/AliFMDCorrector.h
PWG2/FORWARD/analysis2/AliFMDMCCorrector.cxx
PWG2/FORWARD/analysis2/AliFMDMCDensityCalculator.cxx
PWG2/FORWARD/analysis2/AliForwardMCCorrectionsTask.cxx
PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx
PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.cxx
PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.h
PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.cxx

index 06cc038778c12412ee4947daa21361bebd3add19..6713fc84d5b3888e570203911d8c96317aa79e9f 100644 (file)
@@ -69,6 +69,12 @@ AddTaskFMD(Bool_t mc)
   task->GetDensityCalculator().SetMaxParticles(2);
   // Set the lower multiplicity cut.  Overrides setting in energy loss fits.
   task->GetDensityCalculator().SetMultCut(0.3);
+  // Whether to use the secondary map correction
+  task->GetCorrections().SetUseSecondaryMap(true);
+  // Whether to use the vertex bias correction
+  task->GetCorrections().SetUseVertexBias(true);
+  // Whether to use the vertex bias correction
+  task->GetCorrections().SetUseAcceptance(true);
   // Whether to use the merging efficiency correction 
   task->GetCorrections().SetUseMergingEfficiency(false);
   // Set the number of extra bins (beyond the secondary map border) 
index eeedace5a30d38d5d7d86af619c2c46cc3486e5b..830f20cb03c388b703ad7f4ebd0998b490889fde 100644 (file)
@@ -23,6 +23,9 @@ ClassImp(AliFMDCorrector)
 AliFMDCorrector::AliFMDCorrector()
   : TNamed(), 
     fRingHistos(),
+    fUseSecondaryMap(true),
+    fUseVertexBias(true),
+    fUseAcceptance(true),
     fUseMergingEfficiency(true),
     fDebug(0)
 {
@@ -33,6 +36,9 @@ AliFMDCorrector::AliFMDCorrector()
 AliFMDCorrector::AliFMDCorrector(const char* title)
   : TNamed("fmdCorrector", title), 
     fRingHistos(), 
+    fUseSecondaryMap(true),
+    fUseVertexBias(true),
+    fUseAcceptance(true),
     fUseMergingEfficiency(true),
     fDebug(0)
 {
@@ -52,6 +58,9 @@ AliFMDCorrector::AliFMDCorrector(const char* title)
 AliFMDCorrector::AliFMDCorrector(const AliFMDCorrector& o)
   : TNamed(o), 
     fRingHistos(), 
+    fUseSecondaryMap(o.fUseSecondaryMap),
+    fUseVertexBias(o.fUseVertexBias),
+    fUseAcceptance(o.fUseAcceptance),
     fUseMergingEfficiency(o.fUseMergingEfficiency),
     fDebug(o.fDebug)
 {
@@ -85,6 +94,9 @@ AliFMDCorrector::operator=(const AliFMDCorrector& o)
 
   fDebug   = o.fDebug;
   fRingHistos.Delete();
+  fUseSecondaryMap = o.fUseSecondaryMap;
+  fUseVertexBias = o.fUseVertexBias;
+  fUseAcceptance = o.fUseAcceptance;
   fUseMergingEfficiency = o.fUseMergingEfficiency;
   TIter    next(&o.fRingHistos);
   TObject* obj = 0;
@@ -93,6 +105,24 @@ AliFMDCorrector::operator=(const AliFMDCorrector& o)
   return *this;
 }
 
+//____________________________________________________________________
+void
+AliFMDCorrector::Init(const TAxis&)
+{
+  //
+  // Initialize this object
+  //
+  // Parameters:
+  //    etaAxis Eta axis to use
+  //
+  if (!fUseSecondaryMap)
+    AliWarning("Secondary maps not used - BE CAREFUL");
+  if (!fUseVertexBias)
+    AliWarning("Vertex bias not used");
+  if (!fUseAcceptance)
+    AliWarning("Acceptance from dead-channels not used");
+}
+
 //____________________________________________________________________
 AliFMDCorrector::RingHistos*
 AliFMDCorrector::GetRingHistos(UShort_t d, Char_t r) const
@@ -120,7 +150,7 @@ AliFMDCorrector::GetRingHistos(UShort_t d, Char_t r) const
 //____________________________________________________________________
 Bool_t
 AliFMDCorrector::Correct(AliForwardUtil::Histos& hists,
-                          UShort_t                vtxbin)
+                        UShort_t                vtxbin)
 {
   // 
   // Do the calculations 
@@ -140,33 +170,41 @@ AliFMDCorrector::Correct(AliForwardUtil::Histos& hists,
       Char_t      r  = (q == 0 ? 'I' : 'O');
       TH2D*       h  = hists.Get(d,r);
       RingHistos* rh = GetRingHistos(d,r);
-      TH2D*       bg = fcm.GetSecondaryMap()->GetCorrection(d, r, uvb);
-      TH2D*       ef = fcm.GetVertexBias()->GetCorrection(r, uvb);
-      TH2D*       ac = fcm.GetAcceptance()->GetCorrection(d, r, uvb);
-      if (!bg) { 
-       AliWarning(Form("No secondary correction for FMDM%d%c in vertex bin %d",
-                       d, r, uvb));
-       continue;
+
+      if (fUseSecondaryMap) {
+        TH2D*  bg = fcm.GetSecondaryMap()->GetCorrection(d, r, uvb);
+        if (!bg) {
+          AliWarning(Form("No secondary correction for FMDM%d%c in vertex bin %d",
+                          d, r, uvb));
+          continue;
+        }
+        // Divide by primary/total ratio
+        h->Divide(bg);
       }
-      if (!ef) { 
-       AliWarning(Form("No event %s vertex bias correction in vertex bin %d",
-                       (r == 'I' || r == 'i' ? "inner" : "outer"), uvb));
-       continue;
+      if (fUseVertexBias) {
+        TH2D*  ef = fcm.GetVertexBias()->GetCorrection(r, uvb);
+        if (!ef) {
+          AliWarning(Form("No event %s vertex bias correction in vertex bin %d",
+                          (r == 'I' || r == 'i' ? "inner" : "outer"), uvb));
+          continue;
+        }
+        // Divide by the event selection efficiency
+        h->Divide(ef);
       }
-      if (!ac) { 
-       AliWarning(Form("No acceptance correction for FMD%d%c in vertex bin %d",
+      if (fUseAcceptance) {
+        TH2D*  ac = fcm.GetAcceptance()->GetCorrection(d, r, uvb);
+        if (!ac) {
+          AliWarning(Form("No acceptance correction for FMD%d%c in vertex bin %d",
                        d, r, uvb));
-       continue;
+          continue;
+        }
+        // Divide by the acceptance correction
+        h->Divide(ac);
       }
 
-      // Divide by primary/total ratio
-      h->Divide(bg);
-      
-      // Divide by the event selection efficiency 
-      h->Divide(ef);
 
-      // Divide by the acceptance correction 
-      h->Divide(ac);
+
+      
 
       if (fUseMergingEfficiency) {
        if (!fcm.GetMergingEfficiency()) { 
@@ -250,7 +288,13 @@ AliFMDCorrector::Print(Option_t* /* option */) const
   char ind[gROOT->GetDirLevel()+1];
   for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' ';
   ind[gROOT->GetDirLevel()] = '\0';
-  std::cout << ind << "AliFMDCorrector: " << GetName() <<  std::endl;
+  std::cout << ind << "AliFMDCorrector: " << GetName() <<  "\n"
+            << std::boolalpha
+            << ind << " Use secondary maps:     " << fUseSecondaryMap << "\n"
+            << ind << " Use vertex bias:        " << fUseVertexBias << "\n"
+            << ind << " Use acceptance:         " << fUseAcceptance << "\n"
+            << ind << " Use merging efficiency: " << fUseMergingEfficiency
+            << std::endl;
 }
 
 //====================================================================
index c5671892c3251cad3a3fb8f3618535b5ddaee228..9df074d37ac47d6e910f1f66d6c67a2a152183a7 100644 (file)
@@ -64,6 +64,12 @@ public:
    */
   AliFMDCorrector& operator=(const AliFMDCorrector&);
   /** 
+   * Initialize this object
+   *
+   * @param etaAxis Eta axis to use  -- not used
+   */
+  virtual void Init(const TAxis& etaAxis);
+  /**
    * Do the calculations 
    * 
    * @param hists    Cache of histograms 
@@ -92,18 +98,60 @@ public:
    */
   void SetDebug(Int_t dbg=1) { fDebug = dbg; }
   /** 
+   * @{
+   * @name Enable/disable parts of the corrections
+   */
+  /** 
+   *  Whether to do correction for secondaries
+   *
+   * @param use If true, use the secondary correction
+   */
+  void SetUseSecondaryMap(Bool_t use=true) { fUseSecondaryMap = use; }
+  /**
+   * Check
+   *
+   * @return true if the correction for secondaries is done
+   */
+  Bool_t IsUseSecondaryMap() const { return fUseSecondaryMap; }
+  /**
+   *  Whether to do correction for vertex bias
+   *
+   * @param use If true, use the vertex bias correction
+   */
+  void SetUseVertexBias(Bool_t use=true) { fUseVertexBias = use; }
+  /**
+   * Check
+   *
+   * @return true if the correction for vertex bias is done
+   */
+  Bool_t IsUseVertexBias() const { return fUseVertexBias; }
+  /**
+   *  Whether to do correction for dead-channel acceptance
+   *
+   * @param use If true, use the dead-channel acceptance correction
+   */
+  void SetUseAcceptance(Bool_t use=true) { fUseAcceptance = use; }
+  /**
+   * Check
+   *
+   * @return true if the correction for dead-channel acceptance is done
+   */
+  Bool_t IsUseAcceptance() const { return fUseAcceptance; }
+  /**
    * Whether to use the merging efficiency correction
-   * 
+   *
    * @param use If true, use the merging efficiency correction
    */
   void SetUseMergingEfficiency(Bool_t use=true) { fUseMergingEfficiency = use; }
-  /** 
-   * Check 
-   * 
+  /**
+   * Check
+   *
    * @return true if the merging efficiency correction is used.
    */
   Bool_t IsUseMergingEfficiency() const { return fUseMergingEfficiency; }
-  /** 
+  /* @} */
+
+  /**
    * Print information
    * 
    * @param option Not used 
@@ -171,10 +219,13 @@ protected:
   RingHistos* GetRingHistos(UShort_t d, Char_t r) const;
 
   TList    fRingHistos;           // List of histogram containers
+  Bool_t   fUseSecondaryMap;      // Whether to do correction for secondaries
+  Bool_t   fUseVertexBias;        // Whether to do correction for vertex bias
+  Bool_t   fUseAcceptance;        // Whether to do correction for dead ch's.
   Bool_t   fUseMergingEfficiency; // Whether to use the merging efficiency
   Int_t    fDebug;                //  Debug level 
 
-  ClassDef(AliFMDCorrector,2); // Calculate Nch density 
+  ClassDef(AliFMDCorrector,2); // Correct the inclusive d2N/detadphi
 };
 
 #endif
index 68ee64af9b3346fb44459907554fa6ce96f6bc46..c59b2b174690d8472bb82d246bd25899e1997d9a 100644 (file)
@@ -25,8 +25,6 @@
 #include <TH2D.h>
 #include <TROOT.h>
 #include <TProfile2D.h>
-#include <iostream>
-#include <iomanip>
 
 ClassImp(AliFMDMCCorrector)
 #if 0
@@ -89,24 +87,28 @@ AliFMDMCCorrector::CorrectMC(AliForwardUtil::Histos& hists,
     for (UShort_t q=0; q<nr; q++) { 
       Char_t      r  = (q == 0 ? 'I' : 'O');
       TH2D*       h  = hists.Get(d,r);
-      TH2D*       bg = fcm.GetSecondaryMap()->GetCorrection(d,r,uvb);
-      TH2D*       ef = fcm.GetVertexBias()->GetCorrection(r, uvb);
-      if (!bg) { 
-       AliWarning(Form("No secondary correction for FMDM%d%c in vertex bin %d",
-                       d, r, uvb));
-       continue;
+
+
+      if (fUseSecondaryMap) {
+        TH2D*       bg = fcm.GetSecondaryMap()->GetCorrection(d,r,uvb);
+        if (!bg) {
+          AliWarning(Form("No secondary correction for FMDM%d%c in vertex bin %d",
+              d, r, uvb));
+          continue;
+        }
+        // Divide by primary/total ratio
+        h->Divide(bg);
       }
-      if (!ef) { 
-       AliWarning(Form("No event vertex bias correction in vertex bin %d",
+      if (fUseVertexBias) {
+        TH2D*       ef = fcm.GetVertexBias()->GetCorrection(r, uvb);
+        if (!ef) {
+          AliWarning(Form("No event vertex bias correction in vertex bin %d",
                        uvb));
-       continue;
+          continue;
+        }
+        // Divide by the event selection efficiency
+        h->Divide(ef);
       }
-
-      // Divide by primary/total ratio
-      h->Divide(bg);
-      
-      // Divide by the event selection efficiency 
-      h->Divide(ef);
     }
   }
   
@@ -123,6 +125,8 @@ AliFMDMCCorrector::Init(const TAxis& eAxis)
   // Parameters:
   //    etaAxis Eta axis to use 
   //
+  AliFMDCorrector::Init(eAxis);
+
   fFMD1i = Make(1,'I',eAxis);
   fFMD2i = Make(2,'I',eAxis);
   fFMD2o = Make(2,'O',eAxis);
index 775d4d43ddd84985105ed5ee337f57cf2cc8b89b..d338b629077792571c139f18ee2ea7b18dc277e8 100644 (file)
@@ -74,6 +74,7 @@ AliFMDMCDensityCalculator::Init(const TAxis& eAxis)
   // Parameters:
   //    etaAxis Eta axis to use 
   //
+  AliFMDDensityCalculator::Init(eAxis);
   fFMD1i  = Make(1,'I',eAxis);
   fFMD2i  = Make(2,'I',eAxis);
   fFMD2o  = Make(2,'O',eAxis);
index d973b5b5667eb48b481bda8057c7e7c7bd1ba6fe..6bce92382cdf3cc41a3f8bb697aa9dc042ac3761 100644 (file)
@@ -491,11 +491,11 @@ AliForwardMCCorrectionsTask::UserExec(Option_t*)
     return;
   }
 
-  UInt_t   triggers;
-  Bool_t   gotTrigggers;
-  Bool_t   gotInel;
-  Double_t vZ;
-  Bool_t   gotVertex;
+  // UInt_t   triggers;
+  // Bool_t   gotTrigggers = false;
+  Bool_t   gotInel = false;
+  // Double_t vZ;
+  Bool_t   gotVertex = false;
 #if 0
   // Use event inspector instead 
   // Get the triggers 
@@ -788,8 +788,8 @@ AliForwardMCCorrectionsTask::Terminate(Option_t*)
     // Get event counts 
     Int_t nEventsAll   = eventsAll->GetBinContent(v);
     Int_t nEventsTr    = eventsTr->GetBinContent(v);
-    Int_t nEventsVtx   = eventsVtx->GetBinContent(v);
-    Int_t nEventsTrVtx = eventsTrVtx->GetBinContent(v);
+    // Int_t nEventsVtx   = eventsVtx->GetBinContent(v);
+    // Int_t nEventsTrVtx = eventsTrVtx->GetBinContent(v);
 
     // Project event histograms, set names, and store  
     TH2D* primIAllV   = GetVertexProj(v, primIAll);
index 75e07db241eac4aee0f3d8910b59c62b05b36f92..cff88b5dab962ecd91ee028a843a9ee2825a352c 100644 (file)
@@ -27,8 +27,6 @@
 #include <TDirectory.h>
 #include <TTree.h>
 #include <TROOT.h>
-#include <iostream>
-#include <iomanip>
 
 //====================================================================
 AliForwardMCMultiplicityTask::AliForwardMCMultiplicityTask()
@@ -167,24 +165,10 @@ AliForwardMCMultiplicityTask::InitializeSubs()
   // Initialise the sub objects and stuff.  Called on first event 
   // 
   //
-  UInt_t what = AliForwardCorrectionManager::kAll;
-  if (!fEnableLowFlux) 
-    what ^= AliForwardCorrectionManager::kDoubleHit;
-  if (!fCorrections.IsUseMergingEfficiency())
-    what ^= AliForwardCorrectionManager::kMergingEfficiency;
-
-  AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
-  fcm.Init(fEventInspector.GetCollisionSystem(), 
-          fEventInspector.GetEnergy(),
-          fEventInspector.GetField(),
-          true,
-          what);
-  if (!CheckCorrections(what)) return;
-
-  const TAxis* pe = fcm.GetEtaAxis();
-  const TAxis* pv = fcm.GetVertexAxis();
-  if (!pe) AliFatal("No eta axis defined");
-  if (!pv) AliFatal("No vertex axis defined");
+  const TAxis* pe = 0;
+  const TAxis* pv = 0;
+
+  if (!ReadCorrections(pe,pv)) return;
 
   fHistos.Init(*pe);
   fAODFMD.Init(*pe);
@@ -258,32 +242,8 @@ AliForwardMCMultiplicityTask::UserExec(Option_t*)
   //  
 
   // Get the input data 
-  AliESDEvent* esd = dynamic_cast<AliESDEvent*>(InputEvent());
-  if (!esd) { 
-    AliWarning("No ESD event found for input event");
-    return;
-  }
+  AliESDEvent* esd = GetESDEvent();
 
-  // On the first event, initialize the parameters 
-  if (fFirstEvent && esd->GetESDRun()) { 
-    fEventInspector.ReadRunDetails(esd);
-    
-    AliInfo(Form("Initializing with parameters from the ESD:\n"
-                "         AliESDEvent::GetBeamEnergy()   ->%f\n"
-                "         AliESDEvent::GetBeamType()     ->%s\n"
-                "         AliESDEvent::GetCurrentL3()    ->%f\n"
-                "         AliESDEvent::GetMagneticField()->%f\n"
-                "         AliESDEvent::GetRunNumber()    ->%d\n",
-                esd->GetBeamEnergy(), 
-                esd->GetBeamType(),
-                esd->GetCurrentL3(), 
-                esd->GetMagneticField(),
-                esd->GetRunNumber()));
-
-    fFirstEvent = false;
-
-    InitializeSubs();
-  }
   // Clear stuff 
   fHistos.Clear();
   fESDFMD.Clear();
index 2f0b8f15231c4ebcadbb0851ef410dfcf8d6a9ec..d1933db50f493d9abbfa627e37257a5f9fb32a34 100644 (file)
@@ -24,9 +24,9 @@
 #include "AliFMDDensityCalculator.h"
 #include "AliFMDCorrector.h"
 #include "AliFMDHistCollector.h"
+#include "AliESDEvent.h"
 #include <TROOT.h>
-#include <iostream>
-#include <iomanip>
+
 
 //====================================================================
 Bool_t 
@@ -88,7 +88,80 @@ AliForwardMultiplicityBase::CheckCorrections(UInt_t what) const
   }
   return true;
 }
+//____________________________________________________________________
+Bool_t
+AliForwardMultiplicityBase::ReadCorrections(const TAxis*& pe, const TAxis*& pv)
+{
+  UInt_t what = AliForwardCorrectionManager::kAll;
+  if (!fEnableLowFlux)
+    what ^= AliForwardCorrectionManager::kDoubleHit;
+  if (!GetCorrections().IsUseSecondaryMap()) {
+    what ^= AliForwardCorrectionManager::kSecondaryMap;
+    // Need to make eta and vertex axis here since we don't read
+    // that from the secondary correction objects
+    pe = new TAxis(200, -4, 6);
+    pv = new TAxis(10, -10, 10);
+  }
+  if (!GetCorrections().IsUseVertexBias())
+    what ^= AliForwardCorrectionManager::kVertexBias;
+  if (!GetCorrections().IsUseAcceptance())
+    what ^= AliForwardCorrectionManager::kAcceptance;
+  if (!GetCorrections().IsUseMergingEfficiency())
+    what ^= AliForwardCorrectionManager::kMergingEfficiency;
+
+  AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
+  if (!fcm.Init(GetEventInspector().GetCollisionSystem(),
+      GetEventInspector().GetEnergy(),
+      GetEventInspector().GetField(),
+      false,
+      what)) return false;
+  if (!CheckCorrections(what)) return false;
+
+  // Get the eta axis from the secondary maps - if read in
+  if (!pe) {
+    pe = fcm.GetEtaAxis();
+    if (!pe) AliFatal("No eta axis defined");
+  }
+  // Get the vertex axis from the secondary maps - if read in
+  if (!pv) {
+    pv = fcm.GetVertexAxis();
+    if (!pv) AliFatal("No vertex axis defined");
+  }
+
+  return true;
+}
+//____________________________________________________________________
+AliESDEvent*
+AliForwardMultiplicityBase::GetESDEvent()
+{
+  AliESDEvent* esd = dynamic_cast<AliESDEvent*>(InputEvent());
+  if (!esd) {
+    AliWarning("No ESD event found for input event");
+    return 0;
+  }
 
+  // On the first event, initialize the parameters
+  if (fFirstEvent && esd->GetESDRun()) {
+    GetEventInspector().ReadRunDetails(esd);
+
+    AliInfo(Form("Initializing with parameters from the ESD:\n"
+                 "         AliESDEvent::GetBeamEnergy()   ->%f\n"
+                 "         AliESDEvent::GetBeamType()     ->%s\n"
+                 "         AliESDEvent::GetCurrentL3()    ->%f\n"
+                 "         AliESDEvent::GetMagneticField()->%f\n"
+                 "         AliESDEvent::GetRunNumber()    ->%d\n",
+                 esd->GetBeamEnergy(),
+                 esd->GetBeamType(),
+                 esd->GetCurrentL3(),
+                 esd->GetMagneticField(),
+                 esd->GetRunNumber()));
+
+    fFirstEvent = false;
+
+    InitializeSubs();
+  }
+  return esd;
+}
 //____________________________________________________________________
 void
 AliForwardMultiplicityBase::MarkEventForStore() const
index babb194aa7202dc0dc935f5c3014275676c0523d..42856abc14580b011322b7197b619c57c4bb0e98 100644 (file)
@@ -227,7 +227,21 @@ protected:
    * @return true if all present, false otherwise
    */  
   Bool_t CheckCorrections(UInt_t what) const;
+  /**
+   * Read corrections
+   *
+   */
+  virtual Bool_t ReadCorrections(const TAxis*& pe, const TAxis*& pv);
+  /**
+   * Get the ESD event. IF this is the first event, initialise
+   */
+  virtual AliESDEvent* GetESDEvent();
   /** 
+   * Initialise the sub objects and stuff.  Called on first event
+   *
+   */
+  virtual void InitializeSubs() = 0;
+  /**
    * Mark this event as one to store in the AOD 
    * 
    */
index 19072101ed05330499748fb9ab3bbe41099a5447..eab2195cea559fdc89d5fed09626c6b757949451 100644 (file)
@@ -25,8 +25,7 @@
 #include <TDirectory.h>
 #include <TTree.h>
 #include <TROOT.h>
-#include <iostream>
-#include <iomanip>
+
 
 //====================================================================
 AliForwardMultiplicityTask::AliForwardMultiplicityTask()
@@ -151,25 +150,10 @@ AliForwardMultiplicityTask::InitializeSubs()
   // Initialise the sub objects and stuff.  Called on first event 
   // 
   //
-  UInt_t what = AliForwardCorrectionManager::kAll;
-  if (!fEnableLowFlux) 
-    what ^= AliForwardCorrectionManager::kDoubleHit;
-  if (!fCorrections.IsUseMergingEfficiency())
-    what ^= AliForwardCorrectionManager::kMergingEfficiency;
-
-  AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
-  fcm.Init(fEventInspector.GetCollisionSystem(), 
-          fEventInspector.GetEnergy(),
-          fEventInspector.GetField(),
-          false,
-          what);
-  if (!CheckCorrections(what)) return;
-
-
-  const TAxis* pe = fcm.GetEtaAxis();
-  const TAxis* pv = fcm.GetVertexAxis();
-  if (!pe) AliFatal("No eta axis defined");
-  if (!pv) AliFatal("No vertex axis defined");
+  const TAxis* pe = 0;
+  const TAxis* pv = 0;
+
+  if (!ReadCorrections(pe,pv)) return;
 
   fHistos.Init(*pe);
   fAODFMD.Init(*pe);
@@ -182,6 +166,7 @@ AliForwardMultiplicityTask::InitializeSubs()
   fEnergyFitter.Init(*pe);
   fEventInspector.Init(*pv);
   fDensityCalculator.Init(*pe);
+  fCorrections.Init(*pe);
   fHistCollector.Init(*pv);
 
   this->Print();
@@ -228,33 +213,8 @@ AliForwardMultiplicityTask::UserExec(Option_t*)
   // static Int_t cnt = 0;
   // cnt++;
   // Get the input data 
-  AliESDEvent* esd = dynamic_cast<AliESDEvent*>(InputEvent());
-  // AliInfo(Form("Event # %6d (esd=%p)", cnt, esd));
-  if (!esd) { 
-    AliWarning("No ESD event found for input event");
-    return;
-  }
+  AliESDEvent* esd = GetESDEvent();
 
-  // On the first event, initialize the parameters 
-  if (fFirstEvent && esd->GetESDRun()) { 
-    fEventInspector.ReadRunDetails(esd);
-    
-    AliInfo(Form("Initializing with parameters from the ESD:\n"
-                "         AliESDEvent::GetBeamEnergy()   ->%f\n"
-                "         AliESDEvent::GetBeamType()     ->%s\n"
-                "         AliESDEvent::GetCurrentL3()    ->%f\n"
-                "         AliESDEvent::GetMagneticField()->%f\n"
-                "         AliESDEvent::GetRunNumber()    ->%d\n",
-                esd->GetBeamEnergy(), 
-                esd->GetBeamType(),
-                esd->GetCurrentL3(), 
-                esd->GetMagneticField(),
-                esd->GetRunNumber()));
-
-    fFirstEvent = false;
-
-    InitializeSubs();
-  }
   // Clear stuff 
   fHistos.Clear();
   fESDFMD.Clear();