void detector_hit33(){ 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 st[6]; Double_t er_st[6]; Double_t tagh_ps[6]; Double_t er_tagh_ps[6]; Double_t tof[6]; Double_t tof_ps[6]; Double_t tof_tdc[6]; Double_t tof_tdc_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 *tagh_500 = (TH1F*)f_500.Get("tagh_hits"); TH1F *tagh_ps_500 = (TH1F*)f_500.Get("tagh_hits_ps"); TH1F *tof_500 = (TH1F*)f_500.Get("tof_hits"); TH1F *tof_ps_500 = (TH1F*)f_500.Get("tof_hits_ps"); TH1F *tof_tdc_500 = (TH1F*)f_500.Get("tof_tdc_hits"); TH1F *tof_tdc_ps_500 = (TH1F*)f_500.Get("tof_tdc_hits_ps"); TH1F *tagh_400 = (TH1F*)f_400.Get("tagh_hits"); TH1F *tagh_ps_400 = (TH1F*)f_400.Get("tagh_hits_ps"); TH1F *tof_400 = (TH1F*)f_400.Get("tof_hits"); TH1F *tof_ps_400 = (TH1F*)f_400.Get("tof_hits_ps"); TH1F *tof_tdc_400 = (TH1F*)f_400.Get("tof_tdc_hits"); TH1F *tof_tdc_ps_400 = (TH1F*)f_400.Get("tof_tdc_hits_ps"); TH1F *tagh_300 = (TH1F*)f_300.Get("tagh_hits"); TH1F *tagh_ps_300 = (TH1F*)f_300.Get("tagh_hits_ps"); TH1F *tof_300 = (TH1F*)f_300.Get("tof_hits"); TH1F *tof_ps_300 = (TH1F*)f_300.Get("tof_hits_ps"); TH1F *tof_tdc_300 = (TH1F*)f_300.Get("tof_tdc_hits"); TH1F *tof_tdc_ps_300 = (TH1F*)f_300.Get("tof_tdc_hits_ps"); TH1F *tagh_200 = (TH1F*)f_200.Get("tagh_hits"); TH1F *tagh_ps_200 = (TH1F*)f_200.Get("tagh_hits_ps"); TH1F *tof_200 = (TH1F*)f_200.Get("tof_hits"); TH1F *tof_ps_200 = (TH1F*)f_200.Get("tof_hits_ps"); TH1F *tof_tdc_200 = (TH1F*)f_200.Get("tof_tdc_hits"); TH1F *tof_tdc_ps_200 = (TH1F*)f_200.Get("tof_tdc_hits_ps"); TH1F *tagh_100 = (TH1F*)f_100.Get("tagh_hits"); TH1F *tagh_ps_100 = (TH1F*)f_100.Get("tagh_hits_ps"); TH1F *tof_100 = (TH1F*)f_100.Get("tof_hits"); TH1F *tof_ps_100 = (TH1F*)f_100.Get("tof_hits_ps"); TH1F *tof_tdc_100 = (TH1F*)f_100.Get("tof_tdc_hits"); TH1F *tof_tdc_ps_100 = (TH1F*)f_100.Get("tof_tdc_hits_ps"); TH1F *tagh_50 = (TH1F*)f_50.Get("tagh_hits"); TH1F *tagh_ps_50 = (TH1F*)f_50.Get("tagh_hits_ps"); TH1F *tof_50 = (TH1F*)f_50.Get("tof_hits"); TH1F *tof_ps_50 = (TH1F*)f_50.Get("tof_hits_ps"); TH1F *tof_tdc_50 = (TH1F*)f_50.Get("tof_tdc_hits"); TH1F *tof_tdc_ps_50 = (TH1F*)f_50.Get("tof_tdc_hits_ps"); st[0] = tagh_50->GetMean(1); st[1] = tagh_100->GetMean(1); st[2] = tagh_200->GetMean(1); st[3] = tagh_300->GetMean(1); st[4] = tagh_400->GetMean(1); st[5] = tagh_500->GetMean(1); tagh_ps[0] = tagh_ps_50->GetMean(1); tagh_ps[1] = tagh_ps_100->GetMean(1); tagh_ps[2] = tagh_ps_200->GetMean(1); tagh_ps[3] = tagh_ps_300->GetMean(1); tagh_ps[4] = tagh_ps_400->GetMean(1); tagh_ps[5] = tagh_ps_500->GetMean(1); tof[0] = tof_50->GetMean(1); tof[1] = tof_100->GetMean(1); tof[2] = tof_200->GetMean(1); tof[3] = tof_300->GetMean(1); tof[4] = tof_400->GetMean(1); tof[5] = tof_500->GetMean(1); tof_ps[0] = tof_ps_50->GetMean(1); tof_ps[1] = tof_ps_100->GetMean(1); tof_ps[2] = tof_ps_200->GetMean(1); tof_ps[3] = tof_ps_300->GetMean(1); tof_ps[4] = tof_ps_400->GetMean(1); tof_ps[5] = tof_ps_500->GetMean(1); tof_tdc[0] = tof_tdc_50->GetMean(1); tof_tdc[1] = tof_tdc_100->GetMean(1); tof_tdc[2] = tof_tdc_200->GetMean(1); tof_tdc[3] = tof_tdc_300->GetMean(1); tof_tdc[4] = tof_tdc_400->GetMean(1); tof_tdc[5] = tof_tdc_500->GetMean(1); tof_tdc_ps[0] = tof_tdc_ps_50->GetMean(1); tof_tdc_ps[1] = tof_tdc_ps_100->GetMean(1); tof_tdc_ps[2] = tof_tdc_ps_200->GetMean(1); tof_tdc_ps[3] = tof_tdc_ps_300->GetMean(1); tof_tdc_ps[4] = tof_tdc_ps_400->GetMean(1); tof_tdc_ps[5] = tof_tdc_ps_500->GetMean(1); cout << tagh_ps_500->GetMean(1) << " " << tagh_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); TGraph *gr_tof = new TGraph(6, x, tof); gr_tof->GetXaxis()->SetRangeUser(0.,550); gr_tof->GetYaxis()->SetRangeUser(0.,140); gr_tof->SetTitle("Hit multiplicity"); gr_tof->GetXaxis()->SetTitle(" (nA)"); gr_tof->GetYaxis()->SetTitle("Number of hits"); gr_tof->SetMarkerStyle(21); gr_tof->SetMarkerSize(1.0); gr_tof->SetMarkerColor(4); gr_tof->Draw("APL"); TGraph *gr_tof_tdc = new TGraph(6, x, tof_tdc); gr_tof_tdc->SetMarkerStyle(22); gr_tof_tdc->SetMarkerSize(1.0); gr_tof_tdc->SetMarkerColor(4); gr_tof_tdc->Draw("PLsame"); TLatex *text1 = new TLatex(); text1 -> SetTextFont(22); text1 -> SetTextColor(1); text1 -> SetTextSize(0.05); text1 -> SetTextAlign(22); text1 -> SetTextAngle(0); text1 -> DrawLatex(200, 110, "FCAL & BCAL & ST 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_tof_ps = new TGraph(6, x, tof_ps); gr_tof_ps->GetXaxis()->SetRangeUser(0.,550); gr_tof_ps->GetYaxis()->SetRangeUser(0.,140); gr_tof_ps->SetMarkerStyle(21); gr_tof_ps->SetMarkerSize(1.0); gr_tof_ps->SetMarkerColor(4); gr_tof_ps->Draw("APL"); TGraph *gr_tof_tdc_ps = new TGraph(6, x, tof_tdc_ps); gr_tof_tdc_ps->SetMarkerStyle(22); gr_tof_tdc_ps->SetMarkerSize(1.0); gr_tof_tdc_ps->SetMarkerColor(4); gr_tof_tdc_ps->Draw("PLsame"); gr_tof_ps->SetTitle("Hit multiplicity"); gr_tof_ps->GetXaxis()->SetTitle(" (nA)"); gr_tof_ps->GetYaxis()->SetTitle("Number of hits"); text1 -> DrawLatex(190, 110, "PS Trigger (Coincidentals)"); leg = new TLegend(0.2,0.65,0.5,0.85); leg->SetFillColor(0); leg->SetTextSize(0.035); leg->AddEntry(gr_tof,"TOF fadc250 ","p"); leg->AddEntry(gr_tof_tdc,"TOF 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 tagh_fr[6], tof_fr[6], tof_tdc_fr[6]; Double_t tagh_sig[6], tof_sig[6], tof_tdc_sig[6]; for(int ss = 0; ss < 6; ss++){ // tagh_fr[ss] = (st[ss] - tagh_ps[ss])/st[ss]; // tof_fr[ss] = (tof[ss] - tof_ps[ss])/tof[ss]; // tof_tdc_fr[ss] = (tof_tdc[ss] - tof_tdc_ps[ss])/tof_tdc[ss]; tagh_fr[ss] = (tagh_ps[ss])/st[ss]; tof_fr[ss] = (tof_ps[ss])/tof[ss]; tof_tdc_fr[ss] = (tof_tdc_ps[ss])/tof_tdc[ss]; tagh_sig[ss] = st[ss] - tagh_ps[ss]; tof_sig[ss] = tof[ss] - tof_ps[ss]; tof_tdc_sig[ss] = tof_tdc[ss] - tof_tdc_ps[ss]; } TGraph *gr_tagh_fr = new TGraph(6, x, tagh_fr); gr_tagh_fr->SetMarkerStyle(20); gr_tagh_fr->SetMarkerSize(1.0); gr_tagh_fr->SetMarkerColor(2); TGraph *gr_tof_fr = new TGraph(6, x, tof_fr); gr_tof_fr->SetTitle("Coincidental fraction"); gr_tof_fr->GetXaxis()->SetTitle("Current (nA)"); gr_tof_fr->GetYaxis()->SetTitle("N_{COIN} / N_{TOT}"); gr_tof_fr->GetXaxis()->SetRangeUser(0.,550); gr_tof_fr->GetYaxis()->SetRangeUser(0.,1); gr_tof_fr->SetMarkerStyle(21); gr_tof_fr->SetMarkerSize(1.0); gr_tof_fr->SetMarkerColor(4); gr_tof_fr->Draw("APL"); TGraph *gr_tof_tdc_fr = new TGraph(6, x, tof_tdc_fr); gr_tof_tdc_fr->SetMarkerStyle(22); gr_tof_tdc_fr->SetMarkerSize(1.0); gr_tof_tdc_fr->SetMarkerColor(4); gr_tof_tdc_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_tof_sig = new TGraph(6, x, tof_sig); gr_tof_sig->GetXaxis()->SetRangeUser(0.,550); gr_tof_sig->GetYaxis()->SetRangeUser(0.,30); gr_tof_sig->SetMarkerStyle(21); gr_tof_sig->SetMarkerSize(1.0); gr_tof_sig->SetMarkerColor(4); gr_tof_sig->Draw("APL"); TGraph *gr_tof_tdc_sig = new TGraph(6, x, tof_tdc_sig); gr_tof_tdc_sig->SetMarkerStyle(22); gr_tof_tdc_sig->SetMarkerSize(1.0); gr_tof_tdc_sig->SetMarkerColor(4); gr_tof_tdc_sig->Draw("PLsame"); gr_tof_sig->SetTitle("Multiplicity (BG subtracted) "); gr_tof_sig->GetXaxis()->SetTitle("Current (nA)"); gr_tof_sig->GetYaxis()->SetTitle("Number of hits"); text1->SetTextSize(0.045); text1->DrawLatex(220, 22, "FCAL & BCAL & ST Trigger"); }