How to extract a 1D histogram from a 2D histogram?

I have a 2D (TH2D) histogram and I would like to extract the “slices” of 1D histograms that it is composed out of.
If someone could please tell me, or direct me to where this question may already be answered, I would greatly appreciate it!
Thank you!

There are projections as well as profiles. Both for X and Y.

See TH2::ProjectionX, TH2::ProjectionY and TH2::ProfileX, TH2::ProfileY.

1 Like

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