void detector_hit2(){ 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.065,"xy"); gStyle->SetTitleOffset(1.0,"x"); gStyle->SetTitleOffset(1.,"y"); gStyle->SetTitleBorderSize(0); gStyle->SetTitleSize(0.06,"t"); Double_t x[6] = {50, 100, 200, 300, 400, 500}; Double_t fcal[6]; Double_t er_fcal[6]; Double_t fcal_ps[6]; Double_t er_fcal_ps[6]; Double_t bcal[6]; Double_t bcal_ps[6]; Double_t bcal_f1[6]; Double_t bcal_f1_ps[6]; // TFile f_500("run22084.root"); TFile f_500("run22105.root"); // TFile f_500("run22104.root"); TFile f_400("run22102.root"); // TFile f_400("run22103.root"); TFile f_300("run22106.root"); // TFile f_300("run22108.root"); TFile f_200("run22110.root"); // TFile f_200("run22109.root"); TFile f_100("run22111.root"); // TFile f_100("run22112.root"); TFile f_50("run22114.root"); // TFile f_50("run22113.root"); TH1F *fcal_500 = (TH1F*)f_500.Get("fcal_hits"); TH1F *fcal_ps_500 = (TH1F*)f_500.Get("fcal_hits_ps"); TH1F *bcal_500 = (TH1F*)f_500.Get("bcal_hits"); TH1F *bcal_ps_500 = (TH1F*)f_500.Get("bcal_hits_ps"); TH1F *bcal_f1_500 = (TH1F*)f_500.Get("bcal_f1_hits"); TH1F *bcal_f1_ps_500 = (TH1F*)f_500.Get("bcal_f1_hits_ps"); TH1F *fcal_400 = (TH1F*)f_400.Get("fcal_hits"); TH1F *fcal_ps_400 = (TH1F*)f_400.Get("fcal_hits_ps"); TH1F *bcal_400 = (TH1F*)f_400.Get("bcal_hits"); TH1F *bcal_ps_400 = (TH1F*)f_400.Get("bcal_hits_ps"); TH1F *bcal_f1_400 = (TH1F*)f_400.Get("bcal_f1_hits"); TH1F *bcal_f1_ps_400 = (TH1F*)f_400.Get("bcal_f1_hits_ps"); TH1F *fcal_300 = (TH1F*)f_300.Get("fcal_hits"); TH1F *fcal_ps_300 = (TH1F*)f_300.Get("fcal_hits_ps"); TH1F *bcal_300 = (TH1F*)f_300.Get("bcal_hits"); TH1F *bcal_ps_300 = (TH1F*)f_300.Get("bcal_hits_ps"); TH1F *bcal_f1_300 = (TH1F*)f_300.Get("bcal_f1_hits"); TH1F *bcal_f1_ps_300 = (TH1F*)f_300.Get("bcal_f1_hits_ps"); TH1F *fcal_200 = (TH1F*)f_200.Get("fcal_hits"); TH1F *fcal_ps_200 = (TH1F*)f_200.Get("fcal_hits_ps"); TH1F *bcal_200 = (TH1F*)f_200.Get("bcal_hits"); TH1F *bcal_ps_200 = (TH1F*)f_200.Get("bcal_hits_ps"); TH1F *bcal_f1_200 = (TH1F*)f_200.Get("bcal_f1_hits"); TH1F *bcal_f1_ps_200 = (TH1F*)f_200.Get("bcal_f1_hits_ps"); TH1F *fcal_100 = (TH1F*)f_100.Get("fcal_hits"); TH1F *fcal_ps_100 = (TH1F*)f_100.Get("fcal_hits_ps"); TH1F *bcal_100 = (TH1F*)f_100.Get("bcal_hits"); TH1F *bcal_ps_100 = (TH1F*)f_100.Get("bcal_hits_ps"); TH1F *bcal_f1_100 = (TH1F*)f_100.Get("bcal_f1_hits"); TH1F *bcal_f1_ps_100 = (TH1F*)f_100.Get("bcal_f1_hits_ps"); TH1F *fcal_50 = (TH1F*)f_50.Get("fcal_hits"); TH1F *fcal_ps_50 = (TH1F*)f_50.Get("fcal_hits_ps"); TH1F *bcal_50 = (TH1F*)f_50.Get("bcal_hits"); TH1F *bcal_ps_50 = (TH1F*)f_50.Get("bcal_hits_ps"); TH1F *bcal_f1_50 = (TH1F*)f_50.Get("bcal_f1_hits"); TH1F *bcal_f1_ps_50 = (TH1F*)f_50.Get("bcal_f1_hits_ps"); fcal[0] = fcal_50->GetMean(1); fcal[1] = fcal_100->GetMean(1); fcal[2] = fcal_200->GetMean(1); fcal[3] = fcal_300->GetMean(1); fcal[4] = fcal_400->GetMean(1); fcal[5] = fcal_500->GetMean(1); fcal_ps[0] = fcal_ps_50->GetMean(1); fcal_ps[1] = fcal_ps_100->GetMean(1); fcal_ps[2] = fcal_ps_200->GetMean(1); fcal_ps[3] = fcal_ps_300->GetMean(1); fcal_ps[4] = fcal_ps_400->GetMean(1); fcal_ps[5] = fcal_ps_500->GetMean(1); bcal[0] = bcal_50->GetMean(1); bcal[1] = bcal_100->GetMean(1); bcal[2] = bcal_200->GetMean(1); bcal[3] = bcal_300->GetMean(1); bcal[4] = bcal_400->GetMean(1); bcal[5] = bcal_500->GetMean(1); bcal_ps[0] = bcal_ps_50->GetMean(1); bcal_ps[1] = bcal_ps_100->GetMean(1); bcal_ps[2] = bcal_ps_200->GetMean(1); bcal_ps[3] = bcal_ps_300->GetMean(1); bcal_ps[4] = bcal_ps_400->GetMean(1); bcal_ps[5] = bcal_ps_500->GetMean(1); bcal_f1[0] = bcal_f1_50->GetMean(1); bcal_f1[1] = bcal_f1_100->GetMean(1); bcal_f1[2] = bcal_f1_200->GetMean(1); bcal_f1[3] = bcal_f1_300->GetMean(1); bcal_f1[4] = bcal_f1_400->GetMean(1); bcal_f1[5] = bcal_f1_500->GetMean(1); bcal_f1_ps[0] = bcal_f1_ps_50->GetMean(1); bcal_f1_ps[1] = bcal_f1_ps_100->GetMean(1); bcal_f1_ps[2] = bcal_f1_ps_200->GetMean(1); bcal_f1_ps[3] = bcal_f1_ps_300->GetMean(1); bcal_f1_ps[4] = bcal_f1_ps_400->GetMean(1); bcal_f1_ps[5] = bcal_f1_ps_500->GetMean(1); cout << fcal_ps_500->GetMean(1) << " " << fcal_ps_500->GetRMS(1) << endl; TCanvas *c1 = new TCanvas("c1","Cosmic",200,10, 800, 700); c1->Divide(2,2,0,0); c1->cd(1); gPad->SetBottomMargin(0.19); gPad->SetTopMargin(0.1); gPad->SetLeftMargin(0.15); gPad->SetRightMargin(0.015); gPad->SetGrid(1); // fadc_500->GetXaxis()->SetNdivisions(508); // fadc_500->GetXaxis()->SetRangeUser(10.,96.); // fadc_500->GetYaxis()->SetRangeUser(0.,190); TGraph *gr_fcal = new TGraph(6, x, fcal); gr_fcal->SetMarkerStyle(20); gr_fcal->SetMarkerSize(1.0); gr_fcal->SetMarkerColor(2); gr_fcal->GetXaxis()->SetRangeUser(0.,550); gr_fcal->GetYaxis()->SetRangeUser(0.,120); gr_fcal->SetTitle("Hit multiplicity"); gr_fcal->GetXaxis()->SetTitle(" (nA)"); gr_fcal->GetYaxis()->SetTitle("Number of hits"); gr_fcal->Draw("APL"); TGraph *gr_bcal = new TGraph(6, x, bcal); gr_bcal->SetMarkerStyle(21); gr_bcal->SetMarkerSize(1.0); gr_bcal->SetMarkerColor(4); gr_bcal->Draw("PLsame"); TGraph *gr_bcal_f1 = new TGraph(6, x, bcal_f1); gr_bcal_f1->SetMarkerStyle(22); gr_bcal_f1->SetMarkerSize(1.0); gr_bcal_f1->SetMarkerColor(4); gr_bcal_f1->Draw("PLsame"); TLatex *text1 = new TLatex(); text1 -> SetTextFont(22); text1 -> SetTextColor(1); text1 -> SetTextSize(0.05); text1 -> SetTextAlign(22); text1 -> SetTextAngle(0); text1 -> DrawLatex(150, 90, "FCAL & BCAL Trigger"); c1->cd(2); gPad->SetBottomMargin(0.19); gPad->SetTopMargin(0.1); gPad->SetLeftMargin(0.15); gPad->SetRightMargin(0.015); gPad->SetGrid(1); TGraph *gr_fcal_ps = new TGraph(6, x, fcal_ps); gr_fcal_ps->SetMarkerStyle(20); gr_fcal_ps->SetMarkerSize(1.0); gr_fcal_ps->SetMarkerColor(2); gr_fcal_ps->GetXaxis()->SetRangeUser(0.,550); gr_fcal_ps->GetYaxis()->SetRangeUser(0.,37); gr_fcal_ps->Draw("APL"); TGraph *gr_bcal_ps = new TGraph(6, x, bcal_ps); gr_bcal_ps->SetMarkerStyle(21); gr_bcal_ps->SetMarkerSize(1.0); gr_bcal_ps->SetMarkerColor(4); gr_bcal_ps->Draw("PLsame"); TGraph *gr_bcal_f1_ps = new TGraph(6, x, bcal_f1_ps); gr_bcal_f1_ps->SetMarkerStyle(22); gr_bcal_f1_ps->SetMarkerSize(1.0); gr_bcal_f1_ps->SetMarkerColor(4); gr_bcal_f1_ps->Draw("PLsame"); gr_fcal_ps->SetTitle("Hit multiplicity"); gr_fcal_ps->GetXaxis()->SetTitle(" (nA)"); gr_fcal_ps->GetYaxis()->SetTitle("Number of hits"); text1 -> DrawLatex(190, 27, "PS Trigger (Coincidentals)"); leg = new TLegend(0.2,0.65,0.5,0.85); leg->SetFillColor(0); leg->SetTextSize(0.035); leg->AddEntry(gr_fcal,"FCAL ","p"); leg->AddEntry(gr_bcal,"BCAL FADC250 ","p"); leg->AddEntry(gr_bcal_f1,"BCAL TDC ","p"); leg->Draw(); c1->cd(3); gPad->SetBottomMargin(0.19); gPad->SetTopMargin(0.1); gPad->SetLeftMargin(0.15); gPad->SetRightMargin(0.015); gPad->SetGrid(1); Double_t fcal_fr[6], bcal_fr[6], bcal_f1_fr[6]; Double_t fcal_sig[6], bcal_sig[6], bcal_f1_sig[6]; for(int ss = 0; ss < 6; ss++){ // fcal_fr[ss] = (fcal[ss] - fcal_ps[ss])/fcal[ss]; // bcal_fr[ss] = (bcal[ss] - bcal_ps[ss])/bcal[ss]; // bcal_f1_fr[ss] = (bcal_f1[ss] - bcal_f1_ps[ss])/bcal_f1[ss]; fcal_fr[ss] = (fcal_ps[ss])/fcal[ss]; bcal_fr[ss] = (bcal_ps[ss])/bcal[ss]; bcal_f1_fr[ss] = (bcal_f1_ps[ss])/bcal_f1[ss]; fcal_sig[ss] = fcal[ss] - fcal_ps[ss]; bcal_sig[ss] = bcal[ss] - bcal_ps[ss]; bcal_f1_sig[ss] = bcal_f1[ss] - bcal_f1_ps[ss]; } TGraph *gr_fcal_fr = new TGraph(6, x, fcal_fr); gr_fcal_fr->SetMarkerStyle(20); gr_fcal_fr->SetMarkerSize(1.0); gr_fcal_fr->SetMarkerColor(2); gr_fcal_fr->GetXaxis()->SetRangeUser(0.,550); gr_fcal_fr->GetYaxis()->SetRangeUser(0.,1); gr_fcal_fr->SetTitle("Coincidental fraction"); gr_fcal_fr->GetXaxis()->SetTitle("Current (nA)"); gr_fcal_fr->GetYaxis()->SetTitle("N_{COIN} / N_{TOT}"); gr_fcal_fr->Draw("APL"); TGraph *gr_bcal_fr = new TGraph(6, x, bcal_fr); gr_bcal_fr->SetMarkerStyle(21); gr_bcal_fr->SetMarkerSize(1.0); gr_bcal_fr->SetMarkerColor(4); gr_bcal_fr->Draw("PLsame"); TGraph *gr_bcal_f1_fr = new TGraph(6, x, bcal_f1_fr); gr_bcal_f1_fr->SetMarkerStyle(22); gr_bcal_f1_fr->SetMarkerSize(1.0); gr_bcal_f1_fr->SetMarkerColor(4); gr_bcal_f1_fr->Draw("PLsame"); c1->cd(4); gPad->SetBottomMargin(0.19); gPad->SetTopMargin(0.1); gPad->SetLeftMargin(0.15); gPad->SetRightMargin(0.015); gPad->SetGrid(1); TGraph *gr_fcal_sig = new TGraph(6, x, fcal_sig); gr_fcal_sig->SetMarkerStyle(20); gr_fcal_sig->SetMarkerSize(1.0); gr_fcal_sig->SetMarkerColor(2); gr_fcal_sig->GetXaxis()->SetRangeUser(0.,550); gr_fcal_sig->GetYaxis()->SetRangeUser(0.,80); gr_fcal_sig->Draw("APL"); TGraph *gr_bcal_sig = new TGraph(6, x, bcal_sig); gr_bcal_sig->SetMarkerStyle(21); gr_bcal_sig->SetMarkerSize(1.0); gr_bcal_sig->SetMarkerColor(4); gr_bcal_sig->Draw("PLsame"); TGraph *gr_bcal_f1_sig = new TGraph(6, x, bcal_f1_sig); gr_bcal_f1_sig->SetMarkerStyle(22); gr_bcal_f1_sig->SetMarkerSize(1.0); gr_bcal_f1_sig->SetMarkerColor(4); gr_bcal_f1_sig->Draw("PLsame"); gr_fcal_sig->SetTitle("Multiplicity (BG subtracted)"); gr_fcal_sig->GetXaxis()->SetTitle("Current (nA)"); gr_fcal_sig->GetYaxis()->SetTitle("Number of hits"); text1->SetTextSize(0.045); text1->DrawLatex(200, 65, "FCAL & BCAL Trigger"); }