Please read tips for efficient and successful posting and posting code
_ROOT Version: 6.20/02
_Platform:
_Compiler: gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
Hello Everyone!
I have a program that produces some results. These results are saved in a .txt file.(*note These results change every time I run the program, but They are almost the same).
I make a Graph with these results and then I want to have a Gaussian Fit.
However, some times I have 3 problems:
- Negative mean for the gaussian fit
- Invalid result status 4
- Big errors for mean and sigma.
I attached 2 files, one of them has data that produces big errors and the other one is for negative mean and invalid result.
(When I run the program my file’s name is poscount that’s why I have this name in my codeposcount(wrong errors).txt (524 Bytes) poscount(invalid|negativemean).txt (494 Bytes) )
So, what is wrong with my data (or with this part of the code?) I can not understand.
TGraph *MyGraph=new TGraph("poscount.txt");
//ROOT::Math::MinimizerOptions::SetDefaultStrategy(0);
//ROOT::Math::MinimizerOptions::SetDefaultMaxFunctionCalls(10000);
//ROOT::Math::MinimizerOptions::SetDefaultTolerance(1);
MyGraph->Fit("gaus");
MyGraph->Draw("A*");
Thank youuu!!