Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Surf3DHistoMaker.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Surf3DHistoMaker.C
1 void Surf3DHistoMaker(int ncol, int gcol)
2 {
3  TFile *fin = TFile::Open("neutron_gamma_edep.root");
4  gROOT->cd();
5  TCanvas *c1 = new TCanvas();
6  c1->SetLogz();
7  TH2 *h2 = (TH2F *) fin->Get("neutron")->Clone();
8  h2->SetXTitle("dtheta");
9  h2->SetYTitle("dphi");
10  h2->SetZTitle("Energy");
11  h2->GetXaxis()->SetTitleOffset(2);
12  h2->GetYaxis()->SetTitleOffset(2);
13  h2->GetZaxis()->SetTitleOffset(1.2);
14  TH2 *h2a = (TH2F *) fin->Get("gamma")->Clone();
15  h2a->SetXTitle("dtheta");
16  h2a->SetYTitle("dphi");
17  h2a->SetZTitle("Energy");
18  h2a->GetXaxis()->SetTitleOffset(2);
19  h2a->GetYaxis()->SetTitleOffset(2);
20  h2a->GetZaxis()->SetTitleOffset(1.2);
21  h2->SetLineColor(ncol);
22  h2a->SetLineColor(gcol);
23  h2->Draw("surf");
24  h2a->Draw("surf same");
25  // TFile *fout = TFile::Open("finalhistos.root","UPDATE");
26  c1->Print("Neutron_vs_Gamma.png");
27  fin->Close();
28  //fout->Close();
29 }