Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
plot_sPHENIX_A_N_dp.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file plot_sPHENIX_A_N_dp.C
1 //need to run make_ggg_contribution_graphs.C first
2 
3 #include "TFile.h"
4 #include "TCanvas.h"
5 #include "TH1.h"
6 #include "TH2.h"
7 #include "TGraphErrors.h"
8 #include "TAxis.h"
9 #include "TF1.h"
10 #include "TLatex.h"
11 #include "TLegend.h"
12 
13 const int NUM_PT_BINS = 4;
14 const float BIN_CENTERS[ NUM_PT_BINS ] = { 5.39, 6.69, 8.77, 11.9 };
15 const float ASYMMETRY[ NUM_PT_BINS ] =
16  { 0, 0, 0, 0 };
17 const float STAT_ERR[ NUM_PT_BINS ] =
18  { 0.0010, 0.0013, 0.0025, 0.0035 };
19 
20 //https://arxiv.org/abs/2002.08384
21 //https://arxiv.org/abs/1410.3448
22 const int NUM_QGQ_PT_BINS = 12;
23 const float PT[ NUM_QGQ_PT_BINS ]=
24  { 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
25 const float QGQ[ NUM_QGQ_PT_BINS ] =
26  { -0.000500, -0.000434, -0.000339, -0.000213, -0.000054, 0.000137, 0.000357,
27  0.000603, 0.000874, 0.001166, 0.001477, 0.001804 };
28 const float QGQ_ERR[ NUM_QGQ_PT_BINS ] =
29  { 0.000077, 0.000070, 0.000072, 0.000079, 0.000091, 0.000113, 0.000146,
30  0.000191, 0.000250, 0.000321, 0.000405, 0.000501 };
31 
33 {
34  TH1 *frame = new TH2F( "frame", " ", 1, 4.69, 12.6, 1, -0.018, 0.015 );
35  frame->SetTitle( "; p_{T} [GeV/c]; A_{N}" );
36  frame->SetStats( false );
37  TAxis *xAxis = frame->GetXaxis();
38  xAxis->SetTitleSize( 0.05 );
39  xAxis->SetLabelSize( 0.055 );
40  xAxis->SetTitleOffset( 1.2 );
41  TAxis *yAxis = frame->GetYaxis();
42  yAxis->SetTitleSize( 0.07 );
43  yAxis->SetLabelSize( 0.055 );
44  yAxis->CenterTitle( true );
45  yAxis->SetTitleOffset( 0.8 );
46  yAxis->SetNdivisions( 504 );//310 );
47 
48  TGraphErrors *projectedMeasurement =
49  new TGraphErrors( NUM_PT_BINS, BIN_CENTERS, ASYMMETRY, 0, STAT_ERR );
50  projectedMeasurement->SetMarkerStyle( kFullCircle );
51 
52  TF1 *zeroLine = new TF1( "zeroLine", "0", 0, 20 );
53  zeroLine->SetLineColor( kBlack );
54  zeroLine->SetLineStyle( 2 );
55 
56  TFile *trigluonFile = TFile::Open( "gggContribution.root" );
57  //https://arxiv.org/abs/1112.1161
58  TGraphErrors* ggg1 = (TGraphErrors*)trigluonFile->Get( "model1" );
59  ggg1->SetFillStyle( 3005 );
60  ggg1->SetFillColor( kRed );
61  ggg1->SetLineColor( kWhite );
62  TGraphErrors* ggg2 = (TGraphErrors*)trigluonFile->Get( "model2" );
63  ggg2->SetFillStyle( 3004 );
64  ggg2->SetFillColor( kBlue );
65  ggg2->SetLineColor( kWhite );
66 
67  TGraphErrors *qgq = new TGraphErrors( NUM_QGQ_PT_BINS, PT, QGQ,
68  0, QGQ_ERR );
69  qgq->SetFillColor( kGreen + 3 );
70  qgq->SetFillStyle( 3003 );
71  qgq->SetLineColor( kGreen + 1 );
72  qgq->SetLineWidth( 2 );
73 
74  TCanvas *c1 = new TCanvas( "c11", "with QGQ", 200, 200, 800, 500 );
75  gPad->SetBottomMargin( 0.15 );
76  gPad->SetLeftMargin( 0.15 );
77  frame->Draw( "" );
78  ggg1->Draw( "3" );
79  ggg2->Draw( "3" );
80  qgq->Draw( "C3" );
81  projectedMeasurement->Draw( "P" );
82  zeroLine->Draw( "same" );
83 
84  TLatex text1;
85  text1.SetTextSize( 0.05 );
86  // text1.SetTextAlign( 13 );
87  text1.DrawLatex( 5, 0.012, "p^{#uparrow} + p #rightarrow #gamma + X" );
88  text1.DrawLatex( 5.25, 0.0095, "#sqrt{s} = 200 GeV" );
89  text1.DrawLatex( 10, 0.012, "sPHENIX:" );
90  text1.DrawLatex( 10, 0.0095, "L=100/pb P=0.57" );
91 
92  TLegend *leg = new TLegend( 0.18, 0.18, 0.5, 0.41 );
93  leg->AddEntry( qgq, "qgq Contribution (calc. by D.Pitonyak)" );
94  leg->AddEntry( ggg1, "Trigluon Contribution Model 1 (calc. by S.Yoshida)" );
95  leg->AddEntry( ggg2, "Trigluon Contribution Model 2 (calc. by S.Yoshida)" );
96  leg->SetBorderSize( 0 );
97  leg->SetTextSize( 0.04 );
98  leg->Draw();
99 
100  c1->SaveAs( "AN_dp_sPHENIX.pdf" );
101 }