Home | News | Documentation | Download

Change z-axis limits of a 2D TEfficiency graph

Hello,

I am making a 2D TEfficiency plot and I would like the range of the z-axis (on the color palette) to be from 0 to 1.2. I tried to use SetMinimum and SetMaximum but they wouldn’t work as ‘TEfficiency’ object has no attribute ‘SetMaximum’. Is there a way to do this?

Thank you,
Carry

TEfficiency does not have a GetHistogram either. But it has CreateHistogram which returns a *TH2 on which, I guess, you can call SetMaximum and SetMinimum to change the Z axis range. I let @moneta confirm.

Hi,
For changing the limits of the plotted 2D TEfficiency object, you can call CreateHistogram but then you need to draw that objecty. Otherwise, after having called TEfficiency::Draw(), you can call TEfficiency::GetPaintedHistogram() to get a pointer to the histogram that is painted and afterwards you can change its attributes as you wish.

Lorenzo

Thanks @moneta I missed that one. And I should have find it as you already answered this question on the forum : Set range y axis TEfficiency
Sorry.
BTW: I see that “GetPaintedHistogram” has no help. I agree the name of the function is explicit enough but may be we can had some example showing how to set the min and max. Like in the previous post.

BTW. It also seems a good idea to explain when (for what) to use TEfficiency::GetPaintedGraph versus TEfficiency::GetPaintedHistogram.

It is documented in Tefficiency::Paint(), we should maybe add a link to there from the documentation of TEfficiency::GetPaintedHistogram

Lorenzo

It works. Thank you guys!