Function - ln(x) and constant

Hello!

I wish to compare my plotted histograms to an analytical function. I hace ssen in the example “Simple Formula and Functions” so I think this should be possible. However I wish to have a ln(x) in my function. Can I have that? I would also like to include a constant alpha that I wish to declare outside my function, can I do that?

chers,
Karin

Hi Karin,
in C++, ln is called “log”. Use Double_t alpha=42.; TF1* myf=new TF1("myf", Form("%g*log(x)", alpha), 0., 100.); myf->Draw(); or Double_t alpha=42.; TF1* myf=new TF1("myf", "[0]*log(x)", 0., 100.); myf->SetParameter(0, alpha); myf->Draw();
Axel.