Moving from stack to heap (D.Berzano)
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 9 Sep 2011 09:37:04 +0000 (09:37 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 9 Sep 2011 09:37:04 +0000 (09:37 +0000)
PWG3/hfe/AliHFEspectrum.cxx

index 1461984..09a91ae 100644 (file)
@@ -450,12 +450,12 @@ Bool_t AliHFEspectrum::Correct(Bool_t subtractcontamination){
     ratiocorrected->SetStats(0);
     ratiocorrected->Draw();
 
-    TH1D unfoldingspectrac[fNCentralityBinAtTheEnd];
-    TGraphErrors unfoldingspectracn[fNCentralityBinAtTheEnd];
-    TH1D correctedspectrac[fNCentralityBinAtTheEnd];
-    TGraphErrors correctedspectracn[fNCentralityBinAtTheEnd];
+    TH1D *unfoldingspectrac = new TH1D[fNCentralityBinAtTheEnd];
+    TGraphErrors *unfoldingspectracn = new TGraphErrors[fNCentralityBinAtTheEnd];
+    TH1D *correctedspectrac = new TH1D[fNCentralityBinAtTheEnd];
+    TGraphErrors *correctedspectracn = new TGraphErrors[fNCentralityBinAtTheEnd];
+
 
-    
 
     if(fBeamType==1) {
 
@@ -627,10 +627,12 @@ Bool_t AliHFEspectrum::Correct(Bool_t subtractcontamination){
       out->Close(); delete out;
     }
 
-  }
-
+    delete [] unfoldingspectrac;
+    delete [] unfoldingspectracn;
+    delete [] correctedspectrac;
+    delete [] correctedspectracn;
 
-  
+  }
 
   return kTRUE;
 }