TH2 from a TH3 slice

Hello,
I would like to store a TH2 from a TH3 slice. Actually, the idea is like the SetShowProjection, but I want to do it from a macro and store the TH2 for comparison with other TH2.

Is that possible? I guess so.

Thanks
Salva

Thanks a lot for pointing me to TH3:.Project3D. It looks like Projec3D only takes one argument.

What I would like is to make a slice of a TH3. The idea I have in mind is: myTH3->Project3D(“xy”,fromZbin=1,toZbin=1), and then repeat for other bins in Z.
Actually, this is something similar to SetShowProjection(“xy”,1) and then change the bin

Thanks
Salva

The TH3::Project3D explicitly says that you need to use TAxis::SetRange to select a bin range along an axis (and don’t forget to “reset” the range after you are done).

Thanks