fill histograms only when requesting mixing analysis
authorgconesab <gustavo.conesa.balbastre@cern.ch>
Sat, 22 Mar 2014 18:06:42 +0000 (19:06 +0100)
committergconesab <gustavo.conesa.balbastre@cern.ch>
Sat, 22 Mar 2014 18:17:29 +0000 (19:17 +0100)
PWGGA/CaloTrackCorrelations/AliAnaPi0.cxx

index feb8176..cbb2c0c 100755 (executable)
@@ -591,18 +591,22 @@ TList * AliAnaPi0::GetCreateOutputObjects()
     outputContainer->Add(fhReSS[2]) ;
   }
   
-  fhEventBin=new TH1I("hEventBin","Number of real pairs per bin(cen,vz,rp)",
-                      GetNCentrBin()*GetNZvertBin()*GetNRPBin()+1,0, 
-                      GetNCentrBin()*GetNZvertBin()*GetNRPBin()+1) ;
-  fhEventBin->SetXTitle("bin");
-  outputContainer->Add(fhEventBin) ;
-  
-  fhEventMixBin=new TH1I("hEventMixBin","Number of mixed pairs per bin(cen,vz,rp)",
-                         GetNCentrBin()*GetNZvertBin()*GetNRPBin()+1,0,
-                         GetNCentrBin()*GetNZvertBin()*GetNRPBin()+1) ;
-  fhEventMixBin->SetXTitle("bin");
-  outputContainer->Add(fhEventMixBin) ;  
-       
+  if(DoOwnMix())
+  {
+    fhEventBin=new TH1I("hEventBin","Number of real pairs per bin(cen,vz,rp)",
+                        GetNCentrBin()*GetNZvertBin()*GetNRPBin()+1,0,
+                        GetNCentrBin()*GetNZvertBin()*GetNRPBin()+1) ;
+    fhEventBin->SetXTitle("bin");
+    outputContainer->Add(fhEventBin) ;
+    
+    
+    fhEventMixBin=new TH1I("hEventMixBin","Number of mixed pairs per bin(cen,vz,rp)",
+                           GetNCentrBin()*GetNZvertBin()*GetNRPBin()+1,0,
+                           GetNCentrBin()*GetNZvertBin()*GetNRPBin()+1) ;
+    fhEventMixBin->SetXTitle("bin");
+    outputContainer->Add(fhEventMixBin) ;
+       }
+  
   if(GetNCentrBin()>1)
   {
     fhCentrality=new TH1F("hCentralityBin","Number of events in centrality bin",GetNCentrBin(),0.,1.*GetNCentrBin()) ;
@@ -1949,7 +1953,7 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
     if (evtIndex1 != currentEvtIndex) 
     {
       //Fill event bin info
-      fhEventBin->Fill(eventbin) ;
+      if(DoOwnMix()) fhEventBin->Fill(eventbin) ;
       if(GetNCentrBin() > 1) 
       {
         fhCentrality->Fill(curCentrBin);