Dear rooters,
I am filling a TH3 Histogram and want to have a 2D Projection of the y and z axis for every x axis bin. Somehow just to do:
TH2D *hProjection = h3->Project3D(“yz”)->Draw(“Col”);
is not the solution which I want.
Somehow the problem can not be solved like in the case when of a TH2 when projecting the y-axis for every x-axis bin:
TFile *file = new TFile(“File.root”,“READ”);
TH2D *h = (TH2D *)file->Get(“h”);
TCanvas *c1 = new TCanvas(“c1”,"",50,50,800,800);
c1->Divide(2,2);
c1->Draw();
Int_t nbinsX = h->GetNbinsX();
TH1D *hProjection;
Char_t HistName[256];
for(Int_t i = 0; i < nbinsX; i++)
{
sprintf(HistName,“hProjection_%i”,i+1);
hProjection = h->ProjectionX(HistName,i,i+1);
c1->cd(i+1);
hProjection->Draw();
c1->Update();
}
Is there a similar way to solve it as described above as for the TH2 example above?
Thanks a lot in advance for the help.
Cheers,
Michael