Dears,
I have a root file with many TTree, which has many TBranch. I have to extract the y value from one of the TBranch. So what I did is draw the Branch as:
my_tree->Draw(“my_branch”);
then I have assigned the temporary histogram to an histogram, as:
TH1Dhtemp= (TH1D) gPad->GetPrimitive(“htemp”);
I drawn also this histogram:
htemp->Draw();
and at the and I want to extract the y value from the only one bin that the histogram has, doing:
Double_t y_val= htemp->GetBinContent(1);
But it doesn’t work. Until the 3rd passage it works, because I tried to save the htemp into a root file and it works.
Someone can help me? In attached there is the root file containing the htemp. htemp.root (5.5 KB)
Thanks a lot in advance!!