Dear All
I need an help to crosscheck my code when extracting 1D plot from 2D histogram (attached picture).
The results from depth 10mm is higher than 130mm which if refer to 2D histogram the depth at 130mm must be higher.
here the code which I use:
TH1D* total10 = Lattotaldoseproton->ProjectionX("total10", Lattotaldoseproton->GetYaxis()->FindBin(10), Lattotaldoseproton->GetNbinsX());
TH1D* total130 = Lattotaldoseproton->ProjectionX("total130", Lattotaldoseproton->GetYaxis()->FindBin(130), Lattotaldoseproton->GetNbinsX());
total10->Draw();
total10->SetLineWidth(1);
total10->SetLineColor(1);
total130->Draw("same");
total130->SetLineWidth(1);
total130->SetLineColor(2);
//legend
TLegend *leg = new TLegend();
leg->AddEntry(total10,"Depth 10mm");
leg->AddEntry(total130,"Depth 130mm");
leg->Draw("same");