void trig_rate(){ gROOT->Reset(); gROOT->SetStyle("Plain"); gROOT->ForceStyle(); gStyle->SetOptStat(0); gStyle->SetOptFit(0); gStyle->SetTitleX(0.1f); gStyle->SetTitleW(0.8f); gStyle->SetLineWidth(1.5); gStyle->SetTextSize(1.5); gStyle->SetTitleFont(132,"xy"); gStyle->SetLabelFont(132,"xy"); // gStyle->SetLabelFont(62,"xy"); // gStyle->SetLabelSize(0.073,"xy"); gStyle->SetLabelSize(0.05,"xy"); gStyle->SetTitleSize(0.052,"xy"); gStyle->SetTitleOffset(1.0,"x"); gStyle->SetTitleOffset(1.2,"y"); gStyle->SetTitleBorderSize(0); Double_t x[6] = {50, 100, 200, 300, 400, 500}; Double_t ex[6]; Double_t rate_spring[6] = {13.1, 27.4, 54., 86.9, 119.7, 154.6 }; Double_t ps_rate_spring[6] = {0.83, 1.74, 3.3, 5.2, 7.0, 8.8 }; Double_t rate[6] = {11.0, 23.6, 46.7, 73., 99.2, 125. }; Double_t ps_rate[6] = {0.909, 1.891, 3.62, 5.63, 7.39, 9.33 }; Double_t rate_st[6] = {6.4, 12.5, 27.2, 42.3, 61., 82. }; Double_t ps_rate_st[6] = {0.935, 1.855, 3.72, 5.52, 7.51, 9.4 } ; float cc = 0; float cc1 = 0; for(int ss = 0; ss < 6; ss++){ rate_spring[ss] = rate_spring[ss]*ps_rate[ss]/ps_rate_spring[ss]; cout << rate_spring[ss]/rate[ss] << endl; cc += rate_spring[ss]/rate[ss]; cc1 += rate_st[ss]/rate[ss]; } cout << cc/6 << " " << cc1/6 << endl; TGraph *gr_spring = new TGraph(6, x, rate_spring); TGraph *gr_spring1 = new TGraph(6, ps_rate_spring, rate_spring); TGraph *gr = new TGraph(6, x, rate); TGraph *gr1 = new TGraph(6, ps_rate, rate); TGraph *gr_ps = new TGraph(6, x, ps_rate); TGraph *gr_st = new TGraph(6, x, rate_st); TGraph *gr_st1 = new TGraph(6, ps_rate_st, rate_st); TGraph *gr_ps_st = new TGraph(6, x, ps_rate_st); TCanvas *c1 = new TCanvas("c1","c1",200,10, 900, 500); c1->Divide(2,1,0,0); c1->cd(1); gPad->SetBottomMargin(0.19); gPad->SetTopMargin(0.1); gPad->SetLeftMargin(0.15); gPad->SetRightMargin(0.015); gPad->SetGrid(1); gr_spring->SetMarkerStyle(20); gr_spring->SetMarkerSize(0.9); gr_spring->SetMarkerColor(1); gr_spring->SetMaximum(180); // TF1 *f1 = new TF1("f1","[0]*x"); // gr_spring->Fit("f1"); gr_spring->Draw("APL"); gr_spring->SetTitle("Physics Trigger"); gr_spring->GetXaxis()->SetTitle("Current (nA)"); gr_spring->GetYaxis()->SetTitle("Rate (kHz)"); gr->SetMarkerStyle(21); gr->SetMarkerSize(0.9); gr->SetMarkerColor(2); gr->SetMaximum(170); gr->Draw("plsame"); gr_st->SetMarkerStyle(22); gr_st->SetMarkerSize(0.9); gr_st->SetMarkerColor(4); gr_st->Draw("plsame"); leg = new TLegend(0.2,0.65,0.65,0.85); leg->SetFillColor(0); leg->SetTextSize(0.03); leg->AddEntry(gr_spring,"Spring Production ","p"); leg->AddEntry(gr,"New FCAL & BCAL","p"); leg->AddEntry(gr_st,"New FCAL & BCAL & ST ","p"); leg->Draw(); c1->cd(2); gPad->SetBottomMargin(0.19); gPad->SetTopMargin(0.1); gPad->SetLeftMargin(0.15); gPad->SetRightMargin(0.015); gPad->SetGrid(1); gr_ps->SetMarkerStyle(21); gr_ps->SetMarkerSize(0.9); gr_ps->SetMarkerColor(2); gr_ps->SetMaximum(15); gr_ps->SetTitle("PS Trigger"); gr_ps->Draw("APL"); gr_ps->GetXaxis()->SetTitle("Current (nA)"); TCanvas *c2 = new TCanvas("c2","c2",200,10, 600, 500); gPad->SetBottomMargin(0.19); gPad->SetTopMargin(0.1); gPad->SetLeftMargin(0.15); gPad->SetRightMargin(0.015); gPad->SetGrid(1); gr_spring1->SetMarkerStyle(20); gr_spring1->SetMarkerSize(0.9); gr_spring1->SetMarkerColor(1); gr_spring1->SetMaximum(180); // TF1 *f1 = new TF1("f1","[0]*x"); // gr_spring->Fit("f1"); gr_spring1->Draw("APL"); gr_spring1->SetTitle("Physics Trigger"); gr_spring1->GetXaxis()->SetTitle("PS rate (kHz)"); gr_spring1->GetYaxis()->SetTitle("Rate (kHz)"); gr1->SetMarkerStyle(21); gr1->SetMarkerSize(0.9); gr1->SetMarkerColor(2); gr1->SetMaximum(170); gr1->Draw("plsame"); gr_st1->SetMarkerStyle(22); gr_st1->SetMarkerSize(0.9); gr_st1->SetMarkerColor(4); gr_st1->Draw("plsame"); leg = new TLegend(0.2,0.6,0.6,0.85); leg->SetFillColor(0); leg->SetTextSize(0.035); leg->AddEntry(gr_spring1,"Spring Production ","p"); leg->AddEntry(gr1,"New FCAL & BCAL","p"); leg->AddEntry(gr_st1,"New FCAL & BCAL & ST ","p"); leg->Draw(); TCanvas *c3 = new TCanvas("c3","c3",200,10, 600, 500); gPad->SetBottomMargin(0.19); gPad->SetTopMargin(0.1); gPad->SetLeftMargin(0.15); gPad->SetRightMargin(0.015); gPad->SetGrid(1); gr_spring->SetMarkerStyle(20); gr_spring->SetMarkerSize(0.9); gr_spring->SetMarkerColor(1); gr_spring->SetMaximum(180); // TF1 *f1 = new TF1("f1","[0]*x"); // gr_spring->Fit("f1"); gr_spring->Draw("APL"); gr_spring->SetTitle("Physics Trigger"); gr_spring->GetXaxis()->SetTitle("Current (nA)"); gr_spring->GetYaxis()->SetTitle("Rate (kHz)"); gr->SetMarkerStyle(21); gr->SetMarkerSize(0.9); gr->SetMarkerColor(2); gr->SetMaximum(170); gr->Draw("plsame"); gr_st->SetMarkerStyle(22); gr_st->SetMarkerSize(0.9); gr_st->SetMarkerColor(4); gr_st->Draw("plsame"); leg = new TLegend(0.2,0.65,0.6,0.85); leg->SetFillColor(0); leg->SetTextSize(0.035); leg->AddEntry(gr_spring,"Spring Production ","p"); leg->AddEntry(gr,"New FCAL & BCAL","p"); leg->AddEntry(gr_st,"New FCAL & BCAL & ST ","p"); leg->Draw(); TCanvas *c4 = new TCanvas("c4","c4",200,10, 600, 500); gPad->SetBottomMargin(0.19); gPad->SetTopMargin(0.1); gPad->SetLeftMargin(0.15); gPad->SetRightMargin(0.015); gPad->SetGrid(1); gr_ps->SetMarkerStyle(21); gr_ps->SetMarkerSize(0.9); gr_ps->SetMarkerColor(2); gr_ps->SetMaximum(15); gr_ps->SetTitle("PS Trigger"); gr_ps->Draw("APL"); gr_ps->GetYaxis()->SetTitle("Rate (kHz)"); gr_ps->GetXaxis()->SetTitle("Current (nA)"); }