File indexing completed on 2025-08-05 08:10:54
0001
0002
0003 #include <fstream>
0004 #include <iostream>
0005 #include "stdio.h"
0006
0007 #include <TChain.h>
0008 #include <TFile.h>
0009 #include <TGraphAsymmErrors.h>
0010 #include <TGraphErrors.h>
0011 #include <TLatex.h>
0012 #include <TLegend.h>
0013 #include <TLine.h>
0014 #include <TMath.h>
0015 #include <TROOT.h>
0016 #include <TString.h>
0017 #include <TTree.h>
0018 #include <TVectorD.h>
0019 #include <TVirtualFitter.h>
0020 #include <cassert>
0021 #include <cmath>
0022 #include <vector>
0023
0024 #include "SaveCanvas.C"
0025 #include "sPhenixStyle.C"
0026
0027 const int NUM_PT_BINS = 4;
0028 const float BIN_CENTERS[NUM_PT_BINS] = {5.39, 6.69, 8.77, 11.9};
0029 const float ASYMMETRY[NUM_PT_BINS] =
0030 {0, 0, 0, 0};
0031 const float STAT_ERR[NUM_PT_BINS] =
0032 {0.0010, 0.0013, 0.0025, 0.0035};
0033
0034
0035
0036 const int NUM_QGQ_PT_BINS = 12;
0037 const float PT[NUM_QGQ_PT_BINS] =
0038 {4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
0039 const float QGQ[NUM_QGQ_PT_BINS] =
0040 {-0.000500, -0.000434, -0.000339, -0.000213, -0.000054, 0.000137, 0.000357,
0041 0.000603, 0.000874, 0.001166, 0.001477, 0.001804};
0042 const float QGQ_ERR[NUM_QGQ_PT_BINS] =
0043 {0.000077, 0.000070, 0.000072, 0.000079, 0.000091, 0.000113, 0.000146,
0044 0.000191, 0.000250, 0.000321, 0.000405, 0.000501};
0045
0046 const double pp_inelastic_crosssec = 42e-3;
0047 const double pp_rec_3year = 62e12;
0048 const double pp_rec_5year = pp_rec_3year + 80e12;
0049 const double pp_beam_pol = 0.57;
0050
0051 TGraphErrors *GraphShiftScaling(TGraphErrors *gr_src, const double x_shift, const double err_scaling)
0052 {
0053 assert(gr_src);
0054
0055 const int npoint = gr_src->GetN();
0056
0057 TVectorD vx(npoint);
0058 TVectorD vy(npoint);
0059 TVectorD vex(npoint);
0060 TVectorD vey(npoint);
0061
0062 int nfilled = 0;
0063 for (int i = 0; i < npoint; ++i)
0064 {
0065 const double &x = gr_src->GetX()[i];
0066
0067
0068 vx[nfilled] = x + x_shift;
0069 vy[nfilled] = gr_src->GetY()[i];
0070 vex[nfilled] = gr_src->GetEX()[i];
0071 vey[nfilled] = gr_src->GetEY()[i] * err_scaling;
0072
0073 ++nfilled;
0074 }
0075
0076 TGraphErrors *gr = new TGraphErrors(nfilled, vx.GetMatrixArray(), vy.GetMatrixArray(),
0077 vex.GetMatrixArray(), vey.GetMatrixArray());
0078
0079 gr->SetMarkerColor(gr_src->GetMarkerColor());
0080 gr->SetMarkerStyle(gr_src->GetMarkerStyle());
0081 gr->SetMarkerSize(gr_src->GetMarkerSize());
0082 gr->SetLineWidth(gr_src->GetLineWidth());
0083 gr->SetLineColor(gr_src->GetLineColor());
0084
0085 return gr;
0086 }
0087
0088 void plot_sPHENIX_A_N_dp_BUP2020()
0089 {
0090 SetsPhenixStyle();
0091
0092 const double ref_Lum = 100e12;
0093 const double err_scale = sqrt(ref_Lum / pp_rec_3year);
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106 TGraphErrors *projectedMeasurement_ref =
0107 new TGraphErrors(NUM_PT_BINS, BIN_CENTERS, ASYMMETRY, 0, STAT_ERR);
0108
0109 TGraphErrors *projectedMeasurement =
0110 GraphShiftScaling(projectedMeasurement_ref, 0, err_scale);
0111 projectedMeasurement->SetMarkerStyle(kFullCircle);
0112 projectedMeasurement->SetMarkerSize(2);
0113 projectedMeasurement->SetLineWidth(4);
0114 projectedMeasurement->SetLineColorAlpha(kBlack, 1);
0115
0116 TF1 *zeroLine = new TF1("zeroLine", "0", 0, 20);
0117 zeroLine->SetLineColor(kBlack);
0118
0119
0120 TFile *trigluonFile = TFile::Open("gggContribution.root");
0121
0122 TGraphErrors *ggg1 = (TGraphErrors *) trigluonFile->Get("model1");
0123 ggg1->SetFillStyle(3005);
0124 ggg1->SetFillColor(kRed);
0125 ggg1->SetLineColor(kWhite);
0126 TGraphErrors *ggg2 = (TGraphErrors *) trigluonFile->Get("model2");
0127 ggg2->SetFillStyle(3004);
0128 ggg2->SetFillColor(kBlue);
0129 ggg2->SetLineColor(kWhite);
0130
0131 TGraphErrors *qgq = new TGraphErrors(NUM_QGQ_PT_BINS, PT, QGQ,
0132 0, QGQ_ERR);
0133 qgq->SetFillColor(kGreen + 3);
0134 qgq->SetFillStyle(3003);
0135 qgq->SetLineColor(kGreen + 2);
0136 qgq->SetLineWidth(5);
0137
0138 TCanvas *c1 = new TCanvas("AN_dp_sPHENIX", "AN_dp_sPHENIX", 1100, 800);
0139 c1->Divide(1, 1);
0140 int idx = 1;
0141 TPad *p;
0142
0143 p = (TPad *) c1->cd(idx++);
0144 c1->Update();
0145
0146 p->DrawFrame(4.69, -0.015, 12.6, 0.015)->SetTitle(";#it{p}_{T} [GeV];A_{N}");
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157 ggg1->Draw("3");
0158 ggg2->Draw("3");
0159 qgq->Draw("C3");
0160 projectedMeasurement->Draw("P");
0161 zeroLine->Draw("same");
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171 TLegend *leg = new TLegend(.2, .75, .83, .9);
0172 leg->SetFillStyle(0);
0173
0174 leg->AddEntry("", Form("#it{#bf{sPHENIX}} Projection, Years 1-3"), "");
0175 leg->AddEntry("", Form("%.0f pb^{-1} samp. #it{p}^{#uparrow}+#it{p}#rightarrow #gamma + X, P=%.2f", pp_rec_3year / 1e12, pp_beam_pol), "");
0176 leg->Draw();
0177
0178 leg = new TLegend(0.18, 0.18, 0.5, 0.41);
0179 leg->AddEntry(qgq, "qgq Contribution (D.Pitonyak)", "l");
0180 leg->AddEntry(ggg1, "Trigluon Contribution Model 1 (S.Yoshida)", "f");
0181 leg->AddEntry(ggg2, "Trigluon Contribution Model 2 (S.Yoshida)", "f");
0182
0183
0184 leg->Draw();
0185
0186 SaveCanvas(c1, TString(c1->GetName()), kTRUE);
0187 c1->SaveAs("AN_dp_sPHENIX.pdf");
0188 }