Project 2D Histo

How can I project in one axis a 2D histo?

TH2 *h = YOURhistogram;
// locate bin for which to do projection
Int_t biny = h->GetYaxis()->FindBin(y);

// create projection of one bin ( for many bins just set range here
TH1D *hp = h->ProjectionX("",biny,biny);

// call names

char title[80];
sprintf(title,“Projection of biny=%d”,biny);
hp->SetName(“Projection”);
hp->SetTitle(title);

// have a look at projection
hp->Draw()

By the way, have you looked at ROOT reference on web site ?

Nice docs there.

Hi,
use TH2::ProjectionX.
Axel.