9 gSystem->Load(
"libeicsmear");
10 gROOT->LoadMacro(
"/sphenix/user/gregtom3/SBU/research/macros/macros/sPHENIXStyle/sPhenixStyle.C");
14 TFile *
input =
new TFile(
"/sphenix/user/gregtom3/data/Fall2018/LOI_smear_studies/DVMP.root",
"READ");
17 TH1F *h1_invariant_mass = (TH1F*)input->Get(
"h1_invariant_mass");
18 TH1F *h1_invariant_mass_comb = (TH1F*)input->Get(
"h1_invariant_mass_comb");
19 TH1F *h1_invariant_mass_alone = (TH1F*)input->Get(
"h1_invariant_mass_alone");
22 TCanvas *c_inv =
new TCanvas(
"c_inv",
"",700,500);
23 h1_invariant_mass_comb->SetLineColor(kGray);
24 h1_invariant_mass_comb->SetFillColor(kGray);
25 h1_invariant_mass->GetXaxis()->SetTitle(
"e^{-}e^{+} Invariant Mass [GeV/c^{2}]");
26 h1_invariant_mass->GetYaxis()->SetTitle(
"Entries");
29 h1_invariant_mass->Scale(10/1.55);
30 h1_invariant_mass_comb->Scale(10/1.55);
31 h1_invariant_mass_alone->Scale(10/1.55);
37 auto legend =
new TLegend(0.6,0.65,0.8,0.75);
38 legend->SetTextSize(0.03);
39 legend->AddEntry(h1_invariant_mass,
"All e^{+}e^{-} pairs",
"l");
40 legend->AddEntry(h1_invariant_mass_comb,
"Combinatorial background",
"l");
48 c_inv->SaveAs(
"inv_mass_poly.eps");
50 TCanvas *c_sing =
new TCanvas(
"c_sing",
"",700,500);
51 double x[100];
double y[100];
double ex[100];
double ey[100];
54 x[
entry] = h1_invariant_mass->GetXaxis()->GetBinCenter(
entry);
56 y[
entry]=h1_invariant_mass->GetBinContent(1);
58 y[
entry] = h1_invariant_mass->GetBinContent(
entry);
59 ey[
entry] = sqrt(h1_invariant_mass->GetBinContent(
entry));
64 auto gr =
new TGraph(100,x,y);
65 auto gr_error =
new TGraphErrors(100,x,y,ex,ey);
66 gr_error->SetMarkerSize(1);
67 gr_error->SetMarkerColor(kBlack);
68 gr->SetMarkerSize(.5);
69 gr->SetMarkerColor(kBlue);
73 gr->GetXaxis()->SetTitle(
"e^{+}e^{-} Invariant Mass [GeV/c^{2}]");
74 gr->GetYaxis()->SetTitle(
"Entries");
76 auto th2 =
new TLatex(3.16,38000,
"Luminosity 10 fb^{-1}");
77 th2->SetTextSize(0.04);
79 h1_invariant_mass_comb->Draw(
"same");
80 c_sing->SaveAs(
"inv_mass_sing.eps");
82 TCanvas *c_nils =
new TCanvas(
"c_nils",
"",700,500);
84 h1_invariant_mass_alone->SetMarkerColor(kWhite);
85 h1_invariant_mass_alone->SetLineColor(kWhite);
86 gr_error->GetXaxis()->SetRangeUser(2.95,3.25);
87 gr_error->GetXaxis()->SetTitle(
"e^{+}e^{-} Invariant Mass [GeV/c^{2}]");
88 gr_error->GetYaxis()->SetTitle(
"Entries");
89 gr_error->GetYaxis()->SetNdivisions(505);
99 using namespace RooFit;
106 RooRealVar xx(
"xx",
"e^{+}e^{-} Invariant Mass [GeV/c^{2}]",hmin,hmax);
107 RooDataHist dh(
"dh",
"Entries",xx,h1_invariant_mass);
108 RooPlot* frame = xx.frame(
"Z mass");
110 h1_invariant_mass->GetYaxis()->SetNdivisions(505);
115 RooRealVar
mean(
"mean",
"mean",3.096, 3, 1200.0);
116 RooRealVar
width(
"width",
"width",0.0926, 0.0900, 0.1);
117 RooRealVar
sigma(
"sigma",
"sigma",0.02, 0.0, 100.0);
118 RooRealVar
alpha(
"alpha",
"alpha",0.02, -1000.0, 1000.0);
119 RooRealVar
n(
"n",
"n",3, -5, 5);
120 RooGaussian
gauss(
"gauss",
"gauss",xx,mean,sigma);
126 RooFitResult* filters = gauss.fitTo(dh,
"qr");
129 frame->GetYaxis()->SetTitle(
"Entries");
130 frame->GetYaxis()->SetNdivisions(505);
133 TF1 *gfit =
new TF1(
"Gaussian",
"gaus",hmin,hmax);
134 h1_invariant_mass->Fit(
"Gaussian",
"RQ0");
135 gfit->SetLineColor(kBlue);
140 dh.plotOn(frame,MarkerColor(4),MarkerSize(1),MarkerStyle(20));
144 auto legend =
new TLegend(0.2,0.79,0.4,0.89);
145 legend->SetTextSize(0.04);
146 legend->AddEntry(h1_invariant_mass,
"All e^{+}e^{-} pairs",
"l");
147 legend->AddEntry(
gr,
"Bin points",
"p");
148 legend->AddEntry(gfit,
"Fitted Gaussian",
"l");
152 auto th1 =
new TLatex(3.14,130000,
"Luminosity 10 fb^{-1}");
153 th1->SetTextSize(0.04);
156 auto th3 =
new TLatex(3.14,150000,
"18x275 e+p");
157 th3->SetTextSize(0.04);
161 auto th4 =
new TLatex(3.14,140000,
"DVMP Sartre");
162 th4->SetTextSize(0.04);
165 auto th5 =
new TLatex(3.14,160000,
"#bf{#it{sPHENIX}} Simulation");
166 th5->SetTextSize(0.04);
171 c_nils->SaveAs(
"dvmp_gaussian.eps");
177 Double_t
mybw(Double_t*
x, Double_t* par)
179 Double_t arg1 = 14.0/22.0;
180 Double_t arg2 = par[1]*par[1]*par[2]*par[2];
181 Double_t arg3 = ((x[0]*x[0]) - (par[2]*par[2]))*((x[0]*x[0]) - (par[2]*par[2]));
182 Double_t arg4 = x[0]*x[0]*x[0]*x[0]*((par[1]*par[1])/(par[2]*par[2]));
183 return par[0]*arg1*arg2/(arg3 + arg4);