Home | News | Documentation | Download

How can i solve this problems? im a beginner of root plz help me...!

Hi, im a beginner of the root, also C++.
So While i studying root primer section ‘plotting measurements’ and ‘histograms in root’
First. plotting measurements
I typed

root [0] TGraphErrors gr("ExampleData.txt");
root [1] gr.Draw("AP");

then
“Error in TGraphErrors::TGraphErrors: Cannot open file: ExampleData.txt, TGraphErrors is Zombie”
I got this phrase and it didn’t work.

Second. histograms in root
I typed

root [0] TF1 efunc("efunc","exp([0]+[1]*x)",0.,5.);
root [1] efunc.SetParameter(0,1);
root [2] efunc.SetParameter(1,-1);
root [3] TH1F h("h","example histogram",100,0.,5.);
root [4] for (int i=0;i<1000;i++) {h.Fill(efunc.GetRandom());}
root [5] h.Draw();

and nothing happening.

How can i solve this problems?
thanks


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


For the first: did you do what they say after the image?
“Make sure the file ExampleData.txt is available in the directory from which you started ROOT…” (read all!).

gives me: