void ll2() { 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(); gStyle->SetOptDate(0); gStyle->SetGridStyle(1); gStyle->SetGridColor(kGray); gStyle->SetOptTitle(0); pad1 = new TPad("pad1","This is pad1",0.02,0.02,0.48,0.83,33); pad1->SetLogy(); pad1->SetFillColor(0); pad2 = new TPad("pad2","This is pad2",0.52,0.02,0.98,0.83,33); pad1->Draw(); pad2->Draw(); pad1->cd(); // c1->SetLogx(); // c1->SetLogy(); 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] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1000000,10000000,1000000}; const Int_t n45=4, n60=7, n100=7, n150=6; Double_t r45a[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 g45a[n45] = {540.432, 992.376, 1332.65, 2515.87}; Double_t r60a[n60-2] = {(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 g60a[n60-2] = {229.129, 523.224, 1438.29, 3434.5, 8172.36 }; Double_t r100a[n100-1] = {(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 g100a[n100-1] = {121.916, 258.941, 536.4, 1264.41, 2448.42, 3637.44}; Double_t r150a[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.}; Double_t g150a[n150] = {140.563, 262.334, 493.56, 931.931, 1792.65, 3967.11}; const Int_t m150=7, m100=2; Double_t r150[m150] = {0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47}; Double_t g150[m150] = {187.344, 270.36, 397.872, 598.896, 967.032, 1485.94, 2245.82}; Double_t r100[m100] = {0.39, 0.40}; Double_t g100[m100] = {633.528, 1231.7}; Double_t a,b,c; gr = new TGraph(m,rr,ss); gr->SetLineColor(4); gr->SetLineWidth(4); gr->SetMarkerColor(4); gr->SetMarkerStyle(21); gr->SetTitle("Nphe vs #Delta GEM, kV "); gr->GetYaxis()->SetTitle("Nphe "); gr->GetXaxis()->SetTitle("#Delta GEM, kV "); gr->SetMaximum(51000.); gr->SetMinimum(50.); gr->Draw("AP"); gStyle->SetOptFit(000); gr3 = new TGraph(n45,r45a,g45a); gr3->SetLineColor(1); gr3->SetLineWidth(2); gr3->SetMarkerColor(1); gr3->SetMarkerStyle(21); gr3->Draw("P"); gr3->Fit("expo"); gr3->GetFunction("expo")->SetLineWidth(1); gr3->GetFunction("expo")->SetLineColor(1); gr3->GetFunction("expo")->SetLineStyle(1); a = gr3->GetFunction("expo")->GetParameter("Constant"); b = gr3->GetFunction("expo")->GetParameter("Slope"); c = 45.; fout<SetLineColor(1); gr4->SetLineWidth(2); gr4->SetMarkerColor(1); gr4->SetMarkerStyle(21); gr4->Draw("P"); gr4->Fit("expo"); gr4->GetFunction("expo")->SetLineWidth(1); gr4->GetFunction("expo")->SetLineColor(1); gr4->GetFunction("expo")->SetLineStyle(2); a = gr4->GetFunction("expo")->GetParameter("Constant"); b = gr4->GetFunction("expo")->GetParameter("Slope"); c = 60.; fout<SetLineColor(1); gr5->SetLineWidth(2); gr5->SetMarkerColor(1); gr5->SetMarkerStyle(21); gr5->Draw("P"); gr5->Fit("expo"); gr5->GetFunction("expo")->SetLineWidth(1); gr5->GetFunction("expo")->SetLineColor(1); gr5->GetFunction("expo")->SetLineStyle(3); a = gr5->GetFunction("expo")->GetParameter("Constant"); b = gr5->GetFunction("expo")->GetParameter("Slope"); c = 100.; fout<SetLineColor(1); gr6->SetLineWidth(2); gr6->SetMarkerColor(1); gr6->SetMarkerStyle(21); gr6->Draw("P"); gr6->Fit("expo"); gr6->GetFunction("expo")->SetLineWidth(1); gr6->GetFunction("expo")->SetLineColor(1); gr6->GetFunction("expo")->SetLineStyle(4); a = gr6->GetFunction("expo")->GetParameter("Constant"); b = gr6->GetFunction("expo")->GetParameter("Slope"); c = 150.; fout<SetLineColor(1); gr7->SetLineWidth(2); gr7->SetMarkerColor(1); gr7->SetMarkerStyle(25); gr7->Draw("P"); gr7->Fit("expo"); gr7->GetFunction("expo")->SetLineWidth(1); gr7->GetFunction("expo")->SetLineColor(1); gr7->GetFunction("expo")->SetLineStyle(5); a = gr7->GetFunction("expo")->GetParameter("Constant"); b = gr7->GetFunction("expo")->GetParameter("Slope"); c = 100.; fout<SetLineColor(1); gr8->SetLineWidth(2); gr8->SetMarkerColor(1); gr8->SetMarkerStyle(25); gr8->Draw("P"); gr8->Fit("expo"); gr8->GetFunction("expo")->SetLineWidth(1); gr8->GetFunction("expo")->SetLineColor(1); gr8->GetFunction("expo")->SetLineStyle(6); a = gr8->GetFunction("expo")->GetParameter("Constant"); b = gr8->GetFunction("expo")->GetParameter("Slope"); c = 150.; fout<SetNDC(); t->SetTextFont(32); t->SetTextAlign(12); t->SetTextSize(0.04); t->SetTextColor(1); t->DrawLatex(0.15,0.87,"Neon+0.1% H_{2} & 0.01% H_{2} T=293K"); t->DrawLatex(0.21,0.58,"45"); t->DrawLatex(0.30,0.75,"60"); t->DrawLatex(0.35,0.66,"100"); t->DrawLatex(0.45,0.68,"150"); t->DrawLatex(0.61,0.50,"100"); t->DrawLatex(0.76,0.59,"150"); t->DrawLatex(0.39,0.78,"0.1% H2"); t->DrawLatex(0.55,0.17,"0.01% H2"); pad2->cd(); pad2->SetFillColor(0); pad2->SetLogy(); const Int_t m1 = 20; Double_t rr1[m1] = {.170,.205,.210,.215,.220,.225,.230,.235,.240,.245, .250,.255,.260,.265,.270,.275,.280,.320,.390,.490}; Double_t ss1[m1] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1000000,10000000,1000000}; gr = new TGraph(m-2,rr1,ss1); gr->SetLineColor(4); gr->SetLineWidth(4); gr->SetMarkerColor(4); gr->SetMarkerStyle(21); gr->SetTitle("Nphe vs #Delta GEM, kV "); gr->GetYaxis()->SetTitle("Nphe "); gr->GetXaxis()->SetTitle("#Delta GEM, kV "); gr->SetMaximum(51000.); gr->SetMinimum(50.); gr->Draw("AP"); const Int_t k30=5, k45=4, k60=4, k100=3, k150=3; Double_t r30k[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 g30k[k30] = {115.246, 194.851, 310.896, 851.851, 2402.58}; Double_t r45k[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 g45k[k45] = {109.388, 360.76, 976.392, 2649.08}; Double_t r60k[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 g60k[k60] = {111.592, 311.576, 829.656, 2209.06}; Double_t r100k[k100] = {(0.2414+0.2376+0.2400)/3., (0.2507+0.2473+0.2497)/3., (0.2576+0.2621+0.2598)/3.}; Double_t g100k[k100] = {170.723, 437.112, 1138.57}; Double_t r150k[k150] = {(0.2771+0.2813+0.2796)/3., (0.2873+0.2913+0.2896)/3., (0.2982+0.3012+0.2994)/3.}; Double_t g150k[k150] = {87.58, 214.252, 483.652}; gr31 = new TGraph(k30,r30k,g30k); gr31->SetLineColor(1); gr31->SetLineWidth(2); gr31->SetMarkerColor(1); gr31->SetMarkerStyle(24); gr31->Draw("P"); gr31->Fit("expo"); gr31->GetFunction("expo")->SetLineWidth(1); gr31->GetFunction("expo")->SetLineColor(1); gr31->GetFunction("expo")->SetLineStyle(1); a = gr31->GetFunction("expo")->GetParameter("Constant"); b = gr31->GetFunction("expo")->GetParameter("Slope"); c = 30.; fout<SetLineColor(1); gr11->SetLineWidth(2); gr11->SetMarkerColor(1); gr11->SetMarkerStyle(24); gr11->Draw("P"); gr11->Fit("expo"); gr11->GetFunction("expo")->SetLineWidth(1); gr11->GetFunction("expo")->SetLineColor(1); gr11->GetFunction("expo")->SetLineStyle(2); a = gr11->GetFunction("expo")->GetParameter("Constant"); b = gr11->GetFunction("expo")->GetParameter("Slope"); c = 45.; fout<SetLineColor(1); gr41->SetLineWidth(2); gr41->SetMarkerColor(1); gr41->SetMarkerStyle(24); gr41->Draw("P"); gr41->Fit("expo"); gr41->GetFunction("expo")->SetLineWidth(1); gr41->GetFunction("expo")->SetLineColor(1); gr41->GetFunction("expo")->SetLineStyle(3); a = gr41->GetFunction("expo")->GetParameter("Constant"); b = gr41->GetFunction("expo")->GetParameter("Slope"); c = 60.; fout<SetLineColor(1); gr51->SetLineWidth(2); gr51->SetMarkerColor(1); gr51->SetMarkerStyle(24); gr51->Draw("P"); gr51->Fit("expo"); gr51->GetFunction("expo")->SetLineWidth(1); gr51->GetFunction("expo")->SetLineColor(1); gr51->GetFunction("expo")->SetLineStyle(4); a = gr51->GetFunction("expo")->GetParameter("Constant"); b = gr51->GetFunction("expo")->GetParameter("Slope"); c = 100.; fout<SetLineColor(1); gr61->SetLineWidth(2); gr61->SetMarkerColor(1); gr61->SetMarkerStyle(24); gr61->Draw("P"); gr61->Fit("expo"); gr61->GetFunction("expo")->SetLineWidth(1); gr61->GetFunction("expo")->SetLineColor(1); gr51->GetFunction("expo")->SetLineStyle(5); a = gr61->GetFunction("expo")->GetParameter("Constant"); b = gr61->GetFunction("expo")->GetParameter("Slope"); c = 150.; fout<SetTextColor(1); t->DrawLatex(0.15,0.87,"Neon+1.0% H_{2} T=293K"); t->DrawLatex(0.28,0.57,"30"); t->DrawLatex(0.38,0.59,"45"); t->DrawLatex(0.43,0.57,"60"); t->DrawLatex(0.50,0.3,"100"); t->DrawLatex(0.73,0.32,"150"); c1->SaveAs("ll2.pdf"); }