I have a .txt file like this. The format is X Y Ey.
3.txt (510 字节)
And I want to make a TGraphErrors picture. So I reference the example from the ROOTPrimer(page24)
auto c=new TCanvas();c->SetGrid();
"%lg %lg %lg");
"Measurement XYZ and Expectation;"
TLegend leg(.1,.7,.3,.9,"Lab. Lesson 2");
return 0; }
But it doesn’t work at all. I am not familiar with CPP ,ROOT even the English. I’ve been obsessed with this problem for a long time. Thank you very very much for your kind help.
The problem is that your “3.txt” file is encoded in UTF-16 ("-dos").
You must make sure that it is encoded in iso-8859-1 / iso-latin-1, i.e. standard ASCII (and better “-unix” than “-dos”).
Thank you very much for your efficient help. I used “iconv” to solve it. It was pretty sad to find Google can not service here.
Would you please explain more about my confusions?
(1)I tried to write if (energy > 0.5),￼Canvas_1.pdf (14.1 KB) But the counts of zero is still very high.HistoManager.cc (6.1 KB) AnaEx02.root (475.9 KB)
(2)when I set more bins numbers, the hight of the graph becomes lower and lowerCanvas_2.pdf (14.9 KB)
Maybe the core of the problem is that I don’t understand the meaning of the bin?
Best regards Thanks for helping me.
I am really appreciated for your kind and patient rely.
But I can not understand it very much. Maybe I think I need some time and learn some knowledge from Google. Then try it again.
Thank you for your rely again！
Try something like:
if (energy > 10.)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.