I’ve been studying the Langaus distribution for calibration purposes, and at some point in my code I’m searching for fit function maximum and compare it to initial distribution maximum. Here’s the code for this:
I’m trying to initialize Langaus functions here with parameters varying around the “real” ones, then get their maximums and put them into a histogram, so I can use its standard deviation as maximum error. But suddenly it stopped working, as for some reason each function in cycle has the exact same maximum and the histogram’s stddev is 0.
I’d appreciate any help.
_ROOT Version:_6.34.02 Platform: Ubuntu on VM Compiler: Not Provided
I’m sorry, the parameters are set, they all equal zero before SetParameters line and obtain different non-zero values after the line. I was just a bit unattentive.
It’s the initial Langaus distribution histogram that I generate randomly. It’s name doesn’t change, the only values that are changed are the ones of truepar.
Ok, I think I got it. The TF1::GetMaximumX gives you the X corresponding to the max Y. The search for this X only happens between fr[0] and fr[1]. So if your langaufun increases in this range for each set of your truepar values, then the Y-maximum will always be at fr[1]. It will most likely be different for different sets of truepar values, but the important thing it’s always at the right edge of the range, and max1 will always equal fr[1]. Is that what you observe?
Thank you, but that’s not needed anymore. I actually set the wrong range and didn’t notice. Thanks for pushing me in the direction of the right solution!