Projecting on THnD using TTree->Draw

TTree::Draw does not support multidimensional histograms, so you’ll have to loop over the tree by hand or use something like RDataFrame to steer the event loop for you.

Here is an example tutorial that fills a THn with branches from a multi-thread event loop with RDataFrame.

Here is a review of different methods to explicitly loop over ROOT data.

Hope this helps!
Enrico