up from Salvatore
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 May 2013 03:52:57 +0000 (03:52 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 May 2013 03:52:57 +0000 (03:52 +0000)
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskSAQA.cxx
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskSAQA.h

index 79b1351..d25d2b6 100644 (file)
@@ -51,7 +51,6 @@ AliAnalysisTaskSAQA::AliAnalysisTaskSAQA() :
   fHistNCellsEnergy(0),
   fHistFcrossEnergy(0),
   fHistClusTimeEnergy(0),
-  fHistClusMCEnergyFraction(0),
   fHistCellsAbsIdEnergy(0),
   fHistChVSneCells(0),
   fHistChVSneClus(0),
@@ -69,6 +68,7 @@ AliAnalysisTaskSAQA::AliAnalysisTaskSAQA() :
     fHistDeltaPtvsPt[i] = 0;
     fHistTrPhiEtaPtZeroLab[i] = 0;
     fHistClusPhiEtaEnergy[i] = 0;
+    fHistClusMCEnergyFraction[i] = 0;
     fHistJetsPhiEtaPt[i] = 0;
     fHistJetsPtArea[i] = 0;
   }
@@ -97,7 +97,6 @@ AliAnalysisTaskSAQA::AliAnalysisTaskSAQA(const char *name) :
   fHistNCellsEnergy(0),
   fHistFcrossEnergy(0),
   fHistClusTimeEnergy(0),
-  fHistClusMCEnergyFraction(0),
   fHistCellsAbsIdEnergy(0),
   fHistChVSneCells(0),
   fHistChVSneClus(0),
@@ -115,6 +114,7 @@ AliAnalysisTaskSAQA::AliAnalysisTaskSAQA(const char *name) :
     fHistDeltaPtvsPt[i] = 0;
     fHistTrPhiEtaPtZeroLab[i] = 0;
     fHistClusPhiEtaEnergy[i] = 0;
+    fHistClusMCEnergyFraction[i] = 0;
     fHistJetsPhiEtaPt[i] = 0;
     fHistJetsPtArea[i] = 0;
   }
@@ -249,6 +249,15 @@ void AliAnalysisTaskSAQA::UserCreateOutputObjects()
       fHistClusPhiEtaEnergy[i]->GetYaxis()->SetTitle("#phi");
       fHistClusPhiEtaEnergy[i]->GetZaxis()->SetTitle("E_{cluster} (GeV)");
       fOutput->Add(fHistClusPhiEtaEnergy[i]);
+
+      if (fIsEmbedded) {
+       histname = "fHistClusMCEnergyFraction_";
+       histname += i;
+       fHistClusMCEnergyFraction[i] = new TH1F(histname, histname, fNbins, 0, 1.2);
+       fHistClusMCEnergyFraction[i]->GetXaxis()->SetTitle("MC fraction");
+       fHistClusMCEnergyFraction[i]->GetYaxis()->SetTitle("counts");
+       fOutput->Add(fHistClusMCEnergyFraction[i]);
+      }
     }
 
     fHistClusTimeEnergy = new TH2F("fHistClusTimeEnergy","Time vs. energy of clusters", fNbins, fMinBinPt, fMaxBinPt, fNbins,  -1e-6, 1e-6);
@@ -256,13 +265,6 @@ void AliAnalysisTaskSAQA::UserCreateOutputObjects()
     fHistClusTimeEnergy->GetYaxis()->SetTitle("Time");
     fOutput->Add(fHistClusTimeEnergy);
 
-    if (fIsEmbedded) {
-      fHistClusMCEnergyFraction = new TH1F("fHistClusMCEnergyFraction","fHistClusMCEnergyFraction", fNbins, 0, 1.2);
-      fHistClusMCEnergyFraction->GetXaxis()->SetTitle("MC fraction");
-      fHistClusMCEnergyFraction->GetYaxis()->SetTitle("counts");
-      fOutput->Add(fHistClusMCEnergyFraction);
-    }
-
     fHistNCellsEnergy = new TH2F("fHistNCellsEnergy","Number of cells vs. energy of clusters", fNbins, fMinBinPt, fMaxBinPt, 30, 0, 30);
     fHistNCellsEnergy->GetXaxis()->SetTitle("E_{cluster} (GeV)");
     fHistNCellsEnergy->GetYaxis()->SetTitle("N_{cells}");
@@ -514,8 +516,8 @@ Float_t AliAnalysisTaskSAQA::DoClusterLoop()
     if (cells)
       fHistFcrossEnergy->Fill(cluster->E(), GetFcross(cluster, cells));
 
-    if (fHistClusMCEnergyFraction)
-      fHistClusMCEnergyFraction->Fill(cluster->GetMCEnergyFraction());
+    if (fHistClusMCEnergyFraction[fCentBin])
+      fHistClusMCEnergyFraction[fCentBin]->Fill(cluster->GetMCEnergyFraction());
 
     fNclusters++;
   }
index 6ec5a30..0ca0ef1 100644 (file)
@@ -65,7 +65,7 @@ class AliAnalysisTaskSAQA : public AliAnalysisTaskEmcalJet {
   TH2                        *fHistNCellsEnergy;         //!Number of cells vs. energy of cluster
   TH2                        *fHistFcrossEnergy;         //!Fcross vs. energy of cluster
   TH2                        *fHistClusTimeEnergy;       //!Time vs. energy of cluster
-  TH1                        *fHistClusMCEnergyFraction; //!MC energy fraction (embedding)
+  TH1                        *fHistClusMCEnergyFraction[4];//!MC energy fraction (embedding)
 
   // Jets
   TH3                        *fHistJetsPhiEtaPt[4];      //!Phi-Eta distribution of jets