Cleaning up files, added documentation. Added ntuple for v0s.
[u/mrichter/AliRoot.git] / PWG4 / GammaConv / AliGammaConversionHistograms.cxx
index 08ada54..2ca295f 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
  *                                                                        *\r
  * Author: Ana Marin, Kathrin Koch, Kenneth Aamodt                        *\r
- * Version 1.0                                                            *\r
+ * Version 1.1                                                            *\r
  *                                                                        *\r
  * Permission to use, copy, modify and distribute this software and its   *\r
  * documentation strictly for non-commercial purposes is hereby granted   *\r
@@ -43,7 +43,14 @@ AliGammaConversionHistograms::AliGammaConversionHistograms() :
   fMinPhi(0.),\r
   fMaxPhi(0.),\r
   fDeltaPhi(0.),\r
-  fMappingContainer(NULL)\r
+  fMappingContainer(NULL),\r
+  fBackgroundContainer(NULL),\r
+  fDebugContainer(NULL),\r
+  fResolutionContainer(NULL),\r
+  fMatchContainer(NULL),\r
+  fESDContainer(NULL),\r
+  fMCContainer(NULL),\r
+  fOtherContainer(NULL)\r
 {\r
   // see header file for documenation\r
 }\r
@@ -59,7 +66,14 @@ AliGammaConversionHistograms::AliGammaConversionHistograms(const AliGammaConvers
   fMinPhi(original.fMinPhi),\r
   fMaxPhi(original.fMaxPhi),\r
   fDeltaPhi(original.fDeltaPhi),\r
-  fMappingContainer(original.fMappingContainer)\r
+  fMappingContainer(original.fMappingContainer),\r
+  fBackgroundContainer(original.fBackgroundContainer),\r
+  fDebugContainer(original.fDebugContainer),\r
+  fResolutionContainer(original.fResolutionContainer),\r
+  fMatchContainer(original.fMatchContainer),\r
+  fESDContainer(original.fESDContainer),\r
+  fMCContainer(original.fMCContainer),\r
+  fOtherContainer(original.fOtherContainer)\r
 {    \r
   //see header file for documentation\r
 }\r
@@ -102,9 +116,6 @@ void AliGammaConversionHistograms::FillHistogram(TString histogramName, Double_t
   if(tmp){\r
       tmp->Fill(xValue);\r
   }\r
-  else{\r
-    cout<<"Histogram does not exist: "<<histogramName.Data()<<endl;\r
-  }\r
 }\r
 \r
 void AliGammaConversionHistograms::FillHistogram(TString histogramName, Double_t xValue, Double_t yValue) const{\r
@@ -113,9 +124,6 @@ void AliGammaConversionHistograms::FillHistogram(TString histogramName, Double_t
   if(tmp){\r
     tmp->Fill(xValue, yValue);\r
   }\r
-  else{\r
-    cout<<"Histogram does not exist: "<<histogramName.Data()<<endl;\r
-  }\r
 }\r
 \r
 void AliGammaConversionHistograms::GetOutputContainer(TList *fOutputContainer){\r
@@ -140,10 +148,95 @@ void AliGammaConversionHistograms::GetOutputContainer(TList *fOutputContainer){
          fMappingContainer->Add((TH1*)fHistogramMap->GetValue(histogramString.Data()));\r
        }\r
       }\r
-      fOutputContainer->Add((TH1*)fHistogramMap->GetValue(histogramString.Data()));\r
+      else if(histogramString.Contains("Background")){// means it should be put in the background folder\r
+       if(fBackgroundContainer == NULL){\r
+         fBackgroundContainer = new TList();\r
+         fBackgroundContainer->SetName("Background histograms");\r
+       }\r
+       if(fBackgroundContainer != NULL){\r
+         fBackgroundContainer->Add((TH1*)fHistogramMap->GetValue(histogramString.Data()));\r
+       }\r
+      }\r
+      else if(histogramString.Contains("Debug")){// means it should be put in the debug folder\r
+       if(fDebugContainer == NULL){\r
+         fDebugContainer = new TList();\r
+         fDebugContainer->SetName("Debug histograms");\r
+       }\r
+       if(fDebugContainer != NULL){\r
+         fDebugContainer->Add((TH1*)fHistogramMap->GetValue(histogramString.Data()));\r
+       }\r
+      }\r
+      else if(histogramString.Contains("Resolution")){// means it should be put in the resolution folder\r
+       if(fResolutionContainer == NULL){\r
+         fResolutionContainer = new TList();\r
+         fResolutionContainer->SetName("Resolution histograms");\r
+       }\r
+       if(fResolutionContainer != NULL){\r
+         fResolutionContainer->Add((TH1*)fHistogramMap->GetValue(histogramString.Data()));\r
+       }\r
+      }\r
+      else if(histogramString.Contains("Match")){// means it should be put in the mapping folder\r
+       if(fMatchContainer == NULL){\r
+         fMatchContainer = new TList();\r
+         fMatchContainer->SetName("Match histograms");\r
+       }\r
+       if(fMatchContainer != NULL){\r
+         fMatchContainer->Add((TH1*)fHistogramMap->GetValue(histogramString.Data()));\r
+       }\r
+      }\r
+      else if(histogramString.Contains("ESD")){// means it should be put in the ESD folder\r
+       if(fESDContainer == NULL){\r
+         fESDContainer = new TList();\r
+         fESDContainer->SetName("ESD histograms");\r
+       }\r
+       if(fESDContainer != NULL){\r
+         fESDContainer->Add((TH1*)fHistogramMap->GetValue(histogramString.Data()));\r
+       }\r
+      }\r
+      else if(histogramString.Contains("MC")){// means it should be put in the MC folder\r
+       if(fMCContainer == NULL){\r
+         fMCContainer = new TList();\r
+         fMCContainer->SetName("MC histograms");\r
+       }\r
+       if(fMCContainer != NULL){\r
+         fMCContainer->Add((TH1*)fHistogramMap->GetValue(histogramString.Data()));\r
+       }\r
+      }\r
+      else{\r
+       if(fOtherContainer == NULL){\r
+         fOtherContainer = new TList();\r
+         fOtherContainer->SetName("Other histograms");\r
+       }\r
+       if(fOtherContainer != NULL){\r
+         fOtherContainer->Add((TH1*)fHistogramMap->GetValue(histogramString.Data()));\r
+       }\r
+      }\r
       histogramName = NULL;\r
     } // end while\r
-    //   fOutputContainer->Add(fMappingContainer);\r
+    if(fMappingContainer != NULL){\r
+      fOutputContainer->Add(fMappingContainer);\r
+    }\r
+    if(fBackgroundContainer != NULL){\r
+      fOutputContainer->Add(fBackgroundContainer);\r
+    }\r
+    if(fDebugContainer != NULL){\r
+      fOutputContainer->Add(fDebugContainer);\r
+    }\r
+    if(fResolutionContainer != NULL){\r
+      fOutputContainer->Add(fResolutionContainer);\r
+    }\r
+    if(fMatchContainer != NULL){\r
+      fOutputContainer->Add(fMatchContainer);\r
+    }\r
+    if(fESDContainer != NULL){\r
+      fOutputContainer->Add(fESDContainer);\r
+    }\r
+    if(fMCContainer != NULL){\r
+      fOutputContainer->Add(fMCContainer);\r
+    }\r
+    if(fOtherContainer != NULL){\r
+      fOutputContainer->Add(fMCContainer);\r
+    }\r
   }\r
 }\r
 \r