Home | News | Documentation | Download

Draw leaves from a branch into a histogram


#1

Hello,
Is there a way to draw the leaves of a branch, inside a tree, into a histogram. I can draw leaves inside an TTree by using “>>”, but it crashes when I try the same for leaves inside a TBranch, using this -->

branch1->Draw( " name of leaf >> h");

Crash
Root > Warning in <TCanvas::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.

Warning in <TCanvas::ResizePad>: c1 height changed from 0 to 10

Warning in <TCanvas::ResizePad>: Inf/NaN propagated to the pad. Check drawn objects.

Warning in <TCanvas::ResizePad>: c1 height changed from 0 to 10

Thanks
Best,
Shreya


#2

Dear Shreya_Saha,

Is there a special reason why you want it from a branch?
Did you try tree->Draw(“branch_name.leaf_name >> h”)?

G Ganis


#3

Hi Ganis,
Yes, I did, and it crashes as well. I am trying to access the variables inside that specific branch, I would need to compare those variables in two different samples.

Best,
Shreya


#4

Dear Shreya,

Can you post a minimal reproducer with a sample of your file?

G Ganis