void gg11n() { TLegend* legend = 0L; ofstream fout("out.txt"); TCanvas *c1 = new TCanvas("c1","A Simple Graph Example",200,10,800,600); c1->SetFillColor(0); c1->SetGrid(); c1->SetLogy(); gStyle->SetOptDate(0); gStyle->SetGridStyle(1); gStyle->SetGridColor(kGray); gStyle->SetOptTitle(0); const Int_t n45 = 4, n60=5, n100=6, n150=6; const Int_t m = 20; Double_t rr[m] = {.200,.205,.210,.215,.220,.225,.230,.235,.240,.245, .250,.255,.260,.265,.270,.275,.280,.320,.390,.490}; Double_t ss[m] = {10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,1000000,10000000,1000000}; Double_t r45a[n45] = {0.456444, 0.452449, 0.449876, 0.448528 }; Double_t g45a[n45] = {(0.2217+0.2176+0.2199)/3.,(0.2267+0.2274+0.2249)/3., (0.2312+0.2274+0.2296)/3.,(0.2378+0.2370+0.2347)/3.}; Double_t r60a[n60] = {0.434328, 0.425592, 0.416711, 0.408938, 0.387027}; Double_t g60a[n60] = {(0.2189+0.2225+0.2201)/3., (0.2307+0.2275+0.2303)/3., (0.2398+0.2423+0.2402)/3., (0.2491+0.2519+0.2500)/3., (0.2591+0.2616+0.2597)/3.}; Double_t r100a[n100] = {0.306558, 0.304032, 0.297827, 0.293789, 0.290856, 0.283958}; Double_t g100a[n100] = {(0.2385+0.2423+0.2405)/3., (0.2487+0.2523+0.2503)/3., (0.2586+0.2616+0.2600)/3., (0.2723+0.2715+0.2696)/3., (0.2784+0.2811+0.2796)/3., (0.2830+0.2863+0.2843)/3.}; Double_t r150a[n150] = {0.260789, 0.262564, 0.25891, 0.256049, 0.25232, 0.242539}; Double_t g150a[n150] = {(0.2794+0.2815+0.2796)/3., (0.2884+0.2914+0.2893)/3., (0.2987+0.3010+0.2991)/3., (0.3082+0.3108+0.3090)/3., (0.3184+0.3206+0.3184)/3., (0.3328+0.3305+0.3282)/3.}; const Int_t m150=7, m100=2; Double_t r150m[m150]= {1.1804, 1.17029, 1.1766, 1.16228, 1.13842, 1.10616, 1.0724}; Double_t g150m[m150] = {0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47}; Double_t r100m[m100]= {0.96502, 1.01467}; Double_t g100m[m100] = {0.39, 0.40}; Double_t a, b; for(Int_t i=0; iSetLineColor(4); gr->SetLineWidth(4); gr->SetMarkerColor(4); gr->SetMarkerStyle(21); // gr->SetTitle("N_{#gamma}/N_{e} vs #DeltaGEM, kV "); gr->GetXaxis()->SetTitle("#DeltaGEM, kV "); gr->GetYaxis()->SetTitle("N_{#gamma}/N_{e} "); gr->SetMaximum(5.4); gr->SetMinimum(0.02); gr->Draw("AP"); gStyle->SetOptFit(000); gr1 = new TGraph(n45,g45a,r45a); gr1->SetLineColor(1); gr1->SetLineWidth(2); gr1->SetMarkerColor(1); gr1->SetMarkerStyle(21); gr1->Draw("P"); gr1->Fit("pol1",""); gr1->GetFunction("pol1")->SetLineWidth(1); gr1->GetFunction("pol1")->SetLineColor(1); gr1->GetFunction("pol1")->SetLineStyle(1); a = gr1->GetFunction("pol1")->GetParameter(0); b = gr1->GetFunction("pol1")->GetParameter(1); fout<<"APD 45 Psi "<SetLineColor(1); gr2->SetLineWidth(2); gr2->SetMarkerColor(1); gr2->SetMarkerStyle(21); gr2->Draw("P"); gr2->Fit("pol1",""); gr2->GetFunction("pol1")->SetLineWidth(1); gr2->GetFunction("pol1")->SetLineColor(1); gr2->GetFunction("pol1")->SetLineStyle(2); a = gr2->GetFunction("pol1")->GetParameter(0); b = gr2->GetFunction("pol1")->GetParameter(1); fout<<"APD 60 Psi "<SetLineColor(1); gr3->SetLineWidth(2); gr3->SetMarkerColor(1); gr3->SetMarkerStyle(21); gr3->Draw("P"); gr3->Fit("pol1",""); gr3->GetFunction("pol1")->SetLineWidth(1); gr3->GetFunction("pol1")->SetLineColor(1); gr3->GetFunction("pol1")->SetLineStyle(3); a = gr3->GetFunction("pol1")->GetParameter(0); b = gr3->GetFunction("pol1")->GetParameter(1); fout<<"APD 100 Psi "<SetLineColor(1); gr4->SetLineWidth(2); gr4->SetMarkerColor(1); gr4->SetMarkerStyle(21); gr4->Draw("P"); gr4->Fit("pol1",""); gr4->GetFunction("pol1")->SetLineWidth(1); gr4->GetFunction("pol1")->SetLineColor(1); gr4->GetFunction("pol1")->SetLineStyle(4); a = gr4->GetFunction("pol1")->GetParameter(0); b = gr4->GetFunction("pol1")->GetParameter(1); fout<<"PMT 150 Psi "<SetLineColor(1); gr5->SetLineWidth(2); gr5->SetMarkerColor(1); gr5->SetMarkerStyle(25); gr5->Draw("P"); gr5->Fit("pol1",""); gr5->GetFunction("pol1")->SetLineWidth(1); gr5->GetFunction("pol1")->SetLineColor(1); gr5->GetFunction("pol1")->SetLineStyle(2); a = gr5->GetFunction("pol1")->GetParameter(0); b = gr5->GetFunction("pol1")->GetParameter(1); fout<<"PMT 150 Psi "<SetLineColor(1); gr6->SetLineWidth(2); gr6->SetMarkerColor(1); gr6->SetMarkerStyle(25); gr6->Draw("P"); gr6->Fit("pol1",""); gr6->GetFunction("pol1")->SetLineWidth(1); gr6->GetFunction("pol1")->SetLineColor(1); gr6->GetFunction("pol1")->SetLineStyle(1); a = gr6->GetFunction("pol1")->GetParameter(0); b = gr6->GetFunction("pol1")->GetParameter(1); fout<<"PMT 100 Psi "<SetNDC(); t->SetTextFont(32); t->SetTextAlign(12); t->SetTextSize(0.035); t->SetTextColor(1); t->DrawLatex(0.15,0.87,"Neon+0.01% H_{2}, 0.1% H_{2} & 1.0% H_{2} T=293K"); t->DrawLatex(0.16.5,0.61.5,"45"); t->DrawLatex(0.3.5,0.60.5,"60"); t->DrawLatex(0.34,0.56,"100"); t->DrawLatex(0.43,0.54.5,"150"); t->DrawLatex(0.56,0.71,"100"); t->DrawLatex(0.72,0.77,"150"); t->DrawLatex(0.7,0.68,"0.01% H2"); t->DrawLatex(0.30,0.48,"0.1% H2"); const Int_t k30=5, k45=4, k60=4, k100=3, k150=3; Double_t r30k[k30] = {0.215475, 0.214399, 0.2147, 0.217265, 0.220405}; Double_t g30k[k30] = {(0.1823+0.1789+0.1809)/3.,(0.1874+0.1836+0.1857)/3., (0.1925+0.1886+0.1907)/3.,(0.2020+0.1986+0.2003)/3., (0.2119+0.2082+0.2101)/3.}; Double_t r45k[k45] = {0.136039, 0.143073, 0.141919, 0.142967}; Double_t g45k[k45] = {(0.1873+0.1888+0.1907)/3.,(0.2020+0.1985+0.2003)/3., (0.2115+0.2084+0.2102)/3.,(0.2216+0.2181+0.2200)/3.}; Double_t r60k[k60] = {0.104654, 0.107904, 0.107981, 0.109529}; Double_t g60k[k60] = {(0.2023+0.1984+0.2005)/3., (0.2120+0.2084+0.2102)/3., (0.2214+0.2181+0.2200)/3., (0.2322+0.2279+0.2299)/3.}; Double_t r100k[k100] = {0.0523186, 0.0532423, 0.0535629}; Double_t g100k[k100] = {(0.2414+0.2376+0.2400)/3., (0.2507+0.2473+0.2497)/3., (0.2576+0.2621+0.2598)/3.}; Double_t r150k[k150] = {0.0286003, 0.0303109, 0.0295415}; Double_t g150k[k150] = {(0.2771+0.2813+0.2796)/3., (0.2873+0.2913+0.2896)/3., (0.2982+0.3012+0.2994)/3.}; for(Int_t i=0; iSetLineColor(1); gr21->SetLineWidth(2); gr21->SetMarkerColor(1); gr21->SetMarkerStyle(24); gr21->Draw("P"); gr21->Fit("pol1",""); gr21->GetFunction("pol1")->SetLineWidth(1); gr21->GetFunction("pol1")->SetLineColor(1); gr21->GetFunction("pol1")->SetLineStyle(1); a = gr21->GetFunction("pol1")->GetParameter(0); b = gr21->GetFunction("pol1")->GetParameter(1); fout<<"APD 30 Psi "<SetLineColor(1); gr31->SetLineWidth(2); gr31->SetMarkerColor(1); gr31->SetMarkerStyle(24); gr31->Draw("P"); gr31->Fit("pol1",""); gr31->GetFunction("pol1")->SetLineWidth(1); gr31->GetFunction("pol1")->SetLineColor(1); gr31->GetFunction("pol1")->SetLineStyle(2); a = gr31->GetFunction("pol1")->GetParameter(0); b = gr31->GetFunction("pol1")->GetParameter(1); fout<<"APD 45 Psi "<SetLineColor(1); gr41->SetLineWidth(2); gr41->SetMarkerColor(1); gr41->SetMarkerStyle(24); gr41->Draw("P"); gr41->Fit("pol1",""); gr41->GetFunction("pol1")->SetLineWidth(1); gr41->GetFunction("pol1")->SetLineColor(1); gr41->GetFunction("pol1")->SetLineStyle(3); a = gr41->GetFunction("pol1")->GetParameter(0); b = gr41->GetFunction("pol1")->GetParameter(1); fout<<"PMT 60 Psi "<SetLineColor(1); gr51->SetLineWidth(2); gr51->SetMarkerColor(1); gr51->SetMarkerStyle(24); gr51->Draw("P"); gr51->Fit("pol1",""); gr51->GetFunction("pol1")->SetLineWidth(1); gr51->GetFunction("pol1")->SetLineColor(1); gr51->GetFunction("pol1")->SetLineStyle(4); a = gr51->GetFunction("pol1")->GetParameter(0); b = gr51->GetFunction("pol1")->GetParameter(1); fout<<"APD 100 Psi "<SetLineColor(1); gr61->SetLineWidth(2); gr61->SetMarkerColor(1); gr61->SetMarkerStyle(24); gr61->Draw("P"); gr61->Fit("pol1",""); gr61->GetFunction("pol1")->SetLineWidth(1); gr61->GetFunction("pol1")->SetLineColor(1); gr61->GetFunction("pol1")->SetLineStyle(5); a = gr61->GetFunction("pol1")->GetParameter(0); b = gr61->GetFunction("pol1")->GetParameter(1); fout<<"APD 150 Psi "<DrawLatex(0.12,0.52,"30"); t->DrawLatex(0.15,0.45,"45"); t->DrawLatex(0.24,0.41,"60"); t->DrawLatex(0.32,0.29,"100"); t->DrawLatex(0.41,0.20,"150"); t->DrawLatex(0.18,0.34,"1.0% H2"); c1->SaveAs("gg11n.pdf"); }