Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
plot_dis_acceptance.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file plot_dis_acceptance.C
1 int
3 {
4  // TFile *fin = new TFile("output/eic_sphenix_dis_histo_1M.root","OPEN");
5  TFile *fin = new TFile("output/x_q2_pythia_ep_18x275_10M.root","OPEN");
6 
7  THnSparse *hfull = (THnSparse*)fin->Get("hn_dis_electron");
8  THnSparse *hfull_accept = (THnSparse*)fin->Get("hn_dis_electron_accept");
9 
10  TH2F* hxQ2 = (TH2F*)hfull->Projection(1,0);
11  hxQ2->SetName("hxQ2");
12 
13  TH2F* hxQ2_accept = (TH2F*)hfull_accept->Projection(1,0);
14  hxQ2_accept->SetName("hxQ2_accept");
15 
16  TH2F *hxQ2 = (TH2F*)fin->Get("hxQ2");
17  TH2F *hxQ2_fullaccept = (TH2F*)fin->Get("hxQ2");
18 
19  /* beam energies */
20  float ebeam_e = 20;
21  float ebeam_p = 250;
22 
23  /* Prepare TPaveText for plots */
24  TString str_ebeam = TString::Format("%.0f GeV x %.0f GeV", ebeam_e, ebeam_p );
25 
26  TPaveText *pt_ebeam_lumi_ul = new TPaveText(1e-5,1e3,1e-3,1e4,"none");
27  pt_ebeam_lumi_ul->SetFillStyle(0);
28  pt_ebeam_lumi_ul->SetLineColor(0);
29  pt_ebeam_lumi_ul->AddText(str_ebeam);
30 
31  /* Prepare inelasticity (y) cut lines for plots */
32  TF1 *f_y095 = new TF1("f_y095", "4*x*[0]*[1]*[2]", 1e-5, 1);
33  f_y095->SetParameter( 0, ebeam_e);
34  f_y095->SetParameter( 1, ebeam_p);
35  f_y095->SetParameter( 2, 0.95);
36  TF1 *f_y001 = (TF1*)f_y095->Clone("f_y01");
37  f_y001->SetParameter(2 , 0.01);
38 
39 
40  /* make x-Q2 acceptance fraction pot */
41  TCanvas *c3 = new TCanvas();
42  c3->SetRightMargin(0.12);
43  TH2F* hxQ2_acceptance_ratio = hxQ2_accept->Clone("x_Q2_acceptance_ratio");
44  hxQ2_acceptance_ratio->GetZaxis()->SetNdivisions(505);
45  hxQ2_acceptance_ratio->Divide(hxQ2);
46  hxQ2_acceptance_ratio->Draw("colz");
47  c3->SetLogx(1);
48  c3->SetLogy(1);
49 
50  f_y095->Draw("same");
51  f_y001->Draw("same");
52 
53  pt_ebeam_lumi_ul->Draw();
54  gPad->RedrawAxis();
55 
56  return 0;
57 }