6 TFile *fin =
new TFile(fin_name,
"OPEN");
8 TH2F *hxQ2 = (TH2F*)fin->Get(
"hxQ2");
9 TTree *tin = (TTree*)fin->Get(
"tcount");
16 TObjString* gen_lumi_ifb_s = (TObjString*)fin->Get(
"luminosity");
17 float gen_lumi_ifb = (TString((gen_lumi_ifb_s)->GetName())).Atof();
19 cout <<
"Pythia luminosity: " << gen_lumi_ifb <<
" fb^-1" << endl;
25 TString str_ebeam = TString::Format(
"%.0f GeV x %.0f GeV", ebeam_e, ebeam_p );
26 TString str_lumin = TString::Format(
"L = %.4f fb^{-1}", gen_lumi_ifb );
28 TPaveText *pt_ebeam_lumi_ul =
new TPaveText(1
e-5,1e3,1
e-3,1e4,
"none");
29 pt_ebeam_lumi_ul->SetFillStyle(0);
30 pt_ebeam_lumi_ul->SetLineColor(0);
31 pt_ebeam_lumi_ul->AddText(str_ebeam);
32 pt_ebeam_lumi_ul->AddText(str_lumin);
34 TPaveText *pt_ebeam_lumi_ll =
new TPaveText(1e2,45,1e3,50,
"none");
35 pt_ebeam_lumi_ll->SetFillStyle(0);
36 pt_ebeam_lumi_ll->SetLineColor(0);
37 pt_ebeam_lumi_ll->AddText(str_ebeam);
38 pt_ebeam_lumi_ll->AddText(str_lumin);
41 TF1 *f_y095 =
new TF1(
"f_y095",
"4*x*[0]*[1]*[2]", 1
e-5, 1);
42 f_y095->SetParameter( 0, ebeam_e);
43 f_y095->SetParameter( 1, ebeam_p);
44 f_y095->SetParameter( 2, 0.95);
45 TF1 *f_y001 = (TF1*)f_y095->Clone(
"f_y01");
46 f_y001->SetParameter(2 , 0.01);
49 TCanvas *c1 =
new TCanvas();
50 c1->SetRightMargin(0.12);
59 TPaveText *pt_N =
new TPaveText(1
e-5,1e2,1
e-3,3e2,
"none");
60 pt_N->SetFillStyle(0);
61 pt_N->SetLineColor(0);
62 pt_N->AddText(
"z = # events");
65 pt_ebeam_lumi_ul->Draw();
70 TH2F* hxQ2_g1_sigma = hxQ2->Clone(
"x_Q2_g1_sigma");
71 hxQ2_g1_sigma->GetZaxis()->SetNdivisions(505);
72 hxQ2_g1_sigma->Reset();
74 hxQ2_g1_sigma->GetXaxis()->SetTitle(
"x");
75 hxQ2_g1_sigma->GetYaxis()->SetTitle(
"Q^{2} (GeV^{2})");
86 TCanvas *
c2 =
new TCanvas(
"g1",
"",700,800);
89 TH1F* hframe_g1 = (TH1F*)hxQ2->ProjectionY()->Clone(
"h1_g1");
91 hframe_g1->GetXaxis()->CenterTitle();
92 hframe_g1->GetYaxis()->CenterTitle();
93 hframe_g1->GetXaxis()->SetTitle(
"Q^{2} (GeV^{2})");
95 hframe_g1->GetYaxis()->SetTitle(
"const(x)");
96 hframe_g1->GetXaxis()->SetRangeUser(0.99,1500);
97 hframe_g1->GetYaxis()->SetRangeUser(2,50);
98 hframe_g1->GetYaxis()->SetNdivisions(505);
104 for (
int bin_x = 1; bin_x <= hxQ2->GetNbinsX(); bin_x++ )
106 t_x = TMath::Power(10, 0.5 * ( ( TMath::Log10( hxQ2->GetXaxis()->GetBinLowEdge(bin_x) ) )
107 + ( TMath::Log10( hxQ2->GetXaxis()->GetBinLowEdge(bin_x) + hxQ2->GetXaxis()->GetBinWidth(bin_x) ) ) ) );
108 s_binc_x.insert(t_x);
112 TPaveText *leg_offset_x =
new TPaveText(0,0,1,1,
"none");
113 leg_offset_x->SetFillStyle(0);
114 leg_offset_x->SetLineColor(0);
116 leg_offset_x->SetTextSize(0.1);
121 TCanvas *ctmp =
new TCanvas();
124 cout <<
"+++++++++++++++++++++++++++++++++++++++++++" << endl;
125 cout <<
"Plot offsets: " << endl;
127 for ( set<float>::iterator itx = s_binc_x.begin();
128 itx != s_binc_x.end(); itx++ )
135 cout <<
"offset = " << (int)offset <<
" for x = " << *itx << endl;
138 TString str_offset = TString::Format(
"const(x = %.2g) = %d", *itx, (
int)offset );
139 leg_offset_x->AddText(str_offset);
144 unsigned npoints = tcount->GetEntries( TString::Format(
"x > 0.99*%f && x < 1.01*%f", *itx, *itx ) );
145 tcount->Draw( TString::Format(
"%f:Q2:stdev_g1", offset),
146 TString::Format(
"x > 0.99*%f && x < 1.01*%f", *itx, *itx ) );
148 TGraphErrors* gnew =
new TGraphErrors( npoints, tcount->GetV2(), tcount->GetV1(), 0, tcount->GetV3() );
149 gnew->SetMarkerColor(kRed);
152 gnew->Draw(
"PLsame");
161 for (
unsigned j = 0;
j < gnew->GetN();
j++ )
163 gnew->GetPoint(
j, Q2_j, dummy_j);
164 g1sig_j = gnew->GetErrorY(
j);
166 hxQ2_g1_sigma->Fill(x_j, Q2_j, g1sig_j);
170 pt_ebeam_lumi_ll->Draw();
173 c2->Print(
"plots/g1_projection_eic_sphenix.eps");
175 TCanvas *c2_legend =
new TCanvas(
"g1_legend",
"",200,800);
176 leg_offset_x->Draw();
177 c2_legend->Print(
"plots/g1_projection_eic_sphenix_legend.eps");
183 TCanvas *c5 =
new TCanvas();
184 c5->SetRightMargin(0.12);
186 hxQ2_g1_sigma->Draw(
"colz");
187 hxQ2_g1_sigma->GetZaxis()->SetRangeUser(1
e-3,2e1);
192 f_y095->Draw(
"same");
193 f_y001->Draw(
"same");
195 TPaveText *pt_g1_stdev =
new TPaveText(1
e-5,1e2,1
e-3,3e2,
"none");
196 pt_g1_stdev->SetFillStyle(0);
197 pt_g1_stdev->SetLineColor(0);
198 pt_g1_stdev->AddText(
"z = #sigma_{g_{1}}");
201 pt_ebeam_lumi_ul->Draw();
204 c5->Print(
"plots/g1_projection_eic_sphenix_2D.eps");