Misplacement of fitting information in output

Hello, Rooters,

I am fitting tens of histograms, tens of peaks existing in everyone of them, so it involves the writing and reading of several root and text files, the fiitting itself was performed normally, but I found something strange in the lines on the screen.

the original line in my code is: cout<<" fitting "<<GREEN<<hrname<<RESET<<"\n";
where hrname is defined: char *hrname=Form("hr%s",si.c_str());

but the output is: fitting 280 TO DIAGONAL.

hrname is supposed to be like hr2.

How to explain this.

Thank you very much.

ROOT Version: 6.20/04
Platform: AlmaLinux release 8.4
Compiler: Not Provided

What are “GREEN”, “RESET” and “si”? One thing you can do is print out their values separately and see if any is not as expected. Or include more lines of your code here (especially those altering the values of these variables) so it’s easier to help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.