Good morning,
I wrote a root macro that fit a data set (attached file). However when I try to run it, ROOT give me this error: “*** Break *** segmentation violation”
I tried to use “SetPameter” for TGraph but it gives me this error “cannot initialize a parameter of type ‘Double_t’ (aka ‘double’) with an lvalue of type 'double []” what am I doing wrong?
Do not call your macro Fit, as root already has a Fit function and this confuses it. If you call it myFit, for instance, the macro works (the fit fails on your data, by the way, but at least it runs).
Similarly, it’s better to avoid using variable names so similar to reserved words, like “Cout”, “Int”, etc. which, although strictly speaking are ok, are error magnets (as your use of “Fit” exemplifies).