Skip to content

Commit

Permalink
Merge pull request alisw#242 from shahor02/master
Browse files Browse the repository at this point in the history
Fix of non-initialized var. + memory leak
  • Loading branch information
alibuild authored Jun 8, 2017
2 parents 8c3ba23 + 3c14120 commit 9ce8bb9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions T0/T0rec/AliT0CalibSeasonTimeShift.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Int_t AliT0CalibSeasonTimeShift::SetT0Par(const char* filePhys, Float_t *cdbtime
// 300 no one histogram or it is empty
//-100 peak is very narrow

Float_t mean, sigma;
Float_t mean=0, sigma=0;
Int_t ok = 0;
TH1F *hcfd = NULL;
TH2F *hT0mult = NULL;
Expand Down Expand Up @@ -182,7 +182,7 @@ Int_t AliT0CalibSeasonTimeShift::SetT0Par(const char* filePhys, Float_t *cdbtime
if(hT0mult) {
Int_t nbins = hT0mult->GetXaxis()->GetNbins();
Float_t meanprof[nbins], sigmares[nbins], mult[nbins];
Int_t npoints;
Int_t npoints = 0;
for (int ibin=1; ibin<nbins-2; ibin++) {
mult[ibin-1]= hT0mult-> GetXaxis()->GetBinCenter(ibin);
TH1D *proj = hT0mult->ProjectionY(Form("prY%i",ibin),ibin, ibin+1);
Expand All @@ -197,6 +197,7 @@ Int_t AliT0CalibSeasonTimeShift::SetT0Par(const char* filePhys, Float_t *cdbtime
sigmares[ibin-1]=fSigmaPar[i];
meanprof[ibin-1]=fMeanPar[i];
}
delete proj;
}
TGraph *gr = NULL;
if(i<3) gr = new TGraph(npoints-1, mult, meanprof);
Expand Down

0 comments on commit 9ce8bb9

Please sign in to comment.