Skip to content

Commit f5fef03

Browse files
committed
[RF] Remove unneeded pointer dereferencing in RooFit tutorial rf617
Now that also objects returned by smart pointer get automatically downcasted to the actual type, we don't need to dereference returned smart pointer objects to trigger the automatic downcasting.
1 parent 6f366ac commit f5fef03

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

tutorials/roofit/roofit/rf617_simulation_based_inference_multidimensional.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,17 +261,9 @@ def learned_likelihood_ratio(*args):
261261
nllr_learned.plotOn(frame1, LineColor="kP6Blue", ShiftToZero=True, Name="learned")
262262

263263

264-
# Declare a helper function in ROOT to dereference unique_ptr
265-
ROOT.gInterpreter.Declare(
266-
"""
267-
RooAbsArg &my_deref(std::unique_ptr<RooAbsArg> const& ptr) { return *ptr; }
268-
"""
269-
)
270-
271264
# Choose normalization set for lhr_calc to plot over
272265
norm_set = ROOT.RooArgSet(x_vars)
273-
lhr_calc_final_ptr = ROOT.RooFit.Detail.compileForNormSet(lhr_calc, norm_set)
274-
lhr_calc_final = ROOT.my_deref(lhr_calc_final_ptr)
266+
lhr_calc_final = ROOT.RooFit.Detail.compileForNormSet(lhr_calc, norm_set)
275267
lhr_calc_final.recursiveRedirectServers(norm_set)
276268

277269
# Plot the likelihood ratio functions

0 commit comments

Comments
 (0)