Dear all,
I’m looping on a fit and trying to put the parameters at each iteration into the branches of a TTree, to have a final distribution of the parameters in each branch. I’m using RooFit v2.91 for the fit and writing in python language. For this purpose, I wrote the following lines. For example, Phi_s is one of the fit parameters
Phi_s = RooRealVar(‘Phi_s’,‘Phi_s’,-0.04,-pi,pi)
f = TFile(‘Params.root’,‘recreate’)
ParamTTree = TTree(‘ParamTTree’,‘ParamTTree’)
ParamTTree.Branch(‘phis’,Phi_s,‘phis/F’)
then I generate data and fit my PDF to the data (code not written here)
paramList=RooArgSet()
paramList=myPdf.getParameters(data)
paramList.Print(‘v’)
So, now, it seems that all my fit parameters are in the RooArgSet paramList. When I print it, I can therefore see that it works. The problem is now that I don’t know how to pass one of the parameters contained in the RooArgSet to one branch of the TTree I’ve created. I tried for example :
phis=paramList.getRealValue(“Phi_s”), but it puts only zeros in my TTree…
Then, in the loop :
ParamTTree.Fill()
Outside the loop :
f.Write()
f.Close()
Would someone knows how, in python, I can pass what is contained in RooArgSet ParamList into different TTree branches ?
Thank you very much for helping,
Géraldine