Hello,
I am a student and work currently at SMI, Vienna, where I should perform some simulations using PANDA ROOT, which is basically just ROOT with some additions. My question is clearly related to the ROOT base classes, so I thought it would be a good idea to post my question here.
My problem is the following: I have an ASCII file with function values, x in the first and y in the second column, with x steps of variable lenght. Now I would like to create a TF1 object which uses that values. Unfortunately, I could not find out how to do that “natively”. So far, I have written a quite bloated bit of code, where I create a function that has to read the ASCII file every time it is called, interpolates between the sampling points, and then create a TF1 object using a pointer to that function. Of course, that works, and for testing it is alright, but I do not like it very much, especially since its performance is miserable. I really need the function in an TF1 object, since I have to take random numbers out of the distribution defined by that function.
Any ideas?
Thanks a lot and sorry for me asking so basic questions
Christian Leitold