// ----------------------------------------------------------------------------- // ----- pl_over_MCSel.C ----- // ----- ----- // ----- created by C. Simon on 2018-12-18 ----- // ----- ----- // ----------------------------------------------------------------------------- void pl_over_MCSel() { gStyle->SetPalette(1); gStyle->SetOptStat(kTRUE); gStyle->SetOptFit(kTRUE); gROOT->cd(); gROOT->SetDirLevel(1); TH1* h1(NULL); TH2* h2(NULL); TEfficiency* heff(NULL); TF1* f1(NULL); TLegend* leg(NULL); TLegendEntry* len(NULL); TPaveStats* stats(NULL); TString hname; const Int_t kMaxRefTrackMul = 20; TCanvas* can = new TCanvas("can", "MC track selector overview", 0, 0, 1500, 1066); can->Divide(6, 4); can->cd(1); hname = "hSelMCTrackMatchEfficiency"; heff = dynamic_cast(gROOT->FindObjectAny(hname)); if(heff) { heff->Draw("AP"); gPad->Update(); heff->GetPaintedGraph()->GetXaxis()->SetLimits(heff->GetTotalHistogram()->GetXaxis()->GetXmin(), kMaxRefTrackMul); // heff->GetTotalHistogram()->GetXaxis()->GetXmax()); heff->GetPaintedGraph()->GetYaxis()->SetRangeUser(0., 1.1); gPad->Modified(); cout << endl; cout << Form("mean Sel MCT match efficiency: %7.3f %%", 100.*heff->GetPassedHistogram()->Integral()/heff->GetTotalHistogram()->Integral()) << endl; } else { cout << hname << " not found" << endl; } can->cd(7); hname = "hSelMCTrackMatchPurity"; heff = dynamic_cast(gROOT->FindObjectAny(hname)); if(heff) { heff->Draw("AP"); gPad->Update(); heff->GetPaintedGraph()->GetXaxis()->SetLimits(heff->GetTotalHistogram()->GetXaxis()->GetXmin(), kMaxRefTrackMul); // heff->GetTotalHistogram()->GetXaxis()->GetXmax()); heff->GetPaintedGraph()->GetYaxis()->SetRangeUser(0., 1.1); gPad->Modified(); cout << Form("mean Sel MCT match purity: %7.3f %%", 100.*heff->GetPassedHistogram()->Integral()/heff->GetTotalHistogram()->Integral()) << endl; } else { cout << hname << " not found" << endl; } can->cd(2); hname = "hSelMCTrackDutHitMatchNNMul"; h1 = dynamic_cast(gROOT->FindObjectAny(hname)); if(h1) { gPad->SetLogy(); h1->Draw(); gPad->Update(); hname = "hSelMCTrackDutHitMatchAccNNMul"; h1 = dynamic_cast(gROOT->FindObjectAny(hname)); if(h1) { h1->SetLineColor(kRed); h1->Draw("SAMES"); gPad->Update(); stats = dynamic_cast(h1->FindObject("stats")); stats->SetY1NDC(stats->GetY1NDC() - 0.3); stats->SetY2NDC(stats->GetY2NDC() - 0.3); gPad->Modified(); gPad->Update(); } else { cout << hname << " not found" << endl; } } else { cout << hname << " not found" << endl; } can->cd(3); hname = "hSelTypeNNChiSq"; h2 = dynamic_cast(gROOT->FindObjectAny(hname)); if(h2) { h1 = h2->ProjectionY(Form("%s_py", hname.Data()), 3, 3); gPad->SetLogy(); h1->Draw(); } else { cout << hname << " not found" << endl; } can->cd(4); hname = "hSelTypeNNResidualX"; h2 = dynamic_cast(gROOT->FindObjectAny(hname)); if(h2) { h1 = h2->ProjectionY(Form("%s_py", hname.Data()), 3, 3); gPad->SetLogy(); h1->Draw(); h1->Fit("gaus", "Q"); gPad->Update(); stats = dynamic_cast(h1->FindObject("stats")); stats->SetOptFit(10001); gPad->Modified(); } else { cout << hname << " not found" << endl; } can->cd(5); hname = "hSelTypeNNResidualY"; h2 = dynamic_cast(gROOT->FindObjectAny(hname)); if(h2) { h1 = h2->ProjectionY(Form("%s_py", hname.Data()), 3, 3); gPad->SetLogy(); h1->Draw(); h1->Fit("gaus", "Q"); gPad->Update(); stats = dynamic_cast(h1->FindObject("stats")); stats->SetOptFit(10001); gPad->Modified(); } else { cout << hname << " not found" << endl; } can->cd(6); hname = "hSelTypeNNResidualT"; h2 = dynamic_cast(gROOT->FindObjectAny(hname)); if(h2) { h1 = h2->ProjectionY(Form("%s_py", hname.Data()), 3, 3); gPad->SetLogy(); h1->Draw(); h1->Fit("gaus", "Q"); gPad->Update(); stats = dynamic_cast(h1->FindObject("stats")); stats->SetOptFit(10001); gPad->Modified(); } else { cout << hname << " not found" << endl; } can->cd(9); hname = "hSelTypeAccNNChiSq"; h2 = dynamic_cast(gROOT->FindObjectAny(hname)); if(h2) { h1 = h2->ProjectionY(Form("%s_py", hname.Data()), 3, 3); gPad->SetLogy(); h1->Draw(); } else { cout << hname << " not found" << endl; } can->cd(10); hname = "hSelTypeAccNNResidualX"; h2 = dynamic_cast(gROOT->FindObjectAny(hname)); if(h2) { h1 = h2->ProjectionY(Form("%s_py", hname.Data()), 3, 3); gPad->SetLogy(); h1->Draw(); h1->Fit("gaus", "Q"); gPad->Update(); stats = dynamic_cast(h1->FindObject("stats")); stats->SetOptFit(10001); gPad->Modified(); } else { cout << hname << " not found" << endl; } can->cd(11); hname = "hSelTypeAccNNResidualY"; h2 = dynamic_cast(gROOT->FindObjectAny(hname)); if(h2) { h1 = h2->ProjectionY(Form("%s_py", hname.Data()), 3, 3); gPad->SetLogy(); h1->Draw(); h1->Fit("gaus", "Q"); gPad->Update(); stats = dynamic_cast(h1->FindObject("stats")); stats->SetOptFit(10001); gPad->Modified(); } else { cout << hname << " not found" << endl; } can->cd(12); hname = "hSelTypeAccNNResidualT"; h2 = dynamic_cast(gROOT->FindObjectAny(hname)); if(h2) { h1 = h2->ProjectionY(Form("%s_py", hname.Data()), 3, 3); gPad->SetLogy(); h1->Draw(); h1->Fit("gaus", "Q"); gPad->Update(); stats = dynamic_cast(h1->FindObject("stats")); stats->SetOptFit(10001); gPad->Modified(); } else { cout << hname << " not found" << endl; } can->SaveAs("pl_over_MCSel.pdf"); }