Projecting on THnD using TTree->Draw


I am working with THnD and trees, I want to project some branch information into the dimensions of my N-dim histogram. For Eg.


But, this does not look good to compiler and not working properly.

Could anybody suggest me the relevent things what I am missing?

Thanks :wink:

I am am not sure TTree::Draw is able to digest such construct. @pcanal can tell you for sure.

Thanks Olivier for reply,

Is there any other way which works suitably for this purpose (To write the BranchInfo --> THnD)?

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!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.