I want to plot energy distribution in 3D plot using the attached macro and Root file but I don’t see proper filling of histogram What is see is also attached in Screen shot. Please check my Macro and Suggest What could be wrong. Thanks
Or you can create the histogram with small axes ranges, e.g.: auto hist3 = new TH3F("X:Y:Z", "Hit position 3D", 40, -2., 2., 40, -2., 2., 50, -66150., -66000.);
Hi @ Wile_E_Coyote I have added some code to plot projections Now I want to see e.g., the energy deposit within a slice along the z axis. Please suggest How can i see that.
Part of my code is as follows:
for (map<string,TH3*>::const_iterator itr = h3.begin(); itr != h3.end(); itr++)
{
//gStyle->SetOptStat(0);
string hname = itr->first;
TH3* h = (TH3*)itr->second->Clone();
h->Scale(1.0/float(h->Integral()));
TCanvas* c = new TCanvas("c", "", 1000, 1000);
TH2* h2yx = (TH2*)h->Project3D("yx")->Clone();
c->cd();
h2yx->Draw("colz");
gPad->SetLogx(0); gPad->SetLogy(0); gPad->SetLogz(0);
ss.str(""); ss << "test2D_yx_" << hname << ".png";
c->SaveAs(TString(ss.str()));