Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:14:07

0001 #include "TROOT.h"
0002 #include "TF1.h"
0003 #include "TH1.h"
0004 #include "TH2.h"
0005 #include "TNtuple.h"
0006 #include "TFile.h"
0007 #include "TRandom.h"
0008 #include "TMath.h"
0009 #include "TGraph.h"
0010 #include "TCanvas.h"
0011 #include "TLatex.h"
0012 #include "TBox.h"
0013 #include "TGraphErrors.h"
0014 #include "TStyle.h"
0015 #include "TPolyLine.h"
0016 #include "TLegend.h"
0017 
0018 // author:  J.Nagle - email jamie.nagle@colorado.edu for more information
0019 
0020 #include <iostream>
0021 #include <fstream>
0022 
0023 void nlo_plot () {
0024   // read ascii files for pp@200 GeV NLO pQCD calculations from Werner V.
0025   gROOT->Reset();
0026   gROOT->SetStyle("Plain");
0027   gStyle->SetOptTitle(0);
0028   gStyle->SetOptStat(0);
0029 
0030   TCanvas *c1 = new TCanvas("c1","c1",10,10,700,900);
0031   c1->SetLogy(1);
0032 
0033   // template histogram for overlays  
0034   TH1F *h1 = new TH1F("h1","h1",100,0.0,100.0);
0035   h1->SetMaximum(1.e-2);
0036   h1->SetMinimum(1.e-21);
0037   h1->SetYTitle("Counts/Event with p_{T} > p_{T}(cut) [p-p @ 200 GeV]");
0038   h1->SetYTitle("Counts/Event [p-p @ 200 GeV]");
0039   h1->GetYaxis()->SetTitleOffset(1.5);
0040   h1->SetXTitle("Transverse Momentum (GeV/c)");
0041   h1->Draw();
0042 
0043   // Werner's numbers are in pb/GeV^2 which gets multiplied up x28 
0044   // to correspond to 24 pb^-1 or 1e12 pp@200 GeV events
0045   // Also need to multiply by 2*pi*pt*dpt*deta to get counts per bin with dpt = 2.5 and deta = 2.0
0046   // To get counts per event scale down by 1 / 1e12
0047   double scalefactor = 28.0 * (2.0*3.14159*2.5*2.0) / 1.e12;  // need to include pt factor point-by-point
0048 
0049   ifstream myfile;
0050   TGraph *tjet = new TGraph();
0051 
0052   myfile.open("jets_newphenix_sc1.dat");
0053   for (int index=0; index<38; index++) {
0054     double pt; double yield;
0055     myfile >> pt >> yield;
0056     yield = yield * scalefactor*pt;
0057     tjet->SetPoint(index,pt,yield);
0058   }
0059   myfile.close();
0060   tjet->SetMarkerStyle(21);
0061   tjet->SetMarkerColor(2);
0062   tjet->SetLineColor(2);
0063   tjet->Draw("p,l,same");
0064 
0065   //myfile.open("jets_newphenix_sc05.dat");
0066   //TGraph *tjet05 = new TGraph();
0067   //for (int index=0; index<38; index++) {
0068   //  double pt; double yield;
0069   //  myfile >> pt >> yield;
0070   //  yield = yield * scalefactor*pt;
0071   //  tjet05->SetPoint(index,pt,yield);
0072   //}
0073   //myfile.close();
0074   //tjet05->SetMarkerStyle(21);
0075   //tjet05->SetMarkerColor(2);
0076   //tjet05->SetLineColor(2);
0077   //tjet05->Draw("l,same");
0078 
0079   //myfile.open("jets_newphenix_sc2.dat");
0080   //TGraph *tjet2 = new TGraph();
0081   //for (int index=0; index<38; index++) {
0082   //  double pt; double yield;
0083   //  myfile >> pt >> yield;
0084   //  yield = yield * scalefactor*pt;
0085   //  tjet2->SetPoint(index,pt,yield);
0086   //}
0087   //myfile.close();
0088   //tjet2->SetMarkerStyle(21);
0089   //tjet2->SetMarkerColor(2);
0090   //tjet2->SetLineColor(2);
0091   //tjet2->Draw("l,same");
0092 
0093   TLegend *tleg = new TLegend(0.5,0.7,0.9,0.9,"Hard Processes pQCD @ 200 GeV","brNDC");
0094   tleg->AddEntry(tjet,"NLO pQCD W. Vogelsang","");
0095   tleg->AddEntry(tjet,"Light q + g jets","p,l");
0096   tleg->Draw("same");
0097 }