Hi.
based on the myfit.C tutorial, in order to fit an “experimental” histogram to a pretty complicated model (12 parameters), i have written the attached code.
the fit function, pBSim, needs the objects and variables which are defined between the “<<< START HERE” and the “<<< STOP HERE” comment lines. However, these definitions are needlessly performed each and every time the function is called. Basically, they can be defined in the void pBfit() function, but then i pBSim couldn’t access them…
Im not only new to ROOT but also to C++.
My Question Is: how do i make these definitions outside the function so that the objects will “live” also in the scope of the function? (or any other idea is welcome).
Thanks in advance,
Moshe (PSI, Switzerland)
pBfit.C (2.49 KB)