Hi everyone, I’m new to ROOT and I’m trying to fit histogram data using the Landau Gaussian convolution fit found in: https://root.cern.ch/doc/v614/langaus_8C_source.html. My data is in a text file with each row containing the histogram count data with a total of 150 lines. e.g.:
256
8716
13051
8921
6527
…
23
16
33
How do I allow the ROOT program to read the data inside the text file and then what kind of command should I input inside the ROOT session to successfully output the fit graph? Please explain it step by step, as I’m very new to ROOT. Thanks for the help in advance.
This is a C++ macro. You should create a file ascii2hist.C and put this code inside. Then you execute it in root by typing .x ascii2hist.C. Of course the file name containing your data should be changed to the real name of your file.