From acb5beb717fe9eebdd68b19d746e6eb4174a4c08 Mon Sep 17 00:00:00 2001 From: hristov Date: Fri, 29 Oct 2004 07:04:53 +0000 Subject: [PATCH] Fixing memory leaks. Using TMath functions instead of TF1 --- PHOS/AliPHOSPIDv1.cxx | 53 +++++++++++++++++-------------------------- PHOS/AliPHOSPIDv1.h | 1 + 2 files changed, 22 insertions(+), 32 deletions(-) diff --git a/PHOS/AliPHOSPIDv1.cxx b/PHOS/AliPHOSPIDv1.cxx index 6c87623e2a0..2145f8f57ad 100644 --- a/PHOS/AliPHOSPIDv1.cxx +++ b/PHOS/AliPHOSPIDv1.cxx @@ -82,7 +82,7 @@ // --- Standard library --- -#include "TF1.h" +#include "TFormula.h" #include "TBenchmark.h" #include "TPrincipal.h" #include "TFile.h" @@ -129,10 +129,21 @@ AliPHOSPIDv1::AliPHOSPIDv1(const TString alirunFileName, const TString eventFold AliPHOSPIDv1::~AliPHOSPIDv1() { // dtor + fPrincipalPhoton = 0; + fPrincipalPi0 = 0; delete [] fX ; // Principal input delete [] fPPhoton ; // Photon Principal components delete [] fPPi0 ; // Pi0 Principal components + + delete fParameters; + delete fTFphoton; + delete fTFpiong; + delete fTFkaong; + delete fTFkaonl; + delete fTFhhadrong; + delete fTFhhadronl; + delete fDFmuon; } //____________________________________________________________________________ const TString AliPHOSPIDv1::BranchName() const @@ -385,11 +396,7 @@ const Double_t AliPHOSPIDv1::GausF(Double_t x, Double_t y, Double_t * par) // Double_t arg = - (y-mean) * (y-mean) / (2*sigma*sigma) ; // return cnt * TMath::Exp(arg) ; if(TMath::Abs(sigma) > 1.e-10){ - TF1 * f = new TF1("gaus","gaus",0,100); - f->SetParameters(cnt,mean,sigma); - Double_t arg = f->Eval(y) ; - //cout<<"GausF : en "< 1.e-10){ - TF1 * f = new TF1("gaus","gaus",0,100); - f->SetParameters(cnt,mean,sigma); - Double_t arg = f->Eval(y) ; - //cout<<"GausPol : en "< 1.e-10){ - TF1 * f = new TF1("landau","landau",0.,100.); - f->SetParameters(cnt,mean,sigma); - Double_t arg = f->Eval(y) ; - // cout<<"LandauF : en "< 1.e-10){ - TF1 * f = new TF1("landau","landau",0.,100.); - f->SetParameters(cnt,mean,sigma); - Double_t arg = f->Eval(y) ; - //cout<<"LandauPol : en "<