TH3 Projections with ranges

I am looking to project of a 3d histogram to 2d histogram. I found the TH3::Project3D(option = “xy”) to project it to a 2d histogram, but I only need a projection of certain region of the z axis. In TH2D, the arguments of TH2::ProjectionX() included the firstybin and secondybin to project a certain range of the Y axis to X axis. I am looking for something similar.

Hello, @Allan_Prince !
TH3::Project3D docs say that:

The projection is made for the selected bins only. To select a bin range along an axis, use TAxis::SetRange, eg h3.GetYaxis()->SetRange(23,56);

Perhaps this is what you want.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.