Hi @Lepton86,
what do you want to do in the end? It sounds like you could use a fit model that is an addition of multiple PDFs. You would fit this to data once, and could create a histogram or a curve from the already summed results.
Some alternatives:
As you can see here:
https://root.cern.ch/doc/master/classRooAbsPdf.html#a8f802a3a93467d5b7b089e3ccaec0fa8
Save
is only for saving fit results, that is, post fit parameters etc. It’s not saving curves.
If you really want curves in files, you should probably create histograms from the post-fit distributions.
That’s explained in the post you linked:
Here again the link to the relevant function for your convenience:
https://root.cern.ch/doc/master/classRooAbsReal.html#a6659d2c301e5cd65b83ee8c9422c2553
When you have the histogram, use something like
file.WriteObject(histogram, "name that it should have in the file");