Added some classes to the build of PWGLF/forward2
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 1 Oct 2013 08:53:49 +0000 (08:53 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 1 Oct 2013 08:53:49 +0000 (08:53 +0000)
Removed obsolete PWGLF/forward and corresponding directories
Removed obsolete corrections for PWGLF/forward2

133 files changed:
PWGLF/CMakelibPWGLFforward.pkg [deleted file]
PWGLF/CMakelibPWGLFforward2.pkg
PWGLF/FORWARD/analysis/AddTaskCorrection.C [deleted file]
PWGLF/FORWARD/analysis/AddTaskFMD.C [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnaCalibBackgroundCorrection.cxx [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnaCalibBackgroundCorrection.h [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnaCalibEnergyDistribution.cxx [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnaCalibEnergyDistribution.h [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnaCalibEventSelectionEfficiency.cxx [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnaCalibEventSelectionEfficiency.h [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnaCalibSharingEfficiency.cxx [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnaCalibSharingEfficiency.h [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnaParameters.cxx [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnaParameters.h [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskBFCorrelation.cxx [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskBFCorrelation.h [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskBackgroundCorrection.h [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskCollector.cxx [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskCollector.h [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskDensity.cxx [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskDensity.h [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskDndeta.cxx [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskDndeta.h [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskESDReader.cxx [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskESDReader.h [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskGenerateCorrection.cxx [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskGenerateCorrection.h [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskSE.cxx [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskSE.h [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskSharing.cxx [deleted file]
PWGLF/FORWARD/analysis/AliFMDAnalysisTaskSharing.h [deleted file]
PWGLF/FORWARD/analysis/AliFMDDndeta.cxx [deleted file]
PWGLF/FORWARD/analysis/AliFMDDndeta.h [deleted file]
PWGLF/FORWARD/analysis/Run.sh [deleted file]
PWGLF/FORWARD/analysis/RunAliEnFMDAnalysis.C [deleted file]
PWGLF/FORWARD/analysis/RunAliEnFMDAnalysisSE.C [deleted file]
PWGLF/FORWARD/analysis/RunLocalFMDAnalysis.C [deleted file]
PWGLF/FORWARD/analysis/RunLocalFMDAnalysisSE.C [deleted file]
PWGLF/FORWARD/analysis/RunManager.C [deleted file]
PWGLF/FORWARD/analysis/SubmitFMDCorrections.C [deleted file]
PWGLF/FORWARD/analysis/SubmitFMDEnergyDistributions.C [deleted file]
PWGLF/FORWARD/analysis/SubmitSharingEffCorrection.C [deleted file]
PWGLF/FORWARD/analysis/drawdNdeta.C [deleted file]
PWGLF/FORWARD/analysis/mergescript.C [deleted file]
PWGLF/FORWARD/analysis/scripts/LoadLibs.C [deleted file]
PWGLF/FORWARD/analysis/scripts/TestTaskIO.C [deleted file]
PWGLF/FORWARD/analysis/scripts/ViewBGCor.C [deleted file]
PWGLF/FORWARD/analysis/scripts/ViewEDCor.C [deleted file]
PWGLF/FORWARD/analysis/scripts/runFMDbackground.C [deleted file]
PWGLF/FORWARD/analysis/scripts/runFMDcollector.C [deleted file]
PWGLF/FORWARD/analysis/scripts/runFMDjob.C [deleted file]
PWGLF/FORWARD/analysis/scripts/runFMDsharing.C [deleted file]
PWGLF/FORWARD/corrections/Acceptance/acceptance_PbPb_2750GeV_p0kG_real.root [deleted file]
PWGLF/FORWARD/corrections/Acceptance/acceptance_PbPb_2760GeV_p0kG_real.root [deleted file]
PWGLF/FORWARD/corrections/Acceptance/acceptance_pPb_5023GeV_m0kG_real.root [deleted file]
PWGLF/FORWARD/corrections/Acceptance/acceptance_pPb_5023GeV_m5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/Acceptance/acceptance_pPb_5023GeV_p0kG_real.root [deleted file]
PWGLF/FORWARD/corrections/Acceptance/acceptance_pPb_5023GeV_p5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/Acceptance/acceptance_pp_0900GeV_p0kG_real.root [deleted file]
PWGLF/FORWARD/corrections/Acceptance/acceptance_pp_0900GeV_p5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/Acceptance/acceptance_pp_2750GeV_p0kG_real.root [deleted file]
PWGLF/FORWARD/corrections/Acceptance/acceptance_pp_7000GeV_p0kG_real.root [deleted file]
PWGLF/FORWARD/corrections/Background/background_0_0_0_0_0_0.root [deleted file]
PWGLF/FORWARD/corrections/Background/background_0_0_1_0_0_0.root [deleted file]
PWGLF/FORWARD/corrections/Background/background_1_0_1_0_0_0.root [deleted file]
PWGLF/FORWARD/corrections/Background/background_2_0_1_0_0_0.root [deleted file]
PWGLF/FORWARD/corrections/Background/background_3_0_1_0_0_0.root [deleted file]
PWGLF/FORWARD/corrections/CentralAcceptance/centralacceptance_PbPb_2750GeV_m5kG.root [deleted file]
PWGLF/FORWARD/corrections/CentralAcceptance/centralacceptance_PbPb_2750GeV_p5kG.root [deleted file]
PWGLF/FORWARD/corrections/CentralAcceptance/centralacceptance_pPb_5023GeV_m5kG.root [deleted file]
PWGLF/FORWARD/corrections/CentralAcceptance/centralacceptance_pPb_5023GeV_m5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/CentralAcceptance/centralacceptance_pPb_5023GeV_p5kG.root [deleted file]
PWGLF/FORWARD/corrections/CentralAcceptance/centralacceptance_pPb_5023GeV_p5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/CentralAcceptance/centralacceptance_pp_0900GeV_p5kG.root [deleted file]
PWGLF/FORWARD/corrections/CentralAcceptance/centralacceptance_pp_2750GeV_m5kG.root [deleted file]
PWGLF/FORWARD/corrections/CentralAcceptance/centralacceptance_pp_7000GeV_p5kG.root [deleted file]
PWGLF/FORWARD/corrections/CentralSecMap/centralsecmap_PbPb_2750GeV_m5kG.root [deleted file]
PWGLF/FORWARD/corrections/CentralSecMap/centralsecmap_PbPb_2750GeV_p5kG.root [deleted file]
PWGLF/FORWARD/corrections/CentralSecMap/centralsecmap_pPb_5023GeV_m5kG.root [deleted file]
PWGLF/FORWARD/corrections/CentralSecMap/centralsecmap_pPb_5023GeV_m5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/CentralSecMap/centralsecmap_pPb_5023GeV_p5kG.root [deleted file]
PWGLF/FORWARD/corrections/CentralSecMap/centralsecmap_pPb_5023GeV_p5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/CentralSecMap/centralsecmap_pp_0900GeV_p5kG.root [deleted file]
PWGLF/FORWARD/corrections/CentralSecMap/centralsecmap_pp_2750GeV_m5kG.root [deleted file]
PWGLF/FORWARD/corrections/CentralSecMap/centralsecmap_pp_7000GeV_p5kG.root [deleted file]
PWGLF/FORWARD/corrections/DoubleHit/doublehit_pp_0900GeV_p5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/ELossFits/elossfits_PbPb_2750GeV_m5kG_MC.root [deleted file]
PWGLF/FORWARD/corrections/ELossFits/elossfits_PbPb_2750GeV_m5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/ELossFits/elossfits_PbPb_2750GeV_p5kG_MC.root [deleted file]
PWGLF/FORWARD/corrections/ELossFits/elossfits_PbPb_2750GeV_p5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/ELossFits/elossfits_pPb_5023GeV_m5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/ELossFits/elossfits_pPb_5023GeV_p5kG_MC.root [deleted file]
PWGLF/FORWARD/corrections/ELossFits/elossfits_pPb_5023GeV_p5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/ELossFits/elossfits_pp_0900GeV_p5kG_MC.root [deleted file]
PWGLF/FORWARD/corrections/ELossFits/elossfits_pp_0900GeV_p5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/ELossFits/elossfits_pp_2750GeV_m5kG_MC.root [deleted file]
PWGLF/FORWARD/corrections/ELossFits/elossfits_pp_2750GeV_m5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/ELossFits/elossfits_pp_7000GeV_m5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/ELossFits/elossfits_pp_7000GeV_p5kG_MC.root [deleted file]
PWGLF/FORWARD/corrections/ELossFits/elossfits_pp_7000GeV_p5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/ELossFits/elossfits_pp_8000GeV_m5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/EnergyDistribution/energydistributions_0_0_1_0_0_0.root [deleted file]
PWGLF/FORWARD/corrections/EnergyDistribution/energydistributions_0_0_1_0_1_0.root [deleted file]
PWGLF/FORWARD/corrections/EnergyDistribution/energydistributions_1_0_1_0_0_0.root [deleted file]
PWGLF/FORWARD/corrections/EnergyDistribution/energydistributions_2_0_1_0_0_0.root [deleted file]
PWGLF/FORWARD/corrections/EventSelectionEfficiency/eventselectionefficiency_0_0_1_0_0_0.root [deleted file]
PWGLF/FORWARD/corrections/EventSelectionEfficiency/eventselectionefficiency_1_0_1_0_0_0.root [deleted file]
PWGLF/FORWARD/corrections/EventSelectionEfficiency/eventselectionefficiency_2_0_1_0_0_0.root [deleted file]
PWGLF/FORWARD/corrections/MergingEfficiency/merging_pp_0900GeV_p5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/SecondaryMap/secondary_PbPb_2750GeV_m5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/SecondaryMap/secondary_PbPb_2750GeV_p5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/SecondaryMap/secondary_pPb_5023GeV_m5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/SecondaryMap/secondary_pPb_5023GeV_p5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/SecondaryMap/secondary_pp_0900GeV_p5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/SecondaryMap/secondary_pp_2750GeV_m5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/SecondaryMap/secondary_pp_7000GeV_m5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/SecondaryMap/secondary_pp_7000GeV_p5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/SecondaryMap/secondary_pp_8000GeV_m5kG_real.root [deleted file]
PWGLF/FORWARD/corrections/SharingEfficiency/sharingefficiency_0_0_1_0_0_0.root [deleted file]
PWGLF/FORWARD/corrections/SharingEfficiency/sharingefficiency_1_0_1_0_0_0.root [deleted file]
PWGLF/FORWARD/corrections/VertexBias/vertexbias_pp_0900GeV_p5kG_real.root [deleted file]
PWGLF/FORWARD/doc/Doxyfile
PWGLF/FORWARD/trains/ChainBuilder.C
PWGLF/FORWARD/trains/GridDownload.C
PWGLF/FORWARD/trains/GridTerminate.C
PWGLF/FORWARD/trains/GridWatch.C
PWGLF/FORWARD/trains/MyAnalysis.C
PWGLF/FORWARD/trains/MyTrain.C
PWGLF/FORWARD/trains/ParUtilities.C
PWGLF/FORWARD/trains/trainMain.cxx
PWGLF/PWGLFforward2LinkDef.h
PWGLF/PWGLFforwardLinkDef.h [deleted file]

diff --git a/PWGLF/CMakelibPWGLFforward.pkg b/PWGLF/CMakelibPWGLFforward.pkg
deleted file mode 100644 (file)
index f52488a..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-# -*- mode: CMake -*-
-#--------------------------------------------------------------------------------#
-# Package File for PWGLFforward                                                   #
-# Author : Johny Jose (johny.jose@cern.ch)                                       #
-# 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/analysis/AliFMDAnaParameters.cxx 
-    FORWARD/analysis/AliFMDAnaCalibEnergyDistribution.cxx 
-    FORWARD/analysis/AliFMDAnaCalibBackgroundCorrection.cxx 
-    FORWARD/analysis/AliFMDAnaCalibEventSelectionEfficiency.cxx 
-    FORWARD/analysis/AliFMDAnaCalibSharingEfficiency.cxx 
-    FORWARD/analysis/AliFMDAnalysisTaskESDReader.cxx 
-    FORWARD/analysis/AliFMDAnalysisTaskSharing.cxx 
-    FORWARD/analysis/AliFMDAnalysisTaskDensity.cxx 
-    FORWARD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx 
-    FORWARD/analysis/AliFMDAnalysisTaskCollector.cxx 
-    FORWARD/analysis/AliFMDAnalysisTaskDndeta.cxx 
-    FORWARD/analysis/AliFMDAnalysisTaskSE.cxx 
-    FORWARD/analysis/AliFMDAnalysisTaskGenerateCorrection.cxx 
-    FORWARD/analysis/AliFMDDndeta.cxx 
-    FORWARD/analysis/AliFMDAnalysisTaskBFCorrelation.cxx 
-    )
-
-string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
-
-set ( EINCLUDE  ANALYSIS FMD STEER/ESD STEER/STEERBase)
-
-set ( DHDR  PWGLFforwardLinkDef.h)
index 6accac46cb2cc59f8e7c6792c9abb068ef61eea9..c2a754dc4074737999e63c796172fb16f8c2ea15 100644 (file)
@@ -1,6 +1,6 @@
 # -*- mode: CMake -*-
 #------------------------------------------------------------------------#
-# Package File for PWGLFforward2                                          #
+# Package File for PWGLFforward2                                         #
 # Author : Christian Holm Christensen (cholm@nbi.dk)                     #
 # Variables Defined :                                                    #
 #                                                                        #
@@ -90,6 +90,9 @@ set ( SRCS
   FORWARD/analysis2/AliFMDMCSharingFilter.cxx
   FORWARD/analysis2/AliFMDMCTrackDensity.cxx
   # Forward tasks 
+  FORWARD/analysis2/AliBaseESDTask.cxx
+  FORWARD/analysis2/AliBaseAODTask.cxx
+  FORWARD/analysis2/AliBaseMCCorrectionsTask.cxx
   FORWARD/analysis2/AliFMDEnergyFitterTask.cxx 
   FORWARD/analysis2/AliFMDEventPlaneTask.cxx
   FORWARD/analysis2/AliForwarddNdetaTask.cxx
@@ -167,7 +170,7 @@ add_custom_command( OUTPUT FORWARD/doc/alice-int-2012-040.pdf
 
 add_custom_command( OUTPUT FORWARD/doc/html/index.html 
                    COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/FORWARD/doc
-                    COMMAND sed -e 's,../analysis2,${CMAKE_CURRENT_SOURCE_DIR}/FORWARD/analysis2,' -e 's,OUTPUT_DIRECTORY *=.*,OUTPUT_DIRECTORY = FORWARD/doc/,' < ${CMAKE_CURRENT_SOURCE_DIR}/FORWARD/doc/Doxyfile > ${CMAKE_CURRENT_BINARY_DIR}/FORWARD/doc/Doxyfile
+                    COMMAND sed -e 's,\\.\\./,${CMAKE_CURRENT_SOURCE_DIR}/FORWARD/,' -e 's,OUTPUT_DIRECTORY *=.*,OUTPUT_DIRECTORY = FORWARD/doc/,' < ${CMAKE_CURRENT_SOURCE_DIR}/FORWARD/doc/Doxyfile > ${CMAKE_CURRENT_BINARY_DIR}/FORWARD/doc/Doxyfile
                    COMMAND doxygen ${CMAKE_CURRENT_BINARY_DIR}/FORWARD/doc/Doxyfile
                    DEPENDS ${SRCS} ${HDRS})
 
@@ -278,16 +281,8 @@ install ( FILES FORWARD/analysis2/AddTaskCentraldNdeta.C
            DESTINATION PWGLF/FORWARD/analysis2 )
 
 # Install corrections 
-install ( DIRECTORY FORWARD/corrections/DoubleHit
-                   FORWARD/corrections/ELossFits
-                   FORWARD/corrections/Empirical
-                   FORWARD/corrections/MergingEfficiency
-                   FORWARD/corrections/SecondaryMap
-                   FORWARD/corrections/VertexBias
-                   FORWARD/corrections/Acceptance
+install ( DIRECTORY FORWARD/corrections/Empirical
                    FORWARD/corrections/Normalization
-                   FORWARD/corrections/CentralAcceptance
-                   FORWARD/corrections/CentralSecMap
           DESTINATION PWGLF/FORWARD/corrections 
          PATTERN "*~"   EXCLUDE
          PATTERN ".svn" EXCLUDE)
diff --git a/PWGLF/FORWARD/analysis/AddTaskCorrection.C b/PWGLF/FORWARD/analysis/AddTaskCorrection.C
deleted file mode 100644 (file)
index bbf276d..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-// This is the macro to include the FMD analysis in the train.  It
-// depends on two libraries: libFMDanalysis.so in AliRoot and
-// libPhysics.so in ROOT. It has been tested to work with the example
-// scripts in the ANALYSIS webpages.  
-//
-// Author: Hans Hjersing Dalsgaard <hans.dalsgaard@cern.ch>
-
-
-AliAnalysisTask* AddTaskCorrection(Float_t blow =0,
-                                  Float_t bhigh =100,                             
-                                  Float_t cmsGeV=900.F, 
-                                  const char* col="p-p", 
-                                  Float_t bkG=5.F) 
-{
-  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
-  if (!mgr) {
-    Error("AddTaskESDFilter", "No analysis manager to connect to.");
-    return NULL;
-  }   
-  
-  
-  // --- Generate parameter manager ----------------------------------
-  /* AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  pars->SetEnergy(cmsGeV);
-  pars->SetCollisionSystem(col);
-  pars->SetMagField(bkG);
-  pars->SetProcessPrimary(kFALSE);
-  pars->SetProcessHits(kFALSE);
-  pars->SetRealData(kTRUE);
-  */
-  // --- Check if we have an MC handler ------------------------------
-  //AliMCEventHandler* eventHandler = 
-  //  dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()
-  //                                 ->GetMCtruthEventHandler());
-  //if(eventHandler) {
-  //  pars->SetRealData(kFALSE);
-  //  pars->SetProcessPrimary(kTRUE);
-  //  pars->SetProcessHits(kFALSE);
-  // }
-  //pars->Init();
-  //pars->PrintStatus();
-  const Char_t* outFile = AliAnalysisManager::GetCommonFileName();
-  // --- Make the task -----------------------------------------------
-  AliFMDAnalysisTaskGenerateCorrection *taskfmd = new AliFMDAnalysisTaskGenerateCorrection("TaskFMD");
-  taskfmd->SetBLow(blow);
-  taskfmd->SetBHigh(bhigh);
-  mgr->AddTask(taskfmd);
-  
-  // --- Connect input/output ----------------------------------------
-  AliAnalysisDataContainer *cout_fmd1 = mgr->CreateContainer("Hits", 
-                                                            TList::Class(),
-                                                            AliAnalysisManager::kOutputContainer, outFile);
-  AliAnalysisDataContainer *cout_fmd2 = mgr->CreateContainer("Primaries", 
-                                                            TList::Class(),
-                                                            AliAnalysisManager::kOutputContainer, outFile);
-  
-  AliAnalysisDataContainer *cout_fmd3 = mgr->CreateContainer("vertex", 
-                                                            TH1F::Class(),
-                                                            AliAnalysisManager::kOutputContainer, outFile);
-  AliAnalysisDataContainer *cout_fmd4 = mgr->CreateContainer("Correction", 
-                                                            TList::Class(),
-                                                            AliAnalysisManager::kOutputContainer, outFile);
-  
-  
-  // Dummy AOD output container for jet analysis (no client yet)
-  //AliAnalysisDataContainer *c_aodfmd = mgr->CreateContainer("cAODfmd", 
-  //                                               TTree::Class(),
-  //                                               AliAnalysisManager::kExchangeContainer);
-  // Connect to data containers
-  // mgr->ConnectInput  (taskfmd,     0, cin_esd  );
-  // mgr->ConnectOutput (fmdana,     0, c_aodfmd );
-   mgr->ConnectOutput (taskfmd,     1, cout_fmd1 );
-  mgr->ConnectOutput (taskfmd,     2, cout_fmd2 );
-  mgr->ConnectOutput (taskfmd,     3, cout_fmd3 );
-  mgr->ConnectOutput (taskfmd,     4, cout_fmd4 );
-
-  
-  TString outputfile = Form("%s:%s", 
-                           AliAnalysisManager::GetCommonFileName(),
-                           "Background");
-
-  //  AliAnalysisDataContainer *cout_fmd = 
-  // mgr->CreateContainer("BackgroundCorrected", TList::Class(), 
-  //            AliAnalysisManager::kOutputContainer,outputfile);
-  mgr->ConnectInput(taskfmd, 0, mgr->GetCommonInputContainer());
-  //mgr->ConnectOutput(taskfmd, 1, cout_fmd);
-
-  return taskfmd;
-}
-//
-// EOF
-//
-
diff --git a/PWGLF/FORWARD/analysis/AddTaskFMD.C b/PWGLF/FORWARD/analysis/AddTaskFMD.C
deleted file mode 100644 (file)
index 864b7c9..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-// This is the macro to include the FMD analysis in the train.  It
-// depends on two libraries: libFMDanalysis.so in AliRoot and
-// libPhysics.so in ROOT. It has been tested to work with the example
-// scripts in the ANALYSIS webpages.  
-//
-// Author: Hans Hjersing Dalsgaard <hans.dalsgaard@cern.ch>
-
-
-AliFMDAnalysisTaskSE* AddTaskFMD(Float_t cmsGeV=900.F, 
-                                const char* col="p-p", 
-                                Float_t bkG=5.F) 
-{
-  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
-  if (!mgr) {
-    Error("AddTaskESDFilter", "No analysis manager to connect to.");
-    return NULL;
-  }   
-  
-  
-  // --- Generate parameter manager ----------------------------------
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  pars->SetEnergy(cmsGeV);
-  pars->SetCollisionSystem(col);
-  pars->SetMagField(bkG);
-  pars->SetProcessPrimary(kFALSE);
-  pars->SetProcessHits(kFALSE);
-  pars->SetRealData(kTRUE);
-
-  // --- Check if we have an MC handler ------------------------------
-  AliMCEventHandler* eventHandler = 
-    dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()
-                                     ->GetMCtruthEventHandler());
-  if(eventHandler) {
-    pars->SetRealData(kFALSE);
-    pars->SetProcessPrimary(kTRUE);
-    pars->SetProcessHits(kFALSE);
-  }
-  pars->Init();
-  pars->PrintStatus();
-  
-  // --- Make the task -----------------------------------------------
-  AliFMDAnalysisTaskSE *taskfmd = new AliFMDAnalysisTaskSE("TaskFMD");
-  mgr->AddTask(taskfmd);
-
-  // --- Connect input/output ----------------------------------------
-  TString outputfile = Form("%s:%s", 
-                           AliAnalysisManager::GetCommonFileName(),
-                           pars->GetDndetaAnalysisName());
-
-  AliAnalysisDataContainer *cout_fmd = 
-    mgr->CreateContainer("BackgroundCorrected", TList::Class(), 
-                        AliAnalysisManager::kOutputContainer,outputfile);
-  mgr->ConnectInput(taskfmd, 0, mgr->GetCommonInputContainer());
-  mgr->ConnectOutput(taskfmd, 1, cout_fmd);
-
-  return taskfmd;
-}
-//
-// EOF
-//
-
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnaCalibBackgroundCorrection.cxx b/PWGLF/FORWARD/analysis/AliFMDAnaCalibBackgroundCorrection.cxx
deleted file mode 100644 (file)
index e2c10ad..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-//
-// Calibration/Correction object that stores the secondary to primary
-// correction used in the FMD analysis.
-// 
-#include "AliFMDAnaCalibBackgroundCorrection.h"
-#include <TH2F.h>
-#include <TH1F.h>
-#include <TBrowser.h>
-
-ClassImp(AliFMDAnaCalibBackgroundCorrection)
-#if 0
-; // For Emacs
-#endif 
-
-//____________________________________________________________________
-AliFMDAnaCalibBackgroundCorrection::AliFMDAnaCalibBackgroundCorrection() 
-  : TObject(),
-    fArray(),
-    fAxis(),
-    fIsInit(kFALSE),
-    fListOfDoubleHitCorrection(),
-    fListOfNSDBgMaps()
-{
-}
-
-
-//____________________________________________________________________
-AliFMDAnaCalibBackgroundCorrection::AliFMDAnaCalibBackgroundCorrection(const AliFMDAnaCalibBackgroundCorrection& o)
-  : TObject(o), 
-    fArray(o.fArray), 
-    fAxis(o.fAxis), 
-    fIsInit(o.fIsInit), 
-    fListOfDoubleHitCorrection(), 
-    fListOfNSDBgMaps()
-{
-  // Copy ctor 
-}
-//____________________________________________________________________
-AliFMDAnaCalibBackgroundCorrection&
-AliFMDAnaCalibBackgroundCorrection::operator=(const AliFMDAnaCalibBackgroundCorrection& o) 
-{
-  // Assignment operator 
-  
-  fArray     = o.fArray;
-  
-  return (*this);
-}
-
-//____________________________________________________________________
-void 
-AliFMDAnaCalibBackgroundCorrection::SetBgCorrection(Int_t det, 
-                                                   Char_t ring, 
-                                                   Int_t vtxbin, 
-                                                   TH2F* hCorrection) 
-{
-  if(!fIsInit) Init();
-  
-  TObjArray* ringArray = GetRingArray(det,ring);
-  if (!ringArray) return;
-
-  ringArray->AddAtAndExpand(hCorrection,vtxbin);
-  
-}
-//____________________________________________________________________
-TH2F* 
-AliFMDAnaCalibBackgroundCorrection::GetBgCorrection(Int_t det, 
-                                                   Char_t ring, 
-                                                   Int_t vtxbin) const
-{
-  TObjArray* ringArray   = GetRingArray(det,ring);
-  if (!ringArray) return 0;
-
-  TH2F*      hCorrection = static_cast<TH2F*>(ringArray->At(vtxbin));
-  return hCorrection;
-}
-//____________________________________________________________________
-void 
-AliFMDAnaCalibBackgroundCorrection::SetNSDBgCorrection(Int_t det, 
-                                                      Char_t ring, 
-                                                      Int_t vtxbin, 
-                                                      TH2F* hCorrection) 
-{
-  if(!fIsInit)  Init();
-  hCorrection->SetName(Form("FMDNSD%d%c_vtxbin_%d_correction",det,ring,vtxbin));
-  fListOfNSDBgMaps.Add(hCorrection);
-    
-}
-//____________________________________________________________________
-TH2F* 
-AliFMDAnaCalibBackgroundCorrection::GetNSDBgCorrection(Int_t det, 
-                                                      Char_t ring, 
-                                                      Int_t vtxbin) const
-{
-  TH2F* hCorrection    = 
-    static_cast<TH2F*>(fListOfNSDBgMaps
-                      .FindObject(Form("FMDNSD%d%c_vtxbin_%d_correction",
-                                       det,ring,vtxbin)));
-  return hCorrection;
-}
-//____________________________________________________________________
-TH1F* 
-AliFMDAnaCalibBackgroundCorrection::GetDoubleHitCorrection(Int_t  det, 
-                                                          Char_t ring) const
-{  
-  TH1F* hCorrection    = 
-    static_cast<TH1F*>(fListOfDoubleHitCorrection
-                      .FindObject(Form("hDoubleHitCorrection_FMD%d%c",
-                                       det,ring)));
-  return hCorrection;
-}
-
-//____________________________________________________________________
-void 
-AliFMDAnaCalibBackgroundCorrection::SetDoubleHitCorrection(Int_t det, 
-                                                          Char_t ring, 
-                                                          TH1F* hCorrection) 
-{
-  hCorrection->SetName(Form("hDoubleHitCorrection_FMD%d%c",det,ring));
-  fListOfDoubleHitCorrection.Add(hCorrection);    
-}
-//____________________________________________________________________
-TH1F* 
-AliFMDAnaCalibBackgroundCorrection::GetSPDDeadCorrection(Int_t  vtxbin) const
-{
-  TH1F* hCorrection    = 
-    static_cast<TH1F*>(fListOfDoubleHitCorrection
-                      .FindObject(Form("hSPDDeadCorrection_vtx%d",vtxbin)));
-  return hCorrection;
-}
-
-//____________________________________________________________________
-void 
-AliFMDAnaCalibBackgroundCorrection::SetSPDDeadCorrection(Int_t vtxbin, 
-                                                        TH1F* hCorrection) 
-{
-  hCorrection->SetName(Form("hSPDDeadCorrection_vtx%d",vtxbin));
-  fListOfDoubleHitCorrection.Add(hCorrection);    
-}
-
-//____________________________________________________________________
-TH1F* 
-AliFMDAnaCalibBackgroundCorrection::GetFMDDeadCorrection(Int_t  vtxbin) 
-{
-  TH1F* hCorrection    = 
-    static_cast<TH1F*>(fListOfDoubleHitCorrection
-                      .FindObject(Form("hFMDDeadCorrection_vtx%d",vtxbin)));
-  return hCorrection;
-}
-
-//____________________________________________________________________
-void 
-AliFMDAnaCalibBackgroundCorrection::SetFMDDeadCorrection(Int_t vtxbin, 
-                                                        TH1F* hCorrection) 
-{
-  hCorrection->SetName(Form("hFMDDeadCorrection_vtx%d",vtxbin));
-  fListOfDoubleHitCorrection.Add(hCorrection);    
-}
-
-//____________________________________________________________________
-void 
-AliFMDAnaCalibBackgroundCorrection::SetRefAxis(TAxis* axis) 
-{
-  // Set the reference axis 
-  fAxis.Set(axis->GetNbins(),axis->GetXmin(),axis->GetXmax());
-}
-//____________________________________________________________________
-void AliFMDAnaCalibBackgroundCorrection::Init() 
-{
-  // Initialize 
-  fArray.SetOwner();
-  
-  TObjArray* spdArray = new TObjArray();
-  spdArray->SetOwner();
-  fArray.AddAtAndExpand(spdArray,0);
-  
-  for(Int_t det = 1; det<=3;det++) {
-    TObjArray* detArray = new TObjArray();
-    detArray->SetOwner();
-    detArray->SetName(Form("FMD%d", det));
-    // detArray->SetTitle(Form("Array of FMD%d corrections", det));
-    fArray.AddAtAndExpand(detArray,det);
-    Int_t nRings = (det == 1 ? 1 : 2);
-    for(Int_t ring = 0;ring<nRings;ring++) {
-      TObjArray* ringArray = new TObjArray();
-      Char_t r = (ring == 0 ? 'I' : 'O');
-      ringArray->SetOwner();
-      ringArray->SetName(Form("FMD%d%c", det, r));
-      // ringArray->SetTitle(Form("Array of FMD%d%c corrections", det, r));
-      detArray->AddAtAndExpand(ringArray,ring);
-      
-    }
-  }
-  fIsInit = kTRUE;
-  
-}
-//____________________________________________________________________
-TObjArray* AliFMDAnaCalibBackgroundCorrection::GetRingArray(Int_t det, 
-                                                           Char_t ring) const
-{
-  // Find array corresponding to det, ring.  
-  // Note, 0 and 4 refers to the SPD arrays 
-  if(det==0 || det == 4) {
-    TObjArray* spdArray  = (TObjArray*)fArray.At(det);
-    return spdArray;
-  }
-
-  if (det < 0 || det >= fArray.GetEntriesFast()) return 0; 
-
-  Int_t      ringNumber = (ring == 'I' ? 0 : 1);
-  TObjArray* detArray   = static_cast<TObjArray*>(fArray.At(det));
-  TObjArray* ringArray  = static_cast<TObjArray*>(detArray->At(ringNumber));
-  
-  return ringArray;
-}
-
-//____________________________________________________________________
-void
-AliFMDAnaCalibBackgroundCorrection::Browse(TBrowser* b)
-{
-  // Browse 
-  b->Add(&fAxis, "Vertex bins");
-  b->Add(&fArray, "Array of histograms w/BG corrections");
-}
-
-//____________________________________________________________________
-//
-// EOF
-//
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnaCalibBackgroundCorrection.h b/PWGLF/FORWARD/analysis/AliFMDAnaCalibBackgroundCorrection.h
deleted file mode 100644 (file)
index 27b7edb..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-#ifndef ALIFMDANACALIBBACKGROUNDCORRECTION_H
-#define ALIFMDANACALIBBACKGROUNDCORRECTION_H
-
-#include <TObject.h>
-#include <TObjArray.h>
-// #include <TH2F.h>
-#include <TAxis.h>
-#include <TList.h>
-class TH2F;
-class TH1F;
-class TBrowser;
-
-/**
- * @ingroup FMD_ana
- * @brief Object to store secondary corrections. 
- *
- * Objects of this class contains 1 2D histogram per detector,ring 
- * per vertex bin.   The histogram is an (eta,phi) histogram of the ratio
- * of total number of particles (seconary+primary) to the number of 
- * primary particles.   
- * 
- * Objects of this class are generated by 
- * @todo  expand documentation 
- * 
- */
-class AliFMDAnaCalibBackgroundCorrection : public TObject
-{
-public:
-  /** 
-   * Constructor
-   */  
-  AliFMDAnaCalibBackgroundCorrection();
-  /** 
-   * Copy constructor
-   * 
-   * @param o Object to copy from 
-   */
-  AliFMDAnaCalibBackgroundCorrection(const AliFMDAnaCalibBackgroundCorrection& o);
-  /** 
-   * Assignment operator 
-   * 
-   * @param o Object to assign from 
-   * 
-   * @return Reference to this object 
-   */
-  AliFMDAnaCalibBackgroundCorrection& operator=(const AliFMDAnaCalibBackgroundCorrection& o);
-  
-  /** 
-   * Get the background (secondary) correction
-   * 
-   * @param det     Detector
-   * @param ring    Ring
-   * @param vtxbin  Vertex bin
-   * 
-   * @return 2D Histogram (eta,phi) secondary correction map
-   */  
-  TH2F*   GetBgCorrection(Int_t det, Char_t ring, Int_t vtxbin) const;
-  /** 
-   * Set the background correction 
-   * 
-   * @param det          Detector
-   * @param ring         Ring 
-   * @param vtxbin       Vertex bin 
-   * @param hCorrection  2D Histogram (eta,phi) secondary correction map
-   */
-  void    SetBgCorrection(Int_t det, Char_t ring, Int_t vtxbin, 
-                         TH2F* hCorrection);
-  /** 
-   * Get the Non-single-diffractive secondary correction map
-   * 
-   * @param det    Detector   
-   * @param ring   Ring            
-   * @param vtxbin Vertex bin 
-   * 
-   * @return 2D Histogram (eta,phi) secondary correction map
-   */
-  TH2F*   GetNSDBgCorrection(Int_t det, Char_t ring, Int_t vtxbin) const;
-  /** 
-   * Set the Non-single-diffractive secondary correction map
-   * 
-   * @param det         Detector   
-   * @param ring        Ring       
-   * @param vtxbin      Vertex bin 
-   * @param hCorrection 2D Histogram (eta,phi) secondary correction map
-   */
-  void    SetNSDBgCorrection(Int_t det, Char_t ring, Int_t vtxbin, 
-                            TH2F* hCorrection);
-  
-  /** 
-   * Get the double hit correction 
-   * 
-   * @param det   Detector 
-   * @param ring  Ring
-   * 
-   * @return 1D histogram (eta) of correction
-   */  
-  TH1F*   GetDoubleHitCorrection(Int_t det, Char_t ring) const;
-  /** 
-   * Set the double hit correction 
-   * 
-   * @param det         Detector 
-   * @param ring        Ring
-   * @param hCorrection 1D histogram (eta) of correction
-   */  
-  void    SetDoubleHitCorrection(Int_t det, Char_t ring, TH1F* hCorrection);
-  /** 
-   * Get the SPD dead correction 
-   * 
-   * @param vtxbin Vertext bin 
-   * 
-   * @return 1D Histogram (eta) of SPD dead correction
-   */
-  TH1F*   GetSPDDeadCorrection(Int_t vtxbin) const;
-  /** 
-   * Set the SPD dead correction 
-   * 
-   * @param vtxbin      Vertex bin 
-   * @param hCorrection 1D Histogram (eta) of SPD dead correction
-   */
-  void    SetSPDDeadCorrection(Int_t vtxbin, TH1F* hCorrection);
-  /** 
-   * Get the FMD dead correction 
-   * 
-   * @param vtxbin Vertext bin 
-   * 
-   * @return 1D Histogram (eta) of FMD dead correction
-   */
-  TH1F*   GetFMDDeadCorrection(Int_t vtxbin);
-  /** 
-   * Set the FMD dead correction 
-   * 
-   * @param vtxbin      Vertex bin 
-   * @param hCorrection 1D Histogram (eta) of FMD dead correction
-   */
-  void    SetFMDDeadCorrection(Int_t vtxbin, TH1F* hCorrection);
-  /** 
-   * Set the reference axis 
-   * 
-   * @param axis Axis of vertex bins 
-   */
-  void    SetRefAxis(TAxis* axis);
-  /** 
-   * Get the vertex axis 
-   * 
-   * @return Constant reference to vertex axis 
-   */
-  const TAxis& GetRefAxis() const { return fAxis; }
-  /** 
-   * Get the number of vertex bins 
-   * 
-   * @return Number of vertex bins 
-   */
-  Int_t   GetNvtxBins() const { return fAxis.GetNbins(); }
-  /** 
-   * Get the maximum vertex cut (in cm)
-   * 
-   * @return Maximum absolute value of the Z position of the vertex 
-   */
-  Float_t GetVtxCutZ() const { return fAxis.GetXmax(); }
-  /** 
-   * Initialize 
-   * 
-   */
-  void    Init();
-  /** 
-   * Nice browsing 
-   * 
-   * 
-   * @return 
-   */
-  Bool_t  IsFolder() const { return kTRUE; }
-  /** 
-   * Nice browsing 
-   * 
-   * @param b Browser 
-   */
-  void    Browse(TBrowser* b);
-protected:
-  /** 
-   * Get the ring array  
-   * 
-   * @param det   Detector 
-   * @param ring  Ring 
-   * 
-   * @return 
-   */  
-  TObjArray* GetRingArray(Int_t det, Char_t ring) const;
-  TObjArray  fArray;                           // Array
-  TAxis      fAxis;                            // Vertex axis
-  Bool_t     fIsInit;                          // Whether this has been init
-  TList      fListOfDoubleHitCorrection;       // Double hit corrections
-  TList      fListOfNSDBgMaps;                 // NSD bg maps
-  ClassDef(AliFMDAnaCalibBackgroundCorrection,3);
-};
-
-#endif
-// Local Variables:
-//   mode: C++
-// End:
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnaCalibEnergyDistribution.cxx b/PWGLF/FORWARD/analysis/AliFMDAnaCalibEnergyDistribution.cxx
deleted file mode 100644 (file)
index 8b5cd0a..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-//
-// Object to store energy distribution corrections as used in the FMD
-// analysis.  
-//
-//
-#include "AliFMDAnaCalibEnergyDistribution.h"
-#include "TAxis.h"
-#include <AliLog.h>
-#include <iostream>
-#include "TH2F.h"
-#include <TBrowser.h>
-#include "AliFMDAnaParameters.h"
-ClassImp(AliFMDAnaCalibEnergyDistribution)
-#if 0  
-; // This is for Emacs 
-#endif 
-
-//____________________________________________________________________
-AliFMDAnaCalibEnergyDistribution::AliFMDAnaCalibEnergyDistribution() 
-: TObject(),
-  fArray(), 
-  fEmptyArray(), 
-  fRingArray(), 
-  fIsInit(kFALSE),
-  fNetaBins(0),
-  fEtaMax(0),
-  fEtaMin(0)
-{
-  
-  
-}
-//____________________________________________________________________
-void AliFMDAnaCalibEnergyDistribution::Init() 
-{
-  //Init object
-  if(fNetaBins == 0)
-    AliFatal("Set Eta bins before doing Init or anything else");
-  
-  fArray.SetOwner();
-  fArray.SetName("etaBins");
-  fEmptyArray.SetOwner();
-  fEmptyArray.SetName("empty");
-  fRingArray.SetName("rings");
-
-  for(Int_t i = 0; i<fNetaBins; i++) {
-    TObjArray* etaArray = new TObjArray();
-    etaArray->SetName(Form("etabin_%03d", i+1));
-    fArray.AddAtAndExpand(etaArray,i);
-    for(Int_t det = 1; det<=3;det++) {
-      TObjArray* detArray = new TObjArray();
-      detArray->SetName(Form("FMD%d", det));
-      etaArray->AddAtAndExpand(detArray,det);
-    }
-  }
-  
-
-  
-  for(Int_t det = 1; det<=3;det++) {
-    TObjArray* detArray = new TObjArray();
-    detArray->SetName(Form("FMD%d", det));
-    fEmptyArray.AddAtAndExpand(detArray,det);
-  }
-    
-  for(Int_t det = 1; det<=3;det++) {
-    TObjArray* detArray = new TObjArray();
-    detArray->SetName(Form("FMD%d", det));
-    fRingArray.AddAtAndExpand(detArray,det);
-  }
-    
-    
-  fIsInit = kTRUE;
-}
-
-
-//____________________________________________________________________
-TH1F* 
-AliFMDAnaCalibEnergyDistribution::GetEnergyDistribution(Int_t det, 
-                                                       Char_t ring, 
-                                                       Float_t eta) {
-  //Get Energy dist
-  //TAxis testaxis(fNetaBins,fEtaMin,fEtaMax);
-  //  Int_t binnumber = testaxis.FindBin(eta);
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-    
-  Int_t binnumber       = pars->GetEtaBin(eta);
-  
-  Int_t      ringNumber = (ring == 'I' ? 0 : 1);
-  TObjArray* etaArray   = (TObjArray*)fArray.At(binnumber); 
-  TObjArray* detArray   = (TObjArray*)etaArray->At(det); 
-  TH1F*      hEdist     = (TH1F*)detArray->At(ringNumber);    
-  
-  return hEdist;
-}
-//____________________________________________________________________
-TH1F* 
-AliFMDAnaCalibEnergyDistribution::GetEmptyEnergyDistribution(Int_t det, 
-                                                            Char_t ring) 
-{
-  //Get e dist of empty
-  Int_t ringNumber     = (ring == 'I' ? 0 : 1);
-  
-  TObjArray* detArray  = (TObjArray*)fEmptyArray.At(det); 
-  TH1F* hEdist         = (TH1F*)detArray->At(ringNumber);    
-  
-  return hEdist;
-}
-//____________________________________________________________________
-TH1F* 
-AliFMDAnaCalibEnergyDistribution::GetRingEnergyDistribution(Int_t det, 
-                                                           Char_t ring) {
-  // Get E dist of ring
-  Int_t ringNumber     = (ring == 'I' ? 0 : 1);
-  
-  TObjArray* detArray  = (TObjArray*)fRingArray.At(det); 
-  TH1F* hEdist         = (TH1F*)detArray->At(ringNumber);    
-  
-  return hEdist;
-}
-//____________________________________________________________________
-void  
-AliFMDAnaCalibEnergyDistribution::SetEnergyDistributionUser(Int_t det, 
-                                                           Char_t ring, 
-                                                           Float_t eta, 
-                                                           TH1F* edist) 
-{
-  //Set E dist (user)
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  Int_t binnumber = pars->GetEtaBin(eta);
-  //std::cout<<binnumber<<std::endl;
-  SetEnergyDistribution(det, ring, binnumber, edist );
-}
-//____________________________________________________________________
-void 
-AliFMDAnaCalibEnergyDistribution::SetEnergyDistribution(Int_t  det, 
-                                                       Char_t ring, 
-                                                       Int_t  etabin, 
-                                                       TH1F*  edist) 
-{  
-  //Set E dist
-  if(!fIsInit)  Init();
-  
-  Int_t ringNumber     = (ring == 'I' ? 0 : 1);
-  TObjArray* etaArray  = (TObjArray*)fArray.At(etabin);
-  TObjArray* detArray  = (TObjArray*)etaArray->At(det);
-  
-  detArray->AddAtAndExpand(edist,ringNumber);
-}
-
-//____________________________________________________________________
-void 
-AliFMDAnaCalibEnergyDistribution::SetEmptyEnergyDistribution(Int_t  det, 
-                                                            Char_t ring, 
-                                                            TH1F*  edist) 
-{  
-  //Set the empty dist
-  if(!fIsInit)
-    Init();
-    
-  Int_t ringNumber     = (ring == 'I' ? 0 : 1);
-  TObjArray* detArray  = (TObjArray*)fEmptyArray.At(det);
-  
-  detArray->AddAtAndExpand(edist,ringNumber);
-  
-
-}
-//____________________________________________________________________
-void AliFMDAnaCalibEnergyDistribution::SetRingEnergyDistribution(Int_t  det, 
-                                                                Char_t ring, 
-                                                                TH1F*  edist) 
-{
-  // Set E dist of ring
-  if(!fIsInit) Init();
-    
-  Int_t ringNumber     = (ring == 'I' ? 0 : 1);
-  TObjArray* detArray  = (TObjArray*)fRingArray.At(det);
-  
-  detArray->AddAtAndExpand(edist,ringNumber);
-}
-//____________________________________________________________________
-void AliFMDAnaCalibEnergyDistribution::Browse(TBrowser* b)
-{
-  //Browse object
-  for(Int_t i = 0; i<fNetaBins; i++) {
-    TObjArray* etaArray = static_cast<TObjArray*>(fArray.At(i));
-    etaArray->SetName(Form("etabin_%03d", i+1));
-    for(Int_t det = 1; det<=3;det++) {
-      TObjArray* detArray = static_cast<TObjArray*>(etaArray->At(det));
-      detArray->SetName(Form("FMD%d", det));
-    }
-  }
-  
-  for(Int_t det = 1; det<=3;det++) {
-    TObjArray* detArray = static_cast<TObjArray*>(fEmptyArray.At(det));
-    detArray->SetName(Form("FMD%d", det));
-  }
-    
-  for(Int_t det = 1; det<=3;det++) {
-    TObjArray* detArray = static_cast<TObjArray*>(fRingArray.At(det));
-    detArray->SetName(Form("FMD%d", det));
-  }
-
-  b->Add(&fArray,     "etabins");
-  b->Add(&fEmptyArray,"empty");
-  b->Add(&fRingArray, "rings");
-}
-
-//____________________________________________________________________
-//
-// EOF
-//
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnaCalibEnergyDistribution.h b/PWGLF/FORWARD/analysis/AliFMDAnaCalibEnergyDistribution.h
deleted file mode 100644 (file)
index d5bee2a..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#ifndef ALIFMDANACALIBENERGYDISTRIBUTION_H
-#define ALIFMDANACALIBENERGYDISTRIBUTION_H
-#include <TObject.h>
-#include <TObjArray.h>
-#include <TH1F.h>
-class TBrowser;
-/**
- * @ingroup FMD_ana
- * @brief Find most-probable value of MIP peak for one or more
- * particles. 
- * 
- */
-class AliFMDAnaCalibEnergyDistribution : public TObject
-{
-  
- public:
-  
-  AliFMDAnaCalibEnergyDistribution();
-  void  SetNetaBins(Int_t nbins) {fNetaBins = nbins;}
-  Int_t GetNetaBins() const { return fNetaBins;}
-  void  SetEtaLimits(Float_t eta_min, Float_t eta_max) {fEtaMin = eta_min; fEtaMax = eta_max;}
-  void  SetEnergyDistributionUser(Int_t det, Char_t ring, Float_t eta, TH1F* edist);
-  void  SetEnergyDistribution(Int_t det, Char_t ring, Int_t etabin, TH1F* edist);
-  
-  TH1F* GetEnergyDistribution(Int_t det, Char_t ring, Float_t eta);
-  void  SetEmptyEnergyDistribution(Int_t det, Char_t ring, TH1F* edist);
-  TH1F* GetEmptyEnergyDistribution(Int_t det, Char_t ring);
-  void  SetRingEnergyDistribution(Int_t det, Char_t ring, TH1F* edist);
-  TH1F* GetRingEnergyDistribution(Int_t det, Char_t ring);
-  Bool_t IsFolder() const { return kTRUE; }
-  void Browse(TBrowser* b);
- protected:
-  void      Init();
-  TObjArray fArray;       // Overall array
-  TObjArray fEmptyArray;  // Array of empty events energy dep
-  TObjArray fRingArray;   // Array of rings
-  Bool_t    fIsInit;      // Are we init?
-  Int_t     fNetaBins;    // Number of eta bins (intervals)
-  Float_t   fEtaMax;      // Max Eta
-  Float_t   fEtaMin;      // Min Eta
-  
-  ClassDef(AliFMDAnaCalibEnergyDistribution,3);
-};
-
-#endif
-// Local Variables:
-//   mode: C++
-// End:
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnaCalibEventSelectionEfficiency.cxx b/PWGLF/FORWARD/analysis/AliFMDAnaCalibEventSelectionEfficiency.cxx
deleted file mode 100644 (file)
index 2fe5964..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-
-#include "AliFMDAnaCalibEventSelectionEfficiency.h"
-
-#include <TH1F.h>
-#include <TBrowser.h>
-#include "AliLog.h"
-#include "iostream"
-
-ClassImp(AliFMDAnaCalibEventSelectionEfficiency)
-#if 0
-; // For Emacs
-#endif 
-
-//____________________________________________________________________
-AliFMDAnaCalibEventSelectionEfficiency::AliFMDAnaCalibEventSelectionEfficiency() : TObject(),
-                                                                                  fCorrection(),
-                                                                                  fCorrectionList(),
-                                                                                  fIsInit(kFALSE),
-                                                                                  fVtxEff(1)
-{
-  
-  
-  
-}
-
-
-//____________________________________________________________________
-AliFMDAnaCalibEventSelectionEfficiency::
-AliFMDAnaCalibEventSelectionEfficiency(const AliFMDAnaCalibEventSelectionEfficiency& o) : TObject(o),                       
-                                                                                         fCorrection(o.fCorrection),
-                                                                                         fCorrectionList(),
-                                                                                         fIsInit(o.fIsInit),
-                                                                                         fVtxEff(o.fVtxEff)
-{
-  // Copy ctor 
-}
-//____________________________________________________________________
-AliFMDAnaCalibEventSelectionEfficiency&
-AliFMDAnaCalibEventSelectionEfficiency::operator=(const AliFMDAnaCalibEventSelectionEfficiency& /*o*/) 
-{
-  // Assignment operator 
-  
-  return (*this);
-}
-//____________________________________________________________________
-void AliFMDAnaCalibEventSelectionEfficiency::Init() {
-
-  fCorrection.SetName("EventSelectionEffCorrection");
-  
-  fIsInit = kTRUE;
-
-}
-//____________________________________________________________________
-void AliFMDAnaCalibEventSelectionEfficiency::SetCorrection(TH1F* hCorrection) {
-  
-  fCorrection.SetBins(hCorrection->GetNbinsX(),
-                     hCorrection->GetXaxis()->GetXmin(),
-                     hCorrection->GetXaxis()->GetXmax());
-  for(Int_t i=1; i<=hCorrection->GetNbinsX(); i++) {
-    fCorrection.SetBinContent(i,hCorrection->GetBinContent(i));
-    fCorrection.SetBinError(i,hCorrection->GetBinError(i));
-  }
-  
-
-}
-//____________________________________________________________________
-void AliFMDAnaCalibEventSelectionEfficiency::SetCorrection(TString trig,
-                                                          Int_t vtxbin, 
-                                                          Char_t ring,
-                                                          TH2F* hCorrection) {
-  //TString test = trig;
-  if(!trig.Contains("INEL") && !trig.Contains("NSD"))
-    AliWarning("Please choose NSD or INEL!");
-  
-  if(trig.Contains("INEL"))
-    hCorrection->SetName(Form("correction_%c_%d",ring,vtxbin));
-  if(trig.Contains("NSD")) 
-    hCorrection->SetName(Form("correction%s_%c_%d","NSD",ring,vtxbin));
-  
-  fCorrectionList.Add(hCorrection);
-  
-}
-//____________________________________________________________________
-TH2F* AliFMDAnaCalibEventSelectionEfficiency::GetCorrection(TString name,
-                                                           Int_t vtxbin, 
-                                                           Char_t ring) {
-  
-  //TString name = trig;
-  
-  if(name.Contains("INEL"))
-    name.Form("correction_%c_%d",ring,vtxbin);
-  if(name.Contains("NSD")) 
-    name.Form("correction%s_%c_%d","NSD",ring,vtxbin);
-  
-  TH2F* hCorrection = (TH2F*)fCorrectionList.FindObject(name);
-   
-  return hCorrection;
-
-}
-
-//____________________________________________________________________
-Float_t AliFMDAnaCalibEventSelectionEfficiency::GetCorrection(Int_t vtxbin) {
-
-  if( (vtxbin-1) > fCorrection.GetNbinsX() || vtxbin < 0)
-    return 0;
-  
-  Float_t correction = fCorrection.GetBinContent(vtxbin+1);
-  
-  return correction;
-
-}
-
-//____________________________________________________________________
-void AliFMDAnaCalibEventSelectionEfficiency::Browse(TBrowser* /*b*/)
-{
-  
-}
-
-//____________________________________________________________________
-//
-// EOF
-//
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnaCalibEventSelectionEfficiency.h b/PWGLF/FORWARD/analysis/AliFMDAnaCalibEventSelectionEfficiency.h
deleted file mode 100644 (file)
index dcc2332..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef ALIFMDANACALIBEVENTSELECTIONEFFICIENCY_H
-#define ALIFMDANACALIBEVENTSELECTIONEFFICIENCY_H
-
-#include <TObject.h>
-#include <TObjArray.h>
-#include <TH1F.h>
-#include <TAxis.h>
-#include <TList.h>
-#include <TH2F.h>
-#include <TString.h>
-class TBrowser;
-
-class AliFMDAnaCalibEventSelectionEfficiency : public TObject
-{
-  
- public:
-  
-  AliFMDAnaCalibEventSelectionEfficiency();
-  AliFMDAnaCalibEventSelectionEfficiency(const AliFMDAnaCalibEventSelectionEfficiency& o);
-  AliFMDAnaCalibEventSelectionEfficiency& operator=(const AliFMDAnaCalibEventSelectionEfficiency& o);
-  
-  void    Init();
-  Bool_t  IsFolder() const { return kTRUE; }
-  void    Browse(TBrowser* b);
-  void    SetCorrection(TH1F* hCorrection);
-  Float_t GetCorrection(Int_t vtxbin);
-  void    SetCorrection(TString trig, Int_t vtxbin, Char_t ring, TH2F* hCorrection);
-  TH2F*   GetCorrection(TString trig, Int_t vtxbin, Char_t ring);
-  Float_t GetVtxToTriggerRatio() {return fVtxEff; }
-  void    SetVtxToTriggerRatio(Float_t vtxEff) {fVtxEff = vtxEff;}
- protected:
-  
-  TH1F fCorrection;
-  TList fCorrectionList;
-  Bool_t fIsInit;
-  Float_t fVtxEff;
-  ClassDef(AliFMDAnaCalibEventSelectionEfficiency,3);
-};
-
-#endif
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnaCalibSharingEfficiency.cxx b/PWGLF/FORWARD/analysis/AliFMDAnaCalibSharingEfficiency.cxx
deleted file mode 100644 (file)
index eadd175..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-
-#include "AliFMDAnaCalibSharingEfficiency.h"
-#include <TH2F.h>
-#include <TH1F.h>
-#include <TBrowser.h>
-
-ClassImp(AliFMDAnaCalibSharingEfficiency)
-#if 0
-; // For Emacs
-#endif 
-
-//____________________________________________________________________
-AliFMDAnaCalibSharingEfficiency::AliFMDAnaCalibSharingEfficiency() : TObject(),
-                                                                    fArray(),
-                                                                    fArrayTrVtx(),
-                                                                    fIsInit(kFALSE)
-{
-  
-  
-  
-}
-
-
-//____________________________________________________________________
-AliFMDAnaCalibSharingEfficiency::AliFMDAnaCalibSharingEfficiency(const AliFMDAnaCalibSharingEfficiency& o)
-  : TObject(o), fArray(o.fArray), fArrayTrVtx(o.fArrayTrVtx), fIsInit(o.fIsInit)
-{
-  // Copy ctor 
-}
-//____________________________________________________________________
-AliFMDAnaCalibSharingEfficiency&
-AliFMDAnaCalibSharingEfficiency::operator=(const AliFMDAnaCalibSharingEfficiency& o) 
-{
-  // Assignment operator 
-  
-  fArray       = o.fArray;
-  fArrayTrVtx  = o.fArrayTrVtx;
-  
-  return (*this);
-}
-//____________________________________________________________________
-void AliFMDAnaCalibSharingEfficiency::Init() {
-  
-  fArray.SetOwner();
-  for(Int_t det = 1; det<=3;det++) {
-    TObjArray* detArray = new TObjArray();
-    detArray->SetOwner();
-    fArray.AddAtAndExpand(detArray,det);
-    Int_t nRings = (det == 1 ? 1 : 2);
-    for(Int_t ring = 0;ring<nRings;ring++) {
-      TObjArray* ringArray = new TObjArray();
-      ringArray->SetOwner();
-      detArray->AddAtAndExpand(ringArray,ring);
-      
-    }
-  }
-  fArrayTrVtx.SetOwner();
-  for(Int_t det = 1; det<=3;det++) {
-    TObjArray* detArrayTrVtx = new TObjArray();
-    detArrayTrVtx->SetOwner();
-    fArrayTrVtx.AddAtAndExpand(detArrayTrVtx,det);
-    Int_t nRings = (det == 1 ? 1 : 2);
-    for(Int_t ring = 0;ring<nRings;ring++) {
-      TObjArray* ringArrayTrVtx = new TObjArray();
-      ringArrayTrVtx->SetOwner();
-      detArrayTrVtx->AddAtAndExpand(ringArrayTrVtx,ring);
-      
-    }
-  }
-  fIsInit = kTRUE;
-}
-//____________________________________________________________________
-TObjArray* AliFMDAnaCalibSharingEfficiency::GetRingArrayTrVtx(Int_t det, 
-                                                             Char_t ring) {
-  
-  Int_t ringNumber      = (ring == 'I' ? 0 : 1);
-  TObjArray* detArray  = (TObjArray*)fArrayTrVtx.At(det);
-  TObjArray* ringArray = (TObjArray*)detArray->At(ringNumber);
-  
-  return ringArray;
-}
-//____________________________________________________________________
-void AliFMDAnaCalibSharingEfficiency::SetSharingEffTrVtx(Int_t det, 
-                                                        Char_t ring, 
-                                                        Int_t vtxbin, 
-                                                        TH1F* hCorrection) {
-  if(!fIsInit)
-    Init();
-  
-  TObjArray* ringArray = GetRingArrayTrVtx(det,ring);
-  ringArray->AddAtAndExpand(hCorrection,vtxbin);
-  
-}
-//____________________________________________________________________
-TH1F* AliFMDAnaCalibSharingEfficiency::GetSharingEffTrVtx(Int_t det, 
-                                                         Char_t ring, 
-                                                         Int_t vtxbin) {
-  TObjArray* ringArray = GetRingArrayTrVtx(det,ring);
-  TH1F* hCorrection    = (TH1F*)ringArray->At(vtxbin);
-  return hCorrection;
-}
-
-//____________________________________________________________________
-TObjArray* AliFMDAnaCalibSharingEfficiency::GetRingArray(Int_t det, 
-                                                        Char_t ring) {
-  
-  Int_t ringNumber      = (ring == 'I' ? 0 : 1);
-  TObjArray* detArray  = (TObjArray*)fArray.At(det);
-  TObjArray* ringArray = (TObjArray*)detArray->At(ringNumber);
-  
-  return ringArray;
-}
-//____________________________________________________________________
-void AliFMDAnaCalibSharingEfficiency::SetSharingEff(Int_t det, 
-                                                   Char_t ring, 
-                                                   Int_t vtxbin, 
-                                                   TH1F* hCorrection) {
-  if(!fIsInit)
-    Init();
-  
-  TObjArray* ringArray = GetRingArray(det,ring);
-  ringArray->AddAtAndExpand(hCorrection,vtxbin);
-  
-}
-//____________________________________________________________________
-TH1F* AliFMDAnaCalibSharingEfficiency::GetSharingEff(Int_t det, 
-                                                    Char_t ring, 
-                                                    Int_t vtxbin) {
-  TObjArray* ringArray = GetRingArray(det,ring);
-  TH1F* hCorrection    = (TH1F*)ringArray->At(vtxbin);
-  return hCorrection;
-}
-
-//____________________________________________________________________
-void
-AliFMDAnaCalibSharingEfficiency::Browse(TBrowser* b)
-{
-  b->Add(&fArray, "Array of histograms w/sharing eff corrections");
-}
-
-//____________________________________________________________________
-//
-// EOF
-//
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnaCalibSharingEfficiency.h b/PWGLF/FORWARD/analysis/AliFMDAnaCalibSharingEfficiency.h
deleted file mode 100644 (file)
index d731caf..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef ALIFMDANACALIBSHARINGEFFICIENCY_H
-#define ALIFMDANACALIBSHARINGEFFICIENCY_H
-
-#include <TObject.h>
-#include <TAxis.h>
-#include <TObjArray.h>
-class TH2F;
-class TH1F;
-class TBrowser;
-
-/**
- * @ingroup FMD_ana
- * @brief Do the background correction
- * 
- */
-class AliFMDAnaCalibSharingEfficiency : public TObject
-{
-  
- public:
-  
-  AliFMDAnaCalibSharingEfficiency();
-  AliFMDAnaCalibSharingEfficiency(const AliFMDAnaCalibSharingEfficiency& o);
-  AliFMDAnaCalibSharingEfficiency& operator=(const AliFMDAnaCalibSharingEfficiency& o);
-
-  void    SetSharingEff(Int_t det, Char_t ring, Int_t vtxbin, TH1F* hCorrection);
-  TH1F*   GetSharingEff(Int_t det, Char_t ring, Int_t vtxbin);
-  void    SetSharingEffTrVtx(Int_t det, Char_t ring, Int_t vtxbin, TH1F* hCorrection);
-  TH1F*   GetSharingEffTrVtx(Int_t det, Char_t ring, Int_t vtxbin);
-  void    Init();
-  Bool_t  IsFolder() const { return kTRUE; }
-  void    Browse(TBrowser* b);
- protected:
-
-  TObjArray* GetRingArray(Int_t det, Char_t ring);
-  TObjArray* GetRingArrayTrVtx(Int_t det, Char_t ring);
-  
-  TObjArray  fArray;
-  TObjArray  fArrayTrVtx;
-  Bool_t     fIsInit;
-
-  ClassDef(AliFMDAnaCalibSharingEfficiency,1);
-};
-
-#endif
-// Local Variables:
-//   mode: C++
-// End:
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnaParameters.cxx b/PWGLF/FORWARD/analysis/AliFMDAnaParameters.cxx
deleted file mode 100644 (file)
index f9e671a..0000000
+++ /dev/null
@@ -1,1137 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-//
-//The design of this class is based on the AliFMDParameters class. Its purpose
-//is to hold parameters for the analysis such as background correction and 
-//fit functions.
-//
-//Author: Hans Hjersing Dalsgaard, NBI, hans.dalsgaard@cern.ch
-//
-
-// #include "AliFMDDebug.h"               // ALILOG_H
-#include "AliFMDAnaParameters.h"          // ALIFMDPARAMETERS_H
-//#include <AliCDBManager.h>         // ALICDBMANAGER_H
-//#include <AliCDBEntry.h>           // ALICDBMANAGER_H
-//#include "AliFMDRing.h"
-#include <AliLog.h>
-#include <Riostream.h>
-#include <sstream>
-#include <TSystem.h>
-#include <TH2D.h>
-#include <TF1.h>
-#include <TMath.h>
-#include "AliTriggerAnalysis.h"
-#include "AliPhysicsSelection.h"
-#include "AliBackgroundSelection.h"
-#include "AliMultiplicity.h"
-#include "AliESDEvent.h"
-#include "AliESDVertex.h"
-#include "AliFMDAnaCalibBackgroundCorrection.h"
-#include "AliFMDAnaCalibEnergyDistribution.h"
-#include "AliFMDAnaCalibEventSelectionEfficiency.h"
-#include "AliFMDAnaCalibSharingEfficiency.h"
-#include "TFile.h"
-
-//====================================================================
-ClassImp(AliFMDAnaParameters)
-#if 0
-  ; // This is here to keep Emacs for indenting the next line
-#endif
-
-//const char* AliFMDAnaParameters::fgkBackgroundCorrection  = "FMD/Correction/Background";
-//const char* AliFMDAnaParameters::fgkEnergyDists = "FMD/Correction/EnergyDistribution";
-const char* AliFMDAnaParameters::fgkBackgroundID         = "background";
-const char* AliFMDAnaParameters::fgkEnergyDistributionID = "energydistributions";
-const char* AliFMDAnaParameters::fgkEventSelectionEffID  = "eventselectionefficiency";
-const char* AliFMDAnaParameters::fgkSharingEffID         = "sharingefficiency";
-//____________________________________________________________________
-AliFMDAnaParameters* AliFMDAnaParameters::fgInstance = 0;
-
-//____________________________________________________________________
-
-AliFMDAnaParameters* 
-AliFMDAnaParameters::Instance() 
-{
-  // Get static instance 
-  if (!fgInstance) fgInstance = new AliFMDAnaParameters;
-  return fgInstance;
-}
-
-//____________________________________________________________________
-AliFMDAnaParameters::AliFMDAnaParameters() :
-  fIsInit(kFALSE),
-  fBackground(0),
-  fEnergyDistribution(0),
-  fEventSelectionEfficiency(0),
-  fSharingEfficiency(0),
-  fCorner1(4.2231, 26.6638),
-  fCorner2(1.8357, 27.9500),
-  fEnergyPath("$ALICE_ROOT/PWGLF/FORWARD/corrections/EnergyDistribution"),
-  fBackgroundPath("$ALICE_ROOT/PWGLF/FORWARD/corrections/Background"),
-  fEventSelectionEffPath("$ALICE_ROOT/PWGLF/FORWARD/corrections/EventSelectionEfficiency"),
-  fSharingEffPath("$ALICE_ROOT/PWGLF/FORWARD/corrections/SharingEfficiency"),
-  fProcessPrimary(kFALSE),
-  fProcessHits(kFALSE),
-  fTrigger(kMB1),
-  fEnergy(k900),
-  fMagField(k5G),
-  fSpecies(kPP),
-  fPhysicsSelection(0),
-  fRealData(kFALSE),
-  fSPDlowLimit(0),
-  fSPDhighLimit(999999999),
-  fCentralSelection(kFALSE),
-  fSharingObjectPresent(kTRUE),
-  fNumberOfEtaBinsToCut(1),
-  fEtaLowBinLimits(),
-  fEtaHighBinLimits(),
-  fTriggerInel(kFALSE),
-  fTriggerNSD(kFALSE),
-  fTriggerEmpty(kFALSE),
-  fUseBuiltInNSD(kFALSE),
-  fInelGtZero(kFALSE),
-  fRunDndeta(kTRUE),
-  fRunBFCorrelation(kTRUE),
-  fRunMultiplicity(kTRUE)
-{
-  // Default constructor 
-  //  fPhysicsSelection = new AliPhysicsSelection;
-  //  fPhysicsSelection->SetAnalyzeMC(kTRUE); //For the background correction. This is reset in Init if relevant
-  // fPhysicsSelection->SetUseBXNumbers(kFALSE);
-  
-  
-  //  AliBackgroundSelection* backgroundSelection = new AliBackgroundSelection("bg","bg");
-  //  backgroundSelection->Init();
-  //  fPhysicsSelection->AddBackgroundIdentification(backgroundSelection);
-  //fPhysicsSelection->Initialize(104792);
-  // Do not use this - it is only for IO 
-  fgInstance = this;
-  
-}
-//____________________________________________________________________
-const char* AliFMDAnaParameters::GetPath(const char* species) const
-{
-  //Get path of object
-  static TString*  path = new TString();
-  if(species == fgkBackgroundID)
-    path->Form("%s/%s_%d_%d_%d_%d_%d_%d.root",
-             fBackgroundPath.Data(),
-             fgkBackgroundID,
-             fEnergy,
-             fTrigger,
-             fMagField,
-             fSpecies,
-             fInelGtZero,
-             0);
-  if(species == fgkEnergyDistributionID)
-    path->Form("%s/%s_%d_%d_%d_%d_%d_%d.root",
-             fEnergyPath.Data(),
-             fgkEnergyDistributionID,
-             fEnergy,
-             fTrigger,
-             fMagField,
-             fSpecies,
-             fRealData,
-             0);
-  if(species == fgkEventSelectionEffID)
-    path->Form("%s/%s_%d_%d_%d_%d_%d_%d.root",
-             fEventSelectionEffPath.Data(),
-             fgkEventSelectionEffID,
-             fEnergy,
-             fTrigger,
-             fMagField,
-             fSpecies,
-             fInelGtZero,
-             0);
-  if(species == fgkSharingEffID)
-    path->Form("%s/%s_%d_%d_%d_%d_%d_%d.root",
-             fSharingEffPath.Data(),
-             fgkSharingEffID,
-             fEnergy,
-             fTrigger,
-             fMagField,
-             fSpecies,
-             0,
-             0);
-  return path->Data();
-}
-//____________________________________________________________________
-void AliFMDAnaParameters::Init(Bool_t forceReInit, UInt_t what)
-{
-  // Initialize the parameters manager.  We need to get stuff from files here.
-  
-  /*  AliPhysicsSelection* test = (AliPhysicsSelection*)((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->GetEventSelection();
-  
-    if(fPhysicsSelection) {
-    if(!fRealData) {
-      fPhysicsSelection->SetAnalyzeMC(kTRUE);
-    }
-    else fPhysicsSelection->SetAnalyzeMC(kFALSE);
-  }
-  */
-  if (forceReInit) fIsInit = kFALSE;
-  if (fIsInit) return;
-  if (what & kBackgroundCorrection)       InitBackground();
-  if (what & kEnergyDistributions)        InitEnergyDists();
-  if (what & kEventSelectionEfficiency)   InitEventSelectionEff();
-  if (what & kSharingEfficiency)          InitSharingEff();
-  
-  fIsInit = kTRUE;
-  
-  if(fBackground)
-    FindEtaLimits();
-  
-    
-}
-//____________________________________________________________________
-
-void AliFMDAnaParameters::InitBackground() {
-  //Init background correction objects.
-  
-  TFile* fin = TFile::Open(GetPath(fgkBackgroundID));
-  
-  if (!fin) return;
-  
-  fBackground = dynamic_cast<AliFMDAnaCalibBackgroundCorrection*>(fin->Get(fgkBackgroundID));
-  if (!fBackground) AliFatal("Invalid background object from CDB");
-  
-  
-
-}
-
-//____________________________________________________________________
-
-void AliFMDAnaParameters::InitEnergyDists() {
-  //Init energy distributions
-    
-  TFile* fin = TFile::Open(GetPath(fgkEnergyDistributionID));
-  
-  if (!fin) return;
-  
-  fEnergyDistribution = dynamic_cast<AliFMDAnaCalibEnergyDistribution*>(fin->Get(fgkEnergyDistributionID));
-  
-  if (!fEnergyDistribution) AliFatal("Invalid background object from CDB");
-  
-}
-
-//____________________________________________________________________
-
-void AliFMDAnaParameters::InitEventSelectionEff() {
-  //Init event selection objects
-
-  TFile* fin = TFile::Open(GetPath(fgkEventSelectionEffID));
-                           
-  if (!fin) return;
-  
-  fEventSelectionEfficiency = dynamic_cast<AliFMDAnaCalibEventSelectionEfficiency*>(fin->Get(fgkEventSelectionEffID));
-  if (!fEventSelectionEfficiency) AliFatal("Invalid background object from CDB");
-  
-}
-
-//____________________________________________________________________
-
-void AliFMDAnaParameters::InitSharingEff() {
-  //Initialize the sharing efficiency
-  fSharingObjectPresent = kTRUE;
-  TFile* fin = TFile::Open(GetPath(fgkSharingEffID));
-                           
-  if (!fin) {
-    fSharingObjectPresent = kFALSE;
-    return; 
-  }
-  
-  fSharingEfficiency = dynamic_cast<AliFMDAnaCalibSharingEfficiency*>(fin->Get(fgkSharingEffID));
-  if (!fSharingEfficiency) {
-    fSharingObjectPresent = kFALSE;
-    return; 
-  }
-  
-}
-//____________________________________________________________________
-void AliFMDAnaParameters::FindEtaLimits() {
-  //Find eta limits for analysis
-  fEtaLowBinLimits.SetBins(4,0,4,2,0,2,GetNvtxBins(),0,GetNvtxBins());
-  fEtaHighBinLimits.SetBins(4,0,4,2,0,2,GetNvtxBins(),0,GetNvtxBins());
-  for(Int_t det=0; det<=3;det++) {
-    Int_t nRings = (det<=1 ? 1 : 2);
-    for (UShort_t ir = 0; ir < nRings; ir++) {
-      Char_t ringChar = (ir == 0 ? 'I' : 'O');
-      for(Int_t v =0; v<GetNvtxBins(); v++) {
-       fEtaLowBinLimits.SetBinContent(det,ir,v,GetFirstEtaBinFromMap(v, det, ringChar));
-       fEtaHighBinLimits.SetBinContent(det,ir,v,GetLastEtaBinFromMap(v, det, ringChar));
-       //std::cout<<det<<"   "<<ringChar<<"   "<<fEtaLowBinLimits.GetBinContent(det,ir,v)<<"   "<<fEtaHighBinLimits.GetBinContent(det,ir,v)<<std::endl;
-      }
-    }
-  }
-
-}
-//____________________________________________________________________
-void AliFMDAnaParameters::SetEnergy(Float_t cmsNNGeV) 
-{
-  //Set energy
-  if (TMath::Abs(cmsNNGeV - 900.)   < 10)  fEnergy = k900;
-  if (TMath::Abs(cmsNNGeV - 2400.)  < 10)  fEnergy = k2400;
-  if (TMath::Abs(cmsNNGeV - 2750.)  < 10)  fEnergy = k2750;
-  if (TMath::Abs(cmsNNGeV - 5500.)  < 40)  fEnergy = k5500;
-  if (TMath::Abs(cmsNNGeV - 7000.)  < 10)  fEnergy = k7000;
-  if (TMath::Abs(cmsNNGeV - 10000.) < 10)  fEnergy = k10000;
-  if (TMath::Abs(cmsNNGeV - 14000.) < 10)  fEnergy = k14000;
-}
-//____________________________________________________________________
-void AliFMDAnaParameters::SetMagField(Float_t bkG) 
-{
-  //Set magnetic field
-  if (TMath::Abs(bkG - 5.) < 1 ) fMagField = k5G;
-  if (TMath::Abs(bkG + 5.) < 1 ) fMagField = k5Gnegative;
-  if (TMath::Abs(bkG) < 1)       fMagField = k0G;
-}
-//____________________________________________________________________
-void AliFMDAnaParameters::SetCollisionSystem(const TString& sys) 
-{
-  //Set the collision system
-  TString s(sys);
-  s.ToLower();
-  if      (s.Contains("p-p")   || s.Contains("pp"))   fSpecies = kPP; 
-  else if (s.Contains("pb-pb") || s.Contains("pbpb")) fSpecies = kPbPb;
-  else if (s.Contains("a-a")   || s.Contains("aa"))   fSpecies = kPbPb;
-}
-  
-//____________________________________________________________________
-void AliFMDAnaParameters::SetParametersFromESD(AliESDEvent* esd) 
-{
-  //Set the parameters from the ESD header information
-
-  SetCollisionSystem(esd->GetBeamType());
-
-  Float_t energy   = esd->GetBeamEnergy();
-  // Correct to center of mass per nucleon (cmsNN) - LHC gives it as 
-  // cmsNN * Z / 2 
-  if (fSpecies == kPbPb) energy = energy / 208 * 82;
-  SetEnergy(2*energy); 
-  SetMagField(esd->GetMagneticField());
-
-  // Float_t magfield = esd->GetCurrentL3(); 
-  // if (TMath::Abs(magfield - 30000.) < 10 ) fMagField = k5G;
-  // if (TMath::Abs(magfield + 30000.) < 10 ) fMagField = k5Gnegative;
-  // if (TMath::Abs(magfield) < 10 )          fMagField = k0G;
-  
-  
-  
-  Init(kTRUE);
-  
-}
-
-//____________________________________________________________________
-
-void AliFMDAnaParameters::PrintStatus(Bool_t showpaths) const
-{
-  //Print current status
-  TString energystring;
-  switch(fEnergy) {
-  case k900:
-    energystring.Form("900 GeV");   break;
-  case k2400:
-    energystring.Form("2400 GeV"); break;
-  case k2750:
-    energystring.Form("2750 GeV"); break;
-  case k5500:
-    energystring.Form("5500 GeV"); break;
-  case k7000:
-    energystring.Form("7000 GeV");  break;
-  case k10000:
-    energystring.Form("10000 GeV"); break;
-  case k14000:
-    energystring.Form("14000 GeV"); break;
-  default:
-    energystring.Form("invalid energy"); break;
-  }
-  TString triggerstring;
-  switch(fTrigger) {
-  case kMB1:
-    triggerstring.Form("Minimum bias 1");   break;
-  case kMB2:
-    triggerstring.Form("Minimum bias 2");   break;
-  case kSPDFASTOR:
-    triggerstring.Form("SPD FAST OR");   break;
-  case kNOCTP:
-    triggerstring.Form("NO TRIGGER TEST");   break;
-  default:
-    energystring.Form("invalid trigger"); break;
-  }
-  TString magstring;
-  switch(fMagField) {
-  case k5G:
-    magstring.Form("+5 kGaus");   break;
-  case k0G:
-    magstring.Form("0 kGaus");   break;
-  case k5Gnegative:
-    magstring.Form("-5 kGaus");   break;
-  default:
-    magstring.Form("invalid mag field %d", fMagField); break;
-  }
-  TString collsystemstring;
-  switch(fSpecies) {
-  case kPP:
-    collsystemstring.Form("p-p");   break;
-  case kPbPb:
-    collsystemstring.Form("Pb-Pb");   break;
-  default:
-    collsystemstring.Form("invalid collision system");   break;
-  }
-  
-  TString datastring;
-  
-  if(fRealData) 
-    datastring.Form("Nature");
-  else 
-    datastring.Form("MC"); 
-  
-  TString inelString;
-  if(fInelGtZero) inelString = "INEL > 0";
-  else inelString = "INEL";
-  
-  std::cout<<"Energy       = "<<energystring.Data()<<std::endl;
-  std::cout<<"Trigger      = "<<triggerstring.Data()<<std::endl;
-  std::cout<<"Mag Field    = "<<magstring.Data()<<std::endl;
-  std::cout<<"Coll System  = "<<collsystemstring.Data()<<std::endl;
-  std::cout<<"Data origin  = "<<datastring.Data()<<std::endl;
-  std::cout<<"Basic trigger: "<<inelString.Data()<<std::endl;
-
-  if (showpaths) {
-    TString bg = GetPath(fgkBackgroundID);
-    TString es = GetPath(fgkEventSelectionEffID);
-    TString ed = GetPath(fgkEnergyDistributionID);
-    TString me = GetPath(fgkSharingEffID);
-    std::cout << "2nd maps:     " << bg << "\n"
-             << "Event sel.:   " << es << "\n"
-             << "Energy dist.: " << ed << "\n"
-             << "Merge eff.:   " << me << std::endl;
-  }
-  
-}
-
-//____________________________________________________________________
-Float_t AliFMDAnaParameters::GetVtxCutZ() {
-  //Get the z vtx cut in analysis
-  if(!fIsInit) {
-    AliWarning("Not initialized yet. Call Init() to remedy");
-    return -1;
-  }
-  
-  return fBackground->GetVtxCutZ();
-}
-
-//____________________________________________________________________
-Int_t AliFMDAnaParameters::GetNvtxBins() {
-  //Get number of vtx bins
-  if(!fIsInit) {
-    AliWarning("Not initialized yet. Call Init() to remedy");
-    return -1;
-  }
-  
-  return fBackground->GetNvtxBins();
-}
-//____________________________________________________________________
-TH1F* AliFMDAnaParameters::GetEnergyDistribution(Int_t det, Char_t ring, Float_t eta) {
-  
-  return fEnergyDistribution->GetEnergyDistribution(det, ring, eta);
-}
-//____________________________________________________________________
-TH1F* AliFMDAnaParameters::GetEmptyEnergyDistribution(Int_t det, Char_t ring) {
-  
-  return fEnergyDistribution->GetEmptyEnergyDistribution(det, ring);
-}
-//____________________________________________________________________
-TH1F* AliFMDAnaParameters::GetRingEnergyDistribution(Int_t det, Char_t ring) {
-  
-  return fEnergyDistribution->GetRingEnergyDistribution(det, ring);
-}
-//____________________________________________________________________
-Float_t AliFMDAnaParameters::GetSigma(Int_t det, Char_t ring, Float_t eta) {
-  //Get sigma of Landau fits
-  if(!fIsInit) {
-    AliWarning("Not initialized yet. Call Init() to remedy");
-    return 0;
-  }
-  
-  TH1F* hEnergyDist       = GetEnergyDistribution(det,ring, eta);
-  TF1*  fitFunc           = hEnergyDist->GetFunction("FMDfitFunc");
-  if(!fitFunc) {
-    //AliWarning(Form("No function for FMD%d%c, eta %f",det,ring,eta));
-    return 1024;
-  }
-  Float_t sigma           = fitFunc->GetParameter(2);
-  return sigma;
-}
-
-
-//____________________________________________________________________
-Float_t AliFMDAnaParameters::GetMPV(Int_t det, Char_t ring, Float_t eta) {
-  //Get MPV of landau fits
-  if(!fIsInit) {
-    AliWarning("Not initialized yet. Call Init() to remedy");
-    return 0;
-  }
-  //AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  TH1F* hEnergyDist     = GetEnergyDistribution(det,ring,eta);
-  TF1*  fitFunc         = hEnergyDist->GetFunction("FMDfitFunc");
-  
-  if(!fitFunc) {
-    AliWarning(Form("No function for FMD%d%c, eta %f (%d)",det,ring,eta,
-                   GetEtaBin(eta)));
-    return 1024;
-  }
-  
-  Float_t mpv           = fitFunc->GetParameter(1);
-  return mpv;
-}
-//____________________________________________________________________
-Float_t AliFMDAnaParameters::GetConstant(Int_t det, Char_t ring, Float_t eta) {
-  //Get constant parameter of Landau fits
-  if(!fIsInit) {
-    AliWarning("Not initialized yet. Call Init() to remedy");
-    return 0;
-  }
-  
-  TH1F* hEnergyDist     = GetEnergyDistribution(det,ring,eta);
-  TF1*  fitFunc         = hEnergyDist->GetFunction("FMDfitFunc");
-  if(!fitFunc) {
-    AliWarning(Form("No function for FMD%d%c, eta %f",det,ring,eta));
-    return 0;
-  }
-    
-  Float_t mpv           = fitFunc->GetParameter(0);
-  return mpv;
-}
-//____________________________________________________________________
-Float_t 
-AliFMDAnaParameters::Get2MIPWeight(Int_t det, Char_t ring, Float_t eta) 
-{
-  //Get 2 MIP weights of convoluted Landau fits
-  if(!fIsInit) {
-    AliWarning("Not initialized yet. Call Init() to remedy");
-    return 0;
-  }
-  
-  TH1F* hEnergyDist     = GetEnergyDistribution(det,ring,eta);
-  TF1*  fitFunc         = hEnergyDist->GetFunction("FMDfitFunc");
-  if(!fitFunc) return 0;
-  Float_t twoMIPweight    = fitFunc->GetParameter(3);
-  
-  
-  
-  if(twoMIPweight < 1e-05)
-    twoMIPweight = 0;
-  
-  return twoMIPweight;
-}
-//____________________________________________________________________
-Float_t 
-AliFMDAnaParameters::Get3MIPWeight(Int_t det, Char_t ring, Float_t eta) 
-{
-  //Get 3 MIP weights of convoluted Landau fits
-  if(!fIsInit) {
-    AliWarning("Not initialized yet. Call Init() to remedy");
-    return 0;
-  }
-  
-  TH1F* hEnergyDist     = GetEnergyDistribution(det,ring,eta);
-  TF1*  fitFunc         = hEnergyDist->GetFunction("FMDfitFunc");
-  if(!fitFunc) return 0;
-  Float_t threeMIPweight    = fitFunc->GetParameter(4);
-  
-  if(threeMIPweight < 1e-05)
-    threeMIPweight = 0;
-  
-  Float_t twoMIPweight    = fitFunc->GetParameter(3);
-  
-  if(twoMIPweight < 1e-05)
-    threeMIPweight = 0;
-    
-  return threeMIPweight;
-}
-//____________________________________________________________________
-Int_t AliFMDAnaParameters::GetNetaBins() 
-{
-  return GetBackgroundCorrection(1,'I',5)->GetNbinsX();  
-}
-//____________________________________________________________________
-Float_t AliFMDAnaParameters::GetEtaMin() 
-{
-  return GetBackgroundCorrection(1,'I',5)->GetXaxis()->GetXmin();
-} 
-//____________________________________________________________________
-Float_t AliFMDAnaParameters::GetEtaMax() 
-{
-  return GetBackgroundCorrection(1,'I',5)->GetXaxis()->GetXmax();
-}
-//____________________________________________________________________
-Int_t AliFMDAnaParameters::GetEtaBin(Float_t eta) 
-{  
-  TAxis testaxis(GetNetaBins(),GetEtaMin(),GetEtaMax());
-  Int_t binnumber = testaxis.FindBin(eta) ;
-  
-  return binnumber;
-}
-//____________________________________________________________________
-
-TH2F* AliFMDAnaParameters::GetBackgroundCorrection(Int_t det, 
-                                                  Char_t ring, 
-                                                  Int_t vtxbin) {
-  //Get background correction histogram
-  if(!fIsInit) {
-    AliWarning("Not initialized yet. Call Init() to remedy");
-    return 0;
-  }
-  
-  
-  
-  if(vtxbin > fBackground->GetNvtxBins()) {
-    AliWarning(Form("No background object for vertex bin %d", vtxbin));
-    return 0;
-  } 
-  
-  return fBackground->GetBgCorrection(det,ring,vtxbin);
-}
-//____________________________________________________________________
-TH2F* AliFMDAnaParameters::GetBackgroundCorrectionNSD(Int_t det, 
-                                                     Char_t ring, 
-                                                     Int_t vtxbin) {
-  //Get background correction histogram for NSD event class
-  if(!fIsInit) {
-    AliWarning("Not initialized yet. Call Init() to remedy");
-    return 0;
-  }
-  
-  if(vtxbin > fBackground->GetNvtxBins()) {
-    AliWarning(Form("No background object for vertex bin %d", vtxbin));
-    return 0;
-  } 
-  
-  if(fBackground->GetNSDBgCorrection(det,ring,vtxbin))
-    return fBackground->GetNSDBgCorrection(det,ring,vtxbin);
-  else 
-    AliWarning("No NSD background map. You get usual one. "
-              "Difference is probably negligible");
-  
-  return fBackground->GetBgCorrection(det,ring,vtxbin); 
-}
-//____________________________________________________________________
-
-TH1F* AliFMDAnaParameters::GetDoubleHitCorrection(Int_t det, 
-                                                 Char_t ring) {
-  //Get correction for several hits in strips for p+p
-  if(!fIsInit) {
-    AliWarning("Not initialized yet. Call Init() to remedy");
-    return 0;
-  }
-  
-  return fBackground->GetDoubleHitCorrection(det,ring);
-}
-//_____________________________________________________________________
-TH1F* AliFMDAnaParameters::GetSPDDeadCorrection(Int_t vtxbin) {
-                                               
-  //Get correction for several hits in strips for p+p
-  if(!fIsInit) {
-    AliWarning("Not initialized yet. Call Init() to remedy");
-    return 0;
-  }
-  
-  return fBackground->GetSPDDeadCorrection(vtxbin);
-}
-//_____________________________________________________________________
-TH1F* AliFMDAnaParameters::GetFMDDeadCorrection(Int_t vtxbin) {
-                                               
-  //Get correction for several hits in strips for p+p
-  if(!fIsInit) {
-    AliWarning("Not initialized yet. Call Init() to remedy");
-    return 0;
-  }
-  
-  return fBackground->GetFMDDeadCorrection(vtxbin);
-}
-//_____________________________________________________________________
-Float_t AliFMDAnaParameters::GetEventSelectionEfficiency(Int_t vtxbin) {
-  //Get event selection efficiency object
-  if(!fIsInit) {
-    AliWarning("Not initialized yet. Call Init() to remedy");
-    return 0;
-  }
-  return fEventSelectionEfficiency->GetCorrection(vtxbin);
-
-}
-//_____________________________________________________________________
-Float_t AliFMDAnaParameters::GetVtxSelectionEffFromMC() {
-  //Get the vtx selection from MC calculation
-   if(!fIsInit) {
-    AliWarning("Not initialized yet. Call Init() to remedy");
-    return 0;
-   }
-   return fEventSelectionEfficiency->GetVtxToTriggerRatio();
-
-
-}
-//_____________________________________________________________________
-TH2F* AliFMDAnaParameters::GetEventSelectionEfficiency(TString trig, Int_t vtxbin, Char_t ring) {
-  //Get event selection efficiency object
-  
-  //TString test = trig;
-  if(!trig.Contains("NSD") && !trig.Contains("INEL")) {
-    AliWarning("Event selection efficiency only available for INEL and NSD");
-    return 0;
-  }
-  if(!fIsInit) {
-    AliWarning("Not initialized yet. Call Init() to remedy");
-    return 0;
-  }
-  return fEventSelectionEfficiency->GetCorrection(trig,vtxbin,ring);
-
-}
-//_____________________________________________________________________
-TH1F* AliFMDAnaParameters::GetSharingEfficiency(Int_t det, Char_t ring, Int_t vtxbin) {
-  //Get sharing efficiency object
-  if(!fIsInit) {
-    AliWarning("Not initialized yet. Call Init() to remedy");
-    return 0;
-  }
-  
-  return fSharingEfficiency->GetSharingEff(det,ring,vtxbin);
-
-}
-//_____________________________________________________________________
-TH1F* AliFMDAnaParameters::GetSharingEfficiencyTrVtx(Int_t det, Char_t ring, Int_t vtxbin) {
-  //Get sharing efficiency object TrVtx
-  if(!fIsInit) {
-    AliWarning("Not initialized yet. Call Init() to remedy");
-    return 0;
-  }
-  
-  return fSharingEfficiency->GetSharingEffTrVtx(det,ring,vtxbin);
-
-}
-//_____________________________________________________________________
-Float_t AliFMDAnaParameters::GetMaxR(Char_t ring) const {
-  //Get max R of ring
-  Float_t radius = 0;
-  if(ring == 'I')
-    radius = 17.2;
-  else if(ring == 'O')
-    radius = 28.0;
-  else
-    AliWarning("Unknown ring - must be I or O!");
-  
-  return radius;
-}
-//_____________________________________________________________________
-Float_t AliFMDAnaParameters::GetMinR(Char_t ring) const{
-  //Get min R of ring
-  Float_t radius = 0;
-  if(ring == 'I')
-    radius = 4.5213;
-  else if(ring == 'O')
-    radius = 15.4;
-  else
-    AliWarning("Unknown ring - must be I or O!");
-  
-  return radius;
-
-}
-//_____________________________________________________________________
-void AliFMDAnaParameters::SetCorners(Char_t ring) {
-  //Set corners (taken from nominal geometry)
-  if(ring == 'I') {
-    fCorner1.Set(4.9895, 15.3560);
-    fCorner2.Set(1.8007, 17.2000);
-  }
-  else {
-    fCorner1.Set(4.2231, 26.6638);
-    fCorner2.Set(1.8357, 27.9500);
-  }
-  
-}
-//_____________________________________________________________________
-Float_t AliFMDAnaParameters::GetPhiFromSector(UShort_t det, Char_t ring, UShort_t sec) const
-{
-  //Get phi from sector
-  Int_t nsec = (ring == 'I' ? 20 : 40);
-  Float_t basephi = 0;
-  if(det == 1) 
-    basephi = 1.72787594; 
-  if(det == 2 && ring == 'I')
-    basephi = 0.15707963;
-  if(det == 2 && ring == 'O')
-    basephi = 0.078539818;
-  if(det == 3 && ring == 'I')
-    basephi = 2.984513044;
-  if(det == 3 && ring == 'O')
-    basephi = 3.06305289;
-  
-  Float_t step = 2*TMath::Pi() / nsec;
-  Float_t phi = 0;
-  if(det == 3)
-    phi = basephi - sec*step;
-  else
-    phi = basephi + sec*step;
-  
-  if(phi < 0) 
-    phi = phi +2*TMath::Pi();
-  if(phi > 2*TMath::Pi() )
-    phi = phi - 2*TMath::Pi();
-  
-  return phi;
-}
-//_____________________________________________________________________
-Float_t AliFMDAnaParameters::GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip, Float_t zvtx) const
-{
-  //Calculate eta from strip with vertex (redundant with AliESDFMD::Eta)
-  Float_t   rad       = GetMaxR(ring)-GetMinR(ring);
-  Float_t   nStrips   = (ring == 'I' ? 512 : 256);
-  Float_t   segment   = rad / nStrips;
-  Float_t   r         = GetMinR(ring) + segment*strip;
-  Float_t   z         = 0;
-  Int_t hybrid = sec / 2;
-  
-  if(det == 1) {
-    if(!(hybrid%2)) z = 320.266; else z = 319.766;
-  }
-  if(det == 2 && ring == 'I' ) {
-    if(!(hybrid%2)) z = 83.666; else z = 83.166;
-  }
-  if(det == 2 && ring == 'O' ) {
-    if(!(hybrid%2)) z = 74.966; else z = 75.466;
-  }
-  if(det == 3 && ring == 'I' ) {
-    if(!(hybrid%2)) z = -63.066; else z = -62.566;
-  }
-  if(det == 3 && ring == 'O' ) {
-    if(!(hybrid%2)) z = -74.966; else z = -75.466;
-  }
-  
-  //std::cout<<det<<"   "<<ring<<"   "<<sec<<"   "<<hybrid<<"    "<<z<<std::endl;
-  
-  // Float_t   r     = TMath::Sqrt(TMath::Power(x,2)+TMath::Power(y,2));
-  Float_t   theta = TMath::ATan2(r,z-zvtx);
-  Float_t   eta   = -1*TMath::Log(TMath::Tan(0.5*theta));
-  
-  return eta;
-}
-
-//_____________________________________________________________________
-
-Bool_t AliFMDAnaParameters::GetVertex(const AliESDEvent* esd, Double_t* vertexXYZ) 
-{
-  //Get the vertex from the ESD
-  const AliESDVertex* vertex = esd->GetPrimaryVertexSPD();
-  
-  if (!vertex) return kFALSE;
-
-  vertex->GetXYZ(vertexXYZ);
-
-  //if(vertexXYZ[0] == 0 || vertexXYZ[1] == 0 )
-  //  return kFALSE;
-  if(vertex->GetNContributors() <= 0)
-    return kFALSE;
-  
-  if(vertex->GetZRes() > 0.1 ) 
-    return kFALSE;
-  
-  return vertex->GetStatus();
-  
-}
-//____________________________________________________________________
-void AliFMDAnaParameters::SetTriggerStatus(const AliESDEvent *esd) {
-
-  //ULong64_t triggerMask = esd->GetTriggerMask();
-  
-  AliPhysicsSelection* centralPhysicsSelection = (AliPhysicsSelection*)((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->GetEventSelection();
-  
-  if(!centralPhysicsSelection && !fPhysicsSelection) {
-    
-    std::cout<<"Creating AliPhysicsSelection object due to absence of central object"<<std::endl;
-    fPhysicsSelection = new AliPhysicsSelection;
-    fPhysicsSelection->SetAnalyzeMC(!fRealData);
-    // fPhysicsSelection->SetUseBXNumbers(kFALSE);
-    
-    
-    AliBackgroundSelection* backgroundSelection = new AliBackgroundSelection("bg","bg");
-    backgroundSelection->Init();
-    fPhysicsSelection->AddBackgroundIdentification(backgroundSelection);
-    
-  }
-  
-  TString triggers = esd->GetFiredTriggerClasses();
-  
-  AliTriggerAnalysis tAna;
-  
-  fTriggerInel  = kFALSE;
-  fTriggerNSD   = kFALSE;
-  fTriggerEmpty = kFALSE;
-  
-  UInt_t inel = kFALSE;
-  
-  if(centralPhysicsSelection) {
-    inel= ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
-  }
-  else
-    inel = fPhysicsSelection->IsCollisionCandidate(esd);
-  
-  
-  
-  if(fInelGtZero && inel) {
-    const AliMultiplicity* spdmult = esd->GetMultiplicity();
-    Int_t nCentralTracklets = 0;
-    Int_t j = 0;
-    while( nCentralTracklets < 1 && j< spdmult->GetNumberOfTracklets() ) {
-      if(TMath::Abs(spdmult->GetEta(j)) < 1) nCentralTracklets++;
-      j++;
-    }
-    if(nCentralTracklets < 1) inel = kFALSE;      
-  }
-  
-  //std::cout<<fTriggerInel<<std::endl;
-  if(inel) {
-    fTriggerInel = kTRUE;
-  }
-  
-  Bool_t nsd = kFALSE;
-  if(fUseBuiltInNSD) { 
-    if ((tAna.FMDTrigger(esd, AliTriggerAnalysis::kASide) || tAna.V0Trigger(esd, AliTriggerAnalysis::kASide, kFALSE) == AliTriggerAnalysis::kV0BB) && (tAna.FMDTrigger(esd, AliTriggerAnalysis::kCSide) || tAna.V0Trigger(esd, AliTriggerAnalysis::kCSide, kFALSE) == AliTriggerAnalysis::kV0BB))
-      nsd = kTRUE;
-  }
-  else nsd = tAna.IsOfflineTriggerFired(esd,AliTriggerAnalysis::kNSD1);
-  
-  if(fTriggerInel && nsd) {
-    fTriggerNSD = kTRUE;
-  }
-  if(triggers.Contains("CBEAMB-ABCE-NOPF-ALL")) {
-    fTriggerEmpty = kTRUE;
-  }
-  
-  
-  /*switch (fTrigger) {
-  case kMB1: {
-    if( fPhysicsSelection->IsCollisionCandidate(esd)) {
-      fTriggerInel = kTRUE;
-    }
-    break;
-    
-  }
-  case kMB2: { 
-    if (triggerMask & spdFO && ((triggerMask & v0left) || (triggerMask & v0right)))
-      return kTRUE;
-    break;
-  }
-  case kSPDFASTOR: {
-    if (triggerMask & spdFO)
-      return kTRUE;
-    break;
-  }
-  case kNOCTP: {
-    return kTRUE;
-    break;
-  }
-  case kEMPTY: {
-  if(triggers.Contains("CBEAMB-ABCE-NOPF-ALL")) 
-  return kTRUE;
-    break;
-  }
-  case kNSD: {
-    if(fPhysicsSelection->IsCollisionCandidate(esd) && tAna.IsOfflineTriggerFired(esd,AliTriggerAnalysis::kNSD1))
-      return kTRUE;
-    break;
-  }
-    
-  }//switch
-  */
-  
-}
-/*
-//____________________________________________________________________
-Bool_t AliFMDAnaParameters::IsEventTriggered(const AliESDEvent *esd, Trigger trig) {
-  //Did we have trig trigger ?
-  Trigger old = fTrigger;
-  fTrigger = trig;
-  Bool_t retval = IsEventTriggered(esd);
-  fTrigger = old;
-  return retval;
-
-}
-*/
-//____________________________________________________________________
-Bool_t AliFMDAnaParameters::IsEventTriggered(Trigger trigger) {
-  // check if the event was triggered
-  
-  if (fCentralSelection) return kTRUE;
-  switch (trigger) {
-  
-  case kMB1:
-    return fTriggerInel;
-    break;
-  case kNSD:
-    return fTriggerNSD;
-    break;
-  case kEMPTY:
-    return fTriggerEmpty;
-    break;
-  case kNOCTP:
-    return kTRUE;
-    break;
-  default:
-    AliWarning("Trigger not implemented!!!");
-    break;
-    
-    
-  }
-  return kFALSE;
-  
-}
-    
-//____________________________________________________________________
-Float_t 
-AliFMDAnaParameters::GetStripLength(Char_t ring, UShort_t strip)  
-{
-  //Get length of a strip
-  
-  Float_t rad        = GetMaxR(ring)-GetMinR(ring);
-  Float_t   nStrips   = (ring == 'I' ? 512 : 256);
-  Float_t segment    = rad / nStrips;
-  
-  //TVector2* corner1  = fmdring.GetVertex(2);  
-  // TVector2* corner2  = fmdring.GetVertex(3);
-  
-  SetCorners(ring);
-  /*
-  std::cout<<GetMaxR(ring)<<"   "<<fmdring.GetMaxR()<<std::endl;
-  std::cout<<GetMinR(ring)<<"   "<<fmdring.GetMinR()<<std::endl;
-  std::cout<<corner1->X()<<"   "<<fCorner1.X()<<std::endl;
-  std::cout<<corner2->X()<<"   "<<fCorner2.X()<<std::endl;
-  std::cout<<corner1->Y()<<"   "<<fCorner1.Y()<<std::endl;
-  std::cout<<corner2->Y()<<"   "<<fCorner2.Y()<<std::endl;*/
-  Float_t slope      = (fCorner1.Y() - fCorner2.Y()) / (fCorner1.X() - fCorner2.X());
-  Float_t constant   = (fCorner2.Y()*fCorner1.X()-(fCorner2.X()*fCorner1.Y())) / (fCorner1.X() - fCorner2.X());
-  Float_t radius     = GetMinR(ring) + strip*segment;
-  
-  Float_t d          = TMath::Power(TMath::Abs(radius*slope),2) + TMath::Power(radius,2) - TMath::Power(constant,2);
-  
-  Float_t arclength  = GetBaseStripLength(ring,strip);
-  if(d>0) {
-    
-    Float_t x        = (-1*TMath::Sqrt(d) -slope*constant) / (1+TMath::Power(slope,2));
-    Float_t y        = slope*x + constant;
-    Float_t theta    = TMath::ATan2(x,y);
-    
-    if(x < fCorner1.X() && y > fCorner1.Y()) {
-      arclength = radius*theta;                        //One sector since theta is by definition half-hybrid
-      
-    }
-    
-  }
-  
-  return arclength;
-  
-  
-}
-//____________________________________________________________________
-Float_t 
-AliFMDAnaParameters::GetBaseStripLength(Char_t ring, UShort_t strip) const  
-{  
-  //Get length of strip assuming that corners are not cut away
-  Float_t rad             = GetMaxR(ring)-GetMinR(ring);
-  Float_t nStrips         = (ring == 'I' ? 512 : 256);
-  Float_t nSec            = (ring == 'I' ? 20 : 40);
-  Float_t segment         = rad / nStrips;
-  Float_t basearc         = 2*TMath::Pi() / (0.5*nSec); // One hybrid: 36 degrees inner, 18 outer
-  Float_t radius          = GetMinR(ring) + strip*segment;
-  Float_t basearclength   = 0.5*basearc * radius;                // One sector   
-  
-  return basearclength;
-}
-//____________________________________________________________________
-Int_t    AliFMDAnaParameters::GetFirstEtaBinFromMap(Int_t vtxbin, Int_t det, Char_t ring)
-{
-  //Get the first eta bin from the bg map
-  TH2F* hBg = GetBackgroundCorrection(det,ring,vtxbin);
-  
-  if(det == 0) return hBg->GetXaxis()->FindBin(-1.95);
-  
-  Int_t firstbin = -1;
-  Int_t nNonZeroFirst = 0;
-  
-  for(Int_t i=1;i<=hBg->GetNbinsX();i++) {
-    if(nNonZeroFirst == fNumberOfEtaBinsToCut && firstbin==-1) firstbin = i;
-    
-    for(Int_t j=1;j<=hBg->GetNbinsY();j++) {
-      
-      Float_t value = hBg->GetBinContent(i,j);
-      
-      if(value > 0.001 && nNonZeroFirst<fNumberOfEtaBinsToCut)
-       {nNonZeroFirst++; break;}
-      
-      
-    }
-  }
-  
-  return firstbin;
-
-}
-//____________________________________________________________________
-Int_t    AliFMDAnaParameters::GetLastEtaBinFromMap(Int_t vtxbin, Int_t det, Char_t ring)
-{
-  //Get the last eta bin from the map
-  TH2F* hBg = GetBackgroundCorrection(det,ring,vtxbin);
-  Int_t lastbin=-1;
-  Int_t nNonZeroLast = 0;
-  
-  if(det == 0) return hBg->GetXaxis()->FindBin(1.95);
-  
-  for(Int_t i=hBg->GetNbinsX();i>0;i--) {
-    if(nNonZeroLast == fNumberOfEtaBinsToCut && lastbin==-1) lastbin = i;
-    
-    for(Int_t j=1;j<=hBg->GetNbinsY();j++) {
-      
-      Float_t value = hBg->GetBinContent(i,j);
-      
-      if(value > 0.001 && nNonZeroLast<fNumberOfEtaBinsToCut)
-       {nNonZeroLast++; break; }
-      
-      
-    }
-  }
-  
-  return lastbin;
-}
-
-//____________________________________________________________________
-Int_t    AliFMDAnaParameters::GetFirstEtaBinToInclude(Int_t vtxbin, Int_t det, Char_t ring)
-{
-  Int_t ringNumber = (ring == 'I' ? 0 : 1);
-  return (Int_t)fEtaLowBinLimits.GetBinContent(det,ringNumber,vtxbin);
-
-}
-
-//____________________________________________________________________
-Int_t    AliFMDAnaParameters::GetLastEtaBinToInclude(Int_t vtxbin, Int_t det, Char_t ring)
-{
-  Int_t ringNumber = (ring == 'I' ? 0 : 1);
-  return (Int_t)fEtaHighBinLimits.GetBinContent(det,ringNumber,vtxbin);
-  
-}
-//____________________________________________________________________
-//
-// EOF
-//
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnaParameters.h b/PWGLF/FORWARD/analysis/AliFMDAnaParameters.h
deleted file mode 100644 (file)
index 94d18c2..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-#ifndef ALIFMDANAPARAMETERS_H
-#define ALIFMDANAPARAMETERS_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
- * reserved. 
- *
- * Latest changes by Hans Hjersing Dalsgaard, NBI, hans.dalsgaard@cern.ch
- *
- * See cxx source for full Copyright notice                               
- */
-//
-//The design of this class is based on the AliFMDParameters class. Its purpose
-//is to hold parameters for the analysis such as background correction and 
-//fit functions.
-//
-//Author: Hans Hjersing Dalsgaard, NBI, hans.dalsgaard@cern.ch
-//
-//____________________________________________________________________
-
-#ifndef ROOT_TNamed
-# include <TNamed.h>
-#endif
-#ifndef ROOT_TArrayI
-# include <TArrayI.h>
-#endif
-
-// #include "TFile.h"
-// #include "TObjArray.h"
-#include "TH2F.h"
-#include "TAxis.h"
-#include "TH1F.h"
-#include "TH3F.h"
-#include "AliPhysicsSelection.h"
-#include <TVector2.h>
-#include <TString.h>
-//#include "AliPWG0Helper.h"
-// #include "AliESDEvent.h"
-#include "AliInputEventHandler.h"
-#include "AliAnalysisManager.h"
-class AliESDEvent;
-class TObjArray;
-class AliFMDAnaCalibBackgroundCorrection;
-class AliFMDAnaCalibEnergyDistribution;
-class AliFMDAnaCalibEventSelectionEfficiency;
-class AliFMDAnaCalibSharingEfficiency;
-
-/**
- * @ingroup FMD_ana
- */
-class AliFMDAnaParameters : public TNamed
-{
-public:
-  /** Enumeration of things to initialize */ 
-  enum What { 
-    /** Pulser gain */ 
-    kBackgroundCorrection         = 0x1, // Background Correction 
-    kEnergyDistributions          = 0x2, // Energy Distributions
-    kEventSelectionEfficiency     = 0x4, // Event Selection Efficiency
-    kSharingEfficiency            = 0x8  // Sharing algorithm efficiency
-  };
-  
-  enum Trigger { kMB1 = 0, kMB2, kSPDFASTOR, kNOCTP, kEMPTY , kNSD};
-  
-  enum Energy { k900 , k10000, k14000 , k7000, k2400, k5500, k2750};
-  
-  enum MagField {k0G, k5G, k5Gnegative};
-  
-  enum Species {kPP, kPbPb};
-
-  /** DO NOT USE THIS - ONLY FOR IO */
-  AliFMDAnaParameters();
-  
-  /** Singleton access
-      @return  single to */
-  static AliFMDAnaParameters* Instance();
-  
-  void Init(Bool_t forceReInit=kTRUE, UInt_t what=kBackgroundCorrection|kEnergyDistributions|kEventSelectionEfficiency|kSharingEfficiency);
-  Float_t GetVtxCutZ();
-  Int_t GetNvtxBins();
-  Int_t GetNetaBins();
-  Float_t GetEtaMin();  
-  Float_t GetEtaMax();
-  Int_t GetEtaBin(Float_t eta);
-  Float_t GetMPV(Int_t det, Char_t ring, Float_t eta);
-  Float_t GetConstant(Int_t det, Char_t ring, Float_t eta);
-  Float_t GetSigma(Int_t det, Char_t ring, Float_t eta);
-  Float_t Get2MIPWeight(Int_t det, Char_t ring, Float_t eta);
-  Float_t Get3MIPWeight(Int_t det, Char_t ring, Float_t eta);
-  //static const char* GetBackgroundPath() { return fgkBackgroundCorrection;}
-  // static const char* GetEdistPath()      { return fgkEnergyDists;}
-  static const char* GetBackgroundID() { return fgkBackgroundID;}
-  static const char* GetEdistID()      { return fgkEnergyDistributionID;}
-  static const char* GetEventSelectionEffID()      { return fgkEventSelectionEffID;}
-  static const char* GetSharingEffID()      { return fgkSharingEffID;}
-  TH2F* GetBackgroundCorrection(Int_t det, Char_t ring, Int_t vtxbin);
-  TH2F* GetBackgroundCorrectionNSD(Int_t det, Char_t ring, Int_t vtxbin);
-  TH1F* GetDoubleHitCorrection(Int_t det, Char_t ring);
-  TH1F* GetSPDDeadCorrection(Int_t vtxbin);
-  TH1F* GetFMDDeadCorrection(Int_t vtxbin);
-  
-  TH1F* GetSharingEfficiency(Int_t det, Char_t ring, Int_t vtxbin);
-  TH1F* GetSharingEfficiencyTrVtx(Int_t det, Char_t ring, Int_t vtxbin);
-  
-  void     SetParametersFromESD(AliESDEvent* esd);
-  Float_t  GetEventSelectionEfficiency(Int_t vtxbin);
-  TH2F*    GetEventSelectionEfficiency(TString trig, Int_t vtxbin, Char_t ring);
-  Float_t  GetPhiFromSector(UShort_t det, Char_t ring, UShort_t sec) const;
-  Float_t  GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip, Float_t zvtx) const;
-  Float_t  GetStripLength(Char_t ring, UShort_t strip)  ;
-  Float_t  GetBaseStripLength(Char_t ring, UShort_t strip) const  ;
-  Float_t  GetMaxR(Char_t ring) const;
-  Float_t  GetMinR(Char_t ring) const;
-  void     SetBackgroundPath(const Char_t* bgpath) {fBackgroundPath = bgpath;}
-  void     SetEnergyPath(const Char_t* epath) {fEnergyPath = epath;}
-  void     SetEventSelectionPath(const Char_t* evpath) {fEventSelectionEffPath = evpath;}
-  void     SetSharingEfficiencyPath(const Char_t* sharpath) {fSharingEffPath = sharpath;}
-  void     SetInelGtZero(Bool_t InelGtZero) {fInelGtZero = InelGtZero;}
-  void     SetProcessPrimary(Bool_t prim=kTRUE) {fProcessPrimary = prim;}
-  void     SetProcessHits(Bool_t hits=kTRUE) {fProcessHits = hits;}
-  Bool_t   GetProcessPrimary() const {return fProcessPrimary;} 
-  Bool_t   GetProcessHits() const {return fProcessHits;}
-  Bool_t   GetVertex(const AliESDEvent* esd, Double_t* vertexXYZ);
-  void     SetTriggerDefinition(Trigger trigger) {fTrigger = trigger;}
-  Trigger  GetTriggerDefinition() const {return fTrigger;}
-  void     SetRunDndeta(Bool_t rundndeta) { fRunDndeta = rundndeta;  }
-  void     SetRunBFCorrelation(Bool_t runBFcor) { fRunBFCorrelation = runBFcor;  }
-  void     SetRunMultiplicity(Bool_t runMultiplicity) { fRunMultiplicity = runMultiplicity;  }
-  
-  Bool_t   GetRunDndeta() const        {return fRunDndeta;}
-  Bool_t   GetRunBFCorrelation() const {return fRunBFCorrelation;}
-  Bool_t   GetRunMultiplicity() const {return fRunMultiplicity;}
-
-  //Bool_t   IsEventTriggered(const AliESDEvent *esd) ;
-  Bool_t   IsEventTriggered(Trigger trigger) ;
-  void     SetTriggerStatus(const AliESDEvent *esd) ;
-  void     SetEnergy(Energy energy) {fEnergy = energy;}
-  void     SetEnergy(Float_t cmsNNGeV);
-  Energy   GetEnergy() const {return fEnergy;}
-  void     SetMagField(MagField magfield) {fMagField = magfield;}
-  void     SetMagField(Float_t bkG);
-  const char*    GetPath(const char* species) const;
-  void     SetCollisionSystem(Species collsystem) {fSpecies = collsystem;}
-  void     SetCollisionSystem(const TString& collsystem);
-  Species  GetCollisionSystem() const {return fSpecies;}
-  void     PrintStatus(Bool_t showPaths=true)  const;
-  void     Print(Option_t* /* option */) const { PrintStatus(); }
-  const Char_t*  GetDndetaAnalysisName() const {return "PWGLFforwardDnDeta";}
-  TH1F*    GetEnergyDistribution(Int_t det, Char_t ring, Float_t eta);
-  TH1F*    GetEmptyEnergyDistribution(Int_t det, Char_t ring);
-  TH1F*    GetRingEnergyDistribution(Int_t det, Char_t ring);
-  AliPhysicsSelection* GetPhysicsSelection() const { return fPhysicsSelection ? fPhysicsSelection : (AliPhysicsSelection*)((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->GetEventSelection();  /*return fPhysicsSelection;*/ }
-  Bool_t   IsRealData() const {return fRealData; }
-  void     SetRealData(Bool_t realdata) {fRealData = realdata;}
-  Float_t  GetLowSPDLimit() const {return fSPDlowLimit;}
-  Float_t  GetHighSPDLimit() const {return fSPDhighLimit;}
-  void     SetLowSPDLimit(Float_t cut) {fSPDlowLimit = cut;}
-  void     SetHighSPDLimit(Float_t cut) {fSPDhighLimit = cut;}
-  void     SetCentralTriggerSelection(Bool_t selection) {fCentralSelection = selection;}
-  Bool_t   SharingEffPresent() const {return fSharingObjectPresent;}
-  Int_t    GetFirstEtaBinToInclude(Int_t vtxbin, Int_t det, Char_t ring) ;
-  Int_t    GetLastEtaBinToInclude(Int_t vtxbin, Int_t det, Char_t ring) ;
-  void     SetUseInternalNSDTrigger(Bool_t internalNSD) {fUseBuiltInNSD = internalNSD;}
-
-  void     SetNumberOfEtaBinsToCut(Int_t nbins) {fNumberOfEtaBinsToCut = nbins;}
-  Int_t    GetNumberOfEtaBinsToCut() const {return fNumberOfEtaBinsToCut;}
-  Float_t  GetVtxSelectionEffFromMC() ;
-  
-protected:
-  
-  AliFMDAnaParameters(const AliFMDAnaParameters& o) 
-    : TNamed(o),
-      fIsInit(o.fIsInit),
-      fBackground(o.fBackground),
-      fEnergyDistribution(o.fEnergyDistribution),
-      fEventSelectionEfficiency(o.fEventSelectionEfficiency),
-      fSharingEfficiency(o.fSharingEfficiency),
-      fCorner1(o.fCorner1),
-      fCorner2(o.fCorner2),
-      fEnergyPath(o.fEnergyPath),
-      fBackgroundPath(o.fBackgroundPath),
-      fEventSelectionEffPath(o.fEventSelectionEffPath),
-      fSharingEffPath(o.fSharingEffPath),
-      fProcessPrimary(o.fProcessPrimary),
-      fProcessHits(o.fProcessHits),
-      fTrigger(o.fTrigger),
-      fEnergy(o.fEnergy),
-      fMagField(o.fMagField),
-      fSpecies(o.fSpecies),
-      fPhysicsSelection(o.fPhysicsSelection), 
-      fRealData(o.fRealData),
-      fSPDlowLimit(o.fSPDlowLimit),
-      fSPDhighLimit(o.fSPDhighLimit),   
-      fCentralSelection(o.fCentralSelection),
-      fSharingObjectPresent(o.fSharingObjectPresent),
-      fNumberOfEtaBinsToCut(o.fNumberOfEtaBinsToCut),
-      fEtaLowBinLimits(o.fEtaLowBinLimits),
-      fEtaHighBinLimits(o.fEtaHighBinLimits),
-      fTriggerInel(o.fTriggerInel),
-      fTriggerNSD(o.fTriggerNSD),
-      fTriggerEmpty(o.fTriggerEmpty),
-      fUseBuiltInNSD(o.fUseBuiltInNSD),
-      fInelGtZero(o.fInelGtZero),
-      fRunDndeta(o.fRunDndeta),
-      fRunBFCorrelation(o.fRunBFCorrelation),
-      fRunMultiplicity(o.fRunMultiplicity)
-  {}
-  AliFMDAnaParameters& operator=(const AliFMDAnaParameters&) { return *this; }
-  virtual ~AliFMDAnaParameters() {}
-  
-  static AliFMDAnaParameters* fgInstance;   // Static singleton instance
-  
-  //  AliCDBEntry* GetEntry(const char* path, Bool_t fatal=kTRUE) const ;
-  void InitBackground();
-  void InitEnergyDists();
-  void InitEventSelectionEff();
-  void InitSharingEff();
-  
-  void     FindEtaLimits();
-  Int_t    GetFirstEtaBinFromMap(Int_t vtxbin, Int_t det, Char_t ring) ;
-  Int_t    GetLastEtaBinFromMap(Int_t vtxbin, Int_t det, Char_t ring) ;
-
-  TObjArray* GetBackgroundArray();
-  
-  TAxis* GetRefAxis();
-  void SetCorners(Char_t ring) ;
-  
-  Bool_t fIsInit;                      //Have we been init ?
-  //TObjArray*  fBackgroundArray;
-  // TObjArray*  fEdistArray;
-  AliFMDAnaCalibBackgroundCorrection*         fBackground;  //BG correction object 
-  AliFMDAnaCalibEnergyDistribution*           fEnergyDistribution; //Energy dist object
-  AliFMDAnaCalibEventSelectionEfficiency*     fEventSelectionEfficiency; //Event selection correction object
-  AliFMDAnaCalibSharingEfficiency*            fSharingEfficiency; //Sharing efficiency correction object
-  //static const char* fgkBackgroundCorrection;
-  //static const char* fgkEnergyDists;
-  static const char* fgkBackgroundID;           // BG cor ID
-  static const char* fgkEnergyDistributionID ;  // Energy dist ID
-  static const char* fgkEventSelectionEffID ;   // Event selection ID
-  static const char* fgkSharingEffID ;          // Sharing efficiency ID  
-  
-  TVector2 fCorner1;                  //First corner of hybrid
-  TVector2 fCorner2;                  //Second corner of hybrid
-  TString  fEnergyPath;               //Path of energy calib
-  TString  fBackgroundPath;           //Path of BG correction
-  TString  fEventSelectionEffPath;    //Path of event selection eff
-  TString  fSharingEffPath;           //Path of sharing eff
-  Bool_t   fProcessPrimary;           //Do we process primary ?
-  Bool_t   fProcessHits;              //Do we process hits ?
-  Trigger  fTrigger;                  //Which trigger are we using ?
-  Energy   fEnergy;                   // CM energy
-  MagField fMagField;                 //Magnetic field
-  Species  fSpecies;                  //PbPb or pp ?
-  AliPhysicsSelection* fPhysicsSelection;  //Physics selection
-  Bool_t   fRealData;                 // real or simulated
-  Float_t  fSPDlowLimit ;             // low limit of SPD tracklets
-  Float_t  fSPDhighLimit ;             // high limit of SPD tracklets
-  Bool_t   fCentralSelection;         //if event selection is done centrally
-  Bool_t   fSharingObjectPresent ;    //Do we have a sharing object ? 
-  Int_t    fNumberOfEtaBinsToCut;     //Number of eta bins to remove from edge effects
-  TH3F     fEtaLowBinLimits;          //Histogram of low eta bin limits
-  TH3F     fEtaHighBinLimits;         //Histogram of high eta bin limits
-  Bool_t   fTriggerInel;              //If the selected INEL trigger fired
-  Bool_t   fTriggerNSD;               //If the NSD trigger fired
-  Bool_t   fTriggerEmpty;             //Event should be empty (empty bunches)
-  Bool_t   fUseBuiltInNSD;            //Should we use the internal NSD trigger by A. Hansen
-  Bool_t   fInelGtZero;               //Should INEL be INEL>0
-  Bool_t   fRunDndeta;                //Run the Dndeta analysis ?
-  Bool_t   fRunBFCorrelation;         //Run the BF correlation analysis ?
-  Bool_t   fRunMultiplicity;          //Run the multiplicity analysis ?
-  
-  ClassDef(AliFMDAnaParameters,1)     // Manager of parameters
-  
-};
-
-#endif
-//____________________________________________________________________
-//
-// Local Variables:
-//   mode: C++
-// End:
-//
-// EOF
-//
-
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskBFCorrelation.cxx b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskBFCorrelation.cxx
deleted file mode 100644 (file)
index ab8c0cc..0000000
+++ /dev/null
@@ -1,744 +0,0 @@
-#include <TROOT.h>
-#include <TSystem.h>
-#include <TInterpreter.h>
-#include <TChain.h>
-#include <TFile.h>
-#include <TList.h>
-#include <iostream>
-#include <string>
-#include <TCanvas.h>
-#include "TH1F.h"
-#include "TH2F.h"
-#include "TProfile.h"
-#include "AliFMDAnalysisTaskBFCorrelation.h"
-#include "AliAnalysisManager.h"
-#include "AliESDFMD.h"
-#include "AliESDEvent.h"
-#include "AliAODEvent.h"
-#include "AliAODHandler.h"
-#include "AliMCEventHandler.h"
-#include "AliStack.h"
-#include "AliLog.h"
-#include "AliESDVertex.h"
-#include "TMath.h"
-#include "AliFMDAnaParameters.h"
-//#include "AliFMDGeometry.h"
-#include "AliGenEventHeader.h"
-#include "AliGenPythiaEventHeader.h"
-#include "AliHeader.h"
-//#include "TDatabasePDG.h"
-//#include "TParticlePDG.h"
-#include "AliESDInputHandler.h"
-
-ClassImp(AliFMDAnalysisTaskBFCorrelation)
-
-AliFMDAnalysisTaskBFCorrelation::AliFMDAnalysisTaskBFCorrelation()
-: fDebug(0),
-  fOutputList(0),
-  fInputList(0),
-  fInternalList(0),
-  fVertexString(0x0),
-  fStandalone(kTRUE),
-  fEvent(0),
-  fnBinsX(0),
-  fXmin(0),
-  fXmax(0),
-  fnBinsY(0),
-  fYmin(0),
-  fYmax(0)
-{
-  // Default constructor
-  DefineInput (0, TList::Class());
-  DefineOutput(0, TList::Class());
-}
-
-//_____________________________________________________________________
-AliFMDAnalysisTaskBFCorrelation::AliFMDAnalysisTaskBFCorrelation(const char* name, Bool_t SE):
-  AliAnalysisTask(name,name),
-  fDebug(0),
-  fOutputList(0),
-  fInputList(0),
-  fInternalList(0),
-  fVertexString(0x0),
-  fStandalone(kTRUE),
-  fEvent(0),
-  fnBinsX(0),
-  fXmin(0),
-  fXmax(0),
-  fnBinsY(0),
-  fYmin(0),
-  fYmax(0)
-{
-  fStandalone = SE;
-  if(fStandalone) {
-    DefineInput (0, TList::Class());
-    DefineInput(1, TObjString::Class());
-    DefineOutput(0, TList::Class());
-  }
-}
-
-//_____________________________________________________________________
-void AliFMDAnalysisTaskBFCorrelation::CreateOutputObjects()
-{
-  
-  // Nomenclature for naming histograms
-  // SE    - Used in histogram names if used for containing Single Event information
-  // Rebin - Used in histogram names if they have been rebinned for analysis purposes
-
-  // Setup the list for storing results, if it does not exist
-
-  if(!fOutputList) {
-    fOutputList = new TList();
-    fOutputList->SetName("BackgroundCorrected");
-  }
-
-  // Setup the list for temporary storage during the analysis
-  
-  if(!fInternalList) {
-    fInternalList = new TList();
-    fInternalList->SetName("InternalBFList");
-  }
-  
-  // Get the bounds for the input histogram.
-  // This version is optimized for 200 bins in the eta range (-4, 6)
-
-  AliFMDAnaParameters *pars = AliFMDAnaParameters::Instance();
-  TH2F *hDefault = (TH2F*)pars->GetBackgroundCorrection(1, 'I', 1);
-
-  fnBinsX = hDefault->GetNbinsX();
-  fnBinsY = hDefault->GetNbinsY();
-  fXmin   = hDefault->GetXaxis()->GetXmin();
-  fXmax   = hDefault->GetXaxis()->GetXmax();
-  fYmin   = hDefault->GetYaxis()->GetXmin();
-  fYmax   = hDefault->GetYaxis()->GetXmax();
-  
-  // Histogram to contain an event of MC data. Same dimension as ESD event
-
-  TH2F *hEtaPhiParticleMap = new TH2F("hEtaPhiParticleMap",
-                                     "Distributions of MC particles (Eta,Phi)",
-                                     fnBinsX, fXmin, fXmax,
-                                     fnBinsY, fYmin, fYmax);
-  hEtaPhiParticleMap->Sumw2();
-
-  fInternalList->Add(hEtaPhiParticleMap);
-
-  // Create histograms with same binning as input for Response analysis
-  // and control histograms. One temporary histogram is also created to
-  // avoid the new and delete call. Must be reset after use !
-
-  TH1D *hSEMultESD      = new TH1D("hSEMultESD", "Multiplicity", fnBinsX, fXmin, fXmax);
-  TH1D *hSEMultMC       = new TH1D("hSEMultMC",  "Multiplicity", fnBinsX, fXmin, fXmax);
-
-  TH1D *hTemp           = new TH1D("hTemp", "Temporary histogram", fnBinsX, fXmin, fXmax);
-
-  fInternalList->Add(hSEMultESD);
-  fInternalList->Add(hSEMultMC);
-  fInternalList->Add(hTemp);
-
-  TH1F *hMultvsEtaESD   = new TH1F("hMultvsEtaESD", "Multiplicity vs Eta (ESD)", fnBinsX, fXmin, fXmax);
-  TH1F *hMultvsEtaMC    = new TH1F("hMultvsEtaMC",  "Multiplicity vs Eta (MC)",  fnBinsX, fXmin, fXmax);
-  
-  TH2F *hResponseMatrix = new TH2F("hResponseMatrix", "Response matrix", 151, -0.5, 150.5, 151, -0.5, 150.5);
-
-  fOutputList->Add(hMultvsEtaESD);
-  fOutputList->Add(hMultvsEtaMC);
-  fOutputList->Add(hResponseMatrix);
-
-  // Set up histograms for analysis and storage. 3 different binnings
-
-  for (Int_t i = 1; i <= 4; i++) { 
-    if (i == 3) continue;
-    
-    Int_t nBinsX  = fnBinsX/(5*i);
-
-    // Histograms for the event-by-event analysis
-    
-    TH1D *hSERebinMultESD        = new TH1D(Form("hSERebinMultESD_binning%d", i), 
-                                           Form("Multiplicity per event vs eta ESD (%d bins)", nBinsX), 
-                                           nBinsX, fXmin, fXmax);
-    
-    TH1D *hSERebinMultMC         = new TH1D(Form("hSERebinMultMC_binning%d", i), 
-                                           Form("Multiplicity per event vs eta MC-truth (%d bins)", nBinsX), 
-                                           nBinsX, fXmin, fXmax);
-    
-    TH1D *hSERebinMultMirrorESD  = new TH1D(Form("hSERebinMultMirrorESD_binning%d", i), 
-                                           Form("Multiplicity per event vs eta ESD Mirrored (%d bins)", nBinsX), 
-                                           nBinsX, fXmin, fXmax);
-    
-    TH1D *hSERebinMultMirrorMC   = new TH1D(Form("hSERebinMultMirrorMC_binning%d", i), 
-                                           Form("Multiplicity per event vs eta MC-truth Mirrored (%d bins)", nBinsX), 
-                                           nBinsX, fXmin, fXmax);
-    
-    
-    TH1D *hSERebinMultWESD       = new TH1D(Form("hSERebinMultWESD_binning%d", i), 
-                                           Form("Multiplicity per event vs eta ESD (%d bins)", nBinsX), 
-                                           nBinsX, fXmin, fXmax);
-    
-    TH1D *hSERebinMultWMC        = new TH1D(Form("hSERebinMultWMC_binning%d", i), 
-                                           Form("Multiplicity per event vs eta MC-truth (%d bins)", nBinsX), 
-                                           nBinsX, fXmin, fXmax);
-    
-    TH1D *hSERebinMultMirrorWESD = new TH1D(Form("hSERebinMultMirrorWESD_binning%d", i), 
-                                           Form("Multiplicity per event vs eta ESD Mirrored (%d bins)", nBinsX), 
-                                           nBinsX, fXmin, fXmax);
-    
-    TH1D *hSERebinMultMirrorWMC  = new TH1D(Form("hSERebinMultMirrorWMC_binning%d", i), 
-                                           Form("Multiplicity per event vs eta MC-truth Mirrored (%d bins)", nBinsX), 
-                                           nBinsX, fXmin, fXmax);
-    
-    fInternalList->Add(hSERebinMultESD);
-    fInternalList->Add(hSERebinMultMC);
-    fInternalList->Add(hSERebinMultMirrorESD);
-    fInternalList->Add(hSERebinMultMirrorMC);
-
-    fInternalList->Add(hSERebinMultWESD);
-    fInternalList->Add(hSERebinMultWMC);
-    fInternalList->Add(hSERebinMultMirrorWESD);
-    fInternalList->Add(hSERebinMultMirrorWMC);
-    
-    // Histograms for storing the acummulated parameters.
-
-    TH1F *hRebinnESD        = new TH1F(Form("hRebinnESD_binning%d", i),
-                                 Form("Counts ESD (%d bins)", nBinsX),
-                                 nBinsX, fXmin, fXmax);
-    
-    TH1F *hRebinnMirrorESD  = new TH1F(Form("hRebinnMirrorESD_binning%d", i),
-                                 Form("Counts ESD Mirrored (%d bins)", nBinsX),
-                                 nBinsX, fXmin, fXmax);
-    
-    TH1F *hRebinn2ESD       = new TH1F(Form("hRebinn2ESD_binning%d", i),
-                                 Form("Counts^2 ESD (%d bins)", nBinsX),
-                                 nBinsX, fXmin, fXmax);
-    
-    TH1F *hRebinn2MirrorESD = new TH1F(Form("hRebinn2MirrorESD_binning%d", i),
-                                 Form("Counts^2 ESD Mirrored (%d bins)", nBinsX),
-                                 nBinsX, fXmin, fXmax);
-    
-    TH1F *hRebinnfbESD      = new TH1F(Form("hRebinnfbESD_binning%d", i),
-                                 Form("Fwd*bwd ESD (%d bins)", nBinsX),
-                                 nBinsX, fXmin, fXmax);
-    
-
-    TH1F *hRebinnMC         = new TH1F(Form("hRebinnMC_binning%d", i),
-                                 Form("Counts MC (%d bins)", nBinsX),
-                                 nBinsX, fXmin, fXmax);
-    
-    TH1F *hRebinnMirrorMC   = new TH1F(Form("hRebinnMirrorMC_binning%d", i),
-                                 Form("Counts MC Mirrored (%d bins)", nBinsX),
-                                 nBinsX, fXmin, fXmax);
-    
-    TH1F *hRebinn2MC        = new TH1F(Form("hRebinn2MC_binning%d", i),
-                                 Form("Counts^2 MC (%d bins)", nBinsX),
-                                 nBinsX, fXmin, fXmax);
-    
-    TH1F *hRebinn2MirrorMC  = new TH1F(Form("hRebinn2MirrorMC_binning%d", i),
-                                 Form("Counts^2 MC Mirrored (%d bins)", nBinsX),
-                                 nBinsX, fXmin, fXmax);
-    
-    TH1F *hRebinnfbMC       = new TH1F(Form("hRebinnfbMC_binning%d", i),
-                                 Form("Fwd*bwd MC (%d bins)", nBinsX),
-                                 nBinsX, fXmin, fXmax);
-    
-    fOutputList->Add(hRebinnESD);
-    fOutputList->Add(hRebinnMirrorESD);
-    fOutputList->Add(hRebinn2ESD);
-    fOutputList->Add(hRebinn2MirrorESD);
-    fOutputList->Add(hRebinnfbESD);
-    
-    fOutputList->Add(hRebinnMC);
-    fOutputList->Add(hRebinnMirrorMC);
-    fOutputList->Add(hRebinn2MC);
-    fOutputList->Add(hRebinn2MirrorMC);
-    fOutputList->Add(hRebinnfbMC);
-
-    // Histograms for storing the weights for the acummulated parameters.
-
-    TH1F *hRebinnWESD        = new TH1F(Form("hRebinnWESD_binning%d", i),
-                                  Form("Counts ESD Weights (%d bins)", nBinsX),
-                                  nBinsX, fXmin, fXmax);
-    
-    TH1F *hRebinnMirrorWESD  = new TH1F(Form("hRebinnMirrorWESD_binning%d", i),
-                                  Form("Counts ESD Weights (%d bins)", nBinsX),
-                                  nBinsX, fXmin, fXmax);
-    
-    TH1F *hRebinn2WESD       = new TH1F(Form("hRebinn2WESD_binning%d", i),
-                                  Form("Counts^2 ESD Weights (%d bins)", nBinsX),
-                                  nBinsX, fXmin, fXmax);
-    
-    TH1F *hRebinn2MirrorWESD = new TH1F(Form("hRebinn2MirrorWESD_binning%d", i),
-                                  Form("Counts^2 ESD Weights (%d bins)", nBinsX),
-                                  nBinsX, fXmin, fXmax);
-    
-    TH1F *hRebinnfbWESD      = new TH1F(Form("hRebinnfbWESD_binning%d", i),
-                                  Form("Fwd*bwd ESD Weights (%d bins)", nBinsX),
-                                  nBinsX, fXmin, fXmax);
-    
-    
-    TH1F *hRebinnWMC         = new TH1F(Form("hRebinnWMC_binning%d", i),
-                                  Form("Counts MC weights (%d bins)", nBinsX),
-                                  nBinsX, fXmin, fXmax);
-    
-    TH1F *hRebinnMirrorWMC   = new TH1F(Form("hRebinnMirrorWMC_binning%d", i),
-                                  Form("Counts MC weights (%d bins)", nBinsX),
-                                  nBinsX, fXmin, fXmax);
-    
-    TH1F *hRebinn2WMC        = new TH1F(Form("hRebinn2WMC_binning%d", i),
-                                  Form("Counts^2 MC weights (%d bins)", nBinsX),
-                                  nBinsX, fXmin, fXmax);
-
-    TH1F *hRebinn2MirrorWMC  = new TH1F(Form("hRebinn2MirrorWMC_binning%d", i),
-                                  Form("Counts^2 MC weights (%d bins)", nBinsX),
-                                  nBinsX, fXmin, fXmax);
-    
-    TH1F *hRebinnfbWMC       = new TH1F(Form("hRebinnfbWMC_binning%d", i),
-                                  Form("Fwd*bwd MC weights (%d bins)", nBinsX),
-                                  nBinsX, fXmin, fXmax);
-
-    fOutputList->Add(hRebinnWESD);
-    fOutputList->Add(hRebinnMirrorWESD);
-    fOutputList->Add(hRebinn2WESD);
-    fOutputList->Add(hRebinn2MirrorWESD);
-    fOutputList->Add(hRebinnfbWESD);
-    fOutputList->Add(hRebinnWMC);
-    fOutputList->Add(hRebinnMirrorWMC);
-    fOutputList->Add(hRebinn2WMC);
-    fOutputList->Add(hRebinn2MirrorWMC);
-    fOutputList->Add(hRebinnfbWMC);
-    
-    // Histograms for the final result
-    /*
-    TH1D *hBFFcor = new TH1D(Form("hBFFcor_binning%d", i),
-                            Form("Forward - backward correlations F (%d bins)", nBinsXBF),
-                            nBinsXBF, 0, fXmax);
-    hBFFcor->GetXaxis()->SetTitle("#eta");
-    hBFFcor->GetXaxis()->SetTitle("b");
-    TH1D *hBFBcor = new TH1D(Form("hBFBcor_binning%d", i),
-                            Form("Forward - backward correlations B (%d bins)", nBinsXBF),
-                            nBinsXBF, 0, fXmax);
-    hBFBcor->GetXaxis()->SetTitle("#eta");
-    hBFBcor->GetXaxis()->SetTitle("b");
-
-    TH1D *hBFFcor_MC = new TH1D(Form("hBFFcor_MC_binning%d", i),
-                               Form("Forward - backward correlations F (%d bins) MC", nBinsXBF),
-                               nBinsXBF, 0, fXmax);
-    hBFFcor_MC->GetXaxis()->SetTitle("#eta");
-    hBFFcor_MC->GetXaxis()->SetTitle("b");
-    TH1D *hBFBcor_MC = new TH1D(Form("hBFBcor_MC_binning%d", i),
-                               Form("Forward - backward correlations B (%d bins) MC", nBinsXBF),
-                               nBinsXBF, 0, fXmax);
-    hBFBcor_MC->GetXaxis()->SetTitle("#eta");
-    hBFBcor_MC->GetXaxis()->SetTitle("b");
-
-    fOutputList->Add(hBFFcor);
-    fOutputList->Add(hBFBcor);
-    fOutputList->Add(hBFFcor_MC);
-    fOutputList->Add(hBFBcor_MC);
-    */
-    
-    // Temporary histogram to avoid new-delete
-
-    TH1D* hRebinTemp = new TH1D(Form("hRebinTemp_binning%d", i),
-                                 Form("Temporary histogram (%d bins)", nBinsX),
-                                 nBinsX, fXmin, fXmax);
-
-    fInternalList->Add(hRebinTemp);
-  }
-}
-
-//_____________________________________________________________________
-void AliFMDAnalysisTaskBFCorrelation::ConnectInputData(Option_t */*option*/)
-{
-  if(fStandalone) {
-    fInputList   = (TList*)GetInputData(0);
-    fVertexString = (TObjString*)GetInputData(1);
-  }
-}
-
-//_____________________________________________________________________
-void AliFMDAnalysisTaskBFCorrelation::Exec(Option_t */*option*/) {
-
-  fEvent++;
-  //if (fEvent % 1000 == 0) 
-  //  std::cout << "Event # " << fEvent << std::endl;
-  
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  
-  fVertexString = (TObjString*)fInputList->At(0);
-  
-  //Int_t vtxbin = fVertexString->GetString().Atoi();
-  //if (vtxbin != 5) return;
-
-  ProjectAndMirror("ESD");
-  CalculateValues("ESD");
-  
-  if(pars->GetProcessPrimary()) {
-    
-    ProcessPrimary();
-
-    CreateResponseMatrix();
-  }
-  
-  
-  if(fStandalone) {
-    PostData(0, fOutputList); 
-  }
-}
-
-//_____________________________________________________________________
-void AliFMDAnalysisTaskBFCorrelation::ProjectAndMirror(TString sType) {
-  
-  sType.ToUpper();
-  
-  if (!sType.Contains("ESD") && !sType.Contains("MC")) {
-    std::cout << "Wrong type specification for 'ProjectAndMirror'" << std::endl;
-    return;
-  }
-  
-  // Get Single Event histograms for storing hits without rebinning
-  
-  TH1D *hMult = dynamic_cast<TH1D*>(fInternalList->FindObject(Form("hSEMult%s", sType.Data())));
-  if(!hMult) {
-    AliWarning("no hist - returning"); 
-    return; 
-  }
-  hMult->Reset();
-  
-  // Create generic names for retrieving histograms 
-  
-  TList *list = 0; // List for getting either ESD or MC "hit map"
-  
-  TString sEtaPhiMap;
-  
-  if (sType.Contains("ESD")) {
-    
-    list = fInputList;
-    
-    sEtaPhiMap = "dNdetadphiHistogramSPDTrVtx";
-  }
-  
-  if (sType.Contains("MC")) {
-    
-    list = fInternalList;
-    
-    sEtaPhiMap = "hEtaPhiParticleMap";
-  }
-  
-  TString sMult("hSERebinMult");
-  TString sMultMirror("hSERebinMultMirror");
-  TString sMultW("hSERebinMultW");
-  TString sMultMirrorW("hSERebinMultMirrorW");
-  
-  sType += "_binning";
-  
-  sMult        += sType;
-  sMultMirror  += sType;
-  sMultW       += sType;
-  sMultMirrorW += sType;
-  
-  // Get the 2D histogram containing the particles of the event being analyzed
-  
-  TH2F *hEtaPhiMap = dynamic_cast<TH2F*>(list->FindObject(sEtaPhiMap));
-  
-  TH1D *hProjection = hEtaPhiMap->ProjectionX("hTemporary");
-  hMult->Add(hProjection);  
-  
-  // Loop over the 3 binnings
-  
-  for (Int_t i = 1; i<=4; i++) {
-    if (i == 3) continue;
-  
-    // Project the 2D "hit map" onto the eta-axis and rebin
-    
-    TH1D *hProjRebin = hEtaPhiMap->ProjectionX("hProjRebin");
-    hProjRebin->Rebin(i*5);    
-   
-    // Retrieve the histograms to store the Singe Event information and reset
-    
-    TH1D *hSEMult        = static_cast<TH1D*>(fInternalList->FindObject(Form("%s%d", sMult.Data(),        i)));
-    hSEMult->Reset();
-    
-    TH1D *hSEMultMirror  = static_cast<TH1D*>(fInternalList->FindObject(Form("%s%d", sMultMirror.Data(),  i)));
-    hSEMultMirror->Reset();
-    
-    TH1D *hSEMultW       = static_cast<TH1D*>(fInternalList->FindObject(Form("%s%d", sMultW.Data(),       i)));
-    hSEMultW->Reset();
-    
-    TH1D *hSEMultMirrorW = static_cast<TH1D*>(fInternalList->FindObject(Form("%s%d", sMultMirrorW.Data(), i)));
-    hSEMultMirrorW->Reset();
-    
-    // Fill the histograms with the Single Event information
-    
-    hSEMult->Add(hProjRebin);
-    
-    for (Int_t bin = 1; bin <= hSEMult->GetNbinsX(); bin++) {
-      
-      hSEMultMirror->SetBinContent(hSEMultMirror->FindBin(-hProjRebin->GetBinCenter(bin)), hProjRebin->GetBinContent(bin));
-      hSEMultMirror->SetBinError(hSEMultMirror->FindBin(-hProjRebin->GetBinCenter(bin)), hProjRebin->GetBinError(bin));
-      
-      // hMultDist->Fill(bin, hMultTemp->GetBinContent(bin));
-    }
-    hProjRebin->Delete();
-  }
-}
-
-//_____________________________________________________________________
-void AliFMDAnalysisTaskBFCorrelation::CalculateValues(TString sType) {
-  
-  sType.ToUpper();
-  
-  if (!sType.Contains("ESD") && !sType.Contains("MC")) {
-    std::cout << "Wrong type specification for 'CalculateValues'" << std::endl;
-    return;
-  }
-  
-  TString sMult("hSERebinMult");
-  TString sMultMirror("hSERebinMultMirror");
-  //  TString_t *sMultW("hSEMultW");
-  //  TString_t *sMultMirrorW("hSEMultMirrorW");
-  TString sn("hRebinn");
-  TString snMirror("hRebinnMirror");
-  TString sn2("hRebinn2");
-  TString sn2Mirror("hRebinn2Mirror");
-  TString snfb("hRebinnfb");
-
-  sType += "_binning";
-
-  sMult       += sType;
-  sMultMirror += sType;
-
-  sn          += sType;
-  snMirror    += sType;
-  sn2         += sType;
-  sn2Mirror   += sType;
-  snfb        += sType;
-  
-  for (Int_t i = 1; i <= 4; i++) {
-    if (i == 3) continue;
-    
-    TH1D *hSEMult          = (TH1D*)fInternalList->FindObject(Form("%s%d", sMult.Data(),       i)); 
-    TH1D *hSEMultMirror    = (TH1D*)fInternalList->FindObject(Form("%s%d", sMultMirror.Data(), i));
-    /*
-    TH1D *hSEMultW         = (TH1D*)fInternalList->FindObject(Form("%s%d", cMultW,       cType, i)); 
-    TH1D *hSEMultMirrorW   = (TH1D*)fInternalList->FindObject(Form("%s%d", cMultMirrorW, cType, i));
-    */
-
-    TH1F *hn               = (TH1F*)fOutputList->FindObject(Form("%s%d", sn.Data(),        i));
-    TH1F *hnMirror         = (TH1F*)fOutputList->FindObject(Form("%s%d", snMirror.Data(),  i));
-    TH1F *hn2              = (TH1F*)fOutputList->FindObject(Form("%s%d", sn2.Data(),       i));
-    TH1F *hn2Mirror        = (TH1F*)fOutputList->FindObject(Form("%s%d", sn2Mirror.Data(), i));
-    TH1F *hnfb             = (TH1F*)fOutputList->FindObject(Form("%s%d", snfb.Data(),      i));
-    /*
-    TH1F *hnW              = (TH1F*)fOutputList->FindObject(Form("%sW%s_binning%d", cn, cType, i));
-    TH1F *hnMirrorW        = (TH1F*)fOutputList->FindObject(Form("%sW%s_binning%d", cnMirror, cType, i));
-    TH1F *hn2W             = (TH1F*)fOutputList->FindObject(Form("%sW%s_binning%d", cn2, cType, i));
-    TH1F *hn2MirrorW       = (TH1F*)fOutputList->FindObject(Form("%sW%s_binning%d", cn2Mirror, cType, i));
-    TH1F *hnfbW            = (TH1F*)fOutputList->FindObject(Form("%sW%s_binning%d", cnfb, cType, i));
-    */
-    TH1D *hTemp            = (TH1D*)fInternalList->FindObject(Form("hRebinTemp_binning%d", i)); 
-
-    hn->Add(hSEMult);
-
-    hnMirror->Add(hSEMultMirror);
-
-    hTemp->Reset();
-    hTemp->Add(hSEMult);
-    hTemp->Multiply(hSEMult);
-    hn2->Add(hTemp);
-        
-    hTemp->Reset();
-    hTemp->Add(hSEMultMirror);
-    hTemp->Multiply(hSEMultMirror);
-    hn2Mirror->Add(hTemp);
-
-    hSEMultMirror->Multiply(hSEMult);
-    hnfb->Add(hSEMultMirror);
-  }
-}
-
-//_____________________________________________________________________
-void AliFMDAnalysisTaskBFCorrelation::MultiplicityVsEta(TString sType) {
-
-  sType.ToUpper();
-  
-  if (!sType.Contains("ESD") && !sType.Contains("MC")) {
-    std::cout << "Wrong type specification for 'MultiplicityVsEta'" << std::endl;
-    return;
-  }
-}
-  
-
-//_____________________________________________________________________
-void AliFMDAnalysisTaskBFCorrelation::CreateResponseMatrix() {
-
-  TH2F *hResponseMatrix = (TH2F*)fOutputList->FindObject("hResponseMatrix");
-
-  TH1D *hSEMultESD = (TH1D*)fInternalList->FindObject("hSEMultESD");
-  TH1D *hSEMultMC  = (TH1D*)fInternalList->FindObject("hSEMultMC");
-  
-  Float_t HitsESD = 0;
-  Float_t HitsMC  = 0;
-  
-  for (Int_t bin = 1; bin<= fnBinsX; bin++) {
-    
-    if ((hSEMultMC->GetBinLowEdge(bin)  > -3.4) &&
-       (hSEMultMC->GetBinLowEdge(bin+1) <  5.)) {
-
-      HitsESD += hSEMultESD->GetBinContent(bin);
-      HitsMC  += hSEMultMC->GetBinContent(bin);
-    }
-  }
-  
-  hResponseMatrix->Fill(HitsMC, HitsESD);
-}
-
-//_____________________________________________________________________
-void AliFMDAnalysisTaskBFCorrelation::Terminate(Option_t */*option*/) {
-  /*
-  std::cout << "Terminating !" << std::endl;
-
-  TH1I *hnEvents   = (TH1I*)fOutputList->FindObject("nEvents");
-  TH1I *hnMCEvents = (TH1I*)fOutputList->FindObject("nEvents");
-
-  Int_t nEvents   = hnEvents->GetEntries();
-  Int_t nMCEvents = hnMCEvents->GetEntries();
-
-  for (Int_t i = 1; i <= 4; i++) {
-    if (i == 3) continue;
-    
-    TH1F *hnFnB = (TH1F*)fOutputList->FindObject(Form("hnFnB_binning%d", i));
-    TH1F *hnF2  = (TH1F*)fOutputList->FindObject(Form("hnF2_binning%d", i));
-    TH1F *hnB2  = (TH1F*)fOutputList->FindObject(Form("hnB2_binning%d", i));
-    TH1F *hnF   = (TH1F*)fOutputList->FindObject(Form("hnF_binning%d", i));
-    TH1F *hnB   = (TH1F*)fOutputList->FindObject(Form("hnB_binning%d", i));
-
-    TH1F *hnFnB_MC = (TH1F*)fOutputList->FindObject(Form("hnFnB_MC_binning%d", i));
-    TH1F *hnF2_MC  = (TH1F*)fOutputList->FindObject(Form("hnF2_MC_binning%d", i));
-    TH1F *hnB2_MC  = (TH1F*)fOutputList->FindObject(Form("hnB2_MC_binning%d", i));
-    TH1F *hnF_MC   = (TH1F*)fOutputList->FindObject(Form("hnF_MC_binning%d", i));
-    TH1F *hnB_MC   = (TH1F*)fOutputList->FindObject(Form("hnB_MC_binning%d", i));
-    
-    hnFnB->Scale(1./Float_t(nEvents));
-    hnF2->Scale(1./Float_t(nEvents));
-    hnB2->Scale(1./Float_t(nEvents));
-    hnF->Scale(1./Float_t(nEvents));
-    hnB->Scale(1./Float_t(nEvents));
-
-    hnFnB_MC->Scale(1./Float_t(nMCEvents));
-    hnF2_MC->Scale(1./Float_t(nMCEvents));
-    hnB2_MC->Scale(1./Float_t(nMCEvents));
-    hnF_MC->Scale(1./Float_t(nMCEvents));
-    hnB_MC->Scale(1./Float_t(nMCEvents));
-
-    for (Int_t bin = 1; bin <= hnFnB->GetNbinsX(); bin++) {
-      
-      Double_t nFnBav = hnFnB->GetBinContent(bin);
-      Double_t nF2av  = hnF2->GetBinContent(bin);
-      Double_t nB2av  = hnB2->GetBinContent(bin);
-      Double_t nFav   = hnF->GetBinContent(bin);
-      Double_t nBav   = hnB->GetBinContent(bin);
-
-      Double_t nFnB_MCav = hnFnB_MC->GetBinContent(bin);
-      Double_t nF2_MCav  = hnF2_MC->GetBinContent(bin);
-      Double_t nB2_MCav  = hnB2_MC->GetBinContent(bin);
-      Double_t nF_MCav   = hnF_MC->GetBinContent(bin);
-      Double_t nB_MCav   = hnB_MC->GetBinContent(bin);
-
-      Double_t bF = ((nF2av-nFav*nFav) == 0 ? 0. : (nFnBav-nFav*nBav)/(nF2av-nFav*nFav));
-      Double_t bB = ((nF2av-nFav*nFav) == 0 ? 0. : (nFnBav-nFav*nBav)/(nB2av-nBav*nBav));
-
-      Double_t bF_MC = ((nF2_MCav-nF_MCav*nF_MCav) == 0 ? 0. : 
-                       (nFnB_MCav-nF_MCav*nB_MCav)/(nF2_MCav-nF_MCav*nF_MCav));
-      Double_t bB_MC = ((nF2_MCav-nF_MCav*nF_MCav) == 0 ? 0. : 
-                       (nFnB_MCav-nF_MCav*nB_MCav)/(nB2_MCav-nB_MCav*nB_MCav));
-      
-      TH1D *hBFFcor = (TH1D*)fOutputList->FindObject(Form("hBFFcor_binning%d", i));
-      TH1D *hBFBcor = (TH1D*)fOutputList->FindObject(Form("hBFBcor_binning%d", i));
-      TH1D *hBFFcor_MC = (TH1D*)fOutputList->FindObject(Form("hBFFcor_MC_binning%d", i));
-      TH1D *hBFBcor_MC = (TH1D*)fOutputList->FindObject(Form("hBFBcor_MC_binning%d", i));
-
-      hBFFcor->SetBinContent(bin, bF);
-      hBFBcor->SetBinContent(bin, bB);
-      hBFFcor_MC->SetBinContent(bin, bF_MC);
-      hBFBcor_MC->SetBinContent(bin, bB_MC);
-    }
-    }*/
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskBFCorrelation::ProcessPrimary() {
-  
-  AliMCEventHandler* eventHandler = 
-    dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()
-                                     ->GetMCtruthEventHandler());
-  if (!eventHandler) return;
-
-  AliMCEvent* mcEvent = eventHandler->MCEvent();
-  if(!mcEvent) return;
-    
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  
-  AliMCParticle* particle = 0;
-  AliStack* stack = mcEvent->Stack();
-  
-  //TH1F* hPrimary = (TH1F*)fOutputList->FindObject("hMultvsEta");
-  AliHeader* header            = mcEvent->Header();
-  AliGenEventHeader* genHeader = header->GenEventHeader();
-  /*
-  AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader);
-  
-  if (!pythiaGenHeader) {
-    std::cout<<" no pythia header!"<<std::endl;
-    return; 
-  }
-  
-  Int_t pythiaType = pythiaGenHeader->ProcessType();
-  
-  if(pythiaType==92||pythiaType==93){
-    std::cout<<"single diffractive"<<std::endl;
-    return;
-  }
-  if(pythiaType==94){
-    std::cout<<"double diffractive"<<std::endl;
-    return;
-  }
-  */
-  TArrayF vertex;
-  genHeader->PrimaryVertex(vertex);
-  if(TMath::Abs(vertex.At(2)) > pars->GetVtxCutZ())
-    return;
-  //  Double_t delta           = 2*pars->GetVtxCutZ()/pars->GetNvtxBins();
-  //  Double_t vertexBinDouble = (vertex.At(2) + pars->GetVtxCutZ()) / delta;
-  //  Int_t    vertexBin       = (Int_t)vertexBinDouble;
-  
-  //if (vertexBin != 5) return;
-  
-  //Bool_t firstTrack = kTRUE;
-  
-  // we loop over the primaries only unless we need the hits (diagnostics running slowly)
-  Int_t nTracks = stack->GetNprimary();
-  //  if(pars->GetProcessHits())
-  //  nTracks = stack->GetNtrack();
-  
-  TH2F *hEtaPhiParticleMap = (TH2F*)fInternalList->FindObject("hEtaPhiParticleMap");
-  hEtaPhiParticleMap->Reset();
-  
-  for(Int_t i= 0; i < nTracks; i++) {
-    particle = (AliMCParticle*) mcEvent->GetTrack(i);
-    if(!particle) continue;
-    
-    if((stack->IsPhysicalPrimary(i)) && (particle->Charge() != 0)) {
-      hEtaPhiParticleMap->Fill(particle->Eta(), particle->Phi());
-      //std::cout << "Hans er nederen" << std::endl;
-    }
-  }
-  ProjectAndMirror("MC");
-  CalculateValues("MC");
-}
-
-//_____________________________________________________________________
-//
-//
-// EOF
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskBFCorrelation.h b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskBFCorrelation.h
deleted file mode 100644 (file)
index 32589be..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-#ifndef ALIFMDANALYSISTASKBFCORRELATION_H
-#define ALIFMDANALYSISTASKBFCORRELATION_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-#include "AliAnalysisTask.h"
-
-#include "TObjArray.h"
-#include "TObjString.h"
-#include "TArrayI.h"
-#include "TH1I.h"
-#include "TH2.h"
-#include "AliMCEvent.h"
-#include "AliFMDFloatMap.h"
-#include "TCanvas.h"
-
-/**
- * Task to do the backward/forward correlation analysis
- * 
- * Input:
- *   List of histograms from AliFMDAnaysisTaskBackground
- *
- * Output: 
- *   List of histograms of ...
- *
- * Used correction objects:
- *   
- * 
- * @ingroup FMD_ana
- */
-class AliFMDAnalysisTaskBFCorrelation : public AliAnalysisTask
-{
-public:
-  /** 
-   * Constructor 
-   * 
-   * 
-   */
-    AliFMDAnalysisTaskBFCorrelation();
-  /** 
-   * Constructor
-   * 
-   * @param name  Name of task 
-   * @param SE    Whether we're run from SE task
-   */
-    AliFMDAnalysisTaskBFCorrelation(const char* name, Bool_t SE = kTRUE);
-  /** 
-   * Destructor
-   */
-  virtual ~AliFMDAnalysisTaskBFCorrelation() {;}
-  /** 
-   * Copy constructor 
-   * 
-   * @param o Object to copy from
-   */
-  AliFMDAnalysisTaskBFCorrelation(const AliFMDAnalysisTaskBFCorrelation& o) 
-    : AliAnalysisTask(),
-      fDebug(o.fDebug),
-      fOutputList(0),
-      fInputList(0),
-      fInternalList(0),
-      fVertexString(o.fVertexString),
-      fStandalone(o.fStandalone),
-      fEvent(0),
-      fnBinsX(0),
-      fXmin(0),
-      fXmax(0),
-      fnBinsY(0),
-      fYmin(0),
-      fYmax(0)
-  {}
-  /** 
-   * Assignment operator 
-   * 
-   * 
-   * @return Reference to this. 
-   */  
-  AliFMDAnalysisTaskBFCorrelation& 
-  operator=(const AliFMDAnalysisTaskBFCorrelation&) { return *this; }
-  /**
-   * @{
-   * @name Implementation of interface methods
-   */
-  virtual void ConnectInputData(Option_t *option = "");
-  virtual void CreateOutputObjects();
-  virtual void Init() {}
-  virtual void LocalInit() {Init();}
-  virtual void Exec(Option_t *option);
-  virtual void Terminate(Option_t *option);
-  virtual void SetDebugLevel(Int_t level) {fDebug = level;}
-  /** 
-   * @}
-   */
-  /** 
-   * Set the input list of histograms
-   * 
-   * @param inputList Input list 
-   */
-  void SetInputList(TList* inputList) {fInputList = inputList;}
-  /** 
-   * Set the input vertex 
-   * 
-   * @param vtxString String 
-   */
-  void SetInputVertex(TObjString* vtxString) {fVertexString = vtxString;}
-  /** 
-   * Set the output list
-   * 
-   * @param outputList Output list 
-   */
-  void SetOutputList(TList* outputList) {fOutputList = outputList;}
-  /** 
-   * Project the data, and mirror it.
-   * 
-   * @param sType 
-   */
-  void ProjectAndMirror(TString sType);
-  /** 
-   * Calculate values 
-   * 
-   * @param sType 
-   */
-  void CalculateValues(TString sType);
-  //  void ProjectAndMirror(TString type);
-  //  void CalculateParameters(TString type);
-  /** 
-   * The multiplicity versus eta 
-   * 
-   * @param type 
-   */
-  void MultiplicityVsEta(TString type);
-  /** 
-   * Create the response matrix 
-   * 
-   */
-  void CreateResponseMatrix();
-  /** 
-   * Process a primary hit
-   * 
-   */
-  void ProcessPrimary();
-  /** 
-   * Get the list out out objects 
-   * 
-   * 
-   * @return 
-   */  
-  TList* GetOutputList() {return fOutputList;}
-private:
-  
-  Int_t         fDebug;        //  Debug flag
-  TList*        fOutputList;   // output list
-  TList*        fInputList;    // Input list
-  TList*        fInternalList; // Internal list
-  TObjString*   fVertexString; // Vertex string
-  Bool_t        fStandalone;   // Running standalone?
-  Int_t   fEvent;              // Event number
-  Int_t   fnBinsX;             // Number of bins 
-  Float_t fXmin;               // Minimum 
-  Float_t fXmax;               // Maximum
-  Int_t   fnBinsY;             // Number of bins
-  Float_t fYmin;               // Minumum
-  Float_t fYmax;               // Maximum
-
-  ClassDef(AliFMDAnalysisTaskBFCorrelation, 0); // Analysis task for FMD analysis
-};
-#endif
-// Local Variables:
-//   mode: C++ 
-// End:
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx
deleted file mode 100644 (file)
index ad2ef6c..0000000
+++ /dev/null
@@ -1,516 +0,0 @@
-#include <TROOT.h>
-#include <TSystem.h>
-#include <TInterpreter.h>
-#include <TChain.h>
-#include <TFile.h>
-#include <TList.h>
-#include <iostream>
-#include "TH2F.h"
-#include "AliFMDAnalysisTaskBackgroundCorrection.h"
-#include "AliAnalysisManager.h"
-#include "AliESDFMD.h"
-#include "AliESDEvent.h"
-#include "AliAODEvent.h"
-#include "AliAODHandler.h"
-#include "AliMCEventHandler.h"
-#include "AliStack.h"
-#include "AliLog.h"
-#include "AliESDVertex.h"
-#include "TMath.h"
-#include "AliFMDAnaParameters.h"
-#include "AliESDInputHandler.h"
-#include "AliMultiplicity.h"
-#include "TProfile2D.h"
-//#include "AliFMDGeometry.h"
-
-ClassImp(AliFMDAnalysisTaskBackgroundCorrection)
-
-
-AliFMDAnalysisTaskBackgroundCorrection::AliFMDAnalysisTaskBackgroundCorrection()
-: fDebug(0),
-  fOutputList(0),
-  fInputList(0),
-  fHitList(0),
-  fVertexString(0x0),
-  fNevents(),
-  fStandalone(kTRUE),
-  fOutputVertexString(0)
-{
-  // Default constructor
-  DefineInput (0, TList::Class());
-  DefineOutput(0, TList::Class());
-
-}
-//_____________________________________________________________________
-AliFMDAnalysisTaskBackgroundCorrection::AliFMDAnalysisTaskBackgroundCorrection(const char* name, Bool_t SE):
-    AliAnalysisTask(name, "Density"),
-    fDebug(0),
-    fOutputList(0),
-    fInputList(0),
-    fHitList(0),
-    fVertexString(0x0),
-    fNevents(),
-    fStandalone(kTRUE),
-    fOutputVertexString(0)
-{
-  fStandalone = SE;
-  if(fStandalone) {
-    DefineInput (0, TList::Class());
-    DefineOutput(0, TList::Class());
-  }
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskBackgroundCorrection::CreateOutputObjects()
-{
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  
-  if(!fOutputList)
-    fOutputList = new TList();
-  fOutputList->SetName("BackgroundCorrectedPerEvent");
-  if(!fHitList)
-    fHitList = new TList();
-  fHitList->SetName("HitsList");
-  
-  //if(fStandalone) {
-  fOutputVertexString = new TObjString();
-  // }
-  fOutputList->Add(fOutputVertexString);
-  
-  
-  
-  TH2F* hMult         = 0;
-  TH2F* hMultTrVtx    = 0;
-  TH2F* hMultNSD      = 0;
-  TH2F* hHits         = 0;
-  TH2F* hSPDMult      = 0;
-  TH2F* hSPDMultTrVtx = 0;
-  TH2F* hSPDMultNSD   = 0;
-  // TH2F* hHitsNoCuts = 0;
-  Int_t nVtxbins = pars->GetNvtxBins();
-  for(Int_t i = 0; i< nVtxbins; i++) {
-    for(Int_t det =1; det<=3;det++)
-      {
-       Int_t nRings = (det==1 ? 1 : 2);
-       for(Int_t ring = 0;ring<nRings;ring++)
-         {
-           Char_t ringChar = (ring == 0 ? 'I' : 'O');
-           Int_t  nSec     = (ring == 0 ? 20 : 40);
-           
-           
-           TH2F* hBg = pars->GetBackgroundCorrection(det, ringChar, i);
-           hMult  = new TH2F(Form("mult_FMD%d%c_vtxbin%d",det,ringChar,i),Form("mult_FMD%d%c_vtxbin%d",det,ringChar,i),
-                             hBg->GetNbinsX(),
-                             hBg->GetXaxis()->GetXmin(),
-                             hBg->GetXaxis()->GetXmax(),
-                             nSec, 0, 2*TMath::Pi());
-           hMult->Sumw2();
-           fOutputList->Add(hMult);
-           hMultTrVtx  = new TH2F(Form("multTrVtx_FMD%d%c_vtxbin%d",det,ringChar,i),Form("multTrVtx_FMD%d%c_vtxbin%d",det,ringChar,i),
-                                  hBg->GetNbinsX(),
-                                  hBg->GetXaxis()->GetXmin(),
-                                  hBg->GetXaxis()->GetXmax(),
-                                  nSec, 0, 2*TMath::Pi());
-           hMultTrVtx->Sumw2();
-
-           fOutputList->Add(hMultTrVtx);
-           
-           hMultNSD  = new TH2F(Form("multNSD_FMD%d%c_vtxbin%d",det,ringChar,i),Form("multNSD_FMD%d%c_vtxbin%d",det,ringChar,i),
-                                  hBg->GetNbinsX(),
-                                  hBg->GetXaxis()->GetXmin(),
-                                  hBg->GetXaxis()->GetXmax(),
-                                  nSec, 0, 2*TMath::Pi());
-           hMultNSD->Sumw2();
-
-           fOutputList->Add(hMultNSD);
-           
-           hHits  = new TH2F(Form("hits_FMD%d%c_vtxbin%d",det,ringChar,i),Form("hits_FMD%d%c_vtxbin%d",det,ringChar,i),
-                             hBg->GetNbinsX(),
-                             hBg->GetXaxis()->GetXmin(),
-                             hBg->GetXaxis()->GetXmax(),
-                             nSec, 0, 2*TMath::Pi());
-           
-           /*  hHitsNoCuts  = new TH2F(Form("hits_NoCuts_FMD%d%c_vtxbin%d",det,ringChar,i),Form("hits_NoCuts_FMD%d%c_vtxbin%d",det,ringChar,i),
-                                   hBg->GetNbinsX(),
-                                   hBg->GetXaxis()->GetXmin(),
-                                   hBg->GetXaxis()->GetXmax(),
-                                   nSec, 0, 2*TMath::Pi());
-           
-           */
-           hHits->Sumw2();
-           fHitList->Add(hHits);
-           
-         }
-      }
-    //HHD SPD hists
-    TH2F* hBg = pars->GetBackgroundCorrection(1, 'I', i);
-    hSPDMult  = new TH2F(Form("mult_SPD_vtxbin%d",i),Form("mult_SPD_vtxbin%d",i),
-                        hBg->GetNbinsX(),
-                        hBg->GetXaxis()->GetXmin(),
-                        hBg->GetXaxis()->GetXmax(),
-                        20, 0, 2*TMath::Pi());
-    hSPDMult->Sumw2();
-    fOutputList->Add(hSPDMult);
-    hSPDMultTrVtx  = new TH2F(Form("multTrVtx_SPD_vtxbin%d",i),Form("multTrVtx_SPD_vtxbin%d",i),
-                        hBg->GetNbinsX(),
-                        hBg->GetXaxis()->GetXmin(),
-                        hBg->GetXaxis()->GetXmax(),
-                        20, 0, 2*TMath::Pi());
-    hSPDMultTrVtx->Sumw2();
-    fOutputList->Add(hSPDMultTrVtx);
-    hSPDMultNSD  = new TH2F(Form("multNSD_SPD_vtxbin%d",i),Form("multNSD_SPD_vtxbin%d",i),
-                        hBg->GetNbinsX(),
-                        hBg->GetXaxis()->GetXmin(),
-                        hBg->GetXaxis()->GetXmax(),
-                        20, 0, 2*TMath::Pi());
-    hSPDMultNSD->Sumw2();
-    fOutputList->Add(hSPDMultNSD);
-    
-    
-  }
-  TH2F* hBg = pars->GetBackgroundCorrection(1, 'I', 5);
-  TH2F* dNdetadphiHistogram = new TH2F("dNdetadphiHistogramTrVtx","dNdetadphiHistogramTrVtx;#eta;#Phi",pars->GetNetaBins(),hBg->GetXaxis()->GetXmin(),hBg->GetXaxis()->GetXmax(),20,0,2*TMath::Pi());
-  TH2F* dNdetadphiHistogramSPD = new TH2F("dNdetadphiHistogramSPDTrVtx","dNdetadphiHistogramSPDTrVtx;#eta;#Phi",pars->GetNetaBins(),hBg->GetXaxis()->GetXmin(),hBg->GetXaxis()->GetXmax(),20,0,2*TMath::Pi());
-  //dNdetadphiHistogram->SetErrorOption("g");
-  
-  fHitList->Add(dNdetadphiHistogram);
-  fOutputList->Add(dNdetadphiHistogram);
-  fHitList->Add(dNdetadphiHistogramSPD);
-  fOutputList->Add(dNdetadphiHistogramSPD);
-  
-  
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskBackgroundCorrection::ConnectInputData(Option_t */*option*/)
-{
-  if(fStandalone) {
-    fInputList   = (TList*)GetInputData(0);
-    
-  }
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskBackgroundCorrection::Exec(Option_t */*option*/)
-{
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  
-  fVertexString = (TObjString*)fInputList->At(0);
-   
-  Int_t vtxbin   = fVertexString->GetString().Atoi();
-  fOutputVertexString->SetString(Form("%d",vtxbin));
-  
-  fNevents.Fill(vtxbin);
-  //Reset everything
-  for(UShort_t det=1;det<=3;det++) {
-    Int_t nRings = (det==1 ? 1 : 2);
-    for (UShort_t ir = 0; ir < nRings; ir++) {
-      Char_t ringChar = (ir == 0 ? 'I' : 'O');
-      TH2F* hMult = (TH2F*)fOutputList->FindObject(Form("mult_FMD%d%c_vtxbin%d",det,ringChar,vtxbin));
-      hMult->Reset();
-      TH2F* hMultTrVtx = (TH2F*)fOutputList->FindObject(Form("multTrVtx_FMD%d%c_vtxbin%d",det,ringChar,vtxbin));
-      hMultTrVtx->Reset();
-      TH2F* hMultNSD = (TH2F*)fOutputList->FindObject(Form("multNSD_FMD%d%c_vtxbin%d",det,ringChar,vtxbin));
-      hMultNSD->Reset();
-    
-      TH2F* hSPDMult      = (TH2F*)fOutputList->FindObject(Form("mult_SPD_vtxbin%d",vtxbin));
-      hSPDMult->Reset();
-      TH2F* hSPDMultTrVtx = (TH2F*)fOutputList->FindObject(Form("multTrVtx_SPD_vtxbin%d",vtxbin));
-      hSPDMultTrVtx->Reset();
-      TH2F* hSPDMultNSD = (TH2F*)fOutputList->FindObject(Form("multNSD_SPD_vtxbin%d",vtxbin));
-      hSPDMultNSD->Reset();
-    }
-    
-  }
-  
-  Bool_t nsd = pars->IsEventTriggered(AliFMDAnaParameters::kNSD);
-  for(UShort_t det=1;det<=3;det++) {
-    
-    Int_t nRings = (det==1 ? 1 : 2);
-    for (UShort_t ir = 0; ir < nRings; ir++) {
-      Char_t ringChar = (ir == 0 ? 'I' : 'O');
-      
-      TH2F* hMult      = (TH2F*)fOutputList->FindObject(Form("mult_FMD%d%c_vtxbin%d",det,ringChar,vtxbin));
-      TH2F* hMultTrVtx = (TH2F*)fOutputList->FindObject(Form("multTrVtx_FMD%d%c_vtxbin%d",det,ringChar,vtxbin));
-      TH2F* hMultNSD   = (TH2F*)fOutputList->FindObject(Form("multNSD_FMD%d%c_vtxbin%d",det,ringChar,vtxbin));
-      TH2F* hMultInput = (TH2F*)fInputList->FindObject(Form("FMD%d%c_vtxbin%d",det,ringChar,vtxbin));
-      TH2F* hHits      = (TH2F*)fHitList->FindObject(Form("hits_FMD%d%c_vtxbin%d",det,ringChar,vtxbin));
-      
-      //if(pars->GetProcessHits())
-      hHits->Add(hMultInput);
-      
-      TH2F* hBg        = pars->GetBackgroundCorrection(det, ringChar, vtxbin);
-      TH2F* hBgNSD     = pars->GetBackgroundCorrectionNSD(det, ringChar, vtxbin);
-      hMult->Add(hMultInput);
-      hMultTrVtx->Add(hMultInput);
-      
-      hMult->Divide(hBg);//,"B");
-      hMultTrVtx->Divide(hBg);//,"B");
-      
-      if(nsd) {
-       hMultNSD->Add(hMultInput);
-       hMultNSD->Divide(hBgNSD);
-      }
-      
-      //sharing efficiency correction ?
-      if(pars->SharingEffPresent()) {
-       TH1F* hSharingEff = pars->GetSharingEfficiencyTrVtx(det,ringChar,vtxbin); 
-       TH1F* hSharingEffTrVtx = pars->GetSharingEfficiencyTrVtx(det,ringChar,vtxbin);  
-      
-       for(Int_t nx=1; nx<=hMult->GetNbinsX(); nx++) {
-         Float_t correction      = hSharingEff->GetBinContent(nx);
-         Float_t correctionTrVtx = hSharingEffTrVtx->GetBinContent(nx);
-         //FIXME : This should be for NSD events
-         Float_t correctionNSD   = hSharingEff->GetBinContent(nx);
-         
-         for(Int_t ny=1; ny<=hMult->GetNbinsY(); ny++) {
-           
-           if(correction != 0){
-             hMult->SetBinContent(nx,ny,hMult->GetBinContent(nx,ny)/correction);
-             Float_t error = TMath::Sqrt(TMath::Power(hMult->GetBinError(nx,ny),2) + TMath::Power(hMult->GetBinContent(nx,ny)*hSharingEff->GetBinError(nx),2)) / correction;
-             hMult->SetBinError(nx,ny,error);
-           }
-           if(correctionTrVtx != 0){
-             hMultTrVtx->SetBinContent(nx,ny,hMultTrVtx->GetBinContent(nx,ny)/correctionTrVtx);
-             Float_t error = TMath::Sqrt(TMath::Power(hMultTrVtx->GetBinError(nx,ny),2) + TMath::Power(hMultTrVtx->GetBinContent(nx,ny)*hSharingEffTrVtx->GetBinError(nx),2)) / correctionTrVtx;
-             hMultTrVtx->SetBinError(nx,ny,error);
-           }
-           if(correctionNSD != 0 && nsd) {
-             hMultNSD->SetBinContent(nx,ny,hMultNSD->GetBinContent(nx,ny)/correctionNSD);
-             Float_t error = TMath::Sqrt(TMath::Power(hMultNSD->GetBinError(nx,ny),2) + TMath::Power(hMultNSD->GetBinContent(nx,ny)*hSharingEff->GetBinError(nx),2)) / correctionNSD;
-             hMultNSD->SetBinError(nx,ny,error);
-           }
-           
-           
-         }
-         
-       }
-      }
-      
-      // if(pars->GetEventSelectionEfficiency(vtxbin) > 0)
-      //       hMult->Scale(1/pars->GetEventSelectionEfficiency(vtxbin));
-      //else
-      //       hMult->Scale(0);
-      hMult->Divide(pars->GetEventSelectionEfficiency("INEL",vtxbin,ringChar));
-      hMultNSD->Divide(pars->GetEventSelectionEfficiency("NSD",vtxbin,ringChar));
-      
-      
-      }
-  }
-  
-  //HHD SPD code
-  
-  TH2F* hSPDMult      = (TH2F*)fOutputList->FindObject(Form("mult_SPD_vtxbin%d",vtxbin));
-  TH2F* hSPDMultTrVtx = (TH2F*)fOutputList->FindObject(Form("multTrVtx_SPD_vtxbin%d",vtxbin));
-  TH2F* hSPDMultNSD   = (TH2F*)fOutputList->FindObject(Form("multNSD_SPD_vtxbin%d",vtxbin));
-  
-  AliESDInputHandler* eventHandler = 
-    dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()
-                                      ->GetInputEventHandler());
-  if (!eventHandler) return;
-
-  AliESDEvent* esd = eventHandler->GetEvent();
-  
-  const AliMultiplicity* spdmult = esd->GetMultiplicity();
-  for(Int_t j = 0; j< spdmult->GetNumberOfTracklets();j++) {
-    hSPDMult->Fill(spdmult->GetEta(j),spdmult->GetPhi(j));
-    hSPDMultTrVtx->Fill(spdmult->GetEta(j),spdmult->GetPhi(j));
-    hSPDMultNSD->Fill(spdmult->GetEta(j),spdmult->GetPhi(j));
-  }
-  for(Int_t j = 0; j< spdmult->GetNumberOfSingleClusters();j++) {
-    hSPDMult->Fill(-TMath::Log(TMath::Tan(spdmult->GetThetaSingle(j)/2.)),spdmult->GetPhiSingle(j));
-    hSPDMultTrVtx->Fill(-TMath::Log(TMath::Tan(spdmult->GetThetaSingle(j)/2.)),spdmult->GetPhiSingle(j));
-    hSPDMultNSD->Fill(-TMath::Log(TMath::Tan(spdmult->GetThetaSingle(j)/2.)),spdmult->GetPhiSingle(j));
-  }
-  
-  TH2F* hBgSPD        = pars->GetBackgroundCorrection(0, 'Q', vtxbin);
-  if(hBgSPD) { 
-    
-    hSPDMult->Divide(hBgSPD);
-    hSPDMultTrVtx->Divide(hBgSPD);
-    hSPDMultNSD->Divide(hBgSPD);
-      
-    TH1F* hDead      = pars->GetSPDDeadCorrection(vtxbin);
-    for(Int_t i=1; i<=hSPDMult->GetNbinsX(); i++) {
-      for(Int_t j=1; j<=hSPDMult->GetNbinsY(); j++) {
-       Float_t mult = hSPDMult->GetBinContent(i,j);
-       Float_t correction = hBgSPD->GetBinContent(i,j);
-       Float_t correctedMult = 0;
-       Float_t correctedError = 0;
-       
-       
-       if( mult > 0 && correction > 0.) {
-       correctedMult = mult;///correction;
-         //std::cout<<correction<<"   "<<hSPDMult->GetXaxis()->GetBinCenter(i)<<std::endl;
-       //  correctedMult = mult/correction;
-         
-         if(hDead->GetBinContent(i) > 0)
-           correctedMult = correctedMult/hDead->GetBinContent(i);
-         correctedError = correctedMult*TMath::Sqrt( TMath::Power(hSPDMult->GetBinError(i,j)/hSPDMult->GetBinContent(i,j),2) + 
-                                                     TMath::Power(hBgSPD->GetBinError(i,j)/hBgSPD->GetBinContent(i,j),2)); 
-         
-       }
-       
-       if(correctedMult > 0) {
-         hSPDMult->SetBinContent(i,j,correctedMult);
-         hSPDMultTrVtx->SetBinContent(i,j,correctedMult);
-         hSPDMult->SetBinError(i,j,correctedError);
-         hSPDMultTrVtx->SetBinError(i,j,correctedError);
-         if(nsd) {
-           hSPDMultNSD->SetBinContent(i,j,correctedMult);
-           hSPDMultNSD->SetBinError(i,j,correctedError);
-         }
-         
-       }
-      }
-    }
-    hSPDMult->Divide(pars->GetEventSelectionEfficiency("INEL",vtxbin,'I'));
-    hSPDMultNSD->Divide(pars->GetEventSelectionEfficiency("NSD",vtxbin,'I'));
-  }
-  else
-    AliWarning("No SPD background map found");
-  
-  //std::cout<<spdmult->GetNumberOfTracklets()<<"  "<<spdmult->GetNumberOfITSClusters(0)<<"    "<< spdmult->GetNumberOfSingleClusters()<<std::endl;
-  
-  CreatePerEventHistogram(vtxbin);
-  
-  if(fStandalone) {
-    PostData(0, fOutputList); 
-  }
-  
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskBackgroundCorrection::Terminate(Option_t */*option*/) {
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  
-  Int_t nVtxbins = pars->GetNvtxBins();
-  
-  for(UShort_t det=1;det<=3;det++) {
-    Int_t nRings = (det==1 ? 1 : 2);
-    for (UShort_t ir = 0; ir < nRings; ir++) {
-      Char_t ringChar = (ir == 0 ? 'I' : 'O');
-      for(Int_t i =0; i<nVtxbins; i++) {
-       TH2F* hHits      = (TH2F*)fHitList->FindObject(Form("hits_FMD%d%c_vtxbin%d",det,ringChar,i));
-       TH1D* hHitsproj  = hHits->ProjectionX(Form("hits_FMD%d%c_vtxbin%d_proj",det,ringChar,i),1,hHits->GetNbinsY());
-       TH1D* hHitsNoCuts = (TH1D*)hHitsproj->Clone(Form("hits_NoCuts_FMD%d%c_vtxbin%d_proj",det,ringChar,i));
-       if(pars->GetEventSelectionEfficiency(i) > 0)
-         hHitsNoCuts->Scale(1/pars->GetEventSelectionEfficiency(i));
-       else
-         hHitsNoCuts->Scale(0);
-       fHitList->Add(hHitsproj);
-       fHitList->Add(hHitsNoCuts);
-       
-      }
-    }
-  }
-}
-
-//_____________________________________________________________________
-void AliFMDAnalysisTaskBackgroundCorrection::CreatePerEventHistogram(Int_t vtxbin) {
-  
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  TH2F* dNdetadphiHistogram = (TH2F*)fHitList->FindObject("dNdetadphiHistogramTrVtx");
-  TH2F* dNdetadphiHistogramSPD = (TH2F*)fHitList->FindObject("dNdetadphiHistogramSPDTrVtx");
-  
-  dNdetadphiHistogram->Reset();
-  dNdetadphiHistogramSPD->Reset();
-  
-  for(Int_t det = 0; det<=3; det++) {
-    Int_t maxRing = (det<= 1 ? 0 : 1);
-    
-    
-    
-    for(Int_t ring = 0;ring<=maxRing;ring++) {
-      
-      Char_t ringChar = (ring == 0 ? 'I' : 'O');
-      
-      TH2F* multhistoriginal = 0;
-      
-      if(det == 0)
-       multhistoriginal = (TH2F*)fOutputList->FindObject(Form("multTrVtx_SPD_vtxbin%d",vtxbin));
-      else      
-       multhistoriginal = (TH2F*)fOutputList->FindObject(Form("multTrVtx_FMD%d%c_vtxbin%d",det,ringChar,vtxbin));
-      
-      TH2F* multhist = (TH2F*)multhistoriginal->Clone("tmp");
-      
-      
-      
-      if(ringChar == 'O' && det > 0)
-       multhist->RebinY(2);
-      
-      for(Int_t i=pars->GetFirstEtaBinToInclude(vtxbin,det,ringChar); i<=pars->GetLastEtaBinToInclude(vtxbin,det,ringChar); i++) {
-       for(Int_t j=1; j<=multhist->GetNbinsY(); j++) {
-         if(multhist->GetBinContent(i,j) < 0.0001) continue;
-         
-         Bool_t overlapFMD = kFALSE;
-         Bool_t overlapSPD = kFALSE;
-         
-         if(det == 1 && ringChar =='I')
-           if(i<=pars->GetLastEtaBinToInclude(vtxbin,2,'I'))
-             overlapFMD = kTRUE;
-                 
-         if(det == 2 && ringChar =='O') {
-           if(i>=pars->GetFirstEtaBinToInclude(vtxbin,2,'I'))
-             overlapFMD = kTRUE;
-           if(i<=pars->GetLastEtaBinToInclude(vtxbin,0,'I'))// && TMath::Abs(multhist->GetXaxis()->GetBinCenter(i)) < 2)
-             overlapSPD = kTRUE;
-         }
-         if(det == 2 && ringChar =='I')
-           if(i<=pars->GetLastEtaBinToInclude(vtxbin,2,'O') || i>=pars->GetFirstEtaBinToInclude(vtxbin,1,'I'))
-             overlapFMD = kTRUE;
-                 
-         if(det == 3 && ringChar =='I')
-           if(i>=pars->GetFirstEtaBinToInclude(vtxbin,3,'O'))
-             overlapFMD = kTRUE; 
-         
-         if(det == 3 && ringChar =='O') {
-           if(i<=pars->GetLastEtaBinToInclude(vtxbin,3,'I'))
-             overlapFMD = kTRUE;
-           if(i>=pars->GetFirstEtaBinToInclude(vtxbin,0,'I'))// && TMath::Abs(multhist->GetXaxis()->GetBinCenter(i)) < 2)
-             overlapSPD = kTRUE;
-         }
-         
-         if(det == 0) {
-           if(i<=pars->GetLastEtaBinToInclude(vtxbin,3,'O') || i>=pars->GetFirstEtaBinToInclude(vtxbin,2,'O'))
-             overlapSPD = kTRUE;
-         }
-         //std::cout<<overlapFMD<<"    "<<overlapSPD<<std::endl;
-         
-         
-         if(det > 0) {
-           if(overlapFMD) {
-             dNdetadphiHistogram->SetBinContent(i,j,dNdetadphiHistogram->GetBinContent(i,j)+0.5*multhist->GetBinContent(i,j));
-             dNdetadphiHistogram->SetBinError(i,j,TMath::Sqrt(TMath::Power(dNdetadphiHistogram->GetBinError(i,j),2)+TMath::Power(0.5*multhist->GetBinError(i,j),2)));
-           }
-           else {
-             dNdetadphiHistogram->SetBinContent(i,j,multhist->GetBinContent(i,j));
-             dNdetadphiHistogram->SetBinError(i,j,multhist->GetBinError(i,j));
-           }
-         }
-         
-         if( overlapFMD && overlapSPD) {
-           dNdetadphiHistogramSPD->SetBinContent(i,j,dNdetadphiHistogramSPD->GetBinContent(i,j)+0.33*multhist->GetBinContent(i,j));
-           dNdetadphiHistogramSPD->SetBinError(i,j,TMath::Sqrt(TMath::Power(dNdetadphiHistogramSPD->GetBinError(i,j),2)+TMath::Power(0.33*multhist->GetBinError(i,j),2)));
-         }
-         else if( overlapFMD || overlapSPD) {
-           dNdetadphiHistogramSPD->SetBinContent(i,j,dNdetadphiHistogramSPD->GetBinContent(i,j)+0.5*multhist->GetBinContent(i,j));
-           dNdetadphiHistogramSPD->SetBinError(i,j,TMath::Sqrt(TMath::Power(dNdetadphiHistogramSPD->GetBinError(i,j),2)+TMath::Power(0.5*multhist->GetBinError(i,j),2)));
-         }
-         else {
-           dNdetadphiHistogramSPD->SetBinContent(i,j,multhist->GetBinContent(i,j));
-           dNdetadphiHistogramSPD->SetBinError(i,j,multhist->GetBinError(i,j));
-         }
-         
-         
-         
-
-       
-       }
-      }
-      delete multhist;
-    }
-  }
-}
-//_____________________________________________________________________
-//
-//
-// EOF
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskBackgroundCorrection.h b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskBackgroundCorrection.h
deleted file mode 100644 (file)
index e161dfa..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef ALIFMDANALYSISTASKBACKGROUNDCORRECTION_H
-#define ALIFMDANALYSISTASKBACKGROUNDCORRECTION_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-#include "AliAnalysisTask.h"
-
-#include "TObjArray.h"
-#include "TObjString.h"
-#include "TArrayI.h"
-#include "TH1I.h"
-
-/**
- * @ingroup FMD_ana
- * @brief Applu the background correction
- * particles. 
- * 
- */
-class AliFMDAnalysisTaskBackgroundCorrection : public AliAnalysisTask
-{
- public:
-    AliFMDAnalysisTaskBackgroundCorrection();
-    AliFMDAnalysisTaskBackgroundCorrection(const char* name, Bool_t SE = kTRUE);
-    virtual ~AliFMDAnalysisTaskBackgroundCorrection() {;}
- AliFMDAnalysisTaskBackgroundCorrection(const AliFMDAnalysisTaskBackgroundCorrection& o) : AliAnalysisTask(),
-      fDebug(o.fDebug),
-      fOutputList(0),
-      fInputList(0),
-      fHitList(0),
-      fVertexString(o.fVertexString),
-      fNevents(o.fNevents),
-      fStandalone(o.fStandalone), 
-      fOutputVertexString(o.fOutputVertexString) {}
-    AliFMDAnalysisTaskBackgroundCorrection& operator=(const AliFMDAnalysisTaskBackgroundCorrection&) { return *this; }
-    // Implementation of interface methods
-    virtual void ConnectInputData(Option_t *option = "");
-    virtual void CreateOutputObjects();
-    virtual void Init() {}
-    virtual void LocalInit() {Init();}
-    virtual void Exec(Option_t *option);
-    virtual void Terminate(Option_t *option);
-    virtual void SetDebugLevel(Int_t level) {fDebug = level;}
-  void SetInputList(TList* inputList) {fInputList = inputList;}
-  void SetOutputVertex(TObjString* vtxString) {fOutputVertexString = vtxString;}
-  //void SetInputVtx(TObjString* vtxString) {fVertexString = vtxString;}
-  void SetOutputList(TList* outputList) {fOutputList = outputList;}
-  void SetHitList(TList* hitList) {fHitList = hitList;}
-  void         CreatePerEventHistogram(Int_t vtxbin);
- private:
-    Int_t         fDebug;        //  Debug flag
-    TList*        fOutputList;
-    TList*        fInputList;
-    TList*        fHitList;
-    TObjString*   fVertexString;
-    TH1I          fNevents;
-    Bool_t        fStandalone;
-    TObjString*   fOutputVertexString;
-    ClassDef(AliFMDAnalysisTaskBackgroundCorrection, 0); // Analysis task for FMD analysis
-};
-#endif
-// Local Variables:
-//   mode: C++
-// End:
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskCollector.cxx b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskCollector.cxx
deleted file mode 100644 (file)
index 296c06a..0000000
+++ /dev/null
@@ -1,398 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id:$ */
-
-///////////////////////////////////////////////////////////////////////////////
-//                                                                           //
-//  Here some comments on what this task does                                //
-#include <TChain.h>
-#include <TF1.h>
-#include <TFile.h>
-#include <TInterpreter.h>
-#include <TList.h>
-#include <TMath.h>
-#include <TROOT.h>
-#include <TSystem.h>
-#include <iostream>
-
-#include "AliFMDAnalysisTaskCollector.h"
-#include "AliAnalysisManager.h"
-#include "AliESDFMD.h"
-#include "AliESDEvent.h"
-#include "AliAODEvent.h"
-#include "AliAODHandler.h"
-#include "AliMCEventHandler.h"
-#include "AliStack.h"
-#include "AliMultiplicity.h"
-#include "AliESDVertex.h"
-#include "AliFMDAnaParameters.h"
-#include "AliFMDAnaCalibBackgroundCorrection.h"
-#include "AliFMDAnaCalibEnergyDistribution.h"
-#include "AliFMDAnaCalibEventSelectionEfficiency.h"
-#include "AliFMDAnaCalibSharingEfficiency.h"
-
-//#include "AliFMDGeometry.h"
-
-
-ClassImp(AliFMDAnalysisTaskCollector)
-
-//____________________________________________________________________
-Double_t  AliFMDAnalysisTaskCollector::TripleLandau(const Double_t *x, Double_t *par) {
-  //A convolution of three landaus to fit three MIP peaks
-
-  Double_t energy        = x[0];
-  Double_t constant = par[0];
-  Double_t mpv      = par[1];
-  Double_t sigma    = par[2];
-  Double_t alpha    = par[3];
-  Double_t beta     = par[4];
-  Double_t f = constant*(TMath::Landau(energy,mpv,sigma,kTRUE)+
-                        alpha*TMath::Landau(energy,2*mpv+2*sigma*TMath::Log(2),2*sigma,kTRUE)+
-                        beta*TMath::Landau(energy,3*mpv+3*sigma*TMath::Log(3),3*sigma,kTRUE) );
-  
-  return f;
-}
-//____________________________________________________________________
-
-AliFMDAnalysisTaskCollector::AliFMDAnalysisTaskCollector()
-  : //fDebug(0),
-  fOutputList(0),
-  fArray(0),
-  fZvtxDist(0),
-  fEvents(0),
-  fEmptyEvents(0),
-  fClusters(0),
-  fClustersEmpty(0),
-  fFirstEvent(kTRUE),
-  fParam(0)
-{
-  // Default constructor
-  
-}
-//____________________________________________________________________
-AliFMDAnalysisTaskCollector::AliFMDAnalysisTaskCollector(const char* name):
-    AliAnalysisTaskSE(name),
-    //fDebug(0),
-    fOutputList(0),
-    fArray(0),
-    fZvtxDist(0),
-    fEvents(0),
-    fEmptyEvents(0),
-    fClusters(0),
-    fClustersEmpty(0),
-    fFirstEvent(kTRUE),
-    fParam(0)
-{
-  // Default constructor
-  
-  DefineOutput(1, TList::Class());
-  fParam = AliFMDAnaParameters::Instance();
-}
-//____________________________________________________________________
-void AliFMDAnalysisTaskCollector::UserCreateOutputObjects()
-{
-  // Create the output container
-  printf("AnalysisTaskFMD::CreateOutPutData() \n");
-  fFirstEvent = kTRUE;
-  fOutputList = new TList();//(TList*)GetOutputData(0);
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-
-  fArray     = new TObjArray();
-  fArray->SetName("FMD");
-  fArray->SetOwner();
-  TH1F* hEdist = 0;
-  TH1F* hEmptyEdist = 0;
-  TH1F* hRingEdist = 0;
-  for(Int_t nEta = 0; nEta < pars->GetNetaBins(); nEta++) {
-    TObjArray* etaArray = new TObjArray();
-    fArray->AddAtAndExpand(etaArray,nEta);
-    for(Int_t det =1; det<=3;det++)
-      {
-       TObjArray* detArray = new TObjArray();
-       detArray->SetName(Form("FMD%d",det));
-       etaArray->AddAtAndExpand(detArray,det);
-       Int_t nRings = (det==1 ? 1 : 2);
-       for(Int_t ring = 0;ring<nRings;ring++)
-         {
-           Char_t ringChar = (ring == 0 ? 'I' : 'O');
-           hEdist = new TH1F(Form("FMD%d%c_etabin%d",det,ringChar,nEta),Form("FMD%d%c_etabin%d",det,ringChar,nEta),200,0,6);
-           hEdist->SetXTitle("#Delta E / E_{MIP}");
-           fOutputList->Add(hEdist);
-           detArray->AddAtAndExpand(hEdist,ring);
-           
-         } 
-      }
-    
-  }
-  
-  for(Int_t det =1; det<=3;det++)
-    {
-      Int_t nRings = (det==1 ? 1 : 2);
-      for(Int_t ring = 0;ring<nRings;ring++)
-       {
-         Char_t ringChar = (ring == 0 ? 'I' : 'O');
-         hRingEdist = new TH1F(Form("ringFMD%d%c",det,ringChar),Form("ringFMD%d%c",det,ringChar),200,0,6);
-         hRingEdist->SetXTitle("#Delta E / E_{MIP}");
-         fOutputList->Add(hRingEdist);
-         hEmptyEdist = new TH1F(Form("emptyFMD%d%c",det,ringChar),Form("emptyFMD%d%c",det,ringChar),200,0,6);
-         hEmptyEdist->SetXTitle("#Delta E / E_{MIP}");
-         fOutputList->Add(hEmptyEdist);
-         
-       }
-    }
-  fZvtxDist  = new TH1F("ZvtxDist","Vertex distribution",100,-30,30);
-  fZvtxDist->SetXTitle("z vertex");
-  fOutputList->Add(fZvtxDist);
-}
-
-//____________________________________________________________________
-void AliFMDAnalysisTaskCollector::UserExec(Option_t */*option*/)
-{
-  //Collect data for fitting
-  AliESDEvent* esd = (AliESDEvent*)InputEvent();
-  AliESD* old = esd->GetAliESDOld();
-  if (old) {
-    esd->CopyFromOldESD();
-  }
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  pars->SetTriggerStatus(esd);
-  if (fFirstEvent) { 
-    pars->SetParametersFromESD(esd);
-    pars->PrintStatus();
-    fFirstEvent = kFALSE;
-  }
-
-  TString triggers = esd->GetFiredTriggerClasses();
-  //if(!triggers.IsNull()) return;
-  //Bool_t trigger = pars->IsEventTriggered(esd);
-  
-  Bool_t physics = pars->IsEventTriggered(AliFMDAnaParameters::kMB1);
-  Bool_t empty   = pars->IsEventTriggered(AliFMDAnaParameters::kEMPTY);
-  //std::cout<<physics<<"   "<<empty<<std::endl;
-  //if(!trigger)
-  //  physics = kFALSE;
-  Double_t vertex[3] ={0,0,0};
-  
-  Bool_t vtxStatus =   pars->GetVertex(esd,vertex);
-  
-  if(!vtxStatus)
-    physics = kFALSE;
-  
-  if(physics) {
-    fZvtxDist->Fill(vertex[2]);
-    if(TMath::Abs(vertex[2]) > pars->GetVtxCutZ())
-      physics = kFALSE;
-  }
-  //std::cout<<"Bananer "<<vtxStatus<<"    "<<physics<<std::endl;
-  AliESDFMD* fmd = esd->GetFMDData();
-  if (!fmd) return;
-  if(physics)
-    fEvents++;
-  else if(empty)
-    fEmptyEvents++;
-  
-  if(!physics && !empty)
-    return;
-  
-  const AliMultiplicity* spdMult = esd->GetMultiplicity();
-  if(physics)
-    fClusters+= (spdMult->GetNumberOfSingleClusters() + spdMult->GetNumberOfTracklets());
-  
-  if(empty)
-    fClustersEmpty+= (spdMult->GetNumberOfSingleClusters() + spdMult->GetNumberOfTracklets());
-  
-  if(empty)
-    std::cout<<spdMult->GetNumberOfSingleClusters()<<"  "<<spdMult->GetNumberOfTracklets()<<std::endl;
-  
-  TH1F* edist = 0;
-  TH1F* emptyEdist = 0;
-  TH1F* ringEdist = 0;
-  for(UShort_t det=1;det<=3;det++) {
-    
-    Int_t nRings = (det==1 ? 1 : 2);
-    for (UShort_t ir = 0; ir < nRings; ir++) {
-      Char_t   ring = (ir == 0 ? 'I' : 'O');
-      emptyEdist = (TH1F*)fOutputList->FindObject(Form("emptyFMD%d%c",det,ring));
-      ringEdist = (TH1F*)fOutputList->FindObject(Form("ringFMD%d%c",det,ring));
-      UShort_t nsec = (ir == 0 ? 20  : 40);
-      UShort_t nstr = (ir == 0 ? 512 : 256);
-      
-      for(UShort_t sec =0; sec < nsec;  sec++)  {
-       for(UShort_t strip = 0; strip < nstr; strip++) {
-         
-         
-         Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
-         if(mult == AliESDFMD::kInvalidMult || mult == 0) continue;
-         
-         Float_t eta = pars->GetEtaFromStrip(det,ring,sec,strip,vertex[2]);
-         
-         Int_t nEta  = pars->GetEtaBin(eta);
-         
-         //      std::cout<<det<<"  "<<ring<<"   "<<sec<<"    "<<strip<<"   "<<vertex[2]<<"   "<<eta<<"   "<<nEta<<std::endl;
-         if(physics) {
-           edist = (TH1F*)fOutputList->FindObject(Form("FMD%d%c_etabin%d",det,ring,nEta));       
-           edist->Fill(mult);
-           ringEdist->Fill(mult);
-         }
-         else if(empty) {
-           emptyEdist->Fill(mult);
-           
-         }
-         else {
-           AliWarning("Something is wrong - wrong trigger");
-           continue;
-         }
-        
-         
-       }
-      }
-    }
-    
-    PostData(1, fOutputList); 
-    
-  }
-}
-//____________________________________________________________________
-  
-void AliFMDAnalysisTaskCollector::Terminate(Option_t */*option*/) {
-  //Terminate
-  
-  std::cout<<"Analysed "<<fEvents<<" events and "<<fEmptyEvents<<" empty"<<std::endl;
-  std::cout<<fClusters / fEvents << " clusters per physics event and "<<fClustersEmpty / fEmptyEvents<< " clusters per empty event"<<std::endl;
-
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-    
-    for(Int_t det = 1; det<=3; det++) {
-      Int_t nRings  =  (det == 1 ? 1 : 2);
-      for(Int_t ring = 0;ring<nRings; ring++) {
-       
-       Char_t ringChar = (ring == 0 ? 'I' : 'O');
-       TH1F* hRingEdist = (TH1F*)fOutputList->FindObject(Form("ringFMD%d%c",det,ringChar));
-       TH1F* hEmptyEdist = (TH1F*)fOutputList->FindObject(Form("emptyFMD%d%c",det,ringChar));
-       if(fEmptyEvents)
-         hEmptyEdist->Scale(1./(Float_t)fEmptyEvents);
-       
-       if(fEvents)
-         hRingEdist->Scale(1./(Float_t)fEvents);
-       for(Int_t nEta = 0; nEta < pars->GetNetaBins(); nEta++) {
-         TH1F* hEdist = (TH1F*)fOutputList->FindObject(Form("FMD%d%c_etabin%d",det,ringChar,nEta));
-         if(fEvents)
-           hEdist->Scale(1./(Float_t)fEvents);
-         
-       
-      }
-    }
-  }
-  
-}
-//____________________________________________________________________
-void AliFMDAnalysisTaskCollector::ReadFromFile(const Char_t* filename, Bool_t store, Int_t speciesOption)  {
-
-  //speciesOption:
-  //0: p+p Landau fit
-  //1: Pb+Pb triple landau convolution fit
-  
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  //pars->Init(kTRUE,AliFMDAnaParameters::kBackgroundCorrection);
-  
-  TFile fin(filename,"UPDATE");
-  
-  TList* list = (TList*)fin.Get("energyDist");
-  
-  AliFMDAnaCalibEnergyDistribution* energyDist = new AliFMDAnaCalibEnergyDistribution();
-  
-  energyDist->SetNetaBins(pars->GetNetaBins());
-  energyDist->SetEtaLimits(pars->GetEtaMin(),pars->GetEtaMax());
-  
-  TF1* fitFunc = 0;
-  
-  for(Int_t det = 1; det<=3; det++) {
-    Int_t nRings  =  (det == 1 ? 1 : 2);
-    for(Int_t ring = 0;ring<nRings; ring++) {
-      Char_t ringChar = (ring == 0 ? 'I' : 'O');
-      TH1F* hEmptyEdist = (TH1F*)list->FindObject(Form("emptyFMD%d%c",det,ringChar));
-      TH1F* hRingEdist = (TH1F*)list->FindObject(Form("ringFMD%d%c",det,ringChar));
-      fitFunc = FitEnergyDistribution(hEmptyEdist, speciesOption) ;
-      if(fitFunc)
-       fitFunc->Write(Form("emptyFMD%d%c_fitfunc",det,ringChar),TObject::kWriteDelete);
-      fitFunc = FitEnergyDistribution(hRingEdist, speciesOption) ;
-      if(fitFunc)
-       fitFunc->Write(Form("FMD%d%c_fitfunc",det,ringChar),TObject::kWriteDelete);
-      
-      
-      energyDist->SetEmptyEnergyDistribution(det,ringChar,hEmptyEdist);
-      energyDist->SetRingEnergyDistribution(det,ringChar,hRingEdist);
-      for(Int_t nEta = 0; nEta < pars->GetNetaBins(); nEta++) {
-       TH1F* hEdist = (TH1F*)list->FindObject(Form("FMD%d%c_etabin%d",det,ringChar,nEta));
-       
-       fitFunc = FitEnergyDistribution(hEdist, speciesOption) ;
-       if(fitFunc)
-         fitFunc->Write(Form("FMD%d%c_etabin%d_fitfunc",det,ringChar,nEta),TObject::kWriteDelete);
-       energyDist->SetEnergyDistribution(det,ringChar,nEta,hEdist);
-       
-      }
-      
-    }
-    
-  }
-  
-  fin.Write();
-  fin.Close();
-  
-  if(store) {
-    TFile fcalib(pars->GetPath(pars->GetEdistID() ),"RECREATE");
-    energyDist->Write(AliFMDAnaParameters::GetEdistID());
-    fcalib.Close();
-  }
-
-
-
-}
-//____________________________________________________________________
-TF1* AliFMDAnalysisTaskCollector::FitEnergyDistribution(TH1F* hEnergy, Int_t /*speciesOption*/) {
-  //Fit energy distribution
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  TF1* fitFunc = 0;
-  if(hEnergy->GetEntries() != 0) {
-         
-    hEnergy->GetXaxis()->SetRangeUser(0.2,hEnergy->GetXaxis()->GetXmax());
-    
-    if(pars->GetCollisionSystem() == 0)
-      fitFunc =  new TF1("FMDfitFunc","landau",hEnergy->GetBinCenter(hEnergy->GetMaximumBin())-0.2,3);
-    if(pars->GetCollisionSystem() == 1) {
-      fitFunc = new TF1("FMDfitFunc",TripleLandau,hEnergy->GetBinCenter(hEnergy->GetMaximumBin())-0.2,5,5);
-      fitFunc->SetParNames("constant","MPV","sigma","2-Mip weight","3-Mip weight");
-      fitFunc->SetParameters(10,0.8,0.1,0.05,0.01);
-      fitFunc->SetParLimits(1,0.6,1.2);
-      fitFunc->SetParLimits(3,0,1);
-      fitFunc->SetParLimits(4,0,1);
-      
-    }
-    hEnergy->Fit(fitFunc,"","",hEnergy->GetBinCenter(hEnergy->GetMaximumBin())-0.2,3);
-    
-  }
-  return fitFunc;
-  
-}
-//____________________________________________________________________
-//
-// EOF
-//
-// EOF
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskCollector.h b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskCollector.h
deleted file mode 100644 (file)
index 4d1d8ce..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#ifndef ALIFMDANALYSISTASKCOLLECTOR_H
-#define ALIFMDANALYSISTASKCOLLECTOR_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-#include "AliAnalysisTaskSE.h"
-#include "TH1F.h"
-#include "TObjArray.h"
-
-class AliESDEvent;
-class TChain;
-class AliAODEvent;
-class AliFMDAnaParameters;
-//
-//Class to fit energy distributions in the FMD
-//
-class AliFMDAnalysisTaskCollector : public AliAnalysisTaskSE
-{
- public:
-  AliFMDAnalysisTaskCollector();
-  AliFMDAnalysisTaskCollector(const char* name);
-  AliFMDAnalysisTaskCollector(const AliFMDAnalysisTaskCollector& o) : 
-    AliAnalysisTaskSE(),
-    //    fDebug(o.fDebug),
-    fOutputList(o.fOutputList),
-    fArray(o.fArray),
-    fZvtxDist(o.fZvtxDist),
-    fEvents(0),
-    fEmptyEvents(0),
-    fClusters(0),
-    fClustersEmpty(0),
-    fFirstEvent(kTRUE), 
-    fParam(0)
-  {}
-  
-  AliFMDAnalysisTaskCollector& operator=(const AliFMDAnalysisTaskCollector&) { return *this; }
-  virtual ~AliFMDAnalysisTaskCollector() {;}
-  // Implementation of interface methods
-  
-  virtual void UserCreateOutputObjects();
-  virtual void UserExec(Option_t *option);
-  virtual void SetDebugLevel(Int_t level) {fDebug = level;}
-  virtual void Terminate(Option_t */*option*/);
-  void ReadFromFile(const Char_t* filename, Bool_t store=kFALSE, Int_t speciesOption = 0);
-  static Double_t  TripleLandau(const Double_t *x, Double_t *par);
-  TF1* FitEnergyDistribution(TH1F* hEnergy, Int_t speciesOption);
-
-private:
-  void          GetVertex(Double_t* vertexXYZ); 
-  //Int_t         fDebug;        //  Debug flag
-  TList*        fOutputList;     //Output list
-  TObjArray*    fArray;          //Array for storage
-  TH1F*         fZvtxDist;       //Dist of z vertex
-  Int_t         fEvents;         //Number of events
-  Int_t         fEmptyEvents;    //Number of events with empty trigger
-  Float_t       fClusters;       //Number of clusters
-  Float_t       fClustersEmpty;  //Number of clusters in empty events
-  Bool_t        fFirstEvent;     //Have we had events yet ?
-  AliFMDAnaParameters* fParam;   //The parameters class for IO
-
-  ClassDef(AliFMDAnalysisTaskCollector, 1); // Analysis task for FMD analysis
-};
-#endif
-// Local Variables:
-//   mode: C++ 
-// End:
-// EOF
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskDensity.cxx b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskDensity.cxx
deleted file mode 100644 (file)
index 61867d7..0000000
+++ /dev/null
@@ -1,315 +0,0 @@
-#include <TROOT.h>
-#include <TSystem.h>
-#include <TInterpreter.h>
-#include <TChain.h>
-#include <TFile.h>
-#include <TList.h>
-#include <iostream>
-#include "TAxis.h"
-#include "TH2F.h"
-#include "TF1.h"
-#include "AliFMDAnalysisTaskDensity.h"
-#include "AliAnalysisManager.h"
-#include "AliESDFMD.h"
-#include "AliESDEvent.h"
-#include "AliAODEvent.h"
-#include "AliAODHandler.h"
-#include "AliMCEventHandler.h"
-#include "AliStack.h"
-#include "AliFMDAnaCalibEnergyDistribution.h"
-#include "AliESDVertex.h"
-#include "TMath.h"
-#include "AliFMDAnaParameters.h"
-//#include "AliFMDParameters.h"
-//#include "AliFMDGeometry.h"
-//#include "AliFMDRing.h"
-
-ClassImp(AliFMDAnalysisTaskDensity)
-
-//_____________________________________________________________________
-AliFMDAnalysisTaskDensity::AliFMDAnalysisTaskDensity()
-: fDebug(0),
-  fOutputList(),
-  fESD(0x0),
-  fVertexString(),
-  fVertex(0),
-  fStandalone(kTRUE),
-  fStatus(kTRUE)
-{
-  // Default constructor
-  DefineInput (0, AliESDFMD::Class());
-  DefineInput (1, AliESDVertex::Class());
-  DefineOutput(0,TList::Class());
-}
-//_____________________________________________________________________
-AliFMDAnalysisTaskDensity::AliFMDAnalysisTaskDensity(const char* name, Bool_t SE):
-    AliAnalysisTask(name, "Density"),
-    fDebug(0),
-    fOutputList(0),
-    fESD(0x0),
-    fVertexString(),
-    fVertex(0),
-    fStandalone(kTRUE),
-    fStatus(kTRUE)
-{
-  fStandalone = SE;
-  if(fStandalone) {
-    DefineInput (0, AliESDFMD::Class());
-    DefineInput (1, AliESDVertex::Class());
-    DefineOutput(0, TList::Class());
-  }
-  
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskDensity::CreateOutputObjects()
-{
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  
-  
-  
-  if(!fOutputList)
-    fOutputList = new TList();
-  fOutputList->SetName("density_list");
-  
-  fOutputList->Add(&fVertexString);
-  
-  
-  
-  TH2F* hMult = 0;
-  
-  Int_t nVtxbins = pars->GetNvtxBins();
-  
-
-  for(Int_t det =1; det<=3;det++)
-    {
-      Int_t nRings = (det==1 ? 1 : 2);
-      for(Int_t ring = 0;ring<nRings;ring++)
-       {
-         Char_t ringChar = (ring == 0 ? 'I' : 'O');
-         Int_t  nSec     = (ring == 0 ? 20 : 40);
-         
-         for(Int_t i = 0; i< nVtxbins; i++) {
-           TH2F* hBg = pars->GetBackgroundCorrection(det, ringChar, i);
-           
-           hMult  = new TH2F(Form("FMD%d%c_vtxbin%d",det,ringChar,i),Form("FMD%d%c_vtxbin%d",det,ringChar,i),
-                             hBg->GetNbinsX(),
-                             hBg->GetXaxis()->GetXmin(),
-                             hBg->GetXaxis()->GetXmax(),
-                             nSec, 0, 2*TMath::Pi());
-           hMult->Sumw2();
-           
-           fOutputList->Add(hMult);
-         }
-       } 
-    }
-  
-  
-  
-  
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskDensity::ConnectInputData(Option_t */*option*/)
-{
-  if(fStandalone) {
-    fESD    = (AliESDFMD*)GetInputData(0);
-    fVertex = (AliESDVertex*)GetInputData(1);
-  }
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskDensity::Init() {
-  //TFile f("/home/canute/ALICE/FMDanalysis/FirstAnalysis/energydistributions_0_0_1_0_0_0.root");
-  //fEnergyDistribution = dynamic_cast<AliFMDAnaCalibEnergyDistribution*>(f.Get("energydistributions"));
-
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskDensity::Exec(Option_t */*option*/)
-{
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  // AliFMDGeometry* geo       = AliFMDGeometry::Instance();
-  
-  //AliESDFMD*   fmd = fESD->GetFMDData();
-  
-  
-  Double_t vertex[3];
-  fVertex->GetXYZ(vertex);
-  // Z Vtx cut
-  
-  if( TMath::Abs(vertex[2]) > pars->GetVtxCutZ()) {
-    fStatus = kFALSE;
-    return;
-  }
-  else
-    fStatus = kTRUE;
-  
-  Double_t delta = 2*pars->GetVtxCutZ()/pars->GetNvtxBins();
-  Double_t vertexBinDouble = (vertex[2] + pars->GetVtxCutZ()) / delta;
-  
-  Int_t vtxbin = (Int_t)vertexBinDouble;
-  
-  fVertexString.SetString(Form("%d",vtxbin));
-  //Reset everything
-  for(UShort_t det=1;det<=3;det++) {
-    Int_t nRings = (det==1 ? 1 : 2);
-    for (UShort_t ir = 0; ir < nRings; ir++) {
-      Char_t   ring = (ir == 0 ? 'I' : 'O');
-      TH2F* hMult   = (TH2F*)fOutputList->FindObject(Form("FMD%d%c_vtxbin%d",det,ring,vtxbin));
-      hMult->Reset();
-    }
-    
-  }
-  
-  
-  for(UShort_t det=1;det<=3;det++) {
-    Int_t nRings = (det==1 ? 1 : 2);
-    for (UShort_t ir = 0; ir < nRings; ir++) {
-      
-      Char_t   ring = (ir == 0 ? 'I' : 'O');
-      TH2F* hMult   = (TH2F*)fOutputList->FindObject(Form("FMD%d%c_vtxbin%d",det,ring,vtxbin));
-     
-      UShort_t nsec = (ir == 0 ? 20  : 40);
-      UShort_t nstr = (ir == 0 ? 512 : 256);
-      /*
-     TH1F* hEnergyDist       = pars->GetEmptyEnergyDistribution(det,ring);
-      TF1*  fitFunc           = hEnergyDist->GetFunction("FMDfitFunc");
-      TH1F* hSignalDist    = pars->GetRingEnergyDistribution(det, ring);
-      TF1*  fitFuncSignal  = hSignalDist->GetFunction("FMDfitFunc");
-      */
-      for(UShort_t sec =0; sec < nsec;  sec++)  {
-       for(UShort_t strip = 0; strip < nstr; strip++) {
-         Float_t mult = fESD->Multiplicity(det,ring,sec,strip);
-                 
-         if(mult == 0 || mult == AliESDFMD::kInvalidMult) continue;
-                         
-         Float_t phi = pars->GetPhiFromSector(det,ring,sec);
-         Float_t eta = pars->GetEtaFromStrip(det,ring,sec,strip,vertex[2]);
-         
-         Float_t mult_cut = 0.3;//pars->GetMPV(det,ring,eta);// - pars->GetSigma(det,ring,eta);//0.25;//0.15;//m-2*s;//0.15;//0.2;//m-3*s;// 0.2;//0.01;//m-2*s;//0.2;
-         // if(ring == 'I')
-         //  mult_cut = 0.10;
-         //Float_t mult_cut = pars->GetMPV(det,ring,eta) - 5*pars->GetSigma(det,ring,eta);
-         Float_t nParticles = 0;
-         if(fESD->GetUniqueID() == kTRUE) {
-           //proton + proton
-           
-           if(mult > mult_cut) {
-             nParticles = 1.;
-           }
-         }
-         else {
-           
-           //Pb+Pb
-           Float_t mpv   = pars->GetMPV(det,ring,eta);
-           Float_t sigma = pars->GetSigma(det,ring,eta);
-           Float_t alpha = pars->Get2MIPWeight(det,ring,eta);
-           Float_t beta  = pars->Get3MIPWeight(det,ring,eta);
-           
-           Float_t sumCor = TMath::Landau(mult,mpv,sigma,kTRUE)+
-             alpha*TMath::Landau(mult,2*mpv+2*sigma*TMath::Log(2),2*sigma,kTRUE)+
-             beta*TMath::Landau(mult,3*mpv+3*sigma*TMath::Log(3),3*sigma,kTRUE);
-           Float_t weight = TMath::Landau(mult,mpv,sigma,kTRUE)+
-             2*alpha*TMath::Landau(mult,2*mpv+2*sigma*TMath::Log(2),2*sigma,kTRUE)+
-             3*beta*TMath::Landau(mult,3*mpv+3*sigma*TMath::Log(3),3*sigma,kTRUE);
-           
-           
-           if(mult > mult_cut) {
-             if(sumCor) nParticles = weight / sumCor;
-             else nParticles = 1;
-             
-           }
-           //std::cout<<sumCor<<"    "<<weight<<"    "<<"    "<<mult<<"  "<<nParticles<<std::endl;
-           
-         }
-         
-         
-         
-         
-         
-         Float_t correction = GetAcceptanceCorrection(ring,strip);
-         
-         //std::cout<<"before "<<correction<<std::endl;
-         if(fESD->GetUniqueID() == kTRUE) {
-           TH1F* hDoubleHitCorrection = pars->GetDoubleHitCorrection(det,ring);
-           
-           if(hDoubleHitCorrection->GetBinContent(hDoubleHitCorrection->FindBin(eta)) != 0)
-             correction = correction*hDoubleHitCorrection->GetBinContent(hDoubleHitCorrection->FindBin(eta));
-           
-         }
-         
-         //Dead channel correction:
-         TH1F* hFMDDeadCorrection = pars->GetFMDDeadCorrection(vtxbin);
-         if(hFMDDeadCorrection)
-           if(hFMDDeadCorrection->GetBinContent(hFMDDeadCorrection->FindBin(eta)) != 0)
-             correction = correction*hFMDDeadCorrection->GetBinContent(hFMDDeadCorrection->FindBin(eta));
-         
-         
-         //std::cout<<det<<"   "<<ring<<"    "<<sec<<"    "<<strip<<"    "<<vertex[2]<<"   "<<eta<<std::endl;
-         
-         //Float_t signal = hSignalDist->Integral(hSignalDist->FindBin(0.5),hSignalDist->FindBin(2)) ;//pars->GetConstant(det,ring,eta);
-         //Float_t bkg =  hEnergyDist->GetBinContent(hEnergyDist->FindBin(mult));
-         //Float_t signal =  hSignalDist->GetBinContent(hSignalDist->FindBin(mult));
-         /*
-         if(fitFunc && fitFuncSignal && pars->IsRealData()) {
-           Float_t bkg = fitFunc->Eval(mult);
-           Float_t signal = fitFuncSignal->Eval(mult);
-           
-           if(signal > 0) {
-             correction = correction/(1-(bkg/signal));
-             //test
-             // if(TMath::Abs(eta)<3) correction = 1.15*correction;
-             // if(det == 2 && ring == 'I') correction = correction/(1-bkg/signal);
-             //if(det == 2 && ring == 'O') correction = correction/(1-bkg/signal);
-             //if(det == 3 && ring == 'I') correction = correction/(1-bkg/signal);
-             //if(det == 3 && ring == 'O') correction = correction/(1-bkg/signal);
-             
-           }
-           }*/
-         if(correction) nParticles = nParticles / correction;
-         if(nParticles > 0)
-           hMult->Fill(eta,phi,nParticles);
-         
-         
-       }
-      }
-      
-    }
-    
-       
-  
-  }
-  
-  
-
-  if(fStandalone) {
-    PostData(0, fOutputList); 
-  }
-  
-}
-//_____________________________________________________________________
-Float_t AliFMDAnalysisTaskDensity::GetAcceptanceCorrection(Char_t ring, UShort_t strip)
-{
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  
-  //AliFMDRing fmdring(ring);
-  //fmdring.Init();
-  Float_t   rad       = pars->GetMaxR(ring)-pars->GetMinR(ring);
-  Float_t   nstrips   = (ring == 'I' ? 512 : 256);
-  Float_t   segment   = rad / nstrips;
-  Float_t   radius    = pars->GetMinR(ring) + segment*strip;
-  
-  Float_t   basearea1 = 0.5*pars->GetBaseStripLength(ring,strip)*TMath::Power(radius,2);
-  Float_t   basearea2 = 0.5*pars->GetBaseStripLength(ring,strip)*TMath::Power((radius-segment),2);
-  Float_t   basearea  = basearea1 - basearea2;
-  
-  Float_t   area1     = 0.5*pars->GetStripLength(ring,strip)*TMath::Power(radius,2);
-  Float_t   area2     = 0.5*pars->GetStripLength(ring,strip)*TMath::Power((radius-segment),2);
-  Float_t   area      = area1 - area2;
-  
-  Float_t correction = area/basearea;
-  
-  return correction;
-}
-//_____________________________________________________________________
-//
-//EOF
-//
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskDensity.h b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskDensity.h
deleted file mode 100644 (file)
index a8e97f6..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef ALIFMDANALYSISTASKDENSITY_H
-#define ALIFMDANALYSISTASKDENSITY_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-#include "AliAnalysisTask.h"
-
-#include "TObjArray.h"
-#include "AliESDFMD.h"
-#include "AliESDVertex.h"
-#include "TObjString.h"
-#include "TTree.h"
-
-class AliESDEvent;
-class TChain;
-class AliAODEvent;
-class TF1;
-class AliFMDAnaCalibEnergyDistribution;
-
-/**
- * @ingroup FMD_ana
- */
-class AliFMDAnalysisTaskDensity : public AliAnalysisTask
-{
- public:
-    AliFMDAnalysisTaskDensity();
-    AliFMDAnalysisTaskDensity(const char* name, Bool_t SE = kTRUE);
-    virtual ~AliFMDAnalysisTaskDensity() {;}
- AliFMDAnalysisTaskDensity(const AliFMDAnalysisTaskDensity& o) : AliAnalysisTask(),
-      fDebug(o.fDebug),
-      fOutputList(),
-      fESD(o.fESD),
-      fVertexString(o.fVertexString),
-      fVertex(o.fVertex),
-      fStandalone(o.fStandalone),
-      fStatus(o.fStatus) {}
-    AliFMDAnalysisTaskDensity& operator=(const AliFMDAnalysisTaskDensity&) { return *this; }
-    // Implementation of interface methods
-    virtual void ConnectInputData(Option_t *option);
-    virtual void CreateOutputObjects();
-  virtual void Init();
-    virtual void LocalInit() {Init();}
-    virtual void Exec(Option_t *option);
-    virtual void Terminate(Option_t */*option*/) {}
-    virtual void SetDebugLevel(Int_t level) {fDebug = level;}
-    
-    Float_t       GetAcceptanceCorrection(Char_t ring, UShort_t strip);
-    void SetOutputList(TList* outlist) {fOutputList = outlist;}
-    void SetInputESDFMD(AliESDFMD* esdfmd) {fESD = esdfmd;}
-    void SetInputVertex(AliESDVertex* vertex) {fVertex = vertex;}
-    Bool_t GetEventStatus() { return fStatus; }
-    Float_t GetPhiFromSector(UShort_t det, Char_t ring, UShort_t sec);
- private:
-    
-  Int_t         fDebug;        //  Debug flag
-  TList*        fOutputList;
-  AliESDFMD*    fESD;
-  TObjString    fVertexString;
-  AliESDVertex* fVertex;
-  Bool_t        fStandalone;
-  Bool_t        fStatus;
-  //AliFMDAnaCalibEnergyDistribution* fEnergyDistribution;
-    // TF1*          fFuncPos;
-    // TF1*          fFuncNeg;
-    
-  ClassDef(AliFMDAnalysisTaskDensity, 0); // Analysis task for FMD analysis
-};
-#endif
-// Local Variables:
-//   mode: C++ 
-// End:
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskDndeta.cxx b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskDndeta.cxx
deleted file mode 100644 (file)
index e9998a4..0000000
+++ /dev/null
@@ -1,498 +0,0 @@
-#include <TROOT.h>
-#include <TSystem.h>
-#include <TInterpreter.h>
-#include <TChain.h>
-#include <TFile.h>
-#include <TList.h>
-#include <iostream>
-#include "TH1F.h"
-#include "TH2F.h"
-#include "AliFMDAnalysisTaskDndeta.h"
-#include "AliAnalysisManager.h"
-#include "AliESDFMD.h"
-#include "AliESDEvent.h"
-#include "AliAODEvent.h"
-#include "AliAODHandler.h"
-#include "AliMCEventHandler.h"
-#include "AliStack.h"
-#include "AliLog.h"
-#include "AliESDVertex.h"
-#include "TMath.h"
-#include "AliFMDAnaParameters.h"
-//#include "AliFMDGeometry.h"
-#include "AliGenEventHeader.h"
-#include "AliGenPythiaEventHeader.h"
-#include "AliHeader.h"
-//#include "TDatabasePDG.h"
-//#include "TParticlePDG.h"
-#include "AliFMDStripIndex.h"
-#include "AliESDInputHandler.h"
-#include "AliGenDPMjetEventHeader.h"
-#include "AliLog.h"
-ClassImp(AliFMDAnalysisTaskDndeta)
-
-
-AliFMDAnalysisTaskDndeta::AliFMDAnalysisTaskDndeta()
-: fDebug(0),
-  fOutputList(0),
-  fInputList(0),
-  fVertexString(0x0),
-  fNevents(),
-  fNNSDevents(),
-  fNMCevents(),
-  fNMCNSDevents(),
-  fStandalone(kTRUE),
-  fLastTrackByStrip(0),
-  fVtxEff(1),
-  fVtxEffNSD(1)
-{
-  // Default constructor
-  DefineInput (0, TList::Class());
-  DefineOutput(0, TList::Class());
-}
-//_____________________________________________________________________
-AliFMDAnalysisTaskDndeta::AliFMDAnalysisTaskDndeta(const char* name, Bool_t SE):
-    AliAnalysisTask(name, "Density"),
-    fDebug(0),
-    fOutputList(0),
-    fInputList(0),
-    fVertexString(0x0),
-    fNevents(),
-    fNNSDevents(),
-    fNMCevents(),
-    fNMCNSDevents(),
-    fStandalone(kTRUE),
-    fLastTrackByStrip(0),
-    fVtxEff(1),
-    fVtxEffNSD(1)
-{
-  fStandalone = SE;
-  if(fStandalone) {
-    DefineInput (0, TList::Class());
-    DefineInput(1, TObjString::Class());
-    DefineOutput(0, TList::Class());
-    
-  }
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskDndeta::CreateOutputObjects()
-{
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  
-  if(!fOutputList)
-    fOutputList = new TList();
-  fOutputList->SetName("BackgroundCorrected");
-  
-  
-  TH2F* hMult = 0;
-  TH2F* hMultNSD = 0;
-  TH1F* hHits = 0;
-  TH2F* hMultTrVtx = 0;
-  TH1F* hPrimVertexBin = 0;
-  TH1F* hPrimVertexBinNSD = 0;
-  
-  TH2F* hBgTmp   = pars->GetBackgroundCorrection(1, 'I', 0);
-  TH1F* hPrimary = new TH1F("hMultvsEta","hMultvsEta",
-                           hBgTmp->GetNbinsX(),
-                           hBgTmp->GetXaxis()->GetXmin(),
-                           hBgTmp->GetXaxis()->GetXmax());
-  hPrimary->Sumw2();
-  fOutputList->Add(hPrimary);
-  TH1F* hPrimaryNSD = new TH1F("hMultvsEtaNSD","hMultvsEtaNSD",
-                           hBgTmp->GetNbinsX(),
-                           hBgTmp->GetXaxis()->GetXmin(),
-                           hBgTmp->GetXaxis()->GetXmax());
-  hPrimaryNSD->Sumw2();
-  fOutputList->Add(hPrimaryNSD);
-  Int_t nVtxbins = pars->GetNvtxBins();
-  TH2F* hBg = 0;
-  for(Int_t i = 0; i< nVtxbins; i++) {
-     
-    for(Int_t det =1; det<=3;det++)
-      {
-       Int_t nRings = (det==1 ? 1 : 2);
-       for(Int_t ring = 0;ring<nRings;ring++)
-         {
-           Char_t ringChar = (ring == 0 ? 'I' : 'O');
-           Int_t  nSec     = (ring == 0 ? 20 : 40);
-           
-           
-           
-           hBg = pars->GetBackgroundCorrection(det, ringChar, i);
-           hMult  = new TH2F(Form("dNdeta_FMD%d%c_vtxbin%d",det,ringChar,i),Form("dNdeta_FMD%d%c_vtxbin%d",det,ringChar,i),
-                             hBg->GetNbinsX(),
-                             hBg->GetXaxis()->GetXmin(),
-                             hBg->GetXaxis()->GetXmax(),
-                             nSec, 0, 2*TMath::Pi());
-           hMultTrVtx  = new TH2F(Form("dNdetaTrVtx_FMD%d%c_vtxbin%d",det,ringChar,i),Form("dNdetaTrVtx_FMD%d%c_vtxbin%d",det,ringChar,i),
-                                  hBg->GetNbinsX(),
-                                  hBg->GetXaxis()->GetXmin(),
-                                  hBg->GetXaxis()->GetXmax(),
-                                  nSec, 0, 2*TMath::Pi());
-           hMultNSD  = new TH2F(Form("dNdetaNSD_FMD%d%c_vtxbin%d",det,ringChar,i),Form("dNdetaNSD_FMD%d%c_vtxbin%d",det,ringChar,i),
-                                  hBg->GetNbinsX(),
-                                  hBg->GetXaxis()->GetXmin(),
-                                  hBg->GetXaxis()->GetXmax(),
-                                  nSec, 0, 2*TMath::Pi());
-           hHits  = new TH1F(Form("hMCHits_FMD%d%c_vtxbin%d",det,ringChar,i),Form("hMCHits_FMD%d%c_vtxbin%d",det,ringChar,i),
-                             hBg->GetNbinsX(),
-                             hBg->GetXaxis()->GetXmin(),
-                             hBg->GetXaxis()->GetXmax());
-           hHits->Sumw2();
-           fOutputList->Add(hHits);
-           
-           hMult->Sumw2();
-           fOutputList->Add(hMult);
-
-           hMultTrVtx->Sumw2();
-           fOutputList->Add(hMultTrVtx);
-           
-           hMultNSD->Sumw2();
-           fOutputList->Add(hMultNSD);
-           
-         }
-      } 
-  }
-  
-  for(Int_t i = 0; i< nVtxbins; i++) {
-   
-    hPrimVertexBin = new TH1F(Form("primmult_vtxbin%d",i),
-                             Form("primmult_vtxbin%d",i),
-                             hBgTmp->GetNbinsX(),
-                             hBgTmp->GetXaxis()->GetXmin(),
-                             hBgTmp->GetXaxis()->GetXmax());
-    hPrimVertexBin->Sumw2();
-    fOutputList->Add(hPrimVertexBin);
-    
-    hPrimVertexBinNSD = new TH1F(Form("primmult_NSD_vtxbin%d",i),
-                                Form("primmult_NSD_vtxbin%d",i),
-                                hBgTmp->GetNbinsX(),
-                                hBgTmp->GetXaxis()->GetXmin(),
-                                hBgTmp->GetXaxis()->GetXmax());
-    hPrimVertexBinNSD->Sumw2();
-    fOutputList->Add(hPrimVertexBinNSD);
-    
-
-    //SPD part
-    TH2F* hSPDMult  = new TH2F(Form("dNdeta_SPD_vtxbin%d",i),Form("dNdeta_SPD_vtxbin%d",i),
-                        hBgTmp->GetNbinsX(),
-                        hBgTmp->GetXaxis()->GetXmin(),
-                        hBgTmp->GetXaxis()->GetXmax(),
-                        20, 0, 2*TMath::Pi());
-    hSPDMult->Sumw2();
-    fOutputList->Add(hSPDMult);
-    TH2F* hSPDMultTrVtx  = new TH2F(Form("dNdetaTrVtx_SPD_vtxbin%d",i),Form("dNdetaTrVtx_SPD_vtxbin%d",i),
-                        hBgTmp->GetNbinsX(),
-                        hBgTmp->GetXaxis()->GetXmin(),
-                        hBgTmp->GetXaxis()->GetXmax(),
-                        20, 0, 2*TMath::Pi());
-    hSPDMultTrVtx->Sumw2();
-    fOutputList->Add(hSPDMultTrVtx);
-
-    TH2F* hSPDMultNSD  = new TH2F(Form("dNdetaNSD_SPD_vtxbin%d",i),Form("dNdetaNSD_SPD_vtxbin%d",i),
-                        hBgTmp->GetNbinsX(),
-                        hBgTmp->GetXaxis()->GetXmin(),
-                        hBgTmp->GetXaxis()->GetXmax(),
-                        20, 0, 2*TMath::Pi());
-    hSPDMultNSD->Sumw2();
-    fOutputList->Add(hSPDMultNSD);
-
-  }
-  
-  //AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  
-  //  TH2F* dNdetadphiHistogramTotal = new TH2F("dNdetadphiHistogramTotal","dNdetadphiHistogram;#eta;#Phi",pars->GetNetaBins(),-6,6,20,0,2*TMath::Pi());
-  //dNdetadphiHistogramTotal->SetErrorOption("g");
-  //fOutputList->Add(dNdetadphiHistogramTotal);
-  
-  
-  
-  fNevents.SetBins(nVtxbins,0,nVtxbins);
-  fNevents.SetName("nEvents");
-  fNNSDevents.SetBins(nVtxbins,0,nVtxbins);
-  fNNSDevents.SetName("nNSDEvents");
-  
-  fNMCevents.SetBins(nVtxbins,0,nVtxbins);
-  fNMCevents.SetName("nMCEvents");
-  fNMCNSDevents.SetBins(nVtxbins,0,nVtxbins);
-  fNMCNSDevents.SetName("nMCNSDEvents");
-  fOutputList->Add(&fNevents);
-  fOutputList->Add(&fNNSDevents);
-  fOutputList->Add(&fNMCevents);
-  fOutputList->Add(&fNMCNSDevents);
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskDndeta::ConnectInputData(Option_t */*option*/)
-{
-  if(fStandalone) {
-    fInputList   = (TList*)GetInputData(0);
-  }
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskDndeta::Exec(Option_t */*option*/)
-{
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  fVertexString = (TObjString*)fInputList->At(0);
-  
-  Int_t vtxbin   = fVertexString->GetString().Atoi();
-  
-  fNevents.Fill(vtxbin);
-  
-  //AliESDInputHandler* eventHandler = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
-  //AliESDEvent* esd = eventHandler->GetEvent();
-  Bool_t nsd = pars->IsEventTriggered(AliFMDAnaParameters::kNSD);
-  if(nsd) fNNSDevents.Fill(vtxbin);
-  
-  for(UShort_t det=1;det<=3;det++) {
-    Int_t nRings = (det==1 ? 1 : 2);
-    for (UShort_t ir = 0; ir < nRings; ir++) {
-      Char_t ringChar = (ir == 0 ? 'I' : 'O');
-            
-      TH2F* hMultTotal      = (TH2F*)fOutputList->FindObject(Form("dNdeta_FMD%d%c_vtxbin%d",det,ringChar,vtxbin));
-      TH2F* hMultTotalTrVtx = (TH2F*)fOutputList->FindObject(Form("dNdetaTrVtx_FMD%d%c_vtxbin%d",det,ringChar,vtxbin));
-      TH2F* hMultTotalNSD   = (TH2F*)fOutputList->FindObject(Form("dNdetaNSD_FMD%d%c_vtxbin%d",det,ringChar,vtxbin));
-      
-      
-      TH2F* hMultInput      = (TH2F*)fInputList->FindObject(Form("mult_FMD%d%c_vtxbin%d",det,ringChar,vtxbin));
-      TH2F* hMultInputTrVtx = (TH2F*)fInputList->FindObject(Form("multTrVtx_FMD%d%c_vtxbin%d",det,ringChar,vtxbin));
-      TH2F* hMultInputNSD   = (TH2F*)fInputList->FindObject(Form("multNSD_FMD%d%c_vtxbin%d",det,ringChar,vtxbin));
-      
-      hMultTotal->Add(hMultInput);
-      hMultTotalTrVtx->Add(hMultInputTrVtx);
-      if(nsd)
-       hMultTotalNSD->Add(hMultInputNSD);
-      
-    }
-  }
-  
-  //SPD code
-  TH2F* hMultSPDTotal      = (TH2F*)fOutputList->FindObject(Form("dNdeta_SPD_vtxbin%d",vtxbin));
-  TH2F* hMultSPDTotalTrVtx = (TH2F*)fOutputList->FindObject(Form("dNdetaTrVtx_SPD_vtxbin%d",vtxbin));
-  TH2F* hMultSPDTotalNSD   = (TH2F*)fOutputList->FindObject(Form("dNdetaNSD_SPD_vtxbin%d",vtxbin));
-  TH2F* hMultSPDInput      = (TH2F*)fInputList->FindObject(Form("mult_SPD_vtxbin%d",vtxbin));
-  TH2F* hMultSPDInputTrVtx = (TH2F*)fInputList->FindObject(Form("multTrVtx_SPD_vtxbin%d",vtxbin));
-  TH2F* hMultSPDInputNSD   = (TH2F*)fInputList->FindObject(Form("multNSD_SPD_vtxbin%d",vtxbin));
-  
-  hMultSPDTotal->Add(hMultSPDInput);
-  hMultSPDTotalTrVtx->Add(hMultSPDInputTrVtx);
-  if(nsd)
-    hMultSPDTotalNSD->Add(hMultSPDInputNSD);
-  
-  if(pars->GetProcessPrimary())
-    ProcessPrimary();
-  
-  //TH2F* dNdetadphiHistogram = (TH2F*)fOutputList->FindObject("dNdetadphiHistogramSPDTrVtx");
-  
-  //  TH2F* dNdetadphiHistogramTotal = (TH2F*)fOutputList->FindObject("dNdetadphiHistogramTotal");
-  
-  //  if(vtxbin == 4)
-  //  dNdetadphiHistogramTotal->Add(dNdetadphiHistogram);
-  
-  
-  
-  
-  if(fStandalone) {
-    PostData(0, fOutputList); 
-  }
-  
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskDndeta::Terminate(Option_t */*option*/) {
-  
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  
-  Int_t nVtxbins = pars->GetNvtxBins();
-  
-  for(UShort_t det=1;det<=3;det++) {
-    Int_t nRings = (det==1 ? 1 : 2);
-    for (UShort_t ir = 0; ir < nRings; ir++) {
-      Char_t ringChar = (ir == 0 ? 'I' : 'O');
-      for(Int_t i =0; i<nVtxbins; i++) {
-       
-       TH2F* hMultTotal = (TH2F*)fOutputList->FindObject(Form("dNdeta_FMD%d%c_vtxbin%d",det,ringChar,i));
-       fOutputList->Add(hMultTotal->Clone(Form("%s_orig", hMultTotal->GetName())));
-       if(fVtxEff) { 
-         hMultTotal->Scale(fVtxEff);
-       }
-       
-       TH2F* hMultTotalNSD = (TH2F*)fOutputList->FindObject(Form("dNdetaNSD_FMD%d%c_vtxbin%d",det,ringChar,i));
-       fOutputList->Add(hMultTotalNSD->Clone(Form("%s_orig", hMultTotalNSD->GetName())));
-       if(fVtxEffNSD) { 
-         hMultTotalNSD->Scale(fVtxEffNSD);
-       }
-       
-       //TH2F* hMultTrVtx = (TH2F*)hMultTotal->Clone(Form("dNdeta_FMD%d%c_TrVtx_vtxbin%d",det,ringChar,i));
-       TH2F* hMultTrVtx = (TH2F*)fOutputList->FindObject(Form("dNdetaTrVtx_FMD%d%c_vtxbin%d",det,ringChar,i));
-       
-       TH1D* hMultProj   = hMultTotal->ProjectionX(Form("dNdeta_FMD%d%c_vtxbin%d_proj",det,ringChar,i),1,hMultTotal->GetNbinsY());
-       TH1D* hMultProjTrVtx   = hMultTrVtx->ProjectionX(Form("dNdeta_FMD%d%c_TrVtx_vtxbin%d_proj",det,ringChar,i),1,hMultTrVtx->GetNbinsY());
-       TH1D* hMultProjNSD   = hMultTotalNSD->ProjectionX(Form("dNdetaNSD_FMD%d%c_vtxbin%d_proj",det,ringChar,i),1,hMultTotalNSD->GetNbinsY());
-       
-       //fOutputList->Add(hMultTrVtx);
-       fOutputList->Add(hMultProj);
-       fOutputList->Add(hMultProjTrVtx);
-       fOutputList->Add(hMultProjNSD);
-      }
-    }
-  }
-  
-  for(Int_t i =0; i<nVtxbins; i++) {
-    
-    TH2F* hSPDMult = (TH2F*)fOutputList->FindObject(Form("dNdeta_SPD_vtxbin%d",i));
-    TH2F* hSPDMultTrVtx = (TH2F*)fOutputList->FindObject(Form("dNdetaTrVtx_SPD_vtxbin%d",i));
-    TH2F* hSPDMultNSD = (TH2F*)fOutputList->FindObject(Form("dNdetaNSD_SPD_vtxbin%d",i));
-    
-    if(fVtxEff)
-      hSPDMult->Scale(fVtxEff);
-       
-    if(fVtxEffNSD)
-      hSPDMultNSD->Scale(fVtxEffNSD);
-    
-    TH1D* hMultProj   = hSPDMult->ProjectionX(Form("dNdeta_SPD_vtxbin%d_proj",i),1,hSPDMult->GetNbinsY());
-    TH1D* hMultProjTrVtx   = hSPDMultTrVtx->ProjectionX(Form("dNdetaTrVtx_SPD_vtxbin%d_proj",i),1,hSPDMultTrVtx->GetNbinsY());
-    TH1D* hMultProjNSD   = hSPDMultNSD->ProjectionX(Form("dNdetaNSD_SPD_vtxbin%d_proj",i),1,hSPDMultNSD->GetNbinsY());
-    fOutputList->Add(hMultProj);
-    fOutputList->Add(hMultProjTrVtx);
-    fOutputList->Add(hMultProjNSD);
-  
-  }
-  
-  std::cout<<"FMD analysis accepted "<<fNevents.GetEntries()<<" INEL events and "<<fNNSDevents.GetEntries()<<" NSD events"<<std::endl;
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskDndeta::ProcessPrimary() {
-  
-  AliMCEventHandler* eventHandler = 
-    dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()
-                                     ->GetMCtruthEventHandler());
-  if (!eventHandler) return;
-
-  AliMCEvent* mcEvent = eventHandler->MCEvent();
-  if(!mcEvent) return;
-  
-  fLastTrackByStrip.Reset(-1);
-  
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  
-  AliMCParticle* particle = 0;
-  AliStack* stack = mcEvent->Stack();
-  
-  TH1F* hPrimary = (TH1F*)fOutputList->FindObject("hMultvsEta");
-  TH1F* hPrimaryNSD = (TH1F*)fOutputList->FindObject("hMultvsEtaNSD");
-  AliHeader* header            = mcEvent->Header();
-  AliGenEventHeader* genHeader = header->GenEventHeader();
-  
-  AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader);
-  AliGenDPMjetEventHeader* dpmHeader = dynamic_cast<AliGenDPMjetEventHeader*>(header->GenEventHeader());
-  Bool_t nsd = kTRUE;
-  
-  if (!pythiaGenHeader && !dpmHeader) {
-    std::cout<<" no pythia or dpm header!"<<std::endl;
-  }
-  else {
-    if(pythiaGenHeader)        {
-      Int_t pythiaType = pythiaGenHeader->ProcessType();
-      
-      if(pythiaType==92||pythiaType==93)
-       nsd = kFALSE;
-      
-    }
-    if(dpmHeader) {
-      Int_t processType = dpmHeader->ProcessType();
-      if(processType == 5 || processType == 6)  
-       nsd = kFALSE;
-    
-    }
-  }
-  
-  TArrayF vertex;
-  genHeader->PrimaryVertex(vertex);
-  if(TMath::Abs(vertex.At(2)) > pars->GetVtxCutZ())
-    return;
-  Double_t delta           = 2*pars->GetVtxCutZ()/pars->GetNvtxBins();
-  Double_t vertexBinDouble = (vertex.At(2) + pars->GetVtxCutZ()) / delta;
-  Int_t    vertexBin       = (Int_t)vertexBinDouble;
-    
-  Bool_t firstTrack = kTRUE;
-  Bool_t firstTrackNSD = kTRUE;
-  
-  TH1F* hPrimVtxBinNSD = (TH1F*)fOutputList->FindObject(Form("primmult_NSD_vtxbin%d",vertexBin));
-  TH1F* hPrimVtxBin = (TH1F*)fOutputList->FindObject(Form("primmult_vtxbin%d",vertexBin));
-  
-  // we loop over the primaries only unless we need the hits (diagnostics running slowly)
-  Int_t nTracks = stack->GetNprimary();
-  if(pars->GetProcessHits())
-    nTracks = stack->GetNtrack();
-  
-  for(Int_t i = 0 ;i<nTracks;i++) {
-    particle = (AliMCParticle*) mcEvent->GetTrack(i);
-    if(!particle)
-      continue;
-   
-    if(stack->IsPhysicalPrimary(i) && particle->Charge() != 0) {
-      hPrimary->Fill(particle->Eta());
-      hPrimVtxBin->Fill(particle->Eta());
-      if(firstTrack) {
-       fNMCevents.Fill(vertexBin);
-       firstTrack = kFALSE;
-      }
-      
-      if(nsd) {
-       hPrimaryNSD->Fill(particle->Eta());
-       hPrimVtxBinNSD->Fill(particle->Eta());
-       if(firstTrackNSD) {
-         fNMCNSDevents.Fill(vertexBin);
-         firstTrackNSD = kFALSE;
-       }
-      }
-      
-      
-    
-    }
-    if(pars->GetProcessHits()) {
-           
-      for(Int_t j=0; j<particle->GetNumberOfTrackReferences();j++) {
-       
-       AliTrackReference* ref = particle->GetTrackReference(j);
-       UShort_t det,sec,strip;
-       Char_t   ring;
-       if(ref->DetectorId() != AliTrackReference::kFMD)
-         continue;
-       AliFMDStripIndex::Unpack(ref->UserId(),det,ring,sec,strip);
-       Float_t thisStripTrack = fLastTrackByStrip(det,ring,sec,strip);
-       if(particle->Charge() != 0 && i != thisStripTrack ) {
-         //Double_t x,y,z;
-         
-         Float_t   eta   = pars->GetEtaFromStrip(det,ring,sec,strip,vertex.At(2));//-1*TMath::Log(TMath::Tan(0.5*theta));
-         TH1F* hHits = (TH1F*)fOutputList->FindObject(Form("hMCHits_FMD%d%c_vtxbin%d",det,ring,vertexBin));
-         
-       
-         hHits->Fill(eta);
-         
-         Float_t nstrips = (ring =='O' ? 256 : 512);
-         
-         fLastTrackByStrip(det,ring,sec,strip) = (Float_t)i;
-       
-         if(strip >0)
-           fLastTrackByStrip(det,ring,sec,strip-1) = (Float_t)i;
-         if(strip < (nstrips - 1))
-           fLastTrackByStrip(det,ring,sec,strip+1) = (Float_t)i;
-         
-       }
-      
-       
-      }
-      
-      
-    }
-
-      
-      
-  }
-}
-//_____________________________________________________________________
-//
-//
-// EOF
-// EOF
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskDndeta.h b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskDndeta.h
deleted file mode 100644 (file)
index 67b58a7..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#ifndef ALIFMDANALYSISTASKDNDETA_H
-#define ALIFMDANALYSISTASKDNDETA_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-#include "AliAnalysisTask.h"
-
-#include "TObjArray.h"
-#include "TObjString.h"
-#include "TArrayI.h"
-#include "TH1I.h"
-#include "AliMCEvent.h"
-#include "AliFMDFloatMap.h"
-
-/**
- * @ingroup FMD_ana
- */
-class AliFMDAnalysisTaskDndeta : public AliAnalysisTask
-{
- public:
-    AliFMDAnalysisTaskDndeta();
-    AliFMDAnalysisTaskDndeta(const char* name, Bool_t SE = kTRUE);
-    virtual ~AliFMDAnalysisTaskDndeta() {;}
- AliFMDAnalysisTaskDndeta(const AliFMDAnalysisTaskDndeta& o) : AliAnalysisTask(),
-                                                              fDebug(o.fDebug),
-                                                              fOutputList(0),
-                                                              fInputList(0),
-                                                              fVertexString(o.fVertexString),
-                                                              fNevents(o.fNevents),
-                                                              fNNSDevents(o.fNNSDevents),
-                                                              fNMCevents(o.fNMCevents),
-                                                              fNMCNSDevents(o.fNMCNSDevents),
-                                                              fStandalone(o.fStandalone),
-                                                              fLastTrackByStrip(o.fLastTrackByStrip),
-                                                              fVtxEff(o.fVtxEff),
-                                                              fVtxEffNSD(o.fVtxEffNSD)
-  {}
-  AliFMDAnalysisTaskDndeta& operator=(const AliFMDAnalysisTaskDndeta&) { return *this; }
-  // Implementation of interface methods
-  virtual void ConnectInputData(Option_t *option = "");
-  virtual void CreateOutputObjects();
-  virtual void Init() {}
-  virtual void LocalInit() {Init();}
-  virtual void Exec(Option_t *option);
-  virtual void Terminate(Option_t *option);
-  virtual void SetDebugLevel(Int_t level) {fDebug = level;}
-  void SetInputList(TList* inputList) {fInputList = inputList;}
-  void SetInputVertex(TObjString* vtxString) {fVertexString = vtxString;}
-  void SetOutputList(TList* outputList) {fOutputList = outputList;}
-  void ProcessPrimary();
-  TList* GetOutputList() {return fOutputList;}
-  void SetVtxEfficiency(Float_t vtxeff) {fVtxEff = vtxeff;}
-  void SetVtxEfficiencyNSD(Float_t vtxeff) {fVtxEffNSD = vtxeff;}
-  
- private:
-  Int_t          fDebug;        //  Debug flag
-  TList*         fOutputList;
-  TList*         fInputList;
-  TObjString*    fVertexString;
-  TH1I           fNevents;
-  TH1I           fNNSDevents;
-  TH1I           fNMCevents;
-  TH1I           fNMCNSDevents;
-  Bool_t         fStandalone;
-  AliFMDFloatMap fLastTrackByStrip;
-  Float_t        fVtxEff;             //Efficiency of vertex sel.
-  Float_t        fVtxEffNSD;          //Efficiency of vertex sel., NSD
-   
-  ClassDef(AliFMDAnalysisTaskDndeta, 0); // Analysis task for FMD analysis
-};
-#endif
-// Local Variables:
-//   mode: C++ 
-// End:
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskESDReader.cxx b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskESDReader.cxx
deleted file mode 100644 (file)
index 60df085..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#include <TROOT.h>
-#include <TSystem.h>
-#include <TInterpreter.h>
-#include <TChain.h>
-#include <TFile.h>
-#include <TList.h>
-#include <iostream>
-
-#include "AliFMDAnalysisTaskESDReader.h"
-#include "AliAnalysisManager.h"
-#include "AliESDFMD.h"
-#include "AliESDEvent.h"
-#include "AliAODEvent.h"
-#include "AliAODHandler.h"
-#include "AliMCEventHandler.h"
-#include "AliStack.h"
-#include "AliESDVertex.h"
-#include "AliFMDAnaParameters.h"
-
-ClassImp(AliFMDAnalysisTaskESDReader)
-
-//_____________________________________________________________________
-AliFMDAnalysisTaskESDReader::AliFMDAnalysisTaskESDReader()
-: fDebug(0),
-  fChain(0x0),
-  fESD(0x0),
-  fOutputESD(0x0)
-{
-  // Default constructor
-  DefineInput (0, TTree::Class());
-  DefineOutput(0, AliESDEvent::Class());
-}
-//_____________________________________________________________________
-AliFMDAnalysisTaskESDReader::AliFMDAnalysisTaskESDReader(const char* name):
-    AliAnalysisTask(name, "AnalysisTaskFMD"),
-    fDebug(0),
-    fChain(0x0),
-    fESD(0x0),
-    fOutputESD(0x0)
-{
-  DefineInput (0, TTree::Class());
-  DefineOutput(0, AliESDEvent::Class());
-}
-
-//_____________________________________________________________________
-void AliFMDAnalysisTaskESDReader::ConnectInputData(Option_t */*option*/)
-{
-  fChain = (TChain*)GetInputData(0);
-  fESD = new AliESDEvent();
-  fESD->ReadFromTree(fChain);
-  
-}
-//_____________________________________________________________________
-
-void AliFMDAnalysisTaskESDReader::Exec(Option_t */*option*/)
-{
-  //  std::cout<<fOutputESD<<std::endl;
-  fOutputESD = fESD;
-  PostData(0, fOutputESD); 
-  
-}
-//_____________________________________________________________________
-
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskESDReader.h b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskESDReader.h
deleted file mode 100644 (file)
index e95f2fc..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef ALIFMDANALYSISTASKESDREADER_H
-#define ALIFMDANALYSISTASKESDREADER_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-#include "AliAnalysisTask.h"
-#include "TH1F.h"
-#include "TObjString.h"
-#include "AliESDFMD.h"
-#include "TTree.h"
-#include "AliESDVertex.h"
-class AliESDEvent;
-class TChain;
-class AliAODEvent;
-
-
-
-/**
- * @ingroup FMD_ana
- */
-class AliFMDAnalysisTaskESDReader : public AliAnalysisTask
-{
- public:
-    AliFMDAnalysisTaskESDReader();
-    AliFMDAnalysisTaskESDReader(const char* name);
- AliFMDAnalysisTaskESDReader(const AliFMDAnalysisTaskESDReader& o) : AliAnalysisTask(),
-      fDebug(o.fDebug),fChain(o.fChain), fESD(o.fESD),fOutputESD(o.fOutputESD) {}
-    
-    virtual ~AliFMDAnalysisTaskESDReader() {;}
-    AliFMDAnalysisTaskESDReader& operator=(const AliFMDAnalysisTaskESDReader&) { return *this; }
-    // Implementation of interface methods
-    virtual void ConnectInputData(Option_t *option );
-    virtual void CreateOutputObjects() {};
-    virtual void Init() {}
-    virtual void LocalInit() {Init();}
-    virtual void Exec(Option_t *option);
-    virtual void Terminate(Option_t* /* option*/) {}
-    virtual void SetDebugLevel(Int_t level) {fDebug = level;}
-    
- private:
-    Int_t         fDebug;        //  Debug flag
-    TChain*       fChain;        //! chained files
-    AliESDEvent*  fESD;          //! ESD
-    AliESDEvent*  fOutputESD;
-    
-    ClassDef(AliFMDAnalysisTaskESDReader, 0); // Analysis task for FMD analysis
-};
-#endif
-// Local Variables:
-//   mode: C++ 
-// End:
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskGenerateCorrection.cxx b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskGenerateCorrection.cxx
deleted file mode 100644 (file)
index dbe5005..0000000
+++ /dev/null
@@ -1,819 +0,0 @@
-#include "AliFMDAnalysisTaskGenerateCorrection.h"
-#include "AliESDEvent.h"
-#include "iostream"
-#include "AliESDFMD.h"
-#include "TH2F.h"
-#include "AliTrackReference.h"
-#include "AliStack.h"
-#include "AliFMDAnaParameters.h"
-#include "AliFMDStripIndex.h"
-#include "AliStack.h"
-#include "AliMCParticle.h"
-#include "AliMCEvent.h"
-//#include "AliFMDGeometry.h"
-#include "TArray.h"
-#include "AliGenEventHeader.h"
-#include "AliMultiplicity.h"
-#include "AliHeader.h"
-#include "AliFMDAnaCalibBackgroundCorrection.h"
-#include "AliFMDAnaCalibEventSelectionEfficiency.h"
-#include "AliGenPythiaEventHeader.h"
-//#include "AliCDBManager.h"
-//#include "AliCDBId.h"
-//#include "AliCDBMetaData.h"
-#include "TSystem.h"
-#include "TROOT.h"
-#include "TAxis.h"
-#include "AliGenDPMjetEventHeader.h"
-#include <TFile.h>
-
-ClassImp(AliFMDAnalysisTaskGenerateCorrection)
-#if 0 
-; // This is for emacs - do not delete 
-#endif
-
-//_____________________________________________________________________
-AliFMDAnalysisTaskGenerateCorrection::AliFMDAnalysisTaskGenerateCorrection():
-AliAnalysisTaskSE(),
-  fListOfHits(), 
-  fListOfPrimaries(),
-  fListOfCorrection(),
-  fVertexBins(),
-  fLastTrackByStrip(0),
-  fHitsByStrip(0),
-  fZvtxCut(10),
-  fNvtxBins(10),
-  fNbinsEta(240),
-  fBackground(0),
-fEventSelectionEff(0),
-fEtaLow(-6),
-fEtaHigh(6)
-{
-  // Default constructor
-}
-//_____________________________________________________________________
-AliFMDAnalysisTaskGenerateCorrection::AliFMDAnalysisTaskGenerateCorrection(const char* name):
-  AliAnalysisTaskSE(name),
-  fListOfHits(), 
-  fListOfPrimaries(),
-  fListOfCorrection(),
-  fVertexBins(),
-  fLastTrackByStrip(0),
-  fHitsByStrip(0),
-  fZvtxCut(10),
-  fNvtxBins(10),
-  fNbinsEta(240),
-  fBackground(0),
-  fEventSelectionEff(0),
-  fEtaLow(-6),
-  fEtaHigh(6)
-{
-  DefineOutput(1, TList::Class());
-  DefineOutput(2, TList::Class());
-  DefineOutput(3, TH1F::Class());
-  DefineOutput(4, TList::Class());
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskGenerateCorrection::UserCreateOutputObjects()
-{
-// Create the output containers
-//
-  
-  std::cout<<"Creating output objects"<<std::endl;
-  
-  // SelectCollisionCandidates(AliVEvent::kAny);
-  
-  for(Int_t v=0; v<fNvtxBins;v++) {
-    
-    TH2F* hSPDhits       = new TH2F(Form("hSPDhits_vtx%d",v),
-                                   Form("hSPDhits_vtx%d",v),
-                                   fNbinsEta, fEtaLow,fEtaHigh, 20, 0,2*TMath::Pi());
-    hSPDhits->Sumw2();
-    fListOfHits.Add(hSPDhits);
-    
-    TH1F* hReadChannels  = new TH1F(Form("hFMDReadChannels_vtx%d",v),
-                                   Form("hFMDReadChannels_vtx%d",v),
-                                   fNbinsEta,fEtaLow,fEtaHigh);
-    hReadChannels->Sumw2();
-    fListOfHits.Add(hReadChannels);
-    TH1F* hAllChannels  = new TH1F(Form("hFMDAllChannels_vtx%d",v),
-                                  Form("hFMDAllChannels_vtx%d",v),
-                                  fNbinsEta,fEtaLow,fEtaHigh);
-    hAllChannels->Sumw2();
-    fListOfHits.Add(hAllChannels);
-    
-    
-    
-    for(Int_t iring = 0; iring<2;iring++) {
-      Char_t ringChar = (iring == 0 ? 'I' : 'O');
-      Int_t nSec = (iring == 1 ? 40 : 20);
-      
-      TH2F* hPrimary       = new TH2F(Form("hPrimary_FMD_%c_vtx%d",ringChar,v),
-                                     Form("hPrimary_FMD_%c_vtx%d",ringChar,v),
-                                     fNbinsEta, fEtaLow,fEtaHigh, nSec, 0,2*TMath::Pi());
-      hPrimary->Sumw2();
-      fListOfPrimaries.Add(hPrimary);
-      TH2F* hPrimaryNSD       = new TH2F(Form("hPrimaryNSD_FMD_%c_vtx%d",ringChar,v),
-                                        Form("hPrimaryNSD_FMD_%c_vtx%d",ringChar,v),
-                                        fNbinsEta, fEtaLow,fEtaHigh, nSec, 0,2*TMath::Pi());
-      hPrimaryNSD->Sumw2();
-      fListOfPrimaries.Add(hPrimaryNSD);
-      
-      
-      
-    }
-  }
-  
-  
-  
-  for(Int_t det =1; det<=3;det++) {
-    Int_t nRings = (det==1 ? 1 : 2);
-    for(Int_t ring = 0;ring<nRings;ring++) {
-      Int_t nSec = (ring == 1 ? 40 : 20);
-      Char_t ringChar = (ring == 0 ? 'I' : 'O');
-      TH1F* doubleHits = new TH1F(Form("DoubleHits_FMD%d%c",det,ringChar),
-                                 Form("DoubleHits_FMD%d%c",det,ringChar),fNbinsEta, fEtaLow,fEtaHigh);
-      TH1F* allHits = new TH1F(Form("allHits_FMD%d%c",det,ringChar),
-                              Form("allHits_FMD%d%c",det,ringChar), fNbinsEta, fEtaLow,fEtaHigh);
-      
-      doubleHits->Sumw2();
-      allHits->Sumw2();
-      fListOfHits.Add(allHits);
-      fListOfHits.Add(doubleHits);
-       
-      for(Int_t v=0; v<fNvtxBins;v++) {
-       TH2F* hHits = new TH2F(Form("hHits_FMD%d%c_vtx%d", det,ringChar,v),
-                              Form("hHits_FMD%d%c_vtx%d", det,ringChar,v),
-                              fNbinsEta, fEtaLow,fEtaHigh, nSec, 0, 2*TMath::Pi());
-       hHits->Sumw2();
-       fListOfHits.Add(hHits);
-       TH2F* hHitsNSD = new TH2F(Form("hHitsNSD_FMD%d%c_vtx%d", det,ringChar,v),
-                              Form("hHitsNSD_FMD%d%c_vtx%d", det,ringChar,v),
-                              fNbinsEta, fEtaLow,fEtaHigh, nSec, 0, 2*TMath::Pi());
-       hHitsNSD->Sumw2();
-       fListOfHits.Add(hHitsNSD);
-       
-       
-      } 
-    }
-  }
-  
-  TH1F* hEventsSelected  = new TH1F("EventsSelected","EventsSelected",fNvtxBins,0,fNvtxBins);
-  TH1F* hEventsAll    = new TH1F("EventsAll","EventsAll",fNvtxBins,0,fNvtxBins);
-  TH1F* hEventsAllNSD    = new TH1F("EventsAllNSD","EventsAllNSD",fNvtxBins,0,fNvtxBins);
-  TH1F* hEventsSelectedVtx  = new TH1F("EventsSelectedVtx","EventsSelectedVtx",fNvtxBins,0,fNvtxBins);  
-  TH1F* hEventsSelectedTrigger  = new TH1F("EventsSelectedTrigger","EventsSelectedTrigger",fNvtxBins,0,fNvtxBins);
-  
-  TH1F* hEventsSelectedNSDVtx  = new TH1F("EventsSelectedNSDVtx","EventsSelectedNSDVtx",fNvtxBins,0,fNvtxBins);  
-  TH1F* hEventsSelectedNSD     = new TH1F("EventsSelectedNSD","EventsSelectedNSD",fNvtxBins,0,fNvtxBins);
-  
-  TH1F* hXvtx = new TH1F("hXvtx","x vertex distribution",100,-2,2);
-  TH1F* hYvtx = new TH1F("hYvtx","y vertex distribution",100,-2,2);
-  TH1F* hZvtx = new TH1F("hZvtx","z vertex distribution",4*fNvtxBins,-4*fZvtxCut,4*fZvtxCut);
-  
-  fListOfPrimaries.Add(hXvtx);
-  fListOfPrimaries.Add(hYvtx);
-  fListOfPrimaries.Add(hZvtx);
-  
-  hEventsSelected->Sumw2();
-  hEventsAll->Sumw2();
-  hEventsAllNSD->Sumw2();
-  
-  fListOfHits.Add(hEventsSelected);
-  fListOfHits.Add(hEventsSelectedVtx);
-  fListOfHits.Add(hEventsSelectedTrigger);
-  fListOfHits.Add(hEventsSelectedNSDVtx);
-  fListOfHits.Add(hEventsSelectedNSD);
-  
-  
-  fListOfPrimaries.Add(hEventsAll);
-  fListOfPrimaries.Add(hEventsAllNSD);
-  
-  for(Int_t v=0; v<fNvtxBins;v++) {
-    
-    for(Int_t iring = 0; iring<2;iring++) {
-      Char_t ringChar = (iring == 0 ? 'I' : 'O');
-      Int_t nSec = (iring == 1 ? 40 : 20);
-      TH2F* hAnalysed       = new TH2F(Form("Analysed_FMD%c_vtx%d",ringChar,v),
-                                      Form("Analysed_FMD%c_vtx%d",ringChar,v),
-                                      fNbinsEta, fEtaLow,fEtaHigh, nSec, 0,2*TMath::Pi());
-      
-      hAnalysed->Sumw2();
-      fListOfPrimaries.Add(hAnalysed);
-      
-      TH2F* hAnalysedNSD       = new TH2F(Form("AnalysedNSD_FMD%c_vtx%d",ringChar,v),
-                                         Form("AnalysedNSD_FMD%c_vtx%d",ringChar,v),
-                                         fNbinsEta, fEtaLow,fEtaHigh, nSec, 0,2*TMath::Pi());
-      
-      hAnalysedNSD->Sumw2();
-      fListOfPrimaries.Add(hAnalysedNSD);
-      
-      TH2F* hInel           = new TH2F(Form("Inel_FMD%c_vtx%d",ringChar,v),
-                                      Form("Inel_FMD%c_vtx%d",ringChar,v),
-                                      fNbinsEta, fEtaLow,fEtaHigh, nSec, 0,2*TMath::Pi());
-      
-      hInel->Sumw2();
-      fListOfPrimaries.Add(hInel);
-      
-      TH2F* hNSD           = new TH2F(Form("NSD_FMD%c_vtx%d",ringChar,v),
-                                     Form("NSD_FMD%c_vtx%d",ringChar,v),
-                                     fNbinsEta, fEtaLow,fEtaHigh, nSec, 0,2*TMath::Pi());
-      
-      hNSD->Sumw2();
-      fListOfPrimaries.Add(hNSD);
-      
-    }
-  }
-  
-  fVertexBins.SetName("VertexBins");
-  fVertexBins.GetXaxis()->Set(fNvtxBins,-1*fZvtxCut,fZvtxCut);
-  
-  
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskGenerateCorrection::Init()
-{
-  fLastTrackByStrip.Reset(-1);
-  
-  
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskGenerateCorrection::UserExec(Option_t */*option*/)
-{
-  
-  fLastTrackByStrip.Reset(-1);
-  fHitsByStrip.Reset(0);
-  AliMCEvent* mcevent = MCEvent();
-  
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  
-  
-  AliESDEvent* esdevent = (AliESDEvent*)InputEvent();
-  
-  pars->SetTriggerStatus(esdevent);
-  
-  Double_t esdvertex[3];
-  Bool_t vtxStatus =  pars->GetVertex(esdevent,esdvertex);
-  
-  /* Double_t deltaEsd           = 2*fZvtxCut/fNvtxBins;
-  Double_t vertexBinDoubleEsd = (esdvertex[2] + fZvtxCut) / deltaEsd;
-  Int_t    vertexBinEsd       = (Int_t)vertexBinDoubleEsd;*/
-  
-  AliMCParticle* particle = 0;
-  AliStack* stack = mcevent->Stack();
-  
-  UShort_t det,sec,strip;
-  Char_t   ring;
-  
-  Int_t nTracks                = mcevent->GetNumberOfTracks();
-  AliHeader* header            = mcevent->Header();
-  AliGenEventHeader* genHeader = header->GenEventHeader();
-  
-  AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader);
-  AliGenDPMjetEventHeader* dpmHeader = dynamic_cast<AliGenDPMjetEventHeader*>(header->GenEventHeader());
-  
-  if (!pythiaGenHeader && !dpmHeader) {
-    std::cout<<" no pythia or dpm header! - NSD selection unusable"<<std::endl;
-    //return; 
-  }
-  Bool_t nsd = kTRUE;
-  if(pythiaGenHeader) {
-    Int_t pythiaType = pythiaGenHeader->ProcessType();
-    
-    if(pythiaType==92 || pythiaType==93)
-      nsd = kFALSE;
-  }
-  if(dpmHeader) {
-    Int_t processType = dpmHeader->ProcessType();
-    if(processType == 5 || processType == 6)  
-      nsd = kFALSE;
-    
-  }
-  
-  
-  TArrayF vertex;
-  genHeader->PrimaryVertex(vertex);
-  
-  TH1F* hXvtx = (TH1F*)fListOfPrimaries.FindObject("hXvtx");
-  hXvtx->Fill(vertex.At(0));
-  TH1F* hYvtx = (TH1F*)fListOfPrimaries.FindObject("hYvtx");
-  hYvtx->Fill(vertex.At(1));
-  TH1F* hZvtx = (TH1F*)fListOfPrimaries.FindObject("hZvtx");
-  hZvtx->Fill(vertex.At(2));
-
-  
-  
-  
-  Double_t delta           = 2*fZvtxCut/fNvtxBins;
-  Double_t vertexBinDouble = (vertex.At(2) + fZvtxCut) / delta;
-  Int_t    vertexBin       = (Int_t)vertexBinDouble;
-  
-  // Vertex determination correction
-  TH1F* hEventsSelected           = (TH1F*)fListOfHits.FindObject("EventsSelected");
-  TH1F* hEventsSelectedVtx        = (TH1F*)fListOfHits.FindObject("EventsSelectedVtx");
-  TH1F* hEventsSelectedTrigger    = (TH1F*)fListOfHits.FindObject("EventsSelectedTrigger");
-  TH1F* hEventsSelectedNSDVtx     = (TH1F*)fListOfHits.FindObject("EventsSelectedNSDVtx");
-  TH1F* hEventsSelectedNSD        = (TH1F*)fListOfHits.FindObject("EventsSelectedNSD");
-  TH1F* hEventsAll                = (TH1F*)fListOfPrimaries.FindObject("EventsAll");
-  TH1F* hEventsAllNSD             = (TH1F*)fListOfPrimaries.FindObject("EventsAllNSD");
-  
-  // TH1F* hTriggered      = (TH1F*)fListOfHits.FindObject("Triggered");
-  //  TH1F* hTriggeredAll   = (TH1F*)fListOfPrimaries.FindObject("TriggeredAll");
-  
-  Bool_t vtxFound = kTRUE;
-  if(!vtxStatus)
-    vtxFound = kFALSE;
-  
-  //if(TMath::Abs(vertex.At(2)) > fZvtxCut) {
-  //  vtxFound = kFALSE;
-    
-  //}
-  
-  if(TMath::Abs(vertex.At(2)) > fZvtxCut) {
-    return;
-  }
-  
-  
-  Bool_t isTriggered    = pars->IsEventTriggered(AliFMDAnaParameters::kMB1);
-  Bool_t isTriggeredNSD = pars->IsEventTriggered(AliFMDAnaParameters::kNSD);
-  if(vtxFound && isTriggered) hEventsSelected->Fill(vertexBin);
-  
-  if(vtxFound) hEventsSelectedVtx->Fill(vertexBin);
-  if(isTriggered) hEventsSelectedTrigger->Fill(vertexBin);
-
-  if(vtxFound && isTriggeredNSD) hEventsSelectedNSDVtx->Fill(vertexBin);
-  if(isTriggeredNSD) hEventsSelectedNSD->Fill(vertexBin);
-
-  
-  hEventsAll->Fill(vertexBin);
-  if(nsd) hEventsAllNSD->Fill(vertexBin);
-  
-  // FMD dead channels
-  
-  TH1F* hFMDReadChannels  = (TH1F*)fListOfHits.FindObject(Form("hFMDReadChannels_vtx%d",vertexBin));
-  TH1F* hFMDAllChannels   = (TH1F*)fListOfHits.FindObject(Form("hFMDAllChannels_vtx%d",vertexBin));
-  
-  AliESDFMD* fmd = esdevent->GetFMDData();
-  
-  for(UShort_t d=1;d<=3;d++) {
-    Int_t nRings = (d==1 ? 1 : 2);
-    for (UShort_t ir = 0; ir < nRings; ir++) {
-      Char_t   r = (ir == 0 ? 'I' : 'O');
-      UShort_t nsec = (ir == 0 ? 20  : 40);
-      UShort_t nstr = (ir == 0 ? 512 : 256);
-      for(UShort_t s =0; s < nsec;  s++) {
-       for(UShort_t str = 0; str < nstr; str++) {
-         Float_t mult = fmd->Multiplicity(d,r,s,str);
-         
-         hFMDAllChannels->Fill(pars->GetEtaFromStrip(d,r,s,str,esdvertex[2]));
-         
-         if(mult != AliESDFMD::kInvalidMult)
-           hFMDReadChannels->Fill(pars->GetEtaFromStrip(d,r,s,str,esdvertex[2]));
-       }
-      }
-    }
-  }
-  // End, FMD dead channels
-
-  for(Int_t i = 0 ;i<nTracks;i++) {
-    particle = (AliMCParticle*) mcevent->GetTrack(i);
-    
-    if(!particle)
-      continue;
-        
-    if(stack->IsPhysicalPrimary(i) && particle->Charge() != 0) {
-      
-      //if(vtxFound && isTriggered) {
-       TH2F* hPrimaryInner = (TH2F*)fListOfPrimaries.FindObject( Form("hPrimary_FMD_%c_vtx%d",'I',vertexBin));
-       TH2F* hPrimaryOuter = (TH2F*)fListOfPrimaries.FindObject( Form("hPrimary_FMD_%c_vtx%d",'O',vertexBin));
-       hPrimaryInner->Fill(particle->Eta(),particle->Phi());
-       hPrimaryOuter->Fill(particle->Eta(),particle->Phi());
-       if( isTriggeredNSD) {
-         TH2F* hPrimaryInnerNSD = (TH2F*)fListOfPrimaries.FindObject( Form("hPrimaryNSD_FMD_%c_vtx%d",'I',vertexBin));
-         TH2F* hPrimaryOuterNSD = (TH2F*)fListOfPrimaries.FindObject( Form("hPrimaryNSD_FMD_%c_vtx%d",'O',vertexBin));
-         hPrimaryInnerNSD->Fill(particle->Eta(),particle->Phi());
-         hPrimaryOuterNSD->Fill(particle->Eta(),particle->Phi());
-         //    }
-       }
-      TH2F* hAnalysedInner = (TH2F*)fListOfPrimaries.FindObject( Form("Analysed_FMD%c_vtx%d",'I',vertexBin));
-      TH2F* hAnalysedOuter = (TH2F*)fListOfPrimaries.FindObject( Form("Analysed_FMD%c_vtx%d",'O',vertexBin));
-      TH2F* hAnalysedNSDInner = (TH2F*)fListOfPrimaries.FindObject( Form("AnalysedNSD_FMD%c_vtx%d",'I',vertexBin));
-      TH2F* hAnalysedNSDOuter = (TH2F*)fListOfPrimaries.FindObject( Form("AnalysedNSD_FMD%c_vtx%d",'O',vertexBin));
-      TH2F* hInelInner = (TH2F*)fListOfPrimaries.FindObject( Form("Inel_FMD%c_vtx%d",'I',vertexBin));
-      TH2F* hInelOuter = (TH2F*)fListOfPrimaries.FindObject( Form("Inel_FMD%c_vtx%d",'O',vertexBin));
-      TH2F* hNSDInner = (TH2F*)fListOfPrimaries.FindObject( Form("NSD_FMD%c_vtx%d",'I',vertexBin));
-      TH2F* hNSDOuter = (TH2F*)fListOfPrimaries.FindObject( Form("NSD_FMD%c_vtx%d",'O',vertexBin));
-      
-      //if(vtxFound && isTriggered) {
-      if(isTriggeredNSD) {
-       hAnalysedNSDInner->Fill(particle->Eta(),particle->Phi());
-       hAnalysedNSDOuter->Fill(particle->Eta(),particle->Phi());
-      }
-      if(isTriggered && vtxFound) {
-       hAnalysedInner->Fill(particle->Eta(),particle->Phi());
-       hAnalysedOuter->Fill(particle->Eta(),particle->Phi());
-      }
-      hInelInner->Fill(particle->Eta(),particle->Phi());
-      hInelOuter->Fill(particle->Eta(),particle->Phi());
-      
-      if(nsd) {
-       hNSDInner->Fill(particle->Eta(),particle->Phi());
-       hNSDOuter->Fill(particle->Eta(),particle->Phi());
-      }
-    }
-    //if(!vtxFound || !isTriggered) continue;
-    
-    for(Int_t j=0; j<particle->GetNumberOfTrackReferences();j++) {
-      
-      AliTrackReference* ref = particle->GetTrackReference(j);
-      
-      if(ref->DetectorId() != AliTrackReference::kFMD)
-       continue;
-
-      AliFMDStripIndex::Unpack(ref->UserId(),det,ring,sec,strip);
-      Float_t thisStripTrack = fLastTrackByStrip(det,ring,sec,strip);
-      if(particle->Charge() != 0 && i != thisStripTrack ) {
-       
-       Float_t phi = pars->GetPhiFromSector(det,ring,sec);
-       Float_t eta = pars->GetEtaFromStrip(det,ring,sec,strip,vertex.At(2));
-       
-       TH2F* hHits = (TH2F*)fListOfHits.FindObject(Form("hHits_FMD%d%c_vtx%d", det,ring,vertexBin));
-       hHits->Fill(eta,phi);
-       if( isTriggeredNSD) {
-         TH2F* hHitsNSD = (TH2F*)fListOfHits.FindObject(Form("hHitsNSD_FMD%d%c_vtx%d", det,ring,vertexBin));
-         hHitsNSD->Fill(eta,phi);
-       }
-       
-       Float_t nstrips = (ring =='O' ? 256 : 512);
-       fHitsByStrip(det,ring,sec,strip) +=1;
-       TH1F* allHits = (TH1F*)fListOfHits.FindObject(Form("allHits_FMD%d%c",det,ring));
-       TH1F* doubleHits = (TH1F*)fListOfHits.FindObject(Form("DoubleHits_FMD%d%c",det,ring));
-       
-       if(fHitsByStrip(det,ring,sec,strip) == 1)
-         allHits->Fill(eta);
-       
-       doubleHits->Fill(eta);
-               
-       fLastTrackByStrip(det,ring,sec,strip) = (Float_t)i;
-       if(strip >0)
-         fLastTrackByStrip(det,ring,sec,strip-1) = (Float_t)i;
-       if(strip < (nstrips - 1))
-         fLastTrackByStrip(det,ring,sec,strip+1) = (Float_t)i;
-      }
-    }
-
-  }
-  
-  
-  if(vtxFound && isTriggered) {
-    //SPD part HHD
-    TH2F* hSPDMult = (TH2F*)fListOfHits.FindObject(Form("hSPDhits_vtx%d", vertexBin));
-    
-    const AliMultiplicity* spdmult = esdevent->GetMultiplicity();
-    for(Int_t j = 0; j< spdmult->GetNumberOfTracklets();j++) 
-      hSPDMult->Fill(spdmult->GetEta(j),spdmult->GetPhi(j));
-    
-    for(Int_t j = 0; j< spdmult->GetNumberOfSingleClusters();j++) 
-      hSPDMult->Fill(-TMath::Log(TMath::Tan(spdmult->GetThetaSingle(j)/2.)),spdmult->GetPhiSingle(j));
-    
-  }
-  
-  PostData(1, &fListOfHits);
-  PostData(2, &fListOfPrimaries);
-  PostData(3, &fVertexBins);
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskGenerateCorrection::Terminate(Option_t */*option*/)
-{
-  /*  TH1F* allHits = (TH1F*)fListOfHits.FindObject("allHits");
-  TH1F* doubleHits = (TH1F*)fListOfHits.FindObject("DoubleHits");
-  
-  doubleHits->Divide(allHits);
-  GenerateCorrection();
-  PostData(1, &fListOfHits);
-  PostData(4, &fListOfCorrection);*/
-  
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskGenerateCorrection::GenerateCorrection() {
-  
-  fBackground         = new AliFMDAnaCalibBackgroundCorrection();
-  fEventSelectionEff  = new AliFMDAnaCalibEventSelectionEfficiency();
-  
-  //Event selection
-  TH1F* hEventsSelected           = (TH1F*)fListOfHits.FindObject("EventsSelected");
-  TH1F* hEventsSelectedVtx        = (TH1F*)fListOfHits.FindObject("EventsSelectedVtx");
-  TH1F* hEventsSelectedTrigger    = (TH1F*)fListOfHits.FindObject("EventsSelectedTrigger");
-  TH1F* hEventsSelectedNSDVtx     = (TH1F*)fListOfHits.FindObject("EventsSelectedNSDVtx");
-  TH1F* hEventsSelectedNSD        = (TH1F*)fListOfHits.FindObject("EventsSelectedNSD");
-    
-  TH1F* hEventsAll                = (TH1F*)fListOfPrimaries.FindObject("EventsAll");
-  TH1F* hEventsAllNSD             = (TH1F*)fListOfPrimaries.FindObject("EventsAllNSD");
-  TH1F* hEventsSelectedVtxDivByTr = (TH1F*)hEventsSelectedVtx->Clone("hEventsSelectedVtxDivByTr");
-  TH1F* hEventsSelectedNSDVtxDivByNSD = (TH1F*)hEventsSelectedNSDVtx->Clone("hEventsSelectedNSDVtxDivByNSD");
-  
-  fListOfHits.Add(hEventsSelectedVtxDivByTr);
-  fListOfHits.Add(hEventsSelectedNSDVtxDivByNSD);
-  hEventsSelectedNSDVtxDivByNSD->Divide(hEventsSelectedNSD);
-  hEventsSelectedVtxDivByTr->Divide(hEventsSelectedTrigger);
-  
-  for(Int_t v=0;v<fNvtxBins ; v++) {
-    TH2F* hAnalysedInner = (TH2F*)fListOfPrimaries.FindObject(Form("Analysed_FMD%c_vtx%d",'I',v));
-    TH2F* hAnalysedOuter = (TH2F*)fListOfPrimaries.FindObject(Form("Analysed_FMD%c_vtx%d",'O',v));
-    TH2F* hAnalysedNSDInner = (TH2F*)fListOfPrimaries.FindObject( Form("AnalysedNSD_FMD%c_vtx%d",'I',v));
-    TH2F* hAnalysedNSDOuter = (TH2F*)fListOfPrimaries.FindObject( Form("AnalysedNSD_FMD%c_vtx%d",'O',v));
-    
-    TH2F* hInelInner = (TH2F*)fListOfPrimaries.FindObject(Form("Inel_FMD%c_vtx%d",'I',v));
-    TH2F* hInelOuter = (TH2F*)fListOfPrimaries.FindObject(Form("Inel_FMD%c_vtx%d",'O',v));
-    TH2F* hNSDInner  = (TH2F*)fListOfPrimaries.FindObject( Form("NSD_FMD%c_vtx%d",'I',v));
-    TH2F* hNSDOuter  = (TH2F*)fListOfPrimaries.FindObject( Form("NSD_FMD%c_vtx%d",'O',v));
-    // hAnalysedInner->Scale((hEventsSelected->GetBinContent(v+1) == 0 ? 0 : 1/hEventsSelected->GetBinContent(v+1))); 
-    //hAnalysedOuter->Scale((hEventsSelected->GetBinContent(v+1) == 0 ? 0 : 1/hEventsSelected->GetBinContent(v+1))); 
-
-    hAnalysedInner->Scale((hEventsSelectedTrigger->GetBinContent(v+1) == 0 ? 0 : 1/hEventsSelectedTrigger->GetBinContent(v+1))); 
-    
-    hAnalysedOuter->Scale((hEventsSelectedTrigger->GetBinContent(v+1) == 0 ? 0 : 1/hEventsSelectedTrigger->GetBinContent(v+1))); 
-    hAnalysedNSDInner->Scale((hEventsSelectedNSD->GetBinContent(v+1) == 0 ? 0 : 1/hEventsSelectedNSD->GetBinContent(v+1))); 
-    
-    hAnalysedNSDOuter->Scale((hEventsSelectedNSD->GetBinContent(v+1) == 0 ? 0 : 1/hEventsSelectedNSD->GetBinContent(v+1))); 
-    
-    
-
-    hInelInner->Scale((hEventsAll->GetBinContent(v+1) == 0 ? 0 : 1/hEventsAll->GetBinContent(v+1))); 
-    hInelOuter->Scale((hEventsAll->GetBinContent(v+1) == 0 ? 0 : 1/hEventsAll->GetBinContent(v+1)));
-    
-    hNSDInner->Scale((hEventsAllNSD->GetBinContent(v+1) == 0 ? 0 : 1/hEventsAllNSD->GetBinContent(v+1))); 
-    hNSDOuter->Scale((hEventsAllNSD->GetBinContent(v+1) == 0 ? 0 : 1/hEventsAllNSD->GetBinContent(v+1)));
-    
-
-    hAnalysedInner->Divide(hInelInner);
-    hAnalysedOuter->Divide(hInelOuter);
-    
-    hAnalysedNSDInner->Divide(hNSDInner);
-    hAnalysedNSDOuter->Divide(hNSDOuter);
-    
-    fEventSelectionEff->SetCorrection("INEL",v,'I',hAnalysedInner);
-    fEventSelectionEff->SetCorrection("INEL",v,'O',hAnalysedOuter);
-    //NSD
-    fEventSelectionEff->SetCorrection("NSD",v,'I',hAnalysedNSDInner);
-    fEventSelectionEff->SetCorrection("NSD",v,'O',hAnalysedNSDOuter);
-    
-    //FMD dead channels
-    TH1F* hFMDReadChannels   = (TH1F*)fListOfHits.FindObject(Form("hFMDReadChannels_vtx%d",v));
-    
-    TH1F* hFMDAllChannels    = (TH1F*)fListOfHits.FindObject(Form("hFMDAllChannels_vtx%d",v));
-    if(hFMDReadChannels) {
-      TH1F* hFMDDeadCorrection = (TH1F*)hFMDReadChannels->Clone("hFMDDeadCorrection");
-      hFMDDeadCorrection->Divide(hFMDAllChannels);
-      fBackground->SetFMDDeadCorrection(v,hFMDDeadCorrection);
-      fListOfCorrection.Add(hFMDDeadCorrection);
-    }
-    else AliWarning("No Dead Channel Correction generated");
-    
-  }
-  
-  Float_t vtxEff = 1;
-  if(hEventsSelectedTrigger->GetEntries())
-    vtxEff = hEventsSelectedVtx->GetEntries() / hEventsSelectedTrigger->GetEntries();
-  fEventSelectionEff->SetVtxToTriggerRatio(vtxEff);
-  
-  //  hEventsAll->Divide(hEventsAll,hEventsSelected,1,1,"B");
-  hEventsSelectedVtx->Divide(hEventsAll);
-  hEventsSelectedTrigger->Divide(hEventsAll);
-  
-  hEventsSelectedNSDVtx->Divide(hEventsAllNSD);
-  hEventsSelectedNSD->Divide(hEventsAllNSD);
-  
-  for(Int_t i = 1; i<=hEventsSelected->GetNbinsX(); i++) {
-    if(hEventsSelected->GetBinContent(i) == 0 )
-      continue;
-    Float_t b    = hEventsSelected->GetBinContent(i);
-    // Float_t b    = hEventsSelected->GetBinContent(i)*hEventsSelectedTrigger->GetBinContent(i);
-    Float_t db   = hEventsSelected->GetBinError(i);
-    Float_t sum  = hEventsAll->GetBinContent(i);
-    Float_t dsum = hEventsAll->GetBinError(i);
-    Float_t a    = sum-b;
-    Float_t da   = TMath::Sqrt(TMath::Power(db,2) + TMath::Power(dsum,2));
-    
-    Float_t cor  = sum / b;
-    Float_t ecor = TMath::Sqrt(TMath::Power(da,2) + TMath::Power(a/(b*db),2)) / b;
-    
-    hEventsAll->SetBinContent(i,cor);
-    hEventsAll->SetBinError(i,ecor);
-    
-  }
-  
-  //TH1F* hEventTest = (TH1F*)hEventsAll->Clone("hEventTest");
-  
-  
-  
-  fEventSelectionEff->SetCorrection(hEventsAll);
-  
-  for(Int_t det= 1; det <=3; det++) {
-    Int_t nRings = (det==1 ? 1 : 2);
-    
-    for(Int_t iring = 0; iring<nRings; iring++) {
-      Char_t ring = (iring == 0 ? 'I' : 'O');
-      TH1F* allHits = (TH1F*)fListOfHits.FindObject(Form("allHits_FMD%d%c",det,ring));
-      TH1F* doubleHits = (TH1F*)fListOfHits.FindObject(Form("DoubleHits_FMD%d%c",det,ring));
-      allHits->Divide(doubleHits);
-      
-      fBackground->SetDoubleHitCorrection(det,ring,allHits);
-      
-      for(Int_t vertexBin=0;vertexBin<fNvtxBins  ;vertexBin++) {
-       TH2F* hHits          = (TH2F*)fListOfHits.FindObject(Form("hHits_FMD%d%c_vtx%d", det,ring,vertexBin));
-       TH2F* hPrimary       = (TH2F*)fListOfPrimaries.FindObject( Form("hPrimary_FMD_%c_vtx%d",ring,vertexBin));
-       TH2F* hCorrection    = (TH2F*)hHits->Clone(Form("FMD%d%c_vtxbin_%d_correction",det,ring,vertexBin));
-       hCorrection->Divide(hPrimary);
-       
-       TH2F* hHitsNSD       = (TH2F*)fListOfHits.FindObject(Form("hHitsNSD_FMD%d%c_vtx%d", det,ring,vertexBin));
-       TH2F* hPrimaryNSD    = (TH2F*)fListOfPrimaries.FindObject( Form("hPrimaryNSD_FMD_%c_vtx%d",ring,vertexBin));
-       TH2F* hCorrectionNSD = 0;
-       if(hHitsNSD && hPrimaryNSD) {
-         hCorrectionNSD = (TH2F*)hHitsNSD->Clone(Form("FMDNSD%d%c_vtxbin_%d_correction",det,ring,vertexBin));
-         hCorrectionNSD->Divide(hPrimaryNSD);
-       }
-       
-       hCorrection->SetTitle(hCorrection->GetName());
-       fListOfCorrection.Add(hCorrection);
-       fBackground->SetBgCorrection(det,ring,vertexBin,hCorrection);
-       
-       if(hCorrectionNSD) {
-         fBackground->SetNSDBgCorrection(det,ring,vertexBin,hCorrectionNSD);
-         hCorrectionNSD->SetTitle(hCorrectionNSD->GetName());
-         fListOfCorrection.Add(hCorrectionNSD);
-       }
-       
-      }
-      
-    }
-  }
-  for(Int_t vertexBin=0;vertexBin<fNvtxBins  ;vertexBin++) {
-    TH2F* hPrimary  = (TH2F*)fListOfPrimaries.FindObject( Form("hPrimary_FMD_%c_vtx%d",'I',vertexBin));
-    TH2F* hSPDMult = (TH2F*)fListOfHits.FindObject(Form("hSPDhits_vtx%d", vertexBin));
-    if(!hSPDMult) continue;
-    
-    TH2F* hCorrection = (TH2F*)hSPDMult->Clone(Form("SPD_vtxbin_%d_correction",vertexBin));
-    hCorrection->SetTitle(hCorrection->GetName());
-    fListOfCorrection.Add(hCorrection);
-    hCorrection->Divide(hPrimary);
-
-    
-    TH1F* hAlive = new TH1F(Form("hAliveSPD_vtxbin%d",vertexBin),Form("hAliveSPD_vtxbin%d",vertexBin),hSPDMult->GetNbinsX(),hSPDMult->GetXaxis()->GetXmin(), hSPDMult->GetXaxis()->GetXmax());
-    TH1F* hPresent = new TH1F(Form("hPresentSPD_vtxbin%d",vertexBin),Form("hPresentSPD_vtxbin%d",vertexBin),hSPDMult->GetNbinsX(),hSPDMult->GetXaxis()->GetXmin(), hSPDMult->GetXaxis()->GetXmax());
-    for(Int_t xx = 1; xx <=hSPDMult->GetNbinsX(); xx++) {
-      
-    
-       
-      for(Int_t yy = 1; yy <=hSPDMult->GetNbinsY(); yy++) {
-       if(TMath::Abs(hCorrection->GetXaxis()->GetBinCenter(xx)) > 1.9) {
-         hCorrection->SetBinContent(xx,yy,0.); 
-         hCorrection->SetBinError(xx,yy,0.); 
-       }
-       
-       if(hCorrection->GetBinContent(xx,yy) > 0.9) {
-         hAlive->Fill(hCorrection->GetXaxis()->GetBinCenter(xx) );
-       }
-       else {
-         hCorrection->SetBinContent(xx,yy,0.); 
-         hCorrection->SetBinError(xx,yy,0.); 
-       }
-       
-       hPresent->Fill(hCorrection->GetXaxis()->GetBinCenter(xx));
-       
-      }
-    }
-    TH1F* hDeadCorrection = (TH1F*)hAlive->Clone(Form("hSPDDeadCorrection_vtxbin%d",vertexBin));
-    hDeadCorrection->Divide(hPresent);
-    fBackground->SetSPDDeadCorrection(vertexBin,hDeadCorrection);
-    fListOfCorrection.Add(hDeadCorrection);
-  
-    fBackground->SetBgCorrection(0,'Q',vertexBin,hCorrection);
-  }
-  
-  
-  TAxis refAxis(fNvtxBins,-1*fZvtxCut,fZvtxCut);
-  fBackground->SetRefAxis(&refAxis);
-
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskGenerateCorrection::ReadFromFile(const Char_t* filename, Bool_t storeInOCDB, Int_t /*runNo*/) {
-  
-  TFile infile(filename);
-  TH1F* hVertex = (TH1F*)infile.Get("VertexBins");
-  fZvtxCut = hVertex->GetXaxis()->GetXmax();
-  fNvtxBins = hVertex->GetXaxis()->GetNbins();
-  fVertexBins.SetName("VertexBins");
-  fVertexBins.GetXaxis()->Set(fNvtxBins,-1*fZvtxCut,fZvtxCut);
-  
-  TList* listOfHits = (TList*)infile.Get("Hits");
-  TList* listOfPrim = (TList*)infile.Get("Primaries");
-  
-  TH1F* hEventsSelected           = (TH1F*)listOfHits->FindObject("EventsSelected");
-  TH1F* hEventsSelectedVtx        = (TH1F*)listOfHits->FindObject("EventsSelectedVtx");
-  TH1F* hEventsSelectedTrigger    = (TH1F*)listOfHits->FindObject("EventsSelectedTrigger");
-  TH1F* hEventsSelectedNSDVtx     = (TH1F*)listOfHits->FindObject("EventsSelectedNSDVtx");
-  TH1F* hEventsSelectedNSD        = (TH1F*)listOfHits->FindObject("EventsSelectedNSD");  
-  TH1F* hEventsAll                = (TH1F*)listOfPrim->FindObject("EventsAll");
-  TH1F* hEventsAllNSD             = (TH1F*)listOfPrim->FindObject("EventsAllNSD");
-  
-  fListOfHits.Add(hEventsSelected);
-  fListOfHits.Add(hEventsSelectedVtx);
-  fListOfHits.Add(hEventsSelectedNSD);
-  fListOfHits.Add(hEventsSelectedNSDVtx);
-  fListOfHits.Add(hEventsSelectedTrigger);
-  fListOfPrimaries.Add(hEventsAll);
-  fListOfPrimaries.Add(hEventsAllNSD);
-  
-  TH1F* hXvtx = (TH1F*)listOfPrim->FindObject("hXvtx");
-  TH1F* hYvtx = (TH1F*)listOfPrim->FindObject("hYvtx");
-  TH1F* hZvtx = (TH1F*)listOfPrim->FindObject("hZvtx");
-  fListOfPrimaries.Add(hXvtx);
-  fListOfPrimaries.Add(hYvtx);
-  fListOfPrimaries.Add(hZvtx);  
-
-  for(Int_t det =1; det<=3;det++)
-    {
-      Int_t nRings = (det==1 ? 1 : 2);
-      for(Int_t ring = 0;ring<nRings;ring++)
-       {
-         Char_t ringChar = (ring == 0 ? 'I' : 'O');
-         TH1F* allHits = (TH1F*)listOfHits->FindObject(Form("allHits_FMD%d%c",det,ringChar));
-         TH1F* doubleHits = (TH1F*)listOfHits->FindObject(Form("DoubleHits_FMD%d%c",det,ringChar));
-         fListOfHits.Add(allHits);
-         fListOfHits.Add(doubleHits);
-         for(Int_t v=0; v<fNvtxBins;v++)
-           {
-             
-             TH2F* hHits          = (TH2F*)listOfHits->FindObject(Form("hHits_FMD%d%c_vtx%d", det,ringChar,v));
-             fListOfHits.Add(hHits);
-             TH2F* hHitsNSD       = (TH2F*)listOfHits->FindObject(Form("hHitsNSD_FMD%d%c_vtx%d", det,ringChar,v));
-             if(hHitsNSD)
-               fListOfHits.Add(hHitsNSD);
-           }
-       }
-    }
-  for(Int_t v=0; v<fNvtxBins;v++) {
-    TH2F* hSPDHits          = (TH2F*)listOfHits->FindObject(Form("hSPDhits_vtx%d", v));   
-    fListOfHits.Add(hSPDHits);
-    TH1F* hFMDReadChannels  = (TH1F*)listOfHits->FindObject(Form("hFMDReadChannels_vtx%d",v));
-    TH1F* hFMDAllChannels   = (TH1F*)listOfHits->FindObject(Form("hFMDAllChannels_vtx%d",v));
-    
-    if(hFMDReadChannels && hFMDAllChannels) {
-      fListOfHits.Add(hFMDReadChannels);
-      fListOfHits.Add(hFMDAllChannels);
-    }
-    for(Int_t iring = 0; iring<2;iring++) {
-      Char_t ringChar = (iring == 0 ? 'I' : 'O');
-      
-      
-      TH2F* hPrimary       = (TH2F*)listOfPrim->FindObject( Form("hPrimary_FMD_%c_vtx%d",ringChar,v));
-      TH2F* hPrimaryNSD       = (TH2F*)listOfPrim->FindObject( Form("hPrimaryNSD_FMD_%c_vtx%d",ringChar,v));
-      
-      TH2F* hAnalysed      = (TH2F*)listOfPrim->FindObject(Form("Analysed_FMD%c_vtx%d",ringChar,v));
-      TH2F* hAnalysedNSD   = (TH2F*)listOfPrim->FindObject(Form("AnalysedNSD_FMD%c_vtx%d",ringChar,v));
-      TH2F* hInel          = (TH2F*)listOfPrim->FindObject(Form("Inel_FMD%c_vtx%d",ringChar,v));
-      TH2F* hNSD           = (TH2F*)listOfPrim->FindObject(Form("NSD_FMD%c_vtx%d",ringChar,v));
-      
-      fListOfPrimaries.Add(hPrimary);      
-      if(hPrimaryNSD)
-       fListOfPrimaries.Add(hPrimaryNSD); 
-      fListOfPrimaries.Add(hAnalysed);
-      fListOfPrimaries.Add(hInel);      
-      fListOfPrimaries.Add(hAnalysedNSD);
-      fListOfPrimaries.Add(hNSD);      
-    }
-  }
-  GenerateCorrection();
-  
-  TFile fout("backgroundFromFile.root","recreate");
-  fListOfHits.Write();
-  fListOfPrimaries.Write();
-  fListOfCorrection.Write();
-  fVertexBins.Write();
-  
-  fout.Close();
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  if (!storeInOCDB) {
-    pars->SetBackgroundPath(".");
-    pars->SetEnergyPath(".");
-    pars->SetEventSelectionPath(".");
-    pars->SetSharingEfficiencyPath(".");
-  }
-  AliInfo(Form("Generating %s", pars->GetPath(pars->GetBackgroundID())));
-  TFile fbg(pars->GetPath(pars->GetBackgroundID()),"RECREATE");
-  fBackground->Write(AliFMDAnaParameters::GetBackgroundID());
-  fbg.Close();
-
-  AliInfo(Form("Generating %s", pars->GetPath(pars->GetEventSelectionEffID())));
-  TFile feselect(pars->GetPath(pars->GetEventSelectionEffID()),"RECREATE");
-  fEventSelectionEff->Write(AliFMDAnaParameters::GetEventSelectionEffID());
-  feselect.Close();
-}
-//_____________________________________________________________________
-//
-// EOF
-//
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskGenerateCorrection.h b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskGenerateCorrection.h
deleted file mode 100644 (file)
index 7144332..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef ALIFMDANALYSISTASKGENERATECORRECTION_H
-#define ALIFMDANALYSISTASKGENERATECORRECTION_H
-
-#include "AliAnalysisTaskSE.h"
-#include "TList.h"
-#include "AliFMDFloatMap.h"
-#include "TH1F.h"
-
-class AliFMDAnaCalibBackgroundCorrection;
-class AliFMDAnaCalibEventSelectionEfficiency;
-
-class AliFMDAnalysisTaskGenerateCorrection : public AliAnalysisTaskSE
-{
- public:
-  AliFMDAnalysisTaskGenerateCorrection();
-    AliFMDAnalysisTaskGenerateCorrection(const char* name);
-    ~AliFMDAnalysisTaskGenerateCorrection() {;}
- AliFMDAnalysisTaskGenerateCorrection(const AliFMDAnalysisTaskGenerateCorrection& o) : AliAnalysisTaskSE(), 
-      fListOfHits(), 
-      fListOfPrimaries(),
-      fListOfCorrection(),
-      fVertexBins(o.fVertexBins),
-      fLastTrackByStrip(o.fLastTrackByStrip),
-      fHitsByStrip(o.fHitsByStrip),
-      fZvtxCut(o.fZvtxCut),
-      fNvtxBins(o.fNvtxBins),
-      fNbinsEta(o.fNbinsEta),
-      fBackground(o.fBackground),
-      fEventSelectionEff(o.fEventSelectionEff),
-      fEtaLow(o.fEtaLow),
-      fEtaHigh(o.fEtaHigh)
-      {}
-    AliFMDAnalysisTaskGenerateCorrection& operator=(const AliFMDAnalysisTaskGenerateCorrection&) { return *this; }
-    
-    virtual void Init();
-    virtual void UserCreateOutputObjects();
-    virtual void UserExec(Option_t* /*option*/);
-    void  Terminate(Option_t */*option*/);
-    void SetZvtxCut(Float_t vtxcut) {fZvtxCut = vtxcut;}
-    void SetNvtxBins(Int_t nvtxbins) {fNvtxBins = nvtxbins;}
-    void SetNbinsEta(Int_t netabins) {fNbinsEta = netabins;}
-    void SetEtaLimits(Double_t low, Double_t high) {fEtaLow = low; fEtaHigh = high;}
-    void ReadFromFile(const Char_t* filename = "background.root", Bool_t storeInOCDB = kFALSE, Int_t runNo=0);
- private:
-    
-    void GenerateCorrection();
-    
-    TList fListOfHits;
-    TList fListOfPrimaries;
-    TList fListOfCorrection;
-    TH1F  fVertexBins;
-    AliFMDFloatMap fLastTrackByStrip;
-    AliFMDFloatMap fHitsByStrip;
-    Float_t fZvtxCut;
-    Int_t fNvtxBins;
-    Int_t fNbinsEta;
-    AliFMDAnaCalibBackgroundCorrection* fBackground;
-    AliFMDAnaCalibEventSelectionEfficiency*     fEventSelectionEff;
-    Double_t fEtaLow;
-    Double_t fEtaHigh;
-    ClassDef(AliFMDAnalysisTaskGenerateCorrection, 1);
-
-};
-#endif
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskSE.cxx b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskSE.cxx
deleted file mode 100644 (file)
index dbdb027..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-#include "AliFMDAnalysisTaskSE.h"
-#include "AliESDEvent.h"
-#include "iostream"
-#include "AliESDFMD.h"
-#include "AliMCEventHandler.h"
-#include "AliAnalysisManager.h"
-#include "AliFMDAnaParameters.h"
-#include "AliLog.h"
-#include "AliFMDDndeta.h"
-#include "TDirectory.h"
-#include "TProfile2D.h"
-ClassImp(AliFMDAnalysisTaskSE)
-//
-// This task controls the running of the FMD analysis. The current version is made for 
-// dN/deta analysis but multiplicity and correlation tasks will be added here as well.
-//
-// To get the dN/detadphi per selected event as a TH2F* object connect to the 
-// output list of this task in the analysis framework and do
-//
-// TH2F* hFMDdNdetadphi = (TH2F*)list->FindObject("dNdetadphiHistogramTrVtx");
-//_____________________________________________________________________
-AliFMDAnalysisTaskSE::AliFMDAnalysisTaskSE():
-AliAnalysisTaskSE(),
-  fListOfHistos(0),
-  fSharing("Sharing",kFALSE),
-  fDensity("Density",kFALSE),
-  fBackground("BackgroundCorrected",kFALSE),
-  fDndeta("dNdeta",kFALSE), 
-  fBFCorrelation("BFCorrelation",kFALSE), 
-  fParams(0),
-  fFirstEvent(kTRUE),
-  fCentralityLow(0),
-  fCentralityHigh(100)
-{
-  // Default constructor
-}
-//_____________________________________________________________________
-AliFMDAnalysisTaskSE::AliFMDAnalysisTaskSE(const char* name):
-  AliAnalysisTaskSE(name),
-  fListOfHistos(0),
-  fSharing("Sharing",kFALSE),
-  fDensity("Density",kFALSE),
-  fBackground("BackgroundCorrected",kFALSE),
-  fDndeta("dNdeta",kFALSE), 
-  fBFCorrelation("BFCorrelation",kFALSE), 
-  fParams(0),
-  fFirstEvent(kTRUE),
-  fCentralityLow(0),
-  fCentralityHigh(100)
-{
-  SetParams(AliFMDAnaParameters::Instance());
-  DefineOutput(1, TList::Class());
-  // DefineOutput(2, TH2F::Class());
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskSE::UserCreateOutputObjects()
-{
-// Create the output containers
-//
-  
-  
-  fListOfHistos = new TList();
-  
-  AliESDFMD* fmd = new AliESDFMD();
-  AliESDVertex* vertex = new AliESDVertex();
-  
-  TList* densitylist = new TList();
-  
-  TList* bgcorlist = new TList();
-    
-  fSharing.SetFMDData(fmd);
-  fSharing.SetVertex(vertex);
-  fSharing.SetOutputList(fListOfHistos);
-  
-  fDensity.Init();
-  fDensity.SetOutputList(densitylist);
-  fDensity.SetInputESDFMD(fmd) ;
-  fDensity.SetInputVertex(vertex);
-  
-  fBackground.SetInputList(densitylist);
-  fBackground.SetOutputList(bgcorlist);
-  fBackground.SetHitList(fListOfHistos);
-
-  fDndeta.SetInputList(bgcorlist); 
-  fDndeta.SetOutputList(fListOfHistos); 
-  fBFCorrelation.SetInputList(bgcorlist); 
-  fBFCorrelation.SetOutputList(fListOfHistos); 
-  
-  fSharing.CreateOutputObjects();
-  fDensity.CreateOutputObjects();
-  fBackground.CreateOutputObjects();
-  fDndeta.CreateOutputObjects();
-  fBFCorrelation.CreateOutputObjects();
-  
-  PostData(1, fListOfHistos);
-  
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskSE::Init()
-{
-  std::cout<<"Init"<<std::endl;
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskSE::UserExec(Option_t */*option*/)
-{
-  // Execute analysis for current event
-  //
-  AliESDEvent* fESD = (AliESDEvent*)InputEvent();
-  
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  
-  // Centrality selection - work in progress
-  Float_t centrality = 1;
-  if( centrality < fCentralityLow || centrality > fCentralityHigh )  return;
-  
-  //End of centrality selection
-  
-  if(fFirstEvent) {
-    pars->SetParametersFromESD(fESD);
-    pars->PrintStatus();
-    fFirstEvent = kFALSE;
-  }
-  
-  pars->SetTriggerStatus(fESD);
-  fSharing.SetInputESD(fESD);
-  
-  fSharing.Exec("");
-  if(fSharing.GetEventStatus()) {
-    fDensity.Exec("");
-    if(fDensity.GetEventStatus()) {
-      fBackground.Exec("");  
-      if(pars->GetRunDndeta())        fDndeta.Exec("");
-      if(pars->GetRunBFCorrelation()) fBFCorrelation.Exec("");
-    }
-    else return;
-  }
-  else return;
-  
-  PostData(1, fListOfHistos);
-     
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskSE::Terminate(Option_t */*option*/)
-{
-  
-  TList* outputList = (TList*)GetOutputData(1);
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  
-  if(outputList) {
-    fSharing.SetOutputList(outputList);
-    fBackground.SetHitList(outputList);
-    fDndeta.SetOutputList(outputList); 
-    //fBFCorrelation.SetOutputList(outputList); 
-    fSharing.Terminate("");
-    fBackground.Terminate("");
-    if(fSharing.GetVtxEfficiencyFromData() > 0)
-      fDndeta.SetVtxEfficiency(fSharing.GetVtxEfficiencyFromData());
-    else
-      fDndeta.SetVtxEfficiency(pars->GetVtxSelectionEffFromMC());
-    
-    AliInfo(Form("Vertex efficiencies:  NSD_data=%f, INEL_data=%f, INEL_mc=%f", 
-                fSharing.GetNSDVtxEfficiencyFromData(),
-                fSharing.GetVtxEfficiencyFromData(),
-                pars->GetVtxSelectionEffFromMC()));
-    
-    if(fSharing.GetNSDVtxEfficiencyFromData() > 0)
-      fDndeta.SetVtxEfficiencyNSD(fSharing.GetNSDVtxEfficiencyFromData());
-    else
-      fDndeta.SetVtxEfficiencyNSD(pars->GetVtxSelectionEffFromMC());
-    
-    fDndeta.Terminate("");
-    //fBFCorrelation.Terminate("");
-    
-    AliFMDDndeta t;
-    t.SetNbinsToCut(2);
-    t.Init(outputList);
-    t.GenerateMult(AliFMDDndeta::kMult);
-    
-    TList* dNdetalist = t.GetMultList(AliFMDDndeta::kMult);
-    TList* cloneList = (TList*)dNdetalist->Clone("dNdeta");
-    cloneList->SetName("dNdeta");
-    outputList->Add(cloneList);
-    
-    t.GenerateMult(AliFMDDndeta::kMultTrVtx);
-    TList* dNdetalist2 = t.GetMultList(AliFMDDndeta::kMultTrVtx);
-    TList* cloneList2 = (TList*)dNdetalist2->Clone("dNdetaTrVtx");
-    cloneList2->SetName("dNdetaTrVtx");
-    outputList->Add(cloneList2);
-  
-    t.GenerateMult(AliFMDDndeta::kHits);
-    TList* dNdetalist3 = t.GetMultList(AliFMDDndeta::kHits);
-    TList* cloneList3 = (TList*)dNdetalist3->Clone("Hits");
-    cloneList3->SetName("Hits");
-    outputList->Add(cloneList3);
-    
-    t.GenerateMult(AliFMDDndeta::kHitsTrVtx);
-    TList* dNdetalist4 = t.GetMultList(AliFMDDndeta::kHits);
-    TList* cloneList4 = (TList*)dNdetalist4->Clone("HitsTrVtx");
-    cloneList4->SetName("HitsTrVtx");
-    outputList->Add(cloneList4);
-    
-    t.GenerateMult(AliFMDDndeta::kMultNSD);
-    TList* dNdetalist5 = t.GetMultList(AliFMDDndeta::kMultNSD);
-    TList* cloneList5 = (TList*)dNdetalist5->Clone("MultNSD");
-    cloneList5->SetName("MultNSD");
-    outputList->Add(cloneList5);
-    
-    // TFile file("fmd_ana_histos_tmp.root","RECREATE");
-    //  fListOfHistos->Write();
-    // file.Close();
-  }
-  else
-    AliWarning("no merged output from manager");
-  
-  
-}
-
-//_____________________________________________________________________
-void AliFMDAnalysisTaskSE::Print(Option_t* option) const
-{
-  AliInfo(Form("FMD Single Event Analysis Task\n"
-              "Parameters set to %p", fParams));
-  TString opt(option);
-  opt.ToLower();
-  if (opt.Contains("s")) { 
-    fSharing.Print(option);     
-    fDensity.Print(option);     
-    fBackground.Print(option);  
-    fDndeta.Print(option); 
-    fBFCorrelation.Print(option); 
-  }
-  if (opt.Contains("p") && fParams) 
-    fParams->Print(option);      
-}
-
-//_____________________________________________________________________
-//
-// EOF
-//
-// EOF
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskSE.h b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskSE.h
deleted file mode 100644 (file)
index 18c4d30..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef ALIFMDANALYSISTASKSE_H
-#define ALIFMDANALYSISTASKSE_H
-
-#include "AliAnalysisTaskSE.h"
-#include "AliFMDAnalysisTaskSharing.h"
-#include "AliFMDAnalysisTaskDensity.h"
-#include "AliFMDAnalysisTaskBackgroundCorrection.h"
-#include "AliFMDAnalysisTaskDndeta.h"
-#include "AliFMDAnalysisTaskBFCorrelation.h"
-
-class AliFMDAnaParameters;
-
-/** @defgroup FMD_ana Analysis tasks 
-    @brief Various classes to do analysis tasks 
-*/
-
-/**
- * @class AliFMDAnalysisTaskSE
- * @brief Collected analysis task 
- * @ingroup FMD_ana
- *
- * Collector of various analysis tasks.  It will do the full chain of 
- * analysis tasks:
- *
- * - AliFMDAnalysisTaskSharing
- * - AliFMDAnalysisTaskDensity
- * - AliFMDAnalysisTaskBackgroundCorrection
- * - AliFMDAnalysisTaskDndeta
- * - AliFMDAnalysisTaskBFCorrelation
- */
-
-class AliFMDAnalysisTaskSE : public AliAnalysisTaskSE
-{
-public:                                // 
-  AliFMDAnalysisTaskSE();
-  AliFMDAnalysisTaskSE(const char* name);
-  virtual ~AliFMDAnalysisTaskSE() {;}
-  AliFMDAnalysisTaskSE(const AliFMDAnalysisTaskSE& o) 
-    : AliAnalysisTaskSE(),
-      fListOfHistos(o.fListOfHistos),
-      fSharing(o.fSharing),
-      fDensity(o.fDensity),
-      fBackground(o.fBackground),
-      fDndeta(o.fDndeta),   
-      fBFCorrelation(o.fBFCorrelation), 
-      fParams(o.fParams),
-      fFirstEvent(o.fFirstEvent),
-      fCentralityLow(o.fCentralityLow),
-      fCentralityHigh(o.fCentralityHigh)
-  {}
-  AliFMDAnalysisTaskSE& operator=(const AliFMDAnalysisTaskSE&) { return *this; }
-  
-  virtual void Init();
-  virtual void UserCreateOutputObjects();
-  virtual void UserExec(Option_t* /*option*/);
-  void         Terminate(Option_t */*option*/);
-  void         SetParams(AliFMDAnaParameters* p) { fParams = p; }
-  void         Print(Option_t* option="") const ;
-  
-private:
-  
-  TList*                                 fListOfHistos;   // Output list
-  AliFMDAnalysisTaskSharing              fSharing;        // Sharing task
-  AliFMDAnalysisTaskDensity              fDensity;        // Density task
-  AliFMDAnalysisTaskBackgroundCorrection fBackground;     // Background task
-  AliFMDAnalysisTaskDndeta               fDndeta;         // dN/deta task
-  AliFMDAnalysisTaskBFCorrelation        fBFCorrelation;  // BF correlation task
-  AliFMDAnaParameters*                   fParams;         // Analysis parameters
-  Bool_t                                 fFirstEvent;     // Is the next event the first event ?
-  Float_t                                fCentralityLow;  // Low centrality
-  Float_t                                fCentralityHigh; // High centrality
-  
-  ClassDef(AliFMDAnalysisTaskSE, 1);
-
-};
-#endif
-// Local Variables:
-//  mode: C++ 
-// End:
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskSharing.cxx b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskSharing.cxx
deleted file mode 100644 (file)
index b043ecf..0000000
+++ /dev/null
@@ -1,924 +0,0 @@
-#include <TROOT.h>
-#include <TSystem.h>
-#include <TInterpreter.h>
-#include <TChain.h>
-#include <TFile.h>
-#include <TList.h>
-#include <iostream>
-#include <TMath.h>
-//#include "AliFMDDebug.h"
-#include "AliFMDAnalysisTaskSharing.h"
-#include "AliAnalysisManager.h"
-#include "AliESDFMD.h"
-//#include "AliFMDGeometry.h"
-#include "AliMCEventHandler.h"
-#include "AliMCEvent.h"
-#include "AliStack.h"
-#include "AliESDVertex.h"
-#include "AliMultiplicity.h"
-#include "AliFMDAnaParameters.h"
-#include "TH1F.h"
-#include "TObjString.h"
-//#include "/home/canute/ALICE/AliRoot/PWG0/AliPWG0Helper.h"
-//#include "AliFMDParameters.h"
-#include "AliGenEventHeader.h"
-#include "AliGenPythiaEventHeader.h"
-#include "AliHeader.h"
-#include "AliStack.h"
-#include "AliMCParticle.h"
-#include "AliFMDStripIndex.h"
-#include "AliESDVZERO.h"
-#include "AliESDtrack.h"
-#include "AliGenDPMjetEventHeader.h"
-#include "AliLog.h"
-
-// This is the task to do the FMD sharing or hit merging.
-// It reads the input ESDFMD data and posts an ESDFMD object to
-// the tasks that must be performed after this task ie.
-// Density, BackgroundCorrection and Dndeta.
-// Author: Hans Hjersing Dalsgaard, hans.dalsgaard@cern.ch
-
-ClassImp(AliFMDAnalysisTaskSharing)
-
-//_____________________________________________________________________
-AliFMDAnalysisTaskSharing::AliFMDAnalysisTaskSharing()
-: fDebug(0),
-  fESD(0x0),
-  foutputESDFMD(),
-  fSharedThis(kFALSE),
-  fSharedPrev(kFALSE),
-  fDiagList(0),
-  fStandalone(kTRUE),
-  fEsdVertex(0),
-  fStatus(kTRUE),
-  fLastTrackByStrip(0),
-  fLastOrbit(0)
-{
-  // Default constructor
-  DefineInput (0, AliESDEvent::Class());
-  DefineOutput(0, AliESDFMD::Class());
-  DefineOutput(1, AliESDVertex::Class());
-  DefineOutput(2, AliESDEvent::Class());
-  DefineOutput(3, TList::Class());
-}
-//_____________________________________________________________________
-AliFMDAnalysisTaskSharing::AliFMDAnalysisTaskSharing(const char* name, 
-                                                    Bool_t SE):
-    AliAnalysisTask(name, "AnalysisTaskFMD"),
-    fDebug(0),
-    fESD(0x0),
-    foutputESDFMD(),
-    fSharedThis(kFALSE),
-    fSharedPrev(kFALSE),
-    fDiagList(0),
-    fStandalone(kTRUE),
-    fEsdVertex(0),
-    fStatus(kTRUE),
-    fLastTrackByStrip(0),
-    fLastOrbit(0)
-{
-  // named constructor
-  fStandalone = SE;
-  if(fStandalone) {
-    DefineInput (0, AliESDEvent::Class());
-    DefineOutput(0, AliESDFMD::Class());
-    DefineOutput(1, AliESDVertex::Class());
-    DefineOutput(2, AliESDEvent::Class());
-    DefineOutput(3, TList::Class());
-  }
-}
-//_____________________________________________________________________
-Float_t AliFMDAnalysisTaskSharing::GetVtxEfficiencyFromData(){
-  
-  TH1F* hEventsVtx = (TH1F*)fDiagList->FindObject("hEventsVtx");
-  TH1F* hEventsTr  = (TH1F*)fDiagList->FindObject("hEventsTr");
-  
-  if(hEventsTr->GetEntries()  != 0 && 
-     hEventsVtx->GetEntries() != 0 && 
-     hEventsTr->GetEntries()  != hEventsVtx->GetEntries())
-    return hEventsVtx->GetEntries() / hEventsTr->GetEntries();
-  else return -1;
-  
-}
-//_____________________________________________________________________
-Float_t AliFMDAnalysisTaskSharing::GetNSDVtxEfficiencyFromData()
-{
-  
-  TH1F* hEventsNSDVtx = (TH1F*)fDiagList->FindObject("hEventsNSDVtx");
-  TH1F* hEventsNSD    = (TH1F*)fDiagList->FindObject("hEventsNSD");
-  
-  if(hEventsNSD->GetEntries()    != 0 && 
-     hEventsNSDVtx->GetEntries() != 0 && 
-     hEventsNSD->GetEntries()    != hEventsNSDVtx->GetEntries())
-    return hEventsNSDVtx->GetEntries() / hEventsNSD->GetEntries();
-  else return -1;
-  
-}
-
-
-//_____________________________________________________________________
-void AliFMDAnalysisTaskSharing::CreateOutputObjects()
-{
-  // Create the output objects
-  if(!foutputESDFMD)
-    foutputESDFMD = new AliESDFMD();
-  
-  if(!fEsdVertex)
-    fEsdVertex    = new AliESDVertex();
-  //Diagnostics
-  if(!fDiagList)
-    fDiagList = new TList();
-  
-  fDiagList->SetName("Sharing diagnostics");
-  
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  TH2F* hBg                 = pars->GetBackgroundCorrection(1, 'I', 0);
-  TH1F* hPrimary            = new TH1F("hMultvsEtaNoCuts","hMultvsEtaNoCuts",
-                                      hBg->GetNbinsX(),
-                                      hBg->GetXaxis()->GetXmin(),
-                                      hBg->GetXaxis()->GetXmax());
-  hPrimary->Sumw2();
-  fDiagList->Add(hPrimary);
-  
-  TH1F* hPrimaryNSD = new TH1F("hMultvsEtaNSDNoCuts","hMultvsEtaNSDNoCuts",
-                              hBg->GetNbinsX(),
-                              hBg->GetXaxis()->GetXmin(),
-                              hBg->GetXaxis()->GetXmax());
-  hPrimaryNSD->Sumw2();
-  fDiagList->Add(hPrimaryNSD);
-  
-  TH1F* hXvtx = new TH1F("hXvtx","x vertex distribution",100,-2,2);
-  TH1F* hYvtx = new TH1F("hYvtx","y vertex distribution",100,-2,2);
-  TH1F* hZvtx = new TH1F("hZvtx","z vertex distribution",
-                        4*pars->GetNvtxBins(),
-                        -4*pars->GetVtxCutZ(),
-                        +4*pars->GetVtxCutZ());
-  
-  fDiagList->Add(hXvtx);
-  fDiagList->Add(hYvtx);
-  fDiagList->Add(hZvtx);
-  
-  TH1F* hPrimVertexBin = 0;
-  TH1F* hHits = 0;
-  for(Int_t i = 0; i< pars->GetNvtxBins(); i++) {
-    
-    hPrimVertexBin = new TH1F(Form("primmult_NoCuts_vtxbin%d",i),
-                             Form("primmult_NoCuts_vtxbin%d",i),
-                             hBg->GetNbinsX(),
-                             hBg->GetXaxis()->GetXmin(),
-                             hBg->GetXaxis()->GetXmax());
-    hPrimVertexBin->Sumw2();
-    fDiagList->Add(hPrimVertexBin);
-    
-  }
-  
-  for(Int_t det = 1; det<=3; det++) {
-    Int_t nRings = (det==1 ? 1 : 2);
-    
-    for(Int_t iring = 0;iring<nRings; iring++) {
-      Char_t ringChar = (iring == 0 ? 'I' : 'O');
-      TH1F* hEdist        = new TH1F(Form("Edist_before_sharing_FMD%d%c", det, ringChar),
-                                    Form("Edist_before_sharing_FMD%d%c", det, ringChar),
-                                    1000,0,25);
-      TH1F* hEdistAfter  = new TH1F(Form("Edist_after_sharing_FMD%d%c", det, ringChar),
-                                    Form("Edist_after_sharing_FMD%d%c", det, ringChar),
-                                    1000,0,25);
-      
-      
-      //TH1F* hNstripsHit    = new TH1F(Form("N_strips_hit_FMD%d%c",det,ringChar),
-      //                                    Form("N_strips_hit_FMD%d%c",det,ringChar),
-      //                                    25,0,25);
-      fDiagList->Add(hEdist);
-      fDiagList->Add(hEdistAfter);
-      //fDiagList->Add(hNstripsHit);
-      
-      for(Int_t i = 0; i< pars->GetNvtxBins(); i++) {
-       hHits  = new TH1F(Form("hMCHits_nocuts_FMD%d%c_vtxbin%d",det,ringChar,i),Form("hMCHits_FMD%d%c_vtxbin%d",det,ringChar,i),
-                         hBg->GetNbinsX(),
-                         hBg->GetXaxis()->GetXmin(),
-                         hBg->GetXaxis()->GetXmax());
-       hHits->Sumw2();
-       fDiagList->Add(hHits);
-
-      }
-      
-    }
-  }
-  TH2F*  hCorrelationFMDSPDhits = new TH2F("hCorrelationFMDSPDhits","hCorrelationFMDSPDhits;SPD;FMD ",100,0,200,100,0,500);
-  TH2F*  hCorrelationFMDSPD = new TH2F("hCorrelationFMDSPD","hCorrelationFMDSPD;SPD;FMD ",100,0,200,100,0,500);
-  TH2F*  hCorrelationFMD1SPD = new TH2F("hCorrelationFMD1SPD","hCorrelationFMD1SPD;SPD;FMD1 ",100,0,200,100,0,200);
-  TH2F*  hCorrelationFMD2ISPD = new TH2F("hCorrelationFMD2ISPD","hCorrelationFMD2ISPD;SPD;FMD2I ",100,0,200,100,0,200);
-  TH2F*  hCorrelationFMD2OSPD = new TH2F("hCorrelationFMD2OSPD","hCorrelationFMD2OSPD;SPD;FMD2O ",100,0,200,100,0,200);
-  TH2F*  hCorrelationFMD3ISPD = new TH2F("hCorrelationFMD3ISPD","hCorrelationFMD3ISPD;SPD;FMD3I ",100,0,200,100,0,200);
-  TH2F*  hCorrelationFMD3OSPD = new TH2F("hCorrelationFMD3OSPD","hCorrelationFMD3OSPD;SPD;FMD3O ",100,0,200,100,0,200);
-  TH2F*  hCorrelationFMDGoodtracks = new TH2F("hCorrelationFMDGoodtracks","hCorrelationGoodtracks;good tracks;FMD ",100,0,200,100,0,200);
-  TH2F*  hCorrelationFMDBadtracks = new TH2F("hCorrelationFMDBadtracks","hCorrelationBadtracks;bad tracks;FMD ",100,0,200,100,0,200);
-  TH2F*  hCorrelationGoodbadtracks = new TH2F("hCorrelationGoodbadtracks","hCorrelationGoodbadtracks;good tracks;bad tracks ",100,0,200,100,0,200);
-  TH2F*  hCorrelationSPDTracklets = new TH2F("hCorrelationSPDTracklets","hCorrelationSPDTracklets;hits ; tracklets ",100,0,500,100,0,200);
-  TH2F*  hCorrelationClustersTracklets = new TH2F("hCorrelationClustersTracklets","hCorrelationClustersTracklets;clusters ; tracklets ",500,0,500,100,0,100);
-  TH2F*  hCorrelationHitsRadius = new TH2F("hCorrelationHitsRadius","hCorrelationHitsRadius;hits ; radius ",100,0,500,100,0,10);
-  TH2F*  hCorrelationHitsX = new TH2F("hCorrelationHitsX","hCorrelationHitsX;hits ; X ",100,0,500,100,-5,5);
-  TH2F*  hCorrelationHitsY = new TH2F("hCorrelationHitsY","hCorrelationHitsY;hits ; Y ",100,0,500,100,-5,5);
-  fDiagList->Add(hCorrelationHitsRadius);
-  fDiagList->Add(hCorrelationHitsX);
-  fDiagList->Add(hCorrelationHitsY);
-  fDiagList->Add(hCorrelationFMDSPD);
-  fDiagList->Add(hCorrelationFMD1SPD);
-  fDiagList->Add(hCorrelationFMD2ISPD);
-  fDiagList->Add(hCorrelationFMD2OSPD);
-  fDiagList->Add(hCorrelationFMD3ISPD);
-  fDiagList->Add(hCorrelationFMD3OSPD);
-  fDiagList->Add(hCorrelationFMDGoodtracks);
-  fDiagList->Add(hCorrelationFMDBadtracks);
-  fDiagList->Add(hCorrelationGoodbadtracks);
-fDiagList->Add(hCorrelationFMDSPDhits);
-  fDiagList->Add(hCorrelationClustersTracklets);
-  fDiagList->Add(hCorrelationSPDTracklets);
-  TH2F*  hCorrelationFMD23 = new TH2F("hCorrelationFMD23","hCorrelationFMD23;FMD2 ;FMD3 ",100,0,500,100,0,500);
-  TH2F*  hCorrelationFMD2diff23 = new TH2F("hCorrelationFMD2diff23","hCorrelationFMD2diff23;FMD2 ;diff FMD23 ",100,0,100,100,0,100);
-  TH2F*  hCorrelationFMD3diff23 = new TH2F("hCorrelationFMD3diff23","hCorrelationFMD3diff23;FMD3 ;diff FMD23 ",100,0,100,100,0,100);
-  TH2F*  hCorrelationFMD1diff13 = new TH2F("hCorrelationFMD1diff13","hCorrelationFMD1diff13;FMD1 ;diff FMD13 ",100,0,100,100,0,100);
-  TH2F*  hCorrelationFMD1diff12 = new TH2F("hCorrelationFMD1diff12","hCorrelationFMD1diff12;FMD1 ;diff FMD12 ",100,0,100,100,0,100);
-  TH2F*  hCorrelationFMD12 = new TH2F("hCorrelationFMD12","hCorrelationFMD12;FMD1 ;FMD2 ",100,0,500,100,0,500);
-  TH2F* hCorrelationFMDBgCand = new TH2F("hCorrelationFMDBgCand","hCorrelationFMDBgCand;Bg Tr ;FMD ",100,0,100,500,0,500);
-  
-  TH2F* hCorrelationFMDFlatTr = new TH2F("hCorrelationFMDFlatTr","hCorrelationFMDFlatTr;Bg Tr ;FMD ",100,0,100,500,0,500);
-  TH2F* hCorrelationFMDRatioFlatTr = new TH2F("hCorrelationFMDRatioFlatTr","hCorrelationFMDRatioFlatTr;Bg Tr ;FMD ",100,0,1,500,0,500);
-  fDiagList->Add(hCorrelationFMDBgCand);
-  fDiagList->Add(hCorrelationFMDFlatTr);
-  fDiagList->Add(hCorrelationFMDRatioFlatTr);
-  TH2F* hCorrelationFMDBgCandRelative = new TH2F("hCorrelationFMDBgCandRelative","hCorrelationFMDBgCandRelative;Bg Tr ;FMD ",100,0,2,500,0,500);
-  fDiagList->Add(hCorrelationFMDBgCandRelative);
-  fDiagList->Add(hCorrelationFMD2diff23);
-  fDiagList->Add(hCorrelationFMD3diff23);
-  fDiagList->Add(hCorrelationFMD1diff13);
-  fDiagList->Add(hCorrelationFMD1diff12);
-  fDiagList->Add(hCorrelationFMD23);
-  fDiagList->Add(hCorrelationFMD12);
-  TH2F*  hTimeCorrelation = new TH2F("hCorrelationTime","hCorrelationTime ; time ; FMD hits",500,0,500,100,0,200);
-  fDiagList->Add(hTimeCorrelation);
-  TH1F*  hHitDistribution = new TH1F("hFMDHitDistribution","hFMDHitDistribution ; FMD hits",500,0,500);
-
-  TH1F*  hHitDistributionFMD1 = new TH1F("hFMDHitDistributionFMD1","hFMDHitDistributionFMD1 ; FMD1 hits",500,0,500);
-  TH1F*  hHitDistributionFMD2I = new TH1F("hFMDHitDistributionFMD2I","hFMDHitDistributionFMD2I ; FMD2I hits",500,0,500);
-  TH1F*  hHitDistributionFMD2O = new TH1F("hFMDHitDistributionFMD2O","hFMDHitDistributionFMD2O ; FMD2O hits",500,0,500);
-  TH1F*  hHitDistributionFMD3I = new TH1F("hFMDHitDistributionFMD3I","hFMDHitDistributionFMD3I ; FMD3I hits",500,0,500);
-  TH1F*  hHitDistributionFMD3O = new TH1F("hFMDHitDistributionFMD3O","hFMDHitDistributionFMD3O ; FMD3O hits",500,0,500);
-  TH1F*  hTrVtxDistribution = new TH1F("hTrVtxDistribution","hTrVtxDistribution ; TrVtx",200,-500,500);
-  TH1F*  hTrEtaDistribution = new TH1F("hTrEtaDistribution","hTrEtaDistribution ; TrEta",200,-9,9);
-  TH1F*  hTrEtaDistribution2 = new TH1F("hTrEtaDistribution2","hTrEtaDistribution2 ; TrEta",200,-9,9);
-  
- TH1F*  hFlatTracks = new TH1F("hFlatTracks","hFlatTracks ; Horizontal tracks",100,0,100);
- TH1F* hEnergyOfParticles = new TH1F("hEnergyOfParticles","hEnergyOfParticles",1000000,0,10);
- fDiagList->Add(hEnergyOfParticles);
- fDiagList->Add(hTrVtxDistribution);
- fDiagList->Add(hTrEtaDistribution);
- fDiagList->Add(hTrEtaDistribution2);
-  fDiagList->Add(hFlatTracks);
-  fDiagList->Add(hHitDistribution);
-  fDiagList->Add(hHitDistributionFMD1);
-  fDiagList->Add(hHitDistributionFMD2I);
-  fDiagList->Add(hHitDistributionFMD2O);
-  fDiagList->Add(hHitDistributionFMD3I);
-  fDiagList->Add(hHitDistributionFMD3O);
-  TH1F*  nMCevents = new TH1F("nMCEventsNoCuts","nMCEventsNoCuts",pars->GetNvtxBins(),0,pars->GetNvtxBins());
-  TH1F*  nMCeventsNSD= new TH1F("nMCEventsNSDNoCuts","nMCEventsNSDNoCuts",pars->GetNvtxBins(),0,pars->GetNvtxBins());
-  fDiagList->Add(nMCevents);
-  fDiagList->Add(nMCeventsNSD);
-  
-  TH1F*  hEventsVtx     = new TH1F("hEventsVtx","hEventsVtx",pars->GetNvtxBins(),0,pars->GetNvtxBins());
-  TH1F*  hEventsTr      = new TH1F("hEventsTr","hEventsTr",pars->GetNvtxBins(),0,pars->GetNvtxBins());
-  TH1F*  hEventsNSD     = new TH1F("hEventsNSD","hEventsNSD",pars->GetNvtxBins(),0,pars->GetNvtxBins());
-  TH1F*  hEventsNSDVtx  = new TH1F("hEventsNSDVtx","hEventsNSDVtx",pars->GetNvtxBins(),0,pars->GetNvtxBins());
-  fDiagList->Add(hEventsVtx);
-  fDiagList->Add(hEventsTr);
-  fDiagList->Add(hEventsNSD);
-  fDiagList->Add(hEventsNSDVtx);
-  
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskSharing::ConnectInputData(Option_t */*option*/)
-{
-  // connect the input data
-  if(fStandalone)
-    fESD = (AliESDEvent*)GetInputData(0);
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskSharing::Exec(Option_t */*option*/)
-{
-  //perform analysis on one event
-  AliESD* old = fESD->GetAliESDOld();
-  if (old) {
-    fESD->CopyFromOldESD();
-  }
-  
-  foutputESDFMD->Clear();
-
-    
-  Int_t delta = fESD->GetOrbitNumber() - fLastOrbit;
-  fLastOrbit = fESD->GetOrbitNumber();
-  
-  
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  Double_t vertex[3]={0,0,0};
-  Bool_t vtxStatus = pars->GetVertex(fESD,vertex);
-  fEsdVertex->SetXYZ(vertex);
-  
-  // std::cout<<vtxStatus<<"  "<<vertex[0]<<"   "<<vertex[1]<<"   "<<vertex[2]<<std::endl;
-  
-  // Process primaries here to get true MC distribution
-  if(pars->GetProcessPrimary())
-    ProcessPrimary();
-  const AliMultiplicity* testmult = fESD->GetMultiplicity();
-  Int_t nTrackLets = testmult->GetNumberOfTracklets();
-  TH2F*  hCorrelationClustersTracklets = (TH2F*)fDiagList->FindObject("hCorrelationClustersTracklets");
-  hCorrelationClustersTracklets->Fill(testmult->GetNumberOfSingleClusters(),nTrackLets);  
-  
-  
-  
-  Bool_t isTriggered = pars->IsEventTriggered(AliFMDAnaParameters::kMB1);
-  Bool_t nsd = pars->IsEventTriggered(AliFMDAnaParameters::kNSD);
-
-  Double_t delta2 = 2*pars->GetVtxCutZ()/pars->GetNvtxBins();
-  Double_t vertexBinDouble = (vertex[2] + pars->GetVtxCutZ()) / delta2;
-  Int_t vtxbin = (Int_t)vertexBinDouble;
-  TH1F* hEventsVtx    = (TH1F*)fDiagList->FindObject("hEventsVtx");
-  TH1F* hEventsTr     = (TH1F*)fDiagList->FindObject("hEventsTr");
-  TH1F* hEventsNSD    = (TH1F*)fDiagList->FindObject("hEventsNSD");
-  TH1F* hEventsNSDVtx = (TH1F*)fDiagList->FindObject("hEventsNSDVtx");
-  
-  if( TMath::Abs(vertex[2]) > pars->GetVtxCutZ()) {
-    fStatus = kFALSE;
-    return;
-  }
-  
-  if(vtxStatus) hEventsVtx->Fill(vtxbin);
-  if(isTriggered) hEventsTr->Fill(vtxbin);
-  
-  if(vtxStatus && nsd) hEventsNSDVtx->Fill(vtxbin);
-  if(nsd) hEventsNSD->Fill(vtxbin);
-  
-  if(!isTriggered || !vtxStatus ) {
-    fStatus = kFALSE;
-    return;
-  }
-  else
-    fStatus = kTRUE;
-  
-  TH1F* hXvtx = (TH1F*)fDiagList->FindObject("hXvtx");
-  if(vtxStatus ) hXvtx->Fill(vertex[0]);
-  TH1F* hYvtx = (TH1F*)fDiagList->FindObject("hYvtx");
-  if(vtxStatus ) hYvtx->Fill(vertex[1]);
-  TH1F* hZvtx = (TH1F*)fDiagList->FindObject("hZvtx");
-  hZvtx->Fill(vertex[2]);
-  //const AliMultiplicity* testmult = fESD->GetMultiplicity();
-  //std::cout<<vertex[2]<<std::endl;
-  //Int_t nTrackLets = testmult->GetNumberOfTracklets();
-  
-    
-  if(nTrackLets < 1000) foutputESDFMD->SetUniqueID(kTRUE);
-  else foutputESDFMD->SetUniqueID(kFALSE);
-  
-  AliESDFMD* fmd = fESD->GetFMDData();
-   
-  if (!fmd) return;
-  Int_t nHits[3][2] = {{0,0},{0,0},{0,0}};
-  //Int_t nDead = 0;
-  for(UShort_t det=1;det<=3;det++) {
-    Int_t nRings = (det==1 ? 1 : 2);
-    for (UShort_t ir = 0; ir < nRings; ir++) {
-      Char_t   ring = (ir == 0 ? 'I' : 'O');
-      UShort_t nsec = (ir == 0 ? 20  : 40);
-      UShort_t nstr = (ir == 0 ? 512 : 256);
-      
-      TH1F* hEdist = (TH1F*)fDiagList->FindObject(Form("Edist_before_sharing_FMD%d%c",det,ring));
-      
-      for(UShort_t sec =0; sec < nsec;  sec++) {
-       fSharedThis      = kFALSE;
-       fSharedPrev      = kFALSE;
-       
-       for(UShort_t strip = 0; strip < nstr; strip++) {
-         foutputESDFMD->SetMultiplicity(det,ring,sec,strip,0.);
-         Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
-         //if(mult == AliESDFMD::kInvalidMult) 
-         //  nDead++;
-         //  if(mult > 0)
-         //  std::cout<<mult<<std::endl;
-         
-         if(mult == AliESDFMD::kInvalidMult || mult == 0 || mult > 20) continue;
-        
-         //Double_t eta = fmd->Eta(det,ring,sec,strip);
-         Float_t eta = pars->GetEtaFromStrip(det,ring,sec,strip,vertex[2]);
-                 
-         hEdist->Fill(mult);
-         
-         
-         if(fmd->IsAngleCorrected())
-           mult = mult/TMath::Cos(Eta2Theta(eta));
-         Float_t prevE = 0;
-         Float_t nextE = 0;
-         if(strip != 0)
-           if(fmd->Multiplicity(det,ring,sec,strip-1) != AliESDFMD::kInvalidMult) {
-             prevE = fmd->Multiplicity(det,ring,sec,strip-1);
-             if(fmd->IsAngleCorrected())
-               prevE = prevE/TMath::Cos(Eta2Theta(fmd->Eta(det,ring,sec,strip-1)));
-           }
-         if(strip != nstr - 1)
-           if(fmd->Multiplicity(det,ring,sec,strip+1) != AliESDFMD::kInvalidMult) {
-             nextE = fmd->Multiplicity(det,ring,sec,strip+1);
-             if(fmd->IsAngleCorrected())
-               nextE = nextE/TMath::Cos(Eta2Theta(fmd->Eta(det,ring,sec,strip+1)));
-           }
-         
-         Float_t mergedEnergy = GetMultiplicityOfStrip(mult,eta,prevE,nextE,det,ring,sec,strip);
-         
-         if(mergedEnergy > 0.3 )
-           nHits[det-1][ir]++;
-         foutputESDFMD->SetMultiplicity(det,ring,sec,strip,mergedEnergy);
-         foutputESDFMD->SetEta(det,ring,sec,strip,eta);
-         
-       }
-      }
-    }
-  }
-  
-  //std::cout<<nDead<<std::endl;
-  
-  //cluster cut
-  //if(testmult->GetNumberOfSingleClusters() > 15 + nTrackLets)
-  //  {fStatus = kFALSE; std::cout<<"FMD : "<<nHits[0][0]<<"  "<<nHits[1][0]<<"   "<<nHits[1][1]<<"   "<<nHits[2][0]<<"   "<<nHits[2][1]<<" tracks  "<<testmult->GetNumberOfSingleClusters()<<"   "<<nTrackLets<<std::endl; return;}
-  
-  TH2F*  hCorrelationFMD23  = (TH2F*)fDiagList->FindObject("hCorrelationFMD23");
-  TH2F*  hCorrelationFMD12  = (TH2F*)fDiagList->FindObject("hCorrelationFMD12");
-  TH2F*  hCorrelationFMD2diff23  = (TH2F*)fDiagList->FindObject("hCorrelationFMD2diff23");
-  TH2F*  hCorrelationFMD3diff23  = (TH2F*)fDiagList->FindObject("hCorrelationFMD3diff23");
-  TH2F*  hCorrelationFMD1diff13  = (TH2F*)fDiagList->FindObject("hCorrelationFMD1diff13");  
-  TH2F*  hCorrelationFMD1diff12  = (TH2F*)fDiagList->FindObject("hCorrelationFMD1diff12");
-
-  TH2F*  hCorrelationFMDSPD = (TH2F*)fDiagList->FindObject("hCorrelationFMDSPD");
-  TH2F*  hCorrelationFMD1SPD = (TH2F*)fDiagList->FindObject("hCorrelationFMD1SPD");
-  TH2F*  hCorrelationFMD2ISPD = (TH2F*)fDiagList->FindObject("hCorrelationFMD2ISPD");
-  TH2F*  hCorrelationFMD2OSPD = (TH2F*)fDiagList->FindObject("hCorrelationFMD2OSPD");
-  TH2F*  hCorrelationFMD3ISPD = (TH2F*)fDiagList->FindObject("hCorrelationFMD3ISPD");
-  TH2F*  hCorrelationFMD3OSPD = (TH2F*)fDiagList->FindObject("hCorrelationFMD3OSPD");
-  
-  TH2F*  hCorrelationFMDSPDhits = (TH2F*)fDiagList->FindObject("hCorrelationFMDSPDhits");
-
-  TH2F*  hCorrelationSPDTracklets = (TH2F*)fDiagList->FindObject("hCorrelationSPDTracklets");
-  TH2F*  hTimeCorrelation   = (TH2F*)fDiagList->FindObject("hCorrelationTime");
-  TH2F*  hHitsRadius   = (TH2F*)fDiagList->FindObject("hCorrelationHitsRadius");
-  TH2F*  hHitsX   = (TH2F*)fDiagList->FindObject("hCorrelationHitsX");
-  TH2F*  hHitsY   = (TH2F*)fDiagList->FindObject("hCorrelationHitsY");
-  TH1F*  hFMDHitDistribution   = (TH1F*)fDiagList->FindObject("hFMDHitDistribution");
-  TH1F*  hFMD1HitDistribution   = (TH1F*)fDiagList->FindObject("hFMDHitDistributionFMD1");  
-  TH1F*  hFMD2IHitDistribution   = (TH1F*)fDiagList->FindObject("hFMDHitDistributionFMD2I");
-  TH1F*  hFMD2OHitDistribution   = (TH1F*)fDiagList->FindObject("hFMDHitDistributionFMD2O");
-  TH1F*  hFMD3IHitDistribution   = (TH1F*)fDiagList->FindObject("hFMDHitDistributionFMD3I");
-  TH1F*  hFMD3OHitDistribution   = (TH1F*)fDiagList->FindObject("hFMDHitDistributionFMD3O"); 
-  TH1F*  hCorrelationFMDGoodtracks = (TH1F*)fDiagList->FindObject("hCorrelationFMDGoodtracks");
-  TH1F*  hCorrelationFMDBadtracks = (TH1F*)fDiagList->FindObject("hCorrelationFMDBadtracks");
-  TH1F*  hCorrelationGoodbadtracks = (TH1F*)fDiagList->FindObject("hCorrelationGoodbadtracks");
-   TH2F*  hCorrelationFMDBgCand = (TH2F*)fDiagList->FindObject("hCorrelationFMDBgCand");
-   TH2F*  hCorrelationFMDBgCandRelative = (TH2F*)fDiagList->FindObject("hCorrelationFMDBgCandRelative");
-   
-   TH2F* hCorrelationFMDFlatTr = (TH2F*)fDiagList->FindObject("hCorrelationFMDFlatTr");
-   TH2F* hCorrelationFMDRatioFlatTr = (TH2F*)fDiagList->FindObject("hCorrelationFMDRatioFlatTr");
-   TH1F* hTrVtxDistribution = (TH1F*)fDiagList->FindObject("hTrVtxDistribution");
-   TH1F* hTrEtaDistribution = (TH1F*)fDiagList->FindObject("hTrEtaDistribution");
-   TH1F* hTrEtaDistribution2 = (TH1F*)fDiagList->FindObject("hTrEtaDistribution2");
-  hCorrelationFMDSPD->Fill(nTrackLets,nHits[0][0]+nHits[1][0]+nHits[1][1]+nHits[2][0]+nHits[2][1]);
-  TH1F* hFlatTracks = (TH1F*)fDiagList->FindObject("hFlatTracks");
-  hCorrelationFMD1SPD->Fill(nTrackLets,nHits[0][0]);
-  hCorrelationFMD2ISPD->Fill(nTrackLets,nHits[1][0]);
-  hCorrelationFMD2OSPD->Fill(nTrackLets,nHits[1][1]);
-  hCorrelationFMD3ISPD->Fill(nTrackLets,nHits[2][0]);
-  hCorrelationFMD3OSPD->Fill(nTrackLets,nHits[2][1]);
-  hCorrelationFMDSPDhits->Fill(testmult->GetNumberOfFiredChips(0),nHits[0][0]+nHits[1][0]+nHits[1][1]+nHits[2][0]+nHits[2][1]);
-  hCorrelationSPDTracklets->Fill(testmult->GetNumberOfFiredChips(0),nTrackLets);
-  
-  hTimeCorrelation->Fill(delta,nHits[0][0]+nHits[1][0]+nHits[1][1]+nHits[2][0]+nHits[2][1]);
-  hCorrelationFMD23->Fill(nHits[1][0]+nHits[1][1],nHits[2][0]+nHits[2][1]);
-  hCorrelationFMD12->Fill(nHits[0][0],nHits[1][0]+nHits[1][1]);
-  
-  //  if(TMath::Abs(nHits[1]-nHits[2]) > 15 && (nHits[1]+nHits[2]) > 35) {fStatus = kFALSE; std::cout<<"difference : "<<TMath::Abs(nHits[1]-nHits[2])<<std::endl; return;}
-  
-  // if(testmult->GetNumberOfFiredChips(0))
-  //  if(testmult->GetNumberOfFiredChips(0) > 15 && ((Float_t)nTrackLets / (Float_t)testmult->GetNumberOfFiredChips(0)) < 0.4)
-  //   {fStatus = kFALSE; std::cout<<nTrackLets<<"   "<<testmult->GetNumberOfFiredChips(0)<<"   "<<nHits[0]<<"   "<<nHits[1]<<"   "<<nHits[2]<<std::endl; return;}
-  
-  
-  Float_t diff23 = (Float_t)TMath::Abs(nHits[2][1] + nHits[2][0] - nHits[1][1] - nHits[1][0]);
-  Float_t diff13 = TMath::Abs(nHits[2][1] + nHits[2][0] - nHits[1][1] - nHits[1][0] - nHits[0][0]);
-  Float_t diff12 = TMath::Abs(nHits[1][0] - nHits[0][0]);
-  
-  hCorrelationFMD1diff12->Fill(nHits[0][0], diff12);
-  hCorrelationFMD1diff13->Fill(nHits[0][0], diff13);
-  hCorrelationFMD2diff23->Fill(nHits[1][1], diff23);
-  hCorrelationFMD3diff23->Fill(nHits[2][1], diff23);
-  
-  //
-  Float_t nTotalFMDhits = nHits[0][0]+nHits[1][0]+nHits[1][1]+nHits[2][0]+nHits[2][1] ;
-   Float_t radius = TMath::Sqrt(TMath::Power(vertex[0] + 0.03715,2) + TMath::Power(vertex[1] - 0.1659,2));
-  
-  if(vertex[1] !=0 || vertex[1] !=0) {
-    hHitsRadius->Fill(nTotalFMDhits,radius);
-    hHitsX->Fill(nTotalFMDhits,vertex[0]);
-    hHitsY->Fill(nTotalFMDhits,vertex[1]); }
-  
-  hFMDHitDistribution->Fill(nTotalFMDhits);
-  hFMD1HitDistribution->Fill(nHits[0][0]);
-  hFMD2IHitDistribution->Fill(nHits[1][0]);
-  hFMD2OHitDistribution->Fill(nHits[1][1]);
-  hFMD3IHitDistribution->Fill(nHits[2][0]);
-  hFMD3OHitDistribution->Fill(nHits[2][0]);
-  
-  // if(radius > 0.5) {fStatus = kFALSE; std::cout<<"FMD : "<<nTotalFMDhits<<std::endl; foutputESDFMD->Clear(); return;}
-  //if(TMath::Abs(vertex[1] - 0.1659) > 0.1 ) {fStatus = kFALSE; std::cout<<"FMD : "<<nTotalFMDhits<<std::endl; foutputESDFMD->Clear(); return;}
-  
-   if(nTrackLets < pars->GetLowSPDLimit() || nTrackLets > pars->GetHighSPDLimit())
-    {fStatus = kFALSE; std::cout<<nTrackLets<<"   "<<"   "<<nHits[0][0]<<"  "<<nHits[1][0]<<"   "<<nHits[1][1]<<"   "<<nHits[2][0]<<"   "<<nHits[2][1]<<std::endl; return;}
-  
-    
-   AliESDtrack* track = 0;
-  Int_t ntracks = fESD->GetNumberOfTracks();
-  Float_t ngood =0, nbad = 0;
-  //std::cout<<" Primary vtx : "<<vertex[0]<<"   "<<vertex[1]<<"   "<<vertex[2]<<"  "<<nTotalFMDhits<<std::endl;
-  Int_t nBgCandidates = 0;
-  Float_t nFlat = 0;
-  for(Int_t i=0;i<ntracks;i++) {
-    track = fESD->GetTrack(i);
-    //std::cout<<track->GetX()-vertex[0]<<"   "<<track->GetY()-vertex[1]<<"   "<<track->GetZ()-vertex[2]<<std::endl;
-    //std::cout<<track->GetX()<<"   "<<track->GetY()<<"   "<<track->GetZ()<<std::endl;
-    hTrVtxDistribution->Fill(track->GetZ());
-    
-    if(TMath::Abs( track->GetZ()) > 50 &&  TMath::Abs(track->GetZ()) < 300) { // && TMath::Abs( track->GetY()) < 1)
-      nBgCandidates++;
-      hTrEtaDistribution->Fill(track->Eta()); 
-    }
-    
-    
-    
-    if(TMath::Abs(track->GetX()-vertex[0]) > 0.3 || TMath::Abs(track->GetY()-vertex[1]) > 0.3  || TMath::Abs(track->GetZ()-vertex[2]) > 0.3)  {
-      nbad++;
-      hTrEtaDistribution2->Fill(track->Eta()); }
-    else ngood++;
-    
-    if(TMath::Abs(track->Pt()) < 0.1)
-      nFlat++;
-  }
-  
-  Float_t ratioFlat = 0;
-  if(fESD->GetNumberOfTracks())
-    ratioFlat = nFlat/(Float_t)fESD->GetNumberOfTracks();
-  hCorrelationFMDFlatTr->Fill(nFlat,nTotalFMDhits);
-  hCorrelationFMDRatioFlatTr->Fill(ratioFlat,nTotalFMDhits);
-  hFlatTracks->Fill(nFlat);
-   
-  // std::cout<<fESD->GetT0zVertex()<<"   "<<vertex[2]<<std::endl;
-  Float_t ratioBg = 0;
-  //if(fESD->GetNumberOfTracks() > 0)
-  
-  if(fESD->GetNumberOfTracks() > 0)
-    ratioBg = (Float_t)nBgCandidates/(Float_t)fESD->GetNumberOfTracks();
-  hCorrelationFMDBgCand->Fill(nBgCandidates,nTotalFMDhits);
-  hCorrelationFMDBgCandRelative->Fill(ratioBg,nTotalFMDhits);
-  
-  
-  // Float_t ratio =  (nbad > 0 ? ngood / nbad  : 0);
-  
-  hCorrelationFMDGoodtracks->Fill(ngood,nTotalFMDhits);
-  hCorrelationFMDBadtracks->Fill(nbad,nTotalFMDhits);
-  hCorrelationGoodbadtracks->Fill(ngood,nbad);
-  
-  if(fStandalone) {
-    PostData(0, foutputESDFMD); 
-    PostData(1, fEsdVertex); 
-    PostData(2, fESD); 
-    PostData(3, fDiagList); 
-  }
-}
-
-//_____________________________________________________________________
-Float_t AliFMDAnalysisTaskSharing::GetMultiplicityOfStrip(Float_t mult,
-                                                         Float_t eta,
-                                                         Float_t prevE,
-                                                         Float_t nextE,
-                                                         UShort_t   det,
-                                                         Char_t  ring,
-                                                         UShort_t /*sec*/,
-                                                         UShort_t /*strip*/) {
-  //analyse and perform sharing on one strip
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  Float_t mergedEnergy = 0;
-  //Float_t nParticles = 0;
-  Float_t cutLow  = 0.3;//0.15;
-  Double_t mpv     = pars->GetMPV(det,ring,eta);
-  
-  Double_t w       = pars->GetSigma(det,ring,eta);
-  if (mpv > 100) 
-    AliError(Form("FMD%d%c, eta=%f, MPV=%f w=%f", det, ring, eta, mpv, w));
-  Float_t cutHigh = mpv - 2 * w;
-
-  // if(ring == 'I')
-  //  cutLow = 0.1;
-  
-  //cutLow = 0;
-  //AliFMDParameters* recopars = AliFMDParameters::Instance();
-  //cutLow = (5*recopars->GetPedestalWidth(det,ring,sec,strip))/(recopars->GetPulseGain(det,ring,sec,strip)*recopars->GetDACPerMIP());
-  //if(foutputESDFMD->GetUniqueID() == kFALSE ) {
-  
-  if(mult > 12 || mult < cutLow)
-    {
-      //   std::cout<<"rejecting hit in FMD "<<det<<" "<<ring<<std::endl;
-      fSharedThis      = kFALSE;
-      fSharedPrev      = kFALSE;
-      return 0;
-    }
-  
-  
-  
-  
-  // Float_t cutPart = pars->GetMPV(det,ring,eta) - 5*pars->GetSigma(det,ring,eta);
-  Float_t totalE  = mult;
-  
-
-    //std::cout<<det<<ring<<"   "<<sec<<"    "<<strip<<"   "<<cutLow<<std::endl;
-  if(fSharedThis) {
-    fSharedThis      = kFALSE;
-    fSharedPrev      = kTRUE;
-    return 0.;
-  }
-  
-  /*  if(mult < 0.33*pars->GetMPV(det,ring,eta)) {
-    fSharedThis      = kFALSE;
-    fSharedPrev      = kFALSE;
-    return 0;
-    }*/
-  if(mult<nextE && nextE>cutHigh && foutputESDFMD->GetUniqueID() == kTRUE)
-    {
-      fSharedThis      = kFALSE;
-      fSharedPrev      = kFALSE;
-      return 0;
-    }
-  
-  
-  if(prevE > cutLow && prevE < cutHigh && !fSharedPrev ) {
-    totalE += prevE;
-  }
-  
-  if(nextE > cutLow && nextE < cutHigh ) {
-    totalE += nextE;
-    fSharedThis      = kTRUE;
-  }
-  totalE = totalE*TMath::Cos(Eta2Theta(eta));
-  TH1F* hEdist = (TH1F*)fDiagList->FindObject(Form("Edist_after_sharing_FMD%d%c",det,ring));
-  if(totalE > cutLow)
-    hEdist->Fill(totalE);
-  
-  
-  if(totalE > 0) {
-    
-    mergedEnergy = totalE;
-    fSharedPrev      = kTRUE;
-    // if(det == 1 && ring =='I')
-  }
-  else{
-      fSharedThis      = kFALSE;
-      fSharedPrev      = kFALSE;
-  }
-
-  // mergedEnergy = mult;
-  
-
-  /*   }
-else {
-    TH1F* hEdist = (TH1F*)fDiagList->FindObject(Form("Edist_after_sharing_FMD%d%c",det,ring));
-    if(mult > cutLow)
-      fEtotal+=mult;
-    if(mult < cutLow) {
-      mergedEnergy = fEtotal;
-      fEtotal = 0;
-      hEdist->Fill(mergedEnergy);
-      
-    }
-    
-   }*/
-  
-  return mergedEnergy; 
-  //}  
-}
-//_____________________________________________________________________
-void AliFMDAnalysisTaskSharing::Terminate(Option_t* /* option*/) {
-  
-  TH1F*  hFMDHitDistribution   = (TH1F*)fDiagList->FindObject("hFMDHitDistribution");
-  TH1F*  hFMD1HitDistribution   = (TH1F*)fDiagList->FindObject("hFMDHitDistributionFMD1");
-  TH1F*  hFMD2IHitDistribution   = (TH1F*)fDiagList->FindObject("hFMDHitDistributionFMD2I");
-  TH1F*  hFMD2OHitDistribution   = (TH1F*)fDiagList->FindObject("hFMDHitDistributionFMD2O");
-  TH1F*  hFMD3IHitDistribution   = (TH1F*)fDiagList->FindObject("hFMDHitDistributionFMD3I");
-  TH1F*  hFMD3OHitDistribution   = (TH1F*)fDiagList->FindObject("hFMDHitDistributionFMD3O");
-  
-  TH1F* hZvtx = (TH1F*)fDiagList->FindObject("hZvtx");
-  for(UShort_t det=1;det<=3;det++) {
-    Int_t nRings = (det==1 ? 1 : 2);
-    for (UShort_t ir = 0; ir < nRings; ir++) {
-      Char_t   ring = (ir == 0 ? 'I' : 'O');
-      
-      TH1F* hEdist = (TH1F*)fDiagList->FindObject(Form("Edist_before_sharing_FMD%d%c",det,ring));
-      TH1F* hEdistAfter = (TH1F*)fDiagList->FindObject(Form("Edist_after_sharing_FMD%d%c",det,ring));
-      if(hZvtx->GetEntries()) {
-       hEdist->Scale(1./(Float_t)hZvtx->GetEntries());
-       hEdistAfter->Scale(1./(Float_t)hZvtx->GetEntries());
-      }
-      
-    }
-    
-  } 
-  TH1F* hFlatTracks = (TH1F*)fDiagList->FindObject("hFlatTracks");
-  TH1F* hTrVtxDistribution = (TH1F*)fDiagList->FindObject("hTrVtxDistribution");
-  TH1F* hTrEtaDistribution = (TH1F*)fDiagList->FindObject("hTrEtaDistribution");
-  TH1F* hTrEtaDistribution2 = (TH1F*)fDiagList->FindObject("hTrEtaDistribution2");
-  if(hZvtx->GetEntries()) {
-    hFMDHitDistribution->Scale(1./(Float_t)hZvtx->GetEntries());
-    hFMD1HitDistribution->Scale(1./(Float_t)hZvtx->GetEntries());
-    hFMD2IHitDistribution->Scale(1./(Float_t)hZvtx->GetEntries());
-    hFMD2OHitDistribution->Scale(1./(Float_t)hZvtx->GetEntries());
-    hFMD3IHitDistribution->Scale(1./(Float_t)hZvtx->GetEntries());
-    hFMD3OHitDistribution->Scale(1./(Float_t)hZvtx->GetEntries());
-    hFlatTracks->Scale(1./(Float_t)hZvtx->GetEntries());
-    hTrVtxDistribution->Scale(1./(Float_t)hZvtx->GetEntries());
-    hTrEtaDistribution->Scale(1./(Float_t)hZvtx->GetEntries());
-    hTrEtaDistribution2->Scale(1./(Float_t)hZvtx->GetEntries());
-  }
-  
-  //TH1F* hEventsVtx = (TH1F*)fDiagList->FindObject("hEventsVtx");
-  //TH1F* hEventsTr  = (TH1F*)fDiagList->FindObject("hEventsTr");
-  //hEventsVtx->Divide(hEventsTr);
-  
-  
-}
-//_____________________________________________________________________
-Float_t AliFMDAnalysisTaskSharing::Eta2Theta(Float_t eta) const{
-  //convert the eta of a strip to a theta
-  Float_t theta = 2*TMath::ATan(TMath::Exp(-1*eta));
-  
-  if(eta < 0)
-    theta = theta-TMath::Pi();
-  
-  //  std::cout<<"From eta2Theta: "<<theta<<"   "<<eta<<std::endl;
-  return theta;
-  
-
-
-}
-
-
-
-//_____________________________________________________________________
-void AliFMDAnalysisTaskSharing::ProcessPrimary() {
-  //Get the unspoiled MC dN/deta before event cuts
-  
-  AliMCEventHandler* eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
-  if(!eventHandler) 
-    return;
-  AliMCEvent* mcEvent = eventHandler->MCEvent();
-  if(!mcEvent)
-    return;
-  fLastTrackByStrip.Reset(-1);
-  AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  
-  AliMCParticle* particle = 0;
-  
-  AliStack* stack = mcEvent->Stack();
-  
-  TH1F* hPrimary = (TH1F*)fDiagList->FindObject("hMultvsEtaNoCuts");
-  TH1F* hPrimaryNSD = (TH1F*)fDiagList->FindObject("hMultvsEtaNSDNoCuts");
-  TH1F* hEnergyOfParticles = (TH1F*)fDiagList->FindObject("hEnergyOfParticles");
-  AliHeader* header            = mcEvent->Header();
-  AliGenEventHeader* genHeader = header->GenEventHeader();
-  
-  AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader);
-  AliGenDPMjetEventHeader* dpmHeader = dynamic_cast<AliGenDPMjetEventHeader*>(header->GenEventHeader());
-  
-  Bool_t nsd = kTRUE;
-  
-  
-  if (!pythiaGenHeader && !dpmHeader) {
-    std::cout<<" no pythia or dpm header!"<<std::endl;
-  }
-  else {
-    if(pythiaGenHeader)        {
-      Int_t pythiaType = pythiaGenHeader->ProcessType();
-      
-      if(pythiaType==92||pythiaType==93)
-       nsd = kFALSE;
-      
-    }
-    if(dpmHeader) {
-      Int_t processType = dpmHeader->ProcessType();
-      if(processType == 5 || processType == 6)  
-       nsd = kFALSE;
-    
-    }
-  }
-
-  TArrayF vertex;
-  genHeader->PrimaryVertex(vertex);
-  
-  if(TMath::Abs(vertex.At(2)) > pars->GetVtxCutZ())
-    return;
-  
-  Double_t delta           = 2*pars->GetVtxCutZ()/pars->GetNvtxBins();
-  Double_t vertexBinDouble = (vertex.At(2) + pars->GetVtxCutZ()) / delta;
-  Int_t    vertexBin       = (Int_t)vertexBinDouble;
-  
-  Bool_t firstTrack = kTRUE;
-  Bool_t firstTrackNSD = kTRUE;
-  
-  Int_t nTracks = stack->GetNprimary();
-  if(pars->GetProcessHits())
-    nTracks = stack->GetNtrack();
-  TH1F* nMCevents = (TH1F*)fDiagList->FindObject("nMCEventsNoCuts");
-  TH1F* nMCeventsNSD = (TH1F*)fDiagList->FindObject("nMCEventsNSDNoCuts");
-  for(Int_t i = 0 ;i<nTracks;i++) {
-    particle = (AliMCParticle*) mcEvent->GetTrack(i);
-    if(!particle)
-      continue;
-    
-    if(stack->IsPhysicalPrimary(i) && particle->Charge() != 0) {
-      hPrimary->Fill(particle->Eta());
-      if(nsd) {
-       hPrimaryNSD->Fill(particle->Eta());
-       
-       if(firstTrackNSD) {
-         nMCeventsNSD->Fill(vertexBin);
-         firstTrackNSD = kFALSE;
-       }
-      }
-
-      TH1F* hPrimVtxBin = (TH1F*)fDiagList->FindObject(Form("primmult_NoCuts_vtxbin%d",vertexBin));
-      hPrimVtxBin->Fill(particle->Eta());
-      
-      if(firstTrack) {
-       nMCevents->Fill(vertexBin);
-       firstTrack = kFALSE;
-      }
-    
-    }
-     if(pars->GetProcessHits()) {
-           
-      for(Int_t j=0; j<particle->GetNumberOfTrackReferences();j++) {
-       
-       AliTrackReference* ref = particle->GetTrackReference(j);
-       UShort_t det,sec,strip;
-       Char_t   ring;
-       if(ref->DetectorId() != AliTrackReference::kFMD)
-         continue;
-       if(particle->Charge() != 0)
-         hEnergyOfParticles->Fill(particle->E());
-       
-       AliFMDStripIndex::Unpack(ref->UserId(),det,ring,sec,strip);
-       Float_t thisStripTrack = fLastTrackByStrip(det,ring,sec,strip);
-       if(particle->Charge() != 0 && i != thisStripTrack ) {
-         //Double_t x,y,z;
-         
-         Float_t   eta   = pars->GetEtaFromStrip(det,ring,sec,strip,vertex.At(2));//-1*TMath::Log(TMath::Tan(0.5*theta));
-         TH1F* hHits = (TH1F*)fDiagList->FindObject(Form("hMCHits_nocuts_FMD%d%c_vtxbin%d",det,ring,vertexBin));
-         
-       
-         hHits->Fill(eta);
-         
-         Float_t nstrips = (ring =='O' ? 256 : 512);
-         
-         fLastTrackByStrip(det,ring,sec,strip) = (Float_t)i;
-       
-         if(strip >0)
-           fLastTrackByStrip(det,ring,sec,strip-1) = (Float_t)i;
-         if(strip < (nstrips - 1))
-           fLastTrackByStrip(det,ring,sec,strip+1) = (Float_t)i;
-         
-       }
-      
-       
-      }
-      
-      
-    }
-    
-  }
-
-}
-
-//_____________________________________________________________________
-//
-// EOF
-//
-// EOF
diff --git a/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskSharing.h b/PWGLF/FORWARD/analysis/AliFMDAnalysisTaskSharing.h
deleted file mode 100644 (file)
index 7468fff..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-#ifndef ALIFMDANALYSISTASKSHARING_H
-#define ALIFMDANALYSISTASKSHARING_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               
- **/
-#include "AliAnalysisTask.h"
-
-#include "AliESDFMD.h"
-//#include "TTree.h"
-#include "AliESDEvent.h"
-#include "AliFMDFloatMap.h"
-class TChain;
-class AliAODEvent;
-class AliESDVertex;
-
-/**
- * Do the sharing correction. 
- * 
- * This is the task to do the FMD sharing or hit merging.
- * It reads the input ESDFMD data and posts an ESDFMD object to
- * the tasks that must be performed after this task ie.
- * Density, BackgroundCorrection and Dndeta.
- *
- * Inputs: An AliESDFMD object
- *
- * Output:
- *   An AliESDFMD object, but with hits merged according to algorithm.
- *
- * Used correction objects: 
- *   Energy distribution fits (MPV and width of 1st landau)
- *   Hard low cut on 'mult' of 0.3
- *
- * Simplications: 
- *   Remove all diagnostics histograms except a few.  The histograms 
- *   needed for subsequent use are the ones for the sharing correction - 
- *   but only from MC data. 
- * 
- *   Remove calculation vertex efficiency.  This is best taken care of
- *   elsewhere. 
- *   
- * Open issues: 
- *   The ESD signal is un-angle-corrected and the after merging, 
- *   Re-angle-corrected.  I think this is wrong and will cause a 
- *   problem for the low-eta (low-theta) bins where the correction is
- *   largets.   Essentially, a particle that traverses two strips at 
- *   low theta will have a relatively large path through and will, 
- *   all things equal, deposite more energy.  The sharing filter may 
- *   then not pick this hit as steming from the same particle, but 
- *   but rather from 2 particles.   This is especially true of the MPV
- *   and width of the 1st Landau is determined from a full
- *   detector/ring spectra. 
- *
- * @ingroup FMD_ana
- * 
- * 
- */
-class AliFMDAnalysisTaskSharing : public AliAnalysisTask
-{
-public:
-  /** 
-   * Constructor
-   */
-  AliFMDAnalysisTaskSharing();
-  /** 
-   * Constrictor
-   * 
-   * @param name Name of task 
-   * @param SE   Whether we're run from an SE task or not
-   */
-  AliFMDAnalysisTaskSharing(const char* name, Bool_t SE = kTRUE);
-  /** 
-   * Destructor
-   * 
-   */
-  virtual ~AliFMDAnalysisTaskSharing() {;}
-  /** 
-   * Copy constructor
-   * 
-   * @param o Object to copy from 
-   */
-  AliFMDAnalysisTaskSharing(const AliFMDAnalysisTaskSharing& o) 
-    : AliAnalysisTask(),
-      fDebug(o.fDebug),
-      fESD(o.fESD),
-      // fOutputESD(),
-      foutputESDFMD(o.foutputESDFMD),
-      fSharedThis(o.fSharedThis),
-      fSharedPrev(o.fSharedPrev),
-      fDiagList(),
-      fStandalone(o.fStandalone),
-      fEsdVertex(o.fEsdVertex),
-      fStatus(o.fStatus),
-      fLastTrackByStrip(o.fLastTrackByStrip),
-      fLastOrbit(o.fLastOrbit) {}
-  /** 
-   * Assignment operator
-   * 
-   * @return Reference to this object
-   */
-  AliFMDAnalysisTaskSharing& 
-  operator=(const AliFMDAnalysisTaskSharing&) { return *this; }
-    
-  /**
-   * @{ 
-   * @name Implementation of interface methods
-   */
-  virtual void ConnectInputData(Option_t *option = "");
-  virtual void CreateOutputObjects();
-  virtual void Init() {}
-  virtual void LocalInit() {Init();}
-  virtual void Exec(Option_t */*option*/);
-  virtual void Terminate(Option_t* /* option*/);
-  virtual void SetDebugLevel(Int_t level) {fDebug = level;}
-  /** 
-   * @} 
-   */
-  /** 
-   * Get the multiplicity of a strip
-   * 
-   * @param mult    Previous(?) multiplicty
-   * @param eta     Pseudo rapidity of strip
-   * @param Eprev   Previous energy deposition
-   * @param Enext   Next energy deposition
-   * @param det     Detector
-   * @param ring    Ring
-   * @param sec     Sector
-   * @param strip   Strip
-   * 
-   * @return 
-   */
-  Float_t GetMultiplicityOfStrip(Float_t  mult, 
-                                Float_t  eta, 
-                                Float_t  Eprev, 
-                                Float_t  Enext, 
-                                UShort_t det, 
-                                Char_t   ring, 
-                                UShort_t sec, 
-                                UShort_t strip);
-  // void GetVertex(Double_t* vertexXYZ) ;
-  /** 
-   * Set the Output data
-   * 
-   * @param fmd Output data
-   */      
-  void SetFMDData(AliESDFMD* fmd) {foutputESDFMD = fmd;}
-  /** 
-   * Set the output list 
-   * 
-   * @param outlist 
-   */
-  void SetOutputList(TList* outlist) {fDiagList = outlist;}
-  /** 
-   * Set the vertex
-   * 
-   * @param vertex 
-   */
-  void SetVertex(AliESDVertex* vertex) {fEsdVertex = vertex;}
-  /** 
-   * Set the input data
-   *
-   * @param esd Input
-   */
-  void SetInputESD(AliESDEvent* esd) {fESD = esd;}
-  /** 
-   * Get status flag
-   * 
-   * @return @c true on success
-   */
-  Bool_t GetEventStatus() const {return fStatus;}
-  /** 
-   * Get the vertex efficiency from data.  This is calculated as  
-   * 
-   * @f[
-   *   e_{vtx} = \frac{# events with vertex}{# of events with trigger}
-   * @f]
-   * 
-   * @return 
-   */
-  Float_t GetVtxEfficiencyFromData() ;
-  /** 
-   * Get the vertex efficiency from the data for NSD triggers
-   * 
-   * @return 
-   */
-  Float_t GetNSDVtxEfficiencyFromData() ;
-    
- private:
-  /** 
-   * Calculate eta from theta
-   * 
-   * @param eta Input eta
-   * 
-   * @return Theta corresponding to eta
-   */
-  Float_t Eta2Theta(Float_t eta) const ;
-  /** 
-   * Get the psuedo-rapidity of a strip
-   * 
-   * @param det     Detector
-   * @param ring    Ring
-   * @param sector  Sector
-   * @param strip   Strip
-   * @param zvtx    Vertex position along beam-axis
-   * 
-   * @return Eta
-   */
-  Double_t EtaFromStrip(UShort_t det, 
-                       Char_t   ring, 
-                       UShort_t sector, 
-                       UShort_t strip, 
-                       Double_t zvtx);
-  /** 
-   * Process a primary particle (MC only)
-   * 
-   */
-  void ProcessPrimary();
-    
-  Int_t          fDebug;            //  Debug flag
-  AliESDEvent*   fESD;              //! ESD
-  AliESDFMD*     foutputESDFMD;     // the output ESDFMD object
-  Bool_t         fSharedThis;       // was this strip shared?
-  Bool_t         fSharedPrev;       // was the previous strip shared?
-  TList*         fDiagList;         // list of diag histos
-  Bool_t         fStandalone;       // do we run standalone or in SE task
-  AliESDVertex*  fEsdVertex;        // vtx info from the ESD
-  Bool_t         fStatus;           // event status
-  AliFMDFloatMap fLastTrackByStrip; // the last track to hit this strip
-  UInt_t         fLastOrbit;
-  
-  ClassDef(AliFMDAnalysisTaskSharing, 0); // Analysis task for FMD analysis
-};
-#endif
-// Local Variables:
-//  mode: C++
-// End Variables:
diff --git a/PWGLF/FORWARD/analysis/AliFMDDndeta.cxx b/PWGLF/FORWARD/analysis/AliFMDDndeta.cxx
deleted file mode 100644 (file)
index 21775f7..0000000
+++ /dev/null
@@ -1,1573 +0,0 @@
-// Code to analyse dN/deta from the forward analysis
-// This can plot the results 
-// Also works for MC data 
-//
-// -- Author: Hans Hjersing Dalsgaard <canute@gmail.com>
-#include "AliFMDDndeta.h"
-#include "TFile.h"
-#include "AliLog.h"
-#include "TH1.h"
-#include "AliFMDAnaParameters.h"
-#include "AliFMDAnaCalibSharingEfficiency.h"
-#include "TStyle.h"
-//#include "TObjArray.h"
-#include "TCanvas.h"
-#include "TLine.h"
-#include "TGraphErrors.h"
-#include "TGraphAsymmErrors.h"
-#include "TPad.h"
-#include "iostream"
-#include "TH3.h"
-#include "TMath.h"
-#include "TProfile.h"
-#include "TProfile2D.h"
-#include "TProfile3D.h"
-#include "TLegend.h"
-#include "TPad.h"
-#include "TLatex.h"
-#include "TStyle.h"
-#include "TF1.h"
-
-#define SMALLNUMBER 0.0001
-
-ClassImp(AliFMDDndeta)
-//_____________________________________________________________________
-
-AliFMDDndeta::AliFMDDndeta() 
-: TObject(),
-  fList(0),
-  fMultList(),
-  fNbinsToCut(2),
-  fVtxCut1(-10),
-  fVtxCut2(10),
-  fIsInit(kFALSE),
-  fIsGenerated(),
-  fPrimEvents(),
-  fEvents(),
-  fPrimdNdeta(),
-  fDrawAll(kFALSE)
-{
-  //AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
-  /* fDataObject = new TProfile3D("dataObject","dataObject",
-                              pars->GetNetaBins(),-6,6,
-                              20,0,2*TMath::Pi(),
-                              pars->GetNvtxBins(),-0.5,pars->GetNvtxBins()-0.5);
-  fDataObject->SetXTitle("#eta");
-  fDataObject->SetYTitle("#varphi [radians]");
-  fDataObject->SetZTitle("v_{z} [cm]");*/
-  
-  fAnalysisNames[0] = "Hits";
-  fAnalysisNames[1] = "HitsTrVtx";
-  fAnalysisNames[2] = "dNdeta";
-  fAnalysisNames[3] = "dNdetaTrVtx";
-  fAnalysisNames[4] = "dNdetaNSD";
-  
-  for(Int_t i=0; i<5;i++) 
-    fMultList[i] = new TList();
-}
-//_____________________________________________________________________
-void AliFMDDndeta::SetNames(Analysis what) {
-  // Set names of histograms from analysis
-  
-  switch(what) {
-  case kHits :
-    fPrimEvents.Form("nMCEventsNoCuts"); //was nMCEvents
-    fEvents.Form("nEvents");
-    fPrimdNdeta.Form("hMultvsEtaNoCuts");
-    break;
-  case kHitsTrVtx :
-    fPrimEvents.Form("nMCEvents"); 
-    fEvents.Form("nEvents");
-    fPrimdNdeta.Form("hMultvsEtaNoCuts");
-    break;
-  case kMult :
-    fPrimEvents.Form("nMCEventsNoCuts"); 
-    fEvents.Form("nEvents");
-    fPrimdNdeta.Form("hMultvsEtaNoCuts");
-    break;
-  case kMultTrVtx :
-    fPrimEvents.Form("nMCEvents"); 
-    fEvents.Form("nEvents");
-    fPrimdNdeta.Form("hMultvsEta");
-    break;
-  case kMultNSD :
-    fPrimEvents.Form("nMCEventsNSDNoCuts"); 
-    fEvents.Form("nNSDEvents");
-    fPrimdNdeta.Form("hMultvsEtaNSDNoCuts");
-    break;
-    
-  default:
-    break;
-  }
-}
-//_____________________________________________________________________
-const char* AliFMDDndeta::GetAnalysisName(Analysis what, UShort_t det, Char_t ring, Int_t vtxbin) {
-  //Get names of histograms
-  const char* name = "";
-  
-  switch(what) {
-  case kHits :
-    name = Form("hits_NoCuts_FMD%d%c_vtxbin%d_proj",det,ring,vtxbin); //NoCuts added
-    break;
-  case kHitsTrVtx :
-    name = Form("hits_FMD%d%c_vtxbin%d_proj",det,ring,vtxbin); 
-    break;
-  case kMult :
-    name = Form("dNdeta_FMD%d%c_vtxbin%d_proj",det,ring,vtxbin);
-    break;
-  case kMultTrVtx :
-    name = Form("dNdeta_FMD%d%c_TrVtx_vtxbin%d_proj",det,ring,vtxbin);
-    break;
-  case kMultNSD :
-    name = Form("dNdetaNSD_FMD%d%c_vtxbin%d_proj",det,ring,vtxbin);
-    break;
-    
-  default:
-    break;
-  }
-  //std::cout<<name.Data()<<std::endl;
-  return name;
-}
-//_____________________________________________________________________
-const char* AliFMDDndeta::GetPrimName(Analysis what, UShort_t det, Char_t ring, Int_t vtxbin) {
-  //Get names of primaries
-  const char* name = "";
-  
-  switch(what) {
-  case kHits :
-    name = Form("hMCHits_nocuts_FMD%d%c_vtxbin%d",det,ring,vtxbin); //nocuts added
-    break;
-  case kHitsTrVtx :
-    name = Form("hMCHits_FMD%d%c_vtxbin%d",det,ring,vtxbin);
-    break;
-  case kMult :
-    name = Form("primmult_vtxbin%d",vtxbin);
-    break;
-  case kMultTrVtx :
-    name = Form("primmult_NoCuts_vtxbin%d",vtxbin);
-    break;
-  case kMultNSD :
-    name = Form("primmult_NSD_vtxbin%d",vtxbin);
-    break;
-  default:
-    break;
-  }
-  return name;
-}
-//_____________________________________________________________________
-void AliFMDDndeta::GenerateHits(Analysis what) {
-  //Generate the hits distributions
-  AliFMDAnaParameters* pars =  AliFMDAnaParameters::Instance();
-  TH2F* hTmp         =  pars->GetBackgroundCorrection(1,'I',0);
-  Int_t nVertexBins  =  pars->GetNvtxBins();
-  Int_t nEtaBins     =  hTmp->GetNbinsX();
-  Float_t etaMin     =  hTmp->GetXaxis()->GetXmin(); 
-  Float_t etaMax     =  hTmp->GetXaxis()->GetXmax();
-
-  for(Int_t i = 0; i<nVertexBins;i++) { // 
-    TH1F* hHits = new TH1F(Form("hMCHits_vtxbin%d_%s",i,fAnalysisNames[what].Data()),Form("hHits_vtxbin%d_%s",i,fAnalysisNames[what].Data()),nEtaBins,etaMin,etaMax);
-    hHits->Sumw2();
-    fMultList[what]->Add(hHits);
-  }
-  
-  for(Int_t det = 1; det<=3; det++) {
-    Int_t maxRing = (det == 1 ? 0 : 1);
-    for(Int_t ring = 0;ring<=maxRing;ring++) {
-      
-      Char_t ringChar = (ring == 0 ? 'I' : 'O');
-      for(Int_t v=0; v< nVertexBins; v++) {
-       TH1F* hits = (TH1F*)fList->FindObject(GetPrimName(what,det,ringChar,v));
-       
-       Int_t nNonZero = 0, nNonZeroInData = 0;
-       
-       //removing edges
-       for(Int_t i =1;i<=hits->GetNbinsX();i++) {
-         if(hits->GetBinContent(i) !=0)
-           nNonZero++;
-       }
-
-       TH1F* sumMultHist = (TH1F*)fMultList[what]->FindObject(Form("hMCHits_vtxbin%d_%s",v,fAnalysisNames[what].Data()));
-       for(Int_t i =1;i<=sumMultHist->GetNbinsX();i++) {
-         if(hits->GetBinContent(i) == 0 ) continue;
-         
-         nNonZeroInData++;
-         
-         if(nNonZeroInData <=fNbinsToCut || nNonZeroInData > (nNonZero - fNbinsToCut)) {
-           continue;
-         }
-         if(sumMultHist->GetBinContent(i) < SMALLNUMBER && TMath::Abs(hits->GetBinContent(i)) > 0){
-             sumMultHist->SetBinContent(i,hits->GetBinContent(i));
-             sumMultHist->SetBinError(i,hits->GetBinError(i));
-           }
-         else {
-             
-             
-           Float_t sumofw = (1/TMath::Power(hits->GetBinError(i),2)) + (1/TMath::Power(sumMultHist->GetBinError(i),2));
-           Float_t wav =  (hits->GetBinContent(i)*(1/TMath::Power(hits->GetBinError(i),2)) + sumMultHist->GetBinContent(i)*(1/TMath::Power(sumMultHist->GetBinError(i),2)))/sumofw;
-           Float_t error = 1/TMath::Sqrt(sumofw);
-           sumMultHist->SetBinContent(i, wav);
-           sumMultHist->SetBinError(i, error);
-         }
-       }
-      }
-    }
-  }
-}
-
-//_____________________________________________________________________
-void AliFMDDndeta::Init(const Char_t* filename) {
-  //Initialize everything from file
-  TFile* fin = TFile::Open(filename);
-  
-  if(!fin) {
-    AliWarning("No file - exiting !");
-    return;
-  }
-  AliFMDAnaParameters* pars =  AliFMDAnaParameters::Instance();
-  //pars->Init();
-  
-  TList* list = (TList*)fin->Get(Form("%s/BackgroundCorrected",pars->GetDndetaAnalysisName()));
-  
-  if(!list) //an old file ? Perhaps...
-    list = (TList*)fin->Get("BackgroundCorrected");
-  
-  Init(list);
-  
-}
-//_____________________________________________________________________
-void AliFMDDndeta::Init(TList* list) {
-  //Initialize everything from TList
-    
-  if(!list) {
-    AliWarning("No list - exiting !");
-    return;
-  }
-  
-  fList = (TList*)list->Clone("inputList");
-    
-  fIsGenerated[kHits]      = kFALSE;
-  fIsGenerated[kMult]      = kFALSE;  
-  fIsGenerated[kMultTrVtx] = kFALSE;
-  fIsGenerated[kHitsTrVtx] = kFALSE;
-  fIsGenerated[kMultNSD]   = kFALSE;
-  
-  fIsInit = kTRUE;
-}
-//_____________________________________________________________________
-void AliFMDDndeta::GenerateMult(Analysis what) {
-  //Generate dNdeta
-  
-  if(!fIsInit) {
-    AliWarning("Not initialised - call Init to remedy");
-    return;
-  }
-  
-  if(fIsGenerated[what]) {
-    AliWarning("Already generated - have a look at the results!");
-    return;
-  }
-  else fIsGenerated[what] = kTRUE;
-  
-  SetNames(what);
-  
-  if(what == kHits || what == kHitsTrVtx)
-    GenerateHits(what);
-  
-  TH1I* hMCEvents = (TH1I*)fList->FindObject(fPrimEvents.Data());
-  
-  AliFMDAnaParameters* pars =  AliFMDAnaParameters::Instance();
-  
-  TH2F* hTmp         =  pars->GetBackgroundCorrection(1,'I',0);
-  Int_t nVertexBins  =  pars->GetNvtxBins();
-  Int_t nEtaBins     =  hTmp->GetNbinsX();
-  Float_t etaMin     =  hTmp->GetXaxis()->GetXmin(); 
-  Float_t etaMax     =  hTmp->GetXaxis()->GetXmax();
-  
-  for(Int_t i = 0; i<nVertexBins;i++) {
-    TH1F* hMult = new TH1F(Form("hMult_vtxbin%d_%s",i,fAnalysisNames[what].Data()),Form("hMult_vtxbin%d_%s",i,fAnalysisNames[what].Data()),nEtaBins,etaMin,etaMax);
-    hMult->Sumw2();
-    fMultList[what]->Add(hMult);
-  }
-  
-  for(Int_t det = 1; det<=3;det++) {
-    Int_t maxRing = (det == 1 ? 0 : 1);
-    for(Int_t iring = 0; iring<=maxRing; iring++) {
-      Char_t ringChar = (iring == 0 ? 'I' : 'O');
-      //Int_t nsec  = (iring == 0 ? 20 : 40);
-      TH1F* hRingMul