Skip to content

Commit 79a0a34

Browse files
authored
Comment by dan131riley
1 parent 51314b6 commit 79a0a34

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

DQMServices/Components/plugins/DQMGenericClient.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,14 @@ class FitSlicesYTool {
157157
TH1::AddDirectory(true);
158158
// ... create your hists
159159
TH2F* h = me->getTH2F();
160-
TF1* fitFcn = new TF1("gaus", "gaus", h->GetYaxis()->GetXmin(), h->GetYaxis()->GetXmax());
161-
h->FitSlicesY(fitFcn, 0, -1, 0, "QNR SERIAL");
160+
TF1 fgaus("fgaus", "gaus", h->GetYaxis()->GetXmin(), h->GetYaxis()->GetXmax(), TF1::EAddToList::kNo);
161+
h->FitSlicesY(&fgaus, 0, -1, 0, "QNR SERIAL");
162162
string name(h->GetName());
163163
h0 = (TH1*)gDirectory->Get((name + "_0").c_str());
164164
h1 = (TH1*)gDirectory->Get((name + "_1").c_str());
165165
h2 = (TH1*)gDirectory->Get((name + "_2").c_str());
166166
h3 = (TH1*)gDirectory->Get((name + "_chi2").c_str());
167167
TH1::AddDirectory(oldAddDir);
168-
delete fitFcn;
169168
}
170169

171170
/// Destructor

0 commit comments

Comments
 (0)