Histograms as Tree Branches: reading/cloning?

Dear ROOT Users,

I would like to directly refer to an example:
root.cern.ch/root/html/tutorials … est.C.html

How do I actually read some values from a histogram for a particular event, or range of events?
I presume, I would want to have a clone/copy of data that I need, and then read it from there…
But how do I do any other operations besides the shown drawing???

T->Draw(“hpxpy.Draw()”,"",“goff”,1,12345);

I would like to have a clone of the above… and I do not necessarily want to draw it :slight_smile:
-Is this possible?
-Is it possible to retrieve bin content directly from the Branch that is histo? (with a cut/constraint)

Sincerely,
Eugene.

Hi,

You might be able to use something like:TH2 *histo = 0; T->SetBranchAddress("hpxpy",&histo); T->GetEntry(12345); ... histo pointer ...

[quote]-Is it possible to retrieve bin content directly from the Branch that is histo? (with a cut/constraint)
[/quote]This should work:T->Draw("hpxpy.GetBinContent(28,35)")

Cheers,
Philippe.

Dear Philippe,

Thank you! This is wonderful, all works and I can go forward! :slight_smile:
I will pass the knowledge on as much as I can, so if someone asks once more - I will try to answer if I see it!
I have worked with root before, but it is just impossible to know it all well, and my C++ is rusty at best ;o)

I really, really appreciate your help!
Sincerely,
Eugene.