When fitting a TF1 function to a TH1F histogram within a cell in a jupyter notebook
the kernel crashes, if there is no code below the fit command.
Why does this happen?
Minimal example:
# Cell 1
from ROOT import TH1F, TF1, TRandom3
RNG = TRandom3(42)
hist1 = TH1F("hist1", "Exp;t;N", 10, 0., 10.)
for entry in range(100):
num = RNG.Exp(2.0)
hist1.Fill(num)
expFunk1 = TF1("expFunk1", "([1]/[0])*TMath::Exp(-x/[0])", 0.0, 100.0)
expFunk1.SetParameter(0, 2.0)
expFunk1.SetParameter(1, 100)
# Cell 2
hist1.Fit("expFunk1", "LI")
Note: If you include any command below the fit in Cell 2 the kernel will not crash
and the fit works.
ROOT Version: JupyROOT 6.28/02
Compiler: Python 3 (ipykernel)