Dear friends,
As already posted in my previous thread Reading multiple .dat files and save plots in .root
I am shooting beta particles in matter.
The plot must be a sum of three contributions: a truncated Landau (taking into account the 0.55 MeV 90Sr->90Y decay), another truncated Landau (taking into account the 2.28 MeV 90Y->90Zr decay) and of course, the omnipresent gaussian noise.
Now… i want to read, plot and fit with a curve which is Landau1+Landau2+gauss but at the same time
i would love to see on the same graph also the single components superimposed (namely the two landaus and the gaussian noise).
I know that this is a heavy request. Of course before i ask to you i already tried my very best. Consider that i’m (seriously) playing with ROOT since two months, this is the best i could create. It is NOT what i need and not the best of sharp coding but… it is working though.
I attach the code (merged withe the previous post solution).
N6724_eh.C (8.2 KB)
And i attach one of the runs to plot and have fun for all of you. Hope you will enjoy.
NOTE: in order to attach i am forced to change extention to .txt. You can download and safely turn it into .dat again by simply renaming it.
run.txt (134.6 KB)
Now the deal:
1.) the script is too much verbose and require too many input from the user that is required to “first guess” a lot of numbers to initialize the fit. I have no clue if this can be avoided but the fit doesn’t converge this easly if the parameters are not properly initiated.
2.) The plot appears to have a landau, often two landau but the gauss (blu line in the figure below) is never really plotted realistically… even the two landaus are not what i expect. The FIT (red line, see figure below) appears only after that i open the fit panel, fit the data and iterate like 30 times adjusting the paramenters… and i would like to avoid that.
Can you help me to
a)improve the code by ruling out macroscopic bad practices i used because my non-expertise?
b)make the fit line (landau1+landau2+gauss) appear directly without forcing me to actually do the fit from FitPanel?
c)have the three contributes (landau 1,2 and gauus) plotted as well in a realistic way (and not like you see in the figure, that looks like minions…)
Anyone who can help will have a marble bust… or probably my aeternal gratitude…
Thank you in advance.
Nevertheless, i think my rough code can help in anycase since this specific problem in the web is nowhere to be found and a lot of physicists have easy access to Strontium. Hope i helped a bit and to be helped a bit more…
Cheers.