Store TF1 in Ttree (pyroot)

Hi all,

I am trying to save a TF1 object to a ttree, but can’t get it to work. Im using Pyroot with python3.

Here is the relevant code, with a simplified TF1 and fitting. I’ve also tried various other examples using the arrays as laid out at thee top of the TTree reference page

tt = TTree("tt", "processed Static variables")

pulse1 = TF1()
tt.Branch("fitPulse1", "TF1", pulse1)

pulse1 = TF1("myFunc", "[0] + x*[2]")

# do stuff with pulse1, only set parameters and do a fit h.Fit(pulse1...)


I get a segmentation violation error:

...lib/] TBranch::FillImpl(ROOT::Internal::TBranchIMTHelper*) (no debug info)

Any help would be greatly appreciated!

ROOT Version: 6.23
Platform: macOS
Compiler: Not Provided

Can you paste more lines of the backtrace you get from the crash?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.