CUTG and TH2F::Projection


I am using root 5.23/05 version. I am not great in using root through terminal commands and prefer to work with the TTreeviewer and TBrowser. The problem for me is as follows

I have generated a TH2F histogram and have defined a graphical cut (view->toolbar->Graphical cut) on a section of it and rename it as “cutg1”. Then I right click on pad and select ProjectionX from the menu. I put in the firstybin and lastybin (1 and 299 respectively in my case) and then in the option [cutg1] and select OK after that.

Nothing happens :frowning: . I am not sure where I am going wrong. Please help
Attaching the file herewith.
myroot.C (26.7 KB)

You should get a histogram named “E_111vsRest_px” that you can draw with
-E_111vsRest_px->Draw(); //from the command line
-or clicking on the name in TBrowser


thanks a lot Rene :smiley:

It was only after I clicked the Tree folder in TBrowser that I could see my projected histogram.

thanks once again. Now I am quite enjoying ROOTing :slight_smile: