Hey, not sure if this is the place for this post. I am learning the basics, trying to fill a histogram of 10 bins with specific values with Fill().
Bin Value
1 2
2 4
3 0
4 5
5 1
6 7
7 8
8 6
9 4
10 5
How can I do this? I tried to create an array and fill it with a loop like this:
root [14] TH1F hist3(“hist3”,“practice”,10,1,10);
root [15] int y [10] = { 2, 4, 0, 5, 1, 7, 8, 6, 4, 5 };
root [16] for (int i=0;i<5;i++) hist3.Fill(y[i]);
root [17] hist3.Draw()
root [18] hist3.Draw();
but this is what was drawn.
Shouldn’t I have 10 events with the frequency of the value’s occurrence shown by the vertical axis?
Thanks for any help.