I have written the following code
{
#include <math.h>
float distribution(float pt, float pbar)
{
float pzbar = sqrt(pbar*pbar-pt*pt) ;
float Norm = 1. ;
return (pbar*pt/2* (pbar*pzbar + pt*pt*log(pbar+pzbar))
- pt/3 * pzbar*pzbar*pzbar - pt*pt*pt * pzbar) /Norm ;
};
int main()
{
float pbar = 4. ;
TF1 func("func","distribution(x,pbar)",0,pbar) ;
func.Draw();
}
}
which I want to use to plot the `distribution' function, using
root> .L distrib.C ;
root> main();
However, this doesn't work because
Unknown name : "distribution(x,pbar)"
although the function `distribution' is known. Can I use user
defined functions in a TF1 or TFormula definition?
Regards, Wouter.