Hi @Ziel_van_brand,
and sorry for the late reply!
for each bin along x, it seems it makes and plots the integral along y at that x.
Indeed a histogram projection integrates the bin contents along one axis, see e.g. this thread. You can use the firstybin
and lastybin
arguments to only consider a slice of the Y axis when performing the projection (see the docs).
So to get a slice along x at a given constant y you need to set firstybin
and lastybin
to the bin number corresponding to that y value:
// haven't tested the code but it should give you an idea
const auto yBin = h2->GetYaxis()->FindBin(c);
auto xProjection = h2->ProjectionX("pX", yBin, yBin);
I hope this helps!
Enrico