R3BRootGroup / R3BRoot

Framework for Simulations and Data Analysis of R3B Experiment
https://github.com/R3BRootGroup/R3BRoot/wiki
GNU General Public License v3.0
18 stars 104 forks source link

[HOT FIX] Fix the crash in the end of neuland Map2CalPar process #870

Closed YanzhaoW closed 1 year ago

YanzhaoW commented 1 year ago

Program crashes when using R3BNeulandMapped2CalPar to create cal-level parameter.

This is due to the deletion of non-owning memory (namely TH1F and FairParSet).

When I suggested we should use

auto* hist = R3B::root_owned<TH1F>("hist", "hist", 0, 1, 10);

to specify the ownership of ROOT histograms. I remember someone said this is totally not necessary because people would never delete histograms. Well, it turns out people do.


Checklist:

YanzhaoW commented 1 year ago

@jose-luis-rs Ready to be merged.