(New User) How to project a 3D histogram along Y-axis

This is what I’m trying to do:
-I have a 3D histogram that is in the 2D view with a regular xy-axis.
-I need to make a fairly small cut in the histogram that is parallel to the y-axis.
-Then I need to project the cut to the y-axis.
I appreciate the help. (I am using ROOT version 5.10)

A small macro showing what you are doing would help.

The help about TH3 projections can be found here:
root.cern.ch/root/html/TH3.html

Be careful that 5.10 is very old. Some functionalities described in the online doc might not exist in that version.

Here is the 3D histogram and its supplementary 2D histogram that I am working with: Thank you for your help.

You sent 2 images (jpeg files). We cannot help you a lot with that. As I said a small macro (a .C file) showing what you are doing will be more useful.

Ok, ignore the two images on my previous post.
-I used http://root.cern.ch/root/html/TH2.html#TH2:ProjectionY to assist me with this.

  • I made a TCutG object (the black box in the histogram below) and named it “cutg”.
  • I then entered in the following code: Ge2AT->ProjectionY("cutg",450,650,"[cutg]")
    -The terminal then displayed “(const class TH1D*)0xbe2aeb8”
  • I’m not sure what to do next, or if I am even approaching it the right way, but I want to project the boxed cut to the y-axis.

Thanks again for your help.

You can do:

TH1D *h1 = Ge2AT->ProjectionY("cutg",450,650,"[cutg]");
h1->Draw();

Thank you so much. I guess you don’t even need to manually draw the TCutG. Works great.