Dividing 2 branches from 2 different trees

Dear Experts,

I want to measure the reconstruction efficiency vs PT .

I want to divide ple_PT(reconstructed)/ple_TRUEPT(generated), without projecting them in a histogram.

Instead of h1->Divide(h2) where h1, and h2 are hists of ple_PT and
ple_TRUEPT. I want to do :

tree->Project(“h”,“ple_PT/ple_TRUEPT”,"","")
where ple_PT is from tree A
and ple_TRUEPT is from tree B
and the 2 trees don’t have the same nbr of events

this is because I want to avoid the bin migration when I do h1->Divide(h2) I don’t get the correct efficiency. I suspect that maybe ples generated in bin i are reconstructed in bin i+1

Anyone has an idea about what should I do?

Cheers

You need to create “h1” and “h2” with exactly the same numbers of bins and x-axis ranges. Then the division will be fine.

Thanks for your reply.

yes I am aware that I should use the same binning and the same x axis range. but what I get is totally wrong. this is why I suspected that I am having a bin migration.

The “reconstruction algorithm” may shift the value.

In principle, for each “generated” value, you would need a “reconstructed” one (either in the same tree or in two friend trees). You could then draw “reconstructed - generated” or “reconstructed / generated”.