Corrections Ch. Kleinn-Boesing
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Nov 2010 11:11:47 +0000 (11:11 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Nov 2010 11:11:47 +0000 (11:11 +0000)
ANALYSIS/AliCentralitySelectionTask.cxx
ANALYSIS/AliCentralitySelectionTask.h

index 3289104..87674f7 100644 (file)
@@ -28,6 +28,8 @@
 #include <TObjString.h>
 #include <TString.h>
 #include <TCanvas.h>
+#include <TROOT.h>
+#include <TDirectory.h>
 #include <iostream>
 
 #include "AliAnalysisManager.h"
@@ -70,8 +72,8 @@ AliAnalysisTaskSE(),
   fIsMCInput(kFALSE),
   fFile(0),
   fFile2(0),
-  fCentfilename(0),
-  fCentfilename2(0),
+  fCentfilename(""),
+  fCentfilename2(""),
   fFileList(new TList),
   fFileList2(new TList),
   fCurrentRun(-1),
@@ -109,8 +111,8 @@ AliCentralitySelectionTask::AliCentralitySelectionTask(const char *name):
   fIsMCInput(kFALSE),
   fFile(0),
   fFile2(0),
-  fCentfilename(0),
-  fCentfilename2(0),
+  fCentfilename(""),
+  fCentfilename2(""),
   fFileList(new TList),
   fFileList2(new TList),
   fCurrentRun(-1),
@@ -358,27 +360,34 @@ void AliCentralitySelectionTask::UserExec(Option_t */*option*/)
 //________________________________________________________________________
 void AliCentralitySelectionTask::ReadCentralityHistos() 
 {
-  fFile = TFile::Open(fCentfilename,"READ");
-  fHtempV0M  = (TH1D*) (fFile->Get("hmultV0_percentile")); 
-  fHtempFMD  = (TH1D*) (fFile->Get("hmultFMD_percentile")); 
-  fHtempTRK  = (TH1D*) (fFile->Get("hNtracks_percentile")); 
-  fHtempTKL  = (TH1D*) (fFile->Get("hNtracklets_percentile")); 
-  fHtempCL0  = (TH1D*) (fFile->Get("hNclusters0_percentile")); 
-  fHtempCL1  = (TH1D*) (fFile->Get("hNclusters1_percentile")); 
+//  Read centrality histograms
+    TDirectory *owd = gDirectory;
+    fFile  = TFile::Open(fCentfilename);
+    owd->cd();
+    fHtempV0M  = (TH1F*) (fFile->Get("hmultV0_percentile"));
+    fHtempFMD  = (TH1F*) (fFile->Get("hmultFMD_percentile"));
+    fHtempTRK  = (TH1F*) (fFile->Get("hNtracks_percentile"));
+    fHtempTKL  = (TH1F*) (fFile->Get("hNtracklets_percentile"));
+    fHtempCL0  = (TH1F*) (fFile->Get("hNclusters0_percentile"));
+    fHtempCL1  = (TH1F*) (fFile->Get("hNclusters1_percentile"));
 }  
 
 //________________________________________________________________________
 void AliCentralitySelectionTask::ReadCentralityHistos2() 
 {
-  fFile2 = TFile::Open(fCentfilename2);
-  fHtempV0MvsFMD  = (TH1D*) (fFile2->Get("hmultV0vsmultFMD_all_percentile")); 
-  fHtempTKLvsV0M  = (TH1D*) (fFile2->Get("hNtrackletsvsmultV0_all_percentile")); 
-  fHtempZEMvsZDC  = (TH1D*) (fFile2->Get("hEzemvsEzdc_all_percentile"));  
+//  Read centrality histograms
+    TDirectory *owd = gDirectory;
+    fFile2  = TFile::Open(fCentfilename2);
+    owd->cd();
+    fHtempV0MvsFMD =  (TH1F*) (fFile2->Get("hmultV0vsmultFMD_all_percentile"));
+    fHtempTKLvsV0M  = (TH1F*) (fFile2->Get("hNtrackletsvsmultV0_all_percentile"));
+    fHtempZEMvsZDC  = (TH1F*) (fFile2->Get("hEzemvsEzdc_all_percentile"));
 }
 
 //________________________________________________________________________
 void AliCentralitySelectionTask::SetPercentileFile(TString filename) 
 {
+// Set the percentile file name
   fCentfilename = filename;
   ReadCentralityHistos();
 }
@@ -386,6 +395,7 @@ void AliCentralitySelectionTask::SetPercentileFile(TString filename)
 //________________________________________________________________________
 void AliCentralitySelectionTask::SetPercentileFile2(TString filename) 
 {
+// Set the percentile file name
   fCentfilename2 = filename;
   ReadCentralityHistos2();
 }
index ab5b98f..e6e5a7e 100644 (file)
@@ -12,9 +12,9 @@
 #include "AliAnalysisTaskSE.h"
 
 class TFile;
-class TH2F;
+class TH1F;
 class TList;
-class TObjString;
+class TString;
 
 class AliESDEvent;
 
@@ -57,8 +57,8 @@ class AliCentralitySelectionTask : public AliAnalysisTaskSE {
   TString  fCentfilename;       // name of this file 1d
   TString  fCentfilename2;      // name of this file 2d
   
-  TList*   fFileList;           // list of input files names
-  TList*   fFileList2;          // list of input files 2 names
+  TList*   fFileList;           //! list of input files names
+  TList*   fFileList2;          //! list of input files 2 names
   Int_t    fCurrentRun;         // current run number
 
   Float_t  fCentV0M;            // percentile centrality from V0
@@ -71,15 +71,15 @@ class AliCentralitySelectionTask : public AliAnalysisTaskSE {
   Float_t  fCentTKLvsV0M;       // percentile centrality from tracklets vs V0
   Float_t  fCentZEMvsZDC;       // percentile centrality from ZEM vs ZDC
 
-  TH1D    *fHtempV0M;           // histogram with centrality vs multiplicity using V0
-  TH1D    *fHtempFMD;           // histogram with centrality vs multiplicity using FMD
-  TH1D    *fHtempTRK;           // histogram with centrality vs multiplicity using tracks
-  TH1D    *fHtempTKL;           // histogram with centrality vs multiplicity using tracklets
-  TH1D    *fHtempCL0;           // histogram with centrality vs multiplicity using clusters in layer 0
-  TH1D    *fHtempCL1;           // histogram with centrality vs multiplicity using clusters in layer 0
-  TH1D    *fHtempV0MvsFMD;           // histogram with centrality vs multiplicity using V0 vs FMD   
-  TH1D    *fHtempTKLvsV0M;           // histogram with centrality vs multiplicity using tracklets vs V0
-  TH1D    *fHtempZEMvsZDC;           // histogram with centrality vs multiplicity using ZEM vs ZDC 
+  TH1F    *fHtempV0M;           // histogram with centrality vs multiplicity using V0
+  TH1F    *fHtempFMD;           // histogram with centrality vs multiplicity using FMD
+  TH1F    *fHtempTRK;           // histogram with centrality vs multiplicity using tracks
+  TH1F    *fHtempTKL;           // histogram with centrality vs multiplicity using tracklets
+  TH1F    *fHtempCL0;           // histogram with centrality vs multiplicity using clusters in layer 0
+  TH1F    *fHtempCL1;           // histogram with centrality vs multiplicity using clusters in layer 0
+  TH1F    *fHtempV0MvsFMD;           // histogram with centrality vs multiplicity using V0 vs FMD   
+  TH1F    *fHtempTKLvsV0M;           // histogram with centrality vs multiplicity using tracklets vs V0
+  TH1F    *fHtempZEMvsZDC;           // histogram with centrality vs multiplicity using ZEM vs ZDC 
 
   ClassDef(AliCentralitySelectionTask,1);