I’m having some problems with hist projection using TCutG.
I’m trying to project a slice of a histogram and fit it (so I can compare the results to FitSlices). I’m defining the slice with TCutG.
When projection on X and asking for a slice of 2 bins in Y, I see get a slice of only one (the top) bin.
I’m attaching a sample code to show what I mean. When cutting on
x = {-5.,5.};
y = {0.1, 0.3};
I only get the bin corresponding to y={0.2, 0.3}.
To get both 0.1 and 0.2 bins, I need to define the cut like this:
y = {-0.1,0.3};
However, when you apply a simple rectangular cut, you don;t need to go through a TCutg object. You can simply pass the first and last bin as argument to the Projection function or (from 5.24) you can use also TAxis::SetRange
I didn’t quite get your second suggestion. Yes, I can pass the y bins range to the projection, but if I want to limit projection with x bins, there’s no way but using TCutG.