Convert from NTuple to TH2D Histogram

I want to convert from NTuple graph to TH2D histogram graph.

nt > Draw(“e:np >> hist1”, “”, “goff”);
TH2D * hist1_p = (TH2D *)gDirectory->Get(“hist1”);

Then, I can convert from NTuple to TH2D and the graph is TH2D format.
However, the number of bin of x and y axis are defallt (nbin = ~40).
How can I change the number of bin in this case?

see documentation of TTree::Draw
root.cern.ch/root/html514/TTreeP … DrawSelect
and look for section “Saving the result of Draw to an histogram”

eg

Rene

Yes, it works. I did not know “TTree::Draw” website.
Thank you so much.