Hello! I am trying to fill a histogram with x, y, and z variables, and I would like the color of each bin to reflect the number of entries in the bin. I am trying to use a TH3D, defined by the following:
// Histograms
TH3D * h_q1_l = new TH3D("h_q1_l","Quartz 1 Map, Low Resolution",25,-0.025,0.025,50,-0.05,0.05,12,140,200);
And I fill it in and draw it with the following:
for (int ievt = 0; ievt < entries; ievt++)
{
t_T->GetEntry(ievt);
cout << qx1 << endl;
h_q1_l->Fill(qx1,qy1,ladc0);
}
h_q1_l->Draw("SURF2");
However, when I draw the histogram it is completely empty. It has the correct number of entries, but no colors show up, and the means are all 0. This is true for all TH3D options, not just SURF2. I am 100% certain this is not an issue with my ROOT tree because if I change the histogram to a TH2D (removing the last 3 parameters in the definition), and leave the rest of the code as is, the histogram won’t be empty.
Please let me know if I am doing something wrong with my definition or Fill() function, or if there might be a better way to do this. Thank you!