{
"cells": [
{
"cell_type": "markdown",
"id": "2f7934f0",
"metadata": {},
"source": [
"# gr303_zdemo\n",
"\n",
"The presented results are predictions of invariant cross-section\n",
"of Direct Photons produced at RHIC energies, based on the universality of\n",
"scaling function H(z).\n",
"\n",
"These Figures were published in JINR preprint E2-98-64, Dubna,\n",
"1998 and submitted to CPC.\n",
"\n",
"Note that the way greek symbols, super/subscripts are obtained\n",
"illustrate the current limitations of Root in this area.\n",
"\n",
"\n",
"\n",
"**Author:** Michael Tokarev, Elena Potrebenikova (JINR Dubna) \n",
"This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Tuesday, May 19, 2026 at 08:38 PM."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "92080189",
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%%cpp -d\n",
"#include \"TCanvas.h\"\n",
"#include \"TPad.h\"\n",
"#include \"TPaveLabel.h\"\n",
"#include \"TLatex.h\"\n",
"#include \"TGraph.h\"\n",
"#include \"TFrame.h\"\n",
"\n",
"#ifdef HZ\n",
"#undef HZ\n",
"#endif\n",
"\n",
"const Int_t NMAX = 20;\n",
"Int_t NLOOP;\n",
"Float_t Z[NMAX], HZ[NMAX], PT[NMAX], INVSIG[NMAX];\n",
"\n",
"void hz_calc(Float_t, Float_t, Float_t, Float_t, Float_t, Float_t);"
]
},
{
"cell_type": "markdown",
"id": "d7e13f4b",
"metadata": {},
"source": [
" Definition of a helper function: "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "55ba4afa",
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%%cpp -d\n",
"void hz_calc(Float_t ENERG, Float_t DENS, Float_t TGRAD, Float_t PTMIN,\n",
" Float_t PTMAX, Float_t DELP)\n",
"{\n",
" Int_t I;\n",
"\n",
" Float_t GM1 = 0.00001;\n",
" Float_t GM2 = 0.00001;\n",
" Float_t A1 = 1.;\n",
" Float_t A2 = 1.;\n",
" Float_t ALX = 2.;\n",
" Float_t BETA = 1.;\n",
" Float_t KF1 = 8.E-7;\n",
" Float_t KF2 = 5.215;\n",
"\n",
" Float_t MN = 0.9383;\n",
" Float_t DEGRAD=0.01745329;\n",
"\n",
" Float_t EB1, EB2, PB1, PB2, MB1, MB2, M1, M2;\n",
" Float_t DNDETA;\n",
"\n",
" Float_t P1P2, P1P3, P2P3;\n",
" Float_t Y1, Y2, S, SMIN, SX1, SX2, SX1X2, DELM;\n",
" Float_t Y1X1, Y1X2, Y2X1, Y2X2, Y2X1X2, Y1X1X2;\n",
" Float_t KX1, KX2, ZX1, ZX2;\n",
" Float_t H1;\n",
"\n",
" Float_t PTOT, THET, ETOT, X1, X2;\n",
"\n",
" DNDETA= DENS;\n",
" MB1 = MN*A1;\n",
" MB2 = MN*A2;\n",
" EB1 = ENERG/2.*A1;\n",
" EB2 = ENERG/2.*A2;\n",
" M1 = GM1;\n",
" M2 = GM2;\n",
" THET = TGRAD*DEGRAD;\n",
" NLOOP = (PTMAX-PTMIN)/DELP;\n",
"\n",
" for (I=0; IRange(0,0,25,18);\n",
"c1->SetFillColor(40);\n",
"\n",
"TPaveLabel *pl = new TPaveLabel(1,16.3,24,17.5,\"Z-scaling of \\\n",
" Direct Photon Productions in pp Collisions at RHIC Energies\",\"br\");\n",
"pl->SetFillColor(18);\n",
"pl->SetTextFont(32);\n",
"pl->SetTextColor(49);\n",
"pl->Draw();\n",
"\n",
"TLatex t0;\n",
"t0.SetTextFont(32);\n",
"t0.SetTextColor(1);\n",
"t0.SetTextSize(0.03);\n",
"t0.SetTextAlign(12);\n",
"t0.DrawLatex(3.1,15.5,\"M.Tokarev, E.Potrebenikova \");\n",
"t0.DrawLatex(14.,15.5,\"JINR preprint E2-98-64, Dubna, 1998 \");\n",
"\n",
"TPad *pad1 = new TPad(\"pad1\",\"This is pad1\",0.02,0.02,0.48,0.83,33);\n",
"TPad *pad2 = new TPad(\"pad2\",\"This is pad2\",0.52,0.02,0.98,0.83,33);\n",
"\n",
"pad1->Draw();\n",
"pad2->Draw();"
]
},
{
"cell_type": "markdown",
"id": "1e326dc2",
"metadata": {},
"source": [
"Cross-section of direct photon production in pp collisions\n",
"at 500 GeV vs Pt"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "69313038",
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"energ = 63;\n",
"dens = 1.766;\n",
"tgrad = 90.;\n",
"ptmin = 4.;\n",
"ptmax = 24.;\n",
"delp = 2.;\n",
"hz_calc(energ, dens, tgrad, ptmin, ptmax, delp);\n",
"pad1->cd();\n",
"pad1->Range(-0.255174,-19.25,2.29657,-6.75);\n",
"pad1->SetLogx();\n",
"pad1->SetLogy();"
]
},
{
"cell_type": "markdown",
"id": "5d050f6d",
"metadata": {},
"source": [
"create a 2-d histogram to define the range"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "755d80b4",
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"pad1->DrawFrame(1,1e-18,110,1e-8);\n",
"pad1->GetFrame()->SetFillColor(19);\n",
"\n",
"TLatex t1;\n",
"t1.SetNDC();\n",
"t1.SetTextFont(62);\n",
"t1.SetTextColor(36);\n",
"t1.SetTextSize(0.08);\n",
"t1.SetTextAlign(12);\n",
"t1.DrawLatex(0.6,0.85,\"p - p\");\n",
"\n",
"t1.SetTextSize(0.05);\n",
"t1.DrawLatex(0.6,0.79,\"Direct #gamma\");\n",
"t1.DrawLatex(0.6,0.75,\"#theta = 90^{o}\");\n",
"\n",
"t1.DrawLatex(0.20,0.45,\"Ed^{3}#sigma/dq^{3}\");\n",
"t1.DrawLatex(0.18,0.40,\"(barn/Gev^{2})\");\n",
"\n",
"t1.SetTextSize(0.045);\n",
"t1.SetTextColor(kBlue);\n",
"t1.DrawLatex(0.22,0.260,\"#sqrt{s} = 63(GeV)\");\n",
"t1.SetTextColor(kRed);\n",
"t1.DrawLatex(0.22,0.205,\"#sqrt{s} = 200(GeV)\");\n",
"t1.SetTextColor(6);\n",
"t1.DrawLatex(0.22,0.15,\"#sqrt{s} = 500(GeV)\");\n",
"\n",
"t1.SetTextSize(0.05);\n",
"t1.SetTextColor(1);\n",
"t1.DrawLatex(0.6,0.06,\"q_{T} (Gev/c)\");\n",
"\n",
"TGraph *gr1 = new TGraph(NLOOP,PT,INVSIG);\n",
"\n",
"gr1->SetLineColor(38);\n",
"gr1->SetMarkerColor(kBlue);\n",
"gr1->SetMarkerStyle(21);\n",
"gr1->SetMarkerSize(1.1);\n",
"gr1->Draw(\"LP\");"
]
},
{
"cell_type": "markdown",
"id": "65eb017a",
"metadata": {},
"source": [
"Cross-section of direct photon production in pp collisions\n",
"at 200 GeV vs Pt"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2fa342ae",
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"energ = 200;\n",
"dens = 2.25;\n",
"tgrad = 90.;\n",
"ptmin = 4.;\n",
"ptmax = 64.;\n",
"delp = 6.;\n",
"hz_calc(energ, dens, tgrad, ptmin, ptmax, delp);\n",
"\n",
"TGraph *gr2 = new TGraph(NLOOP,PT,INVSIG);\n",
"gr2->SetLineColor(38);\n",
"gr2->SetMarkerColor(kRed);\n",
"gr2->SetMarkerStyle(29);\n",
"gr2->SetMarkerSize(1.5);\n",
"gr2->Draw(\"LP\");"
]
},
{
"cell_type": "markdown",
"id": "37e021d6",
"metadata": {},
"source": [
"Cross-section of direct photon production in pp collisions\n",
"at 500 GeV vs Pt"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8a4ffab5",
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"energ = 500;\n",
"dens = 2.73;\n",
"tgrad = 90.;\n",
"ptmin = 4.;\n",
"ptmax = 104.;\n",
"delp = 10.;\n",
"hz_calc(energ, dens, tgrad, ptmin, ptmax, delp);\n",
"\n",
"TGraph *gr3 = new TGraph(NLOOP,PT,INVSIG);\n",
"\n",
"gr3->SetLineColor(38);\n",
"gr3->SetMarkerColor(6);\n",
"gr3->SetMarkerStyle(8);\n",
"gr3->SetMarkerSize(1.1);\n",
"gr3->Draw(\"LP\");\n",
"\n",
"Float_t *dum = nullptr;\n",
"TGraph *graph = new TGraph(1,dum,dum);\n",
"graph->SetMarkerColor(kBlue);\n",
"graph->SetMarkerStyle(21);\n",
"graph->SetMarkerSize(1.1);\n",
"graph->SetPoint(0,1.7,1.e-16);\n",
"graph->Draw(\"LP\");\n",
"\n",
"graph = new TGraph(1,dum,dum);\n",
"graph->SetMarkerColor(kRed);\n",
"graph->SetMarkerStyle(29);\n",
"graph->SetMarkerSize(1.5);\n",
"graph->SetPoint(0,1.7,2.e-17);\n",
"graph->Draw(\"LP\");\n",
"\n",
"graph = new TGraph(1,dum,dum);\n",
"graph->SetMarkerColor(6);\n",
"graph->SetMarkerStyle(8);\n",
"graph->SetMarkerSize(1.1);\n",
"graph->SetPoint(0,1.7,4.e-18);\n",
"graph->Draw(\"LP\");\n",
"\n",
"pad2->cd();\n",
"pad2->Range(-0.43642,-23.75,3.92778,-6.25);\n",
"pad2->SetLogx();\n",
"pad2->SetLogy();\n",
"\n",
"pad2->DrawFrame(1,1e-22,3100,1e-8);\n",
"pad2->GetFrame()->SetFillColor(19);\n",
"\n",
"TGraph *gr = new TGraph(NLOOP,Z,HZ);\n",
"gr->SetTitle(\"HZ vs Z\");\n",
"gr->SetFillColor(19);\n",
"gr->SetLineColor(9);\n",
"gr->SetMarkerColor(50);\n",
"gr->SetMarkerStyle(29);\n",
"gr->SetMarkerSize(1.5);\n",
"gr->Draw(\"LP\");\n",
"\n",
"TLatex t2;\n",
"t2.SetNDC();\n",
"t2.SetTextFont(62);\n",
"t2.SetTextColor(36);\n",
"t2.SetTextSize(0.08);\n",
"t2.SetTextAlign(12);\n",
"t2.DrawLatex(0.6,0.85,\"p - p\");\n",
"\n",
"t2.SetTextSize(0.05);\n",
"t2.DrawLatex(0.6,0.79,\"Direct #gamma\");\n",
"t2.DrawLatex(0.6,0.75,\"#theta = 90^{o}\");\n",
"\n",
"t2.DrawLatex(0.70,0.55,\"H(z)\");\n",
"t2.DrawLatex(0.68,0.50,\"(barn)\");\n",
"\n",
"t2.SetTextSize(0.045);\n",
"t2.SetTextColor(46);\n",
"t2.DrawLatex(0.20,0.30,\"#sqrt{s}, GeV\");\n",
"t2.DrawLatex(0.22,0.26,\"63\");\n",
"t2.DrawLatex(0.22,0.22,\"200\");\n",
"t2.DrawLatex(0.22,0.18,\"500\");\n",
"\n",
"t2.SetTextSize(0.05);\n",
"t2.SetTextColor(1);\n",
"t2.DrawLatex(0.88,0.06,\"z\");\n",
"\n",
"c1->Modified();\n",
"c1->Update();"
]
},
{
"cell_type": "markdown",
"id": "0f1fbbcf",
"metadata": {},
"source": [
"Draw all canvases "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "26f8b0be",
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"gROOT->GetListOfCanvases()->Draw()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "ROOT C++",
"language": "c++",
"name": "root"
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".C",
"mimetype": " text/x-c++src",
"name": "c++"
}
},
"nbformat": 4,
"nbformat_minor": 5
}