void detector_hit11(){ 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 cdc[6]; Double_t er_cdc[6]; Double_t cdc_ps[6]; Double_t er_cdc_ps[6]; Double_t fdc_wire[6]; Double_t fdc_wire_ps[6]; Double_t fdc_cath[6]; Double_t fdc_cath_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 *cdc_500 = (TH1F*)f_500.Get("cdc_hits"); TH1F *cdc_ps_500 = (TH1F*)f_500.Get("cdc_hits_ps"); TH1F *fdc_wire_500 = (TH1F*)f_500.Get("fdc_wire_hits"); TH1F *fdc_wire_ps_500 = (TH1F*)f_500.Get("fdc_wire_hits_ps"); TH1F *fdc_cath_500 = (TH1F*)f_500.Get("fdc_cath_hits"); TH1F *fdc_cath_ps_500 = (TH1F*)f_500.Get("fdc_cath_hits_ps"); TH1F *cdc_400 = (TH1F*)f_400.Get("cdc_hits"); TH1F *cdc_ps_400 = (TH1F*)f_400.Get("cdc_hits_ps"); TH1F *fdc_wire_400 = (TH1F*)f_400.Get("fdc_wire_hits"); TH1F *fdc_wire_ps_400 = (TH1F*)f_400.Get("fdc_wire_hits_ps"); TH1F *fdc_cath_400 = (TH1F*)f_400.Get("fdc_cath_hits"); TH1F *fdc_cath_ps_400 = (TH1F*)f_400.Get("fdc_cath_hits_ps"); TH1F *cdc_300 = (TH1F*)f_300.Get("cdc_hits"); TH1F *cdc_ps_300 = (TH1F*)f_300.Get("cdc_hits_ps"); TH1F *fdc_wire_300 = (TH1F*)f_300.Get("fdc_wire_hits"); TH1F *fdc_wire_ps_300 = (TH1F*)f_300.Get("fdc_wire_hits_ps"); TH1F *fdc_cath_300 = (TH1F*)f_300.Get("fdc_cath_hits"); TH1F *fdc_cath_ps_300 = (TH1F*)f_300.Get("fdc_cath_hits_ps"); TH1F *cdc_200 = (TH1F*)f_200.Get("cdc_hits"); TH1F *cdc_ps_200 = (TH1F*)f_200.Get("cdc_hits_ps"); TH1F *fdc_wire_200 = (TH1F*)f_200.Get("fdc_wire_hits"); TH1F *fdc_wire_ps_200 = (TH1F*)f_200.Get("fdc_wire_hits_ps"); TH1F *fdc_cath_200 = (TH1F*)f_200.Get("fdc_cath_hits"); TH1F *fdc_cath_ps_200 = (TH1F*)f_200.Get("fdc_cath_hits_ps"); TH1F *cdc_100 = (TH1F*)f_100.Get("cdc_hits"); TH1F *cdc_ps_100 = (TH1F*)f_100.Get("cdc_hits_ps"); TH1F *fdc_wire_100 = (TH1F*)f_100.Get("fdc_wire_hits"); TH1F *fdc_wire_ps_100 = (TH1F*)f_100.Get("fdc_wire_hits_ps"); TH1F *fdc_cath_100 = (TH1F*)f_100.Get("fdc_cath_hits"); TH1F *fdc_cath_ps_100 = (TH1F*)f_100.Get("fdc_cath_hits_ps"); TH1F *cdc_50 = (TH1F*)f_50.Get("cdc_hits"); TH1F *cdc_ps_50 = (TH1F*)f_50.Get("cdc_hits_ps"); TH1F *fdc_wire_50 = (TH1F*)f_50.Get("fdc_wire_hits"); TH1F *fdc_wire_ps_50 = (TH1F*)f_50.Get("fdc_wire_hits_ps"); TH1F *fdc_cath_50 = (TH1F*)f_50.Get("fdc_cath_hits"); TH1F *fdc_cath_ps_50 = (TH1F*)f_50.Get("fdc_cath_hits_ps"); cdc[0] = cdc_50->GetMean(1); cdc[1] = cdc_100->GetMean(1); cdc[2] = cdc_200->GetMean(1); cdc[3] = cdc_300->GetMean(1); cdc[4] = cdc_400->GetMean(1); cdc[5] = cdc_500->GetMean(1); cdc_ps[0] = cdc_ps_50->GetMean(1); cdc_ps[1] = cdc_ps_100->GetMean(1); cdc_ps[2] = cdc_ps_200->GetMean(1); cdc_ps[3] = cdc_ps_300->GetMean(1); cdc_ps[4] = cdc_ps_400->GetMean(1); cdc_ps[5] = cdc_ps_500->GetMean(1); fdc_wire[0] = fdc_wire_50->GetMean(1); fdc_wire[1] = fdc_wire_100->GetMean(1); fdc_wire[2] = fdc_wire_200->GetMean(1); fdc_wire[3] = fdc_wire_300->GetMean(1); fdc_wire[4] = fdc_wire_400->GetMean(1); fdc_wire[5] = fdc_wire_500->GetMean(1); fdc_wire_ps[0] = fdc_wire_ps_50->GetMean(1); fdc_wire_ps[1] = fdc_wire_ps_100->GetMean(1); fdc_wire_ps[2] = fdc_wire_ps_200->GetMean(1); fdc_wire_ps[3] = fdc_wire_ps_300->GetMean(1); fdc_wire_ps[4] = fdc_wire_ps_400->GetMean(1); fdc_wire_ps[5] = fdc_wire_ps_500->GetMean(1); fdc_cath[0] = fdc_cath_50->GetMean(1); fdc_cath[1] = fdc_cath_100->GetMean(1); fdc_cath[2] = fdc_cath_200->GetMean(1); fdc_cath[3] = fdc_cath_300->GetMean(1); fdc_cath[4] = fdc_cath_400->GetMean(1); fdc_cath[5] = fdc_cath_500->GetMean(1); fdc_cath_ps[0] = fdc_cath_ps_50->GetMean(1); fdc_cath_ps[1] = fdc_cath_ps_100->GetMean(1); fdc_cath_ps[2] = fdc_cath_ps_200->GetMean(1); fdc_cath_ps[3] = fdc_cath_ps_300->GetMean(1); fdc_cath_ps[4] = fdc_cath_ps_400->GetMean(1); fdc_cath_ps[5] = fdc_cath_ps_500->GetMean(1); cout << cdc_ps_500->GetMean(1) << " " << cdc_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_cdc = new TGraph(6, x, cdc); gr_cdc->SetMarkerStyle(20); gr_cdc->SetMarkerSize(1.0); gr_cdc->SetMarkerColor(2); gr_cdc->GetXaxis()->SetRangeUser(0.,550); gr_cdc->GetYaxis()->SetRangeUser(0.,750); gr_cdc->SetTitle("Hit multiplicity"); gr_cdc->GetXaxis()->SetTitle(" (nA)"); gr_cdc->GetYaxis()->SetTitle("Number of hits"); gr_cdc->Draw("APL"); TGraph *gr_fdc_wire = new TGraph(6, x, fdc_wire); gr_fdc_wire->SetMarkerStyle(21); gr_fdc_wire->SetMarkerSize(1.0); gr_fdc_wire->SetMarkerColor(4); gr_fdc_wire->Draw("PLsame"); TGraph *gr_fdc_cath = new TGraph(6, x, fdc_cath); gr_fdc_cath->SetMarkerStyle(22); gr_fdc_cath->SetMarkerSize(1.0); gr_fdc_cath->SetMarkerColor(4); gr_fdc_cath->Draw("PLsame"); TLatex *text1 = new TLatex(); text1 -> SetTextFont(22); text1 -> SetTextColor(1); text1 -> SetTextSize(0.05); text1 -> SetTextAlign(22); text1 -> SetTextAngle(0); text1 -> DrawLatex(180, 650, "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_cdc_ps = new TGraph(6, x, cdc_ps); gr_cdc_ps->SetMarkerStyle(20); gr_cdc_ps->SetMarkerSize(1.0); gr_cdc_ps->SetMarkerColor(2); gr_cdc_ps->GetXaxis()->SetRangeUser(0.,550); gr_cdc_ps->GetYaxis()->SetRangeUser(0.,370); gr_cdc_ps->Draw("APL"); TGraph *gr_fdc_wire_ps = new TGraph(6, x, fdc_wire_ps); gr_fdc_wire_ps->SetMarkerStyle(21); gr_fdc_wire_ps->SetMarkerSize(1.0); gr_fdc_wire_ps->SetMarkerColor(4); gr_fdc_wire_ps->Draw("PLsame"); TGraph *gr_fdc_cath_ps = new TGraph(6, x, fdc_cath_ps); gr_fdc_cath_ps->SetMarkerStyle(22); gr_fdc_cath_ps->SetMarkerSize(1.0); gr_fdc_cath_ps->SetMarkerColor(4); gr_fdc_cath_ps->Draw("PLsame"); gr_cdc_ps->SetTitle("Hit multiplicity"); gr_cdc_ps->GetXaxis()->SetTitle(" (nA)"); gr_cdc_ps->GetYaxis()->SetTitle("Number of hits"); text1 -> DrawLatex(190, 320, "PS Trigger (Coincidentals)"); leg = new TLegend(0.2,0.65,0.5,0.85); leg->SetFillColor(0); leg->SetTextSize(0.035); leg->AddEntry(gr_cdc,"CDC ","p"); leg->AddEntry(gr_fdc_wire,"FDC wire ","p"); leg->AddEntry(gr_fdc_cath,"FDC cathode ","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 cdc_fr[6], fdc_wire_fr[6], fdc_cath_fr[6]; Double_t cdc_sig[6], fdc_wire_sig[6], fdc_cath_sig[6]; for(int ss = 0; ss < 6; ss++){ // cdc_fr[ss] = (cdc[ss] - cdc_ps[ss])/cdc[ss]; // fdc_wire_fr[ss] = (fdc_wire[ss] - fdc_wire_ps[ss])/fdc_wire[ss]; // fdc_cath_fr[ss] = (fdc_cath[ss] - fdc_cath_ps[ss])/fdc_cath[ss]; cdc_fr[ss] = (cdc_ps[ss])/cdc[ss]; fdc_wire_fr[ss] = (fdc_wire_ps[ss])/fdc_wire[ss]; fdc_cath_fr[ss] = (fdc_cath_ps[ss])/fdc_cath[ss]; cdc_sig[ss] = cdc[ss] - cdc_ps[ss]; fdc_wire_sig[ss] = fdc_wire[ss] - fdc_wire_ps[ss]; fdc_cath_sig[ss] = fdc_cath[ss] - fdc_cath_ps[ss]; } TGraph *gr_cdc_fr = new TGraph(6, x, cdc_fr); gr_cdc_fr->SetMarkerStyle(20); gr_cdc_fr->SetMarkerSize(1.0); gr_cdc_fr->SetMarkerColor(2); gr_cdc_fr->GetXaxis()->SetRangeUser(0.,550); gr_cdc_fr->GetYaxis()->SetRangeUser(0.,1); gr_cdc_fr->SetTitle("Coincidental fraction"); gr_cdc_fr->GetXaxis()->SetTitle("Current (nA)"); gr_cdc_fr->GetYaxis()->SetTitle("N_{COIN} / N_{TOT}"); gr_cdc_fr->Draw("APL"); TGraph *gr_fdc_wire_fr = new TGraph(6, x, fdc_wire_fr); gr_fdc_wire_fr->SetMarkerStyle(21); gr_fdc_wire_fr->SetMarkerSize(1.0); gr_fdc_wire_fr->SetMarkerColor(4); gr_fdc_wire_fr->Draw("PLsame"); TGraph *gr_fdc_cath_fr = new TGraph(6, x, fdc_cath_fr); gr_fdc_cath_fr->SetMarkerStyle(22); gr_fdc_cath_fr->SetMarkerSize(1.0); gr_fdc_cath_fr->SetMarkerColor(4); gr_fdc_cath_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_cdc_sig = new TGraph(6, x, cdc_sig); gr_cdc_sig->SetMarkerStyle(20); gr_cdc_sig->SetMarkerSize(1.0); gr_cdc_sig->SetMarkerColor(2); gr_cdc_sig->GetXaxis()->SetRangeUser(0.,550); gr_cdc_sig->GetYaxis()->SetRangeUser(0.,540); gr_cdc_sig->Draw("APL"); TGraph *gr_fdc_wire_sig = new TGraph(6, x, fdc_wire_sig); gr_fdc_wire_sig->SetMarkerStyle(21); gr_fdc_wire_sig->SetMarkerSize(1.0); gr_fdc_wire_sig->SetMarkerColor(4); gr_fdc_wire_sig->Draw("PLsame"); TGraph *gr_fdc_cath_sig = new TGraph(6, x, fdc_cath_sig); gr_fdc_cath_sig->SetMarkerStyle(22); gr_fdc_cath_sig->SetMarkerSize(1.0); gr_fdc_cath_sig->SetMarkerColor(4); gr_fdc_cath_sig->Draw("PLsame"); gr_cdc_sig->SetTitle("Multiplicity (BG subtracted)"); gr_cdc_sig->GetXaxis()->SetTitle("Current (nA)"); gr_cdc_sig->GetYaxis()->SetTitle("Number of hits"); // TGraph *gr_cdc_ps = new TGraph(6, x, cdc_ps); // gr_cdc_ps->SetMarkerStyle(21); // gr_cdc_ps->SetMarkerSize(1.0); // gr_cdc_ps->SetMarkerColor(4); // gr_cdc_ps->Draw("PLsame"); text1->SetTextSize(0.045); text1->DrawLatex(220, 450, "FCAL & BCAL & ST Trigger"); }