Fixes, renames, etc.
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Jan 2011 13:59:42 +0000 (13:59 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Jan 2011 13:59:42 +0000 (13:59 +0000)
18 files changed:
PWG2/CMakelibPWG2forward2.pkg
PWG2/FORWARD/analysis2/AliFMDCorrector.cxx [moved from PWG2/FORWARD/analysis2/AliFMDCorrections.cxx with 80% similarity]
PWG2/FORWARD/analysis2/AliFMDCorrector.h [moved from PWG2/FORWARD/analysis2/AliFMDCorrections.h with 91% similarity]
PWG2/FORWARD/analysis2/AliFMDEnergyFitter.cxx
PWG2/FORWARD/analysis2/AliFMDEnergyFitterTask.cxx
PWG2/FORWARD/analysis2/AliFMDMCCorrector.cxx [moved from PWG2/FORWARD/analysis2/AliFMDMCCorrections.cxx with 90% similarity]
PWG2/FORWARD/analysis2/AliFMDMCCorrector.h [moved from PWG2/FORWARD/analysis2/AliFMDMCCorrections.h with 85% similarity]
PWG2/FORWARD/analysis2/AliForwardCorrectionManager.cxx
PWG2/FORWARD/analysis2/AliForwardCorrectionManager.h
PWG2/FORWARD/analysis2/AliForwardMCCorrectionsTask.h
PWG2/FORWARD/analysis2/AliForwardMCMultiplicityTask.h
PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.cxx
PWG2/FORWARD/analysis2/AliForwardMultiplicityBase.h
PWG2/FORWARD/analysis2/AliForwardMultiplicityTask.h
PWG2/FORWARD/analysis2/scripts/MakeAcceptanceCorrection.C
PWG2/FORWARD/corrections/Acceptance/acceptance_PbPb_2760GeV_p0kG_real.root [new file with mode: 0644]
PWG2/FORWARD/corrections/Acceptance/acceptance_pp_0900GeV_p0kG_real.root [new file with mode: 0644]
PWG2/PWG2forward2LinkDef.h

index b748dae..ec9de2c 100644 (file)
-#--------------------------------------------------------------------------------#
-# Package File for PWG2forward2                                                  #
-# Author : Christian Holm Christensen (cholm@nbi.dk)                             #
-# Variables Defined :                                                            #
-#                                                                                #
-# SRCS - C++ source files                                                        #
-# HDRS - C++ header files                                                        #
-# DHDR - ROOT Dictionary Linkdef header file                                     #
-# CSRCS - C source files                                                         #
-# CHDRS - C header files                                                         #
-# EINCLUDE - Include directories                                                 #
-# EDEFINE - Compiler definitions                                                 #
-# ELIBS - Extra libraries to link                                                #
-# ELIBSDIR - Extra library directories                                           #
-# PACKFFLAGS - Fortran compiler flags for package                                #
-# PACKCXXFLAGS - C++ compiler flags for package                                  #
-# PACKCFLAGS - C compiler flags for package                                      #
-# PACKSOFLAGS - Shared library linking flags                                     #
-# PACKLDFLAGS - Module linker flags                                              #
-# PACKBLIBS - Libraries to link (Executables only)                               #
-# EXPORT - Header files to be exported                                           #
-# CINTHDRS - Dictionary header files                                             #
-# CINTAUTOLINK - Set automatic dictionary generation                             #
-# ARLIBS - Archive Libraries and objects for linking (Executables only)          #
-# SHLIBS - Shared Libraries and objects for linking (Executables only)           #
-#--------------------------------------------------------------------------------#
-
-set ( SRCS   FORWARD/analysis2/AliFMDEnergyFitterTask.cxx FORWARD/analysis2/AliFMDCorrELossFit.cxx FORWARD/analysis2/AliFMDCorrections.cxx FORWARD/analysis2/AliFMDCorrSecondaryMap.cxx FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx FORWARD/analysis2/AliFMDCorrMergingEfficiency.cxx FORWARD/analysis2/AliFMDEnergyFitter.cxx FORWARD/analysis2/AliFMDMCCorrections.cxx FORWARD/analysis2/AliForwardUtil.cxx FORWARD/analysis2/AliForwardMCCorrectionsTask.cxx FORWARD/analysis2/AliFMDEventInspector.cxx FORWARD/analysis2/AliFMDHistCollector.cxx FORWARD/analysis2/AliFMDMCDensityCalculator.cxx FORWARD/analysis2/AliForwardMultiplicityTask.cxx FORWARD/analysis2/AliFMDCorrDoubleHit.cxx FORWARD/analysis2/AliForwardCorrectionManager.cxx FORWARD/analysis2/AliAODForwardMult.cxx FORWARD/analysis2/AliFMDDensityCalculator.cxx FORWARD/analysis2/AliFMDMCSharingFilter.cxx FORWARD/analysis2/AliForwardMultiplicityBase.cxx FORWARD/analysis2/AliFMDCorrVertexBias.cxx FORWARD/analysis2/AliFMDSharingFilter.cxx)
+# -*- mode: CMake -*-
+#------------------------------------------------------------------------#
+# Package File for PWG2forward2                                          #
+# Author : Christian Holm Christensen (cholm@nbi.dk)                     #
+# Variables Defined :                                                    #
+#                                                                        #
+# SRCS - C++ source files                                                #
+# HDRS - C++ header files                                                #
+# DHDR - ROOT Dictionary Linkdef header file                             #
+# CSRCS - C source files                                                 #
+# CHDRS - C header files                                                 #
+# EINCLUDE - Include directories                                         #
+# EDEFINE - Compiler definitions                                         #
+# ELIBS - Extra libraries to link                                        #
+# ELIBSDIR - Extra library directories                                   #
+# PACKFFLAGS - Fortran compiler flags for package                        #
+# PACKCXXFLAGS - C++ compiler flags for package                          #
+# PACKCFLAGS - C compiler flags for package                              #
+# PACKSOFLAGS - Shared library linking flags                             #
+# PACKLDFLAGS - Module linker flags                                      #
+# PACKBLIBS - Libraries to link (Executables only)                       #
+# EXPORT - Header files to be exported                                   #
+# CINTHDRS - Dictionary header files                                     #
+# CINTAUTOLINK - Set automatic dictionary generation                     #
+# ARLIBS - Archive Libraries and objects for linking (Executables only)  #
+# SHLIBS - Shared Libraries and objects for linking (Executables only)   #
+#------------------------------------------------------------------------#
+
+set ( SRCS   
+    FORWARD/analysis2/AliAODForwardMult.cxx
+    FORWARD/analysis2/AliFMDCorrAcceptance.cxx
+    FORWARD/analysis2/AliFMDCorrDoubleHit.cxx
+    FORWARD/analysis2/AliFMDCorrELossFit.cxx 
+    FORWARD/analysis2/AliFMDCorrMergingEfficiency.cxx
+    FORWARD/analysis2/AliFMDCorrSecondaryMap.cxx 
+    FORWARD/analysis2/AliFMDCorrVertexBias.cxx
+    FORWARD/analysis2/AliFMDCorrector.cxx 
+    FORWARD/analysis2/AliFMDDensityCalculator.cxx
+    FORWARD/analysis2/AliFMDEnergyFitter.cxx
+    FORWARD/analysis2/AliFMDEnergyFitterTask.cxx 
+    FORWARD/analysis2/AliFMDEventInspector.cxx
+    FORWARD/analysis2/AliFMDHistCollector.cxx
+    FORWARD/analysis2/AliFMDSharingFilter.cxx
+    FORWARD/analysis2/AliFMDMCCorrector.cxx
+    FORWARD/analysis2/AliFMDMCDensityCalculator.cxx
+    FORWARD/analysis2/AliFMDMCSharingFilter.cxx
+    FORWARD/analysis2/AliForwardCorrectionManager.cxx
+    FORWARD/analysis2/AliForwardMultiplicityBase.cxx
+    FORWARD/analysis2/AliForwardMultiplicityTask.cxx
+    FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx 
+    FORWARD/analysis2/AliForwardMCCorrectionsTask.cxx
+    FORWARD/analysis2/AliForwardUtil.cxx
+)
 
 string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
 
-set ( EINCLUDE  ANALYSIS)
+set ( EINCLUDE  ANALYSIS )
 
 set ( DHDR  PWG2forward2LinkDef.h)
+
+# --------------------------------------------------------------------
+# Extra installation targets 
+#
+# Install scripts 
+install ( DIRECTORY FORWARD/analysis2/scripts 
+         DESTINATION PWG2/FORWARD/analysis2 
+         PATTERN ".d"  EXCLUDE 
+         PATTERN ".so" EXCLUDE)
+
+# Install other scripts
+install ( FILES FORWARD/analysis2/AddTaskCopyHeader.C
+                FORWARD/analysis2/AddTaskFMD.C
+                FORWARD/analysis2/AnalyseAOD.C
+                FORWARD/analysis2/MakeAOD.C
+                FORWARD/analysis2/MakeELossFits.C
+                FORWARD/analysis2/OtherData.C
+                FORWARD/analysis2/Pass1.C
+                FORWARD/analysis2/Pass2.C
+           DESTINATION PWG2/FORWARD/analysis2 )
+
+# Install corrections 
+install ( DIRECTORY FORWARD/corrections/DoubleHit
+                   FORWARD/corrections/ELossFits
+                   FORWARD/corrections/MergingEfficiency
+                   FORWARD/corrections/SecondaryMap
+                   FORWARD/corrections/VertexBias
+                   FORWARD/corrections/Acceptance
+          DESTINATION PWG2/FORWARD/corrections 
+         PATTERN ".svn" EXCLUDE)
+
+# Install shell script 
+install ( FILES FORWARD/analysis2/Run.sh 
+         DESTINATION PWG2/FORWARD/analysis2 
+         PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
+                      GROUP_EXECUTE GROUP_READ
+                     WORLD_EXECUTE WORLD_READ )
+
+
+# --------------------------------------------------------------------
+#
+# EOF
+# 
similarity index 80%
rename from PWG2/FORWARD/analysis2/AliFMDCorrections.cxx
rename to PWG2/FORWARD/analysis2/AliFMDCorrector.cxx
index da991fc..f2ef965 100644 (file)
@@ -2,7 +2,7 @@
 // This class calculates the exclusive charged particle density
 // in each for the 5 FMD rings. 
 //
-#include "AliFMDCorrections.h"
+#include "AliFMDCorrector.h"
 #include <AliESDFMD.h>
 #include <TAxis.h>
 #include <TList.h>
 #include <iostream>
 #include <iomanip>
 
-ClassImp(AliFMDCorrections)
+ClassImp(AliFMDCorrector)
 #if 0
 ; // For Emacs
 #endif 
 
 //____________________________________________________________________
-AliFMDCorrections::AliFMDCorrections()
+AliFMDCorrector::AliFMDCorrector()
   : TNamed(), 
     fRingHistos(),
     fUseMergingEfficiency(true),
@@ -30,7 +30,7 @@ AliFMDCorrections::AliFMDCorrections()
 }
 
 //____________________________________________________________________
-AliFMDCorrections::AliFMDCorrections(const char* title)
+AliFMDCorrector::AliFMDCorrector(const char* title)
   : TNamed("fmdCorrections", title), 
     fRingHistos(), 
     fUseMergingEfficiency(true),
@@ -49,7 +49,7 @@ AliFMDCorrections::AliFMDCorrections(const char* title)
 }
 
 //____________________________________________________________________
-AliFMDCorrections::AliFMDCorrections(const AliFMDCorrections& o)
+AliFMDCorrector::AliFMDCorrector(const AliFMDCorrector& o)
   : TNamed(o), 
     fRingHistos(), 
     fUseMergingEfficiency(o.fUseMergingEfficiency),
@@ -65,7 +65,7 @@ AliFMDCorrections::AliFMDCorrections(const AliFMDCorrections& o)
 }
 
 //____________________________________________________________________
-AliFMDCorrections::~AliFMDCorrections()
+AliFMDCorrector::~AliFMDCorrector()
 {
   // Destructor 
   // 
@@ -74,8 +74,8 @@ AliFMDCorrections::~AliFMDCorrections()
 }
 
 //____________________________________________________________________
-AliFMDCorrections&
-AliFMDCorrections::operator=(const AliFMDCorrections& o)
+AliFMDCorrector&
+AliFMDCorrector::operator=(const AliFMDCorrector& o)
 {
   // Assignment operator 
   // 
@@ -94,8 +94,8 @@ AliFMDCorrections::operator=(const AliFMDCorrections& o)
 }
 
 //____________________________________________________________________
-AliFMDCorrections::RingHistos*
-AliFMDCorrections::GetRingHistos(UShort_t d, Char_t r) const
+AliFMDCorrector::RingHistos*
+AliFMDCorrector::GetRingHistos(UShort_t d, Char_t r) const
 {
   // 
   // Get the ring histogram container 
@@ -119,7 +119,7 @@ AliFMDCorrections::GetRingHistos(UShort_t d, Char_t r) const
     
 //____________________________________________________________________
 Bool_t
-AliFMDCorrections::Correct(AliForwardUtil::Histos& hists,
+AliFMDCorrector::Correct(AliForwardUtil::Histos& hists,
                           UShort_t                vtxbin)
 {
   // 
@@ -137,19 +137,25 @@ AliFMDCorrections::Correct(AliForwardUtil::Histos& hists,
   for (UShort_t d=1; d<=3; d++) { 
     UShort_t nr = (d == 1 ? 1 : 2);
     for (UShort_t q=0; q<nr; q++) { 
-      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);
+      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 (!ef) { 
-       AliWarning(Form("No event vertex bias correction in vertex bin %d",
-                       uvb));
+       AliWarning(Form("No event %s vertex bias correction in vertex bin %d",
+                       (r == 'I' || r == 'i' ? "inner" : "outer"), uvb));
+       continue;
+      }
+      if (!ac) { 
+       AliWarning(Form("No acceptance correction for FMD%d%c in vertex bin %d",
+                       d, r, uvb));
        continue;
       }
 
@@ -159,6 +165,9 @@ AliFMDCorrections::Correct(AliForwardUtil::Histos& hists,
       // Divide by the event selection efficiency 
       h->Divide(ef);
 
+      // Divide by the acceptance correction 
+      h->Divide(ac);
+
       if (fUseMergingEfficiency) {
        if (!fcm.GetMergingEfficiency()) { 
          AliWarning("No merging efficiencies");
@@ -198,7 +207,7 @@ AliFMDCorrections::Correct(AliForwardUtil::Histos& hists,
 
 //____________________________________________________________________
 void
-AliFMDCorrections::ScaleHistograms(TList* dir, Int_t nEvents)
+AliFMDCorrector::ScaleHistograms(TList* dir, Int_t nEvents)
 {
   // 
   // Scale the histograms to the total number of events 
@@ -217,7 +226,7 @@ AliFMDCorrections::ScaleHistograms(TList* dir, Int_t nEvents)
 }
 //____________________________________________________________________
 void
-AliFMDCorrections::DefineOutput(TList* dir)
+AliFMDCorrector::DefineOutput(TList* dir)
 {
   TList* d = new TList;
   d->SetName(GetName());
@@ -231,7 +240,7 @@ AliFMDCorrections::DefineOutput(TList* dir)
 
 //____________________________________________________________________
 void
-AliFMDCorrections::Print(Option_t* /* option */) const
+AliFMDCorrector::Print(Option_t* /* option */) const
 {
   // 
   // Print information
@@ -241,11 +250,11 @@ AliFMDCorrections::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 << "AliFMDCorrections: " << GetName() <<  std::endl;
+  std::cout << ind << "AliFMDCorrector: " << GetName() <<  std::endl;
 }
 
 //====================================================================
-AliFMDCorrections::RingHistos::RingHistos()
+AliFMDCorrector::RingHistos::RingHistos()
   : AliForwardUtil::RingHistos(), 
     fDensity(0)
 {
@@ -255,7 +264,7 @@ AliFMDCorrections::RingHistos::RingHistos()
 }
 
 //____________________________________________________________________
-AliFMDCorrections::RingHistos::RingHistos(UShort_t d, Char_t r)
+AliFMDCorrector::RingHistos::RingHistos(UShort_t d, Char_t r)
   : AliForwardUtil::RingHistos(d,r), 
     fDensity(0)
 {
@@ -275,7 +284,7 @@ AliFMDCorrections::RingHistos::RingHistos(UShort_t d, Char_t r)
   fDensity->SetZTitle("Primary N_{ch} density");
 }
 //____________________________________________________________________
-AliFMDCorrections::RingHistos::RingHistos(const RingHistos& o)
+AliFMDCorrector::RingHistos::RingHistos(const RingHistos& o)
   : AliForwardUtil::RingHistos(o), 
     fDensity(o.fDensity)
 {
@@ -287,8 +296,8 @@ AliFMDCorrections::RingHistos::RingHistos(const RingHistos& o)
 }
 
 //____________________________________________________________________
-AliFMDCorrections::RingHistos&
-AliFMDCorrections::RingHistos::operator=(const RingHistos& o)
+AliFMDCorrector::RingHistos&
+AliFMDCorrector::RingHistos::operator=(const RingHistos& o)
 {
   // 
   // Assignment operator 
@@ -307,7 +316,7 @@ AliFMDCorrections::RingHistos::operator=(const RingHistos& o)
   return *this;
 }
 //____________________________________________________________________
-AliFMDCorrections::RingHistos::~RingHistos()
+AliFMDCorrector::RingHistos::~RingHistos()
 {
   // 
   // Destructor 
@@ -317,7 +326,7 @@ AliFMDCorrections::RingHistos::~RingHistos()
 
 //____________________________________________________________________
 void
-AliFMDCorrections::RingHistos::Output(TList* dir)
+AliFMDCorrector::RingHistos::Output(TList* dir)
 {
   // 
   // Make output 
@@ -330,7 +339,7 @@ AliFMDCorrections::RingHistos::Output(TList* dir)
 
 //____________________________________________________________________
 void
-AliFMDCorrections::RingHistos::ScaleHistograms(TList* dir, Int_t nEvents)
+AliFMDCorrector::RingHistos::ScaleHistograms(TList* dir, Int_t nEvents)
 { 
   // 
   // Scale the histograms to the total number of events 
similarity index 91%
rename from PWG2/FORWARD/analysis2/AliFMDCorrections.h
rename to PWG2/FORWARD/analysis2/AliFMDCorrector.h
index 18b59e7..c567189 100644 (file)
@@ -1,8 +1,8 @@
 // This class calculates the exclusive charged particle density
 // in each for the 5 FMD rings. 
 //
-#ifndef ALIFMDCORRECTIONS_H
-#define ALIFMDCORRECTIONS_H
+#ifndef ALIFMDCORRECTOR_H
+#define ALIFMDCORRECTOR_H
 #include <TNamed.h>
 #include <TList.h>
 #include "AliForwardUtil.h"
@@ -32,29 +32,29 @@ class TH2D;
  *
  * @ingroup pwg2_forward_algo 
  */
-class AliFMDCorrections : public TNamed
+class AliFMDCorrector : public TNamed
 {
 public:
   /** 
    * Constructor 
    */
-  AliFMDCorrections();
+  AliFMDCorrector();
   /** 
    * Constructor 
    * 
    * @param name Name of object
    */
-  AliFMDCorrections(const char* name);
+  AliFMDCorrector(const char* name);
   /** 
    * Copy constructor 
    * 
    * @param o Object to copy from 
    */
-  AliFMDCorrections(const AliFMDCorrections& o);
+  AliFMDCorrector(const AliFMDCorrector& o);
   /** 
    * Destructor 
    */
-  virtual ~AliFMDCorrections();
+  virtual ~AliFMDCorrector();
   /** 
    * Assignement operator
    * 
@@ -62,7 +62,7 @@ public:
    * 
    * @return Reference to this object
    */
-  AliFMDCorrections& operator=(const AliFMDCorrections&);
+  AliFMDCorrector& operator=(const AliFMDCorrector&);
   /** 
    * Do the calculations 
    * 
@@ -174,7 +174,7 @@ protected:
   Bool_t   fUseMergingEfficiency; // Whether to use the merging efficiency
   Int_t    fDebug;                //  Debug level 
 
-  ClassDef(AliFMDCorrections,2); // Calculate Nch density 
+  ClassDef(AliFMDCorrector,2); // Calculate Nch density 
 };
 
 #endif
index caedd41..b463add 100644 (file)
@@ -16,7 +16,6 @@
 #include <TROOT.h>
 #include <iostream>
 #include <iomanip>
-#include <TFile.h>
 
 ClassImp(AliFMDEnergyFitter)
 #if 0
@@ -334,13 +333,6 @@ AliFMDEnergyFitter::Fit(const TList* dir)
   if (!fDoMakeObject) return;
 
   MakeCorrectionsObject(d);
-  d->ls();
-  TDirectory* savdir = gDirectory;
-  TFile* tmp = TFile::Open("elossfits.root", "RECREATE");
-  d->Write();
-  tmp->Write();
-  tmp->Close();
-  savdir->cd();
 }
 
 //____________________________________________________________________
index e72d4ef..c0f9366 100644 (file)
 #include "AliAODForwardMult.h"
 #include "AliForwardCorrectionManager.h"
 #include "AliAnalysisManager.h"
+#include "AliAnalysisDataSlot.h"
+#include "AliAnalysisDataContainer.h"
 #include <TH1.h>
 #include <TDirectory.h>
 #include <TTree.h>
+#include <TFile.h>
 
 //====================================================================
 AliFMDEnergyFitterTask::AliFMDEnergyFitterTask()
@@ -252,6 +255,37 @@ AliFMDEnergyFitterTask::Terminate(Option_t*)
   }
   AliInfo("Fitting energy loss spectra");
   fEnergyFitter.Fit(list);
+
+  // Investigate output slot 
+  AliAnalysisDataSlot* oslot = GetOutputSlot(1);
+  if (oslot) { 
+    AliAnalysisDataContainer* ocont = oslot->GetContainer();
+    if (ocont) { 
+      TFile* ofile = ocont->GetFile();
+      if (ofile) {
+       AliInfo(Form("Output file %s opened with option %s (%s)", 
+                    ofile->GetName(), ofile->GetOption(), 
+                    ofile->IsWritable() ? "read-write" : "read-only"));
+       ofile->Flush();
+      }
+      else 
+       AliWarning("No output file associated with data container");
+    }
+    else 
+      AliWarning("No container associated with slot 1");
+  }
+  else 
+    AliWarning("Slot number 1 not defined");
+  
+  // Temporary code to save output to a file - should be disabled once 
+  // the plugin stuff works 
+  list->ls();
+  TDirectory* savdir = gDirectory;
+  TFile* tmp = TFile::Open("elossfits.root", "RECREATE");
+  list->Write(list->GetName(), TObject::kSingleKey);
+  tmp->Write();
+  tmp->Close();
+  savdir->cd();
 }
 
 //____________________________________________________________________
@@ -15,7 +15,7 @@
 //   - AliFMDCorrVertexBias
 //   - AliFMDCorrMergingEfficiency
 //
-#include "AliFMDMCCorrections.h"
+#include "AliFMDMCCorrector.h"
 #include <AliESDFMD.h>
 #include <TAxis.h>
 #include <TList.h>
 #include <iostream>
 #include <iomanip>
 
-ClassImp(AliFMDMCCorrections)
+ClassImp(AliFMDMCCorrector)
 #if 0
 ; // For Emacs
 #endif 
 
 
 //____________________________________________________________________
-AliFMDMCCorrections::~AliFMDMCCorrections()
+AliFMDMCCorrector::~AliFMDMCCorrector()
 {
   // 
   // Destructor 
@@ -49,8 +49,8 @@ AliFMDMCCorrections::~AliFMDMCCorrections()
 }
 
 //____________________________________________________________________
-AliFMDMCCorrections&
-AliFMDMCCorrections::operator=(const AliFMDMCCorrections& o)
+AliFMDMCCorrector&
+AliFMDMCCorrector::operator=(const AliFMDMCCorrector& o)
 {
   // 
   // Assignement operator
@@ -61,14 +61,14 @@ AliFMDMCCorrections::operator=(const AliFMDMCCorrections& o)
   // Return:
   //    Reference to this object
   //
-  AliFMDCorrections::operator=(o);
+  AliFMDCorrector::operator=(o);
 
   return *this;
 }
 
 //____________________________________________________________________
 Bool_t
-AliFMDMCCorrections::CorrectMC(AliForwardUtil::Histos& hists,
+AliFMDMCCorrector::CorrectMC(AliForwardUtil::Histos& hists,
                               UShort_t                vtxbin)
 {
   // 
@@ -115,7 +115,7 @@ AliFMDMCCorrections::CorrectMC(AliForwardUtil::Histos& hists,
 
 //____________________________________________________________________
 void
-AliFMDMCCorrections::Init(const TAxis& eAxis)
+AliFMDMCCorrector::Init(const TAxis& eAxis)
 {
   // 
   // Initialize this object 
@@ -138,7 +138,7 @@ AliFMDMCCorrections::Init(const TAxis& eAxis)
 
 //____________________________________________________________________
 TProfile2D*
-AliFMDMCCorrections::Make(UShort_t d, Char_t r, 
+AliFMDMCCorrector::Make(UShort_t d, Char_t r, 
                                const TAxis& axis) const
 {
   // 
@@ -167,7 +167,7 @@ AliFMDMCCorrections::Make(UShort_t d, Char_t r,
 }
 //____________________________________________________________________
 void
-AliFMDMCCorrections::Fill(UShort_t d, Char_t r, TH2* esd, TH2* mc)
+AliFMDMCCorrector::Fill(UShort_t d, Char_t r, TH2* esd, TH2* mc)
 {
   // 
   // Fill comparison profiles
@@ -201,7 +201,7 @@ AliFMDMCCorrections::Fill(UShort_t d, Char_t r, TH2* esd, TH2* mc)
 
 //____________________________________________________________________
 Bool_t
-AliFMDMCCorrections::CompareResults(AliForwardUtil::Histos& esd,
+AliFMDMCCorrector::CompareResults(AliForwardUtil::Histos& esd,
                                          AliForwardUtil::Histos& mc)
 {
   // 
@@ -227,7 +227,7 @@ AliFMDMCCorrections::CompareResults(AliForwardUtil::Histos& esd,
 
 //____________________________________________________________________
 void
-AliFMDMCCorrections::DefineOutput(TList* dir)
+AliFMDMCCorrector::DefineOutput(TList* dir)
 {
   // 
   // Output diagnostic histograms to directory 
@@ -235,7 +235,7 @@ AliFMDMCCorrections::DefineOutput(TList* dir)
   // Parameters:
   //    dir List to write in
   //  
-  AliFMDCorrections::DefineOutput(dir);
+  AliFMDCorrector::DefineOutput(dir);
   TList* d = static_cast<TList*>(dir->FindObject(GetName()));
 
   fComps = new TList;
similarity index 85%
rename from PWG2/FORWARD/analysis2/AliFMDMCCorrections.h
rename to PWG2/FORWARD/analysis2/AliFMDMCCorrector.h
index cbb2083..b85a9ba 100644 (file)
@@ -2,9 +2,9 @@
 // This class calculates the exclusive charged particle density
 // in each for the 5 FMD rings. 
 //
-#ifndef ALIFMDMCCORRECTIONS_H
-#define ALIFMDMCCORRECTIONS_H
-#include "AliFMDCorrections.h"
+#ifndef ALIFMDMCCORRECTOR_H
+#define ALIFMDMCCORRECTOR_H
+#include "AliFMDCorrector.h"
 #include <TList.h>
 class TProfile2D;
 class TH2;
@@ -34,14 +34,14 @@ class TH2;
  * @ingroup pwg2_forward_algo
  * @ingroup pwg2_forward_mc
  */
-class AliFMDMCCorrections : public AliFMDCorrections
+class AliFMDMCCorrector : public AliFMDCorrector
 {
 public:
   /** 
    * Constructor 
    */
-  AliFMDMCCorrections()
-    : AliFMDCorrections(),
+  AliFMDMCCorrector()
+    : AliFMDCorrector(),
       fFMD1i(0), 
       fFMD2i(0),
       fFMD2o(0),
@@ -54,8 +54,8 @@ public:
    * 
    * @param name Name of object
    */
-  AliFMDMCCorrections(const char* name)
-    : AliFMDCorrections(name),
+  AliFMDMCCorrector(const char* name)
+    : AliFMDCorrector(name),
       fFMD1i(0), 
       fFMD2i(0),
       fFMD2o(0),
@@ -68,8 +68,8 @@ public:
    * 
    * @param o Object to copy from 
    */
-  AliFMDMCCorrections(const AliFMDMCCorrections& o)
-    : AliFMDCorrections(o),
+  AliFMDMCCorrector(const AliFMDMCCorrector& o)
+    : AliFMDCorrector(o),
       fFMD1i(o.fFMD1i), 
       fFMD2i(o.fFMD2i),
       fFMD2o(o.fFMD2o),
@@ -80,7 +80,7 @@ public:
   /** 
    * Destructor 
    */
-  virtual ~AliFMDMCCorrections();
+  virtual ~AliFMDMCCorrector();
   /** 
    * Assignement operator
    * 
@@ -88,7 +88,7 @@ public:
    * 
    * @return Reference to this object
    */
-  AliFMDMCCorrections& operator=(const AliFMDMCCorrections&);
+  AliFMDMCCorrector& operator=(const AliFMDMCCorrector&);
   /** 
    * Initialize this object 
    * 
@@ -150,7 +150,7 @@ protected:
   TProfile2D* fFMD3o; // Comparison
   TList*      fComps; // List of comparisons 
   
-  ClassDef(AliFMDMCCorrections,1); // Calculate Nch density 
+  ClassDef(AliFMDMCCorrector,1); // Calculate Nch density 
 };
 
 #endif
index b9db1e2..02a0067 100644 (file)
@@ -16,8 +16,15 @@ const char* AliForwardCorrectionManager::fgkDoubleHitSkel    = "doublehit";
 const char* AliForwardCorrectionManager::fgkELossFitsSkel    = "elossfits";
 const char* AliForwardCorrectionManager::fgkVertexBiasSkel   = "vertexbias";
 const char* AliForwardCorrectionManager::fgkMergingEffSkel   = "merging";
+const char* AliForwardCorrectionManager::fgkAcceptanceSkel   = "acceptance";
 
 #define PREFIX "$(ALICE_ROOT)/PWG2/FORWARD/corrections/"
+#define ELOSSFIT_DIR   "ELossFits"
+#define MERGING_DIR    "MergingEfficiency"
+#define SECONDARY_DIR  "SecondaryMap"
+#define DOUBLE_DIR     "DoubleHit"
+#define VERTEX_DIR     "VertexBias"
+#define ACCEPTANCE_DIR "Acceptance"
 
 //____________________________________________________________________
 AliForwardCorrectionManager& AliForwardCorrectionManager::Instance()
@@ -39,16 +46,18 @@ AliForwardCorrectionManager::AliForwardCorrectionManager()
     fSys(0),
     fSNN(0),
     fField(999),
-    fELossFitsPath(PREFIX "ELossFits"),
-    fMergingEffPath(PREFIX "MergingEfficiency"), 
-    fSecondaryMapPath(PREFIX "SecondaryMap"),
-    fDoubleHitPath(PREFIX "DoubleHit"),
-    fVertexBiasPath(PREFIX "VertexBias"),
+    fELossFitsPath(PREFIX ELOSSFIT_DIR),
+    fMergingEffPath(PREFIX MERGING_DIR), 
+    fSecondaryMapPath(PREFIX SECONDARY_DIR),
+    fDoubleHitPath(PREFIX DOUBLE_DIR),
+    fVertexBiasPath(PREFIX VERTEX_DIR),
+    fAcceptancePath(PREFIX ACCEPTANCE_DIR),
     fELossFit(0),
     fSecondaryMap(0),
     fDoubleHit(0),
     fVertexBias(0),
-    fMergingEfficiency(0)
+    fMergingEfficiency(0),
+    fAcceptance(0)
 {
   // 
   // Default constructor 
@@ -66,11 +75,13 @@ AliForwardCorrectionManager::AliForwardCorrectionManager(const AliForwardCorrect
     fSecondaryMapPath(o.fSecondaryMapPath),
     fDoubleHitPath(o.fDoubleHitPath),
     fVertexBiasPath(o.fVertexBiasPath),
+    fAcceptancePath(o.fAcceptancePath),
     fELossFit(o.fELossFit),
     fSecondaryMap(o.fSecondaryMap),
     fDoubleHit(o.fDoubleHit),
     fVertexBias(o.fVertexBias),
-    fMergingEfficiency(o.fMergingEfficiency)
+    fMergingEfficiency(o.fMergingEfficiency),
+    fAcceptance(o.fAcceptance)
 
 {
   // 
@@ -102,11 +113,13 @@ AliForwardCorrectionManager::operator=(const AliForwardCorrectionManager& o)
   fSecondaryMapPath = o.fSecondaryMapPath;
   fDoubleHitPath    = o.fDoubleHitPath;
   fVertexBiasPath   = o.fVertexBiasPath;
+  fAcceptancePath   = o.fAcceptancePath;
   fELossFit         = o.fELossFit;
   fSecondaryMap     = o.fSecondaryMap;
   fDoubleHit        = o.fDoubleHit;
   fVertexBias       = o.fVertexBias;
   fMergingEfficiency= o.fMergingEfficiency;
+  fAcceptance       = o.fAcceptance;
   return *this;
 }
 
@@ -202,10 +215,18 @@ AliForwardCorrectionManager::Init(UShort_t cms,
       ret = kFALSE;
     }
   }
+  // Read acceptance correction if requested 
+  if (what & kAcceptance) {
+    if (!ReadAcceptance(cms, sNN, 0)) {
+      AliWarning(Form("Failed to read in acceptance for "
+                     "cms=%d, sNN=%dGeV, field=%dkG", cms, sNN, 0));
+      ret = kFALSE;
+    }
+  }
   // Read event selection efficiencies if requested 
   if (what & kVertexBias) {
     if (!ReadVertexBias(cms, sNN, field)) {
-      AliWarning(Form("Failed to read in event selection efficiency for "
+      AliWarning(Form("Failed to read in vertex bias correction for "
                      "cms=%d, sNN=%dGeV, field=%dkG", cms, sNN, field));
       ret = kFALSE;
     }
@@ -290,6 +311,7 @@ AliForwardCorrectionManager::GetFileDir(ECorrection what) const
   else if (what & kELossFits)           return fELossFitsPath;
   else if (what & kVertexBias)          return fVertexBiasPath;
   else if (what & kMergingEfficiency)   return fMergingEffPath;
+  else if (what & kAcceptance)          return fAcceptancePath;
 
   AliWarning(Form("Unknown correction: %d", what));
   return 0;
@@ -434,6 +456,7 @@ AliForwardCorrectionManager::GetObjectName(ECorrection what) const
   else if (what & kELossFits)          return fgkELossFitsSkel;
   else if (what & kVertexBias)         return fgkVertexBiasSkel;
   else if (what & kMergingEfficiency)  return fgkMergingEffSkel;
+  else if (what & kAcceptance)         return fgkAcceptanceSkel;
   return 0;
 }
 
@@ -686,6 +709,42 @@ AliForwardCorrectionManager::ReadMergingEfficiency(UShort_t sys,
 }
 
 //____________________________________________________________________
+Bool_t 
+AliForwardCorrectionManager::ReadAcceptance(UShort_t sys, 
+                                           UShort_t sNN, 
+                                           Short_t field)
+{
+  // 
+  // Read in the event selection efficiency 
+  // 
+  // Parameters:
+  //    sys   Collision system
+  //    sNN   Center of mass energy [GeV]
+  //    field Magnetic field in the L3 magnet [kG]
+  // 
+  // Return:
+  //    True on success, false otherwise 
+  //
+  if (fInit) { 
+    AliWarning("Corrections manager initialised, do a forced Init(...)");
+    return kFALSE;
+  }
+
+  TObject* o = GetObject(kAcceptance, sys, sNN, field, false);
+  if (!o) return kFALSE;
+
+  fAcceptance = dynamic_cast<AliFMDCorrAcceptance*>(o);
+  if (!fAcceptance) {
+    AliWarning(Form("Object %s (%p) is not an AliFMDCorrAcceptance object, "
+                   "but %s", fgkAcceptanceSkel, o, o->ClassName()));
+    return kFALSE;
+  }
+
+  // file->Close();
+  return kTRUE;
+}
+
+//____________________________________________________________________
 //
 // EOF
 //
index e45dd06..ebc4a47 100644 (file)
@@ -9,6 +9,7 @@
 #include "AliFMDCorrDoubleHit.h"
 #include "AliFMDCorrVertexBias.h"
 #include "AliFMDCorrMergingEfficiency.h"
+#include "AliFMDCorrAcceptance.h"
 #include <TString.h>
 class TFile;
 
@@ -29,11 +30,13 @@ public:
     kVertexBias                = 0x04, 
     kMergingEfficiency         = 0x08,
     kDoubleHit                 = 0x10,
+    kAcceptance                = 0x20,
     kAll                       = (kSecondaryMap| 
                                  kELossFits|
                                  kVertexBias|
                                  kMergingEfficiency|
-                                 kDoubleHit)
+                                 kDoubleHit|
+                                 kAcceptance)
   };
   /** 
    * Access to the singleton object 
@@ -113,11 +116,24 @@ public:
    * @return Get the vertex bias correction object or null 
    */
   AliFMDCorrVertexBias* GetVertexBias() const { return fVertexBias; }
+  /** 
+   * Get the merging efficiency 
+   * 
+   * 
+   * @return Get the vertex efficiency correction 
+   */
   AliFMDCorrMergingEfficiency* GetMergingEfficiency() const 
   {
     return fMergingEfficiency;
   }
   /** 
+   * Get the acceptance correction due to dead channels 
+   * 
+   * 
+   * @return Acceptance correction due to dead channels 
+   */
+  AliFMDCorrAcceptance* GetAcceptance() const { return fAcceptance; }
+  /** 
    * @{ 
    * @name Path, file, and object access utilities 
    */
@@ -130,7 +146,7 @@ public:
    * @param field Magnetic field in the L3 magnet [kG]
    * @param mc    Whether the correction objects should be valid for MC
    * 
-   * @return The full path or null 
+   * @return The file name (sans directory) or null 
    */
   TString GetFileName(ECorrection what, 
                      UShort_t    sys, 
@@ -142,7 +158,7 @@ public:
    * 
    * @param what Which stuff to get the path for 
    * 
-   * @return The full path or null
+   * @return The file name (sans directory) or null
    */
   TString GetFileName(ECorrection what) const;
   /** 
@@ -150,7 +166,7 @@ public:
    *
    * @param what  Which stuff to get the path for 
    * 
-   * @return The full path or null 
+   * @return The files directory full path or null 
    */
   const Char_t* GetFileDir(ECorrection what) const;
   /** 
@@ -325,6 +341,16 @@ private:
    * @return True on success, false otherwise 
    */
   Bool_t ReadMergingEfficiency(UShort_t sys, UShort_t sNN, Short_t field);
+  /** 
+   * Read in the acceptance correction due to dead-channels 
+   * 
+   * @param sys   Collision system                   
+   * @param sNN   Center of mass energy [GeV]        
+   * @param field Magnetic field in the L3 magnet [kG]
+   * 
+   * @return True on success, false otherwise 
+   */
+  Bool_t ReadAcceptance(UShort_t sys, UShort_t sNN, Short_t field);
   /* 
    * @} 
    */
@@ -345,6 +371,7 @@ private:
   TString fSecondaryMapPath; // Path to secondary efficiency correction
   TString fDoubleHitPath;    // Path to double hit correction
   TString fVertexBiasPath;   // Path to event selection efficiency correction
+  TString fAcceptancePath;   // Path to acceptance correction from dead areas
   /* 
    * @}
    */
@@ -357,6 +384,7 @@ private:
   static const Char_t* fgkELossFitsSkel;     // Name of correction object 
   static const Char_t* fgkVertexBiasSkel;    // Name of correction object 
   static const Char_t* fgkMergingEffSkel;    // Name of correction object 
+  static const Char_t* fgkAcceptanceSkel;    // Name of correction object 
   /* 
    * @} 
    */
@@ -364,11 +392,12 @@ private:
    * @{ 
    * @name Correction objects 
    */
-  AliFMDCorrELossFit*     fELossFit;     // Energy loss fits 
-  AliFMDCorrSecondaryMap* fSecondaryMap; // Secondary particle correction
-  AliFMDCorrDoubleHit*    fDoubleHit;    // Double hit correction (low flux)
-  AliFMDCorrVertexBias*   fVertexBias;   // Vertex bias correction
-  AliFMDCorrMergingEfficiency* fMergingEfficiency;
+  AliFMDCorrELossFit*          fELossFit;     // Energy loss fits 
+  AliFMDCorrSecondaryMap*      fSecondaryMap; // Secondary particle correction
+  AliFMDCorrDoubleHit*         fDoubleHit;    // Double hit corr. (low flux)
+  AliFMDCorrVertexBias*        fVertexBias;   // Vertex bias correction
+  AliFMDCorrMergingEfficiency* fMergingEfficiency; // Merging eff. 
+  AliFMDCorrAcceptance*        fAcceptance;   // Acceptance corr. 
   /* 
    * @}
    */
index 196d44b..00776c2 100644 (file)
@@ -1,13 +1,13 @@
 // 
 // Calculate the corrections in the forward regions
 // 
-#ifndef ALIFORWARDCORRECTIONS_H
-#define ALIFORWARDCORRECTIONS_H
+#ifndef ALIFORWARDMCCORRECTIONS_H
+#define ALIFORWARDMCCORRECTIONS_H
 #include <AliAnalysisTaskSE.h>
 #include "AliForwardUtil.h"
 #include "AliFMDSharingFilter.h"
 #include "AliFMDDensityCalculator.h"
-#include "AliFMDCorrections.h"
+#include "AliFMDCorrector.h"
 #include "AliFMDHistCollector.h"
 #include "AliAODForwardMult.h"
 #include <AliESDFMD.h>
index 8dfeab6..f7eb539 100644 (file)
@@ -9,7 +9,7 @@
 #include "AliFMDEnergyFitter.h"
 #include "AliFMDMCSharingFilter.h"
 #include "AliFMDMCDensityCalculator.h"
-#include "AliFMDMCCorrections.h"
+#include "AliFMDMCCorrector.h"
 #include "AliFMDHistCollector.h"
 #include "AliAODForwardMult.h"
 #include "AliFMDEnergyFitter.h"
@@ -120,9 +120,9 @@ public:
   /**
    * Get reference to the Corrections algorithm 
    * 
-   * @return Reference to AliFMDCorrections object 
+   * @return Reference to AliFMDCorrector object 
    */
-  AliFMDCorrections& GetCorrections() { return fCorrections; }
+  AliFMDCorrector& GetCorrections() { return fCorrections; }
   /**
    * Get reference to the HistCollector algorithm 
    * 
@@ -156,9 +156,9 @@ public:
   /**
    * Get reference to the Corrections algorithm 
    * 
-   * @return Reference to AliFMDCorrections object 
+   * @return Reference to AliFMDCorrector object 
    */
-  const AliFMDCorrections& GetCorrections() const { return fCorrections; }
+  const AliFMDCorrector& GetCorrections() const { return fCorrections; }
   /**
    * Get reference to the HistCollector algorithm 
    * 
@@ -194,7 +194,7 @@ protected:
   AliFMDEnergyFitter        fEnergyFitter;      // Algorithm
   AliFMDMCSharingFilter     fSharingFilter;     // Algorithm
   AliFMDMCDensityCalculator fDensityCalculator; // Algorithm
-  AliFMDMCCorrections       fCorrections;       // Algorithm
+  AliFMDMCCorrector         fCorrections;       // Algorithm
   AliFMDHistCollector       fHistCollector;     // Algorithm
 
   TList* fList; // Output list 
index 32d4162..c77391e 100644 (file)
@@ -22,7 +22,7 @@
 #include "AliFMDEnergyFitter.h"
 #include "AliFMDSharingFilter.h"
 #include "AliFMDDensityCalculator.h"
-#include "AliFMDCorrections.h"
+#include "AliFMDCorrector.h"
 #include "AliFMDHistCollector.h"
 #include <TROOT.h>
 #include <iostream>
@@ -58,7 +58,7 @@ AliForwardMultiplicityBase::CheckCorrections(UInt_t what) const
     return false;
   }
   // Check that we have the secondary maps, needed by 
-  //   AliFMDCorrections 
+  //   AliFMDCorrector 
   //   AliFMDHistCollector
   if (what & AliForwardCorrectionManager::kSecondaryMap && 
       !fcm.GetSecondaryMap()) {
@@ -66,14 +66,14 @@ AliForwardMultiplicityBase::CheckCorrections(UInt_t what) const
     return false;
   }
   // Check that we have the vertex bias correction, needed by 
-  //   AliFMDCorrections 
+  //   AliFMDCorrector 
   if (what & AliForwardCorrectionManager::kVertexBias && 
       !fcm.GetVertexBias()) { 
     AliFatal("No event vertex bias corrections");
     return false;
   }
   // Check that we have the merging efficiencies, optionally used by 
-  //   AliFMDCorrections 
+  //   AliFMDCorrector 
   if (what & AliForwardCorrectionManager::kMergingEfficiency && 
       !fcm.GetMergingEfficiency()) {
     AliFatal("No merging efficiencies");
index b258b6b..babb194 100644 (file)
@@ -10,7 +10,7 @@ class AliFMDEventInspector;
 class AliFMDEnergyFitter;
 class AliFMDSharingFilter;
 class AliFMDDensityCalculator;
-class AliFMDCorrections;
+class AliFMDCorrector;
 class AliFMDHistCollector;
 class AliESDEvent;
 class TH2D;
@@ -128,9 +128,9 @@ public:
   /**
    * Get reference to the Corrections algorithm 
    * 
-   * @return Reference to AliFMDCorrections object 
+   * @return Reference to AliFMDCorrector object 
    */
-  virtual AliFMDCorrections& GetCorrections() = 0;
+  virtual AliFMDCorrector& GetCorrections() = 0;
   /**
    * Get reference to the HistCollector algorithm 
    * 
@@ -164,9 +164,9 @@ public:
   /**
    * Get reference to the Corrections algorithm 
    * 
-   * @return Reference to AliFMDCorrections object 
+   * @return Reference to AliFMDCorrector object 
    */
-  virtual const AliFMDCorrections& GetCorrections() const = 0;
+  virtual const AliFMDCorrector& GetCorrections() const = 0;
   /**
    * Get reference to the HistCollector algorithm 
    * 
index 8e6ade5..414bcd6 100644 (file)
@@ -9,7 +9,7 @@
 #include "AliFMDEnergyFitter.h"
 #include "AliFMDSharingFilter.h"
 #include "AliFMDDensityCalculator.h"
-#include "AliFMDCorrections.h"
+#include "AliFMDCorrector.h"
 #include "AliFMDHistCollector.h"
 #include "AliAODForwardMult.h"
 #include "AliFMDEnergyFitter.h"
@@ -116,9 +116,9 @@ public:
   /**
    * Get reference to the Corrections algorithm 
    * 
-   * @return Reference to AliFMDCorrections object 
+   * @return Reference to AliFMDCorrector object 
    */
-  AliFMDCorrections& GetCorrections() { return fCorrections; }
+  AliFMDCorrector& GetCorrections() { return fCorrections; }
   /**
    * Get reference to the HistCollector algorithm 
    * 
@@ -152,9 +152,9 @@ public:
   /**
    * Get reference to the Corrections algorithm 
    * 
-   * @return Reference to AliFMDCorrections object 
+   * @return Reference to AliFMDCorrector object 
    */
-  const AliFMDCorrections& GetCorrections() const { return fCorrections; }
+  const AliFMDCorrector& GetCorrections() const { return fCorrections; }
   /**
    * Get reference to the HistCollector algorithm 
    * 
@@ -186,7 +186,7 @@ protected:
   AliFMDEnergyFitter      fEnergyFitter;      // Algorithm
   AliFMDSharingFilter     fSharingFilter;     // Algorithm
   AliFMDDensityCalculator fDensityCalculator; // Algorithm
-  AliFMDCorrections       fCorrections;       // Algorithm
+  AliFMDCorrector         fCorrections;       // Algorithm
   AliFMDHistCollector     fHistCollector;     // Algorithm
 
   TList* fList; // Output list 
index 6d3ad45..1e9acaf 100644 (file)
@@ -1,5 +1,5 @@
 //_____________________________________________________________________
-TH2* MakeOneRing(UShort_t d, Char_t r, Float_t vz, Int_t& nDead)
+TH2D* MakeOneRing(UShort_t d, Char_t r, Double_t vz, Int_t& nDead)
 {
   AliFMDGeometry*   geom = AliFMDGeometry::Instance();
   AliFMDParameters* pars = AliFMDParameters::Instance();
@@ -8,15 +8,17 @@ TH2* MakeOneRing(UShort_t d, Char_t r, Float_t vz, Int_t& nDead)
   UShort_t nT = (r == 'I' || r == 'i' ? 512 : 256);
   
   // Make our two histograms 
-  TH2* hAll = new TH2D("all","All",200,-4,6,nS,0,2*TMath::Pi());
+  TH2D* hAll = new TH2D("all","All",200,-4,6,nS,0,2*TMath::Pi());
   hAll->SetXTitle("#eta");
   hAll->SetYTitle("#phi");
   hAll->Sumw2();
   hAll->SetDirectory(0);
-  TH2* hOK  = static_cast<TH2*>(hAll->Clone());
+  TH2D* hOK  = static_cast<TH2D*>(hAll->Clone());
   hOK->SetDirectory(0);
   
   // Loop over all sectors and strips in this ring 
+  Int_t nOK  = 0;
+  Int_t nAll = 0;
   for (UShort_t s = 0; s < nS; s++) { 
     for (UShort_t t = 0; t < nT; t++) { 
       // Get eta,phi by quering the geometry (first for (x,y,z), then
@@ -27,11 +29,16 @@ TH2* MakeOneRing(UShort_t d, Char_t r, Float_t vz, Int_t& nDead)
       z -= vz;
       Double_t q, eta, phi, theta;
       AliFMDGeometry::XYZ2REtaPhiTheta(x, y, z, q, eta, phi, theta);
+      if (phi < 0) phi += 2*TMath::Pi();
 
       // Check if this is a dead channel or not 
       Bool_t isDead = pars->IsDead(d, r, s, t);
       hAll->Fill(eta, phi);
-      if (!isDead) hOK->Fill(eta, phi);
+      nAll++;
+      if (!isDead) {
+       hOK->Fill(eta, phi);
+       nOK++;
+      }
       else         nDead++;
     }
   }
@@ -41,12 +48,15 @@ TH2* MakeOneRing(UShort_t d, Char_t r, Float_t vz, Int_t& nDead)
   // Clean up
   delete hAll;
 
+  Info("MakeAcceptanceCorrections","Made correction for FMD%d%c at vz=%f - "
+       "%d strips out of %d OK", d, r, vz, nOK, nAll);
+
   // Return result 
   return hOK;
 }
 
 //_____________________________________________________________________
-void MakeAcceptanceCorrection(Int_t   runNo, 
+void MakeAcceptanceCorrection(Int_t   runNo=121526, 
                              Int_t   nVtxBins=10, 
                              Float_t vtxLow=-10, 
                              Float_t vtxHigh=10){
@@ -60,19 +70,26 @@ void MakeAcceptanceCorrection(Int_t   runNo,
   //TGrid::Connect("alien://",0,0,"t");
   // --- Initialisations ------------------------------------------
   //Set up CDB manager
+  Info("MakeAcceptanceCorrections","Setting up OCDB");
   AliCDBManager* cdb = AliCDBManager::Instance();
   //cdb->SetDefaultStorage("alien://Folder=/alice/data/2010/OCDB");
-  cdb->SetDefaultStorage("local:///home/canute/ALICE/AliRoot/OCDB");
+  cdb->SetDefaultStorage("local://$(ALICE_ROOT)/OCDB");
   cdb->SetRun(runNo);
   
+  // Get the geometry 
+  Info("MakeAcceptanceCorrections","Loading geometry");
+  AliGeomManager::LoadGeometry();
+
   // Get an initialize parameters 
+  Info("MakeAcceptanceCorrections","Intialising parameters");
   AliFMDParameters* pars = AliFMDParameters::Instance();
   pars->Init();
 
   // Get an initialise geometry 
+  Info("MakeAcceptanceCorrections","Initialising geomtry");
   AliFMDGeometry* geom = AliFMDGeometry::Instance();
   geom->Init();
-  geom->InitTransforms();
+  geom->InitTransformations();
 
   // --- Output object -----------------------------------------------
   // Make our correction object 
@@ -82,14 +99,14 @@ void MakeAcceptanceCorrection(Int_t   runNo,
   // --- Loop over verticies and rings -------------------------------
   Int_t nDead = 0;
   Float_t dV = (vtxHigh - vtxLow) / nVtxBins;
-  for (Float_t v = vtxLow+dV/2; v < vtxHigh; v += dV) { 
+  for (Double_t v = vtxLow+dV/2; v < vtxHigh; v += dV) { 
     for(UShort_t d = 1; d <= 3;d++) { 
       UShort_t nR = (d == 1 ? 1 : 2);
       for (UShort_t q = 0; q < nR; q++) { 
        Char_t   r  = (q == 0 ? 'I' : 'O');
 
        // Delegate to other function 
-       TH2* ratio = MakeOneRing(d, r, v, nDead);
+       TH2D* ratio = MakeOneRing(d, r, v, nDead);
        if (!ratio) continue;
 
        // Set the correction 
@@ -99,10 +116,27 @@ void MakeAcceptanceCorrection(Int_t   runNo,
   }
 
   // Write to a file 
+#if 0
   TFile* out = TFile::Open(Form("acceptance_%d.root", runNo), "RECREATE");
   corr->Write("acceptance");
   out->Write();
   out->Close();
+#else 
+  Info("MakeAcceptanceCorrections","Writing to disk");
+  AliForwardCorrectionManager& cm = AliForwardCorrectionManager::Instance();
+  TString fname = cm.GetFileName(AliForwardCorrectionManager::kAcceptance, 
+                                2, 2760, 0, false);
+  TFile* out = TFile::Open(fname.Data(), "RECREATE");
+  corr->Write(cm.GetObjectName(AliForwardCorrectionManager::kAcceptance));
+  out->Write();
+  out->Close();
+  Info("MakeAcceptanceCorrections","File %s generated.  "
+       "It should be copied to %s", fname.Data(), 
+       cm.GetFileDir(AliForwardCorrectionManager::kAcceptance));
+  out = TFile::Open(fname.Data(), "READ");
+  new TBrowser;
+#endif
+  
 }
 
 //
diff --git a/PWG2/FORWARD/corrections/Acceptance/acceptance_PbPb_2760GeV_p0kG_real.root b/PWG2/FORWARD/corrections/Acceptance/acceptance_PbPb_2760GeV_p0kG_real.root
new file mode 100644 (file)
index 0000000..4e90f27
Binary files /dev/null and b/PWG2/FORWARD/corrections/Acceptance/acceptance_PbPb_2760GeV_p0kG_real.root differ
diff --git a/PWG2/FORWARD/corrections/Acceptance/acceptance_pp_0900GeV_p0kG_real.root b/PWG2/FORWARD/corrections/Acceptance/acceptance_pp_0900GeV_p0kG_real.root
new file mode 100644 (file)
index 0000000..98d4012
Binary files /dev/null and b/PWG2/FORWARD/corrections/Acceptance/acceptance_pp_0900GeV_p0kG_real.root differ
index 0c580e7..98d9772 100644 (file)
 #pragma link C++ class AliFMDDensityCalculator+;
 #pragma link C++ class AliFMDDensityCalculator::RingHistos+;
 #pragma link C++ class AliFMDMCDensityCalculator+;
-#pragma link C++ class AliFMDCorrections+;
-#pragma link C++ class AliFMDCorrections::RingHistos+;
-#pragma link C++ class AliFMDMCCorrections+;
+#pragma link C++ class AliFMDCorrector+;
+#pragma link C++ class AliFMDCorrector::RingHistos+;
+#pragma link C++ class AliFMDMCCorrector+;
 #pragma link C++ class AliFMDHistCollector+;
+#pragma link C++ class AliFMDCorrAcceptance+;
 #pragma link C++ class AliFMDCorrELossFit+;
 #pragma link C++ class AliFMDCorrELossFit::ELossFit+;
 #pragma link C++ class AliFMDCorrSecondaryMap+;