Profiling cell-content (weight)

Hi!
In the attached very simple script, I have a 2D histo that I would like to profile in a way, that i just have a clean mean value of the cell-contents, disregarding the value/coordinates of cells where they come from.
So I would like to have a resulting histogram from a projection, which shows a straight line at value 4, if i have two cells filled with a 3 and a 5, no matter in which cell the 3 and 5 are in, is that possible? (Hopefully with an error of the sample of cell-contents?)
I’m sorry, I realise that this maybe is totally missing the point of a TH2, but maybe you can point me to a better structure to use?
Background: I analyse flat-fields of a CCD, and my pixel value is the Cell-Content. With the projections along x and y i want to check the pixel-to-pixel variations (first for all, then for different slices at different bins/pixel rows) which is part of our calibration.
I think for this I tried everything, different profiles, projections, using TProfile2D, even TH3, shifting the bins by half an entry to get rid of the issue, that the Profile uses BinCenter for the filling of the new thing, but I can’t produce a straight 4, can you help me?
Many thanks,
Michael
PS.: CVS-HEAD on Kubuntu Linux
testProjection.C (212 Bytes)

Hi Michael,
the attached script works for me. Btw, the mean of 8 times 0. and 3. and 5. is not 4. :slight_smile:
Axel.
testProjection.C (941 Bytes)

ah yes! :blush:
I’m glad this assumption concerned only this test case… :wink: My real data has all bins filled anyway, so no wrong expectation there… phew :slight_smile:
Thanks very much for your adapted script!
Cheers,
Michael