Skip to content

Commit

Permalink
Fix the copying of TF2 or TF3 objects in TEfficiency::Fit
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoneta committed Mar 17, 2023
1 parent b08941f commit 5858905
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hist/hist/src/TEfficiency.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2373,7 +2373,8 @@ TFitResultPtr TEfficiency::Fit(TF1* f1,Option_t* opt)
TFitResultPtr result = Fitter.Fit(f1,option.Data());

//create copy which is appended to the list
TF1* pFunc = new TF1(*f1);
auto pFunc = static_cast<TF1*>(f1->IsA()->New());
f1->Copy(*pFunc);

if(bDeleteOld) {
TIter next(fFunctions);
Expand Down

0 comments on commit 5858905

Please sign in to comment.