void triggerPlots(float bdtCut = 0.0, TString path = "./"){ gStyle->SetOptStat(0); gStyle->SetPaintTextFormat(".2f"); float totalRate = 360; TFile* f = TFile::Open(path+"TMVApp_hltTree.root"); TString type = ""; TH1F* hAllNoAccept = f->Get("hEphotonTruthAllNoAccept"); TH1F* hAll = f->Get(Form("hEphotonTruthAll%s",type.Data())); TH1F* hL1NoAccept = f->Get("hEphotonTruthL1NoAccept"); TH1F* hL1 = f->Get(Form("hEphotonTruthL1%s",type.Data())); TH1F* hL1_tagged = f->Get(Form("hEphotonTruthL1_tagged%s",type.Data())); TH2F* hL3NoAccept_2D = (TH2F*)f->Get("hEphotonTruthL3NoAccept_2D"); TH2F* hL3_2D = (TH2F*)f->Get(Form("hEphotonTruthL3%s_2D",type.Data())); int bdtCutBin = hL3_2D->GetYaxis()->FindBin(bdtCut); TH1F* hL3cut = (TH1F*)hL3_2D->ProjectionX("L3",bdtCutBin,1000); TH1F* hL3cutNoAccept = (TH1F*)hL3NoAccept_2D->ProjectionX("L3NoAccept",bdtCutBin,1000); TCanvas *aa = new TCanvas("aa","aa",600,400); aa->SetBottomMargin(0.15); aa->SetLeftMargin(0.12); aa->SetTopMargin(0.05); aa->SetRightMargin(0.05); hAllNoAccept->GetXaxis()->SetTitleSize(0.06); hAllNoAccept->GetYaxis()->SetTitleSize(0.06); hAllNoAccept->GetXaxis()->SetTitleOffset(1.1); hAllNoAccept->GetYaxis()->SetTitleOffset(0.9); hAllNoAccept->SetTitle(";E_{#gamma} (GeV); Yield"); hAllNoAccept->Draw(); hAllNoAccept->SetLineColor(kRed); hAllNoAccept->SetLineWidth(2); hL1NoAccept->Draw("same"); hL1NoAccept->SetLineColor(kBlue); hL1NoAccept->SetLineWidth(2); hL3cutNoAccept->Draw("same"); hL3cutNoAccept->SetLineColor(kBlack); hL3cutNoAccept->SetLineWidth(2); gPad->SetLogy(); aa->Print(type+"AllEgammaEffic.pdf"); int lowBin = hL1->FindBin(8.401); int highBin = hL1->FindBin(8.999); //cout<GetEntries()<<" "<GetEntries()<Integral(lowBin,highBin)/hAll->Integral(lowBin,highBin); float L1reject = 1. - hL1NoAccept->Integral()/hAllNoAccept->Integral(); float L3effic = hL3cut->Integral(lowBin,highBin)/hL1->Integral(lowBin,highBin); float L3reject = 1. - hL3cutNoAccept->Integral()/hL1NoAccept->Integral(); cout<Clone(); bb->SetBottomMargin(0.15); bb->SetLeftMargin(0.12); bb->SetTopMargin(0.05); bb->SetRightMargin(0.05); hEffic->Divide(hL1); hEffic->SetMaximum(1.0); hEffic->Draw(); hEffic->SetLineColor(kBlue); hEffic->SetLineWidth(2); hEffic->GetXaxis()->SetTitleSize(0.06); hEffic->GetYaxis()->SetTitleSize(0.06); hEffic->GetXaxis()->SetTitleOffset(1.1); hEffic->GetYaxis()->SetTitleOffset(0.9); hEffic->SetTitle(";E_{#gamma} (GeV); Level-3 Efficiency"); bb->Print(type+"L3EgammaEffic.pdf"); TCanvas *cc = new TCanvas("cc","cc",600,400); cc->SetBottomMargin(0.15); cc->SetLeftMargin(0.12); cc->SetTopMargin(0.05); cc->SetRightMargin(0.05); // make semi-ROC plot int lowBin2 = hL1->FindBin(7.01); TH1F* hAllTempNoAccept = (TH1F*)hL3NoAccept_2D->ProjectionY("hAllTempNoAccept"); TH1F* hSignalTemp = (TH1F*)hL3_2D->ProjectionY("hSignalTemp",lowBin,highBin); TH1F* hSignalTempNoAccept = (TH1F*)hL3NoAccept_2D->ProjectionY("hSignalTempNoAccept",lowBin,highBin); TH1F* hHighTempNoAccept = (TH1F*)hL3NoAccept_2D->ProjectionY("hHighTempNoAccept",lowBin2,1000); float allTotalNoAccept = hAllNoAccept->Integral(); float signalTotal = hSignalTemp->Integral(); float highTotal = hSignalTemp->Integral(); TGraph *hL3effic = new TGraph(1000); TGraph *hL3CoherentEffic = new TGraph(1000); TGraph *hL3HighEffic = new TGraph(1000); TGraph *hL3LowEffic = new TGraph(1000); int binMax = hL3_2D->GetYaxis()->GetNbins(); float outEffic = 0.; for(int i=0; iIntegral(i,1000); float signalYieldNoAccept = hSignalTempNoAccept->Integral(i,1000); float highYieldNoAccept = hHighTempNoAccept->Integral(i,1000); float totalYieldNoAccept = hAllTempNoAccept->Integral(i,1000); float effic = signalYield/signalTotal; float rateSignal = signalYieldNoAccept/allTotalNoAccept*totalRate*0.5; float rateHigh = highYieldNoAccept/allTotalNoAccept*totalRate*0.5; float rateLow = (totalYieldNoAccept-highYieldNoAccept)/allTotalNoAccept*totalRate*0.5; float rate = totalYieldNoAccept/allTotalNoAccept*totalRate*0.5; hL3effic->SetPoint(i,effic,rate); hL3CoherentEffic->SetPoint(i,effic,rateSignal); hL3HighEffic->SetPoint(i,effic,rateHigh); hL3LowEffic->SetPoint(i,effic,rateLow); if(rate<=20. && outEffic==0.) { outEffic = effic; } } TLegend *leg = new TLegend(0.15,0.7,0.6,0.89); leg->SetFillColor(kWhite); leg->SetLineColor(kWhite); TH1F* base = new TH1F("base",";L3 Trigger Efficiency in Coherent Peak; L3 Output Rate (kHz)",100,0.,1.0); base->SetMaximum(30.); base->GetXaxis()->SetTitleSize(0.06); base->GetYaxis()->SetTitleSize(0.06); base->GetXaxis()->SetTitleOffset(1.1); base->GetYaxis()->SetTitleOffset(0.9); base->Draw(); hL3effic->SetLineWidth(2); hL3effic->SetLineColor(kBlue); leg->AddEntry(hL3effic,"All E_{#gamma}","l"); hL3effic->Draw("same"); hL3CoherentEffic->SetLineWidth(2); hL3CoherentEffic->SetLineColor(kGreen); leg->AddEntry(hL3CoherentEffic,"8.4 < E_{#gamma} < 9 GeV","l"); hL3CoherentEffic->Draw("same"); hL3HighEffic->SetLineWidth(2); hL3HighEffic->SetLineColor(kRed); leg->AddEntry(hL3HighEffic,"E_{#gamma} > 7 GeV","l"); hL3HighEffic->Draw("same"); hL3LowEffic->SetLineWidth(2); hL3LowEffic->SetLineColor(kMagenta); leg->AddEntry(hL3LowEffic,"E_{#gamma} < 7 GeV","l"); hL3LowEffic->Draw("same"); leg->Draw("same"); TLatex *tx = new TLatex(0.05,16.,Form("L3 Efficiency = %0.3f @ 20 kHz",outEffic)); tx->Draw("same"); cc->Print(type+"L3TaggerOutput.pdf"); // topology plots TH2F* hTopologyTruthHighAll = (TH2F*)f->Get("hTopologyTruthHighAll"+type); TH2F* hTopologyTruthCoherentAll = (TH2F*)f->Get("hTopologyTruthCoherentAll"+type); TH2F* hTopologyTruthHighL1 = (TH2F*)f->Get("hTopologyTruthHighL1"+type); TH2F* hTopologyTruthCoherentL1 = (TH2F*)f->Get("hTopologyTruthCoherentL1"+type); TH2F* hTopologyTruthHighL3 = (TH2F*)f->Get("hTopologyTruthHighL3"+type); TH2F* hTopologyTruthCoherentL3 = (TH2F*)f->Get("hTopologyTruthCoherentL3"+type); TH2F* hCoherentL1Ratio = hTopologyTruthCoherentL1->Clone(); hCoherentL1Ratio->Divide(hTopologyTruthCoherentAll); TH2F* hCoherentL3Ratio = hTopologyTruthCoherentL3->Clone(); hCoherentL3Ratio->Divide(hTopologyTruthCoherentL1); TCanvas *dd = new TCanvas("dd","dd",600,400); dd->SetBottomMargin(0.15); dd->SetLeftMargin(0.12); dd->SetTopMargin(0.05); dd->SetRightMargin(0.1); hCoherentL1Ratio->GetXaxis()->SetTitleSize(0.06); hCoherentL1Ratio->GetYaxis()->SetTitleSize(0.06); hCoherentL1Ratio->GetXaxis()->SetTitleOffset(1.1); hCoherentL1Ratio->GetYaxis()->SetTitleOffset(0.9); hCoherentL1Ratio->SetMarkerSize(1.5); hCoherentL1Ratio->Draw("colz htext"); dd->Print(type+"L1TopologyEffic.pdf"); TCanvas *ee = new TCanvas("ee","ee",600,400); ee->SetBottomMargin(0.15); ee->SetLeftMargin(0.12); ee->SetTopMargin(0.05); ee->SetRightMargin(0.1); hCoherentL3Ratio->GetXaxis()->SetTitleSize(0.06); hCoherentL3Ratio->GetYaxis()->SetTitleSize(0.06); hCoherentL3Ratio->GetXaxis()->SetTitleOffset(1.1); hCoherentL3Ratio->GetYaxis()->SetTitleOffset(0.9); hCoherentL3Ratio->SetMarkerSize(1.5); hCoherentL3Ratio->Draw("colz htext"); ee->Print(type+"L3TopologyEffic.pdf"); TCanvas *all = new TCanvas("all","all",1000,700); all->SetBottomMargin(0.15); all->SetLeftMargin(0.12); all->SetTopMargin(0.05); all->SetRightMargin(0.1); all->Divide(2,2); all->cd(1); cc->DrawClonePad(); all->cd(2); ee->DrawClonePad(); all->cd(3); bb->DrawClonePad(); all->Print(type+"Summary.pdf"); return; }