Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-07-16 08:11:23

0001 // Auto-generated by find_sv_smear_fracs.py
0002 // Xi: SV sim inv mass smeared to match data KFP mass.
0003 // Run with:  root -l -b -q plot_sv_xi_result.C
0004 
0005 void plot_sv_xi_result() {
0006     gStyle->SetOptStat(0); gStyle->SetOptTitle(0);
0007 
0008     const int N = 5;
0009     double avg_pt[]  = {0.4350, 0.6204, 0.8590, 1.1892, 2.1510};
0010     double sig_dk[]  = {27.3416, 18.1544, 13.0416, 9.5492, 9.8156};   // data KFP mass sigma  ← TARGET
0011     double sig_sv0[] = {41.7836, 60.0000, 48.6511, 0.8108, 0.0000};  // SV sim inv mass (no smear)
0012     double sig_pi[]  = {44.2141, 32.4702, 60.0000, 52.4695, 0.0000};   // SV sim inv mass (pion smeared, proton 0%)
0013     double sig_m[]   = {44.2141, 32.4702, 60.0000, 52.4695, 0.0000};    // SV sim inv mass (pion + proton matched)
0014     double fracs[]   = {0.0000, 0.0000, 0.0000, 0.0000, 0.0000};    // optimal proton smearing %
0015 
0016     TCanvas *c1 = new TCanvas("c1","Xi SV smearing",950,620);
0017     c1->SetLeftMargin(0.12); c1->SetBottomMargin(0.13); c1->SetRightMargin(0.05);
0018 
0019     auto sty = [](TGraph* g, Color_t col, Style_t mrk, Style_t ls=1){
0020         g->SetMarkerColor(col); g->SetLineColor(col);
0021         g->SetMarkerStyle(mrk); g->SetMarkerSize(1.6);
0022         g->SetLineWidth(2); g->SetLineStyle(ls);
0023     };
0024 
0025     TGraph *gDK = new TGraph(N,avg_pt,sig_dk);
0026     TGraph *gS0 = new TGraph(N,avg_pt,sig_sv0);
0027     TGraph *gPI = new TGraph(N,avg_pt,sig_pi);
0028     TGraph *gM  = new TGraph(N,avg_pt,sig_m);
0029 
0030     sty(gDK, kBlack,    20, 1);
0031     sty(gS0, kBlue+1,   24, 2);
0032     sty(gPI, kOrange+1, 25, 2);
0033     sty(gM,  kRed+1,    22, 1);
0034 
0035     TMultiGraph *mg = new TMultiGraph();
0036     mg->Add(gS0,"PL"); mg->Add(gPI,"PL"); mg->Add(gM,"PL"); mg->Add(gDK,"PL");
0037     mg->Draw("A");
0038     mg->GetXaxis()->SetTitle("Proton p_{T} (GeV/#it{c})");
0039     mg->GetYaxis()->SetTitle("#sigma_{#Xi} (MeV/#it{c}^{2})");
0040     mg->GetYaxis()->SetRangeUser(0,81.0);
0041     mg->GetXaxis()->SetTitleSize(0.05);
0042     mg->GetYaxis()->SetTitleSize(0.05);
0043 
0044     TLegend *leg = new TLegend(0.14,0.60,0.76,0.93);
0045     leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.030);
0046     leg->AddEntry(gDK,"Data      (#Xi mass, KFP) — target","lp");
0047     leg->AddEntry(gS0,"SV sim    (inv mass, no smear)","lp");
0048     leg->AddEntry(gPI,"SV sim    (inv mass, #pi smeared, proton 0%)","lp");
0049     leg->AddEntry(gM, "SV sim    (inv mass, #pi + proton matched)","lp");
0050     leg->Draw();
0051 
0052     //c1->SaveAs("plot_sv_xi_result.pdf");
0053     c1->SaveAs("plot_sv_xi_result.png");
0054     std::cout << "Saved plot_sv_xi_result.pdf/.png\n";
0055 
0056     TCanvas *c2 = new TCanvas("c2","Xi proton smearing frac",900,550);
0057     c2->SetLeftMargin(0.13); c2->SetBottomMargin(0.13);
0058     TGraph *gF = new TGraph(N,avg_pt,fracs);
0059     sty(gF, kMagenta+1, 23);
0060     gF->SetTitle(";Proton p_{T} (GeV/#it{c});Optimal proton smearing (% of p_{T})");
0061     gF->GetYaxis()->SetRangeUser(0,15);
0062     gF->GetXaxis()->SetTitleSize(0.05); gF->GetYaxis()->SetTitleSize(0.05);
0063     gF->Draw("APL");
0064     //c2->SaveAs("plot_sv_xi_frac.pdf");
0065     c2->SaveAs("plot_sv_xi_frac.png");
0066     std::cout << "Saved plot_sv_xi_frac.pdf/.png\n";
0067 }