Home | News | Documentation | Download

Multiply 2D TEfficiency with a TH2D

Hi everyone, I have built and filled a 2D TEfficiency object with the probability of tagging a jet with a secondary vertex as a function of its momenta and pseudo-rapidity. However the tracking setup of my simulation uses a device which reduce the background, but also affects my efficiencies. So I would like to correct my 2D TEfficiency with some factors depending on the momenta and pseudorapidity, and so from other simulations I have built a correction matrix as a TH2D.
Now I would like to multiply my 2D TEfficiency with the TH2D correction matrix, however I can’t find a Multiply() method for the TEfficiency. I could use GetBinContent and do this manually for each bin, but I fear I would lose information about the errors. Is there a way to achieve my goal?
I am using ROOT 6.22/06.
Thank you kindly,
Giacomo

Hi,

I suspect the correction is affecting in a different way the two input histograms to the TEfficiency class.
So, you should not correct the resulting TEfficiency, but correct the input histograms applying weights to them and then compute the TEfficiency. It supports computation of the error also in this case taking into account the weights of the histograms.

Lorenzo

Hi Lorenzo,
Thank you for the answer. I tried that, but I found out that the TEfficiency constructor I wanted to use, being
TEfficiency(const [TH1]&passed, const [TH1]&[total])
, takes as input only TH1, while I am working in two dimensions with TH2D…is there a workaround?
Thank you,

Giacomo

Hi,
The TH2D class derives from the base histogram interface TH1 that represents histogram in 1 and multiple dimensions. See inheritance figure in ROOT: TH1 Class Reference

You can then pass TH2 objects in the TEfficiency constructor.

Lorenzo

Thank you :slight_smile: