Filling a TH2D

Dear Root users,

I’ve been filling TH1D histograms with my defined variable D by

I’d like now to fill a TH2D histogram and plot D against a second variable C, so it would be D on the x-axis and C on the y-axis. I’ve spend ten minutes looking in the guide and now I have given up, can someone tell me the command line to fill, I guessed

h2->Fill(D,C); but I’m guessing this is a weight, not what I wanted?



Yes you are right. That’s the way to fill a TH2D. Look at the doc here:
you will see all the Fill methods.

If you use a class XXXX look at the doc of XXXX.
In your case you use a TH2D, so look at the doc of the corresponding class and member function at