void Example() { //=========Macro generated from canvas: cMtdNdy/dNdy Mt //========= (Tue Feb 19 10:13:40 2019) by ROOT version 6.12/06 TCanvas *cMtdNdy = new TCanvas("cMtdNdy", "dNdy Mt",214,153,1200,840); cMtdNdy->ToggleEventStatus(); cMtdNdy->Range(-1.251047,0.0008372092,1.109419,0.01246512); cMtdNdy->SetFillColor(0); cMtdNdy->SetBorderMode(0); cMtdNdy->SetBorderSize(2); cMtdNdy->SetRightMargin(0.04); cMtdNdy->SetTopMargin(0.04); cMtdNdy->SetFrameBorderMode(0); cMtdNdy->SetFrameBorderMode(0); TGraphMultiErrors* tgme = new TGraphMultiErrors(35, 3); tgme->SetName("Graph_from_hdNdyStd"); tgme->SetTitle(""); tgme->SetFillStyle(0); Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = TColor::GetColor("#ff0000"); tgme->SetLineColor(ci); ci = TColor::GetColor("#ff0000"); tgme->SetMarkerColor(ci); tgme->SetMarkerStyle(20); tgme->SetMarkerSize(1.5); tgme->GetAttFill(0)->SetFillStyle(0); ci = TColor::GetColor("#ff0000"); tgme->GetAttLine(0)->SetLineColor(ci); tgme->GetAttFill(1)->SetFillStyle(0); ci = TColor::GetColor("#ff0000"); tgme->GetAttLine(1)->SetLineColor(ci); tgme->GetAttFill(2)->SetFillStyle(3002); tgme->GetAttFill(2)->SetFillColor(kBlue); ci = TColor::GetColor("#ff0000"); tgme->GetAttLine(2)->SetLineColor(ci); tgme->SetPoint(0, -1.7, -1e-10); tgme->SetPointEX(0, 0.05, 0.05); tgme->SetPointEY(0, 0, 0, 0); tgme->SetPointEY(0, 1, 0, 0); tgme->SetPointEY(0, 2, 0, 0); tgme->SetPoint(1, -1.6, -1e-10); tgme->SetPointEX(1, 0.05, 0.05); tgme->SetPointEY(1, 0, 0, 0); tgme->SetPointEY(1, 1, 0, 0); tgme->SetPointEY(1, 2, 0, 0); tgme->SetPoint(2, -1.5, -1e-10); tgme->SetPointEX(2, 0.05, 0.05); tgme->SetPointEY(2, 0, 0, 0); tgme->SetPointEY(2, 1, 0, 0); tgme->SetPointEY(2, 2, 0, 0); tgme->SetPoint(3, -1.4, -1e-10); tgme->SetPointEX(3, 0.05, 0.05); tgme->SetPointEY(3, 0, 0, 0); tgme->SetPointEY(3, 1, 0, 0); tgme->SetPointEY(3, 2, 0, 0); tgme->SetPoint(4, -1.3, -1e-10); tgme->SetPointEX(4, 0.05, 0.05); tgme->SetPointEY(4, 0, 0, 0); tgme->SetPointEY(4, 1, 0, 0); tgme->SetPointEY(4, 2, 0, 0); tgme->SetPoint(5, -1.2, -1e-10); tgme->SetPointEX(5, 0.05, 0.05); tgme->SetPointEY(5, 0, 0, 0); tgme->SetPointEY(5, 1, 0, 0); tgme->SetPointEY(5, 2, 0, 0); tgme->SetPoint(6, -1.1, -1e-10); tgme->SetPointEX(6, 0.05, 0.05); tgme->SetPointEY(6, 0, 0, 0); tgme->SetPointEY(6, 1, 0, 0); tgme->SetPointEY(6, 2, 0, 0); tgme->SetPoint(7, -1, -1e-10); tgme->SetPointEX(7, 0.05, 0.05); tgme->SetPointEY(7, 0, 0, 0); tgme->SetPointEY(7, 1, 0, 0); tgme->SetPointEY(7, 2, 0, 0); tgme->SetPoint(8, -0.9, -1e-10); tgme->SetPointEX(8, 0.05, 0.05); tgme->SetPointEY(8, 0, 0, 0); tgme->SetPointEY(8, 1, 0, 0); tgme->SetPointEY(8, 2, 0, 0); tgme->SetPoint(9, -0.8, -1e-10); tgme->SetPointEX(9, 0.05, 0.05); tgme->SetPointEY(9, 0, 0, 0); tgme->SetPointEY(9, 1, 0, 0); tgme->SetPointEY(9, 2, 0, 0); tgme->SetPoint(10, -0.7, -1e-10); tgme->SetPointEX(10, 0.05, 0.05); tgme->SetPointEY(10, 0, 0, 0); tgme->SetPointEY(10, 1, 0, 0); tgme->SetPointEY(10, 2, 0, 0); tgme->SetPoint(11, -0.6, 0.006653559); tgme->SetPointEX(11, 0.05, 0.05); tgme->SetPointEY(11, 0, 0.0007770135, 0.0007770135); tgme->SetPointEY(11, 1, 0.0002661424, 0.0002661424); tgme->SetPointEY(11, 2, 0.001114412, 0.001114412); tgme->SetPoint(12, -0.5, 0.007612885); tgme->SetPointEX(12, 0.05, 0.05); tgme->SetPointEY(12, 0, 0.0003058048, 0.0003058048); tgme->SetPointEY(12, 1, 0.0003045154, 0.0003045154); tgme->SetPointEY(12, 2, 0.001114412, 0.001114412); tgme->SetPoint(13, -0.4, 0.007998861); tgme->SetPointEX(13, 0.05, 0.05); tgme->SetPointEY(13, 0, 0.000169729, 0.000169729); tgme->SetPointEY(13, 1, 0.0003199544, 0.0003199544); tgme->SetPointEY(13, 2, 0.001114412, 0.001114412); tgme->SetPoint(14, -0.3, 0.008373467); tgme->SetPointEX(14, 0.05, 0.05); tgme->SetPointEY(14, 0, 0.0001226339, 0.0001226339); tgme->SetPointEY(14, 1, 0.0003349387, 0.0003349387); tgme->SetPointEY(14, 2, 0.001114412, 0.001114412); tgme->SetPoint(15, -0.2, 0.0090014); tgme->SetPointEX(15, 0.05, 0.05); tgme->SetPointEY(15, 0, 0.0001099641, 0.0001099641); tgme->SetPointEY(15, 1, 0.000360056, 0.000360056); tgme->SetPointEY(15, 2, 0.001114412, 0.001114412); tgme->SetPoint(16, -0.1, 0.00918717); tgme->SetPointEX(16, 0.05, 0.05); tgme->SetPointEY(16, 0, 0.0001012269, 0.0001012269); tgme->SetPointEY(16, 1, 0.0003674868, 0.0003674868); tgme->SetPointEY(16, 2, 0.001114412, 0.001114412); tgme->SetPoint(17, 1.804112e-16, 0.009157779); tgme->SetPointEX(17, 0.05, 0.05); tgme->SetPointEY(17, 0, 9.974575e-05, 9.974575e-05); tgme->SetPointEY(17, 1, 0.0003663111, 0.0003663111); tgme->SetPointEY(17, 2, 0.001114412, 0.001114412); tgme->SetPoint(18, 0.1, 0.009052232); tgme->SetPointEX(18, 0.05, 0.05); tgme->SetPointEY(18, 0, 0.0001012727, 0.0001012727); tgme->SetPointEY(18, 1, 0.0003620893, 0.0003620893); tgme->SetPointEY(18, 2, 0.001114412, 0.001114412); tgme->SetPoint(19, 0.2, 0.008822018); tgme->SetPointEX(19, 0.05, 0.05); tgme->SetPointEY(19, 0, 0.0001061224, 0.0001061224); tgme->SetPointEY(19, 1, 0.0003528807, 0.0003528807); tgme->SetPointEY(19, 2, 0.001114412, 0.001114412); tgme->SetPoint(20, 0.3, 0.008393364); tgme->SetPointEX(20, 0.05, 0.05); tgme->SetPointEY(20, 0, 0.0001146153, 0.0001146153); tgme->SetPointEY(20, 1, 0.0003357346, 0.0003357346); tgme->SetPointEY(20, 2, 0.001114412, 0.001114412); tgme->SetPoint(21, 0.4, 0.007694294); tgme->SetPointEX(21, 0.05, 0.05); tgme->SetPointEY(21, 0, 0.0001231055, 0.0001231055); tgme->SetPointEY(21, 1, 0.0003077718, 0.0003077718); tgme->SetPointEY(21, 2, 0.001114412, 0.001114412); tgme->SetPoint(22, 0.5, 0.006927766); tgme->SetPointEX(22, 0.05, 0.05); tgme->SetPointEY(22, 0, 0.0001419568, 0.0001419568); tgme->SetPointEY(22, 1, 0.0002771106, 0.0002771106); tgme->SetPointEY(22, 2, 0.001114412, 0.001114412); tgme->SetPoint(23, 0.6, 0.005943415); tgme->SetPointEX(23, 0.05, 0.05); tgme->SetPointEY(23, 0, 0.0001604474, 0.0001604474); tgme->SetPointEY(23, 1, 0.000248211, 0.000248211); tgme->SetPointEY(23, 2, 0.001114412, 0.001114412); tgme->SetPoint(24, 0.7, 0.004971598); tgme->SetPointEX(24, 0.05, 0.05); tgme->SetPointEY(24, 0, 0.00019305, 0.00019305); tgme->SetPointEY(24, 1, 0.0001988639, 0.0001988639); tgme->SetPointEY(24, 2, 0.001114412, 0.001114412); tgme->SetPoint(25, 0.8, 0.003335559); tgme->SetPointEX(25, 0.05, 0.05); tgme->SetPointEY(25, 0, 0.000226053, 0.000226053); tgme->SetPointEY(25, 1, 0.0001334223, 0.0001334223); tgme->SetPointEY(25, 2, 0.001114412, 0.001114412); tgme->SetPoint(26, 0.9, -1e-10); tgme->SetPointEX(26, 0.05, 0.05); tgme->SetPointEY(26, 0, 0, 0); tgme->SetPointEY(26, 1, 0, 0); tgme->SetPointEY(26, 2, 0, 0); tgme->SetPoint(27, 1, -1e-10); tgme->SetPointEX(27, 0.05, 0.05); tgme->SetPointEY(27, 0, 0, 0); tgme->SetPointEY(27, 1, 0, 0); tgme->SetPointEY(27, 2, 0, 0); tgme->SetPoint(28, 1.1, -1e-10); tgme->SetPointEX(28, 0.05, 0.05); tgme->SetPointEY(28, 0, 0, 0); tgme->SetPointEY(28, 1, 0, 0); tgme->SetPointEY(28, 2, 0, 0); tgme->SetPoint(29, 1.2, -1e-10); tgme->SetPointEX(29, 0.05, 0.05); tgme->SetPointEY(29, 0, 0, 0); tgme->SetPointEY(29, 1, 0, 0); tgme->SetPointEY(29, 2, 0, 0); tgme->SetPoint(30, 1.3, -1e-10); tgme->SetPointEX(30, 0.05, 0.05); tgme->SetPointEY(30, 0, 0, 0); tgme->SetPointEY(30, 1, 0, 0); tgme->SetPointEY(30, 2, 0, 0); tgme->SetPoint(31, 1.4, -1e-10); tgme->SetPointEX(31, 0.05, 0.05); tgme->SetPointEY(31, 0, 0, 0); tgme->SetPointEY(31, 1, 0, 0); tgme->SetPointEY(31, 2, 0, 0); tgme->SetPoint(32, 1.5, -1e-10); tgme->SetPointEX(32, 0.05, 0.05); tgme->SetPointEY(32, 0, 0, 0); tgme->SetPointEY(32, 1, 0, 0); tgme->SetPointEY(32, 2, 0, 0); tgme->SetPoint(33, 1.6, -1e-10); tgme->SetPointEX(33, 0.05, 0.05); tgme->SetPointEY(33, 0, 0, 0); tgme->SetPointEY(33, 1, 0, 0); tgme->SetPointEY(33, 2, 0, 0); tgme->SetPoint(34, 1.7, -1e-10); tgme->SetPointEX(34, 0.05, 0.05); tgme->SetPointEY(34, 0, 0, 0); tgme->SetPointEY(34, 1, 0, 0); tgme->SetPointEY(34, 2, 0, 0); TH1F *Graph_Graph_from_hdNdyStd1 = new TH1F("Graph_Graph_from_hdNdyStd1","",100,-1.75,1.75); Graph_Graph_from_hdNdyStd1->SetMinimum(0.002); Graph_Graph_from_hdNdyStd1->SetMaximum(0.012); Graph_Graph_from_hdNdyStd1->SetDirectory(0); Graph_Graph_from_hdNdyStd1->SetStats(0); ci = TColor::GetColor("#000099"); Graph_Graph_from_hdNdyStd1->SetLineColor(ci); Graph_Graph_from_hdNdyStd1->GetXaxis()->SetTitle("Rapidity y_{cm}"); Graph_Graph_from_hdNdyStd1->GetXaxis()->SetRange(22,79); Graph_Graph_from_hdNdyStd1->GetXaxis()->SetLabelFont(42); Graph_Graph_from_hdNdyStd1->GetXaxis()->SetLabelSize(0.035); Graph_Graph_from_hdNdyStd1->GetXaxis()->SetTitleSize(0.035); Graph_Graph_from_hdNdyStd1->GetXaxis()->SetTitleFont(42); Graph_Graph_from_hdNdyStd1->GetYaxis()->SetTitle("#frac{dN}{dy} / N_{Events}"); Graph_Graph_from_hdNdyStd1->GetYaxis()->SetLabelFont(42); Graph_Graph_from_hdNdyStd1->GetYaxis()->SetLabelSize(0.035); Graph_Graph_from_hdNdyStd1->GetYaxis()->SetTitleSize(0.035); Graph_Graph_from_hdNdyStd1->GetYaxis()->SetTitleOffset(1.4); Graph_Graph_from_hdNdyStd1->GetYaxis()->SetTitleFont(42); Graph_Graph_from_hdNdyStd1->GetZaxis()->SetLabelFont(42); Graph_Graph_from_hdNdyStd1->GetZaxis()->SetLabelSize(0.035); Graph_Graph_from_hdNdyStd1->GetZaxis()->SetTitleSize(0.035); Graph_Graph_from_hdNdyStd1->GetZaxis()->SetTitleFont(42); tgme->SetHistogram(Graph_Graph_from_hdNdyStd1); tgme->Draw("a p x y0 s ; z ; 5 s=0.5 ; 3"); TF1 *fdNdyStdGaus1 = new TF1("fdNdyStdGaus","gaus",-1.75,1.75, TF1::EAddToList::kDefault); fdNdyStdGaus1->SetFillColor(19); fdNdyStdGaus1->SetFillStyle(0); ci = TColor::GetColor("#ff0000"); fdNdyStdGaus1->SetLineColor(ci); fdNdyStdGaus1->SetLineWidth(2); fdNdyStdGaus1->SetChisquare(34.55391); fdNdyStdGaus1->SetNDF(13); fdNdyStdGaus1->GetXaxis()->SetLabelFont(42); fdNdyStdGaus1->GetXaxis()->SetLabelSize(0.035); fdNdyStdGaus1->GetXaxis()->SetTitleSize(0.035); fdNdyStdGaus1->GetXaxis()->SetTitleFont(42); fdNdyStdGaus1->GetYaxis()->SetLabelFont(42); fdNdyStdGaus1->GetYaxis()->SetLabelSize(0.035); fdNdyStdGaus1->GetYaxis()->SetTitleSize(0.035); fdNdyStdGaus1->GetYaxis()->SetTitleOffset(0); fdNdyStdGaus1->GetYaxis()->SetTitleFont(42); fdNdyStdGaus1->SetParameter(0,0.009320421); fdNdyStdGaus1->SetParError(0,4.67545e-05); fdNdyStdGaus1->SetParLimits(0,0,0); fdNdyStdGaus1->SetParameter(1,0); fdNdyStdGaus1->SetParError(1,0); fdNdyStdGaus1->SetParLimits(1,1,1); fdNdyStdGaus1->SetParameter(2,0.6340543); fdNdyStdGaus1->SetParError(2,0.01016669); fdNdyStdGaus1->SetParLimits(2,0,0); fdNdyStdGaus1->Draw("SAME"); TLegend *leg = new TLegend(0.73,0.75,0.95,0.95,NULL,"brNDC"); leg->SetBorderSize(1); leg->SetLineColor(0); leg->SetLineStyle(1); leg->SetLineWidth(1); leg->SetFillColor(0); leg->SetFillStyle(1001); TLegendEntry *entry=leg->AddEntry("Graph_from_hdNdyStd","Data","L P"); ci = TColor::GetColor("#ff0000"); entry->SetLineColor(ci); entry->SetLineStyle(1); entry->SetLineWidth(1); ci = TColor::GetColor("#ff0000"); entry->SetMarkerColor(ci); entry->SetMarkerStyle(20); entry->SetMarkerSize(1.5); entry->SetTextFont(42); entry=leg->AddEntry("","Point to Point Systematics","F"); ci = TColor::GetColor("#ff0000"); entry->SetLineColor(ci); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("","Common Systematics","F"); ci = TColor::GetColor("#0000ff"); entry->SetLineColor(ci); entry->SetLineStyle(0); entry->SetLineWidth(0); entry->SetFillColor(ci); entry->SetFillStyle(3002); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); leg->Draw(); cMtdNdy->Modified(); cMtdNdy->cd(); cMtdNdy->SetSelected(cMtdNdy); }