Root syntax question


In this example, what are the par[0],par[0],x[0]? I can’t understand the syntax.

Hi,

The functions defined, e.g. single(…), are thing a pointer to arrays of values, x and par.
x[0] and par[0] are the first element of the array x and par .

This special syntax is used because it allows to create from the created function, directly a ROOT TF1 object.
See the TF1 documentation https://root.cern.ch/doc/master/classTF1.html#F4

Lorenzo

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