From 8cb82595f199fab80b3d8efea0478af440d721d9 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sun, 4 Aug 2013 12:39:07 +0200 Subject: [PATCH 001/182] updating scripts --- SimMuL1/scripts/cuts.py | 50 +- SimMuL1/scripts/drawplot_eff.py | 522 ++++++++++++------ SimMuL1/scripts/produceRatePlotsForApproval.C | 376 ++++++++++--- 3 files changed, 716 insertions(+), 232 deletions(-) diff --git a/SimMuL1/scripts/cuts.py b/SimMuL1/scripts/cuts.py index ecd50d29b2426..a5b626ea37501 100644 --- a/SimMuL1/scripts/cuts.py +++ b/SimMuL1/scripts/cuts.py @@ -1,5 +1,12 @@ from ROOT import TCut +ok_eta = TCut("TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.14") +ok_pt = TCut("pt > 20.") + +ok_dphi1 = TCut("dphi_pad_odd < 10.") +ok_dphi2 = TCut("dphi_pad_even < 10.") + + ok_sh1 = TCut("(has_csc_sh&1) > 0") ok_sh2 = TCut("(has_csc_sh&2) > 0") ok_st1 = TCut("(has_csc_strips&1) > 0") @@ -21,21 +28,50 @@ ok_gdg2 = TCut("(has_gem_dg&2) > 0") ok_pad1 = TCut("(has_gem_pad&1) > 0") ok_pad2 = TCut("(has_gem_pad&2) > 0") + +ok_pad1_lct1 = TCut("%s && %s" %(ok_pad1.GetTitle(),ok_lct1.GetTitle())) +ok_pad2_lct2 = TCut("%s && %s" %(ok_pad2.GetTitle(),ok_lct2.GetTitle())) + +ok_pad1_dphi1 = TCut("%s && %s" %(ok_pad1.GetTitle(),ok_dphi1.GetTitle())) +ok_pad2_dphi2 = TCut("%s && %s" %(ok_pad2.GetTitle(),ok_dphi2.GetTitle())) + +ok_lct1_eta = TCut("%s && %s" %(ok_eta.GetTitle(),ok_lct1.GetTitle())) +ok_lct2_eta = TCut("%s && %s" %(ok_eta.GetTitle(),ok_lct2.GetTitle())) + + + +ok_pad1_lct1_eta = TCut("%s && %s && %s" %(ok_pad1.GetTitle(),ok_lct1.GetTitle(),ok_eta.GetTitle())) +ok_pad2_lct2_eta = TCut("%s && %s && %s" %(ok_pad2.GetTitle(),ok_lct2.GetTitle(),ok_eta.GetTitle())) + +ok_gsh1_lct1_eta = TCut("%s && %s && %s" %(ok_gsh1.GetTitle(),ok_lct1.GetTitle(),ok_eta.GetTitle())) +ok_gsh2_lct2_eta = TCut("%s && %s && %s" %(ok_gsh2.GetTitle(),ok_lct2.GetTitle(),ok_eta.GetTitle())) + +ok_gsh1_eta = TCut("%s && %s" %(ok_gsh1.GetTitle(),ok_eta.GetTitle())) +ok_gsh2_eta = TCut("%s && %s" %(ok_gsh2.GetTitle(),ok_eta.GetTitle())) + +ok_gdg1_eta = TCut("%s && %s" %(ok_gdg1.GetTitle(),ok_eta.GetTitle())) +ok_gdg2_eta = TCut("%s && %s" %(ok_gdg2.GetTitle(),ok_eta.GetTitle())) + ok_2pad1 = TCut("(has_gem_pad2&1) > 0") ok_2pad2 = TCut("(has_gem_pad2&2) > 0") + ok_pad1_overlap = TCut("%s || (%s && %s)" %(ok_pad1.GetTitle(),ok_lct2.GetTitle(),ok_pad2.GetTitle())) ok_pad2_overlap = TCut("%s || (%s && %s)" %(ok_pad2.GetTitle(),ok_lct1.GetTitle(),ok_pad1.GetTitle())) + ok_copad1 = TCut("(has_gem_copad&1) > 0") ok_copad2 = TCut("(has_gem_copad&2) > 0") -Qp = TCut("charge > 0") -Qn = TCut("charge < 0") +ok_Qp = TCut("charge > 0") +ok_Qn = TCut("charge < 0") + +ok_lct1_eta_Qn = TCut("%s && %s && %s" %(ok_lct1.GetTitle(),ok_eta.GetTitle(),ok_Qn.GetTitle())) +ok_lct2_eta_Qn = TCut("%s && %s && %s" %(ok_lct2.GetTitle(),ok_eta.GetTitle(),ok_Qn.GetTitle())) + +ok_lct1_eta_Qp = TCut("%s && %s && %s" %(ok_lct1.GetTitle(),ok_eta.GetTitle(),ok_Qp.GetTitle())) +ok_lct2_eta_Qp = TCut("%s && %s && %s" %(ok_lct2.GetTitle(),ok_eta.GetTitle(),ok_Qp.GetTitle())) + + Ep = TCut("endcap > 0") En = TCut("endcap < 0") -ok_eta = TCut("TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.14") -ok_pt = TCut("pt > 20.") - -ok_dphi1 = TCut("dphi_pad_odd < 10.") -ok_dphi2 = TCut("dphi_pad_even < 10.") diff --git a/SimMuL1/scripts/drawplot_eff.py b/SimMuL1/scripts/drawplot_eff.py index 32e0f653f6ecd..399ab618c3c0b 100644 --- a/SimMuL1/scripts/drawplot_eff.py +++ b/SimMuL1/scripts/drawplot_eff.py @@ -1,11 +1,14 @@ +## custom modules from effFunctions import * from cuts import * from tdrStyle import * +from GEMCSCdPhiLib import * +## ROOT modules from ROOT import TFile,TStyle,TKey,TTree,TH1F,TH2D,TObject,TF1 from ROOT import TMath,TCanvas,TCut,TEfficiency,TLegend from ROOT import gStyle,gROOT,gPad,gDirectory -from ROOT import kBlue,kRed +from ROOT import kBlue,kRed,kFullStar, kViolet, kAzure, kGreen ## run quiet mode import sys @@ -14,6 +17,30 @@ import ROOT ROOT.gROOT.SetBatch(1) +## JSON format for dphi dictionary +import json + +gStyle.SetStatW(0.07) +gStyle.SetStatH(0.06) + +gStyle.SetOptStat(0) + +gStyle.SetTitleStyle(0) +gStyle.SetTitleAlign(13) ##// coord in top left +gStyle.SetTitleX(0.) +gStyle.SetTitleY(1.) +gStyle.SetTitleW(1) +gStyle.SetTitleH(0.058) +gStyle.SetTitleBorderSize(0) + +gStyle.SetPadLeftMargin(0.126) +gStyle.SetPadRightMargin(0.04) +gStyle.SetPadTopMargin(0.06) +gStyle.SetPadBottomMargin(0.13) + +gStyle.SetMarkerStyle(1) + + def getTree(fileName): """Get tree for given filename""" @@ -46,6 +73,8 @@ def eff_halfStrip(f_name,p_name): c = TCanvas("c","c",700,500) c.Clear() + c.SetGridx(1) + c.SetGridy(1) h = TH1F("","Efficiency for track with LCT to have GEM pad in chamber",130,0.5,130.5) h.SetTitle("Efficiency for track with LCT to have GEM pad in chamber") h.GetXaxis().SetTitle("LCT half-strip") @@ -57,10 +86,10 @@ def eff_halfStrip(f_name,p_name): pt = f_name[f_name.find('pt'):] pt = pt[2:] pt = pt[:pt.find('_pad')] - leg = TLegend(0.50,0.23,.9,0.4,"","brNDC") + leg = TLegend(0.40,0.2,.7,0.5,"","brNDC") leg.SetBorderSize(0) leg.SetFillStyle(0) - leg.SetTextSize(.04) + leg.SetTextSize(.05) leg.AddEntry(0, "p_{T} = %s GeV/c"%(pt), "") leg.AddEntry(0, "a pad spans 4 strips", "") leg.AddEntry(ho,"odd chambers","l") @@ -98,10 +127,10 @@ def eff_halfStrip_overlap(f_name, p_name): pt = f_name[f_name.find('pt'):] pt = pt[2:] pt = pt[:pt.find('_pad')] - leg = TLegend(0.50,0.23,.9,0.4,"","brNDC") + leg = TLegend(0.40,0.2,.7,0.5,"","brNDC") leg.SetBorderSize(0) leg.SetFillStyle(0) - leg.SetTextSize(.04) + leg.SetTextSize(.05) leg.AddEntry(0, "p_{T} = %s GeV/c"%(pt), "") leg.AddEntry(0, "a pad spans 4 strips", "") leg.AddEntry(ho,"odd chambers","l") @@ -112,11 +141,9 @@ def eff_halfStrip_overlap(f_name, p_name): c.SaveAs(p_name) -def drawplot_eff_eta(f_name, plotDir): +def drawplot_eff_eta(f_name, plotDir, ext = ".pdf"): """efficiency vs eta""" - ext = ".pdf" - c = TCanvas("c","c",700,500) c.Clear() c.SetGridx(1) @@ -139,10 +166,10 @@ def drawplot_eff_eta(f_name, plotDir): h.Draw() ho.Draw("same") he.Draw("same") - leg = TLegend(0.50,0.23,.9,0.4,"","brNDC") + leg = TLegend(0.4,0.2,.7,0.5,"","brNDC") leg.SetBorderSize(0) leg.SetFillStyle(0) - leg.SetTextSize(.04) + leg.SetTextSize(.05) leg.AddEntry(0, "p_{T} = %s GeV/c"%(pt), "") leg.AddEntry(0, "a pad spans 4 strips", "") leg.AddEntry(ho,"odd chambers","l") @@ -162,10 +189,10 @@ def drawplot_eff_eta(f_name, plotDir): h.Draw() ho.Draw("same") he.Draw("same") - leg = TLegend(0.50,0.23,.9,0.4,"","brNDC") + leg = TLegend(0.40,0.2,.7,0.5,"","brNDC") leg.SetBorderSize(0) leg.SetFillStyle(0) - leg.SetTextSize(.04) + leg.SetTextSize(.05) leg.AddEntry(0, "p_{T} = %s GeV/c"%(pt), "") leg.AddEntry(0, "a pad spans 4 strips", "") leg.AddEntry(ho,"odd chambers","l") @@ -222,14 +249,11 @@ def drawplot_eff_eta(f_name, plotDir): draw_eff(gt, "Efficiency for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Efficiency", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1 && Ep, ok_pad1_overlap, "P", kRed) draw_eff(gt, "Efficiency for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Efficiency", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2 && Ep, ok_pad2_overlap, "P same") """ + -def halfStripEfficiencies(): +def halfStripEfficiencies(filesDir, plotDir, ext): """Plot the halfstrip efficiencies""" - plotDir = "plots/" - filesDir = "files/" - ext = ".pdf" - eff_halfStrip("%sgem_csc_delta_pt5_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt05%s"%(plotDir,ext)) eff_halfStrip("%sgem_csc_delta_pt10_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt10%s"%(plotDir,ext)) eff_halfStrip("%sgem_csc_delta_pt15_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt15%s"%(plotDir,ext)) @@ -237,154 +261,329 @@ def halfStripEfficiencies(): eff_halfStrip("%sgem_csc_delta_pt30_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt30%s"%(plotDir,ext)) eff_halfStrip("%sgem_csc_delta_pt40_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt40%s"%(plotDir,ext)) -## eff_halfStrip_overlap("gem_csc_delta_pt5_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt05_overlap%s"%(plotDir,ext)) -## eff_halfStrip_overlap("gem_csc_delta_pt10_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt10_overlap%s"%(plotDir,ext)) -## eff_halfStrip_overlap("gem_csc_delta_pt15_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt15_overlap%s"%(plotDir,ext)) -## eff_halfStrip_overlap("gem_csc_delta_pt20_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt20_overlap%s"%(plotDir,ext)) -## eff_halfStrip_overlap("gem_csc_delta_pt30_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt30_overlap%s"%(plotDir,ext)) -## eff_halfStrip_overlap("gem_csc_delta_pt40_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt40_overlap%s"%(plotDir,ext)) + eff_halfStrip_overlap("%sgem_csc_delta_pt5_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt05_overlap%s"%(plotDir,ext)) + eff_halfStrip_overlap("%sgem_csc_delta_pt10_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt10_overlap%s"%(plotDir,ext)) + eff_halfStrip_overlap("%sgem_csc_delta_pt15_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt15_overlap%s"%(plotDir,ext)) + eff_halfStrip_overlap("%sgem_csc_delta_pt20_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt20_overlap%s"%(plotDir,ext)) + eff_halfStrip_overlap("%sgem_csc_delta_pt30_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt30_overlap%s"%(plotDir,ext)) + eff_halfStrip_overlap("%sgem_csc_delta_pt40_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt40_overlap%s"%(plotDir,ext)) -def etaMatchingEfficiencies(): + +def etaMatchingEfficiencies(filesDir, plotDir, ext = ".pdf"): """Plot the simtrack to LCT,Pad matching efficiency vs eta""" - drawplot_eff_eta("%sgem_csc_delta_pt5_pad4.root"%(filesDir), plotDir) - drawplot_eff_eta("%sgem_csc_delta_pt10_pad4.root"%(filesDir), plotDir) - drawplot_eff_eta("%sgem_csc_delta_pt15_pad4.root"%(filesDir), plotDir) - drawplot_eff_eta("%sgem_csc_delta_pt20_pad4.root"%(filesDir), plotDir) - drawplot_eff_eta("%sgem_csc_delta_pt30_pad4.root"%(filesDir), plotDir) - drawplot_eff_eta("%sgem_csc_delta_pt40_pad4.root"%(filesDir), plotDir) + drawplot_eff_eta("%sgem_csc_delta_pt5_pad4.root"%(filesDir), plotDir, ext) + drawplot_eff_eta("%sgem_csc_delta_pt10_pad4.root"%(filesDir), plotDir, ext) + drawplot_eff_eta("%sgem_csc_delta_pt15_pad4.root"%(filesDir), plotDir, ext) + drawplot_eff_eta("%sgem_csc_delta_pt20_pad4.root"%(filesDir), plotDir, ext) + drawplot_eff_eta("%sgem_csc_delta_pt30_pad4.root"%(filesDir), plotDir, ext) + drawplot_eff_eta("%sgem_csc_delta_pt40_pad4.root"%(filesDir), plotDir, ext) + + +def getDphi(eff,pt,evenOdd): + """Return the delta Phi cut value""" + + return dphi_lct_pad["%s"%(eff)]["%s"%(pt)]["%s"%(evenOdd)] + + +def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): + """Produce GEM turn-on curve""" + + pt = ["pt10","pt20","pt30","pt40"] + pt_labels = ["10","20","30","40"] + + marker_colors = [kRed, kViolet+1, kAzure+1, kGreen-2] + marker_styles = [20,21,23,24] + + t = getTree("%sgem_csc_eff_pt2pt50_pad4.root"%(filesDir)); + + c = TCanvas("c","c",800,600) + c.SetGridx(1) + c.SetGridy(1) + c.cd() -def gemTurnOns(): + + h = TH1F("","Efficiency for track with LCT to have GEM pad in chamber;muon p_{T} [GeV/c];Efficiency",50,0.,50.) + h.SetStats(0) + h.Draw("") + + histoList = [] + for i in range(len(pt)): + dphi = getDphi("%s"%(eff),"%s"%(pt[i]),"%s"%(oddEven)) + if oddEven=="even": + ok_dphi = TCut("TMath::Abs(dphi_pad_even) < %f"%(dphi)) + denom_cut = ok_pad2_lct2_eta + else: + ok_dphi = TCut("TMath::Abs(dphi_pad_odd) < %f"%(dphi)) + denom_cut = ok_pad1_lct1_eta + + h2 = draw_eff(t, "Eff. for track with LCT to have matched GEM pad;p_{T} [GeV/c];Efficiency", "h2", "(50,0.,50.)", "pt", + denom_cut, ok_dphi, marker_colors[i], marker_styles[i]) + histoList.append(h2) + h2.SetMarkerSize(1) + h2.Draw("same") + + + ## add legend + leg_header = " #Delta#phi(LCT,GEM) is %s%% efficient for"%(eff) + leg = TLegend(0.50,0.17,.99,0.57, "", "brNDC") + leg.AddEntry(0, "%s chambers at pt"%(oddEven), "") + for n in range(len(pt)): + leg.AddEntry(histoList[n], pt_labels[n], "p") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader(leg_header) + leg.SetTextSize(0.05) + leg.Draw("same") + + ## save the file + c.SaveAs("%sGEM_turnon_%s_%s%s"%(plotDir, eff,oddEven,ext)) + + +def gemTurnOns(filesDir, plotDir, ext): """Produce the GEM turn-on curves""" + gemTurnOn(filesDir, plotDir, "95", "even", ext) + gemTurnOn(filesDir, plotDir, "95", "odd", ext) + gemTurnOn(filesDir, plotDir, "98", "even", ext) + gemTurnOn(filesDir, plotDir, "98", "odd", ext) + gemTurnOn(filesDir, plotDir, "99", "even", ext) + gemTurnOn(filesDir, plotDir, "99", "odd", ext) + +##double mymod(double x, double y) {return fmod(x,y);} + + +def eff_hs_1(filesDir, plotDir, f_name, ext): + """Halfstrip matching efficiency dphi""" -# N= 5 -# -## int pt_lbl[N] = {DPHI_PT10, DPHI_PT15, DPHI_PT20, DPHI_PT30, DPHI_PT40}; -## TString pt[N] = {"pt10","pt15","pt20","pt30","pt40"}; -## int marker_styles[5] = {24, 28, 22 , 21, 20}; - -## TCanvas* gEff = new TCanvas("gEff","gEff",700,500); -## gEff.SetGridx(1); gEff.SetGridy(1); -## TCanvas* gEff_odd = new TCanvas("gEff_odd","gEff_odd",700,500); -## gEff_odd.SetGridx(1); gEff_odd.SetGridy(1); -## TCanvas* gEff_even = new TCanvas("gEff_even","gEff_even",700,500); -## gEff_even.SetGridx(1); gEff_even.SetGridy(1); - -## TTree *t = getTree("gem_csc_eff_pt2pt50_pad4.root"); -## TH1F *ho[N], *he[N]; -## for (int n=0; n0) opt = "same p"; -## setDPhi(n, label_eff); -## gEff.cd(); -## ho[n] = draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", Form("h_odd%d",n), "(50,0.,50.)", "pt", ok_lct1 && ok_eta && ok_pad1, ok_dphi1, opt, kRed, marker_styles[n]); -## he[n] = draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", Form("h_evn%d",n), "(50,0.,50.)", "pt", ok_lct2 && ok_eta && ok_pad2, ok_dphi2, "same p", kBlue, marker_styles[n]); -## gEff_odd.cd(); -## ho[n].Draw(opt); -## gEff_even.cd(); -## he[n].Draw(opt); -## } - -## TString pts[N] = {"10","15","20","30","40"}; -## TString efs[5] = {"95", "98", "99"}; -## TString leg_header = " #Delta#phi(LCT,GEM) is " + efs[label_eff] + "% efficient for"; - -## gEff.cd(); -## TLegend *leg = new TLegend(0.50,0.17,.99,0.57, NULL, "brNDC"); -## leg.SetNColumns(2); -## leg.SetBorderSize(0); -## leg.SetFillStyle(0); -## leg.SetHeader(leg_header); -## leg.AddEntry(ho[0], "odd chambers", ""); -## leg.AddEntry(he[0], "even chambers", ""); -## leg.AddEntry(ho[0], "at pt", ""); -## leg.AddEntry(he[0], "at pt", ""); -## for (int n=0; nSetTextSize(0.04); + tex->SetNDC(); + tex->Draw(); + return tex; +} - -void produceRatePlotsForApproval() +void produceRatePlots(TString ext) { gROOT->ProcessLine(".L drawplot_gmtrt.C"); gROOT->ProcessLine(".L getPTHistos.C"); @@ -29,10 +36,8 @@ void produceRatePlotsForApproval() gem_dir = "files/"; gem_label = "gem98"; - TString plots = "plots/"; - TString ext = ".pdf"; - TString the_ttl = "CSC L1 trigger rates in ME1/b region;p_{T}^{cut} [GeV/c];rate [kHz]"; - + TString the_ttl = "CSC L1 trigger rates in 1.64<|#eta|<2.14 region;p_{T}^{cut} [GeV/c];rate [kHz]"; + TString plots = "plots/rate/"; //gStyle->SetStatW(0.13); //gStyle->SetStatH(0.08); @@ -264,9 +269,9 @@ void produceRatePlotsForApproval() result_gem_2s1b__pat8 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat8"); result_gem_3s1b__pat8 = (TH1D*) hh->Clone("result_gem_2s1b__pat8"); - //////////////////////////// - // MY OWN PLOTS FOR APPROVAL - //////////////////////////// + //////////////////////// + // PLOTS FOR APPROVAL // + //////////////////////// { result_gmtsing__pat2->SetFillColor(kRed); result_gmtsing__pat8->SetFillColor(kRed); @@ -311,23 +316,35 @@ void produceRatePlotsForApproval() result_gmtsing__pat2->GetYaxis()->SetRangeUser(0.1, 10000.); result_gmtsing__pat2->GetXaxis()->SetTitle(""); - TLegend *leg = new TLegend(0.49,0.6,.98,0.92,NULL,"brNDC"); + TLegend *leg = new TLegend(0.52,0.65,.93,0.93,NULL,"brNDC"); leg->SetBorderSize(0); - leg->SetFillStyle(0); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); leg->SetTextSize(0.04); - leg->AddEntry((TObject*)0, "Global Muon Trigger:",""); + /* + leg->AddEntry((TObject*)0, "Global Muon Trigger [GMT]",""); leg->AddEntry(result_gmtsing__pat2, "default muon selection","f"); leg->AddEntry((TObject*)0, "",""); - leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); - leg->AddEntry(result_def_2s__pat2, "#geq 2 stubs","f"); - leg->AddEntry(result_def_2s1b__pat2,"#geq 2 with ME1/b stub","f"); - leg->AddEntry(result_gem_2s1b__pat2,"#geq 2 with ME1/b stub ","f"); - leg->AddEntry((TObject*)0, " and GEM pad",""); - leg->Draw(); + leg->AddEntry((TObject*)0, "CSC tracks with hits in",""); + leg->AddEntry(result_def_2s__pat2, "#geq 2 stations","f"); + leg->AddEntry(result_def_2s1b__pat2,"#geq 2 stations with YE1","f"); + leg->AddEntry(result_gem_2s1b__pat2,"#geq 2 stations with YE1 ","f"); + leg->AddEntry((TObject*)0, " and GEM",""); + */ + leg->AddEntry((TObject*)0, "Single muon trigger in",""); + leg->AddEntry(result_gmtsing__pat2, "2012 configuration [GMT]","f"); + // leg->AddEntry((TObject*)0, "",""); + leg->AddEntry((TObject*)0, "CSC track selection:",""); + leg->AddEntry(result_def_2s__pat2, "#geq 2 stations, loose","f"); + leg->AddEntry(result_def_2s1b__pat2,"#geq 2 stations, medium","f"); + leg->AddEntry(result_gem_2s1b__pat2,"#geq 2 stations, tight","f"); + leg->Draw(); + + // drawL1Label(0.17,0.35); drawLumiLabel(0.17,.3); - drawPULabel(0.17,.25); - drawEtaLabel("1.64","2.14",0.17,.20); + // drawPULabel(0.17,.25); + // drawEtaLabel("1.64","2.14",0.17,.20); pad2->cd(); pad2->SetLogx(1); @@ -341,10 +358,25 @@ void produceRatePlotsForApproval() pad2->SetTopMargin(0.06); pad2->SetBottomMargin(0.4); - hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); - hh_ratio->SetMinimum(0.01); + hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.01,1.1,kAzure+1); hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); - hh_ratio->Draw("e1"); + hh_ratio->Draw("P"); + + hh_ratio_gmt = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.01,1.1,kRed); + hh_ratio_gmt->Draw("P same"); + + leg = new TLegend(0.15,0.45,.4,0.7,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetTextSize(0.1); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(hh_ratio_gmt, "tight/GMT","p"); + leg->AddEntry(hh_ratio, "tight/medium","p"); + // leg->AddEntry(hh_ratio_gmt, "2+ME1/b+GEM / GMT","p"); + // leg->AddEntry(hh_ratio, "2+ME1/b+GEM / 2+ME1/b","p"); + + leg->Draw("same"); + c->SaveAs(plots + "GMT_2s_2s1b_2s1bgem_loose" + ext); } { @@ -365,23 +397,34 @@ void produceRatePlotsForApproval() result_gmtsing__pat8->GetYaxis()->SetRangeUser(0.1, 10000.); result_gmtsing__pat8->GetXaxis()->SetTitle(""); - TLegend *leg = new TLegend(0.49,0.6,.98,0.92,NULL,"brNDC"); + TLegend *leg = new TLegend(0.52,0.65,.93,0.93,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); - leg->AddEntry((TObject*)0, "Global Muon Trigger:",""); - leg->AddEntry(result_gmtsing__pat8, "default muon selection","f"); - leg->AddEntry((TObject*)0, "",""); - leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); - leg->AddEntry(result_def_2s__pat8, "#geq 2 stubs","f"); - leg->AddEntry(result_def_2s1b__pat8,"#geq 2 with ME1/b stub","f"); - leg->AddEntry(result_gem_2s1b__pat8,"#geq 2 with ME1/b stub ","f"); - leg->AddEntry((TObject*)0, " and GEM pad",""); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + // leg->AddEntry((TObject*)0, "Global Muon Trigger [GMT]:",""); + // leg->AddEntry(result_gmtsing__pat8, "default muon selection","f"); + // leg->AddEntry((TObject*)0, "",""); + // leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); + // leg->AddEntry(result_def_2s__pat8, "#geq 2 stubs","f"); + // leg->AddEntry(result_def_2s1b__pat8,"#geq 2 with ME1/b stub","f"); + // leg->AddEntry(result_gem_2s1b__pat8,"#geq 2 with ME1/b stub ","f"); + // leg->AddEntry((TObject*)0, " and GEM pad",""); + leg->AddEntry((TObject*)0, "Single muon trigger in",""); + leg->AddEntry(result_gmtsing__pat8, "2012 configuration [GMT]","f"); + // leg->AddEntry((TObject*)0, "",""); + leg->AddEntry((TObject*)0, "CSC track selection:",""); + leg->AddEntry(result_def_2s__pat8, "#geq 2 stations, loose","f"); + leg->AddEntry(result_def_2s1b__pat8,"#geq 2 stations, medium","f"); + leg->AddEntry(result_gem_2s1b__pat8,"#geq 2 stations, tight","f"); + leg->Draw(); + // drawL1Label(0.17,0.35); drawLumiLabel(0.17,.3); - drawPULabel(0.17,.25); - drawEtaLabel("1.64","2.14",0.17,.20); + // drawPULabel(0.17,.25); + // drawEtaLabel("1.64","2.14",0.17,.20); pad2->cd(); pad2->SetLogx(1); @@ -395,10 +438,31 @@ void produceRatePlotsForApproval() pad2->SetTopMargin(0.06); pad2->SetBottomMargin(0.4); - hh_ratio = setHistoRatio(result_gem_2s1b__pat8, result_def_2s1b__pat8, "", 0.,1.1); - hh_ratio->SetMinimum(0.01); + + hh_ratio = setHistoRatio(result_gem_2s1b__pat8, result_def_2s1b__pat8, "", 0.01,1.1,kAzure+1); hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); - hh_ratio->Draw("e1"); + hh_ratio->Draw("P"); + + hh_ratio_gmt = setHistoRatio(result_gem_2s1b__pat8, result_gmtsing__pat8, "", 0.01,1.1,kRed); + hh_ratio_gmt->Draw("P same"); + + leg = new TLegend(0.15,0.45,.4,0.7,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.1); + // leg->AddEntry(hh_ratio_gmt, "2+ME1/b+GEM / GMT","p"); + // leg->AddEntry(hh_ratio, "2+ME1/b+GEM / 2+ME1/b","p"); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(hh_ratio_gmt, "tight/GMT","p"); + leg->AddEntry(hh_ratio, "tight/medium","p"); + leg->Draw("same"); + + // hh_ratio = setHistoRatio(result_gem_2s1b__pat8, result_def_2s1b__pat8, "", 0.,1.1); + // hh_ratio->SetMinimum(0.01); + // hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); + // hh_ratio->Draw("e1"); + c->SaveAs(plots + "GMT_2s_2s1b_2s1bgem_tight" + ext); } @@ -420,23 +484,34 @@ void produceRatePlotsForApproval() result_gmtsing__pat2->GetYaxis()->SetRangeUser(0.01, 10000.); result_gmtsing__pat2->GetXaxis()->SetTitle(""); - TLegend *leg = new TLegend(0.49,0.6,.98,0.92,NULL,"brNDC"); + TLegend *leg = new TLegend(0.52,0.65,.93,0.93,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); - leg->AddEntry((TObject*)0, "Global Muon Trigger:",""); - leg->AddEntry(result_gmtsing__pat2, "default muon selection","f"); - leg->AddEntry((TObject*)0, "",""); - leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); - leg->AddEntry(result_def_3s__pat2, "#geq 3 stubs","f"); - leg->AddEntry(result_def_3s1b__pat2,"#geq 3 with ME1/b stub","f"); - leg->AddEntry(result_gem_3s1b__pat2,"#geq 3 with ME1/b stub ","f"); - leg->AddEntry((TObject*)0, " and GEM pad",""); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + // leg->AddEntry((TObject*)0, "Global Muon Trigger [GMT]:",""); + // leg->AddEntry(result_gmtsing__pat2, "default muon selection","f"); + // leg->AddEntry((TObject*)0, "",""); + // leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); + // leg->AddEntry(result_def_3s__pat2, "#geq 3 stubs","f"); + // leg->AddEntry(result_def_3s1b__pat2,"#geq 3 with ME1/b stub","f"); + // leg->AddEntry(result_gem_3s1b__pat2,"#geq 3 with ME1/b stub ","f"); + // leg->AddEntry((TObject*)0, " and GEM pad",""); + leg->AddEntry((TObject*)0, "Single muon trigger in",""); + leg->AddEntry(result_gmtsing__pat2, "2012 configuration [GMT]","f"); + // leg->AddEntry((TObject*)0, "",""); + leg->AddEntry((TObject*)0, "CSC track selection:",""); + leg->AddEntry(result_def_3s__pat2, "#geq 3 stations, loose","f"); + leg->AddEntry(result_def_3s1b__pat2,"#geq 3 stations, medium","f"); + leg->AddEntry(result_gem_3s1b__pat2,"#geq 3 stations, tight","f"); + leg->Draw(); + // drawL1Label(0.17,0.35); drawLumiLabel(0.17,.3); - drawPULabel(0.17,.25); - drawEtaLabel("1.64","2.14",0.17,.20); + // drawPULabel(0.17,.25); + // drawEtaLabel("1.64","2.14",0.17,.20); pad2->cd(); pad2->SetLogx(1); @@ -450,10 +525,31 @@ void produceRatePlotsForApproval() pad2->SetTopMargin(0.06); pad2->SetBottomMargin(0.4); - hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); - hh_ratio->SetMinimum(0.01); + + hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.01,1.1,kAzure+1); hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); - hh_ratio->Draw("e1"); + hh_ratio->Draw("P"); + + hh_ratio_gmt = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.01,1.1,kRed); + hh_ratio_gmt->Draw("P same"); + + leg = new TLegend(0.15,0.44,.4,0.7,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.1); + // leg->AddEntry(hh_ratio_gmt, "3+ME1/b+GEM / GMT","p"); + // leg->AddEntry(hh_ratio, "3+ME1/b+GEM / 3+ME1/b","p"); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(hh_ratio_gmt, "tight/GMT","p"); + leg->AddEntry(hh_ratio, "tight/medium","p"); + leg->Draw("same"); + + // hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); + // hh_ratio->SetMinimum(0.01); + // hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); + // hh_ratio->Draw("e1"); + c->SaveAs(plots + "GMT_3s_3s1b_3s1bgem_loose" + ext); } @@ -475,23 +571,34 @@ void produceRatePlotsForApproval() result_gmtsing__pat8->GetYaxis()->SetRangeUser(0.01, 10000.); result_gmtsing__pat8->GetXaxis()->SetTitle(""); - TLegend *leg = new TLegend(0.49,0.6,.98,0.92,NULL,"brNDC"); + TLegend *leg = new TLegend(0.52,0.65,.93,0.93,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); - leg->AddEntry((TObject*)0, "Global Muon Trigger:",""); - leg->AddEntry(result_gmtsing__pat8, "default muon selection","f"); - leg->AddEntry((TObject*)0, "",""); - leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); - leg->AddEntry(result_def_3s__pat8, "#geq 3 stubs","f"); - leg->AddEntry(result_def_3s1b__pat8,"#geq 3 with ME1/b stub","f"); - leg->AddEntry(result_gem_3s1b__pat8,"#geq 3 with ME1/b stub ","f"); - leg->AddEntry((TObject*)0, " and GEM pad",""); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + // leg->AddEntry((TObject*)0, "Global Muon Trigger [GMT]:",""); + // leg->AddEntry(result_gmtsing__pat8, "default muon selection","f"); + // leg->AddEntry((TObject*)0, "",""); + // leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); + // leg->AddEntry(result_def_3s__pat8, "#geq 3 stubs","f"); + // leg->AddEntry(result_def_3s1b__pat8,"#geq 3 with ME1/b stub","f"); + // leg->AddEntry(result_gem_3s1b__pat8,"#geq 3 with ME1/b stub ","f"); + // leg->AddEntry((TObject*)0, " and GEM pad",""); + leg->AddEntry((TObject*)0, "Single muon trigger in",""); + leg->AddEntry(result_gmtsing__pat8, "2012 configuration [GMT]","f"); + // leg->AddEntry((TObject*)0, "",""); + leg->AddEntry((TObject*)0, "CSC track selection:",""); + leg->AddEntry(result_def_3s__pat8, "#geq 3 stations, loose","f"); + leg->AddEntry(result_def_3s1b__pat8,"#geq 3 stations, medium","f"); + leg->AddEntry(result_gem_3s1b__pat8,"#geq 3 stations, tight","f"); + leg->Draw(); + // drawL1Label(0.17,0.35); drawLumiLabel(0.17,.3); - drawPULabel(0.17,.25); - drawEtaLabel("1.64","2.14",0.17,.20); + // drawPULabel(0.17,.25); + // drawEtaLabel("1.64","2.14",0.17,.20); pad2->cd(); pad2->SetLogx(1); @@ -505,13 +612,152 @@ void produceRatePlotsForApproval() pad2->SetTopMargin(0.06); pad2->SetBottomMargin(0.4); - hh_ratio = setHistoRatio(result_gem_3s1b__pat8, result_def_3s1b__pat8, "", 0.,1.1); - hh_ratio->SetMinimum(0.01); + hh_ratio = setHistoRatio(result_gem_3s1b__pat8, result_def_3s1b__pat8, "", 0.01,1.1,kAzure+1); hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); - hh_ratio->Draw("e1"); + hh_ratio->Draw("P"); + + hh_ratio_gmt = setHistoRatio(result_gem_3s1b__pat8, result_gmtsing__pat8, "", 0.01,1.1,kRed); + hh_ratio_gmt->Draw("P same"); + + leg = new TLegend(0.15,0.45,.4,0.7,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.1); + // leg->AddEntry(hh_ratio_gmt, "3+ME1/b+GEM / GMT","p"); + // leg->AddEntry(hh_ratio, "3+ME1/b+GEM / 3+ME1/b","p"); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(hh_ratio_gmt, "tight/GMT","p"); + leg->AddEntry(hh_ratio, "tight/medium","p"); + leg->Draw("same"); + c->SaveAs(plots + "GMT_3s_3s1b_3s1bgem_tight" + ext); } + // EXTRA PLOTS + + { + result_def_2s__pat8->SetFillColor(kViolet+2); + result_def_2s1b__pat8->SetFillColor(kAzure+2); + result_gem_2s1b__pat8->SetFillColor(kGreen-1); + + + // GMT; CSCTF 2 stubs; CSCTF 2 stubs + ME1/b; CSCTF 2 stubs + ME1/b + GEM -- LOOSE & TIGHT-- Absolute + ratio + TCanvas* c = new TCanvas("c","c",1000,800); + c->Clear(); + TPad *pad1 = new TPad("pad1","top pad",0.0,0.O,1.0,1.0); + pad1->Draw(); + + pad1->cd(); + pad1->SetLogx(1); + pad1->SetLogy(1); + pad1->SetGridx(1); + pad1->SetGridy(1); + pad1->SetFrameBorderMode(0); + pad1->SetFillColor(kWhite); + + result_gmtsing__pat2->Draw("e3"); + result_def_2s__pat2->Draw("same e3"); + result_def_2s1b__pat2->Draw("same e3"); + result_gem_2s1b__pat2->Draw("same e3"); + result_def_2s__pat8->Draw("same e3"); + result_def_2s1b__pat8->Draw("same e3"); + result_gem_2s1b__pat8->Draw("same e3"); + result_gmtsing__pat2->Draw("same e3"); + result_gmtsing__pat2->GetYaxis()->SetRangeUser(0.1, 10000.); + result_gmtsing__pat2->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); + + TLegend *leg = new TLegend(0.5,0.65,.92,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.03); + leg->AddEntry((TObject*)0, "Global Muon Trigger [GMT]:",""); + leg->AddEntry(result_gmtsing__pat2, "default muon selection","f"); + leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); + leg->AddEntry(result_def_2s__pat2, "#geq 2 stubs","f"); + leg->AddEntry(result_def_2s1b__pat2,"#geq 2 with ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat2,"#geq 2 with ME1/b stub and GEM pad","f"); + leg->AddEntry(result_def_2s__pat8, "#geq 2 stubs","f"); + leg->AddEntry(result_def_2s1b__pat8,"#geq 2 with ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat8,"#geq 2 with ME1/b stub and GEM pad","f"); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + + leg->Draw(); + + drawL1Label(0.17,0.35); + drawLumiLabel(0.17,.3); + drawPULabel(0.17,.25); + // drawEtaLabel("1.64","2.14",0.17,.20); + + c->SaveAs(plots + "GMT_2s_2s1b_2s1bgem" + ext); + + } + + { + result_def_3s__pat8->SetFillColor(kViolet+2); + result_def_3s1b__pat8->SetFillColor(kAzure+2); + result_gem_3s1b__pat8->SetFillColor(kGreen-1); + + + // GMT; CSCTF 3 stubs; CSCTF 3 stubs + ME1/b; CSCTF 3 stubs + ME1/b + GEM -- LOOSE & TIGHT-- Absolute + ratio + TCanvas* c = new TCanvas("c","c",1000,800); + c->Clear(); + TPad *pad1 = new TPad("pad1","top pad",0.0,0.O,1.0,1.0); + pad1->Draw(); + + pad1->cd(); + pad1->SetLogx(1); + pad1->SetLogy(1); + pad1->SetGridx(1); + pad1->SetGridy(1); + pad1->SetFrameBorderMode(0); + pad1->SetFillColor(kWhite); + + result_gmtsing__pat2->Draw("e3"); + result_def_3s__pat2->Draw("same e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_gem_3s1b__pat2->Draw("same e3"); + result_def_3s__pat8->Draw("same e3"); + result_def_3s1b__pat8->Draw("same e3"); + result_gem_3s1b__pat8->Draw("same e3"); + result_gmtsing__pat2->Draw("same e3"); + result_gmtsing__pat2->GetYaxis()->SetRangeUser(0.01, 10000.); + result_gmtsing__pat2->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); + + TLegend *leg = new TLegend(0.5,0.65,.92,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.03); + leg->AddEntry((TObject*)0, "Global Muon Trigger [GMT]:",""); + leg->AddEntry(result_gmtsing__pat2, "default muon selection","f"); + leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); + leg->AddEntry(result_def_3s__pat2, "#geq 3 stubs","f"); + leg->AddEntry(result_def_3s1b__pat2,"#geq 3 with ME1/b stub","f"); + leg->AddEntry(result_gem_3s1b__pat2,"#geq 3 with ME1/b stub and GEM pad","f"); + leg->AddEntry(result_def_3s__pat8, "#geq 3 stubs","f"); + leg->AddEntry(result_def_3s1b__pat8,"#geq 3 with ME1/b stub","f"); + leg->AddEntry(result_gem_3s1b__pat8,"#geq 3 with ME1/b stub and GEM pad","f"); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + + leg->Draw(); + + drawL1Label(0.17,0.35); + drawLumiLabel(0.17,.3); + drawPULabel(0.17,.25); + // drawEtaLabel("1.64","2.14",0.17,.20); + + c->SaveAs(plots + "GMT_3s_3s1b_3s1bgem" + ext); + + } + } +void produceRatePlotsForApproval() +{ + produceRatePlots(".pdf"); + produceRatePlots(".eps"); + produceRatePlots(".png"); +} From ed10df9e1d26dc54f7b777fcba2fe40275266ea0 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sun, 4 Aug 2013 12:44:15 +0200 Subject: [PATCH 002/182] fix plot --- SimMuL1/scripts/plotGEMCSCdPhi.py | 75 +++++++++++++++++++------------ 1 file changed, 46 insertions(+), 29 deletions(-) diff --git a/SimMuL1/scripts/plotGEMCSCdPhi.py b/SimMuL1/scripts/plotGEMCSCdPhi.py index e130e40847f29..b60e2755de086 100644 --- a/SimMuL1/scripts/plotGEMCSCdPhi.py +++ b/SimMuL1/scripts/plotGEMCSCdPhi.py @@ -31,42 +31,46 @@ def getTree(fileName): return tree -def plotGEMCSCdPhi(oddEven = "even", ext = ".pdf"): +def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): """Plot the GEM-CSC bending angles""" - txtHeader = TLegend(.13,.935,.97,1.); - txtHeader.SetFillColor(kWhite); - txtHeader.SetFillStyle(0); - txtHeader.SetBorderSize(0); - txtHeader.SetTextFont(42); - txtHeader.SetTextSize(0.045); - txtHeader.SetTextAlign(22); - txtHeader.SetHeader("|#phi(CSC strip)-#phi(GEM Pad4)| in %s numbered chambers"%(oddEven)); - - legend = TLegend(.4,.60,1.2,.92); - legend.SetFillColor(kWhite); - legend.SetFillStyle(0); - legend.SetBorderSize(0); - legend.SetTextSize(0.045); - legend.SetMargin(0.13); - - - t = getTree("files/gem_csc_delta_pt5_pad4.root"); - t1 = getTree("files/gem_csc_delta_pt20_pad4.root"); + t = getTree("%sgem_csc_delta_pt5_pad4.root"%(filesDir)); + t1 = getTree("%sgem_csc_delta_pt20_pad4.root"%(filesDir)); dphi_pt5 = TH1F("dphi_pt5","",600,0.0,0.03); dphi_pt20 = TH1F("dphi_pt20","",600,0.0,0.03); c = TCanvas("cDphi","cDphi",700,450); c.Clear() + c.SetGridx(1) + c.SetGridy(1) + + gStyle.SetTitleStyle(0) + gStyle.SetTitleAlign(13) ##// coord in top left + gStyle.SetTitleX(0.) + gStyle.SetTitleY(1.) + gStyle.SetTitleW(1) + gStyle.SetTitleH(0.058) + gStyle.SetTitleBorderSize(0) + + gStyle.SetPadLeftMargin(0.126) + gStyle.SetPadRightMargin(0.04) + gStyle.SetPadTopMargin(0.06) + gStyle.SetPadBottomMargin(0.13) + gStyle.SetOptStat(0) + gStyle.SetMarkerStyle(1) + +# setTDRStyle() if oddEven == "even": ok_pad_lct = ok_pad2_lct2 var = "dphi_pad_even" + closeFar = "close" else: ok_pad_lct = ok_pad1_lct1 var = "dphi_pad_odd" - + closeFar = "far" + t.Draw("TMath::Abs(%s)>>dphi_pt5"%(var) , ok_pad_lct); t1.Draw("TMath::Abs(%s)>>dphi_pt20"%(var) , ok_pad_lct); @@ -78,18 +82,31 @@ def plotGEMCSCdPhi(oddEven = "even", ext = ".pdf"): dphi_pt5.SetLineWidth(2); dphi_pt20.SetLineWidth(2); - dphi_pt20.GetXaxis().SetTitle("|#phi(CSC half-strip) - #phi(GEM pad)| [rad]"); + dphi_pt20.GetXaxis().SetTitle("GEM-CSC bending angle [rad]"); dphi_pt20.GetYaxis().SetTitle("A.U."); + dphi_pt20.SetTitle("GEM-CSC bending angle for muons in %s chambers"%(closeFar)); - legend.AddEntry(dphi_pt5,"Muons with p_{T}=5 GeV","L"); - legend.AddEntry(dphi_pt20,"Muons with p_{T}=20 GeV","L"); - dphi_pt20.Draw(); dphi_pt5.Draw("same"); - txtHeader.Draw("same"); + + legend = TLegend(.4,.6,.7,.8); + legend.SetFillColor(kWhite); + legend.SetFillStyle(0); + legend.SetBorderSize(0); + legend.SetTextSize(0.05); + legend.SetMargin(0.13); + legend.AddEntry(dphi_pt5,"p_{T}=5 GeV","L"); + legend.AddEntry(dphi_pt20,"p_{T}=20 GeV","L"); legend.Draw("same"); - c.SaveAs("plots/GEMCSCdPhi_%s_chambers%s"%(oddEven,ext)); + + c.SaveAs("%sGEMCSCdPhi_%s_chambers%s"%(plotDir, oddEven, ext)); if __name__ == "__main__": - plotGEMCSCdPhi("even") - plotGEMCSCdPhi("odd") + plotGEMCSCdPhi("files/", "plots/bending/", "even", ".png") + plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".png") + plotGEMCSCdPhi("files/", "plots/bending/", "even", ".pdf") + plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".pdf") + plotGEMCSCdPhi("files/", "plots/bending/", "even", ".eps") + plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".eps") + + From fbd56798daca0132895fe6753c38fc8f9774de10 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 5 Aug 2013 13:32:31 +0200 Subject: [PATCH 003/182] update efficiency plots --- SimMuL1/scripts/drawplot_eff.py | 37 +++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/SimMuL1/scripts/drawplot_eff.py b/SimMuL1/scripts/drawplot_eff.py index 399ab618c3c0b..a700429850767 100644 --- a/SimMuL1/scripts/drawplot_eff.py +++ b/SimMuL1/scripts/drawplot_eff.py @@ -5,10 +5,7 @@ from GEMCSCdPhiLib import * ## ROOT modules -from ROOT import TFile,TStyle,TKey,TTree,TH1F,TH2D,TObject,TF1 -from ROOT import TMath,TCanvas,TCut,TEfficiency,TLegend -from ROOT import gStyle,gROOT,gPad,gDirectory -from ROOT import kBlue,kRed,kFullStar, kViolet, kAzure, kGreen +from ROOT import * ## run quiet mode import sys @@ -290,7 +287,7 @@ def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): """Produce GEM turn-on curve""" pt = ["pt10","pt20","pt30","pt40"] - pt_labels = ["10","20","30","40"] + pt_labels = ["#geq 10","#geq 20","#geq 30","#geq 40"] marker_colors = [kRed, kViolet+1, kAzure+1, kGreen-2] marker_styles = [20,21,23,24] @@ -303,7 +300,7 @@ def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): c.cd() - h = TH1F("","Efficiency for track with LCT to have GEM pad in chamber;muon p_{T} [GeV/c];Efficiency",50,0.,50.) + h = TH1F("","GEM-CSC bending angle patterns for different p_{T} thresholds;muon p_{T} [GeV/c];Efficiency",50,0.,50.) h.SetStats(0) h.Draw("") @@ -317,23 +314,29 @@ def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): ok_dphi = TCut("TMath::Abs(dphi_pad_odd) < %f"%(dphi)) denom_cut = ok_pad1_lct1_eta - h2 = draw_eff(t, "Eff. for track with LCT to have matched GEM pad;p_{T} [GeV/c];Efficiency", "h2", "(50,0.,50.)", "pt", + h2 = draw_eff(t, "GEM-CSC bending angle patterns for different p_{T} thresholds;p_{T} [GeV/c];Efficiency", "h2", "(50,0.,50.)", "pt", denom_cut, ok_dphi, marker_colors[i], marker_styles[i]) + ## Eff. for track with LCT to have matched GEM pad histoList.append(h2) h2.SetMarkerSize(1) h2.Draw("same") ## add legend - leg_header = " #Delta#phi(LCT,GEM) is %s%% efficient for"%(eff) - leg = TLegend(0.50,0.17,.99,0.57, "", "brNDC") - leg.AddEntry(0, "%s chambers at pt"%(oddEven), "") + ## leg_header = " #Delta#phi(GEM,CSC) is %s%% efficient for"%(eff) + ## leg.AddEntry(0, "%s chambers at pt"%(oddEven), "") + leg = TLegend(0.5,0.2,.8,0.65, "", "brNDC") + leg_header = " " + leg.AddEntry(0, "muon p_{T} measured by %s"%(oddEven), "") + leg.AddEntry(0, "numbered GEM-CSC chambers", "") for n in range(len(pt)): leg.AddEntry(histoList[n], pt_labels[n], "p") leg.SetBorderSize(0) leg.SetFillStyle(0) +## leg.SetFillStyle(1001) +## leg.SetFillColor(kWhite) leg.SetHeader(leg_header) - leg.SetTextSize(0.05) + leg.SetTextSize(0.04) leg.Draw("same") ## save the file @@ -531,8 +534,9 @@ def eff_hs_10(filesDir, plotDir, f_name, ext): ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;p_{T} [GeV/c];Eff.", "h_evn", "(50,0.,50.)", "pt", ok_lct2_eta, ok_pad2) c.SaveAs("%stest%s"%(plotDir, ext)) +""" def eff_hs_11(filesDir, plotDir, f_name, ext): - """Comment to be added here""" + Comment to be added here t = getTree("%s%s"%(filesDir, f_name)); c = TCanvas("c","c",800,600) @@ -548,7 +552,7 @@ def eff_hs_11(filesDir, plotDir, f_name, ext): hg = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip number;Eff.", "h_odd", "(130,-0.2,0.2)", "fmod(phi+TMath::Pi()/36., TMath::Pi()/18.)", ok_eta, ok_pad1 || ok_pad2, "same"); hgp = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip number;Eff.", "h_odd", "(130,-0.2,0.2)", "fmod(phi+TMath::Pi()/36., TMath::Pi()/18.)", ok_eta&&Qpos, ok_pad1 || ok_pad2, "same", kGreen); c.SaveAs("%stest%s"%(plotDir, ext)) - +""" def eff_hs_all(filesDir, plotDir, f_name, ext): @@ -562,9 +566,10 @@ def eff_hs_all(filesDir, plotDir, f_name, ext): eff_hs_7(filesDir, plotDir, f_name, ext) eff_hs_8(filesDir, plotDir, f_name, ext) eff_hs_9(filesDir, plotDir, f_name, ext) +""" eff_hs_10(filesDir, plotDir, f_name, ext) eff_hs_11(filesDir, plotDir, f_name, ext) - +""" def eff_hs(filesDir, plotDir, ext): @@ -987,6 +992,7 @@ def eff_hs(filesDir, plotDir, ext): ## */ if __name__ == "__main__": + """ halfStripEfficiencies("files/", "plots/efficiency/", ".pdf") halfStripEfficiencies("files/", "plots/efficiency/", ".eps") halfStripEfficiencies("files/", "plots/efficiency/", ".png") @@ -994,11 +1000,10 @@ def eff_hs(filesDir, plotDir, ext): etaMatchingEfficiencies("files/", "plots/efficiency/", ".pdf") etaMatchingEfficiencies("files/", "plots/efficiency/", ".eps") etaMatchingEfficiencies("files/", "plots/efficiency/", ".png") - + """ gemTurnOns("files/", "plots/efficiency/", ".pdf") gemTurnOns("files/", "plots/efficiency/", ".eps") gemTurnOns("files/", "plots/efficiency/", ".png") - """ eff_hs("files/", "plots/efficiency/", ".pdf") eff_hs("files/", "plots/efficiency/", ".eps") From b3e0973e4fbec7c5620c0d624e8d85b619c04bb0 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 5 Aug 2013 21:27:31 +0200 Subject: [PATCH 004/182] Update GEMCSCTriggerRate.cc --- SimMuL1/plugins/GEMCSCTriggerRate.cc | 146 +++++++++------------------ 1 file changed, 49 insertions(+), 97 deletions(-) diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.cc b/SimMuL1/plugins/GEMCSCTriggerRate.cc index d742966180503..4592a4c3070aa 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRate.cc @@ -60,16 +60,6 @@ namespace } -/* -struct alct -{ - Int_t detId; - Short_t bx; - Float_t x, y; - Float_t g_r, g_eta, g_phi, g_x, g_y, g_z; - Float_t sdf; - }*/ - // ================================================================================================ // class' constants @@ -144,7 +134,7 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): debugTFCAND = iConfig.getUntrackedParameter("debugTFCAND", 0); debugGMTCAND = iConfig.getUntrackedParameter("debugGMTCAND", 0); debugL1EXTRA = iConfig.getUntrackedParameter("debugL1EXTRA", 0); - debugRATE = iConfig.getUntrackedParameter("debugRATE", 1); + debugRATE = iConfig.getUntrackedParameter("debugRATE", 0); minSimTrPt_ = iConfig.getUntrackedParameter("minSimTrPt", 2.); minSimTrPhi_ = iConfig.getUntrackedParameter("minSimTrPhi",-3.15); @@ -204,7 +194,7 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): ParameterSet stripPSet = iConfig.getParameter("strips"); theStripConditions = new CSCDbStripConditions(stripPSet); - CSCTFSPset = iConfig.getParameter("sectorProcessor"); + CSCTFSPset = iConfig.getParameter("SectorProcessor"); ptLUTset = CSCTFSPset.getParameter("PTLUT"); edm::ParameterSet srLUTset = CSCTFSPset.getParameter("SRLUT"); @@ -803,25 +793,20 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup // const CSCWireDigiCollection* wiredc = wireDigis.product(); // const CSCComparatorDigiCollection* compdc = compDigis.product(); - // ALCTs + // ALCTs and CLCTs Handle< CSCALCTDigiCollection > halcts; - iEvent.getByLabel("simCscTriggerPrimitiveDigis", halcts); - const CSCALCTDigiCollection* alcts = halcts.product(); - - /* - // CLCTs Handle< CSCCLCTDigiCollection > hclcts; + iEvent.getByLabel("simCscTriggerPrimitiveDigis", halcts); iEvent.getByLabel("simCscTriggerPrimitiveDigis", hclcts); + const CSCALCTDigiCollection* alcts = halcts.product(); const CSCCLCTDigiCollection* clcts = hclcts.product(); - // TMB LCTs + // strip&wire matching output after TMB and after MPC sorting Handle< CSCCorrelatedLCTDigiCollection > lcts_tmb; - const CSCCorrelatedLCTDigiCollection* lcts = lcts_tmb.product(); - iEvent.getByLabel("simCscTriggerPrimitiveDigis", lcts_tmb); - - // MPC LCTs Handle< CSCCorrelatedLCTDigiCollection > lcts_mpc; + iEvent.getByLabel("simCscTriggerPrimitiveDigis", lcts_tmb); iEvent.getByLabel("simCscTriggerPrimitiveDigis", "MPCSORTED", lcts_mpc); + const CSCCorrelatedLCTDigiCollection* lcts = lcts_tmb.product(); const CSCCorrelatedLCTDigiCollection* mplcts = lcts_mpc.product(); // DT primitives for input to TF @@ -850,10 +835,6 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup vector l1GmtRPCbCands; vector l1GmtDTCands; - - */ - - /* // key = BX map > l1GmtCSCCandsInBXs; @@ -930,13 +911,12 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup muPtScaleCacheID_ = iSetup.get< L1MuTriggerPtScaleRcd >().cacheIdentifier(); } - */ + // //======================================================================= // //============================= RATES =================================== - // //======================================================================= //============ RATE ALCT ================== @@ -966,34 +946,36 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup const CSCALCTDigiCollection::Range& range = (*adetUnitIt).second; for (CSCALCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) { - if (!(*digiIt).isValid()) continue; - int bx = (*digiIt).getBX(); - //if ( bx-6 < minBX_ || bx-6 > maxBX_ ) - if ( bx < minBxALCT_ || bx > maxBxALCT_ ) - { - if (debugRATE) cout<<"discarding BX = "<< bx-6 <Fill( bx - 6 ); - h_rt_alct_bx_cscdet[csct]->Fill( bx - 6 ); - if (bx>=5 && bx<=7) h_rt_csctype_alct_bx567->Fill(cscst); - + if ((*digiIt).isValid()) + { + int bx = (*digiIt).getBX(); + //if ( bx-6 < minBX_ || bx-6 > maxBX_ ) + if ( bx < minBxALCT_ || bx > maxBxALCT_ ) + { + if (debugRATE) cout<<"discarding BX = "<< bx-6 <Fill( bx - 6 ); + h_rt_alct_bx_cscdet[csct]->Fill( bx - 6 ); + if (bx>=5 && bx<=7) h_rt_csctype_alct_bx567->Fill(cscst); + + } //if (alct_valid) } for (int b=0;b<16;b++) { @@ -1039,20 +1021,6 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup if (debugRATE) cout<< "----- end nalct="<Fill(myTFTrk.pt); h_rt_tftrack_bx->Fill(trk->first.bx()); h_rt_tftrack_mode->Fill(myTFTrk.mode()); @@ -1677,12 +1645,8 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup if (eta_me42) h_rt_gmt_csc_pt_2s42->Fill(gpt); if (eta_me42r) h_rt_gmt_csc_pt_2s42r->Fill(gpt); if ( gpt > max_pt_2s ) { max_pt_2s = gpt; max_pt_2s_eta = geta; } - if (eta_me1b && gpt > max_pt_2s_1b ) { max_pt_2s_1b = gpt; - //max_pt_2s_eta_1b = geta; - } - if (eta_no1a && gpt > max_pt_2s_no1a) { max_pt_2s_no1a = gpt; - //max_pt_2s_eta_no1a = geta; - } + if (eta_me1b && gpt > max_pt_2s_1b ) { max_pt_2s_1b = gpt; /*max_pt_2s_eta_1b = geta;*/ } + if (eta_no1a && gpt > max_pt_2s_no1a) { max_pt_2s_no1a = gpt; /*max_pt_2s_eta_no1a = geta;*/ } if (eta_me42 && gpt > max_pt_me42_2s) max_pt_me42_2s = gpt; if (eta_me42r && gpt>max_pt_me42r_2s) max_pt_me42r_2s = gpt; } @@ -2320,29 +2284,18 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup if (isCSC && gpt > max_pt_sing_csc ) { max_pt_sing_csc = gpt; max_pt_eta_sing_csc = geta; } if ((isCSC||isDT) && gpt > max_pt_sing_dtcsc ) { max_pt_sing_dtcsc = gpt; max_pt_eta_sing_dtcsc = geta; } if (gpt > max_pt_sing_3s && ( !isCSC || isCSC3s ) ) {max_pt_sing_3s = gpt; max_pt_eta_sing_3s = geta;} - if (eta_me1b && gpt > max_pt_sing_1b ) { max_pt_sing_1b = gpt; - max_pt_eta_sing_1b = geta; - // - } - if (eta_no1a && gpt > max_pt_sing_no1a) { max_pt_sing_no1a = gpt; - //max_pt_eta_sing_no1a = geta; - } - } + if (eta_me1b && gpt > max_pt_sing_1b ) { max_pt_sing_1b = gpt; /*max_pt_eta_sing_1b = geta;*/ } + if (eta_no1a && gpt > max_pt_sing_no1a) { max_pt_sing_no1a = gpt; /*max_pt_eta_sing_no1a = geta;*/ } + } if (isSingle6TrigOk) { if ( gpt > max_pt_sing6 ) { max_pt_sing6 = gpt; max_pt_eta_sing6 = geta;} if (isCSC && gpt > max_pt_sing6_csc ) { max_pt_sing6_csc = gpt; max_pt_eta_sing6_csc = geta; } if (gpt > max_pt_sing6_3s && ( !isCSC || isCSC3s ) ) {max_pt_sing6_3s = gpt; max_pt_eta_sing6_3s = geta;} - if (eta_me1b && gpt > max_pt_sing6_1b ) { max_pt_sing6_1b = gpt; - max_pt_eta_sing6_1b = geta; - } - if (eta_no1a && gpt > max_pt_sing6_no1a) { max_pt_sing6_no1a = gpt; - //max_pt_eta_sing6_no1a = geta; - } + if (eta_me1b && gpt > max_pt_sing6_1b ) { max_pt_sing6_1b = gpt; /*max_pt_eta_sing6_1b = geta;*/ } + if (eta_no1a && gpt > max_pt_sing6_no1a) { max_pt_sing6_no1a = gpt; /*max_pt_eta_sing6_no1a = geta;*/ } if (eta_no1a && gpt > max_pt_sing6_3s1b_no1a && - (!eta_me1b || (eta_me1b && has_me1_stub && n_stubs >=3) ) ) { max_pt_sing6_3s1b_no1a = gpt; - max_pt_eta_sing6_no1a = geta; - } + (!eta_me1b || (eta_me1b && has_me1_stub && n_stubs >=3) ) ) { max_pt_sing6_3s1b_no1a = gpt; /*max_pt_eta_sing6_no1a = geta;*/ } } } } @@ -2408,8 +2361,7 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup // matches.clear (); // cleanUp(); -*/ - return true; + return true; } From cf3f00a4c98bc3526ea694abb1718de196035697 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 5 Aug 2013 23:54:27 +0200 Subject: [PATCH 005/182] update plots --- SimMuL1/scripts/drawplot_etastep.C | 3466 ++++++++++++++-------------- SimMuL1/scripts/drawplot_gmtrt.C | 2930 ++++++++++++----------- 2 files changed, 3279 insertions(+), 3117 deletions(-) diff --git a/SimMuL1/scripts/drawplot_etastep.C b/SimMuL1/scripts/drawplot_etastep.C index d6e74db187abd..8f8351ac71dd6 100644 --- a/SimMuL1/scripts/drawplot_etastep.C +++ b/SimMuL1/scripts/drawplot_etastep.C @@ -1,10 +1,10 @@ //int kGray=920, kOrange=800, kSpring=820, kTeal=840, kAzure=860, kViolet=880, kPink=900; - +gROOT->SetBatch(1); TFile *f; -char pdir[111]; +char pdir[111] = "plots/efficiency/"; TObject* NUL; @@ -13,6 +13,8 @@ TH1F *gh; TH1D *h1, *h2, *he; +TString plotDir = "plots/efficiency/"; + double yrange[2]={0.,1.04}; //double yrange[2]={0.5,1.02}; @@ -28,59 +30,59 @@ bool h_eff_eta_steps_full10 = true; void dp(char *prc, char *g, char *pu, int st, char *suffix="", char *neu="") { -char nm[300], fnm[300],onm[300]; -//sprintf(nm,"%s_2_2_6_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3",prc,pu,g,st); -sprintf(nm,"%s_3_6_2_%spu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,neu,pu,g,st,suffix); -//sprintf(nm,"%s_3_7_0_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3",prc,pu,g,st); -sprintf(fnm,"../hp_%s.root",nm); -sprintf(onm,"st_%s",nm); -drawplot_etastep(fnm,"StrictChamber",onm); + char nm[300], fnm[300],onm[300]; + //sprintf(nm,"%s_2_2_6_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3",prc,pu,g,st); + sprintf(nm,"%s_3_6_2_%spu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,neu,pu,g,st,suffix); + //sprintf(nm,"%s_3_7_0_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3",prc,pu,g,st); + sprintf(fnm,"../hp_%s.root",nm); + sprintf(onm,"st_%s",nm); + drawplot_etastep(fnm,"StrictChamber",onm); } TPaveStats* GetStat(TH1*h) { -TPaveStats* stat = (TPaveStats*)h->FindObject("stats"); -return stat; + TPaveStats* stat = (TPaveStats*)h->FindObject("stats"); + return stat; } TPaveStats* SetOptStat(TH1*h,int op) { -TPaveStats* stat = GetStat(h); -stat->SetOptStat(op); -return stat; + TPaveStats* stat = GetStat(h); + stat->SetOptStat(op); + return stat; } TObject* getH(char dir[100], char name[100]) { -char nm[222]; -sprintf(nm,"%s/%s;1",dir,name); -return f->Get(nm); + char nm[222]; + sprintf(nm,"%s/%s;1",dir,name); + return f->Get(nm); } void Print(TCanvas *c, char nm[200]) { -gPad->RedrawAxis(); -char dirnm[200]; -sprintf(dirnm,"%s/%s",pdir,nm); -c->Print(dirnm); + gPad->RedrawAxis(); + char dirnm[200]; + sprintf(dirnm,"%s/%s",pdir,nm); + c->Print(dirnm); } void myRebin(TH1D* h, int n) { -int nb = h->GetNbinsX(); -Double_t entr = h->GetEntries(); -Double_t bin0 = h->GetBinContent(0); -Double_t binN1 = h->GetBinContent(nb+1); -if (nb % n) binN1 += h->Integral(nb - nb%n + 1,nb); -h->Rebin(n); -nb = h->GetNbinsX(); -h->SetBinContent(0,bin0); -h->SetBinContent(nb+1,binN1); -h->SetEntries(entr); + int nb = h->GetNbinsX(); + Double_t entr = h->GetEntries(); + Double_t bin0 = h->GetBinContent(0); + Double_t binN1 = h->GetBinContent(nb+1); + if (nb % n) binN1 += h->Integral(nb - nb%n + 1,nb); + h->Rebin(n); + nb = h->GetNbinsX(); + h->SetBinContent(0,bin0); + h->SetBinContent(nb+1,binN1); + h->SetEntries(entr); } TH1D* setEffHisto(char *num_name, char *den_name, char *dir, int nrebin, @@ -88,1054 +90,1064 @@ TH1D* setEffHisto(char *num_name, char *den_name, char *dir, int nrebin, char *htitle, char *xtitle, char *ytitle, double *x_range, double *y_range) { -TH1D* hd0 = (TH1D*)getH(dir,den_name); -TH1D* hn0 = (TH1D*)getH(dir,num_name); + TH1D* hd0 = (TH1D*)getH(dir,den_name); + TH1D* hn0 = (TH1D*)getH(dir,num_name); -TString sden_name(den_name); -TString snum_name(num_name); + TString sden_name(den_name); + TString snum_name(num_name); -TH1D* hd = (TH1D*)hd0->Clone(sden_name+"_cln"); -TH1D* hn = (TH1D*)hn0->Clone(snum_name+"_cln"); -hd->Sumw2(); -hn->Sumw2(); + TH1D* hd = (TH1D*)hd0->Clone(sden_name+"_cln"); + TH1D* hn = (TH1D*)hn0->Clone(snum_name+"_cln"); + hd->Sumw2(); + hn->Sumw2(); -myRebin(hd, nrebin); -myRebin(hn, nrebin); + myRebin(hd, nrebin); + myRebin(hn, nrebin); -TH1D* heff = (TH1D*)hn->Clone(snum_name+"_eff"); + TH1D* heff = (TH1D*)hn->Clone(snum_name+"_eff"); -hd->Sumw2(); -heff->Sumw2(); + hd->Sumw2(); + heff->Sumw2(); -heff->Divide(heff,hd); + heff->Divide(heff,hd); -heff->SetLineColor(lcolor); -heff->SetLineStyle(lstyle); -heff->SetLineWidth(lwidth); + heff->SetLineColor(lcolor); + heff->SetLineStyle(lstyle); + heff->SetLineWidth(lwidth); -heff->SetTitle(htitle); -heff->GetXaxis()->SetTitle(xtitle); -heff->GetYaxis()->SetTitle(ytitle); -heff->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); -heff->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); + heff->SetTitle(htitle); + heff->GetXaxis()->SetTitle(xtitle); + heff->GetYaxis()->SetTitle(ytitle); + heff->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); + heff->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); -heff->GetXaxis()->SetTitleSize(0.07); -heff->GetXaxis()->SetTitleOffset(0.7); -heff->GetYaxis()->SetLabelOffset(0.015); + heff->GetXaxis()->SetTitleSize(0.07); + heff->GetXaxis()->SetTitleOffset(0.7); + heff->GetYaxis()->SetLabelOffset(0.015); -heff->GetXaxis()->SetLabelSize(0.05); -heff->GetYaxis()->SetLabelSize(0.05); + heff->GetXaxis()->SetLabelSize(0.05); + heff->GetYaxis()->SetLabelSize(0.05); -return heff; + return heff; } TH1D* getEffHisto(TString fname, TString hdir, TString num_name, TString den_name, int nrebin, int lcolor, int lstyle, int lwidth, TString title, double *x_range, double *y_range) { -TFile *fh = TFile::Open(fname); + TFile *fh = TFile::Open(fname); + + TH1D* hd0 = (TH1D*)fh->Get(hdir + "/" + den_name); + TH1D* hn0 = (TH1D*)fh->Get(hdir + "/" + num_name); + + TH1D* hd = (TH1D*)hd0->Clone(den_name+"_cln_"+fname); + TH1D* hn = (TH1D*)hn0->Clone(num_name+"_cln_"+fname); + hd->Sumw2(); + hn->Sumw2(); -TH1D* hd0 = (TH1D*)fh->Get(hdir + "/" + den_name); -TH1D* hn0 = (TH1D*)fh->Get(hdir + "/" + num_name); + myRebin(hd, nrebin); + myRebin(hn, nrebin); -TH1D* hd = (TH1D*)hd0->Clone(den_name+"_cln_"+fname); -TH1D* hn = (TH1D*)hn0->Clone(num_name+"_cln_"+fname); -hd->Sumw2(); -hn->Sumw2(); + TH1D* heff = (TH1D*)hn->Clone(num_name+"_eff_"+fname); -myRebin(hd, nrebin); -myRebin(hn, nrebin); + hd->Sumw2(); + heff->Sumw2(); -TH1D* heff = (TH1D*)hn->Clone(num_name+"_eff_"+fname); + heff->Divide(heff,hd); -hd->Sumw2(); -heff->Sumw2(); + heff->SetLineColor(lcolor); + heff->SetLineStyle(lstyle); + heff->SetLineWidth(lwidth); -heff->Divide(heff,hd); + heff->SetTitle(title); + heff->SetTitleSize(0.05); -heff->SetLineColor(lcolor); -heff->SetLineStyle(lstyle); -heff->SetLineWidth(lwidth); + heff->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); + heff->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); -heff->SetTitle(title); -//heff->GetXaxis()->SetTitle(xtitle); -//heff->GetYaxis()->SetTitle(ytitle); -heff->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); -heff->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); + heff->GetXaxis()->SetLabelOffset(0.015); + heff->GetYaxis()->SetLabelOffset(0.015); -heff->GetXaxis()->SetTitleSize(0.07); -heff->GetXaxis()->SetTitleOffset(0.7); -heff->GetYaxis()->SetLabelOffset(0.015); + heff->GetXaxis()->SetLabelSize(0.05); + heff->GetYaxis()->SetLabelSize(0.05); -heff->GetXaxis()->SetLabelSize(0.05); -heff->GetYaxis()->SetLabelSize(0.05); + heff->GetXaxis()->SetTitleOffset(1.2); + heff->GetYaxis()->SetTitleOffset(1.2); -h1 = hn0; -h2 = hd0; -he = heff; + heff->GetXaxis()->SetTitleSize(0.05); + heff->GetYaxis()->SetTitleSize(0.05); -//fh->Close(); -return heff; + + h1 = hn0; + h2 = hd0; + he = heff; + + return heff; } -void gem_eff_draw() +void gem_eff_draw(TString ext) { -gStyle->SetOptStat(0); -gStyle->SetTitleStyle(0); - -int ptreb=2; + gStyle->SetOptStat(0); + gStyle->SetTitleStyle(0); + gStyle->SetTitleBorderSize(0); + gStyle->SetTitleStyle(0); -TString hdir = "SimMuL1StrictAll"; + int ptreb=2; -TString f_def = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_def_pat2.root"; -TString f_g98_pt10 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt10_pat2.root"; -TString f_g98_pt15 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt15_pat2.root"; -TString f_g98_pt20 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt20_pat2.root"; -TString f_g98_pt30 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt30_pat2.root"; -TString f_g98_pt40 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt40_pat2.root"; + TString hdir = "SimMuL1StrictAll"; -double rpt[2] = {0.,49.99}; + TString f_def = "files/hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_def_pat2.root"; + TString f_g98_pt10 = "files/hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt10_pat2.root"; + TString f_g98_pt15 = "files/hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt15_pat2.root"; + TString f_g98_pt20 = "files/hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt20_pat2.root"; + TString f_g98_pt30 = "files/hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt30_pat2.root"; + TString f_g98_pt40 = "files/hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt40_pat2.root"; -TString htitle = "Efficiency for #mu in 1.6<|#eta|<2.12 to have TF track;p_{T}^{MC}"; + double rpt[2] = {0.,49.99}; -TString hini = "h_pt_initial_1b"; -TString h2s = "h_pt_after_tfcand_eta1b_2s"; -TString h3s = "h_pt_after_tfcand_eta1b_3s"; -TString h2s1b = "h_pt_after_tfcand_eta1b_2s1b"; -TString h3s1b = "h_pt_after_tfcand_eta1b_3s1b"; + TString htitle = "Efficiency for a muon in 1.6<|#eta|<2.12 to have TF track;p_{T}^{MC} [GeV/c];Efficiency"; + TString hini = "h_pt_initial_1b"; + TString h2s = "h_pt_after_tfcand_eta1b_2s"; + TString h3s = "h_pt_after_tfcand_eta1b_3s"; + TString h2s1b = "h_pt_after_tfcand_eta1b_2s1b"; + TString h3s1b = "h_pt_after_tfcand_eta1b_3s1b"; -TH1D* h_eff_tf0_2s = getEffHisto(f_def, hdir, h2s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_tf0_3s = getEffHisto(f_def, hdir, h3s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_tf0_2s1b = getEffHisto(f_def, hdir, h2s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_tf0_3s1b = getEffHisto(f_def, hdir, h3s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_tf0_2s = getEffHisto(f_def, hdir, h2s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_tf0_3s = getEffHisto(f_def, hdir, h3s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_tf0_2s1b = getEffHisto(f_def, hdir, h2s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_tf0_3s1b = getEffHisto(f_def, hdir, h3s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_tf10_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_3s = getEffHisto(f_def, hdir, h3s + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf15_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf15_3s = getEffHisto(f_def, hdir, h3s + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf15_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_3s = getEffHisto(f_def, hdir, h3s + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_2s = getEffHisto(f_def, hdir, h2s + "_pt20", hini, ptreb, kOrange+4, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_3s = getEffHisto(f_def, hdir, h3s + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf15_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf15_3s = getEffHisto(f_def, hdir, h3s + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf15_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf30_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf30_3s = getEffHisto(f_def, hdir, h3s + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf30_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_2s = getEffHisto(f_def, hdir, h2s + "_pt20", hini, ptreb, kOrange+4, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_3s = getEffHisto(f_def, hdir, h3s + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf40_2s = getEffHisto(f_def, hdir, h2s + "_pt40", hini, ptreb, kViolet+4, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf40_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt40", hini, ptreb, kViolet, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf40_3s = getEffHisto(f_def, hdir, h3s + "_pt40", hini, ptreb, kViolet, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf40_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt40", hini, ptreb, kViolet, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf30_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf30_3s = getEffHisto(f_def, hdir, h3s + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf30_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf40_2s = getEffHisto(f_def, hdir, h2s + "_pt40", hini, ptreb, kViolet+4, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf40_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt40", hini, ptreb, kViolet, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf40_3s = getEffHisto(f_def, hdir, h3s + "_pt40", hini, ptreb, kViolet, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf40_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt40", hini, ptreb, kViolet, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_gpt10_2s1b = getEffHisto(f_g98_pt10, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_gpt10_3s1b = getEffHisto(f_g98_pt10, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf15_gpt15_2s1b = getEffHisto(f_g98_pt15, hdir, h2s1b + "_pt15", hini, ptreb, kBlue, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf15_gpt15_3s1b = getEffHisto(f_g98_pt15, hdir, h3s1b + "_pt15", hini, ptreb, kBlue, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_gpt10_2s1b = getEffHisto(f_g98_pt10, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_gpt10_3s1b = getEffHisto(f_g98_pt10, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_gpt20_2s1b = getEffHisto(f_g98_pt20, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_gpt20_3s1b = getEffHisto(f_g98_pt20, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf15_gpt15_2s1b = getEffHisto(f_g98_pt15, hdir, h2s1b + "_pt15", hini, ptreb, kBlue, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf15_gpt15_3s1b = getEffHisto(f_g98_pt15, hdir, h3s1b + "_pt15", hini, ptreb, kBlue, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf30_gpt30_2s1b = getEffHisto(f_g98_pt30, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf30_gpt30_3s1b = getEffHisto(f_g98_pt30, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_gpt20_2s1b = getEffHisto(f_g98_pt20, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_gpt20_3s1b = getEffHisto(f_g98_pt20, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf40_gpt40_2s1b = getEffHisto(f_g98_pt40, hdir, h2s1b + "_pt40", hini, ptreb, kViolet, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf40_gpt40_3s1b = getEffHisto(f_g98_pt40, hdir, h3s1b + "_pt40", hini, ptreb, kViolet, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf30_gpt30_2s1b = getEffHisto(f_g98_pt30, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf30_gpt30_3s1b = getEffHisto(f_g98_pt30, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf40_gpt40_2s1b = getEffHisto(f_g98_pt40, hdir, h2s1b + "_pt40", hini, ptreb, kViolet, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf40_gpt40_3s1b = getEffHisto(f_g98_pt40, hdir, h3s1b + "_pt40", hini, ptreb, kViolet, 7, 2, htitle, rpt,yrange); -TCanvas* c2s1b = new TCanvas("c2s1b","c2s1b",800,600) ; -/* -TH1D* h_eff_gmt20_1b = getEffHisto(f_def, hdir, "h_pt_after_gmt_eta1b_1mu_pt20", hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_gmt30_1b = getEffHisto(f_def, hdir, "h_pt_after_gmt_eta1b_1mu_pt30", hini, ptreb, kBlack-1, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_gmt40_1b = getEffHisto(f_def, hdir, "h_pt_after_gmt_eta1b_1mu_pt40", hini, ptreb, kBlack-2, 1, 2, htitle, rpt, yrange); -h_eff_gmt20_1b->Draw("hist"); -h_eff_gmt30_1b->Draw("hist same"); -h_eff_gmt40_1b->Draw("hist same"); -return; + TCanvas* c2s1b = new TCanvas("c2s1b","c2s1b",800,600) ; -h_eff_tf40_3s->Draw("hist"); -h_eff_tf40_3s1b->Draw("hist same"); -h_eff_tf40_gpt40_3s1b->Draw("hist same"); -return; -*/ + /* + TH1D* h_eff_gmt20_1b = getEffHisto(f_def, hdir, "h_pt_after_gmt_eta1b_1mu_pt20", hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_gmt30_1b = getEffHisto(f_def, hdir, "h_pt_after_gmt_eta1b_1mu_pt30", hini, ptreb, kBlack-1, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_gmt40_1b = getEffHisto(f_def, hdir, "h_pt_after_gmt_eta1b_1mu_pt40", hini, ptreb, kBlack-2, 1, 2, htitle, rpt, yrange); + h_eff_gmt20_1b->Draw("hist"); + h_eff_gmt30_1b->Draw("hist same"); + h_eff_gmt40_1b->Draw("hist same"); + return; + h_eff_tf40_3s->Draw("hist"); + h_eff_tf40_3s1b->Draw("hist same"); + h_eff_tf40_gpt40_3s1b->Draw("hist same"); + return; + */ -TH1D* h_eff_tf10_gpt15_2s1b = getEffHisto(f_g98_pt15, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 2, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_gpt15_3s1b = getEffHisto(f_g98_pt15, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 2, 2, htitle, rpt,yrange); -TH1D* h_eff_tf15_gpt20_2s1b = getEffHisto(f_g98_pt20, hdir, h2s1b + "_pt15", hini, ptreb, kBlue, 2, 2, htitle, rpt,yrange); -TH1D* h_eff_tf15_gpt20_3s1b = getEffHisto(f_g98_pt20, hdir, h3s1b + "_pt15", hini, ptreb, kBlue, 2, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_gpt15_2s1b = getEffHisto(f_g98_pt15, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 2, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_gpt15_3s1b = getEffHisto(f_g98_pt15, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 2, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_gpt30_2s1b = getEffHisto(f_g98_pt30, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 2, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_gpt30_3s1b = getEffHisto(f_g98_pt30, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 2, 2, htitle, rpt,yrange); + TH1D* h_eff_tf15_gpt20_2s1b = getEffHisto(f_g98_pt20, hdir, h2s1b + "_pt15", hini, ptreb, kBlue, 2, 2, htitle, rpt,yrange); + TH1D* h_eff_tf15_gpt20_3s1b = getEffHisto(f_g98_pt20, hdir, h3s1b + "_pt15", hini, ptreb, kBlue, 2, 2, htitle, rpt,yrange); -TH1D* h_eff_tf30_gpt40_2s1b = getEffHisto(f_g98_pt40, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 2, 2, htitle, rpt,yrange); -TH1D* h_eff_tf30_gpt40_3s1b = getEffHisto(f_g98_pt40, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 2, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_gpt30_2s1b = getEffHisto(f_g98_pt30, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 2, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_gpt30_3s1b = getEffHisto(f_g98_pt30, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 2, 2, htitle, rpt,yrange); + TH1D* h_eff_tf30_gpt40_2s1b = getEffHisto(f_g98_pt40, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 2, 2, htitle, rpt,yrange); + TH1D* h_eff_tf30_gpt40_3s1b = getEffHisto(f_g98_pt40, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 2, 2, htitle, rpt,yrange); -TCanvas* c2s1b = new TCanvas("c2s1b","c2s1b",800,600) ; -//h_eff_tf0_2s1b->Draw("hist"); -h_eff_tf10_2s1b->Draw("hist"); -//h_eff_tf15_2s1b->Draw("hist same"); -h_eff_tf20_2s1b->Draw("hist same"); -h_eff_tf30_2s1b->Draw("hist same"); -//h_eff_tf40_2s1b->Draw("hist same"); + TCanvas* c2s1b = new TCanvas("c2s1b","c2s1b",800,600) ; -h_eff_tf10_gpt10_2s1b->Draw("hist same"); -h_eff_tf20_gpt20_2s1b->Draw("hist same"); -h_eff_tf30_gpt30_2s1b->Draw("hist same"); + //h_eff_tf0_2s1b->Draw("hist"); + h_eff_tf10_2s1b->Draw("hist"); + //h_eff_tf15_2s1b->Draw("hist same"); + h_eff_tf20_2s1b->Draw("hist same"); + h_eff_tf30_2s1b->Draw("hist same"); + //h_eff_tf40_2s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.50,0.17,.999,0.57, NULL, "brNDC"); -leg->SetNColumns(2); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track requires 2+ stubs, one from ME1"); -leg->AddEntry(h_eff_tf10_2s1b, "Trigger p_{T}:", ""); -leg->AddEntry(h_eff_tf10_gpt10_2s1b, "with GEM:", ""); -leg->AddEntry(h_eff_tf10_2s1b, "p_{T}^{TF}>=10", "l"); -leg->AddEntry(h_eff_tf10_gpt10_2s1b, "#Delta#phi for p_{T}=10", "l"); -leg->AddEntry(h_eff_tf20_2s1b, "p_{T}^{TF}>=20", "l"); -leg->AddEntry(h_eff_tf20_gpt20_2s1b, "#Delta#phi for p_{T}=20", "l"); -leg->AddEntry(h_eff_tf30_2s1b, "p_{T}^{TF}>=30", "l"); -leg->AddEntry(h_eff_tf30_gpt30_2s1b, "#Delta#phi for p_{T}=30", "l"); -leg->Draw(); + h_eff_tf10_gpt10_2s1b->Draw("hist same"); + h_eff_tf20_gpt20_2s1b->Draw("hist same"); + h_eff_tf30_gpt30_2s1b->Draw("hist same"); -c2s1b->Print("eff_2s1b.png"); + TLegend *leg = new TLegend(0.50,0.17,.999,0.57, NULL, "brNDC"); + leg->SetNColumns(2); + leg->SetBorderSize(0); + // leg->SetBorderStyle(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.04); + leg->SetHeader("TF track requires #geq2 stubs, one from ME1"); + leg->AddEntry(h_eff_tf10_2s1b, "Trigger p_{T}:", ""); + leg->AddEntry(h_eff_tf10_gpt10_2s1b, "with GEM:", ""); + leg->AddEntry(h_eff_tf10_2s1b, "p_{T}^{TF}#geq10", "l"); + leg->AddEntry(h_eff_tf10_gpt10_2s1b, "#Delta#phi for p_{T}=10", "l"); + leg->AddEntry(h_eff_tf20_2s1b, "p_{T}^{TF}#geq20", "l"); + leg->AddEntry(h_eff_tf20_gpt20_2s1b, "#Delta#phi for p_{T}=20", "l"); + leg->AddEntry(h_eff_tf30_2s1b, "p_{T}^{TF}#geq30", "l"); + leg->AddEntry(h_eff_tf30_gpt30_2s1b, "#Delta#phi for p_{T}=30", "l"); + leg->Draw(); + c2s1b->Print(plotDir + "eff_2s1b" + ext); -TCanvas* c3s1b = new TCanvas("c3s1b","c3s1b",800,600) ; -h_eff_tf10_3s1b->Draw("hist"); -h_eff_tf20_3s1b->Draw("hist same"); -h_eff_tf30_3s1b->Draw("hist same"); + TCanvas* c3s1b = new TCanvas("c3s1b","c3s1b",800,600); -h_eff_tf10_gpt10_3s1b->Draw("hist same"); -h_eff_tf20_gpt20_3s1b->Draw("hist same"); -h_eff_tf30_gpt30_3s1b->Draw("hist same"); + h_eff_tf10_3s1b->Draw("hist"); + h_eff_tf20_3s1b->Draw("hist same"); + h_eff_tf30_3s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.50,0.17,.999,0.57, NULL, "brNDC"); -leg->SetNColumns(2); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track requires 3+ stubs, one from ME1"); -leg->AddEntry(h_eff_tf10_3s1b, "Trigger p_{T}:", ""); -leg->AddEntry(h_eff_tf10_gpt10_3s1b, "with GEM:", ""); -leg->AddEntry(h_eff_tf10_3s1b, "p_{T}^{TF}>=10", "l"); -leg->AddEntry(h_eff_tf10_gpt10_3s1b, "#Delta#phi for p_{T}=10", "l"); -leg->AddEntry(h_eff_tf20_3s1b, "p_{T}^{TF}>=20", "l"); -leg->AddEntry(h_eff_tf20_gpt20_3s1b, "#Delta#phi for p_{T}=20", "l"); -leg->AddEntry(h_eff_tf30_3s1b, "p_{T}^{TF}>=30", "l"); -leg->AddEntry(h_eff_tf30_gpt30_3s1b, "#Delta#phi for p_{T}=30", "l"); -leg->Draw(); + h_eff_tf10_gpt10_3s1b->Draw("hist same"); + h_eff_tf20_gpt20_3s1b->Draw("hist same"); + h_eff_tf30_gpt30_3s1b->Draw("hist same"); -c3s1b->Print("eff_3s1b.png"); + TLegend *leg = new TLegend(0.50,0.17,.999,0.57, NULL, "brNDC"); + leg->SetNColumns(2); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track requires #geq3 stubs, one from ME1"); + leg->AddEntry(h_eff_tf10_3s1b, "Trigger p_{T}:", ""); + leg->AddEntry(h_eff_tf10_gpt10_3s1b, "with GEM:", ""); + leg->AddEntry(h_eff_tf10_3s1b, "p_{T}^{TF}#geq10", "l"); + leg->AddEntry(h_eff_tf10_gpt10_3s1b, "#Delta#phi for p_{T}=10", "l"); + leg->AddEntry(h_eff_tf20_3s1b, "p_{T}^{TF}#geq20", "l"); + leg->AddEntry(h_eff_tf20_gpt20_3s1b, "#Delta#phi for p_{T}=20", "l"); + leg->AddEntry(h_eff_tf30_3s1b, "p_{T}^{TF}#geq30", "l"); + leg->AddEntry(h_eff_tf30_gpt30_3s1b, "#Delta#phi for p_{T}=30", "l"); + leg->Draw(); + + c3s1b->Print(plotDir + "eff_3s1b" + ext); -TCanvas* c3s_2s1b = new TCanvas("c3s_2s1b","c3s_2s1b",800,600); + TCanvas* c3s_2s1b = new TCanvas("c3s_2s1b","c3s_2s1b",800,600); -h_eff_tf10_3s->Draw("hist"); -h_eff_tf20_3s->Draw("hist same"); -h_eff_tf30_3s->Draw("hist same"); + h_eff_tf10_3s->Draw("hist"); + h_eff_tf20_3s->Draw("hist same"); + h_eff_tf30_3s->Draw("hist same"); -h_eff_tf10_gpt10_2s1b->Draw("hist same"); -h_eff_tf20_gpt20_2s1b->Draw("hist same"); -h_eff_tf30_gpt30_2s1b->Draw("hist same"); + h_eff_tf10_gpt10_2s1b->Draw("hist same"); + h_eff_tf20_gpt20_2s1b->Draw("hist same"); + h_eff_tf30_gpt30_2s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.50,0.17,.999,0.57, NULL, "brNDC"); -leg->SetNColumns(2); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track requires"); -leg->AddEntry(h_eff_tf10_3s, "3+ stubs", ""); -leg->AddEntry(h_eff_tf10_gpt10_2s1b, "2+ stubs with GEM in ME1", ""); -leg->AddEntry(h_eff_tf10_3s, "p_{T}^{TF}>=10", "l"); -leg->AddEntry(h_eff_tf10_gpt10_2s1b, "#Delta#phi for p_{T}=10", "l"); -leg->AddEntry(h_eff_tf20_3s, "p_{T}^{TF}>=20", "l"); -leg->AddEntry(h_eff_tf20_gpt20_2s1b, "#Delta#phi for p_{T}=20", "l"); -leg->AddEntry(h_eff_tf30_3s, "p_{T}^{TF}>=30", "l"); -leg->AddEntry(h_eff_tf30_gpt30_2s1b, "#Delta#phi for p_{T}=30", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.50,0.17,.999,0.57, NULL, "brNDC"); + leg->SetNColumns(2); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track requires"); + leg->AddEntry(h_eff_tf10_3s, "#geq3 stubs", ""); + leg->AddEntry(h_eff_tf10_gpt10_2s1b, "#geq2 stubs with GEM in ME1", ""); + leg->AddEntry(h_eff_tf10_3s, "p_{T}^{TF}#geq10", "l"); + leg->AddEntry(h_eff_tf10_gpt10_2s1b, "#Delta#phi for p_{T}=10", "l"); + leg->AddEntry(h_eff_tf20_3s, "p_{T}^{TF}#geq20", "l"); + leg->AddEntry(h_eff_tf20_gpt20_2s1b, "#Delta#phi for p_{T}=20", "l"); + leg->AddEntry(h_eff_tf30_3s, "p_{T}^{TF}#geq30", "l"); + leg->AddEntry(h_eff_tf30_gpt30_2s1b, "#Delta#phi for p_{T}=30", "l"); + leg->Draw(); -c3s_2s1b->Print("eff_3s_2s1b.png"); + c3s_2s1b->Print(plotDir + "eff_3s_2s1b" + ext); -TCanvas* c3s_def = new TCanvas("c3s_def","c3s_def",800,600); + TCanvas* c3s_def = new TCanvas("c3s_def","c3s_def",800,600); -h_eff_tf10_3s->Draw("hist"); -h_eff_tf20_3s->Draw("hist same"); -h_eff_tf30_3s->Draw("hist same"); + h_eff_tf10_3s->Draw("hist"); + h_eff_tf20_3s->Draw("hist same"); + h_eff_tf30_3s->Draw("hist same"); -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track requires 3+ stubs and"); -leg->AddEntry(h_eff_tf10_3s, "p_{T}^{TF}>=10", "l"); -leg->AddEntry(h_eff_tf20_3s, "p_{T}^{TF}>=20", "l"); -leg->AddEntry(h_eff_tf30_3s, "p_{T}^{TF}>=30", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track requires #geq3 stubs and"); + leg->AddEntry(h_eff_tf10_3s, "p_{T}^{TF}#geq10", "l"); + leg->AddEntry(h_eff_tf20_3s, "p_{T}^{TF}#geq20", "l"); + leg->AddEntry(h_eff_tf30_3s, "p_{T}^{TF}#geq30", "l"); + leg->Draw(); -c3s_def->Print("eff_3s_def.png"); + c3s_def->Print(plotDir + "eff_3s_def" + ext); -TCanvas* c3s1b_def = new TCanvas("c3s1b_def","c3s1b_def",800,600); + TCanvas* c3s1b_def = new TCanvas("c3s1b_def","c3s1b_def",800,600); -h_eff_tf10_3s1b->Draw("hist"); -h_eff_tf20_3s1b->Draw("hist same"); -h_eff_tf30_3s1b->Draw("hist same"); + h_eff_tf10_3s1b->Draw("hist"); + h_eff_tf20_3s1b->Draw("hist same"); + h_eff_tf30_3s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track requires 3+ stubs with ME1 and"); -leg->AddEntry(h_eff_tf10_3s, "p_{T}^{TF}>=10", "l"); -leg->AddEntry(h_eff_tf20_3s, "p_{T}^{TF}>=20", "l"); -leg->AddEntry(h_eff_tf30_3s, "p_{T}^{TF}>=30", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track requires #geq3 stubs with ME1 and"); + leg->AddEntry(h_eff_tf10_3s, "p_{T}^{TF}#geq10", "l"); + leg->AddEntry(h_eff_tf20_3s, "p_{T}^{TF}#geq20", "l"); + leg->AddEntry(h_eff_tf30_3s, "p_{T}^{TF}#geq30", "l"); + leg->Draw(); -c3s1b_def->Print("eff_3s1b_def.png"); + c3s1b_def->Print(plotDir + "eff_3s1b_def" + ext); -h_eff_tf20_2s->SetLineColor(kAzure+2); -h_eff_tf20_2s1b->SetLineColor(kAzure+6); -h_eff_tf20_3s->SetLineColor(kAzure+3); -h_eff_tf20_3s1b->SetLineColor(kAzure+7); + h_eff_tf20_2s->SetLineColor(kAzure+2); + h_eff_tf20_2s1b->SetLineColor(kAzure+6); + h_eff_tf20_3s->SetLineColor(kAzure+3); + h_eff_tf20_3s1b->SetLineColor(kAzure+7); -h_eff_tf20_gpt20_2s1b->SetLineColor(kAzure+6); -h_eff_tf20_gpt20_3s1b->SetLineColor(kAzure+7); + h_eff_tf20_gpt20_2s1b->SetLineColor(kAzure+6); + h_eff_tf20_gpt20_3s1b->SetLineColor(kAzure+7); -TCanvas* c2s_pt20_def = new TCanvas("c2s_pt20_def","c2s_pt20_def",800,600); + TCanvas* c2s_pt20_def = new TCanvas("c2s_pt20_def","c2s_pt20_def",800,600); -h_eff_tf20_2s->Draw("hist"); -h_eff_tf20_2s1b->Draw("hist same"); + h_eff_tf20_2s->Draw("hist"); + h_eff_tf20_2s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track: p_{T}^{TF}>=20 and 2+ stubs"); -leg->AddEntry(h_eff_tf20_2s, "anywhere", "l"); -leg->AddEntry(h_eff_tf20_2s1b, "with ME1", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track: p_{T}^{TF}#geq20 and #geq2 stubs"); + leg->AddEntry(h_eff_tf20_2s, "anywhere", "l"); + leg->AddEntry(h_eff_tf20_2s1b, "with ME1", "l"); + leg->Draw(); -c2s_pt20_def->Print("eff_2s_pt20_def.png"); + c2s_pt20_def->Print(plotDir + "eff_2s_pt20_def" + ext); -h_eff_tf20_gpt20_2s1b->Draw("hist same"); -leg->AddEntry(h_eff_tf20_gpt20_2s1b, "with (ME1 + GEM)", "l"); -c2s_pt20_def->Print("eff_2s_pt20_gem.png"); + h_eff_tf20_gpt20_2s1b->Draw("hist same"); + leg->AddEntry(h_eff_tf20_gpt20_2s1b, "with (ME1 + GEM)", "l"); + c2s_pt20_def->Print(plotDir + "eff_2s_pt20_gem" + ext); -TCanvas* c3s_pt20_def = new TCanvas("c3s_pt20_def","c3s_pt20_def",800,600); + TCanvas* c3s_pt20_def = new TCanvas("c3s_pt20_def","c3s_pt20_def",800,600); -h_eff_tf20_3s->Draw("hist"); -h_eff_tf20_3s1b->Draw("hist same"); + h_eff_tf20_3s->Draw("hist"); + h_eff_tf20_3s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track: p_{T}^{TF}>=20 and 3+ stubs"); -leg->AddEntry(h_eff_tf20_3s, "anywhere", "l"); -leg->AddEntry(h_eff_tf20_3s1b, "with ME1", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track: p_{T}^{TF}#geq20 and #geq3 stubs"); + leg->AddEntry(h_eff_tf20_3s, "anywhere", "l"); + leg->AddEntry(h_eff_tf20_3s1b, "with ME1", "l"); + leg->Draw(); -c3s_pt20_def->Print("eff_3s_pt20_def.png"); + c3s_pt20_def->Print(plotDir + "eff_3s_pt20_def" + ext); -h_eff_tf20_gpt20_3s1b->Draw("hist same"); -leg->AddEntry(h_eff_tf20_gpt20_3s1b, "with (ME1 + GEM)", "l"); -c3s_pt20_def->Print("eff_3s_pt20_gem.png"); + h_eff_tf20_gpt20_3s1b->Draw("hist same"); + leg->AddEntry(h_eff_tf20_gpt20_3s1b, "with (ME1 + GEM)", "l"); + c3s_pt20_def->Print(plotDir + "eff_3s_pt20_gem" + ext); -return; -h_eff_tf10_gpt15_2s1b->Draw("hist same"); -h_eff_tf20_gpt30_2s1b->Draw("hist same"); -h_eff_tf30_gpt40_2s1b->Draw("hist same"); + return; + h_eff_tf10_gpt15_2s1b->Draw("hist same"); + h_eff_tf20_gpt30_2s1b->Draw("hist same"); + h_eff_tf30_gpt40_2s1b->Draw("hist same"); } void drawplot_etastep(char *fname, char* pu, char *dname="tf") { -// directory for plots is made as -// pdir = $PWD/pic[_{dname}]_{pu} + // directory for plots is made as + // pdir = $PWD/pic[_{dname}]_{pu} -//gStyle->SetStatW(0.13); -//gStyle->SetStatH(0.08); -gStyle->SetStatW(0.07); -gStyle->SetStatH(0.06); + //gStyle->SetStatW(0.13); + //gStyle->SetStatH(0.08); + gStyle->SetStatW(0.07); + gStyle->SetStatH(0.06); -gStyle->SetOptStat(0); + gStyle->SetOptStat(0); -gStyle->SetTitleStyle(0); + gStyle->SetTitleStyle(0); -char d1[111]="",d2[111]=""; -if (strcmp(dname,"")>0) sprintf(d1,"_%s",dname); -if (strcmp(pu,"")>0) sprintf(d2,"_%s",pu); -sprintf(pdir,"pic%s%s",d1,d2); + char d1[111]="",d2[111]=""; + if (strcmp(dname,"")>0) sprintf(d1,"_%s",dname); + if (strcmp(pu,"")>0) sprintf(d2,"_%s",pu); + sprintf(pdir,"pic%s%s",d1,d2); -if (interactive){ - if( gSystem->AccessPathName(pdir)==0 ) { - cout<<"directory "<Exec(cmd) != 0) {cout<<"can't remode directory! exiting..."<AccessPathName(pdir)==0 ) { + cout<<"directory "<Exec(cmd) != 0) {cout<<"can't remode directory! exiting..."<MakeDirectory(pdir); } - gSystem->MakeDirectory(pdir); -} -//TFile *f = TFile::Open("piluphisto.root"); + //TFile *f = TFile::Open("piluphisto.root"); -cout<<"opening "<Get("SimMuL1/;1"); + // = (TH1D*)f->Get("SimMuL1/;1"); -int etareb=1; -int ptreb=2; + int etareb=1; + int ptreb=2; -//TH1D* eff_eta_after_mpc_ok_plus = setEffHisto("h_eta_after_mpc_ok_plus","h_eta_initial",dir, etareb, kRed, 1,2, "asdasd","xxx","yyy",xrange,yrange); -//eff_eta_after_mpc_ok_plus ->Draw("hist"); + //TH1D* eff_eta_after_mpc_ok_plus = setEffHisto("h_eta_after_mpc_ok_plus","h_eta_initial",dir, etareb, kRed, 1,2, "asdasd","xxx","yyy",xrange,yrange); + //eff_eta_after_mpc_ok_plus ->Draw("hist"); -//################################################################################################ -if (interactive) { + //################################################################################################ + if (interactive) { -TCanvas* c_eff_eta_simh_by_st = new TCanvas("c_eff_eta_simh_by_st","c_eff_eta_simh_by_st",900,800 ) ; -c_eff_eta_simh_by_st->Divide(2,2,0.0001,0.0001); + TCanvas* c_eff_eta_simh_by_st = new TCanvas("c_eff_eta_simh_by_st","c_eff_eta_simh_by_st",900,800 ) ; + c_eff_eta_simh_by_st->Divide(2,2,0.0001,0.0001); -TH1D* h_eta_me1_initial = setEffHisto("h_eta_me1_initial","h_eta_initial0",dir, etareb, kBlue, 1, 2, "eff(#eta): SimHits#geq4 in ME1 (MC 20cd(1); -h_eta_me1_initial->Draw("hist"); -c_eff_eta_simh_by_st->cd(2); -h_eta_me2_initial->Draw("hist"); -c_eff_eta_simh_by_st->cd(3); -h_eta_me3_initial->Draw("hist"); -c_eff_eta_simh_by_st->cd(4); -h_eta_me4_initial->Draw("hist"); + c_eff_eta_simh_by_st->cd(1); + h_eta_me1_initial->Draw("hist"); + c_eff_eta_simh_by_st->cd(2); + h_eta_me2_initial->Draw("hist"); + c_eff_eta_simh_by_st->cd(3); + h_eta_me3_initial->Draw("hist"); + c_eff_eta_simh_by_st->cd(4); + h_eta_me4_initial->Draw("hist"); -Print(c_eff_eta_simh_by_st,"c_eff_eta_simh_by_st.png"); + Print(c_eff_eta_simh_by_st,"c_eff_eta_simh_by_st" + ext); -TCanvas* c_eff_eta_simh_by_st = new TCanvas("c_eff_eta_mpc_by_st","c_eff_eta_mpc_by_st",900,800 ) ; -c_eff_eta_mpc_by_st->Divide(2,2,0.0001,0.0001); + TCanvas* c_eff_eta_simh_by_st = new TCanvas("c_eff_eta_mpc_by_st","c_eff_eta_mpc_by_st",900,800 ) ; + c_eff_eta_mpc_by_st->Divide(2,2,0.0001,0.0001); -TH1D* h_eta_me1_mpc = setEffHisto("h_eta_me1_mpc","h_eta_initial0",dir, etareb, kBlack, 1, 2, "","MC #eta","",xrange,yrange); -TH1D* h_eta_me2_mpc = setEffHisto("h_eta_me2_mpc","h_eta_initial0",dir, etareb, kBlack, 1, 2, "","MC #eta","",xrange,yrange); -TH1D* h_eta_me3_mpc = setEffHisto("h_eta_me3_mpc","h_eta_initial0",dir, etareb, kBlack, 1, 2, "","MC #eta","",xrange,yrange); -TH1D* h_eta_me4_mpc = setEffHisto("h_eta_me4_mpc","h_eta_initial0",dir, etareb, kBlack, 1, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_me1_mpc = setEffHisto("h_eta_me1_mpc","h_eta_initial0",dir, etareb, kBlack, 1, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_me2_mpc = setEffHisto("h_eta_me2_mpc","h_eta_initial0",dir, etareb, kBlack, 1, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_me3_mpc = setEffHisto("h_eta_me3_mpc","h_eta_initial0",dir, etareb, kBlack, 1, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_me4_mpc = setEffHisto("h_eta_me4_mpc","h_eta_initial0",dir, etareb, kBlack, 1, 2, "","MC #eta","",xrange,yrange); -h_eta_me1_initial->SetTitle("eff(#eta): matched MPC in ME1 (MC 20SetTitle("eff(#eta): matched MPC in ME2 (MC 20SetTitle("eff(#eta): matched MPC in ME3 (MC 20SetTitle("eff(#eta): matched MPC in ME4 (MC 20SetTitle("eff(#eta): matched MPC in ME1 (MC 20SetTitle("eff(#eta): matched MPC in ME2 (MC 20SetTitle("eff(#eta): matched MPC in ME3 (MC 20SetTitle("eff(#eta): matched MPC in ME4 (MC 20cd(1); -h_eta_me1_initial->Draw("hist"); -h_eta_me1_mpc->Draw("hist same"); -c_eff_eta_mpc_by_st->cd(2); -h_eta_me2_initial->Draw("hist"); -h_eta_me2_mpc->Draw("hist same"); -c_eff_eta_mpc_by_st->cd(3); -h_eta_me3_initial->Draw("hist"); -h_eta_me3_mpc->Draw("hist same"); -c_eff_eta_mpc_by_st->cd(4); -h_eta_me4_initial->Draw("hist"); -h_eta_me4_mpc->Draw("hist same"); + c_eff_eta_mpc_by_st->cd(1); + h_eta_me1_initial->Draw("hist"); + h_eta_me1_mpc->Draw("hist same"); + c_eff_eta_mpc_by_st->cd(2); + h_eta_me2_initial->Draw("hist"); + h_eta_me2_mpc->Draw("hist same"); + c_eff_eta_mpc_by_st->cd(3); + h_eta_me3_initial->Draw("hist"); + h_eta_me3_mpc->Draw("hist same"); + c_eff_eta_mpc_by_st->cd(4); + h_eta_me4_initial->Draw("hist"); + h_eta_me4_mpc->Draw("hist same"); -Print(c_eff_eta_mpc_by_st,"c_eff_eta_mpc_by_st.png"); + Print(c_eff_eta_mpc_by_st,"c_eff_eta_mpc_by_st" + ext); -} -//################################################################################################ -if (interactive) { + } + //################################################################################################ + if (interactive) { -TCanvas* c_eff_eta_simh = new TCanvas("c_eff_eta_simh","c_eff_eta_simh",1000,600 ) ; + TCanvas* c_eff_eta_simh = new TCanvas("c_eff_eta_simh","c_eff_eta_simh",1000,600 ) ; -TH1D* h_eta_initial_1st = setEffHisto("h_eta_initial_1st","h_eta_initial0",dir, etareb, kBlue, 1, 2, "eff(#eta): SimHits#geq4 in #geqN CSC stations","MC #eta","",xrange,yrange); -TH1D* h_eta_initial_2st = setEffHisto("h_eta_initial_2st","h_eta_initial0",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange); -TH1D* h_eta_initial_3st = setEffHisto("h_eta_initial_3st","h_eta_initial0",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_initial_1st = setEffHisto("h_eta_initial_1st","h_eta_initial0",dir, etareb, kBlue, 1, 2, "eff(#eta): SimHits#geq4 in #geqN CSC stations","MC #eta","",xrange,yrange); + TH1D* h_eta_initial_2st = setEffHisto("h_eta_initial_2st","h_eta_initial0",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_initial_3st = setEffHisto("h_eta_initial_3st","h_eta_initial0",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange); -h_eta_initial_1st->Draw("hist"); -h_eta_initial_2st->Draw("hist same"); -h_eta_initial_3st->Draw("hist same"); + h_eta_initial_1st->Draw("hist"); + h_eta_initial_2st->Draw("hist same"); + h_eta_initial_3st->Draw("hist same"); -TLegend *l_eff_eta_simh = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); -l_eff_eta_simh->SetBorderSize(0); -l_eff_eta_simh->SetFillStyle(0); -l_eff_eta_simh->SetHeader("Efficiency for #mu with p_{T}>20 to leave #geq4 SimHits in"); -l_eff_eta_simh->AddEntry(h_eta_initial_1st,"#geq1 CSC stations","pl"); -l_eff_eta_simh->AddEntry(h_eta_initial_2st,"#geq2 CSC stations","pl"); -l_eff_eta_simh->AddEntry(h_eta_initial_3st,"#geq3 CSC stations","pl"); -l_eff_eta_simh->Draw(); + TLegend *l_eff_eta_simh = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); + l_eff_eta_simh->SetBorderSize(0); + l_eff_eta_simh->SetFillStyle(0); + l_eff_eta_simh->SetHeader("Efficiency for #mu with p_{T}>20 to leave #geq4 SimHits in"); + l_eff_eta_simh->AddEntry(h_eta_initial_1st,"#geq1 CSC stations","pl"); + l_eff_eta_simh->AddEntry(h_eta_initial_2st,"#geq2 CSC stations","pl"); + l_eff_eta_simh->AddEntry(h_eta_initial_3st,"#geq3 CSC stations","pl"); + l_eff_eta_simh->Draw(); -Print(c_eff_eta_simh,"c_eff_eta_simh.png"); + Print(c_eff_eta_simh,"c_eff_eta_simh" + ext); -TCanvas* c_eff_eta_mpc = new TCanvas("c_eff_eta_mpc","c_eff_eta_mpc",1000,600 ) ; + TCanvas* c_eff_eta_mpc = new TCanvas("c_eff_eta_mpc","c_eff_eta_mpc",1000,600 ) ; -TH1D* h_eta_mpc_1st = setEffHisto("h_eta_mpc_1st","h_eta_initial0",dir, etareb, kBlue, 1, 2, "eff(#eta): matched MPC in #geqN CSC stations","MC #eta","",xrange,yrange); -TH1D* h_eta_mpc_2st = setEffHisto("h_eta_mpc_2st","h_eta_initial0",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange); -TH1D* h_eta_mpc_3st = setEffHisto("h_eta_mpc_3st","h_eta_initial0",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_mpc_1st = setEffHisto("h_eta_mpc_1st","h_eta_initial0",dir, etareb, kBlue, 1, 2, "eff(#eta): matched MPC in #geqN CSC stations","MC #eta","",xrange,yrange); + TH1D* h_eta_mpc_2st = setEffHisto("h_eta_mpc_2st","h_eta_initial0",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_mpc_3st = setEffHisto("h_eta_mpc_3st","h_eta_initial0",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange); -h_eta_mpc_1st->Draw("hist"); -h_eta_mpc_2st->Draw("hist same"); -h_eta_mpc_3st->Draw("hist same"); + h_eta_mpc_1st->Draw("hist"); + h_eta_mpc_2st->Draw("hist same"); + h_eta_mpc_3st->Draw("hist same"); -TLegend *l_eff_eta_mpc = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); -l_eff_eta_mpc->SetBorderSize(0); -l_eff_eta_mpc->SetFillStyle(0); -l_eff_eta_mpc->SetHeader("Efficiency for #mu with p_{T}>20 to have matched MPCs in"); -l_eff_eta_mpc->AddEntry(h_eta_mpc_1st,"#geq1 CSC stations","pl"); -l_eff_eta_mpc->AddEntry(h_eta_mpc_2st,"#geq2 CSC stations","pl"); -l_eff_eta_mpc->AddEntry(h_eta_mpc_3st,"#geq3 CSC stations","pl"); -l_eff_eta_mpc->Draw(); + TLegend *l_eff_eta_mpc = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); + l_eff_eta_mpc->SetBorderSize(0); + l_eff_eta_mpc->SetFillStyle(0); + l_eff_eta_mpc->SetHeader("Efficiency for #mu with p_{T}>20 to have matched MPCs in"); + l_eff_eta_mpc->AddEntry(h_eta_mpc_1st,"#geq1 CSC stations","pl"); + l_eff_eta_mpc->AddEntry(h_eta_mpc_2st,"#geq2 CSC stations","pl"); + l_eff_eta_mpc->AddEntry(h_eta_mpc_3st,"#geq3 CSC stations","pl"); + l_eff_eta_mpc->Draw(); -Print(c_eff_eta_mpc,"c_eff_eta_mpc.png"); + Print(c_eff_eta_mpc,"c_eff_eta_mpc" + ext); -TCanvas* c_eff_eta_mpc_relative = new TCanvas("c_eff_eta_mpc_relative","c_eff_eta_mpc_relative",1000,600 ) ; + TCanvas* c_eff_eta_mpc_relative = new TCanvas("c_eff_eta_mpc_relative","c_eff_eta_mpc_relative",1000,600 ) ; -TH1D* h_eta_mpc_1st_r = setEffHisto("h_eta_mpc_1st","h_eta_initial_1st",dir, etareb, kBlue, 1, 2, "eff(#eta): matched MPC if SimHits#geq4 in #geqN CSC stations","MC #eta","",xrange,yrange); -TH1D* h_eta_mpc_2st_r = setEffHisto("h_eta_mpc_2st","h_eta_initial_2st",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange); -TH1D* h_eta_mpc_3st_r = setEffHisto("h_eta_mpc_3st","h_eta_initial_3st",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_mpc_1st_r = setEffHisto("h_eta_mpc_1st","h_eta_initial_1st",dir, etareb, kBlue, 1, 2, "eff(#eta): matched MPC if SimHits#geq4 in #geqN CSC stations","MC #eta","",xrange,yrange); + TH1D* h_eta_mpc_2st_r = setEffHisto("h_eta_mpc_2st","h_eta_initial_2st",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_mpc_3st_r = setEffHisto("h_eta_mpc_3st","h_eta_initial_3st",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange); -h_eta_mpc_1st_r->Draw("hist"); -h_eta_mpc_2st_r->Draw("hist same"); -h_eta_mpc_3st_r->Draw("hist same"); + h_eta_mpc_1st_r->Draw("hist"); + h_eta_mpc_2st_r->Draw("hist same"); + h_eta_mpc_3st_r->Draw("hist same"); -TLegend *l_eff_eta_mpc_relative = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); -l_eff_eta_mpc_relative->SetBorderSize(0); -l_eff_eta_mpc_relative->SetFillStyle(0); -l_eff_eta_mpc_relative->SetHeader("Efficiency for #mu with p_{T}>20 to have matched MPCs if it has SimHits#geq4 in"); -l_eff_eta_mpc_relative->AddEntry(h_eta_mpc_1st_r,"#geq1 CSC stations","pl"); -l_eff_eta_mpc_relative->AddEntry(h_eta_mpc_2st_r,"#geq2 CSC stations","pl"); -l_eff_eta_mpc_relative->AddEntry(h_eta_mpc_3st_r,"#geq3 CSC stations","pl"); -l_eff_eta_mpc_relative->Draw(); + TLegend *l_eff_eta_mpc_relative = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); + l_eff_eta_mpc_relative->SetBorderSize(0); + l_eff_eta_mpc_relative->SetFillStyle(0); + l_eff_eta_mpc_relative->SetHeader("Efficiency for #mu with p_{T}>20 to have matched MPCs if it has SimHits#geq4 in"); + l_eff_eta_mpc_relative->AddEntry(h_eta_mpc_1st_r,"#geq1 CSC stations","pl"); + l_eff_eta_mpc_relative->AddEntry(h_eta_mpc_2st_r,"#geq2 CSC stations","pl"); + l_eff_eta_mpc_relative->AddEntry(h_eta_mpc_3st_r,"#geq3 CSC stations","pl"); + l_eff_eta_mpc_relative->Draw(); -Print(c_eff_eta_mpc_relative,"c_eff_eta_mpc_relative.png"); + Print(c_eff_eta_mpc_relative,"c_eff_eta_mpc_relative" + ext); -} + } -//################################################################################################ -if (interactive) { -TCanvas* c_eff_eta_simh_me1 = new TCanvas("c_eff_eta_simh_me1","c_eff_eta_simh_me1",1000,600 ) ; + //################################################################################################ + if (interactive) { + TCanvas* c_eff_eta_simh_me1 = new TCanvas("c_eff_eta_simh_me1","c_eff_eta_simh_me1",1000,600 ) ; -TH1D* h_eta_me1_initial_ = setEffHisto("h_eta_me1_initial","h_eta_initial0",dir, etareb, kBlue, 1, 2, "eff(#eta): SimHits#geq4 in ME1 plus more stations","MC #eta","",xrange,yrange); -TH1D* h_eta_me1_initial_2st = setEffHisto("h_eta_me1_initial_2st","h_eta_initial0",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange); -TH1D* h_eta_me1_initial_3st = setEffHisto("h_eta_me1_initial_3st","h_eta_initial0",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_me1_initial_ = setEffHisto("h_eta_me1_initial","h_eta_initial0",dir, etareb, kBlue, 1, 2, "eff(#eta): SimHits#geq4 in ME1 plus more stations","MC #eta","",xrange,yrange); + TH1D* h_eta_me1_initial_2st = setEffHisto("h_eta_me1_initial_2st","h_eta_initial0",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_me1_initial_3st = setEffHisto("h_eta_me1_initial_3st","h_eta_initial0",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange); -h_eta_me1_initial_->Draw("hist"); -h_eta_me1_initial_2st->Draw("hist same"); -h_eta_me1_initial_3st->Draw("hist same"); + h_eta_me1_initial_->Draw("hist"); + h_eta_me1_initial_2st->Draw("hist same"); + h_eta_me1_initial_3st->Draw("hist same"); -TLegend *l_eff_eta_simh_me1 = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); -l_eff_eta_simh_me1->SetBorderSize(0); -l_eff_eta_simh_me1->SetFillStyle(0); -l_eff_eta_simh_me1->SetHeader("Efficiency for #mu with p_{T}>20 to leave #geq4 SimHits in"); -l_eff_eta_simh_me1->AddEntry(h_eta_me1_initial_,"ME1","pl"); -l_eff_eta_simh_me1->AddEntry(h_eta_me1_initial_2st,"ME1 + #geq1 stations","pl"); -l_eff_eta_simh_me1->AddEntry(h_eta_me1_initial_3st,"ME1 + #geq2 stations","pl"); -l_eff_eta_simh_me1->Draw(); + TLegend *l_eff_eta_simh_me1 = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); + l_eff_eta_simh_me1->SetBorderSize(0); + l_eff_eta_simh_me1->SetFillStyle(0); + l_eff_eta_simh_me1->SetHeader("Efficiency for #mu with p_{T}>20 to leave #geq4 SimHits in"); + l_eff_eta_simh_me1->AddEntry(h_eta_me1_initial_,"ME1","pl"); + l_eff_eta_simh_me1->AddEntry(h_eta_me1_initial_2st,"ME1 + #geq1 stations","pl"); + l_eff_eta_simh_me1->AddEntry(h_eta_me1_initial_3st,"ME1 + #geq2 stations","pl"); + l_eff_eta_simh_me1->Draw(); -Print(c_eff_eta_simh_me1,"c_eff_eta_simh_me1.png"); -} -//################################################################################################ - -TCanvas* c_eff_eta_me1_stubs = new TCanvas("c_eff_eta_me1_stubs","c_eff_eta_me1_stubs",1000,600 ) ; - -TH1D* h_eff_eta_me1_after_lct = setEffHisto("h_eta_me1_after_lct","h_eta_initial",dir, etareb, kRed, 2, 2, "eff(#eta): ME1 stub studies","#eta","",xrange,yrange); -TH1D* h_eff_eta_me1_after_alct = setEffHisto("h_eta_me1_after_alct","h_eta_initial",dir, etareb, kBlue+1, 2, 2, "","","",xrange,yrange); -TH1D* h_eff_eta_me1_after_clct = setEffHisto("h_eta_me1_after_clct","h_eta_initial",dir, etareb, kGreen+1, 2, 2, "","","",xrange,yrange); -TH1D* h_eff_eta_me1_after_alct_okAlct = setEffHisto("h_eta_me1_after_alct_okAlct","h_eta_initial",dir, etareb, kBlue+1, 1, 2, "","","",xrange,yrange); -TH1D* h_eff_eta_me1_after_clct_okClct = setEffHisto("h_eta_me1_after_clct_okClct","h_eta_initial",dir, etareb, kGreen+1, 1, 2, "","","",xrange,yrange); -TH1D* h_eff_eta_me1_after_alctclct = setEffHisto("h_eta_me1_after_alctclct","h_eta_initial",dir, etareb, kYellow+2, 2, 2, "","","",xrange,yrange); -TH1D* h_eff_eta_me1_after_alctclct_okAlctClct = setEffHisto("h_eta_me1_after_alctclct_okAlctClct","h_eta_initial",dir, etareb, kYellow+2, 1,2, "","","",xrange,yrange); -TH1D* h_eff_eta_me1_after_lct_okClctAlct = setEffHisto("h_eta_me1_after_lct_okAlctClct","h_eta_initial",dir, etareb, kRed, 1,2, "","","",xrange,yrange); - -h_eff_eta_me1_after_lct->Draw("hist"); -h_eff_eta_me1_after_alct->Draw("same hist"); -h_eff_eta_me1_after_alct_okAlct->Draw("same hist"); -h_eff_eta_me1_after_clct->Draw("same hist"); -h_eff_eta_me1_after_clct_okClct->Draw("same hist"); -h_eff_eta_me1_after_alctclct->Draw("same hist"); -h_eff_eta_me1_after_alctclct_okAlctClct->Draw("same hist"); -h_eff_eta_me1_after_lct->Draw("same hist"); -h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); - -h_eff_eta_me1_after_lct_okClctAlct->Fit("pol0","R0","",1.63,2.38); -eff11 = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); -cout<Fit("pol0","R0","",1.63,2.05); -eff1b = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); -h_eff_eta_me1_after_lct_okClctAlct->Fit("pol0","R0","",2.05,2.38); -eff1a = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); -cout<SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetNColumns(2); -leg->SetHeader("Efficiency for #mu with p_{T}>20 crossing a ME1 chamber with"); -leg->AddEntry(h_eff_eta_me1_after_alct,"any ALCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alct_okAlct,"correct ALCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_clct,"any CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_clct_okClct,"correct CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alctclct,"any ALCT and CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlctClct,"correct ALCT and CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_lct,"any LCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"correct LCT","pl"); -leg->Draw(); - -if (!interactive) { - char ghn[111]; - sprintf(ghn,"h_eff_eta_me1_after_lct_okClctAlct_%s",dname); - gh = (TH1F*)h_eff_eta_me1_after_lct_okClctAlct->Clone(ghn); - gh->GetYaxis()->SetRangeUser(0.8,1.02); + Print(c_eff_eta_simh_me1,"c_eff_eta_simh_me1" + ext); + } + //################################################################################################ + + TCanvas* c_eff_eta_me1_stubs = new TCanvas("c_eff_eta_me1_stubs","c_eff_eta_me1_stubs",1000,600 ) ; + + TH1D* h_eff_eta_me1_after_lct = setEffHisto("h_eta_me1_after_lct","h_eta_initial",dir, etareb, kRed, 2, 2, "eff(#eta): ME1 stub studies","#eta","",xrange,yrange); + TH1D* h_eff_eta_me1_after_alct = setEffHisto("h_eta_me1_after_alct","h_eta_initial",dir, etareb, kBlue+1, 2, 2, "","","",xrange,yrange); + TH1D* h_eff_eta_me1_after_clct = setEffHisto("h_eta_me1_after_clct","h_eta_initial",dir, etareb, kGreen+1, 2, 2, "","","",xrange,yrange); + TH1D* h_eff_eta_me1_after_alct_okAlct = setEffHisto("h_eta_me1_after_alct_okAlct","h_eta_initial",dir, etareb, kBlue+1, 1, 2, "","","",xrange,yrange); + TH1D* h_eff_eta_me1_after_clct_okClct = setEffHisto("h_eta_me1_after_clct_okClct","h_eta_initial",dir, etareb, kGreen+1, 1, 2, "","","",xrange,yrange); + TH1D* h_eff_eta_me1_after_alctclct = setEffHisto("h_eta_me1_after_alctclct","h_eta_initial",dir, etareb, kYellow+2, 2, 2, "","","",xrange,yrange); + TH1D* h_eff_eta_me1_after_alctclct_okAlctClct = setEffHisto("h_eta_me1_after_alctclct_okAlctClct","h_eta_initial",dir, etareb, kYellow+2, 1,2, "","","",xrange,yrange); + TH1D* h_eff_eta_me1_after_lct_okClctAlct = setEffHisto("h_eta_me1_after_lct_okAlctClct","h_eta_initial",dir, etareb, kRed, 1,2, "","","",xrange,yrange); + + h_eff_eta_me1_after_lct->Draw("hist"); + h_eff_eta_me1_after_alct->Draw("same hist"); + h_eff_eta_me1_after_alct_okAlct->Draw("same hist"); + h_eff_eta_me1_after_clct->Draw("same hist"); + h_eff_eta_me1_after_clct_okClct->Draw("same hist"); + h_eff_eta_me1_after_alctclct->Draw("same hist"); + h_eff_eta_me1_after_alctclct_okAlctClct->Draw("same hist"); + h_eff_eta_me1_after_lct->Draw("same hist"); + h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); + + h_eff_eta_me1_after_lct_okClctAlct->Fit("pol0","R0","",1.63,2.38); + eff11 = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); + cout<Fit("pol0","R0","",1.63,2.05); + eff1b = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); + h_eff_eta_me1_after_lct_okClctAlct->Fit("pol0","R0","",2.05,2.38); + eff1a = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); + cout<SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetNColumns(2); + leg->SetHeader("Efficiency for #mu with p_{T}>20 crossing a ME1 chamber with"); + leg->AddEntry(h_eff_eta_me1_after_alct,"any ALCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alct_okAlct,"correct ALCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_clct,"any CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_clct_okClct,"correct CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alctclct,"any ALCT and CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlctClct,"correct ALCT and CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_lct,"any LCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"correct LCT","pl"); + leg->Draw(); + + if (!interactive) { + char ghn[111]; + sprintf(ghn,"h_eff_eta_me1_after_lct_okClctAlct_%s",dname); + gh = (TH1F*)h_eff_eta_me1_after_lct_okClctAlct->Clone(ghn); + gh->GetYaxis()->SetRangeUser(0.8,1.02); + + gh->SetTitle("LCT finding efficiency in ME1 for #mu with p_{T}>10"); + gh->GetXaxis()->SetRangeUser(0.8,2.5); + gh->GetYaxis()->SetRangeUser(0.,1.05); + gh->GetXaxis()->SetTitle("#eta"); + gh->GetYaxis()->SetTitle("Eff."); + gh->GetXaxis()->SetTitleSize(0.07); + gh->GetXaxis()->SetTitleOffset(0.7); + gh->GetYaxis()->SetLabelOffset(0.015); + return; + } - gh->SetTitle("LCT finding efficiency in ME1 for #mu with p_{T}>10"); - gh->GetXaxis()->SetRangeUser(0.8,2.5); - gh->GetYaxis()->SetRangeUser(0.,1.05); - gh->GetXaxis()->SetTitle("#eta"); - gh->GetYaxis()->SetTitle("Eff."); - gh->GetXaxis()->SetTitleSize(0.07); - gh->GetXaxis()->SetTitleOffset(0.7); - gh->GetYaxis()->SetLabelOffset(0.015); - return; -} + Print(c_eff_eta_me1_stubs,"h_eff_eta_me1_steps_stubs" + ext); -Print(c_eff_eta_me1_stubs,"h_eff_eta_me1_steps_stubs.png"); + //################################################################################################ -//################################################################################################ + TCanvas* c_eff_eta_me1_tf = new TCanvas("c_eff_eta_me1_tf","c_eff_eta_me1_tf",1000,600 ) ; -TCanvas* c_eff_eta_me1_tf = new TCanvas("c_eff_eta_me1_tf","c_eff_eta_me1_tf",1000,600 ) ; + TH1D* h_eff_eta_me1_after_lct_okClctAlct = setEffHisto("h_eta_me1_after_lct_okAlctClct","h_eta_initial",dir, etareb, kRed, 1,2, "eff(#eta): ME1 TF studies", "#eta","",xrange,yrange); + TH1D* h_eff_eta_me1_after_mplct_okClctAlct_plus = setEffHisto("h_eta_me1_after_mplct_okAlctClct_plus","h_eta_initial",dir, etareb, kBlack, 1,2, "","","",xrange,yrange); + //TH1D* h_eff_eta_after_tfcand_ok_plus = setEffHisto("h_eta_after_tfcand_ok_plus","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange); + //TH1D* h_eff_eta_after_tfcand_ok_plus_pt10 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange); + TH1D* h_eff_eta_me1_after_tf_ok_plus = setEffHisto("h_eta_me1_after_tf_ok_plus","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange); + TH1D* h_eff_eta_me1_after_tf_ok_plus_pt10 = setEffHisto("h_eta_me1_after_tf_ok_plus_pt10","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange); + + h_eff_eta_me1_after_lct_okClctAlct->Draw("hist"); + h_eff_eta_me1_after_mplct_okClctAlct_plus->Draw("same hist"); + h_eff_eta_me1_after_tf_ok_plus->Draw("same hist"); + h_eff_eta_me1_after_tf_ok_plus_pt10->Draw("same hist"); -TH1D* h_eff_eta_me1_after_lct_okClctAlct = setEffHisto("h_eta_me1_after_lct_okAlctClct","h_eta_initial",dir, etareb, kRed, 1,2, "eff(#eta): ME1 TF studies", "#eta","",xrange,yrange); -TH1D* h_eff_eta_me1_after_mplct_okClctAlct_plus = setEffHisto("h_eta_me1_after_mplct_okAlctClct_plus","h_eta_initial",dir, etareb, kBlack, 1,2, "","","",xrange,yrange); -//TH1D* h_eff_eta_after_tfcand_ok_plus = setEffHisto("h_eta_after_tfcand_ok_plus","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange); -//TH1D* h_eff_eta_after_tfcand_ok_plus_pt10 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange); -TH1D* h_eff_eta_me1_after_tf_ok_plus = setEffHisto("h_eta_me1_after_tf_ok_plus","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange); -TH1D* h_eff_eta_me1_after_tf_ok_plus_pt10 = setEffHisto("h_eta_me1_after_tf_ok_plus_pt10","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange); - -h_eff_eta_me1_after_lct_okClctAlct->Draw("hist"); -h_eff_eta_me1_after_mplct_okClctAlct_plus->Draw("same hist"); -h_eff_eta_me1_after_tf_ok_plus->Draw("same hist"); -h_eff_eta_me1_after_tf_ok_plus_pt10->Draw("same hist"); + leg = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("Eff. for #mu with p_{T}>20 crossing ME1+one more station with"); + leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"LCT matched in ME1","pl"); + leg->AddEntry(h_eff_eta_me1_after_mplct_okClctAlct_plus,"MPC matched in ME1+one","pl"); + leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus,"TF track with matched stubs in ME1+one","pl"); + leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in ME1+one","pl"); + leg->Draw(); -leg = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("Eff. for #mu with p_{T}>20 crossing ME1+one more station with"); -leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"LCT matched in ME1","pl"); -leg->AddEntry(h_eff_eta_me1_after_mplct_okClctAlct_plus,"MPC matched in ME1+one","pl"); -leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus,"TF track with matched stubs in ME1+one","pl"); -leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in ME1+one","pl"); -leg->Draw(); + Print(c_eff_eta_me1_tf,"h_eff_eta_me1_tf" + ext); -Print(c_eff_eta_me1_tf,"h_eff_eta_me1_tf.png"); + //################################################################################################ -//################################################################################################ + TCanvas* c_eff_eta_tf = new TCanvas("c_eff_eta_tf","c_eff_eta_tf",1000,600 ) ; -TCanvas* c_eff_eta_tf = new TCanvas("c_eff_eta_tf","c_eff_eta_tf",1000,600 ) ; + TH1D* h_eff_eta_after_mpc_ok_plus = setEffHisto("h_eta_after_mpc_ok_plus","h_eta_initial",dir, etareb, kBlack, 1,2, "eff(#eta): TF studies","#eta","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus = setEffHisto("h_eta_after_tfcand_ok_plus","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus_pt10 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange); -TH1D* h_eff_eta_after_mpc_ok_plus = setEffHisto("h_eta_after_mpc_ok_plus","h_eta_initial",dir, etareb, kBlack, 1,2, "eff(#eta): TF studies","#eta","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus = setEffHisto("h_eta_after_tfcand_ok_plus","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus_pt10 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange); + h_eff_eta_after_mpc_ok_plus->Draw("hist"); + h_eff_eta_after_tfcand_ok_plus->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus_pt10->Draw("same hist"); -h_eff_eta_after_mpc_ok_plus->Draw("hist"); -h_eff_eta_after_tfcand_ok_plus->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus_pt10->Draw("same hist"); + leg = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("Eff. for #mu with p_{T}>20 crossing #geq2 stations with"); + leg->AddEntry(h_eff_eta_after_mpc_ok_plus,"MPC matched in 2stations","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus,"TF track with matched stubs in 2st","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); + leg->Draw(); -leg = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("Eff. for #mu with p_{T}>20 crossing #geq2 stations with"); -leg->AddEntry(h_eff_eta_after_mpc_ok_plus,"MPC matched in 2stations","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus,"TF track with matched stubs in 2st","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); -leg->Draw(); + Print(c_eff_eta_tf,"h_eff_eta_tf" + ext); -Print(c_eff_eta_tf,"h_eff_eta_tf.png"); + //################################################################################################ -//################################################################################################ + TCanvas* c_eff_eta_tf_3st1a = new TCanvas("c_eff_eta_tf_3st1a","c_eff_eta_tf_3st1a",1000,600 ) ; -TCanvas* c_eff_eta_tf_3st1a = new TCanvas("c_eff_eta_tf_3st1a","c_eff_eta_tf_3st1a",1000,600 ) ; + TH1D* h_eff_eta_after_mpc_ok_plus = setEffHisto("h_eta_after_mpc_ok_plus","h_eta_initial",dir, etareb, kBlack, 1,2, "eff(#eta): TF studies (3TF stubs in ME1a)","#eta","",xrange,yrange); + TH1D* h_eff_eta_after_mpc_ok_plus_3st = setEffHisto("h_eta_after_mpc_ok_plus_3st","h_eta_initial",dir, etareb, kOrange+2, 1,2, "","","",xrange,yrange); + //TH1D* h_eff_eta_after_mpc_ok_plus_3st1a = setEffHisto("h_eta_after_mpc_ok_plus_3st1a","h_eta_initial",dir, etareb, kBlack-4, 1,2, "","","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus_3st1a = setEffHisto("h_eta_after_tfcand_ok_plus_3st1a","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus_pt10_3st1a = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_3st1a","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange); -TH1D* h_eff_eta_after_mpc_ok_plus = setEffHisto("h_eta_after_mpc_ok_plus","h_eta_initial",dir, etareb, kBlack, 1,2, "eff(#eta): TF studies (3TF stubs in ME1a)","#eta","",xrange,yrange); -TH1D* h_eff_eta_after_mpc_ok_plus_3st = setEffHisto("h_eta_after_mpc_ok_plus_3st","h_eta_initial",dir, etareb, kOrange+2, 1,2, "","","",xrange,yrange); -//TH1D* h_eff_eta_after_mpc_ok_plus_3st1a = setEffHisto("h_eta_after_mpc_ok_plus_3st1a","h_eta_initial",dir, etareb, kBlack-4, 1,2, "","","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus_3st1a = setEffHisto("h_eta_after_tfcand_ok_plus_3st1a","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus_pt10_3st1a = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_3st1a","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange); + h_eff_eta_after_mpc_ok_plus->Draw("hist"); + h_eff_eta_after_mpc_ok_plus_3st->Draw("same hist"); + //h_eff_eta_after_mpc_ok_plus_3st1a->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus_3st1a->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus_pt10_3st1a->Draw("same hist"); -h_eff_eta_after_mpc_ok_plus->Draw("hist"); -h_eff_eta_after_mpc_ok_plus_3st->Draw("same hist"); -//h_eff_eta_after_mpc_ok_plus_3st1a->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus_3st1a->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus_pt10_3st1a->Draw("same hist"); + leg = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("Eff. for #mu with p_{T}>20 crossing #geq2 stations with"); + leg->AddEntry(h_eff_eta_after_mpc_ok_plus,"MPC matched in 2stations","pl"); + leg->AddEntry(h_eff_eta_after_mpc_ok_plus_3st,"MPC matched in 3stations","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_3st1a,"TF track with matched stubs in 2st","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_3st1a,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); + leg->Draw(); -leg = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("Eff. for #mu with p_{T}>20 crossing #geq2 stations with"); -leg->AddEntry(h_eff_eta_after_mpc_ok_plus,"MPC matched in 2stations","pl"); -leg->AddEntry(h_eff_eta_after_mpc_ok_plus_3st,"MPC matched in 3stations","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_3st1a,"TF track with matched stubs in 2st","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_3st1a,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); -leg->Draw(); + Print(c_eff_eta_tf_3st1a,"h_eff_eta_tf_3st1a" + ext); -Print(c_eff_eta_tf_3st1a,"h_eff_eta_tf_3st1a.png"); + //################################################################################################ -//################################################################################################ + TCanvas* c_eff_eta_tf_q = new TCanvas("c_eff_eta_tf_q","c_eff_eta_tf_q",1000,600 ) ; -TCanvas* c_eff_eta_tf_q = new TCanvas("c_eff_eta_tf_q","c_eff_eta_tf_q",1000,600 ) ; + TH1D* h_eff_eta_after_tfcand_ok_plus_q1 = setEffHisto("h_eta_after_tfcand_ok_plus_q1","h_eta_after_mpc_ok_plus",dir, etareb, kBlue, 1,1, "eff(#eta): TF quality studies (denom: 2MPCs)","#eta","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus_q2 = setEffHisto("h_eta_after_tfcand_ok_plus_q2","h_eta_after_mpc_ok_plus",dir, etareb, kCyan+2, 1,1, "","","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus_q3 = setEffHisto("h_eta_after_tfcand_ok_plus_q3","h_eta_after_mpc_ok_plus",dir, etareb, kMagenta+1, 1,1, "","","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus_q1 = setEffHisto("h_eta_after_tfcand_ok_plus_q1","h_eta_after_mpc_ok_plus",dir, etareb, kBlue, 1,1, "eff(#eta): TF quality studies (denom: 2MPCs)","#eta","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus_q2 = setEffHisto("h_eta_after_tfcand_ok_plus_q2","h_eta_after_mpc_ok_plus",dir, etareb, kCyan+2, 1,1, "","","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus_q3 = setEffHisto("h_eta_after_tfcand_ok_plus_q3","h_eta_after_mpc_ok_plus",dir, etareb, kMagenta+1, 1,1, "","","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus_pt10_q1 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_q1","h_eta_after_mpc_ok_plus",dir, etareb, kBlue, 2,2, "eff(#eta): TF quality studies (denom: 2MPCs)","#eta","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus_pt10_q2 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_q2","h_eta_after_mpc_ok_plus",dir, etareb, kCyan+2, 2,2, "","","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus_pt10_q3 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_q3","h_eta_after_mpc_ok_plus",dir, etareb, kMagenta+1, 2,2, "","","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus_pt10_q1 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_q1","h_eta_after_mpc_ok_plus",dir, etareb, kBlue, 2,2, "eff(#eta): TF quality studies (denom: 2MPCs)","#eta","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus_pt10_q2 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_q2","h_eta_after_mpc_ok_plus",dir, etareb, kCyan+2, 2,2, "","","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus_pt10_q3 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_q3","h_eta_after_mpc_ok_plus",dir, etareb, kMagenta+1, 2,2, "","","",xrange,yrange); + h_eff_eta_after_tfcand_ok_plus_q1->Draw("hist"); + h_eff_eta_after_tfcand_ok_plus_pt10_q1->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus_q2->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus_pt10_q2->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus_q3->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus_pt10_q3->Draw("same hist"); + + leg = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetNColumns(2); + leg->SetHeader("TF track with matched stubs in 2st and "); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_q1,"Q#geq1","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_q1,"Q#geq1, p_{T}^{TF}>10","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_q2,"Q#geq2","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_q2,"Q#geq2, p_{T}^{TF}>10","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_q3,"Q=3","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_q3,"Q=3, p_{T}^{TF}>10","pl"); + leg->Draw(); -h_eff_eta_after_tfcand_ok_plus_q1->Draw("hist"); -h_eff_eta_after_tfcand_ok_plus_pt10_q1->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus_q2->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus_pt10_q2->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus_q3->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus_pt10_q3->Draw("same hist"); - -leg = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetNColumns(2); -leg->SetHeader("TF track with matched stubs in 2st and "); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_q1,"Q#geq1","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_q1,"Q#geq1, p_{T}^{TF}>10","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_q2,"Q#geq2","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_q2,"Q#geq2, p_{T}^{TF}>10","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_q3,"Q=3","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_q3,"Q=3, p_{T}^{TF}>10","pl"); -leg->Draw(); + Print(c_eff_eta_tf_q,"h_eff_eta_tf_q" + ext); -Print(c_eff_eta_tf_q,"h_eff_eta_tf_q.png"); + //################################################################################################ -//################################################################################################ + TCanvas* c_eff_pt_tf = new TCanvas("c_eff_pt_tf","c_eff_pt_tf",1000,600 ) ; -TCanvas* c_eff_pt_tf = new TCanvas("c_eff_pt_tf","c_eff_pt_tf",1000,600 ) ; + TH1D* h_eff_pt_after_mpc_ok_plus = setEffHisto("h_pt_after_mpc_ok_plus","h_pt_initial",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.2<#eta<2.1)","p_{T}","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus = setEffHisto("h_pt_after_tfcand_ok_plus","h_pt_initial",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus_pt10 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10","h_pt_initial",dir, ptreb, kBlue, 2,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_mpc_ok_plus = setEffHisto("h_pt_after_mpc_ok_plus","h_pt_initial",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.2<#eta<2.1)","p_{T}","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus = setEffHisto("h_pt_after_tfcand_ok_plus","h_pt_initial",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus_pt10 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10","h_pt_initial",dir, ptreb, kBlue, 2,2, "","","",xrangept,yrange); + h_eff_pt_after_mpc_ok_plus->Draw("hist"); + h_eff_pt_after_tfcand_ok_plus->Draw("same hist"); + h_eff_pt_after_tfcand_ok_plus_pt10->Draw("same hist"); -h_eff_pt_after_mpc_ok_plus->Draw("hist"); -h_eff_pt_after_tfcand_ok_plus->Draw("same hist"); -h_eff_pt_after_tfcand_ok_plus_pt10->Draw("same hist"); + leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetHeader("Eff. for #mu crossing ME1+one more station in 1.2<#eta<2.1 with"); + leg1->AddEntry(h_eff_pt_after_mpc_ok_plus,"MPC matched in 2stations","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus,"TF track with matched stubs in 2st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); + leg1->Draw(); + + Print(c_eff_pt_tf,"h_eff_pt_tf" + ext); + + + //################################################################################################ + + TCanvas* c_eff_pt_tf_eta1b_2s = new TCanvas("c_eff_pt_tf_eta1b_2s","c_eff_pt_tf_eta1b_2s",1000,600 ) ; + + TH1D* h_eff_pt_after_tfcand_eta1b_2s = setEffHisto("h_pt_after_tfcand_eta1b_2s","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_2s_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_2s_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_2s_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_2s_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange); -leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetHeader("Eff. for #mu crossing ME1+one more station in 1.2<#eta<2.1 with"); -leg1->AddEntry(h_eff_pt_after_mpc_ok_plus,"MPC matched in 2stations","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus,"TF track with matched stubs in 2st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); -leg1->Draw(); - -Print(c_eff_pt_tf,"h_eff_pt_tf.png"); - - -//################################################################################################ - -TCanvas* c_eff_pt_tf_eta1b_2s = new TCanvas("c_eff_pt_tf_eta1b_2s","c_eff_pt_tf_eta1b_2s",1000,600 ) ; - -TH1D* h_eff_pt_after_tfcand_eta1b_2s = setEffHisto("h_pt_after_tfcand_eta1b_2s","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_2s_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_2s_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_2s_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_2s_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange); + h_eff_pt_after_tfcand_eta1b_2s->GetXaxis()->SetRangeUser(0.,49.99); -h_eff_pt_after_tfcand_eta1b_2s->GetXaxis()->SetRangeUser(0.,49.99); + h_eff_pt_after_tfcand_eta1b_2s->Draw("hist"); + h_eff_pt_after_tfcand_eta1b_2s_pt10->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_2s_pt20->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_2s_pt25->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_2s_pt30->Draw("same hist"); + + leg1 = new TLegend(0.5,0.15,0.99,0.5,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s,"stubs in (2+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt10,"p_{T}^{TF}#geq10, stubs in (2+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt20,"p_{T}^{TF}#geq20, stubs in (2+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt25,"p_{T}^{TF}#geq25, stubs in (2+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt30,"p_{T}^{TF}#geq30, stubs in (2+)st","pl"); + leg1->Draw(); -h_eff_pt_after_tfcand_eta1b_2s->Draw("hist"); -h_eff_pt_after_tfcand_eta1b_2s_pt10->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_2s_pt20->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_2s_pt25->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_2s_pt30->Draw("same hist"); - -leg1 = new TLegend(0.5,0.15,0.99,0.5,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s,"stubs in (2+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt10,"p_{T}^{TF}>=10, stubs in (2+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt20,"p_{T}^{TF}>=20, stubs in (2+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt25,"p_{T}^{TF}>=25, stubs in (2+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt30,"p_{T}^{TF}>=30, stubs in (2+)st","pl"); -leg1->Draw(); + Print(c_eff_pt_tf_eta1b_2s, "h_eff_pt_tf_eta1b_2s" + ext); -Print(c_eff_pt_tf_eta1b_2s, "h_eff_pt_tf_eta1b_2s.png"); + //################################################################################################ -//################################################################################################ + TCanvas* c_eff_pt_tf_eta1b_2s1b = new TCanvas("c_eff_pt_tf_eta1b_2s1b","c_eff_pt_tf_eta1b_2s1b",1000,600 ) ; -TCanvas* c_eff_pt_tf_eta1b_2s1b = new TCanvas("c_eff_pt_tf_eta1b_2s1b","c_eff_pt_tf_eta1b_2s1b",1000,600 ) ; + TH1D* h_eff_pt_after_tfcand_eta1b_2s1b = setEffHisto("h_pt_after_tfcand_eta1b_2s1b","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_2s1b_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_2s1b_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_2s1b_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_2s1b_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_2s1b = setEffHisto("h_pt_after_tfcand_eta1b_2s1b","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_2s1b_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_2s1b_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_2s1b_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_2s1b_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange); + h_eff_pt_after_tfcand_eta1b_2s1b->GetXaxis()->SetRangeUser(0.,49.99); -h_eff_pt_after_tfcand_eta1b_2s1b->GetXaxis()->SetRangeUser(0.,49.99); + h_eff_pt_after_tfcand_eta1b_2s1b->Draw("hist"); + h_eff_pt_after_tfcand_eta1b_2s1b_pt10->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_2s1b_pt20->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_2s1b_pt25->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_2s1b_pt30->Draw("same hist"); + + leg1 = new TLegend(0.5,0.15,0.99,0.5,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b,"stubs in ME1+(1+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt10,"p_{T}^{TF}#geq10, stubs in ME1+(1+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt20,"p_{T}^{TF}#geq20, stubs in ME1+(1+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt25,"p_{T}^{TF}#geq25, stubs in ME1+(1+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt30,"p_{T}^{TF}#geq30, stubs in ME1+(1+)st","pl"); + leg1->Draw(); -h_eff_pt_after_tfcand_eta1b_2s1b->Draw("hist"); -h_eff_pt_after_tfcand_eta1b_2s1b_pt10->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_2s1b_pt20->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_2s1b_pt25->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_2s1b_pt30->Draw("same hist"); - -leg1 = new TLegend(0.5,0.15,0.99,0.5,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b,"stubs in ME1+(1+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt10,"p_{T}^{TF}>=10, stubs in ME1+(1+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt20,"p_{T}^{TF}>=20, stubs in ME1+(1+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt25,"p_{T}^{TF}>=25, stubs in ME1+(1+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt30,"p_{T}^{TF}>=30, stubs in ME1+(1+)st","pl"); -leg1->Draw(); + Print(c_eff_pt_tf_eta1b_2s1b, "h_eff_pt_tf_eta1b_2s1b" + ext); -Print(c_eff_pt_tf_eta1b_2s1b, "h_eff_pt_tf_eta1b_2s1b.png"); + //################################################################################################ -//################################################################################################ + TCanvas* c_eff_pt_tf_eta1b_3s = new TCanvas("c_eff_pt_tf_eta1b_3s","c_eff_pt_tf_eta1b_3s",1000,600 ) ; -TCanvas* c_eff_pt_tf_eta1b_3s = new TCanvas("c_eff_pt_tf_eta1b_3s","c_eff_pt_tf_eta1b_3s",1000,600 ) ; + TH1D* h_eff_pt_after_tfcand_eta1b_3s = setEffHisto("h_pt_after_tfcand_eta1b_3s","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_3s_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_3s_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_3s_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_3s_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_3s = setEffHisto("h_pt_after_tfcand_eta1b_3s","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_3s_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_3s_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_3s_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_3s_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange); + h_eff_pt_after_tfcand_eta1b_3s->GetXaxis()->SetRangeUser(0.,49.99); -h_eff_pt_after_tfcand_eta1b_3s->GetXaxis()->SetRangeUser(0.,49.99); + h_eff_pt_after_tfcand_eta1b_3s->Draw("hist"); + h_eff_pt_after_tfcand_eta1b_3s_pt10->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_3s_pt20->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_3s_pt25->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_3s_pt30->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_3s->Draw("hist"); -h_eff_pt_after_tfcand_eta1b_3s_pt10->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_3s_pt20->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_3s_pt25->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_3s_pt30->Draw("same hist"); + leg1 = new TLegend(0.5,0.15,0.99,0.5,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s,"stubs in (3+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt10,"p_{T}^{TF}#geq10, stubs in (3+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt20,"p_{T}^{TF}#geq20, stubs in (3+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt25,"p_{T}^{TF}#geq25, stubs in (3+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt30,"p_{T}^{TF}#geq30, stubs in (3+)st","pl"); + leg1->Draw(); -leg1 = new TLegend(0.5,0.15,0.99,0.5,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s,"stubs in (3+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt10,"p_{T}^{TF}>=10, stubs in (3+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt20,"p_{T}^{TF}>=20, stubs in (3+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt25,"p_{T}^{TF}>=25, stubs in (3+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt30,"p_{T}^{TF}>=30, stubs in (3+)st","pl"); -leg1->Draw(); + Print(c_eff_pt_tf_eta1b_3s, "h_eff_pt_tf_eta1b_3s" + ext); -Print(c_eff_pt_tf_eta1b_3s, "h_eff_pt_tf_eta1b_3s.png"); + //################################################################################################ -//################################################################################################ + TCanvas* c_eff_pt_tf_eta1b_3s1b = new TCanvas("c_eff_pt_tf_eta1b_3s1b","c_eff_pt_tf_eta1b_3s1b",1000,600 ) ; -TCanvas* c_eff_pt_tf_eta1b_3s1b = new TCanvas("c_eff_pt_tf_eta1b_3s1b","c_eff_pt_tf_eta1b_3s1b",1000,600 ) ; + TH1D* h_eff_pt_after_tfcand_eta1b_3s1b = setEffHisto("h_pt_after_tfcand_eta1b_3s1b","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_3s1b_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_3s1b_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_3s1b_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_3s1b_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange); + + h_eff_pt_after_tfcand_eta1b_3s1b->GetXaxis()->SetRangeUser(0.,49.99); + + h_eff_pt_after_tfcand_eta1b_3s1b->Draw("hist"); + h_eff_pt_after_tfcand_eta1b_3s1b_pt10->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_3s1b_pt20->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_3s1b_pt25->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_3s1b_pt30->Draw("same hist"); + + leg1 = new TLegend(0.5,0.15,0.99,0.5,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b,"stubs in ME1+(2+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt10,"p_{T}^{TF}#geq10, stubs in ME1+(2+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt20,"p_{T}^{TF}#geq20, stubs in ME1+(2+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt25,"p_{T}^{TF}#geq25, stubs in ME1+(2+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt30,"p_{T}^{TF}#geq30, stubs in ME1+(2+)st","pl"); + leg1->Draw(); + + Print(c_eff_pt_tf_eta1b_3s1b, "h_eff_pt_tf_eta1b_3s1b" + ext); + + + + //################################################################################################ + + /* + TCanvas* c_eff_pth_tf = new TCanvas("c_eff_pth_tf","c_eff_pth_tf",1000,600 ) ; + + TH1D* h_eff_pth_after_mpc_ok_plus = setEffHisto("h_pth_after_mpc_ok_plus","h_pth_initial",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (2.1<#eta<2.4)","p_{T}","",xrangept,yrange); + TH1D* h_eff_pth_after_tfcand_ok_plus = setEffHisto("h_pth_after_tfcand_ok_plus","h_pth_initial",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pth_after_tfcand_ok_plus_pt10 = setEffHisto("h_pth_after_tfcand_ok_plus_pt10","h_pth_initial",dir, ptreb, kBlue, 2,2, "","","",xrangept,yrange); + + h_eff_pth_after_mpc_ok_plus->Draw("hist"); + h_eff_pth_after_tfcand_ok_plus->Draw("same hist"); + h_eff_pth_after_tfcand_ok_plus_pt10->Draw("same hist"); -TH1D* h_eff_pt_after_tfcand_eta1b_3s1b = setEffHisto("h_pt_after_tfcand_eta1b_3s1b","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_3s1b_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_3s1b_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_3s1b_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_3s1b_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange); - -h_eff_pt_after_tfcand_eta1b_3s1b->GetXaxis()->SetRangeUser(0.,49.99); - -h_eff_pt_after_tfcand_eta1b_3s1b->Draw("hist"); -h_eff_pt_after_tfcand_eta1b_3s1b_pt10->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_3s1b_pt20->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_3s1b_pt25->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_3s1b_pt30->Draw("same hist"); - -leg1 = new TLegend(0.5,0.15,0.99,0.5,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b,"stubs in ME1+(2+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt10,"p_{T}^{TF}>=10, stubs in ME1+(2+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt20,"p_{T}^{TF}>=20, stubs in ME1+(2+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt25,"p_{T}^{TF}>=25, stubs in ME1+(2+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt30,"p_{T}^{TF}>=30, stubs in ME1+(2+)st","pl"); -leg1->Draw(); - -Print(c_eff_pt_tf_eta1b_3s1b, "h_eff_pt_tf_eta1b_3s1b.png"); - - - -//################################################################################################ - -/* -TCanvas* c_eff_pth_tf = new TCanvas("c_eff_pth_tf","c_eff_pth_tf",1000,600 ) ; - -TH1D* h_eff_pth_after_mpc_ok_plus = setEffHisto("h_pth_after_mpc_ok_plus","h_pth_initial",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (2.1<#eta<2.4)","p_{T}","",xrangept,yrange); -TH1D* h_eff_pth_after_tfcand_ok_plus = setEffHisto("h_pth_after_tfcand_ok_plus","h_pth_initial",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pth_after_tfcand_ok_plus_pt10 = setEffHisto("h_pth_after_tfcand_ok_plus_pt10","h_pth_initial",dir, ptreb, kBlue, 2,2, "","","",xrangept,yrange); - -h_eff_pth_after_mpc_ok_plus->Draw("hist"); -h_eff_pth_after_tfcand_ok_plus->Draw("same hist"); -h_eff_pth_after_tfcand_ok_plus_pt10->Draw("same hist"); + leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetHeader("Eff. for #mu crossing ME1+one more station in 2.1<#eta<2.4 with"); + leg1->AddEntry(h_eff_pth_after_mpc_ok_plus,"MPC matched in 2stations","pl"); + leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus,"TF track with matched stubs in 2st","pl"); + leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); + leg1->Draw(); -leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetHeader("Eff. for #mu crossing ME1+one more station in 2.1<#eta<2.4 with"); -leg1->AddEntry(h_eff_pth_after_mpc_ok_plus,"MPC matched in 2stations","pl"); -leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus,"TF track with matched stubs in 2st","pl"); -leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); -leg1->Draw(); + Print(c_eff_pth_tf,"h_eff_pth_tf" + ext); + */ -Print(c_eff_pth_tf,"h_eff_pth_tf.png"); -*/ + //################################################################################################ -//################################################################################################ + /* + TCanvas* c_eff_pth_tf_3st1a = new TCanvas("c_eff_pth_tf_3st1a","c_eff_pth_tf_3st1a",1000,600 ) ; -/* -TCanvas* c_eff_pth_tf_3st1a = new TCanvas("c_eff_pth_tf_3st1a","c_eff_pth_tf_3st1a",1000,600 ) ; + TH1D* h_eff_pth_after_mpc_ok_plus = setEffHisto("h_pth_after_mpc_ok_plus","h_pth_initial",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (2.1<#eta<2.4)","p_{T}","",xrangept,yrange); + TH1D* h_eff_pth_after_tfcand_ok_plus_3st1a = setEffHisto("h_pth_after_tfcand_ok_plus_3st1a","h_pth_initial",dir, ptreb, kBlue, 1,2, "eff(p_{T}^{MC}): TF studies (denom: 2MPCs, 2.1<#eta<2.4)","p_{T}","",xrangept,yrange); + TH1D* h_eff_pth_after_tfcand_ok_plus_pt10_3st1a = setEffHisto("h_pth_after_tfcand_ok_plus_pt10_3st1a","h_pth_initial",dir, ptreb, kBlue, 2,2, "","","",xrangept,yrange); -TH1D* h_eff_pth_after_mpc_ok_plus = setEffHisto("h_pth_after_mpc_ok_plus","h_pth_initial",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (2.1<#eta<2.4)","p_{T}","",xrangept,yrange); -TH1D* h_eff_pth_after_tfcand_ok_plus_3st1a = setEffHisto("h_pth_after_tfcand_ok_plus_3st1a","h_pth_initial",dir, ptreb, kBlue, 1,2, "eff(p_{T}^{MC}): TF studies (denom: 2MPCs, 2.1<#eta<2.4)","p_{T}","",xrangept,yrange); -TH1D* h_eff_pth_after_tfcand_ok_plus_pt10_3st1a = setEffHisto("h_pth_after_tfcand_ok_plus_pt10_3st1a","h_pth_initial",dir, ptreb, kBlue, 2,2, "","","",xrangept,yrange); + h_eff_pth_after_mpc_ok_plus->Draw("hist"); + h_eff_pth_after_tfcand_ok_plus_3st1a->Draw("same hist"); + h_eff_pth_after_tfcand_ok_plus_pt10_3st1a->Draw("same hist"); -h_eff_pth_after_mpc_ok_plus->Draw("hist"); -h_eff_pth_after_tfcand_ok_plus_3st1a->Draw("same hist"); -h_eff_pth_after_tfcand_ok_plus_pt10_3st1a->Draw("same hist"); + leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetHeader("Eff. for #mu crossing ME1+one more station in 2.1<#eta<2.4 with"); + leg1->AddEntry(h_eff_pth_after_mpc_ok_plus,"MPC matched in 2stations","pl"); + leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus_3st1a,"TF track with matched stubs in 3st","pl"); + leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus_pt10_3st1a,"p_{T}^{TF}>10 TF track with matched stubs in 3st","pl"); + leg1->Draw(); -leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetHeader("Eff. for #mu crossing ME1+one more station in 2.1<#eta<2.4 with"); -leg1->AddEntry(h_eff_pth_after_mpc_ok_plus,"MPC matched in 2stations","pl"); -leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus_3st1a,"TF track with matched stubs in 3st","pl"); -leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus_pt10_3st1a,"p_{T}^{TF}>10 TF track with matched stubs in 3st","pl"); -leg1->Draw(); + Print(c_eff_pth_tf_3st1a,"h_eff_pth_tf_3st1a" + ext); -Print(c_eff_pth_tf_3st1a,"h_eff_pth_tf_3st1a.png"); + */ + //################################################################################################ -*/ -//################################################################################################ + TCanvas* c_eff_pt_tf_q = new TCanvas("c_eff_pt_tf_q","c_eff_pt_tf_q",1000,600 ) ; -TCanvas* c_eff_pt_tf_q = new TCanvas("c_eff_pt_tf_q","c_eff_pt_tf_q",1000,600 ) ; + TH1D* h_eff_pt_after_tfcand_ok_plus_q1 = setEffHisto("h_pt_after_tfcand_ok_plus_q1","h_pt_after_mpc_ok_plus",dir, etareb, kBlue, 1,1, "eff(p_{T}^{MC}): TF quality studies (denom: 2MPCs, 1.2<#eta<2.1)","p_{T}^{MC}","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus_q2 = setEffHisto("h_pt_after_tfcand_ok_plus_q2","h_pt_after_mpc_ok_plus",dir, etareb, kCyan+2, 1,1, "eff(p_{T}^{MC}): TF quality studies (denom: 2MPCs, 1.2<#eta<2.1)","p_{T}^{MC}","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus_q3 = setEffHisto("h_pt_after_tfcand_ok_plus_q3","h_pt_after_mpc_ok_plus",dir, etareb, kMagenta+1, 1,1, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus_q1 = setEffHisto("h_pt_after_tfcand_ok_plus_q1","h_pt_after_mpc_ok_plus",dir, etareb, kBlue, 1,1, "eff(p_{T}^{MC}): TF quality studies (denom: 2MPCs, 1.2<#eta<2.1)","p_{T}^{MC}","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus_q2 = setEffHisto("h_pt_after_tfcand_ok_plus_q2","h_pt_after_mpc_ok_plus",dir, etareb, kCyan+2, 1,1, "eff(p_{T}^{MC}): TF quality studies (denom: 2MPCs, 1.2<#eta<2.1)","p_{T}^{MC}","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus_q3 = setEffHisto("h_pt_after_tfcand_ok_plus_q3","h_pt_after_mpc_ok_plus",dir, etareb, kMagenta+1, 1,1, "","","",xrangept,yrange); + //TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q1 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q1","h_pt_after_mpc_ok_plus",dir, etareb, kBlue, 2,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q2 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q2","h_pt_after_mpc_ok_plus",dir, etareb, kCyan+2, 2,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q3 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q3","h_pt_after_mpc_ok_plus",dir, etareb, kMagenta+1, 2,2, "","","",xrangept,yrange); -//TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q1 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q1","h_pt_after_mpc_ok_plus",dir, etareb, kBlue, 2,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q2 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q2","h_pt_after_mpc_ok_plus",dir, etareb, kCyan+2, 2,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q3 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q3","h_pt_after_mpc_ok_plus",dir, etareb, kMagenta+1, 2,2, "","","",xrangept,yrange); + h_eff_pt_after_tfcand_ok_plus_q1->Draw("hist"); + //h_eff_pt_after_tfcand_ok_plus_pt10_q1->Draw("same hist"); + h_eff_pt_after_tfcand_ok_plus_q2->Draw("same hist"); + //h_eff_pt_after_tfcand_ok_plus_pt10_q2->Draw("same hist"); + h_eff_pt_after_tfcand_ok_plus_q3->Draw("same hist"); + h_eff_pt_after_tfcand_ok_plus_pt10_q3->Draw("same hist"); -h_eff_pt_after_tfcand_ok_plus_q1->Draw("hist"); -//h_eff_pt_after_tfcand_ok_plus_pt10_q1->Draw("same hist"); -h_eff_pt_after_tfcand_ok_plus_q2->Draw("same hist"); -//h_eff_pt_after_tfcand_ok_plus_pt10_q2->Draw("same hist"); -h_eff_pt_after_tfcand_ok_plus_q3->Draw("same hist"); -h_eff_pt_after_tfcand_ok_plus_pt10_q3->Draw("same hist"); + leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetNColumns(2); + leg1->SetHeader("TF track with matched stubs in 2st and "); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_q1,"Q#geq1","pl"); + //leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q1,"Q#geq1, p_{T}^{TF}>10","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_q2,"Q#geq2","pl"); + //leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q2,"Q#geq2, p_{T}^{TF}>10","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_q3,"Q=3","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q3,"Q=3, p_{T}^{TF}>10","pl"); + leg1->Draw(); -leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetNColumns(2); -leg1->SetHeader("TF track with matched stubs in 2st and "); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_q1,"Q#geq1","pl"); -//leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q1,"Q#geq1, p_{T}^{TF}>10","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_q2,"Q#geq2","pl"); -//leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q2,"Q#geq2, p_{T}^{TF}>10","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_q3,"Q=3","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q3,"Q=3, p_{T}^{TF}>10","pl"); -leg1->Draw(); + Print(c_eff_pt_tf_q,"h_eff_pt_tf_q" + ext); -Print(c_eff_pt_tf_q,"h_eff_pt_tf_q.png"); + //################################################################################################ -//################################################################################################ + TCanvas* c_eff_ptres_tf = new TCanvas("c_eff_ptres_tf","c_eff_ptres_tf",1000,600 ) ; -TCanvas* c_eff_ptres_tf = new TCanvas("c_eff_ptres_tf","c_eff_ptres_tf",1000,600 ) ; + TH1D* h_eff_pt_after_tfcand_ok_plus_pt10 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10","h_pt_after_tfcand_ok_plus",dir, ptreb, kBlue, 1,2, "p_{T}^{TF}>10 assignment eff(p_{T}^{MC}) studies (denom: any p_{T}^{TF}, 1.2<#eta<2.1)","p_{T}^{MC}","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q2 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q2","h_pt_after_tfcand_ok_plus_q2",dir, ptreb, kCyan+2, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q3 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q3","h_pt_after_tfcand_ok_plus_q3",dir, ptreb, kMagenta+1, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus_pt10 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10","h_pt_after_tfcand_ok_plus",dir, ptreb, kBlue, 1,2, "p_{T}^{TF}>10 assignment eff(p_{T}^{MC}) studies (denom: any p_{T}^{TF}, 1.2<#eta<2.1)","p_{T}^{MC}","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q2 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q2","h_pt_after_tfcand_ok_plus_q2",dir, ptreb, kCyan+2, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q3 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q3","h_pt_after_tfcand_ok_plus_q3",dir, ptreb, kMagenta+1, 1,2, "","","",xrangept,yrange); + h_eff_pt_after_tfcand_ok_plus_pt10->Draw("hist"); + h_eff_pt_after_tfcand_ok_plus_pt10_q2->Draw("same hist"); + h_eff_pt_after_tfcand_ok_plus_pt10_q3->Draw("same hist"); -h_eff_pt_after_tfcand_ok_plus_pt10->Draw("hist"); -h_eff_pt_after_tfcand_ok_plus_pt10_q2->Draw("same hist"); -h_eff_pt_after_tfcand_ok_plus_pt10_q3->Draw("same hist"); + leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetHeader("for #mu with p_{T}>20 crossing ME1+one station to pass p_{T}^{TF}>10 with"); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10,"any Q","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q2,"Q#geq2","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q3,"Q=3","pl"); + leg1->Draw(); -leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetHeader("for #mu with p_{T}>20 crossing ME1+one station to pass p_{T}^{TF}>10 with"); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10,"any Q","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q2,"Q#geq2","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q3,"Q=3","pl"); -leg1->Draw(); + Print(c_eff_ptres_tf,"h_eff_ptres_tf" + ext); -Print(c_eff_ptres_tf,"h_eff_ptres_tf.png"); + //################################################################################################ -//################################################################################################ + /* + TCanvas* c_eff_DR2_tf = new TCanvas("c_eff_DR2_tf","c_eff_DR2_tf",1000,600 ) ; -/* -TCanvas* c_eff_DR2_tf = new TCanvas("c_eff_DR2_tf","c_eff_DR2_tf",1000,600 ) ; + double xrangeDR[2]={0.,3.5}; -double xrangeDR[2]={0.,3.5}; + TH1D* h_eff_DR_2SimTr_after_tfcand_ok_plus = setEffHisto("h_DR_2SimTr_after_tfcand_ok_plus","h_DR_2SimTr_after_mpc_ok_plus",dir, 3, kBlue, 1,2, "eff(#DeltaR(Tr1,Tr2)): for Tr1: p_{T}^{MC}>20, denom: 2 MPCs, 1.2<#eta<2.1","#DeltaR(Tr1,Tr2)","",xrangeDR,yrange); -TH1D* h_eff_DR_2SimTr_after_tfcand_ok_plus = setEffHisto("h_DR_2SimTr_after_tfcand_ok_plus","h_DR_2SimTr_after_mpc_ok_plus",dir, 3, kBlue, 1,2, "eff(#DeltaR(Tr1,Tr2)): for Tr1: p_{T}^{MC}>20, denom: 2 MPCs, 1.2<#eta<2.1","#DeltaR(Tr1,Tr2)","",xrangeDR,yrange); + h_eff_DR_2SimTr_after_tfcand_ok_plus->SetLineColor(0); + h_eff_DR_2SimTr_after_tfcand_ok_plus->Draw("hist"); -h_eff_DR_2SimTr_after_tfcand_ok_plus->SetLineColor(0); -h_eff_DR_2SimTr_after_tfcand_ok_plus->Draw("hist"); + TGraphAsymmErrors *gg = new TGraphAsymmErrors(); + gg->BayesDivide((const TH1*)h1,(const TH1*)h2); + gg->Draw("p"); -TGraphAsymmErrors *gg = new TGraphAsymmErrors(); -gg->BayesDivide((const TH1*)h1,(const TH1*)h2); -gg->Draw("p"); + Print(c_eff_DR2_tf,"h_eff_DR_2SimTr_tf" + ext); + */ -Print(c_eff_DR2_tf,"h_eff_DR_2SimTr_tf.png"); -*/ + return;return; -return;return; @@ -1145,793 +1157,793 @@ return;return; + h_eta_initial = (TH1D*)getH(dir,"h_eta_initial"); + h_eta_after_mpc = (TH1D*)getH(dir,"h_eta_after_mpc"); + h_eta_after_mpc_st1 = (TH1D*)getH(dir,"h_eta_after_mpc_st1"); + h_eta_after_mpc_st1_good = (TH1D*)getH(dir,"h_eta_after_mpc_st1_good"); + h_eta_after_mpc_ok = (TH1D*)getH(dir,"h_eta_after_mpc_ok"); + h_eta_after_mpc_ok_plus = (TH1D*)getH(dir,"h_eta_after_mpc_ok_plus"); -h_eta_initial = (TH1D*)getH(dir,"h_eta_initial"); -h_eta_after_mpc = (TH1D*)getH(dir,"h_eta_after_mpc"); -h_eta_after_mpc_st1 = (TH1D*)getH(dir,"h_eta_after_mpc_st1"); -h_eta_after_mpc_st1_good = (TH1D*)getH(dir,"h_eta_after_mpc_st1_good"); -h_eta_after_mpc_ok = (TH1D*)getH(dir,"h_eta_after_mpc_ok"); -h_eta_after_mpc_ok_plus = (TH1D*)getH(dir,"h_eta_after_mpc_ok_plus"); + h_eta_after_tftrack = (TH1D*)getH(dir,"h_eta_after_tftrack"); -h_eta_after_tftrack = (TH1D*)getH(dir,"h_eta_after_tftrack"); + h_eta_after_tfcand = (TH1D*)getH(dir,"h_eta_after_tfcand"); + h_eta_after_tfcand_q1 = (TH1D*)getH(dir,"h_eta_after_tfcand_q1"); + h_eta_after_tfcand_q2 = (TH1D*)getH(dir,"h_eta_after_tfcand_q2"); + h_eta_after_tfcand_q3 = (TH1D*)getH(dir,"h_eta_after_tfcand_q3"); + h_eta_after_tfcand_ok = (TH1D*)getH(dir,"h_eta_after_tfcand_ok"); + h_eta_after_tfcand_ok_plus = (TH1D*)getH(dir,"h_eta_after_tfcand_ok_plus"); + h_eta_after_tfcand_ok_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_ok_pt10"); + h_eta_after_tfcand_ok_plus_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_ok_plus_pt10"); + + h_eta_after_tfcand_all = (TH1D*)getH(dir,"h_eta_after_tfcand_all"); + h_eta_after_tfcand_all_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_all_pt10"); + + h_eta_after_gmtreg = (TH1D*)getH(dir,"h_eta_after_gmtreg"); + h_eta_after_gmtreg_all = (TH1D*)getH(dir,"h_eta_after_gmtreg_all"); + h_eta_after_gmtreg_dr = (TH1D*)getH(dir,"h_eta_after_gmtreg_dr"); + h_eta_after_gmt = (TH1D*)getH(dir,"h_eta_after_gmt"); + h_eta_after_gmt_all = (TH1D*)getH(dir,"h_eta_after_gmt_all"); + h_eta_after_xtra = (TH1D*)getH(dir,"h_eta_after_xtra"); + h_eta_after_xtra_all = (TH1D*)getH(dir,"h_eta_after_xtra_all"); + h_eta_after_xtra_dr = (TH1D*)getH(dir,"h_eta_after_xtra_dr"); + + h_eta_after_tfcand_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_pt10"); + h_eta_after_tfcand_my_st1 = (TH1D*)getH(dir,"h_eta_after_tfcand_my_st1"); + h_eta_after_tfcand_org_st1 = (TH1D*)getH(dir,"h_eta_after_tfcand_org_st1"); + h_eta_after_tfcand_comm_st1 = (TH1D*)getH(dir,"h_eta_after_tfcand_comm_st1"); + h_eta_after_tfcand_my_st1_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_my_st1_pt10"); + h_eta_after_gmtreg_dr_pt10 = (TH1D*)getH(dir,"h_eta_after_gmtreg_dr_pt10"); + h_eta_after_gmtreg_pt10= (TH1D*)getH(dir,"h_eta_after_gmtreg_pt10"); + h_eta_after_gmt_pt10 = (TH1D*)getH(dir,"h_eta_after_gmt_pt10"); + h_eta_after_xtra_dr_pt10 = (TH1D*)getH(dir,"h_eta_after_xtra_dr_pt10"); + + // = (TH1D*)getH(dir,""); + + h_eta_me1_after_alct = (TH1D*)getH(dir,"h_eta_me1_after_alct"); + h_eta_me1_after_alct_okAlct = (TH1D*)getH(dir,"h_eta_me1_after_alct_okAlct"); + h_eta_me1_after_clct = (TH1D*)getH(dir,"h_eta_me1_after_clct"); + h_eta_me1_after_clct_okClct = (TH1D*)getH(dir,"h_eta_me1_after_clct_okClct"); + h_eta_me1_after_alctclct = (TH1D*)getH(dir,"h_eta_me1_after_alctclct"); + h_eta_me1_after_alctclct_okAlct = (TH1D*)getH(dir,"h_eta_me1_after_alctclct_okAlct"); + h_eta_me1_after_alctclct_okClct = (TH1D*)getH(dir,"h_eta_me1_after_alctclct_okClct"); + h_eta_me1_after_alctclct_okAlctClct = (TH1D*)getH(dir,"h_eta_me1_after_alctclct_okAlctClct"); + + h_eta_me1_after_lct = (TH1D*)getH(dir,"h_eta_me1_after_lct"); + h_eta_me1_after_lct_okAlct = (TH1D*)getH(dir,"h_eta_me1_after_lct_okAlct"); + h_eta_me1_after_lct_okAlctClct = (TH1D*)getH(dir,"h_eta_me1_after_lct_okAlctClct"); + h_eta_me1_after_lct_okClct = (TH1D*)getH(dir,"h_eta_me1_after_lct_okClct"); + h_eta_me1_after_lct_okClctAlct = (TH1D*)getH(dir,"h_eta_me1_after_lct_okClctAlct"); + h_eta_me1_after_mplct_okAlctClct = (TH1D*)getH(dir,"h_eta_me1_after_mplct_okAlctClct"); + h_eta_me1_after_mplct_okAlctClct_plus = (TH1D*)getH(dir,"h_eta_me1_after_mplct_okAlctClct_plus"); + h_eta_me1_after_tf_ok = (TH1D*)getH(dir,"h_eta_me1_after_tf_ok"); + h_eta_me1_after_tf_ok_pt10 = (TH1D*)getH(dir,"h_eta_me1_after_tf_ok_pt10"); + h_eta_me1_after_tf_ok_plus = (TH1D*)getH(dir,"h_eta_me1_after_tf_ok_plus"); + h_eta_me1_after_tf_ok_plus_pt10 = (TH1D*)getH(dir,"h_eta_me1_after_tf_ok_plus_pt10"); + + + + myRebin(h_eta_initial,etareb); + myRebin(h_eta_after_mpc,etareb); + myRebin(h_eta_after_mpc_st1,etareb); + myRebin(h_eta_after_mpc_st1_good,etareb); + myRebin(h_eta_after_mpc_ok,etareb); + myRebin(h_eta_after_mpc_ok_plus,etareb); + myRebin(h_eta_after_tftrack,etareb); + + myRebin(h_eta_after_tfcand,etareb); + myRebin(h_eta_after_tfcand_q1,etareb); + myRebin(h_eta_after_tfcand_q2,etareb); + myRebin(h_eta_after_tfcand_q3,etareb); + myRebin(h_eta_after_tfcand_ok,etareb); + myRebin(h_eta_after_tfcand_ok_plus,etareb); + myRebin(h_eta_after_tfcand_ok_pt10,etareb); + myRebin(h_eta_after_tfcand_ok_plus_pt10,etareb); + + myRebin(h_eta_after_tfcand_all,etareb); + myRebin(h_eta_after_tfcand_all_pt10,etareb); + + myRebin(h_eta_after_gmtreg ,etareb); + myRebin(h_eta_after_gmtreg_all,etareb); + myRebin(h_eta_after_gmtreg_dr ,etareb); + myRebin(h_eta_after_gmt ,etareb); + myRebin(h_eta_after_gmt_all ,etareb); + myRebin(h_eta_after_xtra ,etareb); + myRebin(h_eta_after_xtra_all ,etareb); + myRebin(h_eta_after_xtra_dr ,etareb); + + myRebin(h_eta_after_tfcand_pt10,etareb); + myRebin(h_eta_after_tfcand_my_st1,etareb); + myRebin(h_eta_after_tfcand_org_st1,etareb); + myRebin(h_eta_after_tfcand_comm_st1,etareb); + myRebin(h_eta_after_tfcand_my_st1_pt10,etareb); + myRebin(h_eta_after_gmtreg_pt10 ,etareb); + myRebin(h_eta_after_gmtreg_dr_pt10 ,etareb); + myRebin(h_eta_after_gmt_pt10 ,etareb); + myRebin(h_eta_after_xtra_dr_pt10 ,etareb); + + myRebin(h_eta_me1_after_alct,etareb); + myRebin(h_eta_me1_after_alct_okAlct,etareb); + myRebin(h_eta_me1_after_clct,etareb); + myRebin(h_eta_me1_after_clct_okClct,etareb); + myRebin(h_eta_me1_after_alctclct,etareb); + myRebin(h_eta_me1_after_alctclct_okAlct,etareb); + myRebin(h_eta_me1_after_alctclct_okClct,etareb); + myRebin(h_eta_me1_after_alctclct_okAlctClct,etareb); + + myRebin(h_eta_me1_after_lct ,etareb); + myRebin(h_eta_me1_after_lct_okAlct ,etareb); + myRebin(h_eta_me1_after_lct_okAlctClct ,etareb); + myRebin(h_eta_me1_after_lct_okClct ,etareb); + myRebin(h_eta_me1_after_lct_okClctAlct ,etareb); + myRebin(h_eta_me1_after_mplct_okAlctClct ,etareb); + myRebin(h_eta_me1_after_mplct_okAlctClct_plus ,etareb); + myRebin(h_eta_me1_after_tf_ok ,etareb); + myRebin(h_eta_me1_after_tf_ok_pt10 ,etareb); + myRebin(h_eta_me1_after_tf_ok_plus ,etareb); + myRebin(h_eta_me1_after_tf_ok_plus_pt10 ,etareb); + + h_eff_eta_after_mpc = (TH1D*) h_eta_after_mpc->Clone("h_eff_eta_after_mpc"); + h_eff_eta_after_mpc_st1 = (TH1D*) h_eta_after_mpc_st1->Clone("h_eff_eta_after_mpc_st1"); + h_eff_eta_after_mpc_st1_good = (TH1D*) h_eta_after_mpc_st1_good->Clone("h_eff_eta_after_mpc_st1_good"); + h_eff_eta_after_mpc_ok = (TH1D*) h_eta_after_mpc_ok->Clone("h_eff_eta_after_mpc_ok"); + h_eff_eta_after_mpc_ok_plus = (TH1D*) h_eta_after_mpc_ok_plus->Clone("h_eff_eta_after_mpc_ok_plus"); + h_eff_eta_after_tftrack = (TH1D*) h_eta_after_tftrack->Clone("h_eff_eta_after_tftrack"); + + h_eff_eta_after_tfcand = (TH1D*) h_eta_after_tfcand->Clone("h_eff_eta_after_tfcand"); + h_eff_eta_after_tfcand_q1 = (TH1D*) h_eta_after_tfcand_q1->Clone("h_eff_eta_after_tfcand_q1"); + h_eff_eta_after_tfcand_q2 = (TH1D*) h_eta_after_tfcand_q2->Clone("h_eff_eta_after_tfcand_q2"); + h_eff_eta_after_tfcand_q3 = (TH1D*) h_eta_after_tfcand_q3->Clone("h_eff_eta_after_tfcand_q3"); + h_eff_eta_after_tfcand_ok = (TH1D*) h_eta_after_tfcand_ok->Clone("h_eff_eta_after_tfcand_ok"); + h_eff_eta_after_tfcand_ok_plus = (TH1D*) h_eta_after_tfcand_ok_plus->Clone("h_eff_eta_after_tfcand_ok_plus"); + h_eff_eta_after_tfcand_ok_pt10 = (TH1D*) h_eta_after_tfcand_ok_pt10->Clone("h_eff_eta_after_tfcand_ok_pt10"); + h_eff_eta_after_tfcand_ok_plus_pt10 = (TH1D*) h_eta_after_tfcand_ok_plus_pt10->Clone("h_eff_eta_after_tfcand_ok_plus_pt10"); + + h_eff_eta_after_tfcand_all = (TH1D*) h_eta_after_tfcand_all->Clone("h_eff_eta_after_tfcand_all"); + h_eff_eta_after_tfcand_all_pt10 = (TH1D*) h_eta_after_tfcand_all_pt10->Clone("h_eff_eta_after_tfcand_all_pt10"); + + h_eff_eta_after_gmtreg = (TH1D*) h_eta_after_gmtreg->Clone("h_eff_eta_after_gmtreg"); + h_eff_eta_after_gmtreg_all = (TH1D*) h_eta_after_gmtreg_all->Clone("h_eff_eta_after_gmtreg_all"); + h_eff_eta_after_gmtreg_dr = (TH1D*) h_eta_after_gmtreg_dr->Clone("h_eff_eta_after_gmtreg_dr"); + h_eff_eta_after_gmt = (TH1D*) h_eta_after_gmt->Clone("h_eff_eta_after_gmt"); + h_eff_eta_after_gmt_all = (TH1D*) h_eta_after_gmt_all->Clone("h_eff_eta_after_gmt_all"); + h_eff_eta_after_xtra = (TH1D*) h_eta_after_xtra->Clone("h_eff_eta_after_xtra"); + h_eff_eta_after_xtra_all = (TH1D*) h_eta_after_xtra_all->Clone("h_eff_eta_after_xtra_all"); + h_eff_eta_after_xtra_dr = (TH1D*) h_eta_after_xtra_dr->Clone("h_eff_eta_after_xtra_dr"); + + h_eff_eta_after_tfcand_pt10 = (TH1D*) h_eta_after_tfcand_pt10->Clone("h_eff_eta_after_tfcand_pt10"); + h_eff_eta_after_tfcand_my_st1 = (TH1D*) h_eta_after_tfcand_my_st1->Clone("h_eff_eta_after_tfcand_my_st1"); + h_eff_eta_after_tfcand_org_st1 = (TH1D*) h_eta_after_tfcand_org_st1->Clone("h_eff_eta_after_tfcand_org_st1"); + h_eff_eta_after_tfcand_comm_st1 = (TH1D*) h_eta_after_tfcand_comm_st1->Clone("h_eff_eta_after_tfcand_comm_st1"); + h_eff_eta_after_tfcand_my_st1_pt10 = (TH1D*) h_eta_after_tfcand_my_st1_pt10->Clone("h_eff_eta_after_tfcand_my_st1_pt10"); + h_eff_eta_after_gmtreg_pt10 = (TH1D*) h_eta_after_gmtreg_pt10->Clone("h_eff_eta_after_gmtreg_pt10"); + h_eff_eta_after_gmtreg_dr_pt10 = (TH1D*) h_eta_after_gmtreg_dr_pt10->Clone("h_eff_eta_after_gmtreg_dr_pt10"); + h_eff_eta_after_gmt_pt10 = (TH1D*) h_eta_after_gmt_pt10->Clone("h_eff_eta_after_gmt_pt10"); + h_eff_eta_after_xtra_dr_pt10 = (TH1D*) h_eta_after_xtra_dr_pt10->Clone("h_eff_eta_after_xtra_dr_pt10"); + + h_eff_eta_me1_after_alct = (TH1D*) h_eta_me1_after_alct->Clone("h_eff_eta_me1_after_alct"); + h_eff_eta_me1_after_alct_okAlct = (TH1D*) h_eta_me1_after_alct_okAlct->Clone("h_eff_eta_me1_after_alct_okAlct"); + h_eff_eta_me1_after_clct = (TH1D*) h_eta_me1_after_clct->Clone("h_eff_eta_me1_after_clct"); + h_eff_eta_me1_after_clct_okClct = (TH1D*) h_eta_me1_after_clct_okClct->Clone("h_eff_eta_me1_after_clct_okClct"); + h_eff_eta_me1_after_alctclct = (TH1D*) h_eta_me1_after_alctclct->Clone("h_eff_eta_me1_after_alctclct"); + h_eff_eta_me1_after_alctclct_okAlct = (TH1D*) h_eta_me1_after_alctclct_okAlct->Clone("h_eff_eta_me1_after_alctclct_okAlct"); + h_eff_eta_me1_after_alctclct_okClct = (TH1D*) h_eta_me1_after_alctclct_okClct->Clone("h_eff_eta_me1_after_alctclct_okClct"); + h_eff_eta_me1_after_alctclct_okAlctClct = (TH1D*) h_eta_me1_after_alctclct_okAlctClct->Clone("h_eff_eta_me1_after_alctclct_okAlctClct"); + + h_eff_eta_me1_after_lct = (TH1D*) h_eta_me1_after_lct->Clone("h_eff_eta_me1_after_lct"); + h_eff_eta_me1_after_lct_okAlct = (TH1D*) h_eta_me1_after_lct_okAlct->Clone("h_eff_eta_me1_after_lct_okAlct"); + h_eff_eta_me1_after_lct_okAlctClct = (TH1D*) h_eta_me1_after_lct_okAlctClct->Clone("h_eff_eta_me1_after_lct_okAlctClct"); + h_eff_eta_me1_after_lct_okClct = (TH1D*) h_eta_me1_after_lct_okClct->Clone("h_eff_eta_me1_after_lct_okClct"); + h_eff_eta_me1_after_lct_okClctAlct = (TH1D*) h_eta_me1_after_lct_okClctAlct->Clone("h_eff_eta_me1_after_lct_okClctAlct"); + h_eff_eta_me1_after_mplct_okAlctClct = (TH1D*) h_eta_me1_after_mplct_okAlctClct->Clone("h_eff_eta_me1_after_mplct_okAlctClct"); + h_eff_eta_me1_after_mplct_okAlctClct_plus = (TH1D*) h_eta_me1_after_mplct_okAlctClct_plus->Clone("h_eff_eta_me1_after_mplct_okAlctClct_plus"); + h_eff_eta_me1_after_tf_ok = (TH1D*) h_eta_me1_after_tf_ok->Clone("h_eff_eta_me1_after_tf_ok"); + h_eff_eta_me1_after_tf_ok_pt10 = (TH1D*) h_eta_me1_after_tf_ok_pt10->Clone("h_eff_eta_me1_after_tf_ok_pt10"); + h_eff_eta_me1_after_tf_ok_plus = (TH1D*) h_eta_me1_after_tf_ok_plus->Clone("h_eff_eta_me1_after_tf_ok_plus"); + h_eff_eta_me1_after_tf_ok_plus_pt10 = (TH1D*) h_eta_me1_after_tf_ok_plus_pt10->Clone("h_eff_eta_me1_after_tf_ok_plus_pt10"); + + + h_eta_initial->Sumw2(); + h_eff_eta_after_mpc_st1->Sumw2(); + h_eff_eta_after_tfcand_my_st1->Sumw2(); + h_eff_eta_me1_after_alctclct_okAlctClct->Sumw2(); + h_eff_eta_me1_after_lct_okClctAlct->Sumw2(); + + h_eff_eta_after_mpc->Divide(h_eff_eta_after_mpc,h_eta_initial); + h_eff_eta_after_mpc_st1->Divide(h_eff_eta_after_mpc_st1,h_eta_initial,1,1,"B"); + h_eff_eta_after_mpc_st1_good->Divide(h_eff_eta_after_mpc_st1_good,h_eta_initial,1,1,"B"); + h_eff_eta_after_mpc_ok->Divide(h_eff_eta_after_mpc_ok,h_eta_initial); + h_eff_eta_after_mpc_ok_plus->Divide(h_eff_eta_after_mpc_ok_plus,h_eta_initial); + + h_eff_eta_after_tftrack->Divide(h_eff_eta_after_tftrack,h_eta_initial); + h_eff_eta_after_tfcand->Divide(h_eff_eta_after_tfcand,h_eta_initial); + h_eff_eta_after_tfcand_q1->Divide(h_eff_eta_after_tfcand_q1,h_eta_initial); + h_eff_eta_after_tfcand_q2->Divide(h_eff_eta_after_tfcand_q2,h_eta_initial); + h_eff_eta_after_tfcand_q3->Divide(h_eff_eta_after_tfcand_q3,h_eta_initial); + h_eff_eta_after_tfcand_ok->Divide(h_eff_eta_after_tfcand_ok,h_eta_initial); + h_eff_eta_after_tfcand_ok_plus->Divide(h_eff_eta_after_tfcand_ok_plus,h_eta_initial); + h_eff_eta_after_tfcand_ok_pt10->Divide(h_eff_eta_after_tfcand_ok_pt10,h_eta_initial); + h_eff_eta_after_tfcand_ok_plus_pt10->Divide(h_eff_eta_after_tfcand_ok_plus_pt10,h_eta_initial); + h_eff_eta_after_tfcand_all ->Divide(h_eff_eta_after_tfcand_all,h_eta_initial); + h_eff_eta_after_tfcand_all_pt10->Divide(h_eff_eta_after_tfcand_all_pt10,h_eta_initial); + + h_eff_eta_after_gmtreg ->Divide(h_eff_eta_after_gmtreg,h_eta_initial); + h_eff_eta_after_gmtreg_all->Divide(h_eff_eta_after_gmtreg_all,h_eta_initial); + h_eff_eta_after_gmtreg_dr ->Divide(h_eff_eta_after_gmtreg_dr,h_eta_initial); + h_eff_eta_after_gmt ->Divide(h_eff_eta_after_gmt,h_eta_initial); + h_eff_eta_after_gmt_all ->Divide(h_eff_eta_after_gmt_all,h_eta_initial); + h_eff_eta_after_xtra ->Divide(h_eff_eta_after_xtra,h_eta_initial); + h_eff_eta_after_xtra_all ->Divide(h_eff_eta_after_xtra_all,h_eta_initial); + h_eff_eta_after_xtra_dr ->Divide(h_eff_eta_after_xtra_dr,h_eta_initial); + + h_eff_eta_after_tfcand_pt10 ->Divide(h_eff_eta_after_tfcand_pt10,h_eta_initial,1,1,"B"); + h_eff_eta_after_tfcand_my_st1 ->Divide(h_eff_eta_after_tfcand_my_st1,h_eta_initial,1,1,"B"); + h_eff_eta_after_tfcand_org_st1 ->Divide(h_eff_eta_after_tfcand_org_st1,h_eta_initial,1,1,"B"); + h_eff_eta_after_tfcand_comm_st1 ->Divide(h_eff_eta_after_tfcand_comm_st1,h_eta_initial,1,1,"B"); + h_eff_eta_after_tfcand_my_st1_pt10 ->Divide(h_eff_eta_after_tfcand_my_st1_pt10,h_eta_initial,1,1,"B"); + h_eff_eta_after_gmtreg_pt10 ->Divide(h_eff_eta_after_gmtreg_pt10,h_eta_initial); + h_eff_eta_after_gmtreg_dr_pt10 ->Divide(h_eff_eta_after_gmtreg_dr_pt10,h_eta_initial); + h_eff_eta_after_gmt_pt10 ->Divide(h_eff_eta_after_gmt_pt10,h_eta_initial); + h_eff_eta_after_xtra_dr_pt10 ->Divide(h_eff_eta_after_xtra_dr_pt10,h_eta_initial); + + + h_eff_eta_me1_after_alct->Divide(h_eff_eta_me1_after_alct,h_eta_initial); + h_eff_eta_me1_after_alct_okAlct->Divide(h_eff_eta_me1_after_alct_okAlct,h_eta_initial); + h_eff_eta_me1_after_clct->Divide(h_eff_eta_me1_after_clct,h_eta_initial); + h_eff_eta_me1_after_clct_okClct->Divide(h_eff_eta_me1_after_clct_okClct,h_eta_initial); + h_eff_eta_me1_after_alctclct->Divide(h_eff_eta_me1_after_alctclct,h_eta_initial); + h_eff_eta_me1_after_alctclct_okAlct->Divide(h_eff_eta_me1_after_alctclct_okAlct,h_eta_initial); + h_eff_eta_me1_after_alctclct_okClct->Divide(h_eff_eta_me1_after_alctclct_okClct,h_eta_initial); + h_eff_eta_me1_after_alctclct_okAlctClct->Divide(h_eff_eta_me1_after_alctclct_okAlctClct,h_eta_initial); + + h_eff_eta_me1_after_lct ->Divide(h_eff_eta_me1_after_lct,h_eta_initial); + h_eff_eta_me1_after_lct_okAlct ->Divide(h_eff_eta_me1_after_lct_okAlct,h_eta_initial); + h_eff_eta_me1_after_lct_okAlctClct->Divide(h_eff_eta_me1_after_lct_okAlctClct,h_eta_initial); + h_eff_eta_me1_after_lct_okClct ->Divide(h_eff_eta_me1_after_lct_okClct,h_eta_initial); + h_eff_eta_me1_after_lct_okClctAlct->Divide(h_eff_eta_me1_after_lct_okClctAlct,h_eta_initial); + h_eff_eta_me1_after_mplct_okAlctClct->Divide(h_eff_eta_me1_after_mplct_okAlctClct,h_eta_initial); + h_eff_eta_me1_after_mplct_okAlctClct_plus->Divide(h_eff_eta_me1_after_mplct_okAlctClct_plus,h_eta_initial); + h_eff_eta_me1_after_tf_ok ->Divide(h_eff_eta_me1_after_tf_ok,h_eta_initial); + h_eff_eta_me1_after_tf_ok_pt10 ->Divide(h_eff_eta_me1_after_tf_ok_pt10,h_eta_initial); + h_eff_eta_me1_after_tf_ok_plus ->Divide(h_eff_eta_me1_after_tf_ok_plus,h_eta_initial); + h_eff_eta_me1_after_tf_ok_plus_pt10 ->Divide(h_eff_eta_me1_after_tf_ok_plus_pt10,h_eta_initial); + + + + //h_eff_eta_after_mpc->SetFillColor(7); + //h_eff_eta_after_tftrack->SetFillColor(8); + // + //h_eff_eta_after_tfcand ->SetFillColor(1); + //h_eff_eta_after_tfcand_q1->SetFillColor(2); + //h_eff_eta_after_tfcand_q2->SetFillColor(3); + //h_eff_eta_after_tfcand_q3->SetFillColor(4); + // + //h_eff_eta_after_tfcand_all ->SetFillColor(5); + + + TCanvas* c2 = new TCanvas("h_eff_eta","h_eff_eta",900,900 ) ; + c2->Divide(2,2); + c2->cd(1); + h_eff_eta_after_mpc->GetXaxis()->SetRangeUser(0.9,2.5); + h_eff_eta_after_mpc->Draw("hist"); + //h_eff_eta_after_mpc_ok->Draw("same hist"); + h_eff_eta_after_mpc_ok_plus->Draw("same hist"); + //h_eff_eta_after_tftrack->Draw("same hist"); + h_eff_eta_after_tfcand->Draw("same hist"); + //h_eff_eta_after_tfcand_ok->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus_pt10->Draw("same hist"); + + c2->cd(2); + h_eff_eta_after_tfcand->GetXaxis()->SetRangeUser(0.9,2.5); + h_eff_eta_after_tfcand ->Draw("hist"); + h_eff_eta_after_tfcand_q1->Draw("same hist"); + h_eff_eta_after_tfcand_q2->Draw("same hist"); + h_eff_eta_after_tfcand_q3->Draw("same hist"); + c2->cd(3); + h_eff_eta_after_tfcand_all ->GetXaxis()->SetRangeUser(0.9,2.5); + h_eff_eta_after_tfcand_all ->Draw("hist"); + h_eff_eta_after_tfcand->Draw("same hist"); + c2->cd(2); + Print(c2,"h_eff_eta" + ext); + + + h_eff_eta_after_mpc->SetLineColor(kBlack); + h_eff_eta_after_mpc_st1->SetLineColor(kBlack+2); + h_eff_eta_after_mpc_st1_good->SetLineColor(kBlack+4); + h_eff_eta_after_tftrack->SetLineColor(kViolet-2); + h_eff_eta_after_tfcand->SetLineColor(kBlue); + h_eff_eta_after_gmtreg->SetLineColor(kMagenta-2); + h_eff_eta_after_gmtreg_dr->SetLineColor(kOrange-3); + h_eff_eta_after_gmt->SetLineColor(kGreen+1); + h_eff_eta_after_xtra->SetLineColor(kPink-4); + h_eff_eta_after_xtra_dr->SetLineColor(kRed); + + h_eff_eta_after_tfcand_all ->SetLineColor(kBlue); + h_eff_eta_after_gmtreg_all->SetLineColor(kMagenta-2); + h_eff_eta_after_gmt_all->SetLineColor(kGreen+1); + h_eff_eta_after_xtra_all->SetLineColor(kPink-4); + + + h_eff_eta_after_tfcand_pt10 ->SetLineColor(kBlue); + h_eff_eta_after_tfcand_my_st1 ->SetLineColor(kBlue); + h_eff_eta_after_tfcand_org_st1 ->SetLineColor(kBlue); + h_eff_eta_after_tfcand_comm_st1 ->SetLineColor(kBlue); + h_eff_eta_after_tfcand_my_st1_pt10 ->SetLineColor(30); + h_eff_eta_after_gmtreg_pt10 ->SetLineColor(kMagenta-2); + h_eff_eta_after_gmtreg_dr_pt10 ->SetLineColor(kOrange-3); + h_eff_eta_after_gmt_pt10 ->SetLineColor(kGreen+1); + h_eff_eta_after_xtra_dr_pt10 ->SetLineColor(kRed); + + h_eff_eta_after_mpc_st1_good->SetLineStyle(7); + + h_eff_eta_after_tfcand_pt10 ->SetLineStyle(7); + h_eff_eta_after_tfcand_my_st1 ->SetLineStyle(7); + h_eff_eta_after_tfcand_org_st1 ->SetLineStyle(3); + h_eff_eta_after_tfcand_comm_st1->SetLineStyle(2); + h_eff_eta_after_tfcand_my_st1_pt10->SetLineStyle(7); + h_eff_eta_after_gmtreg_pt10 ->SetLineStyle(7); + h_eff_eta_after_gmtreg_dr_pt10 ->SetLineStyle(7); + h_eff_eta_after_gmt_pt10 ->SetLineStyle(7); + h_eff_eta_after_xtra_dr_pt10 ->SetLineStyle(7); + + h_eff_eta_after_mpc->SetTitle("L1 CSC trigger efficiency dependence on #eta"); + h_eff_eta_after_mpc->GetXaxis()->SetRangeUser(0.85,2.5); + h_eff_eta_after_mpc->GetXaxis()->SetTitle("#eta"); + h_eff_eta_after_mpc->SetMinimum(0); + + + + /* + TCanvas* c22 = new TCanvas("h_eff_eta_steps","h_eff_eta_steps",1200,900 ) ; + c22->Divide(1,2); + c22->cd(1); + h_eff_eta_after_mpc->Draw("hist"); + //h_eff_eta_after_tftrack->Draw("same"); + h_eff_eta_after_tfcand->Draw("same"); + //h_eff_eta_after_gmtreg->Draw("same"); + h_eff_eta_after_gmt->Draw("same"); + //h_eff_eta_after_xtra->Draw("same"); + h_eff_eta_after_xtra_dr->Draw("same"); + leg = new TLegend(0.7815507,0.1702982,0.9846086,0.5740635,NULL,"brNDC"); + //leg->SetTextFont(12); + leg->SetBorderSize(0); + leg->SetTextFont(12); + leg->SetLineColor(1); + leg->SetLineStyle(1); + leg->SetLineWidth(1); + leg->SetFillColor(19); + leg->SetFillStyle(0); + leg->AddEntry(h_eff_eta_after_mpc,"h_eff_eta_after_mpc","pl"); + //leg->AddEntry(h_eff_eta_after_tftrack,"h_eff_eta_after_tftrack","pl"); + leg->AddEntry(h_eff_eta_after_tfcand,"h_eff_eta_after_tfcand","pl"); + //leg->AddEntry(h_eff_eta_after_gmtreg,"h_eff_eta_after_gmtreg","pl"); + leg->AddEntry(h_eff_eta_after_gmt,"h_eff_eta_after_gmt","pl"); + //leg->AddEntry(h_eff_eta_after_xtra,"h_eff_eta_after_xtra","pl"); + leg->AddEntry(h_eff_eta_after_xtra_dr,"h_eff_eta_after_xtra_dr","pl"); + leg->Draw(); + c22->cd(2); + h_eff_eta_after_mpc->GetXaxis()->SetRangeUser(0.9,2.5); + h_eff_eta_after_mpc->Draw("hist"); + //h_eff_eta_after_tftrack->Draw("same"); + h_eff_eta_after_tfcand_all->Draw("same"); + //h_eff_eta_after_gmtreg_all->Draw("same"); + h_eff_eta_after_gmt_all->Draw("same"); + //h_eff_eta_after_xtra_all->Draw("same"); + h_eff_eta_after_xtra_dr->Draw("same"); + leg = new TLegend(0.7815507,0.1702982,0.9846086,0.5740635,NULL,"brNDC"); + //leg->SetTextFont(12); + leg->SetBorderSize(0); + leg->SetTextFont(12); + leg->SetLineColor(1); + leg->SetLineStyle(1); + leg->SetLineWidth(1); + leg->SetFillColor(19); + leg->SetFillStyle(0); + leg->AddEntry(h_eff_eta_after_mpc,"h_eff_eta_after_mpc","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_all,"h_eff_eta_after_tfcand_all","pl"); + //leg->AddEntry(h_eff_eta_after_gmtreg_all,"h_eff_eta_after_gmtreg_all","pl"); + leg->AddEntry(h_eff_eta_after_gmt_all,"h_eff_eta_after_gmt_all","pl"); + //leg->AddEntry(h_eff_eta_after_xtra_all,"h_eff_eta_after_xtra_all","pl"); + leg->AddEntry(h_eff_eta_after_xtra_dr,"h_eff_eta_after_xtra_dr","pl"); + leg->Draw("hist"); + Print(c22,"h_eff_eta_step.eps"); + */ + + /* // commented on 10/21/09 + TCanvas* c22x = new TCanvas("h_eff_eta_steps_full","h_eff_eta_steps_full",1000,600 ) ; + + h_eff_eta_after_mpc->Draw("hist"); + ////h_eff_eta_after_tftrack->Draw("same"); + h_eff_eta_after_tfcand->Draw("same"); + h_eff_eta_after_gmtreg->Draw("same"); + //h_eff_eta_after_gmtreg_dr->Draw("same"); + h_eff_eta_after_gmt->Draw("same"); + ////h_eff_eta_after_xtra->Draw("same"); + //h_eff_eta_after_xtra_dr->Draw("same"); + + //h_eff_eta_after_tfcand_pt10 ->Draw("same"); + //h_eff_eta_after_gmtreg_pt10 ->Draw("same"); + ////h_eff_eta_after_gmtreg_dr_pt10 ->Draw("same"); + //h_eff_eta_after_gmt_pt10 ->Draw("same"); + //h_eff_eta_after_xtra_dr_pt10 ->Draw("same"); + + TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); + //leg->SetTextFont(12); + leg->SetBorderSize(0); + //leg->SetTextFont(12); + leg->SetFillStyle(0); + + leg->SetHeader("Efficiency after"); + leg->AddEntry(h_eff_eta_after_mpc,"match to MPC","pl"); + //leg->AddEntry(h_eff_eta_after_tftrack,"h_eff_eta_after_tftrack","pl"); + leg->AddEntry(h_eff_eta_after_tfcand,"match to MPC & TF track","pl"); + leg->AddEntry(h_eff_eta_after_gmtreg,"match to MPC & TF trk & CSC GMT trk","pl"); + //leg->AddEntry(h_eff_eta_after_gmtreg_dr,"#Delta R match to CSC GMT trk","pl"); + leg->AddEntry(h_eff_eta_after_gmt,"match to MPC & TF trk & GMT trk","pl"); + //leg->AddEntry(h_eff_eta_after_xtra,"h_eff_eta_after_xtra","pl"); + //leg->AddEntry(h_eff_eta_after_xtra_dr,"#Delta R match to GMT","pl"); + //leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); + + leg->Draw(); + Print(c22x,"h_eff_eta_steps_full.eps"); + Print(c22x,"h_eff_eta_steps_full" + ext); + */ + + if (h_eff_eta_steps_full10) { + + TCanvas* c22x10 = new TCanvas("h_eff_eta_steps_full10","h_eff_eta_steps_full10",1000,600 ) ; + + h_eff_eta_after_mpc->Draw("hist"); + h_eff_eta_after_tfcand_pt10 ->Draw("same hist"); + h_eff_eta_after_gmtreg_pt10 ->Draw("same hist"); + h_eff_eta_after_gmt_pt10 ->Draw("same hist"); + //h_eff_eta_after_xtra_dr_pt10 ->Draw("same hist"); + + TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + + leg->SetHeader("With additional TF cut p_{T}>10 Efficiency after"); + leg->AddEntry(h_eff_eta_after_mpc,"match to MPC","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_pt10,"match to MPC & TF track","pl"); + leg->AddEntry(h_eff_eta_after_gmtreg_pt10,"match to MPC & TF trk & CSC GMT trk","pl"); + leg->AddEntry(h_eff_eta_after_gmt_pt10,"match to MPC & TF trk & GMT trk","pl"); + //leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); + + leg->Draw(); + Print(c22x10,"h_eff_eta_steps_full10.eps"); + Print(c22x10,"h_eff_eta_steps_full10" + ext); + Print(c22x10,"h_eff_eta_steps_full10.pdf"); -h_eta_after_tfcand = (TH1D*)getH(dir,"h_eta_after_tfcand"); -h_eta_after_tfcand_q1 = (TH1D*)getH(dir,"h_eta_after_tfcand_q1"); -h_eta_after_tfcand_q2 = (TH1D*)getH(dir,"h_eta_after_tfcand_q2"); -h_eta_after_tfcand_q3 = (TH1D*)getH(dir,"h_eta_after_tfcand_q3"); -h_eta_after_tfcand_ok = (TH1D*)getH(dir,"h_eta_after_tfcand_ok"); -h_eta_after_tfcand_ok_plus = (TH1D*)getH(dir,"h_eta_after_tfcand_ok_plus"); -h_eta_after_tfcand_ok_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_ok_pt10"); -h_eta_after_tfcand_ok_plus_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_ok_plus_pt10"); - -h_eta_after_tfcand_all = (TH1D*)getH(dir,"h_eta_after_tfcand_all"); -h_eta_after_tfcand_all_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_all_pt10"); - -h_eta_after_gmtreg = (TH1D*)getH(dir,"h_eta_after_gmtreg"); -h_eta_after_gmtreg_all = (TH1D*)getH(dir,"h_eta_after_gmtreg_all"); -h_eta_after_gmtreg_dr = (TH1D*)getH(dir,"h_eta_after_gmtreg_dr"); -h_eta_after_gmt = (TH1D*)getH(dir,"h_eta_after_gmt"); -h_eta_after_gmt_all = (TH1D*)getH(dir,"h_eta_after_gmt_all"); -h_eta_after_xtra = (TH1D*)getH(dir,"h_eta_after_xtra"); -h_eta_after_xtra_all = (TH1D*)getH(dir,"h_eta_after_xtra_all"); -h_eta_after_xtra_dr = (TH1D*)getH(dir,"h_eta_after_xtra_dr"); - -h_eta_after_tfcand_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_pt10"); -h_eta_after_tfcand_my_st1 = (TH1D*)getH(dir,"h_eta_after_tfcand_my_st1"); -h_eta_after_tfcand_org_st1 = (TH1D*)getH(dir,"h_eta_after_tfcand_org_st1"); -h_eta_after_tfcand_comm_st1 = (TH1D*)getH(dir,"h_eta_after_tfcand_comm_st1"); -h_eta_after_tfcand_my_st1_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_my_st1_pt10"); -h_eta_after_gmtreg_dr_pt10 = (TH1D*)getH(dir,"h_eta_after_gmtreg_dr_pt10"); -h_eta_after_gmtreg_pt10= (TH1D*)getH(dir,"h_eta_after_gmtreg_pt10"); -h_eta_after_gmt_pt10 = (TH1D*)getH(dir,"h_eta_after_gmt_pt10"); -h_eta_after_xtra_dr_pt10 = (TH1D*)getH(dir,"h_eta_after_xtra_dr_pt10"); - -// = (TH1D*)getH(dir,""); - -h_eta_me1_after_alct = (TH1D*)getH(dir,"h_eta_me1_after_alct"); -h_eta_me1_after_alct_okAlct = (TH1D*)getH(dir,"h_eta_me1_after_alct_okAlct"); -h_eta_me1_after_clct = (TH1D*)getH(dir,"h_eta_me1_after_clct"); -h_eta_me1_after_clct_okClct = (TH1D*)getH(dir,"h_eta_me1_after_clct_okClct"); -h_eta_me1_after_alctclct = (TH1D*)getH(dir,"h_eta_me1_after_alctclct"); -h_eta_me1_after_alctclct_okAlct = (TH1D*)getH(dir,"h_eta_me1_after_alctclct_okAlct"); -h_eta_me1_after_alctclct_okClct = (TH1D*)getH(dir,"h_eta_me1_after_alctclct_okClct"); -h_eta_me1_after_alctclct_okAlctClct = (TH1D*)getH(dir,"h_eta_me1_after_alctclct_okAlctClct"); - -h_eta_me1_after_lct = (TH1D*)getH(dir,"h_eta_me1_after_lct"); -h_eta_me1_after_lct_okAlct = (TH1D*)getH(dir,"h_eta_me1_after_lct_okAlct"); -h_eta_me1_after_lct_okAlctClct = (TH1D*)getH(dir,"h_eta_me1_after_lct_okAlctClct"); -h_eta_me1_after_lct_okClct = (TH1D*)getH(dir,"h_eta_me1_after_lct_okClct"); -h_eta_me1_after_lct_okClctAlct = (TH1D*)getH(dir,"h_eta_me1_after_lct_okClctAlct"); -h_eta_me1_after_mplct_okAlctClct = (TH1D*)getH(dir,"h_eta_me1_after_mplct_okAlctClct"); -h_eta_me1_after_mplct_okAlctClct_plus = (TH1D*)getH(dir,"h_eta_me1_after_mplct_okAlctClct_plus"); -h_eta_me1_after_tf_ok = (TH1D*)getH(dir,"h_eta_me1_after_tf_ok"); -h_eta_me1_after_tf_ok_pt10 = (TH1D*)getH(dir,"h_eta_me1_after_tf_ok_pt10"); -h_eta_me1_after_tf_ok_plus = (TH1D*)getH(dir,"h_eta_me1_after_tf_ok_plus"); -h_eta_me1_after_tf_ok_plus_pt10 = (TH1D*)getH(dir,"h_eta_me1_after_tf_ok_plus_pt10"); - - - -myRebin(h_eta_initial,etareb); -myRebin(h_eta_after_mpc,etareb); -myRebin(h_eta_after_mpc_st1,etareb); -myRebin(h_eta_after_mpc_st1_good,etareb); -myRebin(h_eta_after_mpc_ok,etareb); -myRebin(h_eta_after_mpc_ok_plus,etareb); -myRebin(h_eta_after_tftrack,etareb); - -myRebin(h_eta_after_tfcand,etareb); -myRebin(h_eta_after_tfcand_q1,etareb); -myRebin(h_eta_after_tfcand_q2,etareb); -myRebin(h_eta_after_tfcand_q3,etareb); -myRebin(h_eta_after_tfcand_ok,etareb); -myRebin(h_eta_after_tfcand_ok_plus,etareb); -myRebin(h_eta_after_tfcand_ok_pt10,etareb); -myRebin(h_eta_after_tfcand_ok_plus_pt10,etareb); - -myRebin(h_eta_after_tfcand_all,etareb); -myRebin(h_eta_after_tfcand_all_pt10,etareb); - -myRebin(h_eta_after_gmtreg ,etareb); -myRebin(h_eta_after_gmtreg_all,etareb); -myRebin(h_eta_after_gmtreg_dr ,etareb); -myRebin(h_eta_after_gmt ,etareb); -myRebin(h_eta_after_gmt_all ,etareb); -myRebin(h_eta_after_xtra ,etareb); -myRebin(h_eta_after_xtra_all ,etareb); -myRebin(h_eta_after_xtra_dr ,etareb); - -myRebin(h_eta_after_tfcand_pt10,etareb); -myRebin(h_eta_after_tfcand_my_st1,etareb); -myRebin(h_eta_after_tfcand_org_st1,etareb); -myRebin(h_eta_after_tfcand_comm_st1,etareb); -myRebin(h_eta_after_tfcand_my_st1_pt10,etareb); -myRebin(h_eta_after_gmtreg_pt10 ,etareb); -myRebin(h_eta_after_gmtreg_dr_pt10 ,etareb); -myRebin(h_eta_after_gmt_pt10 ,etareb); -myRebin(h_eta_after_xtra_dr_pt10 ,etareb); - -myRebin(h_eta_me1_after_alct,etareb); -myRebin(h_eta_me1_after_alct_okAlct,etareb); -myRebin(h_eta_me1_after_clct,etareb); -myRebin(h_eta_me1_after_clct_okClct,etareb); -myRebin(h_eta_me1_after_alctclct,etareb); -myRebin(h_eta_me1_after_alctclct_okAlct,etareb); -myRebin(h_eta_me1_after_alctclct_okClct,etareb); -myRebin(h_eta_me1_after_alctclct_okAlctClct,etareb); - -myRebin(h_eta_me1_after_lct ,etareb); -myRebin(h_eta_me1_after_lct_okAlct ,etareb); -myRebin(h_eta_me1_after_lct_okAlctClct ,etareb); -myRebin(h_eta_me1_after_lct_okClct ,etareb); -myRebin(h_eta_me1_after_lct_okClctAlct ,etareb); -myRebin(h_eta_me1_after_mplct_okAlctClct ,etareb); -myRebin(h_eta_me1_after_mplct_okAlctClct_plus ,etareb); -myRebin(h_eta_me1_after_tf_ok ,etareb); -myRebin(h_eta_me1_after_tf_ok_pt10 ,etareb); -myRebin(h_eta_me1_after_tf_ok_plus ,etareb); -myRebin(h_eta_me1_after_tf_ok_plus_pt10 ,etareb); - -h_eff_eta_after_mpc = (TH1D*) h_eta_after_mpc->Clone("h_eff_eta_after_mpc"); -h_eff_eta_after_mpc_st1 = (TH1D*) h_eta_after_mpc_st1->Clone("h_eff_eta_after_mpc_st1"); -h_eff_eta_after_mpc_st1_good = (TH1D*) h_eta_after_mpc_st1_good->Clone("h_eff_eta_after_mpc_st1_good"); -h_eff_eta_after_mpc_ok = (TH1D*) h_eta_after_mpc_ok->Clone("h_eff_eta_after_mpc_ok"); -h_eff_eta_after_mpc_ok_plus = (TH1D*) h_eta_after_mpc_ok_plus->Clone("h_eff_eta_after_mpc_ok_plus"); -h_eff_eta_after_tftrack = (TH1D*) h_eta_after_tftrack->Clone("h_eff_eta_after_tftrack"); - -h_eff_eta_after_tfcand = (TH1D*) h_eta_after_tfcand->Clone("h_eff_eta_after_tfcand"); -h_eff_eta_after_tfcand_q1 = (TH1D*) h_eta_after_tfcand_q1->Clone("h_eff_eta_after_tfcand_q1"); -h_eff_eta_after_tfcand_q2 = (TH1D*) h_eta_after_tfcand_q2->Clone("h_eff_eta_after_tfcand_q2"); -h_eff_eta_after_tfcand_q3 = (TH1D*) h_eta_after_tfcand_q3->Clone("h_eff_eta_after_tfcand_q3"); -h_eff_eta_after_tfcand_ok = (TH1D*) h_eta_after_tfcand_ok->Clone("h_eff_eta_after_tfcand_ok"); -h_eff_eta_after_tfcand_ok_plus = (TH1D*) h_eta_after_tfcand_ok_plus->Clone("h_eff_eta_after_tfcand_ok_plus"); -h_eff_eta_after_tfcand_ok_pt10 = (TH1D*) h_eta_after_tfcand_ok_pt10->Clone("h_eff_eta_after_tfcand_ok_pt10"); -h_eff_eta_after_tfcand_ok_plus_pt10 = (TH1D*) h_eta_after_tfcand_ok_plus_pt10->Clone("h_eff_eta_after_tfcand_ok_plus_pt10"); - -h_eff_eta_after_tfcand_all = (TH1D*) h_eta_after_tfcand_all->Clone("h_eff_eta_after_tfcand_all"); -h_eff_eta_after_tfcand_all_pt10 = (TH1D*) h_eta_after_tfcand_all_pt10->Clone("h_eff_eta_after_tfcand_all_pt10"); - -h_eff_eta_after_gmtreg = (TH1D*) h_eta_after_gmtreg->Clone("h_eff_eta_after_gmtreg"); -h_eff_eta_after_gmtreg_all = (TH1D*) h_eta_after_gmtreg_all->Clone("h_eff_eta_after_gmtreg_all"); -h_eff_eta_after_gmtreg_dr = (TH1D*) h_eta_after_gmtreg_dr->Clone("h_eff_eta_after_gmtreg_dr"); -h_eff_eta_after_gmt = (TH1D*) h_eta_after_gmt->Clone("h_eff_eta_after_gmt"); -h_eff_eta_after_gmt_all = (TH1D*) h_eta_after_gmt_all->Clone("h_eff_eta_after_gmt_all"); -h_eff_eta_after_xtra = (TH1D*) h_eta_after_xtra->Clone("h_eff_eta_after_xtra"); -h_eff_eta_after_xtra_all = (TH1D*) h_eta_after_xtra_all->Clone("h_eff_eta_after_xtra_all"); -h_eff_eta_after_xtra_dr = (TH1D*) h_eta_after_xtra_dr->Clone("h_eff_eta_after_xtra_dr"); - -h_eff_eta_after_tfcand_pt10 = (TH1D*) h_eta_after_tfcand_pt10->Clone("h_eff_eta_after_tfcand_pt10"); -h_eff_eta_after_tfcand_my_st1 = (TH1D*) h_eta_after_tfcand_my_st1->Clone("h_eff_eta_after_tfcand_my_st1"); -h_eff_eta_after_tfcand_org_st1 = (TH1D*) h_eta_after_tfcand_org_st1->Clone("h_eff_eta_after_tfcand_org_st1"); -h_eff_eta_after_tfcand_comm_st1 = (TH1D*) h_eta_after_tfcand_comm_st1->Clone("h_eff_eta_after_tfcand_comm_st1"); -h_eff_eta_after_tfcand_my_st1_pt10 = (TH1D*) h_eta_after_tfcand_my_st1_pt10->Clone("h_eff_eta_after_tfcand_my_st1_pt10"); -h_eff_eta_after_gmtreg_pt10 = (TH1D*) h_eta_after_gmtreg_pt10->Clone("h_eff_eta_after_gmtreg_pt10"); -h_eff_eta_after_gmtreg_dr_pt10 = (TH1D*) h_eta_after_gmtreg_dr_pt10->Clone("h_eff_eta_after_gmtreg_dr_pt10"); -h_eff_eta_after_gmt_pt10 = (TH1D*) h_eta_after_gmt_pt10->Clone("h_eff_eta_after_gmt_pt10"); -h_eff_eta_after_xtra_dr_pt10 = (TH1D*) h_eta_after_xtra_dr_pt10->Clone("h_eff_eta_after_xtra_dr_pt10"); - -h_eff_eta_me1_after_alct = (TH1D*) h_eta_me1_after_alct->Clone("h_eff_eta_me1_after_alct"); -h_eff_eta_me1_after_alct_okAlct = (TH1D*) h_eta_me1_after_alct_okAlct->Clone("h_eff_eta_me1_after_alct_okAlct"); -h_eff_eta_me1_after_clct = (TH1D*) h_eta_me1_after_clct->Clone("h_eff_eta_me1_after_clct"); -h_eff_eta_me1_after_clct_okClct = (TH1D*) h_eta_me1_after_clct_okClct->Clone("h_eff_eta_me1_after_clct_okClct"); -h_eff_eta_me1_after_alctclct = (TH1D*) h_eta_me1_after_alctclct->Clone("h_eff_eta_me1_after_alctclct"); -h_eff_eta_me1_after_alctclct_okAlct = (TH1D*) h_eta_me1_after_alctclct_okAlct->Clone("h_eff_eta_me1_after_alctclct_okAlct"); -h_eff_eta_me1_after_alctclct_okClct = (TH1D*) h_eta_me1_after_alctclct_okClct->Clone("h_eff_eta_me1_after_alctclct_okClct"); -h_eff_eta_me1_after_alctclct_okAlctClct = (TH1D*) h_eta_me1_after_alctclct_okAlctClct->Clone("h_eff_eta_me1_after_alctclct_okAlctClct"); - -h_eff_eta_me1_after_lct = (TH1D*) h_eta_me1_after_lct->Clone("h_eff_eta_me1_after_lct"); -h_eff_eta_me1_after_lct_okAlct = (TH1D*) h_eta_me1_after_lct_okAlct->Clone("h_eff_eta_me1_after_lct_okAlct"); -h_eff_eta_me1_after_lct_okAlctClct = (TH1D*) h_eta_me1_after_lct_okAlctClct->Clone("h_eff_eta_me1_after_lct_okAlctClct"); -h_eff_eta_me1_after_lct_okClct = (TH1D*) h_eta_me1_after_lct_okClct->Clone("h_eff_eta_me1_after_lct_okClct"); -h_eff_eta_me1_after_lct_okClctAlct = (TH1D*) h_eta_me1_after_lct_okClctAlct->Clone("h_eff_eta_me1_after_lct_okClctAlct"); -h_eff_eta_me1_after_mplct_okAlctClct = (TH1D*) h_eta_me1_after_mplct_okAlctClct->Clone("h_eff_eta_me1_after_mplct_okAlctClct"); -h_eff_eta_me1_after_mplct_okAlctClct_plus = (TH1D*) h_eta_me1_after_mplct_okAlctClct_plus->Clone("h_eff_eta_me1_after_mplct_okAlctClct_plus"); -h_eff_eta_me1_after_tf_ok = (TH1D*) h_eta_me1_after_tf_ok->Clone("h_eff_eta_me1_after_tf_ok"); -h_eff_eta_me1_after_tf_ok_pt10 = (TH1D*) h_eta_me1_after_tf_ok_pt10->Clone("h_eff_eta_me1_after_tf_ok_pt10"); -h_eff_eta_me1_after_tf_ok_plus = (TH1D*) h_eta_me1_after_tf_ok_plus->Clone("h_eff_eta_me1_after_tf_ok_plus"); -h_eff_eta_me1_after_tf_ok_plus_pt10 = (TH1D*) h_eta_me1_after_tf_ok_plus_pt10->Clone("h_eff_eta_me1_after_tf_ok_plus_pt10"); - - -h_eta_initial->Sumw2(); -h_eff_eta_after_mpc_st1->Sumw2(); -h_eff_eta_after_tfcand_my_st1->Sumw2(); -h_eff_eta_me1_after_alctclct_okAlctClct->Sumw2(); -h_eff_eta_me1_after_lct_okClctAlct->Sumw2(); - -h_eff_eta_after_mpc->Divide(h_eff_eta_after_mpc,h_eta_initial); -h_eff_eta_after_mpc_st1->Divide(h_eff_eta_after_mpc_st1,h_eta_initial,1,1,"B"); -h_eff_eta_after_mpc_st1_good->Divide(h_eff_eta_after_mpc_st1_good,h_eta_initial,1,1,"B"); -h_eff_eta_after_mpc_ok->Divide(h_eff_eta_after_mpc_ok,h_eta_initial); -h_eff_eta_after_mpc_ok_plus->Divide(h_eff_eta_after_mpc_ok_plus,h_eta_initial); - -h_eff_eta_after_tftrack->Divide(h_eff_eta_after_tftrack,h_eta_initial); -h_eff_eta_after_tfcand->Divide(h_eff_eta_after_tfcand,h_eta_initial); -h_eff_eta_after_tfcand_q1->Divide(h_eff_eta_after_tfcand_q1,h_eta_initial); -h_eff_eta_after_tfcand_q2->Divide(h_eff_eta_after_tfcand_q2,h_eta_initial); -h_eff_eta_after_tfcand_q3->Divide(h_eff_eta_after_tfcand_q3,h_eta_initial); -h_eff_eta_after_tfcand_ok->Divide(h_eff_eta_after_tfcand_ok,h_eta_initial); -h_eff_eta_after_tfcand_ok_plus->Divide(h_eff_eta_after_tfcand_ok_plus,h_eta_initial); -h_eff_eta_after_tfcand_ok_pt10->Divide(h_eff_eta_after_tfcand_ok_pt10,h_eta_initial); -h_eff_eta_after_tfcand_ok_plus_pt10->Divide(h_eff_eta_after_tfcand_ok_plus_pt10,h_eta_initial); -h_eff_eta_after_tfcand_all ->Divide(h_eff_eta_after_tfcand_all,h_eta_initial); -h_eff_eta_after_tfcand_all_pt10->Divide(h_eff_eta_after_tfcand_all_pt10,h_eta_initial); - -h_eff_eta_after_gmtreg ->Divide(h_eff_eta_after_gmtreg,h_eta_initial); -h_eff_eta_after_gmtreg_all->Divide(h_eff_eta_after_gmtreg_all,h_eta_initial); -h_eff_eta_after_gmtreg_dr ->Divide(h_eff_eta_after_gmtreg_dr,h_eta_initial); -h_eff_eta_after_gmt ->Divide(h_eff_eta_after_gmt,h_eta_initial); -h_eff_eta_after_gmt_all ->Divide(h_eff_eta_after_gmt_all,h_eta_initial); -h_eff_eta_after_xtra ->Divide(h_eff_eta_after_xtra,h_eta_initial); -h_eff_eta_after_xtra_all ->Divide(h_eff_eta_after_xtra_all,h_eta_initial); -h_eff_eta_after_xtra_dr ->Divide(h_eff_eta_after_xtra_dr,h_eta_initial); - -h_eff_eta_after_tfcand_pt10 ->Divide(h_eff_eta_after_tfcand_pt10,h_eta_initial,1,1,"B"); -h_eff_eta_after_tfcand_my_st1 ->Divide(h_eff_eta_after_tfcand_my_st1,h_eta_initial,1,1,"B"); -h_eff_eta_after_tfcand_org_st1 ->Divide(h_eff_eta_after_tfcand_org_st1,h_eta_initial,1,1,"B"); -h_eff_eta_after_tfcand_comm_st1 ->Divide(h_eff_eta_after_tfcand_comm_st1,h_eta_initial,1,1,"B"); -h_eff_eta_after_tfcand_my_st1_pt10 ->Divide(h_eff_eta_after_tfcand_my_st1_pt10,h_eta_initial,1,1,"B"); -h_eff_eta_after_gmtreg_pt10 ->Divide(h_eff_eta_after_gmtreg_pt10,h_eta_initial); -h_eff_eta_after_gmtreg_dr_pt10 ->Divide(h_eff_eta_after_gmtreg_dr_pt10,h_eta_initial); -h_eff_eta_after_gmt_pt10 ->Divide(h_eff_eta_after_gmt_pt10,h_eta_initial); -h_eff_eta_after_xtra_dr_pt10 ->Divide(h_eff_eta_after_xtra_dr_pt10,h_eta_initial); - - -h_eff_eta_me1_after_alct->Divide(h_eff_eta_me1_after_alct,h_eta_initial); -h_eff_eta_me1_after_alct_okAlct->Divide(h_eff_eta_me1_after_alct_okAlct,h_eta_initial); -h_eff_eta_me1_after_clct->Divide(h_eff_eta_me1_after_clct,h_eta_initial); -h_eff_eta_me1_after_clct_okClct->Divide(h_eff_eta_me1_after_clct_okClct,h_eta_initial); -h_eff_eta_me1_after_alctclct->Divide(h_eff_eta_me1_after_alctclct,h_eta_initial); -h_eff_eta_me1_after_alctclct_okAlct->Divide(h_eff_eta_me1_after_alctclct_okAlct,h_eta_initial); -h_eff_eta_me1_after_alctclct_okClct->Divide(h_eff_eta_me1_after_alctclct_okClct,h_eta_initial); -h_eff_eta_me1_after_alctclct_okAlctClct->Divide(h_eff_eta_me1_after_alctclct_okAlctClct,h_eta_initial); - -h_eff_eta_me1_after_lct ->Divide(h_eff_eta_me1_after_lct,h_eta_initial); -h_eff_eta_me1_after_lct_okAlct ->Divide(h_eff_eta_me1_after_lct_okAlct,h_eta_initial); -h_eff_eta_me1_after_lct_okAlctClct->Divide(h_eff_eta_me1_after_lct_okAlctClct,h_eta_initial); -h_eff_eta_me1_after_lct_okClct ->Divide(h_eff_eta_me1_after_lct_okClct,h_eta_initial); -h_eff_eta_me1_after_lct_okClctAlct->Divide(h_eff_eta_me1_after_lct_okClctAlct,h_eta_initial); -h_eff_eta_me1_after_mplct_okAlctClct->Divide(h_eff_eta_me1_after_mplct_okAlctClct,h_eta_initial); -h_eff_eta_me1_after_mplct_okAlctClct_plus->Divide(h_eff_eta_me1_after_mplct_okAlctClct_plus,h_eta_initial); -h_eff_eta_me1_after_tf_ok ->Divide(h_eff_eta_me1_after_tf_ok,h_eta_initial); -h_eff_eta_me1_after_tf_ok_pt10 ->Divide(h_eff_eta_me1_after_tf_ok_pt10,h_eta_initial); -h_eff_eta_me1_after_tf_ok_plus ->Divide(h_eff_eta_me1_after_tf_ok_plus,h_eta_initial); -h_eff_eta_me1_after_tf_ok_plus_pt10 ->Divide(h_eff_eta_me1_after_tf_ok_plus_pt10,h_eta_initial); - - - -//h_eff_eta_after_mpc->SetFillColor(7); -//h_eff_eta_after_tftrack->SetFillColor(8); -// -//h_eff_eta_after_tfcand ->SetFillColor(1); -//h_eff_eta_after_tfcand_q1->SetFillColor(2); -//h_eff_eta_after_tfcand_q2->SetFillColor(3); -//h_eff_eta_after_tfcand_q3->SetFillColor(4); -// -//h_eff_eta_after_tfcand_all ->SetFillColor(5); - - -TCanvas* c2 = new TCanvas("h_eff_eta","h_eff_eta",900,900 ) ; -c2->Divide(2,2); -c2->cd(1); -h_eff_eta_after_mpc->GetXaxis()->SetRangeUser(0.9,2.5); -h_eff_eta_after_mpc->Draw("hist"); -//h_eff_eta_after_mpc_ok->Draw("same hist"); -h_eff_eta_after_mpc_ok_plus->Draw("same hist"); -//h_eff_eta_after_tftrack->Draw("same hist"); -h_eff_eta_after_tfcand->Draw("same hist"); -//h_eff_eta_after_tfcand_ok->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus_pt10->Draw("same hist"); - -c2->cd(2); -h_eff_eta_after_tfcand->GetXaxis()->SetRangeUser(0.9,2.5); -h_eff_eta_after_tfcand ->Draw("hist"); -h_eff_eta_after_tfcand_q1->Draw("same hist"); -h_eff_eta_after_tfcand_q2->Draw("same hist"); -h_eff_eta_after_tfcand_q3->Draw("same hist"); -c2->cd(3); -h_eff_eta_after_tfcand_all ->GetXaxis()->SetRangeUser(0.9,2.5); -h_eff_eta_after_tfcand_all ->Draw("hist"); -h_eff_eta_after_tfcand->Draw("same hist"); -c2->cd(2); -Print(c2,"h_eff_eta.png"); - - -h_eff_eta_after_mpc->SetLineColor(kBlack); -h_eff_eta_after_mpc_st1->SetLineColor(kBlack+2); -h_eff_eta_after_mpc_st1_good->SetLineColor(kBlack+4); -h_eff_eta_after_tftrack->SetLineColor(kViolet-2); -h_eff_eta_after_tfcand->SetLineColor(kBlue); -h_eff_eta_after_gmtreg->SetLineColor(kMagenta-2); -h_eff_eta_after_gmtreg_dr->SetLineColor(kOrange-3); -h_eff_eta_after_gmt->SetLineColor(kGreen+1); -h_eff_eta_after_xtra->SetLineColor(kPink-4); -h_eff_eta_after_xtra_dr->SetLineColor(kRed); - -h_eff_eta_after_tfcand_all ->SetLineColor(kBlue); -h_eff_eta_after_gmtreg_all->SetLineColor(kMagenta-2); -h_eff_eta_after_gmt_all->SetLineColor(kGreen+1); -h_eff_eta_after_xtra_all->SetLineColor(kPink-4); - - -h_eff_eta_after_tfcand_pt10 ->SetLineColor(kBlue); -h_eff_eta_after_tfcand_my_st1 ->SetLineColor(kBlue); -h_eff_eta_after_tfcand_org_st1 ->SetLineColor(kBlue); -h_eff_eta_after_tfcand_comm_st1 ->SetLineColor(kBlue); -h_eff_eta_after_tfcand_my_st1_pt10 ->SetLineColor(30); -h_eff_eta_after_gmtreg_pt10 ->SetLineColor(kMagenta-2); -h_eff_eta_after_gmtreg_dr_pt10 ->SetLineColor(kOrange-3); -h_eff_eta_after_gmt_pt10 ->SetLineColor(kGreen+1); -h_eff_eta_after_xtra_dr_pt10 ->SetLineColor(kRed); - -h_eff_eta_after_mpc_st1_good->SetLineStyle(7); - -h_eff_eta_after_tfcand_pt10 ->SetLineStyle(7); -h_eff_eta_after_tfcand_my_st1 ->SetLineStyle(7); -h_eff_eta_after_tfcand_org_st1 ->SetLineStyle(3); -h_eff_eta_after_tfcand_comm_st1->SetLineStyle(2); -h_eff_eta_after_tfcand_my_st1_pt10->SetLineStyle(7); -h_eff_eta_after_gmtreg_pt10 ->SetLineStyle(7); -h_eff_eta_after_gmtreg_dr_pt10 ->SetLineStyle(7); -h_eff_eta_after_gmt_pt10 ->SetLineStyle(7); -h_eff_eta_after_xtra_dr_pt10 ->SetLineStyle(7); - -h_eff_eta_after_mpc->SetTitle("L1 CSC trigger efficiency dependence on #eta"); -h_eff_eta_after_mpc->GetXaxis()->SetRangeUser(0.85,2.5); -h_eff_eta_after_mpc->GetXaxis()->SetTitle("#eta"); -h_eff_eta_after_mpc->SetMinimum(0); - - - -/* -TCanvas* c22 = new TCanvas("h_eff_eta_steps","h_eff_eta_steps",1200,900 ) ; -c22->Divide(1,2); -c22->cd(1); -h_eff_eta_after_mpc->Draw("hist"); -//h_eff_eta_after_tftrack->Draw("same"); -h_eff_eta_after_tfcand->Draw("same"); -//h_eff_eta_after_gmtreg->Draw("same"); -h_eff_eta_after_gmt->Draw("same"); -//h_eff_eta_after_xtra->Draw("same"); -h_eff_eta_after_xtra_dr->Draw("same"); -leg = new TLegend(0.7815507,0.1702982,0.9846086,0.5740635,NULL,"brNDC"); -//leg->SetTextFont(12); -leg->SetBorderSize(0); -leg->SetTextFont(12); -leg->SetLineColor(1); -leg->SetLineStyle(1); -leg->SetLineWidth(1); -leg->SetFillColor(19); -leg->SetFillStyle(0); -leg->AddEntry(h_eff_eta_after_mpc,"h_eff_eta_after_mpc","pl"); -//leg->AddEntry(h_eff_eta_after_tftrack,"h_eff_eta_after_tftrack","pl"); -leg->AddEntry(h_eff_eta_after_tfcand,"h_eff_eta_after_tfcand","pl"); -//leg->AddEntry(h_eff_eta_after_gmtreg,"h_eff_eta_after_gmtreg","pl"); -leg->AddEntry(h_eff_eta_after_gmt,"h_eff_eta_after_gmt","pl"); -//leg->AddEntry(h_eff_eta_after_xtra,"h_eff_eta_after_xtra","pl"); -leg->AddEntry(h_eff_eta_after_xtra_dr,"h_eff_eta_after_xtra_dr","pl"); -leg->Draw(); -c22->cd(2); -h_eff_eta_after_mpc->GetXaxis()->SetRangeUser(0.9,2.5); -h_eff_eta_after_mpc->Draw("hist"); -//h_eff_eta_after_tftrack->Draw("same"); -h_eff_eta_after_tfcand_all->Draw("same"); -//h_eff_eta_after_gmtreg_all->Draw("same"); -h_eff_eta_after_gmt_all->Draw("same"); -//h_eff_eta_after_xtra_all->Draw("same"); -h_eff_eta_after_xtra_dr->Draw("same"); -leg = new TLegend(0.7815507,0.1702982,0.9846086,0.5740635,NULL,"brNDC"); -//leg->SetTextFont(12); -leg->SetBorderSize(0); -leg->SetTextFont(12); -leg->SetLineColor(1); -leg->SetLineStyle(1); -leg->SetLineWidth(1); -leg->SetFillColor(19); -leg->SetFillStyle(0); -leg->AddEntry(h_eff_eta_after_mpc,"h_eff_eta_after_mpc","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_all,"h_eff_eta_after_tfcand_all","pl"); -//leg->AddEntry(h_eff_eta_after_gmtreg_all,"h_eff_eta_after_gmtreg_all","pl"); -leg->AddEntry(h_eff_eta_after_gmt_all,"h_eff_eta_after_gmt_all","pl"); -//leg->AddEntry(h_eff_eta_after_xtra_all,"h_eff_eta_after_xtra_all","pl"); -leg->AddEntry(h_eff_eta_after_xtra_dr,"h_eff_eta_after_xtra_dr","pl"); -leg->Draw("hist"); -Print(c22,"h_eff_eta_step.eps"); -*/ - -/* // commented on 10/21/09 -TCanvas* c22x = new TCanvas("h_eff_eta_steps_full","h_eff_eta_steps_full",1000,600 ) ; - -h_eff_eta_after_mpc->Draw("hist"); -////h_eff_eta_after_tftrack->Draw("same"); -h_eff_eta_after_tfcand->Draw("same"); -h_eff_eta_after_gmtreg->Draw("same"); -//h_eff_eta_after_gmtreg_dr->Draw("same"); -h_eff_eta_after_gmt->Draw("same"); -////h_eff_eta_after_xtra->Draw("same"); -//h_eff_eta_after_xtra_dr->Draw("same"); - -//h_eff_eta_after_tfcand_pt10 ->Draw("same"); -//h_eff_eta_after_gmtreg_pt10 ->Draw("same"); -////h_eff_eta_after_gmtreg_dr_pt10 ->Draw("same"); -//h_eff_eta_after_gmt_pt10 ->Draw("same"); -//h_eff_eta_after_xtra_dr_pt10 ->Draw("same"); - -TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); -//leg->SetTextFont(12); -leg->SetBorderSize(0); -//leg->SetTextFont(12); -leg->SetFillStyle(0); - -leg->SetHeader("Efficiency after"); -leg->AddEntry(h_eff_eta_after_mpc,"match to MPC","pl"); -//leg->AddEntry(h_eff_eta_after_tftrack,"h_eff_eta_after_tftrack","pl"); -leg->AddEntry(h_eff_eta_after_tfcand,"match to MPC & TF track","pl"); -leg->AddEntry(h_eff_eta_after_gmtreg,"match to MPC & TF trk & CSC GMT trk","pl"); -//leg->AddEntry(h_eff_eta_after_gmtreg_dr,"#Delta R match to CSC GMT trk","pl"); -leg->AddEntry(h_eff_eta_after_gmt,"match to MPC & TF trk & GMT trk","pl"); -//leg->AddEntry(h_eff_eta_after_xtra,"h_eff_eta_after_xtra","pl"); -//leg->AddEntry(h_eff_eta_after_xtra_dr,"#Delta R match to GMT","pl"); -//leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); - -leg->Draw(); -Print(c22x,"h_eff_eta_steps_full.eps"); -Print(c22x,"h_eff_eta_steps_full.png"); -*/ - -if (h_eff_eta_steps_full10) { - -TCanvas* c22x10 = new TCanvas("h_eff_eta_steps_full10","h_eff_eta_steps_full10",1000,600 ) ; - -h_eff_eta_after_mpc->Draw("hist"); -h_eff_eta_after_tfcand_pt10 ->Draw("same hist"); -h_eff_eta_after_gmtreg_pt10 ->Draw("same hist"); -h_eff_eta_after_gmt_pt10 ->Draw("same hist"); -//h_eff_eta_after_xtra_dr_pt10 ->Draw("same hist"); - -TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); - -leg->SetHeader("With additional TF cut p_{T}>10 Efficiency after"); -leg->AddEntry(h_eff_eta_after_mpc,"match to MPC","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_pt10,"match to MPC & TF track","pl"); -leg->AddEntry(h_eff_eta_after_gmtreg_pt10,"match to MPC & TF trk & CSC GMT trk","pl"); -leg->AddEntry(h_eff_eta_after_gmt_pt10,"match to MPC & TF trk & GMT trk","pl"); -//leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); - -leg->Draw(); -Print(c22x10,"h_eff_eta_steps_full10.eps"); -Print(c22x10,"h_eff_eta_steps_full10.png"); -Print(c22x10,"h_eff_eta_steps_full10.pdf"); + } -} + /* + + TCanvas* c22x10tf = new TCanvas("h_eff_eta_steps_full10tf","h_eff_eta_steps_full10tf",1000,600 ) ; + + h_eff_eta_after_tfcand_pt10 ->SetLineStyle(1); + + h_eff_eta_after_mpc->Draw("hist"); + h_eff_eta_after_mpc_st1->Draw("same hist"); + //h_eff_eta_after_mpc_st1_good->Draw("same hist"); + h_eff_eta_after_tfcand_org_st1 ->Draw("same hist"); + //h_eff_eta_after_tfcand_comm_st1 ->Draw("same hist"); + h_eff_eta_after_tfcand_pt10 ->Draw("same hist"); + h_eff_eta_after_tfcand_my_st1 ->Draw("same hist"); + h_eff_eta_after_tfcand_my_st1_pt10 ->Draw("same hist"); + //h_eff_eta_after_xtra_dr_pt10 ->Draw("same hist"); + + TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + + leg->SetHeader("Efficiency after"); + leg->AddEntry(h_eff_eta_after_mpc,"match to MPC","pl"); + leg->AddEntry(h_eff_eta_after_mpc_st1,"match to MPC (at least one in ME1)","pl"); + //leg->AddEntry(h_eff_eta_after_mpc_st1_good,"match to MPC (at least one good in ME1)","pl"); + leg->AddEntry(NUL,"match to MPC & TF track:",""); + leg->AddEntry(h_eff_eta_after_tfcand_pt10," (a) with additional TF cut p_{T}>10","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_org_st1," (b) at least 1 original TF stub in ME1","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_my_st1," (c) at least 1 matched TF stub in ME1","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_my_st1_pt10," (d) at least 1 matched TF stub in ME1 and TF p_{T}>10","pl"); + //leg->AddEntry(h_eff_eta_after_tfcand_comm_st1," at least 1 my=original stub in St1","pl"); + //leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); + + leg->Draw(); + Print(c22x10tf,"h_eff_eta_steps_full10_tf.eps"); + Print(c22x10tf,"h_eff_eta_steps_full10_tf" + ext); + + */ + + /* // commented on 10/21/09 + TCanvas* c22x10tfs = new TCanvas("h_eff_eta_steps_full10tfs","h_eff_eta_steps_full10tfs",1000,600 ) ; + + h_eff_eta_after_tfcand_pt10 ->SetLineStyle(1); + + h_eff_eta_after_mpc->Draw("hist"); + h_eff_eta_after_mpc_st1->Draw("same hist"); + //h_eff_eta_after_mpc_st1_good->Draw("same hist"); + //h_eff_eta_after_tfcand_org_st1 ->Draw("same hist"); + //h_eff_eta_after_tfcand_comm_st1 ->Draw("same hist"); + h_eff_eta_after_tfcand_pt10 ->Draw("same hist"); + h_eff_eta_after_tfcand_my_st1 ->Draw("same hist"); + //h_eff_eta_after_tfcand_my_st1_pt10 ->Draw("same hist"); + //h_eff_eta_after_xtra_dr_pt10 ->Draw("same hist"); + + TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + + leg->SetHeader("Efficiency after"); + leg->AddEntry(NUL,"match to MPC:",""); + leg->AddEntry(h_eff_eta_after_mpc," at least one","pl"); + leg->AddEntry(h_eff_eta_after_mpc_st1," at least one in ME1","pl"); + //leg->AddEntry(h_eff_eta_after_mpc_st1_good,"match to MPC (at least one good in ME1)","pl"); + leg->AddEntry(NUL,"match to MPC & TF track:",""); + leg->AddEntry(h_eff_eta_after_tfcand_pt10," with additional TF cut p_{T}>10","pl"); + //leg->AddEntry(h_eff_eta_after_tfcand_org_st1," (b) at least 1 original TF stub in ME1","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_my_st1," at least 1 matched TF stub in ME1","pl"); + //leg->AddEntry(h_eff_eta_after_tfcand_my_st1_pt10," (d) at least 1 matched TF stub in ME1 and TF p_{T}>10","pl"); + //leg->AddEntry(h_eff_eta_after_tfcand_comm_st1," at least 1 my=original stub in St1","pl"); + //leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); + + leg->Draw(); + Print(c22x10tfs,"h_eff_eta_steps_full10_tfs.eps"); + Print(c22x10tfs,"h_eff_eta_steps_full10_tfs" + ext); + Print(c22x10tfs,"h_eff_eta_steps_full10_tfs.pdf"); + */ + + + + if (do_h_eff_eta_steps_xchk1) { + + TCanvas* c222xx1 = new TCanvas("h_eff_eta_steps_xchk1","h_eff_eta_steps_xchk1",1000,600 ) ; + + h_eff_eta_after_gmtreg->SetTitle("CSC GMT efficiency dependence on #eta (cross-check)"); + h_eff_eta_after_gmtreg->GetXaxis()->SetRangeUser(0.9,2.5); + h_eff_eta_after_gmtreg->GetXaxis()->SetTitle("#eta"); + h_eff_eta_after_gmtreg->SetMinimum(0); + h_eff_eta_after_gmtreg->Draw("hist"); + h_eff_eta_after_gmtreg_dr->Draw("same hist"); + + //h_eff_eta_after_gmtreg_pt10 ->Draw("same hist"); + //h_eff_eta_after_gmtreg_dr_pt10 ->Draw("same hist"); + + TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + + leg->SetHeader("Efficiency after"); + leg->AddEntry(h_eff_eta_after_gmtreg,"match to MPC & TF trk & CSC GMT trk","pl"); + leg->AddEntry(h_eff_eta_after_gmtreg_dr,"#Delta R match to CSC GMT trk","pl"); + //leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); + + leg->Draw(); + Print(c222xx1,"h_eff_eta_steps_xchk1.eps"); + Print(c222xx1,"h_eff_eta_steps_xchk1" + ext); -/* - -TCanvas* c22x10tf = new TCanvas("h_eff_eta_steps_full10tf","h_eff_eta_steps_full10tf",1000,600 ) ; - -h_eff_eta_after_tfcand_pt10 ->SetLineStyle(1); - -h_eff_eta_after_mpc->Draw("hist"); -h_eff_eta_after_mpc_st1->Draw("same hist"); -//h_eff_eta_after_mpc_st1_good->Draw("same hist"); -h_eff_eta_after_tfcand_org_st1 ->Draw("same hist"); -//h_eff_eta_after_tfcand_comm_st1 ->Draw("same hist"); -h_eff_eta_after_tfcand_pt10 ->Draw("same hist"); -h_eff_eta_after_tfcand_my_st1 ->Draw("same hist"); -h_eff_eta_after_tfcand_my_st1_pt10 ->Draw("same hist"); -//h_eff_eta_after_xtra_dr_pt10 ->Draw("same hist"); - -TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); - -leg->SetHeader("Efficiency after"); -leg->AddEntry(h_eff_eta_after_mpc,"match to MPC","pl"); -leg->AddEntry(h_eff_eta_after_mpc_st1,"match to MPC (at least one in ME1)","pl"); -//leg->AddEntry(h_eff_eta_after_mpc_st1_good,"match to MPC (at least one good in ME1)","pl"); -leg->AddEntry(NUL,"match to MPC & TF track:",""); -leg->AddEntry(h_eff_eta_after_tfcand_pt10," (a) with additional TF cut p_{T}>10","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_org_st1," (b) at least 1 original TF stub in ME1","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_my_st1," (c) at least 1 matched TF stub in ME1","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_my_st1_pt10," (d) at least 1 matched TF stub in ME1 and TF p_{T}>10","pl"); -//leg->AddEntry(h_eff_eta_after_tfcand_comm_st1," at least 1 my=original stub in St1","pl"); -//leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); - -leg->Draw(); -Print(c22x10tf,"h_eff_eta_steps_full10_tf.eps"); -Print(c22x10tf,"h_eff_eta_steps_full10_tf.png"); - -*/ - -/* // commented on 10/21/09 -TCanvas* c22x10tfs = new TCanvas("h_eff_eta_steps_full10tfs","h_eff_eta_steps_full10tfs",1000,600 ) ; - -h_eff_eta_after_tfcand_pt10 ->SetLineStyle(1); - -h_eff_eta_after_mpc->Draw("hist"); -h_eff_eta_after_mpc_st1->Draw("same hist"); -//h_eff_eta_after_mpc_st1_good->Draw("same hist"); -//h_eff_eta_after_tfcand_org_st1 ->Draw("same hist"); -//h_eff_eta_after_tfcand_comm_st1 ->Draw("same hist"); -h_eff_eta_after_tfcand_pt10 ->Draw("same hist"); -h_eff_eta_after_tfcand_my_st1 ->Draw("same hist"); -//h_eff_eta_after_tfcand_my_st1_pt10 ->Draw("same hist"); -//h_eff_eta_after_xtra_dr_pt10 ->Draw("same hist"); - -TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); - -leg->SetHeader("Efficiency after"); -leg->AddEntry(NUL,"match to MPC:",""); -leg->AddEntry(h_eff_eta_after_mpc," at least one","pl"); -leg->AddEntry(h_eff_eta_after_mpc_st1," at least one in ME1","pl"); -//leg->AddEntry(h_eff_eta_after_mpc_st1_good,"match to MPC (at least one good in ME1)","pl"); -leg->AddEntry(NUL,"match to MPC & TF track:",""); -leg->AddEntry(h_eff_eta_after_tfcand_pt10," with additional TF cut p_{T}>10","pl"); -//leg->AddEntry(h_eff_eta_after_tfcand_org_st1," (b) at least 1 original TF stub in ME1","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_my_st1," at least 1 matched TF stub in ME1","pl"); -//leg->AddEntry(h_eff_eta_after_tfcand_my_st1_pt10," (d) at least 1 matched TF stub in ME1 and TF p_{T}>10","pl"); -//leg->AddEntry(h_eff_eta_after_tfcand_comm_st1," at least 1 my=original stub in St1","pl"); -//leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); - -leg->Draw(); -Print(c22x10tfs,"h_eff_eta_steps_full10_tfs.eps"); -Print(c22x10tfs,"h_eff_eta_steps_full10_tfs.png"); -Print(c22x10tfs,"h_eff_eta_steps_full10_tfs.pdf"); -*/ - - - -if (do_h_eff_eta_steps_xchk1) { - -TCanvas* c222xx1 = new TCanvas("h_eff_eta_steps_xchk1","h_eff_eta_steps_xchk1",1000,600 ) ; - -h_eff_eta_after_gmtreg->SetTitle("CSC GMT efficiency dependence on #eta (cross-check)"); -h_eff_eta_after_gmtreg->GetXaxis()->SetRangeUser(0.9,2.5); -h_eff_eta_after_gmtreg->GetXaxis()->SetTitle("#eta"); -h_eff_eta_after_gmtreg->SetMinimum(0); -h_eff_eta_after_gmtreg->Draw("hist"); -h_eff_eta_after_gmtreg_dr->Draw("same hist"); - -//h_eff_eta_after_gmtreg_pt10 ->Draw("same hist"); -//h_eff_eta_after_gmtreg_dr_pt10 ->Draw("same hist"); - -TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); - -leg->SetHeader("Efficiency after"); -leg->AddEntry(h_eff_eta_after_gmtreg,"match to MPC & TF trk & CSC GMT trk","pl"); -leg->AddEntry(h_eff_eta_after_gmtreg_dr,"#Delta R match to CSC GMT trk","pl"); -//leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); - -leg->Draw(); -Print(c222xx1,"h_eff_eta_steps_xchk1.eps"); -Print(c222xx1,"h_eff_eta_steps_xchk1.png"); + } -} + /* + TCanvas* c222xx2 = new TCanvas("h_eff_eta_steps_xchk2","h_eff_eta_steps_xchk2",1000,600 ) ; + + h_eff_eta_after_gmt->SetTitle("GMT efficiency dependence on #eta (cross-check)"); + h_eff_eta_after_gmt->GetXaxis()->SetRangeUser(0.9,2.5); + h_eff_eta_after_gmt->GetXaxis()->SetTitle("#eta"); + h_eff_eta_after_gmt->SetMinimum(0); + h_eff_eta_after_gmt->SetMaximum(1.05); + + h_eff_eta_after_gmt->Draw(); + h_eff_eta_after_xtra_dr->Draw("same hist"); -/* -TCanvas* c222xx2 = new TCanvas("h_eff_eta_steps_xchk2","h_eff_eta_steps_xchk2",1000,600 ) ; - -h_eff_eta_after_gmt->SetTitle("GMT efficiency dependence on #eta (cross-check)"); -h_eff_eta_after_gmt->GetXaxis()->SetRangeUser(0.9,2.5); -h_eff_eta_after_gmt->GetXaxis()->SetTitle("#eta"); -h_eff_eta_after_gmt->SetMinimum(0); -h_eff_eta_after_gmt->SetMaximum(1.05); - -h_eff_eta_after_gmt->Draw(); -h_eff_eta_after_xtra_dr->Draw("same hist"); + //h_eff_eta_after_gmt_pt10 ->Draw("same hist"); + //h_eff_eta_after_xtra_dr_pt10 ->Draw("same hist"); -//h_eff_eta_after_gmt_pt10 ->Draw("same hist"); -//h_eff_eta_after_xtra_dr_pt10 ->Draw("same hist"); + TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); + //leg->SetTextFont(12); + leg->SetBorderSize(0); + //leg->SetTextFont(12); + leg->SetFillStyle(0); + + leg->SetHeader("Efficiency after"); + leg->AddEntry(h_eff_eta_after_gmt,"match to MPC & TF trk & GMT trk","pl"); + leg->AddEntry(h_eff_eta_after_xtra_dr,"#Delta R match to GMT","pl"); + //leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); + + leg->Draw(); + Print(c222xx2,"h_eff_eta_steps_xchk2.eps"); + Print(c222xx2,"h_eff_eta_steps_xchk2" + ext); + return; + + */ + + + + h_eff_eta_me1_after_lct ->SetLineColor(kRed); + h_eff_eta_me1_after_lct_okAlct ->SetLineColor(kRed-6); + h_eff_eta_me1_after_lct_okAlctClct->SetLineColor(kMagenta-6); + h_eff_eta_me1_after_lct_okClct ->SetLineColor(kRed-6); + h_eff_eta_me1_after_lct_okClctAlct->SetLineColor(kMagenta-6); + h_eff_eta_me1_after_mplct_okAlctClct->SetLineColor(kBlack); + h_eff_eta_me1_after_mplct_okAlctClct_plus->SetLineColor(kBlack); + h_eff_eta_me1_after_tf_ok ->SetLineColor(kBlue); + h_eff_eta_me1_after_tf_ok_pt10 ->SetLineColor(kBlue+2); + h_eff_eta_me1_after_tf_ok_plus ->SetLineColor(kBlue); + h_eff_eta_me1_after_tf_ok_plus_pt10 ->SetLineColor(kBlue+2); + + h_eff_eta_after_tfcand_all_pt10->SetLineColor(kCyan+2); + + h_eff_eta_me1_after_lct->SetLineWidth(2); + h_eff_eta_me1_after_lct_okAlct->SetLineWidth(2); + h_eff_eta_me1_after_lct_okAlctClct->SetLineWidth(2); + h_eff_eta_me1_after_lct_okClct->SetLineWidth(2); + h_eff_eta_me1_after_lct_okClctAlct->SetLineWidth(2); + + //h_eff_eta_me1_after_lct->SetLineStyle(7); + h_eff_eta_me1_after_lct_okAlct->SetLineStyle(3); + h_eff_eta_me1_after_lct_okAlctClct->SetLineStyle(7); + h_eff_eta_me1_after_lct_okClct->SetLineStyle(3); + h_eff_eta_me1_after_lct_okClctAlct->SetLineStyle(7); + h_eff_eta_me1_after_mplct_okAlctClct_plus->SetLineStyle(7); + + h_eff_eta_me1_after_tf_ok_pt10->SetLineStyle(7); + h_eff_eta_me1_after_tf_ok_plus_pt10->SetLineStyle(7); + h_eff_eta_after_tfcand_all_pt10->SetLineStyle(3); + + h_eff_eta_me1_after_lct->SetTitle("efficiency dependence on #eta: ME1 studies"); + h_eff_eta_me1_after_lct->GetXaxis()->SetRangeUser(0.86,2.5); + h_eff_eta_me1_after_lct->GetXaxis()->SetTitle("#eta"); + h_eff_eta_me1_after_lct->SetMinimum(0); + h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(0.,1.05); + + + + TCanvas* cme1n1 = new TCanvas("h_eff_eta_me1_after_lct","h_eff_eta_me1_after_lct",1000,600 ) ; + + + h_eff_eta_me1_after_lct->Draw("hist"); + //h_eff_eta_me1_after_lct_okAlct->Draw("same hist"); + //h_eff_eta_me1_after_lct_okAlctClct->Draw("same hist"); + h_eff_eta_me1_after_lct_okClct->Draw("same hist"); + h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); + h_eff_eta_me1_after_mplct_okAlctClct->Draw("same hist"); + h_eff_eta_me1_after_mplct_okAlctClct_plus->Draw("same hist"); + h_eff_eta_me1_after_tf_ok ->Draw("same hist"); + h_eff_eta_me1_after_tf_ok_pt10 ->Draw("same hist"); + h_eff_eta_after_tfcand_all_pt10->Draw("same hist"); + + TLegend *leg = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + + leg->SetHeader("Efficiency for muon with p_{T}>10"); + //leg->AddEntry(NUL,"match to LCT:",""); + leg->AddEntry(h_eff_eta_me1_after_lct,"any LCT in ME1 chamber crossed by #mu","pl"); + //leg->AddEntry(h_eff_eta_me1_after_lct_okAlct," + track's ALCT","pl"); + //leg->AddEntry(h_eff_eta_me1_after_lct_okAlctClct," + track's CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_lct_okClct," + correct CLCT picked","pl"); + leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct," + correct ALCT mached to CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct," + pass MPC selection","pl"); + leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct," + has two MPC matched","pl"); + leg->AddEntry(h_eff_eta_me1_after_tf_ok," + stub used in any TF track","pl"); + leg->AddEntry(h_eff_eta_me1_after_tf_ok_pt10," + stub used in TF track with p_{T}>10 GeV","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_all_pt10,"there is TF track p_{T}>10 in #Delta R<0.3","pl"); + //leg->AddEntry(," ","pl"); + leg->Draw(); + Print(cme1n1,"h_eff_eta_me1_steps_all.eps"); + Print(cme1n1,"h_eff_eta_me1_steps_all" + ext); + Print(cme1n1,"h_eff_eta_me1_steps_all.pdf"); + + + + + TCanvas* cme1n2 = new TCanvas("h_eff_eta_me1_after_lct2","h_eff_eta_me1_after_lct2",800,600 ) ; + h_eff_eta_me1_after_mplct_okAlctClct->GetXaxis()->SetRangeUser(0.86,2.5); + h_eff_eta_me1_after_mplct_okAlctClct->GetXaxis()->SetTitle("#eta"); + h_eff_eta_me1_after_mplct_okAlctClct->SetMinimum(0); + h_eff_eta_me1_after_mplct_okAlctClct->GetYaxis()->SetRangeUser(0.,1.05); + h_eff_eta_me1_after_mplct_okAlctClct->SetTitle("Efficiency in ME1 for #mu with p_{T}>10"); + h_eff_eta_me1_after_mplct_okAlctClct->GetYaxis()->SetTitle("Eff."); + h_eff_eta_me1_after_mplct_okAlctClct->GetXaxis()->SetTitleSize(0.07); + h_eff_eta_me1_after_mplct_okAlctClct->GetXaxis()->SetTitleOffset(0.7); + h_eff_eta_me1_after_mplct_okAlctClct->GetYaxis()->SetLabelOffset(0.015); + gStyle->SetTitleW(1); + gStyle->SetTitleH(0.08); + gStyle->SetTitleStyle(0); + h_eff_eta_me1_after_mplct_okAlctClct->Draw("hist"); + h_eff_eta_me1_after_mplct_okAlctClct_plus->Draw("same hist"); + h_eff_eta_me1_after_tf_ok ->Draw("same hist"); + h_eff_eta_me1_after_tf_ok_pt10 ->Draw("same hist"); + + + TLegend *leg = new TLegend(0.34,0.16,0.87,0.39,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("SimMuon has matched"); + leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct,"MPC LCT stub in ME1","pl"); + leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct_plus," + one more MPC LCT stub in ME234 + ","pl"); + leg->AddEntry(h_eff_eta_me1_after_tf_ok," + this stub was used by a TF track","pl"); + leg->AddEntry(h_eff_eta_me1_after_tf_ok_pt10," + this TF track has p_{T}(TF)>10 GeV","pl"); + leg->Draw(); + Print(cme1n2,"h_eff_eta_me1_tf" + ext); + + + + TCanvas* cme1n2_plus = new TCanvas("h_eff_eta_me1_after_tfplus","h_eff_eta_me1_after_tfplus",800,600 ) ; + h_eff_eta_me1_after_mplct_okAlctClct_plus->GetXaxis()->SetRangeUser(0.86,2.5); + h_eff_eta_me1_after_mplct_okAlctClct_plus->GetXaxis()->SetTitle("#eta"); + h_eff_eta_me1_after_mplct_okAlctClct_plus->SetMinimum(0); + h_eff_eta_me1_after_mplct_okAlctClct_plus->GetYaxis()->SetRangeUser(0.,1.05); + h_eff_eta_me1_after_mplct_okAlctClct_plus->SetTitle("Efficiency in ME1 for #mu with p_{T}>10"); + h_eff_eta_me1_after_mplct_okAlctClct_plus->GetYaxis()->SetTitle("Eff."); + h_eff_eta_me1_after_mplct_okAlctClct_plus->GetXaxis()->SetTitleSize(0.07); + h_eff_eta_me1_after_mplct_okAlctClct_plus->GetXaxis()->SetTitleOffset(0.7); + h_eff_eta_me1_after_mplct_okAlctClct_plus->GetYaxis()->SetLabelOffset(0.015); + gStyle->SetTitleW(1); + gStyle->SetTitleH(0.08); + gStyle->SetTitleStyle(0); + h_eff_eta_me1_after_mplct_okAlctClct_plus->Draw("hist"); + h_eff_eta_me1_after_tf_ok_plus ->Draw("same hist"); + h_eff_eta_me1_after_tf_ok_plus_pt10 ->Draw("same hist"); + h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); + + leg = new TLegend(0.34,0.16,0.87,0.39,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("SimMuon has matched"); + leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct_plus,"MPC LCT stubs in ME1 and some other station","pl"); + leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus," + these stubs were used by a TF track","pl"); + leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus_pt10," + this TF track has p_{T}(TF)>10 GeV","pl"); + leg->Draw(); + Print(cme1n2_plus,"h_eff_eta_me1_tfplus" + ext); + + + + + + + + h_eff_eta_me1_after_alct->SetLineColor(kBlue+1); + h_eff_eta_me1_after_alct_okAlct->SetLineColor(kBlue+1); + h_eff_eta_me1_after_clct->SetLineColor(kGreen+1); + h_eff_eta_me1_after_clct_okClct->SetLineColor(kGreen+1); + h_eff_eta_me1_after_alctclct->SetLineColor(kYellow+2); + h_eff_eta_me1_after_alctclct_okAlct->SetLineColor(kMagenta+2); + h_eff_eta_me1_after_alctclct_okClct->SetLineColor(kMagenta+3); + h_eff_eta_me1_after_alctclct_okAlctClct->SetLineColor(kYellow+2); -TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); -//leg->SetTextFont(12); -leg->SetBorderSize(0); -//leg->SetTextFont(12); -leg->SetFillStyle(0); - -leg->SetHeader("Efficiency after"); -leg->AddEntry(h_eff_eta_after_gmt,"match to MPC & TF trk & GMT trk","pl"); -leg->AddEntry(h_eff_eta_after_xtra_dr,"#Delta R match to GMT","pl"); -//leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); - -leg->Draw(); -Print(c222xx2,"h_eff_eta_steps_xchk2.eps"); -Print(c222xx2,"h_eff_eta_steps_xchk2.png"); -return; - -*/ - - - -h_eff_eta_me1_after_lct ->SetLineColor(kRed); -h_eff_eta_me1_after_lct_okAlct ->SetLineColor(kRed-6); -h_eff_eta_me1_after_lct_okAlctClct->SetLineColor(kMagenta-6); -h_eff_eta_me1_after_lct_okClct ->SetLineColor(kRed-6); -h_eff_eta_me1_after_lct_okClctAlct->SetLineColor(kMagenta-6); -h_eff_eta_me1_after_mplct_okAlctClct->SetLineColor(kBlack); -h_eff_eta_me1_after_mplct_okAlctClct_plus->SetLineColor(kBlack); -h_eff_eta_me1_after_tf_ok ->SetLineColor(kBlue); -h_eff_eta_me1_after_tf_ok_pt10 ->SetLineColor(kBlue+2); -h_eff_eta_me1_after_tf_ok_plus ->SetLineColor(kBlue); -h_eff_eta_me1_after_tf_ok_plus_pt10 ->SetLineColor(kBlue+2); - -h_eff_eta_after_tfcand_all_pt10->SetLineColor(kCyan+2); - -h_eff_eta_me1_after_lct->SetLineWidth(2); -h_eff_eta_me1_after_lct_okAlct->SetLineWidth(2); -h_eff_eta_me1_after_lct_okAlctClct->SetLineWidth(2); -h_eff_eta_me1_after_lct_okClct->SetLineWidth(2); -h_eff_eta_me1_after_lct_okClctAlct->SetLineWidth(2); - -//h_eff_eta_me1_after_lct->SetLineStyle(7); -h_eff_eta_me1_after_lct_okAlct->SetLineStyle(3); -h_eff_eta_me1_after_lct_okAlctClct->SetLineStyle(7); -h_eff_eta_me1_after_lct_okClct->SetLineStyle(3); -h_eff_eta_me1_after_lct_okClctAlct->SetLineStyle(7); -h_eff_eta_me1_after_mplct_okAlctClct_plus->SetLineStyle(7); - -h_eff_eta_me1_after_tf_ok_pt10->SetLineStyle(7); -h_eff_eta_me1_after_tf_ok_plus_pt10->SetLineStyle(7); -h_eff_eta_after_tfcand_all_pt10->SetLineStyle(3); - -h_eff_eta_me1_after_lct->SetTitle("efficiency dependence on #eta: ME1 studies"); -h_eff_eta_me1_after_lct->GetXaxis()->SetRangeUser(0.86,2.5); -h_eff_eta_me1_after_lct->GetXaxis()->SetTitle("#eta"); -h_eff_eta_me1_after_lct->SetMinimum(0); -h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(0.,1.05); - - - -TCanvas* cme1n1 = new TCanvas("h_eff_eta_me1_after_lct","h_eff_eta_me1_after_lct",1000,600 ) ; - - -h_eff_eta_me1_after_lct->Draw("hist"); -//h_eff_eta_me1_after_lct_okAlct->Draw("same hist"); -//h_eff_eta_me1_after_lct_okAlctClct->Draw("same hist"); -h_eff_eta_me1_after_lct_okClct->Draw("same hist"); -h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); -h_eff_eta_me1_after_mplct_okAlctClct->Draw("same hist"); -h_eff_eta_me1_after_mplct_okAlctClct_plus->Draw("same hist"); -h_eff_eta_me1_after_tf_ok ->Draw("same hist"); -h_eff_eta_me1_after_tf_ok_pt10 ->Draw("same hist"); -h_eff_eta_after_tfcand_all_pt10->Draw("same hist"); - -TLegend *leg = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); - -leg->SetHeader("Efficiency for muon with p_{T}>10"); -//leg->AddEntry(NUL,"match to LCT:",""); -leg->AddEntry(h_eff_eta_me1_after_lct,"any LCT in ME1 chamber crossed by #mu","pl"); -//leg->AddEntry(h_eff_eta_me1_after_lct_okAlct," + track's ALCT","pl"); -//leg->AddEntry(h_eff_eta_me1_after_lct_okAlctClct," + track's CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_lct_okClct," + correct CLCT picked","pl"); -leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct," + correct ALCT mached to CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct," + pass MPC selection","pl"); -leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct," + has two MPC matched","pl"); -leg->AddEntry(h_eff_eta_me1_after_tf_ok," + stub used in any TF track","pl"); -leg->AddEntry(h_eff_eta_me1_after_tf_ok_pt10," + stub used in TF track with p_{T}>10 GeV","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_all_pt10,"there is TF track p_{T}>10 in #Delta R<0.3","pl"); -//leg->AddEntry(," ","pl"); -leg->Draw(); -Print(cme1n1,"h_eff_eta_me1_steps_all.eps"); -Print(cme1n1,"h_eff_eta_me1_steps_all.png"); -Print(cme1n1,"h_eff_eta_me1_steps_all.pdf"); - - - - -TCanvas* cme1n2 = new TCanvas("h_eff_eta_me1_after_lct2","h_eff_eta_me1_after_lct2",800,600 ) ; -h_eff_eta_me1_after_mplct_okAlctClct->GetXaxis()->SetRangeUser(0.86,2.5); -h_eff_eta_me1_after_mplct_okAlctClct->GetXaxis()->SetTitle("#eta"); -h_eff_eta_me1_after_mplct_okAlctClct->SetMinimum(0); -h_eff_eta_me1_after_mplct_okAlctClct->GetYaxis()->SetRangeUser(0.,1.05); -h_eff_eta_me1_after_mplct_okAlctClct->SetTitle("Efficiency in ME1 for #mu with p_{T}>10"); -h_eff_eta_me1_after_mplct_okAlctClct->GetYaxis()->SetTitle("Eff."); -h_eff_eta_me1_after_mplct_okAlctClct->GetXaxis()->SetTitleSize(0.07); -h_eff_eta_me1_after_mplct_okAlctClct->GetXaxis()->SetTitleOffset(0.7); -h_eff_eta_me1_after_mplct_okAlctClct->GetYaxis()->SetLabelOffset(0.015); -gStyle->SetTitleW(1); -gStyle->SetTitleH(0.08); -gStyle->SetTitleStyle(0); -h_eff_eta_me1_after_mplct_okAlctClct->Draw("hist"); -h_eff_eta_me1_after_mplct_okAlctClct_plus->Draw("same hist"); -h_eff_eta_me1_after_tf_ok ->Draw("same hist"); -h_eff_eta_me1_after_tf_ok_pt10 ->Draw("same hist"); - - -TLegend *leg = new TLegend(0.34,0.16,0.87,0.39,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("SimMuon has matched"); -leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct,"MPC LCT stub in ME1","pl"); -leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct_plus," + one more MPC LCT stub in ME234 + ","pl"); -leg->AddEntry(h_eff_eta_me1_after_tf_ok," + this stub was used by a TF track","pl"); -leg->AddEntry(h_eff_eta_me1_after_tf_ok_pt10," + this TF track has p_{T}(TF)>10 GeV","pl"); -leg->Draw(); -Print(cme1n2,"h_eff_eta_me1_tf.png"); - - - -TCanvas* cme1n2_plus = new TCanvas("h_eff_eta_me1_after_tfplus","h_eff_eta_me1_after_tfplus",800,600 ) ; -h_eff_eta_me1_after_mplct_okAlctClct_plus->GetXaxis()->SetRangeUser(0.86,2.5); -h_eff_eta_me1_after_mplct_okAlctClct_plus->GetXaxis()->SetTitle("#eta"); -h_eff_eta_me1_after_mplct_okAlctClct_plus->SetMinimum(0); -h_eff_eta_me1_after_mplct_okAlctClct_plus->GetYaxis()->SetRangeUser(0.,1.05); -h_eff_eta_me1_after_mplct_okAlctClct_plus->SetTitle("Efficiency in ME1 for #mu with p_{T}>10"); -h_eff_eta_me1_after_mplct_okAlctClct_plus->GetYaxis()->SetTitle("Eff."); -h_eff_eta_me1_after_mplct_okAlctClct_plus->GetXaxis()->SetTitleSize(0.07); -h_eff_eta_me1_after_mplct_okAlctClct_plus->GetXaxis()->SetTitleOffset(0.7); -h_eff_eta_me1_after_mplct_okAlctClct_plus->GetYaxis()->SetLabelOffset(0.015); -gStyle->SetTitleW(1); -gStyle->SetTitleH(0.08); -gStyle->SetTitleStyle(0); -h_eff_eta_me1_after_mplct_okAlctClct_plus->Draw("hist"); -h_eff_eta_me1_after_tf_ok_plus ->Draw("same hist"); -h_eff_eta_me1_after_tf_ok_plus_pt10 ->Draw("same hist"); -h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); - -leg = new TLegend(0.34,0.16,0.87,0.39,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("SimMuon has matched"); -leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct_plus,"MPC LCT stubs in ME1 and some other station","pl"); -leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus," + these stubs were used by a TF track","pl"); -leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus_pt10," + this TF track has p_{T}(TF)>10 GeV","pl"); -leg->Draw(); -Print(cme1n2_plus,"h_eff_eta_me1_tfplus.png"); - - - - - - - -h_eff_eta_me1_after_alct->SetLineColor(kBlue+1); -h_eff_eta_me1_after_alct_okAlct->SetLineColor(kBlue+1); -h_eff_eta_me1_after_clct->SetLineColor(kGreen+1); -h_eff_eta_me1_after_clct_okClct->SetLineColor(kGreen+1); -h_eff_eta_me1_after_alctclct->SetLineColor(kYellow+2); -h_eff_eta_me1_after_alctclct_okAlct->SetLineColor(kMagenta+2); -h_eff_eta_me1_after_alctclct_okClct->SetLineColor(kMagenta+3); -h_eff_eta_me1_after_alctclct_okAlctClct->SetLineColor(kYellow+2); + /* + h_eff_eta_me1_after_alct + h_eff_eta_me1_after_alct_okAlct + h_eff_eta_me1_after_clct + h_eff_eta_me1_after_clct_okClct + h_eff_eta_me1_after_alctclct + h_eff_eta_me1_after_alctclct_okAlct + h_eff_eta_me1_after_alctclct_okClct + h_eff_eta_me1_after_alctclct_okAlctClct + */ -/* -h_eff_eta_me1_after_alct -h_eff_eta_me1_after_alct_okAlct -h_eff_eta_me1_after_clct -h_eff_eta_me1_after_clct_okClct -h_eff_eta_me1_after_alctclct -h_eff_eta_me1_after_alctclct_okAlct -h_eff_eta_me1_after_alctclct_okClct -h_eff_eta_me1_after_alctclct_okAlctClct -*/ + h_eff_eta_me1_after_alct->SetLineStyle(2); + h_eff_eta_me1_after_clct->SetLineStyle(2); + h_eff_eta_me1_after_alctclct->SetLineStyle(2); -h_eff_eta_me1_after_alct->SetLineStyle(2); -h_eff_eta_me1_after_clct->SetLineStyle(2); -h_eff_eta_me1_after_alctclct->SetLineStyle(2); + h_eff_eta_me1_after_alct->SetLineWidth(2); + h_eff_eta_me1_after_alct_okAlct->SetLineWidth(2); + h_eff_eta_me1_after_clct->SetLineWidth(2); + h_eff_eta_me1_after_clct_okClct->SetLineWidth(2); + h_eff_eta_me1_after_alctclct->SetLineWidth(2); + h_eff_eta_me1_after_alctclct_okAlct->SetLineWidth(2); + h_eff_eta_me1_after_alctclct_okClct->SetLineWidth(2); + h_eff_eta_me1_after_alctclct_okAlctClct->SetLineWidth(2); -h_eff_eta_me1_after_alct->SetLineWidth(2); -h_eff_eta_me1_after_alct_okAlct->SetLineWidth(2); -h_eff_eta_me1_after_clct->SetLineWidth(2); -h_eff_eta_me1_after_clct_okClct->SetLineWidth(2); -h_eff_eta_me1_after_alctclct->SetLineWidth(2); -h_eff_eta_me1_after_alctclct_okAlct->SetLineWidth(2); -h_eff_eta_me1_after_alctclct_okClct->SetLineWidth(2); -h_eff_eta_me1_after_alctclct_okAlctClct->SetLineWidth(2); + h_eff_eta_me1_after_lct->SetLineStyle(2); + h_eff_eta_me1_after_lct_okClctAlct->SetLineStyle(1); + h_eff_eta_me1_after_lct_okClctAlct->SetLineColor(kRed); -h_eff_eta_me1_after_lct->SetLineStyle(2); -h_eff_eta_me1_after_lct_okClctAlct->SetLineStyle(1); -h_eff_eta_me1_after_lct_okClctAlct->SetLineColor(kRed); @@ -1940,196 +1952,202 @@ h_eff_eta_me1_after_lct_okClctAlct->SetLineColor(kRed); + TCanvas* cme1na = new TCanvas("h_eff_eta_me1_after_alct","h_eff_eta_me1_after_alct",1000,600 ) ; -TCanvas* cme1na = new TCanvas("h_eff_eta_me1_after_alct","h_eff_eta_me1_after_alct",1000,600 ) ; + //h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(0.,1.05); + //h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(0.5,1.05); + //h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(0.8,1.02); + h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(yrange[0],yrange[1]); + h_eff_eta_me1_after_lct->Draw("hist"); + //h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); -//h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(0.,1.05); -//h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(0.5,1.05); -//h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(0.8,1.02); -h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(yrange[0],yrange[1]); -h_eff_eta_me1_after_lct->Draw("hist"); -//h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); + h_eff_eta_me1_after_alct->Draw("same hist"); + h_eff_eta_me1_after_alct_okAlct->Draw("same hist"); + h_eff_eta_me1_after_clct->Draw("same hist"); + h_eff_eta_me1_after_clct_okClct->Draw("same hist"); + h_eff_eta_me1_after_alctclct->Draw("same hist"); + //h_eff_eta_me1_after_alctclct_okAlct->Draw("same hist"); + //h_eff_eta_me1_after_alctclct_okClct->Draw("same hist"); + h_eff_eta_me1_after_alctclct_okAlctClct->Draw("same hist"); -h_eff_eta_me1_after_alct->Draw("same hist"); -h_eff_eta_me1_after_alct_okAlct->Draw("same hist"); -h_eff_eta_me1_after_clct->Draw("same hist"); -h_eff_eta_me1_after_clct_okClct->Draw("same hist"); -h_eff_eta_me1_after_alctclct->Draw("same hist"); -//h_eff_eta_me1_after_alctclct_okAlct->Draw("same hist"); -//h_eff_eta_me1_after_alctclct_okClct->Draw("same hist"); -h_eff_eta_me1_after_alctclct_okAlctClct->Draw("same hist"); + h_eff_eta_me1_after_lct->Draw("same hist"); + h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); -h_eff_eta_me1_after_lct->Draw("same hist"); -h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); + h_eff_eta_me1_after_lct_okClctAlct->Fit("pol0","R0","",1.63,2.38); + eff11 = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); + cout<Fit("pol0","R0","",1.63,2.05); + eff1b = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); + h_eff_eta_me1_after_lct_okClctAlct->Fit("pol0","R0","",2.05,2.38); + eff1a = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); -h_eff_eta_me1_after_lct_okClctAlct->Fit("pol0","R0","",1.63,2.38); -eff11 = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); -cout<Fit("pol0","R0","",1.63,2.05); -eff1b = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); -h_eff_eta_me1_after_lct_okClctAlct->Fit("pol0","R0","",2.05,2.38); -eff1a = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); + cout<SetBorderSize(0); + leg->SetFillStyle(0); -TLegend *leg = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); + leg->SetNColumns(2); + leg->SetHeader("Efficiency for #mu with p_{T}>10 crossing a ME1 chamber with"); -leg->SetNColumns(2); -leg->SetHeader("Efficiency for #mu with p_{T}>10 crossing a ME1 chamber with"); + leg->AddEntry(h_eff_eta_me1_after_alct,"any ALCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alct_okAlct,"correct ALCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_clct,"any CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_clct_okClct,"correct CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alct,"any ALCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alct_okAlct,"correct ALCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_clct,"any CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_clct_okClct,"correct CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alctclct,"any ALCT and CLCT","pl"); + //leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlct,"correct ALCT and any CLCT","pl"); + //leg->AddEntry(h_eff_eta_me1_after_alctclct_okClct,"any ALCT and correct CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlctClct,"correct ALCT and CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alctclct,"any ALCT and CLCT","pl"); -//leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlct,"correct ALCT and any CLCT","pl"); -//leg->AddEntry(h_eff_eta_me1_after_alctclct_okClct,"any ALCT and correct CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlctClct,"correct ALCT and CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_lct,"any LCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"correct LCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_lct,"any LCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"correct LCT","pl"); + leg->Draw(); + Print(cme1na,"h_eff_eta_me1_steps_stubs.eps"); + Print(cme1na,"h_eff_eta_me1_steps_stubs" + ext); + Print(cme1na,"h_eff_eta_me1_steps_stubs.pdf"); -leg->Draw(); -Print(cme1na,"h_eff_eta_me1_steps_stubs.eps"); -Print(cme1na,"h_eff_eta_me1_steps_stubs.png"); -Print(cme1na,"h_eff_eta_me1_steps_stubs.pdf"); + char ghn[111]; + sprintf(ghn,"h_eff_eta_me1_after_lct_okClctAlct_%s",dname); + gh = (TH1F*)h_eff_eta_me1_after_lct_okClctAlct->Clone(ghn); + gh->GetYaxis()->SetRangeUser(0.8,1.02); -char ghn[111]; -sprintf(ghn,"h_eff_eta_me1_after_lct_okClctAlct_%s",dname); -gh = (TH1F*)h_eff_eta_me1_after_lct_okClctAlct->Clone(ghn); -gh->GetYaxis()->SetRangeUser(0.8,1.02); + gh->SetTitle("LCT finding efficiency in ME1 for #mu with p_{T}>10"); + gh->GetXaxis()->SetRangeUser(0.8,2.5); + gh->GetYaxis()->SetRangeUser(0.,1.05); + gh->GetXaxis()->SetTitle("#eta"); + gh->GetYaxis()->SetTitle("Eff."); + gh->GetXaxis()->SetTitleSize(0.07); + gh->GetXaxis()->SetTitleOffset(0.7); + gh->GetYaxis()->SetLabelOffset(0.015); -gh->SetTitle("LCT finding efficiency in ME1 for #mu with p_{T}>10"); -gh->GetXaxis()->SetRangeUser(0.8,2.5); -gh->GetYaxis()->SetRangeUser(0.,1.05); -gh->GetXaxis()->SetTitle("#eta"); -gh->GetYaxis()->SetTitle("Eff."); -gh->GetXaxis()->SetTitleSize(0.07); -gh->GetXaxis()->SetTitleOffset(0.7); -gh->GetYaxis()->SetLabelOffset(0.015); + /* -/* + h_eff_eta_me1_after_clct->SetTitle("CLCT efficiency dependence on #eta: ME1 studies"); + h_eff_eta_me1_after_clct->GetXaxis()->SetRangeUser(0.86,2.5); + h_eff_eta_me1_after_clct->GetXaxis()->SetTitle("#eta"); + h_eff_eta_me1_after_clct->SetMinimum(0); + h_eff_eta_me1_after_clct->GetYaxis()->SetRangeUser(0.,1.05); -h_eff_eta_me1_after_clct->SetTitle("CLCT efficiency dependence on #eta: ME1 studies"); -h_eff_eta_me1_after_clct->GetXaxis()->SetRangeUser(0.86,2.5); -h_eff_eta_me1_after_clct->GetXaxis()->SetTitle("#eta"); -h_eff_eta_me1_after_clct->SetMinimum(0); -h_eff_eta_me1_after_clct->GetYaxis()->SetRangeUser(0.,1.05); + h_eff_eta_me1_after_clct_okClct->SetTitle("Correct CLCT efficiency dependence on #eta: ME1 studies"); + h_eff_eta_me1_after_clct_okClct->GetXaxis()->SetRangeUser(0.86,2.5); + h_eff_eta_me1_after_clct_okClct->GetXaxis()->SetTitle("#eta"); + h_eff_eta_me1_after_clct_okClct->SetMinimum(0); + h_eff_eta_me1_after_clct_okClct->GetYaxis()->SetRangeUser(0.,1.05); -h_eff_eta_me1_after_clct_okClct->SetTitle("Correct CLCT efficiency dependence on #eta: ME1 studies"); -h_eff_eta_me1_after_clct_okClct->GetXaxis()->SetRangeUser(0.86,2.5); -h_eff_eta_me1_after_clct_okClct->GetXaxis()->SetTitle("#eta"); -h_eff_eta_me1_after_clct_okClct->SetMinimum(0); -h_eff_eta_me1_after_clct_okClct->GetYaxis()->SetRangeUser(0.,1.05); + TCanvas* cme1nc = new TCanvas("h_eff_eta_me1_after_clct","h_eff_eta_me1_after_clct",1000,600 ) ; -TCanvas* cme1nc = new TCanvas("h_eff_eta_me1_after_clct","h_eff_eta_me1_after_clct",1000,600 ) ; + h_eff_eta_me1_after_clct_okClct->GetYaxis()->SetRangeUser(0.5,1.02); -h_eff_eta_me1_after_clct_okClct->GetYaxis()->SetRangeUser(0.5,1.02); + //h_eff_eta_me1_after_clct->Draw(); + //h_eff_eta_me1_after_clct_okClct->Draw("same hist"); + h_eff_eta_me1_after_clct_okClct->Draw(); -//h_eff_eta_me1_after_clct->Draw(); -//h_eff_eta_me1_after_clct_okClct->Draw("same hist"); -h_eff_eta_me1_after_clct_okClct->Draw(); + TLegend *leg = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); -TLegend *leg = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); + leg->SetNColumns(2); + leg->SetHeader("Efficiency for #mu with p_{T}>10 crossing a ME1 chamber with"); -leg->SetNColumns(2); -leg->SetHeader("Efficiency for #mu with p_{T}>10 crossing a ME1 chamber with"); + leg->AddEntry(h_eff_eta_me1_after_alct,"any ALCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alct_okAlct,"correct ALCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_clct,"any CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_clct_okClct,"correct CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alct,"any ALCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alct_okAlct,"correct ALCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_clct,"any CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_clct_okClct,"correct CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alctclct,"any ALCT and CLCT","pl"); + //leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlct,"correct ALCT and any CLCT","pl"); + //leg->AddEntry(h_eff_eta_me1_after_alctclct_okClct,"any ALCT and correct CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlctClct,"correct ALCT and CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alctclct,"any ALCT and CLCT","pl"); -//leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlct,"correct ALCT and any CLCT","pl"); -//leg->AddEntry(h_eff_eta_me1_after_alctclct_okClct,"any ALCT and correct CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlctClct,"correct ALCT and CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_lct,"any LCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"correct LCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_lct,"any LCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"correct LCT","pl"); + leg->Draw(); -leg->Draw(); + Print(cme1na,"h_eff_eta_me1_steps_stubs.eps"); + Print(cme1na,"h_eff_eta_me1_steps_stubs" + ext ); + Print(cme1na,"h_eff_eta_me1_steps_stubs.pdf"); + */ -Print(cme1na,"h_eff_eta_me1_steps_stubs.eps"); -Print(cme1na,"h_eff_eta_me1_steps_stubs.png"); -Print(cme1na,"h_eff_eta_me1_steps_stubs.pdf"); -*/ + //return; -//return; + if (do_h_eff_eta_me1_after_alct_okAlct) { -if (do_h_eff_eta_me1_after_alct_okAlct) { + h_eff_eta_me1_after_alct_okAlct->SetTitle("Correct ALCT efficiency dependence on #eta: ME1 studies"); + h_eff_eta_me1_after_alct_okAlct->GetXaxis()->SetRangeUser(0.86,2.5); + h_eff_eta_me1_after_alct_okAlct->GetXaxis()->SetTitle("#eta"); + h_eff_eta_me1_after_alct_okAlct->SetMinimum(0); + h_eff_eta_me1_after_alct_okAlct->GetYaxis()->SetRangeUser(0.,1.05); -h_eff_eta_me1_after_alct_okAlct->SetTitle("Correct ALCT efficiency dependence on #eta: ME1 studies"); -h_eff_eta_me1_after_alct_okAlct->GetXaxis()->SetRangeUser(0.86,2.5); -h_eff_eta_me1_after_alct_okAlct->GetXaxis()->SetTitle("#eta"); -h_eff_eta_me1_after_alct_okAlct->SetMinimum(0); -h_eff_eta_me1_after_alct_okAlct->GetYaxis()->SetRangeUser(0.,1.05); + TCanvas* cme1nc = new TCanvas("h_eff_eta_me1_after_alctt","h_eff_eta_me1_after_alctt",1000,600 ) ; -TCanvas* cme1nc = new TCanvas("h_eff_eta_me1_after_alctt","h_eff_eta_me1_after_alctt",1000,600 ) ; + h_eff_eta_me1_after_alct_okAlct->GetYaxis()->SetRangeUser(yrange[0],yrange[1]); -h_eff_eta_me1_after_alct_okAlct->GetYaxis()->SetRangeUser(yrange[0],yrange[1]); + //h_eff_eta_me1_after_alct->Draw(); + //h_eff_eta_me1_after_alct_okAlct->Draw("same hist"); + h_eff_eta_me1_after_alct_okAlct->Draw("hist"); -//h_eff_eta_me1_after_alct->Draw(); -//h_eff_eta_me1_after_alct_okAlct->Draw("same hist"); -h_eff_eta_me1_after_alct_okAlct->Draw("hist"); + } -} + return; -return; + /// EFFICIENCY dep. on WIREGROUP -/// EFFICIENCY dep. on WIREGROUP + h_wg_me11_initial = (TH1D*)getH(dir,"h_wg_me11_initial"); + h_wg_me11_after_alct_okAlct = (TH1D*)getH(dir,"h_wg_me11_after_alct_okAlct"); + h_wg_me11_after_alctclct_okAlctClct = (TH1D*)getH(dir,"h_wg_me11_after_alctclct_okAlctClct"); + h_wg_me11_after_lct_okAlctClct = (TH1D*)getH(dir,"h_wg_me11_after_lct_okAlctClct"); -h_wg_me11_initial = (TH1D*)getH(dir,"h_wg_me11_initial"); -h_wg_me11_after_alct_okAlct = (TH1D*)getH(dir,"h_wg_me11_after_alct_okAlct"); -h_wg_me11_after_alctclct_okAlctClct = (TH1D*)getH(dir,"h_wg_me11_after_alctclct_okAlctClct"); -h_wg_me11_after_lct_okAlctClct = (TH1D*)getH(dir,"h_wg_me11_after_lct_okAlctClct"); + h_eff_wg_me11_after_alct_okAlct = (TH1D*) h_wg_me11_after_alct_okAlct->Clone("h_eff_wg_me11_after_alct_okAlct"); + h_eff_wg_me11_after_alctclct_okAlctClct = (TH1D*) h_wg_me11_after_alctclct_okAlctClct->Clone("h_eff_wg_me11_after_alctclct_okAlctClct"); + h_eff_wg_me11_after_lct_okAlctClct = (TH1D*) h_wg_me11_after_lct_okAlctClct->Clone("h_eff_wg_me11_after_lct_okAlctClct"); -h_eff_wg_me11_after_alct_okAlct = (TH1D*) h_wg_me11_after_alct_okAlct->Clone("h_eff_wg_me11_after_alct_okAlct"); -h_eff_wg_me11_after_alctclct_okAlctClct = (TH1D*) h_wg_me11_after_alctclct_okAlctClct->Clone("h_eff_wg_me11_after_alctclct_okAlctClct"); -h_eff_wg_me11_after_lct_okAlctClct = (TH1D*) h_wg_me11_after_lct_okAlctClct->Clone("h_eff_wg_me11_after_lct_okAlctClct"); + h_eff_wg_me11_after_alct_okAlct->Divide(h_eff_wg_me11_after_alct_okAlct,h_wg_me11_initial); + h_eff_wg_me11_after_alctclct_okAlctClct->Divide(h_eff_wg_me11_after_alctclct_okAlctClct,h_wg_me11_initial); + h_eff_wg_me11_after_lct_okAlctClct->Divide(h_eff_wg_me11_after_lct_okAlctClct,h_wg_me11_initial); -h_eff_wg_me11_after_alct_okAlct->Divide(h_eff_wg_me11_after_alct_okAlct,h_wg_me11_initial); -h_eff_wg_me11_after_alctclct_okAlctClct->Divide(h_eff_wg_me11_after_alctclct_okAlctClct,h_wg_me11_initial); -h_eff_wg_me11_after_lct_okAlctClct->Divide(h_eff_wg_me11_after_lct_okAlctClct,h_wg_me11_initial); + h_eff_wg_me11_after_alct_okAlct->SetLineWidth(2); + h_eff_wg_me11_after_alctclct_okAlctClct->SetLineWidth(2); + h_eff_wg_me11_after_lct_okAlctClct->SetLineWidth(2); -h_eff_wg_me11_after_alct_okAlct->SetLineWidth(2); -h_eff_wg_me11_after_alctclct_okAlctClct->SetLineWidth(2); -h_eff_wg_me11_after_lct_okAlctClct->SetLineWidth(2); + h_eff_wg_me11_after_alct_okAlct->SetLineColor(kBlue+1); + h_eff_wg_me11_after_alctclct_okAlctClct->SetLineColor(kYellow+2); + h_eff_wg_me11_after_lct_okAlctClct->SetLineColor(kRed); -h_eff_wg_me11_after_alct_okAlct->SetLineColor(kBlue+1); -h_eff_wg_me11_after_alctclct_okAlctClct->SetLineColor(kYellow+2); -h_eff_wg_me11_after_lct_okAlctClct->SetLineColor(kRed); + h_eff_wg_me11_after_alct_okAlct->SetTitle("Correct ALCT efficiency dependence on WG in ME11"); + h_eff_wg_me11_after_alct_okAlct->SetTitle("wire group"); + h_eff_wg_me11_after_alct_okAlct->SetMinimum(0); + h_eff_wg_me11_after_alct_okAlct->GetYaxis()->SetRangeUser(0.,1.05); -h_eff_wg_me11_after_alct_okAlct->SetTitle("Correct ALCT efficiency dependence on WG in ME11"); -h_eff_wg_me11_after_alct_okAlct->SetTitle("wire group"); -h_eff_wg_me11_after_alct_okAlct->SetMinimum(0); -h_eff_wg_me11_after_alct_okAlct->GetYaxis()->SetRangeUser(0.,1.05); + TCanvas* cme11wgv= new TCanvas("h_eff_wg_me11_after_alct","h_eff_wg_me11_after_alct",1000,600 ) ; + h_eff_wg_me11_after_alct_okAlct->Draw("hist"); + h_eff_wg_me11_after_alctclct_okAlctClct->Draw("same hist"); + h_eff_wg_me11_after_lct_okAlctClct->Draw("same hist"); -TCanvas* cme11wgv= new TCanvas("h_eff_wg_me11_after_alct","h_eff_wg_me11_after_alct",1000,600 ) ; -h_eff_wg_me11_after_alct_okAlct->Draw("hist"); -h_eff_wg_me11_after_alctclct_okAlctClct->Draw("same hist"); -h_eff_wg_me11_after_lct_okAlctClct->Draw("same hist"); +} +void drawplot_etastep() +{ + gem_eff_draw(".png"); + gem_eff_draw(".pdf"); + gem_eff_draw(".eps"); } diff --git a/SimMuL1/scripts/drawplot_gmtrt.C b/SimMuL1/scripts/drawplot_gmtrt.C index 503b238839207..c354dc6e180c8 100644 --- a/SimMuL1/scripts/drawplot_gmtrt.C +++ b/SimMuL1/scripts/drawplot_gmtrt.C @@ -1,4 +1,3 @@ - //int kGray=920, kOrange=800, kSpring=820, kTeal=840, kAzure=860, kViolet=880, kPink=900; @@ -49,11 +48,13 @@ TH1D* result_gem_3s1b__pat2 = 0; TH1D* result_gem_2s1b__pat8 = 0; TH1D* result_gem_3s1b__pat8 = 0; +TH1D* hAll100 = 0; + int interactive = 1; bool do_not_print = false; -TString gem_dir = "gem/"; +TString gem_dir = "files/"; TString gem_label = "gem98"; int gNPU=100; @@ -71,300 +72,301 @@ const Double_t ptscaleb[31] = { }; const Double_t ptscaleb_[31] = { 1.25, 1.75, 2.25, 2.75, 3.25, 3.75, 4.25, 4.75, 5.5, 6.5, 7.5, 9., 11., 13., 15., - 17., 19., 22.5, 27.5, 32.5, 37.5, 42.5, 47.5, 55., 65., 75., 85., 95., 110., 130., 150. + 17., 19., 22.5, 27.5, 32.5, 37.5, 42.5, 47.5, 55., 65., 75., 85., 95., 110., 130., 150. }; void dpr(char *prc, int pu, char *suffix="") //void dpr(char *prc, char *g, int pu, int st, char *suffix="") { -gNPU=pu; -char nm[300], fnm[300],onm[300]; -char spu[20]; -sprintf(spu,"%03d",pu); -//sprintf(nm,"%s_2_2_6_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); -//sprintf(nm,"%s_3_6_2_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); -//sprintf(nm,"%s_3_6_2_mu_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); -sprintf(nm,"%s_6_0_1_POSTLS161_V12__pu%s_w3%s",prc,spu,suffix); -sprintf(fnm,"../hp_%s.root",nm); - -sprintf(onm,"rttf_%s",nm); -drawplot_tfrt(fnm,"StrictChamber",onm); + gNPU=pu; + char nm[300], fnm[300],onm[300]; + char spu[20]; + sprintf(spu,"%03d",pu); + //sprintf(nm,"%s_2_2_6_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); + //sprintf(nm,"%s_3_6_2_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); + //sprintf(nm,"%s_3_6_2_mu_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); + sprintf(nm,"%s_6_0_1_POSTLS161_V12__pu%s_w3%s",prc,spu,suffix); + sprintf(fnm,"../hp_%s.root",nm); + + sprintf(onm,"rttf_%s",nm); + drawplot_tfrt(fnm,"StrictChamber",onm); } TPaveStats* GetStat(TH1*h) { -TPaveStats* stat = (TPaveStats*)h->FindObject("stats"); -return stat; + TPaveStats* stat = (TPaveStats*)h->FindObject("stats"); + return stat; } TPaveStats* SetOptStat(TH1*h,int op) { -TPaveStats* stat = GetStat(h); -stat->SetOptStat(op); -return stat; + TPaveStats* stat = GetStat(h); + stat->SetOptStat(op); + return stat; } TObject* getH(char dir[100], char name[100]) { -char nm[222]; -sprintf(nm,"%s/%s;1",dir,name); -return f->Get(nm); + char nm[222]; + sprintf(nm,"%s/%s;1",dir,name); + return f->Get(nm); } TObject* getH(TFile *fi, char dir[100], char name[100]) { -char nm[222]; -sprintf(nm,"%s/%s;1",dir,name); -return fi->Get(nm); + char nm[222]; + sprintf(nm,"%s/%s;1",dir,name); + return fi->Get(nm); } void Print(TCanvas *c, char nm[200]) { -if (do_not_print) return; -if (strcmp(pdir,"")<=0) return; -gPad->RedrawAxis(); -char dirnm[200]; -sprintf(dirnm,"%s/%s",pdir,nm); -c->Print(dirnm); + if (do_not_print) return; + if (strcmp(pdir,"")<=0) return; + gPad->RedrawAxis(); + char dirnm[200]; + sprintf(dirnm,"%s/%s",pdir,nm); + c->Print(dirnm); } void myRebin(TH1D* h, int n) { -int nb = h->GetNbinsX(); -Double_t entr = h->GetEntries(); -Double_t bin0 = h->GetBinContent(0); -Double_t binN1 = h->GetBinContent(nb+1); -if (nb % n) binN1 += h->Integral(nb - nb%n + 1,nb); -h->Rebin(n); -nb = h->GetNbinsX(); -h->SetBinContent(0,bin0); -h->SetBinContent(nb+1,binN1); -h->SetEntries(entr); + int nb = h->GetNbinsX(); + Double_t entr = h->GetEntries(); + Double_t bin0 = h->GetBinContent(0); + Double_t binN1 = h->GetBinContent(nb+1); + if (nb % n) binN1 += h->Integral(nb - nb%n + 1,nb); + h->Rebin(n); + nb = h->GetNbinsX(); + h->SetBinContent(0,bin0); + h->SetBinContent(nb+1,binN1); + h->SetEntries(entr); } //########################################################################### TH1D* setHistoPt(char *f_name, char *name, char *cname, char *title, - int lcolor, int lstyle, int lwidth) - //double *x_range, double *y_range) + int lcolor, int lstyle, int lwidth) +//double *x_range, double *y_range) { -cout<<"opening "<GetXaxis()->GetNbins(); - -h = new TH1D(s_name+cname,title,30,ptscaleb); -for (int b=1 ; b<=nb; b++) { - double bc = h0->GetBinContent(b); - if (bc==0) continue; - int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); - //cout<SetBinContent(bin, bc); -} -//h->Sumw2(); -h->Scale(40000./gNEvt/3.*0.795); + cout<<"opening "<GetXaxis()->GetNbins(); + + h = new TH1D(s_name+cname,title,30,ptscaleb); + for (int b=1 ; b<=nb; b++) { + double bc = h0->GetBinContent(b); + if (bc==0) continue; + int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); + //cout<SetBinContent(bin, bc); + } + //h->Sumw2(); + h->Scale(40000./gNEvt/3.*0.795); -return h; + return h; } TH1D* setHistoPtRaw(char *f_name, char *name, char *cname, char *title, - int lcolor, int lstyle, int lwidth) - //double *x_range, double *y_range) + int lcolor, int lstyle, int lwidth) +//double *x_range, double *y_range) { -cout<<"opening "<GetXaxis()->GetNbins(); -h = (TH1D*)h0->Clone(s_name+cname); -//h->Sumw2(); -h->Scale(40000./gNEvt/3.*0.795); - -return h; + cout<<"opening "<GetXaxis()->GetNbins(); + h = (TH1D*)h0->Clone(s_name+cname); + //h->Sumw2(); + h->Scale(40000./gNEvt/3.*0.795); + + return h; } TH1D* setHisto2(char *f_name, char *name1, char *name2, char *cname, char *title, - int lcolor, int lstyle, int lwidth) - //double *x_range, double *y_range) + int lcolor, int lstyle, int lwidth) +//double *x_range, double *y_range) { -cout<<"opening "<Clone(s_name+cname); -h0->Add(h2); -int nb = h0->GetXaxis()->GetNbins(); - -h = new TH1D(s_name+cname,title,30,ptscaleb); -for (int b=1 ; b<=nb; b++) { - double bc = h0->GetBinContent(b); - if (bc==0) continue; - int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); - //cout<SetBinContent(bin, bc); -} -for (int b=1 ; b<=30; b++) - h->SetBinContent(b, h->Integral(b,31)); - -/* -h = (TH1D*)h0->Clone(s_name+cname); -for (int b=1 ; b<=nb; b++) - h->SetBinContent(b, h0->Integral(b,nb+1)); -*/ - -h->Sumw2(); -h->Scale(40000000./gNEvt/3.*0.795/10); - -h->SetLineColor(lcolor); -h->SetFillColor(lcolor); -h->SetLineStyle(lstyle); -h->SetLineWidth(lwidth); - -h->SetTitle(title); -//h->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); -//h->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); - -h->GetXaxis()->SetRangeUser(3,130); -h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); -//h->GetYaxis()->SetRangeUser(0.01,3000); - -h->GetXaxis()->SetMoreLogLabels(1); - -h->GetXaxis()->SetTitleSize(0.055); -h->GetXaxis()->SetTitleOffset(1.05); -h->GetXaxis()->SetLabelSize(0.045); -h->GetXaxis()->SetLabelOffset(0.003); -h->GetXaxis()->SetTitleFont(62); -h->GetXaxis()->SetLabelFont(62); - -h->GetYaxis()->SetTitleSize(0.055); -h->GetYaxis()->SetTitleOffset(0.9); -h->GetYaxis()->SetLabelSize(0.045); -h->GetYaxis()->SetTitleFont(62); -h->GetYaxis()->SetLabelFont(62); - -//h->GetYaxis()->SetLabelOffset(0.015); - -return h; + cout<<"opening "<Clone(s_name+cname); + h0->Add(h2); + int nb = h0->GetXaxis()->GetNbins(); + + h = new TH1D(s_name+cname,title,30,ptscaleb); + for (int b=1 ; b<=nb; b++) { + double bc = h0->GetBinContent(b); + if (bc==0) continue; + int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); + //cout<SetBinContent(bin, bc); + } + for (int b=1 ; b<=30; b++) + h->SetBinContent(b, h->Integral(b,31)); + + /* + h = (TH1D*)h0->Clone(s_name+cname); + for (int b=1 ; b<=nb; b++) + h->SetBinContent(b, h0->Integral(b,nb+1)); + */ + + h->Sumw2(); + h->Scale(40000000./gNEvt/3.*0.795/10); + + h->SetLineColor(lcolor); + h->SetFillColor(lcolor); + h->SetLineStyle(lstyle); + h->SetLineWidth(lwidth); + + h->SetTitle(title); + //h->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); + //h->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); + + h->GetXaxis()->SetRangeUser(3,130); + h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); + //h->GetYaxis()->SetRangeUser(0.01,3000); + + h->GetXaxis()->SetMoreLogLabels(1); + + h->GetXaxis()->SetTitleSize(0.055); + h->GetXaxis()->SetTitleOffset(1.05); + h->GetXaxis()->SetLabelSize(0.045); + h->GetXaxis()->SetLabelOffset(0.003); + h->GetXaxis()->SetTitleFont(62); + h->GetXaxis()->SetLabelFont(62); + + h->GetYaxis()->SetTitleSize(0.055); + h->GetYaxis()->SetTitleOffset(0.9); + h->GetYaxis()->SetLabelSize(0.045); + h->GetYaxis()->SetTitleFont(62); + h->GetYaxis()->SetLabelFont(62); + + //h->GetYaxis()->SetLabelOffset(0.015); + + return h; } TH1D* setHistoEta(TString f_name, char *name, char *cname, char *title, - int lcolor, int lstyle, int lwidth) - //double *x_range, double *y_range) + int lcolor, int lstyle, int lwidth) +//double *x_range, double *y_range) { -cout<<"opening "<GetXaxis()->GetNbins(); - -TH1D* h = (TH1D*)h0->Clone(s_name+cname); -h->SetTitle(title); - -h->Sumw2(); -h->Scale(40000./gNEvt/3.*0.795); - -h->SetLineColor(lcolor); -//h->SetFillColor(lcolor); -h->SetLineStyle(lstyle); -h->SetLineWidth(lwidth); - -h->SetTitle(title); - -//h->GetXaxis()->SetRangeUser(1.2, 2.4); -h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); - -h->GetXaxis()->SetTitleSize(0.055); -h->GetXaxis()->SetTitleOffset(1.05); -h->GetXaxis()->SetLabelSize(0.045); -h->GetXaxis()->SetLabelOffset(0.003); -h->GetXaxis()->SetTitleFont(62); -h->GetXaxis()->SetLabelFont(62); -h->GetXaxis()->SetMoreLogLabels(1); - -h->GetYaxis()->SetTitleSize(0.055); -h->GetYaxis()->SetTitleOffset(0.9); -h->GetYaxis()->SetLabelSize(0.045); -h->GetYaxis()->SetTitleFont(62); -h->GetYaxis()->SetLabelFont(62); - -//h->GetYaxis()->SetLabelOffset(0.015); - -gh = h; -return h; + cout<<"opening "<GetXaxis()->GetNbins(); + + TH1D* h = (TH1D*)h0->Clone(s_name+cname); + h->SetTitle(title); + + h->Sumw2(); + h->Scale(40000./gNEvt/3.*0.795); + + h->SetLineColor(lcolor); + //h->SetFillColor(lcolor); + h->SetLineStyle(lstyle); + h->SetLineWidth(lwidth); + + h->SetTitle(title); + + //h->GetXaxis()->SetRangeUser(1.2, 2.4); + h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); + + h->GetXaxis()->SetTitleSize(0.055); + h->GetXaxis()->SetTitleOffset(1.05); + h->GetXaxis()->SetLabelSize(0.045); + h->GetXaxis()->SetLabelOffset(0.003); + h->GetXaxis()->SetTitleFont(62); + h->GetXaxis()->SetLabelFont(62); + h->GetXaxis()->SetMoreLogLabels(1); + + h->GetYaxis()->SetTitleSize(0.055); + h->GetYaxis()->SetTitleOffset(0.9); + h->GetYaxis()->SetLabelSize(0.045); + h->GetYaxis()->SetTitleFont(62); + h->GetYaxis()->SetLabelFont(62); + + //h->GetYaxis()->SetLabelOffset(0.015); + + gh = h; + return h; } TH1D* getPTHisto(TString f_name, TString dir_name, TString h_name, TString clone_suffix = "_cln") { -f = TFile::Open(f_name); -//cout<Get(dir_name + "/" + h_name)->Clone(h_name + clone_suffix); -return h0; + f = TFile::Open(f_name); + //cout<Get(dir_name + "/" + h_name)->Clone(h_name + clone_suffix); + return h0; } TH1D* setPTHisto(TH1D* h0, TString title, int lcolor, int lstyle, int lwidth) { -int nb = h0->GetXaxis()->GetNbins(); - -h = new TH1D(Form("%s_varpt", h0->GetName()), title, 30, ptscaleb_); -for (int b=1 ; b<=nb; b++) { - double bc = h0->GetBinContent(b); - if (bc==0) continue; - int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); - //cout<GetBinCenter(b)<<" -> "<SetBinContent(bin, bc); -} -for (int b=1 ; b<=30; b++) - h->SetBinContent(b, h->Integral(b,31)); - -h->Sumw2(); -h->Scale(40000./gNEvt/3.*0.795); - -h->SetLineColor(lcolor); -h->SetFillColor(lcolor); -h->SetLineStyle(lstyle); -h->SetLineWidth(lwidth); - -h->SetTitle(title); - -h->GetXaxis()->SetRangeUser(2, 129.); -h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); - -h->GetXaxis()->SetTitleSize(0.055); -h->GetXaxis()->SetTitleOffset(1.05); -h->GetXaxis()->SetLabelSize(0.045); -h->GetXaxis()->SetLabelOffset(0.003); -h->GetXaxis()->SetTitleFont(62); -h->GetXaxis()->SetLabelFont(62); -h->GetXaxis()->SetMoreLogLabels(1); - -h->GetYaxis()->SetTitleSize(0.055); -h->GetYaxis()->SetTitleOffset(0.9); -h->GetYaxis()->SetLabelSize(0.045); -h->GetYaxis()->SetTitleFont(62); -h->GetYaxis()->SetLabelFont(62); - -return h; + int nb = h0->GetXaxis()->GetNbins(); + + h = new TH1D(Form("%s_varpt", h0->GetName()), title, 30, ptscaleb_); + for (int b=1 ; b<=nb; b++) { + double bc = h0->GetBinContent(b); + if (bc==0) continue; + int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); + //cout<GetBinCenter(b)<<" -> "<SetBinContent(bin, bc); + } + for (int b=1 ; b<=30; b++) + h->SetBinContent(b, h->Integral(b,31)); + + h->Sumw2(); + h->Scale(40000./gNEvt/3.*0.795); + + h->SetLineColor(lcolor); + h->SetFillColor(lcolor); + h->SetLineStyle(lstyle); + h->SetLineWidth(lwidth); + + h->SetTitle(title); + + h->GetXaxis()->SetRangeUser(2, 129.); + h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); + + h->GetXaxis()->SetTitleSize(0.055); + h->GetXaxis()->SetTitleOffset(1.05); + h->GetXaxis()->SetLabelSize(0.045); + h->GetXaxis()->SetLabelOffset(0.003); + h->GetXaxis()->SetTitleFont(62); + h->GetXaxis()->SetLabelFont(62); + h->GetXaxis()->SetMoreLogLabels(1); + + h->GetYaxis()->SetTitleSize(0.055); + h->GetYaxis()->SetTitleOffset(0.9); + h->GetYaxis()->SetLabelSize(0.045); + h->GetYaxis()->SetTitleFont(62); + h->GetYaxis()->SetLabelFont(62); + + return h; } TH1D* setPTHisto(TString f_name, TString dir_name, TString h_name, TString clone_suffix, TString title, int lcolor, int lstyle, int lwidth) { -TH1D* h0 = getPTHisto(f_name, dir_name, h_name, clone_suffix); -return setPTHisto(h0, title, lcolor, lstyle, lwidth); + TH1D* h0 = getPTHisto(f_name, dir_name, h_name, clone_suffix); + return setPTHisto(h0, title, lcolor, lstyle, lwidth); } @@ -373,113 +375,122 @@ return setPTHisto(h0, title, lcolor, lstyle, lwidth); TH1D* setHisto(TString f_name, char *name, char *cname, char *title, int lcolor, int lstyle, int lwidth) { -cout<<"opening "<GetXaxis()->GetNbins(); - -h = new TH1D(s_name+cname,title,30,ptscaleb_); -for (int b=1 ; b<=nb; b++) { - double bc = h0->GetBinContent(b); - if (bc==0) continue; - int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); - //cout<GetBinCenter(b)<<" -> "<SetBinContent(bin, bc); -} -for (int b=1 ; b<=30; b++) - h->SetBinContent(b, h->Integral(b,31)); - -/* -h = (TH1D*)h0->Clone(s_name+cname); -for (int b=1 ; b<=nb; b++) - h->SetBinContent(b, h0->Integral(b,nb+1)); -*/ - -h->Sumw2(); -h->Scale(40000./gNEvt/3.*0.795); - -h->SetLineColor(lcolor); -h->SetFillColor(lcolor); -h->SetLineStyle(lstyle); -h->SetLineWidth(lwidth); - -h->SetTitle(title); - -h->GetXaxis()->SetRangeUser(2, 129.); -h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); - -h->GetXaxis()->SetTitleSize(0.055); -h->GetXaxis()->SetTitleOffset(1.05); -h->GetXaxis()->SetLabelSize(0.045); -h->GetXaxis()->SetLabelOffset(0.003); -h->GetXaxis()->SetTitleFont(62); -h->GetXaxis()->SetLabelFont(62); -h->GetXaxis()->SetMoreLogLabels(1); - -h->GetYaxis()->SetTitleSize(0.055); -h->GetYaxis()->SetTitleOffset(0.9); -h->GetYaxis()->SetLabelSize(0.045); -h->GetYaxis()->SetTitleFont(62); -h->GetYaxis()->SetLabelFont(62); - -//h->GetYaxis()->SetLabelOffset(0.015); + cout<<"opening "<GetXaxis()->GetNbins(); + + h = new TH1D(s_name+cname,title,30,ptscaleb_); + for (int b=1 ; b<=nb; b++) { + double bc = h0->GetBinContent(b); + if (bc==0) continue; + int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); + //cout<GetBinCenter(b)<<" -> "<SetBinContent(bin, bc); + } + for (int b=1 ; b<=30; b++) + h->SetBinContent(b, h->Integral(b,31)); + + /* + h = (TH1D*)h0->Clone(s_name+cname); + for (int b=1 ; b<=nb; b++) + h->SetBinContent(b, h0->Integral(b,nb+1)); + */ + + h->Sumw2(); + h->Scale(40000./gNEvt/3.*0.795); + + h->SetLineColor(lcolor); + h->SetFillColor(lcolor); + h->SetLineStyle(lstyle); + h->SetLineWidth(lwidth); + + h->SetTitle(title); + + h->GetXaxis()->SetRangeUser(2, 129.); + h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); + + h->GetXaxis()->SetTitleSize(0.055); + h->GetXaxis()->SetTitleOffset(1.05); + h->GetXaxis()->SetLabelSize(0.045); + h->GetXaxis()->SetLabelOffset(0.003); + h->GetXaxis()->SetTitleFont(62); + h->GetXaxis()->SetLabelFont(62); + h->GetXaxis()->SetMoreLogLabels(1); + + h->GetYaxis()->SetTitleSize(0.055); + h->GetYaxis()->SetTitleOffset(0.9); + h->GetYaxis()->SetLabelSize(0.045); + h->GetYaxis()->SetTitleFont(62); + h->GetYaxis()->SetLabelFont(62); -return h; + //h->GetYaxis()->SetLabelOffset(0.015); + + return h; } -TH1D* setHistoRatio(TH1D* num, TH1D* denom, TString title = "", double ymin=0.4, double ymax=1.6) +TH1D* setHistoRatio(TH1D* num, TH1D* denom, TString title = "", double ymin=0.4, double ymax=1.6, int color = kRed+3) { -ratio = (TH1D*) num->Clone(Form("%s--%s_ratio",num->GetName(),denom->GetName()) ); -ratio->Divide(num, denom, 1., 1.); -ratio->SetTitle(title); -ratio->GetYaxis()->SetRangeUser(ymin, ymax); -ratio->GetYaxis()->SetTitle("ratio: (with GEM)/default"); -ratio->GetYaxis()->SetLabelSize(0.07); -ratio->GetYaxis()->SetTitleSize(0.07); -ratio->GetYaxis()->SetTitleOffset(0.6); -ratio->GetXaxis()->SetMoreLogLabels(1); -ratio->SetLineWidth(2); -ratio->SetFillColor(kRed+3); -ratio->SetLineColor(kRed+3); -ratio->SetMarkerColor(kRed+3); -ratio->SetMarkerStyle(20); -//ratio->Draw("e3"); - -return ratio; + ratio = (TH1D*) num->Clone(Form("%s--%s_ratio",num->GetName(),denom->GetName()) ); + ratio->Divide(num, denom, 1., 1.); + ratio->SetTitle(title); + + ratio->GetYaxis()->SetRangeUser(ymin, ymax); + ratio->GetYaxis()->SetTitle("ratio: (with GEM)/default"); + ratio->GetYaxis()->SetTitle("ratio"); + // ratio->GetYaxis()->SetTitle("(ME1/b + GEM) / ME1/b"); + ratio->GetYaxis()->SetTitleSize(.14); + // ratio->GetYaxis()->SetTitleSize(.1); + ratio->GetYaxis()->SetTitleOffset(0.4); + ratio->GetYaxis()->SetLabelSize(.11); + + + // ratio->GetXaxis()->SetMoreLogLabels(1); + ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); + ratio->GetXaxis()->SetLabelSize(.11); + ratio->GetXaxis()->SetTitleSize(.14); + ratio->GetXaxis()->SetTitleOffset(1.3); + ratio->SetLineWidth(2); + ratio->SetFillColor(color); + ratio->SetLineColor(color); + ratio->SetMarkerColor(color); + ratio->SetMarkerStyle(20); + //ratio->Draw("e3"); + + return ratio; } TH1D* setHistoRatio2(TH1D* num, TH1D* denom, TString title = "", double ymin=0.4, double ymax=1.6) { -ratio = (TH1D*) num->Clone(Form("%s--%s_ratio",num->GetName(),denom->GetName()) ); -ratio->Divide(num, denom, 1., 1.); -ratio->SetTitle(title); -ratio->GetYaxis()->SetRangeUser(ymin, ymax); -ratio->GetYaxis()->SetTitle("ratio: with ME1a stub/without"); -ratio->GetYaxis()->SetLabelSize(0.07); -ratio->GetYaxis()->SetTitleSize(0.07); -ratio->GetYaxis()->SetTitleOffset(0.6); -ratio->GetXaxis()->SetMoreLogLabels(1); -ratio->SetLineWidth(2); -ratio->SetFillColor(kRed+3); -ratio->SetLineColor(kRed+3); -ratio->SetMarkerColor(kRed+3); -ratio->SetMarkerStyle(20); -//ratio->Draw("e3"); - -return ratio; + ratio = (TH1D*) num->Clone(Form("%s--%s_ratio",num->GetName(),denom->GetName()) ); + ratio->Divide(num, denom, 1., 1.); + ratio->SetTitle(title); + ratio->GetYaxis()->SetRangeUser(ymin, ymax); + ratio->GetYaxis()->SetTitle("ratio: stub (ME1b&ME1a)/only ME1b"); + ratio->GetYaxis()->SetLabelSize(0.07); + ratio->GetYaxis()->SetTitleSize(0.07); + ratio->GetYaxis()->SetTitleOffset(0.6); + ratio->GetXaxis()->SetMoreLogLabels(1); + ratio->SetLineWidth(2); + ratio->SetFillColor(kRed+3); + ratio->SetLineColor(kRed+3); + ratio->SetMarkerColor(kRed+3); + ratio->SetMarkerStyle(20); + //ratio->Draw("e3"); + + return ratio; } TH1D* getEnrichRate() { -f = TFile::Open("meb1_genpt4_EnrichMu_st.root"); -TTree *tr = (TTree*) f->Get("SimTrackAna/trk"); -tr->Draw("pt>>pppt()"); - + f = TFile::Open("meb1_genpt4_EnrichMu_st.root"); + TTree *tr = (TTree*) f->Get("SimTrackAna/trk"); + tr->Draw("pt>>pppt()"); } @@ -487,437 +498,570 @@ tr->Draw("pt>>pppt()"); TH1D* getEffHisto(TString fname, TString hdir, TString num_name, TString den_name, int nrebin, int lcolor, int lstyle, int lwidth, TString title, double *x_range, double *y_range) { -TFile *fh = TFile::Open(fname); + TFile *fh = TFile::Open(fname); -TH1D* hd0 = (TH1D*)fh->Get(hdir + "/" + den_name); -TH1D* hn0 = (TH1D*)fh->Get(hdir + "/" + num_name); + TH1D* hd0 = (TH1D*)fh->Get(hdir + "/" + den_name); + TH1D* hn0 = (TH1D*)fh->Get(hdir + "/" + num_name); -TH1D* hd = (TH1D*)hd0->Clone(den_name+"_cln_"+fname); -TH1D* hn = (TH1D*)hn0->Clone(num_name+"_cln_"+fname); -hd->Sumw2(); -hn->Sumw2(); + TH1D* hd = (TH1D*)hd0->Clone(den_name+"_cln_"+fname); + TH1D* hn = (TH1D*)hn0->Clone(num_name+"_cln_"+fname); + hd->Sumw2(); + hn->Sumw2(); -myRebin(hd, nrebin); -myRebin(hn, nrebin); + myRebin(hd, nrebin); + myRebin(hn, nrebin); -TH1D* heff = (TH1D*)hn->Clone(num_name+"_eff_"+fname); + TH1D* heff = (TH1D*)hn->Clone(num_name+"_eff_"+fname); -hd->Sumw2(); -heff->Sumw2(); + hd->Sumw2(); + heff->Sumw2(); -heff->Divide(heff,hd); + heff->Divide(heff,hd); -heff->SetLineColor(lcolor); -heff->SetLineStyle(lstyle); -heff->SetLineWidth(lwidth); + heff->SetLineColor(lcolor); + heff->SetLineStyle(lstyle); + heff->SetLineWidth(lwidth); -heff->SetTitle(title); -//heff->GetXaxis()->SetTitle(xtitle); -//heff->GetYaxis()->SetTitle(ytitle); -heff->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); -heff->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); + heff->SetTitle(title); + //heff->GetXaxis()->SetTitle(xtitle); + //heff->GetYaxis()->SetTitle(ytitle); + heff->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); + heff->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); -heff->GetXaxis()->SetTitleSize(0.07); -heff->GetXaxis()->SetTitleOffset(0.7); -heff->GetYaxis()->SetLabelOffset(0.015); + heff->GetXaxis()->SetTitleSize(0.07); + heff->GetXaxis()->SetTitleOffset(0.7); + heff->GetYaxis()->SetLabelOffset(0.015); -heff->GetXaxis()->SetLabelSize(0.05); -heff->GetYaxis()->SetLabelSize(0.05); + heff->GetXaxis()->SetLabelSize(0.05); + heff->GetYaxis()->SetLabelSize(0.05); -h1 = hn0; -h2 = hd0; -he = heff; + h1 = hn0; + h2 = hd0; + he = heff; -//fh->Close(); -return heff; + //fh->Close(); + return heff; } -TLatex* drawPULabel(float x=0.17, float y=0.15, float font_size=0.) +TLatex* drawPULabel(float x=0.17, float y=0.25, float font_size=0.) { -TLatex * tex = new TLatex(x, y,"L=4*10^{34} (25ns PU100)"); -if (font_size > 0.) tex->SetFontSize(font_size); -tex->SetNDC(); -tex->Draw(); -return tex; + TLatex * tex = new TLatex(x, y,"BX = 25 ns, PU = 100"); + if (font_size > 0.) tex->SetFontSize(font_size); + tex->SetTextSize(0.04); + tex->SetNDC(); + tex->Draw(); + return tex; } void gem_rate_draw() { -do_not_print = false; + do_not_print = false; + + gStyle->SetOptStat(0); + gStyle->SetTitleStyle(0); + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); + + int ptreb=2; + + TString hdir = "SimMuL1StrictAll"; + + TString f_def = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; + TString f_g98_pt10 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt10_pat2.root"; + TString f_g98_pt15 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt15_pat2.root"; + TString f_g98_pt20 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt20_pat2.root"; + TString f_g98_pt30 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat2.root"; + TString f_g98_pt40 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat2.root"; + + sprintf(pdir,"%s", gem_dir.Data()); + + double rpt[2] = {0.,49.99}; + + TString htitle = "Efficiency for #mu in 1.6<|#eta|<2.12 to have TF track;p_{T}^{MC} [GeV/c]"; + + TString hini = "h_pt_initial_1b"; + TString h2s = "h_pt_after_tfcand_eta1b_2s"; + TString h3s = "h_pt_after_tfcand_eta1b_3s"; + TString h2s1b = "h_pt_after_tfcand_eta1b_2s1b"; + TString h3s1b = "h_pt_after_tfcand_eta1b_3s1b"; + + + //gdy[0]=0; gdy[1]=7.; + //if (vs_eta_minpt=="20") gdy[1]=10.; + float miny = 0.01, maxy; + + TString vs_eta_minpt = "20"; + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + + std::cout << "obtaining the input files" << std::endl; -gStyle->SetOptStat(0); -gStyle->SetTitleStyle(0); -//gStyle->SetPadTopMargin(0.08); -gStyle->SetTitleH(0.06); + TH1D* h_rt_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); + TH1D* h_rt_tf20_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); + TH1D* h_rt_tf20_gpt20_2s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); + + TH1D* h_rt_tf20_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); + TH1D* h_rt_tf20_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); + TH1D* h_rt_tf20_gpt20_3s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); + std::cout << "got them" << std::endl; + + // TH1D* h_rt_tf20_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kBlue, 1, 2); + // TH1D* h_rt_tf20_gpt20_3s1ab = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kRed, 7, 2); + + + + + // maxy = 300;// 45; + // h_rt_tf20_2s->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf20_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf20_gpt20_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + cAll100->SetLogy(1); + + // h_rt_tf20_2s->Draw("hist e1"); + // h_rt_tf20_gpt20_2s1b->Draw("hist e1 same"); + // h_rt_tf20_2s->Draw("hist e1 same"); + // h_rt_tf20_2s1b->Draw("hist e1 same"); -int ptreb=2; + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf20_2s,"Tracks: p_{T}>=20, 2+ stubs",""); + // leg->AddEntry(h_rt_tf20_2s,"anywhere","l"); + // leg->AddEntry(h_rt_tf20_2s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + // leg->AddEntry(h_rt_tf20_gpt20_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // leg->Draw(); -TString hdir = "SimMuL1StrictAll"; + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); -TString f_def = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; -TString f_g98_pt10 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt10_pat2.root"; -TString f_g98_pt15 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt15_pat2.root"; -TString f_g98_pt20 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt20_pat2.root"; -TString f_g98_pt30 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat2.root"; -TString f_g98_pt40 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat2.root"; -sprintf(pdir,"%s", gem_dir.Data()); + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); -double rpt[2] = {0.,49.99}; + // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_2s1b, h_rt_tf20_2s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); -TString htitle = "Efficiency for #mu in 1.6<|#eta|<2.12 to have TF track;p_{T}^{MC}"; + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b__ratio.png").Data()); -TString hini = "h_pt_initial_1b"; -TString h2s = "h_pt_after_tfcand_eta1b_2s"; -TString h3s = "h_pt_after_tfcand_eta1b_3s"; -TString h2s1b = "h_pt_after_tfcand_eta1b_2s1b"; -TString h3s1b = "h_pt_after_tfcand_eta1b_3s1b"; + // //======================== 3+ Stubs ================================// -//gdy[0]=0; gdy[1]=7.; -//if (vs_eta_minpt=="20") gdy[1]=10.; -float miny = 0.01, maxy; -TString vs_eta_minpt = "20"; -TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + maxy = 30.;//10; + h_rt_tf20_3s->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf20_gpt20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf20_gpt20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); - TH1D* h_rt_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); - TH1D* h_rt_tf20_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); - TH1D* h_rt_tf20_gpt20_2s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf20_3s->Draw("hist e1"); + // h_rt_tf20_gpt20_3s1b->Draw("hist e1 same"); + // h_rt_tf20_3s->Draw("hist e1 same"); + // h_rt_tf20_3s1b->Draw("hist e1 same"); - TH1D* h_rt_tf20_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); - TH1D* h_rt_tf20_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); - TH1D* h_rt_tf20_gpt20_3s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); - - TH1D* h_rt_tf20_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kAzure+6, 1, 2); - TH1D* h_rt_tf20_gpt20_3s1ab = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kGreen+3, 7, 2); + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); + // leg->AddEntry(h_rt_tf20_3s,"anywhere","l"); + // leg->AddEntry(h_rt_tf20_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + // leg->AddEntry(h_rt_tf20_gpt20_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // leg->Draw(); + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); -// maxy = 300;// 45; -// h_rt_tf20_2s->GetYaxis()->SetRangeUser(miny,maxy); -// h_rt_tf20_2s1b->GetYaxis()->SetRangeUser(miny,maxy); -// h_rt_tf20_gpt20_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - cAll100->SetLogy(1); + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); -// h_rt_tf20_2s->Draw("hist e1"); -// h_rt_tf20_gpt20_2s1b->Draw("hist e1 same"); -// h_rt_tf20_2s->Draw("hist e1 same"); -// h_rt_tf20_2s1b->Draw("hist e1 same"); + // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1b, h_rt_tf20_3s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); -// TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); -// leg->SetBorderSize(0); -// leg->SetFillStyle(0); -// leg->AddEntry(h_rt_tf20_2s,"Tracks: p_{T}>=20, 2+ stubs",""); -// leg->AddEntry(h_rt_tf20_2s,"anywhere","l"); -// leg->AddEntry(h_rt_tf20_2s1b,"with ME1 in 1.6<|#eta|<2.14","l"); -// leg->AddEntry(h_rt_tf20_gpt20_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); -// leg->Draw(); + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); -// TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); -// tex->SetNDC(); -// tex->Draw(); -// Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); + //========================= Comparing default with/without stub in ME1a ============================================== + /* + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + h_rt_tf20_3s1b->Draw("hist e1"); + // h_rt_tf20_3s1ab->Draw("hist e1 same"); + + TLegend *leg = new TLegend(0.25,0.65,.85,0.90,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(h_rt_tf20_3s1b,"Tracks: p_{T}>=20, 3+ stubs",""); + leg->AddEntry(h_rt_tf20_3s1b,"Requiring stub in ME1b","l"); + // leg->AddEntry(h_rt_tf20_3s1ab,"Requiring stub in ME1b and ME1a","l"); + leg->Draw(); -// TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -// gPad->SetGridx(1);gPad->SetGridy(1); + TLatex * tex = new TLatex(0.15, 0.85,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex->SetNDC(); + tex->Draw(); -// gem_ratio = setHistoRatio(h_rt_tf20_gpt20_2s1b, h_rt_tf20_2s1b, "", 0.,1.8); -// gem_ratio->Draw("e1"); + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__def-3s-3s1b_compstubME1a.png").Data()); -// Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b__ratio.png").Data()); + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetGridx(1);gPad->SetGridy(1); + gem_ratio = setHistoRatio(h_rt_tf20_3s1ab, h_rt_tf20_3s1b, "", 0.,1.8); + gem_ratio->Draw("e1"); -// //======================== 3+ Stubs ================================// + Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__def-3s-3s1b__ratio_compstubME1a.png").Data()); + */ -// ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - maxy = 30.;//10; -// h_rt_tf20_3s->GetYaxis()->SetRangeUser(miny,maxy); -// h_rt_tf20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); -// h_rt_tf20_gpt20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -// ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -// h_rt_tf20_3s->Draw("hist e1"); -// h_rt_tf20_gpt20_3s1b->Draw("hist e1 same"); -// h_rt_tf20_3s->Draw("hist e1 same"); -// h_rt_tf20_3s1b->Draw("hist e1 same"); + // maxy = 30.;//10; -// TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); -// leg->SetBorderSize(0); -// leg->SetFillStyle(0); -// leg->AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); -// leg->AddEntry(h_rt_tf20_3s,"anywhere","l"); -// leg->AddEntry(h_rt_tf20_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); -// leg->AddEntry(h_rt_tf20_gpt20_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); -// leg->Draw(); + // h_rt_tf20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf20_gpt20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); -// TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); -// tex->SetNDC(); -// tex->Draw(); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf20_3s->Draw("hist e1"); + // h_rt_tf20_gpt20_3s1ab->Draw("hist e1 same"); + // h_rt_tf20_3s->Draw("hist e1 same"); + // h_rt_tf20_3s1ab->Draw("hist e1 same"); -// Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); + // leg->AddEntry(h_rt_tf20_3s,"anywhere","l"); + // leg->AddEntry(h_rt_tf20_3s1ab,"with ME1 in 1.6<|#eta|","l"); + // leg->AddEntry(h_rt_tf20_gpt20_3s1ab,"with (ME1+GEM) in 1.6<|#eta|","l"); + // leg->Draw(); + + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); + + + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1ab, h_rt_tf20_3s1ab, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); -// TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -// gPad->SetGridx(1);gPad->SetGridy(1); -// gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1b, h_rt_tf20_3s1b, "", 0.,1.8); -// gem_ratio->Draw("e1"); -// Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf20_gpt20_3s1b->Draw("hist e1"); + // h_rt_tf20_gpt20_3s1ab->Draw("hist e1 same"); + + // TLegend *leg = new TLegend(0.25,0.65,.85,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf20_gpt20_3s1b,"Tracks: p_{T}>=20, 3+ stubs",""); + // leg->AddEntry(h_rt_tf20_gpt20_3s1b,"Requiring stub in ME1b (ME1+GEM)","l"); + // leg->AddEntry(h_rt_tf20_gpt20_3s1ab,"Requiring stub in ME1b and ME1a (ME1+GEM)","l"); + // leg->Draw(); -// // Including the region ME1/1a + // TLatex * tex = new TLatex(0.15, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); -// ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__gme-3s-3s1b__gem-3s-3s1b_compstubME1a.png").Data()); -// maxy = 30.;//10; + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); -// h_rt_tf20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); -// h_rt_tf20_gpt20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1ab, h_rt_tf20_gpt20_3s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__gem-3s-3s1b__gem-3s-3s1b__ratio_compstubME1a.png").Data()); -// ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -// h_rt_tf20_3s->Draw("hist e1"); -// h_rt_tf20_gpt20_3s1ab->Draw("hist e1 same"); -// h_rt_tf20_3s->Draw("hist e1 same"); -// h_rt_tf20_3s1ab->Draw("hist e1 same"); -// TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); -// leg->SetBorderSize(0); -// leg->SetFillStyle(0); -// leg->AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); -// leg->AddEntry(h_rt_tf20_3s,"anywhere","l"); -// leg->AddEntry(h_rt_tf20_3s1ab,"with ME1 in 1.6<|#eta|","l"); -// leg->AddEntry(h_rt_tf20_gpt20_3s1ab,"with (ME1+GEM) in 1.6<|#eta|","l"); -// leg->Draw(); -// TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); -// tex->SetNDC(); -// tex->Draw(); -// Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf20_3s1ab->Draw("hist e1"); + // h_rt_tf20_gpt20_3s1ab->Draw("hist e1 same"); + + // TLegend *leg = new TLegend(0.25,0.65,.85,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf20_3s1ab,"Tracks: p_{T}>=20, 3+ stubs",""); + // leg->AddEntry(h_rt_tf20_3s1ab,"Requiring stub in ME1b","l"); + // leg->AddEntry(h_rt_tf20_gpt20_3s1ab,"Requiring stub in ME1b and ME1a (ME1+GEMs)","l"); + // leg->Draw(); + // TLatex * tex = new TLatex(0.15, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); -// TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -// gPad->SetGridx(1);gPad->SetGridy(1); + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b_compstubME1a.png").Data()); -// gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1ab, h_rt_tf20_3s1ab, "", 0.,1.8); -// gem_ratio->Draw("e1"); + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); -// Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); + // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1ab, h_rt_tf20_3s1ab, "", 0.,1.8); + // gem_ratio->Draw("e1"); + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio_compstubME1a.png").Data()); - vs_eta_minpt = "30"; - ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + //********************************** TF track pT>30 GeV ************************************************// + vs_eta_minpt = "30"; + ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin, kHz"; -// TH1D* h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); -// TH1D* h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); -// TH1D* h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); + // TH1D* h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); + // TH1D* h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); + // TH1D* h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); - TH1D* h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); + TH1D* h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); + TH1D* h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); + TH1D* h_rt_tf30_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kAzure+2, 1, 2); + TH1D* h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); + TH1D* h_rt_tf30_gpt30_3s1ab = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kRed, 7, 2); - TH1D* h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); - TH1D* h_rt_tf30_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kAzure+2, 1, 2); - TH1D* h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); - TH1D* h_rt_tf30_gpt30_3s1ab = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kGreen, 7, 2); + // // maxy = 120.;//35.; + // // h_rt_tf30_2s->GetYaxis()->SetRangeUser(miny,maxy); + // // h_rt_tf30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + // // h_rt_tf30_gpt30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - // // maxy = 120.;//35.; - // // h_rt_tf30_2s->GetYaxis()->SetRangeUser(miny,maxy); - // // h_rt_tf30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - // // h_rt_tf30_gpt30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + // TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + // cAll100->SetLogy(1); + // // h_rt_tf30_2s->Draw("hist e1"); + // // h_rt_tf30_gpt30_2s1b->Draw("hist e1 same"); + // // h_rt_tf30_2s->Draw("hist e1 same"); + // // h_rt_tf30_2s1b->Draw("hist e1 same"); + // // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // // leg->SetBorderSize(0); + // // leg->SetFillStyle(0); + // // leg->AddEntry(h_rt_tf30_2s,"Tracks: p_{T}>=30, 2+ stubs",""); + // // leg->AddEntry(h_rt_tf30_2s,"anywhere","l"); + // // leg->AddEntry(h_rt_tf30_2s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + // // leg->AddEntry(h_rt_tf30_gpt30_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // // leg->Draw(); - // TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - // cAll100->SetLogy(1); - // // h_rt_tf30_2s->Draw("hist e1"); - // // h_rt_tf30_gpt30_2s1b->Draw("hist e1 same"); - // // h_rt_tf30_2s->Draw("hist e1 same"); - // // h_rt_tf30_2s1b->Draw("hist e1 same"); + // // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // // tex->SetNDC(); + // // tex->Draw(); - // // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); - // // leg->SetBorderSize(0); - // // leg->SetFillStyle(0); - // // leg->AddEntry(h_rt_tf30_2s,"Tracks: p_{T}>=30, 2+ stubs",""); - // // leg->AddEntry(h_rt_tf30_2s,"anywhere","l"); - // // leg->AddEntry(h_rt_tf30_2s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - // // leg->AddEntry(h_rt_tf30_gpt30_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - // // leg->Draw(); + // // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); - // // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // // tex->SetNDC(); - // // tex->Draw(); - // // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); + // // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // // gPad->SetGridx(1);gPad->SetGridy(1); + // // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_2s1b, h_rt_tf30_2s1b, "", 0.,1.8); + // // gem_ratio->Draw("e1"); - // // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - // // gPad->SetGridx(1);gPad->SetGridy(1); + // // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b__ratio.png").Data()); - // // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_2s1b, h_rt_tf30_2s1b, "", 0.,1.8); - // // gem_ratio->Draw("e1"); - // // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b__ratio.png").Data()); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + maxy = 30.;//7.; + h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf30_gpt30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf30_3s->Draw("hist e1"); + // h_rt_tf30_gpt30_3s1b->Draw("hist e1 same"); + // h_rt_tf30_3s->Draw("hist e1 same"); + // h_rt_tf30_3s1b->Draw("hist e1 same"); - // maxy = 30.;//7.; - // h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); - // h_rt_tf30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - // h_rt_tf30_gpt30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); + // leg->AddEntry(h_rt_tf30_3s,"anywhere","l"); + // leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + // leg->AddEntry(h_rt_tf30_gpt30_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // leg->Draw(); - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // h_rt_tf30_3s->Draw("hist e1"); - // h_rt_tf30_gpt30_3s1b->Draw("hist e1 same"); - // h_rt_tf30_3s->Draw("hist e1 same"); - // h_rt_tf30_3s1b->Draw("hist e1 same"); + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); - // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); - // leg->AddEntry(h_rt_tf30_3s,"anywhere","l"); - // leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - // leg->AddEntry(h_rt_tf30_gpt30_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - // leg->Draw(); + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); - // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // tex->SetNDC(); - // tex->Draw(); - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); - - - // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); - // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1b, h_rt_tf30_3s1b, "", 0.,1.8); - // gem_ratio->Draw("e1"); + // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1b, h_rt_tf30_3s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); - // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); + // //========================== Including the ME1a - // //========================== Including the ME1a + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf30_gpt30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf30_gpt30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - // h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); - // h_rt_tf30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf30_gpt30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf30_3s->Draw("hist e1"); + // h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same"); + // h_rt_tf30_3s->Draw("hist e1 same"); + // h_rt_tf30_3s1ab->Draw("hist e1 same"); - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // h_rt_tf30_3s->Draw("hist e1"); - // h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same"); - // h_rt_tf30_3s->Draw("hist e1 same"); - // h_rt_tf30_3s1ab->Draw("hist e1 same"); + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); - // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); - // leg->AddEntry(h_rt_tf30_3s,"anywhere","l"); - // leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|","l"); - // leg->AddEntry(h_rt_tf30_gpt30_3s1ab,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - // leg->Draw(); + // leg->AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); + // leg->AddEntry(h_rt_tf30_3s,"anywhere","l"); + // leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|","l"); + // leg->AddEntry(h_rt_tf30_gpt30_3s1ab,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // leg->Draw(); - // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // tex->SetNDC(); - // tex->Draw(); + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); - // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); + // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); - // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1ab, h_rt_tf30_3s1ab, "", 0.,1.8); - // gem_ratio->Draw("e1"); + // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1ab, h_rt_tf30_3s1ab, "", 0.,1.8); + // gem_ratio->Draw("e1"); - // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); + // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); - // //========================== Comparison with/withous Stub in ME1a ==========================// - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + //========================== Comparison with/without Stub in ME1a ==========================// + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + + // h_rt_tf30_3s1b->Draw("hist e1"); + // h_rt_tf30_3s1ab->Draw("hist e1 same"); + + // TLegend *leg = new TLegend(0.25,0.65,.85,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf30_3s1b,"Tracks: p_{T}>=30, 3+ stubs",""); + // leg->AddEntry(h_rt_tf30_3s1b,"Requiring stub in ME1b","l"); + // leg->AddEntry(h_rt_tf30_3s1ab,"Requiring stub in ME1b and ME1a ","l"); + // leg->Draw(); + + // TLatex * tex = new TLatex(0.15, 0.85,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); - // h_rt_tf30_3s1b->Draw("hist e1"); - // h_rt_tf30_3s1ab->Draw("hist e1 same"); - // TLegend *leg = new TLegend(0.2,0.65,.80,0.90,NULL,"brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf30_3s1b,"Tracks: p_{T}>=30, 3+ stubs",""); - // leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - // leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|<2.4","l"); - // leg->Draw(); + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__compstubME1a.png").Data()); + + + // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + // gem_ratio = setHistoRatio2(h_rt_tf30_3s1ab, h_rt_tf30_3s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); + // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__ratio_compstubME1a.png").Data()); + + + // //========================== Comparison with/withous Stub in ME1a + GEMS ==========================// + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); + // h_rt_tf30_gpt30_3s1b->Draw("hist e1"); + // h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same "); - // gem_ratio = setHistoRatio2(h_rt_tf30_3s1ab, h_rt_tf30_3s1b, "", 0.,1.8); - // gem_ratio->Draw("e1"); + // TLegend *leg = new TLegend(0.25,0.65,.85,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf30_gpt30_3s1b,"Tracks: p_{T}>=30, 3+ stubs" ,""); + // leg->AddEntry(h_rt_tf30_gpt30_3s1b,"Requiring stub in ME1b (ME1+GEM)","l"); + // leg->AddEntry(h_rt_tf30_gpt30_3s1ab,"Requiring stub in ME1b and ME1a (ME1+GEM) ","l"); + // leg->Draw(); - // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio_compstubME1a.png").Data()); + // TLatex * tex = new TLatex(0.15, 0.85,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); - - //========================== Comparison with/withous Stub in ME1a + GEMS ==========================// + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__gem-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); - ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); - h_rt_tf30_gpt30_3s1b->Draw("hist e1"); - h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same"); + // gem_ratio = setHistoRatio2(h_rt_tf30_gpt30_3s1ab, h_rt_tf30_gpt30_3s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); - TLegend *leg = new TLegend(0.2,0.65,.80,0.90,NULL,"brNDC"); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->AddEntry(h_rt_tf30_3s1b,"Tracks: p_{T}>=30, 3+ stubs",""); - leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|<2.4","l"); - leg->Draw(); + // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__gem-3s-3s1ab__gem-3s-3s1ab__ratio_compstubME1a.png").Data()); + + // //========================== Comparison with stubs in ME1a CSC/CSC+GEMS ==========================// - Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf30_3s1ab->Draw("hist e1"); + // h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same"); - TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; - gPad->SetGridx(1);gPad->SetGridy(1); + // TLegend *leg = new TLegend(0.25,0.65,.85,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf30_3s1ab,"Tracks: p_{T}>=30, 3+ stubs, 1 stub in ME1b or ME1a",""); + // leg->AddEntry(h_rt_tf30_3s1ab,"Requiring stub in ME1b and ME1a ","l"); + // leg->AddEntry(h_rt_tf30_gpt30_3s1ab,"Requiring stub in ME1b and ME1a (ME1+GEM)","l"); + // leg->Draw(); - gem_ratio = setHistoRatio2(h_rt_tf30_3s1ab, h_rt_tf30_3s1b, "", 0.,1.8); - gem_ratio->Draw("e1"); + // TLatex * tex = new TLatex(0.15, 0.85,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); + + + // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1ab, h_rt_tf30_3s1ab, "", 0.,1.8); + // gem_ratio->Draw("e1"); - Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio_compstubME1a.png").Data()); + // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio_compstubME1a.png").Data()); + + } @@ -929,972 +1073,972 @@ TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;tr void drawplot_gmtrt(TString dname = "", TString vs_eta_minpt = "") { -bool vs_eta = false; -if (vs_eta_minpt.Length() > 0) vs_eta = true; - -// directory for plots is made as -// pdir = $PWD/pic[_{dname}]_{pu} - -//gStyle->SetStatW(0.13); -//gStyle->SetStatH(0.08); -gStyle->SetStatW(0.07); -gStyle->SetStatH(0.06); - -gStyle->SetOptStat(0); - -gStyle->SetTitleStyle(0); -gStyle->SetTitleAlign(13);// coord in top left -gStyle->SetTitleX(0.); -gStyle->SetTitleY(1.); -gStyle->SetTitleW(1); -gStyle->SetTitleH(0.058); -gStyle->SetTitleBorderSize(0); - -gStyle->SetPadLeftMargin(0.126); -gStyle->SetPadRightMargin(0.04); -gStyle->SetPadTopMargin(0.06); -gStyle->SetPadBottomMargin(0.13); + bool vs_eta = false; + if (vs_eta_minpt.Length() > 0) vs_eta = true; + + // directory for plots is made as + // pdir = $PWD/pic[_{dname}]_{pu} + + //gStyle->SetStatW(0.13); + //gStyle->SetStatH(0.08); + gStyle->SetStatW(0.07); + gStyle->SetStatH(0.06); + + gStyle->SetOptStat(0); + + gStyle->SetTitleStyle(0); + gStyle->SetTitleAlign(13);// coord in top left + gStyle->SetTitleX(0.); + gStyle->SetTitleY(1.); + gStyle->SetTitleW(1); + gStyle->SetTitleH(0.058); + gStyle->SetTitleBorderSize(0); + + gStyle->SetPadLeftMargin(0.126); + gStyle->SetPadRightMargin(0.04); + gStyle->SetPadTopMargin(0.06); + gStyle->SetPadBottomMargin(0.13); + + gStyle->SetMarkerStyle(1); + + + + char d1[111]="",d2[111]=""; + if (dname != "") sprintf(d1,"_%s", dname.Data()); + //if (strcmp(pu,"")>0) sprintf(d2,"_%s",pu); + //sprintf(pdir,"pic%s%s",d1,d2); + + if (interactive && dname != "") { + sprintf(pdir,"pic%s%s",d1,d2); + if( gSystem->AccessPathName(pdir)==0 ) { + //cout<<"directory "<Exec(cmd) != 0) {cout<<"can't remode directory! exiting..."<MakeDirectory(pdir); + } + } -gStyle->SetMarkerStyle(1); + //cout<<"opening "<0) sprintf(d2,"_%s",pu); -//sprintf(pdir,"pic%s%s",d1,d2); + // = (TH1D*)f->Get("SimMuL1/;1"); -if (interactive && dname != "") { - sprintf(pdir,"pic%s%s",d1,d2); - if( gSystem->AccessPathName(pdir)==0 ) { - //cout<<"directory "<Exec(cmd) != 0) {cout<<"can't remode directory! exiting..."<MakeDirectory(pdir); - } -} + char f_pu050_me42_re4[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + char f_pu050_re4[200] ="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; + char f_pu050[200] ="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; + char f_pu050_me42_rev1[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rev1_rpc.root"; + char f_pu050_me42_rev2[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rev2_rpc.root"; -//cout<<"opening "<Get("SimMuL1/;1"); + char f_pu200_hneu_me42_re4[200]="hp_minbias_3_6_2_hnpu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + char f_pu200_rneu_me42_re4[200]="hp_minbias_3_6_2_rnpu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; -char f_pu050_me42_re4[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; -char f_pu050_re4[200] ="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; -char f_pu050[200] ="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; -char f_pu050_me42_rev1[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rev1_rpc.root"; -char f_pu050_me42_rev2[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rev2_rpc.root"; + char f_pu200_neu_me42_re4[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + char f_pu200_me42_re4[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + char f_pu200_neu_re4[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; + char f_pu200_re4[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; + hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat8.root + char f_pu200_neu[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; + char f_pu200[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; -char f_pu050_hneu_me42_re4[200]="hp_minbias_3_6_2_hnpu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; -char f_pu050_neu_me42_re4[200]="hp_minbias_3_6_2_npu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; -char f_pu200_hneu_me42_re4[200]="hp_minbias_3_6_2_hnpu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; -char f_pu200_rneu_me42_re4[200]="hp_minbias_3_6_2_rnpu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; -char f_pu200_neu_me42_re4[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; -char f_pu200_me42_re4[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + TString f_pu100_pat8 = gem_dir; + TString f_pu100_pat8_gem = gem_dir; -char f_pu200_neu_re4[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; -char f_pu200_re4[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; -hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat8.root -char f_pu200_neu[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; -char f_pu200[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; + //TString f_pu100_pat2 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat2.root"; + //TString f_pu100_pat8 ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat8.root"; + //TString f_pu100_pat2_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat2.root"; + //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat8.root"; + + //TString f_pu100_pat8 ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat2.root"; + //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat2.root"; + if (dname.Contains("_pat8")) f_pu100_pat8 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root"; + if (dname == "minbias_pt05_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat8.root"; + if (dname == "minbias_pt06_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat8.root"; + if (dname == "minbias_pt10_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat8.root"; + if (dname == "minbias_pt15_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat8.root"; + if (dname == "minbias_pt20_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat8.root"; + if (dname == "minbias_pt30_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat8.root"; + if (dname == "minbias_pt40_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat8.root"; + if (dname.Contains("_pat2")) f_pu100_pat8 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; + if (dname == "minbias_pt05_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat2.root"; + if (dname == "minbias_pt06_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat2.root"; + if (dname == "minbias_pt10_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat2.root"; + if (dname == "minbias_pt15_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat2.root"; + if (dname == "minbias_pt20_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat2.root"; + if (dname == "minbias_pt30_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat2.root"; + if (dname == "minbias_pt40_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat2.root"; -TString f_pu100_pat8 = gem_dir; -TString f_pu100_pat8_gem = gem_dir; + //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemx_pt20_pat2.root"; + //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemOldx_pt20_pat2.root"; + //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemOld_pt20_pat2.root"; + + + bool do_return = false; + + + + //#################################### PU100 #################################### + + // full eta 1. - 2.4 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b + if (vs_eta) + { + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin, kHz"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + hAll100->Draw("hist e1"); + hAll100gem->Draw("hist e1 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","l"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); + leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-2s1b__gem-3s-2s1b.png").Data()); + + if (do_return) return; + } + + + + // full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b + if (vs_eta) + { + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin, kHz"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + hAll100->Draw("hist e1"); + hAll100gem->Draw("hist e1 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","l"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"in ME1/b region also require",""); + leg_cc100->AddEntry(hAll100,"one stub to be from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); + + if (do_return) return; + } + + // full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b + if (vs_eta) + { + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin, kHz"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + hAll100->Draw("hist e1"); + hAll100gem->Draw("hist e1 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","l"); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); + leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-2s1b.png").Data()); + + if (do_return) return; + } + + + // full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b + if (vs_eta) + { + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin, kHz"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + hAll100->Draw("hist e1"); + hAll100gem->Draw("hist e1 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","l"); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"in ME1/b region also require",""); + leg_cc100->AddEntry(hAll100,"one stub to be from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-3s1b.png").Data()); + + if (do_return) return; + } + + + if (vs_eta) return; + + + + // full eta 1. - 2.4 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); + leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, "rates__1-2.4__PU100__def-3s-2s1b__gem-3s-2s1b.png"); + + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1);//gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.4); + hAll100gem_ratio->Draw("e1"); -//TString f_pu100_pat2 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat2.root"; -//TString f_pu100_pat8 ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat8.root"; -//TString f_pu100_pat2_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat2.root"; -//TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat8.root"; + Print(cAll100r, "rates__1-2.4__PU100__def-3s-2s1b__gem-3s-2s1b__ratio.png"); -//TString f_pu100_pat8 ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat2.root"; -//TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat2.root"; + if (do_return) return; + } -if (dname.Contains("_pat8")) f_pu100_pat8 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root"; -if (dname == "minbias_pt05_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat8.root"; -if (dname == "minbias_pt06_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat8.root"; -if (dname == "minbias_pt10_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat8.root"; -if (dname == "minbias_pt15_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat8.root"; -if (dname == "minbias_pt20_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat8.root"; -if (dname == "minbias_pt30_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat8.root"; -if (dname == "minbias_pt40_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat8.root"; -if (dname.Contains("_pat2")) f_pu100_pat8 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; -if (dname == "minbias_pt05_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat2.root"; -if (dname == "minbias_pt06_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat2.root"; -if (dname == "minbias_pt10_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat2.root"; -if (dname == "minbias_pt15_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat2.root"; -if (dname == "minbias_pt20_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat2.root"; -if (dname == "minbias_pt30_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat2.root"; -if (dname == "minbias_pt40_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat2.root"; + // full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; -//TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemx_pt20_pat2.root"; -//TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemOldx_pt20_pat2.root"; -//TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemOld_pt20_pat2.root"; + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks: same, except in ME1/b region req.",""); + leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -bool do_return = false; + Print(cAll100, "rates__1-2.4__PU100__def-3s__gem-3s-2s1b.png"); + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1);//gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); -//#################################### PU100 #################################### + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); + hAll100gem_ratio->Draw("e1"); -// full eta 1. - 2.4 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b -if (vs_eta) -{ -gdy[0]=0; gdy[1]=7.; -if (vs_eta_minpt=="20") gdy[1]=10.; - -TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; -hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100", ttl, kAzure+9, 1, 2); -hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - -//gStyle->SetPadTopMargin(0.08); -gStyle->SetTitleH(0.06); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -hAll100->Draw("hist e1"); -hAll100gem->Draw("hist e1 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","l"); -leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); -leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); -leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); -leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); -tex->SetNDC(); -tex->Draw(); - -Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-2s1b__gem-3s-2s1b.png").Data()); - -if (do_return) return; -} + Print(cAll100r, "rates__1-2.4__PU100__def-3s__gem-3s-2s1b__ratio.png"); + if (do_return) return; + } -// full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b -if (vs_eta) -{ -gdy[0]=0; gdy[1]=7.; -if (vs_eta_minpt=="20") gdy[1]=10.; - -TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; -hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+9, 1, 2); -hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - -//gStyle->SetPadTopMargin(0.08); -gStyle->SetTitleH(0.06); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -hAll100->Draw("hist e1"); -hAll100gem->Draw("hist e1 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","l"); -leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); -leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); -leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100,"in ME1/b region also require",""); -leg_cc100->AddEntry(hAll100,"one stub to be from ME1/b",""); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); -tex->SetNDC(); -tex->Draw(); - -Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); - -if (do_return) return; -} -// full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b -if (vs_eta) -{ -gdy[0]=0; gdy[1]=7.; -if (vs_eta_minpt=="20") gdy[1]=10.; - -TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; -hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); -hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - -//gStyle->SetPadTopMargin(0.08); -gStyle->SetTitleH(0.06); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -hAll100->Draw("hist e1"); -hAll100gem->Draw("hist e1 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","l"); -leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); -leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); -leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); -tex->SetNDC(); -tex->Draw(); - -Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-2s1b.png").Data()); - -if (do_return) return; -} + // no ME1/a eta 1. - 2.1 Default: 3station GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_no1a", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); -// full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b -if (vs_eta) -{ -gdy[0]=0; gdy[1]=7.; -if (vs_eta_minpt=="20") gdy[1]=10.; - -TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; -hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); -hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - -//gStyle->SetPadTopMargin(0.08); -gStyle->SetTitleH(0.06); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -hAll100->Draw("hist e1"); -hAll100gem->Draw("hist e1 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","l"); -leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); -leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100,"in ME1/b region also require",""); -leg_cc100->AddEntry(hAll100,"one stub to be from ME1/b",""); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); -tex->SetNDC(); -tex->Draw(); - -Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-3s1b.png").Data()); - -if (do_return) return; -} + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.1",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks: same, except in ME1/b region req.",""); + leg_cc100->AddEntry(hAll100,">=3 stubs and one of them from ME1/b",""); + leg_cc100->Draw(); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -if (vs_eta) return; + Print(cAll100, "rates__1-2.1__PU100__def-3s__gem-3s-3s1b.png"); + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); -// full eta 1. - 2.4 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b -if (1) -{ -gdy[0]=2; gdy[1]=2000.; - -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); - -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); -leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); -leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); - -Print(cAll100, "rates__1-2.4__PU100__def-3s-2s1b__gem-3s-2s1b.png"); - - -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1);//gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); - -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.4); -hAll100gem_ratio->Draw("e1"); - -Print(cAll100r, "rates__1-2.4__PU100__def-3s-2s1b__gem-3s-2s1b__ratio.png"); - -if (do_return) return; -} + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); + hAll100gem_ratio->Draw("e1"); + Print(cAll100r, "rates__1-2.1__PU100__def-3s__gem-3s-3s1b__ratio.png"); -// full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b -if (1) -{ -gdy[0]=2; gdy[1]=2000.; + result_gem_eta_no1a = hAll100gem; + result_def_eta_no1a = hAll100; -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + if (do_return) return; + } -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks: same, except in ME1/b region req.",""); -leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); -leg_cc100->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); + // no ME1/a eta 1. - 2.1 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; -Print(cAll100, "rates__1-2.4__PU100__def-3s__gem-3s-2s1b.png"); + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1<|#eta|<2.1",""); + leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); + leg_cc100->Draw(); -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1);//gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); -hAll100gem_ratio->Draw("e1"); + Print(cAll100, "rates__1-2.1__PU100__def-3s-3s1b__gem-3s-3s1b.png"); -Print(cAll100r, "rates__1-2.4__PU100__def-3s__gem-3s-2s1b__ratio.png"); -if (do_return) return; -} + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); + hAll100gem_ratio->Draw("e1"); + Print(cAll100r, "rates__1-2.1__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); -// no ME1/a eta 1. - 2.1 Default: 3station GEM: 3station, 3s & 1b -if (1) -{ -gdy[0]=2; gdy[1]=2000.; + //result_gem_eta_no1a = hAll100gem; + result_def_eta_no1a_3s1b = hAll100; -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_no1a", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + if (do_return) return; + } -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.1",""); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks: same, except in ME1/b region req.",""); -leg_cc100->AddEntry(hAll100,">=3 stubs and one of them from ME1/b",""); -leg_cc100->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); + // Full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; -Print(cAll100, "rates__1-2.1__PU100__def-3s__gem-3s-3s1b.png"); + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks: same, except",""); + leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); + leg_cc100->Draw(); -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); -hAll100gem_ratio->Draw("e1"); + Print(cAll100, "rates__1-2.4__PU100__def-3s__gem-3s-3s1b.png"); -Print(cAll100r, "rates__1-2.1__PU100__def-3s__gem-3s-3s1b__ratio.png"); + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); -result_gem_eta_no1a = hAll100gem; -result_def_eta_no1a = hAll100; + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); + hAll100gem_ratio->Draw("e1"); -if (do_return) return; -} + Print(cAll100r, "rates__1-2.4__PU100__def-3s__gem-3s-3s1b__ratio.png"); + result_gem_eta_all = hAll100gem; + result_def_eta_all = hAll100; -// no ME1/a eta 1. - 2.1 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b -if (1) -{ -gdy[0]=2; gdy[1]=2000.; + if (do_return) return; + } -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); -leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1<|#eta|<2.1",""); -leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); -leg_cc100->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); + // Full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; -Print(cAll100, "rates__1-2.1__PU100__def-3s-3s1b__gem-3s-3s1b.png"); + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); + leg_cc100->Draw(); -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); -hAll100gem_ratio->Draw("e1"); + Print(cAll100, "rates__1-2.4__PU100__def-3s-3s1b__gem-3s-3s1b.png"); -Print(cAll100r, "rates__1-2.1__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); -//result_gem_eta_no1a = hAll100gem; -result_def_eta_no1a_3s1b = hAll100; + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); -if (do_return) return; -} + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.6); + hAll100gem_ratio->Draw(); + Print(cAll100r, "rates__1-2.4__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); -// Full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b -if (1) -{ -gdy[0]=2; gdy[1]=2000.; + //result_gem_eta_all = hAll100gem; + result_def_eta_all_3s1b = hAll100; -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + if (do_return) return; + } -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks: same, except",""); -leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); -leg_cc100->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); -Print(cAll100, "rates__1-2.4__PU100__def-3s__gem-3s-3s1b.png"); + // ME1b eta 1.64 - 2.14 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=0.02; gdy[1]=1000.; + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100,"and require one stub to be from ME1/b",""); + leg_cc100->Draw(); -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); -hAll100gem_ratio->Draw("e1"); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -Print(cAll100r, "rates__1-2.4__PU100__def-3s__gem-3s-3s1b__ratio.png"); + Print(cAll100, "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b.png"); -result_gem_eta_all = hAll100gem; -result_def_eta_all = hAll100; -if (do_return) return; -} + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,2.1); + hAll100gem_ratio->Draw("e1"); + Print(cAll100r, "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); -// Full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b -if (1) -{ -gdy[0]=2; gdy[1]=2000.; + result_gem = hAll100gem; + result_def_3s1b = hAll100; -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + if (do_return) return; + } -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); -leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); -leg_cc100->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); -Print(cAll100, "rates__1-2.4__PU100__def-3s-3s1b__gem-3s-3s1b.png"); + // ME1b eta 1.64 - 2.14 Default: 3station, 3s GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=0.02; gdy[1]=1000.; + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks: same, plus req. one stub from ME1/b",""); + leg_cc100->Draw(); -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.6); -hAll100gem_ratio->Draw(); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -Print(cAll100r, "rates__1-2.4__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); + Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b.png"); -//result_gem_eta_all = hAll100gem; -result_def_eta_all_3s1b = hAll100; -if (do_return) return; -} + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,1.1); + hAll100gem_ratio->Draw("e1"); + Print(cAll100r, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__ratio.png"); -// ME1b eta 1.64 - 2.14 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b -if (1) -{ -gdy[0]=0.02; gdy[1]=1000.; + //result_gem = hAll100gem; + result_def = hAll100; -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_2s_1b", "_hAll100s2", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + result_def_2s = hAll100; -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); -leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1.64<|#eta|<2.14",""); -leg_cc100->AddEntry(hAll100,"and require one stub to be from ME1/b",""); -leg_cc100->Draw(); + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_2s_1b", "_hAll100s2", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + result_def_2s = hAll100; -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); + if (do_return) return; + } -Print(cAll100, "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b.png"); -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); + // ME1b eta 1.64 - 2.14 Default: 3station, 3s GMT single trigg + if (1) + { + gdy[0]=0.02; gdy[1]=1000.; -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,2.1); -hAll100gem_ratio->Draw("e1"); + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_ptmax_sing_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+1, 1, 1); -Print(cAll100r, "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100gem,"GMT selection for Single Trigger","f"); + leg_cc100->Draw(); -result_gem = hAll100gem; -result_def_3s1b = hAll100; + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -if (do_return) return; -} + Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gmtsing.png"); + result_gmtsing = hAll100gem; + if (do_return) return; + } -// ME1b eta 1.64 - 2.14 Default: 3station, 3s GEM: 3station, 3s & 1b -if (1) -{ -gdy[0]=0.02; gdy[1]=1000.; -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + // ME1b eta 1.64 - 2.14 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b + if (1) + { + gdy[0]=0.02; gdy[1]=1000.; -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks: same, plus req. one stub from ME1/b",""); -leg_cc100->Draw(); + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,"with >=2 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100,"and require one stub to be from ME1/b",""); + leg_cc100->Draw(); -Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b.png"); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + Print(cAll100, "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b.png"); -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,1.1); -hAll100gem_ratio->Draw("e1"); + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); -Print(cAll100r, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__ratio.png"); + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,2.1); + hAll100gem_ratio->Draw("e1"); -//result_gem = hAll100gem; -result_def = hAll100; + Print(cAll100r, "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__ratio.png"); -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_2s_1b", "_hAll100s2", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -result_def_2s = hAll100; + result_gem_2s1b = hAll100gem; + result_def_2s1b = hAll100; -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_2s_1b", "_hAll100s2", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -result_def_2s = hAll100; + if (do_return) return; + } -if (do_return) return; -} + /* -// ME1b eta 1.64 - 2.14 Default: 3station, 3s GMT single trigg -if (1) -{ -gdy[0]=0.02; gdy[1]=1000.; - -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_ptmax_sing_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+1, 1, 1); - -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); -leg_cc100->AddEntry(hAll100gem,"GMT selection for Single Trigger","f"); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); - -Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gmtsing.png"); - -result_gmtsing = hAll100gem; - -if (do_return) return; -} + // ME1b eta 1.64 - 2.14 Default: 3station, 3s GEM: 3station, 2s & 1b + if (1) + { + gdy[0]=0.02; gdy[1]=1000.; + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); -// ME1b eta 1.64 - 2.14 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b -if (1) -{ -gdy[0]=0.02; gdy[1]=1000.; + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100gem,"Tracks: with >=2 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100gem,"plus req. one stub from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b.png"); + + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,1.1); + hAll100gem_ratio->Draw("e1"); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); -leg_cc100->AddEntry(hAll100,"with >=2 stubs in 1.64<|#eta|<2.14",""); -leg_cc100->AddEntry(hAll100,"and require one stub to be from ME1/b",""); -leg_cc100->Draw(); + Print(cAll100r, "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__ratio.png"); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); + result_gem_2s1b = hAll100gem; + //result_def = hAll100; -Print(cAll100, "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b.png"); + if (do_return) return; + } + */ -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,2.1); -hAll100gem_ratio->Draw("e1"); -Print(cAll100r, "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__ratio.png"); + return; +} -result_gem_2s1b = hAll100gem; -result_def_2s1b = hAll100; +/* -if (do_return) return; -} + .L drawplot_gmtrt.C + drawplot_gmtrt("minbias_pt10_pat2") + hh = (TH1D*)result_gem->Clone("gem_new") + hh->SetFillColor(kGreen+4) + for (int b = hh->FindBin(15); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); + drawplot_gmtrt("minbias_pt15_pat2") + h15 = (TH1D*)result_gem->Clone("gem15") + for (int b = h15->FindBin(15); b < h15->FindBin(20); ++b) hh->SetBinContent(b, h15->GetBinContent(b)); + drawplot_gmtrt("minbias_pt20_pat2") + h20 = (TH1D*)result_gem->Clone("gem20") + for (int b = h20->FindBin(20); b < h20->FindBin(30); ++b) hh->SetBinContent(b, h20->GetBinContent(b)); + drawplot_gmtrt("minbias_pt30_pat2") + h30 = (TH1D*)result_gem->Clone("gem30") + for (int b = h30->FindBin(30); b <= h30->GetNbinsX(); ++b) hh->SetBinContent(b, h30->GetBinContent(b)); + for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh->Draw("same e3"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(result_def,"default emulator","f"); + leg_cc100->AddEntry(result_def,"Tracks: with >=3 stubs in 1.14<|#eta|<2.14",""); + leg_cc100->AddEntry(hh,"with GEM match","f"); + leg_cc100->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); + leg_cc100->Draw(); -/* + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -// ME1b eta 1.64 - 2.14 Default: 3station, 3s GEM: 3station, 2s & 1b -if (1) -{ -gdy[0]=0.02; gdy[1]=1000.; + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png") -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100gem,"Tracks: with >=2 stubs in 1.64<|#eta|<2.14",""); -leg_cc100->AddEntry(hAll100gem,"plus req. one stub from ME1/b",""); -leg_cc100->Draw(); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png") -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); -Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b.png"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3") + hh->Draw("same e3") + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(result_def_3s1b,"default emulator","f"); + leg_cc100->AddEntry(hh,"with GEM match","f"); + leg_cc100->AddEntry(result_def_3s1b,"Tracks req. for both:",""); + leg_cc100->AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg_cc100->Draw(); -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,1.1); -hAll100gem_ratio->Draw("e1"); + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png") -Print(cAll100r, "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__ratio.png"); -result_gem_2s1b = hAll100gem; -//result_def = hAll100; + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png") -if (do_return) return; -} -*/ + .L drawplot_gmtrt.C + drawplot_gmtrt("minbias_pt10_pat8") + hh = (TH1D*)result_gem->Clone("gem_new") + hh->SetFillColor(kGreen+4) + for (int b = hh->FindBin(15); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); + drawplot_gmtrt("minbias_pt15_pat8") + h15 = (TH1D*)result_gem->Clone("gem15") + for (int b = h15->FindBin(15); b < h15->FindBin(20); ++b) hh->SetBinContent(b, h15->GetBinContent(b)); + drawplot_gmtrt("minbias_pt20_pat8") + h20 = (TH1D*)result_gem->Clone("gem20") + for (int b = h20->FindBin(20); b < h20->FindBin(30); ++b) hh->SetBinContent(b, h20->GetBinContent(b)); + drawplot_gmtrt("minbias_pt30_pat8") + h30 = (TH1D*)result_gem->Clone("gem30") + for (int b = h30->FindBin(30); b <= h30->GetNbinsX(); ++b) hh->SetBinContent(b, h30->GetBinContent(b)); + for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); -return; -} -/* - -.L drawplot_gmtrt.C -drawplot_gmtrt("minbias_pt10_pat2") -hh = (TH1D*)result_gem->Clone("gem_new") -hh->SetFillColor(kGreen+4) -for (int b = hh->FindBin(15); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); -drawplot_gmtrt("minbias_pt15_pat2") -h15 = (TH1D*)result_gem->Clone("gem15") -for (int b = h15->FindBin(15); b < h15->FindBin(20); ++b) hh->SetBinContent(b, h15->GetBinContent(b)); -drawplot_gmtrt("minbias_pt20_pat2") -h20 = (TH1D*)result_gem->Clone("gem20") -for (int b = h20->FindBin(20); b < h20->FindBin(30); ++b) hh->SetBinContent(b, h20->GetBinContent(b)); -drawplot_gmtrt("minbias_pt30_pat2") -h30 = (TH1D*)result_gem->Clone("gem30") -for (int b = h30->FindBin(30); b <= h30->GetNbinsX(); ++b) hh->SetBinContent(b, h30->GetBinContent(b)); -for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def->Draw("e3"); -hh->Draw("same e3"); - -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(result_def,"default emulator","f"); -leg_cc100->AddEntry(result_def,"Tracks: with >=3 stubs in 1.14<|#eta|<2.14",""); -leg_cc100->AddEntry(hh,"with GEM match","f"); -leg_cc100->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); - -gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png") - - -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png") - - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s1b->Draw("e3") -hh->Draw("same e3") - -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(result_def_3s1b,"default emulator","f"); -leg_cc100->AddEntry(hh,"with GEM match","f"); -leg_cc100->AddEntry(result_def_3s1b,"Tracks req. for both:",""); -leg_cc100->AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); -leg_cc100->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); - -gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png") - - -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png") - - - - -.L drawplot_gmtrt.C -drawplot_gmtrt("minbias_pt10_pat8") -hh = (TH1D*)result_gem->Clone("gem_new") -hh->SetFillColor(kGreen+4) -for (int b = hh->FindBin(15); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); -drawplot_gmtrt("minbias_pt15_pat8") -h15 = (TH1D*)result_gem->Clone("gem15") -for (int b = h15->FindBin(15); b < h15->FindBin(20); ++b) hh->SetBinContent(b, h15->GetBinContent(b)); -drawplot_gmtrt("minbias_pt20_pat8") -h20 = (TH1D*)result_gem->Clone("gem20") -for (int b = h20->FindBin(20); b < h20->FindBin(30); ++b) hh->SetBinContent(b, h20->GetBinContent(b)); -drawplot_gmtrt("minbias_pt30_pat8") -h30 = (TH1D*)result_gem->Clone("gem30") -for (int b = h30->FindBin(30); b <= h30->GetNbinsX(); ++b) hh->SetBinContent(b, h30->GetBinContent(b)); -for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); - - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def->Draw("e3") -hh->Draw("same e3") - -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(result_def,"default emulator","f"); -leg_cc100->AddEntry(result_def,"Tracks: with >=3 stubs in 1.14<|#eta|<2.14",""); -leg_cc100->AddEntry(hh,"with GEM match","f"); -leg_cc100->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); - -gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png") - - -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png") + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3") + hh->Draw("same e3") + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(result_def,"default emulator","f"); + leg_cc100->AddEntry(result_def,"Tracks: with >=3 stubs in 1.14<|#eta|<2.14",""); + leg_cc100->AddEntry(hh,"with GEM match","f"); + leg_cc100->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); + leg_cc100->Draw(); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s1b->Draw("e3") -hh->Draw("same e3") + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png") -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(result_def_3s1b,"default emulator","f"); -leg_cc100->AddEntry(hh,"with GEM match","f"); -leg_cc100->AddEntry(result_def_3s1b,"Tracks req. for both:",""); -leg_cc100->AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); -leg_cc100->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); -leg_cc100->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png") -gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png") -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png") + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3") + hh->Draw("same e3") + + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(result_def_3s1b,"default emulator","f"); + leg_cc100->AddEntry(hh,"with GEM match","f"); + leg_cc100->AddEntry(result_def_3s1b,"Tracks req. for both:",""); + leg_cc100->AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png") + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png") */ From c837402612125cf1caf51e770f34e0ebd66224b8 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 5 Aug 2013 17:00:23 -0500 Subject: [PATCH 006/182] Create README.txt --- SimMuL1/scripts/README.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 SimMuL1/scripts/README.txt diff --git a/SimMuL1/scripts/README.txt b/SimMuL1/scripts/README.txt new file mode 100644 index 0000000000000..9271ea1e151b1 --- /dev/null +++ b/SimMuL1/scripts/README.txt @@ -0,0 +1,11 @@ +- The analyzer output files are stored in gem_vadim (for default and gem configuration) +- To generate the plots need to start root + * root -l + * .L drawplot_gmtrt() (It has some basic functions used in frankenstein) + * drawplot_frankenstein.C() +- This generates a bunch of rate histograms depending on the + nstubs, eta region, GEM-CSC mathching included or not, etc... +- The macro uses tricky logic due to the fact that the samples (then ones with "gem") are splitted in + pT thresholds and need to be added to a single histogram (total rate) +- The results produced are for pat2 and pat8 (as the one general used is pat2 there is no need to call both + of them this can be implemented as a flag in the macro). From 7982e93be3833037f4072746b996bf39d19b3cab Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 00:11:20 +0200 Subject: [PATCH 007/182] global muon trigger rate vs eta --- SimMuL1/scripts/plotGlobalMuonTriggerRate.py | 2150 ++++++++++++++++++ 1 file changed, 2150 insertions(+) create mode 100644 SimMuL1/scripts/plotGlobalMuonTriggerRate.py diff --git a/SimMuL1/scripts/plotGlobalMuonTriggerRate.py b/SimMuL1/scripts/plotGlobalMuonTriggerRate.py new file mode 100644 index 0000000000000..e0932d5a4d59d --- /dev/null +++ b/SimMuL1/scripts/plotGlobalMuonTriggerRate.py @@ -0,0 +1,2150 @@ +from ROOT import * + +## run quiet mode +import sys +sys.argv.append( '-b' ) + +import ROOT +ROOT.gROOT.SetBatch(1) + +def getTriggerSF(): + """Calculate the factor to scale the trigger rate""" + + events = 238000 ## number of events + rate = 40000. ## the collision frequency [kHz] + bxwindow = 3. ##[-1,0,1] width of the bx window used to calculate the rates (see also the analyzer) + bxfilling = 0.795 ##average bx filling + trgScaleFactor = rate/events/bxwindow*bxfilling + return trgScaleFactor + +def Print(c, dirName, outFileName): + """Print the canvas""" + + gPad.RedrawAxis() + c.SaveAs("%s%s"%(dirName, outFileName)) + + +""" +TFile *f=0; +char pdir[111]=""; +char dir[111]="SimMuL1StrictAll"; + +TObject* NUL; + +TH1D *gh; +TH1D *ght; +TLegend *leg; + +TH1D* result_gem = 0; +TH1D* result_def = 0; +TH1D* result_def_2s = 0; +TH1D* result_def_3s1b = 0; + +TH1D* result_gem_2s1b = 0; +TH1D* result_def_2s1b = 0; + +TH1D* result_gem_eta_all = 0; +TH1D* result_def_eta_all = 0; +TH1D* result_def_eta_all_3s1b = 0; + +TH1D* result_gem_eta_no1a = 0; +TH1D* result_def_eta_no1a = 0; +TH1D* result_def_eta_no1a_3s1b = 0; + +TH1D* result_gmtsing = 0; + +// for later use +TH1D* result_def_2s__pat2 = 0; +TH1D* result_def_3s__pat2 = 0; +TH1D* result_def_2s1b__pat2 = 0; +TH1D* result_def_3s1b__pat2 = 0; +TH1D* result_def_2s__pat8 = 0; +TH1D* result_def_3s__pat8 = 0; +TH1D* result_def_2s1b__pat8 = 0; +TH1D* result_def_3s1b__pat8 = 0; + +TH1D* result_gmtsing__pat2 = 0; +TH1D* result_gmtsing__pat8 = 0; + +TH1D* result_gem_2s1b__pat2 = 0; +TH1D* result_gem_3s1b__pat2 = 0; +TH1D* result_gem_2s1b__pat8 = 0; +TH1D* result_gem_3s1b__pat8 = 0; + +TH1D* hAll100 = 0; + + +int interactive = 1; +bool do_not_print = false; + +TString gem_dir = "files/"; +TString gem_label = "gem98"; + + + +int gNPU=100; +int gNEvt=238000; +//int gNEvt=128000; +float gdy[2]={0.1,2500}; + +double ptscale[32] = { + -1., 0., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 6., 7., 8., 10., 12., 14., + 16., 18., 20., 25., 30., 35., 40., 45., 50., 60., 70., 80., 90., 100., 120., 140. +}; +const Double_t ptscaleb[31] = { + 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 6., 7., 8., 10., 12., 14., + 16., 18., 20., 25., 30., 35., 40., 45., 50., 60., 70., 80., 90., 100., 120., 140., 150. +}; +const Double_t ptscaleb_[31] = { + 1.25, 1.75, 2.25, 2.75, 3.25, 3.75, 4.25, 4.75, 5.5, 6.5, 7.5, 9., 11., 13., 15., + 17., 19., 22.5, 27.5, 32.5, 37.5, 42.5, 47.5, 55., 65., 75., 85., 95., 110., 130., 150. +}; + +void dpr(char *prc, int pu, char *suffix="") +//void dpr(char *prc, char *g, int pu, int st, char *suffix="") +{ + gNPU=pu; + char nm[300], fnm[300],onm[300]; + char spu[20]; + sprintf(spu,"%03d",pu); + //sprintf(nm,"%s_2_2_6_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); + //sprintf(nm,"%s_3_6_2_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); + //sprintf(nm,"%s_3_6_2_mu_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); + sprintf(nm,"%s_6_0_1_POSTLS161_V12__pu%s_w3%s",prc,spu,suffix); + sprintf(fnm,"../hp_%s.root",nm); + + sprintf(onm,"rttf_%s",nm); + drawplot_tfrt(fnm,"StrictChamber",onm); +} + + +TPaveStats* GetStat(TH1*h) +{ + TPaveStats* stat = (TPaveStats*)h->FindObject("stats"); + return stat; +} + +TPaveStats* SetOptStat(TH1*h,int op) +{ + TPaveStats* stat = GetStat(h); + stat->SetOptStat(op); + return stat; +} + + +TObject* getH(char dir[100], char name[100]) +{ + char nm[222]; + sprintf(nm,"%s/%s;1",dir,name); + return f->Get(nm); +} + +TObject* getH(TFile *fi, char dir[100], char name[100]) +{ + char nm[222]; + sprintf(nm,"%s/%s;1",dir,name); + return fi->Get(nm); +} + + + + +void myRebin(TH1D* h, int n) +{ + int nb = h->GetNbinsX(); + Double_t entr = h->GetEntries(); + Double_t bin0 = h->GetBinContent(0); + Double_t binN1 = h->GetBinContent(nb+1); + if (nb % n) binN1 += h->Integral(nb - nb%n + 1,nb); + h->Rebin(n); + nb = h->GetNbinsX(); + h->SetBinContent(0,bin0); + h->SetBinContent(nb+1,binN1); + h->SetEntries(entr); +} + +//########################################################################### +TH1D* setHistoPt(char *f_name, char *name, char *cname, char *title, + int lcolor, int lstyle, int lwidth) +//double *x_range, double *y_range) +{ + cout<<"opening "<GetXaxis()->GetNbins(); + + h = new TH1D(s_name+cname,title,30,ptscaleb); + for (int b=1 ; b<=nb; b++) { + double bc = h0->GetBinContent(b); + if (bc==0) continue; + int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); + //cout<SetBinContent(bin, bc); + } + //h->Sumw2(); + h->Scale(40000./gNEvt/3.*0.795); + + return h; +} + +TH1D* setHistoPtRaw(char *f_name, char *name, char *cname, char *title, + int lcolor, int lstyle, int lwidth) +//double *x_range, double *y_range) +{ + cout<<"opening "<GetXaxis()->GetNbins(); + h = (TH1D*)h0->Clone(s_name+cname); + //h->Sumw2(); + h->Scale(40000./gNEvt/3.*0.795); + + return h; +} + + +TH1D* setHisto2(char *f_name, char *name1, char *name2, char *cname, char *title, + int lcolor, int lstyle, int lwidth) +//double *x_range, double *y_range) +{ + cout<<"opening "<Clone(s_name+cname); + h0->Add(h2); + int nb = h0->GetXaxis()->GetNbins(); + + h = new TH1D(s_name+cname,title,30,ptscaleb); + for (int b=1 ; b<=nb; b++) { + double bc = h0->GetBinContent(b); + if (bc==0) continue; + int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); + //cout<SetBinContent(bin, bc); + } + for (int b=1 ; b<=30; b++) + h->SetBinContent(b, h->Integral(b,31)); + + /* + h = (TH1D*)h0->Clone(s_name+cname); + for (int b=1 ; b<=nb; b++) + h->SetBinContent(b, h0->Integral(b,nb+1)); + */ + + h->Sumw2(); + h->Scale(40000000./gNEvt/3.*0.795/10); + + h->SetLineColor(lcolor); + h->SetFillColor(lcolor); + h->SetLineStyle(lstyle); + h->SetLineWidth(lwidth); + + h->SetTitle(title); + //h->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); + //h->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); + + h->GetXaxis()->SetRangeUser(3,130); + h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); + //h->GetYaxis()->SetRangeUser(0.01,3000); + + h->GetXaxis()->SetMoreLogLabels(1); + + h->GetXaxis()->SetTitleSize(0.055); + h->GetXaxis()->SetTitleOffset(1.05); + h->GetXaxis()->SetLabelSize(0.045); + h->GetXaxis()->SetLabelOffset(0.003); + h->GetXaxis()->SetTitleFont(62); + h->GetXaxis()->SetLabelFont(62); + + h->GetYaxis()->SetTitleSize(0.055); + h->GetYaxis()->SetTitleOffset(0.9); + h->GetYaxis()->SetLabelSize(0.045); + h->GetYaxis()->SetTitleFont(62); + h->GetYaxis()->SetLabelFont(62); + + //h->GetYaxis()->SetLabelOffset(0.015); + + return h; +} + +""" + +def setHistoEta(f_name, name, cname, title, lcolor, lstyle, lwidth): + f = TFile.Open(f_name) + dirName = "SimMuL1StrictAll" + if not file: + sys.exit('Input ROOT file %s is missing.' %(f_name)) + h0 = f.Get("%s/%s"%(dirName,name)) + if not h0: + sys.exit("No such histogram") + + nb = h0.GetXaxis().GetNbins(); + h = h0.Clone("%s%s"%(name,cname)) + h.SetTitle(title) + h.Sumw2() + h.Scale(getTriggerSF()) + h.SetLineColor(lcolor) + ##h.SetFillColor(lcolor) + h.SetLineStyle(lstyle) + h.SetLineWidth(lwidth) + h.SetTitle(title) + ##h.GetXaxis().SetRangeUser(1.2, 2.4) + ##h.GetYaxis().SetRangeUser(gdy[0],gdy[1]) + h.GetYaxis().SetRangeUser(0,8) + h.GetXaxis().SetTitleSize(0.055) + h.GetXaxis().SetTitleOffset(1.05) + h.GetXaxis().SetLabelSize(0.045) + h.GetXaxis().SetLabelOffset(0.003) + h.GetXaxis().SetTitleFont(62) + h.GetXaxis().SetLabelFont(62) + h.GetXaxis().SetMoreLogLabels(1) + h.GetYaxis().SetTitleSize(0.055) + h.GetYaxis().SetTitleOffset(0.9) + h.GetYaxis().SetLabelSize(0.045) + h.GetYaxis().SetTitleFont(62) + h.GetYaxis().SetLabelFont(62) + ##h.GetYaxis().SetLabelOffset(0.015) + + return h + + +def setHistoRatio(num, denom, title = "", ymin=0.4, ymax=1.6, color = kRed+3): + + ratio = num.Clone("%s__%s_ratio"%(num.GetName(), denom.GetName())) + ratio.Divide(num, denom, 1., 1.) + ratio.SetTitle(title) + + ratio.GetYaxis().SetRangeUser(ymin, ymax) + ratio.GetYaxis().SetTitle("ratio: (with GEM)/default") + ratio.GetYaxis().SetTitle("ratio") + ## ratio.GetYaxis().SetTitle("(ME1/b + GEM) / ME1/b") + ratio.GetYaxis().SetTitleSize(.14) + ## ratio.GetYaxis().SetTitleSize(.1) + ratio.GetYaxis().SetTitleOffset(0.4) + ratio.GetYaxis().SetLabelSize(.11) + + + ## ratio.GetXaxis().SetMoreLogLabels(1) + ratio.GetXaxis().SetTitle("p_{T}^{cut} [GeV/c]") + ratio.GetXaxis().SetLabelSize(.11) + ratio.GetXaxis().SetTitleSize(.14) + ratio.GetXaxis().SetTitleOffset(1.3) + ratio.SetLineWidth(2) + ratio.SetFillColor(color) + ratio.SetLineColor(color) + ratio.SetMarkerColor(color) + ratio.SetMarkerStyle(20) + ##ratio.Draw("e3") + + return ratio + + + +""" + + +TH1D* getPTHisto(TString f_name, TString dir_name, TString h_name, TString clone_suffix = "_cln") +{ + f = TFile::Open(f_name) + //cout<Get(dir_name + "/" + h_name)->Clone(h_name + clone_suffix); + return h0; +} + +TH1D* setPTHisto(TH1D* h0, TString title, int lcolor, int lstyle, int lwidth) +{ + int nb = h0->GetXaxis()->GetNbins(); + + h = new TH1D(Form("%s_varpt", h0->GetName()), title, 30, ptscaleb_); + for (int b=1 ; b<=nb; b++) { + double bc = h0->GetBinContent(b); + if (bc==0) continue; + int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); + //cout<GetBinCenter(b)<<" -> "<SetBinContent(bin, bc); + } + for (int b=1 ; b<=30; b++) + h->SetBinContent(b, h->Integral(b,31)); + + h->Sumw2(); + h->Scale(40000./gNEvt/3.*0.795); + + h->SetLineColor(lcolor); + h->SetFillColor(lcolor); + h->SetLineStyle(lstyle); + h->SetLineWidth(lwidth); + + h->SetTitle(title); + + h->GetXaxis()->SetRangeUser(2, 129.); + h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); + + h->GetXaxis()->SetTitleSize(0.055); + h->GetXaxis()->SetTitleOffset(1.05); + h->GetXaxis()->SetLabelSize(0.045); + h->GetXaxis()->SetLabelOffset(0.003); + h->GetXaxis()->SetTitleFont(62); + h->GetXaxis()->SetLabelFont(62); + h->GetXaxis()->SetMoreLogLabels(1); + + h->GetYaxis()->SetTitleSize(0.055); + h->GetYaxis()->SetTitleOffset(0.9); + h->GetYaxis()->SetLabelSize(0.045); + h->GetYaxis()->SetTitleFont(62); + h->GetYaxis()->SetLabelFont(62); + + return h; +} + +TH1D* setPTHisto(TString f_name, TString dir_name, TString h_name, TString clone_suffix, + TString title, int lcolor, int lstyle, int lwidth) +{ + TH1D* h0 = getPTHisto(f_name, dir_name, h_name, clone_suffix); + return setPTHisto(h0, title, lcolor, lstyle, lwidth); +} + + + + +TH1D* setHisto(TString f_name, char *name, char *cname, char *title, + int lcolor, int lstyle, int lwidth) +{ + cout<<"opening "<GetXaxis()->GetNbins(); + + h = new TH1D(s_name+cname,title,30,ptscaleb_); + for (int b=1 ; b<=nb; b++) { + double bc = h0->GetBinContent(b); + if (bc==0) continue; + int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); + //cout<GetBinCenter(b)<<" -> "<SetBinContent(bin, bc); + } + for (int b=1 ; b<=30; b++) + h->SetBinContent(b, h->Integral(b,31)); + + /* + h = (TH1D*)h0->Clone(s_name+cname); + for (int b=1 ; b<=nb; b++) + h->SetBinContent(b, h0->Integral(b,nb+1)); + */ + + h->Sumw2(); + h->Scale(40000./gNEvt/3.*0.795); + + h->SetLineColor(lcolor); + h->SetFillColor(lcolor); + h->SetLineStyle(lstyle); + h->SetLineWidth(lwidth); + + h->SetTitle(title); + + h->GetXaxis()->SetRangeUser(2, 129.); + h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); + + h->GetXaxis()->SetTitleSize(0.055); + h->GetXaxis()->SetTitleOffset(1.05); + h->GetXaxis()->SetLabelSize(0.045); + h->GetXaxis()->SetLabelOffset(0.003); + h->GetXaxis()->SetTitleFont(62); + h->GetXaxis()->SetLabelFont(62); + h->GetXaxis()->SetMoreLogLabels(1); + + h->GetYaxis()->SetTitleSize(0.055); + h->GetYaxis()->SetTitleOffset(0.9); + h->GetYaxis()->SetLabelSize(0.045); + h->GetYaxis()->SetTitleFont(62); + h->GetYaxis()->SetLabelFont(62); + + //h->GetYaxis()->SetLabelOffset(0.015); + + return h; +} + + +TH1D* setHistoRatio2(TH1D* num, TH1D* denom, TString title = "", double ymin=0.4, double ymax=1.6) +{ + ratio = (TH1D*) num->Clone(Form("%s--%s_ratio",num->GetName(),denom->GetName()) ); + ratio->Divide(num, denom, 1., 1.); + ratio->SetTitle(title); + ratio->GetYaxis()->SetRangeUser(ymin, ymax); + ratio->GetYaxis()->SetTitle("ratio: stub (ME1b&ME1a)/only ME1b"); + ratio->GetYaxis()->SetLabelSize(0.07); + ratio->GetYaxis()->SetTitleSize(0.07); + ratio->GetYaxis()->SetTitleOffset(0.6); + ratio->GetXaxis()->SetMoreLogLabels(1); + ratio->SetLineWidth(2); + ratio->SetFillColor(kRed+3); + ratio->SetLineColor(kRed+3); + ratio->SetMarkerColor(kRed+3); + ratio->SetMarkerStyle(20); + //ratio->Draw("e3"); + + return ratio; +} + + + +TH1D* getEnrichRate() +{ + f = TFile::Open("meb1_genpt4_EnrichMu_st.root"); + TTree *tr = (TTree*) f->Get("SimTrackAna/trk"); + tr->Draw("pt>>pppt()"); +} + + + +TH1D* getEffHisto(TString fname, TString hdir, TString num_name, TString den_name, int nrebin, int lcolor, int lstyle, int lwidth, + TString title, double *x_range, double *y_range) +{ + TFile *fh = TFile::Open(fname); + + TH1D* hd0 = (TH1D*)fh->Get(hdir + "/" + den_name); + TH1D* hn0 = (TH1D*)fh->Get(hdir + "/" + num_name); + + TH1D* hd = (TH1D*)hd0->Clone(den_name+"_cln_"+fname); + TH1D* hn = (TH1D*)hn0->Clone(num_name+"_cln_"+fname); + hd->Sumw2(); + hn->Sumw2(); + + myRebin(hd, nrebin); + myRebin(hn, nrebin); + + TH1D* heff = (TH1D*)hn->Clone(num_name+"_eff_"+fname); + + hd->Sumw2(); + heff->Sumw2(); + + heff->Divide(heff,hd); + + heff->SetLineColor(lcolor); + heff->SetLineStyle(lstyle); + heff->SetLineWidth(lwidth); + + heff->SetTitle(title); + //heff->GetXaxis()->SetTitle(xtitle); + //heff->GetYaxis()->SetTitle(ytitle); + heff->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); + heff->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); + + heff->GetXaxis()->SetTitleSize(0.07); + heff->GetXaxis()->SetTitleOffset(0.7); + heff->GetYaxis()->SetLabelOffset(0.015); + + heff->GetXaxis()->SetLabelSize(0.05); + heff->GetYaxis()->SetLabelSize(0.05); + + h1 = hn0; + h2 = hd0; + he = heff; + + //fh->Close(); + return heff; +} + + +TLatex* drawPULabel(float x=0.17, float y=0.25, float font_size=0.) +{ + TLatex * tex = new TLatex(x, y,"BX = 25 ns, PU = 100"); + if (font_size > 0.) tex->SetFontSize(font_size); + tex->SetTextSize(0.04); + tex->SetNDC(); + tex->Draw(); + return tex; +} +""" + +def etaTriggerRate(filesDir, plotDir, ext): + """Produce trigger rate plots versus eta.""" + + gStyle.SetOptStat(0) + gStyle.SetTitleStyle(0) + ##gStyle.SetPadTopMargin(0.08) + gStyle.SetTitleH(0.06) + + hdir = "SimMuL1StrictAll" + + f_def = "%shp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"%(filesDir) + f_g98_pt10 = "%shp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt10_pat2.root"%(filesDir) + f_g98_pt15 = "%shp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt15_pat2.root"%(filesDir) + f_g98_pt20 = "%shp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt20_pat2.root"%(filesDir) + f_g98_pt30 = "%shp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat2.root"%(filesDir) + f_g98_pt40 = "%shp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat2.root"%(filesDir) + + htitle = "Efficiency for #mu in 1.6<|#eta|<2.12 to have TF track;p_{T}^{MC} [GeV/c]" + + minpt = 10 + ttl = "CSC L1 trigger rates for p_{T}^{TF}>%d GeV/c;track #eta;rate/bin [kHz]"%(minpt) + + h_rt_def_tf10_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); + h_rt_def_tf10_2s_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s_2s1b"%(minpt), "_hAll100", ttl, kAzure+5, 1, 2); + h_rt_def_tf10_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s"%(minpt), "_hAll100", ttl, kAzure+3, 1, 2); + h_rt_def_tf10_3s_no1a = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_no1a"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); + h_rt_def_tf10_3s_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_1b"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); + h_rt_def_tf10_3s_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_2s1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_def_tf10_3s_2s1b_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_2s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_def_tf10_3s_2s1b_no1a = setHistoEta(f_def,"h_rt_gmt_csc_ptmax%d_eta_3s_2s1b_no1a"%(minpt),"_hAll100", ttl, kAzure+3, 7, 2); + h_rt_def_tf10_3s_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_def_tf10_3s_3s1b_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_def_tf10_3s_3s1b_no1a = setHistoEta(f_def,"h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_no1a"%(minpt),"_hAll100", ttl, kAzure+3, 7, 2); + + minpt = 20 + ttl = "CSC L1 trigger rates for p_{T}^{TF}>%d GeV/c;track #eta;rate/bin [kHz]"%(minpt) + + h_rt_def_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); + h_rt_def_tf20_2s_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s_2s1b"%(minpt), "_hAll100", ttl, kAzure+5, 1, 2); + h_rt_def_tf20_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s"%(minpt), "_hAll100", ttl, kAzure+3, 1, 2); + h_rt_def_tf20_3s_no1a = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_no1a"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); + h_rt_def_tf20_3s_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_1b"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); + h_rt_def_tf20_3s_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_2s1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_def_tf20_3s_2s1b_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_2s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_def_tf20_3s_2s1b_no1a = setHistoEta(f_def,"h_rt_gmt_csc_ptmax%d_eta_3s_2s1b_no1a"%(minpt),"_hAll100", ttl, kAzure+3, 7, 2); + h_rt_def_tf20_3s_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_def_tf20_3s_3s1b_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_def_tf20_3s_3s1b_no1a = setHistoEta(f_def,"h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_no1a"%(minpt),"_hAll100", ttl, kAzure+3, 7, 2); + + h_rt_def_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); + h_rt_def_tf20_2s_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s_2s1b"%(minpt), "_hAll100", ttl, kAzure+5, 1, 2); + h_rt_def_tf20_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s"%(minpt), "_hAll100", ttl, kAzure+3, 1, 2); + h_rt_def_tf20_3s_no1a = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_no1a"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); + h_rt_def_tf20_3s_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_1b"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); + h_rt_def_tf20_3s_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_2s1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_def_tf20_3s_2s1b_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_2s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_def_tf20_3s_2s1b_no1a = setHistoEta(f_def,"h_rt_gmt_csc_ptmax%d_eta_3s_2s1b_no1a"%(minpt),"_hAll100", ttl, kAzure+3, 7, 2); + h_rt_def_tf20_3s_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_def_tf20_3s_3s1b_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_def_tf20_3s_3s1b_no1a = setHistoEta(f_def,"h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_no1a"%(minpt),"_hAll100", ttl, kAzure+3, 7, 2); + + minpt = 30 + ttl = "CSC L1 trigger rates for p_{T}^{TF}>%d GeV/c;track #eta;rate/bin [kHz]"%(minpt) + + h_rt_def_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s"%(minpt), "_hAll300", ttl, kAzure+2, 1, 2); + h_rt_def_tf30_2s_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s_2s1b"%(minpt), "_hAll100", ttl, kAzure+5, 1, 2); + h_rt_def_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s"%(minpt), "_hAll100", ttl, kAzure+3, 1, 2); + h_rt_def_tf30_3s_no1a = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_no1a"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); + h_rt_def_tf30_3s_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_1b"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); + h_rt_def_tf30_3s_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_2s1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_def_tf30_3s_2s1b_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_2s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_def_tf30_3s_2s1b_no1a = setHistoEta(f_def,"h_rt_gmt_csc_ptmax%d_eta_3s_2s1b_no1a"%(minpt),"_hAll100", ttl, kAzure+3, 7, 2); + h_rt_def_tf30_3s_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_def_tf30_3s_3s1b_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_def_tf30_3s_3s1b_no1a = setHistoEta(f_def,"h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_no1a"%(minpt),"_hAll100", ttl, kAzure+3, 7, 2); + + + + + + h_rt_tf20_gpt20_2s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax%d_eta_2s_2s1b"%(minpt), "_hAll100", ttl, kGreen+1, 7, 2); + h_rt_tf20_gpt20_3s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b"%(minpt), "_hAll100", ttl, kGreen+3, 7, 2); + h_rt_tf20_gpt20_3s1b_1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_tf20_gpt20_3s1b_no1a = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_no1a"%(minpt), "_hAll100", ttl, kAzure+3, 7, 2); + + ## h_rt_tf20_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1ab"%(minpt), "_hAll100", ttl, kBlue, 1, 2); + ## h_rt_tf20_gpt20_3s1ab = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1ab"%(minpt), "_hAll100", ttl, kRed, 7, 2); + + +""" + c = TCanvas("c","c",800,600) + c.SetLogy(1) + + miny = 0.01 + maxy = 300 + + h_rt_tf20_2s.GetYaxis().SetRangeUser(miny,maxy) + h_rt_tf20_2s1b.GetYaxis().SetRangeUser(miny,maxy) + h_rt_tf20_gpt20_2s1b.GetYaxis().SetRangeUser(miny,maxy) + + h_rt_tf20_2s.Draw("hist e1") + h_rt_tf20_2s1b.Draw("hist e1 same") + h_rt_tf20_gpt20_2s1b.Draw("hist e1 same") + + leg = TLegend(0.4,0.63,.98,0.90,"","brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.AddEntry(h_rt_tf20_2s,"Tracks: p_{T}>=20, 2+ stubs","") + leg.AddEntry(h_rt_tf20_2s,"anywhere","l") + leg.AddEntry(h_rt_tf20_2s1b,"with ME1 in 1.6<|#eta|<2.14","l") + leg.AddEntry(h_rt_tf20_gpt20_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l") + leg.Draw() + + tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}") + tex.SetNDC() + tex.Draw("same") + + Print(c, plotDir, "rates__vs_eta__minpt%s__PU100__def-2s-2s1b__gem-2s-2s1b%s"%(minpt,ext)) + + ## Ratio plot + cAll100r = TCanvas("cAll100r","cAll100r",800,300) + gPad.SetGridx(1) + gPad.SetGridy(1) + gem_ratio = setHistoRatio(h_rt_tf20_gpt20_2s1b, h_rt_tf20_2s1b, "", 0.,1.8) + gem_ratio.Draw("e1") + + Print(cAll100r, plotDir, "rates__vs_eta__minpt%d__PU100__def-2s-2s1b__gem-2s-2s1b__ratio%s"%(minpt, ext)) + + + ##======================== 3+ Stubs ================================// + + c.Clear() + c.cd() + + maxy = 30 + h_rt_tf20_3s.GetYaxis().SetRangeUser(miny,maxy) + h_rt_tf20_3s1b.GetYaxis().SetRangeUser(miny,maxy) + h_rt_tf20_gpt20_3s1b.GetYaxis().SetRangeUser(miny,maxy) + + h_rt_tf20_3s.Draw("hist e1") + h_rt_tf20_gpt20_3s1b.Draw("hist e1 same") + h_rt_tf20_3s.Draw("hist e1 same") + h_rt_tf20_3s1b.Draw("hist e1 same") + + + + leg = TLegend(0.4,0.63,.98,0.90,"","brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs","") + leg.AddEntry(h_rt_tf20_3s,"anywhere","l") + leg.AddEntry(h_rt_tf20_3s1b,"with ME1 in 1.6<|#eta|<2.14","l") + leg.AddEntry(h_rt_tf20_gpt20_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l") + leg.Draw() + + tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}") + tex.SetNDC() + tex.Draw() + + Print(c, plotDir, "rates__vs_eta__minpt%s__PU100__def-3s-3s1b__gem-3s-3s1b%s"%(minpt,ext)) + + + cAll100r = TCanvas("cAll100r","cAll100r",800,300) + gPad.SetGridx(1) + gPad.SetGridy(1) + gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1b, h_rt_tf20_3s1b, "", 0.,1.8) + gem_ratio.Draw("e1") + + Print(cAll100r, plotDir, "rates__vs_eta__minpt%d__PU100__def-3s-3s1b__gem-3s-3s1b__ratio%s"%(minpt, ext)) + + + + ##========================= Comparing default with/without stub in ME1a ============================================== + + + c.Clear() + c.cd() + h_rt_tf20_3s1b.Draw("hist e1") + h_rt_tf20_3s.Draw("same hist e1") + h_rt_tf20_3s1b_1b.Draw("same hist e1") + h_rt_tf20_3s1b_no1a.Draw("same hist e1") + + h_rt_tf20_3s1b_1b.SetLineColor(kRed) + h_rt_tf20_3s1b_no1a.SetLineColor(kGreen+2) + h_rt_tf20_3s1b_1b.GetYaxis().SetRangeUser(miny,maxy) + h_rt_tf20_gpt20_3s1b_no1a.GetYaxis().SetRangeUser(miny,maxy) + + +# h_rt_tf20_3s1ab.Draw("hist e1 same") + + leg = TLegend(0.25,0.65,.85,0.90,"","brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.AddEntry(h_rt_tf20_3s1b,"Tracks: p_{T}>=20, 3+ stubs","") + leg.AddEntry(h_rt_tf20_3s1b,"Requiring stub in ME1b","l") + ## leg.AddEntry(h_rt_tf20_3s1ab,"Requiring stub in ME1b and ME1a","l") + leg.Draw() + + tex = TLatex(0.15, 0.85,"#splitline{L=4*10^{34}}{(25ns PU100)}") + tex.SetNDC() + tex.Draw() + + Print(c, plotDir, "test.pdf") + ##)rates__vs_eta__minpt%s__PU100__def-3s-3s1b__def-3s-3s1b_compstubME1a%s"%(minpt,ext) + + cAll100r = TCanvas("cAll100r","cAll100r",800,300) + gPad.SetGridx(1) + gPad.SetGridy(1) + gem_ratio = setHistoRatio(h_rt_tf20_3s1ab, h_rt_tf20_3s1b, "", 0.,1.8) + gem_ratio.Draw("e1") + + Print(cAll100r, plotDir, "rates__vs_eta__minpt%d__PU100__def-3s-3s1b__gem-3s-3s1b__ratio_compstubME1a%s"%(minpt, ext)) + + + + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + + // maxy = 30.;//10; + + // h_rt_tf20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf20_gpt20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf20_3s->Draw("hist e1"); + // h_rt_tf20_gpt20_3s1ab->Draw("hist e1 same"); + // h_rt_tf20_3s->Draw("hist e1 same"); + // h_rt_tf20_3s1ab->Draw("hist e1 same"); + + + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,"","brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); + // leg->AddEntry(h_rt_tf20_3s,"anywhere","l"); + // leg->AddEntry(h_rt_tf20_3s1ab,"with ME1 in 1.6<|#eta|","l"); + // leg->AddEntry(h_rt_tf20_gpt20_3s1ab,"with (ME1+GEM) in 1.6<|#eta|","l"); + // leg->Draw(); + + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); + + + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1ab, h_rt_tf20_3s1ab, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); + + + + + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf20_gpt20_3s1b->Draw("hist e1"); + // h_rt_tf20_gpt20_3s1ab->Draw("hist e1 same"); + + // TLegend *leg = new TLegend(0.25,0.65,.85,0.90,"","brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf20_gpt20_3s1b,"Tracks: p_{T}>=20, 3+ stubs",""); + // leg->AddEntry(h_rt_tf20_gpt20_3s1b,"Requiring stub in ME1b (ME1+GEM)","l"); + // leg->AddEntry(h_rt_tf20_gpt20_3s1ab,"Requiring stub in ME1b and ME1a (ME1+GEM)","l"); + // leg->Draw(); + + // TLatex * tex = new TLatex(0.15, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__gme-3s-3s1b__gem-3s-3s1b_compstubME1a.png").Data()); + + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1ab, h_rt_tf20_gpt20_3s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__gem-3s-3s1b__gem-3s-3s1b__ratio_compstubME1a.png").Data()); + + + + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf20_3s1ab->Draw("hist e1"); + // h_rt_tf20_gpt20_3s1ab->Draw("hist e1 same"); + + // TLegend *leg = new TLegend(0.25,0.65,.85,0.90,"","brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf20_3s1ab,"Tracks: p_{T}>=20, 3+ stubs",""); + // leg->AddEntry(h_rt_tf20_3s1ab,"Requiring stub in ME1b","l"); + // leg->AddEntry(h_rt_tf20_gpt20_3s1ab,"Requiring stub in ME1b and ME1a (ME1+GEMs)","l"); + // leg->Draw(); + + // TLatex * tex = new TLatex(0.15, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b_compstubME1a.png").Data()); + + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1ab, h_rt_tf20_3s1ab, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio_compstubME1a.png").Data()); + + + //********************************** TF track pT>30 GeV ************************************************// + + vs_eta_minpt = "30"; + ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin, kHz"; + + // TH1D* h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); + // TH1D* h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); + // TH1D* h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); + + + TH1D* h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); + TH1D* h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); + TH1D* h_rt_tf30_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kAzure+2, 1, 2); + TH1D* h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); + TH1D* h_rt_tf30_gpt30_3s1ab = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kRed, 7, 2); + + + // // maxy = 120.;//35.; + // // h_rt_tf30_2s->GetYaxis()->SetRangeUser(miny,maxy); + // // h_rt_tf30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + // // h_rt_tf30_gpt30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + + + // TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + // cAll100->SetLogy(1); + // // h_rt_tf30_2s->Draw("hist e1"); + // // h_rt_tf30_gpt30_2s1b->Draw("hist e1 same"); + // // h_rt_tf30_2s->Draw("hist e1 same"); + // // h_rt_tf30_2s1b->Draw("hist e1 same"); + + // // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,"","brNDC"); + // // leg->SetBorderSize(0); + // // leg->SetFillStyle(0); + // // leg->AddEntry(h_rt_tf30_2s,"Tracks: p_{T}>=30, 2+ stubs",""); + // // leg->AddEntry(h_rt_tf30_2s,"anywhere","l"); + // // leg->AddEntry(h_rt_tf30_2s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + // // leg->AddEntry(h_rt_tf30_gpt30_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // // leg->Draw(); + + // // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // // tex->SetNDC(); + // // tex->Draw(); + + // // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); + + + // // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // // gPad->SetGridx(1);gPad->SetGridy(1); + + // // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_2s1b, h_rt_tf30_2s1b, "", 0.,1.8); + // // gem_ratio->Draw("e1"); + + // // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b__ratio.png").Data()); + + + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + + maxy = 30.;//7.; + h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf30_gpt30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf30_3s->Draw("hist e1"); + // h_rt_tf30_gpt30_3s1b->Draw("hist e1 same"); + // h_rt_tf30_3s->Draw("hist e1 same"); + // h_rt_tf30_3s1b->Draw("hist e1 same"); + + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,"","brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); + // leg->AddEntry(h_rt_tf30_3s,"anywhere","l"); + // leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + // leg->AddEntry(h_rt_tf30_gpt30_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // leg->Draw(); + + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); + + + + + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1b, h_rt_tf30_3s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); + + + + + + // //========================== Including the ME1a + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + + h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf30_gpt30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf30_gpt30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf30_3s->Draw("hist e1"); + // h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same"); + // h_rt_tf30_3s->Draw("hist e1 same"); + // h_rt_tf30_3s1ab->Draw("hist e1 same"); + + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,"","brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + + // leg->AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); + // leg->AddEntry(h_rt_tf30_3s,"anywhere","l"); + // leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|","l"); + // leg->AddEntry(h_rt_tf30_gpt30_3s1ab,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // leg->Draw(); + + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); + + // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1ab, h_rt_tf30_3s1ab, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); + + + + //========================== Comparison with/without Stub in ME1a ==========================// + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + + // h_rt_tf30_3s1b->Draw("hist e1"); + // h_rt_tf30_3s1ab->Draw("hist e1 same"); + + // TLegend *leg = new TLegend(0.25,0.65,.85,0.90,"","brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf30_3s1b,"Tracks: p_{T}>=30, 3+ stubs",""); + // leg->AddEntry(h_rt_tf30_3s1b,"Requiring stub in ME1b","l"); + // leg->AddEntry(h_rt_tf30_3s1ab,"Requiring stub in ME1b and ME1a ","l"); + // leg->Draw(); + + // TLatex * tex = new TLatex(0.15, 0.85,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); + + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__compstubME1a.png").Data()); + + + // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio2(h_rt_tf30_3s1ab, h_rt_tf30_3s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__ratio_compstubME1a.png").Data()); + + + // //========================== Comparison with/withous Stub in ME1a + GEMS ==========================// + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + + // h_rt_tf30_gpt30_3s1b->Draw("hist e1"); + // h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same "); + + // TLegend *leg = new TLegend(0.25,0.65,.85,0.90,"","brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf30_gpt30_3s1b,"Tracks: p_{T}>=30, 3+ stubs" ,""); + // leg->AddEntry(h_rt_tf30_gpt30_3s1b,"Requiring stub in ME1b (ME1+GEM)","l"); + // leg->AddEntry(h_rt_tf30_gpt30_3s1ab,"Requiring stub in ME1b and ME1a (ME1+GEM) ","l"); + // leg->Draw(); + + // TLatex * tex = new TLatex(0.15, 0.85,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__gem-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); + + // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio2(h_rt_tf30_gpt30_3s1ab, h_rt_tf30_gpt30_3s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__gem-3s-3s1ab__gem-3s-3s1ab__ratio_compstubME1a.png").Data()); + + + // //========================== Comparison with stubs in ME1a CSC/CSC+GEMS ==========================// + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + + // h_rt_tf30_3s1ab->Draw("hist e1"); + // h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same"); + + // TLegend *leg = new TLegend(0.25,0.65,.85,0.90,"","brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf30_3s1ab,"Tracks: p_{T}>=30, 3+ stubs, 1 stub in ME1b or ME1a",""); + // leg->AddEntry(h_rt_tf30_3s1ab,"Requiring stub in ME1b and ME1a ","l"); + // leg->AddEntry(h_rt_tf30_gpt30_3s1ab,"Requiring stub in ME1b and ME1a (ME1+GEM)","l"); + // leg->Draw(); + + // TLatex * tex = new TLatex(0.15, 0.85,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); + + + // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1ab, h_rt_tf30_3s1ab, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio_compstubME1a.png").Data()); + + + + + + + +} + +def etaTriggerRates(filesDir, plotDir, ext): + Produce trigger rate plots versus eta for pt values and specific patterns + + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt10_pat2.root', plotDir, ext) + + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt15_pat2.root', plotDir, ext) + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt20_pat2.root', plotDir, ext) + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt30_pat2.root', plotDir, ext) + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt40_pat2.root', plotDir, ext) + + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt10_pat8.root', plotDir, ext) + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt15_pat8.root', plotDir, ext) + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt20_pat8.root', plotDir, ext) + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt30_pat8.root', plotDir, ext) + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt40_pat8.root', plotDir, ext) + + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt10_pat2.root', plotDir, ext) + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt15_pat2.root', plotDir, ext) + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt20_pat2.root', plotDir, ext) + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat2.root', plotDir, ext) + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat2.root', plotDir, ext) + + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt10_pat8.root', plotDir, ext) + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt15_pat8.root', plotDir, ext) + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt20_pat8.root', plotDir, ext) + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat8.root', plotDir, ext) + etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat8.root', plotDir, ext) + + """ + +""" +/* +//########################################################################### +//########################################################################### + +//void drawplot_gmtrt(char *fname, char *dname="tf") +void drawplot_gmtrt(TString dname = "", TString vs_eta_minpt = "") +{ + + bool vs_eta = false; + if (vs_eta_minpt.Length() > 0) vs_eta = true; + + // directory for plots is made as + // pdir = $PWD/pic[_{dname}]_{pu} + + //gStyle->SetStatW(0.13); + //gStyle->SetStatH(0.08); + gStyle->SetStatW(0.07); + gStyle->SetStatH(0.06); + + gStyle->SetOptStat(0); + + gStyle->SetTitleStyle(0); + gStyle->SetTitleAlign(13);// coord in top left + gStyle->SetTitleX(0.); + gStyle->SetTitleY(1.); + gStyle->SetTitleW(1); + gStyle->SetTitleH(0.058); + gStyle->SetTitleBorderSize(0); + + gStyle->SetPadLeftMargin(0.126); + gStyle->SetPadRightMargin(0.04); + gStyle->SetPadTopMargin(0.06); + gStyle->SetPadBottomMargin(0.13); + + gStyle->SetMarkerStyle(1); + + + + char d1[111]="",d2[111]=""; + if (dname != "") sprintf(d1,"_%s", dname.Data()); + //if (strcmp(pu,"")>0) sprintf(d2,"_%s",pu); + //sprintf(pdir,"pic%s%s",d1,d2); + + if (interactive && dname != "") { + sprintf(pdir,"pic%s%s",d1,d2); + if( gSystem->AccessPathName(pdir)==0 ) { + //cout<<"directory "<Exec(cmd) != 0) {cout<<"can't remode directory! exiting..."<MakeDirectory(pdir); + } + } + + //cout<<"opening "<Get("SimMuL1/;1"); + + char f_pu050_me42_re4[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + char f_pu050_re4[200] ="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; + char f_pu050[200] ="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; + char f_pu050_me42_rev1[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rev1_rpc.root"; + char f_pu050_me42_rev2[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rev2_rpc.root"; + + + char f_pu050_hneu_me42_re4[200]="hp_minbias_3_6_2_hnpu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + char f_pu050_neu_me42_re4[200]="hp_minbias_3_6_2_npu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + + + char f_pu200_hneu_me42_re4[200]="hp_minbias_3_6_2_hnpu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + char f_pu200_rneu_me42_re4[200]="hp_minbias_3_6_2_rnpu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + + char f_pu200_neu_me42_re4[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + char f_pu200_me42_re4[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + + char f_pu200_neu_re4[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; + char f_pu200_re4[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; + hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat8.root + char f_pu200_neu[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; + char f_pu200[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; + + + + + TString f_pu100_pat8 = gem_dir; + TString f_pu100_pat8_gem = gem_dir; + + //TString f_pu100_pat2 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat2.root"; + //TString f_pu100_pat8 ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat8.root"; + //TString f_pu100_pat2_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat2.root"; + //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat8.root"; + + //TString f_pu100_pat8 ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat2.root"; + //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat2.root"; + + + if (dname.Contains("_pat8")) f_pu100_pat8 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root"; + if (dname == "minbias_pt05_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat8.root"; + if (dname == "minbias_pt06_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat8.root"; + if (dname == "minbias_pt10_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat8.root"; + if (dname == "minbias_pt15_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat8.root"; + if (dname == "minbias_pt20_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat8.root"; + if (dname == "minbias_pt30_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat8.root"; + if (dname == "minbias_pt40_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat8.root"; + + if (dname.Contains("_pat2")) f_pu100_pat8 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; + if (dname == "minbias_pt05_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat2.root"; + if (dname == "minbias_pt06_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat2.root"; + if (dname == "minbias_pt10_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat2.root"; + if (dname == "minbias_pt15_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat2.root"; + if (dname == "minbias_pt20_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat2.root"; + if (dname == "minbias_pt30_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat2.root"; + if (dname == "minbias_pt40_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat2.root"; + + //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemx_pt20_pat2.root"; + //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemOldx_pt20_pat2.root"; + //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemOld_pt20_pat2.root"; + + + bool do_return = false; + + + + //#################################### PU100 #################################### + + // full eta 1. - 2.4 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b + if (vs_eta) + { + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin, kHz"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + hAll100->Draw("hist e1"); + hAll100gem->Draw("hist e1 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","l"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); + leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-2s1b__gem-3s-2s1b.png").Data()); + + if (do_return) return; + } + + + + // full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b + if (vs_eta) + { + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin, kHz"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + hAll100->Draw("hist e1"); + hAll100gem->Draw("hist e1 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","l"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"in ME1/b region also require",""); + leg_cc100->AddEntry(hAll100,"one stub to be from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); + + if (do_return) return; + } + + // full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b + if (vs_eta) + { + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin, kHz"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + hAll100->Draw("hist e1"); + hAll100gem->Draw("hist e1 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","l"); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); + leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-2s1b.png").Data()); + + if (do_return) return; + } + + + // full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b + if (vs_eta) + { + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin, kHz"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + hAll100->Draw("hist e1"); + hAll100gem->Draw("hist e1 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","l"); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"in ME1/b region also require",""); + leg_cc100->AddEntry(hAll100,"one stub to be from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-3s1b.png").Data()); + + if (do_return) return; + } + + + if (vs_eta) return; + + + + // full eta 1. - 2.4 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); + leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, "rates__1-2.4__PU100__def-3s-2s1b__gem-3s-2s1b.png"); + + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1);//gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.4); + hAll100gem_ratio->Draw("e1"); + + Print(cAll100r, "rates__1-2.4__PU100__def-3s-2s1b__gem-3s-2s1b__ratio.png"); + + if (do_return) return; + } + + + + // full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks: same, except in ME1/b region req.",""); + leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, "rates__1-2.4__PU100__def-3s__gem-3s-2s1b.png"); + + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1);//gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); + hAll100gem_ratio->Draw("e1"); + + Print(cAll100r, "rates__1-2.4__PU100__def-3s__gem-3s-2s1b__ratio.png"); + + if (do_return) return; + } + + + + // no ME1/a eta 1. - 2.1 Default: 3station GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_no1a", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.1",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks: same, except in ME1/b region req.",""); + leg_cc100->AddEntry(hAll100,">=3 stubs and one of them from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, "rates__1-2.1__PU100__def-3s__gem-3s-3s1b.png"); + + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); + hAll100gem_ratio->Draw("e1"); + + Print(cAll100r, "rates__1-2.1__PU100__def-3s__gem-3s-3s1b__ratio.png"); + + + result_gem_eta_no1a = hAll100gem; + result_def_eta_no1a = hAll100; + + if (do_return) return; + } + + + // no ME1/a eta 1. - 2.1 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1<|#eta|<2.1",""); + leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, "rates__1-2.1__PU100__def-3s-3s1b__gem-3s-3s1b.png"); + + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); + hAll100gem_ratio->Draw("e1"); + + Print(cAll100r, "rates__1-2.1__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); + + //result_gem_eta_no1a = hAll100gem; + result_def_eta_no1a_3s1b = hAll100; + + if (do_return) return; + } + + + // Full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks: same, except",""); + leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, "rates__1-2.4__PU100__def-3s__gem-3s-3s1b.png"); + + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); + hAll100gem_ratio->Draw("e1"); + + Print(cAll100r, "rates__1-2.4__PU100__def-3s__gem-3s-3s1b__ratio.png"); + + result_gem_eta_all = hAll100gem; + result_def_eta_all = hAll100; + + if (do_return) return; + } + + + + // Full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, "rates__1-2.4__PU100__def-3s-3s1b__gem-3s-3s1b.png"); + + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.6); + hAll100gem_ratio->Draw(); + + Print(cAll100r, "rates__1-2.4__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); + + //result_gem_eta_all = hAll100gem; + result_def_eta_all_3s1b = hAll100; + + if (do_return) return; + } + + + + // ME1b eta 1.64 - 2.14 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=0.02; gdy[1]=1000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100,"and require one stub to be from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b.png"); + + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,2.1); + hAll100gem_ratio->Draw("e1"); + + Print(cAll100r, "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); + + result_gem = hAll100gem; + result_def_3s1b = hAll100; + + if (do_return) return; + } + + + + // ME1b eta 1.64 - 2.14 Default: 3station, 3s GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=0.02; gdy[1]=1000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks: same, plus req. one stub from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b.png"); + + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,1.1); + hAll100gem_ratio->Draw("e1"); + + Print(cAll100r, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__ratio.png"); + + //result_gem = hAll100gem; + result_def = hAll100; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_2s_1b", "_hAll100s2", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + result_def_2s = hAll100; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_2s_1b", "_hAll100s2", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + result_def_2s = hAll100; + + if (do_return) return; + } + + + + // ME1b eta 1.64 - 2.14 Default: 3station, 3s GMT single trigg + if (1) + { + gdy[0]=0.02; gdy[1]=1000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_ptmax_sing_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+1, 1, 1); + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100gem,"GMT selection for Single Trigger","f"); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gmtsing.png"); + + result_gmtsing = hAll100gem; + + if (do_return) return; + } + + + // ME1b eta 1.64 - 2.14 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b + if (1) + { + gdy[0]=0.02; gdy[1]=1000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,"with >=2 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100,"and require one stub to be from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b.png"); + + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,2.1); + hAll100gem_ratio->Draw("e1"); + + Print(cAll100r, "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__ratio.png"); + + result_gem_2s1b = hAll100gem; + result_def_2s1b = hAll100; + + if (do_return) return; + } + + + // this was commented out + + // ME1b eta 1.64 - 2.14 Default: 3station, 3s GEM: 3station, 2s & 1b + if (1) + { + gdy[0]=0.02; gdy[1]=1000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100gem,"Tracks: with >=2 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100gem,"plus req. one stub from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b.png"); + + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,1.1); + hAll100gem_ratio->Draw("e1"); + + Print(cAll100r, "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__ratio.png"); + + result_gem_2s1b = hAll100gem; + //result_def = hAll100; + + if (do_return) return; + } + + + + + return; +} +*/ + +/* + + .L drawplot_gmtrt.C + drawplot_gmtrt("minbias_pt10_pat2") + hh = (TH1D*)result_gem->Clone("gem_new") + hh->SetFillColor(kGreen+4) + for (int b = hh->FindBin(15); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); + drawplot_gmtrt("minbias_pt15_pat2") + h15 = (TH1D*)result_gem->Clone("gem15") + for (int b = h15->FindBin(15); b < h15->FindBin(20); ++b) hh->SetBinContent(b, h15->GetBinContent(b)); + drawplot_gmtrt("minbias_pt20_pat2") + h20 = (TH1D*)result_gem->Clone("gem20") + for (int b = h20->FindBin(20); b < h20->FindBin(30); ++b) hh->SetBinContent(b, h20->GetBinContent(b)); + drawplot_gmtrt("minbias_pt30_pat2") + h30 = (TH1D*)result_gem->Clone("gem30") + for (int b = h30->FindBin(30); b <= h30->GetNbinsX(); ++b) hh->SetBinContent(b, h30->GetBinContent(b)); + for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh->Draw("same e3"); + + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(result_def,"default emulator","f"); + leg_cc100->AddEntry(result_def,"Tracks: with >=3 stubs in 1.14<|#eta|<2.14",""); + leg_cc100->AddEntry(hh,"with GEM match","f"); + leg_cc100->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png") + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png") + + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3") + hh->Draw("same e3") + + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(result_def_3s1b,"default emulator","f"); + leg_cc100->AddEntry(hh,"with GEM match","f"); + leg_cc100->AddEntry(result_def_3s1b,"Tracks req. for both:",""); + leg_cc100->AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png") + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png") + + + + + .L drawplot_gmtrt.C + drawplot_gmtrt("minbias_pt10_pat8") + hh = (TH1D*)result_gem->Clone("gem_new") + hh->SetFillColor(kGreen+4) + for (int b = hh->FindBin(15); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); + drawplot_gmtrt("minbias_pt15_pat8") + h15 = (TH1D*)result_gem->Clone("gem15") + for (int b = h15->FindBin(15); b < h15->FindBin(20); ++b) hh->SetBinContent(b, h15->GetBinContent(b)); + drawplot_gmtrt("minbias_pt20_pat8") + h20 = (TH1D*)result_gem->Clone("gem20") + for (int b = h20->FindBin(20); b < h20->FindBin(30); ++b) hh->SetBinContent(b, h20->GetBinContent(b)); + drawplot_gmtrt("minbias_pt30_pat8") + h30 = (TH1D*)result_gem->Clone("gem30") + for (int b = h30->FindBin(30); b <= h30->GetNbinsX(); ++b) hh->SetBinContent(b, h30->GetBinContent(b)); + for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); + + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3") + hh->Draw("same e3") + + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(result_def,"default emulator","f"); + leg_cc100->AddEntry(result_def,"Tracks: with >=3 stubs in 1.14<|#eta|<2.14",""); + leg_cc100->AddEntry(hh,"with GEM match","f"); + leg_cc100->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png") + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png") + + + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3") + hh->Draw("same e3") + + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(result_def_3s1b,"default emulator","f"); + leg_cc100->AddEntry(hh,"with GEM match","f"); + leg_cc100->AddEntry(result_def_3s1b,"Tracks req. for both:",""); + leg_cc100->AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png") + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png") + + +*/ + +""" + +def plotGlobalMuonTriggerRate(filesDir, plotDir, ext): + """Produce trigger rate plots versus eta""" + etaTriggerRate(filesDir, plotDir, ext) + +if __name__ == '__main__': + + plotGlobalMuonTriggerRate("files/", "plots/rate/", ".pdf") + + + +#### PNG +""" + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__gme-3s-3s1b__gem-3s-3s1b_compstubME1a.png").Data()); + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b_compstubME1a.png").Data()); + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); + Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b.png"); +""" From b7969aea36aaeb8f0351db204944486f276107aa Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 00:15:52 +0200 Subject: [PATCH 008/182] updating efficiency plots --- SimMuL1/scripts/drawplot_eff.C | 42 ++++++++++++++++++--------------- SimMuL1/scripts/drawplot_eff.py | 3 --- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/SimMuL1/scripts/drawplot_eff.C b/SimMuL1/scripts/drawplot_eff.C index be7a946f9a4e4..3c4d7c75474a7 100644 --- a/SimMuL1/scripts/drawplot_eff.C +++ b/SimMuL1/scripts/drawplot_eff.C @@ -1,5 +1,9 @@ gROOT->ProcessLine("effFunctions.C"); + +gROOT->SetBatch(1); + + /* .L @@ -101,7 +105,7 @@ void gemTurnOns(int label_eff = GEM_EFF98) TCanvas* gEff_even = new TCanvas("gEff_even","gEff_even",700,500); gEff_even->SetGridx(1); gEff_even->SetGridy(1); - TTree *t = getTree("gem_csc_eff_pt2pt50_pad4.root"); + TTree *t = getTree("files/gem_csc_eff_pt2pt50_pad4.root"); TH1F *ho[N], *he[N]; for (int n=0; n Date: Tue, 6 Aug 2013 01:06:47 +0200 Subject: [PATCH 009/182] update frankenstein --- SimMuL1/scripts/drawplot_frankenstein.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimMuL1/scripts/drawplot_frankenstein.C b/SimMuL1/scripts/drawplot_frankenstein.C index 48cc7e46c6b7e..bcd07b855e84b 100644 --- a/SimMuL1/scripts/drawplot_frankenstein.C +++ b/SimMuL1/scripts/drawplot_frankenstein.C @@ -163,7 +163,7 @@ for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0 for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); -TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz"; +TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]"; hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); From 6c4dead85b463fa4ca826a02c9c490274e53c91e Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 01:08:06 +0200 Subject: [PATCH 010/182] Adding bending angle dictionary --- SimMuL1/scripts/GEMCSCdPhiLib.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 SimMuL1/scripts/GEMCSCdPhiLib.py diff --git a/SimMuL1/scripts/GEMCSCdPhiLib.py b/SimMuL1/scripts/GEMCSCdPhiLib.py new file mode 100644 index 0000000000000..9756ffc9c24be --- /dev/null +++ b/SimMuL1/scripts/GEMCSCdPhiLib.py @@ -0,0 +1,26 @@ +dphi_lct_pad = { + "95" : { + 'pt5 ' : { 'odd' : 0.02023292, 'even' : 0.00833584 }, + 'pt10' : { 'odd' : 0.00977472, 'even' : 0.00435576 }, + 'pt15' : { 'odd' : 0.00661092, 'even' : 0.00324096 }, + 'pt20' : { 'odd' : 0.00512415, 'even' : 0.00272092 }, + 'pt30' : { 'odd' : 0.00374355, 'even' : 0.00221976 }, + 'pt40' : { 'odd' : 0.00307651, 'even' : 0.00198198 } + }, + "98" : { + 'pt5 ' : { 'odd' : 0.02203511, 'even' : 0.00930056 }, + 'pt10' : { 'odd' : 0.01066000, 'even' : 0.00483286 }, + 'pt15' : { 'odd' : 0.00722795, 'even' : 0.00363230 }, + 'pt20' : { 'odd' : 0.00562598, 'even' : 0.00304878 }, + 'pt30' : { 'odd' : 0.00416544, 'even' : 0.00253782 }, + 'pt40' : { 'odd' : 0.00342827, 'even' : 0.00230833 } + }, + "99" : { + 'pt5 ' : { 'odd' : 0.02344691, 'even' : 0.00995745 }, + 'pt10' : { 'odd' : 0.01137125, 'even' : 0.00520722 }, + 'pt15' : { 'odd' : 0.00769842, 'even' : 0.00389632 }, + 'pt20' : { 'odd' : 0.00599498, 'even' : 0.00331874 }, + 'pt30' : { 'odd' : 0.00446935, 'even' : 0.00278215 }, + 'pt40' : { 'odd' : 0.00368553, 'even' : 0.00254660 } + } +} From 76fcf41b187fe6410218ff9961057f738f2dc025 Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Mon, 5 Aug 2013 18:21:57 -0500 Subject: [PATCH 011/182] merging some updates to drawplot_eff.C since giving it to A and S --- SimMuL1/scripts/drawplot_gmtrt.C | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/SimMuL1/scripts/drawplot_gmtrt.C b/SimMuL1/scripts/drawplot_gmtrt.C index 503b238839207..a11700b5c1cd7 100644 --- a/SimMuL1/scripts/drawplot_gmtrt.C +++ b/SimMuL1/scripts/drawplot_gmtrt.C @@ -1,6 +1,7 @@ //int kGray=920, kOrange=800, kSpring=820, kTeal=840, kAzure=860, kViolet=880, kPink=900; +// Design LHC orbit: 2808 filled bickets out of 3564 ---> 0.7879 filled BX fraction TFile *f=0; @@ -19,7 +20,11 @@ TH1D* result_def_2s = 0; TH1D* result_def_3s1b = 0; TH1D* result_gem_2s1b = 0; +TH1D* result_gem_2s123 = 0; +TH1D* result_gem_2s13 = 0; TH1D* result_def_2s1b = 0; +TH1D* result_def_2s123 = 0; +TH1D* result_def_2s13 = 0; TH1D* result_gem_eta_all = 0; TH1D* result_def_eta_all = 0; @@ -29,7 +34,10 @@ TH1D* result_gem_eta_no1a = 0; TH1D* result_def_eta_no1a = 0; TH1D* result_def_eta_no1a_3s1b = 0; -TH1D* result_gmtsing = 0; +TH1D* result_def_gmtsing = 0; + +TH1D* result_def_gmtsing_no1a = 0; +TH1D* result_gem_gmtsing_no1a = 0; // for later use TH1D* result_def_2s__pat2 = 0; @@ -41,8 +49,8 @@ TH1D* result_def_3s__pat8 = 0; TH1D* result_def_2s1b__pat8 = 0; TH1D* result_def_3s1b__pat8 = 0; -TH1D* result_gmtsing__pat2 = 0; -TH1D* result_gmtsing__pat8 = 0; +TH1D* result_def_gmtsing__pat2 = 0; +TH1D* result_def_gmtsing__pat8 = 0; TH1D* result_gem_2s1b__pat2 = 0; TH1D* result_gem_3s1b__pat2 = 0; @@ -1638,7 +1646,7 @@ tex->Draw(); Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gmtsing.png"); -result_gmtsing = hAll100gem; +result_def_gmtsing = hAll100gem; if (do_return) return; } From 8688083140bfe6905bacf857f120421d0e0853a7 Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Mon, 5 Aug 2013 18:23:17 -0500 Subject: [PATCH 012/182] a handle to keep the numerator of efficiency --- SimMuL1/scripts/effFunctions.C | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SimMuL1/scripts/effFunctions.C b/SimMuL1/scripts/effFunctions.C index 59d00db9c37a4..43e4d242a2d8a 100644 --- a/SimMuL1/scripts/effFunctions.C +++ b/SimMuL1/scripts/effFunctions.C @@ -1,3 +1,4 @@ +TH1F* eff_base = 0; TH1F* draw_eff(TTree *t, TString title, TString h_name, TString h_bins, TString to_draw, TCut denom_cut, TCut extra_num_cut, TString opt = "", int color = kBlue, int marker_st = 20) @@ -37,6 +38,7 @@ TGraphAsymmErrors* draw_geff(TTree *t, TString title, TString h_name, TString h_ num->SetStats(0); num->SetTitle(title); num->Draw(); + eff_base = num; } eff->SetLineWidth(2); eff->SetLineColor(color); @@ -47,4 +49,3 @@ TGraphAsymmErrors* draw_geff(TTree *t, TString title, TString h_name, TString h_ return eff; } - From 93c52094c5f6192a4c4815ae1597b0bfa0183e32 Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Mon, 5 Aug 2013 18:37:19 -0500 Subject: [PATCH 013/182] merging some updates to drawplot_eff.C since giving it to A and S --- SimMuL1/scripts/drawplot_eff.C | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/SimMuL1/scripts/drawplot_eff.C b/SimMuL1/scripts/drawplot_eff.C index be7a946f9a4e4..243f4d962f6d8 100644 --- a/SimMuL1/scripts/drawplot_eff.C +++ b/SimMuL1/scripts/drawplot_eff.C @@ -335,6 +335,54 @@ cEff->SetGridy(1); TTree *gt = getTree("gem_csc_delta_pt40_pad4.root"); +//ht = draw_geff(gt, "Eff. for a SimTrack to have an associated LCT;SimTrack |#eta|;Eff.", "h_odd", "(100,1.54,2.2)", "TMath::Abs(eta)", "", ok_lct1 || ok_lct2, "P", kRed); +//hh = draw_geff(gt, "Eff. for a SimTrack to have an associated LCT;SimTrack |#eta|;Eff.", "h_odd", "(100,1.54,2.2)", "TMath::Abs(eta)", "", ok_sh1 || ok_sh2, "P same", kViolet); +h1 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh1, ok_lct1, "P", kRed); +h2 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh2, ok_lct2, "P same"); +eff_base->GetYaxis()->SetRangeUser(0.6,1.05); +TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(h1, "odd chambers","l"); +leg->AddEntry(h2, "even chambers","l"); +leg->Draw(); +TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); +tex->SetNDC(); +tex->Draw(); +cEff->Print("lct_eff_for_Trk_vsTrkEta_pt40.png"); + + +h1 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT and GEM Pad;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh1, ok_lct1 && ok_pad1, "P", kRed); +h2 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT and GEM Pad;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh2, ok_lct2 && ok_pad2, "P same"); +eff_base->GetYaxis()->SetRangeUser(0.6,1.05); +TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(h1, "odd chambers","l"); +leg->AddEntry(h2, "even chambers","l"); +leg->Draw(); +TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); +tex->SetNDC(); +tex->Draw(); +cEff->Print("gem_pad_and_lct_eff_for_Trk_vsTrkEta_pt40.png"); + +return; + +h1 = draw_geff(gt, "Eff. for a SimTrack to have an associated GEM Pad;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", "", ok_pad1 || ok_pad2, "P", kViolet); +eff_base->GetYaxis()->SetRangeUser(0.6,1.05); +TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); +tex->SetNDC(); +tex->Draw(); +cEff->Print("gem_pad0_eff_for_Trk_vsTrkEta_pt40.png"); + + + + +TTree *gt15 = getTree("gem_csc_delta_pt15_pad4.root"); +h1 = draw_geff(gt15, "Eff. for a SimTrack to have an associated LCT;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_lct1 || ok_lct2, "P", kViolet+2); +cEff->Print("lct_eff_for_Trk_vsTrkEta_pt15.png"); + + ho = draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", ok_lct1, ok_pad1, "P", kRed); he = draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta_lct_even)", ok_lct2, ok_pad2, "P same"); TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); From f6cabf957bfaaa8483ca8b9ef4c2ef34f63b3fd1 Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Mon, 5 Aug 2013 18:51:17 -0500 Subject: [PATCH 014/182] merging some updates to drawplot_etastep.C since giving it to A and S --- SimMuL1/scripts/drawplot_etastep.C | 504 +++++++++++++++++++++++++++-- 1 file changed, 486 insertions(+), 18 deletions(-) diff --git a/SimMuL1/scripts/drawplot_etastep.C b/SimMuL1/scripts/drawplot_etastep.C index d6e74db187abd..038d486d5948a 100644 --- a/SimMuL1/scripts/drawplot_etastep.C +++ b/SimMuL1/scripts/drawplot_etastep.C @@ -1,8 +1,6 @@ //int kGray=920, kOrange=800, kSpring=820, kTeal=840, kAzure=860, kViolet=880, kPink=900; - - TFile *f; char pdir[111]; @@ -15,6 +13,9 @@ TH1D *h1, *h2, *he; double yrange[2]={0.,1.04}; +double yrange05[2]={0.5,1.04}; +double yrange06[2]={0.6,1.04}; +double yrange07[2]={0.7,1.04}; //double yrange[2]={0.5,1.02}; //double yrange[2]={0.8,1.02}; double xrange[2]={0.86,2.5}; @@ -187,13 +188,19 @@ int ptreb=2; TString hdir = "SimMuL1StrictAll"; -TString f_def = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_def_pat2.root"; +//TString f_def = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_def_pat2.root"; +TString f_def = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem_dphi0_pat2.root"; TString f_g98_pt10 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt10_pat2.root"; TString f_g98_pt15 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt15_pat2.root"; TString f_g98_pt20 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt20_pat2.root"; TString f_g98_pt30 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt30_pat2.root"; TString f_g98_pt40 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt40_pat2.root"; +TString f_g95_pt10 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt10_pat2.root"; +TString f_g95_pt20 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt20_pat2.root"; +TString f_g95_pt30 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt30_pat2.root"; +TString f_g95_pt40 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt40_pat2.root"; + double rpt[2] = {0.,49.99}; TString htitle = "Efficiency for #mu in 1.6<|#eta|<2.12 to have TF track;p_{T}^{MC}"; @@ -211,19 +218,21 @@ TH1D* h_eff_tf0_2s1b = getEffHisto(f_def, hdir, h2s1b, hini, ptreb, kBlack, 1, TH1D* h_eff_tf0_3s1b = getEffHisto(f_def, hdir, h3s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); +TH1D* h_eff_tf10_2s = getEffHisto(f_def, hdir, h2s + "_pt10", hini, ptreb, kGreen+4, 1, 2, htitle, rpt,yrange); TH1D* h_eff_tf10_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); TH1D* h_eff_tf10_3s = getEffHisto(f_def, hdir, h3s + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); TH1D* h_eff_tf10_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf15_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf15_3s = getEffHisto(f_def, hdir, h3s + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf15_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); +//TH1D* h_eff_tf15_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); +//TH1D* h_eff_tf15_3s = getEffHisto(f_def, hdir, h3s + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); +//TH1D* h_eff_tf15_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); TH1D* h_eff_tf20_2s = getEffHisto(f_def, hdir, h2s + "_pt20", hini, ptreb, kOrange+4, 1, 2, htitle, rpt,yrange); TH1D* h_eff_tf20_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange); TH1D* h_eff_tf20_3s = getEffHisto(f_def, hdir, h3s + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange); TH1D* h_eff_tf20_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange); +TH1D* h_eff_tf30_2s = getEffHisto(f_def, hdir, h2s + "_pt30", hini, ptreb, kRed+4, 1, 2, htitle, rpt,yrange); TH1D* h_eff_tf30_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange); TH1D* h_eff_tf30_3s = getEffHisto(f_def, hdir, h3s + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange); TH1D* h_eff_tf30_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange); @@ -269,17 +278,28 @@ return; */ -TH1D* h_eff_tf10_gpt15_2s1b = getEffHisto(f_g98_pt15, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 2, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_gpt15_3s1b = getEffHisto(f_g98_pt15, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 2, 2, htitle, rpt,yrange); +TH1D* h_eff_tf10_gpt15_2s1b = getEffHisto(f_g98_pt15, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 3, 2, htitle, rpt,yrange); +TH1D* h_eff_tf10_gpt15_3s1b = getEffHisto(f_g98_pt15, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 3, 2, htitle, rpt,yrange); + +TH1D* h_eff_tf15_gpt20_2s1b = getEffHisto(f_g98_pt20, hdir, h2s1b + "_pt15", hini, ptreb, kViolet, 3, 2, htitle, rpt,yrange); +TH1D* h_eff_tf15_gpt20_3s1b = getEffHisto(f_g98_pt20, hdir, h3s1b + "_pt15", hini, ptreb, kViolet, 3, 2, htitle, rpt,yrange); + +TH1D* h_eff_tf20_gpt30_2s1b = getEffHisto(f_g98_pt30, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 3, 2, htitle, rpt,yrange); +TH1D* h_eff_tf20_gpt30_3s1b = getEffHisto(f_g98_pt30, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 3, 2, htitle, rpt,yrange); + +TH1D* h_eff_tf30_gpt40_2s1b = getEffHisto(f_g98_pt40, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 3, 2, htitle, rpt,yrange); +TH1D* h_eff_tf30_gpt40_3s1b = getEffHisto(f_g98_pt40, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 3, 2, htitle, rpt,yrange); + -TH1D* h_eff_tf15_gpt20_2s1b = getEffHisto(f_g98_pt20, hdir, h2s1b + "_pt15", hini, ptreb, kBlue, 2, 2, htitle, rpt,yrange); -TH1D* h_eff_tf15_gpt20_3s1b = getEffHisto(f_g98_pt20, hdir, h3s1b + "_pt15", hini, ptreb, kBlue, 2, 2, htitle, rpt,yrange); +TH1D* h_eff_tf10_gpt20_2s1b = getEffHisto(f_g98_pt20, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 3, 2, htitle, rpt,yrange); +TH1D* h_eff_tf10_gpt20_3s1b = getEffHisto(f_g98_pt20, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 3, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_gpt30_2s1b = getEffHisto(f_g98_pt30, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 2, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_gpt30_3s1b = getEffHisto(f_g98_pt30, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 2, 2, htitle, rpt,yrange); +TH1D* h_eff_tf15_gpt30_2s1b = getEffHisto(f_g98_pt30, hdir, h2s1b + "_pt15", hini, ptreb, kViolet, 3, 2, htitle, rpt,yrange); +TH1D* h_eff_tf15_gpt30_3s1b = getEffHisto(f_g98_pt30, hdir, h3s1b + "_pt15", hini, ptreb, kViolet, 3, 2, htitle, rpt,yrange); + +TH1D* h_eff_tf20_gpt40_2s1b = getEffHisto(f_g98_pt40, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 3, 2, htitle, rpt,yrange); +TH1D* h_eff_tf20_gpt40_3s1b = getEffHisto(f_g98_pt40, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 3, 2, htitle, rpt,yrange); -TH1D* h_eff_tf30_gpt40_2s1b = getEffHisto(f_g98_pt40, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 2, 2, htitle, rpt,yrange); -TH1D* h_eff_tf30_gpt40_3s1b = getEffHisto(f_g98_pt40, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 2, 2, htitle, rpt,yrange); TCanvas* c2s1b = new TCanvas("c2s1b","c2s1b",800,600) ; @@ -410,14 +430,77 @@ c3s1b_def->Print("eff_3s1b_def.png"); +h_eff_tf10_2s->SetLineColor(kAzure+2); +h_eff_tf10_2s1b->SetLineColor(kAzure+6); +h_eff_tf10_3s->SetLineColor(kAzure+3); +h_eff_tf10_3s1b->SetLineColor(kAzure+7); +h_eff_tf10_gpt10_2s1b->SetLineColor(kAzure+6); +h_eff_tf10_gpt10_3s1b->SetLineColor(kAzure+7); + h_eff_tf20_2s->SetLineColor(kAzure+2); h_eff_tf20_2s1b->SetLineColor(kAzure+6); h_eff_tf20_3s->SetLineColor(kAzure+3); h_eff_tf20_3s1b->SetLineColor(kAzure+7); - h_eff_tf20_gpt20_2s1b->SetLineColor(kAzure+6); h_eff_tf20_gpt20_3s1b->SetLineColor(kAzure+7); +h_eff_tf30_2s->SetLineColor(kAzure+2); +h_eff_tf30_2s1b->SetLineColor(kAzure+6); +h_eff_tf30_3s->SetLineColor(kAzure+3); +h_eff_tf30_3s1b->SetLineColor(kAzure+7); +h_eff_tf30_gpt30_2s1b->SetLineColor(kAzure+6); +h_eff_tf30_gpt30_3s1b->SetLineColor(kAzure+7); + +h_eff_tf40_2s->SetLineColor(kAzure+2); +h_eff_tf40_2s1b->SetLineColor(kAzure+6); +h_eff_tf40_3s->SetLineColor(kAzure+3); +h_eff_tf40_3s1b->SetLineColor(kAzure+7); +h_eff_tf40_gpt40_2s1b->SetLineColor(kAzure+6); +h_eff_tf40_gpt40_3s1b->SetLineColor(kAzure+7); + + +TCanvas* c2s_pt10_def = new TCanvas("c2s_pt10_def","c2s_pt10_def",800,600); + +h_eff_tf10_2s->Draw("hist"); +h_eff_tf10_2s1b->Draw("hist same"); + +TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->SetHeader("TF track: p_{T}^{TF}>=10 and 2+ stubs"); +leg->AddEntry(h_eff_tf10_2s, "anywhere", "l"); +leg->AddEntry(h_eff_tf10_2s1b, "with ME1", "l"); +leg->Draw(); + +c2s_pt10_def->Print("eff_2s_pt10_def.png"); + +h_eff_tf10_gpt10_2s1b->Draw("hist same"); +leg->AddEntry(h_eff_tf10_gpt10_2s1b, "with (ME1 + GEM)", "l"); +c2s_pt10_def->Print("eff_2s_pt10_gem.png"); + + + +TCanvas* c3s_pt10_def = new TCanvas("c3s_pt10_def","c3s_pt10_def",800,600); + +h_eff_tf10_3s->Draw("hist"); +h_eff_tf10_3s1b->Draw("hist same"); + +TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->SetHeader("TF track: p_{T}^{TF}>=10 and 3+ stubs"); +leg->AddEntry(h_eff_tf10_3s, "anywhere", "l"); +leg->AddEntry(h_eff_tf10_3s1b, "with ME1", "l"); +leg->Draw(); + +c3s_pt10_def->Print("eff_3s_pt10_def.png"); + +h_eff_tf10_gpt10_3s1b->Draw("hist same"); +leg->AddEntry(h_eff_tf10_gpt10_3s1b, "with (ME1 + GEM)", "l"); +c3s_pt10_def->Print("eff_3s_pt10_gem.png"); + + + TCanvas* c2s_pt20_def = new TCanvas("c2s_pt20_def","c2s_pt20_def",800,600); @@ -460,13 +543,398 @@ leg->AddEntry(h_eff_tf20_gpt20_3s1b, "with (ME1 + GEM)", "l"); c3s_pt20_def->Print("eff_3s_pt20_gem.png"); + +TCanvas* c2s_pt30_def = new TCanvas("c2s_pt30_def","c2s_pt30_def",800,600); + +h_eff_tf30_2s->Draw("hist"); +h_eff_tf30_2s1b->Draw("hist same"); + +TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->SetHeader("TF track: p_{T}^{TF}>=30 and 2+ stubs"); +leg->AddEntry(h_eff_tf30_2s, "anywhere", "l"); +leg->AddEntry(h_eff_tf30_2s1b, "with ME1", "l"); +leg->Draw(); + +c2s_pt30_def->Print("eff_2s_pt30_def.png"); + +h_eff_tf30_gpt30_2s1b->Draw("hist same"); +leg->AddEntry(h_eff_tf30_gpt30_2s1b, "with (ME1 + GEM)", "l"); +c2s_pt30_def->Print("eff_2s_pt30_gem.png"); + + + +TCanvas* c3s_pt30_def = new TCanvas("c3s_pt30_def","c3s_pt30_def",800,600); + +h_eff_tf30_3s->Draw("hist"); +h_eff_tf30_3s1b->Draw("hist same"); + +TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->SetHeader("TF track: p_{T}^{TF}>=30 and 3+ stubs"); +leg->AddEntry(h_eff_tf30_3s, "anywhere", "l"); +leg->AddEntry(h_eff_tf30_3s1b, "with ME1", "l"); +leg->Draw(); + +c3s_pt30_def->Print("eff_3s_pt30_def.png"); + +h_eff_tf30_gpt30_3s1b->Draw("hist same"); +leg->AddEntry(h_eff_tf30_gpt30_3s1b, "with (ME1 + GEM)", "l"); +c3s_pt30_def->Print("eff_3s_pt30_gem.png"); + + + +TCanvas* c2s_pt40_def = new TCanvas("c2s_pt40_def","c2s_pt40_def",800,600); + +h_eff_tf40_2s->Draw("hist"); +h_eff_tf40_2s1b->Draw("hist same"); + +TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->SetHeader("TF track: p_{T}^{TF}>=40 and 2+ stubs"); +leg->AddEntry(h_eff_tf40_2s, "anywhere", "l"); +leg->AddEntry(h_eff_tf40_2s1b, "with ME1", "l"); +leg->Draw(); + +c2s_pt40_def->Print("eff_2s_pt40_def.png"); + +h_eff_tf40_gpt40_2s1b->Draw("hist same"); +leg->AddEntry(h_eff_tf40_gpt40_2s1b, "with (ME1 + GEM)", "l"); +c2s_pt40_def->Print("eff_2s_pt40_gem.png"); + + + +TCanvas* c3s_pt40_def = new TCanvas("c3s_pt40_def","c3s_pt40_def",800,600); + +h_eff_tf40_3s->Draw("hist"); +h_eff_tf40_3s1b->Draw("hist same"); + +TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->SetHeader("TF track: p_{T}^{TF}>=40 and 3+ stubs"); +leg->AddEntry(h_eff_tf40_3s, "anywhere", "l"); +leg->AddEntry(h_eff_tf40_3s1b, "with ME1", "l"); +leg->Draw(); + +c3s_pt40_def->Print("eff_3s_pt40_def.png"); + +h_eff_tf40_gpt40_3s1b->Draw("hist same"); +leg->AddEntry(h_eff_tf40_gpt40_3s1b, "with (ME1 + GEM)", "l"); +c3s_pt40_def->Print("eff_3s_pt40_gem.png"); + + + +//return; + +h_eff_tf10_gpt10_3s1b->SetLineColor(kBlue); +h_eff_tf10_gpt15_3s1b->SetLineColor(kMagenta); +h_eff_tf20_gpt20_3s1b->SetLineColor(kBlue+2); +h_eff_tf20_gpt30_3s1b->SetLineColor(kMagenta+2); +h_eff_tf30_gpt30_3s1b->SetLineColor(kBlue+4); +h_eff_tf30_gpt40_3s1b->SetLineColor(kMagenta+4); + +TCanvas* c3s_tight = new TCanvas("c3s_tight","c3s_tight",800,600); + +h_eff_tf10_gpt10_3s1b->Draw("hist"); +h_eff_tf10_gpt15_3s1b->Draw("hist same"); + +//h_eff_tf15_gpt15_3s1b->Draw("hist same"); +//h_eff_tf15_gpt20_3s1b->Draw("hist same"); + +h_eff_tf20_gpt20_3s1b->Draw("hist same"); +h_eff_tf20_gpt30_3s1b->Draw("hist same"); + +h_eff_tf30_gpt30_3s1b->Draw("hist same"); +h_eff_tf30_gpt40_3s1b->Draw("hist same"); + +TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->SetNColumns(2); +leg->SetHeader("TF track: 3+ stubs with ME1"); +leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T}^{TF} cut and", ""); +leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T}^{TF} cut and", ""); +leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T} for #Delta#phi(GEM,LCT)", ""); +leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T} for #Delta#phi(GEM,LCT)", ""); +leg->AddEntry(h_eff_tf10_gpt10_3s1b, "#geq10 and 10", "l"); +leg->AddEntry(h_eff_tf10_gpt15_3s1b, "#geq10 and 15", "l"); +leg->AddEntry(h_eff_tf20_gpt20_3s1b, "#geq20 and 20", "l"); +leg->AddEntry(h_eff_tf20_gpt30_3s1b, "#geq20 and 30", "l"); +leg->AddEntry(h_eff_tf30_gpt30_3s1b, "#geq30 and 30", "l"); +leg->AddEntry(h_eff_tf30_gpt40_3s1b, "#geq30 and 40", "l"); +leg->Draw(); + +c3s_tight->Print("eff_3s_gemtight.png"); + + + +h_eff_tf10_gpt10_3s1b->SetLineColor(kBlue); +h_eff_tf10_gpt20_3s1b->SetLineColor(kMagenta); +h_eff_tf15_gpt15_3s1b->SetLineColor(kBlue+2); +h_eff_tf15_gpt30_3s1b->SetLineColor(kMagenta+2); +h_eff_tf20_gpt20_3s1b->SetLineColor(kBlue+4); +h_eff_tf20_gpt40_3s1b->SetLineColor(kMagenta+4); + +TCanvas* c3s_tight = new TCanvas("c3s_tight","c3s_tight",800,600); + +h_eff_tf10_gpt10_3s1b->Draw("hist"); +h_eff_tf10_gpt20_3s1b->Draw("hist same"); + +h_eff_tf15_gpt15_3s1b->Draw("hist same"); +h_eff_tf15_gpt30_3s1b->Draw("hist same"); + +h_eff_tf20_gpt20_3s1b->Draw("hist same"); +h_eff_tf20_gpt40_3s1b->Draw("hist same"); + +TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->SetNColumns(2); +leg->SetHeader("TF track: 3+ stubs with ME1"); +leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T}^{TF} cut and", ""); +leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T}^{TF} cut and", ""); +leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T} for #Delta#phi(GEM,LCT)", ""); +leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T} for #Delta#phi(GEM,LCT)", ""); +leg->AddEntry(h_eff_tf10_gpt10_3s1b, "#geq10 and 10", "l"); +leg->AddEntry(h_eff_tf10_gpt20_3s1b, "#geq10 and 20", "l"); +leg->AddEntry(h_eff_tf15_gpt15_3s1b, "#geq15 and 15", "l"); +leg->AddEntry(h_eff_tf15_gpt30_3s1b, "#geq15 and 30", "l"); +leg->AddEntry(h_eff_tf20_gpt20_3s1b, "#geq20 and 20", "l"); +leg->AddEntry(h_eff_tf20_gpt40_3s1b, "#geq20 and 40", "l"); +leg->Draw(); + +c3s_tight->Print("eff_3s_gemtightX.png"); + +} + + + + +void gem_eff_draw_gem1b() +{ +gStyle->SetOptStat(0); +gStyle->SetTitleStyle(0); + +int ptreb=2; + +TString hdir = "SimMuL1StrictAll"; + +//TString f_def = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_def_pat2.root"; +TString f_def = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem_dphi0_pat2.root"; + +double rpt[2] = {0.,49.99}; + + + +TString hini = "h_pt_initial_gem_1b"; +TString hini_g = "h_pt_gem_1b"; +TString hini_gl = "h_pt_lctgem_1b"; + +TString h2g_00 = "h_pt_after_tfcand_gem1b_2s1b"; +TString h2g_00_123 = "h_pt_after_tfcand_gem1b_2s123"; +TString h2g_00_13 = "h_pt_after_tfcand_gem1b_2s13"; +TString h3g_00 = "h_pt_after_tfcand_gem1b_3s1b"; +TString h2p_00 = "h_pt_after_tfcand_dphigem1b_2s1b"; +TString h2p_00_123 = "h_pt_after_tfcand_dphigem1b_2s123"; +TString h2p_00_13 = "h_pt_after_tfcand_dphigem1b_2s13"; +TString h3p_00 = "h_pt_after_tfcand_dphigem1b_3s1b"; + +TString h2g_15 = "h_pt_after_tfcand_gem1b_2s1b_pt15"; +TString h2g_15_123 = "h_pt_after_tfcand_gem1b_2s123_pt15"; +TString h2g_15_13 = "h_pt_after_tfcand_gem1b_2s13_pt15"; +TString h3g_15 = "h_pt_after_tfcand_gem1b_3s1b_pt15"; +TString h2p_15 = "h_pt_after_tfcand_dphigem1b_2s1b_pt15"; +TString h2p_15_123 = "h_pt_after_tfcand_dphigem1b_2s123_pt15"; +TString h2p_15_13 = "h_pt_after_tfcand_dphigem1b_2s13_pt15"; +TString h3p_15 = "h_pt_after_tfcand_dphigem1b_3s1b_pt15"; + +TString h2g_20 = "h_pt_after_tfcand_gem1b_2s1b_pt20"; +TString h2g_20_123 = "h_pt_after_tfcand_gem1b_2s123_pt20"; +TString h2g_20_13 = "h_pt_after_tfcand_gem1b_2s13_pt20"; +TString h3g_20 = "h_pt_after_tfcand_gem1b_3s1b_pt20"; +TString h2p_20 = "h_pt_after_tfcand_dphigem1b_2s1b_pt20"; +TString h2p_20_123 = "h_pt_after_tfcand_dphigem1b_2s123_pt20"; +TString h2p_20_13 = "h_pt_after_tfcand_dphigem1b_2s13_pt20"; +TString h3p_20 = "h_pt_after_tfcand_dphigem1b_3s1b_pt20"; + +TString h2g_30 = "h_pt_after_tfcand_gem1b_2s1b_pt30"; +TString h2g_30_123 = "h_pt_after_tfcand_gem1b_2s123_pt30"; +TString h2g_30_13 = "h_pt_after_tfcand_gem1b_2s13_pt30"; +TString h3g_30 = "h_pt_after_tfcand_gem1b_3s1b_pt30"; +TString h2p_30 = "h_pt_after_tfcand_dphigem1b_2s1b_pt30"; +TString h2p_30_123 = "h_pt_after_tfcand_dphigem1b_2s123_pt30"; +TString h2p_30_13 = "h_pt_after_tfcand_dphigem1b_2s13_pt30"; +TString h3p_30 = "h_pt_after_tfcand_dphigem1b_3s1b_pt30"; + + +TCanvas* c2 = new TCanvas("c2","c2",800,600) ; +gPad->SetGridx(1); +gPad->SetGridy(1); + + +TString htitle = "Efficiency for #mu (GEM) in 1.64<|#eta|<2.05 to have TF track with ME1/b stub;p_{T}^{MC}"; + +hel = getEffHisto(f_def, hdir, hini_gl, hini_g, ptreb, kBlack, 1, 2, htitle, rpt, yrange07); +hel->Draw("hist"); +het2 = getEffHisto(f_def, hdir, h2g_00, hini_g, ptreb, kGreen+2, 1, 2, htitle, rpt, yrange07); +het2->Draw("same hist"); +het3 = getEffHisto(f_def, hdir, h3g_00, hini_g, ptreb, kGreen+2, 2, 2, htitle, rpt, yrange07); +het3->Draw("same hist"); +het2pt20 = getEffHisto(f_def, hdir, h2g_20, hini_g, ptreb, kBlue, 1, 2, htitle, rpt, yrange07); +het2pt20->Draw("same hist"); +het3pt20 = getEffHisto(f_def, hdir, h3g_20, hini_g, ptreb, kBlue, 2, 2, htitle, rpt, yrange07); +het3pt20->Draw("same hist"); + +TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->SetNColumns(2); +//leg->SetHeader("TF track: 3+ stubs with ME1"); +leg->AddEntry(hel, "ME1/b LCT stub", "l"); +leg->AddEntry(hel, " ", ""); +leg->AddEntry(het2, "any p_{T}^{TF}, 2+ stubs", "l"); +leg->AddEntry(het2pt20, "p_{T}^{TF}#geq20, 2+ stubs", "l"); +leg->AddEntry(het3, "any p_{T}^{TF}, 3+ stubs", "l"); +leg->AddEntry(het3pt20, "p_{T}^{TF}#geq20, 3+ stubs", "l"); +leg->Draw(); + +c2->Print("eff_gem1b_basegem.png"); + + + +TString htitle = "Efficiency for #mu (GEM+LCT) in 1.64<|#eta|<2.05 to have TF track with ME1/b stub;p_{T}^{MC}"; + +helt2pt20 = getEffHisto(f_def, hdir, h2g_20, hini_gl, ptreb, kMagenta-3, 1, 2, htitle, rpt, yrange07); +helt2pt20->Draw("hist"); +helt3pt20 = getEffHisto(f_def, hdir, h3g_20, hini_gl, ptreb, kMagenta-3, 2, 2, htitle, rpt, yrange07); +helt3pt20->Draw("same hist"); +het2pt20->Draw("same hist"); +het3pt20->Draw("same hist"); + +TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->SetNColumns(2); +leg->SetHeader("TF track p_{T}^{TF}#geq20 with ME1"); +leg->AddEntry(het2pt20, "GEM baseline", ""); +leg->AddEntry(helt2pt20, "GEM+LCT baseline", ""); +leg->AddEntry(het2pt20, "2+ stubs", "l"); +leg->AddEntry(helt2pt20, "2+ stubs", "l"); +leg->AddEntry(het3pt20, "3+ stubs", "l"); +leg->AddEntry(helt3pt20, "3+ stubs", "l"); +leg->Draw(); +c2->Print("eff_gem1b_baselctgem.png"); + +//return; + +TString htitle = "Efficiency for #mu (GEM) in 1.64<|#eta|<2.05 to have TF track with ME1/b stub;p_{T}^{MC}"; + +het2pt20->Draw("hist"); +het3pt20->Draw("same hist"); +het2pt20p = getEffHisto(f_def, hdir, h2p_20, hini_g, ptreb, kGray+2, 1, 2, htitle, rpt, yrange07); +het2pt20p->Draw("same hist"); +het3pt20p = getEffHisto(f_def, hdir, h3p_20, hini_g, ptreb, kGray+2, 2, 2, htitle, rpt, yrange07); +het3pt20p->Draw("same hist"); + +TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->SetNColumns(2); +leg->SetHeader("TF track p_{T}^{TF}#geq20 with ME1"); +leg->AddEntry(het2pt20, "no GEM #Delta#phi", ""); +leg->AddEntry(het2pt20p, "with GEM #Delta#phi", "l"); +leg->AddEntry(het2pt20, "2+ stubs", "l"); +leg->AddEntry(het2pt20p, "2+ stubs", "l"); +leg->AddEntry(het3pt20, "3+ stubs", "l"); +leg->AddEntry(het3pt20p, "3+ stubs", "l"); +leg->Draw(); +c2->Print("eff_gem1b_basegem_dphi.png"); + + +htitle = "Efficiency for #mu (GEM+LCT) in 1.64<|#eta|<2.05 to have TF track with ME1/b stub;p_{T}^{MC}"; + +helt2pt20->Draw("hist"); +helt3pt20->Draw("same hist"); +helt2pt20p = getEffHisto(f_def, hdir, h2p_20, hini_gl, ptreb, kGray+2, 1, 2, htitle, rpt, yrange07); +helt2pt20p->Draw("same hist"); +helt3pt20p = getEffHisto(f_def, hdir, h3p_20, hini_gl, ptreb, kGray+2, 2, 2, htitle, rpt, yrange07); +helt3pt20p->Draw("same hist"); + +TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->SetNColumns(2); +leg->SetHeader("TF track p_{T}^{TF}#geq20 with ME1"); +leg->AddEntry(helt2pt20, "no GEM #Delta#phi", ""); +leg->AddEntry(helt2pt20p, "with GEM #Delta#phi", "l"); +leg->AddEntry(helt2pt20, "2+ stubs", "l"); +leg->AddEntry(helt2pt20p, "2+ stubs", "l"); +leg->AddEntry(helt3pt20, "3+ stubs", "l"); +leg->AddEntry(helt3pt20p, "3+ stubs", "l"); +leg->Draw(); +c2->Print("eff_gem1b_baselpcgem_dphi.png"); + + +helt2pt20->Draw("hist"); +helt3pt20->Draw("same hist"); +helt2pt20_123 = getEffHisto(f_def, hdir, h2g_20_123, hini_gl, ptreb, kMagenta-3, 9, 2, htitle, rpt, yrange07); +helt2pt20_123->Draw("same hist"); +helt3pt20_13 = getEffHisto(f_def, hdir, h2g_20_13, hini_gl, ptreb, kMagenta-3, 7, 2, htitle, rpt, yrange07); +helt3pt20_13->Draw("same hist"); + +TLegend *leg = new TLegend(0.5,0.17,.999,0.55, NULL, "brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +//leg->SetNColumns(2); +leg->SetHeader("TF track p_{T}^{TF}#geq20 with ME1"); +//leg->AddEntry(helt2pt20, "no GEM #Delta#phi", ""); +//leg->AddEntry(helt2pt20p, "with GEM #Delta#phi", ""); +leg->AddEntry(helt2pt20, "2+ stubs", "l"); +leg->AddEntry(helt2pt20_123, "2+ stubs (no ME1-4 tracks)", "l"); +leg->AddEntry(helt3pt20_13, "2+ stubs (no ME1-2 and ME1-4)", "l"); +leg->AddEntry(helt3pt20, "3+ stubs", "l"); +leg->Draw(); +c2->Print("eff_gem1b_baselpcgem_123.png"); + return; -h_eff_tf10_gpt15_2s1b->Draw("hist same"); -h_eff_tf20_gpt30_2s1b->Draw("hist same"); -h_eff_tf30_gpt40_2s1b->Draw("hist same"); +hegl = getEffHisto(f_def, hdir, hgl, hini, ptreb, kRed, 1, 2, htitle, rpt, yrange); +hegl->Draw("same hist") +heg = getEffHisto(f_def, hdir, hg, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); +heg->Draw("same hist") + + + + +TString hini = "h_pt_initial_1b"; +TString h2s = "h_pt_after_tfcand_eta1b_2s"; +TString h3s = "h_pt_after_tfcand_eta1b_3s"; +TString h2s1b = "h_pt_after_tfcand_eta1b_2s1b"; +TString h3s1b = "h_pt_after_tfcand_eta1b_3s1b"; + + +TH1D* h_eff_tf0_2s = getEffHisto(f_def, hdir, h2s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); +TH1D* h_eff_tf0_3s = getEffHisto(f_def, hdir, h3s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); +TH1D* h_eff_tf0_2s1b = getEffHisto(f_def, hdir, h2s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); +TH1D* h_eff_tf0_3s1b = getEffHisto(f_def, hdir, h3s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + + +TH1D* h_eff_tf10_2s = getEffHisto(f_def, hdir, h2s + "_pt10", hini, ptreb, kGreen+4, 1, 2, htitle, rpt,yrange); +TH1D* h_eff_tf10_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); +TH1D* h_eff_tf10_3s = getEffHisto(f_def, hdir, h3s + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); +TH1D* h_eff_tf10_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); } + + + + + + void drawplot_etastep(char *fname, char* pu, char *dname="tf") { From 9512725d4f1cff990bc65d37c7f908437ae5405d Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Mon, 5 Aug 2013 18:57:07 -0500 Subject: [PATCH 015/182] merging some updates to drawplot_frankenstein.C since giving it to A and S --- SimMuL1/scripts/drawplot_frankenstein.C | 385 ++++++++++++++++++++---- 1 file changed, 331 insertions(+), 54 deletions(-) diff --git a/SimMuL1/scripts/drawplot_frankenstein.C b/SimMuL1/scripts/drawplot_frankenstein.C index 48cc7e46c6b7e..34609cdf44d95 100644 --- a/SimMuL1/scripts/drawplot_frankenstein.C +++ b/SimMuL1/scripts/drawplot_frankenstein.C @@ -1,5 +1,7 @@ +gROOT->ProcessLine(".L drawplot_gmtrt.C"); + /* -.L getPTHistos.C +.L drawplot_gmtrt.C */ @@ -30,17 +32,23 @@ result_def = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_1b", "_def"); result_def_2s = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_2s_1b", "_def"); result_def_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_def"); result_def_2s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_def"); +result_def_2s123 = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_2s123_1b", "_def"); +result_def_2s13 = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_2s13_1b", "_def"); result_def_eta_all = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s", "_def"); result_def_eta_all_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_def"); result_def_eta_no1a = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_no1a", "_def"); result_def_eta_no1a_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_def"); -result_gmtsing = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); +result_def_gmtsing = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); +result_def_gmtsing_no1a = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing6_no1a", "_def"); result_gem = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_gem"); result_gem_2s1b = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_gem"); +result_gem_2s123 = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_2s123_1b", "_gem"); +result_gem_2s13 = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_2s13_1b", "_gem"); result_gem_eta_all = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_gem"); result_gem_eta_no1a = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_gem"); -//result_gmtsing = getPTHisto(f_gem, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); +//result_gem_gmtsing = getPTHisto(f_gem, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); +result_gem_gmtsing_no1a = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing6_3s1b_no1a", "_def"); } @@ -97,6 +105,12 @@ hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); for (int b = hh_no1a->FindBin(6.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); for (int b = hh_2s1b->FindBin(6.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); +hh_2s123 = (TH1D*)result_def_2s123->Clone("gem_new_2s123"); +for (int b = hh_2s123->FindBin(6.01); b <= hh_2s123->GetNbinsX(); ++b) hh_2s123->SetBinContent(b, 0); +hh_2s13 = (TH1D*)result_def_2s13->Clone("gem_new_2s13"); +for (int b = hh_2s13->FindBin(6.01); b <= hh_2s13->GetNbinsX(); ++b) hh_2s13->SetBinContent(b, 0); +hh_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("hh_sing_no1a"); +for (int b = hh_sing_no1a->FindBin(6.01); b <= hh_sing_no1a->GetNbinsX(); ++b) hh_sing_no1a->SetBinContent(b, 0); h06 = (TH1D*)result_gem->Clone("gem_new_06"); for (int b = h06->FindBin(6.01); b < h06->FindBin(10.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} @@ -106,6 +120,12 @@ h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); for (int b = h06_no1a->FindBin(6.01); b < h06_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); for (int b = h06_2s1b->FindBin(6.01); b < h06_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} +h06_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_06"); +for (int b = h06_2s123->FindBin(6.01); b < h06_2s123->FindBin(10.01); ++b) {hh_2s123->SetBinContent(b, h06_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h06_2s123->GetBinError(b));} +h06_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_06"); +for (int b = h06_2s13->FindBin(6.01); b < h06_2s13->FindBin(10.01); ++b) {hh_2s13->SetBinContent(b, h06_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h06_2s13->GetBinError(b));} +h06_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_06"); +for (int b = h06_sing_no1a->FindBin(6.01); b < h06_sing_no1a->FindBin(10.01); ++b) {hh_sing_no1a->SetBinContent(b, h06_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h06_sing_no1a->GetBinError(b));} getPTHistos("minbias_pt10_pat2"); h10 = (TH1D*)result_gem->Clone("gem10"); @@ -116,6 +136,12 @@ h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); for (int b = h10_no1a->FindBin(10.01); b < h10_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); for (int b = h10_2s1b->FindBin(10.01); b < h10_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} +h10_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_10"); +for (int b = h10_2s123->FindBin(10.01); b < h10_2s123->FindBin(15.01); ++b) {hh_2s123->SetBinContent(b, h10_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h10_2s123->GetBinError(b));} +h10_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_10"); +for (int b = h10_2s13->FindBin(10.01); b < h10_2s13->FindBin(15.01); ++b) {hh_2s13->SetBinContent(b, h10_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h10_2s13->GetBinError(b));} +h10_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_10"); +for (int b = h10_sing_no1a->FindBin(10.01); b < h10_sing_no1a->FindBin(15.01); ++b) {hh_sing_no1a->SetBinContent(b, h10_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h10_sing_no1a->GetBinError(b));} getPTHistos("minbias_pt15_pat2"); h15 = (TH1D*)result_gem->Clone("gem15"); @@ -126,6 +152,12 @@ h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); for (int b = h15_no1a->FindBin(15.01); b < h15_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); for (int b = h15_2s1b->FindBin(15.01); b < h15_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} +h15_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_15"); +for (int b = h15_2s123->FindBin(15.01); b < h15_2s123->FindBin(20.01); ++b) {hh_2s123->SetBinContent(b, h15_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h15_2s123->GetBinError(b));} +h15_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_15"); +for (int b = h15_2s13->FindBin(15.01); b < h15_2s13->FindBin(20.01); ++b) {hh_2s13->SetBinContent(b, h15_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h15_2s13->GetBinError(b));} +h15_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_15"); +for (int b = h15_sing_no1a->FindBin(15.01); b < h15_sing_no1a->FindBin(20.01); ++b) {hh_sing_no1a->SetBinContent(b, h15_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h15_sing_no1a->GetBinError(b));} getPTHistos("minbias_pt20_pat2"); h20 = (TH1D*)result_gem->Clone("gem20"); @@ -136,6 +168,12 @@ h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); for (int b = h20_no1a->FindBin(20.01); b < h20_no1a->FindBin(30.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); for (int b = h20_2s1b->FindBin(20.01); b < h20_2s1b->FindBin(30.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} +h20_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_20"); +for (int b = h20_2s123->FindBin(20.01); b < h20_2s123->FindBin(30.01); ++b) {hh_2s123->SetBinContent(b, h20_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h20_2s123->GetBinError(b));} +h20_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_20"); +for (int b = h20_2s13->FindBin(20.01); b < h20_2s13->FindBin(30.01); ++b) {hh_2s13->SetBinContent(b, h20_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h20_2s13->GetBinError(b));} +h20_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_20"); +for (int b = h20_sing_no1a->FindBin(20.01); b < h20_sing_no1a->FindBin(30.01); ++b) {hh_sing_no1a->SetBinContent(b, h20_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h20_sing_no1a->GetBinError(b));} getPTHistos("minbias_pt30_pat2"); h30 = (TH1D*)result_gem->Clone("gem30"); @@ -146,6 +184,12 @@ h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); for (int b = h30_no1a->FindBin(30.01); b < h30_no1a->FindBin(40.01); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); for (int b = h30_2s1b->FindBin(30.01); b < h30_2s1b->FindBin(40.01); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} +h30_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_30"); +for (int b = h30_2s123->FindBin(30.01); b < h30_2s123->FindBin(40.01); ++b) {hh_2s123->SetBinContent(b, h30_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h30_2s123->GetBinError(b));} +h30_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_30"); +for (int b = h30_2s13->FindBin(30.01); b < h30_2s13->FindBin(40.01); ++b) {hh_2s13->SetBinContent(b, h30_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h30_2s13->GetBinError(b));} +h30_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_30"); +for (int b = h30_sing_no1a->FindBin(30.01); b < h30_sing_no1a->FindBin(40.01); ++b) {hh_sing_no1a->SetBinContent(b, h30_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h30_sing_no1a->GetBinError(b));} getPTHistos("minbias_pt40_pat2"); h40 = (TH1D*)result_gem->Clone("gem30"); @@ -156,30 +200,47 @@ h40_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_40"); for (int b = h40_no1a->FindBin(40.01); b < h40_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h40_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h40_no1a->GetBinError(b));} h40_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_40"); for (int b = h40_2s1b->FindBin(40.01); b < h40_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h40_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h40_2s1b->GetBinError(b));} +h40_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_40"); +for (int b = h40_2s123->FindBin(40.01); b < h40_2s123->GetNbinsX(); ++b) {hh_2s123->SetBinContent(b, h40_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h40_2s123->GetBinError(b));} +h40_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_40"); +for (int b = h40_2s13->FindBin(40.01); b < h40_2s13->GetNbinsX(); ++b) {hh_2s13->SetBinContent(b, h40_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h40_2s13->GetBinError(b));} +h40_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_40"); +for (int b = h40_sing_no1a->FindBin(40.01); b < h40_sing_no1a->GetNbinsX(); ++b) {hh_sing_no1a->SetBinContent(b, h40_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h40_sing_no1a->GetBinError(b));} for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); +for (int b = 1; b <= hh_2s123->GetNbinsX(); ++b) if (hh_2s123->GetBinContent(b)==0) hh_2s123->SetBinError(b, 0.); +for (int b = 1; b <= hh_2s13->GetNbinsX(); ++b) if (hh_2s13->GetBinContent(b)==0) hh_2s13->SetBinError(b, 0.); +for (int b = 1; b <= hh_sing_no1a->GetNbinsX(); ++b) if (hh_sing_no1a->GetBinContent(b)==0) hh_sing_no1a->SetBinError(b, 0.); TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz"; +TString the_ttl_no1a = "CSC L1 trigger rates in 1.2<|#eta|<2.14;p_{T}^{cut}, GeV/c;rate, kHz"; +TString the_ttl_all = "CSC L1 trigger rates in 1.<|#eta|<2.4;p_{T}^{cut}, GeV/c;rate, kHz"; hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); -hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); -hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); +hh_all = setPTHisto(hh_all, the_ttl_all, kGreen+3, 1, 1); +hh_no1a = setPTHisto(hh_no1a, the_ttl_no1a, kGreen+3, 1, 1); hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); +hh_2s123 = setPTHisto(hh_2s123, the_ttl, kGreen+3, 1, 1); +hh_2s13 = setPTHisto(hh_2s13, the_ttl, kGreen+3, 1, 1); +hh_sing_no1a = setPTHisto(hh_sing_no1a, the_ttl_no1a, kGreen+3, 1, 1); -result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); +result_def_gmtsing = setPTHisto(result_def_gmtsing, the_ttl, kAzure+1, 1, 1); +result_def_gmtsing_no1a = setPTHisto(result_def_gmtsing_no1a, the_ttl_no1a, kAzure+1, 1, 1); result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); -result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); -result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); -result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); -result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); +result_def_2s123 = setPTHisto(result_def_2s123, the_ttl, kAzure+9, 1, 1); +result_def_2s13 = setPTHisto(result_def_2s13, the_ttl, kAzure+9, 1, 1); +result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl_all, kAzure+9, 1, 1); +result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl_all, kAzure+9, 1, 1); +result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl_no1a, kAzure+9, 1, 1); +result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl_no1a, kAzure+9, 1, 1); @@ -187,16 +248,24 @@ hh->SetFillColor(kGreen+4); hh_all->SetFillColor(kGreen+4); hh_no1a->SetFillColor(kGreen+4); hh_2s1b->SetFillColor(kGreen+4); +hh_2s123->SetFillColor(kGreen+4); +hh_2s13->SetFillColor(kGreen+4); +hh_sing_no1a->SetFillColor(kGreen+4); result_def_2s__pat2 = (TH1D*) result_def_2s->Clone("result_def_2s__pat2"); -result_def_3s__pat2 = (TH1D*) result_def->Clone("result_def_2s__pat2"); +result_def_3s__pat2 = (TH1D*) result_def->Clone("result_def_3s__pat2"); result_def_2s1b__pat2 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat2"); +result_def_2s123__pat2 = (TH1D*) result_def_2s123->Clone("result_def_2s123__pat2"); +result_def_2s13__pat2 = (TH1D*) result_def_2s13->Clone("result_def_2s13__pat2"); result_def_3s1b__pat2 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat2"); -result_gmtsing__pat2 = (TH1D*) result_gmtsing->Clone("result_gmtsing__pat2");; +result_def_gmtsing__pat2 = (TH1D*) result_def_gmtsing->Clone("result_def_gmtsing__pat2");; +result_def_gmtsing_no1a__pat2 = (TH1D*) result_def_gmtsing_no1a->Clone("result_def_gmtsing_no1a__pat2");; result_gem_2s1b__pat2 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat2"); -result_gem_3s1b__pat2 = (TH1D*) hh->Clone("result_gem_2s1b__pat2"); - +result_gem_2s123__pat2 = (TH1D*) hh_2s123->Clone("result_gem_2s123__pat2"); +result_gem_2s13__pat2 = (TH1D*) hh_2s13->Clone("result_gem_2s13__pat2"); +result_gem_3s1b__pat2 = (TH1D*) hh->Clone("result_gem_3s1b__pat2"); +result_gem_sing_no1a__pat2 = (TH1D*)hh_sing_no1a->Clone("result_gem_sing_no1a__pat2"); // --- def-3s gem-3s-3s1b @@ -387,7 +456,7 @@ hh_ratio->Draw("e1"); gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); -// --- eta 1-2.1 def-3s gem-3s-3s1b +// --- eta 1.2-2.1 def-3s gem-3s-3s1b ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); result_def_eta_no1a->Draw("e3"); @@ -397,23 +466,23 @@ TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->AddEntry(result_def_eta_no1a,"default emulator","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); +leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.2<|#eta|<2.4",""); leg->AddEntry(hh_no1a,"with GEM match","f"); leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png"); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); -// --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b +// --- eta 1.2-2.1 def-3s-3s1b gem-3s-3s1b ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); result_def_eta_no1a_3s1b->Draw("e3"); @@ -425,19 +494,19 @@ leg->SetFillStyle(0); leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); leg->AddEntry(hh_no1a,"with GEM match","f"); leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.2<|#eta|<2.14",""); leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png"); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); @@ -527,7 +596,7 @@ hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); -result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); +result_def_gmtsing = setPTHisto(result_def_gmtsing, the_ttl, kAzure+1, 1, 1); result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); @@ -546,13 +615,13 @@ hh_no1a->SetFillColor(kGreen+4); hh_2s1b->SetFillColor(kGreen+4); result_def_2s__pat8 = (TH1D*) result_def_2s->Clone("result_def_2s__pat8"); -result_def_3s__pat8 = (TH1D*) result_def->Clone("result_def_2s__pat8"); +result_def_3s__pat8 = (TH1D*) result_def->Clone("result_def_3s__pat8"); result_def_2s1b__pat8 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat8"); result_def_3s1b__pat8 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat8"); -result_gmtsing__pat8 = (TH1D*) result_gmtsing->Clone("result_gmtsing__pat8");; +result_def_gmtsing__pat8 = (TH1D*) result_def_gmtsing->Clone("result_def_gmtsing__pat8");; result_gem_2s1b__pat8 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat8"); -result_gem_3s1b__pat8 = (TH1D*) hh->Clone("result_gem_2s1b__pat8"); +result_gem_3s1b__pat8 = (TH1D*) hh->Clone("result_gem_3s1b__pat8"); // --- def-3s gem-3s-3s1b @@ -743,7 +812,7 @@ hh_ratio->Draw("e1"); gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); -// --- eta 1-2.1 def-3s gem-3s-3s1b +// --- eta 1.2-2.1 def-3s gem-3s-3s1b ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); result_def_eta_no1a->Draw("e3"); @@ -753,23 +822,23 @@ TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->AddEntry(result_def_eta_no1a,"default emulator","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); +leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.2<|#eta|<2.4",""); leg->AddEntry(hh_no1a,"with GEM match","f"); leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png"); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); -// --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b +// --- eta 1.2-2.1 def-3s-3s1b gem-3s-3s1b ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); result_def_eta_no1a_3s1b->Draw("e3"); @@ -781,19 +850,19 @@ leg->SetFillStyle(0); leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); leg->AddEntry(hh_no1a,"with GEM match","f"); leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.2<|#eta|<2.14",""); leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png"); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); @@ -803,6 +872,8 @@ gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstei result_def_2s__pat2->SetFillColor(kAzure+2); result_def_2s1b__pat2->SetFillColor(kAzure+5); +result_def_2s123__pat2->SetFillColor(kViolet+3); +result_def_2s13__pat2->SetFillColor(kViolet+1); result_def_3s__pat2->SetFillColor(kAzure+3); result_def_3s1b__pat2->SetFillColor(kAzure+6); @@ -811,29 +882,61 @@ result_def_2s1b__pat8->SetFillColor(kViolet+3); result_def_3s__pat8->SetFillColor(kViolet+1); result_def_3s1b__pat8->SetFillColor(kViolet+4); -result_gmtsing__pat2->SetFillColor(kRed); -result_gmtsing__pat8->SetFillColor(kRed); +result_def_gmtsing__pat2->SetFillColor(kRed); +result_def_gmtsing__pat8->SetFillColor(kRed); + +result_def_gmtsing_no1a__pat2->SetFillColor(kRed); result_gem_2s1b__pat2->SetFillColor(kGreen+1); +result_gem_2s123__pat2->SetFillColor(kGreen-2); +result_gem_2s13__pat2->SetFillColor(kGreen-3); result_gem_3s1b__pat2->SetFillColor(kGreen+3); result_gem_2s1b__pat8->SetFillColor(kGreen-2); result_gem_3s1b__pat8->SetFillColor(kGreen-3); +result_gem_sing_no1a__pat2->SetFillColor(kGreen+1); + /* result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); -result_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 1000.); -result_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 1000.); +result_def_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 1000.); +result_def_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 1000.); */ result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); -result_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 5000.); -result_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 5000.); - +result_gem_2s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); +result_gem_3s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); +result_def_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 5000.); +result_def_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 5000.); + +result_def_gmtsing_no1a__pat2->GetYaxis()->SetRangeUser(1., 8000.); + +bool get_ptshift = true; +TH1D* result_gem_3s1b__pat2_ptshift, *result_gem_2s1b__pat2_ptshift; +TH1D* result_gem_3s1b__pat2_ptshiftX, *result_gem_2s1b__pat2_ptshiftX; +TFile *fsave; +TFile *fsaveX; +if (get_ptshift) { +fsave = new TFile("gem_3plus_ptshift.root"); +result_gem_3s1b__pat2__ptshift = (TH1D*) fsave->Get("result_gem_3s1b__pat2")->Clone("result_gem_3s1b__pat2__ptshift"); +result_gem_3s1b__pat2__ptshift->SetFillColor(kGreen-5); +result_gem_3s1b__pat2__ptshift->SetLineColor(kGreen-5); +result_gem_2s1b__pat2__ptshift = (TH1D*) fsave->Get("result_gem_2s1b__pat2")->Clone("result_gem_2s1b__pat2__ptshift"); +result_gem_2s1b__pat2__ptshift->SetFillColor(kGreen-5); +result_gem_2s1b__pat2__ptshift->SetLineColor(kGreen-5); + +fsaveX = new TFile("gem_3plus_ptshiftX.root"); +result_gem_3s1b__pat2__ptshiftX = (TH1D*) fsaveX->Get("result_gem_3s1b__pat2")->Clone("result_gem_3s1b__pat2__ptshiftX"); +result_gem_3s1b__pat2__ptshiftX->SetFillColor(kGreen-5); +result_gem_3s1b__pat2__ptshiftX->SetLineColor(kGreen-5); +result_gem_2s1b__pat2__ptshiftX = (TH1D*) fsaveX->Get("result_gem_2s1b__pat2")->Clone("result_gem_2s1b__pat2__ptshiftX"); +result_gem_2s1b__pat2__ptshiftX->SetFillColor(kGreen-5); +result_gem_2s1b__pat2__ptshiftX->SetLineColor(kGreen-5); +} ///----- 3 stubs @@ -868,13 +971,13 @@ gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2__ ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); result_def_3s__pat2->Draw("e3"); result_def_3s1b__pat2->Draw("same e3"); -result_gmtsing__pat2->Draw("same e3"); +result_def_gmtsing__pat2->Draw("same e3"); result_gem_3s1b__pat2->Draw("same e3"); TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); -leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); +leg->AddEntry(result_def_gmtsing__pat2,"GMT single Mu selection","f"); leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); leg->AddEntry(result_def_3s__pat2,"any stubs","f"); leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); @@ -886,12 +989,64 @@ drawPULabel(); gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2.png"); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); +hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_gmtsing__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio.png"); + +if (get_ptshift) { //----- + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_gem_3s1b__pat2->Draw("e3"); +result_gem_3s1b__pat2__ptshift->Draw("same e3"); + +TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); +leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub",""); +leg->AddEntry(result_gem_3s1b__pat2,"#Delta#phi(GEM.LCT) as for PT threshold","f"); +leg->AddEntry(result_gem_3s1b__pat2__ptshift,"tighter #Delta#phi(GEM.LCT)","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_tightGEM__Frankenstein_pat2.png"); + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(result_gem_3s1b__pat2__ptshift, result_gem_3s1b__pat2, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_tightGEM__Frankenstein_pat2__ratio.png"); + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_gem_3s1b__pat2->Draw("e3"); +result_gem_3s1b__pat2__ptshiftX->Draw("same e3"); + +TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); +leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub",""); +leg->AddEntry(result_gem_3s1b__pat2,"#Delta#phi(GEM.LCT) as for PT threshold","f"); +leg->AddEntry(result_gem_3s1b__pat2__ptshiftX,"tighter #Delta#phi(GEM.LCT)","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_xtightGEM__Frankenstein_pat2.png"); + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(result_gem_3s1b__pat2__ptshiftX, result_gem_3s1b__pat2, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_xtightGEM__Frankenstein_pat2__ratio.png"); + +} //----- + + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); result_def_3s__pat8->Draw("e3"); result_def_3s1b__pat8->Draw("same e3"); @@ -964,13 +1119,13 @@ gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s1b__Frankenstein_pat2 ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); result_def_2s__pat2->Draw("e3"); result_def_2s1b__pat2->Draw("same e3"); -result_gmtsing__pat2->Draw("same e3"); +result_def_gmtsing__pat2->Draw("same e3"); result_gem_2s1b__pat2->Draw("same e3"); TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); -leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); +leg->AddEntry(result_def_gmtsing__pat2,"GMT single Mu selection","f"); leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); leg->AddEntry(result_def_2s__pat2,"any stubs","f"); leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); @@ -982,12 +1137,69 @@ drawPULabel(); gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2.png"); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); +hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_gmtsing__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio.png"); + + +if (get_ptshift) { //----- + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_gem_2s1b__pat2->Draw("e3"); +result_gem_2s1b__pat2__ptshift->Draw("same e3"); + +TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); +leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub",""); +leg->AddEntry(result_gem_2s1b__pat2,"#Delta#phi(GEM.LCT) as for PT threshold","f"); +leg->AddEntry(result_gem_2s1b__pat2__ptshift,"tighter #Delta#phi(GEM.LCT)","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_tightGEM__Frankenstein_pat2.png"); + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(result_gem_2s1b__pat2__ptshift, result_gem_2s1b__pat2, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_tightGEM__Frankenstein_pat2__ratio.png"); + +fsave->Close(); + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_gem_2s1b__pat2->Draw("e3"); +result_gem_2s1b__pat2__ptshiftX->Draw("same e3"); + +TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); +leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub",""); +leg->AddEntry(result_gem_2s1b__pat2,"#Delta#phi(GEM.LCT) as for PT threshold","f"); +leg->AddEntry(result_gem_2s1b__pat2__ptshiftX,"tighter #Delta#phi(GEM.LCT)","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_xtightGEM__Frankenstein_pat2.png"); + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(result_gem_2s1b__pat2__ptshiftX, result_gem_2s1b__pat2, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_xtightGEM__Frankenstein_pat2__ratio.png"); + +fsaveX->Close(); + +} //----- + + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); result_def_2s__pat8->Draw("e3"); result_def_2s1b__pat8->Draw("same e3"); @@ -1035,17 +1247,17 @@ gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein.png"); ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_gmtsing__pat2->Draw("e3"); +result_def_gmtsing__pat2->Draw("e3"); result_def_2s__pat2->Draw("same e3"); result_def_2s1b__pat2->Draw("same e3"); result_def_3s__pat2->Draw("same e3"); result_def_3s1b__pat2->Draw("same e3"); -result_gmtsing__pat2->Draw("same e3"); +result_def_gmtsing__pat2->Draw("same e3"); TLegend *leg = new TLegend(0.49,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); -leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); +leg->AddEntry(result_def_gmtsing__pat2,"GMT single Mu selection","f"); leg->AddEntry(result_def_2s__pat2,"Tracks: #geq2 stubs","f"); leg->AddEntry(result_def_2s1b__pat2," #geq2 with ME1/b stubs","f"); leg->AddEntry(result_def_3s__pat2," #geq3 stubs","f"); @@ -1056,9 +1268,9 @@ drawPULabel(); gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__GMT__Frankenstein_pat2.png"); -///----- 2 & 3 stubs +///----- 2 & 3 stubs ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); @@ -1075,7 +1287,7 @@ leg->AddEntry(result_def_3s__pat2,"CSCTF tracks with:",""); leg->AddEntry(result_def_3s__pat2,"3+ stubs","f"); leg->AddEntry(result_def_3s1b__pat2,"3+ stubs with ME1/b stub","f"); leg->AddEntry(result_gem_2s1b__pat2,"2+ stubs with (ME1/b + GEM) stub","f"); -leg->AddEntry(result_gem_2s1b__pat2,"3+ stubs with (ME1/b + GEM) stub","f"); +leg->AddEntry(result_gem_3s1b__pat2,"3+ stubs with (ME1/b + GEM) stub","f"); leg->Draw(); drawPULabel(); @@ -1083,8 +1295,73 @@ drawPULabel(); gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s__Frankenstein_pat2.png"); -return; +///----- 2 & 123 & 13 & 3 stubs -} +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +//result_def_3s__pat2->Draw("e3"); +//result_def_2s1b__pat2->Draw("same e2"); +//result_def_2s123__pat2->Draw("same e2"); +//result_def_2s13__pat2->Draw("same e2"); +//result_def_3s1b__pat2->Draw("same e3"); +result_gem_2s1b__pat2->Draw("e3"); +result_gem_2s123__pat2->Draw("same e3"); +result_gem_2s13__pat2->Draw("same e3"); +result_gem_3s1b__pat2->Draw("same e3"); + + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_gem_2s1b__pat2,"CSCTF tracks that have",""); +leg->AddEntry(result_gem_2s1b__pat2,"(ME1/b + GEM) stub, with total ",""); +leg->AddEntry(result_gem_2s1b__pat2,"2+ stubs","f"); +leg->AddEntry(result_gem_2s123__pat2,"2+ stubs (no ME1-4 tracks)","f"); +leg->AddEntry(result_gem_2s13__pat2,"2+ stubs (no ME1-2 and ME1-4)","f"); +leg->AddEntry(result_gem_3s1b__pat2,"3+ stubs","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s123__Frankenstein_pat2.png"); + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(result_gem_2s123__pat2, result_gem_2s1b__pat2, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s123__Frankenstein_pat2__ratio.png"); + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(result_gem_2s13__pat2, result_gem_3s1b__pat2, "", 0.,1.4); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s2s13__Frankenstein_pat2__ratio.png"); + + +///----- GMT 1.2 eta 2.14 + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_gmtsing_no1a__pat2->Draw("e3"); +result_gem_sing_no1a__pat2->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->SetHeader("GMT Single tracks 1.2<|#eta|<2.14"); +leg->AddEntry(result_def_gmtsing_no1a__pat2,"whole #eta range","f"); +leg->AddEntry(result_gem_sing_no1a__pat2,"Whole range except in ME1/b:","f"); +leg->AddEntry(result_gem_sing_no1a__pat2,"3+ stubs with (ME1/b + GEM)",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__sequential__GMT2s1b__Frankenstein_pat2.png"); + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(result_gem_sing_no1a__pat2, result_def_gmtsing_no1a__pat2, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__sequential__GMT2s1b__Frankenstein_pat2__ratio.png"); + +return; + +} From 9a2b3a280144f0b969bc00c58cb3196517055ce5 Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Mon, 5 Aug 2013 19:01:43 -0500 Subject: [PATCH 016/182] merging some updates to drawplot_frankenstein_ptshift.C since giving it to A and S --- .../scripts/drawplot_frankenstein_ptshift.C | 734 ++++++++++++++---- 1 file changed, 578 insertions(+), 156 deletions(-) diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshift.C b/SimMuL1/scripts/drawplot_frankenstein_ptshift.C index ef042d4340ce1..703bc3fe6ab30 100644 --- a/SimMuL1/scripts/drawplot_frankenstein_ptshift.C +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshift.C @@ -1,68 +1,153 @@ +gROOT->ProcessLine(".L drawplot_gmtrt.C"); + /* .L drawplot_gmtrt.C */ +void getPTHistos(TString dname) { -//gem_dir = "gemPT/"; gem_label = "gem98"; +TString f_def = gem_dir; +TString f_gem = gem_dir; + +if (dname.Contains("_pat8")) f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root"; +if (dname == "minbias_pt05_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat8.root"; +if (dname == "minbias_pt06_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat8.root"; +if (dname == "minbias_pt10_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat8.root"; +if (dname == "minbias_pt15_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat8.root"; +if (dname == "minbias_pt20_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat8.root"; +if (dname == "minbias_pt30_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat8.root"; +if (dname == "minbias_pt40_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat8.root"; + +if (dname.Contains("_pat2")) f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; +if (dname == "minbias_pt05_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat2.root"; +if (dname == "minbias_pt06_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat2.root"; +if (dname == "minbias_pt10_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat2.root"; +if (dname == "minbias_pt15_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat2.root"; +if (dname == "minbias_pt20_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat2.root"; +if (dname == "minbias_pt30_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat2.root"; +if (dname == "minbias_pt40_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat2.root"; + +result_def = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_1b", "_def"); +result_def_2s = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_2s_1b", "_def"); +result_def_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_def"); +result_def_2s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_def"); +result_def_eta_all = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s", "_def"); +result_def_eta_all_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_def"); +result_def_eta_no1a = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_no1a", "_def"); +result_def_eta_no1a_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_def"); +result_gmtsing = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); + +result_gem = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_gem"); +result_gem_2s1b = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_gem"); +result_gem_eta_all = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_gem"); +result_gem_eta_no1a = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_gem"); +//result_gmtsing = getPTHisto(f_gem, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); +} -gem_dir = "gemPT95/"; gem_label = "gem95"; -// ********** PAT2 ********** -drawplot_gmtrt("minbias_pt10_pat2"); -hh = (TH1D*)result_gem->Clone("gem_new"); -hh->SetFillColor(kGreen+4); -for (int b = hh->FindBin(10.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); -hh_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all"); -hh_all->SetFillColor(kGreen+4); -for (int b = hh_all->FindBin(10.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); -hh_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a"); -hh_no1a->SetFillColor(kGreen+4); -for (int b = hh_no1a->FindBin(10.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); -hh_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b"); -hh_2s1b->SetFillColor(kGreen+4); -for (int b = hh_2s1b->FindBin(10.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); +void drawplot_frankenstein_ptshift() +{ +gem_dir = "gemPT/"; gem_label = "gem98"; + +//gem_dir = "gem95/"; gem_label = "gem95"; + +//do_not_print = true; + +gROOT->SetBatch(true); + +//gStyle->SetStatW(0.13); +//gStyle->SetStatH(0.08); +gStyle->SetStatW(0.07); +gStyle->SetStatH(0.06); -drawplot_gmtrt("minbias_pt15_pat2"); +gStyle->SetOptStat(0); + +gStyle->SetTitleStyle(0); +gStyle->SetTitleAlign(13);// coord in top left +gStyle->SetTitleX(0.); +gStyle->SetTitleY(1.); +gStyle->SetTitleW(1); +gStyle->SetTitleH(0.058); +gStyle->SetTitleBorderSize(0); + +gStyle->SetPadLeftMargin(0.126); +gStyle->SetPadRightMargin(0.04); +gStyle->SetPadTopMargin(0.06); +gStyle->SetPadBottomMargin(0.13); + +gStyle->SetMarkerStyle(1); + +TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; +gPad->SetLogx(1); +gPad->SetGridx(1);gPad->SetGridy(1); + +TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; +gPad->SetLogx(1);gPad->SetLogy(1); +gPad->SetGridx(1);gPad->SetGridy(1); + + +// ********** PAT2 ********** + +getPTHistos("minbias_pt10_pat2"); +hh = (TH1D*)result_def_3s1b->Clone("gem_new"); +for (int b = hh->FindBin(7.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); +hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); +for (int b = hh_all->FindBin(7.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); +hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); +for (int b = hh_no1a->FindBin(7.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); +hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); +for (int b = hh_2s1b->FindBin(7.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); + +h06 = (TH1D*)result_gem->Clone("gem_new_06"); +for (int b = h06->FindBin(7.01); b < h06->FindBin(10.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} +h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); +for (int b = h06_all->FindBin(7.01); b < h06_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} +h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); +for (int b = h06_no1a->FindBin(7.01); b < h06_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} +h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); +for (int b = h06_2s1b->FindBin(7.01); b < h06_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} + +getPTHistos("minbias_pt15_pat2"); +h10 = (TH1D*)result_gem->Clone("gem10"); +for (int b = h10->FindBin(10.01); b < h10->FindBin(15.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} +h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); +for (int b = h10_all->FindBin(10.01); b < h10_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} +h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); +for (int b = h10_no1a->FindBin(10.01); b < h10_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} +h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); +for (int b = h10_2s1b->FindBin(10.01); b < h10_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} + +getPTHistos("minbias_pt20_pat2"); h15 = (TH1D*)result_gem->Clone("gem15"); -for (int b = h15->FindBin(10.01); b < h15->FindBin(15.01); ++b) hh->SetBinContent(b, h15->GetBinContent(b)); +for (int b = h15->FindBin(15.01); b < h15->FindBin(20.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); -for (int b = h15_all->FindBin(10.01); b < h15_all->FindBin(15.01); ++b) hh_all->SetBinContent(b, h15_all->GetBinContent(b)); +for (int b = h15_all->FindBin(15.01); b < h15_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); -for (int b = h15_no1a->FindBin(10.01); b < h15_no1a->FindBin(15.01); ++b) hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); +for (int b = h15_no1a->FindBin(15.01); b < h15_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); -for (int b = h15_2s1b->FindBin(10.01); b < h15_2s1b->FindBin(15.01); ++b) hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); +for (int b = h15_2s1b->FindBin(15.01); b < h15_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} -drawplot_gmtrt("minbias_pt20_pat2"); +getPTHistos("minbias_pt30_pat2"); h20 = (TH1D*)result_gem->Clone("gem20"); -for (int b = h20->FindBin(15.01); b < h20->FindBin(20.01); ++b) hh->SetBinContent(b, h20->GetBinContent(b)); +for (int b = h20->FindBin(20.01); b < h20->FindBin(30.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); -for (int b = h20_all->FindBin(15.01); b < h20_all->FindBin(20.01); ++b) hh_all->SetBinContent(b, h20_all->GetBinContent(b)); +for (int b = h20_all->FindBin(20.01); b < h20_all->FindBin(30.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); -for (int b = h20_no1a->FindBin(15.01); b < h20_no1a->FindBin(20.01); ++b) hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); +for (int b = h20_no1a->FindBin(20.01); b < h20_no1a->FindBin(30.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); -for (int b = h20_2s1b->FindBin(15.01); b < h20_2s1b->FindBin(20.01); ++b) hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); +for (int b = h20_2s1b->FindBin(20.01); b < h20_2s1b->FindBin(30.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} -drawplot_gmtrt("minbias_pt30_pat2"); +getPTHistos("minbias_pt40_pat2"); h30 = (TH1D*)result_gem->Clone("gem30"); -for (int b = h30->FindBin(20.01); b <= h30->FindBin(30.01); ++b) hh->SetBinContent(b, h30->GetBinContent(b)); +for (int b = h30->FindBin(30.01); b <= h30->GetNbinsX(); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); -for (int b = h30_all->FindBin(20.01); b < h30_all->FindBin(30.01); ++b) hh_all->SetBinContent(b, h30_all->GetBinContent(b)); +for (int b = h30_all->FindBin(30.01); b < h30_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); -for (int b = h30_no1a->FindBin(20.01); b < h30_no1a->FindBin(30.01); ++b) hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); +for (int b = h30_no1a->FindBin(30.01); b < h30_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); -for (int b = h30_2s1b->FindBin(20.01); b < h30_2s1b->FindBin(30.01); ++b) hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); - -drawplot_gmtrt("minbias_pt40_pat2"); -h40 = (TH1D*)result_gem->Clone("gem30"); -for (int b = h40->FindBin(30.01); b <= h40->GetNbinsX(); ++b) hh->SetBinContent(b, h40->GetBinContent(b)); -h40_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_40"); -for (int b = h40_all->FindBin(30.01); b < h40_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, h40_all->GetBinContent(b)); -h40_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_40"); -for (int b = h40_no1a->FindBin(30.01); b < h40_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, h40_no1a->GetBinContent(b)); -h40_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_40"); -for (int b = h40_2s1b->FindBin(30.01); b < h40_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, h40_2s1b->GetBinContent(b)); +for (int b = h30_2s1b->FindBin(30.01); b < h30_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); @@ -70,6 +155,42 @@ for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0 for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); +TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz"; + +hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); +hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); +hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); +hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); + +result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); + +result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); +result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); +result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); +result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); +result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); +result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); +result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); +result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); + + + +hh->SetFillColor(kGreen+4); +hh_all->SetFillColor(kGreen+4); +hh_no1a->SetFillColor(kGreen+4); +hh_2s1b->SetFillColor(kGreen+4); + +result_def_2s__pat2 = (TH1D*) result_def_2s->Clone("result_def_2s__pat2"); +result_def_3s__pat2 = (TH1D*) result_def->Clone("result_def_3s__pat2"); +result_def_2s1b__pat2 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat2"); +result_def_3s1b__pat2 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat2"); +result_gmtsing__pat2 = (TH1D*) result_gmtsing->Clone("result_gmtsing__pat2");; + +result_gem_2s1b__pat2 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat2"); +result_gem_3s1b__pat2 = (TH1D*) hh->Clone("result_gem_3s1b__pat2"); + + + // --- def-3s gem-3s-3s1b ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); @@ -80,14 +201,12 @@ TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->AddEntry(result_def,"default emulator","f"); -leg->AddEntry(result_def,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(hh,"with GEM match","f"); leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png"); @@ -110,13 +229,11 @@ leg->SetFillStyle(0); leg->AddEntry(result_def_3s1b,"default emulator","f"); leg->AddEntry(hh,"with GEM match","f"); leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png"); @@ -139,13 +256,11 @@ leg->SetFillStyle(0); leg->AddEntry(result_def_2s1b,"default emulator","f"); leg->AddEntry(hh_2s1b,"with GEM match","f"); leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_2s1b,"with >=2 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2.png"); @@ -166,15 +281,13 @@ TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->AddEntry(result_def,"default emulator","f"); -leg->AddEntry(result_def,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(hh_2s1b,"Tracks: with >=2 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2.png"); @@ -195,16 +308,14 @@ TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->AddEntry(result_def_3s1b,"default emulator","f"); -leg->AddEntry(result_def_3s1b,"Tracks req. >=3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(hh_2s1b,"Tracks req. >=2 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2.png"); @@ -225,14 +336,12 @@ TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->AddEntry(result_def_eta_all,"default emulator","f"); -leg->AddEntry(result_def_eta_all,"Tracks: with >=3 stubs in 1.<|#eta|<2.4",""); +leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); leg->AddEntry(hh_all,"with GEM match","f"); leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png"); @@ -255,13 +364,11 @@ leg->SetFillStyle(0); leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); leg->AddEntry(hh_all,"with GEM match","f"); leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_all_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png"); @@ -282,14 +389,12 @@ TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->AddEntry(result_def_eta_no1a,"default emulator","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: with >=3 stubs in 1.<|#eta|<2.4",""); +leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); leg->AddEntry(hh_no1a,"with GEM match","f"); leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png"); @@ -312,13 +417,11 @@ leg->SetFillStyle(0); leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); leg->AddEntry(hh_no1a,"with GEM match","f"); leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_no1a_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png"); @@ -336,59 +439,64 @@ gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstei // ********** PAT8 ********** -drawplot_gmtrt("minbias_pt10_pat8"); -hh = (TH1D*)result_gem->Clone("gem_new"); -hh->SetFillColor(kGreen+4); -for (int b = hh->FindBin(10.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); -hh_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all"); -hh_all->SetFillColor(kGreen+4); -for (int b = hh_all->FindBin(10.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); -hh_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a"); -hh_no1a->SetFillColor(kGreen+4); -for (int b = hh_no1a->FindBin(10.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); -hh_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b"); -hh_2s1b->SetFillColor(kGreen+4); -for (int b = hh_2s1b->FindBin(10.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); - -drawplot_gmtrt("minbias_pt15_pat8"); +getPTHistos("minbias_pt10_pat8"); +hh = (TH1D*)result_def_3s1b->Clone("gem_new"); +for (int b = hh->FindBin(7.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); +hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); +for (int b = hh_all->FindBin(7.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); +hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); +for (int b = hh_no1a->FindBin(7.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); +hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); +for (int b = hh_2s1b->FindBin(7.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); + +h06 = (TH1D*)result_gem->Clone("gem_new_06"); +for (int b = h06->FindBin(7.01); b < h06->FindBin(10.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} +h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); +for (int b = h06_all->FindBin(7.01); b < h06_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} +h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); +for (int b = h06_no1a->FindBin(7.01); b < h06_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} +h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); +for (int b = h06_2s1b->FindBin(7.01); b < h06_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} + +getPTHistos("minbias_pt15_pat8"); +h10 = (TH1D*)result_gem->Clone("gem10"); +for (int b = h10->FindBin(10.01); b < h10->FindBin(15.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} +h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); +for (int b = h10_all->FindBin(10.01); b < h10_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} +h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); +for (int b = h10_no1a->FindBin(10.01); b < h10_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} +h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); +for (int b = h10_2s1b->FindBin(10.01); b < h10_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} + +getPTHistos("minbias_pt20_pat8"); h15 = (TH1D*)result_gem->Clone("gem15"); -for (int b = h15->FindBin(10.01); b < h15->FindBin(15.01); ++b) hh->SetBinContent(b, h15->GetBinContent(b)); +for (int b = h15->FindBin(15.01); b < h15->FindBin(20.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); -for (int b = h15_all->FindBin(10.01); b < h15_all->FindBin(15.01); ++b) hh_all->SetBinContent(b, h15_all->GetBinContent(b)); +for (int b = h15_all->FindBin(15.01); b < h15_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); -for (int b = h15_no1a->FindBin(10.01); b < h15_no1a->FindBin(15.01); ++b) hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); +for (int b = h15_no1a->FindBin(15.01); b < h15_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); -for (int b = h15_2s1b->FindBin(10.01); b < h15_2s1b->FindBin(15.01); ++b) hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); +for (int b = h15_2s1b->FindBin(15.01); b < h15_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} -drawplot_gmtrt("minbias_pt20_pat8"); +getPTHistos("minbias_pt30_pat8"); h20 = (TH1D*)result_gem->Clone("gem20"); -for (int b = h20->FindBin(15.01); b < h20->FindBin(20.01); ++b) hh->SetBinContent(b, h20->GetBinContent(b)); +for (int b = h20->FindBin(20.01); b < h20->FindBin(30.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); -for (int b = h20_all->FindBin(15.01); b < h20_all->FindBin(20.01); ++b) hh_all->SetBinContent(b, h20_all->GetBinContent(b)); +for (int b = h20_all->FindBin(20.01); b < h20_all->FindBin(30.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); -for (int b = h20_no1a->FindBin(15.01); b < h20_no1a->FindBin(20.01); ++b) hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); +for (int b = h20_no1a->FindBin(20.01); b < h20_no1a->FindBin(30.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); -for (int b = h20_2s1b->FindBin(15.01); b < h20_2s1b->FindBin(20.01); ++b) hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); +for (int b = h20_2s1b->FindBin(20.01); b < h20_2s1b->FindBin(30.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} -drawplot_gmtrt("minbias_pt30_pat8"); +getPTHistos("minbias_pt40_pat8"); h30 = (TH1D*)result_gem->Clone("gem30"); -for (int b = h30->FindBin(20.01); b <= h30->FindBin(30.01); ++b) hh->SetBinContent(b, h30->GetBinContent(b)); +for (int b = h30->FindBin(30.01); b <= h30->GetNbinsX(); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); -for (int b = h30_all->FindBin(20.01); b < h30_all->FindBin(30.01); ++b) hh_all->SetBinContent(b, h30_all->GetBinContent(b)); +for (int b = h30_all->FindBin(30.01); b < h30_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); -for (int b = h30_no1a->FindBin(20.01); b < h30_no1a->FindBin(30.01); ++b) hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); +for (int b = h30_no1a->FindBin(30.01); b < h30_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); -for (int b = h30_2s1b->FindBin(20.01); b < h30_2s1b->FindBin(30.01); ++b) hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); - -drawplot_gmtrt("minbias_pt40_pat8"); -h40 = (TH1D*)result_gem->Clone("gem30"); -for (int b = h40->FindBin(30.01); b <= h40->GetNbinsX(); ++b) hh->SetBinContent(b, h40->GetBinContent(b)); -h40_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_40"); -for (int b = h40_all->FindBin(30.01); b < h40_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, h40_all->GetBinContent(b)); -h40_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_40"); -for (int b = h40_no1a->FindBin(30.01); b < h40_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, h40_no1a->GetBinContent(b)); -h40_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_40"); -for (int b = h40_2s1b->FindBin(30.01); b < h40_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, h40_2s1b->GetBinContent(b)); +for (int b = h30_2s1b->FindBin(30.01); b < h30_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); @@ -396,6 +504,39 @@ for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0 for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); +hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); +hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); +hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); +hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); + +result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); + +result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); +result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); +result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); +result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); +result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); +result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); +result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); +result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); + + + +hh->SetFillColor(kGreen+4); +hh_all->SetFillColor(kGreen+4); +hh_no1a->SetFillColor(kGreen+4); +hh_2s1b->SetFillColor(kGreen+4); + +result_def_2s__pat8 = (TH1D*) result_def_2s->Clone("result_def_2s__pat8"); +result_def_3s__pat8 = (TH1D*) result_def->Clone("result_def_3s__pat8"); +result_def_2s1b__pat8 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat8"); +result_def_3s1b__pat8 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat8"); +result_gmtsing__pat8 = (TH1D*) result_gmtsing->Clone("result_gmtsing__pat8");; + +result_gem_2s1b__pat8 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat8"); +result_gem_3s1b__pat8 = (TH1D*) hh->Clone("result_gem_3s1b__pat8"); + + // --- def-3s gem-3s-3s1b ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); @@ -406,14 +547,12 @@ TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->AddEntry(result_def,"default emulator","f"); -leg->AddEntry(result_def,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(hh,"with GEM match","f"); leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png"); @@ -436,13 +575,11 @@ leg->SetFillStyle(0); leg->AddEntry(result_def_3s1b,"default emulator","f"); leg->AddEntry(hh,"with GEM match","f"); leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png"); @@ -465,13 +602,11 @@ leg->SetFillStyle(0); leg->AddEntry(result_def_2s1b,"default emulator","f"); leg->AddEntry(hh_2s1b,"with GEM match","f"); leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_2s1b,"with >=2 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8.png"); @@ -492,15 +627,13 @@ TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->AddEntry(result_def,"default emulator","f"); -leg->AddEntry(result_def,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(hh_2s1b,"Tracks: with >=2 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8.png"); @@ -521,16 +654,14 @@ TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->AddEntry(result_def_3s1b,"default emulator","f"); -leg->AddEntry(result_def_3s1b,"Tracks req. >=3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(hh_2s1b,"Tracks req. >=2 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8.png"); @@ -551,14 +682,12 @@ TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->AddEntry(result_def_eta_all,"default emulator","f"); -leg->AddEntry(result_def_eta_all,"Tracks: with >=3 stubs in 1.<|#eta|<2.4",""); +leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); leg->AddEntry(hh_all,"with GEM match","f"); leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png"); @@ -581,13 +710,11 @@ leg->SetFillStyle(0); leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); leg->AddEntry(hh_all,"with GEM match","f"); leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_all_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png"); @@ -608,14 +735,12 @@ TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->AddEntry(result_def_eta_no1a,"default emulator","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: with >=3 stubs in 1.<|#eta|<2.4",""); +leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); leg->AddEntry(hh_no1a,"with GEM match","f"); leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png"); @@ -638,13 +763,11 @@ leg->SetFillStyle(0); leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); leg->AddEntry(hh_no1a,"with GEM match","f"); leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_no1a_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); +drawPULabel(); gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png"); @@ -655,4 +778,303 @@ hh_ratio->Draw("e1"); gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); + + + +//-------------------------- "Sequential" combinations ----------------------------- + +result_def_2s__pat2->SetFillColor(kAzure+2); +result_def_2s1b__pat2->SetFillColor(kAzure+5); +result_def_3s__pat2->SetFillColor(kAzure+3); +result_def_3s1b__pat2->SetFillColor(kAzure+6); + +result_def_2s__pat8->SetFillColor(kViolet); +result_def_2s1b__pat8->SetFillColor(kViolet+3); +result_def_3s__pat8->SetFillColor(kViolet+1); +result_def_3s1b__pat8->SetFillColor(kViolet+4); + +result_gmtsing__pat2->SetFillColor(kRed); +result_gmtsing__pat8->SetFillColor(kRed); + +result_gem_2s1b__pat2->SetFillColor(kGreen+1); +result_gem_3s1b__pat2->SetFillColor(kGreen+3); +result_gem_2s1b__pat8->SetFillColor(kGreen-2); +result_gem_3s1b__pat8->SetFillColor(kGreen-3); + +/* +result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); +result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); +result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); +result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); +result_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 1000.); +result_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 1000.); +*/ +result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); +result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); +result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); +result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); +result_gem_2s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); +result_gem_3s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); +result_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 5000.); +result_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 5000.); + + +///----- 3 stubs + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_3s__pat2->Draw("e3"); +result_def_3s1b__pat2->Draw("same e3"); +result_gem_3s1b__pat2->Draw("same e3"); + +TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); +leg->AddEntry(result_def_3s__pat2,"any stubs","f"); +leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); +leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2.png"); + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s1b__Frankenstein_pat2__ratio.png"); +hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s__pat2, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2__ratio.png"); + + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_3s__pat2->Draw("e3"); +result_def_3s1b__pat2->Draw("same e3"); +result_gmtsing__pat2->Draw("same e3"); +result_gem_3s1b__pat2->Draw("same e3"); + +TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); +leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); +leg->AddEntry(result_def_3s__pat2,"any stubs","f"); +leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); +leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2.png"); + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio.png"); + + +TFile fsave("gem_3plus_ptshift.root", "RECREATE"); +result_gem_2s1b__pat2->Write(); +result_gem_3s1b__pat2->Write(); +fsave.Write(); +fsave.Close(); + + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_3s__pat8->Draw("e3"); +result_def_3s1b__pat8->Draw("same e3"); +result_gem_3s1b__pat8->Draw("same e3"); + +TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_3s__pat8,"CSCTF tracks #geq3 stubs:",""); +leg->AddEntry(result_def_3s__pat8,"any stubs","f"); +leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub","f"); +leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat8.png"); + + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_3s__pat2->Draw("e3"); +result_def_3s__pat8->Draw("same e3"); +result_def_3s1b__pat8->Draw("same e3"); +result_gem_3s1b__pat8->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); +leg->AddEntry(result_def_3s__pat2,"any stubs","f"); +leg->AddEntry(result_def_3s__pat8,"any stubs, tight patt.","f"); +leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub, tight patt.","f"); +leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein.png"); + + +/// ----- 2 stubs + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_2s__pat2->Draw("e3"); +result_def_2s1b__pat2->Draw("same e3"); +result_gem_2s1b__pat2->Draw("same e3"); + +TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); +leg->AddEntry(result_def_2s__pat2,"any stubs","f"); +leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); +leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat2.png"); + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s1b__Frankenstein_pat2__ratio.png"); + + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_2s__pat2->Draw("e3"); +result_def_2s1b__pat2->Draw("same e3"); +result_gmtsing__pat2->Draw("same e3"); +result_gem_2s1b__pat2->Draw("same e3"); + +TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); +leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); +leg->AddEntry(result_def_2s__pat2,"any stubs","f"); +leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); +leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2.png"); + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio.png"); + + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_2s__pat8->Draw("e3"); +result_def_2s1b__pat8->Draw("same e3"); +result_gem_2s1b__pat8->Draw("same e3"); + +TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_2s__pat8,"CSCTF tracks #geq2 stubs:",""); +leg->AddEntry(result_def_2s__pat8,"any stubs","f"); +leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub","f"); +leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat8.png"); + + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_2s__pat2->Draw("e3"); +result_def_2s__pat8->Draw("same e3"); +result_def_2s1b__pat8->Draw("same e3"); +result_gem_2s1b__pat8->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); +leg->AddEntry(result_def_2s__pat2,"any stubs","f"); +leg->AddEntry(result_def_2s__pat8,"any stubs, tight patt.","f"); +leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub, tight patt.","f"); +leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein.png"); + + +/// ----- GMT current "default" single trigger + + + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_gmtsing__pat2->Draw("e3"); +result_def_2s__pat2->Draw("same e3"); +result_def_2s1b__pat2->Draw("same e3"); +result_def_3s__pat2->Draw("same e3"); +result_def_3s1b__pat2->Draw("same e3"); +result_gmtsing__pat2->Draw("same e3"); + +TLegend *leg = new TLegend(0.49,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); +leg->AddEntry(result_def_2s__pat2,"Tracks: #geq2 stubs","f"); +leg->AddEntry(result_def_2s1b__pat2," #geq2 with ME1/b stubs","f"); +leg->AddEntry(result_def_3s__pat2," #geq3 stubs","f"); +leg->AddEntry(result_def_3s1b__pat2," #geq3 with ME1/b stubs","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__GMT__Frankenstein_pat2.png"); + +///----- 2 & 3 stubs + + + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_3s__pat2->Draw("e3"); +result_def_3s1b__pat2->Draw("same e3"); +result_gem_2s1b__pat2->Draw("same e3"); +result_gem_3s1b__pat2->Draw("same e3"); + + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_3s__pat2,"CSCTF tracks with:",""); +leg->AddEntry(result_def_3s__pat2,"3+ stubs","f"); +leg->AddEntry(result_def_3s1b__pat2,"3+ stubs with ME1/b stub","f"); +leg->AddEntry(result_gem_2s1b__pat2,"2+ stubs with (ME1/b + GEM) stub","f"); +leg->AddEntry(result_gem_2s1b__pat2,"3+ stubs with (ME1/b + GEM) stub","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s__Frankenstein_pat2.png"); + + +return; + + } From f5e6c170d55a6b3f5bd9559057f7e34e56ed4011 Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Mon, 5 Aug 2013 19:04:03 -0500 Subject: [PATCH 017/182] ptshift with larger dynamic range --- .../scripts/drawplot_frankenstein_ptshiftX.C | 1081 +++++++++++++++++ 1 file changed, 1081 insertions(+) create mode 100644 SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C new file mode 100644 index 0000000000000..2949ddcba81f2 --- /dev/null +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C @@ -0,0 +1,1081 @@ +gROOT->ProcessLine(".L drawplot_gmtrt.C"); + +/* +.L drawplot_gmtrt.C + +*/ + +void getPTHistos(TString dname) +{ +TString f_def = gem_dir; +TString f_gem = gem_dir; + +if (dname.Contains("_pat8")) f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root"; +if (dname == "minbias_pt05_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat8.root"; +if (dname == "minbias_pt06_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat8.root"; +if (dname == "minbias_pt10_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat8.root"; +if (dname == "minbias_pt15_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat8.root"; +if (dname == "minbias_pt20_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat8.root"; +if (dname == "minbias_pt30_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat8.root"; +if (dname == "minbias_pt40_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat8.root"; + +if (dname.Contains("_pat2")) f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; +if (dname == "minbias_pt05_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat2.root"; +if (dname == "minbias_pt06_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat2.root"; +if (dname == "minbias_pt10_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat2.root"; +if (dname == "minbias_pt15_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat2.root"; +if (dname == "minbias_pt20_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat2.root"; +if (dname == "minbias_pt30_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat2.root"; +if (dname == "minbias_pt40_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat2.root"; + +result_def = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_1b", "_def"); +result_def_2s = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_2s_1b", "_def"); +result_def_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_def"); +result_def_2s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_def"); +result_def_eta_all = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s", "_def"); +result_def_eta_all_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_def"); +result_def_eta_no1a = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_no1a", "_def"); +result_def_eta_no1a_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_def"); +result_gmtsing = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); + +result_gem = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_gem"); +result_gem_2s1b = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_gem"); +result_gem_eta_all = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_gem"); +result_gem_eta_no1a = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_gem"); +//result_gmtsing = getPTHisto(f_gem, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); +} + + + +void drawplot_frankenstein_ptshiftX() +{ +gem_dir = "gemPTX/"; gem_label = "gem98"; + +//gem_dir = "gem95/"; gem_label = "gem95"; + +//do_not_print = true; + +gROOT->SetBatch(true); + +//gStyle->SetStatW(0.13); +//gStyle->SetStatH(0.08); +gStyle->SetStatW(0.07); +gStyle->SetStatH(0.06); + +gStyle->SetOptStat(0); + +gStyle->SetTitleStyle(0); +gStyle->SetTitleAlign(13);// coord in top left +gStyle->SetTitleX(0.); +gStyle->SetTitleY(1.); +gStyle->SetTitleW(1); +gStyle->SetTitleH(0.058); +gStyle->SetTitleBorderSize(0); + +gStyle->SetPadLeftMargin(0.126); +gStyle->SetPadRightMargin(0.04); +gStyle->SetPadTopMargin(0.06); +gStyle->SetPadBottomMargin(0.13); + +gStyle->SetMarkerStyle(1); + +TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; +gPad->SetLogx(1); +gPad->SetGridx(1);gPad->SetGridy(1); + +TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; +gPad->SetLogx(1);gPad->SetLogy(1); +gPad->SetGridx(1);gPad->SetGridy(1); + + +// ********** PAT2 ********** + +getPTHistos("minbias_pt10_pat2"); +hh = (TH1D*)result_def_3s1b->Clone("gem_new"); +for (int b = hh->FindBin(7.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); +hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); +for (int b = hh_all->FindBin(7.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); +hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); +for (int b = hh_no1a->FindBin(7.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); +hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); +for (int b = hh_2s1b->FindBin(7.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); + +h06 = (TH1D*)result_gem->Clone("gem_new_06"); +for (int b = h06->FindBin(7.01); b < h06->FindBin(8.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} +h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); +for (int b = h06_all->FindBin(7.01); b < h06_all->FindBin(8.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} +h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); +for (int b = h06_no1a->FindBin(7.01); b < h06_no1a->FindBin(8.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} +h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); +for (int b = h06_2s1b->FindBin(7.01); b < h06_2s1b->FindBin(8.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} + +getPTHistos("minbias_pt15_pat2"); +h10 = (TH1D*)result_gem->Clone("gem10"); +for (int b = h10->FindBin(8.01); b < h10->FindBin(10.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} +h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); +for (int b = h10_all->FindBin(8.01); b < h10_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} +h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); +for (int b = h10_no1a->FindBin(8.01); b < h10_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} +h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); +for (int b = h10_2s1b->FindBin(8.01); b < h10_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} + +getPTHistos("minbias_pt20_pat2"); +h15 = (TH1D*)result_gem->Clone("gem15"); +for (int b = h15->FindBin(10.01); b < h15->FindBin(15.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} +h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); +for (int b = h15_all->FindBin(10.01); b < h15_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} +h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); +for (int b = h15_no1a->FindBin(10.01); b < h15_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} +h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); +for (int b = h15_2s1b->FindBin(10.01); b < h15_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} + +getPTHistos("minbias_pt30_pat2"); +h20 = (TH1D*)result_gem->Clone("gem20"); +for (int b = h20->FindBin(15.01); b < h20->FindBin(20.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} +h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); +for (int b = h20_all->FindBin(15.01); b < h20_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} +h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); +for (int b = h20_no1a->FindBin(15.01); b < h20_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} +h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); +for (int b = h20_2s1b->FindBin(15.01); b < h20_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} + +getPTHistos("minbias_pt40_pat2"); +h30 = (TH1D*)result_gem->Clone("gem30"); +for (int b = h30->FindBin(20.01); b <= h30->GetNbinsX(); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} +h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); +for (int b = h30_all->FindBin(20.01); b < h30_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} +h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); +for (int b = h30_no1a->FindBin(20.01); b < h30_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} +h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); +for (int b = h30_2s1b->FindBin(20.01); b < h30_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} + +for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); +for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); +for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); +for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); + + +TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz"; + +hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); +hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); +hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); +hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); + +result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); + +result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); +result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); +result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); +result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); +result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); +result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); +result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); +result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); + + + +hh->SetFillColor(kGreen+4); +hh_all->SetFillColor(kGreen+4); +hh_no1a->SetFillColor(kGreen+4); +hh_2s1b->SetFillColor(kGreen+4); + +result_def_2s__pat2 = (TH1D*) result_def_2s->Clone("result_def_2s__pat2"); +result_def_3s__pat2 = (TH1D*) result_def->Clone("result_def_3s__pat2"); +result_def_2s1b__pat2 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat2"); +result_def_3s1b__pat2 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat2"); +result_gmtsing__pat2 = (TH1D*) result_gmtsing->Clone("result_gmtsing__pat2");; + +result_gem_2s1b__pat2 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat2"); +result_gem_3s1b__pat2 = (TH1D*) hh->Clone("result_gem_3s1b__pat2"); + + + +// --- def-3s gem-3s-3s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def->Draw("e3"); +hh->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def,"default emulator","f"); +leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(hh,"with GEM match","f"); +leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); + + +// --- def-3s-3s1b gem-3s-3s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_3s1b->Draw("e3"); +hh->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_3s1b,"default emulator","f"); +leg->AddEntry(hh,"with GEM match","f"); +leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); +leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); + + +// --- def-3s-2s1b gem-3s-2s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_2s1b->Draw("e3"); +hh_2s1b->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_2s1b,"default emulator","f"); +leg->AddEntry(hh_2s1b,"with GEM match","f"); +leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); +leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio.png"); + + +// --- def-3s gem-3s-2s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def->Draw("e3"); +hh_2s1b->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def,"default emulator","f"); +leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(hh_2s1b,"with GEM match","f"); +leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio.png"); + + +// --- def-3s-3s1b gem-3s-2s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_3s1b->Draw("e3"); +hh_2s1b->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_3s1b,"default emulator","f"); +leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); +leg->AddEntry(hh_2s1b,"with GEM match","f"); +leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio.png"); + + +// --- eta 1-2.4 def-3s gem-3s-3s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_eta_all->Draw("e3"); +hh_all->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_eta_all,"default emulator","f"); +leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); +leg->AddEntry(hh_all,"with GEM match","f"); +leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); + + +// --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_eta_all_3s1b->Draw("e3"); +hh_all->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); +leg->AddEntry(hh_all,"with GEM match","f"); +leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); +leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); + + +// --- eta 1-2.1 def-3s gem-3s-3s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_eta_no1a->Draw("e3"); +hh_no1a->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_eta_no1a,"default emulator","f"); +leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); +leg->AddEntry(hh_no1a,"with GEM match","f"); +leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); + + +// --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_eta_no1a_3s1b->Draw("e3"); +hh_no1a->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); +leg->AddEntry(hh_no1a,"with GEM match","f"); +leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); +leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); + + + + + + + +// ********** PAT8 ********** + +getPTHistos("minbias_pt10_pat8"); +hh = (TH1D*)result_def_3s1b->Clone("gem_new"); +for (int b = hh->FindBin(7.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); +hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); +for (int b = hh_all->FindBin(7.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); +hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); +for (int b = hh_no1a->FindBin(7.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); +hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); +for (int b = hh_2s1b->FindBin(7.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); + +h06 = (TH1D*)result_gem->Clone("gem_new_06"); +for (int b = h06->FindBin(7.01); b < h06->FindBin(8.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} +h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); +for (int b = h06_all->FindBin(7.01); b < h06_all->FindBin(8.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} +h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); +for (int b = h06_no1a->FindBin(7.01); b < h06_no1a->FindBin(8.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} +h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); +for (int b = h06_2s1b->FindBin(7.01); b < h06_2s1b->FindBin(8.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} + +getPTHistos("minbias_pt15_pat8"); +h10 = (TH1D*)result_gem->Clone("gem10"); +for (int b = h10->FindBin(8.01); b < h10->FindBin(10.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} +h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); +for (int b = h10_all->FindBin(8.01); b < h10_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} +h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); +for (int b = h10_no1a->FindBin(8.01); b < h10_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} +h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); +for (int b = h10_2s1b->FindBin(8.01); b < h10_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} + +getPTHistos("minbias_pt20_pat8"); +h15 = (TH1D*)result_gem->Clone("gem15"); +for (int b = h15->FindBin(10.01); b < h15->FindBin(15.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} +h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); +for (int b = h15_all->FindBin(10.01); b < h15_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} +h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); +for (int b = h15_no1a->FindBin(10.01); b < h15_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} +h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); +for (int b = h15_2s1b->FindBin(10.01); b < h15_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} + +getPTHistos("minbias_pt30_pat8"); +h20 = (TH1D*)result_gem->Clone("gem20"); +for (int b = h20->FindBin(15.01); b < h20->FindBin(20.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} +h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); +for (int b = h20_all->FindBin(15.01); b < h20_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} +h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); +for (int b = h20_no1a->FindBin(15.01); b < h20_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} +h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); +for (int b = h20_2s1b->FindBin(15.01); b < h20_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} + +getPTHistos("minbias_pt40_pat8"); +h30 = (TH1D*)result_gem->Clone("gem30"); +for (int b = h30->FindBin(20.01); b <= h30->GetNbinsX(); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} +h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); +for (int b = h30_all->FindBin(20.01); b < h30_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} +h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); +for (int b = h30_no1a->FindBin(20.01); b < h30_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} +h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); +for (int b = h30_2s1b->FindBin(20.01); b < h30_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} + +for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); +for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); +for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); +for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); + + +hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); +hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); +hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); +hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); + +result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); + +result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); +result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); +result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); +result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); +result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); +result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); +result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); +result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); + + + +hh->SetFillColor(kGreen+4); +hh_all->SetFillColor(kGreen+4); +hh_no1a->SetFillColor(kGreen+4); +hh_2s1b->SetFillColor(kGreen+4); + +result_def_2s__pat8 = (TH1D*) result_def_2s->Clone("result_def_2s__pat8"); +result_def_3s__pat8 = (TH1D*) result_def->Clone("result_def_3s__pat8"); +result_def_2s1b__pat8 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat8"); +result_def_3s1b__pat8 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat8"); +result_gmtsing__pat8 = (TH1D*) result_gmtsing->Clone("result_gmtsing__pat8");; + +result_gem_2s1b__pat8 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat8"); +result_gem_3s1b__pat8 = (TH1D*) hh->Clone("result_gem_3s1b__pat8"); + + +// --- def-3s gem-3s-3s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def->Draw("e3"); +hh->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def,"default emulator","f"); +leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(hh,"with GEM match","f"); +leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); + + +// --- def-3s-3s1b gem-3s-3s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_3s1b->Draw("e3"); +hh->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_3s1b,"default emulator","f"); +leg->AddEntry(hh,"with GEM match","f"); +leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); +leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); + + +// --- def-3s-2s1b gem-3s-2s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_2s1b->Draw("e3"); +hh_2s1b->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_2s1b,"default emulator","f"); +leg->AddEntry(hh_2s1b,"with GEM match","f"); +leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); +leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio.png"); + + +// --- def-3s gem-3s-2s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def->Draw("e3"); +hh_2s1b->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def,"default emulator","f"); +leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(hh_2s1b,"with GEM match","f"); +leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio.png"); + + +// --- def-3s-3s1b gem-3s-2s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_3s1b->Draw("e3"); +hh_2s1b->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_3s1b,"default emulator","f"); +leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); +leg->AddEntry(hh_2s1b,"with GEM match","f"); +leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio.png"); + + +// --- eta 1-2.4 def-3s gem-3s-3s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_eta_all->Draw("e3"); +hh_all->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_eta_all,"default emulator","f"); +leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); +leg->AddEntry(hh_all,"with GEM match","f"); +leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); + + +// --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_eta_all_3s1b->Draw("e3"); +hh_all->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); +leg->AddEntry(hh_all,"with GEM match","f"); +leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); +leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); + + +// --- eta 1-2.1 def-3s gem-3s-3s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_eta_no1a->Draw("e3"); +hh_no1a->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_eta_no1a,"default emulator","f"); +leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); +leg->AddEntry(hh_no1a,"with GEM match","f"); +leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); + + +// --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_eta_no1a_3s1b->Draw("e3"); +hh_no1a->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); +leg->AddEntry(hh_no1a,"with GEM match","f"); +leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); +leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png"); + + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); + + + + + +//-------------------------- "Sequential" combinations ----------------------------- + +result_def_2s__pat2->SetFillColor(kAzure+2); +result_def_2s1b__pat2->SetFillColor(kAzure+5); +result_def_3s__pat2->SetFillColor(kAzure+3); +result_def_3s1b__pat2->SetFillColor(kAzure+6); + +result_def_2s__pat8->SetFillColor(kViolet); +result_def_2s1b__pat8->SetFillColor(kViolet+3); +result_def_3s__pat8->SetFillColor(kViolet+1); +result_def_3s1b__pat8->SetFillColor(kViolet+4); + +result_gmtsing__pat2->SetFillColor(kRed); +result_gmtsing__pat8->SetFillColor(kRed); + +result_gem_2s1b__pat2->SetFillColor(kGreen+1); +result_gem_3s1b__pat2->SetFillColor(kGreen+3); +result_gem_2s1b__pat8->SetFillColor(kGreen-2); +result_gem_3s1b__pat8->SetFillColor(kGreen-3); + +/* +result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); +result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); +result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); +result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); +result_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 1000.); +result_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 1000.); +*/ +result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); +result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); +result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); +result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); +result_gem_2s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); +result_gem_3s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); +result_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 5000.); +result_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 5000.); + + +///----- 3 stubs + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_3s__pat2->Draw("e3"); +result_def_3s1b__pat2->Draw("same e3"); +result_gem_3s1b__pat2->Draw("same e3"); + +TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); +leg->AddEntry(result_def_3s__pat2,"any stubs","f"); +leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); +leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2.png"); + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s1b__Frankenstein_pat2__ratio.png"); +hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s__pat2, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2__ratio.png"); + + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_3s__pat2->Draw("e3"); +result_def_3s1b__pat2->Draw("same e3"); +result_gmtsing__pat2->Draw("same e3"); +result_gem_3s1b__pat2->Draw("same e3"); + +TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); +leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); +leg->AddEntry(result_def_3s__pat2,"any stubs","f"); +leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); +leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2.png"); + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio.png"); + + +TFile fsave("gem_3plus_ptshiftX.root", "RECREATE"); +result_gem_2s1b__pat2->Write(); +result_gem_3s1b__pat2->Write(); +fsave.Write(); +fsave.Close(); + + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_3s__pat8->Draw("e3"); +result_def_3s1b__pat8->Draw("same e3"); +result_gem_3s1b__pat8->Draw("same e3"); + +TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_3s__pat8,"CSCTF tracks #geq3 stubs:",""); +leg->AddEntry(result_def_3s__pat8,"any stubs","f"); +leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub","f"); +leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat8.png"); + + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_3s__pat2->Draw("e3"); +result_def_3s__pat8->Draw("same e3"); +result_def_3s1b__pat8->Draw("same e3"); +result_gem_3s1b__pat8->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); +leg->AddEntry(result_def_3s__pat2,"any stubs","f"); +leg->AddEntry(result_def_3s__pat8,"any stubs, tight patt.","f"); +leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub, tight patt.","f"); +leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein.png"); + + +/// ----- 2 stubs + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_2s__pat2->Draw("e3"); +result_def_2s1b__pat2->Draw("same e3"); +result_gem_2s1b__pat2->Draw("same e3"); + +TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); +leg->AddEntry(result_def_2s__pat2,"any stubs","f"); +leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); +leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat2.png"); + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s1b__Frankenstein_pat2__ratio.png"); + + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_2s__pat2->Draw("e3"); +result_def_2s1b__pat2->Draw("same e3"); +result_gmtsing__pat2->Draw("same e3"); +result_gem_2s1b__pat2->Draw("same e3"); + +TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); +leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); +leg->AddEntry(result_def_2s__pat2,"any stubs","f"); +leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); +leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2.png"); + +((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); +hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); +hh_ratio->Draw("e1"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio.png"); + + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_2s__pat8->Draw("e3"); +result_def_2s1b__pat8->Draw("same e3"); +result_gem_2s1b__pat8->Draw("same e3"); + +TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_2s__pat8,"CSCTF tracks #geq2 stubs:",""); +leg->AddEntry(result_def_2s__pat8,"any stubs","f"); +leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub","f"); +leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat8.png"); + + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_2s__pat2->Draw("e3"); +result_def_2s__pat8->Draw("same e3"); +result_def_2s1b__pat8->Draw("same e3"); +result_gem_2s1b__pat8->Draw("same e3"); + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); +leg->AddEntry(result_def_2s__pat2,"any stubs","f"); +leg->AddEntry(result_def_2s__pat8,"any stubs, tight patt.","f"); +leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub, tight patt.","f"); +leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein.png"); + + +/// ----- GMT current "default" single trigger + + + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_gmtsing__pat2->Draw("e3"); +result_def_2s__pat2->Draw("same e3"); +result_def_2s1b__pat2->Draw("same e3"); +result_def_3s__pat2->Draw("same e3"); +result_def_3s1b__pat2->Draw("same e3"); +result_gmtsing__pat2->Draw("same e3"); + +TLegend *leg = new TLegend(0.49,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); +leg->AddEntry(result_def_2s__pat2,"Tracks: #geq2 stubs","f"); +leg->AddEntry(result_def_2s1b__pat2," #geq2 with ME1/b stubs","f"); +leg->AddEntry(result_def_3s__pat2," #geq3 stubs","f"); +leg->AddEntry(result_def_3s1b__pat2," #geq3 with ME1/b stubs","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__GMT__Frankenstein_pat2.png"); + +///----- 2 & 3 stubs + + + + +((TCanvas*)gROOT->FindObject("cAll100"))->cd(); +result_def_3s__pat2->Draw("e3"); +result_def_3s1b__pat2->Draw("same e3"); +result_gem_2s1b__pat2->Draw("same e3"); +result_gem_3s1b__pat2->Draw("same e3"); + + +TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); +leg->SetBorderSize(0); +leg->SetFillStyle(0); +leg->AddEntry(result_def_3s__pat2,"CSCTF tracks with:",""); +leg->AddEntry(result_def_3s__pat2,"3+ stubs","f"); +leg->AddEntry(result_def_3s1b__pat2,"3+ stubs with ME1/b stub","f"); +leg->AddEntry(result_gem_2s1b__pat2,"2+ stubs with (ME1/b + GEM) stub","f"); +leg->AddEntry(result_gem_2s1b__pat2,"3+ stubs with (ME1/b + GEM) stub","f"); +leg->Draw(); + +drawPULabel(); + +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s__Frankenstein_pat2.png"); + + +return; + + +} + From da7f32a3fb20c5edfb206829b7cc1e8e1b5e497e Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Mon, 5 Aug 2013 19:05:22 -0500 Subject: [PATCH 018/182] add .L to ProcessLine statement --- SimMuL1/scripts/drawplot_eff.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimMuL1/scripts/drawplot_eff.C b/SimMuL1/scripts/drawplot_eff.C index 243f4d962f6d8..ec9d3bd68695f 100644 --- a/SimMuL1/scripts/drawplot_eff.C +++ b/SimMuL1/scripts/drawplot_eff.C @@ -1,4 +1,4 @@ -gROOT->ProcessLine("effFunctions.C"); +gROOT->ProcessLine(".L effFunctions.C"); /* From a1a0a9ffd051c7679ca32abcefa6564b0dc6d2b5 Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Mon, 5 Aug 2013 19:19:43 -0500 Subject: [PATCH 019/182] Merge branch 'master', remote-tracking branch 'origin' From c8fddbf47232d9bf0fed5f2e121f3b915bdd2350 Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Mon, 5 Aug 2013 20:17:17 -0500 Subject: [PATCH 020/182] old NeutronSimHitsAnalyzer: to be modified to include GEM simhits --- SimMuL1/plugins/NeutronSimHitsAnalyzer.cc | 6 +- SimMuL1/test/runNeutronSimHitsAnalyzer_cfg.py | 113 ++++++++++++++++++ 2 files changed, 116 insertions(+), 3 deletions(-) create mode 100644 SimMuL1/test/runNeutronSimHitsAnalyzer_cfg.py diff --git a/SimMuL1/plugins/NeutronSimHitsAnalyzer.cc b/SimMuL1/plugins/NeutronSimHitsAnalyzer.cc index 89cdedf8407ee..20c925b694ece 100644 --- a/SimMuL1/plugins/NeutronSimHitsAnalyzer.cc +++ b/SimMuL1/plugins/NeutronSimHitsAnalyzer.cc @@ -1,6 +1,6 @@ /* - * - * + * The version of NeutronSimHitsAnalyzer that was used for + * SimHit level occupancy studies for CSC * * */ @@ -769,4 +769,4 @@ void NeutronSimHitsAnalyzer::endJob() // ================================================================================================ //define this as a plug-in -//DEFINE_FWK_MODULE(NeutronSimHitsAnalyzer); +DEFINE_FWK_MODULE(NeutronSimHitsAnalyzer); diff --git a/SimMuL1/test/runNeutronSimHitsAnalyzer_cfg.py b/SimMuL1/test/runNeutronSimHitsAnalyzer_cfg.py new file mode 100644 index 0000000000000..ece8d900faa54 --- /dev/null +++ b/SimMuL1/test/runNeutronSimHitsAnalyzer_cfg.py @@ -0,0 +1,113 @@ +# files concatenator cmsRun config +import FWCore.ParameterSet.Config as cms +import os + +# events to process +nevt = 200000 + +# are we running on regular MB instead of neutron simhits sample? +isMB = False +isMB = True + +# where the neutron hits input files are stored +inputDir = '/uscmst1b_scratch/lpc1/lpctau/khotilov/slhc/CMSSW_3_6_3_n/src/out_n' +if isMB: inputDir = '/uscmst1b_scratch/lpc1/lpctau/khotilov/condor/minbias_3_6_2_me42' + +#inputDir = '/uscmst1b_scratch/lpc1/lpctau/khotilov/slhc/CMSSW_3_6_3_ye4/src/out_n_58k' + +theHistoFileName = "shtree100K.root" +if isMB: theHistoFileName = "shtreeMB.root" + +#theHistoFileName = "shtree_hp.root" +#theHistoFileName = "shtreec_hp.root" +#theHistoFileName = "shtreen_hp.root" + +#theHistoFileName = "shtree_hp_eml.root" +#theHistoFileName = "shtree_emlsn.root" +#theHistoFileName = "shtree_eml.root" + +#inputDir = '/uscmst1b_scratch/lpc1/lpctau/khotilov/slhc/CMSSW_3_6_3_ye4/src/crab_0_100826_002606/res' +#theHistoFileName = "shtreem_hp.root" + + + +process = cms.Process('NEUTRON') + +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(nevt) ) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.StandardSequences.Geometry_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.EventContent.EventContent_cff') + +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +#process.GlobalTag.globaltag = 'MC_38Y_V9::All' +process.GlobalTag.globaltag = 'MC_36Y_V10::All' + +process.options = cms.untracked.PSet( + makeTriggerResults = cms.untracked.bool(False), + wantSummary = cms.untracked.bool(True) +) + +ls = os.listdir(inputDir) + +process.source = cms.Source("PoolSource", + duplicateCheckMode = cms.untracked.string('noDuplicateCheck'), + fileNames = cms.untracked.vstring( + #"file:/uscmst1b_scratch/lpc1/lpctau/khotilov/slhc/CMSSW_3_6_3_ye4/src/condor_hp/zomg.root" + #"file:/uscmst1b_scratch/lpc1/lpctau/khotilov/slhc/CMSSW_3_9_0_pre2/src/condor_hp_eml/zomg.root" + #"file:/uscmst1b_scratch/lpc1/lpctau/khotilov/slhc/CMSSW_3_9_0_pre2/src/condor_emlsn/zomg.root" + #"file:/uscmst1b_scratch/lpc1/lpctau/khotilov/slhc/CMSSW_3_9_0_pre2/src/condor_eml/zomg.root" + ['file:'+inputDir+"/"+x for x in ls if x.endswith('root')] + #"file:/uscmst1b_scratch/lpc1/lpctau/khotilov/slhc/CMSSW_3_6_3_n/src/out_std/zomg.root" + ) +) + + +process.TFileService = cms.Service("TFileService", + fileName = cms.string(theHistoFileName) +) + + +process.neutronAna = cms.EDAnalyzer("NeutronSimHitsAnalyzer", + inputIsNeutrons = cms.untracked.bool(not isMB), + inputTagCSC = cms.untracked.InputTag("g4SimHits","MuonCSCHits"), + inputTagRPC = cms.untracked.InputTag("g4SimHits","MuonRPCHits"), + inputTagDT = cms.untracked.InputTag("g4SimHits","MuonDTHits") + #inputTagCSC = cms.untracked.InputTag("g4SimHitsNeutrons","MuonCSCHits"), + #inputTagRPC = cms.untracked.InputTag("g4SimHitsNeutrons","MuonRPCHits"), + #inputTagDT = cms.untracked.InputTag("g4SimHitsNeutrons","MuonDTHits") +) + + +#ff = open("files.txt", "r") +#files = ff.read().split('\n') +#ff.close() +# +#vstri=[] +#for i in range (0,len(files)): +# if len(files[i])==0: continue +# if files[i].find('pnfs') > -1: +# vstri.append('dcap:'+ files[i]) +# elif files[i].find('castor') == 1: +# vstri.append('rfio:'+ files[i]) +# else: +# vstri.append('file:'+ files[i]) +#process.source.fileNames = vstri + + +#process.Timing = cms.Service("Timing") +#process.Tracer = cms.Service("Tracer") + +process.neutron_step = cms.Path(process.neutronAna) +process.endjob_step = cms.Path(process.endOfProcess) + +# Schedule definition +process.schedule = cms.Schedule( + process.neutron_step, + process.endjob_step, +# process.out_step +) + From 97deae7f77716726c6c19cbbfdc52bee52872fb8 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 08:59:13 +0200 Subject: [PATCH 021/182] change file name --- .../{produceDphiLibary.py => produceDphiDict.py} | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) rename SimMuL1/scripts/{produceDphiLibary.py => produceDphiDict.py} (90%) diff --git a/SimMuL1/scripts/produceDphiLibary.py b/SimMuL1/scripts/produceDphiDict.py similarity index 90% rename from SimMuL1/scripts/produceDphiLibary.py rename to SimMuL1/scripts/produceDphiDict.py index 5e00f0fd9d89b..69a01d8acf12b 100644 --- a/SimMuL1/scripts/produceDphiLibary.py +++ b/SimMuL1/scripts/produceDphiDict.py @@ -1,14 +1,12 @@ from cuts import * -from ROOT import TFile,TTree,TH1F -from ROOT import gROOT,gDirectory ## run quiet mode import sys sys.argv.append( '-b' ) -import ROOT -ROOT.gROOT.SetBatch(1) +from ROOT import * +gROOT.SetBatch(1) def getTree(fileName): """Get tree for given filename""" @@ -51,7 +49,7 @@ def dphiCut(h, fractionToKeep): return x -def produceDphiLibary(): +def produceDphiDict(filesDir, outFileName): """Get the libary of dPhi values""" pt = ["pt5","pt10","pt15","pt20","pt30","pt40"] @@ -59,7 +57,7 @@ def produceDphiLibary(): dphis = [[[0 for x in xrange(2)] for x in xrange(len(fr))] for x in xrange(len(pt))] for n in range(len(pt)): - t = getTree("files/gem_csc_delta_%s_pad4.root"%(pt[n])) + t = getTree("%sgem_csc_delta_%s_pad4.root"%(filesDir,pt[n])) t.Draw("TMath::Abs(dphi_pad_odd)>>dphi_odd(600,0.,0.03)" , ok_pad1_lct1) t.Draw("TMath::Abs(dphi_pad_even)>>dphi_even(600,0.,0.03)" , ok_pad2_lct2) h_dphi_odd = TH1F(gDirectory.Get("dphi_odd")) @@ -69,7 +67,7 @@ def produceDphiLibary(): dphis[n][f][1] = dphiCut(h_dphi_even, fr[f]) ## print the dphi library for these samples - outfile = open("GEMCSCdPhiLib.py","w") + outfile = open("%s"%(outFileName),"w") outfile.write("dphi_lct_pad = {\n") for f in range(len(fr)): outfile.write(' "%d" : {\n'%(fr[f])) @@ -93,4 +91,4 @@ def produceDphiLibary(): print "dPhi library written to:", outfile.name if __name__ == "__main__": - produceDphiLibary() + produceDphiDict("files/", "GEMCSCdPhiDict.py") From 9494db37b14f46673e9753aac13ca69c5226e1ca Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 08:59:53 +0200 Subject: [PATCH 022/182] adding extra composite cuts --- SimMuL1/scripts/cuts.py | 50 +++++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/SimMuL1/scripts/cuts.py b/SimMuL1/scripts/cuts.py index ecd50d29b2426..a5b626ea37501 100644 --- a/SimMuL1/scripts/cuts.py +++ b/SimMuL1/scripts/cuts.py @@ -1,5 +1,12 @@ from ROOT import TCut +ok_eta = TCut("TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.14") +ok_pt = TCut("pt > 20.") + +ok_dphi1 = TCut("dphi_pad_odd < 10.") +ok_dphi2 = TCut("dphi_pad_even < 10.") + + ok_sh1 = TCut("(has_csc_sh&1) > 0") ok_sh2 = TCut("(has_csc_sh&2) > 0") ok_st1 = TCut("(has_csc_strips&1) > 0") @@ -21,21 +28,50 @@ ok_gdg2 = TCut("(has_gem_dg&2) > 0") ok_pad1 = TCut("(has_gem_pad&1) > 0") ok_pad2 = TCut("(has_gem_pad&2) > 0") + +ok_pad1_lct1 = TCut("%s && %s" %(ok_pad1.GetTitle(),ok_lct1.GetTitle())) +ok_pad2_lct2 = TCut("%s && %s" %(ok_pad2.GetTitle(),ok_lct2.GetTitle())) + +ok_pad1_dphi1 = TCut("%s && %s" %(ok_pad1.GetTitle(),ok_dphi1.GetTitle())) +ok_pad2_dphi2 = TCut("%s && %s" %(ok_pad2.GetTitle(),ok_dphi2.GetTitle())) + +ok_lct1_eta = TCut("%s && %s" %(ok_eta.GetTitle(),ok_lct1.GetTitle())) +ok_lct2_eta = TCut("%s && %s" %(ok_eta.GetTitle(),ok_lct2.GetTitle())) + + + +ok_pad1_lct1_eta = TCut("%s && %s && %s" %(ok_pad1.GetTitle(),ok_lct1.GetTitle(),ok_eta.GetTitle())) +ok_pad2_lct2_eta = TCut("%s && %s && %s" %(ok_pad2.GetTitle(),ok_lct2.GetTitle(),ok_eta.GetTitle())) + +ok_gsh1_lct1_eta = TCut("%s && %s && %s" %(ok_gsh1.GetTitle(),ok_lct1.GetTitle(),ok_eta.GetTitle())) +ok_gsh2_lct2_eta = TCut("%s && %s && %s" %(ok_gsh2.GetTitle(),ok_lct2.GetTitle(),ok_eta.GetTitle())) + +ok_gsh1_eta = TCut("%s && %s" %(ok_gsh1.GetTitle(),ok_eta.GetTitle())) +ok_gsh2_eta = TCut("%s && %s" %(ok_gsh2.GetTitle(),ok_eta.GetTitle())) + +ok_gdg1_eta = TCut("%s && %s" %(ok_gdg1.GetTitle(),ok_eta.GetTitle())) +ok_gdg2_eta = TCut("%s && %s" %(ok_gdg2.GetTitle(),ok_eta.GetTitle())) + ok_2pad1 = TCut("(has_gem_pad2&1) > 0") ok_2pad2 = TCut("(has_gem_pad2&2) > 0") + ok_pad1_overlap = TCut("%s || (%s && %s)" %(ok_pad1.GetTitle(),ok_lct2.GetTitle(),ok_pad2.GetTitle())) ok_pad2_overlap = TCut("%s || (%s && %s)" %(ok_pad2.GetTitle(),ok_lct1.GetTitle(),ok_pad1.GetTitle())) + ok_copad1 = TCut("(has_gem_copad&1) > 0") ok_copad2 = TCut("(has_gem_copad&2) > 0") -Qp = TCut("charge > 0") -Qn = TCut("charge < 0") +ok_Qp = TCut("charge > 0") +ok_Qn = TCut("charge < 0") + +ok_lct1_eta_Qn = TCut("%s && %s && %s" %(ok_lct1.GetTitle(),ok_eta.GetTitle(),ok_Qn.GetTitle())) +ok_lct2_eta_Qn = TCut("%s && %s && %s" %(ok_lct2.GetTitle(),ok_eta.GetTitle(),ok_Qn.GetTitle())) + +ok_lct1_eta_Qp = TCut("%s && %s && %s" %(ok_lct1.GetTitle(),ok_eta.GetTitle(),ok_Qp.GetTitle())) +ok_lct2_eta_Qp = TCut("%s && %s && %s" %(ok_lct2.GetTitle(),ok_eta.GetTitle(),ok_Qp.GetTitle())) + + Ep = TCut("endcap > 0") En = TCut("endcap < 0") -ok_eta = TCut("TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.14") -ok_pt = TCut("pt > 20.") - -ok_dphi1 = TCut("dphi_pad_odd < 10.") -ok_dphi2 = TCut("dphi_pad_even < 10.") From 35e2f875ae813f01ec749f09999f9beb5d809465 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 09:06:48 +0200 Subject: [PATCH 023/182] add more plotting options for bending angle --- SimMuL1/scripts/plotGEMCSCdPhi.py | 75 +++++++++++++++++++------------ 1 file changed, 46 insertions(+), 29 deletions(-) diff --git a/SimMuL1/scripts/plotGEMCSCdPhi.py b/SimMuL1/scripts/plotGEMCSCdPhi.py index e130e40847f29..b60e2755de086 100644 --- a/SimMuL1/scripts/plotGEMCSCdPhi.py +++ b/SimMuL1/scripts/plotGEMCSCdPhi.py @@ -31,42 +31,46 @@ def getTree(fileName): return tree -def plotGEMCSCdPhi(oddEven = "even", ext = ".pdf"): +def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): """Plot the GEM-CSC bending angles""" - txtHeader = TLegend(.13,.935,.97,1.); - txtHeader.SetFillColor(kWhite); - txtHeader.SetFillStyle(0); - txtHeader.SetBorderSize(0); - txtHeader.SetTextFont(42); - txtHeader.SetTextSize(0.045); - txtHeader.SetTextAlign(22); - txtHeader.SetHeader("|#phi(CSC strip)-#phi(GEM Pad4)| in %s numbered chambers"%(oddEven)); - - legend = TLegend(.4,.60,1.2,.92); - legend.SetFillColor(kWhite); - legend.SetFillStyle(0); - legend.SetBorderSize(0); - legend.SetTextSize(0.045); - legend.SetMargin(0.13); - - - t = getTree("files/gem_csc_delta_pt5_pad4.root"); - t1 = getTree("files/gem_csc_delta_pt20_pad4.root"); + t = getTree("%sgem_csc_delta_pt5_pad4.root"%(filesDir)); + t1 = getTree("%sgem_csc_delta_pt20_pad4.root"%(filesDir)); dphi_pt5 = TH1F("dphi_pt5","",600,0.0,0.03); dphi_pt20 = TH1F("dphi_pt20","",600,0.0,0.03); c = TCanvas("cDphi","cDphi",700,450); c.Clear() + c.SetGridx(1) + c.SetGridy(1) + + gStyle.SetTitleStyle(0) + gStyle.SetTitleAlign(13) ##// coord in top left + gStyle.SetTitleX(0.) + gStyle.SetTitleY(1.) + gStyle.SetTitleW(1) + gStyle.SetTitleH(0.058) + gStyle.SetTitleBorderSize(0) + + gStyle.SetPadLeftMargin(0.126) + gStyle.SetPadRightMargin(0.04) + gStyle.SetPadTopMargin(0.06) + gStyle.SetPadBottomMargin(0.13) + gStyle.SetOptStat(0) + gStyle.SetMarkerStyle(1) + +# setTDRStyle() if oddEven == "even": ok_pad_lct = ok_pad2_lct2 var = "dphi_pad_even" + closeFar = "close" else: ok_pad_lct = ok_pad1_lct1 var = "dphi_pad_odd" - + closeFar = "far" + t.Draw("TMath::Abs(%s)>>dphi_pt5"%(var) , ok_pad_lct); t1.Draw("TMath::Abs(%s)>>dphi_pt20"%(var) , ok_pad_lct); @@ -78,18 +82,31 @@ def plotGEMCSCdPhi(oddEven = "even", ext = ".pdf"): dphi_pt5.SetLineWidth(2); dphi_pt20.SetLineWidth(2); - dphi_pt20.GetXaxis().SetTitle("|#phi(CSC half-strip) - #phi(GEM pad)| [rad]"); + dphi_pt20.GetXaxis().SetTitle("GEM-CSC bending angle [rad]"); dphi_pt20.GetYaxis().SetTitle("A.U."); + dphi_pt20.SetTitle("GEM-CSC bending angle for muons in %s chambers"%(closeFar)); - legend.AddEntry(dphi_pt5,"Muons with p_{T}=5 GeV","L"); - legend.AddEntry(dphi_pt20,"Muons with p_{T}=20 GeV","L"); - dphi_pt20.Draw(); dphi_pt5.Draw("same"); - txtHeader.Draw("same"); + + legend = TLegend(.4,.6,.7,.8); + legend.SetFillColor(kWhite); + legend.SetFillStyle(0); + legend.SetBorderSize(0); + legend.SetTextSize(0.05); + legend.SetMargin(0.13); + legend.AddEntry(dphi_pt5,"p_{T}=5 GeV","L"); + legend.AddEntry(dphi_pt20,"p_{T}=20 GeV","L"); legend.Draw("same"); - c.SaveAs("plots/GEMCSCdPhi_%s_chambers%s"%(oddEven,ext)); + + c.SaveAs("%sGEMCSCdPhi_%s_chambers%s"%(plotDir, oddEven, ext)); if __name__ == "__main__": - plotGEMCSCdPhi("even") - plotGEMCSCdPhi("odd") + plotGEMCSCdPhi("files/", "plots/bending/", "even", ".png") + plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".png") + plotGEMCSCdPhi("files/", "plots/bending/", "even", ".pdf") + plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".pdf") + plotGEMCSCdPhi("files/", "plots/bending/", "even", ".eps") + plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".eps") + + From 29a40245c4e3ccca1207f299a0352aead5af738f Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 09:32:19 +0200 Subject: [PATCH 024/182] add location of files and plots, and a plot extension png pdf eps --- SimMuL1/scripts/drawplot_eff.C | 106 +++++++++++++++++---------------- 1 file changed, 55 insertions(+), 51 deletions(-) diff --git a/SimMuL1/scripts/drawplot_eff.C b/SimMuL1/scripts/drawplot_eff.C index ec9d3bd68695f..538d5c48ce428 100644 --- a/SimMuL1/scripts/drawplot_eff.C +++ b/SimMuL1/scripts/drawplot_eff.C @@ -8,6 +8,10 @@ gROOT->ProcessLine(".L effFunctions.C"); */ +TString filesDir = "files/"; +TString plotDir = "plots/"; +TString ext = ".png"; + TCut ok_sh1 = "(has_csc_sh&1) > 0"; TCut ok_sh2 = "(has_csc_sh&2) > 0"; TCut ok_st1 = "(has_csc_strips&1) > 0"; @@ -101,7 +105,7 @@ void gemTurnOns(int label_eff = GEM_EFF98) TCanvas* gEff_even = new TCanvas("gEff_even","gEff_even",700,500); gEff_even->SetGridx(1); gEff_even->SetGridy(1); - TTree *t = getTree("gem_csc_eff_pt2pt50_pad4.root"); + TTree *t = getTree(filesDir + "gem_csc_eff_pt2pt50_pad4.root"); TH1F *ho[N], *he[N]; for (int n=0; nAddEntry(he[n], pts[n], "p"); } leg->Draw(); - gEff->Print("gem_pad_eff_for_LCT_gemEff" + efs[label_eff] +".png"); + gEff->Print("gem_pad_eff_for_LCT_gemEff" + efs[label_eff] +"" + ext); gEff_odd->cd(); TLegend *leg = new TLegend(0.50,0.17,.99,0.57, NULL, "brNDC"); @@ -150,7 +154,7 @@ void gemTurnOns(int label_eff = GEM_EFF98) leg->AddEntry(ho[n], pts[n], "p"); } leg->Draw(); - gEff_odd->Print("gem_pad_eff_for_LCT_gemEff" + efs[label_eff] +"_odd.png"); + gEff_odd->Print("gem_pad_eff_for_LCT_gemEff" + efs[label_eff] +"_odd" + ext); gEff_even->cd(); TLegend *leg = new TLegend(0.50,0.17,.99,0.57, NULL, "brNDC"); @@ -163,7 +167,7 @@ void gemTurnOns(int label_eff = GEM_EFF98) leg->AddEntry(he[n], pts[n], "p"); } leg->Draw(); - gEff_even->Print("gem_pad_eff_for_LCT_gemEff" + efs[label_eff] +"_even.png"); + gEff_even->Print("gem_pad_eff_for_LCT_gemEff" + efs[label_eff] +"_even" + ext); } @@ -193,7 +197,7 @@ TString pt[6] = {"pt5","pt10","pt15","pt20","pt30","pt40"}; float fr[3] = {0.95, 0.98, 0.99}; for (int n=0; n<6; ++n) { - t = getTree(TString("gem_csc_delta_")+pt[n] + "_pad4.root"); + t = getTree(filesDir + TString("gem_csc_delta_")+pt[n] + "_pad4.root"); t->Draw("TMath::Abs(dphi_pad_odd)>>dphi_odd(600,0.,0.03)" , ok_pad1 && ok_lct1); t->Draw("TMath::Abs(dphi_pad_even)>>dphi_even(600,0.,0.03)" , ok_pad2 && ok_lct2); for (int f=0; f<3; ++f) { @@ -333,7 +337,7 @@ TCanvas* cEff = new TCanvas("cEff","cEff",700,450); cEff->SetGridx(1); cEff->SetGridy(1); -TTree *gt = getTree("gem_csc_delta_pt40_pad4.root"); +TTree *gt = getTree(filesDir + "gem_csc_delta_pt40_pad4.root"); //ht = draw_geff(gt, "Eff. for a SimTrack to have an associated LCT;SimTrack |#eta|;Eff.", "h_odd", "(100,1.54,2.2)", "TMath::Abs(eta)", "", ok_lct1 || ok_lct2, "P", kRed); //hh = draw_geff(gt, "Eff. for a SimTrack to have an associated LCT;SimTrack |#eta|;Eff.", "h_odd", "(100,1.54,2.2)", "TMath::Abs(eta)", "", ok_sh1 || ok_sh2, "P same", kViolet); @@ -349,7 +353,7 @@ leg->Draw(); TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); tex->SetNDC(); tex->Draw(); -cEff->Print("lct_eff_for_Trk_vsTrkEta_pt40.png"); +cEff->Print("lct_eff_for_Trk_vsTrkEta_pt40" + ext); h1 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT and GEM Pad;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh1, ok_lct1 && ok_pad1, "P", kRed); @@ -364,7 +368,7 @@ leg->Draw(); TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); tex->SetNDC(); tex->Draw(); -cEff->Print("gem_pad_and_lct_eff_for_Trk_vsTrkEta_pt40.png"); +cEff->Print("gem_pad_and_lct_eff_for_Trk_vsTrkEta_pt40" + ext); return; @@ -373,14 +377,14 @@ eff_base->GetYaxis()->SetRangeUser(0.6,1.05); TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); tex->SetNDC(); tex->Draw(); -cEff->Print("gem_pad0_eff_for_Trk_vsTrkEta_pt40.png"); +cEff->Print("gem_pad0_eff_for_Trk_vsTrkEta_pt40" + ext); -TTree *gt15 = getTree("gem_csc_delta_pt15_pad4.root"); +TTree *gt15 = getTree(filesDir + "gem_csc_delta_pt15_pad4.root"); h1 = draw_geff(gt15, "Eff. for a SimTrack to have an associated LCT;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_lct1 || ok_lct2, "P", kViolet+2); -cEff->Print("lct_eff_for_Trk_vsTrkEta_pt15.png"); +cEff->Print("lct_eff_for_Trk_vsTrkEta_pt15" + ext); ho = draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", ok_lct1, ok_pad1, "P", kRed); @@ -391,22 +395,22 @@ leg->SetFillStyle(0); leg->AddEntry(ho, "odd chambers","l"); leg->AddEntry(he, "even chambers","l"); leg->Draw(); -cEff->Print("gem_pad_eff_for_LCT_vsLCTEta_pt40.png"); +cEff->Print("gem_pad_eff_for_LCT_vsLCTEta_pt40" + ext); draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1, ok_pad1, "P", kRed); draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2, ok_pad2, "P same"); leg->Draw(); -cEff->Print("gem_pad_eff_for_LCT_vsTrkEta_pt40.png"); +cEff->Print("gem_pad_eff_for_LCT_vsTrkEta_pt40" + ext); draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", ok_lct1, ok_pad1_overlap, "P", kRed); draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta_lct_even)", ok_lct2, ok_pad2_overlap, "P same"); leg->Draw(); -cEff->Print("gem_pad_eff_for_LCT_vsLCTEta_pt40_overlap.png"); +cEff->Print("gem_pad_eff_for_LCT_vsLCTEta_pt40_overlap" + ext); draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1, ok_pad1_overlap, "P", kRed); draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2, ok_pad2_overlap, "P same"); leg->Draw(); -cEff->Print("gem_pad_eff_for_LCT_vsTrkEta_pt40_overlap.png"); +cEff->Print("gem_pad_eff_for_LCT_vsTrkEta_pt40_overlap" + ext); //draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1 && Ep, ok_pad1_overlap, "P", kRed); //draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2 && Ep, ok_pad2_overlap, "P same"); @@ -419,7 +423,7 @@ leg->SetFillStyle(0); leg->AddEntry(h1, "at least one pad","l"); leg->AddEntry(he, "two pads in two GEMs","l"); leg->Draw(); -cEff->Print("gem_pad_eff_for_Trk_vsTrkEta_pt40.png"); +cEff->Print("gem_pad_eff_for_Trk_vsTrkEta_pt40" + ext); return; draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_gsh1 || ok_gsh2, "P", kViolet); @@ -436,19 +440,19 @@ gf_name = ""; TCanvas* cEff = new TCanvas("cEff","cEff",700,500); -eff_hs("gem_csc_delta_pt5_pad4.root", "gem/gem_pad_eff_for_LCT_vsHS_pt05.png"); -eff_hs("gem_csc_delta_pt10_pad4.root", "gem/gem_pad_eff_for_LCT_vsHS_pt10.png"); -eff_hs("gem_csc_delta_pt15_pad4.root", "gem/gem_pad_eff_for_LCT_vsHS_pt15.png"); -eff_hs("gem_csc_delta_pt20_pad4.root", "gem/gem_pad_eff_for_LCT_vsHS_pt20.png"); -eff_hs("gem_csc_delta_pt30_pad4.root", "gem/gem_pad_eff_for_LCT_vsHS_pt30.png"); -eff_hs("gem_csc_delta_pt40_pad4.root", "gem/gem_pad_eff_for_LCT_vsHS_pt40.png"); +eff_hs(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt05" + ext); +eff_hs(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt10" + ext); +eff_hs(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt15" + ext); +eff_hs(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt20" + ext); +eff_hs(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30" + ext); +eff_hs(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40" + ext); -eff_hs_overlap("gem_csc_delta_pt5_pad4.root", "gem/gem_pad_eff_for_LCT_vsHS_pt05_overlap.png"); -eff_hs_overlap("gem_csc_delta_pt10_pad4.root", "gem/gem_pad_eff_for_LCT_vsHS_pt10_overlap.png"); -eff_hs_overlap("gem_csc_delta_pt15_pad4.root", "gem/gem_pad_eff_for_LCT_vsHS_pt15_overlap.png"); -eff_hs_overlap("gem_csc_delta_pt20_pad4.root", "gem/gem_pad_eff_for_LCT_vsHS_pt20_overlap.png"); -eff_hs_overlap("gem_csc_delta_pt30_pad4.root", "gem/gem_pad_eff_for_LCT_vsHS_pt30_overlap.png"); -eff_hs_overlap("gem_csc_delta_pt40_pad4.root", "gem/gem_pad_eff_for_LCT_vsHS_pt40_overlap.png"); +eff_hs_overlap(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt05_overlap" + ext); +eff_hs_overlap(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt10_overlap" + ext); +eff_hs_overlap(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt15_overlap" + ext); +eff_hs_overlap(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt20_overlap" + ext); +eff_hs_overlap(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30_overlap" + ext); +eff_hs_overlap(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40_overlap" + ext); } @@ -660,7 +664,7 @@ g->SetMarkerStyle(2); g->SetMarkerSize(0.4); gPad->Modified() -c1.Print((string("chan_")+suff+".png").c_str()) +c1.Print((string("chan_")+suff+"" + ext).c_str()) @@ -678,7 +682,7 @@ g->SetMarkerStyle(2); g->SetMarkerSize(0.4); gPad->Modified() -c1.Print((string("strip_")+suff+".png").c_str()) +c1.Print((string("strip_")+suff+"" + ext).c_str()) @@ -697,7 +701,7 @@ g->SetMarkerStyle(2); g->SetMarkerSize(0.4); gPad->Modified() -c1.Print((string("wg_")+suff+".png").c_str()) +c1.Print((string("wg_")+suff+"" + ext).c_str()) @@ -709,26 +713,26 @@ c1.Print((string("wg_")+suff+".png").c_str()) fname="shtree_POSTLS161_pt1000.root"; suff = "postls1_pt1000"; TFile *f = TFile::Open(fname) -globalPosfromTree("+ME1", f, 1, 1, "rphi_+ME1_postls1.png") -globalPosfromTree("+ME2", f, 1, 2, "rphi_+ME2_postls1.png") -globalPosfromTree("+ME3", f, 1, 3, "rphi_+ME3_postls1.png") -globalPosfromTree("+ME4", f, 1, 4, "rphi_+ME4_postls1.png") -globalPosfromTree("-ME1", f, 2, 1, "rphi_-ME1_postls1.png") -globalPosfromTree("-ME2", f, 2, 2, "rphi_-ME2_postls1.png") -globalPosfromTree("-ME3", f, 2, 3, "rphi_-ME3_postls1.png") -globalPosfromTree("-ME4", f, 2, 4, "rphi_-ME4_postls1.png") +globalPosfromTree("+ME1", f, 1, 1, "rphi_+ME1_postls1" + ext) +globalPosfromTree("+ME2", f, 1, 2, "rphi_+ME2_postls1" + ext) +globalPosfromTree("+ME3", f, 1, 3, "rphi_+ME3_postls1" + ext) +globalPosfromTree("+ME4", f, 1, 4, "rphi_+ME4_postls1" + ext) +globalPosfromTree("-ME1", f, 2, 1, "rphi_-ME1_postls1" + ext) +globalPosfromTree("-ME2", f, 2, 2, "rphi_-ME2_postls1" + ext) +globalPosfromTree("-ME3", f, 2, 3, "rphi_-ME3_postls1" + ext) +globalPosfromTree("-ME4", f, 2, 4, "rphi_-ME4_postls1" + ext) .L shFunctions.C fname="shtree_std_pt100.root"; suff = "std_pt100"; TFile *f = TFile::Open(fname) -globalPosfromTree("+ME1", f, 1, 1, "rphi_+ME1_std.png") -globalPosfromTree("+ME2", f, 1, 2, "rphi_+ME2_std.png") -globalPosfromTree("+ME3", f, 1, 3, "rphi_+ME3_std.png") -globalPosfromTree("+ME4", f, 1, 4, "rphi_+ME4_std.png") -globalPosfromTree("-ME1", f, 2, 1, "rphi_-ME1_std.png") -globalPosfromTree("-ME2", f, 2, 2, "rphi_-ME2_std.png") -globalPosfromTree("-ME3", f, 2, 3, "rphi_-ME3_std.png") -globalPosfromTree("-ME4", f, 2, 4, "rphi_-ME4_std.png") +globalPosfromTree("+ME1", f, 1, 1, "rphi_+ME1_std" + ext) +globalPosfromTree("+ME2", f, 1, 2, "rphi_+ME2_std" + ext) +globalPosfromTree("+ME3", f, 1, 3, "rphi_+ME3_std" + ext) +globalPosfromTree("+ME4", f, 1, 4, "rphi_+ME4_std" + ext) +globalPosfromTree("-ME1", f, 2, 1, "rphi_-ME1_std" + ext) +globalPosfromTree("-ME2", f, 2, 2, "rphi_-ME2_std" + ext) +globalPosfromTree("-ME3", f, 2, 3, "rphi_-ME3_std" + ext) +globalPosfromTree("-ME4", f, 2, 4, "rphi_-ME4_std" + ext) @@ -767,7 +771,7 @@ g->SetMarkerStyle(1); g->SetMarkerSize(0.1); gPad->Modified() -c1.Print((string("rz_+ME_")+suff+".png").c_str()) +c1.Print((string("rz_+ME_")+suff+"" + ext).c_str()) @@ -783,7 +787,7 @@ g->SetMarkerStyle(1); g->SetMarkerSize(0.1); gPad->Modified() -c1.Print((string("rz_-ME_")+suff+".png").c_str()) +c1.Print((string("rz_-ME_")+suff+"" + ext).c_str()) @@ -829,7 +833,7 @@ leg1->AddEntry(htmp,"6_0_0_patch1","l"); leg1->AddEntry(htmp2,"POSTLS161","l"); leg1->Draw(); -c1.Print("sh_eloss.png") +c1.Print("sh_eloss" + ext) @@ -872,7 +876,7 @@ leg1->AddEntry(htmp,"6_0_0_patch1","l"); leg1->AddEntry(htmp2,"POSTLS161","l"); leg1->Draw(); -c1.Print("sh_tof.png") +c1.Print("sh_tof" + ext) From 4ab5832d15a6349a4a25babce1b42f5a121ce9a5 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 09:50:39 +0200 Subject: [PATCH 025/182] add location of files and plots, and a variable ext for the plot extension --- SimMuL1/scripts/drawplot_etastep.C | 153 +++++++++++++++-------------- 1 file changed, 78 insertions(+), 75 deletions(-) diff --git a/SimMuL1/scripts/drawplot_etastep.C b/SimMuL1/scripts/drawplot_etastep.C index 038d486d5948a..04da20e27c35e 100644 --- a/SimMuL1/scripts/drawplot_etastep.C +++ b/SimMuL1/scripts/drawplot_etastep.C @@ -2,7 +2,7 @@ //int kGray=920, kOrange=800, kSpring=820, kTeal=840, kAzure=860, kViolet=880, kPink=900; TFile *f; -char pdir[111]; +char pdir[111] = "plots/"; TObject* NUL; @@ -11,6 +11,9 @@ TH1F *gh; TH1D *h1, *h2, *he; +TString filesDir = "files/"; +TString plotDir = "plots/"; +TString ext = ".png"; double yrange[2]={0.,1.04}; double yrange05[2]={0.5,1.04}; @@ -188,18 +191,18 @@ int ptreb=2; TString hdir = "SimMuL1StrictAll"; -//TString f_def = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_def_pat2.root"; -TString f_def = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem_dphi0_pat2.root"; -TString f_g98_pt10 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt10_pat2.root"; -TString f_g98_pt15 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt15_pat2.root"; -TString f_g98_pt20 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt20_pat2.root"; -TString f_g98_pt30 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt30_pat2.root"; -TString f_g98_pt40 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt40_pat2.root"; +//TString f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_def_pat2.root"; +TString f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem_dphi0_pat2.root"; +TString f_g98_pt10 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt10_pat2.root"; +TString f_g98_pt15 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt15_pat2.root"; +TString f_g98_pt20 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt20_pat2.root"; +TString f_g98_pt30 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt30_pat2.root"; +TString f_g98_pt40 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt40_pat2.root"; -TString f_g95_pt10 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt10_pat2.root"; -TString f_g95_pt20 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt20_pat2.root"; -TString f_g95_pt30 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt30_pat2.root"; -TString f_g95_pt40 = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt40_pat2.root"; +TString f_g95_pt10 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt10_pat2.root"; +TString f_g95_pt20 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt20_pat2.root"; +TString f_g95_pt30 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt30_pat2.root"; +TString f_g95_pt40 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt40_pat2.root"; double rpt[2] = {0.,49.99}; @@ -330,7 +333,7 @@ leg->AddEntry(h_eff_tf30_2s1b, "p_{T}^{TF}>=30", "l"); leg->AddEntry(h_eff_tf30_gpt30_2s1b, "#Delta#phi for p_{T}=30", "l"); leg->Draw(); -c2s1b->Print("eff_2s1b.png"); +c2s1b->Print(plotDir + "eff_2s1b" + ext); @@ -359,7 +362,7 @@ leg->AddEntry(h_eff_tf30_3s1b, "p_{T}^{TF}>=30", "l"); leg->AddEntry(h_eff_tf30_gpt30_3s1b, "#Delta#phi for p_{T}=30", "l"); leg->Draw(); -c3s1b->Print("eff_3s1b.png"); +c3s1b->Print(plotDir + "eff_3s1b" + ext); @@ -388,7 +391,7 @@ leg->AddEntry(h_eff_tf30_3s, "p_{T}^{TF}>=30", "l"); leg->AddEntry(h_eff_tf30_gpt30_2s1b, "#Delta#phi for p_{T}=30", "l"); leg->Draw(); -c3s_2s1b->Print("eff_3s_2s1b.png"); +c3s_2s1b->Print("eff_3s_2s1b" + ext); @@ -408,7 +411,7 @@ leg->AddEntry(h_eff_tf20_3s, "p_{T}^{TF}>=20", "l"); leg->AddEntry(h_eff_tf30_3s, "p_{T}^{TF}>=30", "l"); leg->Draw(); -c3s_def->Print("eff_3s_def.png"); +c3s_def->Print(plotDir + "eff_3s_def" + ext); TCanvas* c3s1b_def = new TCanvas("c3s1b_def","c3s1b_def",800,600); @@ -426,7 +429,7 @@ leg->AddEntry(h_eff_tf20_3s, "p_{T}^{TF}>=20", "l"); leg->AddEntry(h_eff_tf30_3s, "p_{T}^{TF}>=30", "l"); leg->Draw(); -c3s1b_def->Print("eff_3s1b_def.png"); +c3s1b_def->Print(plotDir + "eff_3s1b_def" + ext); @@ -472,11 +475,11 @@ leg->AddEntry(h_eff_tf10_2s, "anywhere", "l"); leg->AddEntry(h_eff_tf10_2s1b, "with ME1", "l"); leg->Draw(); -c2s_pt10_def->Print("eff_2s_pt10_def.png"); +c2s_pt10_def->Print(plotDir + "eff_2s_pt10_def" + ext); h_eff_tf10_gpt10_2s1b->Draw("hist same"); leg->AddEntry(h_eff_tf10_gpt10_2s1b, "with (ME1 + GEM)", "l"); -c2s_pt10_def->Print("eff_2s_pt10_gem.png"); +c2s_pt10_def->Print(plotDir + "eff_2s_pt10_gem" + ext); @@ -493,11 +496,11 @@ leg->AddEntry(h_eff_tf10_3s, "anywhere", "l"); leg->AddEntry(h_eff_tf10_3s1b, "with ME1", "l"); leg->Draw(); -c3s_pt10_def->Print("eff_3s_pt10_def.png"); +c3s_pt10_def->Print(plotDir + "eff_3s_pt10_def" + ext); h_eff_tf10_gpt10_3s1b->Draw("hist same"); leg->AddEntry(h_eff_tf10_gpt10_3s1b, "with (ME1 + GEM)", "l"); -c3s_pt10_def->Print("eff_3s_pt10_gem.png"); +c3s_pt10_def->Print(plotDir + "eff_3s_pt10_gem" + ext); @@ -515,11 +518,11 @@ leg->AddEntry(h_eff_tf20_2s, "anywhere", "l"); leg->AddEntry(h_eff_tf20_2s1b, "with ME1", "l"); leg->Draw(); -c2s_pt20_def->Print("eff_2s_pt20_def.png"); +c2s_pt20_def->Print(plotDir + "eff_2s_pt20_def" + ext); h_eff_tf20_gpt20_2s1b->Draw("hist same"); leg->AddEntry(h_eff_tf20_gpt20_2s1b, "with (ME1 + GEM)", "l"); -c2s_pt20_def->Print("eff_2s_pt20_gem.png"); +c2s_pt20_def->Print(plotDir + "eff_2s_pt20_gem" + ext); @@ -536,11 +539,11 @@ leg->AddEntry(h_eff_tf20_3s, "anywhere", "l"); leg->AddEntry(h_eff_tf20_3s1b, "with ME1", "l"); leg->Draw(); -c3s_pt20_def->Print("eff_3s_pt20_def.png"); +c3s_pt20_def->Print(plotDir + "eff_3s_pt20_def" + ext); h_eff_tf20_gpt20_3s1b->Draw("hist same"); leg->AddEntry(h_eff_tf20_gpt20_3s1b, "with (ME1 + GEM)", "l"); -c3s_pt20_def->Print("eff_3s_pt20_gem.png"); +c3s_pt20_def->Print(plotDir + "eff_3s_pt20_gem" + ext); @@ -557,11 +560,11 @@ leg->AddEntry(h_eff_tf30_2s, "anywhere", "l"); leg->AddEntry(h_eff_tf30_2s1b, "with ME1", "l"); leg->Draw(); -c2s_pt30_def->Print("eff_2s_pt30_def.png"); +c2s_pt30_def->Print(plotDir + "eff_2s_pt30_def" + ext); h_eff_tf30_gpt30_2s1b->Draw("hist same"); leg->AddEntry(h_eff_tf30_gpt30_2s1b, "with (ME1 + GEM)", "l"); -c2s_pt30_def->Print("eff_2s_pt30_gem.png"); +c2s_pt30_def->Print(plotDir + "eff_2s_pt30_gem" + ext); @@ -578,11 +581,11 @@ leg->AddEntry(h_eff_tf30_3s, "anywhere", "l"); leg->AddEntry(h_eff_tf30_3s1b, "with ME1", "l"); leg->Draw(); -c3s_pt30_def->Print("eff_3s_pt30_def.png"); +c3s_pt30_def->Print(plotDir + "eff_3s_pt30_def" + ext); h_eff_tf30_gpt30_3s1b->Draw("hist same"); leg->AddEntry(h_eff_tf30_gpt30_3s1b, "with (ME1 + GEM)", "l"); -c3s_pt30_def->Print("eff_3s_pt30_gem.png"); +c3s_pt30_def->Print(plotDir + "eff_3s_pt30_gem" + ext); @@ -599,11 +602,11 @@ leg->AddEntry(h_eff_tf40_2s, "anywhere", "l"); leg->AddEntry(h_eff_tf40_2s1b, "with ME1", "l"); leg->Draw(); -c2s_pt40_def->Print("eff_2s_pt40_def.png"); +c2s_pt40_def->Print(plotDir + "eff_2s_pt40_def" + ext); h_eff_tf40_gpt40_2s1b->Draw("hist same"); leg->AddEntry(h_eff_tf40_gpt40_2s1b, "with (ME1 + GEM)", "l"); -c2s_pt40_def->Print("eff_2s_pt40_gem.png"); +c2s_pt40_def->Print(plotDir + "eff_2s_pt40_gem" + ext); @@ -620,11 +623,11 @@ leg->AddEntry(h_eff_tf40_3s, "anywhere", "l"); leg->AddEntry(h_eff_tf40_3s1b, "with ME1", "l"); leg->Draw(); -c3s_pt40_def->Print("eff_3s_pt40_def.png"); +c3s_pt40_def->Print(plotDir + "eff_3s_pt40_def" + ext); h_eff_tf40_gpt40_3s1b->Draw("hist same"); leg->AddEntry(h_eff_tf40_gpt40_3s1b, "with (ME1 + GEM)", "l"); -c3s_pt40_def->Print("eff_3s_pt40_gem.png"); +c3s_pt40_def->Print(plotDir + "eff_3s_pt40_gem" + ext); @@ -668,7 +671,7 @@ leg->AddEntry(h_eff_tf30_gpt30_3s1b, "#geq30 and 30", "l"); leg->AddEntry(h_eff_tf30_gpt40_3s1b, "#geq30 and 40", "l"); leg->Draw(); -c3s_tight->Print("eff_3s_gemtight.png"); +c3s_tight->Print(plotDir + "eff_3s_gemtight" + ext); @@ -707,7 +710,7 @@ leg->AddEntry(h_eff_tf20_gpt20_3s1b, "#geq20 and 20", "l"); leg->AddEntry(h_eff_tf20_gpt40_3s1b, "#geq20 and 40", "l"); leg->Draw(); -c3s_tight->Print("eff_3s_gemtightX.png"); +c3s_tight->Print(plotDir + "eff_3s_gemtightX" + ext); } @@ -723,8 +726,8 @@ int ptreb=2; TString hdir = "SimMuL1StrictAll"; -//TString f_def = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_def_pat2.root"; -TString f_def = "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem_dphi0_pat2.root"; +//TString f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_def_pat2.root"; +TString f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem_dphi0_pat2.root"; double rpt[2] = {0.,49.99}; @@ -802,7 +805,7 @@ leg->AddEntry(het3, "any p_{T}^{TF}, 3+ stubs", "l"); leg->AddEntry(het3pt20, "p_{T}^{TF}#geq20, 3+ stubs", "l"); leg->Draw(); -c2->Print("eff_gem1b_basegem.png"); +c2->Print(plotDir + "eff_gem1b_basegem" + ext); @@ -827,7 +830,7 @@ leg->AddEntry(helt2pt20, "2+ stubs", "l"); leg->AddEntry(het3pt20, "3+ stubs", "l"); leg->AddEntry(helt3pt20, "3+ stubs", "l"); leg->Draw(); -c2->Print("eff_gem1b_baselctgem.png"); +c2->Print(plotDir + "eff_gem1b_baselctgem" + ext); //return; @@ -852,7 +855,7 @@ leg->AddEntry(het2pt20p, "2+ stubs", "l"); leg->AddEntry(het3pt20, "3+ stubs", "l"); leg->AddEntry(het3pt20p, "3+ stubs", "l"); leg->Draw(); -c2->Print("eff_gem1b_basegem_dphi.png"); +c2->Print(plotDir + "eff_gem1b_basegem_dphi" + ext); htitle = "Efficiency for #mu (GEM+LCT) in 1.64<|#eta|<2.05 to have TF track with ME1/b stub;p_{T}^{MC}"; @@ -876,7 +879,7 @@ leg->AddEntry(helt2pt20p, "2+ stubs", "l"); leg->AddEntry(helt3pt20, "3+ stubs", "l"); leg->AddEntry(helt3pt20p, "3+ stubs", "l"); leg->Draw(); -c2->Print("eff_gem1b_baselpcgem_dphi.png"); +c2->Print(plotDir + "eff_gem1b_baselpcgem_dphi" + ext); helt2pt20->Draw("hist"); @@ -898,7 +901,7 @@ leg->AddEntry(helt2pt20_123, "2+ stubs (no ME1-4 tracks)", "l"); leg->AddEntry(helt3pt20_13, "2+ stubs (no ME1-2 and ME1-4)", "l"); leg->AddEntry(helt3pt20, "3+ stubs", "l"); leg->Draw(); -c2->Print("eff_gem1b_baselpcgem_123.png"); +c2->Print(plotDir + "eff_gem1b_baselpcgem_123" + ext); return; @@ -1014,7 +1017,7 @@ h_eta_me3_initial->Draw("hist"); c_eff_eta_simh_by_st->cd(4); h_eta_me4_initial->Draw("hist"); -Print(c_eff_eta_simh_by_st,"c_eff_eta_simh_by_st.png"); +Print(c_eff_eta_simh_by_st,"c_eff_eta_simh_by_st" + ext); TCanvas* c_eff_eta_simh_by_st = new TCanvas("c_eff_eta_mpc_by_st","c_eff_eta_mpc_by_st",900,800 ) ; @@ -1043,7 +1046,7 @@ c_eff_eta_mpc_by_st->cd(4); h_eta_me4_initial->Draw("hist"); h_eta_me4_mpc->Draw("hist same"); -Print(c_eff_eta_mpc_by_st,"c_eff_eta_mpc_by_st.png"); +Print(c_eff_eta_mpc_by_st,"c_eff_eta_mpc_by_st" + ext); } @@ -1069,7 +1072,7 @@ l_eff_eta_simh->AddEntry(h_eta_initial_2st,"#geq2 CSC stations","pl"); l_eff_eta_simh->AddEntry(h_eta_initial_3st,"#geq3 CSC stations","pl"); l_eff_eta_simh->Draw(); -Print(c_eff_eta_simh,"c_eff_eta_simh.png"); +Print(c_eff_eta_simh,"c_eff_eta_simh" + ext); TCanvas* c_eff_eta_mpc = new TCanvas("c_eff_eta_mpc","c_eff_eta_mpc",1000,600 ) ; @@ -1091,7 +1094,7 @@ l_eff_eta_mpc->AddEntry(h_eta_mpc_2st,"#geq2 CSC stations","pl"); l_eff_eta_mpc->AddEntry(h_eta_mpc_3st,"#geq3 CSC stations","pl"); l_eff_eta_mpc->Draw(); -Print(c_eff_eta_mpc,"c_eff_eta_mpc.png"); +Print(c_eff_eta_mpc,"c_eff_eta_mpc" + ext); TCanvas* c_eff_eta_mpc_relative = new TCanvas("c_eff_eta_mpc_relative","c_eff_eta_mpc_relative",1000,600 ) ; @@ -1113,7 +1116,7 @@ l_eff_eta_mpc_relative->AddEntry(h_eta_mpc_2st_r,"#geq2 CSC stations","pl"); l_eff_eta_mpc_relative->AddEntry(h_eta_mpc_3st_r,"#geq3 CSC stations","pl"); l_eff_eta_mpc_relative->Draw(); -Print(c_eff_eta_mpc_relative,"c_eff_eta_mpc_relative.png"); +Print(c_eff_eta_mpc_relative,"c_eff_eta_mpc_relative" + ext); } @@ -1138,7 +1141,7 @@ l_eff_eta_simh_me1->AddEntry(h_eta_me1_initial_2st,"ME1 + #geq1 stations","pl"); l_eff_eta_simh_me1->AddEntry(h_eta_me1_initial_3st,"ME1 + #geq2 stations","pl"); l_eff_eta_simh_me1->Draw(); -Print(c_eff_eta_simh_me1,"c_eff_eta_simh_me1.png"); +Print(c_eff_eta_simh_me1,"c_eff_eta_simh_me1" + ext); } //################################################################################################ @@ -1205,7 +1208,7 @@ if (!interactive) { return; } -Print(c_eff_eta_me1_stubs,"h_eff_eta_me1_steps_stubs.png"); +Print(c_eff_eta_me1_stubs,"h_eff_eta_me1_steps_stubs" + ext); //################################################################################################ @@ -1233,7 +1236,7 @@ leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus,"TF track with matched stubs in ME1 leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in ME1+one","pl"); leg->Draw(); -Print(c_eff_eta_me1_tf,"h_eff_eta_me1_tf.png"); +Print(c_eff_eta_me1_tf,"h_eff_eta_me1_tf" + ext); //################################################################################################ @@ -1257,7 +1260,7 @@ leg->AddEntry(h_eff_eta_after_tfcand_ok_plus,"TF track with matched stubs in 2st leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); leg->Draw(); -Print(c_eff_eta_tf,"h_eff_eta_tf.png"); +Print(c_eff_eta_tf,"h_eff_eta_tf" + ext); //################################################################################################ @@ -1285,7 +1288,7 @@ leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_3st1a,"TF track with matched stubs leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_3st1a,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); leg->Draw(); -Print(c_eff_eta_tf_3st1a,"h_eff_eta_tf_3st1a.png"); +Print(c_eff_eta_tf_3st1a,"h_eff_eta_tf_3st1a" + ext); //################################################################################################ @@ -1320,7 +1323,7 @@ leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_q3,"Q=3","pl"); leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_q3,"Q=3, p_{T}^{TF}>10","pl"); leg->Draw(); -Print(c_eff_eta_tf_q,"h_eff_eta_tf_q.png"); +Print(c_eff_eta_tf_q,"h_eff_eta_tf_q" + ext); //################################################################################################ @@ -1344,7 +1347,7 @@ leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus,"TF track with matched stubs in 2st leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); leg1->Draw(); -Print(c_eff_pt_tf,"h_eff_pt_tf.png"); +Print(c_eff_pt_tf,"h_eff_pt_tf" + ext); //################################################################################################ @@ -1376,7 +1379,7 @@ leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt25,"p_{T}^{TF}>=25, stubs in (2+ leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt30,"p_{T}^{TF}>=30, stubs in (2+)st","pl"); leg1->Draw(); -Print(c_eff_pt_tf_eta1b_2s, "h_eff_pt_tf_eta1b_2s.png"); +Print(c_eff_pt_tf_eta1b_2s, "h_eff_pt_tf_eta1b_2s" + ext); //################################################################################################ @@ -1407,7 +1410,7 @@ leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt25,"p_{T}^{TF}>=25, stubs in M leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt30,"p_{T}^{TF}>=30, stubs in ME1+(1+)st","pl"); leg1->Draw(); -Print(c_eff_pt_tf_eta1b_2s1b, "h_eff_pt_tf_eta1b_2s1b.png"); +Print(c_eff_pt_tf_eta1b_2s1b, "h_eff_pt_tf_eta1b_2s1b" + ext); //################################################################################################ @@ -1439,7 +1442,7 @@ leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt25,"p_{T}^{TF}>=25, stubs in (3+ leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt30,"p_{T}^{TF}>=30, stubs in (3+)st","pl"); leg1->Draw(); -Print(c_eff_pt_tf_eta1b_3s, "h_eff_pt_tf_eta1b_3s.png"); +Print(c_eff_pt_tf_eta1b_3s, "h_eff_pt_tf_eta1b_3s" + ext); //################################################################################################ @@ -1470,7 +1473,7 @@ leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt25,"p_{T}^{TF}>=25, stubs in M leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt30,"p_{T}^{TF}>=30, stubs in ME1+(2+)st","pl"); leg1->Draw(); -Print(c_eff_pt_tf_eta1b_3s1b, "h_eff_pt_tf_eta1b_3s1b.png"); +Print(c_eff_pt_tf_eta1b_3s1b, "h_eff_pt_tf_eta1b_3s1b" + ext); @@ -1496,7 +1499,7 @@ leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus,"TF track with matched stubs in 2s leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); leg1->Draw(); -Print(c_eff_pth_tf,"h_eff_pth_tf.png"); +Print(c_eff_pth_tf,"h_eff_pth_tf" + ext); */ //################################################################################################ @@ -1521,7 +1524,7 @@ leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus_3st1a,"TF track with matched stubs leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus_pt10_3st1a,"p_{T}^{TF}>10 TF track with matched stubs in 3st","pl"); leg1->Draw(); -Print(c_eff_pth_tf_3st1a,"h_eff_pth_tf_3st1a.png"); +Print(c_eff_pth_tf_3st1a,"h_eff_pth_tf_3st1a" + ext); */ //################################################################################################ @@ -1556,7 +1559,7 @@ leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_q3,"Q=3","pl"); leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q3,"Q=3, p_{T}^{TF}>10","pl"); leg1->Draw(); -Print(c_eff_pt_tf_q,"h_eff_pt_tf_q.png"); +Print(c_eff_pt_tf_q,"h_eff_pt_tf_q" + ext); //################################################################################################ @@ -1579,7 +1582,7 @@ leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q2,"Q#geq2","pl"); leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q3,"Q=3","pl"); leg1->Draw(); -Print(c_eff_ptres_tf,"h_eff_ptres_tf.png"); +Print(c_eff_ptres_tf,"h_eff_ptres_tf" + ext); //################################################################################################ @@ -1599,7 +1602,7 @@ TGraphAsymmErrors *gg = new TGraphAsymmErrors(); gg->BayesDivide((const TH1*)h1,(const TH1*)h2); gg->Draw("p"); -Print(c_eff_DR2_tf,"h_eff_DR_2SimTr_tf.png"); +Print(c_eff_DR2_tf,"h_eff_DR_2SimTr_tf" + ext); */ @@ -1901,7 +1904,7 @@ h_eff_eta_after_tfcand_all ->GetXaxis()->SetRangeUser(0.9,2.5); h_eff_eta_after_tfcand_all ->Draw("hist"); h_eff_eta_after_tfcand->Draw("same hist"); c2->cd(2); -Print(c2,"h_eff_eta.png"); +Print(c2,"h_eff_eta" + ext); h_eff_eta_after_mpc->SetLineColor(kBlack); @@ -2043,7 +2046,7 @@ leg->AddEntry(h_eff_eta_after_gmt,"match to MPC & TF trk & GMT trk","pl"); leg->Draw(); Print(c22x,"h_eff_eta_steps_full.eps"); -Print(c22x,"h_eff_eta_steps_full.png"); +Print(c22x,"h_eff_eta_steps_full" + ext); */ if (h_eff_eta_steps_full10) { @@ -2069,7 +2072,7 @@ leg->AddEntry(h_eff_eta_after_gmt_pt10,"match to MPC & TF trk & GMT trk","pl"); leg->Draw(); Print(c22x10,"h_eff_eta_steps_full10.eps"); -Print(c22x10,"h_eff_eta_steps_full10.png"); +Print(c22x10,"h_eff_eta_steps_full10" + ext); Print(c22x10,"h_eff_eta_steps_full10.pdf"); } @@ -2109,7 +2112,7 @@ leg->AddEntry(h_eff_eta_after_tfcand_my_st1_pt10," (d) at least 1 matched TF stu leg->Draw(); Print(c22x10tf,"h_eff_eta_steps_full10_tf.eps"); -Print(c22x10tf,"h_eff_eta_steps_full10_tf.png"); +Print(c22x10tf,"h_eff_eta_steps_full10_tf" + ext); */ @@ -2147,7 +2150,7 @@ leg->AddEntry(h_eff_eta_after_tfcand_my_st1," at least 1 matched TF stub in ME1" leg->Draw(); Print(c22x10tfs,"h_eff_eta_steps_full10_tfs.eps"); -Print(c22x10tfs,"h_eff_eta_steps_full10_tfs.png"); +Print(c22x10tfs,"h_eff_eta_steps_full10_tfs" + ext); Print(c22x10tfs,"h_eff_eta_steps_full10_tfs.pdf"); */ @@ -2178,7 +2181,7 @@ leg->AddEntry(h_eff_eta_after_gmtreg_dr,"#Delta R match to CSC GMT trk","pl"); leg->Draw(); Print(c222xx1,"h_eff_eta_steps_xchk1.eps"); -Print(c222xx1,"h_eff_eta_steps_xchk1.png"); +Print(c222xx1,"h_eff_eta_steps_xchk1" + ext); } @@ -2212,7 +2215,7 @@ leg->AddEntry(h_eff_eta_after_xtra_dr,"#Delta R match to GMT","pl"); leg->Draw(); Print(c222xx2,"h_eff_eta_steps_xchk2.eps"); -Print(c222xx2,"h_eff_eta_steps_xchk2.png"); +Print(c222xx2,"h_eff_eta_steps_xchk2" + ext); return; */ @@ -2291,7 +2294,7 @@ leg->AddEntry(h_eff_eta_after_tfcand_all_pt10,"there is TF track p_{T}>10 in #De //leg->AddEntry(," ","pl"); leg->Draw(); Print(cme1n1,"h_eff_eta_me1_steps_all.eps"); -Print(cme1n1,"h_eff_eta_me1_steps_all.png"); +Print(cme1n1,"h_eff_eta_me1_steps_all" + ext); Print(cme1n1,"h_eff_eta_me1_steps_all.pdf"); @@ -2325,7 +2328,7 @@ leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct_plus," + one more MPC LCT stu leg->AddEntry(h_eff_eta_me1_after_tf_ok," + this stub was used by a TF track","pl"); leg->AddEntry(h_eff_eta_me1_after_tf_ok_pt10," + this TF track has p_{T}(TF)>10 GeV","pl"); leg->Draw(); -Print(cme1n2,"h_eff_eta_me1_tf.png"); +Print(cme1n2,"h_eff_eta_me1_tf" + ext); @@ -2355,7 +2358,7 @@ leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct_plus,"MPC LCT stubs in ME1 an leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus," + these stubs were used by a TF track","pl"); leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus_pt10," + this TF track has p_{T}(TF)>10 GeV","pl"); leg->Draw(); -Print(cme1n2_plus,"h_eff_eta_me1_tfplus.png"); +Print(cme1n2_plus,"h_eff_eta_me1_tfplus" + ext); @@ -2465,7 +2468,7 @@ leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"correct LCT","pl"); leg->Draw(); Print(cme1na,"h_eff_eta_me1_steps_stubs.eps"); -Print(cme1na,"h_eff_eta_me1_steps_stubs.png"); +Print(cme1na,"h_eff_eta_me1_steps_stubs" + ext); Print(cme1na,"h_eff_eta_me1_steps_stubs.pdf"); @@ -2533,7 +2536,7 @@ leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"correct LCT","pl"); leg->Draw(); Print(cme1na,"h_eff_eta_me1_steps_stubs.eps"); -Print(cme1na,"h_eff_eta_me1_steps_stubs.png"); +Print(cme1na,"h_eff_eta_me1_steps_stubs" + ext); Print(cme1na,"h_eff_eta_me1_steps_stubs.pdf"); */ From d1832eaad27f9eedaa4a3d563f8c16b1e3a950d3 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 09:55:49 +0200 Subject: [PATCH 026/182] forgot one plotDir --- SimMuL1/scripts/drawplot_etastep.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimMuL1/scripts/drawplot_etastep.C b/SimMuL1/scripts/drawplot_etastep.C index 04da20e27c35e..cdeb42cd93248 100644 --- a/SimMuL1/scripts/drawplot_etastep.C +++ b/SimMuL1/scripts/drawplot_etastep.C @@ -391,7 +391,7 @@ leg->AddEntry(h_eff_tf30_3s, "p_{T}^{TF}>=30", "l"); leg->AddEntry(h_eff_tf30_gpt30_2s1b, "#Delta#phi for p_{T}=30", "l"); leg->Draw(); -c3s_2s1b->Print("eff_3s_2s1b" + ext); +c3s_2s1b->Print(plotDir + "eff_3s_2s1b" + ext); From 2fe1f590f332a7762b34cebee701565a9a0d1eb0 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 10:23:28 +0200 Subject: [PATCH 027/182] add location of files and plots, and a variable ext for the plot extension --- SimMuL1/scripts/drawplot_frankenstein.C | 148 ++++++++++++------------ 1 file changed, 77 insertions(+), 71 deletions(-) diff --git a/SimMuL1/scripts/drawplot_frankenstein.C b/SimMuL1/scripts/drawplot_frankenstein.C index 34609cdf44d95..99bee7003bcc6 100644 --- a/SimMuL1/scripts/drawplot_frankenstein.C +++ b/SimMuL1/scripts/drawplot_frankenstein.C @@ -5,10 +5,14 @@ gROOT->ProcessLine(".L drawplot_gmtrt.C"); */ +TString ext = ".png"; +TString filesDir = "files/"; +TString plotDir = "plots/"; + void getPTHistos(TString dname) { -TString f_def = gem_dir; -TString f_gem = gem_dir; +TString f_def = filesDir; +TString f_gem = filesDir; if (dname.Contains("_pat8")) f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root"; if (dname == "minbias_pt05_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat8.root"; @@ -55,7 +59,9 @@ result_gem_gmtsing_no1a = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing6_3s1b_no1a void drawplot_frankenstein() { -gem_dir = "gem_vadim/"; gem_label = "gem98"; + //gem_dir = "gem_vadim/"; + gem_dir = plotDir; + gem_label = "gem98"; //gem_dir = "gem95/"; gem_label = "gem95"; @@ -285,13 +291,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-3s1b gem-3s-3s1b @@ -312,13 +318,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-2s1b gem-3s-2s1b @@ -339,13 +345,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s gem-3s-2s1b @@ -366,13 +372,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-3s1b gem-3s-2s1b @@ -394,13 +400,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.4 def-3s gem-3s-3s1b @@ -420,13 +426,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b @@ -447,13 +453,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1.2-2.1 def-3s gem-3s-3s1b @@ -473,13 +479,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1.2-2.1 def-3s-3s1b gem-3s-3s1b @@ -500,13 +506,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); @@ -641,13 +647,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-3s1b gem-3s-3s1b @@ -668,13 +674,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-2s1b gem-3s-2s1b @@ -695,13 +701,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s gem-3s-2s1b @@ -722,13 +728,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-3s1b gem-3s-2s1b @@ -750,13 +756,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.4 def-3s gem-3s-3s1b @@ -776,13 +782,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b @@ -803,13 +809,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1.2-2.1 def-3s gem-3s-3s1b @@ -829,13 +835,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1.2-2.1 def-3s-3s1b gem-3s-3s1b @@ -856,13 +862,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); @@ -915,13 +921,13 @@ result_def_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 5000.); result_def_gmtsing_no1a__pat2->GetYaxis()->SetRangeUser(1., 8000.); -bool get_ptshift = true; +bool get_ptshift = false; TH1D* result_gem_3s1b__pat2_ptshift, *result_gem_2s1b__pat2_ptshift; TH1D* result_gem_3s1b__pat2_ptshiftX, *result_gem_2s1b__pat2_ptshiftX; TFile *fsave; TFile *fsaveX; if (get_ptshift) { -fsave = new TFile("gem_3plus_ptshift.root"); +fsave = new TFile(filesDir + "gem_3plus_ptshift.root"); result_gem_3s1b__pat2__ptshift = (TH1D*) fsave->Get("result_gem_3s1b__pat2")->Clone("result_gem_3s1b__pat2__ptshift"); result_gem_3s1b__pat2__ptshift->SetFillColor(kGreen-5); result_gem_3s1b__pat2__ptshift->SetLineColor(kGreen-5); @@ -929,14 +935,14 @@ result_gem_2s1b__pat2__ptshift = (TH1D*) fsave->Get("result_gem_2s1b__pat2")->Cl result_gem_2s1b__pat2__ptshift->SetFillColor(kGreen-5); result_gem_2s1b__pat2__ptshift->SetLineColor(kGreen-5); -fsaveX = new TFile("gem_3plus_ptshiftX.root"); +fsaveX = new TFile(filesDir + "gem_3plus_ptshiftX.root"); result_gem_3s1b__pat2__ptshiftX = (TH1D*) fsaveX->Get("result_gem_3s1b__pat2")->Clone("result_gem_3s1b__pat2__ptshiftX"); result_gem_3s1b__pat2__ptshiftX->SetFillColor(kGreen-5); result_gem_3s1b__pat2__ptshiftX->SetLineColor(kGreen-5); result_gem_2s1b__pat2__ptshiftX = (TH1D*) fsaveX->Get("result_gem_2s1b__pat2")->Clone("result_gem_2s1b__pat2__ptshiftX"); result_gem_2s1b__pat2__ptshiftX->SetFillColor(kGreen-5); result_gem_2s1b__pat2__ptshiftX->SetLineColor(kGreen-5); -} + } ///----- 3 stubs @@ -956,15 +962,15 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); @@ -986,12 +992,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_gmtsing__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); @@ -1013,12 +1019,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_tightGEM__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_tightGEM__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2__ptshift, result_gem_3s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_tightGEM__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_tightGEM__Frankenstein_pat2__ratio" + ext); ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); @@ -1036,12 +1042,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_xtightGEM__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_xtightGEM__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2__ptshiftX, result_gem_3s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_xtightGEM__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_xtightGEM__Frankenstein_pat2__ratio" + ext); } //----- @@ -1063,7 +1069,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat8" + ext); @@ -1085,7 +1091,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein" + ext); /// ----- 2 stubs @@ -1107,12 +1113,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); @@ -1134,12 +1140,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_gmtsing__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); @@ -1162,12 +1168,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_tightGEM__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_tightGEM__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2__ptshift, result_gem_2s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_tightGEM__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_tightGEM__Frankenstein_pat2__ratio" + ext); fsave->Close(); @@ -1187,12 +1193,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_xtightGEM__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_xtightGEM__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2__ptshiftX, result_gem_2s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_xtightGEM__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_xtightGEM__Frankenstein_pat2__ratio" + ext); fsaveX->Close(); @@ -1216,7 +1222,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat8" + ext); @@ -1238,7 +1244,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein" + ext); /// ----- GMT current "default" single trigger @@ -1266,7 +1272,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__GMT__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__GMT__Frankenstein_pat2" + ext); @@ -1292,7 +1298,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s__Frankenstein_pat2" + ext); ///----- 2 & 123 & 13 & 3 stubs @@ -1323,17 +1329,17 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s123__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s123__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s123__pat2, result_gem_2s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s123__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s123__Frankenstein_pat2__ratio" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s13__pat2, result_gem_3s1b__pat2, "", 0.,1.4); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s2s13__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s2s13__Frankenstein_pat2__ratio" + ext); ///----- GMT 1.2 eta 2.14 @@ -1355,12 +1361,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__sequential__GMT2s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__sequential__GMT2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_sing_no1a__pat2, result_def_gmtsing_no1a__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__sequential__GMT2s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.2-2.1_PU100__sequential__GMT2s1b__Frankenstein_pat2__ratio" + ext); return; From 2163c263b7cada90e7cbce0f53d7ee6e105c6418 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 10:31:58 +0200 Subject: [PATCH 028/182] add location of files and plots, and a variable ext for the plot extension + adding missing histo declaration --- .../scripts/drawplot_frankenstein_ptshift.C | 110 +++++++++--------- SimMuL1/scripts/drawplot_gmtrt.C | 1 + 2 files changed, 58 insertions(+), 53 deletions(-) diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshift.C b/SimMuL1/scripts/drawplot_frankenstein_ptshift.C index 703bc3fe6ab30..4ea3fae2aef96 100644 --- a/SimMuL1/scripts/drawplot_frankenstein_ptshift.C +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshift.C @@ -5,10 +5,14 @@ gROOT->ProcessLine(".L drawplot_gmtrt.C"); */ +TString ext = ".png"; +TString filesDir = "files/"; +TString plotDir = "plots/rate_vs_pt/"; + void getPTHistos(TString dname) { -TString f_def = gem_dir; -TString f_gem = gem_dir; +TString f_def = filesDir; +TString f_gem = filesDir; if (dname.Contains("_pat8")) f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root"; if (dname == "minbias_pt05_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat8.root"; @@ -208,13 +212,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-3s1b gem-3s-3s1b @@ -235,13 +239,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-2s1b gem-3s-2s1b @@ -262,13 +266,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s gem-3s-2s1b @@ -289,13 +293,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-3s1b gem-3s-2s1b @@ -317,13 +321,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.4 def-3s gem-3s-3s1b @@ -343,13 +347,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b @@ -370,13 +374,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.1 def-3s gem-3s-3s1b @@ -396,13 +400,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b @@ -423,13 +427,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); @@ -554,13 +558,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-3s1b gem-3s-3s1b @@ -581,13 +585,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-2s1b gem-3s-2s1b @@ -608,13 +612,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s gem-3s-2s1b @@ -635,13 +639,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-3s1b gem-3s-2s1b @@ -663,13 +667,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.4 def-3s gem-3s-3s1b @@ -689,13 +693,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b @@ -716,13 +720,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.1 def-3s gem-3s-3s1b @@ -742,13 +746,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b @@ -769,13 +773,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); @@ -837,15 +841,15 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); @@ -867,12 +871,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); TFile fsave("gem_3plus_ptshift.root", "RECREATE"); @@ -899,7 +903,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat8" + ext); @@ -921,7 +925,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein" + ext); /// ----- 2 stubs @@ -943,12 +947,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); @@ -970,12 +974,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); @@ -995,7 +999,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat8" + ext); @@ -1017,7 +1021,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein" + ext); /// ----- GMT current "default" single trigger @@ -1045,7 +1049,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__GMT__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__GMT__Frankenstein_pat2" + ext); ///----- 2 & 3 stubs @@ -1071,7 +1075,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s__Frankenstein_pat2" + ext); return; diff --git a/SimMuL1/scripts/drawplot_gmtrt.C b/SimMuL1/scripts/drawplot_gmtrt.C index a11700b5c1cd7..e35143298ec1f 100644 --- a/SimMuL1/scripts/drawplot_gmtrt.C +++ b/SimMuL1/scripts/drawplot_gmtrt.C @@ -35,6 +35,7 @@ TH1D* result_def_eta_no1a = 0; TH1D* result_def_eta_no1a_3s1b = 0; TH1D* result_def_gmtsing = 0; +TH1D* result_gmtsing = 0; TH1D* result_def_gmtsing_no1a = 0; TH1D* result_gem_gmtsing_no1a = 0; From 47cf2da83fd1034bb6fb250708d0f1b1770bae51 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 12:22:38 +0200 Subject: [PATCH 029/182] fix units, add variable file extensions --- SimMuL1/scripts/drawplot_frankenstein.C | 10 +- .../scripts/drawplot_frankenstein_ptshift.C | 8 +- .../scripts/drawplot_frankenstein_ptshiftX.C | 119 +++++++++--------- 3 files changed, 74 insertions(+), 63 deletions(-) diff --git a/SimMuL1/scripts/drawplot_frankenstein.C b/SimMuL1/scripts/drawplot_frankenstein.C index 99bee7003bcc6..3b8c91128bd71 100644 --- a/SimMuL1/scripts/drawplot_frankenstein.C +++ b/SimMuL1/scripts/drawplot_frankenstein.C @@ -1,4 +1,3 @@ -gROOT->ProcessLine(".L drawplot_gmtrt.C"); /* .L drawplot_gmtrt.C @@ -59,6 +58,9 @@ result_gem_gmtsing_no1a = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing6_3s1b_no1a void drawplot_frankenstein() { + + gROOT->ProcessLine(".L drawplot_gmtrt.C"); + //gem_dir = "gem_vadim/"; gem_dir = plotDir; gem_label = "gem98"; @@ -222,9 +224,9 @@ for (int b = 1; b <= hh_2s13->GetNbinsX(); ++b) if (hh_2s13->GetBinContent(b)==0 for (int b = 1; b <= hh_sing_no1a->GetNbinsX(); ++b) if (hh_sing_no1a->GetBinContent(b)==0) hh_sing_no1a->SetBinError(b, 0.); -TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz"; -TString the_ttl_no1a = "CSC L1 trigger rates in 1.2<|#eta|<2.14;p_{T}^{cut}, GeV/c;rate, kHz"; -TString the_ttl_all = "CSC L1 trigger rates in 1.<|#eta|<2.4;p_{T}^{cut}, GeV/c;rate, kHz"; +TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]"; +TString the_ttl_no1a = "CSC L1 trigger rates in 1.2<|#eta|<2.14;p_{T}^{cut} [GeV/c];rate [kHz]"; +TString the_ttl_all = "CSC L1 trigger rates in 1.<|#eta|<2.4;p_{T}^{cut} [GeV/c];rate [kHz]"; hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); hh_all = setPTHisto(hh_all, the_ttl_all, kGreen+3, 1, 1); diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshift.C b/SimMuL1/scripts/drawplot_frankenstein_ptshift.C index 4ea3fae2aef96..9067e744dd220 100644 --- a/SimMuL1/scripts/drawplot_frankenstein_ptshift.C +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshift.C @@ -1,4 +1,3 @@ -gROOT->ProcessLine(".L drawplot_gmtrt.C"); /* .L drawplot_gmtrt.C @@ -53,7 +52,10 @@ result_gem_eta_no1a = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", void drawplot_frankenstein_ptshift() { -gem_dir = "gemPT/"; gem_label = "gem98"; + gROOT->ProcessLine(".L drawplot_gmtrt.C"); + + gem_dir = "plots/rate_vs_pt_shift/"; + gem_label = "gem98"; //gem_dir = "gem95/"; gem_label = "gem95"; @@ -159,7 +161,7 @@ for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0 for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); -TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz"; +TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]"; hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C index 2949ddcba81f2..b76c7a0392724 100644 --- a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C @@ -1,14 +1,17 @@ -gROOT->ProcessLine(".L drawplot_gmtrt.C"); /* .L drawplot_gmtrt.C */ +TString ext = ".png"; +TString filesDir = "files/"; +TString plotDir = "plots/"; + void getPTHistos(TString dname) { -TString f_def = gem_dir; -TString f_gem = gem_dir; +TString f_def = filesDir; +TString f_gem = filesDir; if (dname.Contains("_pat8")) f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root"; if (dname == "minbias_pt05_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat8.root"; @@ -49,7 +52,11 @@ result_gem_eta_no1a = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", void drawplot_frankenstein_ptshiftX() { -gem_dir = "gemPTX/"; gem_label = "gem98"; + gROOT->ProcessLine(".L drawplot_gmtrt.C"); + + //gem_dir = "gemPTX/"; + gem_dir = "plots/rate_vs_pt_shiftX/"; + gem_label = "gem98"; //gem_dir = "gem95/"; gem_label = "gem95"; @@ -155,7 +162,7 @@ for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0 for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); -TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz"; +TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]"; hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); @@ -208,13 +215,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-3s1b gem-3s-3s1b @@ -235,13 +242,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-2s1b gem-3s-2s1b @@ -262,13 +269,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s gem-3s-2s1b @@ -289,13 +296,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-3s1b gem-3s-2s1b @@ -317,13 +324,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.4 def-3s gem-3s-3s1b @@ -343,13 +350,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b @@ -370,13 +377,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.1 def-3s gem-3s-3s1b @@ -396,13 +403,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b @@ -423,13 +430,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); @@ -554,13 +561,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-3s1b gem-3s-3s1b @@ -581,13 +588,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-2s1b gem-3s-2s1b @@ -608,13 +615,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s gem-3s-2s1b @@ -635,13 +642,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-3s1b gem-3s-2s1b @@ -663,13 +670,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.4 def-3s gem-3s-3s1b @@ -689,13 +696,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b @@ -716,13 +723,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.1 def-3s gem-3s-3s1b @@ -742,13 +749,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b @@ -769,13 +776,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png"); +gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); @@ -837,15 +844,15 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); @@ -867,12 +874,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); TFile fsave("gem_3plus_ptshiftX.root", "RECREATE"); @@ -899,7 +906,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat8" + ext); @@ -921,7 +928,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein" + ext); /// ----- 2 stubs @@ -943,12 +950,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s1b__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); @@ -970,12 +977,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); @@ -995,7 +1002,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat8.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat8" + ext); @@ -1017,7 +1024,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein" + ext); /// ----- GMT current "default" single trigger @@ -1045,7 +1052,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__GMT__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__GMT__Frankenstein_pat2" + ext); ///----- 2 & 3 stubs @@ -1071,7 +1078,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s__Frankenstein_pat2.png"); +gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s__Frankenstein_pat2" + ext); return; From 15377c62fe048e0d74a66039bfd055cf948bdcd6 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 12:47:19 +0200 Subject: [PATCH 030/182] remove the extra dots in the file name, otherwise problem in including in latex presentation --- SimMuL1/scripts/drawplot_frankenstein.C | 94 +++++++++---------- .../scripts/drawplot_frankenstein_ptshift.C | 70 +++++++------- .../scripts/drawplot_frankenstein_ptshiftX.C | 70 +++++++------- SimMuL1/scripts/produceRatePlotsForApproval.C | 2 +- 4 files changed, 118 insertions(+), 118 deletions(-) diff --git a/SimMuL1/scripts/drawplot_frankenstein.C b/SimMuL1/scripts/drawplot_frankenstein.C index 3b8c91128bd71..0f3f7a59e0052 100644 --- a/SimMuL1/scripts/drawplot_frankenstein.C +++ b/SimMuL1/scripts/drawplot_frankenstein.C @@ -6,7 +6,7 @@ TString ext = ".png"; TString filesDir = "files/"; -TString plotDir = "plots/"; +TString plotDir = "plots/rate_vs_pt/"; void getPTHistos(TString dname) { @@ -293,13 +293,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-3s1b gem-3s-3s1b @@ -320,13 +320,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-2s1b gem-3s-2s1b @@ -347,13 +347,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s gem-3s-2s1b @@ -374,13 +374,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-3s1b gem-3s-2s1b @@ -402,13 +402,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.4 def-3s gem-3s-3s1b @@ -649,13 +649,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-3s1b gem-3s-3s1b @@ -676,13 +676,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-2s1b gem-3s-2s1b @@ -703,13 +703,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s gem-3s-2s1b @@ -730,13 +730,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-3s1b gem-3s-2s1b @@ -758,13 +758,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.4 def-3s gem-3s-3s1b @@ -964,15 +964,15 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); @@ -994,12 +994,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_gmtsing__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); @@ -1021,12 +1021,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_tightGEM__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_tightGEM__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2__ptshift, result_gem_3s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_tightGEM__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_tightGEM__Frankenstein_pat2__ratio" + ext); ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); @@ -1044,12 +1044,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_xtightGEM__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_xtightGEM__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2__ptshiftX, result_gem_3s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_xtightGEM__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_xtightGEM__Frankenstein_pat2__ratio" + ext); } //----- @@ -1071,7 +1071,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat8" + ext); @@ -1093,7 +1093,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein" + ext); /// ----- 2 stubs @@ -1115,12 +1115,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); @@ -1142,12 +1142,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_gmtsing__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); @@ -1170,12 +1170,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_tightGEM__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_tightGEM__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2__ptshift, result_gem_2s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_tightGEM__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_tightGEM__Frankenstein_pat2__ratio" + ext); fsave->Close(); @@ -1195,12 +1195,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_xtightGEM__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_xtightGEM__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2__ptshiftX, result_gem_2s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_xtightGEM__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_xtightGEM__Frankenstein_pat2__ratio" + ext); fsaveX->Close(); @@ -1224,7 +1224,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat8" + ext); @@ -1246,7 +1246,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein" + ext); /// ----- GMT current "default" single trigger @@ -1274,7 +1274,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__GMT__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__GMT__Frankenstein_pat2" + ext); @@ -1300,7 +1300,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2" + ext); ///----- 2 & 123 & 13 & 3 stubs @@ -1331,17 +1331,17 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s123__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s123__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s123__pat2, result_gem_2s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s123__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s123__Frankenstein_pat2__ratio" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s13__pat2, result_gem_3s1b__pat2, "", 0.,1.4); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s2s13__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s2s13__Frankenstein_pat2__ratio" + ext); ///----- GMT 1.2 eta 2.14 diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshift.C b/SimMuL1/scripts/drawplot_frankenstein_ptshift.C index 9067e744dd220..0bacbbef912be 100644 --- a/SimMuL1/scripts/drawplot_frankenstein_ptshift.C +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshift.C @@ -214,13 +214,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-3s1b gem-3s-3s1b @@ -241,13 +241,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-2s1b gem-3s-2s1b @@ -268,13 +268,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s gem-3s-2s1b @@ -295,13 +295,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-3s1b gem-3s-2s1b @@ -323,13 +323,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.4 def-3s gem-3s-3s1b @@ -560,13 +560,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-3s1b gem-3s-3s1b @@ -587,13 +587,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-2s1b gem-3s-2s1b @@ -614,13 +614,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s gem-3s-2s1b @@ -641,13 +641,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-3s1b gem-3s-2s1b @@ -669,13 +669,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.4 def-3s gem-3s-3s1b @@ -843,15 +843,15 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); @@ -873,12 +873,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); TFile fsave("gem_3plus_ptshift.root", "RECREATE"); @@ -905,7 +905,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat8" + ext); @@ -927,7 +927,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein" + ext); /// ----- 2 stubs @@ -949,12 +949,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); @@ -976,12 +976,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); @@ -1001,7 +1001,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat8" + ext); @@ -1023,7 +1023,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein" + ext); /// ----- GMT current "default" single trigger @@ -1051,7 +1051,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__GMT__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__GMT__Frankenstein_pat2" + ext); ///----- 2 & 3 stubs @@ -1077,7 +1077,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2" + ext); return; diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C index b76c7a0392724..af4096695588f 100644 --- a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C @@ -215,13 +215,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-3s1b gem-3s-3s1b @@ -242,13 +242,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-2s1b gem-3s-2s1b @@ -269,13 +269,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s gem-3s-2s1b @@ -296,13 +296,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-3s1b gem-3s-2s1b @@ -324,13 +324,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.4 def-3s gem-3s-3s1b @@ -561,13 +561,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-3s1b gem-3s-3s1b @@ -588,13 +588,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-2s1b gem-3s-2s1b @@ -615,13 +615,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s gem-3s-2s1b @@ -642,13 +642,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-3s1b gem-3s-2s1b @@ -670,13 +670,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.4 def-3s gem-3s-3s1b @@ -844,15 +844,15 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); @@ -874,12 +874,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); TFile fsave("gem_3plus_ptshiftX.root", "RECREATE"); @@ -906,7 +906,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat8" + ext); @@ -928,7 +928,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__3s__Frankenstein" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein" + ext); /// ----- 2 stubs @@ -950,12 +950,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); @@ -977,12 +977,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); @@ -1002,7 +1002,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat8" + ext); @@ -1024,7 +1024,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s__Frankenstein" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein" + ext); /// ----- GMT current "default" single trigger @@ -1052,7 +1052,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__GMT__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__GMT__Frankenstein_pat2" + ext); ///----- 2 & 3 stubs @@ -1078,7 +1078,7 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.6-2.1_PU100__sequential__2s3s__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2" + ext); return; diff --git a/SimMuL1/scripts/produceRatePlotsForApproval.C b/SimMuL1/scripts/produceRatePlotsForApproval.C index 8ae6fe7c24f3d..ee7d63f0ff2d5 100644 --- a/SimMuL1/scripts/produceRatePlotsForApproval.C +++ b/SimMuL1/scripts/produceRatePlotsForApproval.C @@ -29,7 +29,7 @@ void produceRatePlotsForApproval() gem_dir = "files/"; gem_label = "gem98"; - TString plots = "plots/"; + TString plots = "plots/rate/"; TString ext = ".pdf"; TString the_ttl = "CSC L1 trigger rates in ME1/b region;p_{T}^{cut} [GeV/c];rate [kHz]"; From 0a6e1fe0b99a47b18250ec8727759c0c2f8215ba Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 12:54:23 +0200 Subject: [PATCH 031/182] we already have a better plotter, see plotGEMCSCdPhi.py --- SimMuL1/scripts/dPhiGEMCSC.C | 120 ----------------------------------- 1 file changed, 120 deletions(-) delete mode 100644 SimMuL1/scripts/dPhiGEMCSC.C diff --git a/SimMuL1/scripts/dPhiGEMCSC.C b/SimMuL1/scripts/dPhiGEMCSC.C deleted file mode 100644 index 9fabcbffaad61..0000000000000 --- a/SimMuL1/scripts/dPhiGEMCSC.C +++ /dev/null @@ -1,120 +0,0 @@ -TCut ok_lct1 = "(has_lct&1) > 0"; -TCut ok_lct2 = "(has_lct&2) > 0"; - - -TCut ok_pad1 = "(has_gem_pad&1) > 0"; -TCut ok_pad2 = "(has_gem_pad&2) > 0"; - - - -TFile* gf = 0; -TTree* gt = 0; -TString gf_name = ""; - - -TTree* getTree(TString f_name) -{ -if (gf_name == f_name && gt != 0) return gt; -cout<Get("GEMCSCAnalyzer/trk_eff"); -return gt; -} - - -void drawplot_dphi() -{ - - - - txtHeader = new TLegend(.13,.935,.97,1.); - txtHeader->SetFillColor(kWhite); - txtHeader->SetFillStyle(0); - txtHeader->SetBorderSize(0); - txtHeader->SetTextFont(42); - txtHeader->SetTextSize(0.045); - txtHeader->SetTextAlign(22); - txtHeader->SetHeader("|#phi(CSC strip)-#phi(GEM Pad4)| in odd numbered chambers"); - - - legend = new TLegend(.4,.60,1.2,.92); - legend->SetFillColor(kWhite); - legend->SetFillStyle(0); - legend->SetBorderSize(0); - legend->SetTextSize(0.045); - legend->SetMargin(0.13); - - - t = getTree("gem_alfredo/gem_csc_delta_pt5_pad4.root"); - t1 = getTree("gem_alfredo/gem_csc_delta_pt20_pad4.root"); - - - TH1F *dphi_odd_pt5 = new TH1F("dphi_odd_pt5","",600,0.0,0.03); - TH1F *dphi_odd_pt20 = new TH1F("dphi_odd_pt20","",600,0.0,0.03); - - TCanvas* cDphi_odd = new TCanvas("cDphi_odd","cDphi_odd",700,450); - - t->Draw("TMath::Abs(dphi_pad_odd)>>dphi_odd_pt5" , ok_pad1 && ok_lct1); - t1->Draw("TMath::Abs(dphi_pad_odd)>>dphi_odd_pt20" , ok_pad1 && ok_lct1); - - dphi_odd_pt5->Scale(1/dphi_odd_pt5->Integral()); - dphi_odd_pt20->Scale(1/dphi_odd_pt20->Integral()); - - - dphi_odd_pt5->SetLineColor(kRed); - dphi_odd_pt20->SetLineColor(kBlue); - dphi_odd_pt5->SetLineWidth(2); - dphi_odd_pt20->SetLineWidth(2); - - dphi_odd_pt20->GetXaxis()->SetTitle("|#phi(CSC half-strip) - #phi(GEM pad)| [rad]"); - dphi_odd_pt20->GetYaxis()->SetTitle("Scaled to unity"); - - - legend->AddEntry(dphi_odd_pt5,"Muons with p_{T}=5 GeV","L"); - legend->AddEntry(dphi_odd_pt20,"Muons with p_{T}=20 GeV","L"); - - dphi_odd_pt20->Draw(); - dphi_odd_pt5->Draw("same"); - txtHeader->Draw("same"); - legend->Draw("same"); - cDphi_odd->SaveAs("Dphi_odd_chambers.png","recrate"); - - - TH1F *dphi_even_pt5 = new TH1F("dphi_even_pt5","",600,0.0,0.03); - TH1F *dphi_even_pt20 = new TH1F("dphi_even_pt20","",600,0.0,0.03); - - TCanvas* cDphi_even = new TCanvas("cDphi_even","cDphi_even",700,450); - - t->Draw("TMath::Abs(dphi_pad_even)>>dphi_even_pt5" , ok_pad2 && ok_lct2); - t1->Draw("TMath::Abs(dphi_pad_even)>>dphi_even_pt20" , ok_pad2 && ok_lct2); - - dphi_even_pt5->Scale(1/dphi_even_pt5->Integral()); - dphi_even_pt20->Scale(1/dphi_even_pt20->Integral()); - - dphi_even_pt5->SetLineColor(kRed); - dphi_even_pt20->SetLineColor(kBlue); - dphi_even_pt5->SetLineWidth(2); - dphi_even_pt20->SetLineWidth(2); - - dphi_even_pt20->GetXaxis()->SetTitle("|#phi(CSC half-strip) - #phi(GEM pad)| [rad]"); - dphi_even_pt20->GetYaxis()->SetTitle("Scaled to unity"); - - - txtHeader->SetHeader("|#phi(CSC strip)-#phi(GEM Pad4)| in even numbered chambers"); - - - dphi_even_pt20->Draw(); - dphi_even_pt5->Draw("same"); - txtHeader->Draw("same"); - legend->Draw("same"); - cDphi_even->SaveAs("Dphi_even_chambers.png","recrate"); - - - - - - - - -} From a0b235e883eda473875a34d503c9591bf004edd8 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 13:30:04 +0200 Subject: [PATCH 032/182] Create README.md --- SimMuL1/scripts/README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 SimMuL1/scripts/README.md diff --git a/SimMuL1/scripts/README.md b/SimMuL1/scripts/README.md new file mode 100644 index 0000000000000..159ea632b0fc8 --- /dev/null +++ b/SimMuL1/scripts/README.md @@ -0,0 +1,2 @@ +Usage of the plotting machinery +============================== From a225e72258374eb2d1b23b16c9ce28cc5db8497a Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 13:32:26 +0200 Subject: [PATCH 033/182] Update README.md --- SimMuL1/scripts/README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/SimMuL1/scripts/README.md b/SimMuL1/scripts/README.md index 159ea632b0fc8..5f48f3a469146 100644 --- a/SimMuL1/scripts/README.md +++ b/SimMuL1/scripts/README.md @@ -1,2 +1,37 @@ Usage of the plotting machinery ============================== + +ROOT +---- + +PyROOT +------ + +1. cuts.py + +This PyROOT files contains definitions of cuts used throughout the other PyROOT scripts + +2. drawplot_eff.py +3. + + +plotGEMCSCdPhi.py add more plotting options for bending angle 4 hours ago +produceDphiDict.py change file name 5 hours ago + +tdrStyle.py Update tdrStyle.py 5 days ago + + + + adding extra composite cuts 5 hours ago +drawplot_eff.C add location of files and plots, and a plot extension png pdf eps 4 hours ago +drawplot_etastep.C forgot one plotDir 4 hours ago +drawplot_frankenstein.C remove the extra dots in the file name, otherwise problem in includin… 43 minutes ago +drawplot_frankenstein_ptshift.C remove the extra dots in the file name, otherwise problem in includin… 43 minutes ago +drawplot_frankenstein_ptshiftX.C remove the extra dots in the file name, otherwise problem in includin… 43 minutes ago +drawplot_gmtrt.C add location of files and plots, and a variable ext for the plot exte… 3 hours ago +effFunctions.C a handle to keep the numerator of efficiency 12 hours ago +effFunctions.py adding option to use TEfficiency class 5 days ago +getPTHistos.C Create getPTHistos.C 9 days ago +produceRatePlotsForApproval.C remove the extra dots in the file name, otherwise problem in includin… 43 minutes ago +rootlogon.C moving plotting scripts to scripts directory 14 days ago +tdrstyle.C From 11abe00d290bfaa02601be90df6993ac394b62dc Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 13:38:16 +0200 Subject: [PATCH 034/182] Update README.md --- SimMuL1/scripts/README.md | 53 +++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/SimMuL1/scripts/README.md b/SimMuL1/scripts/README.md index 5f48f3a469146..142158ff7929a 100644 --- a/SimMuL1/scripts/README.md +++ b/SimMuL1/scripts/README.md @@ -1,37 +1,46 @@ -Usage of the plotting machinery -============================== +Usage of the plotting scripts +============================= ROOT ---- +###drawplot_eff.C +###drawplot_etastep.C +###drawplot_frankenstein.C +###drawplot_frankenstein_ptshift.C +###drawplot_frankenstein_ptshiftX.C +###drawplot_gmtrt.C +###effFunctions.C +###getPTHistos.C +###produceRatePlotsForApproval.C +###rootlogon.C +###tdrstyle.C + PyROOT ------ -1. cuts.py +###cuts.py + +Contains definitions of cuts used throughout the other PyROOT scripts + +###drawplot_eff.py + +Produces a lot of trigger efficiency plots. + +###plotGEMCSCdPhi.py + +###produceDphiDict.py + +Produces a dictionary of GEM-CSC bending angle values -This PyROOT files contains definitions of cuts used throughout the other PyROOT scripts +###tdrStyle.py -2. drawplot_eff.py -3. +Contains the recommended style for plots for the TDR +###effFunctions.py -plotGEMCSCdPhi.py add more plotting options for bending angle 4 hours ago -produceDphiDict.py change file name 5 hours ago +Contains definitions of efficiencies -tdrStyle.py Update tdrStyle.py 5 days ago - adding extra composite cuts 5 hours ago -drawplot_eff.C add location of files and plots, and a plot extension png pdf eps 4 hours ago -drawplot_etastep.C forgot one plotDir 4 hours ago -drawplot_frankenstein.C remove the extra dots in the file name, otherwise problem in includin… 43 minutes ago -drawplot_frankenstein_ptshift.C remove the extra dots in the file name, otherwise problem in includin… 43 minutes ago -drawplot_frankenstein_ptshiftX.C remove the extra dots in the file name, otherwise problem in includin… 43 minutes ago -drawplot_gmtrt.C add location of files and plots, and a variable ext for the plot exte… 3 hours ago -effFunctions.C a handle to keep the numerator of efficiency 12 hours ago -effFunctions.py adding option to use TEfficiency class 5 days ago -getPTHistos.C Create getPTHistos.C 9 days ago -produceRatePlotsForApproval.C remove the extra dots in the file name, otherwise problem in includin… 43 minutes ago -rootlogon.C moving plotting scripts to scripts directory 14 days ago -tdrstyle.C From 5d41bd13045f542320629f483fcec929010457d6 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 13:43:26 +0200 Subject: [PATCH 035/182] Update README.md --- SimMuL1/scripts/README.md | 44 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/SimMuL1/scripts/README.md b/SimMuL1/scripts/README.md index 142158ff7929a..2b746d994c577 100644 --- a/SimMuL1/scripts/README.md +++ b/SimMuL1/scripts/README.md @@ -5,17 +5,47 @@ ROOT ---- ###drawplot_eff.C + ###drawplot_etastep.C + ###drawplot_frankenstein.C + +
root -l -b drawplot_frankenstein.C
+
+ ###drawplot_frankenstein_ptshift.C + +
root -l -b drawplot_frankenstein_ptshift.C
+
+ ###drawplot_frankenstein_ptshiftX.C + +
root -l -b drawplot_frankenstein_ptshiftX.C
+
+ ###drawplot_gmtrt.C + + ###effFunctions.C + +Contains definitions of efficiencies + ###getPTHistos.C + +Auxiliary file + ###produceRatePlotsForApproval.C + +Produces trigger summary plots for approval + ###rootlogon.C + +Some useful definitions for ROOT + ###tdrstyle.C +Contains the recommended style for plots for the TDR + PyROOT ------ @@ -27,11 +57,23 @@ Contains definitions of cuts used throughout the other PyROOT scripts Produces a lot of trigger efficiency plots. +
python drawplot_eff.py
+
+ ###plotGEMCSCdPhi.py +Produces plots comparing the bending angle values for high and low pt muons + +
python plotGEMCSCdPhi.py  
+
+ ###produceDphiDict.py -Produces a dictionary of GEM-CSC bending angle values +Produces a dictionary of GEM-CSC bending angle values: GEMCSCdPhiDict.py + +
python produceDphiDict.py  
+
+ ###tdrStyle.py From 3cdc322aa644fa97c01ba7587b0581a25ba8c7d0 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 13:47:00 +0200 Subject: [PATCH 036/182] Update README.md --- SimMuL1/scripts/README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/SimMuL1/scripts/README.md b/SimMuL1/scripts/README.md index 2b746d994c577..f4bdabd952d08 100644 --- a/SimMuL1/scripts/README.md +++ b/SimMuL1/scripts/README.md @@ -6,25 +6,34 @@ ROOT ###drawplot_eff.C +Produces matching efficiency plots (simtrack to LCT, gem pad vs track pt, pt eta, lct eta, lct number) for even and odd chambers + ###drawplot_etastep.C ###drawplot_frankenstein.C +Produces a lot of rate plots. +
root -l -b drawplot_frankenstein.C
 
###drawplot_frankenstein_ptshift.C +Produces a lot of rate plots - what is the shift? +
root -l -b drawplot_frankenstein_ptshift.C
 
###drawplot_frankenstein_ptshiftX.C +Produces a lot of rate plots - what is the shiftX? +
root -l -b drawplot_frankenstein_ptshiftX.C
 
###drawplot_gmtrt.C +Used by the frankenstein plotting scripts ###effFunctions.C @@ -38,6 +47,8 @@ Auxiliary file Produces trigger summary plots for approval +Based on drawplot_frankenstein.C. Produces 4 plots comparing the trigger rate of GMT with CSCTF (n stubs, n stubs with ME1/b, n stubs with ME1/b and GEM); n=2,3; CSCTF track patterns > 2 and > 8 + ###rootlogon.C Some useful definitions for ROOT @@ -69,7 +80,7 @@ Produces plots comparing the bending angle values for high and low pt muons ###produceDphiDict.py -Produces a dictionary of GEM-CSC bending angle values: GEMCSCdPhiDict.py +Uses a set of input files from the GEMCSCAnalyzer for different pt values and builds a python libary file (GEMCSCdPhiDict.py) which can be used in other scripts.
python produceDphiDict.py  
 
From 9991a2eef767c93b9bdcc62aa7226aea9221124e Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 13:52:00 +0200 Subject: [PATCH 037/182] Update README.md --- SimMuL1/scripts/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SimMuL1/scripts/README.md b/SimMuL1/scripts/README.md index f4bdabd952d08..b578e1d371e6f 100644 --- a/SimMuL1/scripts/README.md +++ b/SimMuL1/scripts/README.md @@ -1,6 +1,12 @@ Usage of the plotting scripts ============================= +General stuff +------------- + +1. Keep your input ROOT files in a directory "files/" relative to the location of the scripts +2. The plots will be produced in a directory "plots/" relative to the location of the scripts - for each plotting script a specific output directory was added. + ROOT ---- From 79c1f49bc8e270f923df663e3c079dbcadcae0fd Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 14:07:05 +0200 Subject: [PATCH 038/182] Update README.md --- SimMuL1/scripts/README.md | 66 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/SimMuL1/scripts/README.md b/SimMuL1/scripts/README.md index b578e1d371e6f..daf63702a4ed5 100644 --- a/SimMuL1/scripts/README.md +++ b/SimMuL1/scripts/README.md @@ -18,11 +18,73 @@ Produces matching efficiency plots (simtrack to LCT, gem pad vs track pt, pt eta ###drawplot_frankenstein.C -Produces a lot of rate plots. -
root -l -b drawplot_frankenstein.C
 
+Produces a lot of rate plots +
Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt/rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt/rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__120-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt/rates__120-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__120-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt/rates__120-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__3s__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__3s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__3s__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__3s_tightGEM__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__3s_tightGEM__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__3s_xtightGEM__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__3s_xtightGEM__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__3s__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__3s__Frankenstein.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__2s__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__2s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__2s_tightGEM__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__2s_tightGEM__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__2s_xtightGEM__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__2s_xtightGEM__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__2s__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__2s__Frankenstein.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__GMT__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__2s3s123__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__2s3s123__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__164-214_PU100__sequential__3s2s13__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt/rates__120-214_PU100__sequential__GMT2s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt/rates__120-214_PU100__sequential__GMT2s1b__Frankenstein_pat2__ratio.png has been created
+
+ + ###drawplot_frankenstein_ptshift.C Produces a lot of rate plots - what is the shift? From 7e8e94d53d9cd68f8cda74b365f07a0978321688 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 14:14:53 +0200 Subject: [PATCH 039/182] Update README.md --- SimMuL1/scripts/README.md | 51 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/SimMuL1/scripts/README.md b/SimMuL1/scripts/README.md index daf63702a4ed5..cdabb9d35ab7d 100644 --- a/SimMuL1/scripts/README.md +++ b/SimMuL1/scripts/README.md @@ -22,6 +22,7 @@ Produces matching efficiency plots (simtrack to LCT, gem pad vs track pt, pt eta Produces a lot of rate plots +
Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png has been created
 Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created
 Info in : png file plots/rate_vs_pt/rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png has been created
@@ -87,11 +88,59 @@ Info in : png file plots/rate_vs_pt/rates__120-214_PU100__sequen
 
 ###drawplot_frankenstein_ptshift.C
 
+
root -l -b drawplot_frankenstein_ptshift.C
+
+ Produces a lot of rate plots - what is the shift? -
root -l -b drawplot_frankenstein_ptshift.C
+
Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__100-210_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__100-210_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__3s__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__3s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__3s__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__3s__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__3s__Frankenstein.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__2s__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__2s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__2s__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__2s__Frankenstein.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__GMT__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2.png has been created
 
+ ###drawplot_frankenstein_ptshiftX.C Produces a lot of rate plots - what is the shiftX? From ad038ac5d0516463f7267e4568f3354c8d6268d8 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 14:21:00 +0200 Subject: [PATCH 040/182] Update README.md --- SimMuL1/scripts/README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/SimMuL1/scripts/README.md b/SimMuL1/scripts/README.md index cdabb9d35ab7d..a783566d00fa4 100644 --- a/SimMuL1/scripts/README.md +++ b/SimMuL1/scripts/README.md @@ -107,6 +107,10 @@ Info in : png file plots/rate_vs_pt_shift/rates__100-240_PU100__ Info in : png file plots/rate_vs_pt_shift/rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created Info in : png file plots/rate_vs_pt_shift/rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png has been created Info in : png file plots/rate_vs_pt_shift/rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created +Info in : png file plots/rate_vs_pt_shift/rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png has been created +Info in : png file plots/rate_vs_pt_shift/rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created +Info in : png file plots/rate_vs_pt_shift/rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png has been created +Info in : png file plots/rate_vs_pt_shift/rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png has been created Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png has been created @@ -121,8 +125,10 @@ Info in : png file plots/rate_vs_pt_shift/rates__100-240_PU100__ Info in : png file plots/rate_vs_pt_shift/rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created Info in : png file plots/rate_vs_pt_shift/rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png has been created Info in : png file plots/rate_vs_pt_shift/rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created -Info in : png file plots/rate_vs_pt_shift/rates__100-210_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created -Info in : png file plots/rate_vs_pt_shift/rates__100-210_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created +Info in : png file plots/rate_vs_pt_shift/rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png has been created +Info in : png file plots/rate_vs_pt_shift/rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created +Info in : png file plots/rate_vs_pt_shift/rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png has been created +Info in : png file plots/rate_vs_pt_shift/rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__3s__Frankenstein_pat2.png has been created Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__3s1b__Frankenstein_pat2__ratio.png has been created Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__sequential__3s__Frankenstein_pat2__ratio.png has been created From e3ab25cb6a943532dc5b372880849d2bd1ce4db3 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 14:26:28 +0200 Subject: [PATCH 041/182] Update README.md --- SimMuL1/scripts/README.md | 55 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/SimMuL1/scripts/README.md b/SimMuL1/scripts/README.md index a783566d00fa4..316e64127ce0a 100644 --- a/SimMuL1/scripts/README.md +++ b/SimMuL1/scripts/README.md @@ -149,9 +149,62 @@ Info in : png file plots/rate_vs_pt_shift/rates__164-214_PU100__ ###drawplot_frankenstein_ptshiftX.C +
root -l -b drawplot_frankenstein_ptshiftX.C
+
+ Produces a lot of rate plots - what is the shiftX? -
root -l -b drawplot_frankenstein_ptshiftX.C
+
Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__sequential__3s__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__sequential__3s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__sequential__3s__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__sequential__3s__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__sequential__3s__Frankenstein.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__sequential__2s__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__sequential__2s1b__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__sequential__2s__Frankenstein_pat8.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__sequential__2s__Frankenstein.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__sequential__GMT__Frankenstein_pat2.png has been created
+Info in : png file plots/rate_vs_pt_shiftX/rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2.png has been created
 
###drawplot_gmtrt.C From 88fcec805b5b5bc91fa3e5a3bd455c609523e28f Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 14:45:57 +0200 Subject: [PATCH 042/182] small fixes --- SimMuL1/scripts/drawplot_etastep.C | 4 +- SimMuL1/scripts/drawplot_frankenstein.C | 42 +++++++++---------- .../scripts/drawplot_frankenstein_ptshift.C | 38 ++++++++--------- .../scripts/drawplot_frankenstein_ptshiftX.C | 36 ++++++++-------- 4 files changed, 60 insertions(+), 60 deletions(-) diff --git a/SimMuL1/scripts/drawplot_etastep.C b/SimMuL1/scripts/drawplot_etastep.C index cdeb42cd93248..154db161daf83 100644 --- a/SimMuL1/scripts/drawplot_etastep.C +++ b/SimMuL1/scripts/drawplot_etastep.C @@ -12,8 +12,8 @@ TH1F *gh; TH1D *h1, *h2, *he; TString filesDir = "files/"; -TString plotDir = "plots/"; -TString ext = ".png"; +TString plotDir = "plots/efficiency/"; +TString ext = ".pdf"; double yrange[2]={0.,1.04}; double yrange05[2]={0.5,1.04}; diff --git a/SimMuL1/scripts/drawplot_frankenstein.C b/SimMuL1/scripts/drawplot_frankenstein.C index 0f3f7a59e0052..f6bb975376e47 100644 --- a/SimMuL1/scripts/drawplot_frankenstein.C +++ b/SimMuL1/scripts/drawplot_frankenstein.C @@ -428,13 +428,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b @@ -455,13 +455,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1.2-2.1 def-3s gem-3s-3s1b @@ -474,20 +474,20 @@ TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->AddEntry(result_def_eta_no1a,"default emulator","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.2<|#eta|<2.4",""); +leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.2<|#eta|<2.14",""); leg->AddEntry(hh_no1a,"with GEM match","f"); leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__120-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__120-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1.2-2.1 def-3s-3s1b gem-3s-3s1b @@ -508,13 +508,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__120-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__120-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); @@ -784,13 +784,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b @@ -811,13 +811,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1.2-2.1 def-3s gem-3s-3s1b @@ -830,20 +830,20 @@ TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->AddEntry(result_def_eta_no1a,"default emulator","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.2<|#eta|<2.4",""); +leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.2<|#eta|<2.14",""); leg->AddEntry(hh_no1a,"with GEM match","f"); leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__120-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__120-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1.2-2.1 def-3s-3s1b gem-3s-3s1b @@ -864,13 +864,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__120-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__120-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); @@ -923,7 +923,7 @@ result_def_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 5000.); result_def_gmtsing_no1a__pat2->GetYaxis()->SetRangeUser(1., 8000.); -bool get_ptshift = false; +bool get_ptshift = true; TH1D* result_gem_3s1b__pat2_ptshift, *result_gem_2s1b__pat2_ptshift; TH1D* result_gem_3s1b__pat2_ptshiftX, *result_gem_2s1b__pat2_ptshiftX; TFile *fsave; @@ -1363,12 +1363,12 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__sequential__GMT2s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__120-214_PU100__sequential__GMT2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_sing_no1a__pat2, result_def_gmtsing_no1a__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1.2-2.1_PU100__sequential__GMT2s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__120-214_PU100__sequential__GMT2s1b__Frankenstein_pat2__ratio" + ext); return; diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshift.C b/SimMuL1/scripts/drawplot_frankenstein_ptshift.C index 0bacbbef912be..df31a99173a7f 100644 --- a/SimMuL1/scripts/drawplot_frankenstein_ptshift.C +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshift.C @@ -349,13 +349,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b @@ -376,13 +376,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.1 def-3s gem-3s-3s1b @@ -395,20 +395,20 @@ TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->AddEntry(result_def_eta_no1a,"default emulator","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); +leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.14",""); leg->AddEntry(hh_no1a,"with GEM match","f"); leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b @@ -429,13 +429,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); @@ -695,13 +695,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b @@ -716,19 +716,19 @@ leg->SetFillStyle(0); leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); leg->AddEntry(hh_all,"with GEM match","f"); leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.4",""); leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.1 def-3s gem-3s-3s1b @@ -741,20 +741,20 @@ TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->AddEntry(result_def_eta_no1a,"default emulator","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); +leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.14",""); leg->AddEntry(hh_no1a,"with GEM match","f"); leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b @@ -775,13 +775,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C index af4096695588f..c23e4bc37baa6 100644 --- a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C @@ -350,13 +350,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b @@ -371,19 +371,19 @@ leg->SetFillStyle(0); leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); leg->AddEntry(hh_all,"with GEM match","f"); leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); +leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.4",""); leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.1 def-3s gem-3s-3s1b @@ -403,13 +403,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b @@ -430,13 +430,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); +gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); @@ -696,13 +696,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b @@ -723,13 +723,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.4_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.1 def-3s gem-3s-3s1b @@ -742,20 +742,20 @@ TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->AddEntry(result_def_eta_no1a,"default emulator","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); +leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.14",""); leg->AddEntry(hh_no1a,"with GEM match","f"); leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b @@ -776,13 +776,13 @@ leg->Draw(); drawPULabel(); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); +gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__1-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); +gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); From 65de22af6d30b433ffb92aff7e979d3aed4fd279 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 14:46:16 +0200 Subject: [PATCH 043/182] small fixes --- SimMuL1/scripts/drawplot_eff.C | 1045 ++++++++++++++++---------------- 1 file changed, 527 insertions(+), 518 deletions(-) diff --git a/SimMuL1/scripts/drawplot_eff.C b/SimMuL1/scripts/drawplot_eff.C index 538d5c48ce428..2242509d1111f 100644 --- a/SimMuL1/scripts/drawplot_eff.C +++ b/SimMuL1/scripts/drawplot_eff.C @@ -2,14 +2,14 @@ gROOT->ProcessLine(".L effFunctions.C"); /* -.L + .L -"gem_csc_eff_pt2pt50_pad4.root" + "gem_csc_eff_pt2pt50_pad4.root" */ TString filesDir = "files/"; -TString plotDir = "plots/"; +TString plotDir = "plots/efficiency/"; TString ext = ".png"; TCut ok_sh1 = "(has_csc_sh&1) > 0"; @@ -79,20 +79,22 @@ TString gf_name = ""; TTree* getTree(TString f_name) { -if (gf_name == f_name && gt != 0) return gt; -cout<Get("GEMCSCAnalyzer/trk_eff"); -return gt; + if (gf_name == f_name && gt != 0) return gt; + cout<Get("GEMCSCAnalyzer/trk_eff"); + return gt; } void gemTurnOns(int label_eff = GEM_EFF98) { + // gROOT->ProcessLine(".L effFunctions.C"); + TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.14"; - const N = 5; + const int N = 5; int pt_lbl[N] = {DPHI_PT10, DPHI_PT15, DPHI_PT20, DPHI_PT30, DPHI_PT40}; TString pt[N] = {"pt10","pt15","pt20","pt30","pt40"}; @@ -112,13 +114,13 @@ void gemTurnOns(int label_eff = GEM_EFF98) TString opt = "p"; if (n>0) opt = "same p"; setDPhi(n, label_eff); - gEff->cd(); + gEff->cd(); ho[n] = draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", Form("h_odd%d",n), "(50,0.,50.)", "pt", ok_lct1 && ok_eta && ok_pad1, ok_dphi1, opt, kRed, marker_styles[n]); he[n] = draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", Form("h_evn%d",n), "(50,0.,50.)", "pt", ok_lct2 && ok_eta && ok_pad2, ok_dphi2, "same p", kBlue, marker_styles[n]); - gEff_odd->cd(); - ho[n]->Draw(opt); - gEff_even->cd(); - he[n]->Draw(opt); + gEff_odd->cd(); + ho[n]->Draw(opt); + gEff_even->cd(); + he[n]->Draw(opt); } TString pts[N] = {"10","15","20","30","40"}; @@ -141,7 +143,7 @@ void gemTurnOns(int label_eff = GEM_EFF98) leg->AddEntry(he[n], pts[n], "p"); } leg->Draw(); - gEff->Print("gem_pad_eff_for_LCT_gemEff" + efs[label_eff] +"" + ext); + gEff->Print(plotDir + "gem_pad_eff_for_LCT_gemEff" + efs[label_eff] +"" + ext); gEff_odd->cd(); TLegend *leg = new TLegend(0.50,0.17,.99,0.57, NULL, "brNDC"); @@ -154,7 +156,7 @@ void gemTurnOns(int label_eff = GEM_EFF98) leg->AddEntry(ho[n], pts[n], "p"); } leg->Draw(); - gEff_odd->Print("gem_pad_eff_for_LCT_gemEff" + efs[label_eff] +"_odd" + ext); + gEff_odd->Print(plotDir + "gem_pad_eff_for_LCT_gemEff" + efs[label_eff] +"_odd" + ext); gEff_even->cd(); TLegend *leg = new TLegend(0.50,0.17,.99,0.57, NULL, "brNDC"); @@ -167,77 +169,77 @@ void gemTurnOns(int label_eff = GEM_EFF98) leg->AddEntry(he[n], pts[n], "p"); } leg->Draw(); - gEff_even->Print("gem_pad_eff_for_LCT_gemEff" + efs[label_eff] +"_even" + ext); + gEff_even->Print(plotDir + "gem_pad_eff_for_LCT_gemEff" + efs[label_eff] +"_even" + ext); } float dphiCut(TH1* h, float fractionToKeep) { -TAxis *ax = h->GetXaxis(); -double total = h->Integral(); -int bin=1; -for(int b=1; bGetNbins(); ++b) { - //cout<GetBinUpEdge(b)<<" "<Integral(0,b)/total<Integral(0,b)/total > fractionToKeep) { bin = b - 1; break; } -} -// interpolate -float x1 = ax->GetBinUpEdge(bin), x2 = ax->GetBinUpEdge(bin + 1); -float y1 = h->Integral(0, bin)/total, y2 = h->Integral(0, bin + 1)/total; -float x = x1 + (fractionToKeep - y1)/(y2-y1)*(x2-x1); -cout<<"fraction "<GetXaxis(); + double total = h->Integral(); + int bin=1; + for(int b=1; bGetNbins(); ++b) { + //cout<GetBinUpEdge(b)<<" "<Integral(0,b)/total<Integral(0,b)/total > fractionToKeep) { bin = b - 1; break; } + } + // interpolate + float x1 = ax->GetBinUpEdge(bin), x2 = ax->GetBinUpEdge(bin + 1); + float y1 = h->Integral(0, bin)/total, y2 = h->Integral(0, bin + 1)/total; + float x = x1 + (fractionToKeep - y1)/(y2-y1)*(x2-x1); + cout<<"fraction "<Draw("TMath::Abs(dphi_pad_odd)>>dphi_odd(600,0.,0.03)" , ok_pad1 && ok_lct1); - t->Draw("TMath::Abs(dphi_pad_even)>>dphi_even(600,0.,0.03)" , ok_pad2 && ok_lct2); - for (int f=0; f<3; ++f) { - dphis[n][f][0] = dphiCut(dphi_odd, fr[f]); - dphis[n][f][1] = dphiCut(dphi_even, fr[f]); - } -} + float dphis[6][3][2] = {{{0.}}}; + TString pt[6] = {"pt5","pt10","pt15","pt20","pt30","pt40"}; + float fr[3] = {0.95, 0.98, 0.99}; -cout<Draw("TMath::Abs(dphi_pad_odd)>>dphi_odd(600,0.,0.03)" , ok_pad1 && ok_lct1); + t->Draw("TMath::Abs(dphi_pad_even)>>dphi_even(600,0.,0.03)" , ok_pad2 && ok_lct2); + for (int f=0; f<3; ++f) { + dphis[n][f][0] = dphiCut(dphi_odd, fr[f]); + dphis[n][f][1] = dphiCut(dphi_even, fr[f]); + } } -} -//TF1 fu("[0]*exp([1]*log(x))"); -//dphi_lct_pad95: -//odd { ,0.02023 ,0.009775 ,0.006611 ,0.005124 ,0.003744 ,0.003077} -//even { ,0.008336 ,0.004356 ,0.003241 ,0.002721 ,0.00222 ,0.001982} - -cout<Print(p_name); + //gPad->Print(p_name); } void eff_hs(TString f_name, TString p_name) { -// efficiency vs half-strip - separate odd-even -TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12"; + // efficiency vs half-strip - separate odd-even + TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12"; -TTree *t = getTree(f_name); -TH1F* ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1, "", kRed); -TH1F* he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2, "same"); + TTree *t = getTree(f_name); + TH1F* ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1, "", kRed); + TH1F* he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2, "same"); -TLegend *leg = new TLegend(0.50,0.23,.9,0.4, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(ho,"odd chambers","l"); -leg->AddEntry(he,"even chambers","l"); -leg->Draw(); + TLegend *leg = new TLegend(0.50,0.23,.9,0.4, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(ho,"odd chambers","l"); + leg->AddEntry(he,"even chambers","l"); + leg->Draw(); -gPad->Print(p_name); + gPad->Print(p_name); } void eff_hs_overlap(TString f_name, TString p_name) { -// efficiency vs half-strip - including overlaps in odd&even -TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12"; - -TTree *t = getTree(f_name); -TH1F* ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1_overlap, "", kRed); -TH1F* he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2_overlap, "same"); - -TF1 fo("fo", "pol0", 6., 123.); -ho->Fit("fo","RN"); -TF1 fe("fe", "pol0", 6., 123.); -he->Fit("fe","RN"); - -TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -//leg->AddEntry(ho, Form("odd chambers (%0.2f #pm %0.2f)%%", 100.*fo.GetParameter(0), 100.*fo.GetParError(0)),"l"); -//leg->AddEntry(he, Form("even chambers (%0.1f #pm %0.1f)%%", 100.*fe.GetParameter(0), 100.*fe.GetParError(0)),"l"); -leg->AddEntry(ho, "odd chambers","l"); -leg->AddEntry(he, "even chambers","l"); -leg->Draw(); - -gPad->Print(p_name); + // efficiency vs half-strip - including overlaps in odd&even + TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12"; + + TTree *t = getTree(f_name); + TH1F* ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1_overlap, "", kRed); + TH1F* he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2_overlap, "same"); + + TF1 fo("fo", "pol0", 6., 123.); + ho->Fit("fo","RN"); + TF1 fe("fe", "pol0", 6., 123.); + he->Fit("fe","RN"); + + TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + //leg->AddEntry(ho, Form("odd chambers (%0.2f #pm %0.2f)%%", 100.*fo.GetParameter(0), 100.*fo.GetParError(0)),"l"); + //leg->AddEntry(he, Form("even chambers (%0.1f #pm %0.1f)%%", 100.*fe.GetParameter(0), 100.*fe.GetParError(0)),"l"); + leg->AddEntry(ho, "odd chambers","l"); + leg->AddEntry(he, "even chambers","l"); + leg->Draw(); + + gPad->Print(p_name); } void drawplot_eff_eta() { -TCanvas* cEff = new TCanvas("cEff","cEff",700,450); -cEff->SetGridx(1); -cEff->SetGridy(1); - -TTree *gt = getTree(filesDir + "gem_csc_delta_pt40_pad4.root"); - -//ht = draw_geff(gt, "Eff. for a SimTrack to have an associated LCT;SimTrack |#eta|;Eff.", "h_odd", "(100,1.54,2.2)", "TMath::Abs(eta)", "", ok_lct1 || ok_lct2, "P", kRed); -//hh = draw_geff(gt, "Eff. for a SimTrack to have an associated LCT;SimTrack |#eta|;Eff.", "h_odd", "(100,1.54,2.2)", "TMath::Abs(eta)", "", ok_sh1 || ok_sh2, "P same", kViolet); -h1 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh1, ok_lct1, "P", kRed); -h2 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh2, ok_lct2, "P same"); -eff_base->GetYaxis()->SetRangeUser(0.6,1.05); -TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(h1, "odd chambers","l"); -leg->AddEntry(h2, "even chambers","l"); -leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); -tex->SetNDC(); -tex->Draw(); -cEff->Print("lct_eff_for_Trk_vsTrkEta_pt40" + ext); - - -h1 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT and GEM Pad;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh1, ok_lct1 && ok_pad1, "P", kRed); -h2 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT and GEM Pad;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh2, ok_lct2 && ok_pad2, "P same"); -eff_base->GetYaxis()->SetRangeUser(0.6,1.05); -TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(h1, "odd chambers","l"); -leg->AddEntry(h2, "even chambers","l"); -leg->Draw(); -TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); -tex->SetNDC(); -tex->Draw(); -cEff->Print("gem_pad_and_lct_eff_for_Trk_vsTrkEta_pt40" + ext); - -return; - -h1 = draw_geff(gt, "Eff. for a SimTrack to have an associated GEM Pad;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", "", ok_pad1 || ok_pad2, "P", kViolet); -eff_base->GetYaxis()->SetRangeUser(0.6,1.05); -TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); -tex->SetNDC(); -tex->Draw(); -cEff->Print("gem_pad0_eff_for_Trk_vsTrkEta_pt40" + ext); - - - - -TTree *gt15 = getTree(filesDir + "gem_csc_delta_pt15_pad4.root"); -h1 = draw_geff(gt15, "Eff. for a SimTrack to have an associated LCT;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_lct1 || ok_lct2, "P", kViolet+2); -cEff->Print("lct_eff_for_Trk_vsTrkEta_pt15" + ext); - - -ho = draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", ok_lct1, ok_pad1, "P", kRed); -he = draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta_lct_even)", ok_lct2, ok_pad2, "P same"); -TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(ho, "odd chambers","l"); -leg->AddEntry(he, "even chambers","l"); -leg->Draw(); -cEff->Print("gem_pad_eff_for_LCT_vsLCTEta_pt40" + ext); - -draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1, ok_pad1, "P", kRed); -draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2, ok_pad2, "P same"); -leg->Draw(); -cEff->Print("gem_pad_eff_for_LCT_vsTrkEta_pt40" + ext); - -draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", ok_lct1, ok_pad1_overlap, "P", kRed); -draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta_lct_even)", ok_lct2, ok_pad2_overlap, "P same"); -leg->Draw(); -cEff->Print("gem_pad_eff_for_LCT_vsLCTEta_pt40_overlap" + ext); - -draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1, ok_pad1_overlap, "P", kRed); -draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2, ok_pad2_overlap, "P same"); -leg->Draw(); -cEff->Print("gem_pad_eff_for_LCT_vsTrkEta_pt40_overlap" + ext); - -//draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1 && Ep, ok_pad1_overlap, "P", kRed); -//draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2 && Ep, ok_pad2_overlap, "P same"); -//draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_gemsh_odd)", ok_gsh1, ok_gdg1, "P", kRed); -h1 = draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_pad1 || ok_pad2, "P", kViolet); -h2 = draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_2pad1 || ok_2pad2, "P same", kViolet-6); -TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(h1, "at least one pad","l"); -leg->AddEntry(he, "two pads in two GEMs","l"); -leg->Draw(); -cEff->Print("gem_pad_eff_for_Trk_vsTrkEta_pt40" + ext); - -return; -draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_gsh1 || ok_gsh2, "P", kViolet); -draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_g2sh1 || ok_g2sh2 , "P", kOrange); -draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_copad1 || ok_copad2 , "P same", kRed); + + gROOT->ProcessLine(".L effFunctions.C"); + + TCanvas* cEff = new TCanvas("cEff","cEff",700,450); + cEff->SetGridx(1); + cEff->SetGridy(1); + + TTree *gt = getTree(filesDir + "gem_csc_delta_pt40_pad4.root"); + + //ht = draw_geff(gt, "Eff. for a SimTrack to have an associated LCT;SimTrack |#eta|;Eff.", "h_odd", "(100,1.54,2.2)", "TMath::Abs(eta)", "", ok_lct1 || ok_lct2, "P", kRed); + //hh = draw_geff(gt, "Eff. for a SimTrack to have an associated LCT;SimTrack |#eta|;Eff.", "h_odd", "(100,1.54,2.2)", "TMath::Abs(eta)", "", ok_sh1 || ok_sh2, "P same", kViolet); + h1 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh1, ok_lct1, "P", kRed); + h2 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh2, ok_lct2, "P same"); + eff_base->GetYaxis()->SetRangeUser(0.6,1.05); + TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(h1, "odd chambers","l"); + leg->AddEntry(h2, "even chambers","l"); + leg->Draw(); + TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); + tex->SetNDC(); + tex->Draw(); + cEff->Print("lct_eff_for_Trk_vsTrkEta_pt40" + ext); + + + h1 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT and GEM Pad;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh1, ok_lct1 && ok_pad1, "P", kRed); + h2 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT and GEM Pad;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh2, ok_lct2 && ok_pad2, "P same"); + eff_base->GetYaxis()->SetRangeUser(0.6,1.05); + TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(h1, "odd chambers","l"); + leg->AddEntry(h2, "even chambers","l"); + leg->Draw(); + TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); + tex->SetNDC(); + tex->Draw(); + cEff->Print("gem_pad_and_lct_eff_for_Trk_vsTrkEta_pt40" + ext); + + return; + + h1 = draw_geff(gt, "Eff. for a SimTrack to have an associated GEM Pad;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", "", ok_pad1 || ok_pad2, "P", kViolet); + eff_base->GetYaxis()->SetRangeUser(0.6,1.05); + TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); + tex->SetNDC(); + tex->Draw(); + cEff->Print("gem_pad0_eff_for_Trk_vsTrkEta_pt40" + ext); + + + + + TTree *gt15 = getTree(filesDir + "gem_csc_delta_pt15_pad4.root"); + h1 = draw_geff(gt15, "Eff. for a SimTrack to have an associated LCT;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_lct1 || ok_lct2, "P", kViolet+2); + cEff->Print("lct_eff_for_Trk_vsTrkEta_pt15" + ext); + + + ho = draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", ok_lct1, ok_pad1, "P", kRed); + he = draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta_lct_even)", ok_lct2, ok_pad2, "P same"); + TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(ho, "odd chambers","l"); + leg->AddEntry(he, "even chambers","l"); + leg->Draw(); + cEff->Print("gem_pad_eff_for_LCT_vsLCTEta_pt40" + ext); + + draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1, ok_pad1, "P", kRed); + draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2, ok_pad2, "P same"); + leg->Draw(); + cEff->Print("gem_pad_eff_for_LCT_vsTrkEta_pt40" + ext); + + draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", ok_lct1, ok_pad1_overlap, "P", kRed); + draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta_lct_even)", ok_lct2, ok_pad2_overlap, "P same"); + leg->Draw(); + cEff->Print("gem_pad_eff_for_LCT_vsLCTEta_pt40_overlap" + ext); + + draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1, ok_pad1_overlap, "P", kRed); + draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2, ok_pad2_overlap, "P same"); + leg->Draw(); + cEff->Print("gem_pad_eff_for_LCT_vsTrkEta_pt40_overlap" + ext); + + //draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1 && Ep, ok_pad1_overlap, "P", kRed); + //draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2 && Ep, ok_pad2_overlap, "P same"); + //draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_gemsh_odd)", ok_gsh1, ok_gdg1, "P", kRed); + h1 = draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_pad1 || ok_pad2, "P", kViolet); + h2 = draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_2pad1 || ok_2pad2, "P same", kViolet-6); + TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(h1, "at least one pad","l"); + leg->AddEntry(he, "two pads in two GEMs","l"); + leg->Draw(); + cEff->Print("gem_pad_eff_for_Trk_vsTrkEta_pt40" + ext); + + return; + draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_gsh1 || ok_gsh2, "P", kViolet); + draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_g2sh1 || ok_g2sh2 , "P", kOrange); + draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_copad1 || ok_copad2 , "P same", kRed); } @@ -436,23 +441,27 @@ draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta| void drawplot_eff() { -gf_name = ""; + gROOT->ProcessLine(".L effFunctions.C"); + + gf_name = ""; -TCanvas* cEff = new TCanvas("cEff","cEff",700,500); + TCanvas* cEff = new TCanvas("cEff","cEff",700,500); -eff_hs(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt05" + ext); -eff_hs(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt10" + ext); -eff_hs(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt15" + ext); -eff_hs(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt20" + ext); -eff_hs(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30" + ext); -eff_hs(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40" + ext); + eff_hs(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt05" + ext); + eff_hs(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt10" + ext); + eff_hs(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt15" + ext); + eff_hs(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt20" + ext); + eff_hs(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30" + ext); + eff_hs(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40" + ext); -eff_hs_overlap(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt05_overlap" + ext); -eff_hs_overlap(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt10_overlap" + ext); -eff_hs_overlap(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt15_overlap" + ext); -eff_hs_overlap(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt20_overlap" + ext); -eff_hs_overlap(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30_overlap" + ext); -eff_hs_overlap(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40_overlap" + ext); + eff_hs_overlap(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt05_overlap" + ext); + eff_hs_overlap(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt10_overlap" + ext); + eff_hs_overlap(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt15_overlap" + ext); + eff_hs_overlap(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt20_overlap" + ext); + eff_hs_overlap(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30_overlap" + ext); + eff_hs_overlap(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40_overlap" + ext); + + gemTurnOns(); } @@ -460,145 +469,145 @@ eff_hs_overlap(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff /* -TTree *gt = getTree("gem_csc_delta_pt40_pad4.root"); + TTree *gt = getTree("gem_csc_delta_pt40_pad4.root"); -draw_eff(gt, "Eff. ;p_{T}, GeV/c;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_sh1 && ok_eta , ok_digi1) -draw_eff(gt, "Eff. ;p_{T}, GeV/c;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_digi1 && ok_eta , ok_lct1) -draw_eff(gt, "Eff. ;p_{T}, GeV/c;Eff.", "hname", "(50,0.,50.)", "pt", ok_sh1 && ok_eta , ok_lct1) + draw_eff(gt, "Eff. ;p_{T}, GeV/c;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_sh1 && ok_eta , ok_digi1) + draw_eff(gt, "Eff. ;p_{T}, GeV/c;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_digi1 && ok_eta , ok_lct1) + draw_eff(gt, "Eff. ;p_{T}, GeV/c;Eff.", "hname", "(50,0.,50.)", "pt", ok_sh1 && ok_eta , ok_lct1) -draw_eff(gt, "Eff. of |CLCT pattern bend| selection for matched LCTs;p_{T}, GeV/c;Eff.", "hname2", "(50,0.,50.)", "pt", (ok_lct1||ok_lct2) && ok_eta, "TMath::Abs(bend_lct_odd)<2 || TMath::Abs(bend_lct_even)<2") -draw_eff(gt, "Eff. of |CLCT pattern bend| selection for matched LCTs;p_{T}, GeV/c;Eff.", "hname1", "(50,0.,50.)", "pt", (ok_lct1||ok_lct2) && ok_eta, "TMath::Abs(bend_lct_odd)<1 || TMath::Abs(bend_lct_even)<1","same",kBlack) -draw_eff(gt, "Eff. of |CLCT bend|<3 selection for matched LCTs;p_{T}, GeV/c;Eff.", "hname3", "(50,0.,50.)", "pt", (ok_lct1||ok_lct2) && ok_eta, "TMath::Abs(bend_lct_odd)<3 || TMath::Abs(bend_lct_even)<3","same",kGreen+2) -draw_eff(gt, "Eff. of |CLCT bend|<4 selection for matched LCTs;p_{T}, GeV/c;Eff.", "hname4", "(50,0.,50.)", "pt", (ok_lct1||ok_lct2) && ok_eta, "TMath::Abs(bend_lct_odd)<4 || TMath::Abs(bend_lct_even)<4","same",kRed) + draw_eff(gt, "Eff. of |CLCT pattern bend| selection for matched LCTs;p_{T}, GeV/c;Eff.", "hname2", "(50,0.,50.)", "pt", (ok_lct1||ok_lct2) && ok_eta, "TMath::Abs(bend_lct_odd)<2 || TMath::Abs(bend_lct_even)<2") + draw_eff(gt, "Eff. of |CLCT pattern bend| selection for matched LCTs;p_{T}, GeV/c;Eff.", "hname1", "(50,0.,50.)", "pt", (ok_lct1||ok_lct2) && ok_eta, "TMath::Abs(bend_lct_odd)<1 || TMath::Abs(bend_lct_even)<1","same",kBlack) + draw_eff(gt, "Eff. of |CLCT bend|<3 selection for matched LCTs;p_{T}, GeV/c;Eff.", "hname3", "(50,0.,50.)", "pt", (ok_lct1||ok_lct2) && ok_eta, "TMath::Abs(bend_lct_odd)<3 || TMath::Abs(bend_lct_even)<3","same",kGreen+2) + draw_eff(gt, "Eff. of |CLCT bend|<4 selection for matched LCTs;p_{T}, GeV/c;Eff.", "hname4", "(50,0.,50.)", "pt", (ok_lct1||ok_lct2) && ok_eta, "TMath::Abs(bend_lct_odd)<4 || TMath::Abs(bend_lct_even)<4","same",kRed) -draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;|#eta|;Eff.", "hname", "(90,1.5,2.2)", "TMath::Abs(eta)", ok_lct2, ok_pad2 ) -draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;|#eta|;Eff.", "hname", "(90,1.5,2.2)", "TMath::Abs(eta)", ok_lct1, ok_pad1, "same" ) + draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;|#eta|;Eff.", "hname", "(90,1.5,2.2)", "TMath::Abs(eta)", ok_lct2, ok_pad2 ) + draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;|#eta|;Eff.", "hname", "(90,1.5,2.2)", "TMath::Abs(eta)", ok_lct1, ok_pad1, "same" ) -draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;|#phi|;Eff.", "hname", "(128,0,3.2)", "TMath::Abs(phi)", ok_lct2 && ok_eta && ok_pt , ok_pad2 ) -draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;|#phi|;Eff.", "hname", "(128,0,3.2)", "TMath::Abs(phi)", ok_lct1 && ok_eta && ok_pt , ok_pad1, "same" ) + draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;|#phi|;Eff.", "hname", "(128,0,3.2)", "TMath::Abs(phi)", ok_lct2 && ok_eta && ok_pt , ok_pad2 ) + draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;|#phi|;Eff.", "hname", "(128,0,3.2)", "TMath::Abs(phi)", ok_lct1 && ok_eta && ok_pt , ok_pad1, "same" ) -draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;p_{T}, GeV/c;Eff.", "h_odd", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1) -draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;p_{T}, GeV/c;Eff.", "h_evn", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2, "same") + draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;p_{T}, GeV/c;Eff.", "h_odd", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1) + draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;p_{T}, GeV/c;Eff.", "h_evn", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2, "same") -// efficiency vs half-strip - separate odd-even -TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<1.9" -draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1, "", kRed) -draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2, "same") + // efficiency vs half-strip - separate odd-even + TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<1.9" + draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1, "", kRed) + draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2, "same") -// efficiency vs half-strip - including overlaps in odd&even -TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<1.9" -TCut ok_pad1_overlap = ok_pad1 || (ok_lct2 && ok_pad2); -TCut ok_pad2_overlap = ok_pad2 || (ok_lct1 && ok_pad1); -TTree *t = getTree("gem_csc_delta_pt20_pad4.root"); + // efficiency vs half-strip - including overlaps in odd&even + TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<1.9" + TCut ok_pad1_overlap = ok_pad1 || (ok_lct2 && ok_pad2); + TCut ok_pad2_overlap = ok_pad2 || (ok_lct1 && ok_pad1); + TTree *t = getTree("gem_csc_delta_pt20_pad4.root"); -draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1_overlap, "", kRed) -draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2_overlap, "same") + draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1_overlap, "", kRed) + draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2_overlap, "same") -draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", ok_lct1, ok_pad1, "", kRed) -draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta_lct_even)", ok_lct2, ok_pad2, "same") + draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", ok_lct1, ok_pad1, "", kRed) + draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta_lct_even)", ok_lct2, ok_pad2, "same") -draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;trk |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1, ok_pad1, "", kRed) -draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;trk |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2, ok_pad2, "same") + draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;trk |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1, ok_pad1, "", kRed) + draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;trk |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2, ok_pad2, "same") -draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1) -draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_env", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") + draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1) + draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_env", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") -draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd", "(50,0.,50.)", "pt", ok_lct1 && ok_eta && ok_pad1, ok_dphi1) -draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_evn", "(50,0.,50.)", "pt", ok_lct2 && ok_eta && ok_pad2, ok_dphi2, "same") + draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd", "(50,0.,50.)", "pt", ok_lct1 && ok_eta && ok_pad1, ok_dphi1) + draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_evn", "(50,0.,50.)", "pt", ok_lct2 && ok_eta && ok_pad2, ok_dphi2, "same") -// 98% pt10 -TCut ok_dphi1 = "TMath::Abs(dphi_pad_odd) < 0.01076" -TCut ok_dphi2 = "TMath::Abs(dphi_pad_even) < 0.004863" -draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd_10", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1, "", kRed) -draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_evn_10", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") -// 98% pt30 -TCut ok_dphi1 = "TMath::Abs(dphi_pad_odd) < 0.00571" -TCut ok_dphi2 = "TMath::Abs(dphi_pad_even) < 0.00306" -draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd_20", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1, "same", kRed) -draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_evn_20", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") -// 98% pt30 -TCut ok_dphi1 = "TMath::Abs(dphi_pad_odd) < 0.00426" -TCut ok_dphi2 = "TMath::Abs(dphi_pad_even) < 0.00256" -draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd_30", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1, "same", kRed) -draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_evn_30", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") -// 98% pt40 -TCut ok_dphi1 = "TMath::Abs(dphi_pad_odd) < 0.00351" -TCut ok_dphi2 = "TMath::Abs(dphi_pad_even) < 0.00231" -draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd_40", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1, "same", kRed) -draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_evn_40", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") + // 98% pt10 + TCut ok_dphi1 = "TMath::Abs(dphi_pad_odd) < 0.01076" + TCut ok_dphi2 = "TMath::Abs(dphi_pad_even) < 0.004863" + draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd_10", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1, "", kRed) + draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_evn_10", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") + // 98% pt30 + TCut ok_dphi1 = "TMath::Abs(dphi_pad_odd) < 0.00571" + TCut ok_dphi2 = "TMath::Abs(dphi_pad_even) < 0.00306" + draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd_20", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1, "same", kRed) + draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_evn_20", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") + // 98% pt30 + TCut ok_dphi1 = "TMath::Abs(dphi_pad_odd) < 0.00426" + TCut ok_dphi2 = "TMath::Abs(dphi_pad_even) < 0.00256" + draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd_30", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1, "same", kRed) + draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_evn_30", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") + // 98% pt40 + TCut ok_dphi1 = "TMath::Abs(dphi_pad_odd) < 0.00351" + TCut ok_dphi2 = "TMath::Abs(dphi_pad_even) < 0.00231" + draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd_40", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1, "same", kRed) + draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_evn_40", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") -|#Delta#phi_{odd}(LCT,Pad)| < 5.5 mrad -|#Delta#phi_{even}(LCT,Pad)| < 3.1 mrad -|#Delta#eta(LCT,Pad)| < 0.08 + |#Delta#phi_{odd}(LCT,Pad)| < 5.5 mrad + |#Delta#phi_{even}(LCT,Pad)| < 3.1 mrad + |#Delta#eta(LCT,Pad)| < 0.08 -draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_sh1 && ok_eta , ok_lct1 && ok_pad1 && ok_dphi1) -draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_sh2 && ok_eta , ok_lct2 && ok_pad2 && ok_dphi2, "same") + draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_sh1 && ok_eta , ok_lct1 && ok_pad1 && ok_dphi1) + draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_sh2 && ok_eta , ok_lct2 && ok_pad2 && ok_dphi2, "same") -draw_eff(gt, "title;pt;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1) + draw_eff(gt, "title;pt;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1) -draw_eff(gt, "title;pt;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") + draw_eff(gt, "title;pt;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") -draw_eff(gt, "title;|#eta|;Eff.", "hname", "(45,1.5,2.2)", "TMath::Abs(eta)", ok_sh1 , ok_lct1 && ok_pad1 ) + draw_eff(gt, "title;|#eta|;Eff.", "hname", "(45,1.5,2.2)", "TMath::Abs(eta)", ok_sh1 , ok_lct1 && ok_pad1 ) -draw_eff(gt, "title;|#phi|;Eff.", "hname", "(128,0,3.2)", "TMath::Abs(phi)", ok_sh2 , ok_lct2 && ok_pad2 ) + draw_eff(gt, "title;|#phi|;Eff.", "hname", "(128,0,3.2)", "TMath::Abs(phi)", ok_sh2 , ok_lct2 && ok_pad2 ) -gt->Draw("TMath::Abs(eta)", ok_sh1, ""); -gt->Draw("TMath::Abs(eta)", ok_sh1 && ok_lct1, "same"); -gt->Draw("TMath::Abs(eta)", ok_sh1 && ok_lct1 && ok_pad1, "same"); + gt->Draw("TMath::Abs(eta)", ok_sh1, ""); + gt->Draw("TMath::Abs(eta)", ok_sh1 && ok_lct1, "same"); + gt->Draw("TMath::Abs(eta)", ok_sh1 && ok_lct1 && ok_pad1, "same"); -gt->Draw("TMath::Abs(phi)", ok_sh1 && ok_lct1 && ok_pad1, ""); -gt->Draw("TMath::Abs(phi)", ok_sh1, ""); -gt->Draw("TMath::Abs(eta)", ok_sh1 && ok_lct1, "same"); + gt->Draw("TMath::Abs(phi)", ok_sh1 && ok_lct1 && ok_pad1, ""); + gt->Draw("TMath::Abs(phi)", ok_sh1, ""); + gt->Draw("TMath::Abs(eta)", ok_sh1 && ok_lct1, "same"); -gt->Draw("TMath::Abs(phi)", ok_sh1, ""); -gt->Draw("TMath::Abs(phi)", ok_sh1 && ok_lct1, "same"); -gt->Draw("TMath::Abs(phi)", ok_sh1 && ok_lct1 && ok_pad1, "same"); + gt->Draw("TMath::Abs(phi)", ok_sh1, ""); + gt->Draw("TMath::Abs(phi)", ok_sh1 && ok_lct1, "same"); + gt->Draw("TMath::Abs(phi)", ok_sh1 && ok_lct1 && ok_pad1, "same"); -gt->Draw("pt", ok_sh1, ""); -gt->Draw("pt", ok_sh1 && ok_lct1, "same"); -gt->Draw("pt", ok_sh1 && ok_lct1 && ok_pad1, "same"); -gt->Draw("pt", ok_sh1, ""); -gt->Draw("pt", ok_sh1 && ok_lct1 && ok_pad1, "same"); + gt->Draw("pt", ok_sh1, ""); + gt->Draw("pt", ok_sh1 && ok_lct1, "same"); + gt->Draw("pt", ok_sh1 && ok_lct1 && ok_pad1, "same"); + gt->Draw("pt", ok_sh1, ""); + gt->Draw("pt", ok_sh1 && ok_lct1 && ok_pad1, "same"); -gt->Draw("pt>>h1", ok_sh1, ""); -dn=(TH1F*)h1->Clone("dn") -gt->Draw("pt>>h2", ok_sh1 && ok_lct1 && ok_pad1, "same"); -nm=(TH1F*)h2->Clone("nm") + gt->Draw("pt>>h1", ok_sh1, ""); + dn=(TH1F*)h1->Clone("dn") + gt->Draw("pt>>h2", ok_sh1 && ok_lct1 && ok_pad1, "same"); + nm=(TH1F*)h2->Clone("nm") -dn->Draw() -nm->Draw("same") + dn->Draw() + nm->Draw("same") -nm->Divide(dn) -nm->Draw() + nm->Divide(dn) + nm->Draw() -gt->Draw("pt>>h2", ok_sh1 && ok_lct1, "same"); -nmlct=(TH1F*)h2->Clone("nmlct") -nmlct->Divide(dn) + gt->Draw("pt>>h2", ok_sh1 && ok_lct1, "same"); + nmlct=(TH1F*)h2->Clone("nmlct") + nmlct->Divide(dn) -nm->Draw() -nmlct->Draw("same") + nm->Draw() + nmlct->Draw("same") @@ -627,167 +636,167 @@ nmlct->Draw("same") ---------------------------- 2012 Oct 30 ----------------------- + --------------------------- 2012 Oct 30 ----------------------- -.L shFunctions.C + .L shFunctions.C -//fname="shtree_std_pt100.root"; suff = "std_pt100"; -fname="shtree_POSTLS161_pt100.root"; suff = "postls1_pt100"; + //fname="shtree_std_pt100.root"; suff = "std_pt100"; + fname="shtree_POSTLS161_pt100.root"; suff = "postls1_pt100"; -TFile *f = TFile::Open(fname) -tree = (TTree *) f->Get("neutronAna/CSCSimHitsTree"); + TFile *f = TFile::Open(fname) + tree = (TTree *) f->Get("neutronAna/CSCSimHitsTree"); -TCanvas c1("c1","c1",1200,600); -c1->SetBorderSize(0); -c1->SetLeftMargin(0.084); -c1->SetRightMargin(0.033); -c1->SetTopMargin(0.089); -c1->SetBottomMargin(0.086); -c1->SetGridy(); -c1->SetTickx(1); -c1->SetTicky(1); -gStyle->SetOptStat(0); + TCanvas c1("c1","c1",1200,600); + c1->SetBorderSize(0); + c1->SetLeftMargin(0.084); + c1->SetRightMargin(0.033); + c1->SetTopMargin(0.089); + c1->SetBottomMargin(0.086); + c1->SetGridy(); + c1->SetTickx(1); + c1->SetTicky(1); + gStyle->SetOptStat(0); -TH2D *hc = new TH2D("hc","Strip readout channels closest to SimHit",21,-10.5,10.5,82,0,82); -hc->Draw() -setupH2DType(hc); -hc->GetYaxis()->SetTitle("readout channel #"); + TH2D *hc = new TH2D("hc","Strip readout channels closest to SimHit",21,-10.5,10.5,82,0,82); + hc->Draw() + setupH2DType(hc); + hc->GetYaxis()->SetTitle("readout channel #"); -tree->Draw("sh.chan:(3-2*id.e)*id.t","","same", 10000000, 0); -g = (TGraph*)gPad->FindObject("Graph"); -g->SetMarkerColor(kBlue); -g->SetMarkerStyle(2); -g->SetMarkerSize(0.4); -gPad->Modified() + tree->Draw("sh.chan:(3-2*id.e)*id.t","","same", 10000000, 0); + g = (TGraph*)gPad->FindObject("Graph"); + g->SetMarkerColor(kBlue); + g->SetMarkerStyle(2); + g->SetMarkerSize(0.4); + gPad->Modified() -c1.Print((string("chan_")+suff+"" + ext).c_str()) + c1.Print((string("chan_")+suff+"" + ext).c_str()) -TH2D *hc = new TH2D("hc","Strips closest to SimHit",21,-10.5,10.5,82,0,82) -for(int b=1; b<=hc->GetXaxis()->GetNbins(); ++b) hc->GetXaxis()->SetBinLabel(b, types2[b].c_str()) -hc->Draw() -setupH2DType(hc); -hc->GetYaxis()->SetTitle("strip #"); + TH2D *hc = new TH2D("hc","Strips closest to SimHit",21,-10.5,10.5,82,0,82) + for(int b=1; b<=hc->GetXaxis()->GetNbins(); ++b) hc->GetXaxis()->SetBinLabel(b, types2[b].c_str()) + hc->Draw() + setupH2DType(hc); + hc->GetYaxis()->SetTitle("strip #"); -tree->Draw("sh.s:(3-2*id.e)*id.t","","same", 10000000, 0); -g = (TGraph*)gPad->FindObject("Graph"); -g->SetMarkerColor(kBlue); -g->SetMarkerStyle(2); -g->SetMarkerSize(0.4); -gPad->Modified() + tree->Draw("sh.s:(3-2*id.e)*id.t","","same", 10000000, 0); + g = (TGraph*)gPad->FindObject("Graph"); + g->SetMarkerColor(kBlue); + g->SetMarkerStyle(2); + g->SetMarkerSize(0.4); + gPad->Modified() -c1.Print((string("strip_")+suff+"" + ext).c_str()) + c1.Print((string("strip_")+suff+"" + ext).c_str()) -TH2D *hc = new TH2D("hc","Wire groups closest to SimHit",21,-10.5,10.5,115,-1,114) -for(int b=1; b<=hc->GetXaxis()->GetNbins(); ++b) hc->GetXaxis()->SetBinLabel(b, types2[b].c_str()) -hc->Draw() -setupH2DType(hc); -hc->GetYaxis()->SetTitle("wiregroup #"); -hc->GetYaxis()->SetNdivisions(1020); + TH2D *hc = new TH2D("hc","Wire groups closest to SimHit",21,-10.5,10.5,115,-1,114) + for(int b=1; b<=hc->GetXaxis()->GetNbins(); ++b) hc->GetXaxis()->SetBinLabel(b, types2[b].c_str()) + hc->Draw() + setupH2DType(hc); + hc->GetYaxis()->SetTitle("wiregroup #"); + hc->GetYaxis()->SetNdivisions(1020); -tree->Draw("sh.w:(3-2*id.e)*id.t","","same", 10000000, 0); -g = (TGraph*)gPad->FindObject("Graph"); -g->SetMarkerColor(kBlue); -g->SetMarkerStyle(2); -g->SetMarkerSize(0.4); -gPad->Modified() + tree->Draw("sh.w:(3-2*id.e)*id.t","","same", 10000000, 0); + g = (TGraph*)gPad->FindObject("Graph"); + g->SetMarkerColor(kBlue); + g->SetMarkerStyle(2); + g->SetMarkerSize(0.4); + gPad->Modified() -c1.Print((string("wg_")+suff+"" + ext).c_str()) + c1.Print((string("wg_")+suff+"" + ext).c_str()) -.L shFunctions.C -//fname="shtree_POSTLS161_pt100.root"; suff = "postls1_pt100"; -//fname="shtree_POSTLS161_pt10.root"; suff = "postls1_pt10"; -fname="shtree_POSTLS161_pt1000.root"; suff = "postls1_pt1000"; -TFile *f = TFile::Open(fname) + .L shFunctions.C + //fname="shtree_POSTLS161_pt100.root"; suff = "postls1_pt100"; + //fname="shtree_POSTLS161_pt10.root"; suff = "postls1_pt10"; + fname="shtree_POSTLS161_pt1000.root"; suff = "postls1_pt1000"; + TFile *f = TFile::Open(fname) -globalPosfromTree("+ME1", f, 1, 1, "rphi_+ME1_postls1" + ext) -globalPosfromTree("+ME2", f, 1, 2, "rphi_+ME2_postls1" + ext) -globalPosfromTree("+ME3", f, 1, 3, "rphi_+ME3_postls1" + ext) -globalPosfromTree("+ME4", f, 1, 4, "rphi_+ME4_postls1" + ext) -globalPosfromTree("-ME1", f, 2, 1, "rphi_-ME1_postls1" + ext) -globalPosfromTree("-ME2", f, 2, 2, "rphi_-ME2_postls1" + ext) -globalPosfromTree("-ME3", f, 2, 3, "rphi_-ME3_postls1" + ext) -globalPosfromTree("-ME4", f, 2, 4, "rphi_-ME4_postls1" + ext) + globalPosfromTree("+ME1", f, 1, 1, "rphi_+ME1_postls1" + ext) + globalPosfromTree("+ME2", f, 1, 2, "rphi_+ME2_postls1" + ext) + globalPosfromTree("+ME3", f, 1, 3, "rphi_+ME3_postls1" + ext) + globalPosfromTree("+ME4", f, 1, 4, "rphi_+ME4_postls1" + ext) + globalPosfromTree("-ME1", f, 2, 1, "rphi_-ME1_postls1" + ext) + globalPosfromTree("-ME2", f, 2, 2, "rphi_-ME2_postls1" + ext) + globalPosfromTree("-ME3", f, 2, 3, "rphi_-ME3_postls1" + ext) + globalPosfromTree("-ME4", f, 2, 4, "rphi_-ME4_postls1" + ext) -.L shFunctions.C -fname="shtree_std_pt100.root"; suff = "std_pt100"; -TFile *f = TFile::Open(fname) -globalPosfromTree("+ME1", f, 1, 1, "rphi_+ME1_std" + ext) -globalPosfromTree("+ME2", f, 1, 2, "rphi_+ME2_std" + ext) -globalPosfromTree("+ME3", f, 1, 3, "rphi_+ME3_std" + ext) -globalPosfromTree("+ME4", f, 1, 4, "rphi_+ME4_std" + ext) -globalPosfromTree("-ME1", f, 2, 1, "rphi_-ME1_std" + ext) -globalPosfromTree("-ME2", f, 2, 2, "rphi_-ME2_std" + ext) -globalPosfromTree("-ME3", f, 2, 3, "rphi_-ME3_std" + ext) -globalPosfromTree("-ME4", f, 2, 4, "rphi_-ME4_std" + ext) + .L shFunctions.C + fname="shtree_std_pt100.root"; suff = "std_pt100"; + TFile *f = TFile::Open(fname) + globalPosfromTree("+ME1", f, 1, 1, "rphi_+ME1_std" + ext) + globalPosfromTree("+ME2", f, 1, 2, "rphi_+ME2_std" + ext) + globalPosfromTree("+ME3", f, 1, 3, "rphi_+ME3_std" + ext) + globalPosfromTree("+ME4", f, 1, 4, "rphi_+ME4_std" + ext) + globalPosfromTree("-ME1", f, 2, 1, "rphi_-ME1_std" + ext) + globalPosfromTree("-ME2", f, 2, 2, "rphi_-ME2_std" + ext) + globalPosfromTree("-ME3", f, 2, 3, "rphi_-ME3_std" + ext) + globalPosfromTree("-ME4", f, 2, 4, "rphi_-ME4_std" + ext) -fname="shtree_std_pt100.root"; suff = "std_pt100"; -//fname="shtree_POSTLS161_pt100.root"; suff = "postls1_pt100"; + fname="shtree_std_pt100.root"; suff = "std_pt100"; + //fname="shtree_POSTLS161_pt100.root"; suff = "postls1_pt100"; -TFile *f = TFile::Open(fname) -tree = (TTree *) f->Get("neutronAna/CSCSimHitsTree"); + TFile *f = TFile::Open(fname) + tree = (TTree *) f->Get("neutronAna/CSCSimHitsTree"); -TCanvas c1("c1","c1",900,900); -c1->SetBorderSize(0); -c1->SetLeftMargin(0.13); -c1->SetRightMargin(0.012); -c1->SetTopMargin(0.022); -c1->SetBottomMargin(0.111); -c1->SetGridy(); -c1->SetTickx(1); -c1->SetTicky(1); -gStyle->SetOptStat(0); + TCanvas c1("c1","c1",900,900); + c1->SetBorderSize(0); + c1->SetLeftMargin(0.13); + c1->SetRightMargin(0.012); + c1->SetTopMargin(0.022); + c1->SetBottomMargin(0.111); + c1->SetGridy(); + c1->SetTickx(1); + c1->SetTicky(1); + gStyle->SetOptStat(0); -TH2D *hc = new TH2D("hc",";z, cm;r, cm",2,560,1070,82,70,710); -hc->Draw() -h->GetXaxis()->SetTickLength(0.02); -h->GetYaxis()->SetTickLength(0.02); + TH2D *hc = new TH2D("hc",";z, cm;r, cm",2,560,1070,82,70,710); + hc->Draw() + h->GetXaxis()->SetTickLength(0.02); + h->GetYaxis()->SetTickLength(0.02); -tree->Draw("sh.r:sh.gz","","same", 10000000, 0); -g = (TGraph*)gPad->FindObject("Graph"); -g->SetMarkerColor(kBlue); -g->SetMarkerStyle(1); -g->SetMarkerSize(0.1); -gPad->Modified() + tree->Draw("sh.r:sh.gz","","same", 10000000, 0); + g = (TGraph*)gPad->FindObject("Graph"); + g->SetMarkerColor(kBlue); + g->SetMarkerStyle(1); + g->SetMarkerSize(0.1); + gPad->Modified() -c1.Print((string("rz_+ME_")+suff+"" + ext).c_str()) + c1.Print((string("rz_+ME_")+suff+"" + ext).c_str()) -TH2D *hc = new TH2D("hc",";z, cm;r, cm",2,-1070,-560,82,70,710); -hc->Draw() -h->GetXaxis()->SetTickLength(0.02); -h->GetYaxis()->SetTickLength(0.02); + TH2D *hc = new TH2D("hc",";z, cm;r, cm",2,-1070,-560,82,70,710); + hc->Draw() + h->GetXaxis()->SetTickLength(0.02); + h->GetYaxis()->SetTickLength(0.02); -tree->Draw("sh.r:sh.gz","","same", 10000000, 0); -g = (TGraph*)gPad->FindObject("Graph"); -g->SetMarkerColor(kBlue); -g->SetMarkerStyle(1); -g->SetMarkerSize(0.1); -gPad->Modified() + tree->Draw("sh.r:sh.gz","","same", 10000000, 0); + g = (TGraph*)gPad->FindObject("Graph"); + g->SetMarkerColor(kBlue); + g->SetMarkerStyle(1); + g->SetMarkerSize(0.1); + gPad->Modified() -c1.Print((string("rz_-ME_")+suff+"" + ext).c_str()) + c1.Print((string("rz_-ME_")+suff+"" + ext).c_str()) @@ -795,88 +804,88 @@ c1.Print((string("rz_-ME_")+suff+"" + ext).c_str()) -TFile *f1 = TFile::Open("shtree_std_pt100.root") -t1 = (TTree *) f1->Get("neutronAna/CSCSimHitsTree"); -TFile *f2 = TFile::Open("shtree_POSTLS161_pt100.root") -t2 = (TTree *) f2->Get("neutronAna/CSCSimHitsTree"); + TFile *f1 = TFile::Open("shtree_std_pt100.root") + t1 = (TTree *) f1->Get("neutronAna/CSCSimHitsTree"); + TFile *f2 = TFile::Open("shtree_POSTLS161_pt100.root") + t2 = (TTree *) f2->Get("neutronAna/CSCSimHitsTree"); -TCanvas c1("c1","c1",900,900); -c1->SetBorderSize(0); -c1->SetLeftMargin(0.13); -c1->SetRightMargin(0.023); -c1->SetTopMargin(0.081); -c1->SetBottomMargin(0.13); -c1->SetGridy(); -c1->SetTickx(1); -c1->SetTicky(1); -c1->SetLogy(1); -gStyle->SetOptStat(0); + TCanvas c1("c1","c1",900,900); + c1->SetBorderSize(0); + c1->SetLeftMargin(0.13); + c1->SetRightMargin(0.023); + c1->SetTopMargin(0.081); + c1->SetBottomMargin(0.13); + c1->SetGridy(); + c1->SetTickx(1); + c1->SetTicky(1); + c1->SetLogy(1); + gStyle->SetOptStat(0); -t1->Draw("TMath::Log10(sh.e*1000000)>>htmp(100,-2.5,2.5)","","", 10000000, 0); -htmp->SetTitle("SimHit energy loss"); -htmp->SetXTitle("log_{10}E_{loss}, eV"); -htmp->SetYTitle("entries"); -htmp->SetLineWidth(2); -htmp->GetXaxis()->SetNdivisions(509); -t2->Draw("TMath::Log10(sh.e*1000000)>>htmp2(100,-2.5,2.5)","","same", 10000000, 0); -htmp2->SetLineWidth(2); -htmp2->SetLineStyle(7); -htmp2->SetLineColor(kRed); -scale = htmp->GetEntries()/(1.*htmp2->GetEntries()); -htmp2->Scale(scale); -gPad->Modified(); + t1->Draw("TMath::Log10(sh.e*1000000)>>htmp(100,-2.5,2.5)","","", 10000000, 0); + htmp->SetTitle("SimHit energy loss"); + htmp->SetXTitle("log_{10}E_{loss}, eV"); + htmp->SetYTitle("entries"); + htmp->SetLineWidth(2); + htmp->GetXaxis()->SetNdivisions(509); + t2->Draw("TMath::Log10(sh.e*1000000)>>htmp2(100,-2.5,2.5)","","same", 10000000, 0); + htmp2->SetLineWidth(2); + htmp2->SetLineStyle(7); + htmp2->SetLineColor(kRed); + scale = htmp->GetEntries()/(1.*htmp2->GetEntries()); + htmp2->Scale(scale); + gPad->Modified(); -TLegend *leg1 = new TLegend(0.17,0.7,0.47,0.85,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->AddEntry(htmp,"6_0_0_patch1","l"); -leg1->AddEntry(htmp2,"POSTLS161","l"); -leg1->Draw(); + TLegend *leg1 = new TLegend(0.17,0.7,0.47,0.85,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->AddEntry(htmp,"6_0_0_patch1","l"); + leg1->AddEntry(htmp2,"POSTLS161","l"); + leg1->Draw(); -c1.Print("sh_eloss" + ext) + c1.Print("sh_eloss" + ext) -TFile *f1 = TFile::Open("shtree_std_pt100.root") -t1 = (TTree *) f1->Get("neutronAna/CSCSimHitsTree"); -TFile *f2 = TFile::Open("shtree_POSTLS161_pt100.root") -t2 = (TTree *) f2->Get("neutronAna/CSCSimHitsTree"); + TFile *f1 = TFile::Open("shtree_std_pt100.root") + t1 = (TTree *) f1->Get("neutronAna/CSCSimHitsTree"); + TFile *f2 = TFile::Open("shtree_POSTLS161_pt100.root") + t2 = (TTree *) f2->Get("neutronAna/CSCSimHitsTree"); -TCanvas c1("c1","c1",900,900); -c1->SetBorderSize(0); -c1->SetLeftMargin(0.13); -c1->SetRightMargin(0.023); -c1->SetTopMargin(0.081); -c1->SetBottomMargin(0.13); -c1->SetGridy(); -c1->SetTickx(1); -c1->SetTicky(1); -//c1->SetLogy(1); -gStyle->SetOptStat(0); + TCanvas c1("c1","c1",900,900); + c1->SetBorderSize(0); + c1->SetLeftMargin(0.13); + c1->SetRightMargin(0.023); + c1->SetTopMargin(0.081); + c1->SetBottomMargin(0.13); + c1->SetGridy(); + c1->SetTickx(1); + c1->SetTicky(1); + //c1->SetLogy(1); + gStyle->SetOptStat(0); -t1->Draw("sh.t>>htmp(200,0,50.)","","", 10000000, 0); -htmp->SetTitle("SimHit TOF"); -htmp->SetXTitle("TOF, ns"); -htmp->SetYTitle("entries"); -htmp->SetLineWidth(2); -t2->Draw("sh.t>>htmp2(200,0,50)","","same", 10000000, 0); -htmp2->SetLineWidth(2); -htmp2->SetLineStyle(7); -htmp2->SetLineColor(kRed); -scale = htmp->GetEntries()/(1.*htmp2->GetEntries()); -htmp2->Scale(scale); -gPad->Modified(); + t1->Draw("sh.t>>htmp(200,0,50.)","","", 10000000, 0); + htmp->SetTitle("SimHit TOF"); + htmp->SetXTitle("TOF, ns"); + htmp->SetYTitle("entries"); + htmp->SetLineWidth(2); + t2->Draw("sh.t>>htmp2(200,0,50)","","same", 10000000, 0); + htmp2->SetLineWidth(2); + htmp2->SetLineStyle(7); + htmp2->SetLineColor(kRed); + scale = htmp->GetEntries()/(1.*htmp2->GetEntries()); + htmp2->Scale(scale); + gPad->Modified(); -TLegend *leg1 = new TLegend(0.17,0.7,0.47,0.85,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->AddEntry(htmp,"6_0_0_patch1","l"); -leg1->AddEntry(htmp2,"POSTLS161","l"); -leg1->Draw(); + TLegend *leg1 = new TLegend(0.17,0.7,0.47,0.85,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->AddEntry(htmp,"6_0_0_patch1","l"); + leg1->AddEntry(htmp2,"POSTLS161","l"); + leg1->Draw(); -c1.Print("sh_tof" + ext) + c1.Print("sh_tof" + ext) @@ -888,13 +897,13 @@ c1.Print("sh_tof" + ext) -cvs co -r V50-00-00 CondFormats/CSCObjects -V01-21-03-03 Configuration/StandardSequences -V50-00-00 DataFormats/MuonDetId -V50-00-00 L1Trigger/CSCTrackFinder -V50-00-00 L1Trigger/CSCTriggerPrimitives -V00-00-02 SLHCUpgradeSimulations/Configuration -V00-00-04 SLHCUpgradeSimulations/Geometry + cvs co -r V50-00-00 CondFormats/CSCObjects + V01-21-03-03 Configuration/StandardSequences + V50-00-00 DataFormats/MuonDetId + V50-00-00 L1Trigger/CSCTrackFinder + V50-00-00 L1Trigger/CSCTriggerPrimitives + V00-00-02 SLHCUpgradeSimulations/Configuration + V00-00-04 SLHCUpgradeSimulations/Geometry */ From e4fe05a3721ec9a142e17a8b9977bd81fc146c33 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 14:50:50 +0200 Subject: [PATCH 044/182] remove bending angle dictionary stuff -> already in a python file --- SimMuL1/scripts/drawplot_eff.C | 72 ---------------------------------- 1 file changed, 72 deletions(-) diff --git a/SimMuL1/scripts/drawplot_eff.C b/SimMuL1/scripts/drawplot_eff.C index 2242509d1111f..52cc07f5c6857 100644 --- a/SimMuL1/scripts/drawplot_eff.C +++ b/SimMuL1/scripts/drawplot_eff.C @@ -173,78 +173,6 @@ void gemTurnOns(int label_eff = GEM_EFF98) } -float dphiCut(TH1* h, float fractionToKeep) -{ - TAxis *ax = h->GetXaxis(); - double total = h->Integral(); - int bin=1; - for(int b=1; bGetNbins(); ++b) { - //cout<GetBinUpEdge(b)<<" "<Integral(0,b)/total<Integral(0,b)/total > fractionToKeep) { bin = b - 1; break; } - } - // interpolate - float x1 = ax->GetBinUpEdge(bin), x2 = ax->GetBinUpEdge(bin + 1); - float y1 = h->Integral(0, bin)/total, y2 = h->Integral(0, bin + 1)/total; - float x = x1 + (fractionToKeep - y1)/(y2-y1)*(x2-x1); - cout<<"fraction "<Draw("TMath::Abs(dphi_pad_odd)>>dphi_odd(600,0.,0.03)" , ok_pad1 && ok_lct1); - t->Draw("TMath::Abs(dphi_pad_even)>>dphi_even(600,0.,0.03)" , ok_pad2 && ok_lct2); - for (int f=0; f<3; ++f) { - dphis[n][f][0] = dphiCut(dphi_odd, fr[f]); - dphis[n][f][1] = dphiCut(dphi_even, fr[f]); - } - } - - cout< Date: Tue, 6 Aug 2013 14:53:36 +0200 Subject: [PATCH 045/182] Update README.md --- SimMuL1/scripts/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SimMuL1/scripts/README.md b/SimMuL1/scripts/README.md index 316e64127ce0a..cc350245a7a1b 100644 --- a/SimMuL1/scripts/README.md +++ b/SimMuL1/scripts/README.md @@ -254,6 +254,14 @@ Produces plots comparing the bending angle values for high and low pt muons
python plotGEMCSCdPhi.py  
 
+
Info in : png file plots/bending/GEMCSCdPhi_even_chambers.png has been created
+Info in : png file plots/bending/GEMCSCdPhi_odd_chambers.png has been created
+Info in : pdf file plots/bending/GEMCSCdPhi_even_chambers.pdf has been created
+Info in : pdf file plots/bending/GEMCSCdPhi_odd_chambers.pdf has been created
+Info in : eps file plots/bending/GEMCSCdPhi_even_chambers.eps has been created
+Info in : eps file plots/bending/GEMCSCdPhi_odd_chambers.eps has been created
+
+ ###produceDphiDict.py Uses a set of input files from the GEMCSCAnalyzer for different pt values and builds a python libary file (GEMCSCdPhiDict.py) which can be used in other scripts. @@ -261,6 +269,9 @@ Uses a set of input files from the GEMCSCAnalyzer for different pt values and bu
python produceDphiDict.py  
 
+
Info in : created default TCanvas with name c1 +dPhi library written to: GEMCSCdPhiDict.py +

 
 ###tdrStyle.py
 

From 5104ef8ce7253ea874913e7de5d82f0ba934b7d9 Mon Sep 17 00:00:00 2001
From: Sven Dildick 
Date: Tue, 6 Aug 2013 14:54:04 +0200
Subject: [PATCH 046/182] Update README.md

---
 SimMuL1/scripts/README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/SimMuL1/scripts/README.md b/SimMuL1/scripts/README.md
index cc350245a7a1b..2dcea0d1c5868 100644
--- a/SimMuL1/scripts/README.md
+++ b/SimMuL1/scripts/README.md
@@ -269,9 +269,9 @@ Uses a set of input files from the GEMCSCAnalyzer for different pt values and bu
 
python produceDphiDict.py  
 
-
Info in : created default TCanvas with name c1 +
Info in :  created default TCanvas with name c1
 dPhi library written to: GEMCSCdPhiDict.py
-

+
###tdrStyle.py From 1b552c6aef37edc6eab7c5f4ac8d92f70a77939a Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 14:59:14 +0200 Subject: [PATCH 047/182] Update README.md --- SimMuL1/scripts/README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/SimMuL1/scripts/README.md b/SimMuL1/scripts/README.md index 2dcea0d1c5868..28fd694e447a3 100644 --- a/SimMuL1/scripts/README.md +++ b/SimMuL1/scripts/README.md @@ -221,9 +221,28 @@ Auxiliary file ###produceRatePlotsForApproval.C +Based on drawplot_frankenstein.C. Produces 4 plots comparing the trigger rate of GMT with CSCTF (n stubs, n stubs with ME1/b, n stubs with ME1/b and GEM); n=2,3; CSCTF track patterns > 2 and > 8 + Produces trigger summary plots for approval -Based on drawplot_frankenstein.C. Produces 4 plots comparing the trigger rate of GMT with CSCTF (n stubs, n stubs with ME1/b, n stubs with ME1/b and GEM); n=2,3; CSCTF track patterns > 2 and > 8 +
Warning in : Deleting canvas with same name: c
+Info in : png file plots/rate/GMT_2s_2s1b_2s1bgem_loose.png has been created
+Info in : png file plots/rate/GMT_2s_2s1b_2s1bgem_tight.png has been created
+Info in : png file plots/rate/GMT_3s_3s1b_3s1bgem_loose.png has been created
+Info in : png file plots/rate/GMT_3s_3s1b_3s1bgem_tight.png has been created
+Warning in : Deleting canvas with same name: c
+Info in : pdf file plots/rate/GMT_2s_2s1b_2s1bgem_loose.pdf has been created
+Info in : pdf file plots/rate/GMT_2s_2s1b_2s1bgem_tight.pdf has been created
+Info in : pdf file plots/rate/GMT_3s_3s1b_3s1bgem_loose.pdf has been created
+Info in : pdf file plots/rate/GMT_3s_3s1b_3s1bgem_tight.pdf has been created
+Warning in : Deleting canvas with same name: c
+Info in : eps file plots/rate/GMT_2s_2s1b_2s1bgem_loose.eps has been created
+Info in : eps file plots/rate/GMT_2s_2s1b_2s1bgem_tight.eps has been created
+Info in : eps file plots/rate/GMT_3s_3s1b_3s1bgem_loose.eps has been created
+Info in : eps file plots/rate/GMT_3s_3s1b_3s1bgem_tight.eps has been created
+
+ +Do we have to reproduce them with the shift and the extra shift? ###rootlogon.C From b8c4a0c2d0185179e7a6dc31b8e9b8dd5f1e012c Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 15:00:14 +0200 Subject: [PATCH 048/182] add eps png and pdf extension --- SimMuL1/scripts/produceRatePlotsForApproval.C | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/SimMuL1/scripts/produceRatePlotsForApproval.C b/SimMuL1/scripts/produceRatePlotsForApproval.C index ee7d63f0ff2d5..ad675901dedfa 100644 --- a/SimMuL1/scripts/produceRatePlotsForApproval.C +++ b/SimMuL1/scripts/produceRatePlotsForApproval.C @@ -20,17 +20,13 @@ TLatex* drawLumiLabel(float x=0.17, float y=0.35) -void produceRatePlotsForApproval() +void produceRatePlotsForApproval(TString ext) { - gROOT->ProcessLine(".L drawplot_gmtrt.C"); - gROOT->ProcessLine(".L getPTHistos.C"); - gROOT->SetBatch(true); gem_dir = "files/"; gem_label = "gem98"; TString plots = "plots/rate/"; - TString ext = ".pdf"; TString the_ttl = "CSC L1 trigger rates in ME1/b region;p_{T}^{cut} [GeV/c];rate [kHz]"; @@ -515,3 +511,13 @@ void produceRatePlotsForApproval() } +void produceRatePlotsForApproval() +{ + gROOT->ProcessLine(".L drawplot_gmtrt.C"); + gROOT->ProcessLine(".L getPTHistos.C"); + gROOT->SetBatch(true); + + produceRatePlotsForApproval(".png"); + produceRatePlotsForApproval(".pdf"); + produceRatePlotsForApproval(".eps"); +} From 771b20f8e6856b29a88dd22740e3dc37eba9bc06 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 15:01:02 +0200 Subject: [PATCH 049/182] Update README.md --- SimMuL1/scripts/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SimMuL1/scripts/README.md b/SimMuL1/scripts/README.md index 28fd694e447a3..d7ae9dc212f3f 100644 --- a/SimMuL1/scripts/README.md +++ b/SimMuL1/scripts/README.md @@ -223,6 +223,9 @@ Auxiliary file Based on drawplot_frankenstein.C. Produces 4 plots comparing the trigger rate of GMT with CSCTF (n stubs, n stubs with ME1/b, n stubs with ME1/b and GEM); n=2,3; CSCTF track patterns > 2 and > 8 +
root -l -b produceRatePlotsForApproval.C
+
+ Produces trigger summary plots for approval
Warning in : Deleting canvas with same name: c

From 5e38d9c99c854693add6ac468b5f353831c1762d Mon Sep 17 00:00:00 2001
From: Sven Dildick 
Date: Tue, 6 Aug 2013 15:03:14 +0200
Subject: [PATCH 050/182] Adding the GEM-CSC bending angle dictionary

---
 SimMuL1/scripts/GEMCSCdPhiDict.py | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 SimMuL1/scripts/GEMCSCdPhiDict.py

diff --git a/SimMuL1/scripts/GEMCSCdPhiDict.py b/SimMuL1/scripts/GEMCSCdPhiDict.py
new file mode 100644
index 0000000000000..9756ffc9c24be
--- /dev/null
+++ b/SimMuL1/scripts/GEMCSCdPhiDict.py
@@ -0,0 +1,26 @@
+dphi_lct_pad = {
+    "95" : {
+        'pt5 ' : { 'odd' :  0.02023292, 'even' : 0.00833584 },
+        'pt10' : { 'odd' :  0.00977472, 'even' : 0.00435576 },
+        'pt15' : { 'odd' :  0.00661092, 'even' : 0.00324096 },
+        'pt20' : { 'odd' :  0.00512415, 'even' : 0.00272092 },
+        'pt30' : { 'odd' :  0.00374355, 'even' : 0.00221976 },
+        'pt40' : { 'odd' :  0.00307651, 'even' : 0.00198198 }
+        },
+    "98" : {
+        'pt5 ' : { 'odd' :  0.02203511, 'even' : 0.00930056 },
+        'pt10' : { 'odd' :  0.01066000, 'even' : 0.00483286 },
+        'pt15' : { 'odd' :  0.00722795, 'even' : 0.00363230 },
+        'pt20' : { 'odd' :  0.00562598, 'even' : 0.00304878 },
+        'pt30' : { 'odd' :  0.00416544, 'even' : 0.00253782 },
+        'pt40' : { 'odd' :  0.00342827, 'even' : 0.00230833 }
+        },
+    "99" : {
+        'pt5 ' : { 'odd' :  0.02344691, 'even' : 0.00995745 },
+        'pt10' : { 'odd' :  0.01137125, 'even' : 0.00520722 },
+        'pt15' : { 'odd' :  0.00769842, 'even' : 0.00389632 },
+        'pt20' : { 'odd' :  0.00599498, 'even' : 0.00331874 },
+        'pt30' : { 'odd' :  0.00446935, 'even' : 0.00278215 },
+        'pt40' : { 'odd' :  0.00368553, 'even' : 0.00254660 }
+        }
+}

From 828ea5d3c4c58a158cfa23e4a63c1006bdfef60a Mon Sep 17 00:00:00 2001
From: Sven Dildick 
Date: Tue, 6 Aug 2013 15:15:06 +0200
Subject: [PATCH 051/182] Update README.md

---
 SimMuL1/scripts/README.md | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/SimMuL1/scripts/README.md b/SimMuL1/scripts/README.md
index d7ae9dc212f3f..2e55673504514 100644
--- a/SimMuL1/scripts/README.md
+++ b/SimMuL1/scripts/README.md
@@ -12,8 +12,25 @@ ROOT
 
 ###drawplot_eff.C
 
+
root -l -b drawplot_eff.C
+
+ Produces matching efficiency plots (simtrack to LCT, gem pad vs track pt, pt eta, lct eta, lct number) for even and odd chambers +
Info in : png file plots/efficiency/gem_pad_eff_for_LCT_vsHS_pt05.png has been created
+Info in : png file plots/efficiency/gem_pad_eff_for_LCT_vsHS_pt10.png has been created
+Info in : png file plots/efficiency/gem_pad_eff_for_LCT_vsHS_pt15.png has been created
+Info in : png file plots/efficiency/gem_pad_eff_for_LCT_vsHS_pt20.png has been created
+Info in : png file plots/efficiency/gem_pad_eff_for_LCT_vsHS_pt30.png has been created
+Info in : png file plots/efficiency/gem_pad_eff_for_LCT_vsHS_pt40.png has been created
+Info in : png file plots/efficiency/gem_pad_eff_for_LCT_vsHS_pt05_overlap.png has been created
+Info in : png file plots/efficiency/gem_pad_eff_for_LCT_vsHS_pt10_overlap.png has been created
+Info in : png file plots/efficiency/gem_pad_eff_for_LCT_vsHS_pt15_overlap.png has been created
+Info in : png file plots/efficiency/gem_pad_eff_for_LCT_vsHS_pt20_overlap.png has been created
+Info in : png file plots/efficiency/gem_pad_eff_for_LCT_vsHS_pt30_overlap.png has been created
+Info in : png file plots/efficiency/gem_pad_eff_for_LCT_vsHS_pt40_overlap.png has been created
+
+ ###drawplot_etastep.C ###drawplot_frankenstein.C From 1da0c6f05f688dd06ac2f72d2bd2eebe99f4f3a7 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 6 Aug 2013 15:28:11 +0200 Subject: [PATCH 052/182] add location of directory to put plots --- SimMuL1/scripts/drawplot_eff.C | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/SimMuL1/scripts/drawplot_eff.C b/SimMuL1/scripts/drawplot_eff.C index 52cc07f5c6857..ce10e0c424534 100644 --- a/SimMuL1/scripts/drawplot_eff.C +++ b/SimMuL1/scripts/drawplot_eff.C @@ -1,4 +1,4 @@ -gROOT->ProcessLine(".L effFunctions.C"); +//gROOT->ProcessLine(".L effFunctions.C"); /* @@ -264,7 +264,7 @@ void eff_hs_overlap(TString f_name, TString p_name) void drawplot_eff_eta() { - gROOT->ProcessLine(".L effFunctions.C"); + // gROOT->ProcessLine(".L effFunctions.C"); TCanvas* cEff = new TCanvas("cEff","cEff",700,450); cEff->SetGridx(1); @@ -286,7 +286,7 @@ void drawplot_eff_eta() TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); tex->SetNDC(); tex->Draw(); - cEff->Print("lct_eff_for_Trk_vsTrkEta_pt40" + ext); + cEff->Print(plotDir + "lct_eff_for_Trk_vsTrkEta_pt40" + ext); h1 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT and GEM Pad;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh1, ok_lct1 && ok_pad1, "P", kRed); @@ -301,7 +301,7 @@ void drawplot_eff_eta() TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); tex->SetNDC(); tex->Draw(); - cEff->Print("gem_pad_and_lct_eff_for_Trk_vsTrkEta_pt40" + ext); + cEff->Print(plotDir + "gem_pad_and_lct_eff_for_Trk_vsTrkEta_pt40" + ext); return; @@ -310,14 +310,14 @@ void drawplot_eff_eta() TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); tex->SetNDC(); tex->Draw(); - cEff->Print("gem_pad0_eff_for_Trk_vsTrkEta_pt40" + ext); + cEff->Print(plotDir + "gem_pad0_eff_for_Trk_vsTrkEta_pt40" + ext); TTree *gt15 = getTree(filesDir + "gem_csc_delta_pt15_pad4.root"); h1 = draw_geff(gt15, "Eff. for a SimTrack to have an associated LCT;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_lct1 || ok_lct2, "P", kViolet+2); - cEff->Print("lct_eff_for_Trk_vsTrkEta_pt15" + ext); + cEff->Print(plotDir + "lct_eff_for_Trk_vsTrkEta_pt15" + ext); ho = draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", ok_lct1, ok_pad1, "P", kRed); @@ -328,22 +328,22 @@ void drawplot_eff_eta() leg->AddEntry(ho, "odd chambers","l"); leg->AddEntry(he, "even chambers","l"); leg->Draw(); - cEff->Print("gem_pad_eff_for_LCT_vsLCTEta_pt40" + ext); + cEff->Print(plotDir + "gem_pad_eff_for_LCT_vsLCTEta_pt40" + ext); draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1, ok_pad1, "P", kRed); draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2, ok_pad2, "P same"); leg->Draw(); - cEff->Print("gem_pad_eff_for_LCT_vsTrkEta_pt40" + ext); + cEff->Print(plotDir + "gem_pad_eff_for_LCT_vsTrkEta_pt40" + ext); draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", ok_lct1, ok_pad1_overlap, "P", kRed); draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta_lct_even)", ok_lct2, ok_pad2_overlap, "P same"); leg->Draw(); - cEff->Print("gem_pad_eff_for_LCT_vsLCTEta_pt40_overlap" + ext); + cEff->Print(plotDir + "gem_pad_eff_for_LCT_vsLCTEta_pt40_overlap" + ext); draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1, ok_pad1_overlap, "P", kRed); draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2, ok_pad2_overlap, "P same"); leg->Draw(); - cEff->Print("gem_pad_eff_for_LCT_vsTrkEta_pt40_overlap" + ext); + cEff->Print(plotDir + "gem_pad_eff_for_LCT_vsTrkEta_pt40_overlap" + ext); //draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1 && Ep, ok_pad1_overlap, "P", kRed); //draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2 && Ep, ok_pad2_overlap, "P same"); @@ -356,7 +356,7 @@ void drawplot_eff_eta() leg->AddEntry(h1, "at least one pad","l"); leg->AddEntry(he, "two pads in two GEMs","l"); leg->Draw(); - cEff->Print("gem_pad_eff_for_Trk_vsTrkEta_pt40" + ext); + cEff->Print(plotDir + "gem_pad_eff_for_Trk_vsTrkEta_pt40" + ext); return; draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_gsh1 || ok_gsh2, "P", kViolet); @@ -389,7 +389,9 @@ void drawplot_eff() eff_hs_overlap(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30_overlap" + ext); eff_hs_overlap(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40_overlap" + ext); - gemTurnOns(); + //gemTurnOns(); + + drawplot_eff_eta(); } From a0d0e6434e3c3a8944aba9cfe6d07dfa87595b1e Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Aug 2013 00:25:39 +0200 Subject: [PATCH 053/182] fix ratio plot x and y axis titles --- SimMuL1/scripts/drawplot_gmtrt.C | 2670 +++++++++++++++--------------- 1 file changed, 1340 insertions(+), 1330 deletions(-) diff --git a/SimMuL1/scripts/drawplot_gmtrt.C b/SimMuL1/scripts/drawplot_gmtrt.C index e35143298ec1f..2768777727d18 100644 --- a/SimMuL1/scripts/drawplot_gmtrt.C +++ b/SimMuL1/scripts/drawplot_gmtrt.C @@ -80,300 +80,300 @@ const Double_t ptscaleb[31] = { }; const Double_t ptscaleb_[31] = { 1.25, 1.75, 2.25, 2.75, 3.25, 3.75, 4.25, 4.75, 5.5, 6.5, 7.5, 9., 11., 13., 15., - 17., 19., 22.5, 27.5, 32.5, 37.5, 42.5, 47.5, 55., 65., 75., 85., 95., 110., 130., 150. + 17., 19., 22.5, 27.5, 32.5, 37.5, 42.5, 47.5, 55., 65., 75., 85., 95., 110., 130., 150. }; void dpr(char *prc, int pu, char *suffix="") //void dpr(char *prc, char *g, int pu, int st, char *suffix="") { -gNPU=pu; -char nm[300], fnm[300],onm[300]; -char spu[20]; -sprintf(spu,"%03d",pu); -//sprintf(nm,"%s_2_2_6_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); -//sprintf(nm,"%s_3_6_2_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); -//sprintf(nm,"%s_3_6_2_mu_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); -sprintf(nm,"%s_6_0_1_POSTLS161_V12__pu%s_w3%s",prc,spu,suffix); -sprintf(fnm,"../hp_%s.root",nm); - -sprintf(onm,"rttf_%s",nm); -drawplot_tfrt(fnm,"StrictChamber",onm); + gNPU=pu; + char nm[300], fnm[300],onm[300]; + char spu[20]; + sprintf(spu,"%03d",pu); + //sprintf(nm,"%s_2_2_6_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); + //sprintf(nm,"%s_3_6_2_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); + //sprintf(nm,"%s_3_6_2_mu_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); + sprintf(nm,"%s_6_0_1_POSTLS161_V12__pu%s_w3%s",prc,spu,suffix); + sprintf(fnm,"../hp_%s.root",nm); + + sprintf(onm,"rttf_%s",nm); + drawplot_tfrt(fnm,"StrictChamber",onm); } TPaveStats* GetStat(TH1*h) { -TPaveStats* stat = (TPaveStats*)h->FindObject("stats"); -return stat; + TPaveStats* stat = (TPaveStats*)h->FindObject("stats"); + return stat; } TPaveStats* SetOptStat(TH1*h,int op) { -TPaveStats* stat = GetStat(h); -stat->SetOptStat(op); -return stat; + TPaveStats* stat = GetStat(h); + stat->SetOptStat(op); + return stat; } TObject* getH(char dir[100], char name[100]) { -char nm[222]; -sprintf(nm,"%s/%s;1",dir,name); -return f->Get(nm); + char nm[222]; + sprintf(nm,"%s/%s;1",dir,name); + return f->Get(nm); } TObject* getH(TFile *fi, char dir[100], char name[100]) { -char nm[222]; -sprintf(nm,"%s/%s;1",dir,name); -return fi->Get(nm); + char nm[222]; + sprintf(nm,"%s/%s;1",dir,name); + return fi->Get(nm); } void Print(TCanvas *c, char nm[200]) { -if (do_not_print) return; -if (strcmp(pdir,"")<=0) return; -gPad->RedrawAxis(); -char dirnm[200]; -sprintf(dirnm,"%s/%s",pdir,nm); -c->Print(dirnm); + if (do_not_print) return; + if (strcmp(pdir,"")<=0) return; + gPad->RedrawAxis(); + char dirnm[200]; + sprintf(dirnm,"%s/%s",pdir,nm); + c->Print(dirnm); } void myRebin(TH1D* h, int n) { -int nb = h->GetNbinsX(); -Double_t entr = h->GetEntries(); -Double_t bin0 = h->GetBinContent(0); -Double_t binN1 = h->GetBinContent(nb+1); -if (nb % n) binN1 += h->Integral(nb - nb%n + 1,nb); -h->Rebin(n); -nb = h->GetNbinsX(); -h->SetBinContent(0,bin0); -h->SetBinContent(nb+1,binN1); -h->SetEntries(entr); + int nb = h->GetNbinsX(); + Double_t entr = h->GetEntries(); + Double_t bin0 = h->GetBinContent(0); + Double_t binN1 = h->GetBinContent(nb+1); + if (nb % n) binN1 += h->Integral(nb - nb%n + 1,nb); + h->Rebin(n); + nb = h->GetNbinsX(); + h->SetBinContent(0,bin0); + h->SetBinContent(nb+1,binN1); + h->SetEntries(entr); } //########################################################################### TH1D* setHistoPt(char *f_name, char *name, char *cname, char *title, - int lcolor, int lstyle, int lwidth) - //double *x_range, double *y_range) + int lcolor, int lstyle, int lwidth) +//double *x_range, double *y_range) { -cout<<"opening "<GetXaxis()->GetNbins(); - -h = new TH1D(s_name+cname,title,30,ptscaleb); -for (int b=1 ; b<=nb; b++) { - double bc = h0->GetBinContent(b); - if (bc==0) continue; - int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); - //cout<SetBinContent(bin, bc); -} -//h->Sumw2(); -h->Scale(40000./gNEvt/3.*0.795); + cout<<"opening "<GetXaxis()->GetNbins(); + + h = new TH1D(s_name+cname,title,30,ptscaleb); + for (int b=1 ; b<=nb; b++) { + double bc = h0->GetBinContent(b); + if (bc==0) continue; + int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); + //cout<SetBinContent(bin, bc); + } + //h->Sumw2(); + h->Scale(40000./gNEvt/3.*0.795); -return h; + return h; } TH1D* setHistoPtRaw(char *f_name, char *name, char *cname, char *title, - int lcolor, int lstyle, int lwidth) - //double *x_range, double *y_range) + int lcolor, int lstyle, int lwidth) +//double *x_range, double *y_range) { -cout<<"opening "<GetXaxis()->GetNbins(); -h = (TH1D*)h0->Clone(s_name+cname); -//h->Sumw2(); -h->Scale(40000./gNEvt/3.*0.795); + TH1D* h0 = (TH1D*)getH(f, dir, name); + TString s_name(name); + int nb = h0->GetXaxis()->GetNbins(); + h = (TH1D*)h0->Clone(s_name+cname); + //h->Sumw2(); + h->Scale(40000./gNEvt/3.*0.795); -return h; + return h; } TH1D* setHisto2(char *f_name, char *name1, char *name2, char *cname, char *title, - int lcolor, int lstyle, int lwidth) - //double *x_range, double *y_range) + int lcolor, int lstyle, int lwidth) +//double *x_range, double *y_range) { -cout<<"opening "<Clone(s_name+cname); -h0->Add(h2); -int nb = h0->GetXaxis()->GetNbins(); - -h = new TH1D(s_name+cname,title,30,ptscaleb); -for (int b=1 ; b<=nb; b++) { - double bc = h0->GetBinContent(b); - if (bc==0) continue; - int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); - //cout<SetBinContent(bin, bc); -} -for (int b=1 ; b<=30; b++) - h->SetBinContent(b, h->Integral(b,31)); + cout<<"opening "<Clone(s_name+cname); + h0->Add(h2); + int nb = h0->GetXaxis()->GetNbins(); + + h = new TH1D(s_name+cname,title,30,ptscaleb); + for (int b=1 ; b<=nb; b++) { + double bc = h0->GetBinContent(b); + if (bc==0) continue; + int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); + //cout<SetBinContent(bin, bc); + } + for (int b=1 ; b<=30; b++) + h->SetBinContent(b, h->Integral(b,31)); -/* -h = (TH1D*)h0->Clone(s_name+cname); -for (int b=1 ; b<=nb; b++) - h->SetBinContent(b, h0->Integral(b,nb+1)); -*/ + /* + h = (TH1D*)h0->Clone(s_name+cname); + for (int b=1 ; b<=nb; b++) + h->SetBinContent(b, h0->Integral(b,nb+1)); + */ -h->Sumw2(); -h->Scale(40000000./gNEvt/3.*0.795/10); + h->Sumw2(); + h->Scale(40000000./gNEvt/3.*0.795/10); -h->SetLineColor(lcolor); -h->SetFillColor(lcolor); -h->SetLineStyle(lstyle); -h->SetLineWidth(lwidth); + h->SetLineColor(lcolor); + h->SetFillColor(lcolor); + h->SetLineStyle(lstyle); + h->SetLineWidth(lwidth); -h->SetTitle(title); -//h->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); -//h->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); + h->SetTitle(title); + //h->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); + //h->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); -h->GetXaxis()->SetRangeUser(3,130); -h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); -//h->GetYaxis()->SetRangeUser(0.01,3000); + h->GetXaxis()->SetRangeUser(3,130); + h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); + //h->GetYaxis()->SetRangeUser(0.01,3000); -h->GetXaxis()->SetMoreLogLabels(1); + h->GetXaxis()->SetMoreLogLabels(1); -h->GetXaxis()->SetTitleSize(0.055); -h->GetXaxis()->SetTitleOffset(1.05); -h->GetXaxis()->SetLabelSize(0.045); -h->GetXaxis()->SetLabelOffset(0.003); -h->GetXaxis()->SetTitleFont(62); -h->GetXaxis()->SetLabelFont(62); + h->GetXaxis()->SetTitleSize(0.055); + h->GetXaxis()->SetTitleOffset(1.05); + h->GetXaxis()->SetLabelSize(0.045); + h->GetXaxis()->SetLabelOffset(0.003); + h->GetXaxis()->SetTitleFont(62); + h->GetXaxis()->SetLabelFont(62); -h->GetYaxis()->SetTitleSize(0.055); -h->GetYaxis()->SetTitleOffset(0.9); -h->GetYaxis()->SetLabelSize(0.045); -h->GetYaxis()->SetTitleFont(62); -h->GetYaxis()->SetLabelFont(62); + h->GetYaxis()->SetTitleSize(0.055); + h->GetYaxis()->SetTitleOffset(0.9); + h->GetYaxis()->SetLabelSize(0.045); + h->GetYaxis()->SetTitleFont(62); + h->GetYaxis()->SetLabelFont(62); -//h->GetYaxis()->SetLabelOffset(0.015); + //h->GetYaxis()->SetLabelOffset(0.015); -return h; + return h; } TH1D* setHistoEta(TString f_name, char *name, char *cname, char *title, - int lcolor, int lstyle, int lwidth) - //double *x_range, double *y_range) + int lcolor, int lstyle, int lwidth) +//double *x_range, double *y_range) { -cout<<"opening "<GetXaxis()->GetNbins(); + TH1D* h0 = (TH1D*)getH(f, dir, name); + TString s_name(name); + int nb = h0->GetXaxis()->GetNbins(); -TH1D* h = (TH1D*)h0->Clone(s_name+cname); -h->SetTitle(title); + TH1D* h = (TH1D*)h0->Clone(s_name+cname); + h->SetTitle(title); -h->Sumw2(); -h->Scale(40000./gNEvt/3.*0.795); + h->Sumw2(); + h->Scale(40000./gNEvt/3.*0.795); -h->SetLineColor(lcolor); -//h->SetFillColor(lcolor); -h->SetLineStyle(lstyle); -h->SetLineWidth(lwidth); + h->SetLineColor(lcolor); + //h->SetFillColor(lcolor); + h->SetLineStyle(lstyle); + h->SetLineWidth(lwidth); -h->SetTitle(title); + h->SetTitle(title); -//h->GetXaxis()->SetRangeUser(1.2, 2.4); -h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); + //h->GetXaxis()->SetRangeUser(1.2, 2.4); + h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); -h->GetXaxis()->SetTitleSize(0.055); -h->GetXaxis()->SetTitleOffset(1.05); -h->GetXaxis()->SetLabelSize(0.045); -h->GetXaxis()->SetLabelOffset(0.003); -h->GetXaxis()->SetTitleFont(62); -h->GetXaxis()->SetLabelFont(62); -h->GetXaxis()->SetMoreLogLabels(1); + h->GetXaxis()->SetTitleSize(0.055); + h->GetXaxis()->SetTitleOffset(1.05); + h->GetXaxis()->SetLabelSize(0.045); + h->GetXaxis()->SetLabelOffset(0.003); + h->GetXaxis()->SetTitleFont(62); + h->GetXaxis()->SetLabelFont(62); + h->GetXaxis()->SetMoreLogLabels(1); -h->GetYaxis()->SetTitleSize(0.055); -h->GetYaxis()->SetTitleOffset(0.9); -h->GetYaxis()->SetLabelSize(0.045); -h->GetYaxis()->SetTitleFont(62); -h->GetYaxis()->SetLabelFont(62); + h->GetYaxis()->SetTitleSize(0.055); + h->GetYaxis()->SetTitleOffset(0.9); + h->GetYaxis()->SetLabelSize(0.045); + h->GetYaxis()->SetTitleFont(62); + h->GetYaxis()->SetLabelFont(62); -//h->GetYaxis()->SetLabelOffset(0.015); + //h->GetYaxis()->SetLabelOffset(0.015); -gh = h; -return h; + gh = h; + return h; } TH1D* getPTHisto(TString f_name, TString dir_name, TString h_name, TString clone_suffix = "_cln") { -f = TFile::Open(f_name); -//cout<Get(dir_name + "/" + h_name)->Clone(h_name + clone_suffix); -return h0; + f = TFile::Open(f_name); + //cout<Get(dir_name + "/" + h_name)->Clone(h_name + clone_suffix); + return h0; } TH1D* setPTHisto(TH1D* h0, TString title, int lcolor, int lstyle, int lwidth) { -int nb = h0->GetXaxis()->GetNbins(); - -h = new TH1D(Form("%s_varpt", h0->GetName()), title, 30, ptscaleb_); -for (int b=1 ; b<=nb; b++) { - double bc = h0->GetBinContent(b); - if (bc==0) continue; - int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); - //cout<GetBinCenter(b)<<" -> "<SetBinContent(bin, bc); -} -for (int b=1 ; b<=30; b++) - h->SetBinContent(b, h->Integral(b,31)); + int nb = h0->GetXaxis()->GetNbins(); + + h = new TH1D(Form("%s_varpt", h0->GetName()), title, 30, ptscaleb_); + for (int b=1 ; b<=nb; b++) { + double bc = h0->GetBinContent(b); + if (bc==0) continue; + int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); + //cout<GetBinCenter(b)<<" -> "<SetBinContent(bin, bc); + } + for (int b=1 ; b<=30; b++) + h->SetBinContent(b, h->Integral(b,31)); -h->Sumw2(); -h->Scale(40000./gNEvt/3.*0.795); + h->Sumw2(); + h->Scale(40000./gNEvt/3.*0.795); -h->SetLineColor(lcolor); -h->SetFillColor(lcolor); -h->SetLineStyle(lstyle); -h->SetLineWidth(lwidth); + h->SetLineColor(lcolor); + h->SetFillColor(lcolor); + h->SetLineStyle(lstyle); + h->SetLineWidth(lwidth); -h->SetTitle(title); + h->SetTitle(title); -h->GetXaxis()->SetRangeUser(2, 129.); -h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); + h->GetXaxis()->SetRangeUser(2, 129.); + h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); -h->GetXaxis()->SetTitleSize(0.055); -h->GetXaxis()->SetTitleOffset(1.05); -h->GetXaxis()->SetLabelSize(0.045); -h->GetXaxis()->SetLabelOffset(0.003); -h->GetXaxis()->SetTitleFont(62); -h->GetXaxis()->SetLabelFont(62); -h->GetXaxis()->SetMoreLogLabels(1); + h->GetXaxis()->SetTitleSize(0.055); + h->GetXaxis()->SetTitleOffset(1.05); + h->GetXaxis()->SetLabelSize(0.045); + h->GetXaxis()->SetLabelOffset(0.003); + h->GetXaxis()->SetTitleFont(62); + h->GetXaxis()->SetLabelFont(62); + h->GetXaxis()->SetMoreLogLabels(1); -h->GetYaxis()->SetTitleSize(0.055); -h->GetYaxis()->SetTitleOffset(0.9); -h->GetYaxis()->SetLabelSize(0.045); -h->GetYaxis()->SetTitleFont(62); -h->GetYaxis()->SetLabelFont(62); + h->GetYaxis()->SetTitleSize(0.055); + h->GetYaxis()->SetTitleOffset(0.9); + h->GetYaxis()->SetLabelSize(0.045); + h->GetYaxis()->SetTitleFont(62); + h->GetYaxis()->SetLabelFont(62); -return h; + return h; } TH1D* setPTHisto(TString f_name, TString dir_name, TString h_name, TString clone_suffix, TString title, int lcolor, int lstyle, int lwidth) { -TH1D* h0 = getPTHisto(f_name, dir_name, h_name, clone_suffix); -return setPTHisto(h0, title, lcolor, lstyle, lwidth); + TH1D* h0 = getPTHisto(f_name, dir_name, h_name, clone_suffix); + return setPTHisto(h0, title, lcolor, lstyle, lwidth); } @@ -382,112 +382,122 @@ return setPTHisto(h0, title, lcolor, lstyle, lwidth); TH1D* setHisto(TString f_name, char *name, char *cname, char *title, int lcolor, int lstyle, int lwidth) { -cout<<"opening "<GetXaxis()->GetNbins(); - -h = new TH1D(s_name+cname,title,30,ptscaleb_); -for (int b=1 ; b<=nb; b++) { - double bc = h0->GetBinContent(b); - if (bc==0) continue; - int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); - //cout<GetBinCenter(b)<<" -> "<SetBinContent(bin, bc); -} -for (int b=1 ; b<=30; b++) - h->SetBinContent(b, h->Integral(b,31)); + cout<<"opening "<GetXaxis()->GetNbins(); + + h = new TH1D(s_name+cname,title,30,ptscaleb_); + for (int b=1 ; b<=nb; b++) { + double bc = h0->GetBinContent(b); + if (bc==0) continue; + int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); + //cout<GetBinCenter(b)<<" -> "<SetBinContent(bin, bc); + } + for (int b=1 ; b<=30; b++) + h->SetBinContent(b, h->Integral(b,31)); -/* -h = (TH1D*)h0->Clone(s_name+cname); -for (int b=1 ; b<=nb; b++) - h->SetBinContent(b, h0->Integral(b,nb+1)); -*/ + /* + h = (TH1D*)h0->Clone(s_name+cname); + for (int b=1 ; b<=nb; b++) + h->SetBinContent(b, h0->Integral(b,nb+1)); + */ -h->Sumw2(); -h->Scale(40000./gNEvt/3.*0.795); + h->Sumw2(); + h->Scale(40000./gNEvt/3.*0.795); -h->SetLineColor(lcolor); -h->SetFillColor(lcolor); -h->SetLineStyle(lstyle); -h->SetLineWidth(lwidth); + h->SetLineColor(lcolor); + h->SetFillColor(lcolor); + h->SetLineStyle(lstyle); + h->SetLineWidth(lwidth); -h->SetTitle(title); + h->SetTitle(title); -h->GetXaxis()->SetRangeUser(2, 129.); -h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); + h->GetXaxis()->SetRangeUser(2, 129.); + h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); -h->GetXaxis()->SetTitleSize(0.055); -h->GetXaxis()->SetTitleOffset(1.05); -h->GetXaxis()->SetLabelSize(0.045); -h->GetXaxis()->SetLabelOffset(0.003); -h->GetXaxis()->SetTitleFont(62); -h->GetXaxis()->SetLabelFont(62); -h->GetXaxis()->SetMoreLogLabels(1); + h->GetXaxis()->SetTitleSize(0.055); + h->GetXaxis()->SetTitleOffset(1.05); + h->GetXaxis()->SetLabelSize(0.045); + h->GetXaxis()->SetLabelOffset(0.003); + h->GetXaxis()->SetTitleFont(62); + h->GetXaxis()->SetLabelFont(62); + h->GetXaxis()->SetMoreLogLabels(1); -h->GetYaxis()->SetTitleSize(0.055); -h->GetYaxis()->SetTitleOffset(0.9); -h->GetYaxis()->SetLabelSize(0.045); -h->GetYaxis()->SetTitleFont(62); -h->GetYaxis()->SetLabelFont(62); + h->GetYaxis()->SetTitleSize(0.055); + h->GetYaxis()->SetTitleOffset(0.9); + h->GetYaxis()->SetLabelSize(0.045); + h->GetYaxis()->SetTitleFont(62); + h->GetYaxis()->SetLabelFont(62); -//h->GetYaxis()->SetLabelOffset(0.015); + //h->GetYaxis()->SetLabelOffset(0.015); -return h; + return h; } -TH1D* setHistoRatio(TH1D* num, TH1D* denom, TString title = "", double ymin=0.4, double ymax=1.6) +TH1D* setHistoRatio(TH1D* num, TH1D* denom, TString title = "", double ymin=0.4, double ymax=1.6, int color = kRed+3) { -ratio = (TH1D*) num->Clone(Form("%s--%s_ratio",num->GetName(),denom->GetName()) ); -ratio->Divide(num, denom, 1., 1.); -ratio->SetTitle(title); -ratio->GetYaxis()->SetRangeUser(ymin, ymax); -ratio->GetYaxis()->SetTitle("ratio: (with GEM)/default"); -ratio->GetYaxis()->SetLabelSize(0.07); -ratio->GetYaxis()->SetTitleSize(0.07); -ratio->GetYaxis()->SetTitleOffset(0.6); -ratio->GetXaxis()->SetMoreLogLabels(1); -ratio->SetLineWidth(2); -ratio->SetFillColor(kRed+3); -ratio->SetLineColor(kRed+3); -ratio->SetMarkerColor(kRed+3); -ratio->SetMarkerStyle(20); -//ratio->Draw("e3"); - -return ratio; + ratio = (TH1D*) num->Clone(Form("%s--%s_ratio",num->GetName(),denom->GetName()) ); + ratio->Divide(num, denom, 1., 1.); + ratio->SetTitle(title); + + ratio->GetYaxis()->SetRangeUser(ymin, ymax); + ratio->GetYaxis()->SetTitle("ratio: (with GEM)/default"); + ratio->GetYaxis()->SetTitle("ratio"); + // ratio->GetYaxis()->SetTitle("(ME1/b + GEM) / ME1/b"); + ratio->GetYaxis()->SetTitleSize(.14); + // ratio->GetYaxis()->SetTitleSize(.1); + ratio->GetYaxis()->SetTitleOffset(0.4); + ratio->GetYaxis()->SetLabelSize(.11); + + //ratio->GetXaxis()->SetMoreLogLabels(1); + ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); + ratio->GetXaxis()->SetLabelSize(.11); + ratio->GetXaxis()->SetTitleSize(.14); + ratio->GetXaxis()->SetTitleOffset(1.3); + + ratio->SetLineWidth(2); + ratio->SetFillColor(color); + ratio->SetLineColor(color); + ratio->SetMarkerColor(color); + ratio->SetMarkerStyle(20); + //ratio->Draw("e3"); + + return ratio; } TH1D* setHistoRatio2(TH1D* num, TH1D* denom, TString title = "", double ymin=0.4, double ymax=1.6) { -ratio = (TH1D*) num->Clone(Form("%s--%s_ratio",num->GetName(),denom->GetName()) ); -ratio->Divide(num, denom, 1., 1.); -ratio->SetTitle(title); -ratio->GetYaxis()->SetRangeUser(ymin, ymax); -ratio->GetYaxis()->SetTitle("ratio: with ME1a stub/without"); -ratio->GetYaxis()->SetLabelSize(0.07); -ratio->GetYaxis()->SetTitleSize(0.07); -ratio->GetYaxis()->SetTitleOffset(0.6); -ratio->GetXaxis()->SetMoreLogLabels(1); -ratio->SetLineWidth(2); -ratio->SetFillColor(kRed+3); -ratio->SetLineColor(kRed+3); -ratio->SetMarkerColor(kRed+3); -ratio->SetMarkerStyle(20); -//ratio->Draw("e3"); - -return ratio; + ratio = (TH1D*) num->Clone(Form("%s--%s_ratio",num->GetName(),denom->GetName()) ); + ratio->Divide(num, denom, 1., 1.); + ratio->SetTitle(title); + ratio->GetYaxis()->SetRangeUser(ymin, ymax); + ratio->GetYaxis()->SetTitle("ratio: with ME1a stub/without"); + ratio->GetYaxis()->SetLabelSize(0.07); + ratio->GetYaxis()->SetTitleSize(0.07); + ratio->GetYaxis()->SetTitleOffset(0.6); + ratio->GetXaxis()->SetMoreLogLabels(1); + ratio->SetLineWidth(2); + ratio->SetFillColor(kRed+3); + ratio->SetLineColor(kRed+3); + ratio->SetMarkerColor(kRed+3); + ratio->SetMarkerStyle(20); + //ratio->Draw("e3"); + + return ratio; } TH1D* getEnrichRate() { -f = TFile::Open("meb1_genpt4_EnrichMu_st.root"); -TTree *tr = (TTree*) f->Get("SimTrackAna/trk"); -tr->Draw("pt>>pppt()"); + f = TFile::Open("meb1_genpt4_EnrichMu_st.root"); + TTree *tr = (TTree*) f->Get("SimTrackAna/trk"); + tr->Draw("pt>>pppt()"); } @@ -496,404 +506,404 @@ tr->Draw("pt>>pppt()"); TH1D* getEffHisto(TString fname, TString hdir, TString num_name, TString den_name, int nrebin, int lcolor, int lstyle, int lwidth, TString title, double *x_range, double *y_range) { -TFile *fh = TFile::Open(fname); + TFile *fh = TFile::Open(fname); -TH1D* hd0 = (TH1D*)fh->Get(hdir + "/" + den_name); -TH1D* hn0 = (TH1D*)fh->Get(hdir + "/" + num_name); + TH1D* hd0 = (TH1D*)fh->Get(hdir + "/" + den_name); + TH1D* hn0 = (TH1D*)fh->Get(hdir + "/" + num_name); -TH1D* hd = (TH1D*)hd0->Clone(den_name+"_cln_"+fname); -TH1D* hn = (TH1D*)hn0->Clone(num_name+"_cln_"+fname); -hd->Sumw2(); -hn->Sumw2(); + TH1D* hd = (TH1D*)hd0->Clone(den_name+"_cln_"+fname); + TH1D* hn = (TH1D*)hn0->Clone(num_name+"_cln_"+fname); + hd->Sumw2(); + hn->Sumw2(); -myRebin(hd, nrebin); -myRebin(hn, nrebin); + myRebin(hd, nrebin); + myRebin(hn, nrebin); -TH1D* heff = (TH1D*)hn->Clone(num_name+"_eff_"+fname); + TH1D* heff = (TH1D*)hn->Clone(num_name+"_eff_"+fname); -hd->Sumw2(); -heff->Sumw2(); + hd->Sumw2(); + heff->Sumw2(); -heff->Divide(heff,hd); + heff->Divide(heff,hd); -heff->SetLineColor(lcolor); -heff->SetLineStyle(lstyle); -heff->SetLineWidth(lwidth); + heff->SetLineColor(lcolor); + heff->SetLineStyle(lstyle); + heff->SetLineWidth(lwidth); -heff->SetTitle(title); -//heff->GetXaxis()->SetTitle(xtitle); -//heff->GetYaxis()->SetTitle(ytitle); -heff->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); -heff->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); + heff->SetTitle(title); + //heff->GetXaxis()->SetTitle(xtitle); + //heff->GetYaxis()->SetTitle(ytitle); + heff->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); + heff->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); -heff->GetXaxis()->SetTitleSize(0.07); -heff->GetXaxis()->SetTitleOffset(0.7); -heff->GetYaxis()->SetLabelOffset(0.015); + heff->GetXaxis()->SetTitleSize(0.07); + heff->GetXaxis()->SetTitleOffset(0.7); + heff->GetYaxis()->SetLabelOffset(0.015); -heff->GetXaxis()->SetLabelSize(0.05); -heff->GetYaxis()->SetLabelSize(0.05); + heff->GetXaxis()->SetLabelSize(0.05); + heff->GetYaxis()->SetLabelSize(0.05); -h1 = hn0; -h2 = hd0; -he = heff; + h1 = hn0; + h2 = hd0; + he = heff; -//fh->Close(); -return heff; + //fh->Close(); + return heff; } TLatex* drawPULabel(float x=0.17, float y=0.15, float font_size=0.) { -TLatex * tex = new TLatex(x, y,"L=4*10^{34} (25ns PU100)"); -if (font_size > 0.) tex->SetFontSize(font_size); -tex->SetNDC(); -tex->Draw(); -return tex; + TLatex * tex = new TLatex(x, y,"L=4*10^{34} (25ns PU100)"); + if (font_size > 0.) tex->SetFontSize(font_size); + tex->SetNDC(); + tex->Draw(); + return tex; } void gem_rate_draw() { -do_not_print = false; + do_not_print = false; -gStyle->SetOptStat(0); -gStyle->SetTitleStyle(0); -//gStyle->SetPadTopMargin(0.08); -gStyle->SetTitleH(0.06); + gStyle->SetOptStat(0); + gStyle->SetTitleStyle(0); + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); -int ptreb=2; + int ptreb=2; -TString hdir = "SimMuL1StrictAll"; + TString hdir = "SimMuL1StrictAll"; -TString f_def = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; -TString f_g98_pt10 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt10_pat2.root"; -TString f_g98_pt15 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt15_pat2.root"; -TString f_g98_pt20 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt20_pat2.root"; -TString f_g98_pt30 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat2.root"; -TString f_g98_pt40 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat2.root"; + TString f_def = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; + TString f_g98_pt10 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt10_pat2.root"; + TString f_g98_pt15 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt15_pat2.root"; + TString f_g98_pt20 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt20_pat2.root"; + TString f_g98_pt30 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat2.root"; + TString f_g98_pt40 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat2.root"; -sprintf(pdir,"%s", gem_dir.Data()); + sprintf(pdir,"%s", gem_dir.Data()); -double rpt[2] = {0.,49.99}; + double rpt[2] = {0.,49.99}; -TString htitle = "Efficiency for #mu in 1.6<|#eta|<2.12 to have TF track;p_{T}^{MC}"; + TString htitle = "Efficiency for #mu in 1.6<|#eta|<2.12 to have TF track;p_{T}^{MC}"; -TString hini = "h_pt_initial_1b"; -TString h2s = "h_pt_after_tfcand_eta1b_2s"; -TString h3s = "h_pt_after_tfcand_eta1b_3s"; -TString h2s1b = "h_pt_after_tfcand_eta1b_2s1b"; -TString h3s1b = "h_pt_after_tfcand_eta1b_3s1b"; + TString hini = "h_pt_initial_1b"; + TString h2s = "h_pt_after_tfcand_eta1b_2s"; + TString h3s = "h_pt_after_tfcand_eta1b_3s"; + TString h2s1b = "h_pt_after_tfcand_eta1b_2s1b"; + TString h3s1b = "h_pt_after_tfcand_eta1b_3s1b"; -//gdy[0]=0; gdy[1]=7.; -//if (vs_eta_minpt=="20") gdy[1]=10.; -float miny = 0.01, maxy; + //gdy[0]=0; gdy[1]=7.; + //if (vs_eta_minpt=="20") gdy[1]=10.; + float miny = 0.01, maxy; -TString vs_eta_minpt = "20"; -TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + TString vs_eta_minpt = "20"; + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; - TH1D* h_rt_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); - TH1D* h_rt_tf20_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); - TH1D* h_rt_tf20_gpt20_2s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); + TH1D* h_rt_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); + TH1D* h_rt_tf20_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); + TH1D* h_rt_tf20_gpt20_2s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); - TH1D* h_rt_tf20_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); - TH1D* h_rt_tf20_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); - TH1D* h_rt_tf20_gpt20_3s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); + TH1D* h_rt_tf20_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); + TH1D* h_rt_tf20_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); + TH1D* h_rt_tf20_gpt20_3s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); - TH1D* h_rt_tf20_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kAzure+6, 1, 2); - TH1D* h_rt_tf20_gpt20_3s1ab = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kGreen+3, 7, 2); + TH1D* h_rt_tf20_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kAzure+6, 1, 2); + TH1D* h_rt_tf20_gpt20_3s1ab = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kGreen+3, 7, 2); -// maxy = 300;// 45; -// h_rt_tf20_2s->GetYaxis()->SetRangeUser(miny,maxy); -// h_rt_tf20_2s1b->GetYaxis()->SetRangeUser(miny,maxy); -// h_rt_tf20_gpt20_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + // maxy = 300;// 45; + // h_rt_tf20_2s->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf20_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf20_gpt20_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - cAll100->SetLogy(1); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + cAll100->SetLogy(1); -// h_rt_tf20_2s->Draw("hist e1"); -// h_rt_tf20_gpt20_2s1b->Draw("hist e1 same"); -// h_rt_tf20_2s->Draw("hist e1 same"); -// h_rt_tf20_2s1b->Draw("hist e1 same"); + // h_rt_tf20_2s->Draw("hist e1"); + // h_rt_tf20_gpt20_2s1b->Draw("hist e1 same"); + // h_rt_tf20_2s->Draw("hist e1 same"); + // h_rt_tf20_2s1b->Draw("hist e1 same"); -// TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); -// leg->SetBorderSize(0); -// leg->SetFillStyle(0); -// leg->AddEntry(h_rt_tf20_2s,"Tracks: p_{T}>=20, 2+ stubs",""); -// leg->AddEntry(h_rt_tf20_2s,"anywhere","l"); -// leg->AddEntry(h_rt_tf20_2s1b,"with ME1 in 1.6<|#eta|<2.14","l"); -// leg->AddEntry(h_rt_tf20_gpt20_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); -// leg->Draw(); + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf20_2s,"Tracks: p_{T}>=20, 2+ stubs",""); + // leg->AddEntry(h_rt_tf20_2s,"anywhere","l"); + // leg->AddEntry(h_rt_tf20_2s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + // leg->AddEntry(h_rt_tf20_gpt20_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // leg->Draw(); -// TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); -// tex->SetNDC(); -// tex->Draw(); + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); -// Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); -// TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -// gPad->SetGridx(1);gPad->SetGridy(1); + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); -// gem_ratio = setHistoRatio(h_rt_tf20_gpt20_2s1b, h_rt_tf20_2s1b, "", 0.,1.8); -// gem_ratio->Draw("e1"); + // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_2s1b, h_rt_tf20_2s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); -// Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b__ratio.png").Data()); + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b__ratio.png").Data()); -// //======================== 3+ Stubs ================================// + // //======================== 3+ Stubs ================================// -// ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - maxy = 30.;//10; -// h_rt_tf20_3s->GetYaxis()->SetRangeUser(miny,maxy); -// h_rt_tf20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); -// h_rt_tf20_gpt20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + maxy = 30.;//10; + // h_rt_tf20_3s->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf20_gpt20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); -// ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -// h_rt_tf20_3s->Draw("hist e1"); -// h_rt_tf20_gpt20_3s1b->Draw("hist e1 same"); -// h_rt_tf20_3s->Draw("hist e1 same"); -// h_rt_tf20_3s1b->Draw("hist e1 same"); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf20_3s->Draw("hist e1"); + // h_rt_tf20_gpt20_3s1b->Draw("hist e1 same"); + // h_rt_tf20_3s->Draw("hist e1 same"); + // h_rt_tf20_3s1b->Draw("hist e1 same"); -// TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); -// leg->SetBorderSize(0); -// leg->SetFillStyle(0); -// leg->AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); -// leg->AddEntry(h_rt_tf20_3s,"anywhere","l"); -// leg->AddEntry(h_rt_tf20_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); -// leg->AddEntry(h_rt_tf20_gpt20_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); -// leg->Draw(); + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); + // leg->AddEntry(h_rt_tf20_3s,"anywhere","l"); + // leg->AddEntry(h_rt_tf20_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + // leg->AddEntry(h_rt_tf20_gpt20_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // leg->Draw(); -// TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); -// tex->SetNDC(); -// tex->Draw(); + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); -// Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); -// TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -// gPad->SetGridx(1);gPad->SetGridy(1); + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); -// gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1b, h_rt_tf20_3s1b, "", 0.,1.8); -// gem_ratio->Draw("e1"); + // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1b, h_rt_tf20_3s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); -// Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); -// // Including the region ME1/1a + // // Including the region ME1/1a -// ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -// maxy = 30.;//10; + // maxy = 30.;//10; -// h_rt_tf20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); -// h_rt_tf20_gpt20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf20_gpt20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); -// ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -// h_rt_tf20_3s->Draw("hist e1"); -// h_rt_tf20_gpt20_3s1ab->Draw("hist e1 same"); -// h_rt_tf20_3s->Draw("hist e1 same"); -// h_rt_tf20_3s1ab->Draw("hist e1 same"); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf20_3s->Draw("hist e1"); + // h_rt_tf20_gpt20_3s1ab->Draw("hist e1 same"); + // h_rt_tf20_3s->Draw("hist e1 same"); + // h_rt_tf20_3s1ab->Draw("hist e1 same"); -// TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); -// leg->SetBorderSize(0); -// leg->SetFillStyle(0); -// leg->AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); -// leg->AddEntry(h_rt_tf20_3s,"anywhere","l"); -// leg->AddEntry(h_rt_tf20_3s1ab,"with ME1 in 1.6<|#eta|","l"); -// leg->AddEntry(h_rt_tf20_gpt20_3s1ab,"with (ME1+GEM) in 1.6<|#eta|","l"); -// leg->Draw(); + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); + // leg->AddEntry(h_rt_tf20_3s,"anywhere","l"); + // leg->AddEntry(h_rt_tf20_3s1ab,"with ME1 in 1.6<|#eta|","l"); + // leg->AddEntry(h_rt_tf20_gpt20_3s1ab,"with (ME1+GEM) in 1.6<|#eta|","l"); + // leg->Draw(); -// TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); -// tex->SetNDC(); -// tex->Draw(); + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); -// Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); -// TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -// gPad->SetGridx(1);gPad->SetGridy(1); + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); -// gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1ab, h_rt_tf20_3s1ab, "", 0.,1.8); -// gem_ratio->Draw("e1"); + // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1ab, h_rt_tf20_3s1ab, "", 0.,1.8); + // gem_ratio->Draw("e1"); -// Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); - vs_eta_minpt = "30"; - ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + vs_eta_minpt = "30"; + ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; -// TH1D* h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); -// TH1D* h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); -// TH1D* h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); + // TH1D* h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); + // TH1D* h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); + // TH1D* h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); - TH1D* h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); + TH1D* h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); - TH1D* h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); - TH1D* h_rt_tf30_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kAzure+2, 1, 2); - TH1D* h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); - TH1D* h_rt_tf30_gpt30_3s1ab = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kGreen, 7, 2); + TH1D* h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); + TH1D* h_rt_tf30_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kAzure+2, 1, 2); + TH1D* h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); + TH1D* h_rt_tf30_gpt30_3s1ab = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kGreen, 7, 2); - // // maxy = 120.;//35.; - // // h_rt_tf30_2s->GetYaxis()->SetRangeUser(miny,maxy); - // // h_rt_tf30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - // // h_rt_tf30_gpt30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + // // maxy = 120.;//35.; + // // h_rt_tf30_2s->GetYaxis()->SetRangeUser(miny,maxy); + // // h_rt_tf30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + // // h_rt_tf30_gpt30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - // TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - // cAll100->SetLogy(1); - // // h_rt_tf30_2s->Draw("hist e1"); - // // h_rt_tf30_gpt30_2s1b->Draw("hist e1 same"); - // // h_rt_tf30_2s->Draw("hist e1 same"); - // // h_rt_tf30_2s1b->Draw("hist e1 same"); + // TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + // cAll100->SetLogy(1); + // // h_rt_tf30_2s->Draw("hist e1"); + // // h_rt_tf30_gpt30_2s1b->Draw("hist e1 same"); + // // h_rt_tf30_2s->Draw("hist e1 same"); + // // h_rt_tf30_2s1b->Draw("hist e1 same"); - // // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); - // // leg->SetBorderSize(0); - // // leg->SetFillStyle(0); - // // leg->AddEntry(h_rt_tf30_2s,"Tracks: p_{T}>=30, 2+ stubs",""); - // // leg->AddEntry(h_rt_tf30_2s,"anywhere","l"); - // // leg->AddEntry(h_rt_tf30_2s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - // // leg->AddEntry(h_rt_tf30_gpt30_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - // // leg->Draw(); + // // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // // leg->SetBorderSize(0); + // // leg->SetFillStyle(0); + // // leg->AddEntry(h_rt_tf30_2s,"Tracks: p_{T}>=30, 2+ stubs",""); + // // leg->AddEntry(h_rt_tf30_2s,"anywhere","l"); + // // leg->AddEntry(h_rt_tf30_2s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + // // leg->AddEntry(h_rt_tf30_gpt30_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // // leg->Draw(); - // // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // // tex->SetNDC(); - // // tex->Draw(); + // // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // // tex->SetNDC(); + // // tex->Draw(); - // // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); + // // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); - // // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - // // gPad->SetGridx(1);gPad->SetGridy(1); + // // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // // gPad->SetGridx(1);gPad->SetGridy(1); - // // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_2s1b, h_rt_tf30_2s1b, "", 0.,1.8); - // // gem_ratio->Draw("e1"); + // // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_2s1b, h_rt_tf30_2s1b, "", 0.,1.8); + // // gem_ratio->Draw("e1"); - // // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b__ratio.png").Data()); + // // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b__ratio.png").Data()); - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // maxy = 30.;//7.; - // h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); - // h_rt_tf30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - // h_rt_tf30_gpt30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + // maxy = 30.;//7.; + // h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf30_gpt30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // h_rt_tf30_3s->Draw("hist e1"); - // h_rt_tf30_gpt30_3s1b->Draw("hist e1 same"); - // h_rt_tf30_3s->Draw("hist e1 same"); - // h_rt_tf30_3s1b->Draw("hist e1 same"); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf30_3s->Draw("hist e1"); + // h_rt_tf30_gpt30_3s1b->Draw("hist e1 same"); + // h_rt_tf30_3s->Draw("hist e1 same"); + // h_rt_tf30_3s1b->Draw("hist e1 same"); - // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); - // leg->AddEntry(h_rt_tf30_3s,"anywhere","l"); - // leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - // leg->AddEntry(h_rt_tf30_gpt30_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - // leg->Draw(); + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); + // leg->AddEntry(h_rt_tf30_3s,"anywhere","l"); + // leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + // leg->AddEntry(h_rt_tf30_gpt30_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // leg->Draw(); - // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // tex->SetNDC(); - // tex->Draw(); + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); - // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); - // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1b, h_rt_tf30_3s1b, "", 0.,1.8); - // gem_ratio->Draw("e1"); + // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1b, h_rt_tf30_3s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); - // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); - // //========================== Including the ME1a + // //========================== Including the ME1a - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); - // h_rt_tf30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf30_gpt30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf30_gpt30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // h_rt_tf30_3s->Draw("hist e1"); - // h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same"); - // h_rt_tf30_3s->Draw("hist e1 same"); - // h_rt_tf30_3s1ab->Draw("hist e1 same"); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf30_3s->Draw("hist e1"); + // h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same"); + // h_rt_tf30_3s->Draw("hist e1 same"); + // h_rt_tf30_3s1ab->Draw("hist e1 same"); - // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); - // leg->AddEntry(h_rt_tf30_3s,"anywhere","l"); - // leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|","l"); - // leg->AddEntry(h_rt_tf30_gpt30_3s1ab,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - // leg->Draw(); + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); + // leg->AddEntry(h_rt_tf30_3s,"anywhere","l"); + // leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|","l"); + // leg->AddEntry(h_rt_tf30_gpt30_3s1ab,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // leg->Draw(); - // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // tex->SetNDC(); - // tex->Draw(); + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); - // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); + // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); - // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1ab, h_rt_tf30_3s1ab, "", 0.,1.8); - // gem_ratio->Draw("e1"); + // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1ab, h_rt_tf30_3s1ab, "", 0.,1.8); + // gem_ratio->Draw("e1"); - // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); + // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); - // //========================== Comparison with/withous Stub in ME1a ==========================// + // //========================== Comparison with/withous Stub in ME1a ==========================// - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // h_rt_tf30_3s1b->Draw("hist e1"); - // h_rt_tf30_3s1ab->Draw("hist e1 same"); + // h_rt_tf30_3s1b->Draw("hist e1"); + // h_rt_tf30_3s1ab->Draw("hist e1 same"); - // TLegend *leg = new TLegend(0.2,0.65,.80,0.90,NULL,"brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf30_3s1b,"Tracks: p_{T}>=30, 3+ stubs",""); - // leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - // leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|<2.4","l"); - // leg->Draw(); + // TLegend *leg = new TLegend(0.2,0.65,.80,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf30_3s1b,"Tracks: p_{T}>=30, 3+ stubs",""); + // leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + // leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|<2.4","l"); + // leg->Draw(); - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); - // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); + // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); - // gem_ratio = setHistoRatio2(h_rt_tf30_3s1ab, h_rt_tf30_3s1b, "", 0.,1.8); - // gem_ratio->Draw("e1"); + // gem_ratio = setHistoRatio2(h_rt_tf30_3s1ab, h_rt_tf30_3s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); - // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio_compstubME1a.png").Data()); + // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio_compstubME1a.png").Data()); //========================== Comparison with/withous Stub in ME1a + GEMS ==========================// @@ -938,972 +948,972 @@ TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;tr void drawplot_gmtrt(TString dname = "", TString vs_eta_minpt = "") { -bool vs_eta = false; -if (vs_eta_minpt.Length() > 0) vs_eta = true; + bool vs_eta = false; + if (vs_eta_minpt.Length() > 0) vs_eta = true; + + // directory for plots is made as + // pdir = $PWD/pic[_{dname}]_{pu} + + //gStyle->SetStatW(0.13); + //gStyle->SetStatH(0.08); + gStyle->SetStatW(0.07); + gStyle->SetStatH(0.06); + + gStyle->SetOptStat(0); + + gStyle->SetTitleStyle(0); + gStyle->SetTitleAlign(13);// coord in top left + gStyle->SetTitleX(0.); + gStyle->SetTitleY(1.); + gStyle->SetTitleW(1); + gStyle->SetTitleH(0.058); + gStyle->SetTitleBorderSize(0); + + gStyle->SetPadLeftMargin(0.126); + gStyle->SetPadRightMargin(0.04); + gStyle->SetPadTopMargin(0.06); + gStyle->SetPadBottomMargin(0.13); + + gStyle->SetMarkerStyle(1); + + + + char d1[111]="",d2[111]=""; + if (dname != "") sprintf(d1,"_%s", dname.Data()); + //if (strcmp(pu,"")>0) sprintf(d2,"_%s",pu); + //sprintf(pdir,"pic%s%s",d1,d2); + + if (interactive && dname != "") { + sprintf(pdir,"pic%s%s",d1,d2); + if( gSystem->AccessPathName(pdir)==0 ) { + //cout<<"directory "<Exec(cmd) != 0) {cout<<"can't remode directory! exiting..."<MakeDirectory(pdir); + } + } -// directory for plots is made as -// pdir = $PWD/pic[_{dname}]_{pu} + //cout<<"opening "<SetStatW(0.13); -//gStyle->SetStatH(0.08); -gStyle->SetStatW(0.07); -gStyle->SetStatH(0.06); + // directory inside of root file: + //char dir[111]; + char pu[15]="StrictChamber"; + if (strcmp(pu,"StrictDirect")==0) sprintf(dir,"SimMuL1Strict"); + if (strcmp(pu,"StrictChamber")==0) sprintf(dir,"SimMuL1StrictAll"); + if (strcmp(pu,"NaturalDirect")==0) sprintf(dir,"SimMuL1"); + if (strcmp(pu,"NaturalChamber")==0) sprintf(dir,"SimMuL1All"); + if (strcmp(pu,"StrictDeltaY")==0) sprintf(dir,"SimMuL1StrictDY"); + if (strcmp(pu,"NaturalDeltaY")==0) sprintf(dir,"SimMuL1DY"); + if (strcmp(pu,"StrictChamber0")==0) sprintf(dir,"SimMuL1StrictAll0"); -gStyle->SetOptStat(0); + char label[200]; -gStyle->SetTitleStyle(0); -gStyle->SetTitleAlign(13);// coord in top left -gStyle->SetTitleX(0.); -gStyle->SetTitleY(1.); -gStyle->SetTitleW(1); -gStyle->SetTitleH(0.058); -gStyle->SetTitleBorderSize(0); + // = (TH1D*)f->Get("SimMuL1/;1"); -gStyle->SetPadLeftMargin(0.126); -gStyle->SetPadRightMargin(0.04); -gStyle->SetPadTopMargin(0.06); -gStyle->SetPadBottomMargin(0.13); + char f_pu050_me42_re4[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + char f_pu050_re4[200] ="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; + char f_pu050[200] ="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; + char f_pu050_me42_rev1[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rev1_rpc.root"; + char f_pu050_me42_rev2[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rev2_rpc.root"; -gStyle->SetMarkerStyle(1); + char f_pu050_hneu_me42_re4[200]="hp_minbias_3_6_2_hnpu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + char f_pu050_neu_me42_re4[200]="hp_minbias_3_6_2_npu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; -char d1[111]="",d2[111]=""; -if (dname != "") sprintf(d1,"_%s", dname.Data()); -//if (strcmp(pu,"")>0) sprintf(d2,"_%s",pu); -//sprintf(pdir,"pic%s%s",d1,d2); + char f_pu200_hneu_me42_re4[200]="hp_minbias_3_6_2_hnpu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + char f_pu200_rneu_me42_re4[200]="hp_minbias_3_6_2_rnpu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; -if (interactive && dname != "") { - sprintf(pdir,"pic%s%s",d1,d2); - if( gSystem->AccessPathName(pdir)==0 ) { - //cout<<"directory "<Exec(cmd) != 0) {cout<<"can't remode directory! exiting..."<MakeDirectory(pdir); - } -} + char f_pu200_neu_me42_re4[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + char f_pu200_me42_re4[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; -//cout<<"opening "<Get("SimMuL1/;1"); -char f_pu050_me42_re4[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; -char f_pu050_re4[200] ="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; -char f_pu050[200] ="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; -char f_pu050_me42_rev1[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rev1_rpc.root"; -char f_pu050_me42_rev2[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rev2_rpc.root"; + TString f_pu100_pat8 = gem_dir; + TString f_pu100_pat8_gem = gem_dir; + //TString f_pu100_pat2 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat2.root"; + //TString f_pu100_pat8 ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat8.root"; + //TString f_pu100_pat2_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat2.root"; + //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat8.root"; + + //TString f_pu100_pat8 ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat2.root"; + //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat2.root"; -char f_pu050_hneu_me42_re4[200]="hp_minbias_3_6_2_hnpu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; -char f_pu050_neu_me42_re4[200]="hp_minbias_3_6_2_npu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + if (dname.Contains("_pat8")) f_pu100_pat8 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root"; + if (dname == "minbias_pt05_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat8.root"; + if (dname == "minbias_pt06_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat8.root"; + if (dname == "minbias_pt10_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat8.root"; + if (dname == "minbias_pt15_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat8.root"; + if (dname == "minbias_pt20_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat8.root"; + if (dname == "minbias_pt30_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat8.root"; + if (dname == "minbias_pt40_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat8.root"; -char f_pu200_hneu_me42_re4[200]="hp_minbias_3_6_2_hnpu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; -char f_pu200_rneu_me42_re4[200]="hp_minbias_3_6_2_rnpu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + if (dname.Contains("_pat2")) f_pu100_pat8 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; + if (dname == "minbias_pt05_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat2.root"; + if (dname == "minbias_pt06_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat2.root"; + if (dname == "minbias_pt10_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat2.root"; + if (dname == "minbias_pt15_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat2.root"; + if (dname == "minbias_pt20_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat2.root"; + if (dname == "minbias_pt30_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat2.root"; + if (dname == "minbias_pt40_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat2.root"; -char f_pu200_neu_me42_re4[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; -char f_pu200_me42_re4[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; + //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemx_pt20_pat2.root"; + //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemOldx_pt20_pat2.root"; + //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemOld_pt20_pat2.root"; + + + bool do_return = false; + + + + //#################################### PU100 #################################### + + // full eta 1. - 2.4 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b + if (vs_eta) + { + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + hAll100->Draw("hist e1"); + hAll100gem->Draw("hist e1 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","l"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); + leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-2s1b__gem-3s-2s1b.png").Data()); + + if (do_return) return; + } + + + + // full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b + if (vs_eta) + { + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + hAll100->Draw("hist e1"); + hAll100gem->Draw("hist e1 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","l"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"in ME1/b region also require",""); + leg_cc100->AddEntry(hAll100,"one stub to be from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); + + if (do_return) return; + } + + // full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b + if (vs_eta) + { + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + hAll100->Draw("hist e1"); + hAll100gem->Draw("hist e1 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","l"); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); + leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-2s1b.png").Data()); + + if (do_return) return; + } + + + // full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b + if (vs_eta) + { + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + hAll100->Draw("hist e1"); + hAll100gem->Draw("hist e1 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","l"); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"in ME1/b region also require",""); + leg_cc100->AddEntry(hAll100,"one stub to be from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-3s1b.png").Data()); + + if (do_return) return; + } + + + if (vs_eta) return; + + + + // full eta 1. - 2.4 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); + leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, "rates__1-2.4__PU100__def-3s-2s1b__gem-3s-2s1b.png"); + + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1);//gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.4); + hAll100gem_ratio->Draw("e1"); -char f_pu200_neu_re4[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; -char f_pu200_re4[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; -hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat8.root -char f_pu200_neu[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; -char f_pu200[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; + Print(cAll100r, "rates__1-2.4__PU100__def-3s-2s1b__gem-3s-2s1b__ratio.png"); + if (do_return) return; + } -TString f_pu100_pat8 = gem_dir; -TString f_pu100_pat8_gem = gem_dir; + // full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; -//TString f_pu100_pat2 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat2.root"; -//TString f_pu100_pat8 ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat8.root"; -//TString f_pu100_pat2_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat2.root"; -//TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat8.root"; + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); -//TString f_pu100_pat8 ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat2.root"; -//TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat2.root"; + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks: same, except in ME1/b region req.",""); + leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + Print(cAll100, "rates__1-2.4__PU100__def-3s__gem-3s-2s1b.png"); -if (dname.Contains("_pat8")) f_pu100_pat8 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root"; -if (dname == "minbias_pt05_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat8.root"; -if (dname == "minbias_pt06_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat8.root"; -if (dname == "minbias_pt10_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat8.root"; -if (dname == "minbias_pt15_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat8.root"; -if (dname == "minbias_pt20_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat8.root"; -if (dname == "minbias_pt30_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat8.root"; -if (dname == "minbias_pt40_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat8.root"; -if (dname.Contains("_pat2")) f_pu100_pat8 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; -if (dname == "minbias_pt05_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat2.root"; -if (dname == "minbias_pt06_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat2.root"; -if (dname == "minbias_pt10_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat2.root"; -if (dname == "minbias_pt15_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat2.root"; -if (dname == "minbias_pt20_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat2.root"; -if (dname == "minbias_pt30_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat2.root"; -if (dname == "minbias_pt40_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat2.root"; + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1);//gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); -//TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemx_pt20_pat2.root"; -//TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemOldx_pt20_pat2.root"; -//TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemOld_pt20_pat2.root"; + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); + hAll100gem_ratio->Draw("e1"); + Print(cAll100r, "rates__1-2.4__PU100__def-3s__gem-3s-2s1b__ratio.png"); -bool do_return = false; + if (do_return) return; + } -//#################################### PU100 #################################### + // no ME1/a eta 1. - 2.1 Default: 3station GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; -// full eta 1. - 2.4 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b -if (vs_eta) -{ -gdy[0]=0; gdy[1]=7.; -if (vs_eta_minpt=="20") gdy[1]=10.; - -TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; -hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100", ttl, kAzure+9, 1, 2); -hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - -//gStyle->SetPadTopMargin(0.08); -gStyle->SetTitleH(0.06); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -hAll100->Draw("hist e1"); -hAll100gem->Draw("hist e1 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","l"); -leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); -leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); -leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); -leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); -tex->SetNDC(); -tex->Draw(); - -Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-2s1b__gem-3s-2s1b.png").Data()); - -if (do_return) return; -} + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_no1a", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.1",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks: same, except in ME1/b region req.",""); + leg_cc100->AddEntry(hAll100,">=3 stubs and one of them from ME1/b",""); + leg_cc100->Draw(); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -// full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b -if (vs_eta) -{ -gdy[0]=0; gdy[1]=7.; -if (vs_eta_minpt=="20") gdy[1]=10.; - -TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; -hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+9, 1, 2); -hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - -//gStyle->SetPadTopMargin(0.08); -gStyle->SetTitleH(0.06); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -hAll100->Draw("hist e1"); -hAll100gem->Draw("hist e1 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","l"); -leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); -leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); -leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100,"in ME1/b region also require",""); -leg_cc100->AddEntry(hAll100,"one stub to be from ME1/b",""); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); -tex->SetNDC(); -tex->Draw(); - -Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); - -if (do_return) return; -} + Print(cAll100, "rates__1-2.1__PU100__def-3s__gem-3s-3s1b.png"); -// full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b -if (vs_eta) -{ -gdy[0]=0; gdy[1]=7.; -if (vs_eta_minpt=="20") gdy[1]=10.; - -TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; -hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); -hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - -//gStyle->SetPadTopMargin(0.08); -gStyle->SetTitleH(0.06); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -hAll100->Draw("hist e1"); -hAll100gem->Draw("hist e1 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","l"); -leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); -leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); -leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); -tex->SetNDC(); -tex->Draw(); - -Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-2s1b.png").Data()); - -if (do_return) return; -} + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); -// full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b -if (vs_eta) -{ -gdy[0]=0; gdy[1]=7.; -if (vs_eta_minpt=="20") gdy[1]=10.; - -TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; -hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); -hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - -//gStyle->SetPadTopMargin(0.08); -gStyle->SetTitleH(0.06); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -hAll100->Draw("hist e1"); -hAll100gem->Draw("hist e1 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","l"); -leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); -leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100,"in ME1/b region also require",""); -leg_cc100->AddEntry(hAll100,"one stub to be from ME1/b",""); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); -tex->SetNDC(); -tex->Draw(); - -Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-3s1b.png").Data()); - -if (do_return) return; -} + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); + hAll100gem_ratio->Draw("e1"); + Print(cAll100r, "rates__1-2.1__PU100__def-3s__gem-3s-3s1b__ratio.png"); -if (vs_eta) return; + result_gem_eta_no1a = hAll100gem; + result_def_eta_no1a = hAll100; + if (do_return) return; + } -// full eta 1. - 2.4 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b -if (1) -{ -gdy[0]=2; gdy[1]=2000.; - -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); - -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); -leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); -leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); - -Print(cAll100, "rates__1-2.4__PU100__def-3s-2s1b__gem-3s-2s1b.png"); - - -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1);//gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); - -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.4); -hAll100gem_ratio->Draw("e1"); - -Print(cAll100r, "rates__1-2.4__PU100__def-3s-2s1b__gem-3s-2s1b__ratio.png"); - -if (do_return) return; -} + // no ME1/a eta 1. - 2.1 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); -// full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b -if (1) -{ -gdy[0]=2; gdy[1]=2000.; + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1<|#eta|<2.1",""); + leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); + leg_cc100->Draw(); -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks: same, except in ME1/b region req.",""); -leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); -leg_cc100->Draw(); + Print(cAll100, "rates__1-2.1__PU100__def-3s-3s1b__gem-3s-3s1b.png"); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); -Print(cAll100, "rates__1-2.4__PU100__def-3s__gem-3s-2s1b.png"); + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); + hAll100gem_ratio->Draw("e1"); -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1);//gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); + Print(cAll100r, "rates__1-2.1__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); -hAll100gem_ratio->Draw("e1"); + //result_gem_eta_no1a = hAll100gem; + result_def_eta_no1a_3s1b = hAll100; -Print(cAll100r, "rates__1-2.4__PU100__def-3s__gem-3s-2s1b__ratio.png"); + if (do_return) return; + } -if (do_return) return; -} + // Full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); -// no ME1/a eta 1. - 2.1 Default: 3station GEM: 3station, 3s & 1b -if (1) -{ -gdy[0]=2; gdy[1]=2000.; + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks: same, except",""); + leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); + leg_cc100->Draw(); -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_no1a", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.1",""); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks: same, except in ME1/b region req.",""); -leg_cc100->AddEntry(hAll100,">=3 stubs and one of them from ME1/b",""); -leg_cc100->Draw(); + Print(cAll100, "rates__1-2.4__PU100__def-3s__gem-3s-3s1b.png"); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); -Print(cAll100, "rates__1-2.1__PU100__def-3s__gem-3s-3s1b.png"); + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); + hAll100gem_ratio->Draw("e1"); -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); + Print(cAll100r, "rates__1-2.4__PU100__def-3s__gem-3s-3s1b__ratio.png"); -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); -hAll100gem_ratio->Draw("e1"); + result_gem_eta_all = hAll100gem; + result_def_eta_all = hAll100; -Print(cAll100r, "rates__1-2.1__PU100__def-3s__gem-3s-3s1b__ratio.png"); + if (do_return) return; + } -result_gem_eta_no1a = hAll100gem; -result_def_eta_no1a = hAll100; -if (do_return) return; -} + // Full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=2; gdy[1]=2000.; + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); -// no ME1/a eta 1. - 2.1 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b -if (1) -{ -gdy[0]=2; gdy[1]=2000.; + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); + leg_cc100->Draw(); -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); -leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1<|#eta|<2.1",""); -leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); -leg_cc100->Draw(); + Print(cAll100, "rates__1-2.4__PU100__def-3s-3s1b__gem-3s-3s1b.png"); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); -Print(cAll100, "rates__1-2.1__PU100__def-3s-3s1b__gem-3s-3s1b.png"); + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.6); + hAll100gem_ratio->Draw(); -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); + Print(cAll100r, "rates__1-2.4__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); -hAll100gem_ratio->Draw("e1"); + //result_gem_eta_all = hAll100gem; + result_def_eta_all_3s1b = hAll100; -Print(cAll100r, "rates__1-2.1__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); + if (do_return) return; + } -//result_gem_eta_no1a = hAll100gem; -result_def_eta_no1a_3s1b = hAll100; -if (do_return) return; -} + // ME1b eta 1.64 - 2.14 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=0.02; gdy[1]=1000.; -// Full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b -if (1) -{ -gdy[0]=2; gdy[1]=2000.; + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100,"and require one stub to be from ME1/b",""); + leg_cc100->Draw(); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks: same, except",""); -leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); -leg_cc100->Draw(); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); + Print(cAll100, "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b.png"); -Print(cAll100, "rates__1-2.4__PU100__def-3s__gem-3s-3s1b.png"); + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,2.1); + hAll100gem_ratio->Draw("e1"); -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); -hAll100gem_ratio->Draw("e1"); + Print(cAll100r, "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); -Print(cAll100r, "rates__1-2.4__PU100__def-3s__gem-3s-3s1b__ratio.png"); + result_gem = hAll100gem; + result_def_3s1b = hAll100; -result_gem_eta_all = hAll100gem; -result_def_eta_all = hAll100; + if (do_return) return; + } -if (do_return) return; -} + // ME1b eta 1.64 - 2.14 Default: 3station, 3s GEM: 3station, 3s & 1b + if (1) + { + gdy[0]=0.02; gdy[1]=1000.; -// Full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b -if (1) -{ -gdy[0]=2; gdy[1]=2000.; + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks: same, plus req. one stub from ME1/b",""); + leg_cc100->Draw(); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); -leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1<|#eta|<2.4",""); -leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); -leg_cc100->Draw(); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); + Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b.png"); -Print(cAll100, "rates__1-2.4__PU100__def-3s-3s1b__gem-3s-3s1b.png"); + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,1.1); + hAll100gem_ratio->Draw("e1"); -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.6); -hAll100gem_ratio->Draw(); + Print(cAll100r, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__ratio.png"); -Print(cAll100r, "rates__1-2.4__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); + //result_gem = hAll100gem; + result_def = hAll100; -//result_gem_eta_all = hAll100gem; -result_def_eta_all_3s1b = hAll100; + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_2s_1b", "_hAll100s2", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + result_def_2s = hAll100; -if (do_return) return; -} + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_2s_1b", "_hAll100s2", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + result_def_2s = hAll100; + if (do_return) return; + } -// ME1b eta 1.64 - 2.14 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b -if (1) -{ -gdy[0]=0.02; gdy[1]=1000.; -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + // ME1b eta 1.64 - 2.14 Default: 3station, 3s GMT single trigg + if (1) + { + gdy[0]=0.02; gdy[1]=1000.; -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); -leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1.64<|#eta|<2.14",""); -leg_cc100->AddEntry(hAll100,"and require one stub to be from ME1/b",""); -leg_cc100->Draw(); + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_ptmax_sing_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+1, 1, 1); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100gem,"GMT selection for Single Trigger","f"); + leg_cc100->Draw(); -Print(cAll100, "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b.png"); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gmtsing.png"); -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); + result_def_gmtsing = hAll100gem; -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,2.1); -hAll100gem_ratio->Draw("e1"); + if (do_return) return; + } -Print(cAll100r, "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); -result_gem = hAll100gem; -result_def_3s1b = hAll100; + // ME1b eta 1.64 - 2.14 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b + if (1) + { + gdy[0]=0.02; gdy[1]=1000.; -if (do_return) return; -} + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,"with >=2 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100,"and require one stub to be from ME1/b",""); + leg_cc100->Draw(); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -// ME1b eta 1.64 - 2.14 Default: 3station, 3s GEM: 3station, 3s & 1b -if (1) -{ -gdy[0]=0.02; gdy[1]=1000.; + Print(cAll100, "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b.png"); -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks: same, plus req. one stub from ME1/b",""); -leg_cc100->Draw(); + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,2.1); + hAll100gem_ratio->Draw("e1"); -Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b.png"); + Print(cAll100r, "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__ratio.png"); + result_gem_2s1b = hAll100gem; + result_def_2s1b = hAll100; -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); + if (do_return) return; + } -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,1.1); -hAll100gem_ratio->Draw("e1"); -Print(cAll100r, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__ratio.png"); -//result_gem = hAll100gem; -result_def = hAll100; + /* -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_2s_1b", "_hAll100s2", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -result_def_2s = hAll100; + // ME1b eta 1.64 - 2.14 Default: 3station, 3s GEM: 3station, 2s & 1b + if (1) + { + gdy[0]=0.02; gdy[1]=1000.; -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_2s_1b", "_hAll100s2", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -result_def_2s = hAll100; + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); -if (do_return) return; -} - - - -// ME1b eta 1.64 - 2.14 Default: 3station, 3s GMT single trigg -if (1) -{ -gdy[0]=0.02; gdy[1]=1000.; - -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_ptmax_sing_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+1, 1, 1); - -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); -leg_cc100->AddEntry(hAll100gem,"GMT selection for Single Trigger","f"); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); - -Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gmtsing.png"); - -result_def_gmtsing = hAll100gem; - -if (do_return) return; -} - - -// ME1b eta 1.64 - 2.14 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b -if (1) -{ -gdy[0]=0.02; gdy[1]=1000.; + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + hAll100->Draw("e3"); + hAll100gem->Draw("e3 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","f"); + leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100->AddEntry(hAll100gem,"Tracks: with >=2 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(hAll100gem,"plus req. one stub from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b.png"); + + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,1.1); + hAll100gem_ratio->Draw("e1"); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); -leg_cc100->AddEntry(hAll100,"with >=2 stubs in 1.64<|#eta|<2.14",""); -leg_cc100->AddEntry(hAll100,"and require one stub to be from ME1/b",""); -leg_cc100->Draw(); + Print(cAll100r, "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__ratio.png"); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); + result_gem_2s1b = hAll100gem; + //result_def = hAll100; -Print(cAll100, "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b.png"); + if (do_return) return; + } + */ -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,2.1); -hAll100gem_ratio->Draw("e1"); -Print(cAll100r, "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__ratio.png"); + return; +} -result_gem_2s1b = hAll100gem; -result_def_2s1b = hAll100; +/* -if (do_return) return; -} + .L drawplot_gmtrt.C + drawplot_gmtrt("minbias_pt10_pat2") + hh = (TH1D*)result_gem->Clone("gem_new") + hh->SetFillColor(kGreen+4) + for (int b = hh->FindBin(15); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); + drawplot_gmtrt("minbias_pt15_pat2") + h15 = (TH1D*)result_gem->Clone("gem15") + for (int b = h15->FindBin(15); b < h15->FindBin(20); ++b) hh->SetBinContent(b, h15->GetBinContent(b)); + drawplot_gmtrt("minbias_pt20_pat2") + h20 = (TH1D*)result_gem->Clone("gem20") + for (int b = h20->FindBin(20); b < h20->FindBin(30); ++b) hh->SetBinContent(b, h20->GetBinContent(b)); + drawplot_gmtrt("minbias_pt30_pat2") + h30 = (TH1D*)result_gem->Clone("gem30") + for (int b = h30->FindBin(30); b <= h30->GetNbinsX(); ++b) hh->SetBinContent(b, h30->GetBinContent(b)); + for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh->Draw("same e3"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(result_def,"default emulator","f"); + leg_cc100->AddEntry(result_def,"Tracks: with >=3 stubs in 1.14<|#eta|<2.14",""); + leg_cc100->AddEntry(hh,"with GEM match","f"); + leg_cc100->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); + leg_cc100->Draw(); -/* + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -// ME1b eta 1.64 - 2.14 Default: 3station, 3s GEM: 3station, 2s & 1b -if (1) -{ -gdy[0]=0.02; gdy[1]=1000.; + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png") -hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); -hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); -hAll100->Draw("e3"); -hAll100gem->Draw("e3 same"); -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -//leg_cc100->SetTextSize(0.0368); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(hAll100,"default emulator","f"); -leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); -leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); -leg_cc100->AddEntry(hAll100gem,"Tracks: with >=2 stubs in 1.64<|#eta|<2.14",""); -leg_cc100->AddEntry(hAll100gem,"plus req. one stub from ME1/b",""); -leg_cc100->Draw(); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png") -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); -Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b.png"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3") + hh->Draw("same e3") + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(result_def_3s1b,"default emulator","f"); + leg_cc100->AddEntry(hh,"with GEM match","f"); + leg_cc100->AddEntry(result_def_3s1b,"Tracks req. for both:",""); + leg_cc100->AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg_cc100->Draw(); -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,1.1); -hAll100gem_ratio->Draw("e1"); + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png") -Print(cAll100r, "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__ratio.png"); -result_gem_2s1b = hAll100gem; -//result_def = hAll100; + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png") -if (do_return) return; -} -*/ + .L drawplot_gmtrt.C + drawplot_gmtrt("minbias_pt10_pat8") + hh = (TH1D*)result_gem->Clone("gem_new") + hh->SetFillColor(kGreen+4) + for (int b = hh->FindBin(15); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); + drawplot_gmtrt("minbias_pt15_pat8") + h15 = (TH1D*)result_gem->Clone("gem15") + for (int b = h15->FindBin(15); b < h15->FindBin(20); ++b) hh->SetBinContent(b, h15->GetBinContent(b)); + drawplot_gmtrt("minbias_pt20_pat8") + h20 = (TH1D*)result_gem->Clone("gem20") + for (int b = h20->FindBin(20); b < h20->FindBin(30); ++b) hh->SetBinContent(b, h20->GetBinContent(b)); + drawplot_gmtrt("minbias_pt30_pat8") + h30 = (TH1D*)result_gem->Clone("gem30") + for (int b = h30->FindBin(30); b <= h30->GetNbinsX(); ++b) hh->SetBinContent(b, h30->GetBinContent(b)); + for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); -return; -} -/* - -.L drawplot_gmtrt.C -drawplot_gmtrt("minbias_pt10_pat2") -hh = (TH1D*)result_gem->Clone("gem_new") -hh->SetFillColor(kGreen+4) -for (int b = hh->FindBin(15); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); -drawplot_gmtrt("minbias_pt15_pat2") -h15 = (TH1D*)result_gem->Clone("gem15") -for (int b = h15->FindBin(15); b < h15->FindBin(20); ++b) hh->SetBinContent(b, h15->GetBinContent(b)); -drawplot_gmtrt("minbias_pt20_pat2") -h20 = (TH1D*)result_gem->Clone("gem20") -for (int b = h20->FindBin(20); b < h20->FindBin(30); ++b) hh->SetBinContent(b, h20->GetBinContent(b)); -drawplot_gmtrt("minbias_pt30_pat2") -h30 = (TH1D*)result_gem->Clone("gem30") -for (int b = h30->FindBin(30); b <= h30->GetNbinsX(); ++b) hh->SetBinContent(b, h30->GetBinContent(b)); -for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def->Draw("e3"); -hh->Draw("same e3"); - -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(result_def,"default emulator","f"); -leg_cc100->AddEntry(result_def,"Tracks: with >=3 stubs in 1.14<|#eta|<2.14",""); -leg_cc100->AddEntry(hh,"with GEM match","f"); -leg_cc100->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); - -gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png") - - -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png") - - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s1b->Draw("e3") -hh->Draw("same e3") - -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(result_def_3s1b,"default emulator","f"); -leg_cc100->AddEntry(hh,"with GEM match","f"); -leg_cc100->AddEntry(result_def_3s1b,"Tracks req. for both:",""); -leg_cc100->AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); -leg_cc100->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); - -gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png") - - -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png") - - - - -.L drawplot_gmtrt.C -drawplot_gmtrt("minbias_pt10_pat8") -hh = (TH1D*)result_gem->Clone("gem_new") -hh->SetFillColor(kGreen+4) -for (int b = hh->FindBin(15); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); -drawplot_gmtrt("minbias_pt15_pat8") -h15 = (TH1D*)result_gem->Clone("gem15") -for (int b = h15->FindBin(15); b < h15->FindBin(20); ++b) hh->SetBinContent(b, h15->GetBinContent(b)); -drawplot_gmtrt("minbias_pt20_pat8") -h20 = (TH1D*)result_gem->Clone("gem20") -for (int b = h20->FindBin(20); b < h20->FindBin(30); ++b) hh->SetBinContent(b, h20->GetBinContent(b)); -drawplot_gmtrt("minbias_pt30_pat8") -h30 = (TH1D*)result_gem->Clone("gem30") -for (int b = h30->FindBin(30); b <= h30->GetNbinsX(); ++b) hh->SetBinContent(b, h30->GetBinContent(b)); -for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); - - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def->Draw("e3") -hh->Draw("same e3") - -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(result_def,"default emulator","f"); -leg_cc100->AddEntry(result_def,"Tracks: with >=3 stubs in 1.14<|#eta|<2.14",""); -leg_cc100->AddEntry(hh,"with GEM match","f"); -leg_cc100->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); -leg_cc100->Draw(); - -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); - -gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png") - - -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png") + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3") + hh->Draw("same e3") + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(result_def,"default emulator","f"); + leg_cc100->AddEntry(result_def,"Tracks: with >=3 stubs in 1.14<|#eta|<2.14",""); + leg_cc100->AddEntry(hh,"with GEM match","f"); + leg_cc100->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); + leg_cc100->Draw(); + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s1b->Draw("e3") -hh->Draw("same e3") + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png") -TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -const TObject obj; -leg_cc100->SetBorderSize(0); -leg_cc100->SetFillStyle(0); -leg_cc100->AddEntry(result_def_3s1b,"default emulator","f"); -leg_cc100->AddEntry(hh,"with GEM match","f"); -leg_cc100->AddEntry(result_def_3s1b,"Tracks req. for both:",""); -leg_cc100->AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); -leg_cc100->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); -leg_cc100->Draw(); -TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); -tex->SetNDC(); -tex->Draw(); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png") -gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png") -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png") + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3") + hh->Draw("same e3") + + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(result_def_3s1b,"default emulator","f"); + leg_cc100->AddEntry(hh,"with GEM match","f"); + leg_cc100->AddEntry(result_def_3s1b,"Tracks req. for both:",""); + leg_cc100->AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex->SetNDC(); + tex->Draw(); + + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png") + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png") */ From ff063c052e0126f1305fa2789f8c807a9cd9b3e9 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Aug 2013 00:26:39 +0200 Subject: [PATCH 054/182] change nomenclature, add fully summary plots (not for approval --- SimMuL1/scripts/produceRatePlotsForApproval.C | 377 ++++++++++++++---- 1 file changed, 309 insertions(+), 68 deletions(-) diff --git a/SimMuL1/scripts/produceRatePlotsForApproval.C b/SimMuL1/scripts/produceRatePlotsForApproval.C index ad675901dedfa..d70d4455653bf 100644 --- a/SimMuL1/scripts/produceRatePlotsForApproval.C +++ b/SimMuL1/scripts/produceRatePlotsForApproval.C @@ -18,17 +18,22 @@ TLatex* drawLumiLabel(float x=0.17, float y=0.35) return tex; } - - -void produceRatePlotsForApproval(TString ext) +TLatex* drawL1Label(float x=0.17, float y=0.35) { + TLatex * tex = new TLatex(x, y,"L1 trigger in 2012 configuration"); + tex->SetTextSize(0.04); + tex->SetNDC(); + tex->Draw(); + return tex; +} +void produceRatePlots(TString ext) +{ gem_dir = "files/"; gem_label = "gem98"; - TString plots = "plots/rate/"; - TString the_ttl = "CSC L1 trigger rates in ME1/b region;p_{T}^{cut} [GeV/c];rate [kHz]"; - + TString the_ttl = "CSC L1 trigger rates in 1.64<|#eta|<2.14 region;p_{T}^{cut} [GeV/c];rate [kHz]"; + TString plots = "plots/rateForApproval/"; //gStyle->SetStatW(0.13); //gStyle->SetStatH(0.08); @@ -260,9 +265,9 @@ void produceRatePlotsForApproval(TString ext) result_gem_2s1b__pat8 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat8"); result_gem_3s1b__pat8 = (TH1D*) hh->Clone("result_gem_2s1b__pat8"); - //////////////////////////// - // MY OWN PLOTS FOR APPROVAL - //////////////////////////// + //////////////////////// + // PLOTS FOR APPROVAL // + //////////////////////// { result_gmtsing__pat2->SetFillColor(kRed); result_gmtsing__pat8->SetFillColor(kRed); @@ -307,23 +312,35 @@ void produceRatePlotsForApproval(TString ext) result_gmtsing__pat2->GetYaxis()->SetRangeUser(0.1, 10000.); result_gmtsing__pat2->GetXaxis()->SetTitle(""); - TLegend *leg = new TLegend(0.49,0.6,.98,0.92,NULL,"brNDC"); + TLegend *leg = new TLegend(0.52,0.65,.93,0.93,NULL,"brNDC"); leg->SetBorderSize(0); - leg->SetFillStyle(0); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); leg->SetTextSize(0.04); - leg->AddEntry((TObject*)0, "Global Muon Trigger:",""); + /* + leg->AddEntry((TObject*)0, "Global Muon Trigger [GMT]",""); leg->AddEntry(result_gmtsing__pat2, "default muon selection","f"); leg->AddEntry((TObject*)0, "",""); - leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); - leg->AddEntry(result_def_2s__pat2, "#geq 2 stubs","f"); - leg->AddEntry(result_def_2s1b__pat2,"#geq 2 with ME1/b stub","f"); - leg->AddEntry(result_gem_2s1b__pat2,"#geq 2 with ME1/b stub ","f"); - leg->AddEntry((TObject*)0, " and GEM pad",""); - leg->Draw(); + leg->AddEntry((TObject*)0, "CSC tracks with hits in",""); + leg->AddEntry(result_def_2s__pat2, "#geq 2 stations","f"); + leg->AddEntry(result_def_2s1b__pat2,"#geq 2 stations with YE1","f"); + leg->AddEntry(result_gem_2s1b__pat2,"#geq 2 stations with YE1 ","f"); + leg->AddEntry((TObject*)0, " and GEM",""); + */ + leg->AddEntry((TObject*)0, "Single muon trigger in",""); + leg->AddEntry(result_gmtsing__pat2, "2012 configuration [GMT]","f"); + // leg->AddEntry((TObject*)0, "",""); + leg->AddEntry((TObject*)0, "CSC track selection:",""); + leg->AddEntry(result_def_2s__pat2, "#geq 2 stations, loose","f"); + leg->AddEntry(result_def_2s1b__pat2,"#geq 2 stations, medium","f"); + leg->AddEntry(result_gem_2s1b__pat2,"#geq 2 stations, tight","f"); + leg->Draw(); + + // drawL1Label(0.17,0.35); drawLumiLabel(0.17,.3); - drawPULabel(0.17,.25); - drawEtaLabel("1.64","2.14",0.17,.20); + // drawPULabel(0.17,.25); + // drawEtaLabel("1.64","2.14",0.17,.20); pad2->cd(); pad2->SetLogx(1); @@ -337,10 +354,26 @@ void produceRatePlotsForApproval(TString ext) pad2->SetTopMargin(0.06); pad2->SetBottomMargin(0.4); - hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); - hh_ratio->SetMinimum(0.01); + hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.01,1.1,kAzure+1); + hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); - hh_ratio->Draw("e1"); + hh_ratio->Draw("P"); + + hh_ratio_gmt = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.01,1.1,kRed); + hh_ratio_gmt->Draw("P same"); + + leg = new TLegend(0.15,0.45,.4,0.7,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetTextSize(0.1); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(hh_ratio_gmt, "tight/GMT","p"); + leg->AddEntry(hh_ratio, "tight/medium","p"); + // leg->AddEntry(hh_ratio_gmt, "2+ME1/b+GEM / GMT","p"); + // leg->AddEntry(hh_ratio, "2+ME1/b+GEM / 2+ME1/b","p"); + + leg->Draw("same"); + c->SaveAs(plots + "GMT_2s_2s1b_2s1bgem_loose" + ext); } { @@ -361,23 +394,34 @@ void produceRatePlotsForApproval(TString ext) result_gmtsing__pat8->GetYaxis()->SetRangeUser(0.1, 10000.); result_gmtsing__pat8->GetXaxis()->SetTitle(""); - TLegend *leg = new TLegend(0.49,0.6,.98,0.92,NULL,"brNDC"); + TLegend *leg = new TLegend(0.52,0.65,.93,0.93,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); - leg->AddEntry((TObject*)0, "Global Muon Trigger:",""); - leg->AddEntry(result_gmtsing__pat8, "default muon selection","f"); - leg->AddEntry((TObject*)0, "",""); - leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); - leg->AddEntry(result_def_2s__pat8, "#geq 2 stubs","f"); - leg->AddEntry(result_def_2s1b__pat8,"#geq 2 with ME1/b stub","f"); - leg->AddEntry(result_gem_2s1b__pat8,"#geq 2 with ME1/b stub ","f"); - leg->AddEntry((TObject*)0, " and GEM pad",""); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + // leg->AddEntry((TObject*)0, "Global Muon Trigger [GMT]:",""); + // leg->AddEntry(result_gmtsing__pat8, "default muon selection","f"); + // leg->AddEntry((TObject*)0, "",""); + // leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); + // leg->AddEntry(result_def_2s__pat8, "#geq 2 stubs","f"); + // leg->AddEntry(result_def_2s1b__pat8,"#geq 2 with ME1/b stub","f"); + // leg->AddEntry(result_gem_2s1b__pat8,"#geq 2 with ME1/b stub ","f"); + // leg->AddEntry((TObject*)0, " and GEM pad",""); + leg->AddEntry((TObject*)0, "Single muon trigger in",""); + leg->AddEntry(result_gmtsing__pat8, "2012 configuration [GMT]","f"); + // leg->AddEntry((TObject*)0, "",""); + leg->AddEntry((TObject*)0, "CSC track selection:",""); + leg->AddEntry(result_def_2s__pat8, "#geq 2 stations, loose","f"); + leg->AddEntry(result_def_2s1b__pat8,"#geq 2 stations, medium","f"); + leg->AddEntry(result_gem_2s1b__pat8,"#geq 2 stations, tight","f"); + leg->Draw(); + // drawL1Label(0.17,0.35); drawLumiLabel(0.17,.3); - drawPULabel(0.17,.25); - drawEtaLabel("1.64","2.14",0.17,.20); + // drawPULabel(0.17,.25); + // drawEtaLabel("1.64","2.14",0.17,.20); pad2->cd(); pad2->SetLogx(1); @@ -391,10 +435,31 @@ void produceRatePlotsForApproval(TString ext) pad2->SetTopMargin(0.06); pad2->SetBottomMargin(0.4); - hh_ratio = setHistoRatio(result_gem_2s1b__pat8, result_def_2s1b__pat8, "", 0.,1.1); - hh_ratio->SetMinimum(0.01); + + hh_ratio = setHistoRatio(result_gem_2s1b__pat8, result_def_2s1b__pat8, "", 0.01,1.1,kAzure+1); hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); - hh_ratio->Draw("e1"); + hh_ratio->Draw("P"); + + hh_ratio_gmt = setHistoRatio(result_gem_2s1b__pat8, result_gmtsing__pat8, "", 0.01,1.1,kRed); + hh_ratio_gmt->Draw("P same"); + + leg = new TLegend(0.15,0.45,.4,0.7,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.1); + // leg->AddEntry(hh_ratio_gmt, "2+ME1/b+GEM / GMT","p"); + // leg->AddEntry(hh_ratio, "2+ME1/b+GEM / 2+ME1/b","p"); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(hh_ratio_gmt, "tight/GMT","p"); + leg->AddEntry(hh_ratio, "tight/medium","p"); + leg->Draw("same"); + + // hh_ratio = setHistoRatio(result_gem_2s1b__pat8, result_def_2s1b__pat8, "", 0.,1.1); + // hh_ratio->SetMinimum(0.01); + // hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); + // hh_ratio->Draw("e1"); + c->SaveAs(plots + "GMT_2s_2s1b_2s1bgem_tight" + ext); } @@ -416,23 +481,34 @@ void produceRatePlotsForApproval(TString ext) result_gmtsing__pat2->GetYaxis()->SetRangeUser(0.01, 10000.); result_gmtsing__pat2->GetXaxis()->SetTitle(""); - TLegend *leg = new TLegend(0.49,0.6,.98,0.92,NULL,"brNDC"); + TLegend *leg = new TLegend(0.52,0.65,.93,0.93,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); - leg->AddEntry((TObject*)0, "Global Muon Trigger:",""); - leg->AddEntry(result_gmtsing__pat2, "default muon selection","f"); - leg->AddEntry((TObject*)0, "",""); - leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); - leg->AddEntry(result_def_3s__pat2, "#geq 3 stubs","f"); - leg->AddEntry(result_def_3s1b__pat2,"#geq 3 with ME1/b stub","f"); - leg->AddEntry(result_gem_3s1b__pat2,"#geq 3 with ME1/b stub ","f"); - leg->AddEntry((TObject*)0, " and GEM pad",""); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + // leg->AddEntry((TObject*)0, "Global Muon Trigger [GMT]:",""); + // leg->AddEntry(result_gmtsing__pat2, "default muon selection","f"); + // leg->AddEntry((TObject*)0, "",""); + // leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); + // leg->AddEntry(result_def_3s__pat2, "#geq 3 stubs","f"); + // leg->AddEntry(result_def_3s1b__pat2,"#geq 3 with ME1/b stub","f"); + // leg->AddEntry(result_gem_3s1b__pat2,"#geq 3 with ME1/b stub ","f"); + // leg->AddEntry((TObject*)0, " and GEM pad",""); + leg->AddEntry((TObject*)0, "Single muon trigger in",""); + leg->AddEntry(result_gmtsing__pat2, "2012 configuration [GMT]","f"); + // leg->AddEntry((TObject*)0, "",""); + leg->AddEntry((TObject*)0, "CSC track selection:",""); + leg->AddEntry(result_def_3s__pat2, "#geq 3 stations, loose","f"); + leg->AddEntry(result_def_3s1b__pat2,"#geq 3 stations, medium","f"); + leg->AddEntry(result_gem_3s1b__pat2,"#geq 3 stations, tight","f"); + leg->Draw(); + // drawL1Label(0.17,0.35); drawLumiLabel(0.17,.3); - drawPULabel(0.17,.25); - drawEtaLabel("1.64","2.14",0.17,.20); + // drawPULabel(0.17,.25); + // drawEtaLabel("1.64","2.14",0.17,.20); pad2->cd(); pad2->SetLogx(1); @@ -446,10 +522,31 @@ void produceRatePlotsForApproval(TString ext) pad2->SetTopMargin(0.06); pad2->SetBottomMargin(0.4); - hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); - hh_ratio->SetMinimum(0.01); + + hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.01,1.1,kAzure+1); hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); - hh_ratio->Draw("e1"); + hh_ratio->Draw("P"); + + hh_ratio_gmt = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.01,1.1,kRed); + hh_ratio_gmt->Draw("P same"); + + leg = new TLegend(0.15,0.44,.4,0.7,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.1); + // leg->AddEntry(hh_ratio_gmt, "3+ME1/b+GEM / GMT","p"); + // leg->AddEntry(hh_ratio, "3+ME1/b+GEM / 3+ME1/b","p"); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(hh_ratio_gmt, "tight/GMT","p"); + leg->AddEntry(hh_ratio, "tight/medium","p"); + leg->Draw("same"); + + // hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); + // hh_ratio->SetMinimum(0.01); + // hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); + // hh_ratio->Draw("e1"); + c->SaveAs(plots + "GMT_3s_3s1b_3s1bgem_loose" + ext); } @@ -471,23 +568,34 @@ void produceRatePlotsForApproval(TString ext) result_gmtsing__pat8->GetYaxis()->SetRangeUser(0.01, 10000.); result_gmtsing__pat8->GetXaxis()->SetTitle(""); - TLegend *leg = new TLegend(0.49,0.6,.98,0.92,NULL,"brNDC"); + TLegend *leg = new TLegend(0.52,0.65,.93,0.93,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); - leg->AddEntry((TObject*)0, "Global Muon Trigger:",""); - leg->AddEntry(result_gmtsing__pat8, "default muon selection","f"); - leg->AddEntry((TObject*)0, "",""); - leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); - leg->AddEntry(result_def_3s__pat8, "#geq 3 stubs","f"); - leg->AddEntry(result_def_3s1b__pat8,"#geq 3 with ME1/b stub","f"); - leg->AddEntry(result_gem_3s1b__pat8,"#geq 3 with ME1/b stub ","f"); - leg->AddEntry((TObject*)0, " and GEM pad",""); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + // leg->AddEntry((TObject*)0, "Global Muon Trigger [GMT]:",""); + // leg->AddEntry(result_gmtsing__pat8, "default muon selection","f"); + // leg->AddEntry((TObject*)0, "",""); + // leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); + // leg->AddEntry(result_def_3s__pat8, "#geq 3 stubs","f"); + // leg->AddEntry(result_def_3s1b__pat8,"#geq 3 with ME1/b stub","f"); + // leg->AddEntry(result_gem_3s1b__pat8,"#geq 3 with ME1/b stub ","f"); + // leg->AddEntry((TObject*)0, " and GEM pad",""); + leg->AddEntry((TObject*)0, "Single muon trigger in",""); + leg->AddEntry(result_gmtsing__pat8, "2012 configuration [GMT]","f"); + // leg->AddEntry((TObject*)0, "",""); + leg->AddEntry((TObject*)0, "CSC track selection:",""); + leg->AddEntry(result_def_3s__pat8, "#geq 3 stations, loose","f"); + leg->AddEntry(result_def_3s1b__pat8,"#geq 3 stations, medium","f"); + leg->AddEntry(result_gem_3s1b__pat8,"#geq 3 stations, tight","f"); + leg->Draw(); + // drawL1Label(0.17,0.35); drawLumiLabel(0.17,.3); - drawPULabel(0.17,.25); - drawEtaLabel("1.64","2.14",0.17,.20); + // drawPULabel(0.17,.25); + // drawEtaLabel("1.64","2.14",0.17,.20); pad2->cd(); pad2->SetLogx(1); @@ -501,14 +609,147 @@ void produceRatePlotsForApproval(TString ext) pad2->SetTopMargin(0.06); pad2->SetBottomMargin(0.4); - hh_ratio = setHistoRatio(result_gem_3s1b__pat8, result_def_3s1b__pat8, "", 0.,1.1); - hh_ratio->SetMinimum(0.01); + hh_ratio = setHistoRatio(result_gem_3s1b__pat8, result_def_3s1b__pat8, "", 0.01,1.1,kAzure+1); hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); - hh_ratio->Draw("e1"); + hh_ratio->Draw("P"); + + hh_ratio_gmt = setHistoRatio(result_gem_3s1b__pat8, result_gmtsing__pat8, "", 0.01,1.1,kRed); + hh_ratio_gmt->Draw("P same"); + + leg = new TLegend(0.15,0.45,.4,0.7,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.1); + // leg->AddEntry(hh_ratio_gmt, "3+ME1/b+GEM / GMT","p"); + // leg->AddEntry(hh_ratio, "3+ME1/b+GEM / 3+ME1/b","p"); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(hh_ratio_gmt, "tight/GMT","p"); + leg->AddEntry(hh_ratio, "tight/medium","p"); + leg->Draw("same"); + c->SaveAs(plots + "GMT_3s_3s1b_3s1bgem_tight" + ext); } + // EXTRA PLOTS + + { + result_def_2s__pat8->SetFillColor(kViolet+2); + result_def_2s1b__pat8->SetFillColor(kAzure+2); + result_gem_2s1b__pat8->SetFillColor(kGreen-1); + + + // GMT; CSCTF 2 stubs; CSCTF 2 stubs + ME1/b; CSCTF 2 stubs + ME1/b + GEM -- LOOSE & TIGHT-- Absolute + ratio + TCanvas* c = new TCanvas("c","c",1000,800); + c->Clear(); + TPad *pad1 = new TPad("pad1","top pad",0.0,0.0,1.0,1.0); + pad1->Draw(); + + pad1->cd(); + pad1->SetLogx(1); + pad1->SetLogy(1); + pad1->SetGridx(1); + pad1->SetGridy(1); + pad1->SetFrameBorderMode(0); + pad1->SetFillColor(kWhite); + + result_gmtsing__pat2->Draw("e3"); + result_def_2s__pat2->Draw("same e3"); + result_def_2s1b__pat2->Draw("same e3"); + result_gem_2s1b__pat2->Draw("same e3"); + result_def_2s__pat8->Draw("same e3"); + result_def_2s1b__pat8->Draw("same e3"); + result_gem_2s1b__pat8->Draw("same e3"); + result_gmtsing__pat2->Draw("same e3"); + result_gmtsing__pat2->GetYaxis()->SetRangeUser(0.1, 10000.); + result_gmtsing__pat2->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); + + TLegend *leg = new TLegend(0.5,0.65,.92,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.03); + leg->AddEntry((TObject*)0, "Global Muon Trigger [GMT]:",""); + leg->AddEntry(result_gmtsing__pat2, "default muon selection","f"); + leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); + leg->AddEntry(result_def_2s__pat2, "#geq 2 stubs","f"); + leg->AddEntry(result_def_2s1b__pat2,"#geq 2 with ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat2,"#geq 2 with ME1/b stub and GEM pad","f"); + leg->AddEntry(result_def_2s__pat8, "#geq 2 stubs","f"); + leg->AddEntry(result_def_2s1b__pat8,"#geq 2 with ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat8,"#geq 2 with ME1/b stub and GEM pad","f"); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + + leg->Draw(); + + // drawL1Label(0.17,0.35); + drawLumiLabel(0.17,.3); + // drawPULabel(0.17,.25); + // drawEtaLabel("1.64","2.14",0.17,.20); + + c->SaveAs(plots + "GMT_2s_2s1b_2s1bgem" + ext); + + } + + { + result_def_3s__pat8->SetFillColor(kViolet+2); + result_def_3s1b__pat8->SetFillColor(kAzure+2); + result_gem_3s1b__pat8->SetFillColor(kGreen-1); + + + // GMT; CSCTF 3 stubs; CSCTF 3 stubs + ME1/b; CSCTF 3 stubs + ME1/b + GEM -- LOOSE & TIGHT-- Absolute + ratio + TCanvas* c = new TCanvas("c","c",1000,800); + c->Clear(); + TPad *pad1 = new TPad("pad1","top pad",0.0,0.0,1.0,1.0); + pad1->Draw(); + + pad1->cd(); + pad1->SetLogx(1); + pad1->SetLogy(1); + pad1->SetGridx(1); + pad1->SetGridy(1); + pad1->SetFrameBorderMode(0); + pad1->SetFillColor(kWhite); + + result_gmtsing__pat2->Draw("e3"); + result_def_3s__pat2->Draw("same e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_gem_3s1b__pat2->Draw("same e3"); + result_def_3s__pat8->Draw("same e3"); + result_def_3s1b__pat8->Draw("same e3"); + result_gem_3s1b__pat8->Draw("same e3"); + result_gmtsing__pat2->Draw("same e3"); + result_gmtsing__pat2->GetYaxis()->SetRangeUser(0.01, 10000.); + result_gmtsing__pat2->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); + + TLegend *leg = new TLegend(0.5,0.65,.92,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.03); + leg->AddEntry((TObject*)0, "Global Muon Trigger [GMT]:",""); + leg->AddEntry(result_gmtsing__pat2, "default muon selection","f"); + leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); + leg->AddEntry(result_def_3s__pat2, "#geq 3 stubs","f"); + leg->AddEntry(result_def_3s1b__pat2,"#geq 3 with ME1/b stub","f"); + leg->AddEntry(result_gem_3s1b__pat2,"#geq 3 with ME1/b stub and GEM pad","f"); + leg->AddEntry(result_def_3s__pat8, "#geq 3 stubs","f"); + leg->AddEntry(result_def_3s1b__pat8,"#geq 3 with ME1/b stub","f"); + leg->AddEntry(result_gem_3s1b__pat8,"#geq 3 with ME1/b stub and GEM pad","f"); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + + leg->Draw(); + + // drawL1Label(0.17,0.35); + drawLumiLabel(0.17,.3); + // drawPULabel(0.17,.25); + // drawEtaLabel("1.64","2.14",0.17,.20); + + c->SaveAs(plots + "GMT_3s_3s1b_3s1bgem" + ext); + + } + } void produceRatePlotsForApproval() @@ -517,7 +758,7 @@ void produceRatePlotsForApproval() gROOT->ProcessLine(".L getPTHistos.C"); gROOT->SetBatch(true); - produceRatePlotsForApproval(".png"); - produceRatePlotsForApproval(".pdf"); - produceRatePlotsForApproval(".eps"); + produceRatePlots(".pdf"); + produceRatePlots(".eps"); + produceRatePlots(".png"); } From 93255c05c3d215f43af6591f9520bd9384fd9d45 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Aug 2013 00:50:20 +0200 Subject: [PATCH 055/182] further clean-up plot --- SimMuL1/scripts/plotGEMCSCdPhi.py | 32 ++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/SimMuL1/scripts/plotGEMCSCdPhi.py b/SimMuL1/scripts/plotGEMCSCdPhi.py index b60e2755de086..93fed12b064ee 100644 --- a/SimMuL1/scripts/plotGEMCSCdPhi.py +++ b/SimMuL1/scripts/plotGEMCSCdPhi.py @@ -60,16 +60,16 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): gStyle.SetOptStat(0) gStyle.SetMarkerStyle(1) -# setTDRStyle() + #setTDRStyle() if oddEven == "even": ok_pad_lct = ok_pad2_lct2 var = "dphi_pad_even" - closeFar = "close" + closeFar = "Close" else: ok_pad_lct = ok_pad1_lct1 var = "dphi_pad_odd" - closeFar = "far" + closeFar = "Far" t.Draw("TMath::Abs(%s)>>dphi_pt5"%(var) , ok_pad_lct); t1.Draw("TMath::Abs(%s)>>dphi_pt20"%(var) , ok_pad_lct); @@ -82,24 +82,34 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): dphi_pt5.SetLineWidth(2); dphi_pt20.SetLineWidth(2); - dphi_pt20.GetXaxis().SetTitle("GEM-CSC bending angle [rad]"); - dphi_pt20.GetYaxis().SetTitle("A.U."); - dphi_pt20.SetTitle("GEM-CSC bending angle for muons in %s chambers"%(closeFar)); + dphi_pt20.GetXaxis().SetTitle("#Delta#Phi(GEM,CSC) [rad]"); + dphi_pt20.GetYaxis().SetTitle("Arbitrary units"); + dphi_pt20.SetTitle("CMS Simulation: GEM-CSC bending angle"); dphi_pt20.Draw(); dphi_pt5.Draw("same"); - legend = TLegend(.4,.6,.7,.8); + legend = TLegend(.4,.5,.7,.7); legend.SetFillColor(kWhite); legend.SetFillStyle(0); legend.SetBorderSize(0); - legend.SetTextSize(0.05); + legend.SetTextSize(0.06); legend.SetMargin(0.13); - legend.AddEntry(dphi_pt5,"p_{T}=5 GeV","L"); - legend.AddEntry(dphi_pt20,"p_{T}=20 GeV","L"); + legend.AddEntry(dphi_pt5,"muon p_{T} = 5 GeV/c","L"); + legend.AddEntry(dphi_pt20,"muon p_{T} = 20 GeV/c","L"); legend.Draw("same"); - c.SaveAs("%sGEMCSCdPhi_%s_chambers%s"%(plotDir, oddEven, ext)); + tex = TLatex(.65,.85,"%s chambers"%(closeFar)) + tex.SetTextSize(0.06) + tex.SetNDC() + tex.Draw("same") + + tex2 = TLatex(.65,.75,"1.64<|#eta|<2.14") + tex2.SetTextSize(0.06) + tex2.SetNDC() + tex2.Draw("same") + + c.SaveAs("%sGEMCSCdPhi_%s_chambers%s"%(plotDir, oddEven, ext)) if __name__ == "__main__": plotGEMCSCdPhi("files/", "plots/bending/", "even", ".png") From 495bd6939d4ca25270fdd082797425fba9d703ad Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Aug 2013 15:35:53 +0200 Subject: [PATCH 056/182] add Alexei and Alfredo' suggestions --- SimMuL1/scripts/plotGEMCSCdPhi.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/SimMuL1/scripts/plotGEMCSCdPhi.py b/SimMuL1/scripts/plotGEMCSCdPhi.py index 93fed12b064ee..635a1123545e9 100644 --- a/SimMuL1/scripts/plotGEMCSCdPhi.py +++ b/SimMuL1/scripts/plotGEMCSCdPhi.py @@ -83,8 +83,8 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): dphi_pt20.SetLineWidth(2); dphi_pt20.GetXaxis().SetTitle("#Delta#Phi(GEM,CSC) [rad]"); - dphi_pt20.GetYaxis().SetTitle("Arbitrary units"); - dphi_pt20.SetTitle("CMS Simulation: GEM-CSC bending angle"); + dphi_pt20.GetYaxis().SetTitle("A.U."); + dphi_pt20.SetTitle(" GEM-CSC Bending Angle CMS Simulation"); dphi_pt20.Draw(); dphi_pt5.Draw("same"); @@ -95,16 +95,17 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): legend.SetBorderSize(0); legend.SetTextSize(0.06); legend.SetMargin(0.13); + legend.AddEntry(0,"1.64<|#eta|<2.14:",""); legend.AddEntry(dphi_pt5,"muon p_{T} = 5 GeV/c","L"); legend.AddEntry(dphi_pt20,"muon p_{T} = 20 GeV/c","L"); legend.Draw("same"); - tex = TLatex(.65,.85,"%s chambers"%(closeFar)) + tex = TLatex(.55,.85,'"%s" chamber pairs'%(closeFar)) tex.SetTextSize(0.06) tex.SetNDC() tex.Draw("same") - tex2 = TLatex(.65,.75,"1.64<|#eta|<2.14") + tex2 = TLatex(.22,.85,'L1 Trigger') tex2.SetTextSize(0.06) tex2.SetNDC() tex2.Draw("same") From 2f32e2490ce99693f140e9bd18257688bb721f4b Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Aug 2013 18:08:37 +0200 Subject: [PATCH 057/182] fine-tuning of the rate vs pt plots --- ...al.C => produceRateVsPtPlotsForApproval.C} | 236 ++++++------------ 1 file changed, 82 insertions(+), 154 deletions(-) rename SimMuL1/scripts/{produceRatePlotsForApproval.C => produceRateVsPtPlotsForApproval.C} (80%) diff --git a/SimMuL1/scripts/produceRatePlotsForApproval.C b/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C similarity index 80% rename from SimMuL1/scripts/produceRatePlotsForApproval.C rename to SimMuL1/scripts/produceRateVsPtPlotsForApproval.C index d70d4455653bf..be48d690aeac5 100644 --- a/SimMuL1/scripts/produceRatePlotsForApproval.C +++ b/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C @@ -33,7 +33,7 @@ void produceRatePlots(TString ext) gem_label = "gem98"; TString the_ttl = "CSC L1 trigger rates in 1.64<|#eta|<2.14 region;p_{T}^{cut} [GeV/c];rate [kHz]"; - TString plots = "plots/rateForApproval/"; + TString plots = "plots/rate/"; //gStyle->SetStatW(0.13); //gStyle->SetStatH(0.08); @@ -133,8 +133,6 @@ void produceRatePlots(TString ext) for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); - - hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); @@ -151,8 +149,6 @@ void produceRatePlots(TString ext) result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); - - result_def_2s__pat2 = (TH1D*) result_def_2s->Clone("result_def_2s__pat2"); result_def_3s__pat2 = (TH1D*) result_def->Clone("result_def_2s__pat2"); result_def_2s1b__pat2 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat2"); @@ -238,7 +234,6 @@ void produceRatePlots(TString ext) for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); - hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); @@ -255,7 +250,6 @@ void produceRatePlots(TString ext) result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); - result_def_2s__pat8 = (TH1D*) result_def_2s->Clone("result_def_2s__pat8"); result_def_3s__pat8 = (TH1D*) result_def->Clone("result_def_2s__pat8"); result_def_2s1b__pat8 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat8"); @@ -312,35 +306,28 @@ void produceRatePlots(TString ext) result_gmtsing__pat2->GetYaxis()->SetRangeUser(0.1, 10000.); result_gmtsing__pat2->GetXaxis()->SetTitle(""); - TLegend *leg = new TLegend(0.52,0.65,.93,0.93,NULL,"brNDC"); + TLegend *leg0 = new TLegend(0.15,0.88,.9,0.93,NULL,"brNDC"); + leg0->SetBorderSize(0); + leg0->SetFillStyle(0); + leg0->SetTextSize(0.04); + leg0->SetFillStyle(1001); + leg0->SetFillColor(kWhite); + leg0->AddEntry(result_gmtsing__pat2,"Single muon trigger in 2012 configuration [GMT]","f"); + leg0->Draw(); + + TLegend *leg = new TLegend(0.45,0.68,.93,0.86,NULL,"brNDC"); leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->SetTextSize(0.04); - /* - leg->AddEntry((TObject*)0, "Global Muon Trigger [GMT]",""); - leg->AddEntry(result_gmtsing__pat2, "default muon selection","f"); - leg->AddEntry((TObject*)0, "",""); - leg->AddEntry((TObject*)0, "CSC tracks with hits in",""); - leg->AddEntry(result_def_2s__pat2, "#geq 2 stations","f"); - leg->AddEntry(result_def_2s1b__pat2,"#geq 2 stations with YE1","f"); - leg->AddEntry(result_gem_2s1b__pat2,"#geq 2 stations with YE1 ","f"); - leg->AddEntry((TObject*)0, " and GEM",""); - */ - leg->AddEntry((TObject*)0, "Single muon trigger in",""); - leg->AddEntry(result_gmtsing__pat2, "2012 configuration [GMT]","f"); - // leg->AddEntry((TObject*)0, "",""); - leg->AddEntry((TObject*)0, "CSC track selection:",""); - leg->AddEntry(result_def_2s__pat2, "#geq 2 stations, loose","f"); - leg->AddEntry(result_def_2s1b__pat2,"#geq 2 stations, medium","f"); - leg->AddEntry(result_gem_2s1b__pat2,"#geq 2 stations, tight","f"); - + leg->AddEntry((TObject*)0, "L1 Selections (#geq2 stations):",""); + leg->AddEntry(result_def_2s__pat2, "CSC, loose","f"); + leg->AddEntry(result_def_2s1b__pat2,"CSC, tight","f"); + leg->AddEntry(result_gem_2s1b__pat2,"GEM+CSC Integrated Trigger","f"); leg->Draw(); - - // drawL1Label(0.17,0.35); + drawLumiLabel(0.17,.3); - // drawPULabel(0.17,.25); - // drawEtaLabel("1.64","2.14",0.17,.20); pad2->cd(); pad2->SetLogx(1); @@ -362,22 +349,19 @@ void produceRatePlots(TString ext) hh_ratio_gmt = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.01,1.1,kRed); hh_ratio_gmt->Draw("P same"); - leg = new TLegend(0.15,0.45,.4,0.7,NULL,"brNDC"); + leg = new TLegend(0.15,0.45,.5,0.7,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetTextSize(0.1); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry(hh_ratio_gmt, "tight/GMT","p"); - leg->AddEntry(hh_ratio, "tight/medium","p"); - // leg->AddEntry(hh_ratio_gmt, "2+ME1/b+GEM / GMT","p"); - // leg->AddEntry(hh_ratio, "2+ME1/b+GEM / 2+ME1/b","p"); - + leg->AddEntry(hh_ratio_gmt, "GEM+CSC/GMT","p"); + leg->AddEntry(hh_ratio, "GEM+CSC/CSC tight","p"); leg->Draw("same"); - c->SaveAs(plots + "GMT_2s_2s1b_2s1bgem_loose" + ext); + c->SaveAs(plots + "rates_vs_pt__PU100__def_2s_2s1b_2s1bgem__loose" + ext); } { - // GMT; CSCTF 2 stubs; CSCTF 2 stubs + ME1/b; CSCTF 2 stubs + ME1/b + GEM -- TIGHT -- Absolute + // GMT; CSCTF 2 stubs; CSCTF 2 stubs + ME1/b; CSCTF 2 stubs + ME1/b + GEM -- TIGHT + GEM -- Absolute pad1->cd(); pad1->SetLogx(1); pad1->SetLogy(1); @@ -394,34 +378,28 @@ void produceRatePlots(TString ext) result_gmtsing__pat8->GetYaxis()->SetRangeUser(0.1, 10000.); result_gmtsing__pat8->GetXaxis()->SetTitle(""); - TLegend *leg = new TLegend(0.52,0.65,.93,0.93,NULL,"brNDC"); + TLegend *leg0 = new TLegend(0.15,0.88,.9,0.93,NULL,"brNDC"); + leg0->SetBorderSize(0); + leg0->SetFillStyle(0); + leg0->SetTextSize(0.04); + leg0->SetFillStyle(1001); + leg0->SetFillColor(kWhite); + leg0->AddEntry(result_gmtsing__pat8,"Single muon trigger in 2012 configuration [GMT]","f"); + leg0->Draw(); + + TLegend *leg = new TLegend(0.45,0.68,.93,0.86,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - // leg->AddEntry((TObject*)0, "Global Muon Trigger [GMT]:",""); - // leg->AddEntry(result_gmtsing__pat8, "default muon selection","f"); - // leg->AddEntry((TObject*)0, "",""); - // leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); - // leg->AddEntry(result_def_2s__pat8, "#geq 2 stubs","f"); - // leg->AddEntry(result_def_2s1b__pat8,"#geq 2 with ME1/b stub","f"); - // leg->AddEntry(result_gem_2s1b__pat8,"#geq 2 with ME1/b stub ","f"); - // leg->AddEntry((TObject*)0, " and GEM pad",""); - leg->AddEntry((TObject*)0, "Single muon trigger in",""); - leg->AddEntry(result_gmtsing__pat8, "2012 configuration [GMT]","f"); - // leg->AddEntry((TObject*)0, "",""); - leg->AddEntry((TObject*)0, "CSC track selection:",""); - leg->AddEntry(result_def_2s__pat8, "#geq 2 stations, loose","f"); - leg->AddEntry(result_def_2s1b__pat8,"#geq 2 stations, medium","f"); - leg->AddEntry(result_gem_2s1b__pat8,"#geq 2 stations, tight","f"); - + leg->AddEntry((TObject*)0, "L1 Selections (#geq2 stations):",""); + leg->AddEntry(result_def_2s__pat8, "CSC, loose","f"); + leg->AddEntry(result_def_2s1b__pat8,"CSC, tight","f"); + leg->AddEntry(result_gem_2s1b__pat8,"GEM+CSC Integrated Trigger","f"); leg->Draw(); - // drawL1Label(0.17,0.35); drawLumiLabel(0.17,.3); - // drawPULabel(0.17,.25); - // drawEtaLabel("1.64","2.14",0.17,.20); pad2->cd(); pad2->SetLogx(1); @@ -435,33 +413,23 @@ void produceRatePlots(TString ext) pad2->SetTopMargin(0.06); pad2->SetBottomMargin(0.4); - hh_ratio = setHistoRatio(result_gem_2s1b__pat8, result_def_2s1b__pat8, "", 0.01,1.1,kAzure+1); hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); hh_ratio->Draw("P"); - hh_ratio_gmt = setHistoRatio(result_gem_2s1b__pat8, result_gmtsing__pat8, "", 0.01,1.1,kRed); hh_ratio_gmt->Draw("P same"); - leg = new TLegend(0.15,0.45,.4,0.7,NULL,"brNDC"); + leg = new TLegend(0.15,0.45,.5,0.7,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.1); - // leg->AddEntry(hh_ratio_gmt, "2+ME1/b+GEM / GMT","p"); - // leg->AddEntry(hh_ratio, "2+ME1/b+GEM / 2+ME1/b","p"); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry(hh_ratio_gmt, "tight/GMT","p"); - leg->AddEntry(hh_ratio, "tight/medium","p"); + leg->AddEntry(hh_ratio_gmt, "GEM+CSC/GMT","p"); + leg->AddEntry(hh_ratio, "GEM+CSC/CSC tight","p"); leg->Draw("same"); - // hh_ratio = setHistoRatio(result_gem_2s1b__pat8, result_def_2s1b__pat8, "", 0.,1.1); - // hh_ratio->SetMinimum(0.01); - // hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); - // hh_ratio->Draw("e1"); - - c->SaveAs(plots + "GMT_2s_2s1b_2s1bgem_tight" + ext); - + c->SaveAs(plots + "rates_vs_pt__PU100__def_2s_2s1b_2s1bgem__tight" + ext); } { // GMT; CSCTF 3 stubs; CSCTF 3 stubs + ME1/b; CSCTF 3 stubs + ME1/b + GEM -- LOOSE -- Absolute @@ -481,34 +449,28 @@ void produceRatePlots(TString ext) result_gmtsing__pat2->GetYaxis()->SetRangeUser(0.01, 10000.); result_gmtsing__pat2->GetXaxis()->SetTitle(""); - TLegend *leg = new TLegend(0.52,0.65,.93,0.93,NULL,"brNDC"); + TLegend *leg0 = new TLegend(0.15,0.88,.9,0.93,NULL,"brNDC"); + leg0->SetBorderSize(0); + leg0->SetFillStyle(0); + leg0->SetTextSize(0.04); + leg0->SetFillStyle(1001); + leg0->SetFillColor(kWhite); + leg0->AddEntry(result_gmtsing__pat2,"Single muon trigger in 2012 configuration [GMT]","f"); + leg0->Draw(); + + TLegend *leg = new TLegend(0.45,0.68,.93,0.86,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - // leg->AddEntry((TObject*)0, "Global Muon Trigger [GMT]:",""); - // leg->AddEntry(result_gmtsing__pat2, "default muon selection","f"); - // leg->AddEntry((TObject*)0, "",""); - // leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); - // leg->AddEntry(result_def_3s__pat2, "#geq 3 stubs","f"); - // leg->AddEntry(result_def_3s1b__pat2,"#geq 3 with ME1/b stub","f"); - // leg->AddEntry(result_gem_3s1b__pat2,"#geq 3 with ME1/b stub ","f"); - // leg->AddEntry((TObject*)0, " and GEM pad",""); - leg->AddEntry((TObject*)0, "Single muon trigger in",""); - leg->AddEntry(result_gmtsing__pat2, "2012 configuration [GMT]","f"); - // leg->AddEntry((TObject*)0, "",""); - leg->AddEntry((TObject*)0, "CSC track selection:",""); - leg->AddEntry(result_def_3s__pat2, "#geq 3 stations, loose","f"); - leg->AddEntry(result_def_3s1b__pat2,"#geq 3 stations, medium","f"); - leg->AddEntry(result_gem_3s1b__pat2,"#geq 3 stations, tight","f"); - + leg->AddEntry((TObject*)0, "L1 Selections (#geq3 stations):",""); + leg->AddEntry(result_def_3s__pat2, "CSC, loose","f"); + leg->AddEntry(result_def_3s1b__pat2,"CSC, tight","f"); + leg->AddEntry(result_gem_3s1b__pat2,"GEM+CSC Integrated Trigger","f"); leg->Draw(); - // drawL1Label(0.17,0.35); drawLumiLabel(0.17,.3); - // drawPULabel(0.17,.25); - // drawEtaLabel("1.64","2.14",0.17,.20); pad2->cd(); pad2->SetLogx(1); @@ -522,36 +484,26 @@ void produceRatePlots(TString ext) pad2->SetTopMargin(0.06); pad2->SetBottomMargin(0.4); - hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.01,1.1,kAzure+1); hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); hh_ratio->Draw("P"); - hh_ratio_gmt = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.01,1.1,kRed); hh_ratio_gmt->Draw("P same"); - leg = new TLegend(0.15,0.44,.4,0.7,NULL,"brNDC"); + leg = new TLegend(0.15,0.45,.5,0.7,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.1); - // leg->AddEntry(hh_ratio_gmt, "3+ME1/b+GEM / GMT","p"); - // leg->AddEntry(hh_ratio, "3+ME1/b+GEM / 3+ME1/b","p"); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry(hh_ratio_gmt, "tight/GMT","p"); - leg->AddEntry(hh_ratio, "tight/medium","p"); + leg->AddEntry(hh_ratio_gmt, "GEM+CSC/GMT","p"); + leg->AddEntry(hh_ratio, "GEM+CSC/CSC tight","p"); leg->Draw("same"); - // hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); - // hh_ratio->SetMinimum(0.01); - // hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); - // hh_ratio->Draw("e1"); - - c->SaveAs(plots + "GMT_3s_3s1b_3s1bgem_loose" + ext); - + c->SaveAs(plots + "rates_vs_pt__PU100__def_3s_3s1b_3s1bgem__loose" + ext); } { - // GMT; CSCTF 3 stubs; CSCTF 3 stubs + ME1/b; CSCTF 3 stubs + ME1/b + GEM -- TIGHT -- Absolute + // GMT; CSCTF 3 stubs; CSCTF 3 stubs + ME1/b; CSCTF 3 stubs + ME1/b + GEM -- TIGHT + GEM -- Absolute pad1->cd(); pad1->SetLogx(1); pad1->SetLogy(1); @@ -567,35 +519,29 @@ void produceRatePlots(TString ext) result_gmtsing__pat8->Draw("same e3"); result_gmtsing__pat8->GetYaxis()->SetRangeUser(0.01, 10000.); result_gmtsing__pat8->GetXaxis()->SetTitle(""); + + TLegend *leg0 = new TLegend(0.15,0.88,.9,0.93,NULL,"brNDC"); + leg0->SetBorderSize(0); + leg0->SetFillStyle(0); + leg0->SetTextSize(0.04); + leg0->SetFillStyle(1001); + leg0->SetFillColor(kWhite); + leg0->AddEntry(result_gmtsing__pat8,"Single muon trigger in 2012 configuration [GMT]","f"); + leg0->Draw(); - TLegend *leg = new TLegend(0.52,0.65,.93,0.93,NULL,"brNDC"); + TLegend *leg = new TLegend(0.45,0.68,.93,0.86,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - // leg->AddEntry((TObject*)0, "Global Muon Trigger [GMT]:",""); - // leg->AddEntry(result_gmtsing__pat8, "default muon selection","f"); - // leg->AddEntry((TObject*)0, "",""); - // leg->AddEntry((TObject*)0, "CSCTF tracks with:",""); - // leg->AddEntry(result_def_3s__pat8, "#geq 3 stubs","f"); - // leg->AddEntry(result_def_3s1b__pat8,"#geq 3 with ME1/b stub","f"); - // leg->AddEntry(result_gem_3s1b__pat8,"#geq 3 with ME1/b stub ","f"); - // leg->AddEntry((TObject*)0, " and GEM pad",""); - leg->AddEntry((TObject*)0, "Single muon trigger in",""); - leg->AddEntry(result_gmtsing__pat8, "2012 configuration [GMT]","f"); - // leg->AddEntry((TObject*)0, "",""); - leg->AddEntry((TObject*)0, "CSC track selection:",""); - leg->AddEntry(result_def_3s__pat8, "#geq 3 stations, loose","f"); - leg->AddEntry(result_def_3s1b__pat8,"#geq 3 stations, medium","f"); - leg->AddEntry(result_gem_3s1b__pat8,"#geq 3 stations, tight","f"); - + leg->AddEntry((TObject*)0, "L1 Selections (#geq3 stations):",""); + leg->AddEntry(result_def_3s__pat8, "CSC, loose","f"); + leg->AddEntry(result_def_3s1b__pat8,"CSC, tight","f"); + leg->AddEntry(result_gem_3s1b__pat8,"GEM+CSC Integrated Trigger","f"); leg->Draw(); - // drawL1Label(0.17,0.35); drawLumiLabel(0.17,.3); - // drawPULabel(0.17,.25); - // drawEtaLabel("1.64","2.14",0.17,.20); pad2->cd(); pad2->SetLogx(1); @@ -612,35 +558,29 @@ void produceRatePlots(TString ext) hh_ratio = setHistoRatio(result_gem_3s1b__pat8, result_def_3s1b__pat8, "", 0.01,1.1,kAzure+1); hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); hh_ratio->Draw("P"); - hh_ratio_gmt = setHistoRatio(result_gem_3s1b__pat8, result_gmtsing__pat8, "", 0.01,1.1,kRed); hh_ratio_gmt->Draw("P same"); - leg = new TLegend(0.15,0.45,.4,0.7,NULL,"brNDC"); + leg = new TLegend(0.15,0.45,.5,0.7,NULL,"brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.1); - // leg->AddEntry(hh_ratio_gmt, "3+ME1/b+GEM / GMT","p"); - // leg->AddEntry(hh_ratio, "3+ME1/b+GEM / 3+ME1/b","p"); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry(hh_ratio_gmt, "tight/GMT","p"); - leg->AddEntry(hh_ratio, "tight/medium","p"); + leg->AddEntry(hh_ratio_gmt, "GEM+CSC/GMT","p"); + leg->AddEntry(hh_ratio, "GEM+CSC/CSC tight","p"); leg->Draw("same"); - c->SaveAs(plots + "GMT_3s_3s1b_3s1bgem_tight" + ext); - + c->SaveAs(plots + "rates_vs_pt__PU100__def_3s_3s1b_3s1bgem__tight" + ext); } // EXTRA PLOTS - { result_def_2s__pat8->SetFillColor(kViolet+2); result_def_2s1b__pat8->SetFillColor(kAzure+2); result_gem_2s1b__pat8->SetFillColor(kGreen-1); - - // GMT; CSCTF 2 stubs; CSCTF 2 stubs + ME1/b; CSCTF 2 stubs + ME1/b + GEM -- LOOSE & TIGHT-- Absolute + ratio + // GMT; CSCTF 2 stubs; CSCTF 2 stubs + ME1/b; CSCTF 2 stubs + ME1/b + GEM -- LOOSE & TIGHT + GEM-- Absolute + ratio TCanvas* c = new TCanvas("c","c",1000,800); c->Clear(); TPad *pad1 = new TPad("pad1","top pad",0.0,0.0,1.0,1.0); @@ -680,25 +620,19 @@ void produceRatePlots(TString ext) leg->AddEntry(result_gem_2s1b__pat8,"#geq 2 with ME1/b stub and GEM pad","f"); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->Draw(); - // drawL1Label(0.17,0.35); drawLumiLabel(0.17,.3); - // drawPULabel(0.17,.25); - // drawEtaLabel("1.64","2.14",0.17,.20); - c->SaveAs(plots + "GMT_2s_2s1b_2s1bgem" + ext); - + c->SaveAs(plots + "rates_vs_pt__PU100__def_2s_2s1b_2s1bgem" + ext); } { result_def_3s__pat8->SetFillColor(kViolet+2); result_def_3s1b__pat8->SetFillColor(kAzure+2); result_gem_3s1b__pat8->SetFillColor(kGreen-1); - - // GMT; CSCTF 3 stubs; CSCTF 3 stubs + ME1/b; CSCTF 3 stubs + ME1/b + GEM -- LOOSE & TIGHT-- Absolute + ratio + // GMT; CSCTF 3 stubs; CSCTF 3 stubs + ME1/b; CSCTF 3 stubs + ME1/b + GEM -- LOOSE & TIGHT + GEM-- Absolute + ratio TCanvas* c = new TCanvas("c","c",1000,800); c->Clear(); TPad *pad1 = new TPad("pad1","top pad",0.0,0.0,1.0,1.0); @@ -738,18 +672,12 @@ void produceRatePlots(TString ext) leg->AddEntry(result_gem_3s1b__pat8,"#geq 3 with ME1/b stub and GEM pad","f"); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->Draw(); - // drawL1Label(0.17,0.35); drawLumiLabel(0.17,.3); - // drawPULabel(0.17,.25); - // drawEtaLabel("1.64","2.14",0.17,.20); - - c->SaveAs(plots + "GMT_3s_3s1b_3s1bgem" + ext); + c->SaveAs(plots + "rates_vs_pt__PU100__def_3s_3s1b_3s1bgem" + ext); } - } void produceRatePlotsForApproval() From 5b59f932566d8b7c855f64fd2aa610f095fa0f44 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Aug 2013 20:08:04 +0200 Subject: [PATCH 058/182] small correction to title --- SimMuL1/scripts/produceRateVsPtPlotsForApproval.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C b/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C index be48d690aeac5..65e73aeef1dd2 100644 --- a/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C +++ b/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C @@ -32,7 +32,7 @@ void produceRatePlots(TString ext) gem_dir = "files/"; gem_label = "gem98"; - TString the_ttl = "CSC L1 trigger rates in 1.64<|#eta|<2.14 region;p_{T}^{cut} [GeV/c];rate [kHz]"; + TString the_ttl = " L1 trigger rates in 1.64<|#eta|<2.14 region, CMS Simulation;p_{T}^{cut} [GeV/c];rate [kHz]"; TString plots = "plots/rate/"; //gStyle->SetStatW(0.13); @@ -680,7 +680,7 @@ void produceRatePlots(TString ext) } } -void produceRatePlotsForApproval() +void produceRateVsPtPlotsForApproval() { gROOT->ProcessLine(".L drawplot_gmtrt.C"); gROOT->ProcessLine(".L getPTHistos.C"); From 4cdd482b30020298431bb50ce13c7a4771ddfe56 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 7 Aug 2013 20:08:54 +0200 Subject: [PATCH 059/182] Adding rate vs eta plots for approval --- .../produceRateVsEtaPlotsForApproval.C | 1122 +++++++++++++++++ 1 file changed, 1122 insertions(+) create mode 100644 SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C diff --git a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C b/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C new file mode 100644 index 0000000000000..1764c31886d6a --- /dev/null +++ b/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C @@ -0,0 +1,1122 @@ +// Design LHC orbit: 2808 filled bickets out of 3564 ---> 0.7879 filled BX fraction + +TString gem_dir = "files/"; +TString gem_label = "gem98"; +char dir[111]="SimMuL1StrictAll"; +int gNPU=100; +int gNEvt=238000; +//int gNEvt=128000; +float gdy[2]={0.1,2500}; + +TLatex* drawLumiLabel2(float x=0.17, float y=0.35) +{ + TLatex * tex = new TLatex(x, y,"L = 4*10^{34} cm^{-2} s^{-1}"); + tex->SetTextSize(0.04); + tex->SetNDC(); + tex->Draw(); + return tex; +} + +TLatex* drawPULabel(float x=0.17, float y=0.15, float font_size=0.) +{ + TLatex * tex = new TLatex(x, y,"L=4*10^{34} (25ns PU100)"); + if (font_size > 0.) tex->SetFontSize(font_size); + tex->SetNDC(); + tex->Draw(); + return tex; +} + +TH1D* setHistoEta(TString f_name, char *name, char *cname, char *title, + Color_t lcolor, int lstyle, int lwidth) +//double *x_range, double *y_range) +{ + cout<<"opening "<GetXaxis()->GetNbins(); + + TH1D* h = (TH1D*)h0->Clone(s_name+cname); + h->SetTitle(title); + + h->Sumw2(); + h->Scale(40000./gNEvt/3.*0.795); + + h->SetLineColor(lcolor); + //h->SetFillColor(lcolor); + h->SetLineStyle(lstyle); + h->SetLineWidth(lwidth); + + h->SetTitle(title); + + //h->GetXaxis()->SetRangeUser(1.2, 2.4); + h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); + + h->GetXaxis()->SetTitleSize(0.055); + h->GetXaxis()->SetTitleOffset(1.05); + h->GetXaxis()->SetLabelSize(0.045); + h->GetXaxis()->SetLabelOffset(0.003); + h->GetXaxis()->SetTitleFont(62); + h->GetXaxis()->SetLabelFont(62); + h->GetXaxis()->SetMoreLogLabels(1); + + h->GetYaxis()->SetTitleSize(0.055); + h->GetYaxis()->SetTitleOffset(0.9); + h->GetYaxis()->SetLabelSize(0.045); + h->GetYaxis()->SetTitleFont(62); + h->GetYaxis()->SetLabelFont(62); + + //h->GetYaxis()->SetLabelOffset(0.015); + + gh = h; + return h; +} + +TObject* getH(char dir[100], char name[100]) +{ + char nm[222]; + sprintf(nm,"%s/%s;1",dir,name); + return f->Get(nm); +} + +TObject* getH(TFile *fi, char dir[100], char name[100]) +{ + char nm[222]; + sprintf(nm,"%s/%s;1",dir,name); + return fi->Get(nm); +} + +void Print(TCanvas *c, char nm[200]) +{ + if (do_not_print) return; + if (strcmp(pdir,"")<=0) return; + gPad->RedrawAxis(); + char dirnm[200]; + sprintf(dirnm,"%s/%s",pdir,nm); + c->Print(dirnm); +} + +TH1D* setHistoRatio(TH1D* num, TH1D* denom, TString title = "", double ymin=0.4, double ymax=1.6, int color = kRed+3) +{ + ratio = (TH1D*) num->Clone(Form("%s--%s_ratio",num->GetName(),denom->GetName()) ); + ratio->Divide(num, denom, 1., 1.); + ratio->SetTitle(title); + + ratio->GetYaxis()->SetRangeUser(ymin, ymax); + ratio->GetYaxis()->SetTitle("ratio: (with GEM)/default"); + ratio->GetYaxis()->SetTitle("ratio"); + // ratio->GetYaxis()->SetTitle("(ME1/b + GEM) / ME1/b"); + ratio->GetYaxis()->SetTitleSize(.14); + // ratio->GetYaxis()->SetTitleSize(.1); + ratio->GetYaxis()->SetTitleOffset(0.4); + ratio->GetYaxis()->SetLabelSize(.11); + + //ratio->GetXaxis()->SetMoreLogLabels(1); + ratio->GetXaxis()->SetTitle("track #eta"); + ratio->GetXaxis()->SetLabelSize(.11); + ratio->GetXaxis()->SetTitleSize(.14); + ratio->GetXaxis()->SetTitleOffset(1.); + + ratio->SetLineWidth(2); + ratio->SetFillColor(color); + ratio->SetLineColor(color); + ratio->SetMarkerColor(color); + ratio->SetMarkerStyle(20); + //ratio->Draw("e3"); + + ratio->SetLineColor(color); + ratio->SetMarkerColor(color); + + + return ratio; +} + + +/* +void gem_rate_draw() +{ + + // //======================== 3+ Stubs ================================// + + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + + maxy = 30.;//10; + // h_rt_tf20_3s->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf20_gpt20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf20_3s->Draw("hist e1"); + // h_rt_tf20_gpt20_3s1b->Draw("hist e1 same"); + // h_rt_tf20_3s->Draw("hist e1 same"); + // h_rt_tf20_3s1b->Draw("hist e1 same"); + + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); + // leg->AddEntry(h_rt_tf20_3s,"anywhere","l"); + // leg->AddEntry(h_rt_tf20_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + // leg->AddEntry(h_rt_tf20_gpt20_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // leg->Draw(); + + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); + + + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1b, h_rt_tf20_3s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); + + + + // // Including the region ME1/1a + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + + // maxy = 30.;//10; + + // h_rt_tf20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf20_gpt20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf20_3s->Draw("hist e1"); + // h_rt_tf20_gpt20_3s1ab->Draw("hist e1 same"); + // h_rt_tf20_3s->Draw("hist e1 same"); + // h_rt_tf20_3s1ab->Draw("hist e1 same"); + + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); + // leg->AddEntry(h_rt_tf20_3s,"anywhere","l"); + // leg->AddEntry(h_rt_tf20_3s1ab,"with ME1 in 1.6<|#eta|","l"); + // leg->AddEntry(h_rt_tf20_gpt20_3s1ab,"with (ME1+GEM) in 1.6<|#eta|","l"); + // leg->Draw(); + + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); + + + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1ab, h_rt_tf20_3s1ab, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); + + + + vs_eta_minpt = "30"; + ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + + + // TH1D* h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); + // TH1D* h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); + // TH1D* h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); + + + TH1D* h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); + + TH1D* h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); + TH1D* h_rt_tf30_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kAzure+2, 1, 2); + TH1D* h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); + TH1D* h_rt_tf30_gpt30_3s1ab = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kGreen, 7, 2); + + + + // // maxy = 120.;//35.; + // // h_rt_tf30_2s->GetYaxis()->SetRangeUser(miny,maxy); + // // h_rt_tf30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + // // h_rt_tf30_gpt30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + + + // TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + // cAll100->SetLogy(1); + // // h_rt_tf30_2s->Draw("hist e1"); + // // h_rt_tf30_gpt30_2s1b->Draw("hist e1 same"); + // // h_rt_tf30_2s->Draw("hist e1 same"); + // // h_rt_tf30_2s1b->Draw("hist e1 same"); + + // // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // // leg->SetBorderSize(0); + // // leg->SetFillStyle(0); + // // leg->AddEntry(h_rt_tf30_2s,"Tracks: p_{T}>=30, 2+ stubs",""); + // // leg->AddEntry(h_rt_tf30_2s,"anywhere","l"); + // // leg->AddEntry(h_rt_tf30_2s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + // // leg->AddEntry(h_rt_tf30_gpt30_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // // leg->Draw(); + + // // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // // tex->SetNDC(); + // // tex->Draw(); + + // // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); + + + // // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // // gPad->SetGridx(1);gPad->SetGridy(1); + + // // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_2s1b, h_rt_tf30_2s1b, "", 0.,1.8); + // // gem_ratio->Draw("e1"); + + // // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b__ratio.png").Data()); + + + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + + // maxy = 30.;//7.; + // h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf30_gpt30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf30_3s->Draw("hist e1"); + // h_rt_tf30_gpt30_3s1b->Draw("hist e1 same"); + // h_rt_tf30_3s->Draw("hist e1 same"); + // h_rt_tf30_3s1b->Draw("hist e1 same"); + + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); + // leg->AddEntry(h_rt_tf30_3s,"anywhere","l"); + // leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + // leg->AddEntry(h_rt_tf30_gpt30_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // leg->Draw(); + + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); + + + + + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1b, h_rt_tf30_3s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); + + + + + + // //========================== Including the ME1a + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + + // h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf30_gpt30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf30_3s->Draw("hist e1"); + // h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same"); + // h_rt_tf30_3s->Draw("hist e1 same"); + // h_rt_tf30_3s1ab->Draw("hist e1 same"); + + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); + // leg->AddEntry(h_rt_tf30_3s,"anywhere","l"); + // leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|","l"); + // leg->AddEntry(h_rt_tf30_gpt30_3s1ab,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // leg->Draw(); + + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); + + // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1ab, h_rt_tf30_3s1ab, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); + + + + // //========================== Comparison with/withous Stub in ME1a ==========================// + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + + // h_rt_tf30_3s1b->Draw("hist e1"); + // h_rt_tf30_3s1ab->Draw("hist e1 same"); + + // TLegend *leg = new TLegend(0.2,0.65,.80,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf30_3s1b,"Tracks: p_{T}>=30, 3+ stubs",""); + // leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + // leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|<2.4","l"); + // leg->Draw(); + + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); + + + // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio2(h_rt_tf30_3s1ab, h_rt_tf30_3s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio_compstubME1a.png").Data()); + + + //========================== Comparison with/withous Stub in ME1a + GEMS ==========================// + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + + h_rt_tf30_gpt30_3s1b->Draw("hist e1"); + h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same"); + + TLegend *leg = new TLegend(0.2,0.65,.80,0.90,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(h_rt_tf30_3s1b,"Tracks: p_{T}>=30, 3+ stubs",""); + leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|<2.4","l"); + leg->Draw(); + + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); + + + + + //#################################### PU100 #################################### + + // full eta 1. - 2.4 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b + if (vs_eta) + { + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + hAll100->Draw("hist e1"); + hAll100gem->Draw("hist e1 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","l"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); + leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-2s1b__gem-3s-2s1b.png").Data()); + + if (do_return) return; + } + + + + // full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b + if (vs_eta) + { + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + hAll100->Draw("hist e1"); + hAll100gem->Draw("hist e1 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","l"); + leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"in ME1/b region also require",""); + leg_cc100->AddEntry(hAll100,"one stub to be from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); + + if (do_return) return; + } + + // full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b + if (vs_eta) + { + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + hAll100->Draw("hist e1"); + hAll100gem->Draw("hist e1 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","l"); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); + leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-2s1b.png").Data()); + + if (do_return) return; + } + + + // full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b + if (vs_eta) + { + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + //gStyle->SetPadTopMargin(0.08); + gStyle->SetTitleH(0.06); + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + hAll100->Draw("hist e1"); + hAll100gem->Draw("hist e1 same"); + TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100->SetBorderSize(0); + //leg_cc100->SetTextSize(0.0368); + leg_cc100->SetFillStyle(0); + leg_cc100->AddEntry(hAll100,"default emulator","l"); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100->AddEntry(hAll100,"in ME1/b region also require",""); + leg_cc100->AddEntry(hAll100,"one stub to be from ME1/b",""); + leg_cc100->Draw(); + + TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex->SetNDC(); + tex->Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-3s1b.png").Data()); + + if (do_return) return; + } + + return; +} +*/ + +void produceRateVsEtaPlotsForApproval() +{ + gStyle->SetOptStat(0); + gStyle->SetTitleStyle(0); + // //gStyle->SetPadTopMargin(0.08); + // gStyle->SetTitleH(0.06); + + // input files + + TString f_def = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; + TString f_g98_pt10 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt10_pat2.root"; + TString f_g98_pt15 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt15_pat2.root"; + TString f_g98_pt20 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt20_pat2.root"; + TString f_g98_pt30 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat2.root"; + TString f_g98_pt40 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat2.root"; + + TString hdir = "SimMuL1StrictAll"; + + // general stuff + + TString ext = ".pdf"; + TString plots = "plots/rate_vs_eta/"; + + // colors - same colors as for rate vs eta plots!! + Color_t col1 = kViolet+1; + Color_t col2 = kAzure+1; + Color_t col3 = kGreen-2; + + // Declaration of histograms + TString vs_eta_minpt = "10"; + TString ttl = " L1 trigger rates versus track #eta CMS Simulation;;rate/bin [kHz]"; + TH1D* h_rt_tf10_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); + TH1D* h_rt_tf10_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); + TH1D* h_rt_tf10_gpt10_2s1b = setHistoEta(f_g98_pt10, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); + TH1D* h_rt_tf10_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2); + TH1D* h_rt_tf10_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2); + TH1D* h_rt_tf10_gpt10_3s1b = setHistoEta(f_g98_pt10, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 7, 2); + + /* + TString vs_eta_minpt = "15"; + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;;rate/bin [kHz]"; + TH1D* h_rt_tf15_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); + TH1D* h_rt_tf15_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); + TH1D* h_rt_tf15_gpt15_2s1b = setHistoEta(f_g98_pt15, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); + TH1D* h_rt_tf15_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2); + TH1D* h_rt_tf15_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2); + TH1D* h_rt_tf15_gpt15_3s1b = setHistoEta(f_g98_pt15, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 1, 2); + */ + + TString vs_eta_minpt = "20"; + TString ttl = " L1 trigger rates versus track #eta CMS Simulation;;rate/bin [kHz]"; + TH1D* h_rt_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); + TH1D* h_rt_tf20_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); + TH1D* h_rt_tf20_gpt20_2s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); + TH1D* h_rt_tf20_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2); + TH1D* h_rt_tf20_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2); + TH1D* h_rt_tf20_gpt20_3s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 1, 2); + + TString vs_eta_minpt = "30"; + TString ttl = " L1 trigger rates versus track #eta CMS Simulation;;rate/bin [kHz]"; + TH1D* h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); + TH1D* h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); + TH1D* h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); + TH1D* h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2); + TH1D* h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2); + TH1D* h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 1, 2); + + /* + TString vs_eta_minpt = "40"; + TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;;rate/bin [kHz]"; + TH1D* h_rt_tf40_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); + TH1D* h_rt_tf40_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); + TH1D* h_rt_tf40_gpt40_2s1b = setHistoEta(f_g98_pt40, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); + TH1D* h_rt_tf40_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2); + TH1D* h_rt_tf40_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2); + TH1D* h_rt_tf40_gpt40_3s1b = setHistoEta(f_g98_pt40, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 1, 2); + */ + + + // Style + gStyle->SetStatW(0.07); + gStyle->SetStatH(0.06); + + gStyle->SetOptStat(0); + + gStyle->SetTitleStyle(0); + gStyle->SetTitleAlign(13);// coord in top left + gStyle->SetTitleX(0.); + gStyle->SetTitleY(1.); + gStyle->SetTitleW(1); + gStyle->SetTitleH(0.058); + gStyle->SetTitleBorderSize(0); + + // producing the histograms + float miny = 0.01, maxy; + + // ------------ +2 stubs, track pt=10GeV ----------------// + vs_eta_minpt = "10"; + + { + TCanvas* c = new TCanvas("c","c",800,800); + c->Clear(); + TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); + pad1->Draw(); + TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); + pad2->Draw(); + + pad1->cd(); + //pad1->SetLogy(1); + pad1->SetGridx(1); + pad1->SetGridy(1); + pad1->SetFrameBorderMode(0); + pad1->SetFillColor(kWhite); + pad1->SetTopMargin(0.06); + pad1->SetBottomMargin(0.13); + + h_rt_tf10_2s->Draw("hist e1"); + h_rt_tf10_2s1b->Draw("hist e1 same"); + h_rt_tf10_gpt10_2s1b->Draw("hist e1 same"); + //h_rt_tf10_2s1b->Draw("hist e1 same"); + // h_rt_tf10_2s->Draw("hist e1 same "); + + h_rt_tf10_2s->SetFillColor(col1); + h_rt_tf10_2s1b->SetFillColor(col2); + h_rt_tf10_gpt10_2s1b->SetFillColor(col3); + + h_rt_tf10_2s->SetFillStyle(3345); + h_rt_tf10_2s1b->SetFillStyle(3354); + h_rt_tf10_gpt10_2s1b->SetFillStyle(3344); + + maxy = 80; + h_rt_tf10_2s->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf10_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf10_gpt10_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + + TLegend *leg = new TLegend(0.17,0.65,.8,0.90,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetTextSize(0.04); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(h_rt_tf10_2s,"L1 Selections (#geq2 stations, track p_{T}#geq10):",""); + leg->AddEntry(h_rt_tf10_2s,"CSC, loose","f"); + leg->AddEntry(h_rt_tf10_2s1b,"CSC, tight","f"); + leg->AddEntry(h_rt_tf10_gpt10_2s1b,"GEM+CSC Integrated Trigger","f"); + leg->Draw(); + + drawLumiLabel2(); + + pad2->cd(); + pad2->SetLogy(1); + pad2->SetGridx(1); + pad2->SetGridy(1); + pad2->SetFillColor(kWhite); + pad2->SetFrameBorderMode(0); + pad2->SetTopMargin(0.06); + pad2->SetBottomMargin(0.3); + + gem_ratio = setHistoRatio(h_rt_tf10_gpt10_2s1b, h_rt_tf10_2s1b, "", 0.01,2.0, col2); + gem_ratio->Draw("Pe"); + + leg = new TLegend(0.16,0.33,.5,0.45,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetTextSize(0.1); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(gem_ratio, "GEM+CSC/CSC tight","P"); + leg->Draw("same"); + + c->SaveAs(plots + "rates_vs_eta__minpt" + vs_eta_minpt + "__PU100__def_2s_2s1b_2s1bgem" + ext); + } + + + // ------------ +2 stubs, track pt=20GeV ----------------// + vs_eta_minpt = "20"; + + { + TCanvas* c = new TCanvas("c","c",800,800); + c->Clear(); + TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); + pad1->Draw(); + TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); + pad2->Draw(); + + pad1->cd(); + //pad1->SetLogy(1); + pad1->SetGridx(1); + pad1->SetGridy(1); + pad1->SetFrameBorderMode(0); + pad1->SetFillColor(kWhite); + pad1->SetTopMargin(0.06); + pad1->SetBottomMargin(0.13); + + h_rt_tf20_2s->Draw("hist e1"); + h_rt_tf20_2s1b->Draw("hist e1 same"); + h_rt_tf20_gpt20_2s1b->Draw("hist e1 same"); + //h_rt_tf20_2s1b->Draw("hist e1 same"); + // h_rt_tf20_2s->Draw("hist e1 same "); + + h_rt_tf20_2s->SetFillColor(col1); + h_rt_tf20_2s1b->SetFillColor(col2); + h_rt_tf20_gpt20_2s1b->SetFillColor(col3); + + h_rt_tf20_2s->SetFillStyle(3345); + h_rt_tf20_2s1b->SetFillStyle(3354); + h_rt_tf20_gpt20_2s1b->SetFillStyle(3344); + + maxy = 35; + h_rt_tf20_2s->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf20_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf20_gpt20_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + + TLegend *leg = new TLegend(0.17,0.65,.8,0.90,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetTextSize(0.04); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(h_rt_tf20_2s,"L1 Selections (#geq2 stations, track p_{T}#geq20):",""); + leg->AddEntry(h_rt_tf20_2s,"CSC, loose","f"); + leg->AddEntry(h_rt_tf20_2s1b,"CSC, tight","f"); + leg->AddEntry(h_rt_tf20_gpt20_2s1b,"GEM+CSC Integrated Trigger","f"); + leg->Draw(); + + drawLumiLabel2(); + + pad2->cd(); + pad2->SetLogy(1); + pad2->SetGridx(1); + pad2->SetGridy(1); + pad2->SetFillColor(kWhite); + pad2->SetFrameBorderMode(0); + pad2->SetTopMargin(0.06); + pad2->SetBottomMargin(0.3); + + gem_ratio = setHistoRatio(h_rt_tf20_gpt20_2s1b, h_rt_tf20_2s1b, "", 0.01,2.0, col2); + gem_ratio->Draw("Pe"); + + leg = new TLegend(0.16,0.33,.5,0.45,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetTextSize(0.1); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(gem_ratio, "GEM+CSC/CSC tight","P"); + leg->Draw("same"); + + c->SaveAs(plots + "rates_vs_eta__minpt" + vs_eta_minpt + "__PU100__def_2s_2s1b_2s1bgem" + ext); + } + + // ------------ +2 stubs, track pt=30GeV ----------------// + vs_eta_minpt = "30"; + + { + TCanvas* c = new TCanvas("c","c",800,800); + c->Clear(); + TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); + pad1->Draw(); + TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); + pad2->Draw(); + + pad1->cd(); + //pad1->SetLogy(1); + pad1->SetGridx(1); + pad1->SetGridy(1); + pad1->SetFrameBorderMode(0); + pad1->SetFillColor(kWhite); + pad1->SetTopMargin(0.06); + pad1->SetBottomMargin(0.13); + + h_rt_tf30_2s->Draw("hist e1"); + h_rt_tf30_2s1b->Draw("hist e1 same"); + h_rt_tf30_gpt30_2s1b->Draw("hist e1 same"); + //h_rt_tf30_2s1b->Draw("hist e1 same"); + // h_rt_tf30_2s->Draw("hist e1 same "); + + h_rt_tf30_2s->SetFillColor(col1); + h_rt_tf30_2s1b->SetFillColor(col2); + h_rt_tf30_gpt30_2s1b->SetFillColor(col3); + + h_rt_tf30_2s->SetFillStyle(3345); + h_rt_tf30_2s1b->SetFillStyle(3354); + h_rt_tf30_gpt30_2s1b->SetFillStyle(3344); + + maxy = 30; + h_rt_tf30_2s->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf30_gpt30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); + + TLegend *leg = new TLegend(0.17,0.65,.8,0.90,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetTextSize(0.04); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(h_rt_tf30_2s,"L1 Selections (#geq2 stations, track p_{T}#geq30):",""); + leg->AddEntry(h_rt_tf30_2s,"CSC, loose","f"); + leg->AddEntry(h_rt_tf30_2s1b,"CSC, tight","f"); + leg->AddEntry(h_rt_tf30_gpt30_2s1b,"GEM+CSC Integrated Trigger","f"); + leg->Draw(); + + drawLumiLabel2(); + + pad2->cd(); + pad2->SetLogy(1); + pad2->SetGridx(1); + pad2->SetGridy(1); + pad2->SetFillColor(kWhite); + pad2->SetFrameBorderMode(0); + pad2->SetTopMargin(0.06); + pad2->SetBottomMargin(0.3); + + gem_ratio = setHistoRatio(h_rt_tf30_gpt30_2s1b, h_rt_tf30_2s1b, "", 0.01,2.0, col2); + gem_ratio->Draw("Pe"); + + leg = new TLegend(0.16,0.33,.5,0.45,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetTextSize(0.1); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(gem_ratio, "GEM+CSC/CSC tight","P"); + leg->Draw("same"); + + c->SaveAs(plots + "rates_vs_eta__minpt" + vs_eta_minpt + "__PU100__def_2s_2s1b_2s1bgem" + ext); + } + + + //// +3 Stub plots + + + + // ------------ +3 stubs, track pt=10GeV ----------------// + vs_eta_minpt = "10"; + + { + TCanvas* c = new TCanvas("c","c",800,800); + c->Clear(); + TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); + pad1->Draw(); + TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); + pad2->Draw(); + + pad1->cd(); + //pad1->SetLogy(1); + pad1->SetGridx(1); + pad1->SetGridy(1); + pad1->SetFrameBorderMode(0); + pad1->SetFillColor(kWhite); + pad1->SetTopMargin(0.06); + pad1->SetBottomMargin(0.13); + + h_rt_tf10_3s->Draw("hist e1"); + h_rt_tf10_3s1b->Draw("hist e1 same"); + h_rt_tf10_gpt10_3s1b->Draw("hist e1 same"); + //h_rt_tf10_3s1b->Draw("hist e1 same"); + // h_rt_tf10_3s->Draw("hist e1 same "); + + h_rt_tf10_3s->SetFillColor(col1); + h_rt_tf10_3s1b->SetFillColor(col2); + h_rt_tf10_gpt10_3s1b->SetFillColor(col3); + + h_rt_tf10_3s->SetFillStyle(3345); + h_rt_tf10_3s1b->SetFillStyle(3354); + h_rt_tf10_gpt10_3s1b->SetFillStyle(3344); + + maxy = 23; + h_rt_tf10_3s->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf10_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf10_gpt10_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + + TLegend *leg = new TLegend(0.17,0.65,.8,0.90,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetTextSize(0.04); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(h_rt_tf10_3s,"L1 Selections (#geq3 stations, track p_{T}#geq10):",""); + leg->AddEntry(h_rt_tf10_3s,"CSC, loose","f"); + leg->AddEntry(h_rt_tf10_3s1b,"CSC, tight","f"); + leg->AddEntry(h_rt_tf10_gpt10_3s1b,"GEM+CSC Integrated Trigger","f"); + leg->Draw(); + + drawLumiLabel2(); + + pad2->cd(); + pad2->SetLogy(1); + pad2->SetGridx(1); + pad2->SetGridy(1); + pad2->SetFillColor(kWhite); + pad2->SetFrameBorderMode(0); + pad2->SetTopMargin(0.06); + pad2->SetBottomMargin(0.3); + + gem_ratio = setHistoRatio(h_rt_tf10_gpt10_3s1b, h_rt_tf10_3s1b, "", 0.01,2.0, col2); + gem_ratio->Draw("Pe"); + + leg = new TLegend(0.16,0.33,.5,0.45,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetTextSize(0.1); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(gem_ratio, "GEM+CSC/CSC tight","P"); + leg->Draw("same"); + + c->SaveAs(plots + "rates_vs_eta__minpt" + vs_eta_minpt + "__PU100__def_3s_3s1b_3s1bgem" + ext); + } + + + // ------------ +3 stubs, track pt=20GeV ----------------// + vs_eta_minpt = "20"; + + { + TCanvas* c = new TCanvas("c","c",800,800); + c->Clear(); + TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); + pad1->Draw(); + TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); + pad2->Draw(); + + pad1->cd(); + //pad1->SetLogy(1); + pad1->SetGridx(1); + pad1->SetGridy(1); + pad1->SetFrameBorderMode(0); + pad1->SetFillColor(kWhite); + pad1->SetTopMargin(0.06); + pad1->SetBottomMargin(0.13); + + h_rt_tf20_3s->Draw("hist e1"); + h_rt_tf20_3s1b->Draw("hist e1 same"); + h_rt_tf20_gpt20_3s1b->Draw("hist e1 same"); + //h_rt_tf20_3s1b->Draw("hist e1 same"); + // h_rt_tf20_3s->Draw("hist e1 same "); + + h_rt_tf20_3s->SetFillColor(col1); + h_rt_tf20_3s1b->SetFillColor(col2); + h_rt_tf20_gpt20_3s1b->SetFillColor(col3); + + h_rt_tf20_3s->SetFillStyle(3345); + h_rt_tf20_3s1b->SetFillStyle(3354); + h_rt_tf20_gpt20_3s1b->SetFillStyle(3344); + + maxy = 10; + h_rt_tf20_3s->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf20_gpt20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + + TLegend *leg = new TLegend(0.17,0.65,.8,0.90,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetTextSize(0.04); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(h_rt_tf20_3s,"L1 Selections (#geq3 stations, track p_{T}#geq20):",""); + leg->AddEntry(h_rt_tf20_3s,"CSC, loose","f"); + leg->AddEntry(h_rt_tf20_3s1b,"CSC, tight","f"); + leg->AddEntry(h_rt_tf20_gpt20_3s1b,"GEM+CSC Integrated Trigger","f"); + leg->Draw(); + + drawLumiLabel2(); + + pad2->cd(); + pad2->SetLogy(1); + pad2->SetGridx(1); + pad2->SetGridy(1); + pad2->SetFillColor(kWhite); + pad2->SetFrameBorderMode(0); + pad2->SetTopMargin(0.06); + pad2->SetBottomMargin(0.3); + + gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1b, h_rt_tf20_3s1b, "", 0.01,2.0, col2); + gem_ratio->Draw("Pe"); + + leg = new TLegend(0.16,0.33,.5,0.45,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetTextSize(0.1); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(gem_ratio, "GEM+CSC/CSC tight","P"); + leg->Draw("same"); + + c->SaveAs(plots + "rates_vs_eta__minpt" + vs_eta_minpt + "__PU100__def_3s_3s1b_3s1bgem" + ext); + } + + // ------------ +3 stubs, track pt=30GeV ----------------// + vs_eta_minpt = "30"; + + { + TCanvas* c = new TCanvas("c","c",800,800); + c->Clear(); + TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); + pad1->Draw(); + TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); + pad2->Draw(); + + pad1->cd(); + //pad1->SetLogy(1); + pad1->SetGridx(1); + pad1->SetGridy(1); + pad1->SetFrameBorderMode(0); + pad1->SetFillColor(kWhite); + pad1->SetTopMargin(0.06); + pad1->SetBottomMargin(0.13); + + h_rt_tf30_3s->Draw("hist e1"); + h_rt_tf30_3s1b->Draw("hist e1 same"); + h_rt_tf30_gpt30_3s1b->Draw("hist e1 same"); + //h_rt_tf30_3s1b->Draw("hist e1 same"); + // h_rt_tf30_3s->Draw("hist e1 same "); + + h_rt_tf30_3s->SetFillColor(col1); + h_rt_tf30_3s1b->SetFillColor(col2); + h_rt_tf30_gpt30_3s1b->SetFillColor(col3); + + h_rt_tf30_3s->SetFillStyle(3345); + h_rt_tf30_3s1b->SetFillStyle(3354); + h_rt_tf30_gpt30_3s1b->SetFillStyle(3344); + + maxy = 6; + h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf30_gpt30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); + + TLegend *leg = new TLegend(0.17,0.65,.8,0.90,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetTextSize(0.04); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(h_rt_tf30_3s,"L1 Selections (#geq3 stations, track p_{T}#geq30):",""); + leg->AddEntry(h_rt_tf30_3s,"CSC, loose","f"); + leg->AddEntry(h_rt_tf30_3s1b,"CSC, tight","f"); + leg->AddEntry(h_rt_tf30_gpt30_3s1b,"GEM+CSC Integrated Trigger","f"); + leg->Draw(); + + drawLumiLabel2(); + + pad2->cd(); + pad2->SetLogy(1); + pad2->SetGridx(1); + pad2->SetGridy(1); + pad2->SetFillColor(kWhite); + pad2->SetFrameBorderMode(0); + pad2->SetTopMargin(0.06); + pad2->SetBottomMargin(0.3); + + gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1b, h_rt_tf30_3s1b, "", 0.01,2.0, col2); + gem_ratio->Draw("Pe"); + + leg = new TLegend(0.16,0.33,.5,0.45,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetTextSize(0.1); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(gem_ratio, "GEM+CSC/CSC tight","P"); + leg->Draw("same"); + + c->SaveAs(plots + "rates_vs_eta__minpt" + vs_eta_minpt + "__PU100__def_3s_3s1b_3s1bgem" + ext); + } + +} From d079af4f33db5cc0227ef766d80db3360ecbeefc Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 8 Aug 2013 01:20:48 +0200 Subject: [PATCH 060/182] update plotter --- SimMuL1/scripts/drawplot_eff.C | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/SimMuL1/scripts/drawplot_eff.C b/SimMuL1/scripts/drawplot_eff.C index ce10e0c424534..b63a45ae18753 100644 --- a/SimMuL1/scripts/drawplot_eff.C +++ b/SimMuL1/scripts/drawplot_eff.C @@ -220,16 +220,24 @@ void eff_hs(TString f_name, TString p_name) TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12"; TTree *t = getTree(f_name); - TH1F* ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1, "", kRed); - TH1F* he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2, "same"); + TH1F* ho = draw_eff(t, "GEM reconstruction efficiency versus LCT half-strip;LCT half-strip number;Efficiency", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1, "", kRed); + TH1F* he = draw_eff(t, "GEM reconstruction efficiency versus LCT half-strip;LCT half-strip number;Efficiency", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2, "same"); - TLegend *leg = new TLegend(0.50,0.23,.9,0.4, NULL, "brNDC"); + TLegend *leg = new TLegend(0.35,0.2,.65,0.4, NULL, "brNDC"); leg->SetBorderSize(0); + leg->SetTextSize(0.06); leg->SetFillStyle(0); + leg->AddEntry((TObject*)0,"1.64<|#eta|<2.12",""); leg->AddEntry(ho,"odd chambers","l"); leg->AddEntry(he,"even chambers","l"); leg->Draw(); + // TLatex * tex = new TLatex(.4,.6,"1.64<|#eta|<2.12"); + // tex->SetTextSize(0.05); + // tex->SetNDC(); + // tex->Draw(); + + gPad->Print(p_name); } @@ -240,8 +248,8 @@ void eff_hs_overlap(TString f_name, TString p_name) TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12"; TTree *t = getTree(f_name); - TH1F* ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1_overlap, "", kRed); - TH1F* he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2_overlap, "same"); + TH1F* ho = draw_eff(t, "GEM reconstruction efficiency versus LCT half-strip;LCT half-strip number;Efficiency", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1_overlap, "", kRed); + TH1F* he = draw_eff(t, "GEM reconstruction efficiency versus LCT half-strip;LCT half-strip number;Efficiency", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2_overlap, "same"); TF1 fo("fo", "pol0", 6., 123.); ho->Fit("fo","RN"); @@ -253,6 +261,7 @@ void eff_hs_overlap(TString f_name, TString p_name) leg->SetFillStyle(0); //leg->AddEntry(ho, Form("odd chambers (%0.2f #pm %0.2f)%%", 100.*fo.GetParameter(0), 100.*fo.GetParError(0)),"l"); //leg->AddEntry(he, Form("even chambers (%0.1f #pm %0.1f)%%", 100.*fe.GetParameter(0), 100.*fe.GetParError(0)),"l"); + leg->AddEntry((TObject*)0,"1.64<|#eta|<2.12",""); leg->AddEntry(ho, "odd chambers","l"); leg->AddEntry(he, "even chambers","l"); leg->Draw(); @@ -370,6 +379,8 @@ void drawplot_eff_eta() void drawplot_eff() { gROOT->ProcessLine(".L effFunctions.C"); + gROOT->ProcessLine(".L tdrstyle.C"); + setTDRStyle(); gf_name = ""; From 5000e1d5781b180c271731b6a86c4d97be67bb4f Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 8 Aug 2013 02:00:05 +0200 Subject: [PATCH 061/182] update plots --- SimMuL1/scripts/drawplot_eff.C | 56 +++- SimMuL1/scripts/drawplot_eff.py | 532 +++++++++++++++++++++--------- SimMuL1/scripts/plotGEMCSCdPhi.py | 4 +- 3 files changed, 409 insertions(+), 183 deletions(-) diff --git a/SimMuL1/scripts/drawplot_eff.C b/SimMuL1/scripts/drawplot_eff.C index b63a45ae18753..2cc258a85408c 100644 --- a/SimMuL1/scripts/drawplot_eff.C +++ b/SimMuL1/scripts/drawplot_eff.C @@ -10,7 +10,7 @@ TString filesDir = "files/"; TString plotDir = "plots/efficiency/"; -TString ext = ".png"; +TString ext = ".pdf"; TCut ok_sh1 = "(has_csc_sh&1) > 0"; TCut ok_sh2 = "(has_csc_sh&2) > 0"; @@ -242,11 +242,12 @@ void eff_hs(TString f_name, TString p_name) } -void eff_hs_overlap(TString f_name, TString p_name) +void eff_hs_overlap(TString f_name, TString p_name, TString pt) { // efficiency vs half-strip - including overlaps in odd&even TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12"; - + + TTree *t = getTree(f_name); TH1F* ho = draw_eff(t, "GEM reconstruction efficiency versus LCT half-strip;LCT half-strip number;Efficiency", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1_overlap, "", kRed); TH1F* he = draw_eff(t, "GEM reconstruction efficiency versus LCT half-strip;LCT half-strip number;Efficiency", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2_overlap, "same"); @@ -256,14 +257,26 @@ void eff_hs_overlap(TString f_name, TString p_name) TF1 fe("fe", "pol0", 6., 123.); he->Fit("fe","RN"); - TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); + // TLatex * tex = new TLatex(.2, .35,"muon p_{T} = " + pt + " GeV/c"); + // tex->SetTextSize(0.05); + // tex->SetNDC(); + // tex->Draw(); + + // TLatex * tex2 = new TLatex(.2, .3,"1.64<|#eta|<2.12"); + // tex2->SetTextSize(0.05); + // tex2->SetNDC(); + // tex2->Draw(); + + TLegend *leg = new TLegend(0.25,0.23,.75,0.5, NULL, "brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); + leg->SetTextSize(0.05); //leg->AddEntry(ho, Form("odd chambers (%0.2f #pm %0.2f)%%", 100.*fo.GetParameter(0), 100.*fo.GetParError(0)),"l"); //leg->AddEntry(he, Form("even chambers (%0.1f #pm %0.1f)%%", 100.*fe.GetParameter(0), 100.*fe.GetParError(0)),"l"); - leg->AddEntry((TObject*)0,"1.64<|#eta|<2.12",""); - leg->AddEntry(ho, "odd chambers","l"); - leg->AddEntry(he, "even chambers","l"); + leg->AddEntry((TObject*)0,"muon p_{T} = " + pt + " GeV/c",""); + leg->AddEntry((TObject*)0,"1.64<|#eta|<2.12",""); + leg->AddEntry(he, "\"Close\" chamber pairs","l"); + leg->AddEntry(ho, "\"Far\" chamber pairs","l"); leg->Draw(); gPad->Print(p_name); @@ -334,8 +347,8 @@ void drawplot_eff_eta() TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); - leg->AddEntry(ho, "odd chambers","l"); - leg->AddEntry(he, "even chambers","l"); + leg->AddEntry(he, "\"Close\" chambers","l"); + leg->AddEntry(ho, "\"Far\" chambers","l"); leg->Draw(); cEff->Print(plotDir + "gem_pad_eff_for_LCT_vsLCTEta_pt40" + ext); @@ -380,7 +393,14 @@ void drawplot_eff() { gROOT->ProcessLine(".L effFunctions.C"); gROOT->ProcessLine(".L tdrstyle.C"); - setTDRStyle(); + //setTDRStyle(); + gStyle->SetTitleStyle(0); + gStyle->SetTitleAlign(13);// coord in top left + gStyle->SetTitleX(0.); + gStyle->SetTitleY(1.); + gStyle->SetTitleW(1); + gStyle->SetTitleH(0.058); + gStyle->SetTitleBorderSize(0); gf_name = ""; @@ -393,16 +413,16 @@ void drawplot_eff() eff_hs(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30" + ext); eff_hs(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40" + ext); - eff_hs_overlap(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt05_overlap" + ext); - eff_hs_overlap(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt10_overlap" + ext); - eff_hs_overlap(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt15_overlap" + ext); - eff_hs_overlap(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt20_overlap" + ext); - eff_hs_overlap(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30_overlap" + ext); - eff_hs_overlap(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40_overlap" + ext); + eff_hs_overlap(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt05_overlap" + ext,"5"); + eff_hs_overlap(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt10_overlap" + ext,"10"); + eff_hs_overlap(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt15_overlap" + ext,"15"); + eff_hs_overlap(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt20_overlap" + ext,"20"); + eff_hs_overlap(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30_overlap" + ext,"30"); + eff_hs_overlap(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40_overlap" + ext,"40"); - //gemTurnOns(); + gemTurnOns(); - drawplot_eff_eta(); + //drawplot_eff_eta(); } diff --git a/SimMuL1/scripts/drawplot_eff.py b/SimMuL1/scripts/drawplot_eff.py index 32e0f653f6ecd..bd7d8828b1b02 100644 --- a/SimMuL1/scripts/drawplot_eff.py +++ b/SimMuL1/scripts/drawplot_eff.py @@ -1,11 +1,11 @@ +## custom modules from effFunctions import * from cuts import * from tdrStyle import * +from GEMCSCdPhiDict import * -from ROOT import TFile,TStyle,TKey,TTree,TH1F,TH2D,TObject,TF1 -from ROOT import TMath,TCanvas,TCut,TEfficiency,TLegend -from ROOT import gStyle,gROOT,gPad,gDirectory -from ROOT import kBlue,kRed +## ROOT modules +from ROOT import * ## run quiet mode import sys @@ -14,6 +14,27 @@ import ROOT ROOT.gROOT.SetBatch(1) +gStyle.SetStatW(0.07) +gStyle.SetStatH(0.06) + +gStyle.SetOptStat(0) + +gStyle.SetTitleStyle(0) +gStyle.SetTitleAlign(13) ##// coord in top left +gStyle.SetTitleX(0.) +gStyle.SetTitleY(1.) +gStyle.SetTitleW(1) +gStyle.SetTitleH(0.058) +gStyle.SetTitleBorderSize(0) + +gStyle.SetPadLeftMargin(0.126) +gStyle.SetPadRightMargin(0.04) +gStyle.SetPadTopMargin(0.06) +gStyle.SetPadBottomMargin(0.13) + +gStyle.SetMarkerStyle(1) + + def getTree(fileName): """Get tree for given filename""" @@ -46,6 +67,8 @@ def eff_halfStrip(f_name,p_name): c = TCanvas("c","c",700,500) c.Clear() + c.SetGridx(1) + c.SetGridy(1) h = TH1F("","Efficiency for track with LCT to have GEM pad in chamber",130,0.5,130.5) h.SetTitle("Efficiency for track with LCT to have GEM pad in chamber") h.GetXaxis().SetTitle("LCT half-strip") @@ -57,10 +80,10 @@ def eff_halfStrip(f_name,p_name): pt = f_name[f_name.find('pt'):] pt = pt[2:] pt = pt[:pt.find('_pad')] - leg = TLegend(0.50,0.23,.9,0.4,"","brNDC") + leg = TLegend(0.40,0.2,.7,0.5,"","brNDC") leg.SetBorderSize(0) leg.SetFillStyle(0) - leg.SetTextSize(.04) + leg.SetTextSize(.05) leg.AddEntry(0, "p_{T} = %s GeV/c"%(pt), "") leg.AddEntry(0, "a pad spans 4 strips", "") leg.AddEntry(ho,"odd chambers","l") @@ -98,10 +121,10 @@ def eff_halfStrip_overlap(f_name, p_name): pt = f_name[f_name.find('pt'):] pt = pt[2:] pt = pt[:pt.find('_pad')] - leg = TLegend(0.50,0.23,.9,0.4,"","brNDC") + leg = TLegend(0.40,0.2,.7,0.5,"","brNDC") leg.SetBorderSize(0) leg.SetFillStyle(0) - leg.SetTextSize(.04) + leg.SetTextSize(.05) leg.AddEntry(0, "p_{T} = %s GeV/c"%(pt), "") leg.AddEntry(0, "a pad spans 4 strips", "") leg.AddEntry(ho,"odd chambers","l") @@ -112,11 +135,9 @@ def eff_halfStrip_overlap(f_name, p_name): c.SaveAs(p_name) -def drawplot_eff_eta(f_name, plotDir): +def drawplot_eff_eta(f_name, plotDir, ext = ".pdf"): """efficiency vs eta""" - ext = ".pdf" - c = TCanvas("c","c",700,500) c.Clear() c.SetGridx(1) @@ -139,10 +160,10 @@ def drawplot_eff_eta(f_name, plotDir): h.Draw() ho.Draw("same") he.Draw("same") - leg = TLegend(0.50,0.23,.9,0.4,"","brNDC") + leg = TLegend(0.4,0.2,.7,0.5,"","brNDC") leg.SetBorderSize(0) leg.SetFillStyle(0) - leg.SetTextSize(.04) + leg.SetTextSize(.05) leg.AddEntry(0, "p_{T} = %s GeV/c"%(pt), "") leg.AddEntry(0, "a pad spans 4 strips", "") leg.AddEntry(ho,"odd chambers","l") @@ -162,10 +183,10 @@ def drawplot_eff_eta(f_name, plotDir): h.Draw() ho.Draw("same") he.Draw("same") - leg = TLegend(0.50,0.23,.9,0.4,"","brNDC") + leg = TLegend(0.40,0.2,.7,0.5,"","brNDC") leg.SetBorderSize(0) leg.SetFillStyle(0) - leg.SetTextSize(.04) + leg.SetTextSize(.05) leg.AddEntry(0, "p_{T} = %s GeV/c"%(pt), "") leg.AddEntry(0, "a pad spans 4 strips", "") leg.AddEntry(ho,"odd chambers","l") @@ -222,14 +243,11 @@ def drawplot_eff_eta(f_name, plotDir): draw_eff(gt, "Efficiency for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Efficiency", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1 && Ep, ok_pad1_overlap, "P", kRed) draw_eff(gt, "Efficiency for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Efficiency", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2 && Ep, ok_pad2_overlap, "P same") """ + -def halfStripEfficiencies(): +def halfStripEfficiencies(filesDir, plotDir, ext): """Plot the halfstrip efficiencies""" - plotDir = "plots/" - filesDir = "files/" - ext = ".pdf" - eff_halfStrip("%sgem_csc_delta_pt5_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt05%s"%(plotDir,ext)) eff_halfStrip("%sgem_csc_delta_pt10_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt10%s"%(plotDir,ext)) eff_halfStrip("%sgem_csc_delta_pt15_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt15%s"%(plotDir,ext)) @@ -237,154 +255,339 @@ def halfStripEfficiencies(): eff_halfStrip("%sgem_csc_delta_pt30_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt30%s"%(plotDir,ext)) eff_halfStrip("%sgem_csc_delta_pt40_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt40%s"%(plotDir,ext)) -## eff_halfStrip_overlap("gem_csc_delta_pt5_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt05_overlap%s"%(plotDir,ext)) -## eff_halfStrip_overlap("gem_csc_delta_pt10_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt10_overlap%s"%(plotDir,ext)) -## eff_halfStrip_overlap("gem_csc_delta_pt15_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt15_overlap%s"%(plotDir,ext)) -## eff_halfStrip_overlap("gem_csc_delta_pt20_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt20_overlap%s"%(plotDir,ext)) -## eff_halfStrip_overlap("gem_csc_delta_pt30_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt30_overlap%s"%(plotDir,ext)) -## eff_halfStrip_overlap("gem_csc_delta_pt40_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt40_overlap%s"%(plotDir,ext)) + eff_halfStrip_overlap("%sgem_csc_delta_pt5_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt05_overlap%s"%(plotDir,ext)) + eff_halfStrip_overlap("%sgem_csc_delta_pt10_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt10_overlap%s"%(plotDir,ext)) + eff_halfStrip_overlap("%sgem_csc_delta_pt15_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt15_overlap%s"%(plotDir,ext)) + eff_halfStrip_overlap("%sgem_csc_delta_pt20_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt20_overlap%s"%(plotDir,ext)) + eff_halfStrip_overlap("%sgem_csc_delta_pt30_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt30_overlap%s"%(plotDir,ext)) + eff_halfStrip_overlap("%sgem_csc_delta_pt40_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt40_overlap%s"%(plotDir,ext)) + -def etaMatchingEfficiencies(): +def etaMatchingEfficiencies(filesDir, plotDir, ext = ".pdf"): """Plot the simtrack to LCT,Pad matching efficiency vs eta""" - drawplot_eff_eta("%sgem_csc_delta_pt5_pad4.root"%(filesDir), plotDir) - drawplot_eff_eta("%sgem_csc_delta_pt10_pad4.root"%(filesDir), plotDir) - drawplot_eff_eta("%sgem_csc_delta_pt15_pad4.root"%(filesDir), plotDir) - drawplot_eff_eta("%sgem_csc_delta_pt20_pad4.root"%(filesDir), plotDir) - drawplot_eff_eta("%sgem_csc_delta_pt30_pad4.root"%(filesDir), plotDir) - drawplot_eff_eta("%sgem_csc_delta_pt40_pad4.root"%(filesDir), plotDir) + drawplot_eff_eta("%sgem_csc_delta_pt5_pad4.root"%(filesDir), plotDir, ext) + drawplot_eff_eta("%sgem_csc_delta_pt10_pad4.root"%(filesDir), plotDir, ext) + drawplot_eff_eta("%sgem_csc_delta_pt15_pad4.root"%(filesDir), plotDir, ext) + drawplot_eff_eta("%sgem_csc_delta_pt20_pad4.root"%(filesDir), plotDir, ext) + drawplot_eff_eta("%sgem_csc_delta_pt30_pad4.root"%(filesDir), plotDir, ext) + drawplot_eff_eta("%sgem_csc_delta_pt40_pad4.root"%(filesDir), plotDir, ext) + + +def getDphi(eff,pt,evenOdd): + """Return the delta Phi cut value""" + + return dphi_lct_pad["%s"%(eff)]["%s"%(pt)]["%s"%(evenOdd)] + + +def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): + """Produce GEM turn-on curve""" + + pt = ["pt10","pt20","pt30","pt40"] + pt_labels = ["#geq 10","#geq 20","#geq 30","#geq 40"] + + marker_colors = [kRed, kViolet+1, kAzure+1, kGreen-2] + marker_styles = [20,21,23,24] + + t = getTree("%sgem_csc_eff_pt2pt50_pad4.root"%(filesDir)); + + c = TCanvas("c","c",800,600) + c.SetGridx(1) + c.SetGridy(1) + c.cd() + + + h = TH1F("","High efficiency GEM-CSC bending angle patterns;muon p_{T} [GeV/c];Efficiency",50,0.,50.) + h.SetStats(0) + h.Draw("") + + histoList = [] + for i in range(len(pt)): + dphi = getDphi("%s"%(eff),"%s"%(pt[i]),"%s"%(oddEven)) + if oddEven=="even": + ok_dphi = TCut("TMath::Abs(dphi_pad_even) < %f"%(dphi)) + denom_cut = ok_pad2_lct2_eta + closeFar = "close" + else: + ok_dphi = TCut("TMath::Abs(dphi_pad_odd) < %f"%(dphi)) + denom_cut = ok_pad1_lct1_eta + closeFar = "far" + + h2 = draw_eff(t, "GEM-CSC bending angle patterns for different p_{T} thresholds;p_{T} [GeV/c];Efficiency", "h2", "(50,0.,50.)", "pt", + denom_cut, ok_dphi, marker_colors[i], marker_styles[i]) + ## Eff. for track with LCT to have matched GEM pad + histoList.append(h2) + h2.SetMarkerSize(1) + h2.Draw("same") + + + ## add legend + ## leg_header = " #Delta#phi(GEM,CSC) is %s%% efficient for"%(eff) + ## leg.AddEntry(0, "%s chambers at pt"%(oddEven), "") + leg = TLegend(0.5,0.2,.8,0.65, "", "brNDC") + leg_header = " " + leg.AddEntry(0, 'muon p_{T} measured by "%s"'%(closeFar), "") + leg.AddEntry(0, "GEM-CSC chamber pairs", "") + for n in range(len(pt)): + leg.AddEntry(histoList[n], pt_labels[n], "p") + leg.SetBorderSize(0) + leg.SetFillStyle(0) +## leg.SetFillStyle(1001) +## leg.SetFillColor(kWhite) + leg.SetHeader(leg_header) + leg.SetTextSize(0.04) + leg.Draw("same") + + ## save the file + c.SaveAs("%sGEM_turnon_%s_%s%s"%(plotDir, eff,oddEven,ext)) + -def gemTurnOns(): +def gemTurnOns(filesDir, plotDir, ext): """Produce the GEM turn-on curves""" + gemTurnOn(filesDir, plotDir, "95", "even", ext) + gemTurnOn(filesDir, plotDir, "95", "odd", ext) + gemTurnOn(filesDir, plotDir, "98", "even", ext) + gemTurnOn(filesDir, plotDir, "98", "odd", ext) + gemTurnOn(filesDir, plotDir, "99", "even", ext) + gemTurnOn(filesDir, plotDir, "99", "odd", ext) + +##double mymod(double x, double y) {return fmod(x,y);} + + +def eff_hs_1(filesDir, plotDir, f_name, ext): + """Halfstrip matching efficiency dphi""" -# N= 5 -# -## int pt_lbl[N] = {DPHI_PT10, DPHI_PT15, DPHI_PT20, DPHI_PT30, DPHI_PT40}; -## TString pt[N] = {"pt10","pt15","pt20","pt30","pt40"}; -## int marker_styles[5] = {24, 28, 22 , 21, 20}; - -## TCanvas* gEff = new TCanvas("gEff","gEff",700,500); -## gEff.SetGridx(1); gEff.SetGridy(1); -## TCanvas* gEff_odd = new TCanvas("gEff_odd","gEff_odd",700,500); -## gEff_odd.SetGridx(1); gEff_odd.SetGridy(1); -## TCanvas* gEff_even = new TCanvas("gEff_even","gEff_even",700,500); -## gEff_even.SetGridx(1); gEff_even.SetGridy(1); - -## TTree *t = getTree("gem_csc_eff_pt2pt50_pad4.root"); -## TH1F *ho[N], *he[N]; -## for (int n=0; n0) opt = "same p"; -## setDPhi(n, label_eff); -## gEff.cd(); -## ho[n] = draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", Form("h_odd%d",n), "(50,0.,50.)", "pt", ok_lct1 && ok_eta && ok_pad1, ok_dphi1, opt, kRed, marker_styles[n]); -## he[n] = draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", Form("h_evn%d",n), "(50,0.,50.)", "pt", ok_lct2 && ok_eta && ok_pad2, ok_dphi2, "same p", kBlue, marker_styles[n]); -## gEff_odd.cd(); -## ho[n].Draw(opt); -## gEff_even.cd(); -## he[n].Draw(opt); -## } - -## TString pts[N] = {"10","15","20","30","40"}; -## TString efs[5] = {"95", "98", "99"}; -## TString leg_header = " #Delta#phi(LCT,GEM) is " + efs[label_eff] + "% efficient for"; - -## gEff.cd(); -## TLegend *leg = new TLegend(0.50,0.17,.99,0.57, NULL, "brNDC"); -## leg.SetNColumns(2); -## leg.SetBorderSize(0); -## leg.SetFillStyle(0); -## leg.SetHeader(leg_header); -## leg.AddEntry(ho[0], "odd chambers", ""); -## leg.AddEntry(he[0], "even chambers", ""); -## leg.AddEntry(ho[0], "at pt", ""); -## leg.AddEntry(he[0], "at pt", ""); -## for (int n=0; n Date: Sun, 11 Aug 2013 00:21:59 +0200 Subject: [PATCH 062/182] update plots --- SimMuL1/scripts/drawplot_eff.C | 103 +++++++++++------- SimMuL1/scripts/drawplot_eff.py | 55 ++++++++-- SimMuL1/scripts/plotGEMCSCdPhi.py | 33 +++++- .../produceRateVsEtaPlotsForApproval.C | 75 +++++++------ .../scripts/produceRateVsPtPlotsForApproval.C | 94 +++++++++------- 5 files changed, 232 insertions(+), 128 deletions(-) diff --git a/SimMuL1/scripts/drawplot_eff.C b/SimMuL1/scripts/drawplot_eff.C index 2cc258a85408c..ee0e96279bb0d 100644 --- a/SimMuL1/scripts/drawplot_eff.C +++ b/SimMuL1/scripts/drawplot_eff.C @@ -214,29 +214,57 @@ void eff_hs_dphi(TString f_name, TString p_name) } -void eff_hs(TString f_name, TString p_name) +void eff_hs(TString f_name, TString p_name, TString pt) { + + gStyle->SetTitleStyle(0); + gStyle->SetTitleAlign(13); // coord in top left + gStyle->SetTitleX(0.); + gStyle->SetTitleY(1.); + gStyle->SetTitleW(1); + gStyle->SetTitleH(0.058); + gStyle->SetTitleBorderSize(0); + + gStyle->SetPadLeftMargin(0.126); + gStyle->SetPadRightMargin(0.04); + gStyle->SetPadTopMargin(0.06); + gStyle->SetPadBottomMargin(0.13); + gStyle->SetOptStat(0); + gStyle->SetMarkerStyle(1); + // efficiency vs half-strip - separate odd-even TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12"; TTree *t = getTree(f_name); - TH1F* ho = draw_eff(t, "GEM reconstruction efficiency versus LCT half-strip;LCT half-strip number;Efficiency", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1, "", kRed); - TH1F* he = draw_eff(t, "GEM reconstruction efficiency versus LCT half-strip;LCT half-strip number;Efficiency", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2, "same"); + TH1F* ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;LCT half-strip number;Efficiency", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1, "", kRed); + TH1F* he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;LCT half-strip number;Efficiency", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2, "same"); - TLegend *leg = new TLegend(0.35,0.2,.65,0.4, NULL, "brNDC"); + TLegend *leg = new TLegend(0.25,0.23,.75,0.5, NULL, "brNDC"); leg->SetBorderSize(0); - leg->SetTextSize(0.06); leg->SetFillStyle(0); - leg->AddEntry((TObject*)0,"1.64<|#eta|<2.12",""); - leg->AddEntry(ho,"odd chambers","l"); - leg->AddEntry(he,"even chambers","l"); + leg->SetTextSize(0.06); + leg->AddEntry((TObject*)0,"muon p_{T} = " + pt + " GeV/c",""); + leg->AddEntry(he, "\"Close\" chamber pairs","l"); + leg->AddEntry(ho, "\"Far\" chamber pairs","l"); leg->Draw(); - - // TLatex * tex = new TLatex(.4,.6,"1.64<|#eta|<2.12"); - // tex->SetTextSize(0.05); - // tex->SetNDC(); - // tex->Draw(); - + // TLegend *leg = new TLegend(0.35,0.2,.65,0.4, NULL, "brNDC"); + // leg->SetBorderSize(0); + // leg->SetTextSize(0.06); + // leg->SetFillStyle(0); + // leg->AddEntry((TObject*)0,"muon p_{T} = " + pt + " GeV/c",""); + // leg->AddEntry(ho,"odd chambers","l"); + // leg->AddEntry(he,"even chambers","l"); + // leg->Draw(); + + TLatex* tex2 = new TLatex(.67,.8," L1 Trigger"); + tex2->SetTextSize(0.05); + tex2->SetNDC(); + tex2->Draw(); + + TLatex * tex = new TLatex(.66,.73,"1.64<|#eta|<2.12"); + tex->SetTextSize(0.05); + tex->SetNDC(); + tex->Draw(); gPad->Print(p_name); } @@ -249,36 +277,34 @@ void eff_hs_overlap(TString f_name, TString p_name, TString pt) TTree *t = getTree(f_name); - TH1F* ho = draw_eff(t, "GEM reconstruction efficiency versus LCT half-strip;LCT half-strip number;Efficiency", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1_overlap, "", kRed); - TH1F* he = draw_eff(t, "GEM reconstruction efficiency versus LCT half-strip;LCT half-strip number;Efficiency", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2_overlap, "same"); + TH1F* ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;LCT half-strip number;Efficiency", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1_overlap, "", kRed); + TH1F* he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;LCT half-strip number;Efficiency", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2_overlap, "same"); TF1 fo("fo", "pol0", 6., 123.); ho->Fit("fo","RN"); TF1 fe("fe", "pol0", 6., 123.); he->Fit("fe","RN"); - // TLatex * tex = new TLatex(.2, .35,"muon p_{T} = " + pt + " GeV/c"); - // tex->SetTextSize(0.05); - // tex->SetNDC(); - // tex->Draw(); - - // TLatex * tex2 = new TLatex(.2, .3,"1.64<|#eta|<2.12"); - // tex2->SetTextSize(0.05); - // tex2->SetNDC(); - // tex2->Draw(); - TLegend *leg = new TLegend(0.25,0.23,.75,0.5, NULL, "brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); - leg->SetTextSize(0.05); - //leg->AddEntry(ho, Form("odd chambers (%0.2f #pm %0.2f)%%", 100.*fo.GetParameter(0), 100.*fo.GetParError(0)),"l"); - //leg->AddEntry(he, Form("even chambers (%0.1f #pm %0.1f)%%", 100.*fe.GetParameter(0), 100.*fe.GetParError(0)),"l"); + leg->SetTextSize(0.06); leg->AddEntry((TObject*)0,"muon p_{T} = " + pt + " GeV/c",""); - leg->AddEntry((TObject*)0,"1.64<|#eta|<2.12",""); leg->AddEntry(he, "\"Close\" chamber pairs","l"); leg->AddEntry(ho, "\"Far\" chamber pairs","l"); leg->Draw(); + // Print additional information + TLatex* tex2 = new TLatex(.67,.8," L1 Trigger"); + tex2->SetTextSize(0.05); + tex2->SetNDC(); + tex2->Draw(); + + TLatex * tex = new TLatex(.66,.73,"1.64<|#eta|<2.12"); + tex->SetTextSize(0.05); + tex->SetNDC(); + tex->Draw(); + gPad->Print(p_name); } @@ -394,6 +420,7 @@ void drawplot_eff() gROOT->ProcessLine(".L effFunctions.C"); gROOT->ProcessLine(".L tdrstyle.C"); //setTDRStyle(); + gStyle->SetTitleStyle(0); gStyle->SetTitleAlign(13);// coord in top left gStyle->SetTitleX(0.); @@ -401,17 +428,17 @@ void drawplot_eff() gStyle->SetTitleW(1); gStyle->SetTitleH(0.058); gStyle->SetTitleBorderSize(0); - + gf_name = ""; TCanvas* cEff = new TCanvas("cEff","cEff",700,500); - eff_hs(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt05" + ext); - eff_hs(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt10" + ext); - eff_hs(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt15" + ext); - eff_hs(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt20" + ext); - eff_hs(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30" + ext); - eff_hs(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40" + ext); + eff_hs(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt05" + ext,"5"); + eff_hs(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt10" + ext,"10"); + eff_hs(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt15" + ext,"15"); + eff_hs(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt20" + ext,"20"); + eff_hs(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30" + ext,"30"); + eff_hs(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40" + ext,"40"); eff_hs_overlap(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt05_overlap" + ext,"5"); eff_hs_overlap(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt10_overlap" + ext,"10"); @@ -420,7 +447,7 @@ void drawplot_eff() eff_hs_overlap(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30_overlap" + ext,"30"); eff_hs_overlap(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40_overlap" + ext,"40"); - gemTurnOns(); + //gemTurnOns(); //drawplot_eff_eta(); diff --git a/SimMuL1/scripts/drawplot_eff.py b/SimMuL1/scripts/drawplot_eff.py index bd7d8828b1b02..52fe0638302a8 100644 --- a/SimMuL1/scripts/drawplot_eff.py +++ b/SimMuL1/scripts/drawplot_eff.py @@ -283,8 +283,9 @@ def getDphi(eff,pt,evenOdd): def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): """Produce GEM turn-on curve""" - pt = ["pt10","pt20","pt30","pt40"] - pt_labels = ["#geq 10","#geq 20","#geq 30","#geq 40"] + pt = ["pt10","pt20","pt30","pt40"] + pt_labels = ["10 GeV/c","20 GeV/c","30 GeV/c","40 GeV/c"] + dphis = [0.,0.,0.,0.] marker_colors = [kRed, kViolet+1, kAzure+1, kGreen-2] marker_styles = [20,21,23,24] @@ -297,23 +298,24 @@ def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): c.cd() - h = TH1F("","High efficiency GEM-CSC bending angle patterns;muon p_{T} [GeV/c];Efficiency",50,0.,50.) + h = TH1F(""," GEM-CSC bending Angle: p_{T} measurement, CMS Simulation;p_{T} [GeV/c];Efficiency",50,0.,50.) h.SetStats(0) h.Draw("") histoList = [] for i in range(len(pt)): dphi = getDphi("%s"%(eff),"%s"%(pt[i]),"%s"%(oddEven)) + dphis[i] = dphi if oddEven=="even": ok_dphi = TCut("TMath::Abs(dphi_pad_even) < %f"%(dphi)) denom_cut = ok_pad2_lct2_eta - closeFar = "close" + closeFar = "Close" else: ok_dphi = TCut("TMath::Abs(dphi_pad_odd) < %f"%(dphi)) denom_cut = ok_pad1_lct1_eta - closeFar = "far" + closeFar = "Far" - h2 = draw_eff(t, "GEM-CSC bending angle patterns for different p_{T} thresholds;p_{T} [GeV/c];Efficiency", "h2", "(50,0.,50.)", "pt", + h2 = draw_eff(t, "GEM-CSC bending angle: momentum measurement;p_{T} [GeV/c];Efficiency", "h2", "(50,0.,50.)", "pt", denom_cut, ok_dphi, marker_colors[i], marker_styles[i]) ## Eff. for track with LCT to have matched GEM pad histoList.append(h2) @@ -324,32 +326,59 @@ def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): ## add legend ## leg_header = " #Delta#phi(GEM,CSC) is %s%% efficient for"%(eff) ## leg.AddEntry(0, "%s chambers at pt"%(oddEven), "") - leg = TLegend(0.5,0.2,.8,0.65, "", "brNDC") + leg = TLegend(0.37,0.15,.82,0.5, "", "brNDC") leg_header = " " - leg.AddEntry(0, 'muon p_{T} measured by "%s"'%(closeFar), "") - leg.AddEntry(0, "GEM-CSC chamber pairs", "") + leg.AddEntry(0, 'High efficiency patterns:', "") for n in range(len(pt)): - leg.AddEntry(histoList[n], pt_labels[n], "p") + leg.AddEntry(histoList[n], "#Delta#Phi(GEM-CSC)#geq%.4f (p_{T}>%s)"%(dphis[n],pt_labels[n]), "p") leg.SetBorderSize(0) leg.SetFillStyle(0) -## leg.SetFillStyle(1001) -## leg.SetFillColor(kWhite) + ## leg.SetFillStyle(1001) + ## leg.SetFillColor(kWhite) leg.SetHeader(leg_header) leg.SetTextSize(0.04) leg.Draw("same") + ## Adding additional information - top right + tex2 = TLatex(.75,.82,' L1 Trigger') + tex2.SetTextSize(0.05) + tex2.SetNDC() + tex2.Draw("same") + + tex3 = TLatex(.735,.75,'1.64<|#eta|<2.14') + tex3.SetTextSize(0.05) + tex3.SetNDC() + tex3.Draw("same") + + ## hardcore nitpicking over here! + if closeFar == "Close": + xpos = 0.57 + else: + xpos = 0.62 + + tex = TLatex(xpos,.68,'"%s" chamber pairs'%(closeFar)) + tex.Draw("same") + tex.SetTextSize(0.05) + tex.SetNDC() + + ## save the file c.SaveAs("%sGEM_turnon_%s_%s%s"%(plotDir, eff,oddEven,ext)) def gemTurnOns(filesDir, plotDir, ext): """Produce the GEM turn-on curves""" + + """ gemTurnOn(filesDir, plotDir, "95", "even", ext) gemTurnOn(filesDir, plotDir, "95", "odd", ext) + """ gemTurnOn(filesDir, plotDir, "98", "even", ext) gemTurnOn(filesDir, plotDir, "98", "odd", ext) + """ gemTurnOn(filesDir, plotDir, "99", "even", ext) gemTurnOn(filesDir, plotDir, "99", "odd", ext) + """ ##double mymod(double x, double y) {return fmod(x,y);} @@ -1000,9 +1029,11 @@ def eff_hs(filesDir, plotDir, ext): etaMatchingEfficiencies("files/", "plots/efficiency/", ".eps") etaMatchingEfficiencies("files/", "plots/efficiency/", ".png") """ + gemTurnOns("files/", "plots/efficiency/", ".pdf") gemTurnOns("files/", "plots/efficiency/", ".eps") gemTurnOns("files/", "plots/efficiency/", ".png") + """ eff_hs("files/", "plots/efficiency/", ".pdf") eff_hs("files/", "plots/efficiency/", ".eps") diff --git a/SimMuL1/scripts/plotGEMCSCdPhi.py b/SimMuL1/scripts/plotGEMCSCdPhi.py index aca1d820e4ab9..0d0a251a5f6a8 100644 --- a/SimMuL1/scripts/plotGEMCSCdPhi.py +++ b/SimMuL1/scripts/plotGEMCSCdPhi.py @@ -40,7 +40,7 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): dphi_pt5 = TH1F("dphi_pt5","",600,0.0,0.03); dphi_pt20 = TH1F("dphi_pt20","",600,0.0,0.03); - c = TCanvas("cDphi","cDphi",700,450); + c = TCanvas("c","c",700,450); c.Clear() c.SetGridx(1) c.SetGridy(1) @@ -84,22 +84,45 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): dphi_pt20.GetXaxis().SetTitle("#Delta#Phi(GEM,CSC) [rad]"); dphi_pt20.GetYaxis().SetTitle("A.U."); - dphi_pt20.SetTitle(" GEM-CSC Bending Angle CMS Simulation"); + dphi_pt20.SetTitle(" GEM-CSC Bending Angle CMS Simulation"); dphi_pt20.Draw(); dphi_pt5.Draw("same"); - legend = TLegend(.4,.45,.7,.7); + legend = TLegend(.4,.45,.7,.6); legend.SetFillColor(kWhite); legend.SetFillStyle(0); legend.SetBorderSize(0); legend.SetTextSize(0.06); legend.SetMargin(0.13); - legend.AddEntry(0,"1.64<|#eta|<2.14:",""); + ## legend.AddEntry(0,"1.64<|#eta|<2.14:",""); legend.AddEntry(dphi_pt5,"muon p_{T} = 5 GeV/c","L"); legend.AddEntry(dphi_pt20,"muon p_{T} = 20 GeV/c","L"); legend.Draw("same"); + ## Adding additional information - top right + tex2 = TLatex(.75,.87,' L1 Trigger') + tex2.SetTextSize(0.05) + tex2.SetNDC() + tex2.Draw("same") + + tex3 = TLatex(.74,.80,'1.64<|#eta|<2.14') + tex3.SetTextSize(0.05) + tex3.SetNDC() + tex3.Draw("same") + + ## hardcore nitpicking over here! + if closeFar == "Close": + xpos = 0.61 + else: + xpos = 0.64 + + tex = TLatex(xpos,.74,'"%s" chamber pairs'%(closeFar)) + tex.Draw("same") + tex.SetTextSize(0.05) + tex.SetNDC() + + """ tex = TLatex(.55,.85,'"%s" chamber pairs'%(closeFar)) tex.SetTextSize(0.06) tex.SetNDC() @@ -109,7 +132,7 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): tex2.SetTextSize(0.06) tex2.SetNDC() tex2.Draw("same") - + """ c.SaveAs("%sGEMCSCdPhi_%s_chambers%s"%(plotDir, oddEven, ext)) if __name__ == "__main__": diff --git a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C b/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C index 1764c31886d6a..f4915d97c10a2 100644 --- a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C +++ b/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C @@ -8,10 +8,10 @@ int gNEvt=238000; //int gNEvt=128000; float gdy[2]={0.1,2500}; -TLatex* drawLumiLabel2(float x=0.17, float y=0.35) +TLatex* drawLumiLabel2(float x=0.2, float y=0.35) { TLatex * tex = new TLatex(x, y,"L = 4*10^{34} cm^{-2} s^{-1}"); - tex->SetTextSize(0.04); + tex->SetTextSize(0.05); tex->SetNDC(); tex->Draw(); return tex; @@ -113,7 +113,7 @@ TH1D* setHistoRatio(TH1D* num, TH1D* denom, TString title = "", double ymin=0.4, ratio->GetYaxis()->SetLabelSize(.11); //ratio->GetXaxis()->SetMoreLogLabels(1); - ratio->GetXaxis()->SetTitle("track #eta"); + // ratio->GetXaxis()->SetTitle("track #eta"); ratio->GetXaxis()->SetLabelSize(.11); ratio->GetXaxis()->SetTitleSize(.14); ratio->GetXaxis()->SetTitleOffset(1.); @@ -591,12 +591,12 @@ void produceRateVsEtaPlotsForApproval() // colors - same colors as for rate vs eta plots!! Color_t col1 = kViolet+1; - Color_t col2 = kAzure+1; + Color_t col2 = kAzure+2; Color_t col3 = kGreen-2; // Declaration of histograms TString vs_eta_minpt = "10"; - TString ttl = " L1 trigger rates versus track #eta CMS Simulation;;rate/bin [kHz]"; + TString ttl = " L1 Single Muon Trigger CMS Simulation;L1 muon candidate #eta;rate/bin [kHz]"; TH1D* h_rt_tf10_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); TH1D* h_rt_tf10_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); TH1D* h_rt_tf10_gpt10_2s1b = setHistoEta(f_g98_pt10, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); @@ -606,7 +606,6 @@ void produceRateVsEtaPlotsForApproval() /* TString vs_eta_minpt = "15"; - TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;;rate/bin [kHz]"; TH1D* h_rt_tf15_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); TH1D* h_rt_tf15_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); TH1D* h_rt_tf15_gpt15_2s1b = setHistoEta(f_g98_pt15, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); @@ -616,7 +615,6 @@ void produceRateVsEtaPlotsForApproval() */ TString vs_eta_minpt = "20"; - TString ttl = " L1 trigger rates versus track #eta CMS Simulation;;rate/bin [kHz]"; TH1D* h_rt_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); TH1D* h_rt_tf20_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); TH1D* h_rt_tf20_gpt20_2s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); @@ -625,7 +623,6 @@ void produceRateVsEtaPlotsForApproval() TH1D* h_rt_tf20_gpt20_3s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 1, 2); TString vs_eta_minpt = "30"; - TString ttl = " L1 trigger rates versus track #eta CMS Simulation;;rate/bin [kHz]"; TH1D* h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); TH1D* h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); TH1D* h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); @@ -635,7 +632,6 @@ void produceRateVsEtaPlotsForApproval() /* TString vs_eta_minpt = "40"; - TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;;rate/bin [kHz]"; TH1D* h_rt_tf40_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); TH1D* h_rt_tf40_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); TH1D* h_rt_tf40_gpt40_2s1b = setHistoEta(f_g98_pt40, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); @@ -662,7 +658,7 @@ void produceRateVsEtaPlotsForApproval() // producing the histograms float miny = 0.01, maxy; - // ------------ +2 stubs, track pt=10GeV ----------------// + // ------------ +2 stubs, L1 candidate muon pt=10GeV ----------------// vs_eta_minpt = "10"; { @@ -701,12 +697,14 @@ void produceRateVsEtaPlotsForApproval() h_rt_tf10_2s1b->GetYaxis()->SetRangeUser(miny,maxy); h_rt_tf10_gpt10_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - TLegend *leg = new TLegend(0.17,0.65,.8,0.90,NULL,"brNDC"); + TLegend *leg = new TLegend(0.16,0.67,.8,0.87,"L1 Selections (#geq2 stations, L1 candidate p_{T}#geq20 GeV/c):","brNDC"); leg->SetBorderSize(0); + leg->SetMargin(0.2); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry(h_rt_tf10_2s,"L1 Selections (#geq2 stations, track p_{T}#geq10):",""); + leg->AddEntry(h_rt_tf10_2s,"L1 Selections:",""); + // leg->AddEntry((TObject*)0,"(#geq2 stations, L1 candidate muon p_{T}#geq10 GeV/c)",""); leg->AddEntry(h_rt_tf10_2s,"CSC, loose","f"); leg->AddEntry(h_rt_tf10_2s1b,"CSC, tight","f"); leg->AddEntry(h_rt_tf10_gpt10_2s1b,"GEM+CSC Integrated Trigger","f"); @@ -726,7 +724,8 @@ void produceRateVsEtaPlotsForApproval() gem_ratio = setHistoRatio(h_rt_tf10_gpt10_2s1b, h_rt_tf10_2s1b, "", 0.01,2.0, col2); gem_ratio->Draw("Pe"); - leg = new TLegend(0.16,0.33,.5,0.45,NULL,"brNDC"); + leg = new TLegend(0.2,0.33,.5,0.45,NULL,"brNDC"); + leg->SetMargin(0.1); leg->SetBorderSize(0); leg->SetTextSize(0.1); leg->SetFillStyle(1001); @@ -738,7 +737,7 @@ void produceRateVsEtaPlotsForApproval() } - // ------------ +2 stubs, track pt=20GeV ----------------// + // ------------ +2 stubs, L1 candidate muon pt=20GeV ----------------// vs_eta_minpt = "20"; { @@ -772,17 +771,20 @@ void produceRateVsEtaPlotsForApproval() h_rt_tf20_2s1b->SetFillStyle(3354); h_rt_tf20_gpt20_2s1b->SetFillStyle(3344); - maxy = 35; + maxy = 40; h_rt_tf20_2s->GetYaxis()->SetRangeUser(miny,maxy); h_rt_tf20_2s1b->GetYaxis()->SetRangeUser(miny,maxy); h_rt_tf20_gpt20_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - TLegend *leg = new TLegend(0.17,0.65,.8,0.90,NULL,"brNDC"); + TLegend *leg = new TLegend(0.16,0.67,.8,0.87,"L1 Selections (#geq2 stations, L1 candidate p_{T}#geq20 GeV/c):","brNDC"); + leg->SetMargin(0.2); leg->SetBorderSize(0); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry(h_rt_tf20_2s,"L1 Selections (#geq2 stations, track p_{T}#geq20):",""); + // leg->AddEntry(h_rt_tf20_2s,"L1 Selections:",""); + // leg->AddEntry((TObject*)0,"()",""); + // leg->AddEntry((TObject*)0,"()",""); leg->AddEntry(h_rt_tf20_2s,"CSC, loose","f"); leg->AddEntry(h_rt_tf20_2s1b,"CSC, tight","f"); leg->AddEntry(h_rt_tf20_gpt20_2s1b,"GEM+CSC Integrated Trigger","f"); @@ -802,7 +804,8 @@ void produceRateVsEtaPlotsForApproval() gem_ratio = setHistoRatio(h_rt_tf20_gpt20_2s1b, h_rt_tf20_2s1b, "", 0.01,2.0, col2); gem_ratio->Draw("Pe"); - leg = new TLegend(0.16,0.33,.5,0.45,NULL,"brNDC"); + leg = new TLegend(0.16,0.4,.5,0.55,NULL,"brNDC"); + leg->SetMargin(0.1); leg->SetBorderSize(0); leg->SetTextSize(0.1); leg->SetFillStyle(1001); @@ -813,7 +816,7 @@ void produceRateVsEtaPlotsForApproval() c->SaveAs(plots + "rates_vs_eta__minpt" + vs_eta_minpt + "__PU100__def_2s_2s1b_2s1bgem" + ext); } - // ------------ +2 stubs, track pt=30GeV ----------------// + // ------------ +2 stubs, L1 candidate muon pt=30GeV ----------------// vs_eta_minpt = "30"; { @@ -852,12 +855,12 @@ void produceRateVsEtaPlotsForApproval() h_rt_tf30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); h_rt_tf30_gpt30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - TLegend *leg = new TLegend(0.17,0.65,.8,0.90,NULL,"brNDC"); + TLegend *leg = new TLegend(0.16,0.67,.8,0.87,"L1 Selections (#geq2 stations, L1 candidate p_{T}#geq20 GeV/c):","brNDC"); + leg->SetMargin(0.2); leg->SetBorderSize(0); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry(h_rt_tf30_2s,"L1 Selections (#geq2 stations, track p_{T}#geq30):",""); leg->AddEntry(h_rt_tf30_2s,"CSC, loose","f"); leg->AddEntry(h_rt_tf30_2s1b,"CSC, tight","f"); leg->AddEntry(h_rt_tf30_gpt30_2s1b,"GEM+CSC Integrated Trigger","f"); @@ -877,7 +880,8 @@ void produceRateVsEtaPlotsForApproval() gem_ratio = setHistoRatio(h_rt_tf30_gpt30_2s1b, h_rt_tf30_2s1b, "", 0.01,2.0, col2); gem_ratio->Draw("Pe"); - leg = new TLegend(0.16,0.33,.5,0.45,NULL,"brNDC"); + leg = new TLegend(0.16,0.4,.5,0.55,NULL,"brNDC"); + leg->SetMargin(0.1); leg->SetBorderSize(0); leg->SetTextSize(0.1); leg->SetFillStyle(1001); @@ -893,7 +897,7 @@ void produceRateVsEtaPlotsForApproval() - // ------------ +3 stubs, track pt=10GeV ----------------// + // ------------ +3 stubs, L1 candidate muon pt=10GeV ----------------// vs_eta_minpt = "10"; { @@ -932,12 +936,12 @@ void produceRateVsEtaPlotsForApproval() h_rt_tf10_3s1b->GetYaxis()->SetRangeUser(miny,maxy); h_rt_tf10_gpt10_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - TLegend *leg = new TLegend(0.17,0.65,.8,0.90,NULL,"brNDC"); + TLegend *leg = new TLegend(0.16,0.67,.8,0.87,"L1 Selections (#geq2 stations, L1 candidate p_{T}#geq20 GeV/c):","brNDC"); + leg->SetMargin(0.2); leg->SetBorderSize(0); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry(h_rt_tf10_3s,"L1 Selections (#geq3 stations, track p_{T}#geq10):",""); leg->AddEntry(h_rt_tf10_3s,"CSC, loose","f"); leg->AddEntry(h_rt_tf10_3s1b,"CSC, tight","f"); leg->AddEntry(h_rt_tf10_gpt10_3s1b,"GEM+CSC Integrated Trigger","f"); @@ -957,7 +961,8 @@ void produceRateVsEtaPlotsForApproval() gem_ratio = setHistoRatio(h_rt_tf10_gpt10_3s1b, h_rt_tf10_3s1b, "", 0.01,2.0, col2); gem_ratio->Draw("Pe"); - leg = new TLegend(0.16,0.33,.5,0.45,NULL,"brNDC"); + leg = new TLegend(0.16,0.4,.5,0.55,NULL,"brNDC"); + leg->SetMargin(0.1); leg->SetBorderSize(0); leg->SetTextSize(0.1); leg->SetFillStyle(1001); @@ -969,7 +974,7 @@ void produceRateVsEtaPlotsForApproval() } - // ------------ +3 stubs, track pt=20GeV ----------------// + // ------------ +3 stubs, L1 candidate muon pt=20GeV ----------------// vs_eta_minpt = "20"; { @@ -1008,12 +1013,12 @@ void produceRateVsEtaPlotsForApproval() h_rt_tf20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); h_rt_tf20_gpt20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - TLegend *leg = new TLegend(0.17,0.65,.8,0.90,NULL,"brNDC"); + TLegend *leg = new TLegend(0.16,0.67,.8,0.87,"L1 Selections (#geq2 stations, L1 candidate p_{T}#geq20 GeV/c):","brNDC"); + leg->SetMargin(0.20); leg->SetBorderSize(0); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry(h_rt_tf20_3s,"L1 Selections (#geq3 stations, track p_{T}#geq20):",""); leg->AddEntry(h_rt_tf20_3s,"CSC, loose","f"); leg->AddEntry(h_rt_tf20_3s1b,"CSC, tight","f"); leg->AddEntry(h_rt_tf20_gpt20_3s1b,"GEM+CSC Integrated Trigger","f"); @@ -1033,7 +1038,8 @@ void produceRateVsEtaPlotsForApproval() gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1b, h_rt_tf20_3s1b, "", 0.01,2.0, col2); gem_ratio->Draw("Pe"); - leg = new TLegend(0.16,0.33,.5,0.45,NULL,"brNDC"); + leg = new TLegend(0.16,0.4,.5,0.55,NULL,"brNDC"); + leg->SetMargin(0.1); leg->SetBorderSize(0); leg->SetTextSize(0.1); leg->SetFillStyle(1001); @@ -1044,7 +1050,7 @@ void produceRateVsEtaPlotsForApproval() c->SaveAs(plots + "rates_vs_eta__minpt" + vs_eta_minpt + "__PU100__def_3s_3s1b_3s1bgem" + ext); } - // ------------ +3 stubs, track pt=30GeV ----------------// + // ------------ +3 stubs, L1 candidate muon pt=30GeV ----------------// vs_eta_minpt = "30"; { @@ -1083,12 +1089,12 @@ void produceRateVsEtaPlotsForApproval() h_rt_tf30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); h_rt_tf30_gpt30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - TLegend *leg = new TLegend(0.17,0.65,.8,0.90,NULL,"brNDC"); + TLegend *leg = new TLegend(0.16,0.67,.8,0.87,"L1 Selections (#geq2 stations, L1 candidate p_{T}#geq20 GeV/c):","brNDC"); + leg->SetMargin(0.2); leg->SetBorderSize(0); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry(h_rt_tf30_3s,"L1 Selections (#geq3 stations, track p_{T}#geq30):",""); leg->AddEntry(h_rt_tf30_3s,"CSC, loose","f"); leg->AddEntry(h_rt_tf30_3s1b,"CSC, tight","f"); leg->AddEntry(h_rt_tf30_gpt30_3s1b,"GEM+CSC Integrated Trigger","f"); @@ -1108,7 +1114,8 @@ void produceRateVsEtaPlotsForApproval() gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1b, h_rt_tf30_3s1b, "", 0.01,2.0, col2); gem_ratio->Draw("Pe"); - leg = new TLegend(0.16,0.33,.5,0.45,NULL,"brNDC"); + leg = new TLegend(0.16,0.4,.5,0.55,NULL,"brNDC"); + leg->SetMargin(0.1); leg->SetBorderSize(0); leg->SetTextSize(0.1); leg->SetFillStyle(1001); diff --git a/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C b/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C index 65e73aeef1dd2..9d8862ce12e5a 100644 --- a/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C +++ b/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C @@ -3,7 +3,7 @@ TLatex* drawEtaLabel(TString minEta, TString maxEta, float x=0.17, float y=0.35, TString label(minEta + " < |#eta| < " + maxEta); TLatex * tex = new TLatex(x, y,label); if (font_size > 0.) tex->SetFontSize(font_size); - tex->SetTextSize(0.04); + tex->SetTextSize(0.05); tex->SetNDC(); tex->Draw(); return tex; @@ -12,7 +12,7 @@ TLatex* drawEtaLabel(TString minEta, TString maxEta, float x=0.17, float y=0.35, TLatex* drawLumiLabel(float x=0.17, float y=0.35) { TLatex * tex = new TLatex(x, y,"L = 4*10^{34} cm^{-2} s^{-1}"); - tex->SetTextSize(0.04); + tex->SetTextSize(0.05); tex->SetNDC(); tex->Draw(); return tex; @@ -32,14 +32,13 @@ void produceRatePlots(TString ext) gem_dir = "files/"; gem_label = "gem98"; - TString the_ttl = " L1 trigger rates in 1.64<|#eta|<2.14 region, CMS Simulation;p_{T}^{cut} [GeV/c];rate [kHz]"; + TString the_ttl = " L1 Single Muon Trigger CMS Simulation;L1 candidate muon p_{T}^{cut} [GeV/c];rate [kHz]"; TString plots = "plots/rate/"; //gStyle->SetStatW(0.13); //gStyle->SetStatH(0.08); gStyle->SetStatW(0.07); gStyle->SetStatH(0.06); - gStyle->SetOptStat(0); gStyle->SetTitleStyle(0); @@ -263,24 +262,29 @@ void produceRatePlots(TString ext) // PLOTS FOR APPROVAL // //////////////////////// { - result_gmtsing__pat2->SetFillColor(kRed); - result_gmtsing__pat8->SetFillColor(kRed); + Color_t col0 = kRed; + Color_t col1 = kViolet+1; + Color_t col2 = kAzure+2; + Color_t col3 = kGreen-2; - result_def_2s__pat2->SetFillColor(kViolet+1); - result_def_2s1b__pat2->SetFillColor(kAzure+1); - result_gem_2s1b__pat2->SetFillColor(kGreen-2); + result_gmtsing__pat2->SetFillColor(col0); + result_gmtsing__pat8->SetFillColor(col0); - result_def_3s__pat2->SetFillColor(kViolet+1); - result_def_3s1b__pat2->SetFillColor(kAzure+1); - result_gem_3s1b__pat2->SetFillColor(kGreen-2); + result_def_2s__pat2->SetFillColor(col1); + result_def_2s1b__pat2->SetFillColor(col2); + result_gem_2s1b__pat2->SetFillColor(col3); - result_def_2s__pat8->SetFillColor(kViolet+1); - result_def_2s1b__pat8->SetFillColor(kAzure+1); - result_gem_2s1b__pat8->SetFillColor(kGreen-2); + result_def_3s__pat2->SetFillColor(col1); + result_def_3s1b__pat2->SetFillColor(col2); + result_gem_3s1b__pat2->SetFillColor(col3); - result_def_3s__pat8->SetFillColor(kViolet+1); - result_def_3s1b__pat8->SetFillColor(kAzure+1); - result_gem_3s1b__pat8->SetFillColor(kGreen-2); + result_def_2s__pat8->SetFillColor(col1); + result_def_2s1b__pat8->SetFillColor(col2); + result_gem_2s1b__pat8->SetFillColor(col3); + + result_def_3s__pat8->SetFillColor(col1); + result_def_3s1b__pat8->SetFillColor(col2); + result_gem_3s1b__pat8->SetFillColor(col3); // GMT; CSCTF 2 stubs; CSCTF 2 stubs + ME1/b; CSCTF 2 stubs + ME1/b + GEM -- LOOSE -- Absolute + ratio TCanvas* c = new TCanvas("c","c",800,800); @@ -306,29 +310,32 @@ void produceRatePlots(TString ext) result_gmtsing__pat2->GetYaxis()->SetRangeUser(0.1, 10000.); result_gmtsing__pat2->GetXaxis()->SetTitle(""); - TLegend *leg0 = new TLegend(0.15,0.88,.9,0.93,NULL,"brNDC"); + TLegend *leg0 = new TLegend(0.365,0.88,.93,0.93,NULL,"brNDC"); leg0->SetBorderSize(0); + leg0->SetMargin(0.235); leg0->SetFillStyle(0); leg0->SetTextSize(0.04); leg0->SetFillStyle(1001); leg0->SetFillColor(kWhite); - leg0->AddEntry(result_gmtsing__pat2,"Single muon trigger in 2012 configuration [GMT]","f"); + leg0->AddEntry(result_gmtsing__pat2,"Standard Configuration (GMT 2012)","f"); leg0->Draw(); - TLegend *leg = new TLegend(0.45,0.68,.93,0.86,NULL,"brNDC"); + TLegend *leg = new TLegend(0.45,0.68,.93,0.86,"L1 Selections (#geq 2 stations):","brNDC"); + leg->SetMargin(0.25); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry((TObject*)0, "L1 Selections (#geq2 stations):",""); + // leg->AddEntry((TObject*)0, "L1 Selections (#geq 2 stations):",""); leg->AddEntry(result_def_2s__pat2, "CSC, loose","f"); leg->AddEntry(result_def_2s1b__pat2,"CSC, tight","f"); leg->AddEntry(result_gem_2s1b__pat2,"GEM+CSC Integrated Trigger","f"); leg->Draw(); drawLumiLabel(0.17,.3); - + drawEtaLabel("1.64","2.14",0.17,.37); + pad2->cd(); pad2->SetLogx(1); pad2->SetLogy(1); @@ -341,15 +348,16 @@ void produceRatePlots(TString ext) pad2->SetTopMargin(0.06); pad2->SetBottomMargin(0.4); - hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.01,1.1,kAzure+1); + hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.01,1.1,col2); - hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); + hh_ratio->GetXaxis()->SetTitle("L1 muon candidate p_{T}^{cut} [GeV/c]"); hh_ratio->Draw("P"); - hh_ratio_gmt = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.01,1.1,kRed); + hh_ratio_gmt = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.01,1.1,col0); hh_ratio_gmt->Draw("P same"); - leg = new TLegend(0.15,0.45,.5,0.7,NULL,"brNDC"); + leg = new TLegend(0.15,0.45,.45,0.7,NULL,"brNDC"); + leg->SetMargin(0.1); leg->SetBorderSize(0); leg->SetTextSize(0.1); leg->SetFillStyle(1001); @@ -387,19 +395,20 @@ void produceRatePlots(TString ext) leg0->AddEntry(result_gmtsing__pat8,"Single muon trigger in 2012 configuration [GMT]","f"); leg0->Draw(); - TLegend *leg = new TLegend(0.45,0.68,.93,0.86,NULL,"brNDC"); + TLegend *leg = new TLegend(0.45,0.68,.93,0.86,"L1 Selections (#geq 2 stations):","brNDC"); + leg->SetMargin(0.25); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry((TObject*)0, "L1 Selections (#geq2 stations):",""); leg->AddEntry(result_def_2s__pat8, "CSC, loose","f"); leg->AddEntry(result_def_2s1b__pat8,"CSC, tight","f"); leg->AddEntry(result_gem_2s1b__pat8,"GEM+CSC Integrated Trigger","f"); leg->Draw(); drawLumiLabel(0.17,.3); + drawEtaLabel("1.64","2.14",0.17,.37); pad2->cd(); pad2->SetLogx(1); @@ -413,13 +422,14 @@ void produceRatePlots(TString ext) pad2->SetTopMargin(0.06); pad2->SetBottomMargin(0.4); - hh_ratio = setHistoRatio(result_gem_2s1b__pat8, result_def_2s1b__pat8, "", 0.01,1.1,kAzure+1); + hh_ratio = setHistoRatio(result_gem_2s1b__pat8, result_def_2s1b__pat8, "", 0.01,1.1,col2); hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); hh_ratio->Draw("P"); - hh_ratio_gmt = setHistoRatio(result_gem_2s1b__pat8, result_gmtsing__pat8, "", 0.01,1.1,kRed); + hh_ratio_gmt = setHistoRatio(result_gem_2s1b__pat8, result_gmtsing__pat8, "", 0.01,1.1,col0); hh_ratio_gmt->Draw("P same"); leg = new TLegend(0.15,0.45,.5,0.7,NULL,"brNDC"); + leg->SetMargin(0.1); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.1); @@ -458,19 +468,20 @@ void produceRatePlots(TString ext) leg0->AddEntry(result_gmtsing__pat2,"Single muon trigger in 2012 configuration [GMT]","f"); leg0->Draw(); - TLegend *leg = new TLegend(0.45,0.68,.93,0.86,NULL,"brNDC"); + TLegend *leg = new TLegend(0.45,0.68,.93,0.86,"L1 Selections (#geq 3 stations):","brNDC"); + leg->SetMargin(0.25); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry((TObject*)0, "L1 Selections (#geq3 stations):",""); leg->AddEntry(result_def_3s__pat2, "CSC, loose","f"); leg->AddEntry(result_def_3s1b__pat2,"CSC, tight","f"); leg->AddEntry(result_gem_3s1b__pat2,"GEM+CSC Integrated Trigger","f"); leg->Draw(); drawLumiLabel(0.17,.3); + drawEtaLabel("1.64","2.14",0.17,.37); pad2->cd(); pad2->SetLogx(1); @@ -484,13 +495,14 @@ void produceRatePlots(TString ext) pad2->SetTopMargin(0.06); pad2->SetBottomMargin(0.4); - hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.01,1.1,kAzure+1); + hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.01,1.1,col2); hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); hh_ratio->Draw("P"); - hh_ratio_gmt = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.01,1.1,kRed); + hh_ratio_gmt = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.01,1.1,col0); hh_ratio_gmt->Draw("P same"); leg = new TLegend(0.15,0.45,.5,0.7,NULL,"brNDC"); + leg->SetMargin(0.1); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.1); @@ -529,19 +541,20 @@ void produceRatePlots(TString ext) leg0->AddEntry(result_gmtsing__pat8,"Single muon trigger in 2012 configuration [GMT]","f"); leg0->Draw(); - TLegend *leg = new TLegend(0.45,0.68,.93,0.86,NULL,"brNDC"); + TLegend *leg = new TLegend(0.45,0.68,.93,0.86,"L1 Selections (#geq 3 stations):","brNDC"); + leg->SetMargin(0.25); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry((TObject*)0, "L1 Selections (#geq3 stations):",""); leg->AddEntry(result_def_3s__pat8, "CSC, loose","f"); leg->AddEntry(result_def_3s1b__pat8,"CSC, tight","f"); leg->AddEntry(result_gem_3s1b__pat8,"GEM+CSC Integrated Trigger","f"); leg->Draw(); drawLumiLabel(0.17,.3); + drawEtaLabel("1.64","2.14",0.17,.37); pad2->cd(); pad2->SetLogx(1); @@ -555,13 +568,14 @@ void produceRatePlots(TString ext) pad2->SetTopMargin(0.06); pad2->SetBottomMargin(0.4); - hh_ratio = setHistoRatio(result_gem_3s1b__pat8, result_def_3s1b__pat8, "", 0.01,1.1,kAzure+1); + hh_ratio = setHistoRatio(result_gem_3s1b__pat8, result_def_3s1b__pat8, "", 0.01,1.1,col2); hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); hh_ratio->Draw("P"); - hh_ratio_gmt = setHistoRatio(result_gem_3s1b__pat8, result_gmtsing__pat8, "", 0.01,1.1,kRed); + hh_ratio_gmt = setHistoRatio(result_gem_3s1b__pat8, result_gmtsing__pat8, "", 0.01,1.1,col0); hh_ratio_gmt->Draw("P same"); leg = new TLegend(0.15,0.45,.5,0.7,NULL,"brNDC"); + leg->SetMargin(0.1); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.1); @@ -623,6 +637,7 @@ void produceRatePlots(TString ext) leg->Draw(); drawLumiLabel(0.17,.3); + drawEtaLabel("1.64","2.14"); c->SaveAs(plots + "rates_vs_pt__PU100__def_2s_2s1b_2s1bgem" + ext); } @@ -675,6 +690,7 @@ void produceRatePlots(TString ext) leg->Draw(); drawLumiLabel(0.17,.3); + drawEtaLabel("1.64","2.14"); c->SaveAs(plots + "rates_vs_pt__PU100__def_3s_3s1b_3s1bgem" + ext); } From 84fae58549850d1fbe10c6cc184f0777977c89b6 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sun, 11 Aug 2013 15:19:32 +0200 Subject: [PATCH 063/182] Update README.md --- README.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 22c0cd9f37c27..a9e8d780065c8 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,23 @@ -GEMCode -======= +#GEMCode -Introduction ------------- +## Table of contents + +* [Introduction](#Introduction) +* [Documentation](#Documentation) +* [Instructions to get the code](#Instructions-to-get-the-code) + *[General GitHub setup](#General-GitHub-setup) + *[CMSSW environment setup](#CMSSW-environment-setup) + *[Get the official CMSSW code](#Get-the-official-CMSSW-code) + *[Checking out and merging the latest GEM developments](#Checking-out-and-merging-the-latest-GEM-developments) + *[Adding submodules](#Adding-submodules) + +##Introduction This is the repository for code development of GEM the validation analyzer and the GEM-CSC integrated local trigger analyzer.

This README.md file can is encoded in MarkDown, see
http://daringfireball.net/projects/markdown/syntax -Documentation -------------- +##Documentation * Home page of validation page
https://twiki.cern.ch/twiki/bin/view/MPGD/GemSimulationsInstructionsCMSSW
@@ -28,8 +36,7 @@ http://cms-project-gem-validation.web.cern.ch/cms-project-gem-validation/
https://twiki.cern.ch/twiki/bin/view/MPGD/GEMTriggerRoadMap -Instructions to get the code ----------------------------- +##Instructions to get the code ###General GitHub setup From 8216e2d02c8667f994173bebd0f067ca7ce1723e Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sun, 11 Aug 2013 15:21:21 +0200 Subject: [PATCH 064/182] Update README.md --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a9e8d780065c8..4accdbd5aee4b 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,14 @@ ## Table of contents -* [Introduction](#Introduction) -* [Documentation](#Documentation) -* [Instructions to get the code](#Instructions-to-get-the-code) - *[General GitHub setup](#General-GitHub-setup) - *[CMSSW environment setup](#CMSSW-environment-setup) - *[Get the official CMSSW code](#Get-the-official-CMSSW-code) - *[Checking out and merging the latest GEM developments](#Checking-out-and-merging-the-latest-GEM-developments) - *[Adding submodules](#Adding-submodules) +* [Introduction](#introduction) +* [Documentation](#documentation) +* [Instructions to get the code](#instructions-to-get-the-code) + * [General GitHub setup](#general-github-setup) + * [CMSSW environment setup](#cmssw-environment-setup) + * [Get the official CMSSW code](#get-the-official-cmssw-code) + * [Checking out and merging the latest GEM developments](#Checking-out-and-merging-the-latest-gem-developments) + * [Adding submodules](#adding-submodules) ##Introduction From f30baff93bf9b061433fd7ce8c13495c2127dc47 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sun, 11 Aug 2013 17:43:40 +0200 Subject: [PATCH 065/182] port to latest CMSSW SLHC instructions --- GEMValidation/test/runGEMDigiAnalyzer_cfg.py | 48 ++++++++----------- .../test/runGEMSimHitAnalyzer_cfg.py | 48 +++++++------------ 2 files changed, 35 insertions(+), 61 deletions(-) diff --git a/GEMValidation/test/runGEMDigiAnalyzer_cfg.py b/GEMValidation/test/runGEMDigiAnalyzer_cfg.py index 61fbf04fe9b61..6439267dc8389 100644 --- a/GEMValidation/test/runGEMDigiAnalyzer_cfg.py +++ b/GEMValidation/test/runGEMDigiAnalyzer_cfg.py @@ -1,19 +1,22 @@ import FWCore.ParameterSet.Config as cms -process = cms.Process("GEMANA") +process = cms.Process("GEMDIGIANA") +## Standard sequence +process.load('Configuration.StandardSequences.Services_cff') process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.Geometry.GeometryExtended2019Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2019_cff') +process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +## TrackingComponentsRecord required for matchers +process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorOpposite_cfi') +process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAlong_cfi') -#process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMXML_cfi') -process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMr08v01XML_cfi') -#process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMr10v01XML_cfi') -process.load('Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi') -process.load('Geometry.CommonDetUnit.globalTrackingGeometry_cfi') -process.load('Geometry.MuonNumbering.muonNumberingInitialization_cfi') -process.load('Geometry.GEMGeometry.gemGeometry_cfi') -process.load('Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometryDB_cff') -process.load('Geometry.DTGeometryBuilder.idealForDigiDtGeometryDB_cff') -process.load('Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff') +## global tag for 2019 upgrade studies +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgrade2019', '') # the analyzer configuration process.load('GEMCode.GEMValidation.GEMDigiAnalyzer_cfi') @@ -23,30 +26,17 @@ process.GEMDigiAnalyzer.simTrackMatching.cscALCTInput = "" process.GEMDigiAnalyzer.simTrackMatching.cscLCTInput = "" -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.GlobalTag.globaltag = 'POSTLS161_V12::All' - process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) -process.TFileService = cms.Service("TFileService", - fileName = cms.string("gem_digi_ana.root") +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring("file:out_digi.root") ) -#dir_pt40 = '/pnfs/cms/WAX/11/store/user/lpcgem/yasser1/yasser/muonGun_50k_pT40_lpcgem/MuomGunPt40L1CSC50k_digi/82325e40d6202e6fec2dd983c477f3ca/' -#inputDir = dir_pt40 - -import os - -#ls = os.listdir(inputDir) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - #[inputDir[16:] + x for x in ls if x.endswith('root')] - 'file:out_digi.root' - ) +process.TFileService = cms.Service("TFileService", + fileName = cms.string("gem_digi_ana.root") ) -process.p = cms.Path(process.GEMDigiAnalyzer) +process.p = cms.Path(process.GEMDigiAnalyzer) diff --git a/GEMValidation/test/runGEMSimHitAnalyzer_cfg.py b/GEMValidation/test/runGEMSimHitAnalyzer_cfg.py index b679eb6dfdf70..64605a9fd999d 100644 --- a/GEMValidation/test/runGEMSimHitAnalyzer_cfg.py +++ b/GEMValidation/test/runGEMSimHitAnalyzer_cfg.py @@ -1,21 +1,23 @@ import FWCore.ParameterSet.Config as cms -process = cms.Process("Demo") - -process.load("FWCore.MessageService.MessageLogger_cfi") - -process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMXML_cfi') -#process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMr08v01XML_cfi') -#process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMr10v01XML_cfi') -process.load('Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi') -process.load('Geometry.CommonDetUnit.globalTrackingGeometry_cfi') -process.load('Geometry.MuonNumbering.muonNumberingInitialization_cfi') -process.load('Geometry.GEMGeometry.gemGeometry_cfi') +process = cms.Process("GEMSIMANA") + +## Standard sequence +process.load('Configuration.StandardSequences.Services_cff') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.Geometry.GeometryExtended2019Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2019_cff') +process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.load('Configuration.StandardSequences.MagneticField_cff') +## TrackingComponentsRecord required for matchers process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorOpposite_cfi') process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAlong_cfi') +## global tag for 2019 upgrade studies +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgrade2019', '') + # the analyzer configuration process.load('GEMCode.GEMValidation.GEMSimHitAnalyzer_cfi') process.GEMSimHitAnalyzer.simTrackMatching.gemDigiInput = "" @@ -27,34 +29,16 @@ process.GEMSimHitAnalyzer.simTrackMatching.cscALCTInput = "" process.GEMSimHitAnalyzer.simTrackMatching.cscLCTInput = "" -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.GlobalTag.globaltag = 'POSTLS161_V12::All' process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) ) process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) -## ff = open('filelist_minbias_61M.txt', "r") -## pu_files = ff.read().split('\n') -## ff.close() -## pu_files = filter(lambda x: x.endswith('.root'), pu_files) - -dir_pt40 = '/pnfs/cms/WAX/11/store/user/lpcgem/willhf/willhf/muonGun_50k_pT40_lpcgem/muonGun_50k_pT40_lpcgem/c25a99a3a5d3061319c1beac698b55b1/' - -inputDir = dir_pt40 - -import os - -ls = os.listdir(inputDir) - process.source = cms.Source("PoolSource", -## fileNames = cms.untracked.vstring(*pu_files) - fileNames = cms.untracked.vstring( - [inputDir[16:] + x for x in ls if x.endswith('root')] - ) + fileNames = cms.untracked.vstring("file:out_sim.root") ) process.TFileService = cms.Service("TFileService", - fileName = cms.string("gem_sh_ana.test.root") + fileName = cms.string("gem_sh_ana.root") ) process.p = cms.Path(process.GEMSimHitAnalyzer) From e934df663c9323f9a82023065b8915b8e0d34f90 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sun, 11 Aug 2013 17:51:02 +0200 Subject: [PATCH 066/182] bugfix discarding electrons in the matching --- GEMValidation/src/SimHitMatcher.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GEMValidation/src/SimHitMatcher.cc b/GEMValidation/src/SimHitMatcher.cc index 01f835fe36a51..ec15c3ad1aeb3 100644 --- a/GEMValidation/src/SimHitMatcher.cc +++ b/GEMValidation/src/SimHitMatcher.cc @@ -176,7 +176,7 @@ SimHitMatcher::matchSimHitsToSimTrack(std::vector track_ids, if (h.trackId() != track_id) continue; int pdgid = h.particleType(); if (simMuOnlyCSC_ && std::abs(pdgid) != 13) continue; - if (discardEleHitsCSC_ && pdgid == 11) continue; + if (discardEleHitsCSC_ && std::abs(pdgid == 11)) continue; csc_detid_to_hits_[ h.detUnitId() ].push_back(h); csc_hits_.push_back(h); @@ -188,7 +188,7 @@ SimHitMatcher::matchSimHitsToSimTrack(std::vector track_ids, if (h.trackId() != track_id) continue; int pdgid = h.particleType(); if (simMuOnlyGEM_ && std::abs(pdgid) != 13) continue; - if (discardEleHitsGEM_ && pdgid == 11) continue; + if (discardEleHitsGEM_ && std::abs(pdgid == 11)) continue; gem_detid_to_hits_[ h.detUnitId() ].push_back(h); gem_hits_.push_back(h); From aad15698fb36dcb5b8d304730cd2e9cc6904a4e0 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sun, 11 Aug 2013 20:31:41 +0200 Subject: [PATCH 067/182] Adding helper functions --- SimMuL1/interface/Helpers.h | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 SimMuL1/interface/Helpers.h diff --git a/SimMuL1/interface/Helpers.h b/SimMuL1/interface/Helpers.h new file mode 100644 index 0000000000000..207c85453369d --- /dev/null +++ b/SimMuL1/interface/Helpers.h @@ -0,0 +1,38 @@ +#ifndef SimMuL1_Helpers_h +#define SimMuL1_Helpers_h + +namespace helpers +{ +inline bool +isME1bEtaRegion(float eta, float eta_min = 1.64, float eta_max = 2.14) +{ + return fabs(eta) >= eta_min && fabs(eta) <= eta_max; +} + +inline bool +isME1abEtaRegion(float eta, float eta_min = 1.64) +{ + return fabs(eta) >= eta_min; +} + +bool +isME1aEtaRegion(float eta, float eta_min = 2.14) +{ + return fabs(eta) >= eta_min; +} + +bool +isME42EtaRegion(float eta) +{ + return fabs(eta)>=1.2499 && fabs(eta)<=1.8; +} + +bool +isME42RPCEtaRegion(float eta) +{ + return fabs(eta)>=1.2499 && fabs(eta)<=1.6; +} + +} + +#endif From d339a8637ccc03958df0d8d28b957f4f3b0aa72b Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sun, 11 Aug 2013 22:46:56 +0200 Subject: [PATCH 068/182] update --- SimMuL1/scripts/drawplot_gmtrt.py | 1382 +++++++++++++++++++++++++++++ SimMuL1/scripts/getPTHistos.py | 38 + SimMuL1/scripts/helpers.py | 36 + 3 files changed, 1456 insertions(+) create mode 100644 SimMuL1/scripts/drawplot_gmtrt.py create mode 100644 SimMuL1/scripts/getPTHistos.py create mode 100644 SimMuL1/scripts/helpers.py diff --git a/SimMuL1/scripts/drawplot_gmtrt.py b/SimMuL1/scripts/drawplot_gmtrt.py new file mode 100644 index 0000000000000..3a48a37954973 --- /dev/null +++ b/SimMuL1/scripts/drawplot_gmtrt.py @@ -0,0 +1,1382 @@ +from helpers import * +from ROOT import * + +## Attempt to pyrootize the drawplot_gmtrt.C script + +pdir = "" +dir = "SimMuL1StrictAll" + +gem_dir = "gem/" +gem_label = "gem98" +pdir = "plots/" + +gNPU=100 +gNEvt=238000 + +gdy = [0.1, 2500] + +ptscale = [-1., 0., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 6., 7., 8., 10., 12., 14., + 16., 18., 20., 25., 30., 35., 40., 45., 50., 60., 70., 80., 90., 100., 120., 140.] + +ptscaleb = [1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 6., 7., 8., 10., 12., 14., + 16., 18., 20., 25., 30., 35., 40., 45., 50., 60., 70., 80., 90., 100., 120., 140., 150.] + +ptscaleb_ = [1.25, 1.75, 2.25, 2.75, 3.25, 3.75, 4.25, 4.75, 5.5, 6.5, 7.5, 9., 11., 13., 15., + 17., 19., 22.5, 27.5, 32.5, 37.5, 42.5, 47.5, 55., 65., 75., 85., 95., 110., 130., 150.] + +def drawLumiBXPULabel(): + tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}") + tex.SetNDC() + tex.Draw() + + +def setHistoPt(f_name, name, cname, title, lcolor, lstyle, lwidth): + print "Opening ", f_name + f = TFile.Open(f_name) + h0 = getH(f, dir, name) + nb = h0.GetXaxis().GetNbins() + h = TH1D(name+cname,title,30,ptscaleb) + for b in range(1,nb+1): + bc = h0.GetBinContent(b) + if (bc==0): + continue + bin = h.GetXaxis().FindFixBin(h0.GetBinCenter(b)) + ##cout< 0.): + tex.SetFontSize(font_size) + tex.SetNDC() + tex.Draw() + return tex + + +def gem_rate_draw(): + gStyle.SetOptStat(0) + gStyle.SetTitleStyle(0) + ##gStyle.SetPadTopMargin(0.08) + gStyle.SetTitleH(0.06) + + ptreb = 2 + hdir = "SimMuL1StrictAll" + + f_def = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root" + f_g98_pt10 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt10_pat2.root" + f_g98_pt15 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt15_pat2.root" + f_g98_pt20 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt20_pat2.root" + f_g98_pt30 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat2.root" + f_g98_pt40 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat2.root" + + sprintf(pdir,"%s", gem_dir.Data()) + + rpt = [0.,49.99] + + htitle = "Efficiency for #mu in 1.6<|#eta|<2.12 to have TF track;p_{T}^{MC}" + + hini = "h_pt_initial_1b" + h2s = "h_pt_after_tfcand_eta1b_2s" + h3s = "h_pt_after_tfcand_eta1b_3s" + h2s1b = "h_pt_after_tfcand_eta1b_2s1b" + h3s1b = "h_pt_after_tfcand_eta1b_3s1b" + + + ##gdy[0]=0 gdy[1]=7. + ##if (vs_eta_minpt=="20") gdy[1]=10. + miny = 0.01, maxy + + ### Trigger rate plots with PT >= 20 + + vs_eta_minpt = "20" + ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + + + h_rt_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); + h_rt_tf20_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); + h_rt_tf20_gpt20_2s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); + + h_rt_tf20_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); + h_rt_tf20_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_tf20_gpt20_3s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); + + h_rt_tf20_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_tf20_gpt20_3s1ab = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kGreen+3, 7, 2); + + + ## cAll100 = TCanvas("cAll100","cAll100",800,600) ; + ## cAll100.SetLogy(1); + ## maxy = 300;## 45; + ## h_rt_tf20_2s.GetYaxis().SetRangeUser(miny,maxy); + ## h_rt_tf20_2s1b.GetYaxis().SetRangeUser(miny,maxy); + ## h_rt_tf20_gpt20_2s1b.GetYaxis().SetRangeUser(miny,maxy); + ## h_rt_tf20_2s.Draw("hist e1"); + ## h_rt_tf20_gpt20_2s1b.Draw("hist e1 same"); + ## h_rt_tf20_2s.Draw("hist e1 same"); + ## h_rt_tf20_2s1b.Draw("hist e1 same"); + ## leg = TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + ## leg.SetBorderSize(0); + ## leg.SetFillStyle(0); + ## leg.AddEntry(h_rt_tf20_2s,"Tracks: p_{T}>=20, 2+ stubs",""); + ## leg.AddEntry(h_rt_tf20_2s,"anywhere","l"); + ## leg.AddEntry(h_rt_tf20_2s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + ## leg.AddEntry(h_rt_tf20_gpt20_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + ## leg.Draw(); + ## tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + ## tex.SetNDC(); + ## tex.Draw(); + ## Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); + + ## cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; + ## gPad.SetGridx(1); + ## gPad.SetGridy(1); + ## gem_ratio = setHistoRatio(h_rt_tf20_gpt20_2s1b, h_rt_tf20_2s1b, "", 0.,1.8); + ## gem_ratio.Draw("e1"); + ## Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b__ratio.png").Data()); + + + ##======================== 3+ Stubs ================================## + + ## ((TCanvas*)gROOT.FindObject("cAll100")).cd(); + ## maxy = 30.;##10; + ## h_rt_tf20_3s.GetYaxis().SetRangeUser(miny,maxy); + ## h_rt_tf20_3s1b.GetYaxis().SetRangeUser(miny,maxy); + ## h_rt_tf20_gpt20_3s1b.GetYaxis().SetRangeUser(miny,maxy); + ## h_rt_tf20_3s.Draw("hist e1"); + ## h_rt_tf20_gpt20_3s1b.Draw("hist e1 same"); + ## h_rt_tf20_3s.Draw("hist e1 same"); + ## h_rt_tf20_3s1b.Draw("hist e1 same"); + ## leg = TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + ## leg.SetBorderSize(0); + ## leg.SetFillStyle(0); + ## leg.AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); + ## leg.AddEntry(h_rt_tf20_3s,"anywhere","l"); + ## leg.AddEntry(h_rt_tf20_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + ## leg.AddEntry(h_rt_tf20_gpt20_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + ## leg.Draw(); + ## tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + ## tex.SetNDC(); + ## tex.Draw(); + ## Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); + + ## cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; + ## gPad.SetGridx(1);gPad.SetGridy(1); + ## gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1b, h_rt_tf20_3s1b, "", 0.,1.8); + ## gem_ratio.Draw("e1"); + ## Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); + + + ##======================== 3+ Stubs Including the region ME1/1a ================================## + + ## (gROOT.FindObject("cAll100")).cd(); + ## h_rt_tf20_3s.Draw("hist e1"); + ## h_rt_tf20_gpt20_3s1ab.Draw("hist e1 same"); + ## h_rt_tf20_3s.Draw("hist e1 same"); + ## h_rt_tf20_3s1ab.Draw("hist e1 same"); + ## maxy = 30.; + ## 10; + ## h_rt_tf20_3s1ab.GetYaxis().SetRangeUser(miny,maxy); + ## h_rt_tf20_gpt20_3s1ab.GetYaxis().SetRangeUser(miny,maxy); + ## leg = TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + ## leg.SetBorderSize(0); + ## leg.SetFillStyle(0); + ## leg.AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); + ## leg.AddEntry(h_rt_tf20_3s,"anywhere","l"); + ## leg.AddEntry(h_rt_tf20_3s1ab,"with ME1 in 1.6<|#eta|","l"); + ## leg.AddEntry(h_rt_tf20_gpt20_3s1ab,"with (ME1+GEM) in 1.6<|#eta|","l"); + ## leg.Draw(); + ## tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + ## tex.SetNDC(); + ## tex.Draw(); + ## Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); + + ## cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; + ## gPad.SetGridx(1);gPad.SetGridy(1); + ## gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1ab, h_rt_tf20_3s1ab, "", 0.,1.8); + ## gem_ratio.Draw("e1"); + ## Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); + + ### Trigger rate plots with PT >= 20 + + vs_eta_minpt = "30"; + ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + + ## h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); + ## h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); + ## h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); + h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); + h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); + h_rt_tf30_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kAzure+2, 1, 2); + h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); + h_rt_tf30_gpt30_3s1ab = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kGreen, 7, 2); + + ## cAll100 = TCanvas("cAll100","cAll100",800,600) ; + ## cAll100.SetLogy(1); + ## h_rt_tf30_2s.Draw("hist e1"); + ## h_rt_tf30_gpt30_2s1b.Draw("hist e1 same"); + ## h_rt_tf30_2s.Draw("hist e1 same"); + ## h_rt_tf30_2s1b.Draw("hist e1 same"); + ## maxy = 120.;##35.; + ## h_rt_tf30_2s.GetYaxis().SetRangeUser(miny,maxy); + ## h_rt_tf30_2s1b.GetYaxis().SetRangeUser(miny,maxy); + ## h_rt_tf30_gpt30_2s1b.GetYaxis().SetRangeUser(miny,maxy); + ## leg = TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + ## leg.SetBorderSize(0); + ## leg.SetFillStyle(0); + ## leg.AddEntry(h_rt_tf30_2s,"Tracks: p_{T}>=30, 2+ stubs",""); + ## leg.AddEntry(h_rt_tf30_2s,"anywhere","l"); + ## leg.AddEntry(h_rt_tf30_2s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + ## leg.AddEntry(h_rt_tf30_gpt30_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + ## leg.Draw(); + ## tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + ## tex.SetNDC(); + ## tex.Draw(); + ## Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); + + ## cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; + ## gPad.SetGridx(1);gPad.SetGridy(1); + ## gem_ratio = setHistoRatio(h_rt_tf30_gpt30_2s1b, h_rt_tf30_2s1b, "", 0.,1.8); + ## gem_ratio.Draw("e1"); + ## Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b__ratio.png").Data()); + + + ## (gROOT.FindObject("cAll100")).cd(); + ## h_rt_tf30_3s.Draw("hist e1"); + ## h_rt_tf30_gpt30_3s1b.Draw("hist e1 same"); + ## h_rt_tf30_3s.Draw("hist e1 same"); + ## h_rt_tf30_3s1b.Draw("hist e1 same"); + ## maxy = 30.;##7.; + ## h_rt_tf30_3s.GetYaxis().SetRangeUser(miny,maxy); + ## h_rt_tf30_3s1b.GetYaxis().SetRangeUser(miny,maxy); + ## h_rt_tf30_gpt30_3s1b.GetYaxis().SetRangeUser(miny,maxy); + ## leg = TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + ## leg.SetBorderSize(0); + ## leg.SetFillStyle(0); + ## leg.AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); + ## leg.AddEntry(h_rt_tf30_3s,"anywhere","l"); + ## leg.AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + ## leg.AddEntry(h_rt_tf30_gpt30_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + ## leg.Draw(); + ## tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + ## tex.SetNDC(); + ## tex.Draw(); + ## Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); + + ## cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; + ## gPad.SetGridx(1);gPad.SetGridy(1); + ## gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1b, h_rt_tf30_3s1b, "", 0.,1.8); + ## gem_ratio.Draw("e1"); + ## Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); + + + ##========================== Including the ME1a ==========================## + + ## (gROOT.FindObject("cAll100")).cd(); + ## h_rt_tf30_3s.Draw("hist e1"); + ## h_rt_tf30_gpt30_3s1ab.Draw("hist e1 same"); + ## h_rt_tf30_3s.Draw("hist e1 same"); + ## h_rt_tf30_3s1ab.Draw("hist e1 same"); + ## h_rt_tf30_3s.GetYaxis().SetRangeUser(miny,maxy); + ## h_rt_tf30_3s1ab.GetYaxis().SetRangeUser(miny,maxy); + ## h_rt_tf30_gpt30_3s1ab.GetYaxis().SetRangeUser(miny,maxy); + ## leg = TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + ## leg.SetBorderSize(0); + ## leg.SetFillStyle(0); + ## leg.AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); + ## leg.AddEntry(h_rt_tf30_3s,"anywhere","l"); + ## leg.AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|","l"); + ## leg.AddEntry(h_rt_tf30_gpt30_3s1ab,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + ## leg.Draw(); + ## tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + ## tex.SetNDC(); + ## tex.Draw(); + ## Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); + + ## cAll100r2 = TCanvas("cAll100r2","cAll100r2",800,300) ; + ## gPad.SetGridx(1);gPad.SetGridy(1); + ## gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1ab, h_rt_tf30_3s1ab, "", 0.,1.8); + ## gem_ratio.Draw("e1"); + ## Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); + + ##========================== Comparison with/withous Stub in ME1a ==========================## + + ## (gROOT.FindObject("cAll100")).cd(); + ## h_rt_tf30_3s1b.Draw("hist e1"); + ## h_rt_tf30_3s1ab.Draw("hist e1 same"); + ## leg = TLegend(0.2,0.65,.80,0.90,NULL,"brNDC"); + ## leg.SetBorderSize(0); + ## leg.SetFillStyle(0); + ## leg.AddEntry(h_rt_tf30_3s1b,"Tracks: p_{T}>=30, 3+ stubs",""); + ## leg.AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + ## leg.AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|<2.4","l"); + ## leg.Draw(); + ## Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); + + ## cAll100r2 = TCanvas("cAll100r2","cAll100r2",800,300) ; + ## gPad.SetGridx(1);gPad.SetGridy(1); + ## gem_ratio = setHistoRatio2(h_rt_tf30_3s1ab, h_rt_tf30_3s1b, "", 0.,1.8); + ## gem_ratio.Draw("e1"); + ## Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio_compstubME1a.png").Data()); + + ##========================== Comparison with/withous Stub in ME1a + GEMS ==========================## + + """ + (gROOT.FindObject("cAll100")).cd(); + h_rt_tf30_gpt30_3s1b.Draw("hist e1"); + h_rt_tf30_gpt30_3s1ab.Draw("hist e1 same"); + leg = TLegend(0.2,0.65,.80,0.90,NULL,"brNDC"); + leg.SetBorderSize(0); + leg.SetFillStyle(0); + leg.AddEntry(h_rt_tf30_3s1b,"Tracks: p_{T}>=30, 3+ stubs",""); + leg.AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + leg.AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|<2.4","l"); + leg.Draw(); + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); + + cAll100r2 = TCanvas("cAll100r2","cAll100r2",800,300) ; + gPad.SetGridx(1);gPad.SetGridy(1); + gem_ratio = setHistoRatio2(h_rt_tf30_3s1ab, h_rt_tf30_3s1b, "", 0.,1.8); + gem_ratio.Draw("e1"); + Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio_compstubME1a.png").Data()); + """ + +def drawplot_gmtrt(dname = "", vs_eta_minpt = ""): + + ##gStyle.SetStatW(0.13); + ##gStyle.SetStatH(0.08); + gStyle.SetStatW(0.07); + gStyle.SetStatH(0.06); + gStyle.SetOptStat(0); + gStyle.SetTitleStyle(0); + gStyle.SetTitleAlign(13);## coord in top left + gStyle.SetTitleX(0.); + gStyle.SetTitleY(1.); + gStyle.SetTitleW(1); + gStyle.SetTitleH(0.058); + gStyle.SetTitleBorderSize(0); + gStyle.SetPadLeftMargin(0.126); + gStyle.SetPadRightMargin(0.04); + gStyle.SetPadTopMargin(0.06); + gStyle.SetPadBottomMargin(0.13); + gStyle.SetMarkerStyle(1); + + """ + d1="" + d2="" + if (dname != ""): + sprintf(d1,"_%s", dname.Data()); + ##if (strcmp(pu,"")>0) sprintf(d2,"_%s",pu); + ##sprintf(pdir,"pic%s%s",d1,d2); + + if (interactive && dname != "") { + sprintf(pdir,"pic%s%s",d1,d2); + if( gSystem.AccessPathName(pdir)==0 ) { + ##cout<<"directory "<=3 stubs in 1<|#eta|<2.4",""); + leg_cc100.AddEntry(hAll100,"except in ME1/b region require",""); + leg_cc100.AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex.SetNDC(); + tex.Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-2s1b__gem-3s-2s1b.png").Data()); + + if (do_return) return; + + + ## full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + ##gStyle.SetPadTopMargin(0.08); + gStyle.SetTitleH(0.06); + cAll100 = TCanvas("cAll100","cAll100",800,600) ; + hAll100.Draw("hist e1"); + hAll100gem.Draw("hist e1 same"); + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + ##leg_cc100.SetTextSize(0.0368); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(hAll100,"default emulator","l"); + leg_cc100.AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100.AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100.AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100.AddEntry(hAll100,"in ME1/b region also require",""); + leg_cc100.AddEntry(hAll100,"one stub to be from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex.SetNDC(); + tex.Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); + + ## full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + ##gStyle.SetPadTopMargin(0.08); + gStyle.SetTitleH(0.06); + cAll100 = TCanvas("cAll100","cAll100",800,600) ; + hAll100.Draw("hist e1"); + hAll100gem.Draw("hist e1 same"); + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + ##leg_cc100.SetTextSize(0.0368); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(hAll100,"default emulator","l"); + leg_cc100.AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100.AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100.AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100.AddEntry(hAll100,"except in ME1/b region require",""); + leg_cc100.AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex.SetNDC(); + tex.Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-2s1b.png").Data()); + + ## full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b + gdy[0]=0; gdy[1]=7.; + if (vs_eta_minpt=="20") gdy[1]=10.; + + ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); + hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); + + ##gStyle.SetPadTopMargin(0.08); + gStyle.SetTitleH(0.06); + cAll100 = TCanvas("cAll100","cAll100",800,600) ; + hAll100.Draw("hist e1"); + hAll100gem.Draw("hist e1 same"); + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + ##leg_cc100.SetTextSize(0.0368); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(hAll100,"default emulator","l"); + leg_cc100.AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100.AddEntry(hAll100gem,"with GEM match","l"); + leg_cc100.AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100.AddEntry(hAll100,"in ME1/b region also require",""); + leg_cc100.AddEntry(hAll100,"one stub to be from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + tex.SetNDC(); + tex.Draw(); + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-3s1b.png").Data()); + + if (do_return) return; + + + ## full eta 1. - 2.4 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b + gdy[0]=2; gdy[1]=2000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + + cAll100 = TCanvas("cAll100","cAll100",800,600) ; + gPad.SetLogx(1);gPad.SetLogy(1); + gPad.SetGridx(1);gPad.SetGridy(1); + hAll100.Draw("e3"); + hAll100gem.Draw("e3 same"); + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + ##leg_cc100.SetTextSize(0.0368); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(hAll100,"default emulator","f"); + leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100.AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100.AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); + leg_cc100.AddEntry(hAll100,"except in ME1/b region require",""); + leg_cc100.AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex.SetNDC(); + tex.Draw(); + + Print(cAll100, "rates__1-2.4__PU100__def-3s-2s1b__gem-3s-2s1b.png"); + + + cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; + gPad.SetLogx(1);##gPad.SetLogy(1); + gPad.SetGridx(1);gPad.SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.4); + hAll100gem_ratio.Draw("e1"); + + Print(cAll100r, "rates__1-2.4__PU100__def-3s-2s1b__gem-3s-2s1b__ratio.png"); + + ## full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b + gdy[0]=2; gdy[1]=2000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + + cAll100 = TCanvas("cAll100","cAll100",800,600) ; + gPad.SetLogx(1);gPad.SetLogy(1); + gPad.SetGridx(1);gPad.SetGridy(1); + hAll100.Draw("e3"); + hAll100gem.Draw("e3 same"); + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + ##leg_cc100.SetTextSize(0.0368); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(hAll100,"default emulator","f"); + leg_cc100.AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.4",""); + leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100.AddEntry(hAll100,"Tracks: same, except in ME1/b region req.",""); + leg_cc100.AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex.SetNDC(); + tex.Draw(); + + Print(cAll100, "rates__1-2.4__PU100__def-3s__gem-3s-2s1b.png"); + + + cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; + gPad.SetLogx(1);##gPad.SetLogy(1); + gPad.SetGridx(1);gPad.SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); + hAll100gem_ratio.Draw("e1"); + + Print(cAll100r, "rates__1-2.4__PU100__def-3s__gem-3s-2s1b__ratio.png"); + + + ## no ME1/a eta 1. - 2.1 Default: 3station GEM: 3station, 3s & 1b + gdy[0]=2; gdy[1]=2000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_no1a", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + + cAll100 = TCanvas("cAll100","cAll100",800,600) ; + gPad.SetLogx(1);gPad.SetLogy(1); + gPad.SetGridx(1);gPad.SetGridy(1); + hAll100.Draw("e3"); + hAll100gem.Draw("e3 same"); + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + ##leg_cc100.SetTextSize(0.0368); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(hAll100,"default emulator","f"); + leg_cc100.AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.1",""); + leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100.AddEntry(hAll100,"Tracks: same, except in ME1/b region req.",""); + leg_cc100.AddEntry(hAll100,">=3 stubs and one of them from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex.SetNDC(); + tex.Draw(); + + Print(cAll100, "rates__1-2.1__PU100__def-3s__gem-3s-3s1b.png"); + + + cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; + gPad.SetLogx(1); + gPad.SetGridx(1);gPad.SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); + hAll100gem_ratio.Draw("e1"); + + Print(cAll100r, "rates__1-2.1__PU100__def-3s__gem-3s-3s1b__ratio.png"); + + + result_gem_eta_no1a = hAll100gem; + result_def_eta_no1a = hAll100; + + ## no ME1/a eta 1. - 2.1 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b + gdy[0]=2; gdy[1]=2000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + + cAll100 = TCanvas("cAll100","cAll100",800,600) ; + gPad.SetLogx(1);gPad.SetLogy(1); + gPad.SetGridx(1);gPad.SetGridy(1); + hAll100.Draw("e3"); + hAll100gem.Draw("e3 same"); + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + ##leg_cc100.SetTextSize(0.0368); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(hAll100,"default emulator","f"); + leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100.AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100.AddEntry(hAll100,"with >=3 stubs in 1<|#eta|<2.1",""); + leg_cc100.AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex.SetNDC(); + tex.Draw(); + + Print(cAll100, "rates__1-2.1__PU100__def-3s-3s1b__gem-3s-3s1b.png"); + + + cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; + gPad.SetLogx(1); + gPad.SetGridx(1);gPad.SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); + hAll100gem_ratio.Draw("e1"); + + Print(cAll100r, "rates__1-2.1__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); + + ##result_gem_eta_no1a = hAll100gem; + result_def_eta_no1a_3s1b = hAll100; + + + ## Full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b + gdy[0]=2; gdy[1]=2000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + + cAll100 = TCanvas("cAll100","cAll100",800,600) ; + gPad.SetLogx(1);gPad.SetLogy(1); + gPad.SetGridx(1);gPad.SetGridy(1); + hAll100.Draw("e3"); + hAll100gem.Draw("e3 same"); + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + ##leg_cc100.SetTextSize(0.0368); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(hAll100,"default emulator","f"); + leg_cc100.AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.4",""); + leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100.AddEntry(hAll100,"Tracks: same, except",""); + leg_cc100.AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex.SetNDC(); + tex.Draw(); + + Print(cAll100, "rates__1-2.4__PU100__def-3s__gem-3s-3s1b.png"); + + + cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; + gPad.SetLogx(1); + gPad.SetGridx(1);gPad.SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); + hAll100gem_ratio.Draw("e1"); + + Print(cAll100r, "rates__1-2.4__PU100__def-3s__gem-3s-3s1b__ratio.png"); + + result_gem_eta_all = hAll100gem; + result_def_eta_all = hAll100; + + + ## Full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b + gdy[0]=2; gdy[1]=2000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + + cAll100 = TCanvas("cAll100","cAll100",800,600) ; + gPad.SetLogx(1);gPad.SetLogy(1); + gPad.SetGridx(1);gPad.SetGridy(1); + hAll100.Draw("e3"); + hAll100gem.Draw("e3 same"); + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + ##leg_cc100.SetTextSize(0.0368); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(hAll100,"default emulator","f"); + leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100.AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100.AddEntry(hAll100,"with >=3 stubs in 1<|#eta|<2.4",""); + leg_cc100.AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex.SetNDC(); + tex.Draw(); + + Print(cAll100, "rates__1-2.4__PU100__def-3s-3s1b__gem-3s-3s1b.png"); + + + cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; + gPad.SetLogx(1); + gPad.SetGridx(1);gPad.SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.6); + hAll100gem_ratio.Draw(); + + Print(cAll100r, "rates__1-2.4__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); + + ##result_gem_eta_all = hAll100gem; + result_def_eta_all_3s1b = hAll100; + + + + ## ME1b eta 1.64 - 2.14 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b + gdy[0]=0.02; gdy[1]=1000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + + cAll100 = TCanvas("cAll100","cAll100",800,600) ; + gPad.SetLogx(1);gPad.SetLogy(1); + gPad.SetGridx(1);gPad.SetGridy(1); + hAll100.Draw("e3"); + hAll100gem.Draw("e3 same"); + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + ##leg_cc100.SetTextSize(0.0368); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(hAll100,"default emulator","f"); + leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100.AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100.AddEntry(hAll100,"with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100.AddEntry(hAll100,"and require one stub to be from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex.SetNDC(); + tex.Draw(); + + Print(cAll100, "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b.png"); + + + cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; + gPad.SetLogx(1); + gPad.SetGridx(1);gPad.SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,2.1); + hAll100gem_ratio.Draw("e1"); + + Print(cAll100r, "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); + + result_gem = hAll100gem; + result_def_3s1b = hAll100; + + + ## ME1b eta 1.64 - 2.14 Default: 3station, 3s GEM: 3station, 3s & 1b + gdy[0]=0.02; gdy[1]=1000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + + cAll100 = TCanvas("cAll100","cAll100",800,600) ; + gPad.SetLogx(1);gPad.SetLogy(1); + gPad.SetGridx(1);gPad.SetGridy(1); + hAll100.Draw("e3"); + hAll100gem.Draw("e3 same"); + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + ##leg_cc100.SetTextSize(0.0368); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(hAll100,"default emulator","f"); + leg_cc100.AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100.AddEntry(hAll100,"Tracks: same, plus req. one stub from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex.SetNDC(); + tex.Draw(); + + Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b.png"); + + + cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; + gPad.SetLogx(1); + gPad.SetGridx(1);gPad.SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,1.1); + hAll100gem_ratio.Draw("e1"); + + Print(cAll100r, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__ratio.png"); + + ##result_gem = hAll100gem; + result_def = hAll100; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_2s_1b", "_hAll100s2", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + result_def_2s = hAll100; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_2s_1b", "_hAll100s2", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + result_def_2s = hAll100; + + + ## ME1b eta 1.64 - 2.14 Default: 3station, 3s GMT single trigg + gdy[0]=0.02; gdy[1]=1000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_ptmax_sing_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+1, 1, 1); + + cAll100 = TCanvas("cAll100","cAll100",800,600) ; + gPad.SetLogx(1);gPad.SetLogy(1); + gPad.SetGridx(1);gPad.SetGridy(1); + hAll100.Draw("e3"); + hAll100gem.Draw("e3 same"); + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + ##leg_cc100.SetTextSize(0.0368); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100.AddEntry(hAll100gem,"GMT selection for Single Trigger","f"); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex.SetNDC(); + tex.Draw(); + + Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gmtsing.png"); + + result_def_gmtsing = hAll100gem; + + ## ME1b eta 1.64 - 2.14 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b + gdy[0]=0.02; gdy[1]=1000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + + cAll100 = TCanvas("cAll100","cAll100",800,600) ; + gPad.SetLogx(1);gPad.SetLogy(1); + gPad.SetGridx(1);gPad.SetGridy(1); + hAll100.Draw("e3"); + hAll100gem.Draw("e3 same"); + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + ##leg_cc100.SetTextSize(0.0368); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(hAll100,"default emulator","f"); + leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100.AddEntry(hAll100,"Tracks req. for both:",""); + leg_cc100.AddEntry(hAll100,"with >=2 stubs in 1.64<|#eta|<2.14",""); + leg_cc100.AddEntry(hAll100,"and require one stub to be from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex.SetNDC(); + tex.Draw(); + + Print(cAll100, "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b.png"); + + + cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; + gPad.SetLogx(1); + gPad.SetGridx(1);gPad.SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,2.1); + hAll100gem_ratio.Draw("e1"); + + Print(cAll100r, "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__ratio.png"); + + result_gem_2s1b = hAll100gem; + result_def_2s1b = hAll100; + + + """ + + ## ME1b eta 1.64 - 2.14 Default: 3station, 3s GEM: 3station, 2s & 1b + if (1) + { + gdy[0]=0.02; gdy[1]=1000.; + + hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); + hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); + + cAll100 = TCanvas("cAll100","cAll100",800,600) ; + gPad.SetLogx(1);gPad.SetLogy(1); + gPad.SetGridx(1);gPad.SetGridy(1); + hAll100.Draw("e3"); + hAll100gem.Draw("e3 same"); + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + ##leg_cc100.SetTextSize(0.0368); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(hAll100,"default emulator","f"); + leg_cc100.AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); + leg_cc100.AddEntry(hAll100gem,"Tracks: with >=2 stubs in 1.64<|#eta|<2.14",""); + leg_cc100.AddEntry(hAll100gem,"plus req. one stub from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex.SetNDC(); + tex.Draw(); + + Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b.png"); + + + cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; + gPad.SetLogx(1); + gPad.SetGridx(1);gPad.SetGridy(1); + + hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,1.1); + hAll100gem_ratio.Draw("e1"); + + Print(cAll100r, "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__ratio.png"); + + result_gem_2s1b = hAll100gem; + ##result_def = hAll100; + + if (do_return) return; + } + + """ + + + +""" + + .L drawplot_gmtrt.C + drawplot_gmtrt("minbias_pt10_pat2") + hh = (TH1D*)result_gem.Clone("gem_new") + hh.SetFillColor(kGreen+4) + for (b = hh.FindBin(15); b <= hh.GetNbinsX(); ++b) hh.SetBinContent(b, 0); + drawplot_gmtrt("minbias_pt15_pat2") + h15 = (TH1D*)result_gem.Clone("gem15") + for (b = h15.FindBin(15); b < h15.FindBin(20); ++b) hh.SetBinContent(b, h15.GetBinContent(b)); + drawplot_gmtrt("minbias_pt20_pat2") + h20 = (TH1D*)result_gem.Clone("gem20") + for (b = h20.FindBin(20); b < h20.FindBin(30); ++b) hh.SetBinContent(b, h20.GetBinContent(b)); + drawplot_gmtrt("minbias_pt30_pat2") + h30 = (TH1D*)result_gem.Clone("gem30") + for (b = h30.FindBin(30); b <= h30.GetNbinsX(); ++b) hh.SetBinContent(b, h30.GetBinContent(b)); + for (b = 1; b <= hh.GetNbinsX(); ++b) if (hh.GetBinContent(b)==0) hh.SetBinError(b, 0.); + + (gROOT.FindObject("cAll100")).cd(); + result_def.Draw("e3"); + hh.Draw("same e3"); + + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(result_def,"default emulator","f"); + leg_cc100.AddEntry(result_def,"Tracks: with >=3 stubs in 1.14<|#eta|<2.14",""); + leg_cc100.AddEntry(hh,"with GEM match","f"); + leg_cc100.AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex.SetNDC(); + tex.Draw(); + + gPad.Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png") + + + (gROOT.FindObject("cAll100r")).cd(); + hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); + hh_ratio.Draw("e1"); + gPad.Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png") + + + (gROOT.FindObject("cAll100")).cd(); + result_def_3s1b.Draw("e3") + hh.Draw("same e3") + + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(result_def_3s1b,"default emulator","f"); + leg_cc100.AddEntry(hh,"with GEM match","f"); + leg_cc100.AddEntry(result_def_3s1b,"Tracks req. for both:",""); + leg_cc100.AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100.AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex.SetNDC(); + tex.Draw(); + + gPad.Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png") + + + (gROOT.FindObject("cAll100r")).cd(); + hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); + hh_ratio.Draw("e1"); + gPad.Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png") + + + + + .L drawplot_gmtrt.C + drawplot_gmtrt("minbias_pt10_pat8") + hh = (TH1D*)result_gem.Clone("gem_new") + hh.SetFillColor(kGreen+4) + for (b = hh.FindBin(15); b <= hh.GetNbinsX(); ++b) hh.SetBinContent(b, 0); + drawplot_gmtrt("minbias_pt15_pat8") + h15 = (TH1D*)result_gem.Clone("gem15") + for (b = h15.FindBin(15); b < h15.FindBin(20); ++b) hh.SetBinContent(b, h15.GetBinContent(b)); + drawplot_gmtrt("minbias_pt20_pat8") + h20 = (TH1D*)result_gem.Clone("gem20") + for (b = h20.FindBin(20); b < h20.FindBin(30); ++b) hh.SetBinContent(b, h20.GetBinContent(b)); + drawplot_gmtrt("minbias_pt30_pat8") + h30 = (TH1D*)result_gem.Clone("gem30") + for (b = h30.FindBin(30); b <= h30.GetNbinsX(); ++b) hh.SetBinContent(b, h30.GetBinContent(b)); + for (b = 1; b <= hh.GetNbinsX(); ++b) if (hh.GetBinContent(b)==0) hh.SetBinError(b, 0.); + + + (gROOT.FindObject("cAll100")).cd(); + result_def.Draw("e3") + hh.Draw("same e3") + + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(result_def,"default emulator","f"); + leg_cc100.AddEntry(result_def,"Tracks: with >=3 stubs in 1.14<|#eta|<2.14",""); + leg_cc100.AddEntry(hh,"with GEM match","f"); + leg_cc100.AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex.SetNDC(); + tex.Draw(); + + gPad.Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png") + + + (gROOT.FindObject("cAll100r")).cd(); + hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); + hh_ratio.Draw("e1"); + gPad.Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png") + + + + (gROOT.FindObject("cAll100")).cd(); + result_def_3s1b.Draw("e3") + hh.Draw("same e3") + + leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + const TObject obj; + leg_cc100.SetBorderSize(0); + leg_cc100.SetFillStyle(0); + leg_cc100.AddEntry(result_def_3s1b,"default emulator","f"); + leg_cc100.AddEntry(hh,"with GEM match","f"); + leg_cc100.AddEntry(result_def_3s1b,"Tracks req. for both:",""); + leg_cc100.AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); + leg_cc100.AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg_cc100.Draw(); + + tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); + tex.SetNDC(); + tex.Draw(); + + gPad.Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png") + + + (gROOT.FindObject("cAll100r")).cd(); + hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); + hh_ratio.Draw("e1"); + gPad.Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png") + + +""" + + +if __name__ == "__main__": + print "It works!" diff --git a/SimMuL1/scripts/getPTHistos.py b/SimMuL1/scripts/getPTHistos.py new file mode 100644 index 0000000000000..4568145dcd275 --- /dev/null +++ b/SimMuL1/scripts/getPTHistos.py @@ -0,0 +1,38 @@ +def getPtHistos(f_def, f_gem, dname): + + if "_pat8" in dname: f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root" + if dname == "minbias_pt05_pat8" : f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat8.root" + if dname == "minbias_pt06_pat8" : f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat8.root" + if dname == "minbias_pt10_pat8" : f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat8.root" + if dname == "minbias_pt15_pat8" : f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat8.root" + if dname == "minbias_pt20_pat8" : f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat8.root" + if dname == "minbias_pt30_pat8" : f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat8.root" + if dname == "minbias_pt40_pat8" : f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat8.root" + + if "_pat2" in dname : f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root" + if dname == "minbias_pt05_pat2" : f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat2.root" + if dname == "minbias_pt06_pat2" : f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat2.root" + if dname == "minbias_pt10_pat2" : f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat2.root" + if dname == "minbias_pt15_pat2" : f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat2.root" + if dname == "minbias_pt20_pat2" : f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat2.root" + if dname == "minbias_pt30_pat2" : f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat2.root" + if dname == "minbias_pt40_pat2" : f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat2.root" + + result_def = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_1b", "_def") + result_def_2s = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_2s_1b", "_def") + result_def_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_def") + result_def_2s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_def") + result_def_eta_all = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s", "_def") + result_def_eta_all_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_def") + result_def_eta_no1a = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_no1a", "_def") + result_def_eta_no1a_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_def") + result_gmtsing = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing_1b", "_def") + + result_gem = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_gem") + result_gem_2s1b = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_gem") + result_gem_eta_all = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_gem") + result_gem_eta_no1a = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_gem") + ##result_gmtsing = getPTHisto(f_gem, dir, "h_rt_gmt_ptmax_sing_1b", "_def") + +if __name__ == "__main__": + getPtHistos("f_def", "f_gem", "test") diff --git a/SimMuL1/scripts/helpers.py b/SimMuL1/scripts/helpers.py new file mode 100644 index 0000000000000..9a18fe2086cbc --- /dev/null +++ b/SimMuL1/scripts/helpers.py @@ -0,0 +1,36 @@ +def GetStat(h): + return h.FindObject("stats") + +def SetOptStat(h, op): + stat = GetStat(h) + stat.SetOptStat(op) + return stat + +def GetH(f, dir, name): + return fi.Get("%s/%s;1"%(dir,name)) + +def Print(c, name): + c.Print("%s/%s"%(pdir,name)) + +def myRebin(h, n): + nb = h.GetNbinsX() + entr = h.GetEntries() + bin0 = h.GetBinContent(0) + binN1 = h.GetBinContent(nb+1) + if (nb % n): + binN1 += h.Integral(nb - nb%n + 1, nb) + h.Rebin(n) + nb = h.GetNbinsX() + h.SetBinContent(0, bin0) + h.SetBinContent(nb+1, binN1) + h.SetEntries(entr) + +def scale(h): + rate = 40000. + nevents = 238000 + bx_window = 3 + bx_filling = 0.795 + h.Scale(rate*bx_filling/(bx_window*nevents)) + +if __name__ == "__main__": + print "It's Working!" From a71234419fb8ce697b48c6813b90b5d819e3f881 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sun, 11 Aug 2013 22:50:10 +0200 Subject: [PATCH 069/182] remove helpers --- SimMuL1/plugins/GEMCSCTriggerRate.cc | 35 ---------------------------- 1 file changed, 35 deletions(-) diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.cc b/SimMuL1/plugins/GEMCSCTriggerRate.cc index 4592a4c3070aa..a21fb5f7b25e4 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRate.cc @@ -36,29 +36,8 @@ using namespace edm; namespace { - const Double_t ETA_BIN = 0.0125 *2; const Double_t PHI_BIN = 62.*M_PI/180./4096.; // 0.26 mrad - - bool isME1bEtaRegion(float eta, float eta_min = 1.64, float eta_max = 2.14) - { - if (fabs(eta) >= eta_min && fabs(eta) <= eta_max) return true; - else return false; - } - - bool isME1abEtaRegion(float eta, float eta_min = 1.64) - { - if (fabs(eta) >= eta_min) return true; - else return false; - } - - bool isME1aEtaRegion(float eta, float eta_min = 2.14) - { - if (fabs(eta) >= eta_min) return true; - else return false; - } - - } // ================================================================================================ @@ -2473,20 +2452,6 @@ GEMCSCTriggerRate::cscTriggerSubsector(CSCDetId &id) } -// ================================================================================================ -bool GEMCSCTriggerRate::isME42EtaRegion(float eta) -{ - if (fabs(eta)>=1.2499 && fabs(eta)<=1.8) return true; - else return false; -} - -bool GEMCSCTriggerRate::isME42RPCEtaRegion(float eta) -{ - if (fabs(eta)>=1.2499 && fabs(eta)<=1.6) return true; - else return false; -} - - // ================================================================================================ void GEMCSCTriggerRate::setupTFModeHisto(TH1D* h) From 99b2d22d2fc5a282d4566c7aef840fce06360c14 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 12 Aug 2013 10:05:03 +0200 Subject: [PATCH 070/182] Add helper functions --- SimMuL1/interface/Helpers.h | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 SimMuL1/interface/Helpers.h diff --git a/SimMuL1/interface/Helpers.h b/SimMuL1/interface/Helpers.h new file mode 100644 index 0000000000000..7ba04de2d9dcd --- /dev/null +++ b/SimMuL1/interface/Helpers.h @@ -0,0 +1,46 @@ +#ifndef SimMuL1_Helpers_h +#define SimMuL1_Helpers_h + +namespace helpers +{ +bool +isME1bEtaRegion(float eta, float eta_min = 1.64, float eta_max = 2.14) +{ + return fabs(eta) >= eta_min && fabs(eta) <= eta_max; +} + +bool +isME1abEtaRegion(float eta, float eta_min = 1.64) +{ + return fabs(eta) >= eta_min; +} + +bool +isME1aEtaRegion(float eta, float eta_min = 2.14) +{ + return fabs(eta) >= eta_min; +} + +bool +isME42EtaRegion(float eta) +{ + return fabs(eta)>=1.2499 && fabs(eta)<=1.8; +} + +bool +isME42RPCEtaRegion(float eta) +{ + return fabs(eta)>=1.2499 && fabs(eta)<=1.6; +} + +} + +#endif + + + + + + + + From 80f255058ed3e02af0646cbf235d40ada932987e Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Mon, 12 Aug 2013 19:03:54 -0500 Subject: [PATCH 071/182] GEM simhits + more complex analysis from the original NeutronSimHitsAnalyzer including the sensitive detector areas calculations --- SimMuL1/plugins/NeutronSimHitsAnalyzer.cc | 2444 ++++++++++++++++++--- 1 file changed, 2183 insertions(+), 261 deletions(-) diff --git a/SimMuL1/plugins/NeutronSimHitsAnalyzer.cc b/SimMuL1/plugins/NeutronSimHitsAnalyzer.cc index 20c925b694ece..7ee4062c09e51 100644 --- a/SimMuL1/plugins/NeutronSimHitsAnalyzer.cc +++ b/SimMuL1/plugins/NeutronSimHitsAnalyzer.cc @@ -1,7 +1,7 @@ /* - * The version of NeutronSimHitsAnalyzer that was used for - * SimHit level occupancy studies for CSC + * NeutronSimHitsAnalyzer: analyzer module for SimHit level occupancy studies in muon systems * + * The NeutronSimHitsAnalyzer that was used for CSC studies was taken as a base. * */ @@ -21,103 +21,358 @@ #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" +#include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h" + #include "Geometry/Records/interface/MuonGeometryRecord.h" #include "Geometry/CSCGeometry/interface/CSCGeometry.h" +#include "Geometry/GEMGeometry/interface/GEMGeometry.h" #include "Geometry/RPCGeometry/interface/RPCGeometry.h" +#include "Geometry/RPCGeometry/interface/RPCGeomServ.h" #include "Geometry/DTGeometry/interface/DTGeometry.h" +#include "Geometry/CommonTopologies/interface/RectangularStripTopology.h" +#include "Geometry/CommonTopologies/interface/TrapezoidalStripTopology.h" #include "DataFormats/MuonDetId/interface/CSCDetId.h" #include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h" #include "L1Trigger/CSCCommonTrigger/interface/CSCTriggerGeometry.h" - +#include "DataFormats/MuonDetId/interface/GEMDetId.h" #include "DataFormats/MuonDetId/interface/RPCDetId.h" +#include "DataFormats/MuonDetId/interface/DTWireId.h" + #include "TH1.h" #include "TH2.h" +#include "TGraphErrors.h" #include "TTree.h" #include "GEMCode/SimMuL1/interface/PSimHitMapCSC.h" +#include + +using std::cout; +using std::endl; namespace { -enum trig_cscs {MAX_CSC_STATIONS = 4, CSC_TYPES = 10}; -enum trig_dts {MAX_DT_STATIONS = 4, DT_TYPES = 12}; -enum trig_rpcf {MAX_RPCF_STATIONS = 4, RPCF_TYPES = 8}; -enum trig_rpcb {MAX_RPCB_STATIONS = 4, RPCB_TYPES = 12}; -int getCSCType(CSCDetId &id); -} +enum ETrigCSC {MAX_CSC_STATIONS = 4, CSC_TYPES = 10}; +enum ETrigGEM {MAX_GEM_STATIONS = 1, GEM_TYPES = 1}; +enum ETrigDT {MAX_DT_STATIONS = 4, DT_TYPES = 12}; +enum ETrigRPCF {MAX_RPCF_STATIONS = 4, RPCF_TYPES = 12}; +enum ETrigRPCB {MAX_RPCB_STATIONS = 4, RPCB_TYPES = 12}; + +int typeRPCb(RPCDetId &d) {return 3*d.station() + abs(d.ring()) - 2;} +int typeRPCf(RPCDetId &d) {return 3*d.station() + d.ring() - 3;} +int typeGEM(GEMDetId &d) {return 3*d.station() + d.ring() - 3;} +int typeDT(DTWireId &d) {return 3*d.station() + abs(d.wheel()) - 2;} + +const std::string csc_type[CSC_TYPES+1] = + { "all", "ME1/a", "ME1/b", "ME1/2", "ME1/3", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2"}; +const std::string csc_type_[CSC_TYPES+1] = + { "all", "ME1a", "ME1b", "ME12", "ME13", "ME21", "ME22", "ME31", "ME32", "ME41", "ME42"}; + +const std::string gem_type[GEM_TYPES+1] = + { "all", "GE1/1"}; +const std::string gem_type_[GEM_TYPES+1] = + { "all", "GE11"}; + +const std::string dt_type[DT_TYPES+1] = + { "all", "MB1/0", "MB1/1", "MB1/2", "MB2/0", "MB2/1", "MB2/2", "MB3/0", "MB3/1", "MB3/2", "MB4/0", "MB4/1", "MB4/2",}; +const std::string dt_type_[DT_TYPES+1] = + { "all", "MB10", "MB11", "MB12", "MB20", "MB21", "MB22", "MB30", "MB31", "MB32", "MB40", "MB41", "MB42",}; + +const std::string rpcf_type[RPCF_TYPES+1] = + { "all", "RE1/1", "RE1/2", "RE1/3", "RE2/1", "RE2/2", "RE2/3", "RE3/1", "RE3/2", "RE3/3", "RE4/1", "RE4/2", "RE4/3"}; +const std::string rpcf_type_[RPCF_TYPES+1] = + { "all", "RE11", "RE12", "RE13", "RE21", "RE22", "RE23", "RE31", "RE32", "RE33", "RE41", "RE42", "RE43"}; + +const std::string rpcb_type[RPCB_TYPES+1] = + { "all", "RB1/0", "RB1/1", "RB1/2", "RB2/0", "RB2/1", "RB2/2", "RB3/0", "RB3/1", "RB3/2", "RB4/0", "RB4/1", "RB4/2",}; +const std::string rpcb_type_[RPCB_TYPES+1] = + { "all", "RB10", "RB11", "RB12", "RB20", "RB21", "RB22", "RB30", "RB31", "RB32", "RB40", "RB41", "RB42",}; + +// chamber radial segmentations (including factor of 2 for non-zero wheels in barrel): +const double csc_radial_segm[CSC_TYPES+1] = {1, 36, 36, 36, 36, 18, 36, 18, 36, 18, 36}; +const double gem_radial_segm[GEM_TYPES+1] = {1, 36}; +const double dt_radial_segm[DT_TYPES+1] = {1, 12, 12*2, 12*2, 12, 12*2, 12*2, 12, 12*2, 12*2, 14, 14*2, 14*2}; +const double rpcb_radial_segm[RPCF_TYPES+1] = {1, 12, 12*2, 12*2, 12, 12*2, 12*2, 24, 24*2, 24*2, 12, 24*2, 24*2}; +const double rpcf_radial_segm[RPCF_TYPES+1] = {1, 36, 36, 36, 18, 36, 36, 18, 36, 36, 18, 36, 36}; + +// DT # of superlayers in chamber +const double dt_n_superlayers[DT_TYPES+1] = {1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2}; + +enum ENumPDG {N_PDGIDS=7}; +const int pdg_ids[N_PDGIDS] = {0,11,13,211,321,2212,1000000000}; +const std::string pdg_ids_names[N_PDGIDS] = {"unknown","e","#mu","#pi","K","p","nuclei"}; +const std::string pdg_ids_names_[N_PDGIDS] = {"","e","mu","pi","K","p","nucl"}; +const int pdg_colors[N_PDGIDS] = {0, kBlack, kBlue, kGreen+1, kOrange-3, kMagenta, kRed}; +const int pdg_markers[N_PDGIDS] = {0, 1, 24, 3, 5, 26, 2}; +} // local namespace // -// class decleration +// class declarations // +// ================================================================================================ struct MyCSCDetId { void init(CSCDetId &id); - Int_t e, s, r, c, l; - Int_t t; // type 1-10: ME1/a,1/b,1/2,1/3,2/1...4/2 + Short_t e, s, r, c, l; + Short_t t; // type 1-10: ME1/a,1/b,1/2,1/3,2/1...4/2 }; struct MyCSCSimHit { - void init(PSimHit &sh, const CSCGeometry* csc_g); + void init(PSimHit &sh, const CSCGeometry* csc_g, const ParticleDataTable * pdt); + float eKin() {return sqrt(p*p + m*m) - m;} + bool operator < (const MyCSCSimHit &rhs) const; Float_t x, y, z; // local - Float_t r, eta, phi, gz; // global + Float_t r, eta, phi, gx, gy, gz; // global Float_t e; // energy deposit + Float_t p; // particle momentum + Float_t m; // particle mass Float_t t; // TOF + Int_t trid; // trackId Int_t pdg; // PDG Int_t w, s; // WG & Strip }; -struct MyCSCLayer + +struct MyCSCCluster { - void init(int l, std::vector &shits); + void init(std::vector &shits); + float eKin() {return sqrt(p*p + m*m) - m;} std::vector hits; - Int_t ln; // layer # Int_t nh; // # of hits + Float_t r, eta, phi, gx, gy, gz; // globals fot 1st hit + Float_t e; // total energy deposit + Float_t p, m; // particle mass and initial momentum Float_t mint, maxt; // min/max TOF Float_t meant, sigmat;// mean&stdev of TOF + Int_t mintrid, maxtrid;// trackId + Int_t pdg; // PDG + Int_t minw, maxw, mins, maxs; // min/max WG & Strip +}; + +struct MyCSCLayer +{ + void init(int l, std::vector &sclusters); + std::vector clusters; + Int_t ln; // layer #, not stored + Int_t nh; // # of hits + Int_t nclu; // # of clusters + Float_t mint, maxt; // min/max TOF + Int_t mintrid, maxtrid;// trackId Int_t minw, maxw, mins, maxs; // min/max WG & Strip }; struct MyCSCChamber { void init(std::vector &slayers); - Int_t nh; // nhits - Int_t nl, l1, ln; // nlayers, 1st and last layer # + Int_t nh; // # of hits + Int_t nclu; // # of clusters + Int_t nl, l1, ln; // # of layers, 1st and last layer # Float_t mint, maxt; // min/max TOF - Float_t meant, sigmat;// mean&stdev of TOF Int_t minw, maxw, mins, maxs; // min/max WG & Strip }; struct MyCSCEvent { void init(std::vector &schambers); - Int_t nh; // nhits - Int_t nch; // nchambers + Int_t nh; // #hits + Int_t nclu; // #clusters + Int_t nch; // #chambers w/ hits + Int_t nch2, nch3, nch4, nch5, nch6; // #chambers w/ at least 2,3... hits +}; + + +// ================================================================================================ + +struct MyGEMDetId +{ + void init(GEMDetId &id); + Short_t reg, ring, st, layer, ch, part; + Short_t t; // type 1: GE1/1 +}; + + +struct MyGEMSimHit +{ + void init(PSimHit &sh, const GEMGeometry* gem_g, const ParticleDataTable * pdt); + float eKin() {return sqrt(p*p + m*m) - m;} + bool operator < (const MyGEMSimHit &rhs) const; + Float_t x, y, z; // local + Float_t r, eta, phi, gx, gy, gz; // global + Float_t e; // energy deposit + Float_t p; // particle momentum + Float_t m; // particle mass + Float_t t; // TOF + Int_t trid; // trackId + Int_t pdg; // PDG + Int_t s; // Strip +}; + + +struct MyGEMCluster +{ + void init(std::vector &shits); + float eKin() {return sqrt(p*p + m*m) - m;} + std::vector hits; + Int_t nh; // # of hits + Float_t r, eta, phi, gx, gy, gz; // globals fot 1st hit + Float_t e; // total energy deposit + Float_t p, m; // 1st particle mass and initial momentum + Float_t mint, maxt; // min/max TOF + Float_t meant, sigmat;// mean&stdev of TOF + Int_t mintrid, maxtrid;// trackId + Int_t pdg; // PDG + Int_t mins, maxs; // min/max strip +}; + + +struct MyGEMPart +{ + void init(int r, int l, std::vector &sclusters); + std::vector clusters; + Int_t pn; // partition #, not stored + Int_t ln; // layer #, not stored + Int_t nh; // # of hits + Int_t nclu; // # of clusters + Float_t mint, maxt; // min/max TOF + Int_t mintrid, maxtrid;// trackId + Int_t mins, maxs; // min/max strip +}; + + +struct MyGEMChamber +{ + void init(std::vector &sparts); + Int_t nh; // # of hits + Int_t nclu; // # of clusters + Int_t np; // # of partitions + Int_t nl; // # of layers + Float_t mint, maxt; // min/max TOF +}; + + +struct MyGEMEvent +{ + void init(std::vector &schambers); + Int_t nh; // #hits + Int_t nclu; // #clusters + Int_t np; // #partitions + Int_t nch; // #chambers w/ hits + //Short_t nch2, nch3, nch4, nch5, nch6; // #chambers w/ at least 2,3... hits }; +// ================================================================================================ + struct MyRPCDetId { void init(RPCDetId &id); - Int_t reg, ring, st, sec, layer, subsec, roll; - Int_t t; // type 1-8: RE1/2,1/3,2/2,2/3,3/2,3/3,4/2,4/3 + Short_t reg, ring, st, sec, layer, subsec, roll; + Short_t t; // type 1-8: RE1/2,1/3,2/2,2/3,3/2,3/3,4/2,4/3 }; + struct MyRPCSimHit { - void init(const PSimHit &sh, const RPCGeometry* rpc_g); + void init(PSimHit &sh, const RPCGeometry* rpc_g, const ParticleDataTable * pdt); + float eKin() {return sqrt(p*p + m*m) - m;} + bool operator < (const MyRPCSimHit &rhs) const; + Float_t x, y, z; // local + Float_t r, eta, phi, gx, gy, gz; // global + Float_t e; // energy deposit + Float_t p; // particle momentum + Float_t m; // particle mass + Float_t t; // TOF + Int_t trid; // trackId + Int_t pdg; // PDG + Int_t s; // Strip +}; + + +struct MyRPCCluster +{ + void init(std::vector &shits); + float eKin() {return sqrt(p*p + m*m) - m;} + std::vector hits; + Int_t nh; // # of hits + Float_t r, eta, phi, gx, gy, gz; // globals fot 1st hit + Float_t e; // total energy deposit + Float_t p, m; // 1st particle mass and initial momentum + Float_t mint, maxt; // min/max TOF + Float_t meant, sigmat;// mean&stdev of TOF + Int_t mintrid, maxtrid;// trackId + Int_t pdg; // PDG + Int_t mins, maxs; // min/max strip +}; + + +struct MyRPCRoll +{ + void init(int r, int l, std::vector &sclusters); + std::vector clusters; + Int_t rn; // roll #, not stored + Int_t ln; // layer #, not stored + Int_t nh; // # of hits + Int_t nclu; // # of clusters + Float_t mint, maxt; // min/max TOF + Int_t mintrid, maxtrid;// trackId + Int_t mins, maxs; // min/max strip +}; + + +struct MyRPCChamber +{ + void init(std::vector &srolls); + Int_t nh; // # of hits + Int_t nclu; // # of clusters + Int_t nr; // # of rolls + Int_t nl; // # of layers + Float_t mint, maxt; // min/max TOF +}; + + +struct MyRPCEvent +{ + void init(std::vector &schambers); + Int_t nh; // #hits + Int_t nclu; // #clusters + Int_t nr; // #rolls + Int_t nch; // #chambers w/ hits + //Short_t nch2, nch3, nch4, nch5, nch6; // #chambers w/ at least 2,3... hits +}; + + +// ================================================================================================ + +struct MyDTDetId +{ + void init(DTWireId &id); + Short_t st, wh, sec, sl, l, wire; + Short_t t; // +}; + + +struct MyDTSimHit +{ + void init(PSimHit &sh, const DTGeometry* dt_g, const ParticleDataTable * pdt); + float eKin() {return sqrt(p*p + m*m) - m;} Float_t x, y, z; // local - Float_t r, eta, phi, gz; // global + Float_t r, eta, phi, gx, gy, gz; // global Float_t e; // energy deposit + Float_t p; // particle momentum + Float_t m; // particle mass Float_t t; // TOF + Int_t trid; // trackId Int_t pdg; // PDG //Int_t w, s; // WG & Strip }; +// ================================================================================================ + class NeutronSimHitsAnalyzer : public edm::EDAnalyzer { public: explicit NeutronSimHitsAnalyzer(const edm::ParameterSet&); @@ -127,160 +382,266 @@ class NeutronSimHitsAnalyzer : public edm::EDAnalyzer { virtual void analyze(const edm::Event&, const edm::EventSetup&); virtual void endJob() ; - static const std::string csc_type[CSC_TYPES+1]; - static const std::string csc_type_[CSC_TYPES+1]; - static const std::string dt_type[DT_TYPES+1]; - static const std::string dt_type_[DT_TYPES+1]; - static const std::string rpcf_type[RPCF_TYPES+1]; - static const std::string rpcf_type_[RPCF_TYPES+1]; - static const std::string rpcb_type[RPCB_TYPES+1]; - static const std::string rpcb_type_[RPCB_TYPES+1]; + void analyzeCSC(); + void analyzeGEM(); + void analyzeDT(); + void analyzeRPC(); + + std::vector > clusterCSCHitsInLayer(std::vector &hits); + std::vector > clusterGEMHitsInPart(std::vector &hits); + std::vector > clusterRPCHitsInRoll(std::vector &hits); + std::vector > clusterDTHitsInLayer(std::vector &hits); private: // configuration parameters: edm::InputTag input_tag_csc_; + edm::InputTag input_tag_gem_; edm::InputTag input_tag_dt_; edm::InputTag input_tag_rpc_; bool input_is_neutrons_; - bool fill_csc_ch_tree_; - bool fill_csc_la_tree_; + bool do_csc_; + bool do_gem_; + bool do_rpc_; + bool do_dt_; + bool fill_csc_sh_tree_; + bool fill_gem_sh_tree_; bool fill_rpc_sh_tree_; + bool fill_dt_sh_tree_; - // misc utilities + // misc. utilities const CSCGeometry* csc_geometry; - const DTGeometry* dt_geometry; + const GEMGeometry* gem_geometry; + const DTGeometry* dt_geometry; const RPCGeometry* rpc_geometry; + const ParticleDataTable * pdt_; + SimHitAnalysis::PSimHitMapCSC simhit_map_csc; + SimHitAnalysis::PSimHitMap simhit_map_gem; + SimHitAnalysis::PSimHitMap simhit_map_rpc; + SimHitAnalysis::PSimHitMap simhit_map_dt; + + // sensitive areas + void calculateCSCDetectorAreas(); + void calculateGEMDetectorAreas(); + void calculateDTDetectorAreas(); + void calculateRPCDetectorAreas(); + + float csc_total_areas_cm2[CSC_TYPES+1]; + float gem_total_areas_cm2[GEM_TYPES+1]; + float dt_total_areas_cm2[DT_TYPES+1]; + float rpcb_total_areas_cm2[RPCB_TYPES+1]; + float rpcf_total_areas_cm2[RPCF_TYPES+1]; + + // vector index is over partitions + std::vector gem_total_part_areas_cm2[GEM_TYPES+1]; + std::vector gem_part_radii[GEM_TYPES+1]; // some counters: UInt_t evtn; UInt_t csc_shn; + UInt_t gem_shn; UInt_t rpc_shn; + UInt_t dt_shn; int nevt_with_cscsh, nevt_with_cscsh_in_rpc; int n_cscsh, n_cscsh_in_rpc; + int nevt_with_gemsh; + int n_gemsh; + int nevt_with_rpcsh, nevt_with_rpcsh_e, nevt_with_rpcsh_b; int n_rpcsh, n_rpcsh_e, n_rpcsh_b; + int nevt_with_dtsh; + int n_dtsh; + // some histos: TH2D * h_csc_rz_sh_xray; TH2D * h_csc_rz_sh_heatmap; + TH2D * h_csc_rz_clu_heatmap; TH1D * h_csc_nlayers_in_ch[CSC_TYPES+1]; TH1D * h_csc_nevt_fraction_with_sh; - TH1D * h_csc_shflux_per_layer; + TH1D * h_csc_hit_flux_per_layer; + TH1D * h_csc_hit_rate_per_ch; + TH1D * h_csc_clu_flux_per_layer; + TH1D * h_csc_clu_rate_per_ch; + + std::map pdg2idx; + TH2D * h_csc_tof_vs_ekin[CSC_TYPES+1][N_PDGIDS]; + + + TH2D * h_gem_rz_sh_heatmap; + TH1D * h_gem_nevt_fraction_with_sh; + TH1D * h_gem_hit_flux_per_layer; + TH1D * h_gem_hit_rate_per_ch; + TH1D * h_gem_clu_flux_per_layer; + TH1D * h_gem_clu_rate_per_ch; + TH2D * h_gem_tof_vs_ekin[N_PDGIDS]; + TH2D * h_rpc_rz_sh_heatmap; TH1D * h_rpcf_nevt_fraction_with_sh; - TH1D * h_rpcf_shflux_per_layer; + TH1D * h_rpcf_hit_flux_per_layer; + TH1D * h_rpcf_hit_rate_per_ch; + TH1D * h_rpcf_clu_flux_per_layer; + TH1D * h_rpcf_clu_rate_per_ch; TH1D * h_rpcb_nevt_fraction_with_sh; + TH1D * h_rpcb_hit_flux_per_layer; + TH1D * h_rpcb_hit_rate_per_ch; + TH1D * h_rpcb_clu_flux_per_layer; + TH1D * h_rpcb_clu_rate_per_ch; + + TH2D * h_rpcb_tof_vs_ekin[N_PDGIDS]; + TH2D * h_rpcf_tof_vs_ekin[N_PDGIDS]; + + + TH2D * h_dt_xy_sh_heatmap; + TH1D * h_dt_nevt_fraction_with_sh; + TH1D * h_dt_hit_flux_per_layer; + TH1D * h_dt_hit_rate_per_ch; + TH2D * h_dt_tof_vs_ekin[N_PDGIDS]; + TH2D * h_mu_rz_sh_heatmap; + TH2D * h_mu_xy_sh_heatmap; - // some ntuples: - void bookCSCChambersTree(); - void bookCSCLayersTree(); - void bookCSCSimHitsTree(); + TGraphErrors *gr_csc_hit_flux_me1, *gr_csc_hit_flux_me2, *gr_csc_hit_flux_me3, *gr_csc_hit_flux_me4; + TGraphErrors *gr_dt_hit_flux_mb1, *gr_dt_hit_flux_mb2, *gr_dt_hit_flux_mb3, *gr_dt_hit_flux_mb4; + + //TGraphErrors *gr_gem_hit_flux_me1; - void bookRPCSimHitsTree(); + // some ntuples: + void bookCSCSimHitsTrees(); + TTree* csc_ev_tree; TTree* csc_ch_tree; TTree* csc_la_tree; + TTree* csc_cl_tree; TTree* csc_sh_tree; - - TTree* rpc_sh_tree; - MyCSCDetId c_id; MyCSCDetId c_cid; MyCSCSimHit c_h; + MyCSCCluster c_cl; MyCSCLayer c_la; MyCSCChamber c_ch; - + MyCSCEvent c_ev; + + + void bookGEMSimHitsTrees(); + TTree* gem_ev_tree; + TTree* gem_ch_tree; + TTree* gem_part_tree; + TTree* gem_cl_tree; + TTree* gem_sh_tree; + MyGEMDetId g_id; + MyGEMSimHit g_h; + MyGEMCluster g_cl; + MyGEMPart g_part; + MyGEMChamber g_ch; + MyGEMEvent g_ev; + + + void bookRPCSimHitsTrees(); + TTree* rpc_ev_tree; + TTree* rpc_ch_tree; + TTree* rpc_rl_tree; + TTree* rpc_cl_tree; + TTree* rpc_sh_tree; MyRPCDetId r_id; MyRPCSimHit r_h; -}; + MyRPCCluster r_cl; + MyRPCRoll r_rl; + MyRPCChamber r_ch; + MyRPCEvent r_ev; -// -// constants, enums and typedefs -// -const std::string NeutronSimHitsAnalyzer::csc_type[CSC_TYPES+1] = - { "Any", "ME1/a", "ME1/b", "ME1/2", "ME1/3", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2"}; -const std::string NeutronSimHitsAnalyzer::csc_type_[CSC_TYPES+1] = - { "Any", "ME1a", "ME1b", "ME12", "ME13", "ME21", "ME22", "ME31", "ME32", "ME41", "ME42"}; + void bookDTSimHitsTrees(); + TTree* dt_sh_tree; + MyDTDetId d_id; + MyDTSimHit d_h; -const std::string NeutronSimHitsAnalyzer::dt_type[DT_TYPES+1] = - { "Any", "MB1/0", "MB1/1", "MB1/2", "MB2/0", "MB2/1", "MB2/2", "MB3/0", "MB3/1", "MB3/2", "MB4/0", "MB4/1", "MB4/2",}; -const std::string NeutronSimHitsAnalyzer::dt_type_[DT_TYPES+1] = - { "Any", "MB10", "MB11", "MB12", "MB20", "MB21", "MB22", "MB30", "MB31", "MB32", "MB40", "MB41", "MB42",}; +}; -const std::string NeutronSimHitsAnalyzer::rpcf_type[RPCF_TYPES+1] = - { "Any", "RE1/2", "RE1/3", "RE2/2", "RE2/3", "RE3/2", "RE3/3", "RE4/2", "RE4/3"}; -const std::string NeutronSimHitsAnalyzer::rpcf_type_[RPCF_TYPES+1] = - { "Any", "RE12", "RE13", "RE22", "RE23", "RE32", "RE33", "RE42", "RE43"}; -const std::string NeutronSimHitsAnalyzer::rpcb_type[RPCB_TYPES+1] = - { "Any", "RB1/0", "RB1/1", "RB1/2", "RB2/0", "RB2/1", "RB2/2", "RB3/0", "RB3/1", "RB3/2", "RB4/0", "RB4/1", "RB4/2",}; -const std::string NeutronSimHitsAnalyzer::rpcb_type_[RPCB_TYPES+1] = - { "Any", "RB10", "RB11", "RB12", "RB20", "RB21", "RB22", "RB30", "RB31", "RB32", "RB40", "RB41", "RB42",}; // ================================================================================================ -NeutronSimHitsAnalyzer::NeutronSimHitsAnalyzer(const edm::ParameterSet& iConfig): - simhit_map_csc() +NeutronSimHitsAnalyzer::NeutronSimHitsAnalyzer(const edm::ParameterSet& iConfig) { // should be set to false if running over a regular MB sample - input_is_neutrons_ = iConfig.getUntrackedParameter< bool >("inputIsNeutrons",true); + input_is_neutrons_ = iConfig.getUntrackedParameter< bool >("inputIsNeutrons", true); edm::InputTag default_tag_csc("g4SimHits","MuonCSCHits"); + edm::InputTag default_tag_gem("g4SimHits","MuonGEMHits"); edm::InputTag default_tag_dt("g4SimHits","MuonDTHits"); edm::InputTag default_tag_rpc("g4SimHits","MuonRPCHits"); if (input_is_neutrons_) { default_tag_csc = edm::InputTag("cscNeutronWriter",""); + default_tag_gem = edm::InputTag("gemNeutronWriter",""); default_tag_dt = edm::InputTag("dtNeutronWriter",""); default_tag_rpc = edm::InputTag("rpcNeutronWriter",""); } input_tag_csc_ = iConfig.getUntrackedParameter("inputTagCSC", default_tag_csc); + input_tag_gem_ = iConfig.getUntrackedParameter("inputTagGEM", default_tag_gem); input_tag_dt_ = iConfig.getUntrackedParameter("inputTagDT", default_tag_dt); - input_tag_rpc_ = iConfig.getUntrackedParameter("inputTagCSC", default_tag_rpc); + input_tag_rpc_ = iConfig.getUntrackedParameter("inputTagRPC", default_tag_rpc); simhit_map_csc.setInputTag(input_tag_csc_); + simhit_map_gem.setInputTag(input_tag_gem_); + simhit_map_rpc.setInputTag(input_tag_rpc_); + simhit_map_dt.setInputTag(input_tag_dt_); + + + do_csc_ = iConfig.getUntrackedParameter< bool >("doCSC", true); + do_gem_ = iConfig.getUntrackedParameter< bool >("doGEM", true); + do_rpc_ = iConfig.getUntrackedParameter< bool >("doRPC", true); + do_dt_ = iConfig.getUntrackedParameter< bool >("doDT", true); + + + fill_csc_sh_tree_ = do_csc_ && iConfig.getUntrackedParameter< bool >("fillCSCSimHitsTrees",true); + if (fill_csc_sh_tree_) bookCSCSimHitsTrees(); + fill_gem_sh_tree_ = do_gem_ && iConfig.getUntrackedParameter< bool >("fillGEMSimHitsTrees",true); + if (fill_gem_sh_tree_) bookGEMSimHitsTrees(); + fill_rpc_sh_tree_ = do_rpc_ && iConfig.getUntrackedParameter< bool >("fillRPCSimHitsTree",true); + if (fill_rpc_sh_tree_) bookRPCSimHitsTrees(); + + fill_dt_sh_tree_ = do_dt_ && iConfig.getUntrackedParameter< bool >("fillDTSimHitsTree",true); + if (fill_dt_sh_tree_) bookDTSimHitsTrees(); + + + evtn = 0; nevt_with_cscsh = nevt_with_cscsh_in_rpc = n_cscsh = n_cscsh_in_rpc = 0; + nevt_with_gemsh = n_gemsh = 0; nevt_with_rpcsh = nevt_with_rpcsh_e = nevt_with_rpcsh_b = n_rpcsh = n_rpcsh_e = n_rpcsh_b = 0; + nevt_with_dtsh = n_dtsh = 0; - fill_csc_sh_tree_ = iConfig.getUntrackedParameter< bool >("fillCSCSimHitsTree",true); - if (fill_csc_sh_tree_) bookCSCSimHitsTree(); - fill_csc_la_tree_ = iConfig.getUntrackedParameter< bool >("fillCSCLayersTree",true); - if (fill_csc_la_tree_) bookCSCLayersTree(); - fill_csc_ch_tree_ = iConfig.getUntrackedParameter< bool >("fillCSCChambersTree",true); - if (fill_csc_ch_tree_) bookCSCChambersTree(); - - fill_rpc_sh_tree_ = iConfig.getUntrackedParameter< bool >("fillRPCSimHitsTree",true); - if (fill_rpc_sh_tree_) bookRPCSimHitsTree(); edm::Service fs; std::string n_simhits = "n-SimHits"; if (!input_is_neutrons_) n_simhits = "SimHits"; + std::string n_clusters = "n-Clusters"; + if (!input_is_neutrons_) n_clusters = "Clusters"; - h_csc_rz_sh_xray = fs->make("h_csc_rz_sh_xray",("CSC "+n_simhits+" #rho-z X-ray;z, cm;#rho, cm").c_str(),2060,550,1080,750,0,750); - h_csc_rz_sh_heatmap = fs->make("h_csc_rz_sh_heatmap",("CSC "+n_simhits+" #rho-z;z, cm;#rho, cm").c_str(),230,550,1080,150,0,750); + h_csc_rz_sh_xray = fs->make("h_csc_rz_sh_xray",("CSC "+n_simhits+" #rho-z X-ray;z, cm;#rho, cm").c_str(),2060,550,1080,755,0,755); + h_csc_rz_sh_heatmap = fs->make("h_csc_rz_sh_heatmap",("CSC "+n_simhits+" #rho-z;z, cm;#rho, cm").c_str(),220,541.46,1101.46,150,0,755); + h_csc_rz_clu_heatmap = fs->make("h_csc_rz_clu_heatmap",("CSC "+n_clusters+" #rho-z;z, cm;#rho, cm").c_str(),220,541.46,1101.46,150,0,755); char label[200], nlabel[200]; @@ -291,34 +652,213 @@ NeutronSimHitsAnalyzer::NeutronSimHitsAnalyzer(const edm::ParameterSet& iConfig) h_csc_nlayers_in_ch[me] = fs->make(label, nlabel, 6, 0.5, 6.5); } - h_csc_nevt_fraction_with_sh = - fs->make("h_csc_nevt_fraction_with_sh", ("Fraction of events with "+n_simhits+" by CSC type").c_str(), CSC_TYPES+1, -0.5, CSC_TYPES+0.5); + h_csc_nevt_fraction_with_sh = fs->make("h_csc_nevt_fraction_with_sh", + ("Fraction of events with "+n_simhits+" by CSC type;ME station/ring").c_str(), CSC_TYPES+1, -0.5, CSC_TYPES+0.5); for (int i=1; i<=h_csc_nevt_fraction_with_sh->GetXaxis()->GetNbins();i++) h_csc_nevt_fraction_with_sh->GetXaxis()->SetBinLabel(i,csc_type[i-1].c_str()); - h_csc_shflux_per_layer = fs->make("h_csc_shflux_per_layer", (n_simhits+" Flux per CSC layer at L=10^{34}").c_str(), CSC_TYPES, 0.5, CSC_TYPES+0.5); - for (int i=1; i<=h_csc_shflux_per_layer->GetXaxis()->GetNbins();i++) - h_csc_shflux_per_layer->GetXaxis()->SetBinLabel(i,csc_type[i].c_str()); - h_csc_shflux_per_layer->GetYaxis()->SetTitle("Hz/cm^{2}"); + h_csc_hit_flux_per_layer = fs->make("h_csc_hit_flux_per_layer", + (n_simhits+" Flux per CSC layer at L=10^{34};ME station/ring;Hz/cm^{2}").c_str(), CSC_TYPES, 0.5, CSC_TYPES+0.5); + for (int i=1; i<=h_csc_hit_flux_per_layer->GetXaxis()->GetNbins();i++) + h_csc_hit_flux_per_layer->GetXaxis()->SetBinLabel(i,csc_type[i].c_str()); + + h_csc_hit_rate_per_ch = fs->make("h_csc_hit_rate_per_ch", + (n_simhits+" rate per chamber in CSC at L=10^{34};ME station/ring;kHz").c_str(), CSC_TYPES, 0.5, CSC_TYPES+0.5); + for (int i=1; i<=h_csc_hit_rate_per_ch->GetXaxis()->GetNbins();i++) + h_csc_hit_rate_per_ch->GetXaxis()->SetBinLabel(i,csc_type[i].c_str()); + + h_csc_clu_flux_per_layer = fs->make("h_csc_clu_flux_per_layer", + (n_clusters+" Flux per CSC layer at L=10^{34};ME station/ring;Hz/cm^{2}").c_str(), CSC_TYPES, 0.5, CSC_TYPES+0.5); + for (int i=1; i<=h_csc_clu_flux_per_layer->GetXaxis()->GetNbins();i++) + h_csc_clu_flux_per_layer->GetXaxis()->SetBinLabel(i,csc_type[i].c_str()); + + h_csc_clu_rate_per_ch = fs->make("h_csc_clu_rate_per_ch", + (n_clusters+" rate per chamber in CSC at L=10^{34};ME station/ring;Hz/cm^{2}").c_str(), CSC_TYPES, 0.5, CSC_TYPES+0.5); + for (int i=1; i<=h_csc_clu_rate_per_ch->GetXaxis()->GetNbins();i++) + h_csc_clu_rate_per_ch->GetXaxis()->SetBinLabel(i,csc_type[i].c_str()); + + for (int pdg=1; pdgmake(label, nlabel, 450, -4, 5, 350, 1, 8); + h_csc_tof_vs_ekin[me][pdg]->SetMarkerColor(pdg_colors[pdg]); + h_csc_tof_vs_ekin[me][pdg]->SetMarkerStyle(pdg_markers[pdg]); + } + + + + h_gem_rz_sh_heatmap = fs->make("h_gem_rz_sh_heatmap",("GEM "+n_simhits+" #rho-z;z, cm;#rho, cm").c_str(),572,0,1120,160,0,800); + + h_gem_nevt_fraction_with_sh = fs->make("h_gem_nevt_fraction_with_sh", + ("Fraction of events with "+n_simhits+" by GEM type;GE station/ring").c_str(), GEM_TYPES+1, -0.5, GEM_TYPES+0.5); + for (int i=1; i<=h_gem_nevt_fraction_with_sh->GetXaxis()->GetNbins();i++) + h_gem_nevt_fraction_with_sh->GetXaxis()->SetBinLabel(i,gem_type[i-1].c_str()); + + h_gem_hit_flux_per_layer = fs->make("h_gem_hit_flux_per_layer", + (n_simhits+" Flux in GEM at L=10^{34};RE station/ring;Hz/cm^{2}").c_str(), GEM_TYPES, 0.5, GEM_TYPES+0.5); + for (int i=1; i<=h_gem_hit_flux_per_layer->GetXaxis()->GetNbins();i++) + h_gem_hit_flux_per_layer->GetXaxis()->SetBinLabel(i,gem_type[i].c_str()); + + h_gem_hit_rate_per_ch = fs->make("h_gem_hit_rate_per_ch", + (n_simhits+" rate per chamber in GEM at L=10^{34};GE station/ring;kHz").c_str(), GEM_TYPES, 0.5, GEM_TYPES+0.5); + for (int i=1; i<=h_gem_hit_rate_per_ch->GetXaxis()->GetNbins();i++) + h_gem_hit_rate_per_ch->GetXaxis()->SetBinLabel(i,gem_type[i].c_str()); + + h_gem_clu_flux_per_layer = fs->make("h_gem_clu_flux_per_layer", + (n_clusters+" Flux in GEM at L=10^{34};GE station/ring;Hz/cm^{2}").c_str(), GEM_TYPES, 0.5, GEM_TYPES+0.5); + for (int i=1; i<=h_gem_clu_flux_per_layer->GetXaxis()->GetNbins();i++) + h_gem_clu_flux_per_layer->GetXaxis()->SetBinLabel(i,gem_type[i].c_str()); + + h_gem_clu_rate_per_ch = fs->make("h_gem_clu_rate_per_ch", + (n_clusters+" rate per chamber in GEM L=10^{34};GE station/ring;kHz").c_str(), GEM_TYPES, 0.5, GEM_TYPES+0.5); + for (int i=1; i<=h_gem_clu_rate_per_ch->GetXaxis()->GetNbins();i++) + h_gem_clu_rate_per_ch->GetXaxis()->SetBinLabel(i,gem_type[i].c_str()); + + for (int pdg=1; pdgmake(label, nlabel, 450, -4, 5, 350, 1, 8); + h_gem_tof_vs_ekin[pdg]->SetMarkerColor(pdg_colors[pdg]); + h_gem_tof_vs_ekin[pdg]->SetMarkerStyle(pdg_markers[pdg]); + } + - h_rpc_rz_sh_heatmap = fs->make("h_rpc_rz_sh_heatmap",("RPC "+n_simhits+" #rho-z;z, cm;#rho, cm").c_str(),450,0,1080,160,0,800); + h_rpc_rz_sh_heatmap = fs->make("h_rpc_rz_sh_heatmap",("RPC "+n_simhits+" #rho-z;z, cm;#rho, cm").c_str(),572,0,1120,160,0,800); - h_rpcf_nevt_fraction_with_sh = - fs->make("h_rpcf_nevt_fraction_with_sh", ("Fraction of events with "+n_simhits+" by RPFf type").c_str(), RPCF_TYPES+1, -0.5, RPCF_TYPES+0.5); + h_rpcf_nevt_fraction_with_sh = fs->make("h_rpcf_nevt_fraction_with_sh", + ("Fraction of events with "+n_simhits+" by RPFf type;RE station/ring").c_str(), RPCF_TYPES+1, -0.5, RPCF_TYPES+0.5); for (int i=1; i<=h_rpcf_nevt_fraction_with_sh->GetXaxis()->GetNbins();i++) h_rpcf_nevt_fraction_with_sh->GetXaxis()->SetBinLabel(i,rpcf_type[i-1].c_str()); - h_rpcf_shflux_per_layer = fs->make("h_rpcf_shflux_per_layer", (n_simhits+" Flux in RPCf at L=10^{34}").c_str(), RPCF_TYPES, 0.5, RPCF_TYPES+0.5); - for (int i=1; i<=h_rpcf_shflux_per_layer->GetXaxis()->GetNbins();i++) - h_rpcf_shflux_per_layer->GetXaxis()->SetBinLabel(i,rpcf_type[i].c_str()); - h_rpcf_shflux_per_layer->GetYaxis()->SetTitle("Hz/cm^{2}"); + h_rpcf_hit_flux_per_layer = fs->make("h_rpcf_hit_flux_per_layer", + (n_simhits+" Flux in RPCf at L=10^{34};RE station/ring;Hz/cm^{2}").c_str(), RPCF_TYPES, 0.5, RPCF_TYPES+0.5); + for (int i=1; i<=h_rpcf_hit_flux_per_layer->GetXaxis()->GetNbins();i++) + h_rpcf_hit_flux_per_layer->GetXaxis()->SetBinLabel(i,rpcf_type[i].c_str()); + + h_rpcf_hit_rate_per_ch = fs->make("h_rpcf_hit_rate_per_ch", + (n_simhits+" rate per chamber in RPCf at L=10^{34};RE station/ring;kHz").c_str(), RPCF_TYPES, 0.5, RPCF_TYPES+0.5); + for (int i=1; i<=h_rpcf_hit_rate_per_ch->GetXaxis()->GetNbins();i++) + h_rpcf_hit_rate_per_ch->GetXaxis()->SetBinLabel(i,rpcf_type[i].c_str()); + + h_rpcf_clu_flux_per_layer = fs->make("h_rpcf_clu_flux_per_layer", + (n_clusters+" Flux in RPCf at L=10^{34};RE station/ring;Hz/cm^{2}").c_str(), RPCF_TYPES, 0.5, RPCF_TYPES+0.5); + for (int i=1; i<=h_rpcf_clu_flux_per_layer->GetXaxis()->GetNbins();i++) + h_rpcf_clu_flux_per_layer->GetXaxis()->SetBinLabel(i,rpcf_type[i].c_str()); - h_rpcb_nevt_fraction_with_sh = - fs->make("h_rpcb_nevt_fraction_with_sh", ("Fraction of events with "+n_simhits+" by RPFb type").c_str(), RPCB_TYPES+1, -0.5, RPCB_TYPES+0.5); + h_rpcf_clu_rate_per_ch = fs->make("h_rpcf_clu_rate_per_ch", + (n_clusters+" rate per chamber in RPCf at L=10^{34};RE station/ring;kHz").c_str(), RPCF_TYPES, 0.5, RPCF_TYPES+0.5); + for (int i=1; i<=h_rpcf_clu_rate_per_ch->GetXaxis()->GetNbins();i++) + h_rpcf_clu_rate_per_ch->GetXaxis()->SetBinLabel(i,rpcf_type[i].c_str()); + + + h_rpcb_nevt_fraction_with_sh = fs->make("h_rpcb_nevt_fraction_with_sh", + ("Fraction of events with "+n_simhits+" by RPFb type;RB station/|wheel|").c_str(), RPCB_TYPES+1, -0.5, RPCB_TYPES+0.5); for (int i=1; i<=h_rpcb_nevt_fraction_with_sh->GetXaxis()->GetNbins();i++) h_rpcb_nevt_fraction_with_sh->GetXaxis()->SetBinLabel(i,rpcb_type[i-1].c_str()); - h_mu_rz_sh_heatmap = fs->make("h_mu_rz_sh_heatmap", (n_simhits+" #rho-z;z, cm;#rho, cm").c_str(),480,0,1100,160,0,800); + h_rpcb_hit_flux_per_layer = fs->make("h_rpcb_hit_flux_per_layer", + (n_simhits+" Flux in RPCb at L=10^{34};RB station/|wheel|;Hz/cm^{2}").c_str(), RPCB_TYPES, 0.5, RPCB_TYPES+0.5); + for (int i=1; i<=h_rpcb_hit_flux_per_layer->GetXaxis()->GetNbins();i++) + h_rpcb_hit_flux_per_layer->GetXaxis()->SetBinLabel(i,rpcb_type[i].c_str()); + + h_rpcb_hit_rate_per_ch = fs->make("h_rpcb_hit_rate_per_ch", + (n_simhits+" rate per chamber in RPCb at L=10^{34};RB station/|wheel|;kHz").c_str(), RPCB_TYPES, 0.5, RPCB_TYPES+0.5); + for (int i=1; i<=h_rpcb_hit_rate_per_ch->GetXaxis()->GetNbins();i++) + h_rpcb_hit_rate_per_ch->GetXaxis()->SetBinLabel(i,rpcb_type[i].c_str()); + + h_rpcb_clu_flux_per_layer = fs->make("h_rpcb_clu_flux_per_layer", + (n_clusters+" Flux in RPCb at L=10^{34};RB station/|wheel|;Hz/cm^{2}").c_str(), RPCB_TYPES, 0.5, RPCB_TYPES+0.5); + for (int i=1; i<=h_rpcb_clu_flux_per_layer->GetXaxis()->GetNbins();i++) + h_rpcb_clu_flux_per_layer->GetXaxis()->SetBinLabel(i,rpcb_type[i].c_str()); + + h_rpcb_clu_rate_per_ch = fs->make("h_rpcb_clu_rate_per_ch", + (n_clusters+" rate per chamber in RPCb at L=10^{34};RB station/|wheel|;kHz").c_str(), RPCB_TYPES, 0.5, RPCB_TYPES+0.5); + for (int i=1; i<=h_rpcb_clu_rate_per_ch->GetXaxis()->GetNbins();i++) + h_rpcb_clu_rate_per_ch->GetXaxis()->SetBinLabel(i,rpcb_type[i].c_str()); + + for (int pdg=1; pdgmake(label, nlabel, 450, -4, 5, 350, 1, 8); + h_rpcb_tof_vs_ekin[pdg]->SetMarkerColor(pdg_colors[pdg]); + h_rpcb_tof_vs_ekin[pdg]->SetMarkerStyle(pdg_markers[pdg]); + + sprintf(label,"h_rpcf_tof_vs_ekin_%s", pdg_ids_names_[pdg].c_str()); + sprintf(nlabel,"SimHit time vs. E_{kin}: RPCf;log_{10}E_{kin}(MeV);log_{10}TOF(ns)"); + h_rpcf_tof_vs_ekin[pdg] = fs->make(label, nlabel, 450, -4, 5, 350, 1, 8); + h_rpcf_tof_vs_ekin[pdg]->SetMarkerColor(pdg_colors[pdg]); + h_rpcf_tof_vs_ekin[pdg]->SetMarkerStyle(pdg_markers[pdg]); + } + + + + h_dt_xy_sh_heatmap = fs->make("h_dt_xy_sh_heatmap",("DT "+n_simhits+" xy;x, cm;y, cm").c_str(),320,-800.,800.,320,-800.,800.); + + h_dt_nevt_fraction_with_sh = fs->make("h_dt_nevt_fraction_with_sh", + ("Fraction of events with "+n_simhits+" by DT type;DT station/|wheel|").c_str(), DT_TYPES+1, -0.5, DT_TYPES+0.5); + for (int i=1; i<=h_dt_nevt_fraction_with_sh->GetXaxis()->GetNbins();i++) + h_dt_nevt_fraction_with_sh->GetXaxis()->SetBinLabel(i,dt_type[i-1].c_str()); + + h_dt_hit_flux_per_layer = fs->make("h_dt_hit_flux_per_layer", + (n_simhits+" Flux per DT layer at L=10^{34};DT station/|wheel|;Hz/cm^{2}").c_str(), DT_TYPES, 0.5, DT_TYPES+0.5); + for (int i=1; i<=h_dt_hit_flux_per_layer->GetXaxis()->GetNbins();i++) + h_dt_hit_flux_per_layer->GetXaxis()->SetBinLabel(i,dt_type[i].c_str()); + + h_dt_hit_rate_per_ch = fs->make("h_dt_hit_rate_per_ch", + (n_simhits+" rate per chamber in DT at L=10^{34};DT station/|wheel|;kHz").c_str(), DT_TYPES, 0.5, DT_TYPES+0.5); + for (int i=1; i<=h_dt_hit_rate_per_ch->GetXaxis()->GetNbins();i++) + h_dt_hit_rate_per_ch->GetXaxis()->SetBinLabel(i,dt_type[i].c_str()); + + for (int pdg=1; pdgmake(label, nlabel, 450, -4, 5, 350, 1, 8); + h_dt_tof_vs_ekin[pdg]->SetMarkerColor(pdg_colors[pdg]); + h_dt_tof_vs_ekin[pdg]->SetMarkerStyle(pdg_markers[pdg]); + } + + + h_mu_xy_sh_heatmap = fs->make("h_mu_xy_sh_heatmap",("Barrel "+n_simhits+" xy;x, cm;y, cm").c_str(),320,-800.,800.,320,-800.,800.); + + h_mu_rz_sh_heatmap = fs->make("h_mu_rz_sh_heatmap", (n_simhits+" #rho-z;z, cm;#rho, cm").c_str(),572,0,1120,160,0,800); + + + gr_csc_hit_flux_me1 = fs->make(4); + gr_csc_hit_flux_me1->SetName("gr_csc_hit_flux_me1"); + gr_csc_hit_flux_me1->SetTitle("SimHit Flux in ME1;r, cm;Hz/cm^{2}"); + gr_csc_hit_flux_me2 = fs->make(2); + gr_csc_hit_flux_me2->SetName("gr_csc_hit_flux_me2"); + gr_csc_hit_flux_me2->SetTitle("SimHit Flux in ME2;r, cm;Hz/cm^{2}"); + gr_csc_hit_flux_me3 = fs->make(2); + gr_csc_hit_flux_me3->SetName("gr_csc_hit_flux_me3"); + gr_csc_hit_flux_me3->SetTitle("SimHit Flux in ME3;r, cm;Hz/cm^{2}"); + gr_csc_hit_flux_me4 = fs->make(2); + gr_csc_hit_flux_me4->SetName("gr_csc_hit_flux_me4"); + gr_csc_hit_flux_me4->SetTitle("SimHit Flux in ME3;r, cm;Hz/cm^{2}"); + + gr_dt_hit_flux_mb1 = fs->make(3); + gr_dt_hit_flux_mb1->SetName("gr_dt_hit_flux_mb1"); + gr_dt_hit_flux_mb1->SetTitle("SimHit Flux in MB1;z, cm;Hz/cm^{2}"); + gr_dt_hit_flux_mb2 = fs->make(3); + gr_dt_hit_flux_mb2->SetName("gr_dt_hit_flux_mb2"); + gr_dt_hit_flux_mb2->SetTitle("SimHit Flux in MB2;z, cm;Hz/cm^{2}"); + gr_dt_hit_flux_mb3 = fs->make(3); + gr_dt_hit_flux_mb3->SetName("gr_dt_hit_flux_mb3"); + gr_dt_hit_flux_mb3->SetTitle("SimHit Flux in MB3;z, cm;Hz/cm^{2}"); + gr_dt_hit_flux_mb4 = fs->make(3); + gr_dt_hit_flux_mb4->SetName("gr_dt_hit_flux_mb4"); + gr_dt_hit_flux_mb4->SetTitle("SimHit Flux in MB4;z, cm;Hz/cm^{2}"); + + //gr_gem_hit_flux_me1 = fs->make(2); + //gr_gem_hit_flux_me1->SetName("gr_gem_hit_flux_me1"); + //gr_gem_hit_flux_me1->SetTitle("SimHit Flux in GE1;r, cm;Hz/cm^{2}"); } // ================================================================================================ @@ -328,58 +868,124 @@ NeutronSimHitsAnalyzer::~NeutronSimHitsAnalyzer() // ================================================================================================ void -NeutronSimHitsAnalyzer::bookCSCSimHitsTree() +NeutronSimHitsAnalyzer::bookCSCSimHitsTrees() { edm::Service fs; + csc_sh_tree = fs->make("CSCSimHitsTree", "CSCSimHitsTree"); csc_sh_tree->Branch("evtn", &evtn,"evtn/i"); csc_sh_tree->Branch("shn", &csc_shn,"shn/i"); - csc_sh_tree->Branch("id", &c_id.e,"e/I:s:r:c:l:t"); - csc_sh_tree->Branch("sh", &c_h.x,"x/F:y:z:r:eta:phi:gz:e:t:pdg/I:w:s"); + csc_sh_tree->Branch("id", &c_id.e,"e/S:s:r:c:l:t"); + csc_sh_tree->Branch("sh", &c_h.x,"x/F:y:z:r:eta:phi:gx:gy:gz:e:p:m:t:trid/I:pdg:w:s"); //csc_sh_tree->Branch("", &., "/I"); //csc_sh_tree->Branch("" , "vector" , & ); -} + csc_cl_tree = fs->make("CSCClustersTree", "CSCClustersTree"); + csc_cl_tree->Branch("evtn", &evtn,"evtn/i"); + csc_cl_tree->Branch("id", &c_id.e,"e/S:s:r:c:l:t"); + csc_cl_tree->Branch("cl", &c_cl.nh,"nh/I:r/F:eta:phi:gx:gy:gz:e:p:m:mint:maxt:meant:sigmat:mintrid/I:maxtrid:pdg/I:minw:maxw:mins:maxs"); -// ================================================================================================ -void -NeutronSimHitsAnalyzer::bookCSCLayersTree() -{ - edm::Service fs; csc_la_tree = fs->make("CSCLayersTree", "CSCLayersTree"); csc_la_tree->Branch("evtn", &evtn,"evtn/i"); - csc_la_tree->Branch("id", &c_id.e,"e/I:s:r:c:l:t"); - csc_la_tree->Branch("la", &c_la.ln,"ln/I:nh:mint/F:maxt:meant:sigmat:minw/I:maxw:mins:maxs"); + csc_la_tree->Branch("id", &c_id.e,"e/S:s:r:c:l:t"); + csc_la_tree->Branch("la", &c_la.nh,"nh/I:nclu:mint/F:maxt:mintrid/I:maxtrid:minw:maxw:mins:maxs"); + + csc_ch_tree = fs->make("CSCChambersTree", "CSCChambersTree"); + csc_ch_tree->Branch("evtn", &evtn,"evtn/i"); + csc_ch_tree->Branch("id", &c_cid.e,"e/S:s:r:c:l:t"); + csc_ch_tree->Branch("ch", &c_ch.nh,"nh/I:nclu:nl:l1:ln:mint/F:maxt:minw/I:maxw:mins:maxs"); + + csc_ev_tree = fs->make("CSCEventsTree", "CSCEventsTree"); + csc_ev_tree->Branch("evtn", &evtn,"evtn/i"); + csc_ev_tree->Branch("ev", &c_ev.nh,"nh/I:nclu:nch:nch2:nch3:nch4:nch5:nch6"); } // ================================================================================================ void -NeutronSimHitsAnalyzer::bookCSCChambersTree() +NeutronSimHitsAnalyzer::bookGEMSimHitsTrees() { edm::Service fs; - csc_ch_tree = fs->make("CSCChambersTree", "CSCChambersTree"); - csc_ch_tree->Branch("evtn", &evtn,"evtn/i"); - csc_ch_tree->Branch("id", &c_cid.e,"e/I:s:r:c:l:t"); - csc_ch_tree->Branch("ch", &c_ch.nh,"nh/I:nl:l1:ln:mint/F:maxt:meant:sigmat:minw/I:maxw:mins:maxs"); + gem_sh_tree = fs->make("GEMSimHitsTree", "GEMSimHitsTree"); + gem_sh_tree->Branch("evtn", &evtn,"evtn/i"); + gem_sh_tree->Branch("shn", &gem_shn,"shn/i"); + gem_sh_tree->Branch("id", &g_id.reg,"reg/S:ring:st:layer:ch:part:t"); + gem_sh_tree->Branch("sh", &g_h.x,"x/F:y:z:r:eta:phi:gx:gy:gz:e:p:m:t:trid/I:pdg:s"); + + gem_cl_tree = fs->make("GEMClustersTree", "GEMClustersTree"); + gem_cl_tree->Branch("evtn", &evtn,"evtn/i"); + gem_cl_tree->Branch("id", &g_id.reg,"reg/S:ring:st:layer:ch:part:t"); + gem_cl_tree->Branch("cl", &g_cl.nh,"nh/I:r/F:eta:phi:gx:gy:gz:e:p:m:mint:maxt:meant:sigmat:mintrid/I:maxtrid:pdg/I:mins:maxs"); + + gem_part_tree = fs->make("GEMPartTree", "GEMPartTree"); + gem_part_tree->Branch("evtn", &evtn,"evtn/i"); + gem_part_tree->Branch("id", &g_id.reg,"reg/S:ring:st:layer:ch:part:t"); + gem_part_tree->Branch("part", &g_part.nh,"nh/I:nclu:mint/F:maxt:mintrid/I:maxtrid:mins:maxs"); + + gem_ch_tree = fs->make("GEMChambersTree", "GEMChambersTree"); + gem_ch_tree->Branch("evtn", &evtn,"evtn/i"); + gem_ch_tree->Branch("id", &g_id.reg,"reg/S:ring:st:layer:ch:part:t"); + gem_ch_tree->Branch("ch", &g_ch.nh,"nh/I:nclu:np:nl:mint/F:maxt"); + + gem_ev_tree = fs->make("GEMEventsTree", "GEMEventsTree"); + gem_ev_tree->Branch("evtn", &evtn,"evtn/i"); + gem_ev_tree->Branch("ev", &g_ev.nh,"nh/I:nclu:np:nch"); + + //gem_sh_tree->Branch("", &., "/I"); + //gem_sh_tree->Branch("" , "vector" , & ); } // ================================================================================================ void -NeutronSimHitsAnalyzer::bookRPCSimHitsTree() +NeutronSimHitsAnalyzer::bookRPCSimHitsTrees() { edm::Service fs; rpc_sh_tree = fs->make("RPCSimHitsTree", "RPCSimHitsTree"); rpc_sh_tree->Branch("evtn", &evtn,"evtn/i"); rpc_sh_tree->Branch("shn", &rpc_shn,"shn/i"); - rpc_sh_tree->Branch("id", &r_id.reg,"reg/I:ring:st:sec:layer:subsec:roll:t"); - rpc_sh_tree->Branch("sh", &r_h.x,"x/F:y:z:r:eta:phi:gz:e:t:pdg/I"); + rpc_sh_tree->Branch("id", &r_id.reg,"reg/S:ring:st:sec:layer:subsec:roll:t"); + rpc_sh_tree->Branch("sh", &r_h.x,"x/F:y:z:r:eta:phi:gx:gy:gz:e:p:m:t:trid/I:pdg:s"); + + rpc_cl_tree = fs->make("RPCClustersTree", "RPCClustersTree"); + rpc_cl_tree->Branch("evtn", &evtn,"evtn/i"); + rpc_cl_tree->Branch("id", &r_id.reg,"reg/S:ring:st:sec:layer:subsec:roll:t"); + rpc_cl_tree->Branch("cl", &r_cl.nh,"nh/I:r/F:eta:phi:gx:gy:gz:e:p:m:mint:maxt:meant:sigmat:mintrid/I:maxtrid:pdg/I:mins:maxs"); + + rpc_rl_tree = fs->make("RPCRollsTree", "RPCRollsTree"); + rpc_rl_tree->Branch("evtn", &evtn,"evtn/i"); + rpc_rl_tree->Branch("id", &r_id.reg,"reg/S:ring:st:sec:layer:subsec:roll:t"); + rpc_rl_tree->Branch("rl", &r_rl.nh,"nh/I:nclu:mint/F:maxt:mintrid/I:maxtrid:mins:maxs"); + + rpc_ch_tree = fs->make("RPCChambersTree", "RPCChambersTree"); + rpc_ch_tree->Branch("evtn", &evtn,"evtn/i"); + rpc_ch_tree->Branch("id", &r_id.reg,"reg/S:ring:st:sec:layer:subsec:roll:t"); + rpc_ch_tree->Branch("ch", &r_ch.nh,"nh/I:nclu:nr:nl:mint/F:maxt"); + + rpc_ev_tree = fs->make("RPCEventsTree", "RPCEventsTree"); + rpc_ev_tree->Branch("evtn", &evtn,"evtn/i"); + rpc_ev_tree->Branch("ev", &r_ev.nh,"nh/I:nclu:nr:nch"); + //rpc_sh_tree->Branch("", &., "/I"); //rpc_sh_tree->Branch("" , "vector" , & ); } +// ================================================================================================ +void +NeutronSimHitsAnalyzer::bookDTSimHitsTrees() +{ + edm::Service fs; + dt_sh_tree = fs->make("DTSimHitsTree", "DTSimHitsTree"); + dt_sh_tree->Branch("evtn", &evtn,"evtn/i"); + dt_sh_tree->Branch("shn", &dt_shn,"shn/i"); + dt_sh_tree->Branch("id", &d_id.st,"st/I:wh:sec:sl:l:wire:t"); + dt_sh_tree->Branch("sh", &r_h.x,"x/F:y:z:r:eta:phi:gx:gy:gz:e:p:m:t:trid/I:pdg"); + //dt_sh_tree->Branch("", &., "/I"); + //dt_sh_tree->Branch("" , "vector" , & ); +} + + // ================================================================================================ void MyCSCDetId::init(CSCDetId &id) @@ -395,16 +1001,26 @@ MyCSCDetId::init(CSCDetId &id) // ================================================================================================ void -MyCSCSimHit::init(PSimHit &sh, const CSCGeometry* csc_g) +MyCSCSimHit::init(PSimHit &sh, const CSCGeometry* csc_g, const ParticleDataTable * pdt) { LocalPoint hitLP = sh.localPosition(); + pdg = sh.particleType(); + m = 0.00051; + + ParticleData const *pdata = 0; + HepPDT::ParticleID particleType(pdg); + if (particleType.isValid()) pdata = pdt->particle(particleType); + if (pdata) m = pdata->mass(); + // cout<<" "<name()<<" "<layer(layerId); @@ -413,6 +1029,8 @@ MyCSCSimHit::init(PSimHit &sh, const CSCGeometry* csc_g) r = hitGP.perp(); eta = hitGP.eta(); phi = hitGP.phi(); + gx = hitGP.x(); + gy = hitGP.y(); gz = hitGP.z(); w = csclayer->geometry()->wireGroup(csclayer->geometry()->nearestWire(hitLP)); @@ -420,74 +1038,123 @@ MyCSCSimHit::init(PSimHit &sh, const CSCGeometry* csc_g) } +bool MyCSCSimHit::operator<(const MyCSCSimHit & rhs) const +{ + // first sort by wire group, then by strip, then by TOF + if (w==rhs.w) + { + if (s==rhs.s) return t &shits) +MyCSCCluster::init(std::vector &shits) { hits = shits; - ln = l; nh = hits.size(); - mint = 1000.; + mint = 1000000000.; maxt = -1.; + minw = mins = 1000; + maxw = maxs = -1; meant = 0; sigmat = 0; - minw = 1000.; - maxw = -1; - mins = 1000; - maxs = -1; if (nh==0) return; + r = hits[0].r; + eta = hits[0].eta; + phi = hits[0].phi; + gx = hits[0].gx; + gy = hits[0].gy; + gz = hits[0].gz; + p = hits[0].p; + m = hits[0].m; + pdg = hits[0].pdg; + e = 0; + mintrid = 1000000000; + maxtrid = -1; for (std::vector::const_iterator itr = hits.begin(); itr != hits.end(); itr++) { MyCSCSimHit sh = *itr; + e += sh.e; if (sh.t < mint) mint = sh.t; if (sh.t > maxt) maxt = sh.t; if (sh.w < minw) minw = sh.w; if (sh.w > maxw) maxw = sh.w; if (sh.s < mins) mins = sh.s; if (sh.s > maxs) maxs = sh.s; + if (sh.trid < mintrid) mintrid = sh.trid; + if (sh.trid > maxtrid) maxtrid = sh.trid; meant += sh.t; sigmat += sh.t*sh.t; } meant = meant/nh; sigmat = sqrt( sigmat/nh - meant*meant); +cout<<" clu: "< &slayers) +MyCSCLayer::init(int l, std::vector &sclusters) { + clusters = sclusters; + ln = l; + nclu = clusters.size(); nh = 0; + mint = 1000000000.; + maxt = -1.; + minw = mins = 1000; + maxw = maxs = -1; + mintrid = 1000000000; + maxtrid = -1; + if (nclu==0) return; + for (std::vector::const_iterator itr = clusters.begin(); itr != clusters.end(); itr++) + { + MyCSCCluster cl = *itr; + nh += cl.nh; + if (cl.mint < mint) mint = cl.mint; + if (cl.maxt > maxt) maxt = cl.maxt; + if (cl.minw < minw) minw = cl.minw; + if (cl.maxw > maxw) maxw = cl.maxw; + if (cl.mins < mins) mins = cl.mins; + if (cl.maxs > maxs) maxs = cl.maxs; + if (cl.mintrid < mintrid) mintrid = cl.mintrid; + if (cl.maxtrid > maxtrid) maxtrid = cl.maxtrid; + } +} + + +// ================================================================================================ +void +MyCSCChamber::init(std::vector &slayers) +{ + nh = nclu = 0; nl = slayers.size(); - mint = 1000.; + mint = 1000000000.; maxt = -1.; - meant = 0; - sigmat = 0; - minw = 1000.; - maxw = -1; - mins = 1000; - maxs = -1; + minw = mins = 1000; + maxw = maxs = -1; if (nl==0) return; - l1 = slayers[0].ln; - ln = slayers[nl-1].ln; - for (std::vector::const_iterator sl = slayers.begin(); sl != slayers.end(); sl++) + l1 = 7; + ln = -1; + for (std::vector::const_iterator itr = slayers.begin(); itr != slayers.end(); itr++) { - nh += sl->hits.size(); - for (std::vector::const_iterator itr = sl->hits.begin(); itr != sl->hits.end(); itr++) - { - MyCSCSimHit sh = *itr; - if (sh.t < mint) mint = sh.t; - if (sh.t > maxt) maxt = sh.t; - if (sh.w < minw) minw = sh.w; - if (sh.w > maxw) maxw = sh.w; - if (sh.s < mins) mins = sh.s; - if (sh.s > maxs) maxs = sh.s; - meant += sh.t; - sigmat += sh.t*sh.t; - } + MyCSCLayer la = *itr; + nh += la.nh; + nclu += la.nclu; + if (la.ln < l1) l1 = la.ln; + if (la.ln > ln) ln = la.ln; + if (la.mint < mint) mint = la.mint; + if (la.maxt > maxt) maxt = la.maxt; + if (la.minw < minw) minw = la.minw; + if (la.maxw > maxw) maxw = la.maxw; + if (la.mins < mins) mins = la.mins; + if (la.maxs > maxs) maxs = la.maxs; + } - meant = meant/nh; - sigmat = sqrt( sigmat/nh - meant*meant); } @@ -495,85 +1162,513 @@ MyCSCChamber::init(std::vector &slayers) void MyCSCEvent::init(std::vector &schambers) { - nh = 0; - nch = 0; + nch = schambers.size(); + nh = nclu = 0; + nch2 = nch3 = nch4 = nch5 = nch6 = 0; + for (std::vector::const_iterator itr = schambers.begin(); itr != schambers.end(); itr++) + { + MyCSCChamber ch = *itr; + nh += ch.nh; + nclu += ch.nclu; + if (ch.nl>1) nch2++; + if (ch.nl>2) nch3++; + if (ch.nl>3) nch4++; + if (ch.nl>4) nch5++; + if (ch.nl>5) nch6++; + } } + // ================================================================================================ void -MyRPCDetId::init(RPCDetId &id) +MyGEMDetId::init(GEMDetId &id) { reg = id.region(); ring = id.ring(); st = id.station(); - sec = id.sector(); layer = id.layer(); - subsec = id.subsector(); - roll = id.roll(); - if (reg!=0) t = st*2 + ring - 3; // endcap - else t = st*3 + abs(ring) - 2; + ch = id.chamber(); + part = id.roll(); + t = typeGEM(id); } // ================================================================================================ void -MyRPCSimHit::init(const PSimHit &sh, const RPCGeometry* rpc_g) +MyGEMSimHit::init(PSimHit &sh, const GEMGeometry* gem_g, const ParticleDataTable * pdt) { LocalPoint hitLP = sh.localPosition(); + pdg = sh.particleType(); + m = 0.00051; + + ParticleData const *pdata = 0; + HepPDT::ParticleID particleType(pdg); + if (particleType.isValid()) pdata = pdt->particle(particleType); + if (pdata) m = pdata->mass(); + // cout<<" "<name()<<" "<idToDet(DetId(sh.detUnitId()))->surface().toGlobal(hitLP); + GlobalPoint hitGP = gem_g->idToDet(DetId(sh.detUnitId()))->surface().toGlobal(hitLP); r = hitGP.perp(); eta = hitGP.eta(); phi = hitGP.phi(); + gx = hitGP.x(); + gy = hitGP.y(); gz = hitGP.z(); - //w = csclayer->geometry()->wireGroup(csclayer->geometry()->nearestWire(hitLP)); - //s = csclayer->geometry()->nearestStrip(hitLP); + GEMDetId rollId(sh.detUnitId()); + s = gem_g->etaPartition(rollId)->strip(hitLP); } -// ================================================================================================ -void -NeutronSimHitsAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +bool MyGEMSimHit::operator<(const MyGEMSimHit & rhs) const { - using namespace edm; - using namespace std; - - evtn += 1; - csc_shn = 0; - rpc_shn = 0; - - ESHandle< CSCGeometry > csc_geom; - ESHandle< DTGeometry > dt_geom; - ESHandle< RPCGeometry > rpc_geom; - - iSetup.get< MuonGeometryRecord >().get(csc_geom); - iSetup.get< MuonGeometryRecord >().get(dt_geom); - iSetup.get< MuonGeometryRecord >().get(rpc_geom); - - csc_geometry = &*csc_geom; - dt_geometry = &*dt_geom; - rpc_geometry = &*rpc_geom; + // first sort by strip, then by TOF + if (s==rhs.s) return t chIds = simhit_map_csc.chambersWithHits(); - if (chIds.size()) { - //cout<<"--- chambers with hits: "< &shits) +{ + hits = shits; + nh = hits.size(); + mint = 1000000000.; + maxt = -1.; + mins = 1000; + maxs = -1; + meant = 0; + sigmat = 0; + if (nh==0) return; + r = hits[0].r; + eta = hits[0].eta; + phi = hits[0].phi; + gx = hits[0].gx; + gy = hits[0].gy; + gz = hits[0].gz; + p = hits[0].p; + m = hits[0].m; + pdg = hits[0].pdg; + e = 0; + mintrid = 1000000000; + maxtrid = -1; + for (std::vector::const_iterator itr = hits.begin(); itr != hits.end(); itr++) + { + MyGEMSimHit sh = *itr; + e += sh.e; + if (sh.t < mint) mint = sh.t; + if (sh.t > maxt) maxt = sh.t; + if (sh.s < mins) mins = sh.s; + if (sh.s > maxs) maxs = sh.s; + if (sh.trid < mintrid) mintrid = sh.trid; + if (sh.trid > maxtrid) maxtrid = sh.trid; + meant += sh.t; + sigmat += sh.t*sh.t; + } + meant = meant/nh; + sigmat = sqrt( sigmat/nh - meant*meant); + cout<<" gem clu: "< &sclusters) +{ + clusters = sclusters; + pn = p; + ln = l; + nclu = clusters.size(); + nh = 0; + mint = 1000000000.; + maxt = -1.; + mins = 1000; + maxs = -1; + mintrid = 1000000000; + maxtrid = -1; + if (nclu==0) return; + for (std::vector::const_iterator itr = clusters.begin(); itr != clusters.end(); itr++) + { + MyGEMCluster cl = *itr; + nh += cl.nh; + if (cl.mint < mint) mint = cl.mint; + if (cl.maxt > maxt) maxt = cl.maxt; + if (cl.mins < mins) mins = cl.mins; + if (cl.maxs > maxs) maxs = cl.maxs; + if (cl.mintrid < mintrid) mintrid = cl.mintrid; + if (cl.maxtrid > maxtrid) maxtrid = cl.maxtrid; + } +} + + +// ================================================================================================ +void +MyGEMChamber::init(std::vector &sparts) +{ + nh = nclu = nl = 0; + np = sparts.size(); + mint = 1000000000.; + maxt = -1.; + if (np==0) return; + std::set layers; + for (std::vector::const_iterator itr = sparts.begin(); itr != sparts.end(); itr++) + { + MyGEMPart rl = *itr; + nh += rl.nh; + nclu += rl.nclu; + layers.insert(rl.ln); + if (rl.mint < mint) mint = rl.mint; + if (rl.maxt > maxt) maxt = rl.maxt; + } + nl = layers.size(); +} + + +// ================================================================================================ +void +MyGEMEvent::init(std::vector &schambers) +{ + nch = schambers.size(); + nh = nclu = np = 0; + for (std::vector::const_iterator itr = schambers.begin(); itr != schambers.end(); itr++) + { + MyGEMChamber ch = *itr; + nh += ch.nh; + nclu += ch.nclu; + np += ch.np; + } +} + + +// ================================================================================================ +void +MyRPCDetId::init(RPCDetId &id) +{ + reg = id.region(); + ring = id.ring(); + st = id.station(); + sec = id.sector(); + layer = id.layer(); + subsec = id.subsector(); + roll = id.roll(); + if (reg!=0) t = typeRPCf(id); + else t = typeRPCb(id); +} + + +// ================================================================================================ +void +MyRPCSimHit::init(PSimHit &sh, const RPCGeometry* rpc_g, const ParticleDataTable * pdt) +{ + LocalPoint hitLP = sh.localPosition(); + pdg = sh.particleType(); + m = 0.00051; + + ParticleData const *pdata = 0; + HepPDT::ParticleID particleType(pdg); + if (particleType.isValid()) pdata = pdt->particle(particleType); + if (pdata) m = pdata->mass(); + // cout<<" "<name()<<" "<idToDet(DetId(sh.detUnitId()))->surface().toGlobal(hitLP); + + r = hitGP.perp(); + eta = hitGP.eta(); + phi = hitGP.phi(); + gx = hitGP.x(); + gy = hitGP.y(); + gz = hitGP.z(); + + RPCDetId rollId(sh.detUnitId()); + s = rpc_g->roll(rollId)->strip(hitLP); +} + + +bool MyRPCSimHit::operator<(const MyRPCSimHit & rhs) const +{ + // first sort by strip, then by TOF + if (s==rhs.s) return t &shits) +{ + hits = shits; + nh = hits.size(); + mint = 1000000000.; + maxt = -1.; + mins = 1000; + maxs = -1; + meant = 0; + sigmat = 0; + if (nh==0) return; + r = hits[0].r; + eta = hits[0].eta; + phi = hits[0].phi; + gx = hits[0].gx; + gy = hits[0].gy; + gz = hits[0].gz; + p = hits[0].p; + m = hits[0].m; + pdg = hits[0].pdg; + e = 0; + mintrid = 1000000000; + maxtrid = -1; + for (std::vector::const_iterator itr = hits.begin(); itr != hits.end(); itr++) + { + MyRPCSimHit sh = *itr; + e += sh.e; + if (sh.t < mint) mint = sh.t; + if (sh.t > maxt) maxt = sh.t; + if (sh.s < mins) mins = sh.s; + if (sh.s > maxs) maxs = sh.s; + if (sh.trid < mintrid) mintrid = sh.trid; + if (sh.trid > maxtrid) maxtrid = sh.trid; + meant += sh.t; + sigmat += sh.t*sh.t; + } + meant = meant/nh; + sigmat = sqrt( sigmat/nh - meant*meant); + cout<<" rpc clu: "< &sclusters) +{ + clusters = sclusters; + rn = r; + ln = l; + nclu = clusters.size(); + nh = 0; + mint = 1000000000.; + maxt = -1.; + mins = 1000; + maxs = -1; + mintrid = 1000000000; + maxtrid = -1; + if (nclu==0) return; + for (std::vector::const_iterator itr = clusters.begin(); itr != clusters.end(); itr++) + { + MyRPCCluster cl = *itr; + nh += cl.nh; + if (cl.mint < mint) mint = cl.mint; + if (cl.maxt > maxt) maxt = cl.maxt; + if (cl.mins < mins) mins = cl.mins; + if (cl.maxs > maxs) maxs = cl.maxs; + if (cl.mintrid < mintrid) mintrid = cl.mintrid; + if (cl.maxtrid > maxtrid) maxtrid = cl.maxtrid; + } +} + + +// ================================================================================================ +void +MyRPCChamber::init(std::vector &srolls) +{ + nh = nclu = nl = 0; + nr = srolls.size(); + mint = 1000000000.; + maxt = -1.; + if (nr==0) return; + std::set layers; + for (std::vector::const_iterator itr = srolls.begin(); itr != srolls.end(); itr++) + { + MyRPCRoll rl = *itr; + nh += rl.nh; + nclu += rl.nclu; + layers.insert(rl.ln); + if (rl.mint < mint) mint = rl.mint; + if (rl.maxt > maxt) maxt = rl.maxt; + } + nl = layers.size(); +} + + +// ================================================================================================ +void +MyRPCEvent::init(std::vector &schambers) +{ + nch = schambers.size(); + nh = nclu = nr = 0; + for (std::vector::const_iterator itr = schambers.begin(); itr != schambers.end(); itr++) + { + MyRPCChamber ch = *itr; + nh += ch.nh; + nclu += ch.nclu; + nr += ch.nr; + } +} + + +// ================================================================================================ +void +MyDTDetId::init(DTWireId &id) +{ + st = id.station(); + wh = id.wheel(); + sec = id.sector(); + sl = id.superLayer(); + l = id.layer(); + wire = id.wire(); + t = typeDT(id); +} + + +// ================================================================================================ +void +MyDTSimHit::init(PSimHit &sh, const DTGeometry* dt_g, const ParticleDataTable * pdt) +{ + LocalPoint hitLP = sh.localPosition(); + pdg = sh.particleType(); + m = 0.00051; + + ParticleData const *pdata = 0; + HepPDT::ParticleID particleType(pdg); + if (particleType.isValid()) pdata = pdt->particle(particleType); + if (pdata) m = pdata->mass(); + // cout<<" "<name()<<" "<idToDet(DetId(sh.detUnitId()))->surface().toGlobal(hitLP); + + r = hitGP.perp(); + eta = hitGP.eta(); + phi = hitGP.phi(); + gx = hitGP.x(); + gy = hitGP.y(); + gz = hitGP.z(); + + //w = csclayer->geometry()->wireGroup(csclayer->geometry()->nearestWire(hitLP)); + //s = csclayer->geometry()->nearestStrip(hitLP); +} + + +// ================================================================================================ +void +NeutronSimHitsAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + using namespace edm; + using namespace std; + + evtn += 1; + csc_shn = 0; + gem_shn = 0; + rpc_shn = 0; + dt_shn = 0; + + edm::ESHandle < ParticleDataTable > pdt_h; + iSetup.getData(pdt_h); + pdt_ = &*pdt_h; + + if (do_csc_) + { + ESHandle< CSCGeometry > csc_geom; + iSetup.get< MuonGeometryRecord >().get(csc_geom); + csc_geometry = &*csc_geom; + + if (evtn==1) calculateCSCDetectorAreas(); + + // get SimHits + simhit_map_csc.fill(iEvent); + + analyzeCSC(); + } + + if (do_gem_) + { + ESHandle< GEMGeometry > gem_geom; + iSetup.get< MuonGeometryRecord >().get(gem_geom); + gem_geometry = &*gem_geom; + + if (evtn==1) calculateGEMDetectorAreas(); + + // get SimHits + simhit_map_gem.fill(iEvent); + + analyzeGEM(); + } + + if (do_rpc_) + { + ESHandle< RPCGeometry > rpc_geom; + iSetup.get< MuonGeometryRecord >().get(rpc_geom); + rpc_geometry = &*rpc_geom; + + if (evtn==1) calculateRPCDetectorAreas(); + + // get SimHits + simhit_map_rpc.fill(iEvent); + + analyzeRPC(); + } + + if (do_dt_) + { + ESHandle< DTGeometry > dt_geom; + iSetup.get< MuonGeometryRecord >().get(dt_geom); + dt_geometry = &*dt_geom; + + if (evtn==1) calculateDTDetectorAreas(); + + // get SimHits + simhit_map_dt.fill(iEvent); + + analyzeDT(); + } + +} + +// ================================================================================================ +void +NeutronSimHitsAnalyzer::analyzeCSC() +{ + using namespace edm; + using namespace std; + + bool ev_has_csc_type[CSC_TYPES+1]={0,0,0,0,0,0,0,0,0,0,0}; bool has_cscsh_in_rpc = false; + + vector chIds = simhit_map_csc.chambersWithHits(); + if (chIds.size()) { + //cout<<"--- CSC chambers with hits: "< evt_mychambers; for (size_t ch = 0; ch < chIds.size(); ch++) { CSCDetId chId(chIds[ch]); @@ -582,26 +1677,24 @@ NeutronSimHitsAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& std::vector layer_ids = simhit_map_csc.chamberLayersWithHits(chIds[ch]); //if (layer_ids.size()) cout<<"------ layers with hits: "< chamber_layers; + vector chamber_mylayers; for (size_t la = 0; la < layer_ids.size(); la++) { CSCDetId layerId(layer_ids[la]); c_id.init(layerId); PSimHitContainer hits = simhit_map_csc.hits(layer_ids[la]); - //cout<<" "<< layer_ids[la]<<" "< > clusters = clusterCSCHitsInLayer(layer_mysimhits); + //cout<<" "<< layer_ids[la]<<" "< part_mysimhits; + for (size_t ih=0; ihFill(); + part_mysimhits.push_back(g_h); + + n_gemsh++; + has_gemsh = true; + + // Fill some histos + h_gem_rz_sh_heatmap->Fill(fabs(g_h.gz), g_h.r); + h_mu_rz_sh_heatmap->Fill(fabs(g_h.gz), g_h.r); + + int sh_pdg = abs(g_h.pdg); + if (sh_pdg > 100000) sh_pdg = 1000000000; + int idx = pdg2idx[sh_pdg]; + if (idx<=0) cout << " *** non-registered pdgid: " << sh_pdg << endl; + + ev_has_gem_type[g_id.t] = true; + ev_has_gem_type[0] = true; + + h_gem_hit_flux_per_layer->Fill(g_id.t); + h_gem_hit_rate_per_ch->Fill(g_id.t); + + if (idx > 0) h_gem_tof_vs_ekin[idx]->Fill( log10(g_h.eKin() * 1000.), log10(g_h.t) ); + } + + cout<<" calling GEM recursive clustering:"< > clusters = clusterGEMHitsInPart(part_mysimhits); + + vector part_myclusters; + for (unsigned cl = 0; cl < clusters.size(); cl++) + { + vector cluster_mysimhits = clusters[cl]; + + g_cl.init(cluster_mysimhits); + part_myclusters.push_back(g_cl); + if (fill_gem_sh_tree_) gem_cl_tree->Fill(); + + // fill some histograms + h_gem_clu_flux_per_layer->Fill(g_id.t); + h_gem_clu_rate_per_ch->Fill(g_id.t); + } + + g_part.init(g_id.part, g_id.layer, part_myclusters); + if (fill_gem_sh_tree_) gem_part_tree->Fill(); - //************ RPC ************* + GEMDetId chid(shid.region(), shid.station(), shid.ring(), 1, shid.chamber(), 0); + int ch_id = chid.rawId(); + map >::const_iterator is_there = mapChamberParts.find(ch_id); + if (is_there != mapChamberParts.end()) mapChamberParts[ch_id].push_back(g_part); + else + { + vector vp; + vp.push_back(g_part); + mapChamberParts[ch_id] = vp; + } + } - edm::Handle< PSimHitContainer > h_rpc_simhits; - iEvent.getByLabel(input_tag_rpc_, h_rpc_simhits); - const PSimHitContainer* rpc_simhits = h_rpc_simhits.product(); + // loop over chambers + vector evt_mychambers; + map >::iterator itr = mapChamberParts.begin(); + for (; itr!= mapChamberParts.end(); itr++) + { + GEMDetId id(itr->first); + g_id.init(id); - if (rpc_simhits->size()) nevt_with_rpcsh++; + g_ch.init(itr->second); + evt_mychambers.push_back(g_ch); + if (fill_gem_sh_tree_) gem_ch_tree->Fill(); + } + g_ev.init(evt_mychambers); + if (fill_gem_sh_tree_) gem_ev_tree->Fill(); + + + // fill events with GEM hits by GEM type: + for (int t=0; t<=GEM_TYPES; t++) + if (ev_has_gem_type[t]) h_gem_nevt_fraction_with_sh->Fill(t); + + if (has_gemsh) nevt_with_gemsh++; +} + + +// ================================================================================================ +void +NeutronSimHitsAnalyzer::analyzeRPC() +{ + using namespace edm; + using namespace std; - bool ev_has_rpcf_type[RPCF_TYPES+1]={0,0,0,0,0,0,0,0,0}; + bool ev_has_rpcf_type[RPCF_TYPES+1]={0,0,0,0,0,0,0,0,0,0,0,0,0}; bool ev_has_rpcb_type[RPCB_TYPES+1]={0,0,0,0,0,0,0,0,0,0,0,0,0}; bool has_rpcsh_e = false, has_rpcsh_b = false; - for (PSimHitContainer::const_iterator rsh = rpc_simhits->begin(); rsh!=rpc_simhits->end(); rsh++) - { - rpc_shn += 1; - const PSimHit &sh = *rsh; - RPCDetId shid(sh.detUnitId()); + vector rpc_ids = simhit_map_rpc.detsWithHits(); + if (rpc_ids.size()) nevt_with_rpcsh++; + + map > mapChamberRolls; + + // loop over rolls + for (size_t id = 0; id < rpc_ids.size(); id++) + { + //cout<<" rpcid: "<Fill(); + //RPCGeomServ rpcsrv(shid); + //cout<<" "<Fill(fabs(r_h.gz), r_h.r); - h_mu_rz_sh_heatmap->Fill(fabs(r_h.gz), r_h.r); + // hits in a roll + vector roll_mysimhits; + for (size_t ih=0; ihFill(); + roll_mysimhits.push_back(r_h); + + n_rpcsh++; + if (shid.region() == 0) { n_rpcsh_b++; has_rpcsh_b = true; } + else { n_rpcsh_e++; has_rpcsh_e = true; } + + // Fill some histos + h_rpc_rz_sh_heatmap->Fill(fabs(r_h.gz), r_h.r); + h_mu_rz_sh_heatmap->Fill(fabs(r_h.gz), r_h.r); + + int sh_pdg = abs(r_h.pdg); + if (sh_pdg > 100000) sh_pdg = 1000000000; + int idx = pdg2idx[sh_pdg]; + if (idx<=0) cout << " *** non-registered pdgid: " << sh_pdg << endl; + + if (shid.region() == 0) + { + h_mu_xy_sh_heatmap->Fill(r_h.gx, r_h.gy); + + ev_has_rpcb_type[r_id.t] = true; + ev_has_rpcb_type[0] = true; + + h_rpcb_hit_flux_per_layer->Fill(r_id.t); + h_rpcb_hit_rate_per_ch->Fill(r_id.t); + + if (idx > 0) h_rpcb_tof_vs_ekin[idx]->Fill( log10(r_h.eKin() * 1000.), log10(r_h.t) ); + } + else + { + ev_has_rpcf_type[r_id.t] = true; + ev_has_rpcf_type[0] = true; + + h_rpcf_hit_flux_per_layer->Fill(r_id.t); + h_rpcf_hit_rate_per_ch->Fill(r_id.t); - if (shid.region() == 0) + if (idx > 0) h_rpcf_tof_vs_ekin[idx]->Fill( log10(r_h.eKin() * 1000.), log10(r_h.t) ); + } + } + + cout<<" calling recursive clustering:"< > clusters = clusterRPCHitsInRoll(roll_mysimhits); + + vector roll_myclusters; + for (unsigned cl = 0; cl < clusters.size(); cl++) { - ev_has_rpcb_type[r_id.t]=true; - ev_has_rpcb_type[0]=true; + vector cluster_mysimhits = clusters[cl]; + + r_cl.init(cluster_mysimhits); + roll_myclusters.push_back(r_cl); + if (fill_rpc_sh_tree_) rpc_cl_tree->Fill(); + + // fill some histograms + if (shid.region() == 0) + { + //h_csc_rz_clu_heatmap->Fill(fabs(c_cl.gz), c_cl.r); + + h_rpcb_clu_flux_per_layer->Fill(r_id.t); + h_rpcb_clu_rate_per_ch->Fill(r_id.t); + } + else + { + h_rpcf_clu_flux_per_layer->Fill(r_id.t); + h_rpcf_clu_rate_per_ch->Fill(r_id.t); + } } + + r_rl.init(r_id.roll, r_id.layer, roll_myclusters); + if (fill_rpc_sh_tree_) rpc_rl_tree->Fill(); + + int ch_id = shid.chamberId().rawId(); + map >::const_iterator is_there = mapChamberRolls.find(ch_id); + if (is_there != mapChamberRolls.end()) mapChamberRolls[ch_id].push_back(r_rl); else { - ev_has_rpcf_type[r_id.t]=true; - ev_has_rpcf_type[0]=true; - - h_rpcf_shflux_per_layer->Fill(r_id.t); + vector vr; + vr.push_back(r_rl); + mapChamberRolls[ch_id] = vr; } } + + // loop over chambers + vector evt_mychambers; + map >::iterator itr = mapChamberRolls.begin(); + for (; itr!= mapChamberRolls.end(); itr++) + { + RPCDetId id(itr->first); + r_id.init(id); + + r_ch.init(itr->second); + evt_mychambers.push_back(r_ch); + if (fill_rpc_sh_tree_) rpc_ch_tree->Fill(); + } + r_ev.init(evt_mychambers); + if (fill_rpc_sh_tree_) rpc_ev_tree->Fill(); + + // fill events with RPCf hits by RPCf type: for (int t=0; t<=RPCF_TYPES; t++) if (ev_has_rpcf_type[t]) h_rpcf_nevt_fraction_with_sh->Fill(t); @@ -695,6 +2032,242 @@ NeutronSimHitsAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& } +// ================================================================================================ +void +NeutronSimHitsAnalyzer::analyzeDT() +{ + using namespace edm; + using namespace std; + + bool ev_has_dt_type[DT_TYPES+1]={0,0,0,0,0,0,0,0,0,0,0,0,0}; + + vector dt_ids = simhit_map_dt.detsWithHits(); + if (dt_ids.size()) nevt_with_dtsh++; + + map > mapChamberRolls; + + // loop over wires? + for (size_t id = 0; id < dt_ids.size(); id++) + { + DTWireId shid(dt_ids[id]); + d_id.init(shid); + + PSimHitContainer hits = simhit_map_dt.hits(dt_ids[id]); + + for (size_t ih=0; ihFill(); + + n_dtsh++; + + // Fill some histos + h_dt_xy_sh_heatmap->Fill(d_h.gx, d_h.gy); + h_mu_rz_sh_heatmap->Fill(fabs(d_h.gz), d_h.r); + h_mu_xy_sh_heatmap->Fill(d_h.gx, d_h.gy); + + int sh_pdg = abs(d_h.pdg); + if (sh_pdg > 100000) sh_pdg = 1000000000; + int idx = pdg2idx[sh_pdg]; + if (idx<=0) cout << " *** non-registered pdgid: " << sh_pdg << endl; + + ev_has_dt_type[d_id.t] = true; + ev_has_dt_type[0] = true; + + h_dt_hit_flux_per_layer->Fill(d_id.t); + h_dt_hit_rate_per_ch->Fill(d_id.t); + + if (idx > 0) h_dt_tof_vs_ekin[idx]->Fill( log10(d_h.eKin() * 1000.), log10(d_h.t) ); + } + + } + + // fill events with DT hits by DT type: + for (int t=0; t<=DT_TYPES; t++) + if (ev_has_dt_type[t]) h_dt_nevt_fraction_with_sh->Fill(t); +} + + +// ================================================================================================ +void NeutronSimHitsAnalyzer::calculateCSCDetectorAreas() +{ + for (int i=0; i<=CSC_TYPES; i++) csc_total_areas_cm2[i]=0.; + + for(std::vector::const_iterator it = csc_geometry->layers().begin(); it != csc_geometry->layers().end(); it++) + { + if( dynamic_cast( *it ) == 0 ) continue; + + CSCLayer* layer = dynamic_cast( *it ); + CSCDetId id = layer->id(); + int ctype = id.iChamberType(); + + const CSCWireTopology* wire_topo = layer->geometry()->wireTopology(); + const CSCStripTopology* strip_topo = layer->geometry()->topology(); + float b = wire_topo->narrowWidthOfPlane(); + float t = wire_topo->wideWidthOfPlane(); + float w_h = wire_topo->lengthOfPlane(); + float s_h = fabs(strip_topo->yLimitsOfStripPlane().first - strip_topo->yLimitsOfStripPlane().second); + float h = (w_h < s_h)? w_h : s_h; + + // special cases: + if (ctype==1) // ME1/1a + { + h += -0.5; // adjustment in order to agree with the official me1a height number + t = ( b*(w_h - h) + t*h )/w_h; + } + if (ctype==2) // ME1/1a + { + h += -1.; + b = ( b*h + t*(w_h - h) )/w_h; + } + + float layer_area = h*(t + b)*0.5; + csc_total_areas_cm2[0] += layer_area; + csc_total_areas_cm2[ctype] += layer_area; + + if (id.layer()==1) cout<<"CSC type "< emptyv(12, 0.); + float minr[GEM_TYPES+1], maxr[GEM_TYPES+1]; + for (int i=0; i<=GEM_TYPES; i++) + { + gem_total_areas_cm2[i]=0.; + gem_total_part_areas_cm2[i] = emptyv; + gem_part_radii[i] = emptyv; + minr[i] = 9999.; + maxr[i] = 0.; + } + + + auto etaPartitions = gem_geometry->etaPartitions(); + for(auto p: etaPartitions) + { + GEMDetId id = p->id(); + int t = typeGEM(id); + int part = id.roll(); + + const TrapezoidalStripTopology* top = dynamic_cast(&(p->topology())); + float xmin = top->localPosition(0.).x(); + float xmax = top->localPosition((float)p->nstrips()).x(); + float rollarea = top->stripLength() * (xmax - xmin); + gem_total_areas_cm2[0] += rollarea; + gem_total_areas_cm2[typeGEM(id)] += rollarea; + gem_total_part_areas_cm2[0][0] += rollarea; + gem_total_part_areas_cm2[t][part] += rollarea; + cout<<"Partition: "<idToDet(id)->surface().toGlobal(LocalPoint(0.,0.,0.)); + gem_part_radii[t][part] = gp.perp(); + + if (maxr[t] < gp.perp() + top->stripLength()/2.) maxr[t] = gp.perp() + top->stripLength()/2.; + if (minr[t] > gp.perp() - top->stripLength()/2.) minr[t] = gp.perp() - top->stripLength()/2.; + } + + for (int t=1; t<=GEM_TYPES; t++) + { + gem_part_radii[t][0] = (minr[t] + maxr[t])/2.; + } + + cout<<"========================"<::const_iterator it = dt_geometry->layers().begin(); it != dt_geometry->layers().end(); it++) + { + if( dynamic_cast( *it ) == 0 ) continue; + + DTLayer* layer = dynamic_cast( *it ); + DTWireId id = (DTWireId) layer->id(); + int ctype = typeDT(id); + + const DTTopology& topo = layer->specificTopology(); + // cell's sensible width * # cells + float w = topo.sensibleWidth() * topo.channels(); + float l = topo.cellLenght(); + + float layer_area = w*l; + dt_total_areas_cm2[0] += layer_area; + dt_total_areas_cm2[ctype] += layer_area; + + if (id.layer()==1) cout<<"DT type "<::const_iterator it = rpc_geometry->rolls().begin(); it != rpc_geometry->rolls().end(); it++) + { + if( dynamic_cast( *it ) != 0 ) { // check if dynamic cast is ok: cast ok => 1 + RPCRoll* roll = dynamic_cast( *it ); + RPCDetId id = roll->id(); + //RPCGeomServ rpcsrv(detId); + //std::string name = rpcsrv.name(); + if (id.region() == 0) { + const RectangularStripTopology* top_ = dynamic_cast(&(roll->topology())); + float xmin = (top_->localPosition(0.)).x(); + float xmax = (top_->localPosition((float)roll->nstrips())).x(); + float rollarea = top_->stripLength() * (xmax - xmin); + rpcb_total_areas_cm2[0] += rollarea; + rpcb_total_areas_cm2[typeRPCb(id)] += rollarea; + // cout<<"Roll: RawId: "<(&(roll->topology())); + float xmin = (top_->localPosition(0.)).x(); + float xmax = (top_->localPosition((float)roll->nstrips())).x(); + float rollarea = top_->stripLength() * (xmax - xmin); + rpcf_total_areas_cm2[0] += rollarea; + rpcf_total_areas_cm2[typeRPCf(id)] += rollarea; + // cout<<"Roll: RawId: "<0) ? (double)n_rpcsh_b/nevt_with_rpcsh_b : 0 )<<" sh/evt with hits)"< fs; + // convert to fraction: h_csc_nevt_fraction_with_sh->Sumw2(); h_csc_nevt_fraction_with_sh->Scale(1./evtn); + h_gem_nevt_fraction_with_sh->Sumw2(); + h_gem_nevt_fraction_with_sh->Scale(1./evtn); h_rpcf_nevt_fraction_with_sh->Sumw2(); h_rpcf_nevt_fraction_with_sh->Scale(1./evtn); h_rpcb_nevt_fraction_with_sh->Sumw2(); h_rpcb_nevt_fraction_with_sh->Scale(1./evtn); + h_dt_nevt_fraction_with_sh->Sumw2(); + h_dt_nevt_fraction_with_sh->Scale(1./evtn); - // ---- calculate fluxes at L=10^34 + // ---- calculate fluxes per cm2 and rates per chamber at L=10^34 ---- - // chamber areas - const double csc_areas_cm2[CSC_TYPES+1] = {100000, 1068.32, 4108.77, 10872.75, 13559.025, 16986, 31121.2, 15716.4, 31121.2, 14542.5, 31121.2}; - const double rpcf_areas_cm2[RPCF_TYPES+1] = {100000, 11700, 17360, 11690, 19660, 11690, 19660, 11690, 19660}; - // chamber radial segmentations - const double csc_radial_segm[CSC_TYPES+1] = {100, 36, 36, 36, 36, 18, 36, 18, 36, 18, 36}; - const double rpcf_radial_segm = 36; // pileup at nominal lumi double n_pu = 25.; - // fraction of empty BXs - double f_empty_bx = 0.77; - if (!input_is_neutrons_) f_empty_bx = 1.; + // fraction of full BXs : 2808 filled bickets out of 3564 + double f_full_bx = 0.7879; + if (!input_is_neutrons_) f_full_bx = 1.; // bx rate 40 MHz double bxrate = 40000000.; - h_csc_shflux_per_layer->Sumw2(); - for (int t=1; t<=CSC_TYPES; t++) + // chamber areas + //const double csc_areas_cm2[CSC_TYPES+1] = + // {10000000, 1068.32, 4108.77, 10872.75, 13559.025, 16986, 31121.2, 15716.4, 31121.2, 14542.5, 31121.2}; + h_csc_hit_flux_per_layer->Sumw2(); + h_csc_hit_rate_per_ch->Sumw2(); + h_csc_clu_flux_per_layer->Sumw2(); + h_csc_clu_rate_per_ch->Sumw2(); + if (do_csc_) for (int t=1; t<=CSC_TYPES; t++) + { + // 2 endcaps , 6 layers + double scale = bxrate * n_pu * f_full_bx /csc_total_areas_cm2[t]/evtn; + double rt = scale * h_csc_hit_flux_per_layer->GetBinContent(t); + double er = scale * h_csc_hit_flux_per_layer->GetBinError(t); + h_csc_hit_flux_per_layer->SetBinContent(t,rt); + h_csc_hit_flux_per_layer->SetBinError(t,er); + + rt = scale * h_csc_clu_flux_per_layer->GetBinContent(t); + er = scale * h_csc_clu_flux_per_layer->GetBinError(t); + h_csc_clu_flux_per_layer->SetBinContent(t,rt); + h_csc_clu_flux_per_layer->SetBinError(t,er); + + scale = bxrate * n_pu * f_full_bx /csc_radial_segm[t]/2/evtn/1000; + rt = scale * h_csc_hit_rate_per_ch->GetBinContent(t); + er = scale * h_csc_hit_rate_per_ch->GetBinError(t); + h_csc_hit_rate_per_ch->SetBinContent(t,rt); + h_csc_hit_rate_per_ch->SetBinError(t,er); + + rt = scale * h_csc_clu_rate_per_ch->GetBinContent(t); + er = scale * h_csc_clu_rate_per_ch->GetBinError(t); + h_csc_clu_rate_per_ch->SetBinContent(t,rt); + h_csc_clu_rate_per_ch->SetBinError(t,er); + + + // centers of ME stations in r + const Double_t xx[4][4] = { + {128., 203.25, 369.75, 594.1}, {239.05, 525.55, 0, 0}, {251.75, 525.55, 0, 0}, {261.7, 525.55, 0, 0}}; + // half-spans of ME stations in r + const Double_t xe[4][4] = { + {22., 53.25, 87.25, 82.1}, {94.85, 161.55, 0, 0}, {84.85, 161.55, 0, 0}, {74.7, 161.55, 0, 0}}; + // fluxes and errors + const Double_t yy[4][4] = { + { h_csc_hit_flux_per_layer->GetBinContent(1), h_csc_hit_flux_per_layer->GetBinContent(2), + h_csc_hit_flux_per_layer->GetBinContent(3), h_csc_hit_flux_per_layer->GetBinContent(4)}, + { h_csc_hit_flux_per_layer->GetBinContent(5), h_csc_hit_flux_per_layer->GetBinContent(6), 0, 0}, + { h_csc_hit_flux_per_layer->GetBinContent(7), h_csc_hit_flux_per_layer->GetBinContent(8), 0, 0}, + { h_csc_hit_flux_per_layer->GetBinContent(9), h_csc_hit_flux_per_layer->GetBinContent(10), 0, 0} }; + const Double_t ye[4][4] = { + { h_csc_hit_flux_per_layer->GetBinError(1), h_csc_hit_flux_per_layer->GetBinError(2), + h_csc_hit_flux_per_layer->GetBinError(3), h_csc_hit_flux_per_layer->GetBinError(4)}, + { h_csc_hit_flux_per_layer->GetBinError(5), h_csc_hit_flux_per_layer->GetBinError(6), 0, 0}, + { h_csc_hit_flux_per_layer->GetBinError(7), h_csc_hit_flux_per_layer->GetBinError(8), 0, 0}, + { h_csc_hit_flux_per_layer->GetBinError(9), h_csc_hit_flux_per_layer->GetBinError(10), 0, 0} }; + for (int i=0; i<4; i++) + { + gr_csc_hit_flux_me1->SetPoint(i, xx[0][i], yy[0][i]); + gr_csc_hit_flux_me1->SetPointError(i, xe[0][i], ye[0][i]); + if (i>1) continue; + gr_csc_hit_flux_me2->SetPoint(i, xx[1][i], yy[1][i]); + gr_csc_hit_flux_me3->SetPoint(i, xx[2][i], yy[2][i]); + gr_csc_hit_flux_me4->SetPoint(i, xx[3][i], yy[3][i]); + gr_csc_hit_flux_me2->SetPointError(i, xe[1][i], ye[1][i]); + gr_csc_hit_flux_me3->SetPointError(i, xe[2][i], ye[2][i]); + gr_csc_hit_flux_me4->SetPointError(i, xe[3][i], ye[3][i]); + } + } + + + h_gem_hit_flux_per_layer->Sumw2(); + h_gem_hit_rate_per_ch->Sumw2(); + if (do_gem_) for (int t=1; t<=GEM_TYPES; t++) + { + double scale = bxrate * n_pu * f_full_bx /gem_total_areas_cm2[t]/evtn; + + double rt = scale * h_gem_hit_flux_per_layer->GetBinContent(t); + double er = scale * h_gem_hit_flux_per_layer->GetBinError(t); + h_gem_hit_flux_per_layer->SetBinContent(t,rt); + h_gem_hit_flux_per_layer->SetBinError(t,er); + + rt = scale * h_gem_clu_flux_per_layer->GetBinContent(t); + er = scale * h_gem_clu_flux_per_layer->GetBinError(t); + h_gem_clu_flux_per_layer->SetBinContent(t,rt); + h_gem_clu_flux_per_layer->SetBinError(t,er); + + scale = bxrate * n_pu * f_full_bx /gem_radial_segm[t]/2/evtn/1000; + + rt = scale * h_gem_hit_rate_per_ch->GetBinContent(t); + er = scale * h_gem_hit_rate_per_ch->GetBinError(t); + h_gem_hit_rate_per_ch->SetBinContent(t,rt); + h_gem_hit_rate_per_ch->SetBinError(t,er); + + rt = scale * h_gem_clu_rate_per_ch->GetBinContent(t); + er = scale * h_gem_clu_rate_per_ch->GetBinError(t); + h_gem_clu_rate_per_ch->SetBinContent(t,rt); + h_gem_clu_rate_per_ch->SetBinError(t,er); + } + + //const double rpcf_areas_cm2[RPCF_TYPES+1] = {100000, 3150,11700,17360,11070,11690,19660,7330,11690,19660,5330,11690,19660}; + //const double rpcf_total_areas_cm2[RPCF_TYPES+1] = + // { 10000000, 244093, 738256, 1289290, 397166, 854259, 1418920, 276969, 854259, 1418920, 204059, 854259, 1418920}; + + h_rpcf_hit_flux_per_layer->Sumw2(); + h_rpcf_hit_rate_per_ch->Sumw2(); + if (do_rpc_) for (int t=1; t<=RPCF_TYPES; t++) + { + double scale = bxrate * n_pu * f_full_bx /rpcf_total_areas_cm2[t]/evtn; + double rt = scale * h_rpcf_hit_flux_per_layer->GetBinContent(t); + double er = scale * h_rpcf_hit_flux_per_layer->GetBinError(t); + h_rpcf_hit_flux_per_layer->SetBinContent(t,rt); + h_rpcf_hit_flux_per_layer->SetBinError(t,er); + + rt = scale * h_rpcf_clu_flux_per_layer->GetBinContent(t); + er = scale * h_rpcf_clu_flux_per_layer->GetBinError(t); + h_rpcf_clu_flux_per_layer->SetBinContent(t,rt); + h_rpcf_clu_flux_per_layer->SetBinError(t,er); + + scale = bxrate * n_pu * f_full_bx /rpcf_radial_segm[t]/2/evtn/1000; + rt = scale * h_rpcf_hit_rate_per_ch->GetBinContent(t); + er = scale * h_rpcf_hit_rate_per_ch->GetBinError(t); + h_rpcf_hit_rate_per_ch->SetBinContent(t,rt); + h_rpcf_hit_rate_per_ch->SetBinError(t,er); + + rt = scale * h_rpcf_clu_rate_per_ch->GetBinContent(t); + er = scale * h_rpcf_clu_rate_per_ch->GetBinError(t); + h_rpcf_clu_rate_per_ch->SetBinContent(t,rt); + h_rpcf_clu_rate_per_ch->SetBinError(t,er); + } + + // chambers with two layers have their area doubled: + //const double rpcb_total_areas_cm2[RPCF_TYPES+1] = + // { 10000000, 1196940, 2361750, 2393880, 1439190, 2839700, 2878390, 859939, 1696790, 1719880, 1102040, 2163920, 2204080}; + h_rpcb_hit_flux_per_layer->Sumw2(); + if (do_rpc_) for (int t=1; t<=RPCB_TYPES; t++) + { + double scale = bxrate * n_pu * f_full_bx /rpcb_total_areas_cm2[t]/evtn; + double rt = scale * h_rpcb_hit_flux_per_layer->GetBinContent(t); + double er = scale * h_rpcb_hit_flux_per_layer->GetBinError(t); + h_rpcb_hit_flux_per_layer->SetBinContent(t,rt); + h_rpcb_hit_flux_per_layer->SetBinError(t,er); + + rt = scale * h_rpcb_clu_flux_per_layer->GetBinContent(t); + er = scale * h_rpcb_clu_flux_per_layer->GetBinError(t); + h_rpcb_clu_flux_per_layer->SetBinContent(t,rt); + h_rpcb_clu_flux_per_layer->SetBinError(t,er); + + scale = bxrate * n_pu * f_full_bx /rpcb_radial_segm[t]/evtn/1000; + rt = scale * h_rpcb_hit_rate_per_ch->GetBinContent(t); + er = scale * h_rpcb_hit_rate_per_ch->GetBinError(t); + h_rpcb_hit_rate_per_ch->SetBinContent(t,rt); + h_rpcb_hit_rate_per_ch->SetBinError(t,er); + + rt = scale * h_rpcb_clu_rate_per_ch->GetBinContent(t); + er = scale * h_rpcb_clu_rate_per_ch->GetBinError(t); + h_rpcb_clu_rate_per_ch->SetBinContent(t,rt); + h_rpcb_clu_rate_per_ch->SetBinError(t,er); + } + + + // chamber areas + //const double dt_total_areas_cm2[DT_TYPES+1] = + // {1.65696e+08,6.73021e+06,1.32739e+07,1.34604e+07,8.20906e+06,1.61906e+07,1.64182e+07,9.88901e+06,1.95039e+07,1.9778e+07,8.50898e+06,1.67151e+07,1.7018e+07}; + h_dt_hit_flux_per_layer->Sumw2(); + h_dt_hit_rate_per_ch->Sumw2(); + if (do_dt_) for (int t=1; t<=DT_TYPES; t++) { // 2 endcaps , 6 layers - double scale = bxrate * n_pu * f_empty_bx /csc_areas_cm2[t]/csc_radial_segm[t]/2/6 /evtn; - double rt = scale * h_csc_shflux_per_layer->GetBinContent(t); - double er = scale * h_csc_shflux_per_layer->GetBinError(t); - h_csc_shflux_per_layer->SetBinContent(t,rt); - h_csc_shflux_per_layer->SetBinError(t,er); + double scale = bxrate * n_pu * f_full_bx /dt_total_areas_cm2[t] /evtn; + double rt = scale * h_dt_hit_flux_per_layer->GetBinContent(t); + double er = scale * h_dt_hit_flux_per_layer->GetBinError(t); + h_dt_hit_flux_per_layer->SetBinContent(t,rt); + h_dt_hit_flux_per_layer->SetBinError(t,er); + + scale = bxrate * n_pu * f_full_bx /dt_radial_segm[t]/evtn/1000; + rt = scale * h_dt_hit_rate_per_ch->GetBinContent(t); + er = scale * h_dt_hit_rate_per_ch->GetBinError(t); + h_dt_hit_rate_per_ch->SetBinContent(t,rt); + h_dt_hit_rate_per_ch->SetBinError(t,er); + + // centers of MB stations in |z| + const Double_t xx[4][3] = {{58.7, 273, 528}, {58.7, 273, 528}, {58.7, 273, 528}, {58.7, 273, 528}}; + // half-spans of MB stations in |z| + const Double_t xe[4][3] = {{58.7, 117.4, 117.4}, {58.7, 117.4, 117.4}, {58.7, 117.4, 117.4}, {58.7, 117.4, 117.4}}; + // fluxes and errors + const Double_t yy[4][3] = { + { h_dt_hit_flux_per_layer->GetBinContent(1), h_dt_hit_flux_per_layer->GetBinContent(2), h_dt_hit_flux_per_layer->GetBinContent(3)}, + { h_dt_hit_flux_per_layer->GetBinContent(4), h_dt_hit_flux_per_layer->GetBinContent(5), h_dt_hit_flux_per_layer->GetBinContent(6)}, + { h_dt_hit_flux_per_layer->GetBinContent(7), h_dt_hit_flux_per_layer->GetBinContent(8), h_dt_hit_flux_per_layer->GetBinContent(9)}, + { h_dt_hit_flux_per_layer->GetBinContent(10), h_dt_hit_flux_per_layer->GetBinContent(11), h_dt_hit_flux_per_layer->GetBinContent(12)} + }; + const Double_t ye[4][3] = { + { h_dt_hit_flux_per_layer->GetBinError(1), h_dt_hit_flux_per_layer->GetBinError(2), h_dt_hit_flux_per_layer->GetBinError(3)}, + { h_dt_hit_flux_per_layer->GetBinError(4), h_dt_hit_flux_per_layer->GetBinError(5), h_dt_hit_flux_per_layer->GetBinError(6)}, + { h_dt_hit_flux_per_layer->GetBinError(7), h_dt_hit_flux_per_layer->GetBinError(8), h_dt_hit_flux_per_layer->GetBinError(9)}, + { h_dt_hit_flux_per_layer->GetBinError(10), h_dt_hit_flux_per_layer->GetBinError(11), h_dt_hit_flux_per_layer->GetBinError(12)} + }; + for (int i=0; i<3; i++) + { + gr_dt_hit_flux_mb1->SetPoint(i, xx[0][i], yy[0][i]); + gr_dt_hit_flux_mb2->SetPoint(i, xx[1][i], yy[1][i]); + gr_dt_hit_flux_mb3->SetPoint(i, xx[2][i], yy[2][i]); + gr_dt_hit_flux_mb4->SetPoint(i, xx[3][i], yy[3][i]); + gr_dt_hit_flux_mb1->SetPointError(i, xe[0][i], ye[0][i]); + gr_dt_hit_flux_mb2->SetPointError(i, xe[1][i], ye[1][i]); + gr_dt_hit_flux_mb3->SetPointError(i, xe[2][i], ye[2][i]); + gr_dt_hit_flux_mb4->SetPointError(i, xe[3][i], ye[3][i]); + } + } + +} + + +// ================================================================================================ +std::vector > NeutronSimHitsAnalyzer::clusterCSCHitsInLayer(std::vector &hits) +{ + /* Does recursive clustering: + - sort by WG,Strip,TOF + - take first hit + - cluster the other hits around it by requiring dWG<2 && dS<4 && dTOF<2ns + - recursively call itself over the hits that didn't get into the cluster + */ + using namespace std; + + vector< vector > result; + vector cluster; + size_t N = hits.size(); + cout<<" clusterCSC: #hits="< not_clustered; + for (size_t i=1; i 2 || abs(sh1.w - shi.w) > 1 || abs(sh1.s - shi.s) > 3 ) { + not_clustered.push_back(shi); + cout<<"NO"< > result_recursive = clusterCSCHitsInLayer(not_clustered); + result.insert(result.end(), result_recursive.begin(), result_recursive.end()); + } + cout<<" returning "< > NeutronSimHitsAnalyzer::clusterGEMHitsInPart(std::vector &hits) +{ + /* Does recursive clustering: + - sort by Strip,TOF + - take first hit + - cluster the other hits around it by requiring dS<4 && dTOF<4ns + - recursively call itself over the hits that didn't get into the cluster + */ + using namespace std; + + vector< vector > result; + vector cluster; + size_t N = hits.size(); + cout<<" clusterGEM: #hits="< not_clustered; + for (size_t i=1; i 4. || abs(sh1.s - shi.s) > 3 ) { + not_clustered.push_back(shi); + cout<<"NO"<Sumw2(); - for (int t=1; t<=RPCF_TYPES; t++) + if (not_clustered.size()) { - double scale = bxrate * n_pu * f_empty_bx /rpcf_areas_cm2[t]/rpcf_radial_segm/2 /evtn; - double rt = scale * h_rpcf_shflux_per_layer->GetBinContent(t); - double er = scale * h_rpcf_shflux_per_layer->GetBinError(t); - h_rpcf_shflux_per_layer->SetBinContent(t,rt); - h_rpcf_shflux_per_layer->SetBinError(t,er); + cout<<" recursing..."< > result_recursive = clusterGEMHitsInPart(not_clustered); + result.insert(result.end(), result_recursive.begin(), result_recursive.end()); } + cout<<" returning "< > NeutronSimHitsAnalyzer::clusterRPCHitsInRoll(std::vector &hits) +{ + /* Does recursive clustering: + - sort by Strip,TOF + - take first hit + - cluster the other hits around it by requiring dS<3 && dTOF<2ns + - recursively call itself over the hits that didn't get into the cluster + */ + using namespace std; + vector< vector > result; + vector cluster; + size_t N = hits.size(); + cout<<" clusterRPC: #hits="< not_clustered; + for (size_t i=1; i 2 || abs(sh1.s - shi.s) > 2 ) { + not_clustered.push_back(shi); + cout<<"NO"< > result_recursive = clusterRPCHitsInRoll(not_clustered); + result.insert(result.end(), result_recursive.begin(), result_recursive.end()); + } + cout<<" returning "< Date: Mon, 12 Aug 2013 19:11:25 -0500 Subject: [PATCH 072/182] renamed NeutronSimHitsAnalyzer to MuSimHitOccupancy --- ...imHitsAnalyzer.cc => MuSimHitOccupancy.cc} | 52 +++++++++---------- ...zer_cfg.py => runMuSimHitOccupancy_cfg.py} | 4 +- 2 files changed, 29 insertions(+), 27 deletions(-) rename SimMuL1/plugins/{NeutronSimHitsAnalyzer.cc => MuSimHitOccupancy.cc} (98%) rename SimMuL1/test/{runNeutronSimHitsAnalyzer_cfg.py => runMuSimHitOccupancy_cfg.py} (94%) diff --git a/SimMuL1/plugins/NeutronSimHitsAnalyzer.cc b/SimMuL1/plugins/MuSimHitOccupancy.cc similarity index 98% rename from SimMuL1/plugins/NeutronSimHitsAnalyzer.cc rename to SimMuL1/plugins/MuSimHitOccupancy.cc index 7ee4062c09e51..00ed988b122de 100644 --- a/SimMuL1/plugins/NeutronSimHitsAnalyzer.cc +++ b/SimMuL1/plugins/MuSimHitOccupancy.cc @@ -1,7 +1,7 @@ /* - * NeutronSimHitsAnalyzer: analyzer module for SimHit level occupancy studies in muon systems + * MuSimHitOccupancy: analyzer module for SimHit level occupancy studies in muon systems * - * The NeutronSimHitsAnalyzer that was used for CSC studies was taken as a base. + * The MuSimHitOccupancy that was used for CSC studies was taken as a base. * */ @@ -373,10 +373,10 @@ struct MyDTSimHit // ================================================================================================ -class NeutronSimHitsAnalyzer : public edm::EDAnalyzer { +class MuSimHitOccupancy : public edm::EDAnalyzer { public: - explicit NeutronSimHitsAnalyzer(const edm::ParameterSet&); - ~NeutronSimHitsAnalyzer(); + explicit MuSimHitOccupancy(const edm::ParameterSet&); + ~MuSimHitOccupancy(); virtual void beginJob() ; virtual void analyze(const edm::Event&, const edm::EventSetup&); @@ -578,7 +578,7 @@ class NeutronSimHitsAnalyzer : public edm::EDAnalyzer { // ================================================================================================ -NeutronSimHitsAnalyzer::NeutronSimHitsAnalyzer(const edm::ParameterSet& iConfig) +MuSimHitOccupancy::MuSimHitOccupancy(const edm::ParameterSet& iConfig) { // should be set to false if running over a regular MB sample input_is_neutrons_ = iConfig.getUntrackedParameter< bool >("inputIsNeutrons", true); @@ -862,13 +862,13 @@ NeutronSimHitsAnalyzer::NeutronSimHitsAnalyzer(const edm::ParameterSet& iConfig) } // ================================================================================================ -NeutronSimHitsAnalyzer::~NeutronSimHitsAnalyzer() +MuSimHitOccupancy::~MuSimHitOccupancy() {} // ================================================================================================ void -NeutronSimHitsAnalyzer::bookCSCSimHitsTrees() +MuSimHitOccupancy::bookCSCSimHitsTrees() { edm::Service fs; @@ -903,7 +903,7 @@ NeutronSimHitsAnalyzer::bookCSCSimHitsTrees() // ================================================================================================ void -NeutronSimHitsAnalyzer::bookGEMSimHitsTrees() +MuSimHitOccupancy::bookGEMSimHitsTrees() { edm::Service fs; gem_sh_tree = fs->make("GEMSimHitsTree", "GEMSimHitsTree"); @@ -938,7 +938,7 @@ NeutronSimHitsAnalyzer::bookGEMSimHitsTrees() // ================================================================================================ void -NeutronSimHitsAnalyzer::bookRPCSimHitsTrees() +MuSimHitOccupancy::bookRPCSimHitsTrees() { edm::Service fs; rpc_sh_tree = fs->make("RPCSimHitsTree", "RPCSimHitsTree"); @@ -973,7 +973,7 @@ NeutronSimHitsAnalyzer::bookRPCSimHitsTrees() // ================================================================================================ void -NeutronSimHitsAnalyzer::bookDTSimHitsTrees() +MuSimHitOccupancy::bookDTSimHitsTrees() { edm::Service fs; dt_sh_tree = fs->make("DTSimHitsTree", "DTSimHitsTree"); @@ -1579,7 +1579,7 @@ MyDTSimHit::init(PSimHit &sh, const DTGeometry* dt_g, const ParticleDataTable * // ================================================================================================ void -NeutronSimHitsAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +MuSimHitOccupancy::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { using namespace edm; using namespace std; @@ -1654,7 +1654,7 @@ NeutronSimHitsAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& // ================================================================================================ void -NeutronSimHitsAnalyzer::analyzeCSC() +MuSimHitOccupancy::analyzeCSC() { using namespace edm; using namespace std; @@ -1773,7 +1773,7 @@ NeutronSimHitsAnalyzer::analyzeCSC() // ================================================================================================ void -NeutronSimHitsAnalyzer::analyzeGEM() +MuSimHitOccupancy::analyzeGEM() { using namespace edm; using namespace std; @@ -1887,7 +1887,7 @@ NeutronSimHitsAnalyzer::analyzeGEM() // ================================================================================================ void -NeutronSimHitsAnalyzer::analyzeRPC() +MuSimHitOccupancy::analyzeRPC() { using namespace edm; using namespace std; @@ -2034,7 +2034,7 @@ NeutronSimHitsAnalyzer::analyzeRPC() // ================================================================================================ void -NeutronSimHitsAnalyzer::analyzeDT() +MuSimHitOccupancy::analyzeDT() { using namespace edm; using namespace std; @@ -2092,7 +2092,7 @@ NeutronSimHitsAnalyzer::analyzeDT() // ================================================================================================ -void NeutronSimHitsAnalyzer::calculateCSCDetectorAreas() +void MuSimHitOccupancy::calculateCSCDetectorAreas() { for (int i=0; i<=CSC_TYPES; i++) csc_total_areas_cm2[i]=0.; @@ -2139,7 +2139,7 @@ void NeutronSimHitsAnalyzer::calculateCSCDetectorAreas() // ================================================================================================ -void NeutronSimHitsAnalyzer::calculateGEMDetectorAreas() +void MuSimHitOccupancy::calculateGEMDetectorAreas() { std::vector emptyv(12, 0.); float minr[GEM_TYPES+1], maxr[GEM_TYPES+1]; @@ -2191,7 +2191,7 @@ void NeutronSimHitsAnalyzer::calculateGEMDetectorAreas() // ================================================================================================ -void NeutronSimHitsAnalyzer::calculateDTDetectorAreas() +void MuSimHitOccupancy::calculateDTDetectorAreas() { for (int i=0; i<=DT_TYPES; i++) dt_total_areas_cm2[i]=0.; @@ -2224,7 +2224,7 @@ void NeutronSimHitsAnalyzer::calculateDTDetectorAreas() // ================================================================================================ -void NeutronSimHitsAnalyzer::calculateRPCDetectorAreas() +void MuSimHitOccupancy::calculateRPCDetectorAreas() { for (int i=0; i<=RPCB_TYPES; i++) rpcb_total_areas_cm2[i]=0.; for (int i=0; i<=RPCF_TYPES; i++) rpcf_total_areas_cm2[i]=0.; @@ -2269,11 +2269,11 @@ void NeutronSimHitsAnalyzer::calculateRPCDetectorAreas() // ================================================================================================ -void NeutronSimHitsAnalyzer::beginJob() {} +void MuSimHitOccupancy::beginJob() {} // ================================================================================================ -void NeutronSimHitsAnalyzer::endJob() +void MuSimHitOccupancy::endJob() { using namespace std; cout<<"******************* COUNTERS *******************"< > NeutronSimHitsAnalyzer::clusterCSCHitsInLayer(std::vector &hits) +std::vector > MuSimHitOccupancy::clusterCSCHitsInLayer(std::vector &hits) { /* Does recursive clustering: - sort by WG,Strip,TOF @@ -2585,7 +2585,7 @@ std::vector > NeutronSimHitsAnalyzer::clusterCSCHitsInL // ================================================================================================ -std::vector > NeutronSimHitsAnalyzer::clusterGEMHitsInPart(std::vector &hits) +std::vector > MuSimHitOccupancy::clusterGEMHitsInPart(std::vector &hits) { /* Does recursive clustering: - sort by Strip,TOF @@ -2637,7 +2637,7 @@ std::vector > NeutronSimHitsAnalyzer::clusterGEMHitsInP } // ================================================================================================ -std::vector > NeutronSimHitsAnalyzer::clusterRPCHitsInRoll(std::vector &hits) +std::vector > MuSimHitOccupancy::clusterRPCHitsInRoll(std::vector &hits) { /* Does recursive clustering: - sort by Strip,TOF @@ -2691,4 +2691,4 @@ std::vector > NeutronSimHitsAnalyzer::clusterRPCHitsInR // ================================================================================================ //define this as a plug-in -DEFINE_FWK_MODULE(NeutronSimHitsAnalyzer); +DEFINE_FWK_MODULE(MuSimHitOccupancy); diff --git a/SimMuL1/test/runNeutronSimHitsAnalyzer_cfg.py b/SimMuL1/test/runMuSimHitOccupancy_cfg.py similarity index 94% rename from SimMuL1/test/runNeutronSimHitsAnalyzer_cfg.py rename to SimMuL1/test/runMuSimHitOccupancy_cfg.py index ece8d900faa54..bbc2cc1ab5bbc 100644 --- a/SimMuL1/test/runNeutronSimHitsAnalyzer_cfg.py +++ b/SimMuL1/test/runMuSimHitOccupancy_cfg.py @@ -71,12 +71,14 @@ ) -process.neutronAna = cms.EDAnalyzer("NeutronSimHitsAnalyzer", +process.neutronAna = cms.EDAnalyzer("MuSimHitOccupancy", inputIsNeutrons = cms.untracked.bool(not isMB), inputTagCSC = cms.untracked.InputTag("g4SimHits","MuonCSCHits"), + inputTagGEM = cms.untracked.InputTag("g4SimHits","MuonGEMHits"), inputTagRPC = cms.untracked.InputTag("g4SimHits","MuonRPCHits"), inputTagDT = cms.untracked.InputTag("g4SimHits","MuonDTHits") #inputTagCSC = cms.untracked.InputTag("g4SimHitsNeutrons","MuonCSCHits"), + #inputTagGEM = cms.untracked.InputTag("g4SimHitsNeutrons","MuonGEMHits"), #inputTagRPC = cms.untracked.InputTag("g4SimHitsNeutrons","MuonRPCHits"), #inputTagDT = cms.untracked.InputTag("g4SimHitsNeutrons","MuonDTHits") ) From 56d2a8fd29da3d08faf3fabdd0045a0d5c3ec748 Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Mon, 12 Aug 2013 19:33:16 -0500 Subject: [PATCH 073/182] unify chamber type accessors --- SimMuL1/plugins/MuSimHitOccupancy.cc | 35 +++++++++++++++------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/SimMuL1/plugins/MuSimHitOccupancy.cc b/SimMuL1/plugins/MuSimHitOccupancy.cc index 00ed988b122de..10bbd5852b04f 100644 --- a/SimMuL1/plugins/MuSimHitOccupancy.cc +++ b/SimMuL1/plugins/MuSimHitOccupancy.cc @@ -60,10 +60,14 @@ enum ETrigDT {MAX_DT_STATIONS = 4, DT_TYPES = 12}; enum ETrigRPCF {MAX_RPCF_STATIONS = 4, RPCF_TYPES = 12}; enum ETrigRPCB {MAX_RPCB_STATIONS = 4, RPCB_TYPES = 12}; -int typeRPCb(RPCDetId &d) {return 3*d.station() + abs(d.ring()) - 2;} -int typeRPCf(RPCDetId &d) {return 3*d.station() + d.ring() - 3;} -int typeGEM(GEMDetId &d) {return 3*d.station() + d.ring() - 3;} -int typeDT(DTWireId &d) {return 3*d.station() + abs(d.wheel()) - 2;} +int type(CSCDetId &d) {return d.iChamberType();} +int type(GEMDetId &d) {return 3*d.station() + d.ring() - 3;} +int type(RPCDetId &d) +{ + if (d.region()==0) return 3*d.station() + abs(d.ring()) - 2; + else return 3*d.station() + d.ring() - 3; +} +int type(DTWireId &d) {return 3*d.station() + abs(d.wheel()) - 2;} const std::string csc_type[CSC_TYPES+1] = { "all", "ME1/a", "ME1/b", "ME1/2", "ME1/3", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2"}; @@ -995,7 +999,7 @@ MyCSCDetId::init(CSCDetId &id) r = id.ring(); c = id.chamber(); l = id.layer(); - t = id.iChamberType(); + t = type(id); } @@ -1190,7 +1194,7 @@ MyGEMDetId::init(GEMDetId &id) layer = id.layer(); ch = id.chamber(); part = id.roll(); - t = typeGEM(id); + t = type(id); } @@ -1363,8 +1367,7 @@ MyRPCDetId::init(RPCDetId &id) layer = id.layer(); subsec = id.subsector(); roll = id.roll(); - if (reg!=0) t = typeRPCf(id); - else t = typeRPCb(id); + t = type(id); } @@ -1536,7 +1539,7 @@ MyDTDetId::init(DTWireId &id) sl = id.superLayer(); l = id.layer(); wire = id.wire(); - t = typeDT(id); + t = type(id); } @@ -2157,7 +2160,7 @@ void MuSimHitOccupancy::calculateGEMDetectorAreas() for(auto p: etaPartitions) { GEMDetId id = p->id(); - int t = typeGEM(id); + int t = type(id); int part = id.roll(); const TrapezoidalStripTopology* top = dynamic_cast(&(p->topology())); @@ -2165,7 +2168,7 @@ void MuSimHitOccupancy::calculateGEMDetectorAreas() float xmax = top->localPosition((float)p->nstrips()).x(); float rollarea = top->stripLength() * (xmax - xmin); gem_total_areas_cm2[0] += rollarea; - gem_total_areas_cm2[typeGEM(id)] += rollarea; + gem_total_areas_cm2[t] += rollarea; gem_total_part_areas_cm2[0][0] += rollarea; gem_total_part_areas_cm2[t][part] += rollarea; cout<<"Partition: "<( *it ); DTWireId id = (DTWireId) layer->id(); - int ctype = typeDT(id); + int t = type(id); const DTTopology& topo = layer->specificTopology(); // cell's sensible width * # cells @@ -2210,9 +2213,9 @@ void MuSimHitOccupancy::calculateDTDetectorAreas() float layer_area = w*l; dt_total_areas_cm2[0] += layer_area; - dt_total_areas_cm2[ctype] += layer_area; + dt_total_areas_cm2[t] += layer_area; - if (id.layer()==1) cout<<"DT type "<localPosition((float)roll->nstrips())).x(); float rollarea = top_->stripLength() * (xmax - xmin); rpcf_total_areas_cm2[0] += rollarea; - rpcf_total_areas_cm2[typeRPCf(id)] += rollarea; + rpcf_total_areas_cm2[type(id)] += rollarea; // cout<<"Roll: RawId: "< Date: Mon, 12 Aug 2013 22:28:42 -0500 Subject: [PATCH 074/182] separate geometry utils and analysis data structs lighten up MuSimHitOccupancy analyzer by splitting some code off it --- SimMuL1/interface/MuGeometryHelpers.h | 119 +++ SimMuL1/interface/MuNtupleClasses.h | 354 +++++++ SimMuL1/plugins/MuSimHitOccupancy.cc | 1316 ++----------------------- SimMuL1/src/MuGeometryHelpers.cc | 190 ++++ SimMuL1/src/MuNtupleClasses.cc | 595 +++++++++++ 5 files changed, 1342 insertions(+), 1232 deletions(-) create mode 100644 SimMuL1/interface/MuGeometryHelpers.h create mode 100644 SimMuL1/interface/MuNtupleClasses.h create mode 100644 SimMuL1/src/MuGeometryHelpers.cc create mode 100644 SimMuL1/src/MuNtupleClasses.cc diff --git a/SimMuL1/interface/MuGeometryHelpers.h b/SimMuL1/interface/MuGeometryHelpers.h new file mode 100644 index 0000000000000..eeac1e61fff07 --- /dev/null +++ b/SimMuL1/interface/MuGeometryHelpers.h @@ -0,0 +1,119 @@ +#ifndef SimMuL1_MuGeometryArea_h +#define SimMuL1_MuGeometryArea_h + +/**\file MuGeometryHelpers + + Description: + + Utils to summarize and access some of the muon detectors' information, sensitive volumes areas in particular. +*/ + +#include "DataFormats/MuonDetId/interface/CSCDetId.h" +#include "DataFormats/MuonDetId/interface/GEMDetId.h" +#include "DataFormats/MuonDetId/interface/RPCDetId.h" +#include "DataFormats/MuonDetId/interface/DTWireId.h" + +class CSCGeometry; +class GEMGeometry; +class RPCGeometry; +class DTGeometry; + + +namespace mugeo { + +// constants +enum ETrigCSC {MAX_CSC_STATIONS = 4, CSC_TYPES = 10}; +enum ETrigGEM {MAX_GEM_STATIONS = 1, GEM_TYPES = 1}; +enum ETrigDT {MAX_DT_STATIONS = 4, DT_TYPES = 12}; +enum ETrigRPCF {MAX_RPCF_STATIONS = 4, RPCF_TYPES = 12}; +enum ETrigRPCB {MAX_RPCB_STATIONS = 4, RPCB_TYPES = 12}; + +// chamber types +int type(CSCDetId &d) {return d.iChamberType();} +int type(GEMDetId &d) {return 3*d.station() + d.ring() - 3;} +int type(RPCDetId &d) +{ + if (d.region()==0) return 3*d.station() + abs(d.ring()) - 2; + else return 3*d.station() + d.ring() - 3; +} +int type(DTWireId &d) {return 3*d.station() + abs(d.wheel()) - 2;} + +// labels for chamber types +const std::string csc_type[CSC_TYPES+1] = + { "all", "ME1/a", "ME1/b", "ME1/2", "ME1/3", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2"}; +const std::string csc_type_[CSC_TYPES+1] = + { "all", "ME1a", "ME1b", "ME12", "ME13", "ME21", "ME22", "ME31", "ME32", "ME41", "ME42"}; + +const std::string gem_type[GEM_TYPES+1] = + { "all", "GE1/1"}; +const std::string gem_type_[GEM_TYPES+1] = + { "all", "GE11"}; + +const std::string dt_type[DT_TYPES+1] = + { "all", "MB1/0", "MB1/1", "MB1/2", "MB2/0", "MB2/1", "MB2/2", "MB3/0", "MB3/1", "MB3/2", "MB4/0", "MB4/1", "MB4/2",}; +const std::string dt_type_[DT_TYPES+1] = + { "all", "MB10", "MB11", "MB12", "MB20", "MB21", "MB22", "MB30", "MB31", "MB32", "MB40", "MB41", "MB42",}; + +const std::string rpcf_type[RPCF_TYPES+1] = + { "all", "RE1/1", "RE1/2", "RE1/3", "RE2/1", "RE2/2", "RE2/3", "RE3/1", "RE3/2", "RE3/3", "RE4/1", "RE4/2", "RE4/3"}; +const std::string rpcf_type_[RPCF_TYPES+1] = + { "all", "RE11", "RE12", "RE13", "RE21", "RE22", "RE23", "RE31", "RE32", "RE33", "RE41", "RE42", "RE43"}; + +const std::string rpcb_type[RPCB_TYPES+1] = + { "all", "RB1/0", "RB1/1", "RB1/2", "RB2/0", "RB2/1", "RB2/2", "RB3/0", "RB3/1", "RB3/2", "RB4/0", "RB4/1", "RB4/2",}; +const std::string rpcb_type_[RPCB_TYPES+1] = + { "all", "RB10", "RB11", "RB12", "RB20", "RB21", "RB22", "RB30", "RB31", "RB32", "RB40", "RB41", "RB42",}; + +// chamber radial segmentation numbers (including factor of 2 for non-zero wheels in barrel): +const double csc_radial_segm[CSC_TYPES+1] = {1, 36, 36, 36, 36, 18, 36, 18, 36, 18, 36}; +const double gem_radial_segm[GEM_TYPES+1] = {1, 36}; +const double dt_radial_segm[DT_TYPES+1] = {1, 12, 12*2, 12*2, 12, 12*2, 12*2, 12, 12*2, 12*2, 14, 14*2, 14*2}; +const double rpcb_radial_segm[RPCF_TYPES+1] = {1, 12, 12*2, 12*2, 12, 12*2, 12*2, 24, 24*2, 24*2, 12, 24*2, 24*2}; +const double rpcf_radial_segm[RPCF_TYPES+1] = {1, 36, 36, 36, 18, 36, 36, 18, 36, 36, 18, 36, 36}; + +// DT # of superlayers in chamber +const double dt_n_superlayers[DT_TYPES+1] = {1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2}; + + +/// +class MuGeometryAreas +{ +public: + //MuGeometryAreas(); + + void calculateCSCDetectorAreas(const CSCGeometry* g); + void calculateGEMDetectorAreas(const GEMGeometry* g); + void calculateDTDetectorAreas(const DTGeometry* g); + void calculateRPCDetectorAreas(const RPCGeometry* g); + + float csc_total_areas_cm2[CSC_TYPES+1]; + float gem_total_areas_cm2[GEM_TYPES+1]; + float dt_total_areas_cm2[DT_TYPES+1]; + float rpcb_total_areas_cm2[RPCB_TYPES+1]; + float rpcf_total_areas_cm2[RPCF_TYPES+1]; + + // vector index is over partitions + std::vector gem_total_part_areas_cm2[GEM_TYPES+1]; // partition total areas + std::vector gem_part_radius[GEM_TYPES+1]; // partition center radii + std::vector gem_part_halfheight[GEM_TYPES+1]; // partition half height + + // centers of CSC chamber positions in r + const float csc_ch_radius[CSC_TYPES+1] = {0., 128., 203.25, 369.75, 594.1, 239.05, 525.55, 251.75, 525.55, 261.7, 525.55}; + // half-spans of CSC stations in r + const float csc_ch_halfheight[CSC_TYPES+1] = {0., 22., 53.25, 87.25, 82.1, 94.85, 161.55, 84.85, 161.55, 74.7, 161.55}; + + + // centers of MB chamber types in |z| + // Note: normally, wheel 0 chamber is centered at 0, but as we are looking at "half-detector" + // we take half-of-half of a wheel 0 position + const float dt_ch_z[DT_TYPES+1] = {0., 58.7, 273, 528, 58.7, 273, 528, 58.7, 273, 528, 58.7, 273, 528}; + // half-spans of MB chambers in |z| + const float dt_ch_halfspanz[DT_TYPES+1] = {0., 58.7, 117.4, 117.4, 58.7, 117.4, 117.4, 58.7, 117.4, 117.4, 58.7, 117.4, 117.4}; + +private: + +}; + +} // namespace + +#endif diff --git a/SimMuL1/interface/MuNtupleClasses.h b/SimMuL1/interface/MuNtupleClasses.h new file mode 100644 index 0000000000000..9e874a988d75c --- /dev/null +++ b/SimMuL1/interface/MuNtupleClasses.h @@ -0,0 +1,354 @@ +#ifndef SimMuL1_MuNtupleClasses_h +#define SimMuL1_MuNtupleClasses_h + +/**\file MuNtupleClasses + +Various data classes to use for analysis ntuples + +*/ + +#include "DataFormats/MuonDetId/interface/CSCDetId.h" +#include "DataFormats/MuonDetId/interface/GEMDetId.h" +#include "DataFormats/MuonDetId/interface/RPCDetId.h" +#include "DataFormats/MuonDetId/interface/DTWireId.h" +#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" + +class CSCGeometry; +class GEMGeometry; +class RPCGeometry; +class DTGeometry; + + +// ================================================================================================ +// CSC classes + +struct MyCSCDetId +{ + void init(CSCDetId &id); + void book(TTree* t) + { + t->Branch("id", &e,"e/S:s:r:c:l:t"); + } + Short_t e, s, r, c, l; + Short_t t; // type 1-10: ME1/a,1/b,1/2,1/3,2/1...4/2 +}; + +struct MyCSCSimHit +{ + void init(PSimHit &sh, const CSCGeometry* csc_g, const ParticleDataTable * pdt); + void book(TTree* t) + { + t->Branch("sh", &x,"x/F:y:z:r:eta:phi:gx:gy:gz:e:p:m:t:trid/I:pdg:w:s"); + } + float eKin() {return sqrt(p*p + m*m) - m;} + bool operator < (const MyCSCSimHit &rhs) const; + Float_t x, y, z; // local + Float_t r, eta, phi, gx, gy, gz; // global + Float_t e; // energy deposit + Float_t p; // particle momentum + Float_t m; // particle mass + Float_t t; // TOF + Int_t trid; // trackId + Int_t pdg; // PDG + Int_t w, s; // WG & Strip +}; + +struct MyCSCCluster +{ + void init(std::vector &shits); + void book(TTree* t) + { + t->Branch("cl", &nh,"nh/I:r/F:eta:phi:gx:gy:gz:e:p:m:mint:maxt:meant:sigmat:mintrid/I:maxtrid:pdg/I:minw:maxw:mins:maxs"); + } + float eKin() {return sqrt(p*p + m*m) - m;} + std::vector hits; + Int_t nh; // # of hits + Float_t r, eta, phi, gx, gy, gz; // globals fot 1st hit + Float_t e; // total energy deposit + Float_t p, m; // particle mass and initial momentum + Float_t mint, maxt; // min/max TOF + Float_t meant, sigmat;// mean&stdev of TOF + Int_t mintrid, maxtrid;// trackId + Int_t pdg; // PDG + Int_t minw, maxw, mins, maxs; // min/max WG & Strip +}; + +struct MyCSCLayer +{ + void init(int l, std::vector &sclusters); + void book(TTree* t) + { + t->Branch("la", &nh,"nh/I:nclu:mint/F:maxt:mintrid/I:maxtrid:minw:maxw:mins:maxs"); + } + std::vector clusters; + Int_t ln; // layer #, not stored + Int_t nh; // # of hits + Int_t nclu; // # of clusters + Float_t mint, maxt; // min/max TOF + Int_t mintrid, maxtrid;// trackId + Int_t minw, maxw, mins, maxs; // min/max WG & Strip +}; + +struct MyCSCChamber +{ + void init(std::vector &slayers); + void book(TTree* t) + { + t->Branch("ch", &nh,"nh/I:nclu:nl:l1:ln:mint/F:maxt:minw/I:maxw:mins:maxs"); + } + Int_t nh; // # of hits + Int_t nclu; // # of clusters + Int_t nl, l1, ln; // # of layers, 1st and last layer # + Float_t mint, maxt; // min/max TOF + Int_t minw, maxw, mins, maxs; // min/max WG & Strip +}; + +struct MyCSCEvent +{ + void init(std::vector &schambers); + void book(TTree* t) + { + t->Branch("ev", &nh,"nh/I:nclu:nch:nch2:nch3:nch4:nch5:nch6"); + } + Int_t nh; // #hits + Int_t nclu; // #clusters + Int_t nch; // #chambers w/ hits + Int_t nch2, nch3, nch4, nch5, nch6; // #chambers w/ at least 2,3... hits +}; + + +// ================================================================================================ +// GEM classes + +struct MyGEMDetId +{ + void init(GEMDetId &id); + void book(TTree* t) + { + t->Branch("id", ®,"reg/S:ring:st:layer:ch:part:t"); + } + Short_t reg, ring, st, layer, ch, part; + Short_t t; // type 1: GE1/1 +}; + +struct MyGEMSimHit +{ + void init(PSimHit &sh, const GEMGeometry* gem_g, const ParticleDataTable * pdt); + void book(TTree* t) + { + t->Branch("sh", &x,"x/F:y:z:r:eta:phi:gx:gy:gz:e:p:m:t:trid/I:pdg:s"); + } + float eKin() {return sqrt(p*p + m*m) - m;} + bool operator < (const MyGEMSimHit &rhs) const; + Float_t x, y, z; // local + Float_t r, eta, phi, gx, gy, gz; // global + Float_t e; // energy deposit + Float_t p; // particle momentum + Float_t m; // particle mass + Float_t t; // TOF + Int_t trid; // trackId + Int_t pdg; // PDG + Int_t s; // Strip +}; + +struct MyGEMCluster +{ + void init(std::vector &shits); + void book(TTree* t) + { + t->Branch("cl", &nh,"nh/I:r/F:eta:phi:gx:gy:gz:e:p:m:mint:maxt:meant:sigmat:mintrid/I:maxtrid:pdg/I:mins:maxs"); + } + float eKin() {return sqrt(p*p + m*m) - m;} + std::vector hits; + Int_t nh; // # of hits + Float_t r, eta, phi, gx, gy, gz; // globals fot 1st hit + Float_t e; // total energy deposit + Float_t p, m; // 1st particle mass and initial momentum + Float_t mint, maxt; // min/max TOF + Float_t meant, sigmat;// mean&stdev of TOF + Int_t mintrid, maxtrid;// trackId + Int_t pdg; // PDG + Int_t mins, maxs; // min/max strip +}; + +struct MyGEMPart +{ + void init(int r, int l, std::vector &sclusters); + void book(TTree* t) + { + t->Branch("part", &nh,"nh/I:nclu:mint/F:maxt:mintrid/I:maxtrid:mins:maxs"); + } + std::vector clusters; + Int_t pn; // partition #, not stored + Int_t ln; // layer #, not stored + Int_t nh; // # of hits + Int_t nclu; // # of clusters + Float_t mint, maxt; // min/max TOF + Int_t mintrid, maxtrid;// trackId + Int_t mins, maxs; // min/max strip +}; + +struct MyGEMChamber +{ + void init(std::vector &sparts); + void book(TTree* t) + { + t->Branch("ch", &nh,"nh/I:nclu:np:nl:mint/F:maxt"); + } + Int_t nh; // # of hits + Int_t nclu; // # of clusters + Int_t np; // # of partitions + Int_t nl; // # of layers + Float_t mint, maxt; // min/max TOF +}; + +struct MyGEMEvent +{ + void init(std::vector &schambers); + void book(TTree* t) + { + t->Branch("ev", &nh,"nh/I:nclu:np:nch"); + } + Int_t nh; // #hits + Int_t nclu; // #clusters + Int_t np; // #partitions + Int_t nch; // #chambers w/ hits + //Short_t nch2, nch3, nch4, nch5, nch6; // #chambers w/ at least 2,3... hits +}; + + +// ================================================================================================ +// PRC classes + +struct MyRPCDetId +{ + void init(RPCDetId &id); + void book(TTree* t) + { + t->Branch("id", ®,"reg/S:ring:st:sec:layer:subsec:roll:t"); + } + Short_t reg, ring, st, sec, layer, subsec, roll; + Short_t t; // type 1-8: RE1/2,1/3,2/2,2/3,3/2,3/3,4/2,4/3 +}; + +struct MyRPCSimHit +{ + void init(PSimHit &sh, const RPCGeometry* rpc_g, const ParticleDataTable * pdt); + void book(TTree* t) + { + t->Branch("sh", &x,"x/F:y:z:r:eta:phi:gx:gy:gz:e:p:m:t:trid/I:pdg:s"); + } + float eKin() {return sqrt(p*p + m*m) - m;} + bool operator < (const MyRPCSimHit &rhs) const; + Float_t x, y, z; // local + Float_t r, eta, phi, gx, gy, gz; // global + Float_t e; // energy deposit + Float_t p; // particle momentum + Float_t m; // particle mass + Float_t t; // TOF + Int_t trid; // trackId + Int_t pdg; // PDG + Int_t s; // Strip +}; + +struct MyRPCCluster +{ + void init(std::vector &shits); + void book(TTree* t) + { + t->Branch("cl", &nh,"nh/I:r/F:eta:phi:gx:gy:gz:e:p:m:mint:maxt:meant:sigmat:mintrid/I:maxtrid:pdg/I:mins:maxs"); + } + float eKin() {return sqrt(p*p + m*m) - m;} + std::vector hits; + Int_t nh; // # of hits + Float_t r, eta, phi, gx, gy, gz; // globals fot 1st hit + Float_t e; // total energy deposit + Float_t p, m; // 1st particle mass and initial momentum + Float_t mint, maxt; // min/max TOF + Float_t meant, sigmat;// mean&stdev of TOF + Int_t mintrid, maxtrid;// trackId + Int_t pdg; // PDG + Int_t mins, maxs; // min/max strip +}; + +struct MyRPCRoll +{ + void init(int r, int l, std::vector &sclusters); + void book(TTree* t) + { + t->Branch("rl", &nh,"nh/I:nclu:mint/F:maxt:mintrid/I:maxtrid:mins:maxs"); + } + std::vector clusters; + Int_t rn; // roll #, not stored + Int_t ln; // layer #, not stored + Int_t nh; // # of hits + Int_t nclu; // # of clusters + Float_t mint, maxt; // min/max TOF + Int_t mintrid, maxtrid;// trackId + Int_t mins, maxs; // min/max strip +}; + +struct MyRPCChamber +{ + void init(std::vector &srolls); + void book(TTree* t) + { + t->Branch("ch", &nh,"nh/I:nclu:nr:nl:mint/F:maxt"); + } + Int_t nh; // # of hits + Int_t nclu; // # of clusters + Int_t nr; // # of rolls + Int_t nl; // # of layers + Float_t mint, maxt; // min/max TOF +}; + +struct MyRPCEvent +{ + void init(std::vector &schambers); + void book(TTree* t) + { + t->Branch("ev", &nh,"nh/I:nclu:nr:nch"); + } + Int_t nh; // #hits + Int_t nclu; // #clusters + Int_t nr; // #rolls + Int_t nch; // #chambers w/ hits + //Short_t nch2, nch3, nch4, nch5, nch6; // #chambers w/ at least 2,3... hits +}; + + +// ================================================================================================ +// DT classes + +struct MyDTDetId +{ + void init(DTWireId &id); + void book(TTree* t) + { + t->Branch("id", &st,"st/I:wh:sec:sl:l:wire:t"); + } + Short_t st, wh, sec, sl, l, wire; + Short_t t; // +}; + +struct MyDTSimHit +{ + void init(PSimHit &sh, const DTGeometry* dt_g, const ParticleDataTable * pdt); + void book(TTree* t) + { + t->Branch("sh", &x,"x/F:y:z:r:eta:phi:gx:gy:gz:e:p:m:t:trid/I:pdg"); + } + float eKin() {return sqrt(p*p + m*m) - m;} + Float_t x, y, z; // local + Float_t r, eta, phi, gx, gy, gz; // global + Float_t e; // energy deposit + Float_t p; // particle momentum + Float_t m; // particle mass + Float_t t; // TOF + Int_t trid; // trackId + Int_t pdg; // PDG + //Int_t w, s; // WG & Strip +}; + + +#endif diff --git a/SimMuL1/plugins/MuSimHitOccupancy.cc b/SimMuL1/plugins/MuSimHitOccupancy.cc index 10bbd5852b04f..8b24e0374aab5 100644 --- a/SimMuL1/plugins/MuSimHitOccupancy.cc +++ b/SimMuL1/plugins/MuSimHitOccupancy.cc @@ -29,8 +29,6 @@ #include "Geometry/RPCGeometry/interface/RPCGeometry.h" #include "Geometry/RPCGeometry/interface/RPCGeomServ.h" #include "Geometry/DTGeometry/interface/DTGeometry.h" -#include "Geometry/CommonTopologies/interface/RectangularStripTopology.h" -#include "Geometry/CommonTopologies/interface/TrapezoidalStripTopology.h" #include "DataFormats/MuonDetId/interface/CSCDetId.h" #include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h" @@ -46,338 +44,32 @@ #include "TTree.h" #include "GEMCode/SimMuL1/interface/PSimHitMapCSC.h" +#include "GEMCode/SimMuL1/interface/MuGeometryHelpers.h" +#include "GEMCode/SimMuL1/interface/MuNtupleClasses.h" #include using std::cout; using std::endl; +using namespace mugeo; namespace { -enum ETrigCSC {MAX_CSC_STATIONS = 4, CSC_TYPES = 10}; -enum ETrigGEM {MAX_GEM_STATIONS = 1, GEM_TYPES = 1}; -enum ETrigDT {MAX_DT_STATIONS = 4, DT_TYPES = 12}; -enum ETrigRPCF {MAX_RPCF_STATIONS = 4, RPCF_TYPES = 12}; -enum ETrigRPCB {MAX_RPCB_STATIONS = 4, RPCB_TYPES = 12}; - -int type(CSCDetId &d) {return d.iChamberType();} -int type(GEMDetId &d) {return 3*d.station() + d.ring() - 3;} -int type(RPCDetId &d) -{ - if (d.region()==0) return 3*d.station() + abs(d.ring()) - 2; - else return 3*d.station() + d.ring() - 3; -} -int type(DTWireId &d) {return 3*d.station() + abs(d.wheel()) - 2;} - -const std::string csc_type[CSC_TYPES+1] = - { "all", "ME1/a", "ME1/b", "ME1/2", "ME1/3", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2"}; -const std::string csc_type_[CSC_TYPES+1] = - { "all", "ME1a", "ME1b", "ME12", "ME13", "ME21", "ME22", "ME31", "ME32", "ME41", "ME42"}; - -const std::string gem_type[GEM_TYPES+1] = - { "all", "GE1/1"}; -const std::string gem_type_[GEM_TYPES+1] = - { "all", "GE11"}; - -const std::string dt_type[DT_TYPES+1] = - { "all", "MB1/0", "MB1/1", "MB1/2", "MB2/0", "MB2/1", "MB2/2", "MB3/0", "MB3/1", "MB3/2", "MB4/0", "MB4/1", "MB4/2",}; -const std::string dt_type_[DT_TYPES+1] = - { "all", "MB10", "MB11", "MB12", "MB20", "MB21", "MB22", "MB30", "MB31", "MB32", "MB40", "MB41", "MB42",}; - -const std::string rpcf_type[RPCF_TYPES+1] = - { "all", "RE1/1", "RE1/2", "RE1/3", "RE2/1", "RE2/2", "RE2/3", "RE3/1", "RE3/2", "RE3/3", "RE4/1", "RE4/2", "RE4/3"}; -const std::string rpcf_type_[RPCF_TYPES+1] = - { "all", "RE11", "RE12", "RE13", "RE21", "RE22", "RE23", "RE31", "RE32", "RE33", "RE41", "RE42", "RE43"}; - -const std::string rpcb_type[RPCB_TYPES+1] = - { "all", "RB1/0", "RB1/1", "RB1/2", "RB2/0", "RB2/1", "RB2/2", "RB3/0", "RB3/1", "RB3/2", "RB4/0", "RB4/1", "RB4/2",}; -const std::string rpcb_type_[RPCB_TYPES+1] = - { "all", "RB10", "RB11", "RB12", "RB20", "RB21", "RB22", "RB30", "RB31", "RB32", "RB40", "RB41", "RB42",}; - -// chamber radial segmentations (including factor of 2 for non-zero wheels in barrel): -const double csc_radial_segm[CSC_TYPES+1] = {1, 36, 36, 36, 36, 18, 36, 18, 36, 18, 36}; -const double gem_radial_segm[GEM_TYPES+1] = {1, 36}; -const double dt_radial_segm[DT_TYPES+1] = {1, 12, 12*2, 12*2, 12, 12*2, 12*2, 12, 12*2, 12*2, 14, 14*2, 14*2}; -const double rpcb_radial_segm[RPCF_TYPES+1] = {1, 12, 12*2, 12*2, 12, 12*2, 12*2, 24, 24*2, 24*2, 12, 24*2, 24*2}; -const double rpcf_radial_segm[RPCF_TYPES+1] = {1, 36, 36, 36, 18, 36, 36, 18, 36, 36, 18, 36, 36}; - -// DT # of superlayers in chamber -const double dt_n_superlayers[DT_TYPES+1] = {1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2}; - +// constants for PDG IDs to consider enum ENumPDG {N_PDGIDS=7}; -const int pdg_ids[N_PDGIDS] = {0,11,13,211,321,2212,1000000000}; -const std::string pdg_ids_names[N_PDGIDS] = {"unknown","e","#mu","#pi","K","p","nuclei"}; -const std::string pdg_ids_names_[N_PDGIDS] = {"","e","mu","pi","K","p","nucl"}; +const int pdg_ids[N_PDGIDS] = {0, 11, 13, 211, 321, 2212, 1000000000}; +const std::string pdg_ids_names[N_PDGIDS] = {"unknown", "e", "#mu", "#pi", "K", "p", "nuclei"}; +const std::string pdg_ids_names_[N_PDGIDS] = {"", "e", "mu", "pi", "K", "p", "nucl"}; const int pdg_colors[N_PDGIDS] = {0, kBlack, kBlue, kGreen+1, kOrange-3, kMagenta, kRed}; const int pdg_markers[N_PDGIDS] = {0, 1, 24, 3, 5, 26, 2}; } // local namespace -// -// class declarations -// -// ================================================================================================ - -struct MyCSCDetId -{ - void init(CSCDetId &id); - Short_t e, s, r, c, l; - Short_t t; // type 1-10: ME1/a,1/b,1/2,1/3,2/1...4/2 -}; - -struct MyCSCSimHit -{ - void init(PSimHit &sh, const CSCGeometry* csc_g, const ParticleDataTable * pdt); - float eKin() {return sqrt(p*p + m*m) - m;} - bool operator < (const MyCSCSimHit &rhs) const; - Float_t x, y, z; // local - Float_t r, eta, phi, gx, gy, gz; // global - Float_t e; // energy deposit - Float_t p; // particle momentum - Float_t m; // particle mass - Float_t t; // TOF - Int_t trid; // trackId - Int_t pdg; // PDG - Int_t w, s; // WG & Strip -}; - - -struct MyCSCCluster -{ - void init(std::vector &shits); - float eKin() {return sqrt(p*p + m*m) - m;} - std::vector hits; - Int_t nh; // # of hits - Float_t r, eta, phi, gx, gy, gz; // globals fot 1st hit - Float_t e; // total energy deposit - Float_t p, m; // particle mass and initial momentum - Float_t mint, maxt; // min/max TOF - Float_t meant, sigmat;// mean&stdev of TOF - Int_t mintrid, maxtrid;// trackId - Int_t pdg; // PDG - Int_t minw, maxw, mins, maxs; // min/max WG & Strip -}; - -struct MyCSCLayer -{ - void init(int l, std::vector &sclusters); - std::vector clusters; - Int_t ln; // layer #, not stored - Int_t nh; // # of hits - Int_t nclu; // # of clusters - Float_t mint, maxt; // min/max TOF - Int_t mintrid, maxtrid;// trackId - Int_t minw, maxw, mins, maxs; // min/max WG & Strip -}; - -struct MyCSCChamber -{ - void init(std::vector &slayers); - Int_t nh; // # of hits - Int_t nclu; // # of clusters - Int_t nl, l1, ln; // # of layers, 1st and last layer # - Float_t mint, maxt; // min/max TOF - Int_t minw, maxw, mins, maxs; // min/max WG & Strip -}; - -struct MyCSCEvent -{ - void init(std::vector &schambers); - Int_t nh; // #hits - Int_t nclu; // #clusters - Int_t nch; // #chambers w/ hits - Int_t nch2, nch3, nch4, nch5, nch6; // #chambers w/ at least 2,3... hits -}; - - -// ================================================================================================ - -struct MyGEMDetId -{ - void init(GEMDetId &id); - Short_t reg, ring, st, layer, ch, part; - Short_t t; // type 1: GE1/1 -}; - - -struct MyGEMSimHit -{ - void init(PSimHit &sh, const GEMGeometry* gem_g, const ParticleDataTable * pdt); - float eKin() {return sqrt(p*p + m*m) - m;} - bool operator < (const MyGEMSimHit &rhs) const; - Float_t x, y, z; // local - Float_t r, eta, phi, gx, gy, gz; // global - Float_t e; // energy deposit - Float_t p; // particle momentum - Float_t m; // particle mass - Float_t t; // TOF - Int_t trid; // trackId - Int_t pdg; // PDG - Int_t s; // Strip -}; - - -struct MyGEMCluster -{ - void init(std::vector &shits); - float eKin() {return sqrt(p*p + m*m) - m;} - std::vector hits; - Int_t nh; // # of hits - Float_t r, eta, phi, gx, gy, gz; // globals fot 1st hit - Float_t e; // total energy deposit - Float_t p, m; // 1st particle mass and initial momentum - Float_t mint, maxt; // min/max TOF - Float_t meant, sigmat;// mean&stdev of TOF - Int_t mintrid, maxtrid;// trackId - Int_t pdg; // PDG - Int_t mins, maxs; // min/max strip -}; - - -struct MyGEMPart -{ - void init(int r, int l, std::vector &sclusters); - std::vector clusters; - Int_t pn; // partition #, not stored - Int_t ln; // layer #, not stored - Int_t nh; // # of hits - Int_t nclu; // # of clusters - Float_t mint, maxt; // min/max TOF - Int_t mintrid, maxtrid;// trackId - Int_t mins, maxs; // min/max strip -}; - - -struct MyGEMChamber -{ - void init(std::vector &sparts); - Int_t nh; // # of hits - Int_t nclu; // # of clusters - Int_t np; // # of partitions - Int_t nl; // # of layers - Float_t mint, maxt; // min/max TOF -}; - - -struct MyGEMEvent -{ - void init(std::vector &schambers); - Int_t nh; // #hits - Int_t nclu; // #clusters - Int_t np; // #partitions - Int_t nch; // #chambers w/ hits - //Short_t nch2, nch3, nch4, nch5, nch6; // #chambers w/ at least 2,3... hits -}; - // ================================================================================================ +// the analyzer -struct MyRPCDetId -{ - void init(RPCDetId &id); - Short_t reg, ring, st, sec, layer, subsec, roll; - Short_t t; // type 1-8: RE1/2,1/3,2/2,2/3,3/2,3/3,4/2,4/3 -}; - - -struct MyRPCSimHit +class MuSimHitOccupancy : public edm::EDAnalyzer { - void init(PSimHit &sh, const RPCGeometry* rpc_g, const ParticleDataTable * pdt); - float eKin() {return sqrt(p*p + m*m) - m;} - bool operator < (const MyRPCSimHit &rhs) const; - Float_t x, y, z; // local - Float_t r, eta, phi, gx, gy, gz; // global - Float_t e; // energy deposit - Float_t p; // particle momentum - Float_t m; // particle mass - Float_t t; // TOF - Int_t trid; // trackId - Int_t pdg; // PDG - Int_t s; // Strip -}; - - -struct MyRPCCluster -{ - void init(std::vector &shits); - float eKin() {return sqrt(p*p + m*m) - m;} - std::vector hits; - Int_t nh; // # of hits - Float_t r, eta, phi, gx, gy, gz; // globals fot 1st hit - Float_t e; // total energy deposit - Float_t p, m; // 1st particle mass and initial momentum - Float_t mint, maxt; // min/max TOF - Float_t meant, sigmat;// mean&stdev of TOF - Int_t mintrid, maxtrid;// trackId - Int_t pdg; // PDG - Int_t mins, maxs; // min/max strip -}; - - -struct MyRPCRoll -{ - void init(int r, int l, std::vector &sclusters); - std::vector clusters; - Int_t rn; // roll #, not stored - Int_t ln; // layer #, not stored - Int_t nh; // # of hits - Int_t nclu; // # of clusters - Float_t mint, maxt; // min/max TOF - Int_t mintrid, maxtrid;// trackId - Int_t mins, maxs; // min/max strip -}; - - -struct MyRPCChamber -{ - void init(std::vector &srolls); - Int_t nh; // # of hits - Int_t nclu; // # of clusters - Int_t nr; // # of rolls - Int_t nl; // # of layers - Float_t mint, maxt; // min/max TOF -}; - - -struct MyRPCEvent -{ - void init(std::vector &schambers); - Int_t nh; // #hits - Int_t nclu; // #clusters - Int_t nr; // #rolls - Int_t nch; // #chambers w/ hits - //Short_t nch2, nch3, nch4, nch5, nch6; // #chambers w/ at least 2,3... hits -}; - - -// ================================================================================================ - -struct MyDTDetId -{ - void init(DTWireId &id); - Short_t st, wh, sec, sl, l, wire; - Short_t t; // -}; - - -struct MyDTSimHit -{ - void init(PSimHit &sh, const DTGeometry* dt_g, const ParticleDataTable * pdt); - float eKin() {return sqrt(p*p + m*m) - m;} - Float_t x, y, z; // local - Float_t r, eta, phi, gx, gy, gz; // global - Float_t e; // energy deposit - Float_t p; // particle momentum - Float_t m; // particle mass - Float_t t; // TOF - Int_t trid; // trackId - Int_t pdg; // PDG - //Int_t w, s; // WG & Strip -}; - - -// ================================================================================================ - -class MuSimHitOccupancy : public edm::EDAnalyzer { public: explicit MuSimHitOccupancy(const edm::ParameterSet&); ~MuSimHitOccupancy(); @@ -432,21 +124,7 @@ class MuSimHitOccupancy : public edm::EDAnalyzer { SimHitAnalysis::PSimHitMap simhit_map_dt; // sensitive areas - - void calculateCSCDetectorAreas(); - void calculateGEMDetectorAreas(); - void calculateDTDetectorAreas(); - void calculateRPCDetectorAreas(); - - float csc_total_areas_cm2[CSC_TYPES+1]; - float gem_total_areas_cm2[GEM_TYPES+1]; - float dt_total_areas_cm2[DT_TYPES+1]; - float rpcb_total_areas_cm2[RPCB_TYPES+1]; - float rpcf_total_areas_cm2[RPCF_TYPES+1]; - - // vector index is over partitions - std::vector gem_total_part_areas_cm2[GEM_TYPES+1]; - std::vector gem_part_radii[GEM_TYPES+1]; + mugeo::MuGeometryAreas areas_; // some counters: @@ -524,7 +202,7 @@ class MuSimHitOccupancy : public edm::EDAnalyzer { TGraphErrors *gr_csc_hit_flux_me1, *gr_csc_hit_flux_me2, *gr_csc_hit_flux_me3, *gr_csc_hit_flux_me4; TGraphErrors *gr_dt_hit_flux_mb1, *gr_dt_hit_flux_mb2, *gr_dt_hit_flux_mb3, *gr_dt_hit_flux_mb4; - //TGraphErrors *gr_gem_hit_flux_me1; + TGraphErrors *gr_gem_hit_flux_ge1; // some ntuples: @@ -579,8 +257,6 @@ class MuSimHitOccupancy : public edm::EDAnalyzer { }; - - // ================================================================================================ MuSimHitOccupancy::MuSimHitOccupancy(const edm::ParameterSet& iConfig) { @@ -643,9 +319,9 @@ MuSimHitOccupancy::MuSimHitOccupancy(const edm::ParameterSet& iConfig) std::string n_clusters = "n-Clusters"; if (!input_is_neutrons_) n_clusters = "Clusters"; - h_csc_rz_sh_xray = fs->make("h_csc_rz_sh_xray",("CSC "+n_simhits+" #rho-z X-ray;z, cm;#rho, cm").c_str(),2060,550,1080,755,0,755); - h_csc_rz_sh_heatmap = fs->make("h_csc_rz_sh_heatmap",("CSC "+n_simhits+" #rho-z;z, cm;#rho, cm").c_str(),220,541.46,1101.46,150,0,755); - h_csc_rz_clu_heatmap = fs->make("h_csc_rz_clu_heatmap",("CSC "+n_clusters+" #rho-z;z, cm;#rho, cm").c_str(),220,541.46,1101.46,150,0,755); + h_csc_rz_sh_xray = fs->make("h_csc_rz_sh_xray",("CSC "+n_simhits+" #rho-z X-ray;z, cm;#rho, cm").c_str(), 2060, 550, 1080, 755, 0, 755); + h_csc_rz_sh_heatmap = fs->make("h_csc_rz_sh_heatmap",("CSC "+n_simhits+" #rho-z;z, cm;#rho, cm").c_str(), 220, 541.46, 1101.46, 150, 0, 755); + h_csc_rz_clu_heatmap = fs->make("h_csc_rz_clu_heatmap",("CSC "+n_clusters+" #rho-z;z, cm;#rho, cm").c_str(), 220, 541.46, 1101.46, 150, 0, 755); char label[200], nlabel[200]; @@ -694,7 +370,6 @@ MuSimHitOccupancy::MuSimHitOccupancy(const edm::ParameterSet& iConfig) } - h_gem_rz_sh_heatmap = fs->make("h_gem_rz_sh_heatmap",("GEM "+n_simhits+" #rho-z;z, cm;#rho, cm").c_str(),572,0,1120,160,0,800); h_gem_nevt_fraction_with_sh = fs->make("h_gem_nevt_fraction_with_sh", @@ -860,9 +535,9 @@ MuSimHitOccupancy::MuSimHitOccupancy(const edm::ParameterSet& iConfig) gr_dt_hit_flux_mb4->SetName("gr_dt_hit_flux_mb4"); gr_dt_hit_flux_mb4->SetTitle("SimHit Flux in MB4;z, cm;Hz/cm^{2}"); - //gr_gem_hit_flux_me1 = fs->make(2); - //gr_gem_hit_flux_me1->SetName("gr_gem_hit_flux_me1"); - //gr_gem_hit_flux_me1->SetTitle("SimHit Flux in GE1;r, cm;Hz/cm^{2}"); + gr_gem_hit_flux_ge1 = fs->make(10); + gr_gem_hit_flux_ge1->SetName("gr_gem_hit_flux_ge1"); + gr_gem_hit_flux_ge1->SetTitle("SimHit Flux in GE1;r, cm;Hz/cm^{2}"); } // ================================================================================================ @@ -879,29 +554,27 @@ MuSimHitOccupancy::bookCSCSimHitsTrees() csc_sh_tree = fs->make("CSCSimHitsTree", "CSCSimHitsTree"); csc_sh_tree->Branch("evtn", &evtn,"evtn/i"); csc_sh_tree->Branch("shn", &csc_shn,"shn/i"); - csc_sh_tree->Branch("id", &c_id.e,"e/S:s:r:c:l:t"); - csc_sh_tree->Branch("sh", &c_h.x,"x/F:y:z:r:eta:phi:gx:gy:gz:e:p:m:t:trid/I:pdg:w:s"); - //csc_sh_tree->Branch("", &., "/I"); - //csc_sh_tree->Branch("" , "vector" , & ); + c_id.book(csc_sh_tree); + c_h.book(csc_sh_tree); csc_cl_tree = fs->make("CSCClustersTree", "CSCClustersTree"); csc_cl_tree->Branch("evtn", &evtn,"evtn/i"); - csc_cl_tree->Branch("id", &c_id.e,"e/S:s:r:c:l:t"); - csc_cl_tree->Branch("cl", &c_cl.nh,"nh/I:r/F:eta:phi:gx:gy:gz:e:p:m:mint:maxt:meant:sigmat:mintrid/I:maxtrid:pdg/I:minw:maxw:mins:maxs"); + c_id.book(csc_cl_tree); + c_cl.book(csc_cl_tree); csc_la_tree = fs->make("CSCLayersTree", "CSCLayersTree"); csc_la_tree->Branch("evtn", &evtn,"evtn/i"); - csc_la_tree->Branch("id", &c_id.e,"e/S:s:r:c:l:t"); - csc_la_tree->Branch("la", &c_la.nh,"nh/I:nclu:mint/F:maxt:mintrid/I:maxtrid:minw:maxw:mins:maxs"); + c_id.book(csc_la_tree); + c_la.book(csc_la_tree); csc_ch_tree = fs->make("CSCChambersTree", "CSCChambersTree"); csc_ch_tree->Branch("evtn", &evtn,"evtn/i"); - csc_ch_tree->Branch("id", &c_cid.e,"e/S:s:r:c:l:t"); - csc_ch_tree->Branch("ch", &c_ch.nh,"nh/I:nclu:nl:l1:ln:mint/F:maxt:minw/I:maxw:mins:maxs"); + c_id.book(csc_ch_tree); + c_ch.book(csc_ch_tree); csc_ev_tree = fs->make("CSCEventsTree", "CSCEventsTree"); csc_ev_tree->Branch("evtn", &evtn,"evtn/i"); - csc_ev_tree->Branch("ev", &c_ev.nh,"nh/I:nclu:nch:nch2:nch3:nch4:nch5:nch6"); + c_ev.book(csc_ev_tree); } @@ -913,30 +586,27 @@ MuSimHitOccupancy::bookGEMSimHitsTrees() gem_sh_tree = fs->make("GEMSimHitsTree", "GEMSimHitsTree"); gem_sh_tree->Branch("evtn", &evtn,"evtn/i"); gem_sh_tree->Branch("shn", &gem_shn,"shn/i"); - gem_sh_tree->Branch("id", &g_id.reg,"reg/S:ring:st:layer:ch:part:t"); - gem_sh_tree->Branch("sh", &g_h.x,"x/F:y:z:r:eta:phi:gx:gy:gz:e:p:m:t:trid/I:pdg:s"); + g_id.book(gem_sh_tree); + g_h.book(gem_sh_tree); gem_cl_tree = fs->make("GEMClustersTree", "GEMClustersTree"); gem_cl_tree->Branch("evtn", &evtn,"evtn/i"); - gem_cl_tree->Branch("id", &g_id.reg,"reg/S:ring:st:layer:ch:part:t"); - gem_cl_tree->Branch("cl", &g_cl.nh,"nh/I:r/F:eta:phi:gx:gy:gz:e:p:m:mint:maxt:meant:sigmat:mintrid/I:maxtrid:pdg/I:mins:maxs"); + g_id.book(gem_cl_tree); + g_cl.book(gem_cl_tree); gem_part_tree = fs->make("GEMPartTree", "GEMPartTree"); gem_part_tree->Branch("evtn", &evtn,"evtn/i"); - gem_part_tree->Branch("id", &g_id.reg,"reg/S:ring:st:layer:ch:part:t"); - gem_part_tree->Branch("part", &g_part.nh,"nh/I:nclu:mint/F:maxt:mintrid/I:maxtrid:mins:maxs"); + g_id.book(gem_part_tree); + g_part.book(gem_part_tree); gem_ch_tree = fs->make("GEMChambersTree", "GEMChambersTree"); gem_ch_tree->Branch("evtn", &evtn,"evtn/i"); - gem_ch_tree->Branch("id", &g_id.reg,"reg/S:ring:st:layer:ch:part:t"); - gem_ch_tree->Branch("ch", &g_ch.nh,"nh/I:nclu:np:nl:mint/F:maxt"); + g_id.book(gem_ch_tree); + g_ch.book(gem_ch_tree); gem_ev_tree = fs->make("GEMEventsTree", "GEMEventsTree"); gem_ev_tree->Branch("evtn", &evtn,"evtn/i"); - gem_ev_tree->Branch("ev", &g_ev.nh,"nh/I:nclu:np:nch"); - - //gem_sh_tree->Branch("", &., "/I"); - //gem_sh_tree->Branch("" , "vector" , & ); + g_ev.book(gem_ev_tree); } @@ -948,30 +618,27 @@ MuSimHitOccupancy::bookRPCSimHitsTrees() rpc_sh_tree = fs->make("RPCSimHitsTree", "RPCSimHitsTree"); rpc_sh_tree->Branch("evtn", &evtn,"evtn/i"); rpc_sh_tree->Branch("shn", &rpc_shn,"shn/i"); - rpc_sh_tree->Branch("id", &r_id.reg,"reg/S:ring:st:sec:layer:subsec:roll:t"); - rpc_sh_tree->Branch("sh", &r_h.x,"x/F:y:z:r:eta:phi:gx:gy:gz:e:p:m:t:trid/I:pdg:s"); + r_id.book(rpc_sh_tree); + r_h.book(rpc_sh_tree); rpc_cl_tree = fs->make("RPCClustersTree", "RPCClustersTree"); rpc_cl_tree->Branch("evtn", &evtn,"evtn/i"); - rpc_cl_tree->Branch("id", &r_id.reg,"reg/S:ring:st:sec:layer:subsec:roll:t"); - rpc_cl_tree->Branch("cl", &r_cl.nh,"nh/I:r/F:eta:phi:gx:gy:gz:e:p:m:mint:maxt:meant:sigmat:mintrid/I:maxtrid:pdg/I:mins:maxs"); + r_id.book(rpc_cl_tree); + r_cl.book(rpc_cl_tree); rpc_rl_tree = fs->make("RPCRollsTree", "RPCRollsTree"); rpc_rl_tree->Branch("evtn", &evtn,"evtn/i"); - rpc_rl_tree->Branch("id", &r_id.reg,"reg/S:ring:st:sec:layer:subsec:roll:t"); - rpc_rl_tree->Branch("rl", &r_rl.nh,"nh/I:nclu:mint/F:maxt:mintrid/I:maxtrid:mins:maxs"); + r_id.book(rpc_rl_tree); + r_rl.book(rpc_rl_tree); rpc_ch_tree = fs->make("RPCChambersTree", "RPCChambersTree"); rpc_ch_tree->Branch("evtn", &evtn,"evtn/i"); - rpc_ch_tree->Branch("id", &r_id.reg,"reg/S:ring:st:sec:layer:subsec:roll:t"); - rpc_ch_tree->Branch("ch", &r_ch.nh,"nh/I:nclu:nr:nl:mint/F:maxt"); + r_id.book(rpc_ch_tree); + r_ch.book(rpc_ch_tree); rpc_ev_tree = fs->make("RPCEventsTree", "RPCEventsTree"); rpc_ev_tree->Branch("evtn", &evtn,"evtn/i"); - rpc_ev_tree->Branch("ev", &r_ev.nh,"nh/I:nclu:nr:nch"); - - //rpc_sh_tree->Branch("", &., "/I"); - //rpc_sh_tree->Branch("" , "vector" , & ); + r_ev.book(rpc_ev_tree); } @@ -983,602 +650,11 @@ MuSimHitOccupancy::bookDTSimHitsTrees() dt_sh_tree = fs->make("DTSimHitsTree", "DTSimHitsTree"); dt_sh_tree->Branch("evtn", &evtn,"evtn/i"); dt_sh_tree->Branch("shn", &dt_shn,"shn/i"); - dt_sh_tree->Branch("id", &d_id.st,"st/I:wh:sec:sl:l:wire:t"); - dt_sh_tree->Branch("sh", &r_h.x,"x/F:y:z:r:eta:phi:gx:gy:gz:e:p:m:t:trid/I:pdg"); - //dt_sh_tree->Branch("", &., "/I"); - //dt_sh_tree->Branch("" , "vector" , & ); -} - - -// ================================================================================================ -void -MyCSCDetId::init(CSCDetId &id) -{ - e = id.endcap(); - s = id.station(); - r = id.ring(); - c = id.chamber(); - l = id.layer(); - t = type(id); -} - - -// ================================================================================================ -void -MyCSCSimHit::init(PSimHit &sh, const CSCGeometry* csc_g, const ParticleDataTable * pdt) -{ - LocalPoint hitLP = sh.localPosition(); - pdg = sh.particleType(); - m = 0.00051; - - ParticleData const *pdata = 0; - HepPDT::ParticleID particleType(pdg); - if (particleType.isValid()) pdata = pdt->particle(particleType); - if (pdata) m = pdata->mass(); - // cout<<" "<name()<<" "<layer(layerId); - GlobalPoint hitGP = csclayer->toGlobal(hitLP); - - r = hitGP.perp(); - eta = hitGP.eta(); - phi = hitGP.phi(); - gx = hitGP.x(); - gy = hitGP.y(); - gz = hitGP.z(); - - w = csclayer->geometry()->wireGroup(csclayer->geometry()->nearestWire(hitLP)); - s = csclayer->geometry()->nearestStrip(hitLP); -} - - -bool MyCSCSimHit::operator<(const MyCSCSimHit & rhs) const -{ - // first sort by wire group, then by strip, then by TOF - if (w==rhs.w) - { - if (s==rhs.s) return t &shits) -{ - hits = shits; - nh = hits.size(); - mint = 1000000000.; - maxt = -1.; - minw = mins = 1000; - maxw = maxs = -1; - meant = 0; - sigmat = 0; - if (nh==0) return; - r = hits[0].r; - eta = hits[0].eta; - phi = hits[0].phi; - gx = hits[0].gx; - gy = hits[0].gy; - gz = hits[0].gz; - p = hits[0].p; - m = hits[0].m; - pdg = hits[0].pdg; - e = 0; - mintrid = 1000000000; - maxtrid = -1; - for (std::vector::const_iterator itr = hits.begin(); itr != hits.end(); itr++) - { - MyCSCSimHit sh = *itr; - e += sh.e; - if (sh.t < mint) mint = sh.t; - if (sh.t > maxt) maxt = sh.t; - if (sh.w < minw) minw = sh.w; - if (sh.w > maxw) maxw = sh.w; - if (sh.s < mins) mins = sh.s; - if (sh.s > maxs) maxs = sh.s; - if (sh.trid < mintrid) mintrid = sh.trid; - if (sh.trid > maxtrid) maxtrid = sh.trid; - meant += sh.t; - sigmat += sh.t*sh.t; - } - meant = meant/nh; - sigmat = sqrt( sigmat/nh - meant*meant); -cout<<" clu: "< &sclusters) -{ - clusters = sclusters; - ln = l; - nclu = clusters.size(); - nh = 0; - mint = 1000000000.; - maxt = -1.; - minw = mins = 1000; - maxw = maxs = -1; - mintrid = 1000000000; - maxtrid = -1; - if (nclu==0) return; - for (std::vector::const_iterator itr = clusters.begin(); itr != clusters.end(); itr++) - { - MyCSCCluster cl = *itr; - nh += cl.nh; - if (cl.mint < mint) mint = cl.mint; - if (cl.maxt > maxt) maxt = cl.maxt; - if (cl.minw < minw) minw = cl.minw; - if (cl.maxw > maxw) maxw = cl.maxw; - if (cl.mins < mins) mins = cl.mins; - if (cl.maxs > maxs) maxs = cl.maxs; - if (cl.mintrid < mintrid) mintrid = cl.mintrid; - if (cl.maxtrid > maxtrid) maxtrid = cl.maxtrid; - } -} - - -// ================================================================================================ -void -MyCSCChamber::init(std::vector &slayers) -{ - nh = nclu = 0; - nl = slayers.size(); - mint = 1000000000.; - maxt = -1.; - minw = mins = 1000; - maxw = maxs = -1; - if (nl==0) return; - l1 = 7; - ln = -1; - for (std::vector::const_iterator itr = slayers.begin(); itr != slayers.end(); itr++) - { - MyCSCLayer la = *itr; - nh += la.nh; - nclu += la.nclu; - if (la.ln < l1) l1 = la.ln; - if (la.ln > ln) ln = la.ln; - if (la.mint < mint) mint = la.mint; - if (la.maxt > maxt) maxt = la.maxt; - if (la.minw < minw) minw = la.minw; - if (la.maxw > maxw) maxw = la.maxw; - if (la.mins < mins) mins = la.mins; - if (la.maxs > maxs) maxs = la.maxs; - - } -} - - -// ================================================================================================ -void -MyCSCEvent::init(std::vector &schambers) -{ - nch = schambers.size(); - nh = nclu = 0; - nch2 = nch3 = nch4 = nch5 = nch6 = 0; - for (std::vector::const_iterator itr = schambers.begin(); itr != schambers.end(); itr++) - { - MyCSCChamber ch = *itr; - nh += ch.nh; - nclu += ch.nclu; - if (ch.nl>1) nch2++; - if (ch.nl>2) nch3++; - if (ch.nl>3) nch4++; - if (ch.nl>4) nch5++; - if (ch.nl>5) nch6++; - } -} - - - -// ================================================================================================ -void -MyGEMDetId::init(GEMDetId &id) -{ - reg = id.region(); - ring = id.ring(); - st = id.station(); - layer = id.layer(); - ch = id.chamber(); - part = id.roll(); - t = type(id); -} - - -// ================================================================================================ -void -MyGEMSimHit::init(PSimHit &sh, const GEMGeometry* gem_g, const ParticleDataTable * pdt) -{ - LocalPoint hitLP = sh.localPosition(); - pdg = sh.particleType(); - m = 0.00051; - - ParticleData const *pdata = 0; - HepPDT::ParticleID particleType(pdg); - if (particleType.isValid()) pdata = pdt->particle(particleType); - if (pdata) m = pdata->mass(); - // cout<<" "<name()<<" "<idToDet(DetId(sh.detUnitId()))->surface().toGlobal(hitLP); - - r = hitGP.perp(); - eta = hitGP.eta(); - phi = hitGP.phi(); - gx = hitGP.x(); - gy = hitGP.y(); - gz = hitGP.z(); - - GEMDetId rollId(sh.detUnitId()); - s = gem_g->etaPartition(rollId)->strip(hitLP); -} - - -bool MyGEMSimHit::operator<(const MyGEMSimHit & rhs) const -{ - // first sort by strip, then by TOF - if (s==rhs.s) return t &shits) -{ - hits = shits; - nh = hits.size(); - mint = 1000000000.; - maxt = -1.; - mins = 1000; - maxs = -1; - meant = 0; - sigmat = 0; - if (nh==0) return; - r = hits[0].r; - eta = hits[0].eta; - phi = hits[0].phi; - gx = hits[0].gx; - gy = hits[0].gy; - gz = hits[0].gz; - p = hits[0].p; - m = hits[0].m; - pdg = hits[0].pdg; - e = 0; - mintrid = 1000000000; - maxtrid = -1; - for (std::vector::const_iterator itr = hits.begin(); itr != hits.end(); itr++) - { - MyGEMSimHit sh = *itr; - e += sh.e; - if (sh.t < mint) mint = sh.t; - if (sh.t > maxt) maxt = sh.t; - if (sh.s < mins) mins = sh.s; - if (sh.s > maxs) maxs = sh.s; - if (sh.trid < mintrid) mintrid = sh.trid; - if (sh.trid > maxtrid) maxtrid = sh.trid; - meant += sh.t; - sigmat += sh.t*sh.t; - } - meant = meant/nh; - sigmat = sqrt( sigmat/nh - meant*meant); - cout<<" gem clu: "< &sclusters) -{ - clusters = sclusters; - pn = p; - ln = l; - nclu = clusters.size(); - nh = 0; - mint = 1000000000.; - maxt = -1.; - mins = 1000; - maxs = -1; - mintrid = 1000000000; - maxtrid = -1; - if (nclu==0) return; - for (std::vector::const_iterator itr = clusters.begin(); itr != clusters.end(); itr++) - { - MyGEMCluster cl = *itr; - nh += cl.nh; - if (cl.mint < mint) mint = cl.mint; - if (cl.maxt > maxt) maxt = cl.maxt; - if (cl.mins < mins) mins = cl.mins; - if (cl.maxs > maxs) maxs = cl.maxs; - if (cl.mintrid < mintrid) mintrid = cl.mintrid; - if (cl.maxtrid > maxtrid) maxtrid = cl.maxtrid; - } -} - - -// ================================================================================================ -void -MyGEMChamber::init(std::vector &sparts) -{ - nh = nclu = nl = 0; - np = sparts.size(); - mint = 1000000000.; - maxt = -1.; - if (np==0) return; - std::set layers; - for (std::vector::const_iterator itr = sparts.begin(); itr != sparts.end(); itr++) - { - MyGEMPart rl = *itr; - nh += rl.nh; - nclu += rl.nclu; - layers.insert(rl.ln); - if (rl.mint < mint) mint = rl.mint; - if (rl.maxt > maxt) maxt = rl.maxt; - } - nl = layers.size(); -} - - -// ================================================================================================ -void -MyGEMEvent::init(std::vector &schambers) -{ - nch = schambers.size(); - nh = nclu = np = 0; - for (std::vector::const_iterator itr = schambers.begin(); itr != schambers.end(); itr++) - { - MyGEMChamber ch = *itr; - nh += ch.nh; - nclu += ch.nclu; - np += ch.np; - } -} - - -// ================================================================================================ -void -MyRPCDetId::init(RPCDetId &id) -{ - reg = id.region(); - ring = id.ring(); - st = id.station(); - sec = id.sector(); - layer = id.layer(); - subsec = id.subsector(); - roll = id.roll(); - t = type(id); -} - - -// ================================================================================================ -void -MyRPCSimHit::init(PSimHit &sh, const RPCGeometry* rpc_g, const ParticleDataTable * pdt) -{ - LocalPoint hitLP = sh.localPosition(); - pdg = sh.particleType(); - m = 0.00051; - - ParticleData const *pdata = 0; - HepPDT::ParticleID particleType(pdg); - if (particleType.isValid()) pdata = pdt->particle(particleType); - if (pdata) m = pdata->mass(); - // cout<<" "<name()<<" "<idToDet(DetId(sh.detUnitId()))->surface().toGlobal(hitLP); - - r = hitGP.perp(); - eta = hitGP.eta(); - phi = hitGP.phi(); - gx = hitGP.x(); - gy = hitGP.y(); - gz = hitGP.z(); - - RPCDetId rollId(sh.detUnitId()); - s = rpc_g->roll(rollId)->strip(hitLP); + d_id.book(dt_sh_tree); + d_h.book(dt_sh_tree); } -bool MyRPCSimHit::operator<(const MyRPCSimHit & rhs) const -{ - // first sort by strip, then by TOF - if (s==rhs.s) return t &shits) -{ - hits = shits; - nh = hits.size(); - mint = 1000000000.; - maxt = -1.; - mins = 1000; - maxs = -1; - meant = 0; - sigmat = 0; - if (nh==0) return; - r = hits[0].r; - eta = hits[0].eta; - phi = hits[0].phi; - gx = hits[0].gx; - gy = hits[0].gy; - gz = hits[0].gz; - p = hits[0].p; - m = hits[0].m; - pdg = hits[0].pdg; - e = 0; - mintrid = 1000000000; - maxtrid = -1; - for (std::vector::const_iterator itr = hits.begin(); itr != hits.end(); itr++) - { - MyRPCSimHit sh = *itr; - e += sh.e; - if (sh.t < mint) mint = sh.t; - if (sh.t > maxt) maxt = sh.t; - if (sh.s < mins) mins = sh.s; - if (sh.s > maxs) maxs = sh.s; - if (sh.trid < mintrid) mintrid = sh.trid; - if (sh.trid > maxtrid) maxtrid = sh.trid; - meant += sh.t; - sigmat += sh.t*sh.t; - } - meant = meant/nh; - sigmat = sqrt( sigmat/nh - meant*meant); - cout<<" rpc clu: "< &sclusters) -{ - clusters = sclusters; - rn = r; - ln = l; - nclu = clusters.size(); - nh = 0; - mint = 1000000000.; - maxt = -1.; - mins = 1000; - maxs = -1; - mintrid = 1000000000; - maxtrid = -1; - if (nclu==0) return; - for (std::vector::const_iterator itr = clusters.begin(); itr != clusters.end(); itr++) - { - MyRPCCluster cl = *itr; - nh += cl.nh; - if (cl.mint < mint) mint = cl.mint; - if (cl.maxt > maxt) maxt = cl.maxt; - if (cl.mins < mins) mins = cl.mins; - if (cl.maxs > maxs) maxs = cl.maxs; - if (cl.mintrid < mintrid) mintrid = cl.mintrid; - if (cl.maxtrid > maxtrid) maxtrid = cl.maxtrid; - } -} - - -// ================================================================================================ -void -MyRPCChamber::init(std::vector &srolls) -{ - nh = nclu = nl = 0; - nr = srolls.size(); - mint = 1000000000.; - maxt = -1.; - if (nr==0) return; - std::set layers; - for (std::vector::const_iterator itr = srolls.begin(); itr != srolls.end(); itr++) - { - MyRPCRoll rl = *itr; - nh += rl.nh; - nclu += rl.nclu; - layers.insert(rl.ln); - if (rl.mint < mint) mint = rl.mint; - if (rl.maxt > maxt) maxt = rl.maxt; - } - nl = layers.size(); -} - - -// ================================================================================================ -void -MyRPCEvent::init(std::vector &schambers) -{ - nch = schambers.size(); - nh = nclu = nr = 0; - for (std::vector::const_iterator itr = schambers.begin(); itr != schambers.end(); itr++) - { - MyRPCChamber ch = *itr; - nh += ch.nh; - nclu += ch.nclu; - nr += ch.nr; - } -} - - -// ================================================================================================ -void -MyDTDetId::init(DTWireId &id) -{ - st = id.station(); - wh = id.wheel(); - sec = id.sector(); - sl = id.superLayer(); - l = id.layer(); - wire = id.wire(); - t = type(id); -} - - -// ================================================================================================ -void -MyDTSimHit::init(PSimHit &sh, const DTGeometry* dt_g, const ParticleDataTable * pdt) -{ - LocalPoint hitLP = sh.localPosition(); - pdg = sh.particleType(); - m = 0.00051; - - ParticleData const *pdata = 0; - HepPDT::ParticleID particleType(pdg); - if (particleType.isValid()) pdata = pdt->particle(particleType); - if (pdata) m = pdata->mass(); - // cout<<" "<name()<<" "<idToDet(DetId(sh.detUnitId()))->surface().toGlobal(hitLP); - - r = hitGP.perp(); - eta = hitGP.eta(); - phi = hitGP.phi(); - gx = hitGP.x(); - gy = hitGP.y(); - gz = hitGP.z(); - - //w = csclayer->geometry()->wireGroup(csclayer->geometry()->nearestWire(hitLP)); - //s = csclayer->geometry()->nearestStrip(hitLP); -} - // ================================================================================================ void @@ -1603,7 +679,7 @@ MuSimHitOccupancy::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet iSetup.get< MuonGeometryRecord >().get(csc_geom); csc_geometry = &*csc_geom; - if (evtn==1) calculateCSCDetectorAreas(); + if (evtn==1) areas_.calculateCSCDetectorAreas(csc_geom); // get SimHits simhit_map_csc.fill(iEvent); @@ -1617,7 +693,7 @@ MuSimHitOccupancy::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet iSetup.get< MuonGeometryRecord >().get(gem_geom); gem_geometry = &*gem_geom; - if (evtn==1) calculateGEMDetectorAreas(); + if (evtn==1) areas_.calculateGEMDetectorAreas(gem_geom); // get SimHits simhit_map_gem.fill(iEvent); @@ -1631,7 +707,7 @@ MuSimHitOccupancy::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet iSetup.get< MuonGeometryRecord >().get(rpc_geom); rpc_geometry = &*rpc_geom; - if (evtn==1) calculateRPCDetectorAreas(); + if (evtn==1) areas_.calculateRPCDetectorAreas(rpc_geom); // get SimHits simhit_map_rpc.fill(iEvent); @@ -1645,7 +721,7 @@ MuSimHitOccupancy::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet iSetup.get< MuonGeometryRecord >().get(dt_geom); dt_geometry = &*dt_geom; - if (evtn==1) calculateDTDetectorAreas(); + if (evtn==1) areas_.calculateDTDetectorAreas(dt_geom); // get SimHits simhit_map_dt.fill(iEvent); @@ -2094,182 +1170,6 @@ MuSimHitOccupancy::analyzeDT() } -// ================================================================================================ -void MuSimHitOccupancy::calculateCSCDetectorAreas() -{ - for (int i=0; i<=CSC_TYPES; i++) csc_total_areas_cm2[i]=0.; - - for(std::vector::const_iterator it = csc_geometry->layers().begin(); it != csc_geometry->layers().end(); it++) - { - if( dynamic_cast( *it ) == 0 ) continue; - - CSCLayer* layer = dynamic_cast( *it ); - CSCDetId id = layer->id(); - int ctype = id.iChamberType(); - - const CSCWireTopology* wire_topo = layer->geometry()->wireTopology(); - const CSCStripTopology* strip_topo = layer->geometry()->topology(); - float b = wire_topo->narrowWidthOfPlane(); - float t = wire_topo->wideWidthOfPlane(); - float w_h = wire_topo->lengthOfPlane(); - float s_h = fabs(strip_topo->yLimitsOfStripPlane().first - strip_topo->yLimitsOfStripPlane().second); - float h = (w_h < s_h)? w_h : s_h; - - // special cases: - if (ctype==1) // ME1/1a - { - h += -0.5; // adjustment in order to agree with the official me1a height number - t = ( b*(w_h - h) + t*h )/w_h; - } - if (ctype==2) // ME1/1a - { - h += -1.; - b = ( b*h + t*(w_h - h) )/w_h; - } - - float layer_area = h*(t + b)*0.5; - csc_total_areas_cm2[0] += layer_area; - csc_total_areas_cm2[ctype] += layer_area; - - if (id.layer()==1) cout<<"CSC type "< emptyv(12, 0.); - float minr[GEM_TYPES+1], maxr[GEM_TYPES+1]; - for (int i=0; i<=GEM_TYPES; i++) - { - gem_total_areas_cm2[i]=0.; - gem_total_part_areas_cm2[i] = emptyv; - gem_part_radii[i] = emptyv; - minr[i] = 9999.; - maxr[i] = 0.; - } - - - auto etaPartitions = gem_geometry->etaPartitions(); - for(auto p: etaPartitions) - { - GEMDetId id = p->id(); - int t = type(id); - int part = id.roll(); - - const TrapezoidalStripTopology* top = dynamic_cast(&(p->topology())); - float xmin = top->localPosition(0.).x(); - float xmax = top->localPosition((float)p->nstrips()).x(); - float rollarea = top->stripLength() * (xmax - xmin); - gem_total_areas_cm2[0] += rollarea; - gem_total_areas_cm2[t] += rollarea; - gem_total_part_areas_cm2[0][0] += rollarea; - gem_total_part_areas_cm2[t][part] += rollarea; - cout<<"Partition: "<idToDet(id)->surface().toGlobal(LocalPoint(0.,0.,0.)); - gem_part_radii[t][part] = gp.perp(); - - if (maxr[t] < gp.perp() + top->stripLength()/2.) maxr[t] = gp.perp() + top->stripLength()/2.; - if (minr[t] > gp.perp() - top->stripLength()/2.) minr[t] = gp.perp() - top->stripLength()/2.; - } - - for (int t=1; t<=GEM_TYPES; t++) - { - gem_part_radii[t][0] = (minr[t] + maxr[t])/2.; - } - - cout<<"========================"<::const_iterator it = dt_geometry->layers().begin(); it != dt_geometry->layers().end(); it++) - { - if( dynamic_cast( *it ) == 0 ) continue; - - DTLayer* layer = dynamic_cast( *it ); - DTWireId id = (DTWireId) layer->id(); - int t = type(id); - - const DTTopology& topo = layer->specificTopology(); - // cell's sensible width * # cells - float w = topo.sensibleWidth() * topo.channels(); - float l = topo.cellLenght(); - - float layer_area = w*l; - dt_total_areas_cm2[0] += layer_area; - dt_total_areas_cm2[t] += layer_area; - - if (id.layer()==1) cout<<"DT type "<::const_iterator it = rpc_geometry->rolls().begin(); it != rpc_geometry->rolls().end(); it++) - { - if( dynamic_cast( *it ) != 0 ) { // check if dynamic cast is ok: cast ok => 1 - RPCRoll* roll = dynamic_cast( *it ); - RPCDetId id = roll->id(); - //RPCGeomServ rpcsrv(detId); - //std::string name = rpcsrv.name(); - if (id.region() == 0) { - const RectangularStripTopology* top_ = dynamic_cast(&(roll->topology())); - float xmin = (top_->localPosition(0.)).x(); - float xmax = (top_->localPosition((float)roll->nstrips())).x(); - float rollarea = top_->stripLength() * (xmax - xmin); - rpcb_total_areas_cm2[0] += rollarea; - rpcb_total_areas_cm2[type(id)] += rollarea; - // cout<<"Roll: RawId: "<(&(roll->topology())); - float xmin = (top_->localPosition(0.)).x(); - float xmax = (top_->localPosition((float)roll->nstrips())).x(); - float rollarea = top_->stripLength() * (xmax - xmin); - rpcf_total_areas_cm2[0] += rollarea; - rpcf_total_areas_cm2[type(id)] += rollarea; - // cout<<"Roll: RawId: "<Sumw2(); h_csc_hit_rate_per_ch->Sumw2(); h_csc_clu_flux_per_layer->Sumw2(); h_csc_clu_rate_per_ch->Sumw2(); - if (do_csc_) for (int t=1; t<=CSC_TYPES; t++) + if (do_csc_) for (int t=1; t <= CSC_TYPES; t++) { // 2 endcaps , 6 layers - double scale = bxrate * n_pu * f_full_bx /csc_total_areas_cm2[t]/evtn; + double scale = bxrate * n_pu * f_full_bx /areas_.csc_total_areas_cm2[t]/evtn; double rt = scale * h_csc_hit_flux_per_layer->GetBinContent(t); double er = scale * h_csc_hit_flux_per_layer->GetBinError(t); - h_csc_hit_flux_per_layer->SetBinContent(t,rt); - h_csc_hit_flux_per_layer->SetBinError(t,er); + h_csc_hit_flux_per_layer->SetBinContent(t, rt); + h_csc_hit_flux_per_layer->SetBinError(t, er); rt = scale * h_csc_clu_flux_per_layer->GetBinContent(t); er = scale * h_csc_clu_flux_per_layer->GetBinError(t); - h_csc_clu_flux_per_layer->SetBinContent(t,rt); - h_csc_clu_flux_per_layer->SetBinError(t,er); + h_csc_clu_flux_per_layer->SetBinContent(t, rt); + h_csc_clu_flux_per_layer->SetBinError(t, er); - scale = bxrate * n_pu * f_full_bx /csc_radial_segm[t]/2/evtn/1000; + scale = bxrate * n_pu * f_full_bx /csc_radial_segm[t]/2./evtn/1000.; rt = scale * h_csc_hit_rate_per_ch->GetBinContent(t); er = scale * h_csc_hit_rate_per_ch->GetBinError(t); - h_csc_hit_rate_per_ch->SetBinContent(t,rt); - h_csc_hit_rate_per_ch->SetBinError(t,er); + h_csc_hit_rate_per_ch->SetBinContent(t, rt); + h_csc_hit_rate_per_ch->SetBinError(t, er); rt = scale * h_csc_clu_rate_per_ch->GetBinContent(t); er = scale * h_csc_clu_rate_per_ch->GetBinError(t); - h_csc_clu_rate_per_ch->SetBinContent(t,rt); - h_csc_clu_rate_per_ch->SetBinError(t,er); - - - // centers of ME stations in r - const Double_t xx[4][4] = { - {128., 203.25, 369.75, 594.1}, {239.05, 525.55, 0, 0}, {251.75, 525.55, 0, 0}, {261.7, 525.55, 0, 0}}; - // half-spans of ME stations in r - const Double_t xe[4][4] = { - {22., 53.25, 87.25, 82.1}, {94.85, 161.55, 0, 0}, {84.85, 161.55, 0, 0}, {74.7, 161.55, 0, 0}}; - // fluxes and errors - const Double_t yy[4][4] = { - { h_csc_hit_flux_per_layer->GetBinContent(1), h_csc_hit_flux_per_layer->GetBinContent(2), - h_csc_hit_flux_per_layer->GetBinContent(3), h_csc_hit_flux_per_layer->GetBinContent(4)}, - { h_csc_hit_flux_per_layer->GetBinContent(5), h_csc_hit_flux_per_layer->GetBinContent(6), 0, 0}, - { h_csc_hit_flux_per_layer->GetBinContent(7), h_csc_hit_flux_per_layer->GetBinContent(8), 0, 0}, - { h_csc_hit_flux_per_layer->GetBinContent(9), h_csc_hit_flux_per_layer->GetBinContent(10), 0, 0} }; - const Double_t ye[4][4] = { - { h_csc_hit_flux_per_layer->GetBinError(1), h_csc_hit_flux_per_layer->GetBinError(2), - h_csc_hit_flux_per_layer->GetBinError(3), h_csc_hit_flux_per_layer->GetBinError(4)}, - { h_csc_hit_flux_per_layer->GetBinError(5), h_csc_hit_flux_per_layer->GetBinError(6), 0, 0}, - { h_csc_hit_flux_per_layer->GetBinError(7), h_csc_hit_flux_per_layer->GetBinError(8), 0, 0}, - { h_csc_hit_flux_per_layer->GetBinError(9), h_csc_hit_flux_per_layer->GetBinError(10), 0, 0} }; + h_csc_clu_rate_per_ch->SetBinContent(t, rt); + h_csc_clu_rate_per_ch->SetBinError(t, er); + for (int i=0; i<4; i++) { - gr_csc_hit_flux_me1->SetPoint(i, xx[0][i], yy[0][i]); - gr_csc_hit_flux_me1->SetPointError(i, xe[0][i], ye[0][i]); + gr_csc_hit_flux_me1->SetPoint(i, areas_.csc_ch_radius[i+1], h_csc_hit_flux_per_layer->GetBinContent(i+1) ); + gr_csc_hit_flux_me1->SetPointError(i, areas_.csc_ch_halfheight[i+1], h_csc_hit_flux_per_layer->GetBinError(i+1) ); if (i>1) continue; - gr_csc_hit_flux_me2->SetPoint(i, xx[1][i], yy[1][i]); - gr_csc_hit_flux_me3->SetPoint(i, xx[2][i], yy[2][i]); - gr_csc_hit_flux_me4->SetPoint(i, xx[3][i], yy[3][i]); - gr_csc_hit_flux_me2->SetPointError(i, xe[1][i], ye[1][i]); - gr_csc_hit_flux_me3->SetPointError(i, xe[2][i], ye[2][i]); - gr_csc_hit_flux_me4->SetPointError(i, xe[3][i], ye[3][i]); + gr_csc_hit_flux_me2->SetPoint(i, areas_.csc_ch_radius[i+5], h_csc_hit_flux_per_layer->GetBinContent(i+5) ); + gr_csc_hit_flux_me3->SetPoint(i, areas_.csc_ch_radius[i+7], h_csc_hit_flux_per_layer->GetBinContent(i+7) ); + gr_csc_hit_flux_me4->SetPoint(i, areas_.csc_ch_radius[i+9], h_csc_hit_flux_per_layer->GetBinContent(i+9) ); + gr_csc_hit_flux_me2->SetPointError(i, areas_.csc_ch_halfheight[i+5], h_csc_hit_flux_per_layer->GetBinError(i+5) ); + gr_csc_hit_flux_me3->SetPointError(i, areas_.csc_ch_halfheight[i+7], h_csc_hit_flux_per_layer->GetBinError(i+7) ); + gr_csc_hit_flux_me4->SetPointError(i, areas_.csc_ch_halfheight[i+9], h_csc_hit_flux_per_layer->GetBinError(i+9) ); } } @@ -2394,7 +1271,7 @@ void MuSimHitOccupancy::endJob() h_gem_hit_rate_per_ch->Sumw2(); if (do_gem_) for (int t=1; t<=GEM_TYPES; t++) { - double scale = bxrate * n_pu * f_full_bx /gem_total_areas_cm2[t]/evtn; + double scale = bxrate * n_pu * f_full_bx /areas_.gem_total_areas_cm2[t]/evtn; double rt = scale * h_gem_hit_flux_per_layer->GetBinContent(t); double er = scale * h_gem_hit_flux_per_layer->GetBinError(t); @@ -2419,15 +1296,12 @@ void MuSimHitOccupancy::endJob() h_gem_clu_rate_per_ch->SetBinError(t,er); } - //const double rpcf_areas_cm2[RPCF_TYPES+1] = {100000, 3150,11700,17360,11070,11690,19660,7330,11690,19660,5330,11690,19660}; - //const double rpcf_total_areas_cm2[RPCF_TYPES+1] = - // { 10000000, 244093, 738256, 1289290, 397166, 854259, 1418920, 276969, 854259, 1418920, 204059, 854259, 1418920}; h_rpcf_hit_flux_per_layer->Sumw2(); h_rpcf_hit_rate_per_ch->Sumw2(); if (do_rpc_) for (int t=1; t<=RPCF_TYPES; t++) { - double scale = bxrate * n_pu * f_full_bx /rpcf_total_areas_cm2[t]/evtn; + double scale = bxrate * n_pu * f_full_bx /areas_.rpcf_total_areas_cm2[t]/evtn; double rt = scale * h_rpcf_hit_flux_per_layer->GetBinContent(t); double er = scale * h_rpcf_hit_flux_per_layer->GetBinError(t); h_rpcf_hit_flux_per_layer->SetBinContent(t,rt); @@ -2449,14 +1323,12 @@ void MuSimHitOccupancy::endJob() h_rpcf_clu_rate_per_ch->SetBinContent(t,rt); h_rpcf_clu_rate_per_ch->SetBinError(t,er); } + - // chambers with two layers have their area doubled: - //const double rpcb_total_areas_cm2[RPCF_TYPES+1] = - // { 10000000, 1196940, 2361750, 2393880, 1439190, 2839700, 2878390, 859939, 1696790, 1719880, 1102040, 2163920, 2204080}; h_rpcb_hit_flux_per_layer->Sumw2(); if (do_rpc_) for (int t=1; t<=RPCB_TYPES; t++) { - double scale = bxrate * n_pu * f_full_bx /rpcb_total_areas_cm2[t]/evtn; + double scale = bxrate * n_pu * f_full_bx /areas_.rpcb_total_areas_cm2[t]/evtn; double rt = scale * h_rpcb_hit_flux_per_layer->GetBinContent(t); double er = scale * h_rpcb_hit_flux_per_layer->GetBinError(t); h_rpcb_hit_flux_per_layer->SetBinContent(t,rt); @@ -2480,53 +1352,33 @@ void MuSimHitOccupancy::endJob() } - // chamber areas - //const double dt_total_areas_cm2[DT_TYPES+1] = - // {1.65696e+08,6.73021e+06,1.32739e+07,1.34604e+07,8.20906e+06,1.61906e+07,1.64182e+07,9.88901e+06,1.95039e+07,1.9778e+07,8.50898e+06,1.67151e+07,1.7018e+07}; h_dt_hit_flux_per_layer->Sumw2(); h_dt_hit_rate_per_ch->Sumw2(); if (do_dt_) for (int t=1; t<=DT_TYPES; t++) { // 2 endcaps , 6 layers - double scale = bxrate * n_pu * f_full_bx /dt_total_areas_cm2[t] /evtn; + double scale = bxrate * n_pu * f_full_bx /areas_.dt_total_areas_cm2[t] /evtn; double rt = scale * h_dt_hit_flux_per_layer->GetBinContent(t); double er = scale * h_dt_hit_flux_per_layer->GetBinError(t); h_dt_hit_flux_per_layer->SetBinContent(t,rt); h_dt_hit_flux_per_layer->SetBinError(t,er); - scale = bxrate * n_pu * f_full_bx /dt_radial_segm[t]/evtn/1000; + scale = bxrate * n_pu * f_full_bx /dt_radial_segm[t]/evtn/1000.; rt = scale * h_dt_hit_rate_per_ch->GetBinContent(t); er = scale * h_dt_hit_rate_per_ch->GetBinError(t); h_dt_hit_rate_per_ch->SetBinContent(t,rt); h_dt_hit_rate_per_ch->SetBinError(t,er); - // centers of MB stations in |z| - const Double_t xx[4][3] = {{58.7, 273, 528}, {58.7, 273, 528}, {58.7, 273, 528}, {58.7, 273, 528}}; - // half-spans of MB stations in |z| - const Double_t xe[4][3] = {{58.7, 117.4, 117.4}, {58.7, 117.4, 117.4}, {58.7, 117.4, 117.4}, {58.7, 117.4, 117.4}}; - // fluxes and errors - const Double_t yy[4][3] = { - { h_dt_hit_flux_per_layer->GetBinContent(1), h_dt_hit_flux_per_layer->GetBinContent(2), h_dt_hit_flux_per_layer->GetBinContent(3)}, - { h_dt_hit_flux_per_layer->GetBinContent(4), h_dt_hit_flux_per_layer->GetBinContent(5), h_dt_hit_flux_per_layer->GetBinContent(6)}, - { h_dt_hit_flux_per_layer->GetBinContent(7), h_dt_hit_flux_per_layer->GetBinContent(8), h_dt_hit_flux_per_layer->GetBinContent(9)}, - { h_dt_hit_flux_per_layer->GetBinContent(10), h_dt_hit_flux_per_layer->GetBinContent(11), h_dt_hit_flux_per_layer->GetBinContent(12)} - }; - const Double_t ye[4][3] = { - { h_dt_hit_flux_per_layer->GetBinError(1), h_dt_hit_flux_per_layer->GetBinError(2), h_dt_hit_flux_per_layer->GetBinError(3)}, - { h_dt_hit_flux_per_layer->GetBinError(4), h_dt_hit_flux_per_layer->GetBinError(5), h_dt_hit_flux_per_layer->GetBinError(6)}, - { h_dt_hit_flux_per_layer->GetBinError(7), h_dt_hit_flux_per_layer->GetBinError(8), h_dt_hit_flux_per_layer->GetBinError(9)}, - { h_dt_hit_flux_per_layer->GetBinError(10), h_dt_hit_flux_per_layer->GetBinError(11), h_dt_hit_flux_per_layer->GetBinError(12)} - }; for (int i=0; i<3; i++) { - gr_dt_hit_flux_mb1->SetPoint(i, xx[0][i], yy[0][i]); - gr_dt_hit_flux_mb2->SetPoint(i, xx[1][i], yy[1][i]); - gr_dt_hit_flux_mb3->SetPoint(i, xx[2][i], yy[2][i]); - gr_dt_hit_flux_mb4->SetPoint(i, xx[3][i], yy[3][i]); - gr_dt_hit_flux_mb1->SetPointError(i, xe[0][i], ye[0][i]); - gr_dt_hit_flux_mb2->SetPointError(i, xe[1][i], ye[1][i]); - gr_dt_hit_flux_mb3->SetPointError(i, xe[2][i], ye[2][i]); - gr_dt_hit_flux_mb4->SetPointError(i, xe[3][i], ye[3][i]); + gr_dt_hit_flux_mb1->SetPoint(i, areas_.dt_ch_z[i+1], h_dt_hit_flux_per_layer->GetBinContent(i+1) ); + gr_dt_hit_flux_mb2->SetPoint(i, areas_.dt_ch_z[i+4], h_dt_hit_flux_per_layer->GetBinContent(i+4) ); + gr_dt_hit_flux_mb3->SetPoint(i, areas_.dt_ch_z[i+7], h_dt_hit_flux_per_layer->GetBinContent(i+7) ); + gr_dt_hit_flux_mb4->SetPoint(i, areas_.dt_ch_z[i+10], h_dt_hit_flux_per_layer->GetBinContent(i+10) ); + gr_dt_hit_flux_mb1->SetPointError(i, areas_.dt_ch_halfspanz[i+1], h_dt_hit_flux_per_layer->GetBinError(i+1) ); + gr_dt_hit_flux_mb2->SetPointError(i, areas_.dt_ch_halfspanz[i+4], h_dt_hit_flux_per_layer->GetBinError(i+4) ); + gr_dt_hit_flux_mb3->SetPointError(i, areas_.dt_ch_halfspanz[i+7], h_dt_hit_flux_per_layer->GetBinError(i+7) ); + gr_dt_hit_flux_mb4->SetPointError(i, areas_.dt_ch_halfspanz[i+10], h_dt_hit_flux_per_layer->GetBinError(i+10) ); } } diff --git a/SimMuL1/src/MuGeometryHelpers.cc b/SimMuL1/src/MuGeometryHelpers.cc new file mode 100644 index 0000000000000..1be000fa1174a --- /dev/null +++ b/SimMuL1/src/MuGeometryHelpers.cc @@ -0,0 +1,190 @@ +#include "GEMCode/SimMuL1/interface/MuGeometryHelpers.h" + +#include "Geometry/CSCGeometry/interface/CSCGeometry.h" +#include "Geometry/GEMGeometry/interface/GEMGeometry.h" +#include "Geometry/RPCGeometry/interface/RPCGeometry.h" +#include "Geometry/RPCGeometry/interface/RPCGeomServ.h" +#include "Geometry/DTGeometry/interface/DTGeometry.h" +#include "Geometry/CommonTopologies/interface/RectangularStripTopology.h" +#include "Geometry/CommonTopologies/interface/TrapezoidalStripTopology.h" + +using namespace mugeo; + + + +// ================================================================================================ +void mugeo::MuGeometryAreas::calculateCSCDetectorAreas(const CSCGeometry* g) +{ + for (int i=0; i<=CSC_TYPES; i++) csc_total_areas_cm2[i]=0.; + + for(std::vector::const_iterator it = g->layers().begin(); it != g->layers().end(); it++) + { + if( dynamic_cast( *it ) == 0 ) continue; + + CSCLayer* layer = dynamic_cast( *it ); + CSCDetId id = layer->id(); + int ctype = id.iChamberType(); + + const CSCWireTopology* wire_topo = layer->geometry()->wireTopology(); + const CSCStripTopology* strip_topo = layer->geometry()->topology(); + float b = wire_topo->narrowWidthOfPlane(); + float t = wire_topo->wideWidthOfPlane(); + float w_h = wire_topo->lengthOfPlane(); + float s_h = fabs(strip_topo->yLimitsOfStripPlane().first - strip_topo->yLimitsOfStripPlane().second); + float h = (w_h < s_h)? w_h : s_h; + + // special cases: + if (ctype==1) // ME1/1a + { + h += -0.5; // adjustment in order to agree with the official me1a height number + t = ( b*(w_h - h) + t*h )/w_h; + } + if (ctype==2) // ME1/1a + { + h += -1.; + b = ( b*h + t*(w_h - h) )/w_h; + } + + float layer_area = h*(t + b)*0.5; + csc_total_areas_cm2[0] += layer_area; + csc_total_areas_cm2[ctype] += layer_area; + + if (id.layer()==1) cout<<"CSC type "< emptyv(12, 0.); + float minr[GEM_TYPES+1], maxr[GEM_TYPES+1]; + for (int i=0; i<=GEM_TYPES; i++) + { + gem_total_areas_cm2[i]=0.; + gem_total_part_areas_cm2[i] = emptyv; + gem_part_radii[i] = emptyv; + gem_part_halfheight[i] = emptyv; + minr[i] = 9999.; + maxr[i] = 0.; + } + + + auto etaPartitions = g->etaPartitions(); + for(auto p: etaPartitions) + { + GEMDetId id = p->id(); + int t = type(id); + int part = id.roll(); + + const TrapezoidalStripTopology* top = dynamic_cast(&(p->topology())); + float xmin = top->localPosition(0.).x(); + float xmax = top->localPosition((float)p->nstrips()).x(); + float rollarea = top->stripLength() * (xmax - xmin); + gem_total_areas_cm2[0] += rollarea; + gem_total_areas_cm2[t] += rollarea; + gem_total_part_areas_cm2[0][0] += rollarea; + gem_total_part_areas_cm2[t][part] += rollarea; + cout<<"Partition: "<idToDet(id)->surface().toGlobal(LocalPoint(0.,0.,0.)); + gem_part_radii[t][part] = gp.perp(); + gem_part_halfheight[t][part] = top->stripLength()/2.; + + if (maxr[t] < gp.perp() + top->stripLength()/2.) maxr[t] = gp.perp() + top->stripLength()/2.; + if (minr[t] > gp.perp() - top->stripLength()/2.) minr[t] = gp.perp() - top->stripLength()/2.; + } + + for (int t=1; t<=GEM_TYPES; t++) + { + gem_part_radii[t][0] = (minr[t] + maxr[t])/2.; + } + + cout<<"========================"<::const_iterator it = g->layers().begin(); it != g->layers().end(); it++) + { + if( dynamic_cast( *it ) == 0 ) continue; + + DTLayer* layer = dynamic_cast( *it ); + DTWireId id = (DTWireId) layer->id(); + int t = type(id); + + const DTTopology& topo = layer->specificTopology(); + // cell's sensible width * # cells + float w = topo.sensibleWidth() * topo.channels(); + float l = topo.cellLenght(); + + float layer_area = w*l; + dt_total_areas_cm2[0] += layer_area; + dt_total_areas_cm2[t] += layer_area; + + if (id.layer()==1) cout<<"DT type "<::const_iterator it = g->rolls().begin(); it != g->rolls().end(); it++) + { + if( dynamic_cast( *it ) != 0 ) { // check if dynamic cast is ok: cast ok => 1 + RPCRoll* roll = dynamic_cast( *it ); + RPCDetId id = roll->id(); + //RPCGeomServ rpcsrv(detId); + //std::string name = rpcsrv.name(); + if (id.region() == 0) { + const RectangularStripTopology* top_ = dynamic_cast(&(roll->topology())); + float xmin = (top_->localPosition(0.)).x(); + float xmax = (top_->localPosition((float)roll->nstrips())).x(); + float rollarea = top_->stripLength() * (xmax - xmin); + rpcb_total_areas_cm2[0] += rollarea; + rpcb_total_areas_cm2[type(id)] += rollarea; + // cout<<"Roll: RawId: "<(&(roll->topology())); + float xmin = (top_->localPosition(0.)).x(); + float xmax = (top_->localPosition((float)roll->nstrips())).x(); + float rollarea = top_->stripLength() * (xmax - xmin); + rpcf_total_areas_cm2[0] += rollarea; + rpcf_total_areas_cm2[type(id)] += rollarea; + // cout<<"Roll: RawId: "<particle(particleType); + if (pdata) m = pdata->mass(); + // cout<<" "<name()<<" "<layer(layerId); + GlobalPoint hitGP = csclayer->toGlobal(hitLP); + + r = hitGP.perp(); + eta = hitGP.eta(); + phi = hitGP.phi(); + gx = hitGP.x(); + gy = hitGP.y(); + gz = hitGP.z(); + + w = csclayer->geometry()->wireGroup(csclayer->geometry()->nearestWire(hitLP)); + s = csclayer->geometry()->nearestStrip(hitLP); +} + + +bool MyCSCSimHit::operator<(const MyCSCSimHit & rhs) const +{ + // first sort by wire group, then by strip, then by TOF + if (w==rhs.w) + { + if (s==rhs.s) return t &shits) +{ + hits = shits; + nh = hits.size(); + mint = 1000000000.; + maxt = -1.; + minw = mins = 1000; + maxw = maxs = -1; + meant = 0; + sigmat = 0; + if (nh==0) return; + r = hits[0].r; + eta = hits[0].eta; + phi = hits[0].phi; + gx = hits[0].gx; + gy = hits[0].gy; + gz = hits[0].gz; + p = hits[0].p; + m = hits[0].m; + pdg = hits[0].pdg; + e = 0; + mintrid = 1000000000; + maxtrid = -1; + for (std::vector::const_iterator itr = hits.begin(); itr != hits.end(); itr++) + { + MyCSCSimHit sh = *itr; + e += sh.e; + if (sh.t < mint) mint = sh.t; + if (sh.t > maxt) maxt = sh.t; + if (sh.w < minw) minw = sh.w; + if (sh.w > maxw) maxw = sh.w; + if (sh.s < mins) mins = sh.s; + if (sh.s > maxs) maxs = sh.s; + if (sh.trid < mintrid) mintrid = sh.trid; + if (sh.trid > maxtrid) maxtrid = sh.trid; + meant += sh.t; + sigmat += sh.t*sh.t; + } + meant = meant/nh; + sigmat = sqrt( sigmat/nh - meant*meant); +cout<<" clu: "< &sclusters) +{ + clusters = sclusters; + ln = l; + nclu = clusters.size(); + nh = 0; + mint = 1000000000.; + maxt = -1.; + minw = mins = 1000; + maxw = maxs = -1; + mintrid = 1000000000; + maxtrid = -1; + if (nclu==0) return; + for (std::vector::const_iterator itr = clusters.begin(); itr != clusters.end(); itr++) + { + MyCSCCluster cl = *itr; + nh += cl.nh; + if (cl.mint < mint) mint = cl.mint; + if (cl.maxt > maxt) maxt = cl.maxt; + if (cl.minw < minw) minw = cl.minw; + if (cl.maxw > maxw) maxw = cl.maxw; + if (cl.mins < mins) mins = cl.mins; + if (cl.maxs > maxs) maxs = cl.maxs; + if (cl.mintrid < mintrid) mintrid = cl.mintrid; + if (cl.maxtrid > maxtrid) maxtrid = cl.maxtrid; + } +} + + +// ================================================================================================ +void +MyCSCChamber::init(std::vector &slayers) +{ + nh = nclu = 0; + nl = slayers.size(); + mint = 1000000000.; + maxt = -1.; + minw = mins = 1000; + maxw = maxs = -1; + if (nl==0) return; + l1 = 7; + ln = -1; + for (std::vector::const_iterator itr = slayers.begin(); itr != slayers.end(); itr++) + { + MyCSCLayer la = *itr; + nh += la.nh; + nclu += la.nclu; + if (la.ln < l1) l1 = la.ln; + if (la.ln > ln) ln = la.ln; + if (la.mint < mint) mint = la.mint; + if (la.maxt > maxt) maxt = la.maxt; + if (la.minw < minw) minw = la.minw; + if (la.maxw > maxw) maxw = la.maxw; + if (la.mins < mins) mins = la.mins; + if (la.maxs > maxs) maxs = la.maxs; + + } +} + + +// ================================================================================================ +void +MyCSCEvent::init(std::vector &schambers) +{ + nch = schambers.size(); + nh = nclu = 0; + nch2 = nch3 = nch4 = nch5 = nch6 = 0; + for (std::vector::const_iterator itr = schambers.begin(); itr != schambers.end(); itr++) + { + MyCSCChamber ch = *itr; + nh += ch.nh; + nclu += ch.nclu; + if (ch.nl>1) nch2++; + if (ch.nl>2) nch3++; + if (ch.nl>3) nch4++; + if (ch.nl>4) nch5++; + if (ch.nl>5) nch6++; + } +} + + + +// ================================================================================================ +void +MyGEMDetId::init(GEMDetId &id) +{ + reg = id.region(); + ring = id.ring(); + st = id.station(); + layer = id.layer(); + ch = id.chamber(); + part = id.roll(); + t = type(id); +} + + +// ================================================================================================ +void +MyGEMSimHit::init(PSimHit &sh, const GEMGeometry* gem_g, const ParticleDataTable * pdt) +{ + LocalPoint hitLP = sh.localPosition(); + pdg = sh.particleType(); + m = 0.00051; + + ParticleData const *pdata = 0; + HepPDT::ParticleID particleType(pdg); + if (particleType.isValid()) pdata = pdt->particle(particleType); + if (pdata) m = pdata->mass(); + // cout<<" "<name()<<" "<idToDet(DetId(sh.detUnitId()))->surface().toGlobal(hitLP); + + r = hitGP.perp(); + eta = hitGP.eta(); + phi = hitGP.phi(); + gx = hitGP.x(); + gy = hitGP.y(); + gz = hitGP.z(); + + GEMDetId rollId(sh.detUnitId()); + s = gem_g->etaPartition(rollId)->strip(hitLP); +} + + +bool MyGEMSimHit::operator<(const MyGEMSimHit & rhs) const +{ + // first sort by strip, then by TOF + if (s==rhs.s) return t &shits) +{ + hits = shits; + nh = hits.size(); + mint = 1000000000.; + maxt = -1.; + mins = 1000; + maxs = -1; + meant = 0; + sigmat = 0; + if (nh==0) return; + r = hits[0].r; + eta = hits[0].eta; + phi = hits[0].phi; + gx = hits[0].gx; + gy = hits[0].gy; + gz = hits[0].gz; + p = hits[0].p; + m = hits[0].m; + pdg = hits[0].pdg; + e = 0; + mintrid = 1000000000; + maxtrid = -1; + for (std::vector::const_iterator itr = hits.begin(); itr != hits.end(); itr++) + { + MyGEMSimHit sh = *itr; + e += sh.e; + if (sh.t < mint) mint = sh.t; + if (sh.t > maxt) maxt = sh.t; + if (sh.s < mins) mins = sh.s; + if (sh.s > maxs) maxs = sh.s; + if (sh.trid < mintrid) mintrid = sh.trid; + if (sh.trid > maxtrid) maxtrid = sh.trid; + meant += sh.t; + sigmat += sh.t*sh.t; + } + meant = meant/nh; + sigmat = sqrt( sigmat/nh - meant*meant); + cout<<" gem clu: "< &sclusters) +{ + clusters = sclusters; + pn = p; + ln = l; + nclu = clusters.size(); + nh = 0; + mint = 1000000000.; + maxt = -1.; + mins = 1000; + maxs = -1; + mintrid = 1000000000; + maxtrid = -1; + if (nclu==0) return; + for (std::vector::const_iterator itr = clusters.begin(); itr != clusters.end(); itr++) + { + MyGEMCluster cl = *itr; + nh += cl.nh; + if (cl.mint < mint) mint = cl.mint; + if (cl.maxt > maxt) maxt = cl.maxt; + if (cl.mins < mins) mins = cl.mins; + if (cl.maxs > maxs) maxs = cl.maxs; + if (cl.mintrid < mintrid) mintrid = cl.mintrid; + if (cl.maxtrid > maxtrid) maxtrid = cl.maxtrid; + } +} + + +// ================================================================================================ +void +MyGEMChamber::init(std::vector &sparts) +{ + nh = nclu = nl = 0; + np = sparts.size(); + mint = 1000000000.; + maxt = -1.; + if (np==0) return; + std::set layers; + for (std::vector::const_iterator itr = sparts.begin(); itr != sparts.end(); itr++) + { + MyGEMPart rl = *itr; + nh += rl.nh; + nclu += rl.nclu; + layers.insert(rl.ln); + if (rl.mint < mint) mint = rl.mint; + if (rl.maxt > maxt) maxt = rl.maxt; + } + nl = layers.size(); +} + + +// ================================================================================================ +void +MyGEMEvent::init(std::vector &schambers) +{ + nch = schambers.size(); + nh = nclu = np = 0; + for (std::vector::const_iterator itr = schambers.begin(); itr != schambers.end(); itr++) + { + MyGEMChamber ch = *itr; + nh += ch.nh; + nclu += ch.nclu; + np += ch.np; + } +} + + +// ================================================================================================ +void +MyRPCDetId::init(RPCDetId &id) +{ + reg = id.region(); + ring = id.ring(); + st = id.station(); + sec = id.sector(); + layer = id.layer(); + subsec = id.subsector(); + roll = id.roll(); + t = type(id); +} + + +// ================================================================================================ +void +MyRPCSimHit::init(PSimHit &sh, const RPCGeometry* rpc_g, const ParticleDataTable * pdt) +{ + LocalPoint hitLP = sh.localPosition(); + pdg = sh.particleType(); + m = 0.00051; + + ParticleData const *pdata = 0; + HepPDT::ParticleID particleType(pdg); + if (particleType.isValid()) pdata = pdt->particle(particleType); + if (pdata) m = pdata->mass(); + // cout<<" "<name()<<" "<idToDet(DetId(sh.detUnitId()))->surface().toGlobal(hitLP); + + r = hitGP.perp(); + eta = hitGP.eta(); + phi = hitGP.phi(); + gx = hitGP.x(); + gy = hitGP.y(); + gz = hitGP.z(); + + RPCDetId rollId(sh.detUnitId()); + s = rpc_g->roll(rollId)->strip(hitLP); +} + + +bool MyRPCSimHit::operator<(const MyRPCSimHit & rhs) const +{ + // first sort by strip, then by TOF + if (s==rhs.s) return t &shits) +{ + hits = shits; + nh = hits.size(); + mint = 1000000000.; + maxt = -1.; + mins = 1000; + maxs = -1; + meant = 0; + sigmat = 0; + if (nh==0) return; + r = hits[0].r; + eta = hits[0].eta; + phi = hits[0].phi; + gx = hits[0].gx; + gy = hits[0].gy; + gz = hits[0].gz; + p = hits[0].p; + m = hits[0].m; + pdg = hits[0].pdg; + e = 0; + mintrid = 1000000000; + maxtrid = -1; + for (std::vector::const_iterator itr = hits.begin(); itr != hits.end(); itr++) + { + MyRPCSimHit sh = *itr; + e += sh.e; + if (sh.t < mint) mint = sh.t; + if (sh.t > maxt) maxt = sh.t; + if (sh.s < mins) mins = sh.s; + if (sh.s > maxs) maxs = sh.s; + if (sh.trid < mintrid) mintrid = sh.trid; + if (sh.trid > maxtrid) maxtrid = sh.trid; + meant += sh.t; + sigmat += sh.t*sh.t; + } + meant = meant/nh; + sigmat = sqrt( sigmat/nh - meant*meant); + cout<<" rpc clu: "< &sclusters) +{ + clusters = sclusters; + rn = r; + ln = l; + nclu = clusters.size(); + nh = 0; + mint = 1000000000.; + maxt = -1.; + mins = 1000; + maxs = -1; + mintrid = 1000000000; + maxtrid = -1; + if (nclu==0) return; + for (std::vector::const_iterator itr = clusters.begin(); itr != clusters.end(); itr++) + { + MyRPCCluster cl = *itr; + nh += cl.nh; + if (cl.mint < mint) mint = cl.mint; + if (cl.maxt > maxt) maxt = cl.maxt; + if (cl.mins < mins) mins = cl.mins; + if (cl.maxs > maxs) maxs = cl.maxs; + if (cl.mintrid < mintrid) mintrid = cl.mintrid; + if (cl.maxtrid > maxtrid) maxtrid = cl.maxtrid; + } +} + + +// ================================================================================================ +void +MyRPCChamber::init(std::vector &srolls) +{ + nh = nclu = nl = 0; + nr = srolls.size(); + mint = 1000000000.; + maxt = -1.; + if (nr==0) return; + std::set layers; + for (std::vector::const_iterator itr = srolls.begin(); itr != srolls.end(); itr++) + { + MyRPCRoll rl = *itr; + nh += rl.nh; + nclu += rl.nclu; + layers.insert(rl.ln); + if (rl.mint < mint) mint = rl.mint; + if (rl.maxt > maxt) maxt = rl.maxt; + } + nl = layers.size(); +} + + +// ================================================================================================ +void +MyRPCEvent::init(std::vector &schambers) +{ + nch = schambers.size(); + nh = nclu = nr = 0; + for (std::vector::const_iterator itr = schambers.begin(); itr != schambers.end(); itr++) + { + MyRPCChamber ch = *itr; + nh += ch.nh; + nclu += ch.nclu; + nr += ch.nr; + } +} + + +// ================================================================================================ +void +MyDTDetId::init(DTWireId &id) +{ + st = id.station(); + wh = id.wheel(); + sec = id.sector(); + sl = id.superLayer(); + l = id.layer(); + wire = id.wire(); + t = type(id); +} + + +// ================================================================================================ +void +MyDTSimHit::init(PSimHit &sh, const DTGeometry* dt_g, const ParticleDataTable * pdt) +{ + LocalPoint hitLP = sh.localPosition(); + pdg = sh.particleType(); + m = 0.00051; + + ParticleData const *pdata = 0; + HepPDT::ParticleID particleType(pdg); + if (particleType.isValid()) pdata = pdt->particle(particleType); + if (pdata) m = pdata->mass(); + // cout<<" "<name()<<" "<idToDet(DetId(sh.detUnitId()))->surface().toGlobal(hitLP); + + r = hitGP.perp(); + eta = hitGP.eta(); + phi = hitGP.phi(); + gx = hitGP.x(); + gy = hitGP.y(); + gz = hitGP.z(); + + //w = csclayer->geometry()->wireGroup(csclayer->geometry()->nearestWire(hitLP)); + //s = csclayer->geometry()->nearestStrip(hitLP); +} From 57ffc631aa766194ab033ef58b97227379f1cf9c Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Mon, 12 Aug 2013 22:30:29 -0500 Subject: [PATCH 075/182] Merge branch 'master', remote-tracking branch 'origin' From 32882e43313533f1495e875260219e528a06c9bf Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Mon, 12 Aug 2013 23:01:35 -0500 Subject: [PATCH 076/182] MuSimHitOccupancy: some fixes --- SimMuL1/interface/MuGeometryHelpers.h | 18 ++++++++++-------- SimMuL1/interface/MuNtupleClasses.h | 3 +++ SimMuL1/plugins/MuSimHitOccupancy.cc | 8 ++++---- SimMuL1/src/MuGeometryHelpers.cc | 12 +++++++++--- SimMuL1/src/MuNtupleClasses.cc | 5 +++++ 5 files changed, 31 insertions(+), 15 deletions(-) diff --git a/SimMuL1/interface/MuGeometryHelpers.h b/SimMuL1/interface/MuGeometryHelpers.h index eeac1e61fff07..721c13a8a2aad 100644 --- a/SimMuL1/interface/MuGeometryHelpers.h +++ b/SimMuL1/interface/MuGeometryHelpers.h @@ -13,6 +13,8 @@ #include "DataFormats/MuonDetId/interface/RPCDetId.h" #include "DataFormats/MuonDetId/interface/DTWireId.h" +#include + class CSCGeometry; class GEMGeometry; class RPCGeometry; @@ -29,14 +31,14 @@ enum ETrigRPCF {MAX_RPCF_STATIONS = 4, RPCF_TYPES = 12}; enum ETrigRPCB {MAX_RPCB_STATIONS = 4, RPCB_TYPES = 12}; // chamber types -int type(CSCDetId &d) {return d.iChamberType();} -int type(GEMDetId &d) {return 3*d.station() + d.ring() - 3;} -int type(RPCDetId &d) +inline int type(CSCDetId &d) {return d.iChamberType();} +inline int type(GEMDetId &d) {return 3*d.station() + d.ring() - 3;} +inline int type(RPCDetId &d) { if (d.region()==0) return 3*d.station() + abs(d.ring()) - 2; else return 3*d.station() + d.ring() - 3; } -int type(DTWireId &d) {return 3*d.station() + abs(d.wheel()) - 2;} +inline int type(DTWireId &d) {return 3*d.station() + abs(d.wheel()) - 2;} // labels for chamber types const std::string csc_type[CSC_TYPES+1] = @@ -98,17 +100,17 @@ class MuGeometryAreas std::vector gem_part_halfheight[GEM_TYPES+1]; // partition half height // centers of CSC chamber positions in r - const float csc_ch_radius[CSC_TYPES+1] = {0., 128., 203.25, 369.75, 594.1, 239.05, 525.55, 251.75, 525.55, 261.7, 525.55}; + static const float csc_ch_radius[CSC_TYPES+1]; // half-spans of CSC stations in r - const float csc_ch_halfheight[CSC_TYPES+1] = {0., 22., 53.25, 87.25, 82.1, 94.85, 161.55, 84.85, 161.55, 74.7, 161.55}; + static const float csc_ch_halfheight[CSC_TYPES+1]; // centers of MB chamber types in |z| // Note: normally, wheel 0 chamber is centered at 0, but as we are looking at "half-detector" // we take half-of-half of a wheel 0 position - const float dt_ch_z[DT_TYPES+1] = {0., 58.7, 273, 528, 58.7, 273, 528, 58.7, 273, 528, 58.7, 273, 528}; + static const float dt_ch_z[DT_TYPES+1]; // half-spans of MB chambers in |z| - const float dt_ch_halfspanz[DT_TYPES+1] = {0., 58.7, 117.4, 117.4, 58.7, 117.4, 117.4, 58.7, 117.4, 117.4, 58.7, 117.4, 117.4}; + static const float dt_ch_halfspanz[DT_TYPES+1]; private: diff --git a/SimMuL1/interface/MuNtupleClasses.h b/SimMuL1/interface/MuNtupleClasses.h index 9e874a988d75c..80b89fea90ab3 100644 --- a/SimMuL1/interface/MuNtupleClasses.h +++ b/SimMuL1/interface/MuNtupleClasses.h @@ -12,6 +12,9 @@ Various data classes to use for analysis ntuples #include "DataFormats/MuonDetId/interface/RPCDetId.h" #include "DataFormats/MuonDetId/interface/DTWireId.h" #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" +#include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h" + +#include "TTree.h" class CSCGeometry; class GEMGeometry; diff --git a/SimMuL1/plugins/MuSimHitOccupancy.cc b/SimMuL1/plugins/MuSimHitOccupancy.cc index 8b24e0374aab5..b52d026630b75 100644 --- a/SimMuL1/plugins/MuSimHitOccupancy.cc +++ b/SimMuL1/plugins/MuSimHitOccupancy.cc @@ -679,7 +679,7 @@ MuSimHitOccupancy::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet iSetup.get< MuonGeometryRecord >().get(csc_geom); csc_geometry = &*csc_geom; - if (evtn==1) areas_.calculateCSCDetectorAreas(csc_geom); + if (evtn==1) areas_.calculateCSCDetectorAreas(csc_geometry); // get SimHits simhit_map_csc.fill(iEvent); @@ -693,7 +693,7 @@ MuSimHitOccupancy::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet iSetup.get< MuonGeometryRecord >().get(gem_geom); gem_geometry = &*gem_geom; - if (evtn==1) areas_.calculateGEMDetectorAreas(gem_geom); + if (evtn==1) areas_.calculateGEMDetectorAreas(gem_geometry); // get SimHits simhit_map_gem.fill(iEvent); @@ -707,7 +707,7 @@ MuSimHitOccupancy::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet iSetup.get< MuonGeometryRecord >().get(rpc_geom); rpc_geometry = &*rpc_geom; - if (evtn==1) areas_.calculateRPCDetectorAreas(rpc_geom); + if (evtn==1) areas_.calculateRPCDetectorAreas(rpc_geometry); // get SimHits simhit_map_rpc.fill(iEvent); @@ -721,7 +721,7 @@ MuSimHitOccupancy::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet iSetup.get< MuonGeometryRecord >().get(dt_geom); dt_geometry = &*dt_geom; - if (evtn==1) areas_.calculateDTDetectorAreas(dt_geom); + if (evtn==1) areas_.calculateDTDetectorAreas(dt_geometry); // get SimHits simhit_map_dt.fill(iEvent); diff --git a/SimMuL1/src/MuGeometryHelpers.cc b/SimMuL1/src/MuGeometryHelpers.cc index 1be000fa1174a..431b62933c281 100644 --- a/SimMuL1/src/MuGeometryHelpers.cc +++ b/SimMuL1/src/MuGeometryHelpers.cc @@ -8,8 +8,14 @@ #include "Geometry/CommonTopologies/interface/RectangularStripTopology.h" #include "Geometry/CommonTopologies/interface/TrapezoidalStripTopology.h" +using std::cout; +using std::endl; using namespace mugeo; +const float mugeo::MuGeometryAreas::csc_ch_radius[CSC_TYPES+1] = {0., 128., 203.25, 369.75, 594.1, 239.05, 525.55, 251.75, 525.55, 261.7, 525.55}; +const float mugeo::MuGeometryAreas::csc_ch_halfheight[CSC_TYPES+1] = {0., 22., 53.25, 87.25, 82.1, 94.85, 161.55, 84.85, 161.55, 74.7, 161.55}; +const float mugeo::MuGeometryAreas::dt_ch_z[DT_TYPES+1] = {0., 58.7, 273, 528, 58.7, 273, 528, 58.7, 273, 528, 58.7, 273, 528}; +const float mugeo::MuGeometryAreas::dt_ch_halfspanz[DT_TYPES+1] = {0., 58.7, 117.4, 117.4, 58.7, 117.4, 117.4, 58.7, 117.4, 117.4, 58.7, 117.4, 117.4}; // ================================================================================================ @@ -68,7 +74,7 @@ void mugeo::MuGeometryAreas::calculateGEMDetectorAreas(const GEMGeometry* g) { gem_total_areas_cm2[i]=0.; gem_total_part_areas_cm2[i] = emptyv; - gem_part_radii[i] = emptyv; + gem_part_radius[i] = emptyv; gem_part_halfheight[i] = emptyv; minr[i] = 9999.; maxr[i] = 0.; @@ -93,7 +99,7 @@ void mugeo::MuGeometryAreas::calculateGEMDetectorAreas(const GEMGeometry* g) cout<<"Partition: "<idToDet(id)->surface().toGlobal(LocalPoint(0.,0.,0.)); - gem_part_radii[t][part] = gp.perp(); + gem_part_radius[t][part] = gp.perp(); gem_part_halfheight[t][part] = top->stripLength()/2.; if (maxr[t] < gp.perp() + top->stripLength()/2.) maxr[t] = gp.perp() + top->stripLength()/2.; @@ -102,7 +108,7 @@ void mugeo::MuGeometryAreas::calculateGEMDetectorAreas(const GEMGeometry* g) for (int t=1; t<=GEM_TYPES; t++) { - gem_part_radii[t][0] = (minr[t] + maxr[t])/2.; + gem_part_radius[t][0] = (minr[t] + maxr[t])/2.; } cout<<"========================"< Date: Tue, 13 Aug 2013 12:45:25 +0200 Subject: [PATCH 077/182] Adding GEMs to NeutronSimHitAnalyzer - first version --- SimMuL1/plugins/NeutronSimHitAnalyzer.cc | 925 +++++++++++++++++++ SimMuL1/plugins/NeutronSimHitsAnalyzer.cc | 772 ---------------- SimMuL1/python/NeutronSimHitAnalyzer_cfi.py | 52 ++ SimMuL1/test/runNeutronSimHitAnalyzer_cfg.py | 34 + 4 files changed, 1011 insertions(+), 772 deletions(-) create mode 100644 SimMuL1/plugins/NeutronSimHitAnalyzer.cc delete mode 100644 SimMuL1/plugins/NeutronSimHitsAnalyzer.cc create mode 100644 SimMuL1/python/NeutronSimHitAnalyzer_cfi.py create mode 100644 SimMuL1/test/runNeutronSimHitAnalyzer_cfg.py diff --git a/SimMuL1/plugins/NeutronSimHitAnalyzer.cc b/SimMuL1/plugins/NeutronSimHitAnalyzer.cc new file mode 100644 index 0000000000000..637b2a5188a9b --- /dev/null +++ b/SimMuL1/plugins/NeutronSimHitAnalyzer.cc @@ -0,0 +1,925 @@ +// system include files +#include +#include +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" + +#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" + +#include "Geometry/Records/interface/MuonGeometryRecord.h" +#include "Geometry/CSCGeometry/interface/CSCGeometry.h" +#include "Geometry/RPCGeometry/interface/RPCGeometry.h" +#include "Geometry/DTGeometry/interface/DTGeometry.h" +#include "Geometry/GEMGeometry/interface/GEMGeometry.h" + +#include "DataFormats/MuonDetId/interface/CSCDetId.h" +#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h" +#include "L1Trigger/CSCCommonTrigger/interface/CSCTriggerGeometry.h" + +#include "DataFormats/MuonDetId/interface/RPCDetId.h" +#include "DataFormats/MuonDetId/interface/GEMDetId.h" + +#include "TH1.h" +#include "TH2.h" +#include "TTree.h" +#include "TString.h" + +#include "GEMCode/SimMuL1/interface/PSimHitMapCSC.h" + +// +// class decleration +// + +struct MyCSCDetId +{ + void init(CSCDetId &id); + Int_t e, s, r, c, l; + Int_t t; // type 1-10: ME1/a,1/b,1/2,1/3,2/1...4/2 +}; + +struct MyCSCSimHit +{ + void init(PSimHit &sh, const CSCGeometry* csc_g); + Float_t x, y, z; // local + Float_t r, eta, phi, gz; // global + Float_t e; // energy deposit + Float_t t; // TOF + Int_t pdg; // PDG + Int_t w, s; // WG & Strip +}; + +struct MyCSCLayer +{ + void init(int l, std::vector &shits); + std::vector hits; + Int_t ln; // layer # + Int_t nh; // # of hits + Float_t mint, maxt; // min/max TOF + Float_t meant, sigmat;// mean&stdev of TOF + Int_t minw, maxw, mins, maxs; // min/max WG & Strip +}; + +struct MyCSCChamber +{ + void init(std::vector &slayers); + Int_t nh; // nhits + Int_t nl, l1, ln; // nlayers, 1st and last layer # + Float_t mint, maxt; // min/max TOF + Float_t meant, sigmat;// mean&stdev of TOF + Int_t minw, maxw, mins, maxs; // min/max WG & Strip +}; + +struct MyCSCEvent +{ + void init(std::vector &schambers); + Int_t nh; // nhits + Int_t nch; // nchambers +}; + + +struct MyRPCDetId +{ + void init(RPCDetId &id); + Int_t reg, ring, st, sec, layer, subsec, roll; + Int_t t; // type 1-8: RE1/2,1/3,2/2,2/3,3/2,3/3,4/2,4/3 +}; + +struct MyRPCSimHit +{ + void init(const PSimHit &sh, const RPCGeometry* rpc_g); + Float_t x, y, z; // local + Float_t r, eta, phi, gz; // global + Float_t e; // energy deposit + Float_t t; // TOF + Int_t pdg; // PDG + //Int_t w, s; // WG & Strip +}; + +struct MyGEMDetId +{ + void init(GEMDetId &id); + Int_t region, ring, station, layer, chamber, roll; + Int_t t; // GE1/1 +}; + +struct MyGEMSimHit +{ + void init(const PSimHit &sh, const GEMGeometry* gem_g); + Float_t l_x, l_y, l_z; // local + Float_t g_r, g_eta, g_phi, g_z; // global + Float_t energy; // energy deposit + Float_t tof; // TOF + Int_t pdg; // PDG + Int_t strip; +}; + + +class NeutronSimHitAnalyzer : public edm::EDAnalyzer +{ +public: + + explicit NeutronSimHitAnalyzer(const edm::ParameterSet&); + ~NeutronSimHitAnalyzer(); + + virtual void beginJob() ; + virtual void analyze(const edm::Event&, const edm::EventSetup&); + virtual void endJob() ; + +private: + + // configuration parameters: + edm::InputTag defaultInputTagCSC_; + edm::InputTag defaultInputTagGEM_; + edm::InputTag defaultInputTagRPC_; + edm::InputTag defaultInputTagDT_; + edm::InputTag inputTagCSC_; + edm::InputTag inputTagGEM_; + edm::InputTag inputTagRPC_; + edm::InputTag inputTagDT_; + + // misc utilities + const CSCGeometry* csc_geometry; + const DTGeometry* dt_geometry; + const RPCGeometry* rpc_geometry; + const GEMGeometry* gem_geometry; + + + // some counters: + int evtn; + int csc_shn; + int rpc_shn; + int gem_shn; + int nevt_with_cscsh, nevt_with_cscsh_in_rpc; + int n_cscsh, n_cscsh_in_rpc; + int nevt_with_rpcsh, nevt_with_rpcsh_e, nevt_with_rpcsh_b; + int n_rpcsh, n_rpcsh_e, n_rpcsh_b; + int nevt_with_gemsh; + int n_gemsh; + + // some histos: + TH2D* h_csc_rz_sh_xray; + TH1D* h_csc_nlayers_in_ch[11]; + TH1D* h_csc_nevt_fraction_with_sh; + TH1D* h_csc_shflux_per_layer; + TH1D* h_rpcf_nevt_fraction_with_sh; + TH1D* h_rpcf_shflux_per_layer; + TH1D* h_rpcb_nevt_fraction_with_sh; + TH1D* h_gem_nevt_fraction_with_sh; + TH1D* h_gem_shflux_per_layer; + TH2D* h_csc_rz_sh_heatmap; + TH2D* h_rpc_rz_sh_heatmap; + TH2D* h_gem_rz_sh_heatmap; + TH2D* h_mu_rz_sh_heatmap; + + // quantities for rate calculation + int pu_; + double fractionEmptyBX_; + int bxRate_; + + // Muon detector types (long and short) + int maxCSCStations_; + int nCSCTypes_; + int maxDTStations_; + int nDTTypes_; + int maxRPCfStations_; + int nRPCfTypes_; + int maxRPCbStations_; + int nRPCbTypes_; + int maxGEMStations_; + int nGEMTypes_; + + std::vector cscTypesLong_; + std::vector cscTypesShort_; + std::vector dtTypesLong_; + std::vector dtTypesShort_; + std::vector rpcfTypesLong_; + std::vector rpcfTypesShort_; + std::vector rpcbTypesLong_; + std::vector rpcbTypesShort_; + std::vector gemTypesLong_; + std::vector gemTypesShort_; + + SimHitAnalysis::PSimHitMapCSC simhit_map_csc; + bool inputIsNeutrons_; + + // chamber sizes and segmentation + std::vector cscAreascm2_; + std::vector rpcfAreascm2_; + std::vector gemAreascm2_; + std::vector cscRadialSegmentation_; + std::vector rpcfRadialSegmentation_; + std::vector gemRadialSegmentation_; + + // layers + int nRPCLayers_; + int nGEMLayers_; + int nCSCLayers_; + + // ntuples: + void bookCSCChambersTree(); + void bookCSCLayersTree(); + void bookCSCSimHitsTree(); + void bookRPCSimHitsTree(); + void bookGEMSimHitsTree(); + + TTree* csc_ch_tree; + TTree* csc_la_tree; + TTree* csc_sh_tree; + TTree* rpc_sh_tree; + TTree* gem_sh_tree; + + MyCSCDetId c_id; + MyCSCDetId c_cid; + MyCSCSimHit c_h; + MyCSCLayer c_la; + MyCSCChamber c_ch; + MyRPCDetId r_id; + MyRPCSimHit r_h; + MyGEMDetId g_id; + MyGEMSimHit g_h; +}; + +// ================================================================================================ +NeutronSimHitAnalyzer::NeutronSimHitAnalyzer(const edm::ParameterSet& iConfig): + defaultInputTagCSC_(iConfig.getParameter("defaultInputTagCSC")), + defaultInputTagGEM_(iConfig.getParameter("defaultInputTagCSC")), + defaultInputTagRPC_(iConfig.getParameter("defaultInputTagCSC")), + defaultInputTagDT_(iConfig.getParameter("defaultInputTagCSC")), + inputTagCSC_(iConfig.getParameter("inputTagCSC")), + inputTagGEM_(iConfig.getParameter("inputTagGEM")), + inputTagRPC_(iConfig.getParameter("inputTagRPC")), + inputTagDT_(iConfig.getParameter("inputTagDT")), + pu_(iConfig.getParameter("pu")), + fractionEmptyBX_(iConfig.getParameter("fractionEmptyBX")), + bxRate_(iConfig.getParameter( "bxRate")), + maxCSCStations_(iConfig.getParameter("maxCSCStations")), + nCSCTypes_(iConfig.getParameter("nCSCTypes")), + maxDTStations_(iConfig.getParameter("maxDTStations")), + nDTTypes_(iConfig.getParameter("nDTTypes")), + maxRPCfStations_(iConfig.getParameter("maxRPCfStations")), + nRPCfTypes_(iConfig.getParameter("nRPCfTypes")), + maxRPCbStations_(iConfig.getParameter("maxRPCbStations")), + nRPCbTypes_(iConfig.getParameter("nRPCbTypes")), + maxGEMStations_(iConfig.getParameter("maxGEMStations")), + nGEMTypes_(iConfig.getParameter("nGEMTypes")), + cscTypesLong_(iConfig.getParameter >("cscTypesLong")), + cscTypesShort_(iConfig.getParameter >("cscTypesShort")), + dtTypesLong_(iConfig.getParameter >("dtTypesLong")), + dtTypesShort_(iConfig.getParameter >("dtTypesShort")), + rpcfTypesLong_(iConfig.getParameter >("rpcfTypesLong")), + rpcfTypesShort_(iConfig.getParameter >("rpcfTypesShort")), + rpcbTypesLong_(iConfig.getParameter >("rpcbTypesLong")), + rpcbTypesShort_(iConfig.getParameter >("rpcbTypesShort")), + gemTypesLong_(iConfig.getParameter >("gemTypesLong")), + gemTypesShort_(iConfig.getParameter >("gemTypesLong")), + simhit_map_csc(), + // should be set to false if running over a regular MB sample + inputIsNeutrons_(iConfig.getParameter("inputIsNeutrons")), + //chambers sizes + cscAreascm2_(iConfig.getParameter >("cscAreascm2")), + rpcfAreascm2_(iConfig.getParameter >("rpfcAreascm2")), + gemAreascm2_(iConfig.getParameter >("gemAreascm2")), + cscRadialSegmentation_(iConfig.getParameter >("cscRadialSegmentation")), + rpcfRadialSegmentation_(iConfig.getParameter >("rpcfRadialSegmentation")), + gemRadialSegmentation_(iConfig.getParameter >("gemRadialSegmentation")), + nRPCLayers_(iConfig.getParameter("nRPCLayers")), + nGEMLayers_(iConfig.getParameter("nGEMLayers")), + nCSCLayers_(iConfig.getParameter("nCSCLayers")) +{ + bookCSCSimHitsTree(); + bookCSCLayersTree(); + bookCSCChambersTree(); + bookRPCSimHitsTree(); + bookGEMSimHitsTree(); + + if (inputIsNeutrons_) + { + inputTagCSC_ = defaultInputTagCSC_; + inputTagGEM_ = defaultInputTagGEM_; + inputTagRPC_ = defaultInputTagRPC_; + inputTagDT_ = defaultInputTagDT_; + } + + simhit_map_csc.setInputTag(inputTagCSC_); + nevt_with_cscsh = nevt_with_cscsh_in_rpc = n_cscsh = n_cscsh_in_rpc = 0; + nevt_with_rpcsh = nevt_with_rpcsh_e = nevt_with_rpcsh_b = n_rpcsh = n_rpcsh_e = n_rpcsh_b = 0; + + edm::Service fs; + + const TString n_simhits(inputIsNeutrons_? "n-SimHits" : "SimHits"); + + // Heat map + h_csc_rz_sh_xray = fs->make("h_csc_rz_sh_xray","CSC "+n_simhits+" #rho-z X-ray;z, cm;#rho, cm",2060,550,1080,750,0,750); + h_csc_rz_sh_heatmap = fs->make("h_csc_rz_sh_heatmap","CSC "+n_simhits+" #rho-z;z, cm;#rho, cm",230,550,1080,150,0,750); + h_rpc_rz_sh_heatmap = fs->make("h_rpc_rz_sh_heatmap","RPC "+n_simhits+" #rho-z;z, cm;#rho, cm",450,0,1080,160,0,800); + h_gem_rz_sh_heatmap = fs->make("h_gem_rz_sh_heatmap","GEM "+n_simhits+" #rho-z;z, cm;#rho, cm",450,0,1080,160,0,800); + h_mu_rz_sh_heatmap = fs->make("h_mu_rz_sh_heatmap", n_simhits+" #rho-z;z, cm;#rho, cm",480,0,1100,160,0,800); + + + // CSC + char label[200], nlabel[200]; + for (int me=0; me<=nCSCTypes_; me++) + { + sprintf(label,"h_csc_nlayers_in_ch_%s",cscTypesShort_.at(me).c_str()); + sprintf(nlabel,"# of layers with %s: %s CSC;# layers", n_simhits.Data(), cscTypesLong_.at(me).c_str()); + h_csc_nlayers_in_ch[me] = fs->make(label, nlabel, 6, 0.5, 6.5); + } + h_csc_nevt_fraction_with_sh = + fs->make("h_csc_nevt_fraction_with_sh", "Fraction of events with "+n_simhits+" by CSC type", nCSCTypes_+1, -0.5, nCSCTypes_+0.5); + for (int i=1; i<=h_csc_nevt_fraction_with_sh->GetXaxis()->GetNbins();i++) + h_csc_nevt_fraction_with_sh->GetXaxis()->SetBinLabel(i,cscTypesLong_.at(i-1).c_str()); + + h_csc_shflux_per_layer = fs->make("h_csc_shflux_per_layer", n_simhits+" Flux per CSC layer at L=10^{34};;Hz/cm^{2}", nCSCTypes_, 0.5, nCSCTypes_+0.5); + for (int i=1; i<=h_csc_shflux_per_layer->GetXaxis()->GetNbins();i++) + h_csc_shflux_per_layer->GetXaxis()->SetBinLabel(i,cscTypesLong_.at(i).c_str()); + + // RPC + h_rpcf_nevt_fraction_with_sh = + fs->make("h_rpcf_nevt_fraction_with_sh", "Fraction of events with "+n_simhits+" by RPCf type", nRPCfTypes_+1, -0.5, nRPCfTypes_+0.5); + for (int i=1; i<=h_rpcf_nevt_fraction_with_sh->GetXaxis()->GetNbins();i++) + h_rpcf_nevt_fraction_with_sh->GetXaxis()->SetBinLabel(i,rpcfTypesLong_.at(i-1).c_str()); + + h_rpcf_shflux_per_layer = fs->make("h_rpcf_shflux_per_layer", n_simhits+" Flux in RPCf at L=10^{34};;Hz/cm^{2}", nRPCfTypes_, 0.5, nRPCfTypes_+0.5); + for (int i=1; i<=h_rpcf_shflux_per_layer->GetXaxis()->GetNbins();i++) + h_rpcf_shflux_per_layer->GetXaxis()->SetBinLabel(i,rpcfTypesLong_.at(i).c_str()); + + h_rpcb_nevt_fraction_with_sh = + fs->make("h_rpcb_nevt_fraction_with_sh", "Fraction of events with "+n_simhits+" by RPCb type", nRPCbTypes_+1, -0.5, nRPCbTypes_+0.5); + for (int i=1; i<=h_rpcb_nevt_fraction_with_sh->GetXaxis()->GetNbins();i++) + h_rpcb_nevt_fraction_with_sh->GetXaxis()->SetBinLabel(i,rpcbTypesLong_.at(i-1).c_str()); + + // GEM + h_gem_nevt_fraction_with_sh = + fs->make("h_gem_nevt_fraction_with_sh", "Fraction of events with "+n_simhits+" by GEM type", nGEMTypes_+1, -0.5, nGEMTypes_+0.5); + for (int i=1; i<=h_gem_nevt_fraction_with_sh->GetXaxis()->GetNbins();i++) + h_gem_nevt_fraction_with_sh->GetXaxis()->SetBinLabel(i,gemTypesLong_.at(i-1).c_str()); + + h_gem_shflux_per_layer = fs->make("h_gem_shflux_per_layer", n_simhits+" Flux per GEM layer at L=10^{34};;Hz/cm^{2}", nGEMTypes_, 0.5, nGEMTypes_+0.5); + for (int i=1; i<=h_gem_shflux_per_layer->GetXaxis()->GetNbins();i++) + h_gem_shflux_per_layer->GetXaxis()->SetBinLabel(i,gemTypesLong_.at(i).c_str()); +} + +// ================================================================================================ +NeutronSimHitAnalyzer::~NeutronSimHitAnalyzer() +{} + + +// ================================================================================================ +void +NeutronSimHitAnalyzer::bookCSCSimHitsTree() +{ + edm::Service fs; + csc_sh_tree = fs->make("CSCSimHitsTree", "CSCSimHitsTree"); + csc_sh_tree->Branch("evtn", &evtn); + csc_sh_tree->Branch("shn", &csc_shn); + csc_sh_tree->Branch("id", &c_id.e,"e/I:s:r:c:l:t"); + csc_sh_tree->Branch("sh", &c_h.x,"x/F:y:z:r:eta:phi:gz:e:t:pdg/I:w:s"); + //csc_sh_tree->Branch("", &., "/I"); + //csc_sh_tree->Branch("" , "vector" , & ); +} + + +// ================================================================================================ +void +NeutronSimHitAnalyzer::bookCSCLayersTree() +{ + edm::Service fs; + csc_la_tree = fs->make("CSCLayersTree", "CSCLayersTree"); + csc_la_tree->Branch("evtn", &evtn,"evtn/i"); + csc_la_tree->Branch("id", &c_id.e,"e/I:s:r:c:l:t"); + csc_la_tree->Branch("la", &c_la.ln,"ln/I:nh:mint/F:maxt:meant:sigmat:minw/I:maxw:mins:maxs"); +} + + +// ================================================================================================ +void +NeutronSimHitAnalyzer::bookCSCChambersTree() +{ + edm::Service fs; + csc_ch_tree = fs->make("CSCChambersTree", "CSCChambersTree"); + csc_ch_tree->Branch("evtn", &evtn,"evtn/i"); + csc_ch_tree->Branch("id", &c_cid.e,"e/I:s:r:c:l:t"); + csc_ch_tree->Branch("ch", &c_ch.nh,"nh/I:nl:l1:ln:mint/F:maxt:meant:sigmat:minw/I:maxw:mins:maxs"); +} + + +// ================================================================================================ +void +NeutronSimHitAnalyzer::bookRPCSimHitsTree() +{ + edm::Service fs; + rpc_sh_tree = fs->make("RPCSimHitsTree", "RPCSimHitsTree"); + rpc_sh_tree->Branch("evtn", &evtn,"evtn/i"); + rpc_sh_tree->Branch("shn", &rpc_shn,"shn/i"); + rpc_sh_tree->Branch("id", &r_id.reg,"reg/I:ring:st:sec:layer:subsec:roll:t"); + rpc_sh_tree->Branch("sh", &r_h.x,"x/F:y:z:r:eta:phi:gz:e:t:pdg/I"); +} + + +// ================================================================================================ +void +NeutronSimHitAnalyzer::bookGEMSimHitsTree() +{ + edm::Service fs; + gem_sh_tree = fs->make("GEMSimHitsTree", "GEMSimHitsTree"); + gem_sh_tree->Branch("evtn", &evtn,"evtn/i"); + gem_sh_tree->Branch("shn", &gem_shn,"shn/i"); + gem_sh_tree->Branch("region", &g_id.region); + gem_sh_tree->Branch("ring", &g_id.ring); + gem_sh_tree->Branch("station", &g_id.station); + gem_sh_tree->Branch("layer", &g_id.layer); + gem_sh_tree->Branch("chamber", &g_id.chamber); + gem_sh_tree->Branch("roll", &g_id.roll); + gem_sh_tree->Branch("l_x", &g_h.l_x); + gem_sh_tree->Branch("l_y", &g_h.l_y); + gem_sh_tree->Branch("l_z", &g_h.g_z); + gem_sh_tree->Branch("g_r", &g_h.g_r); + gem_sh_tree->Branch("g_eta", &g_h.g_eta); + gem_sh_tree->Branch("g_phi", &g_h.g_phi); + gem_sh_tree->Branch("g_z", &g_h.g_z); + gem_sh_tree->Branch("energyLoss", &g_h.energy); + gem_sh_tree->Branch("timeOfFlight", &g_h.tof); + gem_sh_tree->Branch("particleType", &g_h.pdg); + gem_sh_tree->Branch("strip", &g_h.strip); +} + + +// ================================================================================================ +void +MyCSCDetId::init(CSCDetId &id) +{ + e = id.endcap(); + s = id.station(); + r = id.ring(); + c = id.chamber(); + l = id.layer(); + t = id.iChamberType(); +} + + +// ================================================================================================ +void +MyCSCSimHit::init(PSimHit &sh, const CSCGeometry* csc_g) +{ + const LocalPoint hitLP(sh.localPosition()); + + x = hitLP.x(); + y = hitLP.y(); + z = hitLP.z(); + e = sh.energyLoss(); + t = sh.tof(); + pdg = sh.particleType(); + + const CSCDetId layerId(sh.detUnitId()); + const CSCLayer* csclayer(csc_g->layer(layerId)); + const GlobalPoint hitGP(csclayer->toGlobal(hitLP)); + + r = hitGP.perp(); + eta = hitGP.eta(); + phi = hitGP.phi(); + gz = hitGP.z(); + + w = csclayer->geometry()->wireGroup(csclayer->geometry()->nearestWire(hitLP)); + s = csclayer->geometry()->nearestStrip(hitLP); +} + + +// ================================================================================================ +void +MyCSCLayer::init(int l, std::vector &shits) +{ + hits = shits; + ln = l; + nh = hits.size(); + mint = 1000.; + maxt = -1.; + meant = 0; + sigmat = 0; + minw = 1000.; + maxw = -1; + mins = 1000; + maxs = -1; + if (nh==0) return; + for (std::vector::const_iterator itr = hits.begin(); itr != hits.end(); itr++) + { + const MyCSCSimHit sh(*itr); + if (sh.t < mint) mint = sh.t; + if (sh.t > maxt) maxt = sh.t; + if (sh.w < minw) minw = sh.w; + if (sh.w > maxw) maxw = sh.w; + if (sh.s < mins) mins = sh.s; + if (sh.s > maxs) maxs = sh.s; + meant += sh.t; + sigmat += sh.t*sh.t; + } + meant = meant/nh; + sigmat = sqrt( sigmat/nh - meant*meant); +} + + +// ================================================================================================ +void +MyCSCChamber::init(std::vector &slayers) +{ + nh = 0; + nl = slayers.size(); + mint = 1000.; + maxt = -1.; + meant = 0; + sigmat = 0; + minw = 1000.; + maxw = -1; + mins = 1000; + maxs = -1; + if (nl==0) return; + l1 = slayers[0].ln; + ln = slayers[nl-1].ln; + for (std::vector::const_iterator sl = slayers.begin(); sl != slayers.end(); sl++) + { + nh += sl->hits.size(); + for (std::vector::const_iterator itr = sl->hits.begin(); itr != sl->hits.end(); itr++) + { + const MyCSCSimHit sh(*itr); + if (sh.t < mint) mint = sh.t; + if (sh.t > maxt) maxt = sh.t; + if (sh.w < minw) minw = sh.w; + if (sh.w > maxw) maxw = sh.w; + if (sh.s < mins) mins = sh.s; + if (sh.s > maxs) maxs = sh.s; + meant += sh.t; + sigmat += sh.t*sh.t; + } + } + meant = meant/nh; + sigmat = sqrt( sigmat/nh - meant*meant); +} + + +// ================================================================================================ +void +MyCSCEvent::init(std::vector &schambers) +{ + nh = 0; + nch = 0; +} + + +// ================================================================================================ +void +MyRPCDetId::init(RPCDetId &id) +{ + reg = id.region(); + ring = id.ring(); + st = id.station(); + sec = id.sector(); + layer = id.layer(); + subsec = id.subsector(); + roll = id.roll(); + if (reg!=0) t = st*2 + ring - 3; // endcap + else t = st*3 + abs(ring) - 2; +} + + +// ================================================================================================ +void +MyRPCSimHit::init(const PSimHit &sh, const RPCGeometry* rpc_g) +{ + const LocalPoint hitLP(sh.localPosition()); + + x = hitLP.x(); + y = hitLP.y(); + z = hitLP.z(); + e = sh.energyLoss(); + t = sh.tof(); + pdg = sh.particleType(); + + const GlobalPoint hitGP(rpc_g->idToDet(DetId(sh.detUnitId()))->surface().toGlobal(hitLP)); + + r = hitGP.perp(); + eta = hitGP.eta(); + phi = hitGP.phi(); + gz = hitGP.z(); +} + +// ================================================================================================ +void +MyGEMDetId::init(GEMDetId &id) +{ + region = id.region(); + ring = id.ring(); + station = id.station(); + layer = id.layer(); + chamber = id.chamber(); + roll = id.roll(); + t = 1; +} + +// ================================================================================================ +void +MyGEMSimHit::init(const PSimHit &sh, const GEMGeometry* gem_g) +{ + const LocalPoint hitLP(sh.localPosition()); + + l_x = hitLP.x(); + l_y = hitLP.y(); + l_z = hitLP.z(); + energy = sh.energyLoss(); + tof = sh.tof(); + pdg = sh.particleType(); + + const GlobalPoint hitGP(gem_g->idToDet(DetId(sh.detUnitId()))->surface().toGlobal(hitLP)); + + g_r = hitGP.perp(); + g_eta = hitGP.eta(); + g_phi = hitGP.phi(); + g_z = hitGP.z(); + +// const LocalPoint hitEP(sh->entryPoint()); +// strip = gem_geometry_->etaPartition(sh->detUnitId())->strip(hitEP); + +} + +// ================================================================================================ +void +NeutronSimHitAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + evtn += 1; + csc_shn = 0; + rpc_shn = 0; + + // Get the geometry + edm::ESHandle csc_geom; + iSetup.get< MuonGeometryRecord >().get(csc_geom); + csc_geometry = &*csc_geom; + + edm::ESHandle dt_geom; + iSetup.get< MuonGeometryRecord >().get(dt_geom); + dt_geometry = &*dt_geom; + + edm::ESHandle rpc_geom; + iSetup.get< MuonGeometryRecord >().get(rpc_geom); + rpc_geometry = &*rpc_geom; + + edm::ESHandle gem_geom; + iSetup.get< MuonGeometryRecord >().get(gem_geom); + gem_geometry = &*gem_geom; + + // get SimHits + simhit_map_csc.fill(iEvent); + + std::vector chIds = simhit_map_csc.chambersWithHits(); + if (chIds.size()) { + //std::cout<<"--- chambers with hits: "< layer_ids = simhit_map_csc.chamberLayersWithHits(chIds[ch]); + //if (layer_ids.size()) std::cout<<"------ layers with hits: "< chamber_layers; + for (size_t la = 0; la < layer_ids.size(); la++) + { + CSCDetId layerId(layer_ids[la]); + c_id.init(layerId); + + edm::PSimHitContainer hits(simhit_map_csc.hits(layer_ids[la])); + //std::couts<<" "<< layer_ids[la]<<" "<0) ? (double)n_rpcsh_b/nevt_with_rpcsh_b : 0 )<<" sh/evt with hits)"<Sumw2(); + h_gem_nevt_fraction_with_sh->Scale(1./evtn); + h_csc_nevt_fraction_with_sh->Sumw2(); + h_csc_nevt_fraction_with_sh->Scale(1./evtn); + h_rpcf_nevt_fraction_with_sh->Sumw2(); + h_rpcf_nevt_fraction_with_sh->Scale(1./evtn); + h_rpcb_nevt_fraction_with_sh->Sumw2(); + h_rpcb_nevt_fraction_with_sh->Scale(1./evtn); + + // ---- calculate fluxes at L=10^34 + + h_csc_shflux_per_layer->Sumw2(); + for (int t=1; t<=nCSCTypes_; t++) + { + // 2 endcaps , 6 layers + const double scale(bxRate_ * pu_ * fractionEmptyBX_ /cscAreascm2_.at(t)/cscRadialSegmentation_.at(t)/2/6 /evtn); + const double rt(scale * h_csc_shflux_per_layer->GetBinContent(t)); + const double er(scale * h_csc_shflux_per_layer->GetBinError(t)); + h_csc_shflux_per_layer->SetBinContent(t,rt); + h_csc_shflux_per_layer->SetBinError(t,er); + } + + h_rpcf_shflux_per_layer->Sumw2(); + for (int t=1; t<=nRPCfTypes_; t++) + { + const double scale(bxRate_ * pu_ * fractionEmptyBX_ /rpcfAreascm2_.at(t)/rpcfRadialSegmentation_.at(t)/2 /evtn); + const double rt(scale * h_rpcf_shflux_per_layer->GetBinContent(t)); + const double er(scale * h_rpcf_shflux_per_layer->GetBinError(t)); + h_rpcf_shflux_per_layer->SetBinContent(t,rt); + h_rpcf_shflux_per_layer->SetBinError(t,er); + } + + h_gem_shflux_per_layer->Sumw2(); + for (int t=1; t<=nGEMTypes_; t++) + { + const double scale(bxRate_ * pu_ * fractionEmptyBX_ /gemAreascm2_.at(t)/gemRadialSegmentation_.at(t)/2 /evtn); + const double rt(scale * h_gem_shflux_per_layer->GetBinContent(t)); + const double er(scale * h_gem_shflux_per_layer->GetBinError(t)); + h_gem_shflux_per_layer->SetBinContent(t,rt); + h_gem_shflux_per_layer->SetBinError(t,er); + } +} + +//define this as a plug-in +DEFINE_FWK_MODULE(NeutronSimHitAnalyzer); diff --git a/SimMuL1/plugins/NeutronSimHitsAnalyzer.cc b/SimMuL1/plugins/NeutronSimHitsAnalyzer.cc deleted file mode 100644 index 89cdedf8407ee..0000000000000 --- a/SimMuL1/plugins/NeutronSimHitsAnalyzer.cc +++ /dev/null @@ -1,772 +0,0 @@ -/* - * - * - * - * - */ - -// system include files -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" - -#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" - -#include "Geometry/Records/interface/MuonGeometryRecord.h" -#include "Geometry/CSCGeometry/interface/CSCGeometry.h" -#include "Geometry/RPCGeometry/interface/RPCGeometry.h" -#include "Geometry/DTGeometry/interface/DTGeometry.h" - -#include "DataFormats/MuonDetId/interface/CSCDetId.h" -#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h" -#include "L1Trigger/CSCCommonTrigger/interface/CSCTriggerGeometry.h" - -#include "DataFormats/MuonDetId/interface/RPCDetId.h" - -#include "TH1.h" -#include "TH2.h" -#include "TTree.h" - -#include "GEMCode/SimMuL1/interface/PSimHitMapCSC.h" - - -namespace -{ -enum trig_cscs {MAX_CSC_STATIONS = 4, CSC_TYPES = 10}; -enum trig_dts {MAX_DT_STATIONS = 4, DT_TYPES = 12}; -enum trig_rpcf {MAX_RPCF_STATIONS = 4, RPCF_TYPES = 8}; -enum trig_rpcb {MAX_RPCB_STATIONS = 4, RPCB_TYPES = 12}; -int getCSCType(CSCDetId &id); -} - -// -// class decleration -// - -struct MyCSCDetId -{ - void init(CSCDetId &id); - Int_t e, s, r, c, l; - Int_t t; // type 1-10: ME1/a,1/b,1/2,1/3,2/1...4/2 -}; - -struct MyCSCSimHit -{ - void init(PSimHit &sh, const CSCGeometry* csc_g); - Float_t x, y, z; // local - Float_t r, eta, phi, gz; // global - Float_t e; // energy deposit - Float_t t; // TOF - Int_t pdg; // PDG - Int_t w, s; // WG & Strip -}; - -struct MyCSCLayer -{ - void init(int l, std::vector &shits); - std::vector hits; - Int_t ln; // layer # - Int_t nh; // # of hits - Float_t mint, maxt; // min/max TOF - Float_t meant, sigmat;// mean&stdev of TOF - Int_t minw, maxw, mins, maxs; // min/max WG & Strip -}; - -struct MyCSCChamber -{ - void init(std::vector &slayers); - Int_t nh; // nhits - Int_t nl, l1, ln; // nlayers, 1st and last layer # - Float_t mint, maxt; // min/max TOF - Float_t meant, sigmat;// mean&stdev of TOF - Int_t minw, maxw, mins, maxs; // min/max WG & Strip -}; - -struct MyCSCEvent -{ - void init(std::vector &schambers); - Int_t nh; // nhits - Int_t nch; // nchambers -}; - - -struct MyRPCDetId -{ - void init(RPCDetId &id); - Int_t reg, ring, st, sec, layer, subsec, roll; - Int_t t; // type 1-8: RE1/2,1/3,2/2,2/3,3/2,3/3,4/2,4/3 -}; - -struct MyRPCSimHit -{ - void init(const PSimHit &sh, const RPCGeometry* rpc_g); - Float_t x, y, z; // local - Float_t r, eta, phi, gz; // global - Float_t e; // energy deposit - Float_t t; // TOF - Int_t pdg; // PDG - //Int_t w, s; // WG & Strip -}; - - -class NeutronSimHitsAnalyzer : public edm::EDAnalyzer { -public: - explicit NeutronSimHitsAnalyzer(const edm::ParameterSet&); - ~NeutronSimHitsAnalyzer(); - - virtual void beginJob() ; - virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual void endJob() ; - - static const std::string csc_type[CSC_TYPES+1]; - static const std::string csc_type_[CSC_TYPES+1]; - static const std::string dt_type[DT_TYPES+1]; - static const std::string dt_type_[DT_TYPES+1]; - static const std::string rpcf_type[RPCF_TYPES+1]; - static const std::string rpcf_type_[RPCF_TYPES+1]; - static const std::string rpcb_type[RPCB_TYPES+1]; - static const std::string rpcb_type_[RPCB_TYPES+1]; - -private: - - // configuration parameters: - - edm::InputTag input_tag_csc_; - edm::InputTag input_tag_dt_; - edm::InputTag input_tag_rpc_; - - bool input_is_neutrons_; - - bool fill_csc_ch_tree_; - bool fill_csc_la_tree_; - bool fill_csc_sh_tree_; - bool fill_rpc_sh_tree_; - - // misc utilities - - const CSCGeometry* csc_geometry; - const DTGeometry* dt_geometry; - const RPCGeometry* rpc_geometry; - - SimHitAnalysis::PSimHitMapCSC simhit_map_csc; - - - // some counters: - - UInt_t evtn; - UInt_t csc_shn; - UInt_t rpc_shn; - - int nevt_with_cscsh, nevt_with_cscsh_in_rpc; - int n_cscsh, n_cscsh_in_rpc; - - int nevt_with_rpcsh, nevt_with_rpcsh_e, nevt_with_rpcsh_b; - int n_rpcsh, n_rpcsh_e, n_rpcsh_b; - - // some histos: - - TH2D * h_csc_rz_sh_xray; - TH2D * h_csc_rz_sh_heatmap; - TH1D * h_csc_nlayers_in_ch[CSC_TYPES+1]; - TH1D * h_csc_nevt_fraction_with_sh; - TH1D * h_csc_shflux_per_layer; - - TH2D * h_rpc_rz_sh_heatmap; - TH1D * h_rpcf_nevt_fraction_with_sh; - TH1D * h_rpcf_shflux_per_layer; - - TH1D * h_rpcb_nevt_fraction_with_sh; - - TH2D * h_mu_rz_sh_heatmap; - - // some ntuples: - - void bookCSCChambersTree(); - void bookCSCLayersTree(); - void bookCSCSimHitsTree(); - - void bookRPCSimHitsTree(); - - TTree* csc_ch_tree; - TTree* csc_la_tree; - TTree* csc_sh_tree; - - TTree* rpc_sh_tree; - - MyCSCDetId c_id; - MyCSCDetId c_cid; - MyCSCSimHit c_h; - MyCSCLayer c_la; - MyCSCChamber c_ch; - - MyRPCDetId r_id; - MyRPCSimHit r_h; -}; - -// -// constants, enums and typedefs -// - -const std::string NeutronSimHitsAnalyzer::csc_type[CSC_TYPES+1] = - { "Any", "ME1/a", "ME1/b", "ME1/2", "ME1/3", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2"}; -const std::string NeutronSimHitsAnalyzer::csc_type_[CSC_TYPES+1] = - { "Any", "ME1a", "ME1b", "ME12", "ME13", "ME21", "ME22", "ME31", "ME32", "ME41", "ME42"}; - -const std::string NeutronSimHitsAnalyzer::dt_type[DT_TYPES+1] = - { "Any", "MB1/0", "MB1/1", "MB1/2", "MB2/0", "MB2/1", "MB2/2", "MB3/0", "MB3/1", "MB3/2", "MB4/0", "MB4/1", "MB4/2",}; -const std::string NeutronSimHitsAnalyzer::dt_type_[DT_TYPES+1] = - { "Any", "MB10", "MB11", "MB12", "MB20", "MB21", "MB22", "MB30", "MB31", "MB32", "MB40", "MB41", "MB42",}; - -const std::string NeutronSimHitsAnalyzer::rpcf_type[RPCF_TYPES+1] = - { "Any", "RE1/2", "RE1/3", "RE2/2", "RE2/3", "RE3/2", "RE3/3", "RE4/2", "RE4/3"}; -const std::string NeutronSimHitsAnalyzer::rpcf_type_[RPCF_TYPES+1] = - { "Any", "RE12", "RE13", "RE22", "RE23", "RE32", "RE33", "RE42", "RE43"}; - -const std::string NeutronSimHitsAnalyzer::rpcb_type[RPCB_TYPES+1] = - { "Any", "RB1/0", "RB1/1", "RB1/2", "RB2/0", "RB2/1", "RB2/2", "RB3/0", "RB3/1", "RB3/2", "RB4/0", "RB4/1", "RB4/2",}; -const std::string NeutronSimHitsAnalyzer::rpcb_type_[RPCB_TYPES+1] = - { "Any", "RB10", "RB11", "RB12", "RB20", "RB21", "RB22", "RB30", "RB31", "RB32", "RB40", "RB41", "RB42",}; - - -// ================================================================================================ -NeutronSimHitsAnalyzer::NeutronSimHitsAnalyzer(const edm::ParameterSet& iConfig): - simhit_map_csc() -{ - // should be set to false if running over a regular MB sample - input_is_neutrons_ = iConfig.getUntrackedParameter< bool >("inputIsNeutrons",true); - - edm::InputTag default_tag_csc("g4SimHits","MuonCSCHits"); - edm::InputTag default_tag_dt("g4SimHits","MuonDTHits"); - edm::InputTag default_tag_rpc("g4SimHits","MuonRPCHits"); - if (input_is_neutrons_) - { - default_tag_csc = edm::InputTag("cscNeutronWriter",""); - default_tag_dt = edm::InputTag("dtNeutronWriter",""); - default_tag_rpc = edm::InputTag("rpcNeutronWriter",""); - } - - input_tag_csc_ = iConfig.getUntrackedParameter("inputTagCSC", default_tag_csc); - input_tag_dt_ = iConfig.getUntrackedParameter("inputTagDT", default_tag_dt); - input_tag_rpc_ = iConfig.getUntrackedParameter("inputTagCSC", default_tag_rpc); - - simhit_map_csc.setInputTag(input_tag_csc_); - - - nevt_with_cscsh = nevt_with_cscsh_in_rpc = n_cscsh = n_cscsh_in_rpc = 0; - nevt_with_rpcsh = nevt_with_rpcsh_e = nevt_with_rpcsh_b = n_rpcsh = n_rpcsh_e = n_rpcsh_b = 0; - - fill_csc_sh_tree_ = iConfig.getUntrackedParameter< bool >("fillCSCSimHitsTree",true); - if (fill_csc_sh_tree_) bookCSCSimHitsTree(); - fill_csc_la_tree_ = iConfig.getUntrackedParameter< bool >("fillCSCLayersTree",true); - if (fill_csc_la_tree_) bookCSCLayersTree(); - fill_csc_ch_tree_ = iConfig.getUntrackedParameter< bool >("fillCSCChambersTree",true); - if (fill_csc_ch_tree_) bookCSCChambersTree(); - - fill_rpc_sh_tree_ = iConfig.getUntrackedParameter< bool >("fillRPCSimHitsTree",true); - if (fill_rpc_sh_tree_) bookRPCSimHitsTree(); - - edm::Service fs; - - std::string n_simhits = "n-SimHits"; - if (!input_is_neutrons_) n_simhits = "SimHits"; - - h_csc_rz_sh_xray = fs->make("h_csc_rz_sh_xray",("CSC "+n_simhits+" #rho-z X-ray;z, cm;#rho, cm").c_str(),2060,550,1080,750,0,750); - h_csc_rz_sh_heatmap = fs->make("h_csc_rz_sh_heatmap",("CSC "+n_simhits+" #rho-z;z, cm;#rho, cm").c_str(),230,550,1080,150,0,750); - - - char label[200], nlabel[200]; - for (int me=0; me<=CSC_TYPES; me++) - { - sprintf(label,"h_csc_nlayers_in_ch_%s",csc_type_[me].c_str()); - sprintf(nlabel,"# of layers with %s: %s CSC;# layers", n_simhits.c_str(), csc_type[me].c_str()); - h_csc_nlayers_in_ch[me] = fs->make(label, nlabel, 6, 0.5, 6.5); - } - - h_csc_nevt_fraction_with_sh = - fs->make("h_csc_nevt_fraction_with_sh", ("Fraction of events with "+n_simhits+" by CSC type").c_str(), CSC_TYPES+1, -0.5, CSC_TYPES+0.5); - for (int i=1; i<=h_csc_nevt_fraction_with_sh->GetXaxis()->GetNbins();i++) - h_csc_nevt_fraction_with_sh->GetXaxis()->SetBinLabel(i,csc_type[i-1].c_str()); - - h_csc_shflux_per_layer = fs->make("h_csc_shflux_per_layer", (n_simhits+" Flux per CSC layer at L=10^{34}").c_str(), CSC_TYPES, 0.5, CSC_TYPES+0.5); - for (int i=1; i<=h_csc_shflux_per_layer->GetXaxis()->GetNbins();i++) - h_csc_shflux_per_layer->GetXaxis()->SetBinLabel(i,csc_type[i].c_str()); - h_csc_shflux_per_layer->GetYaxis()->SetTitle("Hz/cm^{2}"); - - h_rpc_rz_sh_heatmap = fs->make("h_rpc_rz_sh_heatmap",("RPC "+n_simhits+" #rho-z;z, cm;#rho, cm").c_str(),450,0,1080,160,0,800); - - h_rpcf_nevt_fraction_with_sh = - fs->make("h_rpcf_nevt_fraction_with_sh", ("Fraction of events with "+n_simhits+" by RPFf type").c_str(), RPCF_TYPES+1, -0.5, RPCF_TYPES+0.5); - for (int i=1; i<=h_rpcf_nevt_fraction_with_sh->GetXaxis()->GetNbins();i++) - h_rpcf_nevt_fraction_with_sh->GetXaxis()->SetBinLabel(i,rpcf_type[i-1].c_str()); - - h_rpcf_shflux_per_layer = fs->make("h_rpcf_shflux_per_layer", (n_simhits+" Flux in RPCf at L=10^{34}").c_str(), RPCF_TYPES, 0.5, RPCF_TYPES+0.5); - for (int i=1; i<=h_rpcf_shflux_per_layer->GetXaxis()->GetNbins();i++) - h_rpcf_shflux_per_layer->GetXaxis()->SetBinLabel(i,rpcf_type[i].c_str()); - h_rpcf_shflux_per_layer->GetYaxis()->SetTitle("Hz/cm^{2}"); - - h_rpcb_nevt_fraction_with_sh = - fs->make("h_rpcb_nevt_fraction_with_sh", ("Fraction of events with "+n_simhits+" by RPFb type").c_str(), RPCB_TYPES+1, -0.5, RPCB_TYPES+0.5); - for (int i=1; i<=h_rpcb_nevt_fraction_with_sh->GetXaxis()->GetNbins();i++) - h_rpcb_nevt_fraction_with_sh->GetXaxis()->SetBinLabel(i,rpcb_type[i-1].c_str()); - - h_mu_rz_sh_heatmap = fs->make("h_mu_rz_sh_heatmap", (n_simhits+" #rho-z;z, cm;#rho, cm").c_str(),480,0,1100,160,0,800); -} - -// ================================================================================================ -NeutronSimHitsAnalyzer::~NeutronSimHitsAnalyzer() -{} - - -// ================================================================================================ -void -NeutronSimHitsAnalyzer::bookCSCSimHitsTree() -{ - edm::Service fs; - csc_sh_tree = fs->make("CSCSimHitsTree", "CSCSimHitsTree"); - csc_sh_tree->Branch("evtn", &evtn,"evtn/i"); - csc_sh_tree->Branch("shn", &csc_shn,"shn/i"); - csc_sh_tree->Branch("id", &c_id.e,"e/I:s:r:c:l:t"); - csc_sh_tree->Branch("sh", &c_h.x,"x/F:y:z:r:eta:phi:gz:e:t:pdg/I:w:s"); - //csc_sh_tree->Branch("", &., "/I"); - //csc_sh_tree->Branch("" , "vector" , & ); -} - - -// ================================================================================================ -void -NeutronSimHitsAnalyzer::bookCSCLayersTree() -{ - edm::Service fs; - csc_la_tree = fs->make("CSCLayersTree", "CSCLayersTree"); - csc_la_tree->Branch("evtn", &evtn,"evtn/i"); - csc_la_tree->Branch("id", &c_id.e,"e/I:s:r:c:l:t"); - csc_la_tree->Branch("la", &c_la.ln,"ln/I:nh:mint/F:maxt:meant:sigmat:minw/I:maxw:mins:maxs"); -} - - -// ================================================================================================ -void -NeutronSimHitsAnalyzer::bookCSCChambersTree() -{ - edm::Service fs; - csc_ch_tree = fs->make("CSCChambersTree", "CSCChambersTree"); - csc_ch_tree->Branch("evtn", &evtn,"evtn/i"); - csc_ch_tree->Branch("id", &c_cid.e,"e/I:s:r:c:l:t"); - csc_ch_tree->Branch("ch", &c_ch.nh,"nh/I:nl:l1:ln:mint/F:maxt:meant:sigmat:minw/I:maxw:mins:maxs"); -} - - -// ================================================================================================ -void -NeutronSimHitsAnalyzer::bookRPCSimHitsTree() -{ - edm::Service fs; - rpc_sh_tree = fs->make("RPCSimHitsTree", "RPCSimHitsTree"); - rpc_sh_tree->Branch("evtn", &evtn,"evtn/i"); - rpc_sh_tree->Branch("shn", &rpc_shn,"shn/i"); - rpc_sh_tree->Branch("id", &r_id.reg,"reg/I:ring:st:sec:layer:subsec:roll:t"); - rpc_sh_tree->Branch("sh", &r_h.x,"x/F:y:z:r:eta:phi:gz:e:t:pdg/I"); - //rpc_sh_tree->Branch("", &., "/I"); - //rpc_sh_tree->Branch("" , "vector" , & ); -} - - -// ================================================================================================ -void -MyCSCDetId::init(CSCDetId &id) -{ - e = id.endcap(); - s = id.station(); - r = id.ring(); - c = id.chamber(); - l = id.layer(); - t = id.iChamberType(); -} - - -// ================================================================================================ -void -MyCSCSimHit::init(PSimHit &sh, const CSCGeometry* csc_g) -{ - LocalPoint hitLP = sh.localPosition(); - - x = hitLP.x(); - y = hitLP.y(); - z = hitLP.z(); - e = sh.energyLoss(); - t = sh.tof(); - pdg = sh.particleType(); - - CSCDetId layerId(sh.detUnitId()); - const CSCLayer* csclayer = csc_g->layer(layerId); - GlobalPoint hitGP = csclayer->toGlobal(hitLP); - - r = hitGP.perp(); - eta = hitGP.eta(); - phi = hitGP.phi(); - gz = hitGP.z(); - - w = csclayer->geometry()->wireGroup(csclayer->geometry()->nearestWire(hitLP)); - s = csclayer->geometry()->nearestStrip(hitLP); -} - - -// ================================================================================================ -void -MyCSCLayer::init(int l, std::vector &shits) -{ - hits = shits; - ln = l; - nh = hits.size(); - mint = 1000.; - maxt = -1.; - meant = 0; - sigmat = 0; - minw = 1000.; - maxw = -1; - mins = 1000; - maxs = -1; - if (nh==0) return; - for (std::vector::const_iterator itr = hits.begin(); itr != hits.end(); itr++) - { - MyCSCSimHit sh = *itr; - if (sh.t < mint) mint = sh.t; - if (sh.t > maxt) maxt = sh.t; - if (sh.w < minw) minw = sh.w; - if (sh.w > maxw) maxw = sh.w; - if (sh.s < mins) mins = sh.s; - if (sh.s > maxs) maxs = sh.s; - meant += sh.t; - sigmat += sh.t*sh.t; - } - meant = meant/nh; - sigmat = sqrt( sigmat/nh - meant*meant); -} - - -// ================================================================================================ -void -MyCSCChamber::init(std::vector &slayers) -{ - nh = 0; - nl = slayers.size(); - mint = 1000.; - maxt = -1.; - meant = 0; - sigmat = 0; - minw = 1000.; - maxw = -1; - mins = 1000; - maxs = -1; - if (nl==0) return; - l1 = slayers[0].ln; - ln = slayers[nl-1].ln; - for (std::vector::const_iterator sl = slayers.begin(); sl != slayers.end(); sl++) - { - nh += sl->hits.size(); - for (std::vector::const_iterator itr = sl->hits.begin(); itr != sl->hits.end(); itr++) - { - MyCSCSimHit sh = *itr; - if (sh.t < mint) mint = sh.t; - if (sh.t > maxt) maxt = sh.t; - if (sh.w < minw) minw = sh.w; - if (sh.w > maxw) maxw = sh.w; - if (sh.s < mins) mins = sh.s; - if (sh.s > maxs) maxs = sh.s; - meant += sh.t; - sigmat += sh.t*sh.t; - } - } - meant = meant/nh; - sigmat = sqrt( sigmat/nh - meant*meant); -} - - -// ================================================================================================ -void -MyCSCEvent::init(std::vector &schambers) -{ - nh = 0; - nch = 0; -} - - -// ================================================================================================ -void -MyRPCDetId::init(RPCDetId &id) -{ - reg = id.region(); - ring = id.ring(); - st = id.station(); - sec = id.sector(); - layer = id.layer(); - subsec = id.subsector(); - roll = id.roll(); - if (reg!=0) t = st*2 + ring - 3; // endcap - else t = st*3 + abs(ring) - 2; -} - - -// ================================================================================================ -void -MyRPCSimHit::init(const PSimHit &sh, const RPCGeometry* rpc_g) -{ - LocalPoint hitLP = sh.localPosition(); - - x = hitLP.x(); - y = hitLP.y(); - z = hitLP.z(); - e = sh.energyLoss(); - t = sh.tof(); - pdg = sh.particleType(); - - GlobalPoint hitGP = rpc_g->idToDet(DetId(sh.detUnitId()))->surface().toGlobal(hitLP); - - r = hitGP.perp(); - eta = hitGP.eta(); - phi = hitGP.phi(); - gz = hitGP.z(); - - //w = csclayer->geometry()->wireGroup(csclayer->geometry()->nearestWire(hitLP)); - //s = csclayer->geometry()->nearestStrip(hitLP); -} - - -// ================================================================================================ -void -NeutronSimHitsAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) -{ - using namespace edm; - using namespace std; - - evtn += 1; - csc_shn = 0; - rpc_shn = 0; - - ESHandle< CSCGeometry > csc_geom; - ESHandle< DTGeometry > dt_geom; - ESHandle< RPCGeometry > rpc_geom; - - iSetup.get< MuonGeometryRecord >().get(csc_geom); - iSetup.get< MuonGeometryRecord >().get(dt_geom); - iSetup.get< MuonGeometryRecord >().get(rpc_geom); - - csc_geometry = &*csc_geom; - dt_geometry = &*dt_geom; - rpc_geometry = &*rpc_geom; - - // get SimHits - simhit_map_csc.fill(iEvent); - - vector chIds = simhit_map_csc.chambersWithHits(); - if (chIds.size()) { - //cout<<"--- chambers with hits: "< layer_ids = simhit_map_csc.chamberLayersWithHits(chIds[ch]); - //if (layer_ids.size()) cout<<"------ layers with hits: "< chamber_layers; - for (size_t la = 0; la < layer_ids.size(); la++) - { - CSCDetId layerId(layer_ids[la]); - c_id.init(layerId); - - PSimHitContainer hits = simhit_map_csc.hits(layer_ids[la]); - //cout<<" "<< layer_ids[la]<<" "<0) ? (double)n_rpcsh_b/nevt_with_rpcsh_b : 0 )<<" sh/evt with hits)"<Sumw2(); - h_csc_nevt_fraction_with_sh->Scale(1./evtn); - h_rpcf_nevt_fraction_with_sh->Sumw2(); - h_rpcf_nevt_fraction_with_sh->Scale(1./evtn); - h_rpcb_nevt_fraction_with_sh->Sumw2(); - h_rpcb_nevt_fraction_with_sh->Scale(1./evtn); - - // ---- calculate fluxes at L=10^34 - - // chamber areas - const double csc_areas_cm2[CSC_TYPES+1] = {100000, 1068.32, 4108.77, 10872.75, 13559.025, 16986, 31121.2, 15716.4, 31121.2, 14542.5, 31121.2}; - const double rpcf_areas_cm2[RPCF_TYPES+1] = {100000, 11700, 17360, 11690, 19660, 11690, 19660, 11690, 19660}; - // chamber radial segmentations - const double csc_radial_segm[CSC_TYPES+1] = {100, 36, 36, 36, 36, 18, 36, 18, 36, 18, 36}; - const double rpcf_radial_segm = 36; - // pileup at nominal lumi - double n_pu = 25.; - // fraction of empty BXs - double f_empty_bx = 0.77; - if (!input_is_neutrons_) f_empty_bx = 1.; - // bx rate 40 MHz - double bxrate = 40000000.; - - h_csc_shflux_per_layer->Sumw2(); - for (int t=1; t<=CSC_TYPES; t++) - { - // 2 endcaps , 6 layers - double scale = bxrate * n_pu * f_empty_bx /csc_areas_cm2[t]/csc_radial_segm[t]/2/6 /evtn; - double rt = scale * h_csc_shflux_per_layer->GetBinContent(t); - double er = scale * h_csc_shflux_per_layer->GetBinError(t); - h_csc_shflux_per_layer->SetBinContent(t,rt); - h_csc_shflux_per_layer->SetBinError(t,er); - } - - h_rpcf_shflux_per_layer->Sumw2(); - for (int t=1; t<=RPCF_TYPES; t++) - { - double scale = bxrate * n_pu * f_empty_bx /rpcf_areas_cm2[t]/rpcf_radial_segm/2 /evtn; - double rt = scale * h_rpcf_shflux_per_layer->GetBinContent(t); - double er = scale * h_rpcf_shflux_per_layer->GetBinError(t); - h_rpcf_shflux_per_layer->SetBinContent(t,rt); - h_rpcf_shflux_per_layer->SetBinError(t,er); - } - - -} - -// ================================================================================================ -//define this as a plug-in -//DEFINE_FWK_MODULE(NeutronSimHitsAnalyzer); diff --git a/SimMuL1/python/NeutronSimHitAnalyzer_cfi.py b/SimMuL1/python/NeutronSimHitAnalyzer_cfi.py new file mode 100644 index 0000000000000..1ce4603e9e939 --- /dev/null +++ b/SimMuL1/python/NeutronSimHitAnalyzer_cfi.py @@ -0,0 +1,52 @@ +import FWCore.ParameterSet.Config as cms + +NeutronSimHitAnalyzer = cms.EDAnalyzer("NeutronSimHitAnalyzer", + inputIsNeutrons = cms.bool(True), + defaultInputTagCSC = cms.InputTag("cscNeutronWriter",""), + defaultInputTagRPC = cms.InputTag("rpcNeutronWriter",""), + defaultInputTagGEM = cms.InputTag("gemNeutronWriter",""), + defaultInputTagDT = cms.InputTag("dtNeutronWriter",""), + inputTagCSC = cms.InputTag("g4SimHits","MuonCSCHits"), + inputTagGEM = cms.InputTag("g4SimHits","MuonGEMHits"), + inputTagRPC = cms.InputTag("g4SimHits","MuonRPCHits"), + inputTagDT = cms.InputTag("g4SimHits","MuonDTHits"), + ## + maxCSCStations = cms.int32(4), + nCSCTypes = cms.int32(10), + maxDTStations = cms.int32(4), + nDTTypes = cms.int32(4), + maxRPCfStations = cms.int32(8), + nRPCfTypes = cms.int32(8), + maxRPCbStations = cms.int32(4), + nRPCbTypes = cms.int32(12), + maxGEMStations = cms.int32(1), + nGEMTypes = cms.int32(1), + ## chamber types + cscTypesLong = cms.vstring("Any", "ME1/a", "ME1/b", "ME1/2", "ME1/3", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2"), + cscTypesShort = cms.vstring("Any", "ME1a", "ME1b", "ME12", "ME13", "ME21", "ME22", "ME31", "ME32", "ME41", "ME42"), + dtTypesLong = cms.vstring("Any", "MB1/0", "MB1/1", "MB1/2", "MB2/0", "MB2/1", "MB2/2", "MB3/0", "MB3/1", "MB3/2", "MB4/0", "MB4/1", "MB4/2"), + dtTypesShort = cms.vstring("Any", "MB10", "MB11", "MB12", "MB20", "MB21", "MB22", "MB30", "MB31", "MB32", "MB40", "MB41", "MB42"), + rpcfTypesLong = cms.vstring("Any", "RE1/2", "RE1/3", "RE2/2", "RE2/3", "RE3/2", "RE3/3", "RE4/2", "RE4/3"), + rpcfTypesShort = cms.vstring("Any", "RE12", "RE13", "RE22", "RE23", "RE32", "RE33", "RE42", "RE43"), + rpcbTypesLong = cms.vstring("Any", "RB1/0", "RB1/1", "RB1/2", "RB2/0", "RB2/1", "RB2/2", "RB3/0", "RB3/1", "RB3/2", "RB4/0", "RB4/1", "RB4/2"), + rpcbTypesShort = cms.vstring("Any", "RB10", "RB11", "RB12", "RB20", "RB21", "RB22", "RB30", "RB31", "RB32", "RB40", "RB41", "RB42"), + gemTypesLong = cms.vstring("Any", "GE1/1"), + gemTypesShort = cms.vstring("Any", "GE11"), + ## add chamber areas + pu = cms.int32(25), + fractionEmptyBX = cms.double(0.77), + bxRate = cms.int32(40000000), + ## chamber areas + ## are these sensitive volumes? + cscAreascm2 = cms.vdouble(100000, 1068.32, 4108.77, 10872.75, 13559.025, 16986, 31121.2, 15716.4, 31121.2, 14542.5, 31121.2), ##why 100000 for ANY? + rpfcAreascm2 = cms.vdouble(100000, 11700, 17360, 11690, 19660, 11690, 19660, 11690, 19660), + gemAreascm2 = cms.vdouble(100000, 3226.446), ## current geometry + ##gemAreascm2 = cms.vdouble(100000, 4082.091), ## extended geometry cscRadialSegmentation = cms.vint32(100, 36, 36, 36, 36, 18, 36, 18, 36, 18, 36), ##why 100? for ANY? + rpcfRadialSegmentation = cms.int32(100, 36), + gemRadialSegmentation = cms.int32(100, 36), + ##layers + nRPCLayers = cms.int32(1), + nGEMLayers = cms.int32(2), + nCSCLayers = cms.int32(6) +) + diff --git a/SimMuL1/test/runNeutronSimHitAnalyzer_cfg.py b/SimMuL1/test/runNeutronSimHitAnalyzer_cfg.py new file mode 100644 index 0000000000000..8793b58dc85e4 --- /dev/null +++ b/SimMuL1/test/runNeutronSimHitAnalyzer_cfg.py @@ -0,0 +1,34 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("NEUTRON") + +## Standard sequence +process.load('Configuration.StandardSequences.Services_cff') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.Geometry.GeometryExtended2019Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2019_cff') +process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +## TrackingComponentsRecord required for matchers +process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorOpposite_cfi') +process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAlong_cfi') + +## global tag for 2019 upgrade studies +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgrade2019', '') + +# the analyzer configuration +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) ) + +process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) + +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring("file:out_sim.root") +) + +process.TFileService = cms.Service("TFileService", + fileName = cms.string("neutron_sh_ana.root") +) + +process.p = cms.Path(process.NeutronSimHitAnalyzer) From 4c05ec67fe362693d51184ebc070ece209d46787 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 13 Aug 2013 14:01:33 +0200 Subject: [PATCH 078/182] clean-up --- SimMuL1/plugins/NeutronSimHitAnalyzer.cc | 128 ++++++++++++----------- 1 file changed, 68 insertions(+), 60 deletions(-) diff --git a/SimMuL1/plugins/NeutronSimHitAnalyzer.cc b/SimMuL1/plugins/NeutronSimHitAnalyzer.cc index 637b2a5188a9b..c4f5a3968d248 100644 --- a/SimMuL1/plugins/NeutronSimHitAnalyzer.cc +++ b/SimMuL1/plugins/NeutronSimHitAnalyzer.cc @@ -37,7 +37,7 @@ #include "GEMCode/SimMuL1/interface/PSimHitMapCSC.h" // -// class decleration +// class declaration // struct MyCSCDetId @@ -128,12 +128,17 @@ class NeutronSimHitAnalyzer : public edm::EDAnalyzer { public: + typedef std::vector vstring; + typedef std::vector vdouble; + typedef std::vector vint; + explicit NeutronSimHitAnalyzer(const edm::ParameterSet&); ~NeutronSimHitAnalyzer(); - virtual void beginJob() ; + virtual void beginRun(const edm::Run &, const edm::EventSetup &); + virtual void beginJob(); virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual void endJob() ; + virtual void endJob(); private: @@ -153,7 +158,6 @@ class NeutronSimHitAnalyzer : public edm::EDAnalyzer const RPCGeometry* rpc_geometry; const GEMGeometry* gem_geometry; - // some counters: int evtn; int csc_shn; @@ -198,27 +202,27 @@ class NeutronSimHitAnalyzer : public edm::EDAnalyzer int maxGEMStations_; int nGEMTypes_; - std::vector cscTypesLong_; - std::vector cscTypesShort_; - std::vector dtTypesLong_; - std::vector dtTypesShort_; - std::vector rpcfTypesLong_; - std::vector rpcfTypesShort_; - std::vector rpcbTypesLong_; - std::vector rpcbTypesShort_; - std::vector gemTypesLong_; - std::vector gemTypesShort_; + vstring cscTypesLong_; + vstring cscTypesShort_; + vstring dtTypesLong_; + vstring dtTypesShort_; + vstring rpcfTypesLong_; + vstring rpcfTypesShort_; + vstring rpcbTypesLong_; + vstring rpcbTypesShort_; + vstring gemTypesLong_; + vstring gemTypesShort_; SimHitAnalysis::PSimHitMapCSC simhit_map_csc; bool inputIsNeutrons_; // chamber sizes and segmentation - std::vector cscAreascm2_; - std::vector rpcfAreascm2_; - std::vector gemAreascm2_; - std::vector cscRadialSegmentation_; - std::vector rpcfRadialSegmentation_; - std::vector gemRadialSegmentation_; + vdouble cscAreascm2_; + vdouble rpcfAreascm2_; + vdouble gemAreascm2_; + vint cscRadialSegmentation_; + vint rpcfRadialSegmentation_; + vint gemRadialSegmentation_; // layers int nRPCLayers_; @@ -272,26 +276,26 @@ NeutronSimHitAnalyzer::NeutronSimHitAnalyzer(const edm::ParameterSet& iConfig): nRPCbTypes_(iConfig.getParameter("nRPCbTypes")), maxGEMStations_(iConfig.getParameter("maxGEMStations")), nGEMTypes_(iConfig.getParameter("nGEMTypes")), - cscTypesLong_(iConfig.getParameter >("cscTypesLong")), - cscTypesShort_(iConfig.getParameter >("cscTypesShort")), - dtTypesLong_(iConfig.getParameter >("dtTypesLong")), - dtTypesShort_(iConfig.getParameter >("dtTypesShort")), - rpcfTypesLong_(iConfig.getParameter >("rpcfTypesLong")), - rpcfTypesShort_(iConfig.getParameter >("rpcfTypesShort")), - rpcbTypesLong_(iConfig.getParameter >("rpcbTypesLong")), - rpcbTypesShort_(iConfig.getParameter >("rpcbTypesShort")), - gemTypesLong_(iConfig.getParameter >("gemTypesLong")), - gemTypesShort_(iConfig.getParameter >("gemTypesLong")), + cscTypesLong_(iConfig.getParameter("cscTypesLong")), + cscTypesShort_(iConfig.getParameter("cscTypesShort")), + dtTypesLong_(iConfig.getParameter("dtTypesLong")), + dtTypesShort_(iConfig.getParameter("dtTypesShort")), + rpcfTypesLong_(iConfig.getParameter("rpcfTypesLong")), + rpcfTypesShort_(iConfig.getParameter("rpcfTypesShort")), + rpcbTypesLong_(iConfig.getParameter("rpcbTypesLong")), + rpcbTypesShort_(iConfig.getParameter("rpcbTypesShort")), + gemTypesLong_(iConfig.getParameter("gemTypesLong")), + gemTypesShort_(iConfig.getParameter("gemTypesLong")), simhit_map_csc(), // should be set to false if running over a regular MB sample inputIsNeutrons_(iConfig.getParameter("inputIsNeutrons")), //chambers sizes - cscAreascm2_(iConfig.getParameter >("cscAreascm2")), - rpcfAreascm2_(iConfig.getParameter >("rpfcAreascm2")), - gemAreascm2_(iConfig.getParameter >("gemAreascm2")), - cscRadialSegmentation_(iConfig.getParameter >("cscRadialSegmentation")), - rpcfRadialSegmentation_(iConfig.getParameter >("rpcfRadialSegmentation")), - gemRadialSegmentation_(iConfig.getParameter >("gemRadialSegmentation")), + cscAreascm2_(iConfig.getParameter("cscAreascm2")), + rpcfAreascm2_(iConfig.getParameter("rpfcAreascm2")), + gemAreascm2_(iConfig.getParameter("gemAreascm2")), + cscRadialSegmentation_(iConfig.getParameter("cscRadialSegmentation")), + rpcfRadialSegmentation_(iConfig.getParameter("rpcfRadialSegmentation")), + gemRadialSegmentation_(iConfig.getParameter("gemRadialSegmentation")), nRPCLayers_(iConfig.getParameter("nRPCLayers")), nGEMLayers_(iConfig.getParameter("nGEMLayers")), nCSCLayers_(iConfig.getParameter("nCSCLayers")) @@ -384,8 +388,6 @@ NeutronSimHitAnalyzer::bookCSCSimHitsTree() csc_sh_tree->Branch("shn", &csc_shn); csc_sh_tree->Branch("id", &c_id.e,"e/I:s:r:c:l:t"); csc_sh_tree->Branch("sh", &c_h.x,"x/F:y:z:r:eta:phi:gz:e:t:pdg/I:w:s"); - //csc_sh_tree->Branch("", &., "/I"); - //csc_sh_tree->Branch("" , "vector" , & ); } @@ -644,19 +646,13 @@ MyGEMSimHit::init(const PSimHit &sh, const GEMGeometry* gem_g) g_phi = hitGP.phi(); g_z = hitGP.z(); -// const LocalPoint hitEP(sh->entryPoint()); -// strip = gem_geometry_->etaPartition(sh->detUnitId())->strip(hitEP); - + const LocalPoint hitEP(sh.entryPoint()); + strip = gem_g->etaPartition(sh.detUnitId())->strip(hitEP); } -// ================================================================================================ -void -NeutronSimHitAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +void +NeutronSimHitAnalyzer::beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) { - evtn += 1; - csc_shn = 0; - rpc_shn = 0; - // Get the geometry edm::ESHandle csc_geom; iSetup.get< MuonGeometryRecord >().get(csc_geom); @@ -673,11 +669,25 @@ NeutronSimHitAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& edm::ESHandle gem_geom; iSetup.get< MuonGeometryRecord >().get(gem_geom); gem_geometry = &*gem_geom; +} + +// ================================================================================================ +void +NeutronSimHitAnalyzer::beginJob() {} + + +// ================================================================================================ +void +NeutronSimHitAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + evtn += 1; + csc_shn = 0; + rpc_shn = 0; // get SimHits simhit_map_csc.fill(iEvent); - std::vector chIds = simhit_map_csc.chambersWithHits(); + vint chIds = simhit_map_csc.chambersWithHits(); if (chIds.size()) { //std::cout<<"--- chambers with hits: "< layer_ids = simhit_map_csc.chamberLayersWithHits(chIds[ch]); + vint layer_ids = simhit_map_csc.chamberLayersWithHits(chIds[ch]); //if (layer_ids.size()) std::cout<<"------ layers with hits: "< chamber_layers; @@ -813,7 +823,7 @@ NeutronSimHitAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& edm::Handle< edm::PSimHitContainer > h_gem_simhits; iEvent.getByLabel(inputTagGEM_, h_gem_simhits); - const edm::PSimHitContainer* gem_simhits = h_gem_simhits.product(); + const edm::PSimHitContainer* gem_simhits(h_gem_simhits.product()); if (gem_simhits->size()) nevt_with_gemsh++; @@ -852,13 +862,9 @@ NeutronSimHitAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& // ================================================================================================ -void NeutronSimHitAnalyzer::beginJob() {} - - -// ================================================================================================ -void NeutronSimHitAnalyzer::endJob() +void +NeutronSimHitAnalyzer::endJob() { - using namespace std; std::cout<<"******************* COUNTERS *******************"<GetBinContent(t)); const double er(scale * h_csc_shflux_per_layer->GetBinError(t)); h_csc_shflux_per_layer->SetBinContent(t,rt); @@ -903,7 +909,8 @@ void NeutronSimHitAnalyzer::endJob() h_rpcf_shflux_per_layer->Sumw2(); for (int t=1; t<=nRPCfTypes_; t++) { - const double scale(bxRate_ * pu_ * fractionEmptyBX_ /rpcfAreascm2_.at(t)/rpcfRadialSegmentation_.at(t)/2 /evtn); + // 2 endcaps , 1 layer + const double scale(bxRate_ * pu_ * fractionEmptyBX_ /rpcfAreascm2_.at(t)/rpcfRadialSegmentation_.at(t)/2/nRPCLayers_ /evtn); const double rt(scale * h_rpcf_shflux_per_layer->GetBinContent(t)); const double er(scale * h_rpcf_shflux_per_layer->GetBinError(t)); h_rpcf_shflux_per_layer->SetBinContent(t,rt); @@ -913,7 +920,8 @@ void NeutronSimHitAnalyzer::endJob() h_gem_shflux_per_layer->Sumw2(); for (int t=1; t<=nGEMTypes_; t++) { - const double scale(bxRate_ * pu_ * fractionEmptyBX_ /gemAreascm2_.at(t)/gemRadialSegmentation_.at(t)/2 /evtn); + // 2 endcaps , 2 layers + const double scale(bxRate_ * pu_ * fractionEmptyBX_ /gemAreascm2_.at(t)/gemRadialSegmentation_.at(t)/2/nGEMLayers_ /evtn); const double rt(scale * h_gem_shflux_per_layer->GetBinContent(t)); const double er(scale * h_gem_shflux_per_layer->GetBinError(t)); h_gem_shflux_per_layer->SetBinContent(t,rt); From 585fea3b335e555bebe4424c1e3370857f0c944f Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Tue, 13 Aug 2013 08:37:41 -0500 Subject: [PATCH 079/182] extra GEM plots, some simplifications & shortcuts also extra histograms where total areas are saved --- SimMuL1/plugins/MuSimHitOccupancy.cc | 259 +++++++++++++++------------ 1 file changed, 146 insertions(+), 113 deletions(-) diff --git a/SimMuL1/plugins/MuSimHitOccupancy.cc b/SimMuL1/plugins/MuSimHitOccupancy.cc index b52d026630b75..bcd90883b3aad 100644 --- a/SimMuL1/plugins/MuSimHitOccupancy.cc +++ b/SimMuL1/plugins/MuSimHitOccupancy.cc @@ -62,6 +62,16 @@ const std::string pdg_ids_names[N_PDGIDS] = {"unknown", "e", "#mu", "#pi", "K", const std::string pdg_ids_names_[N_PDGIDS] = {"", "e", "mu", "pi", "K", "p", "nucl"}; const int pdg_colors[N_PDGIDS] = {0, kBlack, kBlue, kGreen+1, kOrange-3, kMagenta, kRed}; const int pdg_markers[N_PDGIDS] = {0, 1, 24, 3, 5, 26, 2}; + +template +void scaleOneBin(H *h, int bin, double scale) +{ + double rt = scale * h->GetBinContent(bin); + double er = scale * h->GetBinError(bin); + h->SetBinContent(bin, rt); + h->SetBinError(bin, er); +} + } // local namespace @@ -157,6 +167,7 @@ class MuSimHitOccupancy : public edm::EDAnalyzer TH1D * h_csc_hit_rate_per_ch; TH1D * h_csc_clu_flux_per_layer; TH1D * h_csc_clu_rate_per_ch; + TH1D * h_csc_total_area; std::map pdg2idx; TH2D * h_csc_tof_vs_ekin[CSC_TYPES+1][N_PDGIDS]; @@ -169,6 +180,12 @@ class MuSimHitOccupancy : public edm::EDAnalyzer TH1D * h_gem_clu_flux_per_layer; TH1D * h_gem_clu_rate_per_ch; TH2D * h_gem_tof_vs_ekin[N_PDGIDS]; + TH2D * h_gem_hit_avg_per_ch; + TH1D * h_gem_total_area; + + TH1D * h_gem_hit_flux_per_partlayer_ge11; + TH1D * h_gem_hit_avg_per_part_ge11; + TH1D * h_gem_total_partarea_ge11; TH2D * h_rpc_rz_sh_heatmap; @@ -177,12 +194,14 @@ class MuSimHitOccupancy : public edm::EDAnalyzer TH1D * h_rpcf_hit_rate_per_ch; TH1D * h_rpcf_clu_flux_per_layer; TH1D * h_rpcf_clu_rate_per_ch; + TH1D * h_rpcf_total_area; TH1D * h_rpcb_nevt_fraction_with_sh; TH1D * h_rpcb_hit_flux_per_layer; TH1D * h_rpcb_hit_rate_per_ch; TH1D * h_rpcb_clu_flux_per_layer; TH1D * h_rpcb_clu_rate_per_ch; + TH1D * h_rpcb_total_area; TH2D * h_rpcb_tof_vs_ekin[N_PDGIDS]; TH2D * h_rpcf_tof_vs_ekin[N_PDGIDS]; @@ -193,6 +212,7 @@ class MuSimHitOccupancy : public edm::EDAnalyzer TH1D * h_dt_hit_flux_per_layer; TH1D * h_dt_hit_rate_per_ch; TH2D * h_dt_tof_vs_ekin[N_PDGIDS]; + TH1D * h_dt_total_area; TH2D * h_mu_rz_sh_heatmap; @@ -203,6 +223,7 @@ class MuSimHitOccupancy : public edm::EDAnalyzer TGraphErrors *gr_dt_hit_flux_mb1, *gr_dt_hit_flux_mb2, *gr_dt_hit_flux_mb3, *gr_dt_hit_flux_mb4; TGraphErrors *gr_gem_hit_flux_ge1; + TGraphErrors *gr_gem_hit_padflux_ge1; // some ntuples: @@ -357,6 +378,8 @@ MuSimHitOccupancy::MuSimHitOccupancy(const edm::ParameterSet& iConfig) for (int i=1; i<=h_csc_clu_rate_per_ch->GetXaxis()->GetNbins();i++) h_csc_clu_rate_per_ch->GetXaxis()->SetBinLabel(i,csc_type[i].c_str()); + h_csc_total_area = fs->make("h_csc_total_area", "CSC total area per type", CSC_TYPES, 0.5, CSC_TYPES+0.5); + for (int pdg=1; pdgGetXaxis()->SetBinLabel(i,gem_type[i-1].c_str()); h_gem_hit_flux_per_layer = fs->make("h_gem_hit_flux_per_layer", - (n_simhits+" Flux in GEM at L=10^{34};RE station/ring;Hz/cm^{2}").c_str(), GEM_TYPES, 0.5, GEM_TYPES+0.5); + (n_simhits+" Flux in GEM at L=10^{34};GE station/ring;Hz/cm^{2}").c_str(), GEM_TYPES, 0.5, GEM_TYPES+0.5); for (int i=1; i<=h_gem_hit_flux_per_layer->GetXaxis()->GetNbins();i++) h_gem_hit_flux_per_layer->GetXaxis()->SetBinLabel(i,gem_type[i].c_str()); @@ -397,6 +420,16 @@ MuSimHitOccupancy::MuSimHitOccupancy(const edm::ParameterSet& iConfig) for (int i=1; i<=h_gem_clu_rate_per_ch->GetXaxis()->GetNbins();i++) h_gem_clu_rate_per_ch->GetXaxis()->SetBinLabel(i,gem_type[i].c_str()); + h_gem_total_area = fs->make("h_gem_total_area", "GEM total area per type", GEM_TYPES, 0.5, GEM_TYPES+0.5); + + h_gem_hit_flux_per_partlayer_ge11 = fs->make("h_gem_hit_flux_per_partlayer_ge11", + (n_simhits+" Flux in GEM at L=10^{34};GE1/1 partition#;Hz/cm^{2}").c_str(), 10, 0.5, 10.5); + + h_gem_hit_avg_per_part_ge11 = fs->make("h_gem_hit_avg_per_part_ge11", + (n_simhits+" Avg. #hits GE1/1 at PU=1;GE1/1 partition#;hits/part./BX").c_str(), 10, 0.5, 10.5); + + h_gem_total_partarea_ge11 = fs->make("h_gem_total_partarea_ge11", "GE1/1 total area per partition", 10, 0.5, 10.5); + for (int pdg=1; pdgGetXaxis()->GetNbins();i++) h_rpcb_clu_rate_per_ch->GetXaxis()->SetBinLabel(i,rpcb_type[i].c_str()); + h_rpcb_total_area = fs->make("h_rpcb_total_area", "RPCb total area per type", RPCB_TYPES, 0.5, RPCB_TYPES+0.5); + for (int pdg=1; pdgGetXaxis()->GetNbins();i++) h_dt_hit_rate_per_ch->GetXaxis()->SetBinLabel(i,dt_type[i].c_str()); + h_dt_total_area = fs->make("h_dt_total_area", "DT total area per type", DT_TYPES, 0.5, DT_TYPES+0.5); + for (int pdg=1; pdgmake(10); gr_gem_hit_flux_ge1->SetName("gr_gem_hit_flux_ge1"); - gr_gem_hit_flux_ge1->SetTitle("SimHit Flux in GE1;r, cm;Hz/cm^{2}"); + gr_gem_hit_flux_ge1->SetTitle("SimHit Flux in GE1;r, cm;Hz/pad"); + gr_gem_hit_padflux_ge1 = fs->make(10); + gr_gem_hit_padflux_ge1->SetName("gr_gem_hit_padflux_ge1"); + gr_gem_hit_padflux_ge1->SetTitle("SimHit Flux in GE1;r, cm;Hz/pad"); } // ================================================================================================ @@ -905,6 +945,12 @@ MuSimHitOccupancy::analyzeGEM() h_gem_hit_flux_per_layer->Fill(g_id.t); h_gem_hit_rate_per_ch->Fill(g_id.t); + if (t==1) + { + h_gem_hit_flux_per_partlayer_ge11->Fill(g_id.part); + h_gem_hit_avg_per_part_ge11->Fill(g_id.part); + } + if (idx > 0) h_gem_tof_vs_ekin[idx]->Fill( log10(g_h.eKin() * 1000.), log10(g_h.t) ); } @@ -1056,8 +1102,6 @@ MuSimHitOccupancy::analyzeRPC() // fill some histograms if (shid.region() == 0) { - //h_csc_rz_clu_heatmap->Fill(fabs(c_cl.gz), c_cl.r); - h_rpcb_clu_flux_per_layer->Fill(r_id.t); h_rpcb_clu_rate_per_ch->Fill(r_id.t); } @@ -1222,6 +1266,14 @@ void MuSimHitOccupancy::endJob() if (!input_is_neutrons_) f_full_bx = 1.; // bx rate 40 MHz double bxrate = 40000000.; + double scale; + + if (do_csc_) for (int t=0; t <= CSC_TYPES; t++) + { + h_csc_total_area->SetBinContent(t+1,areas_.csc_total_areas_cm2[t]); + } + h_csc_total_area->SetBinContent(0, evtn); // store it in underflow + h_csc_total_area->SetEntries(CSC_TYPES+2); h_csc_hit_flux_per_layer->Sumw2(); h_csc_hit_rate_per_ch->Sumw2(); @@ -1230,156 +1282,137 @@ void MuSimHitOccupancy::endJob() if (do_csc_) for (int t=1; t <= CSC_TYPES; t++) { // 2 endcaps , 6 layers - double scale = bxrate * n_pu * f_full_bx /areas_.csc_total_areas_cm2[t]/evtn; - double rt = scale * h_csc_hit_flux_per_layer->GetBinContent(t); - double er = scale * h_csc_hit_flux_per_layer->GetBinError(t); - h_csc_hit_flux_per_layer->SetBinContent(t, rt); - h_csc_hit_flux_per_layer->SetBinError(t, er); - - rt = scale * h_csc_clu_flux_per_layer->GetBinContent(t); - er = scale * h_csc_clu_flux_per_layer->GetBinError(t); - h_csc_clu_flux_per_layer->SetBinContent(t, rt); - h_csc_clu_flux_per_layer->SetBinError(t, er); + scale = bxrate * n_pu * f_full_bx /areas_.csc_total_areas_cm2[t]/evtn; + scaleOneBin(h_csc_hit_flux_per_layer, t, scale); + scaleOneBin(h_csc_clu_flux_per_layer, t, scale); scale = bxrate * n_pu * f_full_bx /csc_radial_segm[t]/2./evtn/1000.; - rt = scale * h_csc_hit_rate_per_ch->GetBinContent(t); - er = scale * h_csc_hit_rate_per_ch->GetBinError(t); - h_csc_hit_rate_per_ch->SetBinContent(t, rt); - h_csc_hit_rate_per_ch->SetBinError(t, er); + scaleOneBin(h_csc_hit_rate_per_ch, t, scale); + scaleOneBin(h_csc_clu_rate_per_ch, t, scale); + } + if (do_csc_) for (int i=0; i<4; i++) + { + gr_csc_hit_flux_me1->SetPoint(i, areas_.csc_ch_radius[i+1], h_csc_hit_flux_per_layer->GetBinContent(i+1) ); + gr_csc_hit_flux_me1->SetPointError(i, areas_.csc_ch_halfheight[i+1], h_csc_hit_flux_per_layer->GetBinError(i+1) ); + if (i>1) continue; + gr_csc_hit_flux_me2->SetPoint(i, areas_.csc_ch_radius[i+5], h_csc_hit_flux_per_layer->GetBinContent(i+5) ); + gr_csc_hit_flux_me3->SetPoint(i, areas_.csc_ch_radius[i+7], h_csc_hit_flux_per_layer->GetBinContent(i+7) ); + gr_csc_hit_flux_me4->SetPoint(i, areas_.csc_ch_radius[i+9], h_csc_hit_flux_per_layer->GetBinContent(i+9) ); + gr_csc_hit_flux_me2->SetPointError(i, areas_.csc_ch_halfheight[i+5], h_csc_hit_flux_per_layer->GetBinError(i+5) ); + gr_csc_hit_flux_me3->SetPointError(i, areas_.csc_ch_halfheight[i+7], h_csc_hit_flux_per_layer->GetBinError(i+7) ); + gr_csc_hit_flux_me4->SetPointError(i, areas_.csc_ch_halfheight[i+9], h_csc_hit_flux_per_layer->GetBinError(i+9) ); + } - rt = scale * h_csc_clu_rate_per_ch->GetBinContent(t); - er = scale * h_csc_clu_rate_per_ch->GetBinError(t); - h_csc_clu_rate_per_ch->SetBinContent(t, rt); - h_csc_clu_rate_per_ch->SetBinError(t, er); - for (int i=0; i<4; i++) - { - gr_csc_hit_flux_me1->SetPoint(i, areas_.csc_ch_radius[i+1], h_csc_hit_flux_per_layer->GetBinContent(i+1) ); - gr_csc_hit_flux_me1->SetPointError(i, areas_.csc_ch_halfheight[i+1], h_csc_hit_flux_per_layer->GetBinError(i+1) ); - if (i>1) continue; - gr_csc_hit_flux_me2->SetPoint(i, areas_.csc_ch_radius[i+5], h_csc_hit_flux_per_layer->GetBinContent(i+5) ); - gr_csc_hit_flux_me3->SetPoint(i, areas_.csc_ch_radius[i+7], h_csc_hit_flux_per_layer->GetBinContent(i+7) ); - gr_csc_hit_flux_me4->SetPoint(i, areas_.csc_ch_radius[i+9], h_csc_hit_flux_per_layer->GetBinContent(i+9) ); - gr_csc_hit_flux_me2->SetPointError(i, areas_.csc_ch_halfheight[i+5], h_csc_hit_flux_per_layer->GetBinError(i+5) ); - gr_csc_hit_flux_me3->SetPointError(i, areas_.csc_ch_halfheight[i+7], h_csc_hit_flux_per_layer->GetBinError(i+7) ); - gr_csc_hit_flux_me4->SetPointError(i, areas_.csc_ch_halfheight[i+9], h_csc_hit_flux_per_layer->GetBinError(i+9) ); - } + if (do_gem_) for (int t=0; t <= GEM_TYPES; t++) + { + h_gem_total_area->SetBinContent(t+1,areas_.gem_total_areas_cm2[t]); } - + h_gem_total_area->SetBinContent(0, evtn); // store it in underflow + h_gem_total_area->SetEntries(GEM_TYPES+2); h_gem_hit_flux_per_layer->Sumw2(); h_gem_hit_rate_per_ch->Sumw2(); if (do_gem_) for (int t=1; t<=GEM_TYPES; t++) { - double scale = bxrate * n_pu * f_full_bx /areas_.gem_total_areas_cm2[t]/evtn; - - double rt = scale * h_gem_hit_flux_per_layer->GetBinContent(t); - double er = scale * h_gem_hit_flux_per_layer->GetBinError(t); - h_gem_hit_flux_per_layer->SetBinContent(t,rt); - h_gem_hit_flux_per_layer->SetBinError(t,er); - - rt = scale * h_gem_clu_flux_per_layer->GetBinContent(t); - er = scale * h_gem_clu_flux_per_layer->GetBinError(t); - h_gem_clu_flux_per_layer->SetBinContent(t,rt); - h_gem_clu_flux_per_layer->SetBinError(t,er); + scale = bxrate * n_pu * f_full_bx /areas_.gem_total_areas_cm2[t]/evtn; + scaleOneBin(h_gem_hit_flux_per_layer, t, scale); + scaleOneBin(h_gem_clu_flux_per_layer, t, scale); scale = bxrate * n_pu * f_full_bx /gem_radial_segm[t]/2/evtn/1000; + scaleOneBin(h_gem_hit_rate_per_ch, t, scale); + scaleOneBin(h_gem_clu_rate_per_ch, t, scale); - rt = scale * h_gem_hit_rate_per_ch->GetBinContent(t); - er = scale * h_gem_hit_rate_per_ch->GetBinError(t); - h_gem_hit_rate_per_ch->SetBinContent(t,rt); - h_gem_hit_rate_per_ch->SetBinError(t,er); + scale = 1. /evtn /gem_radial_segm[t]/2./2.; // gem + scaleOneBin(h_gem_hit_avg_per_ch, t, scale); + } + + h_gem_hit_flux_per_partlayer_ge11->Sumw2(); + h_gem_hit_avg_per_part_ge11->Sumw2(); + if (do_gem_) + { + scale = bxrate * n_pu * f_full_bx /evtn /areas_.gem_total_part_areas_cm2[1]; + h_gem_hit_flux_per_partlayer_ge11->Scale(scale); - rt = scale * h_gem_clu_rate_per_ch->GetBinContent(t); - er = scale * h_gem_clu_rate_per_ch->GetBinError(t); - h_gem_clu_rate_per_ch->SetBinContent(t,rt); - h_gem_clu_rate_per_ch->SetBinError(t,er); + scale = 1. /evtn /gem_radial_segm[1]/2./2.; // gem + h_gem_hit_avg_per_part_ge11->Scale(scale); + } + if (do_gem_) for (int i=0; i<=10; i++) + { + gr_gem_hit_flux_ge1->SetPoint(i, areas_.gem_part_radius[i+1], h_gem_hit_flux_per_partlayer_ge11->GetBinContent(i+1) ); + gr_gem_hit_flux_ge1->SetPointError(i, areas_.gem_part_halfheight[i+1], h_gem_hit_flux_per_partlayer_ge11->GetBinError(i+1) ); } + if (do_rpc_) for (int t=0; t <= RPCF_TYPES; t++) + { + h_rpcf_total_area->SetBinContent(t+1, areas_.rpcf_total_areas_cm2[t]); + } + h_rpcf_total_area->SetBinContent(0, evtn); // store it in underflow + h_rpcf_total_area->SetEntries(RPCF_TYPES+2); + h_rpcf_hit_flux_per_layer->Sumw2(); h_rpcf_hit_rate_per_ch->Sumw2(); if (do_rpc_) for (int t=1; t<=RPCF_TYPES; t++) { - double scale = bxrate * n_pu * f_full_bx /areas_.rpcf_total_areas_cm2[t]/evtn; - double rt = scale * h_rpcf_hit_flux_per_layer->GetBinContent(t); - double er = scale * h_rpcf_hit_flux_per_layer->GetBinError(t); - h_rpcf_hit_flux_per_layer->SetBinContent(t,rt); - h_rpcf_hit_flux_per_layer->SetBinError(t,er); - - rt = scale * h_rpcf_clu_flux_per_layer->GetBinContent(t); - er = scale * h_rpcf_clu_flux_per_layer->GetBinError(t); - h_rpcf_clu_flux_per_layer->SetBinContent(t,rt); - h_rpcf_clu_flux_per_layer->SetBinError(t,er); + scale = bxrate * n_pu * f_full_bx /areas_.rpcf_total_areas_cm2[t]/evtn; + scaleOneBin(h_rpcf_hit_flux_per_layer, t, scale); + scaleOneBin(h_rpcf_clu_flux_per_layer, t, scale); scale = bxrate * n_pu * f_full_bx /rpcf_radial_segm[t]/2/evtn/1000; - rt = scale * h_rpcf_hit_rate_per_ch->GetBinContent(t); - er = scale * h_rpcf_hit_rate_per_ch->GetBinError(t); - h_rpcf_hit_rate_per_ch->SetBinContent(t,rt); - h_rpcf_hit_rate_per_ch->SetBinError(t,er); - - rt = scale * h_rpcf_clu_rate_per_ch->GetBinContent(t); - er = scale * h_rpcf_clu_rate_per_ch->GetBinError(t); - h_rpcf_clu_rate_per_ch->SetBinContent(t,rt); - h_rpcf_clu_rate_per_ch->SetBinError(t,er); + scaleOneBin(h_rpcf_hit_rate_per_ch, t, scale); + scaleOneBin(h_rpcf_clu_rate_per_ch, t, scale); } + if (do_rpc_) for (int t=0; t <= RPCB_TYPES; t++) + { + h_rpcb_total_area->SetBinContent(t+1, areas_.rpcb_total_areas_cm2[t]); + } + h_rpcb_total_area->SetBinContent(0, evtn); // store it in underflow + h_rpcb_total_area->SetEntries(RPCB_TYPES+2); + h_rpcb_hit_flux_per_layer->Sumw2(); if (do_rpc_) for (int t=1; t<=RPCB_TYPES; t++) { - double scale = bxrate * n_pu * f_full_bx /areas_.rpcb_total_areas_cm2[t]/evtn; - double rt = scale * h_rpcb_hit_flux_per_layer->GetBinContent(t); - double er = scale * h_rpcb_hit_flux_per_layer->GetBinError(t); - h_rpcb_hit_flux_per_layer->SetBinContent(t,rt); - h_rpcb_hit_flux_per_layer->SetBinError(t,er); - - rt = scale * h_rpcb_clu_flux_per_layer->GetBinContent(t); - er = scale * h_rpcb_clu_flux_per_layer->GetBinError(t); - h_rpcb_clu_flux_per_layer->SetBinContent(t,rt); - h_rpcb_clu_flux_per_layer->SetBinError(t,er); + scale = bxrate * n_pu * f_full_bx /areas_.rpcb_total_areas_cm2[t]/evtn; + scaleOneBin(h_rpcb_hit_flux_per_layer, t, scale); + scaleOneBin(h_rpcb_clu_flux_per_layer, t, scale); scale = bxrate * n_pu * f_full_bx /rpcb_radial_segm[t]/evtn/1000; - rt = scale * h_rpcb_hit_rate_per_ch->GetBinContent(t); - er = scale * h_rpcb_hit_rate_per_ch->GetBinError(t); - h_rpcb_hit_rate_per_ch->SetBinContent(t,rt); - h_rpcb_hit_rate_per_ch->SetBinError(t,er); - - rt = scale * h_rpcb_clu_rate_per_ch->GetBinContent(t); - er = scale * h_rpcb_clu_rate_per_ch->GetBinError(t); - h_rpcb_clu_rate_per_ch->SetBinContent(t,rt); - h_rpcb_clu_rate_per_ch->SetBinError(t,er); + scaleOneBin(h_rpcb_hit_rate_per_ch, t, scale); + scaleOneBin(h_rpcb_clu_rate_per_ch, t, scale); } + if (do_dt_) for (int t=0; t <= DT_TYPES; t++) + { + h_dt_total_area->SetBinContent(t+1, areas_.dt_total_areas_cm2[t]); + } + h_dt_total_area->SetBinContent(0, evtn); // store it in underflow + h_dt_total_area->SetEntries(DT_TYPES+2); + h_dt_hit_flux_per_layer->Sumw2(); h_dt_hit_rate_per_ch->Sumw2(); if (do_dt_) for (int t=1; t<=DT_TYPES; t++) { // 2 endcaps , 6 layers - double scale = bxrate * n_pu * f_full_bx /areas_.dt_total_areas_cm2[t] /evtn; - double rt = scale * h_dt_hit_flux_per_layer->GetBinContent(t); - double er = scale * h_dt_hit_flux_per_layer->GetBinError(t); - h_dt_hit_flux_per_layer->SetBinContent(t,rt); - h_dt_hit_flux_per_layer->SetBinError(t,er); + scale = bxrate * n_pu * f_full_bx /areas_.dt_total_areas_cm2[t] /evtn; + scaleOneBin(h_dt_hit_flux_per_layer, t, scale); scale = bxrate * n_pu * f_full_bx /dt_radial_segm[t]/evtn/1000.; - rt = scale * h_dt_hit_rate_per_ch->GetBinContent(t); - er = scale * h_dt_hit_rate_per_ch->GetBinError(t); - h_dt_hit_rate_per_ch->SetBinContent(t,rt); - h_dt_hit_rate_per_ch->SetBinError(t,er); - - for (int i=0; i<3; i++) - { - gr_dt_hit_flux_mb1->SetPoint(i, areas_.dt_ch_z[i+1], h_dt_hit_flux_per_layer->GetBinContent(i+1) ); - gr_dt_hit_flux_mb2->SetPoint(i, areas_.dt_ch_z[i+4], h_dt_hit_flux_per_layer->GetBinContent(i+4) ); - gr_dt_hit_flux_mb3->SetPoint(i, areas_.dt_ch_z[i+7], h_dt_hit_flux_per_layer->GetBinContent(i+7) ); - gr_dt_hit_flux_mb4->SetPoint(i, areas_.dt_ch_z[i+10], h_dt_hit_flux_per_layer->GetBinContent(i+10) ); - gr_dt_hit_flux_mb1->SetPointError(i, areas_.dt_ch_halfspanz[i+1], h_dt_hit_flux_per_layer->GetBinError(i+1) ); - gr_dt_hit_flux_mb2->SetPointError(i, areas_.dt_ch_halfspanz[i+4], h_dt_hit_flux_per_layer->GetBinError(i+4) ); - gr_dt_hit_flux_mb3->SetPointError(i, areas_.dt_ch_halfspanz[i+7], h_dt_hit_flux_per_layer->GetBinError(i+7) ); - gr_dt_hit_flux_mb4->SetPointError(i, areas_.dt_ch_halfspanz[i+10], h_dt_hit_flux_per_layer->GetBinError(i+10) ); - } + scaleOneBin(h_dt_hit_rate_per_ch, t, scale); + } + if (do_dt_) for (int i=0; i<3; i++) + { + gr_dt_hit_flux_mb1->SetPoint(i, areas_.dt_ch_z[i+1], h_dt_hit_flux_per_layer->GetBinContent(i+1) ); + gr_dt_hit_flux_mb2->SetPoint(i, areas_.dt_ch_z[i+4], h_dt_hit_flux_per_layer->GetBinContent(i+4) ); + gr_dt_hit_flux_mb3->SetPoint(i, areas_.dt_ch_z[i+7], h_dt_hit_flux_per_layer->GetBinContent(i+7) ); + gr_dt_hit_flux_mb4->SetPoint(i, areas_.dt_ch_z[i+10], h_dt_hit_flux_per_layer->GetBinContent(i+10) ); + gr_dt_hit_flux_mb1->SetPointError(i, areas_.dt_ch_halfspanz[i+1], h_dt_hit_flux_per_layer->GetBinError(i+1) ); + gr_dt_hit_flux_mb2->SetPointError(i, areas_.dt_ch_halfspanz[i+4], h_dt_hit_flux_per_layer->GetBinError(i+4) ); + gr_dt_hit_flux_mb3->SetPointError(i, areas_.dt_ch_halfspanz[i+7], h_dt_hit_flux_per_layer->GetBinError(i+7) ); + gr_dt_hit_flux_mb4->SetPointError(i, areas_.dt_ch_halfspanz[i+10], h_dt_hit_flux_per_layer->GetBinError(i+10) ); } } From e413355d6fd1e92083aadfa00f8285a3243db215 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 14 Aug 2013 00:27:04 +0200 Subject: [PATCH 080/182] clean-up of plots --- SimMuL1/scripts/drawplot_eff.py | 13 +- SimMuL1/scripts/plotGEMCSCdPhi.py | 29 +- .../produceRateVsEtaPlotsForApproval.C | 1076 ++++------------- .../scripts/produceRateVsPtPlotsForApproval.C | 101 +- 4 files changed, 274 insertions(+), 945 deletions(-) diff --git a/SimMuL1/scripts/drawplot_eff.py b/SimMuL1/scripts/drawplot_eff.py index 52fe0638302a8..d6a5a9acc9f50 100644 --- a/SimMuL1/scripts/drawplot_eff.py +++ b/SimMuL1/scripts/drawplot_eff.py @@ -326,17 +326,18 @@ def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): ## add legend ## leg_header = " #Delta#phi(GEM,CSC) is %s%% efficient for"%(eff) ## leg.AddEntry(0, "%s chambers at pt"%(oddEven), "") - leg = TLegend(0.37,0.15,.82,0.5, "", "brNDC") + leg = TLegend(0.37,0.15,.93,0.6, "", "brNDC") leg_header = " " leg.AddEntry(0, 'High efficiency patterns:', "") for n in range(len(pt)): - leg.AddEntry(histoList[n], "#Delta#Phi(GEM-CSC)#geq%.4f (p_{T}>%s)"%(dphis[n],pt_labels[n]), "p") + leg.AddEntry(histoList[n], "|#Delta#Phi_{(GEM,CSC)}|<%.4f (p_{T}^{th}>%s)"%(dphis[n],pt_labels[n]), "p") leg.SetBorderSize(0) + leg.SetMargin(0.1) leg.SetFillStyle(0) - ## leg.SetFillStyle(1001) - ## leg.SetFillColor(kWhite) + leg.SetFillStyle(1001) + leg.SetFillColor(kWhite) leg.SetHeader(leg_header) - leg.SetTextSize(0.04) + leg.SetTextSize(0.05) leg.Draw("same") ## Adding additional information - top right @@ -354,7 +355,7 @@ def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): if closeFar == "Close": xpos = 0.57 else: - xpos = 0.62 + xpos = 0.61 tex = TLatex(xpos,.68,'"%s" chamber pairs'%(closeFar)) tex.Draw("same") diff --git a/SimMuL1/scripts/plotGEMCSCdPhi.py b/SimMuL1/scripts/plotGEMCSCdPhi.py index 0d0a251a5f6a8..85864aeb73f2c 100644 --- a/SimMuL1/scripts/plotGEMCSCdPhi.py +++ b/SimMuL1/scripts/plotGEMCSCdPhi.py @@ -42,8 +42,8 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): c = TCanvas("c","c",700,450); c.Clear() - c.SetGridx(1) - c.SetGridy(1) + ## c.SetGridx(1) + ## c.SetGridy(1) gStyle.SetTitleStyle(0) gStyle.SetTitleAlign(13) ##// coord in top left @@ -101,38 +101,27 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): legend.Draw("same"); ## Adding additional information - top right - tex2 = TLatex(.75,.87,' L1 Trigger') - tex2.SetTextSize(0.05) + tex2 = TLatex(.73,.85,' L1 Trigger') + tex2.SetTextSize(0.06) tex2.SetNDC() tex2.Draw("same") - tex3 = TLatex(.74,.80,'1.64<|#eta|<2.14') - tex3.SetTextSize(0.05) + tex3 = TLatex(.72,.75,'1.64<|#eta|<2.14') + tex3.SetTextSize(0.06) tex3.SetNDC() tex3.Draw("same") ## hardcore nitpicking over here! if closeFar == "Close": - xpos = 0.61 + xpos = 0.22##0.61 else: - xpos = 0.64 + xpos = 0.25##0.64 - tex = TLatex(xpos,.74,'"%s" chamber pairs'%(closeFar)) + tex = TLatex(xpos,.85,'"%s" chamber pairs'%(closeFar)) tex.Draw("same") - tex.SetTextSize(0.05) - tex.SetNDC() - - """ - tex = TLatex(.55,.85,'"%s" chamber pairs'%(closeFar)) tex.SetTextSize(0.06) tex.SetNDC() - tex.Draw("same") - tex2 = TLatex(.22,.85,' L1 Trigger') - tex2.SetTextSize(0.06) - tex2.SetNDC() - tex2.Draw("same") - """ c.SaveAs("%sGEMCSCdPhi_%s_chambers%s"%(plotDir, oddEven, ext)) if __name__ == "__main__": diff --git a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C b/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C index f4915d97c10a2..c09ebe747e744 100644 --- a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C +++ b/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C @@ -8,7 +8,7 @@ int gNEvt=238000; //int gNEvt=128000; float gdy[2]={0.1,2500}; -TLatex* drawLumiLabel2(float x=0.2, float y=0.35) +TLatex* drawLumiLabel2(float x=0.2, float y=0.4) { TLatex * tex = new TLatex(x, y,"L = 4*10^{34} cm^{-2} s^{-1}"); tex->SetTextSize(0.05); @@ -28,7 +28,6 @@ TLatex* drawPULabel(float x=0.17, float y=0.15, float font_size=0.) TH1D* setHistoEta(TString f_name, char *name, char *cname, char *title, Color_t lcolor, int lstyle, int lwidth) -//double *x_range, double *y_range) { cout<<"opening "<Clone(s_name+cname); h->SetTitle(title); - h->Sumw2(); h->Scale(40000./gNEvt/3.*0.795); - h->SetLineColor(lcolor); //h->SetFillColor(lcolor); h->SetLineStyle(lstyle); h->SetLineWidth(lwidth); - h->SetTitle(title); - //h->GetXaxis()->SetRangeUser(1.2, 2.4); h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); - h->GetXaxis()->SetTitleSize(0.055); h->GetXaxis()->SetTitleOffset(1.05); h->GetXaxis()->SetLabelSize(0.045); @@ -60,16 +54,12 @@ TH1D* setHistoEta(TString f_name, char *name, char *cname, char *title, h->GetXaxis()->SetTitleFont(62); h->GetXaxis()->SetLabelFont(62); h->GetXaxis()->SetMoreLogLabels(1); - h->GetYaxis()->SetTitleSize(0.055); h->GetYaxis()->SetTitleOffset(0.9); h->GetYaxis()->SetLabelSize(0.045); h->GetYaxis()->SetTitleFont(62); h->GetYaxis()->SetLabelFont(62); - //h->GetYaxis()->SetLabelOffset(0.015); - - gh = h; return h; } @@ -102,82 +92,255 @@ TH1D* setHistoRatio(TH1D* num, TH1D* denom, TString title = "", double ymin=0.4, ratio = (TH1D*) num->Clone(Form("%s--%s_ratio",num->GetName(),denom->GetName()) ); ratio->Divide(num, denom, 1., 1.); ratio->SetTitle(title); - ratio->GetYaxis()->SetRangeUser(ymin, ymax); ratio->GetYaxis()->SetTitle("ratio: (with GEM)/default"); ratio->GetYaxis()->SetTitle("ratio"); - // ratio->GetYaxis()->SetTitle("(ME1/b + GEM) / ME1/b"); + //ratio->GetYaxis()->SetTitle("(ME1/b + GEM) / ME1/b"); ratio->GetYaxis()->SetTitleSize(.14); - // ratio->GetYaxis()->SetTitleSize(.1); + //ratio->GetYaxis()->SetTitleSize(.1); ratio->GetYaxis()->SetTitleOffset(0.4); ratio->GetYaxis()->SetLabelSize(.11); - //ratio->GetXaxis()->SetMoreLogLabels(1); - // ratio->GetXaxis()->SetTitle("track #eta"); + //ratio->GetXaxis()->SetTitle("track #eta"); ratio->GetXaxis()->SetLabelSize(.11); ratio->GetXaxis()->SetTitleSize(.14); ratio->GetXaxis()->SetTitleOffset(1.); - ratio->SetLineWidth(2); ratio->SetFillColor(color); ratio->SetLineColor(color); ratio->SetMarkerColor(color); ratio->SetMarkerStyle(20); - //ratio->Draw("e3"); - ratio->SetLineColor(color); ratio->SetMarkerColor(color); - + //ratio->Draw("e3"); return ratio; } -/* -void gem_rate_draw() + +void addRatioPlotLegend(TH1* h) { + TLegend* leg = new TLegend(0.17,0.4,.47,0.5,NULL,"brNDC"); + leg->SetMargin(0.1); + leg->SetBorderSize(0); + leg->SetTextSize(0.1); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(h, "GEM+CSC/CSC tight","P"); + leg->Draw("same"); +} - // //======================== 3+ Stubs ================================// +void addRatePlotLegend(TH1* h, TH1* i, TH1* j, TString k, TString l) +{ + TLegend *leg = new TLegend(0.16,0.67,.8,0.9,"L1 Selections (#geq" + k + " stations, L1 candidate p_{T}#geq" + l + " GeV/c):","brNDC"); + leg->SetMargin(0.20); + leg->SetBorderSize(0); + leg->SetTextSize(0.04); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(h,"CSC, loose","f"); + leg->AddEntry(i,"CSC, tight","f"); + leg->AddEntry(j,"GEM+CSC Integrated Trigger","f"); + leg->Draw("same"); +} +void addRatePlots(TH1* h, TH1* i, TH1* j, Color_t col1, Color_t col2, Color_t col3, + Style_t sty1, Style_t sty2, Style_t sty3, Style_t sty4, int miny, int maxy) +{ + h->SetFillColor(col1); + i->SetFillColor(col2); + j->SetFillColor(col3); + + h->SetFillStyle(sty1); + i->SetFillStyle(sty2); + j->SetFillStyle(sty3); + + h->GetYaxis()->SetRangeUser(miny,maxy); + i->GetYaxis()->SetRangeUser(miny,maxy); + j->GetYaxis()->SetRangeUser(miny,maxy); + + TH1* i_clone = i->Clone("i_clone"); + TH1* j_clone = j->Clone("j_clone"); + TH1* i_clone2 = i->Clone("i_clone2"); + TH1* j_clone2 = j->Clone("j_clone2"); + + for (int ii=0; ii<=14; ++ii){ + i_clone2->SetBinContent(ii,0); + j_clone2->SetBinContent(ii,0); + i_clone2->SetBinError(ii,0); + j_clone2->SetBinError(ii,0); + } + for (int ii=26; ii<=34; ++ii){ + i_clone2->SetBinContent(ii,0); + j_clone2->SetBinContent(ii,0); + i_clone2->SetBinError(ii,0); + j_clone2->SetBinError(ii,0); + + } + + for (int ii=15; ii<=25; ++ii){ + i_clone->SetBinContent(ii,0); + j_clone->SetBinContent(ii,0); + i_clone->SetBinError(ii,0); + j_clone->SetBinError(ii,0); + } + + j_clone->SetFillStyle(sty4); - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + i_clone->Draw("hist e1 same"); + j_clone->Draw("hist e1 same"); + h->Draw("hist e1 same"); + i_clone2->Draw("hist e1 same"); + j_clone2->Draw("hist e1 same"); +} - maxy = 30.;//10; - // h_rt_tf20_3s->GetYaxis()->SetRangeUser(miny,maxy); - // h_rt_tf20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - // h_rt_tf20_gpt20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); +void setPad1Attributes(TPad* pad1) +{ + pad1->SetGridx(1); + pad1->SetGridy(1); + pad1->SetFrameBorderMode(0); + pad1->SetFillColor(kWhite); + pad1->SetTopMargin(0.06); + pad1->SetBottomMargin(0.13); +} - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // h_rt_tf20_3s->Draw("hist e1"); - // h_rt_tf20_gpt20_3s1b->Draw("hist e1 same"); - // h_rt_tf20_3s->Draw("hist e1 same"); - // h_rt_tf20_3s1b->Draw("hist e1 same"); +void setPad2Attributes(TPad* pad2) +{ + pad2->SetLogy(1); + pad2->SetGridx(1); + pad2->SetGridy(1); + pad2->SetFillColor(kWhite); + pad2->SetFrameBorderMode(0); + pad2->SetTopMargin(0.06); + pad2->SetBottomMargin(0.3); +} - // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); - // leg->AddEntry(h_rt_tf20_3s,"anywhere","l"); - // leg->AddEntry(h_rt_tf20_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - // leg->AddEntry(h_rt_tf20_gpt20_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - // leg->Draw(); +void produceRateVsEtaPlot(TH1D* h, TH1D* i, TH1D* j, Color_t col1, Color_t col2, Color_t col3, + Style_t sty1, Style_t sty2, Style_t sty3, Style_t sty4, int miny, int maxy, + TString k, TString l, TString plots, TString ext) +{ + TCanvas* c = new TCanvas("c","c",800,800); + c->Clear(); + TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); + pad1->Draw(); + TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); + pad2->Draw(); + + pad1->cd(); + setPad1Attributes(pad1); + addRatePlots(h,i,j,col1,col2,col3,sty1,sty2,sty3,3355,miny,maxy); + addRatePlotLegend(h, i, j, k,l); + drawLumiLabel2(); + + pad2->cd(); + setPad2Attributes(pad2); + TH1D* gem_ratio = setHistoRatio(j, i, "", 0.01,2.0, col2); + gem_ratio->Draw("Pe"); + addRatioPlotLegend(gem_ratio); + + c->SaveAs(plots + "rates_vs_eta__minpt" + l + "__PU100__def_" + k + "s_" + k + "s1b_" + k + "s1bgem" + ext); +} - // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // tex->SetNDC(); - // tex->Draw(); +void produceRateVsEtaPlotsForApproval() +{ + gStyle->SetOptStat(0); + gStyle->SetTitleStyle(0); + // //gStyle->SetPadTopMargin(0.08); + // gStyle->SetTitleH(0.06); - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); + // input files + TString f_def = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; + TString f_g98_pt10 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt10_pat2.root"; + TString f_g98_pt15 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt15_pat2.root"; + TString f_g98_pt20 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt20_pat2.root"; + TString f_g98_pt30 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat2.root"; + TString f_g98_pt40 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat2.root"; - // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); + // general stuff + TString hdir = "SimMuL1StrictAll"; + TString ext = ".pdf"; + TString plots = "plots/rate_vs_eta/"; - // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1b, h_rt_tf20_3s1b, "", 0.,1.8); - // gem_ratio->Draw("e1"); + // colors - same colors as for rate vs pt plots!! + Color_t col1 = kViolet+1; + Color_t col2 = kAzure+2; + Color_t col3 = kGreen-2; + + // styles + Style_t sty1 = 3345; + Style_t sty2 = 2003; + Style_t sty3 = 2002; + + // Declaration of histograms + TString vs_eta_minpt = "10"; + TString ttl = " L1 Single Muon Trigger CMS Simulation;L1 muon candidate #eta;rate [kHz]"; + TH1D* h_rt_tf10_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); + TH1D* h_rt_tf10_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); + TH1D* h_rt_tf10_gpt10_2s1b = setHistoEta(f_g98_pt10, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); + + TH1D* h_rt_tf10_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2); + TH1D* h_rt_tf10_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2); + TH1D* h_rt_tf10_gpt10_3s1b = setHistoEta(f_g98_pt10, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 7, 2); + + TString vs_eta_minpt = "20"; + TH1D* h_rt_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); + TH1D* h_rt_tf20_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); + TH1D* h_rt_tf20_gpt20_2s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); + TH1D* h_rt_tf20_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2); + TH1D* h_rt_tf20_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2); + TH1D* h_rt_tf20_gpt20_3s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 1, 2); + + TString vs_eta_minpt = "30"; + TH1D* h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); + TH1D* h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); + TH1D* h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); + TH1D* h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2); + TH1D* h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2); + TH1D* h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 1, 2); - // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); + // Style + gStyle->SetStatW(0.07); + gStyle->SetStatH(0.06); + gStyle->SetOptStat(0); + gStyle->SetTitleStyle(0); + gStyle->SetTitleAlign(13);// coord in top left + gStyle->SetTitleX(0.); + gStyle->SetTitleY(1.); + gStyle->SetTitleW(1); + gStyle->SetTitleH(0.058); + gStyle->SetTitleBorderSize(0); + + // producing the histograms + float miny = 0.01, maxy; + + // ------------ +2 stubs, L1 candidate muon pt=10GeV ----------------// + produceRateVsEtaPlot(h_rt_tf10_2s,h_rt_tf10_2s1b,h_rt_tf10_gpt10_2s1b, + col1,col2,col3,sty1,sty2,sty3,3355,miny,80,"2","10",plots,ext); + // ------------ +2 stubs, L1 candidate muon pt=20GeV ----------------// + produceRateVsEtaPlot(h_rt_tf20_2s,h_rt_tf20_2s1b,h_rt_tf20_gpt20_2s1b, + col1,col2,col3,sty1,sty2,sty3,3355,miny,40,"2","20",plots,ext); + // ------------ +2 stubs, L1 candidate muon pt=30GeV ----------------// + produceRateVsEtaPlot(h_rt_tf30_2s,h_rt_tf30_2s1b,h_rt_tf30_gpt30_2s1b, + col1,col2,col3,sty1,sty2,sty3,3355,miny,30,"2","30",plots,ext); + // ------------ +3 stubs, L1 candidate muon pt=10GeV ----------------// + produceRateVsEtaPlot(h_rt_tf10_3s,h_rt_tf10_3s1b,h_rt_tf10_gpt10_3s1b, + col1,col2,col3,sty1,sty2,sty3,3355,miny,25,"3","10",plots,ext); + // ------------ +3 stubs, L1 candidate muon pt=20GeV ----------------// + produceRateVsEtaPlot(h_rt_tf20_3s,h_rt_tf20_3s1b,h_rt_tf20_gpt20_3s1b, + col1,col2,col3,sty1,sty2,sty3,3355,miny,10,"3","20",plots,ext); + // ------------ +3 stubs, L1 candidate muon pt=30GeV ----------------// + produceRateVsEtaPlot(h_rt_tf30_3s,h_rt_tf30_3s1b,h_rt_tf30_gpt30_3s1b, + col1,col2,col3,sty1,sty2,sty3,3355,miny,6,"3","30",plots,ext); +} +/* +void gem_rate_draw() +{ + -- KEEP THIS FRAGMENT FOR THE TIME BEING!! -- + -- NEED TO FIGURE OUT WHAT TO DO WITH ME1A -- // // Including the region ME1/1a @@ -222,16 +385,13 @@ void gem_rate_draw() vs_eta_minpt = "30"; - ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; + ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate [kHz]"; - - // TH1D* h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); - // TH1D* h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); - // TH1D* h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); - - + + TH1D* h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); + TH1D* h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); + TH1D* h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); TH1D* h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); - TH1D* h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); TH1D* h_rt_tf30_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kAzure+2, 1, 2); TH1D* h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); @@ -239,86 +399,6 @@ void gem_rate_draw() - // // maxy = 120.;//35.; - // // h_rt_tf30_2s->GetYaxis()->SetRangeUser(miny,maxy); - // // h_rt_tf30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - // // h_rt_tf30_gpt30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - - - // TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - // cAll100->SetLogy(1); - // // h_rt_tf30_2s->Draw("hist e1"); - // // h_rt_tf30_gpt30_2s1b->Draw("hist e1 same"); - // // h_rt_tf30_2s->Draw("hist e1 same"); - // // h_rt_tf30_2s1b->Draw("hist e1 same"); - - // // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); - // // leg->SetBorderSize(0); - // // leg->SetFillStyle(0); - // // leg->AddEntry(h_rt_tf30_2s,"Tracks: p_{T}>=30, 2+ stubs",""); - // // leg->AddEntry(h_rt_tf30_2s,"anywhere","l"); - // // leg->AddEntry(h_rt_tf30_2s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - // // leg->AddEntry(h_rt_tf30_gpt30_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - // // leg->Draw(); - - // // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // // tex->SetNDC(); - // // tex->Draw(); - - // // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); - - - // // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - // // gPad->SetGridx(1);gPad->SetGridy(1); - - // // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_2s1b, h_rt_tf30_2s1b, "", 0.,1.8); - // // gem_ratio->Draw("e1"); - - // // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b__ratio.png").Data()); - - - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - - // maxy = 30.;//7.; - // h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); - // h_rt_tf30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - // h_rt_tf30_gpt30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // h_rt_tf30_3s->Draw("hist e1"); - // h_rt_tf30_gpt30_3s1b->Draw("hist e1 same"); - // h_rt_tf30_3s->Draw("hist e1 same"); - // h_rt_tf30_3s1b->Draw("hist e1 same"); - - // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); - // leg->AddEntry(h_rt_tf30_3s,"anywhere","l"); - // leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - // leg->AddEntry(h_rt_tf30_gpt30_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - // leg->Draw(); - - // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // tex->SetNDC(); - // tex->Draw(); - - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); - - - - - // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); - - // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1b, h_rt_tf30_3s1b, "", 0.,1.8); - // gem_ratio->Draw("e1"); - - // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); - - - // //========================== Including the ME1a @@ -405,725 +485,5 @@ void gem_rate_draw() Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); - - - - - //#################################### PU100 #################################### - - // full eta 1. - 2.4 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b - if (vs_eta) - { - gdy[0]=0; gdy[1]=7.; - if (vs_eta_minpt=="20") gdy[1]=10.; - - TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; - hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100", ttl, kAzure+9, 1, 2); - hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - - //gStyle->SetPadTopMargin(0.08); - gStyle->SetTitleH(0.06); - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - hAll100->Draw("hist e1"); - hAll100gem->Draw("hist e1 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","l"); - leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); - leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); - leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); - leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-2s1b__gem-3s-2s1b.png").Data()); - - if (do_return) return; - } - - - - // full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b - if (vs_eta) - { - gdy[0]=0; gdy[1]=7.; - if (vs_eta_minpt=="20") gdy[1]=10.; - - TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; - hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+9, 1, 2); - hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - - //gStyle->SetPadTopMargin(0.08); - gStyle->SetTitleH(0.06); - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - hAll100->Draw("hist e1"); - hAll100gem->Draw("hist e1 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","l"); - leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); - leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); - leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100->AddEntry(hAll100,"in ME1/b region also require",""); - leg_cc100->AddEntry(hAll100,"one stub to be from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); - - if (do_return) return; - } - - // full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b - if (vs_eta) - { - gdy[0]=0; gdy[1]=7.; - if (vs_eta_minpt=="20") gdy[1]=10.; - - TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; - hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); - hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - - //gStyle->SetPadTopMargin(0.08); - gStyle->SetTitleH(0.06); - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - hAll100->Draw("hist e1"); - hAll100gem->Draw("hist e1 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","l"); - leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); - leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); - leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-2s1b.png").Data()); - - if (do_return) return; - } - - - // full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b - if (vs_eta) - { - gdy[0]=0; gdy[1]=7.; - if (vs_eta_minpt=="20") gdy[1]=10.; - - TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; - hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); - hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - - //gStyle->SetPadTopMargin(0.08); - gStyle->SetTitleH(0.06); - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - hAll100->Draw("hist e1"); - hAll100gem->Draw("hist e1 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","l"); - leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); - leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100->AddEntry(hAll100,"in ME1/b region also require",""); - leg_cc100->AddEntry(hAll100,"one stub to be from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-3s1b.png").Data()); - - if (do_return) return; - } - - return; } */ - -void produceRateVsEtaPlotsForApproval() -{ - gStyle->SetOptStat(0); - gStyle->SetTitleStyle(0); - // //gStyle->SetPadTopMargin(0.08); - // gStyle->SetTitleH(0.06); - - // input files - - TString f_def = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; - TString f_g98_pt10 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt10_pat2.root"; - TString f_g98_pt15 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt15_pat2.root"; - TString f_g98_pt20 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt20_pat2.root"; - TString f_g98_pt30 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat2.root"; - TString f_g98_pt40 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat2.root"; - - TString hdir = "SimMuL1StrictAll"; - - // general stuff - - TString ext = ".pdf"; - TString plots = "plots/rate_vs_eta/"; - - // colors - same colors as for rate vs eta plots!! - Color_t col1 = kViolet+1; - Color_t col2 = kAzure+2; - Color_t col3 = kGreen-2; - - // Declaration of histograms - TString vs_eta_minpt = "10"; - TString ttl = " L1 Single Muon Trigger CMS Simulation;L1 muon candidate #eta;rate/bin [kHz]"; - TH1D* h_rt_tf10_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); - TH1D* h_rt_tf10_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); - TH1D* h_rt_tf10_gpt10_2s1b = setHistoEta(f_g98_pt10, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); - TH1D* h_rt_tf10_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2); - TH1D* h_rt_tf10_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2); - TH1D* h_rt_tf10_gpt10_3s1b = setHistoEta(f_g98_pt10, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 7, 2); - - /* - TString vs_eta_minpt = "15"; - TH1D* h_rt_tf15_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); - TH1D* h_rt_tf15_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); - TH1D* h_rt_tf15_gpt15_2s1b = setHistoEta(f_g98_pt15, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); - TH1D* h_rt_tf15_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2); - TH1D* h_rt_tf15_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2); - TH1D* h_rt_tf15_gpt15_3s1b = setHistoEta(f_g98_pt15, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 1, 2); - */ - - TString vs_eta_minpt = "20"; - TH1D* h_rt_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); - TH1D* h_rt_tf20_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); - TH1D* h_rt_tf20_gpt20_2s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); - TH1D* h_rt_tf20_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2); - TH1D* h_rt_tf20_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2); - TH1D* h_rt_tf20_gpt20_3s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 1, 2); - - TString vs_eta_minpt = "30"; - TH1D* h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); - TH1D* h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); - TH1D* h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); - TH1D* h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2); - TH1D* h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2); - TH1D* h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 1, 2); - - /* - TString vs_eta_minpt = "40"; - TH1D* h_rt_tf40_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); - TH1D* h_rt_tf40_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); - TH1D* h_rt_tf40_gpt40_2s1b = setHistoEta(f_g98_pt40, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); - TH1D* h_rt_tf40_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2); - TH1D* h_rt_tf40_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2); - TH1D* h_rt_tf40_gpt40_3s1b = setHistoEta(f_g98_pt40, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 1, 2); - */ - - - // Style - gStyle->SetStatW(0.07); - gStyle->SetStatH(0.06); - - gStyle->SetOptStat(0); - - gStyle->SetTitleStyle(0); - gStyle->SetTitleAlign(13);// coord in top left - gStyle->SetTitleX(0.); - gStyle->SetTitleY(1.); - gStyle->SetTitleW(1); - gStyle->SetTitleH(0.058); - gStyle->SetTitleBorderSize(0); - - // producing the histograms - float miny = 0.01, maxy; - - // ------------ +2 stubs, L1 candidate muon pt=10GeV ----------------// - vs_eta_minpt = "10"; - - { - TCanvas* c = new TCanvas("c","c",800,800); - c->Clear(); - TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); - pad1->Draw(); - TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); - pad2->Draw(); - - pad1->cd(); - //pad1->SetLogy(1); - pad1->SetGridx(1); - pad1->SetGridy(1); - pad1->SetFrameBorderMode(0); - pad1->SetFillColor(kWhite); - pad1->SetTopMargin(0.06); - pad1->SetBottomMargin(0.13); - - h_rt_tf10_2s->Draw("hist e1"); - h_rt_tf10_2s1b->Draw("hist e1 same"); - h_rt_tf10_gpt10_2s1b->Draw("hist e1 same"); - //h_rt_tf10_2s1b->Draw("hist e1 same"); - // h_rt_tf10_2s->Draw("hist e1 same "); - - h_rt_tf10_2s->SetFillColor(col1); - h_rt_tf10_2s1b->SetFillColor(col2); - h_rt_tf10_gpt10_2s1b->SetFillColor(col3); - - h_rt_tf10_2s->SetFillStyle(3345); - h_rt_tf10_2s1b->SetFillStyle(3354); - h_rt_tf10_gpt10_2s1b->SetFillStyle(3344); - - maxy = 80; - h_rt_tf10_2s->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf10_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf10_gpt10_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - - TLegend *leg = new TLegend(0.16,0.67,.8,0.87,"L1 Selections (#geq2 stations, L1 candidate p_{T}#geq20 GeV/c):","brNDC"); - leg->SetBorderSize(0); - leg->SetMargin(0.2); - leg->SetTextSize(0.04); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(h_rt_tf10_2s,"L1 Selections:",""); - // leg->AddEntry((TObject*)0,"(#geq2 stations, L1 candidate muon p_{T}#geq10 GeV/c)",""); - leg->AddEntry(h_rt_tf10_2s,"CSC, loose","f"); - leg->AddEntry(h_rt_tf10_2s1b,"CSC, tight","f"); - leg->AddEntry(h_rt_tf10_gpt10_2s1b,"GEM+CSC Integrated Trigger","f"); - leg->Draw(); - - drawLumiLabel2(); - - pad2->cd(); - pad2->SetLogy(1); - pad2->SetGridx(1); - pad2->SetGridy(1); - pad2->SetFillColor(kWhite); - pad2->SetFrameBorderMode(0); - pad2->SetTopMargin(0.06); - pad2->SetBottomMargin(0.3); - - gem_ratio = setHistoRatio(h_rt_tf10_gpt10_2s1b, h_rt_tf10_2s1b, "", 0.01,2.0, col2); - gem_ratio->Draw("Pe"); - - leg = new TLegend(0.2,0.33,.5,0.45,NULL,"brNDC"); - leg->SetMargin(0.1); - leg->SetBorderSize(0); - leg->SetTextSize(0.1); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(gem_ratio, "GEM+CSC/CSC tight","P"); - leg->Draw("same"); - - c->SaveAs(plots + "rates_vs_eta__minpt" + vs_eta_minpt + "__PU100__def_2s_2s1b_2s1bgem" + ext); - } - - - // ------------ +2 stubs, L1 candidate muon pt=20GeV ----------------// - vs_eta_minpt = "20"; - - { - TCanvas* c = new TCanvas("c","c",800,800); - c->Clear(); - TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); - pad1->Draw(); - TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); - pad2->Draw(); - - pad1->cd(); - //pad1->SetLogy(1); - pad1->SetGridx(1); - pad1->SetGridy(1); - pad1->SetFrameBorderMode(0); - pad1->SetFillColor(kWhite); - pad1->SetTopMargin(0.06); - pad1->SetBottomMargin(0.13); - - h_rt_tf20_2s->Draw("hist e1"); - h_rt_tf20_2s1b->Draw("hist e1 same"); - h_rt_tf20_gpt20_2s1b->Draw("hist e1 same"); - //h_rt_tf20_2s1b->Draw("hist e1 same"); - // h_rt_tf20_2s->Draw("hist e1 same "); - - h_rt_tf20_2s->SetFillColor(col1); - h_rt_tf20_2s1b->SetFillColor(col2); - h_rt_tf20_gpt20_2s1b->SetFillColor(col3); - - h_rt_tf20_2s->SetFillStyle(3345); - h_rt_tf20_2s1b->SetFillStyle(3354); - h_rt_tf20_gpt20_2s1b->SetFillStyle(3344); - - maxy = 40; - h_rt_tf20_2s->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf20_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf20_gpt20_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - - TLegend *leg = new TLegend(0.16,0.67,.8,0.87,"L1 Selections (#geq2 stations, L1 candidate p_{T}#geq20 GeV/c):","brNDC"); - leg->SetMargin(0.2); - leg->SetBorderSize(0); - leg->SetTextSize(0.04); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - // leg->AddEntry(h_rt_tf20_2s,"L1 Selections:",""); - // leg->AddEntry((TObject*)0,"()",""); - // leg->AddEntry((TObject*)0,"()",""); - leg->AddEntry(h_rt_tf20_2s,"CSC, loose","f"); - leg->AddEntry(h_rt_tf20_2s1b,"CSC, tight","f"); - leg->AddEntry(h_rt_tf20_gpt20_2s1b,"GEM+CSC Integrated Trigger","f"); - leg->Draw(); - - drawLumiLabel2(); - - pad2->cd(); - pad2->SetLogy(1); - pad2->SetGridx(1); - pad2->SetGridy(1); - pad2->SetFillColor(kWhite); - pad2->SetFrameBorderMode(0); - pad2->SetTopMargin(0.06); - pad2->SetBottomMargin(0.3); - - gem_ratio = setHistoRatio(h_rt_tf20_gpt20_2s1b, h_rt_tf20_2s1b, "", 0.01,2.0, col2); - gem_ratio->Draw("Pe"); - - leg = new TLegend(0.16,0.4,.5,0.55,NULL,"brNDC"); - leg->SetMargin(0.1); - leg->SetBorderSize(0); - leg->SetTextSize(0.1); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(gem_ratio, "GEM+CSC/CSC tight","P"); - leg->Draw("same"); - - c->SaveAs(plots + "rates_vs_eta__minpt" + vs_eta_minpt + "__PU100__def_2s_2s1b_2s1bgem" + ext); - } - - // ------------ +2 stubs, L1 candidate muon pt=30GeV ----------------// - vs_eta_minpt = "30"; - - { - TCanvas* c = new TCanvas("c","c",800,800); - c->Clear(); - TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); - pad1->Draw(); - TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); - pad2->Draw(); - - pad1->cd(); - //pad1->SetLogy(1); - pad1->SetGridx(1); - pad1->SetGridy(1); - pad1->SetFrameBorderMode(0); - pad1->SetFillColor(kWhite); - pad1->SetTopMargin(0.06); - pad1->SetBottomMargin(0.13); - - h_rt_tf30_2s->Draw("hist e1"); - h_rt_tf30_2s1b->Draw("hist e1 same"); - h_rt_tf30_gpt30_2s1b->Draw("hist e1 same"); - //h_rt_tf30_2s1b->Draw("hist e1 same"); - // h_rt_tf30_2s->Draw("hist e1 same "); - - h_rt_tf30_2s->SetFillColor(col1); - h_rt_tf30_2s1b->SetFillColor(col2); - h_rt_tf30_gpt30_2s1b->SetFillColor(col3); - - h_rt_tf30_2s->SetFillStyle(3345); - h_rt_tf30_2s1b->SetFillStyle(3354); - h_rt_tf30_gpt30_2s1b->SetFillStyle(3344); - - maxy = 30; - h_rt_tf30_2s->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf30_gpt30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - - TLegend *leg = new TLegend(0.16,0.67,.8,0.87,"L1 Selections (#geq2 stations, L1 candidate p_{T}#geq20 GeV/c):","brNDC"); - leg->SetMargin(0.2); - leg->SetBorderSize(0); - leg->SetTextSize(0.04); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(h_rt_tf30_2s,"CSC, loose","f"); - leg->AddEntry(h_rt_tf30_2s1b,"CSC, tight","f"); - leg->AddEntry(h_rt_tf30_gpt30_2s1b,"GEM+CSC Integrated Trigger","f"); - leg->Draw(); - - drawLumiLabel2(); - - pad2->cd(); - pad2->SetLogy(1); - pad2->SetGridx(1); - pad2->SetGridy(1); - pad2->SetFillColor(kWhite); - pad2->SetFrameBorderMode(0); - pad2->SetTopMargin(0.06); - pad2->SetBottomMargin(0.3); - - gem_ratio = setHistoRatio(h_rt_tf30_gpt30_2s1b, h_rt_tf30_2s1b, "", 0.01,2.0, col2); - gem_ratio->Draw("Pe"); - - leg = new TLegend(0.16,0.4,.5,0.55,NULL,"brNDC"); - leg->SetMargin(0.1); - leg->SetBorderSize(0); - leg->SetTextSize(0.1); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(gem_ratio, "GEM+CSC/CSC tight","P"); - leg->Draw("same"); - - c->SaveAs(plots + "rates_vs_eta__minpt" + vs_eta_minpt + "__PU100__def_2s_2s1b_2s1bgem" + ext); - } - - - //// +3 Stub plots - - - - // ------------ +3 stubs, L1 candidate muon pt=10GeV ----------------// - vs_eta_minpt = "10"; - - { - TCanvas* c = new TCanvas("c","c",800,800); - c->Clear(); - TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); - pad1->Draw(); - TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); - pad2->Draw(); - - pad1->cd(); - //pad1->SetLogy(1); - pad1->SetGridx(1); - pad1->SetGridy(1); - pad1->SetFrameBorderMode(0); - pad1->SetFillColor(kWhite); - pad1->SetTopMargin(0.06); - pad1->SetBottomMargin(0.13); - - h_rt_tf10_3s->Draw("hist e1"); - h_rt_tf10_3s1b->Draw("hist e1 same"); - h_rt_tf10_gpt10_3s1b->Draw("hist e1 same"); - //h_rt_tf10_3s1b->Draw("hist e1 same"); - // h_rt_tf10_3s->Draw("hist e1 same "); - - h_rt_tf10_3s->SetFillColor(col1); - h_rt_tf10_3s1b->SetFillColor(col2); - h_rt_tf10_gpt10_3s1b->SetFillColor(col3); - - h_rt_tf10_3s->SetFillStyle(3345); - h_rt_tf10_3s1b->SetFillStyle(3354); - h_rt_tf10_gpt10_3s1b->SetFillStyle(3344); - - maxy = 23; - h_rt_tf10_3s->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf10_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf10_gpt10_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - - TLegend *leg = new TLegend(0.16,0.67,.8,0.87,"L1 Selections (#geq2 stations, L1 candidate p_{T}#geq20 GeV/c):","brNDC"); - leg->SetMargin(0.2); - leg->SetBorderSize(0); - leg->SetTextSize(0.04); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(h_rt_tf10_3s,"CSC, loose","f"); - leg->AddEntry(h_rt_tf10_3s1b,"CSC, tight","f"); - leg->AddEntry(h_rt_tf10_gpt10_3s1b,"GEM+CSC Integrated Trigger","f"); - leg->Draw(); - - drawLumiLabel2(); - - pad2->cd(); - pad2->SetLogy(1); - pad2->SetGridx(1); - pad2->SetGridy(1); - pad2->SetFillColor(kWhite); - pad2->SetFrameBorderMode(0); - pad2->SetTopMargin(0.06); - pad2->SetBottomMargin(0.3); - - gem_ratio = setHistoRatio(h_rt_tf10_gpt10_3s1b, h_rt_tf10_3s1b, "", 0.01,2.0, col2); - gem_ratio->Draw("Pe"); - - leg = new TLegend(0.16,0.4,.5,0.55,NULL,"brNDC"); - leg->SetMargin(0.1); - leg->SetBorderSize(0); - leg->SetTextSize(0.1); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(gem_ratio, "GEM+CSC/CSC tight","P"); - leg->Draw("same"); - - c->SaveAs(plots + "rates_vs_eta__minpt" + vs_eta_minpt + "__PU100__def_3s_3s1b_3s1bgem" + ext); - } - - - // ------------ +3 stubs, L1 candidate muon pt=20GeV ----------------// - vs_eta_minpt = "20"; - - { - TCanvas* c = new TCanvas("c","c",800,800); - c->Clear(); - TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); - pad1->Draw(); - TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); - pad2->Draw(); - - pad1->cd(); - //pad1->SetLogy(1); - pad1->SetGridx(1); - pad1->SetGridy(1); - pad1->SetFrameBorderMode(0); - pad1->SetFillColor(kWhite); - pad1->SetTopMargin(0.06); - pad1->SetBottomMargin(0.13); - - h_rt_tf20_3s->Draw("hist e1"); - h_rt_tf20_3s1b->Draw("hist e1 same"); - h_rt_tf20_gpt20_3s1b->Draw("hist e1 same"); - //h_rt_tf20_3s1b->Draw("hist e1 same"); - // h_rt_tf20_3s->Draw("hist e1 same "); - - h_rt_tf20_3s->SetFillColor(col1); - h_rt_tf20_3s1b->SetFillColor(col2); - h_rt_tf20_gpt20_3s1b->SetFillColor(col3); - - h_rt_tf20_3s->SetFillStyle(3345); - h_rt_tf20_3s1b->SetFillStyle(3354); - h_rt_tf20_gpt20_3s1b->SetFillStyle(3344); - - maxy = 10; - h_rt_tf20_3s->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf20_gpt20_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - - TLegend *leg = new TLegend(0.16,0.67,.8,0.87,"L1 Selections (#geq2 stations, L1 candidate p_{T}#geq20 GeV/c):","brNDC"); - leg->SetMargin(0.20); - leg->SetBorderSize(0); - leg->SetTextSize(0.04); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(h_rt_tf20_3s,"CSC, loose","f"); - leg->AddEntry(h_rt_tf20_3s1b,"CSC, tight","f"); - leg->AddEntry(h_rt_tf20_gpt20_3s1b,"GEM+CSC Integrated Trigger","f"); - leg->Draw(); - - drawLumiLabel2(); - - pad2->cd(); - pad2->SetLogy(1); - pad2->SetGridx(1); - pad2->SetGridy(1); - pad2->SetFillColor(kWhite); - pad2->SetFrameBorderMode(0); - pad2->SetTopMargin(0.06); - pad2->SetBottomMargin(0.3); - - gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1b, h_rt_tf20_3s1b, "", 0.01,2.0, col2); - gem_ratio->Draw("Pe"); - - leg = new TLegend(0.16,0.4,.5,0.55,NULL,"brNDC"); - leg->SetMargin(0.1); - leg->SetBorderSize(0); - leg->SetTextSize(0.1); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(gem_ratio, "GEM+CSC/CSC tight","P"); - leg->Draw("same"); - - c->SaveAs(plots + "rates_vs_eta__minpt" + vs_eta_minpt + "__PU100__def_3s_3s1b_3s1bgem" + ext); - } - - // ------------ +3 stubs, L1 candidate muon pt=30GeV ----------------// - vs_eta_minpt = "30"; - - { - TCanvas* c = new TCanvas("c","c",800,800); - c->Clear(); - TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); - pad1->Draw(); - TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); - pad2->Draw(); - - pad1->cd(); - //pad1->SetLogy(1); - pad1->SetGridx(1); - pad1->SetGridy(1); - pad1->SetFrameBorderMode(0); - pad1->SetFillColor(kWhite); - pad1->SetTopMargin(0.06); - pad1->SetBottomMargin(0.13); - - h_rt_tf30_3s->Draw("hist e1"); - h_rt_tf30_3s1b->Draw("hist e1 same"); - h_rt_tf30_gpt30_3s1b->Draw("hist e1 same"); - //h_rt_tf30_3s1b->Draw("hist e1 same"); - // h_rt_tf30_3s->Draw("hist e1 same "); - - h_rt_tf30_3s->SetFillColor(col1); - h_rt_tf30_3s1b->SetFillColor(col2); - h_rt_tf30_gpt30_3s1b->SetFillColor(col3); - - h_rt_tf30_3s->SetFillStyle(3345); - h_rt_tf30_3s1b->SetFillStyle(3354); - h_rt_tf30_gpt30_3s1b->SetFillStyle(3344); - - maxy = 6; - h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf30_gpt30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - - TLegend *leg = new TLegend(0.16,0.67,.8,0.87,"L1 Selections (#geq2 stations, L1 candidate p_{T}#geq20 GeV/c):","brNDC"); - leg->SetMargin(0.2); - leg->SetBorderSize(0); - leg->SetTextSize(0.04); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(h_rt_tf30_3s,"CSC, loose","f"); - leg->AddEntry(h_rt_tf30_3s1b,"CSC, tight","f"); - leg->AddEntry(h_rt_tf30_gpt30_3s1b,"GEM+CSC Integrated Trigger","f"); - leg->Draw(); - - drawLumiLabel2(); - - pad2->cd(); - pad2->SetLogy(1); - pad2->SetGridx(1); - pad2->SetGridy(1); - pad2->SetFillColor(kWhite); - pad2->SetFrameBorderMode(0); - pad2->SetTopMargin(0.06); - pad2->SetBottomMargin(0.3); - - gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1b, h_rt_tf30_3s1b, "", 0.01,2.0, col2); - gem_ratio->Draw("Pe"); - - leg = new TLegend(0.16,0.4,.5,0.55,NULL,"brNDC"); - leg->SetMargin(0.1); - leg->SetBorderSize(0); - leg->SetTextSize(0.1); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(gem_ratio, "GEM+CSC/CSC tight","P"); - leg->Draw("same"); - - c->SaveAs(plots + "rates_vs_eta__minpt" + vs_eta_minpt + "__PU100__def_3s_3s1b_3s1bgem" + ext); - } - -} diff --git a/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C b/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C index 9d8862ce12e5a..57b3ecdbf82cd 100644 --- a/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C +++ b/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C @@ -59,21 +59,30 @@ void produceRatePlots(TString ext) // ********** PAT2 ********** getPTHistos("minbias_pt06_pat2"); + hh = (TH1D*)result_def_3s1b->Clone("gem_new"); for (int b = hh->FindBin(6.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); + hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); for (int b = hh_all->FindBin(6.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); + hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); for (int b = hh_no1a->FindBin(6.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); + hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); for (int b = hh_2s1b->FindBin(6.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); + + h06 = (TH1D*)result_gem->Clone("gem_new_06"); for (int b = h06->FindBin(6.01); b < h06->FindBin(10.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} + h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); for (int b = h06_all->FindBin(6.01); b < h06_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} + h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); for (int b = h06_no1a->FindBin(6.01); b < h06_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} + h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); for (int b = h06_2s1b->FindBin(6.01); b < h06_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} @@ -310,27 +319,18 @@ void produceRatePlots(TString ext) result_gmtsing__pat2->GetYaxis()->SetRangeUser(0.1, 10000.); result_gmtsing__pat2->GetXaxis()->SetTitle(""); - TLegend *leg0 = new TLegend(0.365,0.88,.93,0.93,NULL,"brNDC"); - leg0->SetBorderSize(0); - leg0->SetMargin(0.235); - leg0->SetFillStyle(0); - leg0->SetTextSize(0.04); - leg0->SetFillStyle(1001); - leg0->SetFillColor(kWhite); - leg0->AddEntry(result_gmtsing__pat2,"Standard Configuration (GMT 2012)","f"); - leg0->Draw(); - - TLegend *leg = new TLegend(0.45,0.68,.93,0.86,"L1 Selections (#geq 2 stations):","brNDC"); + TLegend *leg = new TLegend(0.45,0.7,.93,0.93,"","brNDC"); leg->SetMargin(0.25); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - // leg->AddEntry((TObject*)0, "L1 Selections (#geq 2 stations):",""); + leg->AddEntry(result_gmtsing__pat2, "GMT (2012 configuration)","f"); + leg->AddEntry((TObject*)0, "L1 selections (#geq 2 stations):",""); leg->AddEntry(result_def_2s__pat2, "CSC, loose","f"); leg->AddEntry(result_def_2s1b__pat2,"CSC, tight","f"); - leg->AddEntry(result_gem_2s1b__pat2,"GEM+CSC Integrated Trigger","f"); + leg->AddEntry(result_gem_2s1b__pat2,"GEM+CSC integrated trigger","f"); leg->Draw(); drawLumiLabel(0.17,.3); @@ -362,8 +362,8 @@ void produceRatePlots(TString ext) leg->SetTextSize(0.1); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry(hh_ratio_gmt, "GEM+CSC/GMT","p"); - leg->AddEntry(hh_ratio, "GEM+CSC/CSC tight","p"); + leg->AddEntry(hh_ratio_gmt, "(GEM+CSC)/GMT","p"); + leg->AddEntry(hh_ratio, "(GEM+CSC)/CSC tight","p"); leg->Draw("same"); c->SaveAs(plots + "rates_vs_pt__PU100__def_2s_2s1b_2s1bgem__loose" + ext); @@ -386,25 +386,18 @@ void produceRatePlots(TString ext) result_gmtsing__pat8->GetYaxis()->SetRangeUser(0.1, 10000.); result_gmtsing__pat8->GetXaxis()->SetTitle(""); - TLegend *leg0 = new TLegend(0.15,0.88,.9,0.93,NULL,"brNDC"); - leg0->SetBorderSize(0); - leg0->SetFillStyle(0); - leg0->SetTextSize(0.04); - leg0->SetFillStyle(1001); - leg0->SetFillColor(kWhite); - leg0->AddEntry(result_gmtsing__pat8,"Single muon trigger in 2012 configuration [GMT]","f"); - leg0->Draw(); - - TLegend *leg = new TLegend(0.45,0.68,.93,0.86,"L1 Selections (#geq 2 stations):","brNDC"); + TLegend *leg = new TLegend(0.45,0.7,.93,0.93,"","brNDC"); leg->SetMargin(0.25); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); + leg->AddEntry(result_gmtsing__pat8, "GMT (2012 configuration)","f"); + leg->AddEntry((TObject*)0, "L1 selections (#geq 2 stations):",""); leg->AddEntry(result_def_2s__pat8, "CSC, loose","f"); leg->AddEntry(result_def_2s1b__pat8,"CSC, tight","f"); - leg->AddEntry(result_gem_2s1b__pat8,"GEM+CSC Integrated Trigger","f"); + leg->AddEntry(result_gem_2s1b__pat8,"GEM+CSC integrated trigger","f"); leg->Draw(); drawLumiLabel(0.17,.3); @@ -423,20 +416,20 @@ void produceRatePlots(TString ext) pad2->SetBottomMargin(0.4); hh_ratio = setHistoRatio(result_gem_2s1b__pat8, result_def_2s1b__pat8, "", 0.01,1.1,col2); - hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); + hh_ratio->GetXaxis()->SetTitle("L1 muon candidate p_{T}^{cut} [GeV/c]"); hh_ratio->Draw("P"); hh_ratio_gmt = setHistoRatio(result_gem_2s1b__pat8, result_gmtsing__pat8, "", 0.01,1.1,col0); hh_ratio_gmt->Draw("P same"); - leg = new TLegend(0.15,0.45,.5,0.7,NULL,"brNDC"); + leg = new TLegend(0.15,0.45,.45,0.7,NULL,"brNDC"); leg->SetMargin(0.1); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.1); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry(hh_ratio_gmt, "GEM+CSC/GMT","p"); - leg->AddEntry(hh_ratio, "GEM+CSC/CSC tight","p"); + leg->AddEntry(hh_ratio_gmt, "(GEM+CSC)/GMT","p"); + leg->AddEntry(hh_ratio, "(GEM+CSC)/CSC tight","p"); leg->Draw("same"); c->SaveAs(plots + "rates_vs_pt__PU100__def_2s_2s1b_2s1bgem__tight" + ext); @@ -459,25 +452,18 @@ void produceRatePlots(TString ext) result_gmtsing__pat2->GetYaxis()->SetRangeUser(0.01, 10000.); result_gmtsing__pat2->GetXaxis()->SetTitle(""); - TLegend *leg0 = new TLegend(0.15,0.88,.9,0.93,NULL,"brNDC"); - leg0->SetBorderSize(0); - leg0->SetFillStyle(0); - leg0->SetTextSize(0.04); - leg0->SetFillStyle(1001); - leg0->SetFillColor(kWhite); - leg0->AddEntry(result_gmtsing__pat2,"Single muon trigger in 2012 configuration [GMT]","f"); - leg0->Draw(); - - TLegend *leg = new TLegend(0.45,0.68,.93,0.86,"L1 Selections (#geq 3 stations):","brNDC"); + TLegend *leg = new TLegend(0.45,0.7,.93,0.93,"","brNDC"); leg->SetMargin(0.25); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); + leg->AddEntry(result_gmtsing__pat2, "GMT (2012 configuration)","f"); + leg->AddEntry((TObject*)0, "L1 selections (#geq 3 stations):",""); leg->AddEntry(result_def_3s__pat2, "CSC, loose","f"); leg->AddEntry(result_def_3s1b__pat2,"CSC, tight","f"); - leg->AddEntry(result_gem_3s1b__pat2,"GEM+CSC Integrated Trigger","f"); + leg->AddEntry(result_gem_3s1b__pat2,"GEM+CSC integrated trigger","f"); leg->Draw(); drawLumiLabel(0.17,.3); @@ -496,20 +482,19 @@ void produceRatePlots(TString ext) pad2->SetBottomMargin(0.4); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.01,1.1,col2); - hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); + hh_ratio->GetXaxis()->SetTitle("L1 muon candidate p_{T}^{cut} [GeV/c]"); hh_ratio->Draw("P"); hh_ratio_gmt = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.01,1.1,col0); hh_ratio_gmt->Draw("P same"); - leg = new TLegend(0.15,0.45,.5,0.7,NULL,"brNDC"); + leg = new TLegend(0.15,0.45,.45,0.7,NULL,"brNDC"); leg->SetMargin(0.1); leg->SetBorderSize(0); - leg->SetFillStyle(0); leg->SetTextSize(0.1); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry(hh_ratio_gmt, "GEM+CSC/GMT","p"); - leg->AddEntry(hh_ratio, "GEM+CSC/CSC tight","p"); + leg->AddEntry(hh_ratio_gmt, "(GEM+CSC)/GMT","p"); + leg->AddEntry(hh_ratio, "(GEM+CSC)/CSC tight","p"); leg->Draw("same"); c->SaveAs(plots + "rates_vs_pt__PU100__def_3s_3s1b_3s1bgem__loose" + ext); @@ -532,25 +517,18 @@ void produceRatePlots(TString ext) result_gmtsing__pat8->GetYaxis()->SetRangeUser(0.01, 10000.); result_gmtsing__pat8->GetXaxis()->SetTitle(""); - TLegend *leg0 = new TLegend(0.15,0.88,.9,0.93,NULL,"brNDC"); - leg0->SetBorderSize(0); - leg0->SetFillStyle(0); - leg0->SetTextSize(0.04); - leg0->SetFillStyle(1001); - leg0->SetFillColor(kWhite); - leg0->AddEntry(result_gmtsing__pat8,"Single muon trigger in 2012 configuration [GMT]","f"); - leg0->Draw(); - - TLegend *leg = new TLegend(0.45,0.68,.93,0.86,"L1 Selections (#geq 3 stations):","brNDC"); + TLegend *leg = new TLegend(0.45,0.7,.93,0.93,"","brNDC"); leg->SetMargin(0.25); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); + leg->AddEntry(result_gmtsing__pat8, "GMT (2012 configuration)","f"); + leg->AddEntry((TObject*)0, "L1 selections (#geq 3 stations):",""); leg->AddEntry(result_def_3s__pat8, "CSC, loose","f"); leg->AddEntry(result_def_3s1b__pat8,"CSC, tight","f"); - leg->AddEntry(result_gem_3s1b__pat8,"GEM+CSC Integrated Trigger","f"); + leg->AddEntry(result_gem_3s1b__pat8,"GEM+CSC integrated trigger","f"); leg->Draw(); drawLumiLabel(0.17,.3); @@ -569,20 +547,20 @@ void produceRatePlots(TString ext) pad2->SetBottomMargin(0.4); hh_ratio = setHistoRatio(result_gem_3s1b__pat8, result_def_3s1b__pat8, "", 0.01,1.1,col2); - hh_ratio->GetXaxis()->SetTitle("p_{T}^{cut} [GeV/c]"); + hh_ratio->GetXaxis()->SetTitle("L1 muon candidate p_{T}^{cut} [GeV/c]"); hh_ratio->Draw("P"); hh_ratio_gmt = setHistoRatio(result_gem_3s1b__pat8, result_gmtsing__pat8, "", 0.01,1.1,col0); hh_ratio_gmt->Draw("P same"); - leg = new TLegend(0.15,0.45,.5,0.7,NULL,"brNDC"); + leg = new TLegend(0.15,0.45,.45,0.7,NULL,"brNDC"); leg->SetMargin(0.1); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.1); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry(hh_ratio_gmt, "GEM+CSC/GMT","p"); - leg->AddEntry(hh_ratio, "GEM+CSC/CSC tight","p"); + leg->AddEntry(hh_ratio_gmt, "(GEM+CSC)/GMT","p"); + leg->AddEntry(hh_ratio, "(GEM+CSC)/CSC tight","p"); leg->Draw("same"); c->SaveAs(plots + "rates_vs_pt__PU100__def_3s_3s1b_3s1bgem__tight" + ext); @@ -705,4 +683,5 @@ void produceRateVsPtPlotsForApproval() produceRatePlots(".pdf"); produceRatePlots(".eps"); produceRatePlots(".png"); + // produceRatePlots(".C"); } From e4f0e52615fb3d5d0b6108f6f75438252d84c498 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 14 Aug 2013 00:50:57 +0200 Subject: [PATCH 081/182] cleanup of the rate vs pt plots --- .../scripts/produceRateVsPtPlotsForApproval.C | 397 +++++------------- 1 file changed, 98 insertions(+), 299 deletions(-) diff --git a/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C b/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C index 57b3ecdbf82cd..afeba580bd65c 100644 --- a/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C +++ b/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C @@ -27,6 +27,87 @@ TLatex* drawL1Label(float x=0.17, float y=0.35) return tex; } +void produceRatePlot(TH1D* h, TH1D* i, TH1D* j, TH1D* m, Color_t col0, Color_t col1, Color_t col2, Color_t col3, + float miny, float maxy, TString k, TString l, TString plots, TString ext) +) +{ + TCanvas* c = new TCanvas("c","c",800,800); + c->Clear(); + TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); + pad1->Draw(); + TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); + pad2->Draw(); + + pad1->cd(); + pad1->SetLogx(1); + pad1->SetLogy(1); + pad1->SetGridx(1); + pad1->SetGridy(1); + pad1->SetFrameBorderMode(0); + pad1->SetFillColor(kWhite); + + h->SetFillColor(col0); + i->SetFillColor(col1); + j->SetFillColor(col2); + m->SetFillColor(col3); + + h->Draw("e3"); + i->Draw("same e3"); + j->Draw("same e3"); + m->Draw("same e3"); + h->Draw("same e3"); + h->GetYaxis()->SetRangeUser(miny, maxy); + h->GetXaxis()->SetTitle(""); + + TLegend *leg = new TLegend(0.45,0.7,.93,0.93,"","brNDC"); + leg->SetMargin(0.25); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.04); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(h, "GMT (2012 configuration)","f"); + leg->AddEntry((TObject*)0, "L1 selections (#geq " + k + " stations):",""); + leg->AddEntry(i, "CSC, loose","f"); + leg->AddEntry(j,"CSC, tight","f"); + leg->AddEntry(m,"GEM+CSC integrated trigger","f"); + leg->Draw(); + + drawLumiLabel(0.17,.3); + drawEtaLabel("1.64","2.14",0.17,.37); + + pad2->cd(); + pad2->SetLogx(1); + pad2->SetLogy(1); + pad2->SetGridx(1); + pad2->SetGridy(1); + pad2->SetFillColor(kWhite); + pad2->SetFrameBorderMode(0); + pad2->SetLeftMargin(0.126); + pad2->SetRightMargin(0.04); + pad2->SetTopMargin(0.06); + pad2->SetBottomMargin(0.4); + + TH1D* hh_ratio = setHistoRatio(m, j, "", 0.01,1.1,col2); + hh_ratio->GetXaxis()->SetTitle("L1 muon candidate p_{T}^{cut} [GeV/c]"); + hh_ratio->Draw("P"); + + TH1D* hh_ratio_gmt = setHistoRatio(m, h, "", 0.01,1.1,col0); + hh_ratio_gmt->Draw("P same"); + + leg = new TLegend(0.15,0.45,.45,0.7,NULL,"brNDC"); + leg->SetMargin(0.1); + leg->SetBorderSize(0); + leg->SetTextSize(0.1); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(hh_ratio_gmt, "(GEM+CSC)/GMT","p"); + leg->AddEntry(hh_ratio, "(GEM+CSC)/CSC tight","p"); + leg->Draw("same"); + + c->SaveAs(plots + "rates_vs_pt__PU100__def_" + k + "s_" + k + "s1b_" + k + "s1bgem__" + l + ext); +} + void produceRatePlots(TString ext) { gem_dir = "files/"; @@ -270,303 +351,24 @@ void produceRatePlots(TString ext) //////////////////////// // PLOTS FOR APPROVAL // //////////////////////// - { - Color_t col0 = kRed; - Color_t col1 = kViolet+1; - Color_t col2 = kAzure+2; - Color_t col3 = kGreen-2; - - result_gmtsing__pat2->SetFillColor(col0); - result_gmtsing__pat8->SetFillColor(col0); - - result_def_2s__pat2->SetFillColor(col1); - result_def_2s1b__pat2->SetFillColor(col2); - result_gem_2s1b__pat2->SetFillColor(col3); - - result_def_3s__pat2->SetFillColor(col1); - result_def_3s1b__pat2->SetFillColor(col2); - result_gem_3s1b__pat2->SetFillColor(col3); - - result_def_2s__pat8->SetFillColor(col1); - result_def_2s1b__pat8->SetFillColor(col2); - result_gem_2s1b__pat8->SetFillColor(col3); - - result_def_3s__pat8->SetFillColor(col1); - result_def_3s1b__pat8->SetFillColor(col2); - result_gem_3s1b__pat8->SetFillColor(col3); - - // GMT; CSCTF 2 stubs; CSCTF 2 stubs + ME1/b; CSCTF 2 stubs + ME1/b + GEM -- LOOSE -- Absolute + ratio - TCanvas* c = new TCanvas("c","c",800,800); - c->Clear(); - TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); - pad1->Draw(); - TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); - pad2->Draw(); - - pad1->cd(); - pad1->SetLogx(1); - pad1->SetLogy(1); - pad1->SetGridx(1); - pad1->SetGridy(1); - pad1->SetFrameBorderMode(0); - pad1->SetFillColor(kWhite); - - result_gmtsing__pat2->Draw("e3"); - result_def_2s__pat2->Draw("same e3"); - result_def_2s1b__pat2->Draw("same e3"); - result_gem_2s1b__pat2->Draw("same e3"); - result_gmtsing__pat2->Draw("same e3"); - result_gmtsing__pat2->GetYaxis()->SetRangeUser(0.1, 10000.); - result_gmtsing__pat2->GetXaxis()->SetTitle(""); - - TLegend *leg = new TLegend(0.45,0.7,.93,0.93,"","brNDC"); - leg->SetMargin(0.25); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->SetTextSize(0.04); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(result_gmtsing__pat2, "GMT (2012 configuration)","f"); - leg->AddEntry((TObject*)0, "L1 selections (#geq 2 stations):",""); - leg->AddEntry(result_def_2s__pat2, "CSC, loose","f"); - leg->AddEntry(result_def_2s1b__pat2,"CSC, tight","f"); - leg->AddEntry(result_gem_2s1b__pat2,"GEM+CSC integrated trigger","f"); - leg->Draw(); - - drawLumiLabel(0.17,.3); - drawEtaLabel("1.64","2.14",0.17,.37); - - pad2->cd(); - pad2->SetLogx(1); - pad2->SetLogy(1); - pad2->SetGridx(1); - pad2->SetGridy(1); - pad2->SetFillColor(kWhite); - pad2->SetFrameBorderMode(0); - pad2->SetLeftMargin(0.126); - pad2->SetRightMargin(0.04); - pad2->SetTopMargin(0.06); - pad2->SetBottomMargin(0.4); - - hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.01,1.1,col2); - - hh_ratio->GetXaxis()->SetTitle("L1 muon candidate p_{T}^{cut} [GeV/c]"); - hh_ratio->Draw("P"); - - hh_ratio_gmt = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.01,1.1,col0); - hh_ratio_gmt->Draw("P same"); - - leg = new TLegend(0.15,0.45,.45,0.7,NULL,"brNDC"); - leg->SetMargin(0.1); - leg->SetBorderSize(0); - leg->SetTextSize(0.1); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(hh_ratio_gmt, "(GEM+CSC)/GMT","p"); - leg->AddEntry(hh_ratio, "(GEM+CSC)/CSC tight","p"); - leg->Draw("same"); - - c->SaveAs(plots + "rates_vs_pt__PU100__def_2s_2s1b_2s1bgem__loose" + ext); - } - { - // GMT; CSCTF 2 stubs; CSCTF 2 stubs + ME1/b; CSCTF 2 stubs + ME1/b + GEM -- TIGHT + GEM -- Absolute - pad1->cd(); - pad1->SetLogx(1); - pad1->SetLogy(1); - pad1->SetGridx(1); - pad1->SetGridy(1); - pad1->SetFrameBorderMode(0); - pad1->SetFillColor(kWhite); - - result_gmtsing__pat8->Draw("e3"); - result_def_2s__pat8->Draw("same e3"); - result_def_2s1b__pat8->Draw("same e3"); - result_gem_2s1b__pat8->Draw("same e3"); - result_gmtsing__pat8->Draw("same e3"); - result_gmtsing__pat8->GetYaxis()->SetRangeUser(0.1, 10000.); - result_gmtsing__pat8->GetXaxis()->SetTitle(""); - - TLegend *leg = new TLegend(0.45,0.7,.93,0.93,"","brNDC"); - leg->SetMargin(0.25); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->SetTextSize(0.04); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(result_gmtsing__pat8, "GMT (2012 configuration)","f"); - leg->AddEntry((TObject*)0, "L1 selections (#geq 2 stations):",""); - leg->AddEntry(result_def_2s__pat8, "CSC, loose","f"); - leg->AddEntry(result_def_2s1b__pat8,"CSC, tight","f"); - leg->AddEntry(result_gem_2s1b__pat8,"GEM+CSC integrated trigger","f"); - leg->Draw(); - - drawLumiLabel(0.17,.3); - drawEtaLabel("1.64","2.14",0.17,.37); - - pad2->cd(); - pad2->SetLogx(1); - pad2->SetLogy(1); - pad2->SetGridx(1); - pad2->SetGridy(1); - pad2->SetFillColor(kWhite); - pad2->SetFrameBorderMode(0); - pad2->SetLeftMargin(0.126); - pad2->SetRightMargin(0.04); - pad2->SetTopMargin(0.06); - pad2->SetBottomMargin(0.4); - - hh_ratio = setHistoRatio(result_gem_2s1b__pat8, result_def_2s1b__pat8, "", 0.01,1.1,col2); - hh_ratio->GetXaxis()->SetTitle("L1 muon candidate p_{T}^{cut} [GeV/c]"); - hh_ratio->Draw("P"); - hh_ratio_gmt = setHistoRatio(result_gem_2s1b__pat8, result_gmtsing__pat8, "", 0.01,1.1,col0); - hh_ratio_gmt->Draw("P same"); - - leg = new TLegend(0.15,0.45,.45,0.7,NULL,"brNDC"); - leg->SetMargin(0.1); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->SetTextSize(0.1); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(hh_ratio_gmt, "(GEM+CSC)/GMT","p"); - leg->AddEntry(hh_ratio, "(GEM+CSC)/CSC tight","p"); - leg->Draw("same"); - - c->SaveAs(plots + "rates_vs_pt__PU100__def_2s_2s1b_2s1bgem__tight" + ext); - } - { - // GMT; CSCTF 3 stubs; CSCTF 3 stubs + ME1/b; CSCTF 3 stubs + ME1/b + GEM -- LOOSE -- Absolute - pad1->cd(); - pad1->SetLogx(1); - pad1->SetLogy(1); - pad1->SetGridx(1); - pad1->SetGridy(1); - pad1->SetFrameBorderMode(0); - pad1->SetFillColor(kWhite); - - result_gmtsing__pat2->Draw("e3"); - result_def_3s__pat2->Draw("same e3"); - result_def_3s1b__pat2->Draw("same e3"); - result_gem_3s1b__pat2->Draw("same e3"); - result_gmtsing__pat2->Draw("same e3"); - result_gmtsing__pat2->GetYaxis()->SetRangeUser(0.01, 10000.); - result_gmtsing__pat2->GetXaxis()->SetTitle(""); - - TLegend *leg = new TLegend(0.45,0.7,.93,0.93,"","brNDC"); - leg->SetMargin(0.25); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->SetTextSize(0.04); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(result_gmtsing__pat2, "GMT (2012 configuration)","f"); - leg->AddEntry((TObject*)0, "L1 selections (#geq 3 stations):",""); - leg->AddEntry(result_def_3s__pat2, "CSC, loose","f"); - leg->AddEntry(result_def_3s1b__pat2,"CSC, tight","f"); - leg->AddEntry(result_gem_3s1b__pat2,"GEM+CSC integrated trigger","f"); - leg->Draw(); - - drawLumiLabel(0.17,.3); - drawEtaLabel("1.64","2.14",0.17,.37); - - pad2->cd(); - pad2->SetLogx(1); - pad2->SetLogy(1); - pad2->SetGridx(1); - pad2->SetGridy(1); - pad2->SetFillColor(kWhite); - pad2->SetFrameBorderMode(0); - pad2->SetLeftMargin(0.126); - pad2->SetRightMargin(0.04); - pad2->SetTopMargin(0.06); - pad2->SetBottomMargin(0.4); - - hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.01,1.1,col2); - hh_ratio->GetXaxis()->SetTitle("L1 muon candidate p_{T}^{cut} [GeV/c]"); - hh_ratio->Draw("P"); - hh_ratio_gmt = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.01,1.1,col0); - hh_ratio_gmt->Draw("P same"); - - leg = new TLegend(0.15,0.45,.45,0.7,NULL,"brNDC"); - leg->SetMargin(0.1); - leg->SetBorderSize(0); - leg->SetTextSize(0.1); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(hh_ratio_gmt, "(GEM+CSC)/GMT","p"); - leg->AddEntry(hh_ratio, "(GEM+CSC)/CSC tight","p"); - leg->Draw("same"); - - c->SaveAs(plots + "rates_vs_pt__PU100__def_3s_3s1b_3s1bgem__loose" + ext); - } - { - // GMT; CSCTF 3 stubs; CSCTF 3 stubs + ME1/b; CSCTF 3 stubs + ME1/b + GEM -- TIGHT + GEM -- Absolute - pad1->cd(); - pad1->SetLogx(1); - pad1->SetLogy(1); - pad1->SetGridx(1); - pad1->SetGridy(1); - pad1->SetFrameBorderMode(0); - pad1->SetFillColor(kWhite); - - result_gmtsing__pat8->Draw("e3"); - result_def_3s__pat8->Draw("same e3"); - result_def_3s1b__pat8->Draw("same e3"); - result_gem_3s1b__pat8->Draw("same e3"); - result_gmtsing__pat8->Draw("same e3"); - result_gmtsing__pat8->GetYaxis()->SetRangeUser(0.01, 10000.); - result_gmtsing__pat8->GetXaxis()->SetTitle(""); - - TLegend *leg = new TLegend(0.45,0.7,.93,0.93,"","brNDC"); - leg->SetMargin(0.25); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->SetTextSize(0.04); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(result_gmtsing__pat8, "GMT (2012 configuration)","f"); - leg->AddEntry((TObject*)0, "L1 selections (#geq 3 stations):",""); - leg->AddEntry(result_def_3s__pat8, "CSC, loose","f"); - leg->AddEntry(result_def_3s1b__pat8,"CSC, tight","f"); - leg->AddEntry(result_gem_3s1b__pat8,"GEM+CSC integrated trigger","f"); - leg->Draw(); - - drawLumiLabel(0.17,.3); - drawEtaLabel("1.64","2.14",0.17,.37); - - pad2->cd(); - pad2->SetLogx(1); - pad2->SetLogy(1); - pad2->SetGridx(1); - pad2->SetGridy(1); - pad2->SetFillColor(kWhite); - pad2->SetFrameBorderMode(0); - pad2->SetLeftMargin(0.126); - pad2->SetRightMargin(0.04); - pad2->SetTopMargin(0.06); - pad2->SetBottomMargin(0.4); - - hh_ratio = setHistoRatio(result_gem_3s1b__pat8, result_def_3s1b__pat8, "", 0.01,1.1,col2); - hh_ratio->GetXaxis()->SetTitle("L1 muon candidate p_{T}^{cut} [GeV/c]"); - hh_ratio->Draw("P"); - hh_ratio_gmt = setHistoRatio(result_gem_3s1b__pat8, result_gmtsing__pat8, "", 0.01,1.1,col0); - hh_ratio_gmt->Draw("P same"); - - leg = new TLegend(0.15,0.45,.45,0.7,NULL,"brNDC"); - leg->SetMargin(0.1); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->SetTextSize(0.1); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(hh_ratio_gmt, "(GEM+CSC)/GMT","p"); - leg->AddEntry(hh_ratio, "(GEM+CSC)/CSC tight","p"); - leg->Draw("same"); - - c->SaveAs(plots + "rates_vs_pt__PU100__def_3s_3s1b_3s1bgem__tight" + ext); - } - + Color_t col0 = kRed; + Color_t col1 = kViolet+1; + Color_t col2 = kAzure+2; + Color_t col3 = kGreen-2; + + produceRatePlot(result_gmtsing__pat2, result_def_2s__pat2, result_def_2s1b__pat2, result_gem_2s1b__pat2, + col0, col1, col2, col3, 0.1, 10000, "2", "loose", plots, ext); + produceRatePlot(result_gmtsing__pat8, result_def_2s__pat8, result_def_2s1b__pat8, result_gem_2s1b__pat8, + col0, col1, col2, col3, 0.1, 10000, "2", "tight", plots, ext); + + produceRatePlot(result_gmtsing__pat2, result_def_3s__pat2, result_def_3s1b__pat2, result_gem_3s1b__pat2, + col0, col1, col2, col3, 0.01, 10000, "3", "loose", plots, ext); + produceRatePlot(result_gmtsing__pat8, result_def_3s__pat8, result_def_3s1b__pat8, result_gem_3s1b__pat8, + col0, col1, col2, col3, 0.01, 10000, "3", "tight", plots, ext); + // EXTRA PLOTS + bool produceTheBigPlots = false; + if (produceTheBigPlots) { result_def_2s__pat8->SetFillColor(kViolet+2); result_def_2s1b__pat8->SetFillColor(kAzure+2); @@ -681,7 +483,4 @@ void produceRateVsPtPlotsForApproval() gROOT->SetBatch(true); produceRatePlots(".pdf"); - produceRatePlots(".eps"); - produceRatePlots(".png"); - // produceRatePlots(".C"); } From 6eb3647e7b4eb3d2cdea61e7c8ffc00009c844f1 Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Wed, 14 Aug 2013 00:01:34 -0500 Subject: [PATCH 082/182] fixes for config and missing histos in MuSimHitOccupancy --- SimMuL1/plugins/MuSimHitOccupancy.cc | 48 ++++++++++++++---------- SimMuL1/src/MuGeometryHelpers.cc | 4 +- SimMuL1/test/runMuSimHitOccupancy_cfg.py | 34 ++++++++++++++--- 3 files changed, 61 insertions(+), 25 deletions(-) diff --git a/SimMuL1/plugins/MuSimHitOccupancy.cc b/SimMuL1/plugins/MuSimHitOccupancy.cc index bcd90883b3aad..812ea0df6631d 100644 --- a/SimMuL1/plugins/MuSimHitOccupancy.cc +++ b/SimMuL1/plugins/MuSimHitOccupancy.cc @@ -180,7 +180,7 @@ class MuSimHitOccupancy : public edm::EDAnalyzer TH1D * h_gem_clu_flux_per_layer; TH1D * h_gem_clu_rate_per_ch; TH2D * h_gem_tof_vs_ekin[N_PDGIDS]; - TH2D * h_gem_hit_avg_per_ch; + TH1D * h_gem_nhit_avg_per_ch; TH1D * h_gem_total_area; TH1D * h_gem_hit_flux_per_partlayer_ge11; @@ -420,6 +420,11 @@ MuSimHitOccupancy::MuSimHitOccupancy(const edm::ParameterSet& iConfig) for (int i=1; i<=h_gem_clu_rate_per_ch->GetXaxis()->GetNbins();i++) h_gem_clu_rate_per_ch->GetXaxis()->SetBinLabel(i,gem_type[i].c_str()); + h_gem_nhit_avg_per_ch = fs->make("h_gem_nhit_avg_per_ch", + (n_clusters+" average #hits per chamber in GEM L=10^{34};GE station/ring;<#hits>").c_str(), GEM_TYPES, 0.5, GEM_TYPES+0.5); + for (int i=1; i<=h_gem_nhit_avg_per_ch->GetXaxis()->GetNbins();i++) + h_gem_nhit_avg_per_ch->GetXaxis()->SetBinLabel(i,gem_type[i].c_str()); + h_gem_total_area = fs->make("h_gem_total_area", "GEM total area per type", GEM_TYPES, 0.5, GEM_TYPES+0.5); h_gem_hit_flux_per_partlayer_ge11 = fs->make("h_gem_hit_flux_per_partlayer_ge11", @@ -467,6 +472,8 @@ MuSimHitOccupancy::MuSimHitOccupancy(const edm::ParameterSet& iConfig) for (int i=1; i<=h_rpcf_clu_rate_per_ch->GetXaxis()->GetNbins();i++) h_rpcf_clu_rate_per_ch->GetXaxis()->SetBinLabel(i,rpcf_type[i].c_str()); + h_rpcf_total_area = fs->make("h_rpcf_total_area", "RPCf total area per type", RPCF_TYPES, 0.5, RPCF_TYPES+0.5); + h_rpcb_nevt_fraction_with_sh = fs->make("h_rpcb_nevt_fraction_with_sh", ("Fraction of events with "+n_simhits+" by RPFb type;RB station/|wheel|").c_str(), RPCB_TYPES+1, -0.5, RPCB_TYPES+0.5); @@ -945,7 +952,7 @@ MuSimHitOccupancy::analyzeGEM() h_gem_hit_flux_per_layer->Fill(g_id.t); h_gem_hit_rate_per_ch->Fill(g_id.t); - if (t==1) + if (g_id.t==1) { h_gem_hit_flux_per_partlayer_ge11->Fill(g_id.part); h_gem_hit_avg_per_part_ge11->Fill(g_id.part); @@ -1270,9 +1277,9 @@ void MuSimHitOccupancy::endJob() if (do_csc_) for (int t=0; t <= CSC_TYPES; t++) { - h_csc_total_area->SetBinContent(t+1,areas_.csc_total_areas_cm2[t]); + h_csc_total_area->SetBinContent(t, areas_.csc_total_areas_cm2[t]); } - h_csc_total_area->SetBinContent(0, evtn); // store it in underflow + h_csc_total_area->SetBinContent(CSC_TYPES+1, evtn); // store it in overflow h_csc_total_area->SetEntries(CSC_TYPES+2); h_csc_hit_flux_per_layer->Sumw2(); @@ -1304,11 +1311,11 @@ void MuSimHitOccupancy::endJob() } - if (do_gem_) for (int t=0; t <= GEM_TYPES; t++) + if (do_gem_) for (int t=0; t <= GEM_TYPES; t++) // underflow is total area { - h_gem_total_area->SetBinContent(t+1,areas_.gem_total_areas_cm2[t]); + h_gem_total_area->SetBinContent(t,areas_.gem_total_areas_cm2[t]); } - h_gem_total_area->SetBinContent(0, evtn); // store it in underflow + h_gem_total_area->SetBinContent(GEM_TYPES+1, evtn); // store it in overflow h_gem_total_area->SetEntries(GEM_TYPES+2); h_gem_hit_flux_per_layer->Sumw2(); @@ -1324,31 +1331,34 @@ void MuSimHitOccupancy::endJob() scaleOneBin(h_gem_clu_rate_per_ch, t, scale); scale = 1. /evtn /gem_radial_segm[t]/2./2.; // gem - scaleOneBin(h_gem_hit_avg_per_ch, t, scale); + scaleOneBin(h_gem_nhit_avg_per_ch, t, scale); } h_gem_hit_flux_per_partlayer_ge11->Sumw2(); h_gem_hit_avg_per_part_ge11->Sumw2(); + if (do_gem_) for (int i=1; i<=10; i++) + { + if (areas_.gem_total_part_areas_cm2[1][i] == 0.) continue; + scale = bxrate * n_pu * f_full_bx /evtn /areas_.gem_total_part_areas_cm2[1][i]; + scaleOneBin(h_gem_hit_flux_per_partlayer_ge11, i, scale); + } if (do_gem_) { - scale = bxrate * n_pu * f_full_bx /evtn /areas_.gem_total_part_areas_cm2[1]; - h_gem_hit_flux_per_partlayer_ge11->Scale(scale); - scale = 1. /evtn /gem_radial_segm[1]/2./2.; // gem h_gem_hit_avg_per_part_ge11->Scale(scale); } if (do_gem_) for (int i=0; i<=10; i++) { - gr_gem_hit_flux_ge1->SetPoint(i, areas_.gem_part_radius[i+1], h_gem_hit_flux_per_partlayer_ge11->GetBinContent(i+1) ); - gr_gem_hit_flux_ge1->SetPointError(i, areas_.gem_part_halfheight[i+1], h_gem_hit_flux_per_partlayer_ge11->GetBinError(i+1) ); + gr_gem_hit_flux_ge1->SetPoint(i, areas_.gem_part_radius[1][i+1], h_gem_hit_flux_per_partlayer_ge11->GetBinContent(i+1) ); + gr_gem_hit_flux_ge1->SetPointError(i, areas_.gem_part_halfheight[1][i+1], h_gem_hit_flux_per_partlayer_ge11->GetBinError(i+1) ); } if (do_rpc_) for (int t=0; t <= RPCF_TYPES; t++) { - h_rpcf_total_area->SetBinContent(t+1, areas_.rpcf_total_areas_cm2[t]); + h_rpcf_total_area->SetBinContent(t, areas_.rpcf_total_areas_cm2[t]); } - h_rpcf_total_area->SetBinContent(0, evtn); // store it in underflow + h_rpcf_total_area->SetBinContent(RPCF_TYPES+1, evtn); // store it in overflow h_rpcf_total_area->SetEntries(RPCF_TYPES+2); h_rpcf_hit_flux_per_layer->Sumw2(); @@ -1367,9 +1377,9 @@ void MuSimHitOccupancy::endJob() if (do_rpc_) for (int t=0; t <= RPCB_TYPES; t++) { - h_rpcb_total_area->SetBinContent(t+1, areas_.rpcb_total_areas_cm2[t]); + h_rpcb_total_area->SetBinContent(t, areas_.rpcb_total_areas_cm2[t]); } - h_rpcb_total_area->SetBinContent(0, evtn); // store it in underflow + h_rpcb_total_area->SetBinContent(RPCB_TYPES+1, evtn); // store it in overflow h_rpcb_total_area->SetEntries(RPCB_TYPES+2); h_rpcb_hit_flux_per_layer->Sumw2(); @@ -1387,9 +1397,9 @@ void MuSimHitOccupancy::endJob() if (do_dt_) for (int t=0; t <= DT_TYPES; t++) { - h_dt_total_area->SetBinContent(t+1, areas_.dt_total_areas_cm2[t]); + h_dt_total_area->SetBinContent(t, areas_.dt_total_areas_cm2[t]); } - h_dt_total_area->SetBinContent(0, evtn); // store it in underflow + h_dt_total_area->SetBinContent(DT_TYPES+1, evtn); // store it in overflow h_dt_total_area->SetEntries(DT_TYPES+2); h_dt_hit_flux_per_layer->Sumw2(); diff --git a/SimMuL1/src/MuGeometryHelpers.cc b/SimMuL1/src/MuGeometryHelpers.cc index 431b62933c281..4fdbc372ea33c 100644 --- a/SimMuL1/src/MuGeometryHelpers.cc +++ b/SimMuL1/src/MuGeometryHelpers.cc @@ -112,8 +112,10 @@ void mugeo::MuGeometryAreas::calculateGEMDetectorAreas(const GEMGeometry* g) } cout<<"========================"< Date: Wed, 14 Aug 2013 14:09:36 +0200 Subject: [PATCH 083/182] minor fix --- SimMuL1/scripts/drawplot_eff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimMuL1/scripts/drawplot_eff.py b/SimMuL1/scripts/drawplot_eff.py index d6a5a9acc9f50..78c3be490068a 100644 --- a/SimMuL1/scripts/drawplot_eff.py +++ b/SimMuL1/scripts/drawplot_eff.py @@ -355,7 +355,7 @@ def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): if closeFar == "Close": xpos = 0.57 else: - xpos = 0.61 + xpos = 0.611 tex = TLatex(xpos,.68,'"%s" chamber pairs'%(closeFar)) tex.Draw("same") From de8ded3d7bb94c5cf04d23297e01ffaffcc84573 Mon Sep 17 00:00:00 2001 From: Vadim Khotilovich Date: Wed, 14 Aug 2013 15:14:38 -0500 Subject: [PATCH 084/182] new filter module: selects events with CSC chambers with simhits --- SimMuL1/plugins/MESimHitFilter.cc | 128 ++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 SimMuL1/plugins/MESimHitFilter.cc diff --git a/SimMuL1/plugins/MESimHitFilter.cc b/SimMuL1/plugins/MESimHitFilter.cc new file mode 100644 index 0000000000000..e99113a50beaf --- /dev/null +++ b/SimMuL1/plugins/MESimHitFilter.cc @@ -0,0 +1,128 @@ +// -*- C++ -*- +// +// Package: MESimHitFilter +// Class: MESimHitFilter +// +/**\class MESimHitFilter + + Description: [one line class summary] + + Implementation: + [Notes on implementation] +*/ +// +// Original Author: Vadim Khotilovich +// Created: Wed Aug 14 13:32:41 CDT 2013 +// $Id$ +// +// + + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDFilter.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "DataFormats/MuonDetId/interface/CSCDetId.h" +#include "GEMCode/SimMuL1/interface/PSimHitMapCSC.h" + +#include +#include + +// +// class declaration +// + +class MESimHitFilter : public edm::EDFilter +{ +public: + explicit MESimHitFilter(const edm::ParameterSet&); + ~MESimHitFilter(); + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + virtual void beginJob() ; + virtual bool filter(edm::Event&, const edm::EventSetup&); + virtual void endJob() ; + + SimHitAnalysis::PSimHitMapCSC simhit_map_csc_; + + std::set me_types_; +}; + + + +MESimHitFilter::MESimHitFilter(const edm::ParameterSet& cfg) +{ + const std::vector def_types {1,4,5}; // ME1/a ME1/b ME2/1 + std::vector types_cfg = cfg.getUntrackedParameter >("me_types", def_types); + std::copy(types_cfg.begin(), types_cfg.end(), inserter(me_types_, me_types_.begin())); + + edm::InputTag def_input("g4SimHits","MuonCSCHits"); + simhit_map_csc_.setInputTag(def_input); + +} + + +MESimHitFilter::~MESimHitFilter() +{ +} + + +bool MESimHitFilter::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + using namespace edm; + using namespace std; + + simhit_map_csc_.fill(iEvent); + + vector ch_ids = simhit_map_csc_.chambersWithHits(); + if (ch_ids.empty()) return false; + + for(auto d: ch_ids) + { + CSCDetId ch_id(d); + + // is it a chamber type of interest? + if (me_types_.count(ch_id.iChamberType()) == 0) continue; + + // count number of layers with hits + vector layer_ids = simhit_map_csc_.chamberLayersWithHits(d); + //cout<= 4) return true; + } + + return false; +} + + +void MESimHitFilter::beginJob() +{ +} + + +void MESimHitFilter::endJob() +{ +} + +// ------------ method fills 'descriptions' with the allowed parameters for the module ------------ +void +MESimHitFilter::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + //The following says we do not know what parameters are allowed so do no validation + // Please change this to state exactly what you do use, even if it is no parameters + edm::ParameterSetDescription desc; + desc.setUnknown(); + descriptions.addDefault(desc); +} + +//define this as a plug-in +DEFINE_FWK_MODULE(MESimHitFilter); + From ccf6a5b398e57a141a4681878bcf3b27f7b19564 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 15 Aug 2013 19:57:30 +0200 Subject: [PATCH 085/182] Vadim made a better analyzer --- .../{NeutronSimHitAnalyzer.cc => NeutronSimHitAnalyzer.cc.txt} | 0 ...tronSimHitAnalyzer_cfi.py => NeutronSimHitAnalyzer_cfi.py.txt} | 0 ...nSimHitAnalyzer_cfg.py => runNeutronSimHitAnalyzer_cfg.py.txt} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename SimMuL1/plugins/{NeutronSimHitAnalyzer.cc => NeutronSimHitAnalyzer.cc.txt} (100%) rename SimMuL1/python/{NeutronSimHitAnalyzer_cfi.py => NeutronSimHitAnalyzer_cfi.py.txt} (100%) rename SimMuL1/test/{runNeutronSimHitAnalyzer_cfg.py => runNeutronSimHitAnalyzer_cfg.py.txt} (100%) diff --git a/SimMuL1/plugins/NeutronSimHitAnalyzer.cc b/SimMuL1/plugins/NeutronSimHitAnalyzer.cc.txt similarity index 100% rename from SimMuL1/plugins/NeutronSimHitAnalyzer.cc rename to SimMuL1/plugins/NeutronSimHitAnalyzer.cc.txt diff --git a/SimMuL1/python/NeutronSimHitAnalyzer_cfi.py b/SimMuL1/python/NeutronSimHitAnalyzer_cfi.py.txt similarity index 100% rename from SimMuL1/python/NeutronSimHitAnalyzer_cfi.py rename to SimMuL1/python/NeutronSimHitAnalyzer_cfi.py.txt diff --git a/SimMuL1/test/runNeutronSimHitAnalyzer_cfg.py b/SimMuL1/test/runNeutronSimHitAnalyzer_cfg.py.txt similarity index 100% rename from SimMuL1/test/runNeutronSimHitAnalyzer_cfg.py rename to SimMuL1/test/runNeutronSimHitAnalyzer_cfg.py.txt From 33949730fd119442c7fa3ac37006068175d45a26 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 15 Aug 2013 23:47:04 +0200 Subject: [PATCH 086/182] clean-up of trigger plotting machinery --- SimMuL1/scripts/drawplot_gmtrt.py | 1382 ----------------- SimMuL1/scripts/helpers.py | 36 - .../produceRateVsEtaPlotsForApproval.py | 279 ++++ .../produceRateVsPtPlotsForApproval.py | 477 ++++++ SimMuL1/scripts/triggerPlotHelpers.py | 237 +++ 5 files changed, 993 insertions(+), 1418 deletions(-) delete mode 100644 SimMuL1/scripts/drawplot_gmtrt.py delete mode 100644 SimMuL1/scripts/helpers.py create mode 100644 SimMuL1/scripts/produceRateVsEtaPlotsForApproval.py create mode 100644 SimMuL1/scripts/produceRateVsPtPlotsForApproval.py create mode 100644 SimMuL1/scripts/triggerPlotHelpers.py diff --git a/SimMuL1/scripts/drawplot_gmtrt.py b/SimMuL1/scripts/drawplot_gmtrt.py deleted file mode 100644 index 3a48a37954973..0000000000000 --- a/SimMuL1/scripts/drawplot_gmtrt.py +++ /dev/null @@ -1,1382 +0,0 @@ -from helpers import * -from ROOT import * - -## Attempt to pyrootize the drawplot_gmtrt.C script - -pdir = "" -dir = "SimMuL1StrictAll" - -gem_dir = "gem/" -gem_label = "gem98" -pdir = "plots/" - -gNPU=100 -gNEvt=238000 - -gdy = [0.1, 2500] - -ptscale = [-1., 0., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 6., 7., 8., 10., 12., 14., - 16., 18., 20., 25., 30., 35., 40., 45., 50., 60., 70., 80., 90., 100., 120., 140.] - -ptscaleb = [1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 6., 7., 8., 10., 12., 14., - 16., 18., 20., 25., 30., 35., 40., 45., 50., 60., 70., 80., 90., 100., 120., 140., 150.] - -ptscaleb_ = [1.25, 1.75, 2.25, 2.75, 3.25, 3.75, 4.25, 4.75, 5.5, 6.5, 7.5, 9., 11., 13., 15., - 17., 19., 22.5, 27.5, 32.5, 37.5, 42.5, 47.5, 55., 65., 75., 85., 95., 110., 130., 150.] - -def drawLumiBXPULabel(): - tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}") - tex.SetNDC() - tex.Draw() - - -def setHistoPt(f_name, name, cname, title, lcolor, lstyle, lwidth): - print "Opening ", f_name - f = TFile.Open(f_name) - h0 = getH(f, dir, name) - nb = h0.GetXaxis().GetNbins() - h = TH1D(name+cname,title,30,ptscaleb) - for b in range(1,nb+1): - bc = h0.GetBinContent(b) - if (bc==0): - continue - bin = h.GetXaxis().FindFixBin(h0.GetBinCenter(b)) - ##cout< 0.): - tex.SetFontSize(font_size) - tex.SetNDC() - tex.Draw() - return tex - - -def gem_rate_draw(): - gStyle.SetOptStat(0) - gStyle.SetTitleStyle(0) - ##gStyle.SetPadTopMargin(0.08) - gStyle.SetTitleH(0.06) - - ptreb = 2 - hdir = "SimMuL1StrictAll" - - f_def = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root" - f_g98_pt10 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt10_pat2.root" - f_g98_pt15 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt15_pat2.root" - f_g98_pt20 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt20_pat2.root" - f_g98_pt30 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat2.root" - f_g98_pt40 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat2.root" - - sprintf(pdir,"%s", gem_dir.Data()) - - rpt = [0.,49.99] - - htitle = "Efficiency for #mu in 1.6<|#eta|<2.12 to have TF track;p_{T}^{MC}" - - hini = "h_pt_initial_1b" - h2s = "h_pt_after_tfcand_eta1b_2s" - h3s = "h_pt_after_tfcand_eta1b_3s" - h2s1b = "h_pt_after_tfcand_eta1b_2s1b" - h3s1b = "h_pt_after_tfcand_eta1b_3s1b" - - - ##gdy[0]=0 gdy[1]=7. - ##if (vs_eta_minpt=="20") gdy[1]=10. - miny = 0.01, maxy - - ### Trigger rate plots with PT >= 20 - - vs_eta_minpt = "20" - ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; - - - h_rt_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); - h_rt_tf20_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); - h_rt_tf20_gpt20_2s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); - - h_rt_tf20_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); - h_rt_tf20_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_tf20_gpt20_3s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); - - h_rt_tf20_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_tf20_gpt20_3s1ab = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kGreen+3, 7, 2); - - - ## cAll100 = TCanvas("cAll100","cAll100",800,600) ; - ## cAll100.SetLogy(1); - ## maxy = 300;## 45; - ## h_rt_tf20_2s.GetYaxis().SetRangeUser(miny,maxy); - ## h_rt_tf20_2s1b.GetYaxis().SetRangeUser(miny,maxy); - ## h_rt_tf20_gpt20_2s1b.GetYaxis().SetRangeUser(miny,maxy); - ## h_rt_tf20_2s.Draw("hist e1"); - ## h_rt_tf20_gpt20_2s1b.Draw("hist e1 same"); - ## h_rt_tf20_2s.Draw("hist e1 same"); - ## h_rt_tf20_2s1b.Draw("hist e1 same"); - ## leg = TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); - ## leg.SetBorderSize(0); - ## leg.SetFillStyle(0); - ## leg.AddEntry(h_rt_tf20_2s,"Tracks: p_{T}>=20, 2+ stubs",""); - ## leg.AddEntry(h_rt_tf20_2s,"anywhere","l"); - ## leg.AddEntry(h_rt_tf20_2s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - ## leg.AddEntry(h_rt_tf20_gpt20_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - ## leg.Draw(); - ## tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - ## tex.SetNDC(); - ## tex.Draw(); - ## Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); - - ## cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; - ## gPad.SetGridx(1); - ## gPad.SetGridy(1); - ## gem_ratio = setHistoRatio(h_rt_tf20_gpt20_2s1b, h_rt_tf20_2s1b, "", 0.,1.8); - ## gem_ratio.Draw("e1"); - ## Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b__ratio.png").Data()); - - - ##======================== 3+ Stubs ================================## - - ## ((TCanvas*)gROOT.FindObject("cAll100")).cd(); - ## maxy = 30.;##10; - ## h_rt_tf20_3s.GetYaxis().SetRangeUser(miny,maxy); - ## h_rt_tf20_3s1b.GetYaxis().SetRangeUser(miny,maxy); - ## h_rt_tf20_gpt20_3s1b.GetYaxis().SetRangeUser(miny,maxy); - ## h_rt_tf20_3s.Draw("hist e1"); - ## h_rt_tf20_gpt20_3s1b.Draw("hist e1 same"); - ## h_rt_tf20_3s.Draw("hist e1 same"); - ## h_rt_tf20_3s1b.Draw("hist e1 same"); - ## leg = TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); - ## leg.SetBorderSize(0); - ## leg.SetFillStyle(0); - ## leg.AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); - ## leg.AddEntry(h_rt_tf20_3s,"anywhere","l"); - ## leg.AddEntry(h_rt_tf20_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - ## leg.AddEntry(h_rt_tf20_gpt20_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - ## leg.Draw(); - ## tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - ## tex.SetNDC(); - ## tex.Draw(); - ## Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); - - ## cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; - ## gPad.SetGridx(1);gPad.SetGridy(1); - ## gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1b, h_rt_tf20_3s1b, "", 0.,1.8); - ## gem_ratio.Draw("e1"); - ## Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); - - - ##======================== 3+ Stubs Including the region ME1/1a ================================## - - ## (gROOT.FindObject("cAll100")).cd(); - ## h_rt_tf20_3s.Draw("hist e1"); - ## h_rt_tf20_gpt20_3s1ab.Draw("hist e1 same"); - ## h_rt_tf20_3s.Draw("hist e1 same"); - ## h_rt_tf20_3s1ab.Draw("hist e1 same"); - ## maxy = 30.; - ## 10; - ## h_rt_tf20_3s1ab.GetYaxis().SetRangeUser(miny,maxy); - ## h_rt_tf20_gpt20_3s1ab.GetYaxis().SetRangeUser(miny,maxy); - ## leg = TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); - ## leg.SetBorderSize(0); - ## leg.SetFillStyle(0); - ## leg.AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); - ## leg.AddEntry(h_rt_tf20_3s,"anywhere","l"); - ## leg.AddEntry(h_rt_tf20_3s1ab,"with ME1 in 1.6<|#eta|","l"); - ## leg.AddEntry(h_rt_tf20_gpt20_3s1ab,"with (ME1+GEM) in 1.6<|#eta|","l"); - ## leg.Draw(); - ## tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - ## tex.SetNDC(); - ## tex.Draw(); - ## Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); - - ## cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; - ## gPad.SetGridx(1);gPad.SetGridy(1); - ## gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1ab, h_rt_tf20_3s1ab, "", 0.,1.8); - ## gem_ratio.Draw("e1"); - ## Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); - - ### Trigger rate plots with PT >= 20 - - vs_eta_minpt = "30"; - ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; - - ## h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); - ## h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); - ## h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); - h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); - h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_tf30_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kAzure+2, 1, 2); - h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); - h_rt_tf30_gpt30_3s1ab = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kGreen, 7, 2); - - ## cAll100 = TCanvas("cAll100","cAll100",800,600) ; - ## cAll100.SetLogy(1); - ## h_rt_tf30_2s.Draw("hist e1"); - ## h_rt_tf30_gpt30_2s1b.Draw("hist e1 same"); - ## h_rt_tf30_2s.Draw("hist e1 same"); - ## h_rt_tf30_2s1b.Draw("hist e1 same"); - ## maxy = 120.;##35.; - ## h_rt_tf30_2s.GetYaxis().SetRangeUser(miny,maxy); - ## h_rt_tf30_2s1b.GetYaxis().SetRangeUser(miny,maxy); - ## h_rt_tf30_gpt30_2s1b.GetYaxis().SetRangeUser(miny,maxy); - ## leg = TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); - ## leg.SetBorderSize(0); - ## leg.SetFillStyle(0); - ## leg.AddEntry(h_rt_tf30_2s,"Tracks: p_{T}>=30, 2+ stubs",""); - ## leg.AddEntry(h_rt_tf30_2s,"anywhere","l"); - ## leg.AddEntry(h_rt_tf30_2s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - ## leg.AddEntry(h_rt_tf30_gpt30_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - ## leg.Draw(); - ## tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - ## tex.SetNDC(); - ## tex.Draw(); - ## Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); - - ## cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; - ## gPad.SetGridx(1);gPad.SetGridy(1); - ## gem_ratio = setHistoRatio(h_rt_tf30_gpt30_2s1b, h_rt_tf30_2s1b, "", 0.,1.8); - ## gem_ratio.Draw("e1"); - ## Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b__ratio.png").Data()); - - - ## (gROOT.FindObject("cAll100")).cd(); - ## h_rt_tf30_3s.Draw("hist e1"); - ## h_rt_tf30_gpt30_3s1b.Draw("hist e1 same"); - ## h_rt_tf30_3s.Draw("hist e1 same"); - ## h_rt_tf30_3s1b.Draw("hist e1 same"); - ## maxy = 30.;##7.; - ## h_rt_tf30_3s.GetYaxis().SetRangeUser(miny,maxy); - ## h_rt_tf30_3s1b.GetYaxis().SetRangeUser(miny,maxy); - ## h_rt_tf30_gpt30_3s1b.GetYaxis().SetRangeUser(miny,maxy); - ## leg = TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); - ## leg.SetBorderSize(0); - ## leg.SetFillStyle(0); - ## leg.AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); - ## leg.AddEntry(h_rt_tf30_3s,"anywhere","l"); - ## leg.AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - ## leg.AddEntry(h_rt_tf30_gpt30_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - ## leg.Draw(); - ## tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - ## tex.SetNDC(); - ## tex.Draw(); - ## Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); - - ## cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; - ## gPad.SetGridx(1);gPad.SetGridy(1); - ## gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1b, h_rt_tf30_3s1b, "", 0.,1.8); - ## gem_ratio.Draw("e1"); - ## Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); - - - ##========================== Including the ME1a ==========================## - - ## (gROOT.FindObject("cAll100")).cd(); - ## h_rt_tf30_3s.Draw("hist e1"); - ## h_rt_tf30_gpt30_3s1ab.Draw("hist e1 same"); - ## h_rt_tf30_3s.Draw("hist e1 same"); - ## h_rt_tf30_3s1ab.Draw("hist e1 same"); - ## h_rt_tf30_3s.GetYaxis().SetRangeUser(miny,maxy); - ## h_rt_tf30_3s1ab.GetYaxis().SetRangeUser(miny,maxy); - ## h_rt_tf30_gpt30_3s1ab.GetYaxis().SetRangeUser(miny,maxy); - ## leg = TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); - ## leg.SetBorderSize(0); - ## leg.SetFillStyle(0); - ## leg.AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); - ## leg.AddEntry(h_rt_tf30_3s,"anywhere","l"); - ## leg.AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|","l"); - ## leg.AddEntry(h_rt_tf30_gpt30_3s1ab,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - ## leg.Draw(); - ## tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - ## tex.SetNDC(); - ## tex.Draw(); - ## Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); - - ## cAll100r2 = TCanvas("cAll100r2","cAll100r2",800,300) ; - ## gPad.SetGridx(1);gPad.SetGridy(1); - ## gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1ab, h_rt_tf30_3s1ab, "", 0.,1.8); - ## gem_ratio.Draw("e1"); - ## Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); - - ##========================== Comparison with/withous Stub in ME1a ==========================## - - ## (gROOT.FindObject("cAll100")).cd(); - ## h_rt_tf30_3s1b.Draw("hist e1"); - ## h_rt_tf30_3s1ab.Draw("hist e1 same"); - ## leg = TLegend(0.2,0.65,.80,0.90,NULL,"brNDC"); - ## leg.SetBorderSize(0); - ## leg.SetFillStyle(0); - ## leg.AddEntry(h_rt_tf30_3s1b,"Tracks: p_{T}>=30, 3+ stubs",""); - ## leg.AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - ## leg.AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|<2.4","l"); - ## leg.Draw(); - ## Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); - - ## cAll100r2 = TCanvas("cAll100r2","cAll100r2",800,300) ; - ## gPad.SetGridx(1);gPad.SetGridy(1); - ## gem_ratio = setHistoRatio2(h_rt_tf30_3s1ab, h_rt_tf30_3s1b, "", 0.,1.8); - ## gem_ratio.Draw("e1"); - ## Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio_compstubME1a.png").Data()); - - ##========================== Comparison with/withous Stub in ME1a + GEMS ==========================## - - """ - (gROOT.FindObject("cAll100")).cd(); - h_rt_tf30_gpt30_3s1b.Draw("hist e1"); - h_rt_tf30_gpt30_3s1ab.Draw("hist e1 same"); - leg = TLegend(0.2,0.65,.80,0.90,NULL,"brNDC"); - leg.SetBorderSize(0); - leg.SetFillStyle(0); - leg.AddEntry(h_rt_tf30_3s1b,"Tracks: p_{T}>=30, 3+ stubs",""); - leg.AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - leg.AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|<2.4","l"); - leg.Draw(); - Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); - - cAll100r2 = TCanvas("cAll100r2","cAll100r2",800,300) ; - gPad.SetGridx(1);gPad.SetGridy(1); - gem_ratio = setHistoRatio2(h_rt_tf30_3s1ab, h_rt_tf30_3s1b, "", 0.,1.8); - gem_ratio.Draw("e1"); - Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio_compstubME1a.png").Data()); - """ - -def drawplot_gmtrt(dname = "", vs_eta_minpt = ""): - - ##gStyle.SetStatW(0.13); - ##gStyle.SetStatH(0.08); - gStyle.SetStatW(0.07); - gStyle.SetStatH(0.06); - gStyle.SetOptStat(0); - gStyle.SetTitleStyle(0); - gStyle.SetTitleAlign(13);## coord in top left - gStyle.SetTitleX(0.); - gStyle.SetTitleY(1.); - gStyle.SetTitleW(1); - gStyle.SetTitleH(0.058); - gStyle.SetTitleBorderSize(0); - gStyle.SetPadLeftMargin(0.126); - gStyle.SetPadRightMargin(0.04); - gStyle.SetPadTopMargin(0.06); - gStyle.SetPadBottomMargin(0.13); - gStyle.SetMarkerStyle(1); - - """ - d1="" - d2="" - if (dname != ""): - sprintf(d1,"_%s", dname.Data()); - ##if (strcmp(pu,"")>0) sprintf(d2,"_%s",pu); - ##sprintf(pdir,"pic%s%s",d1,d2); - - if (interactive && dname != "") { - sprintf(pdir,"pic%s%s",d1,d2); - if( gSystem.AccessPathName(pdir)==0 ) { - ##cout<<"directory "<=3 stubs in 1<|#eta|<2.4",""); - leg_cc100.AddEntry(hAll100,"except in ME1/b region require",""); - leg_cc100.AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - tex.SetNDC(); - tex.Draw(); - - Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-2s1b__gem-3s-2s1b.png").Data()); - - if (do_return) return; - - - ## full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b - gdy[0]=0; gdy[1]=7.; - if (vs_eta_minpt=="20") gdy[1]=10.; - - ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; - hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+9, 1, 2); - hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - - ##gStyle.SetPadTopMargin(0.08); - gStyle.SetTitleH(0.06); - cAll100 = TCanvas("cAll100","cAll100",800,600) ; - hAll100.Draw("hist e1"); - hAll100gem.Draw("hist e1 same"); - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - ##leg_cc100.SetTextSize(0.0368); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(hAll100,"default emulator","l"); - leg_cc100.AddEntry(hAll100gem,"with GEM match","l"); - leg_cc100.AddEntry(hAll100,"Tracks req. for both:",""); - leg_cc100.AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100.AddEntry(hAll100,"in ME1/b region also require",""); - leg_cc100.AddEntry(hAll100,"one stub to be from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - tex.SetNDC(); - tex.Draw(); - - Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); - - ## full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b - gdy[0]=0; gdy[1]=7.; - if (vs_eta_minpt=="20") gdy[1]=10.; - - ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; - hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); - hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - - ##gStyle.SetPadTopMargin(0.08); - gStyle.SetTitleH(0.06); - cAll100 = TCanvas("cAll100","cAll100",800,600) ; - hAll100.Draw("hist e1"); - hAll100gem.Draw("hist e1 same"); - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - ##leg_cc100.SetTextSize(0.0368); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(hAll100,"default emulator","l"); - leg_cc100.AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100.AddEntry(hAll100gem,"with GEM match","l"); - leg_cc100.AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100.AddEntry(hAll100,"except in ME1/b region require",""); - leg_cc100.AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - tex.SetNDC(); - tex.Draw(); - - Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-2s1b.png").Data()); - - ## full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b - gdy[0]=0; gdy[1]=7.; - if (vs_eta_minpt=="20") gdy[1]=10.; - - ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin [kHz]"; - hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); - hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - - ##gStyle.SetPadTopMargin(0.08); - gStyle.SetTitleH(0.06); - cAll100 = TCanvas("cAll100","cAll100",800,600) ; - hAll100.Draw("hist e1"); - hAll100gem.Draw("hist e1 same"); - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - ##leg_cc100.SetTextSize(0.0368); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(hAll100,"default emulator","l"); - leg_cc100.AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100.AddEntry(hAll100gem,"with GEM match","l"); - leg_cc100.AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100.AddEntry(hAll100,"in ME1/b region also require",""); - leg_cc100.AddEntry(hAll100,"one stub to be from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - tex.SetNDC(); - tex.Draw(); - - Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-3s1b.png").Data()); - - if (do_return) return; - - - ## full eta 1. - 2.4 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b - gdy[0]=2; gdy[1]=2000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); - - cAll100 = TCanvas("cAll100","cAll100",800,600) ; - gPad.SetLogx(1);gPad.SetLogy(1); - gPad.SetGridx(1);gPad.SetGridy(1); - hAll100.Draw("e3"); - hAll100gem.Draw("e3 same"); - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - ##leg_cc100.SetTextSize(0.0368); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(hAll100,"default emulator","f"); - leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100.AddEntry(hAll100,"Tracks req. for both:",""); - leg_cc100.AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100.AddEntry(hAll100,"except in ME1/b region require",""); - leg_cc100.AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex.SetNDC(); - tex.Draw(); - - Print(cAll100, "rates__1-2.4__PU100__def-3s-2s1b__gem-3s-2s1b.png"); - - - cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; - gPad.SetLogx(1);##gPad.SetLogy(1); - gPad.SetGridx(1);gPad.SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.4); - hAll100gem_ratio.Draw("e1"); - - Print(cAll100r, "rates__1-2.4__PU100__def-3s-2s1b__gem-3s-2s1b__ratio.png"); - - ## full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b - gdy[0]=2; gdy[1]=2000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); - - cAll100 = TCanvas("cAll100","cAll100",800,600) ; - gPad.SetLogx(1);gPad.SetLogy(1); - gPad.SetGridx(1);gPad.SetGridy(1); - hAll100.Draw("e3"); - hAll100gem.Draw("e3 same"); - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - ##leg_cc100.SetTextSize(0.0368); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(hAll100,"default emulator","f"); - leg_cc100.AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.4",""); - leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100.AddEntry(hAll100,"Tracks: same, except in ME1/b region req.",""); - leg_cc100.AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex.SetNDC(); - tex.Draw(); - - Print(cAll100, "rates__1-2.4__PU100__def-3s__gem-3s-2s1b.png"); - - - cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; - gPad.SetLogx(1);##gPad.SetLogy(1); - gPad.SetGridx(1);gPad.SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); - hAll100gem_ratio.Draw("e1"); - - Print(cAll100r, "rates__1-2.4__PU100__def-3s__gem-3s-2s1b__ratio.png"); - - - ## no ME1/a eta 1. - 2.1 Default: 3station GEM: 3station, 3s & 1b - gdy[0]=2; gdy[1]=2000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_no1a", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); - - cAll100 = TCanvas("cAll100","cAll100",800,600) ; - gPad.SetLogx(1);gPad.SetLogy(1); - gPad.SetGridx(1);gPad.SetGridy(1); - hAll100.Draw("e3"); - hAll100gem.Draw("e3 same"); - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - ##leg_cc100.SetTextSize(0.0368); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(hAll100,"default emulator","f"); - leg_cc100.AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.1",""); - leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100.AddEntry(hAll100,"Tracks: same, except in ME1/b region req.",""); - leg_cc100.AddEntry(hAll100,">=3 stubs and one of them from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex.SetNDC(); - tex.Draw(); - - Print(cAll100, "rates__1-2.1__PU100__def-3s__gem-3s-3s1b.png"); - - - cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; - gPad.SetLogx(1); - gPad.SetGridx(1);gPad.SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); - hAll100gem_ratio.Draw("e1"); - - Print(cAll100r, "rates__1-2.1__PU100__def-3s__gem-3s-3s1b__ratio.png"); - - - result_gem_eta_no1a = hAll100gem; - result_def_eta_no1a = hAll100; - - ## no ME1/a eta 1. - 2.1 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b - gdy[0]=2; gdy[1]=2000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); - - cAll100 = TCanvas("cAll100","cAll100",800,600) ; - gPad.SetLogx(1);gPad.SetLogy(1); - gPad.SetGridx(1);gPad.SetGridy(1); - hAll100.Draw("e3"); - hAll100gem.Draw("e3 same"); - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - ##leg_cc100.SetTextSize(0.0368); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(hAll100,"default emulator","f"); - leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100.AddEntry(hAll100,"Tracks req. for both:",""); - leg_cc100.AddEntry(hAll100,"with >=3 stubs in 1<|#eta|<2.1",""); - leg_cc100.AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex.SetNDC(); - tex.Draw(); - - Print(cAll100, "rates__1-2.1__PU100__def-3s-3s1b__gem-3s-3s1b.png"); - - - cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; - gPad.SetLogx(1); - gPad.SetGridx(1);gPad.SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); - hAll100gem_ratio.Draw("e1"); - - Print(cAll100r, "rates__1-2.1__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); - - ##result_gem_eta_no1a = hAll100gem; - result_def_eta_no1a_3s1b = hAll100; - - - ## Full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b - gdy[0]=2; gdy[1]=2000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); - - cAll100 = TCanvas("cAll100","cAll100",800,600) ; - gPad.SetLogx(1);gPad.SetLogy(1); - gPad.SetGridx(1);gPad.SetGridy(1); - hAll100.Draw("e3"); - hAll100gem.Draw("e3 same"); - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - ##leg_cc100.SetTextSize(0.0368); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(hAll100,"default emulator","f"); - leg_cc100.AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.4",""); - leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100.AddEntry(hAll100,"Tracks: same, except",""); - leg_cc100.AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex.SetNDC(); - tex.Draw(); - - Print(cAll100, "rates__1-2.4__PU100__def-3s__gem-3s-3s1b.png"); - - - cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; - gPad.SetLogx(1); - gPad.SetGridx(1);gPad.SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); - hAll100gem_ratio.Draw("e1"); - - Print(cAll100r, "rates__1-2.4__PU100__def-3s__gem-3s-3s1b__ratio.png"); - - result_gem_eta_all = hAll100gem; - result_def_eta_all = hAll100; - - - ## Full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b - gdy[0]=2; gdy[1]=2000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); - - cAll100 = TCanvas("cAll100","cAll100",800,600) ; - gPad.SetLogx(1);gPad.SetLogy(1); - gPad.SetGridx(1);gPad.SetGridy(1); - hAll100.Draw("e3"); - hAll100gem.Draw("e3 same"); - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - ##leg_cc100.SetTextSize(0.0368); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(hAll100,"default emulator","f"); - leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100.AddEntry(hAll100,"Tracks req. for both:",""); - leg_cc100.AddEntry(hAll100,"with >=3 stubs in 1<|#eta|<2.4",""); - leg_cc100.AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex.SetNDC(); - tex.Draw(); - - Print(cAll100, "rates__1-2.4__PU100__def-3s-3s1b__gem-3s-3s1b.png"); - - - cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; - gPad.SetLogx(1); - gPad.SetGridx(1);gPad.SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.6); - hAll100gem_ratio.Draw(); - - Print(cAll100r, "rates__1-2.4__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); - - ##result_gem_eta_all = hAll100gem; - result_def_eta_all_3s1b = hAll100; - - - - ## ME1b eta 1.64 - 2.14 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b - gdy[0]=0.02; gdy[1]=1000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); - - cAll100 = TCanvas("cAll100","cAll100",800,600) ; - gPad.SetLogx(1);gPad.SetLogy(1); - gPad.SetGridx(1);gPad.SetGridy(1); - hAll100.Draw("e3"); - hAll100gem.Draw("e3 same"); - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - ##leg_cc100.SetTextSize(0.0368); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(hAll100,"default emulator","f"); - leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100.AddEntry(hAll100,"Tracks req. for both:",""); - leg_cc100.AddEntry(hAll100,"with >=3 stubs in 1.64<|#eta|<2.14",""); - leg_cc100.AddEntry(hAll100,"and require one stub to be from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex.SetNDC(); - tex.Draw(); - - Print(cAll100, "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b.png"); - - - cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; - gPad.SetLogx(1); - gPad.SetGridx(1);gPad.SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,2.1); - hAll100gem_ratio.Draw("e1"); - - Print(cAll100r, "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); - - result_gem = hAll100gem; - result_def_3s1b = hAll100; - - - ## ME1b eta 1.64 - 2.14 Default: 3station, 3s GEM: 3station, 3s & 1b - gdy[0]=0.02; gdy[1]=1000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); - - cAll100 = TCanvas("cAll100","cAll100",800,600) ; - gPad.SetLogx(1);gPad.SetLogy(1); - gPad.SetGridx(1);gPad.SetGridy(1); - hAll100.Draw("e3"); - hAll100gem.Draw("e3 same"); - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - ##leg_cc100.SetTextSize(0.0368); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(hAll100,"default emulator","f"); - leg_cc100.AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); - leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100.AddEntry(hAll100,"Tracks: same, plus req. one stub from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex.SetNDC(); - tex.Draw(); - - Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b.png"); - - - cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; - gPad.SetLogx(1); - gPad.SetGridx(1);gPad.SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,1.1); - hAll100gem_ratio.Draw("e1"); - - Print(cAll100r, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__ratio.png"); - - ##result_gem = hAll100gem; - result_def = hAll100; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_2s_1b", "_hAll100s2", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); - result_def_2s = hAll100; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_2s_1b", "_hAll100s2", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); - result_def_2s = hAll100; - - - ## ME1b eta 1.64 - 2.14 Default: 3station, 3s GMT single trigg - gdy[0]=0.02; gdy[1]=1000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_ptmax_sing_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+1, 1, 1); - - cAll100 = TCanvas("cAll100","cAll100",800,600) ; - gPad.SetLogx(1);gPad.SetLogy(1); - gPad.SetGridx(1);gPad.SetGridy(1); - hAll100.Draw("e3"); - hAll100gem.Draw("e3 same"); - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - ##leg_cc100.SetTextSize(0.0368); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); - leg_cc100.AddEntry(hAll100gem,"GMT selection for Single Trigger","f"); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex.SetNDC(); - tex.Draw(); - - Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gmtsing.png"); - - result_def_gmtsing = hAll100gem; - - ## ME1b eta 1.64 - 2.14 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b - gdy[0]=0.02; gdy[1]=1000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); - - cAll100 = TCanvas("cAll100","cAll100",800,600) ; - gPad.SetLogx(1);gPad.SetLogy(1); - gPad.SetGridx(1);gPad.SetGridy(1); - hAll100.Draw("e3"); - hAll100gem.Draw("e3 same"); - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - ##leg_cc100.SetTextSize(0.0368); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(hAll100,"default emulator","f"); - leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100.AddEntry(hAll100,"Tracks req. for both:",""); - leg_cc100.AddEntry(hAll100,"with >=2 stubs in 1.64<|#eta|<2.14",""); - leg_cc100.AddEntry(hAll100,"and require one stub to be from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex.SetNDC(); - tex.Draw(); - - Print(cAll100, "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b.png"); - - - cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; - gPad.SetLogx(1); - gPad.SetGridx(1);gPad.SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,2.1); - hAll100gem_ratio.Draw("e1"); - - Print(cAll100r, "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__ratio.png"); - - result_gem_2s1b = hAll100gem; - result_def_2s1b = hAll100; - - - """ - - ## ME1b eta 1.64 - 2.14 Default: 3station, 3s GEM: 3station, 2s & 1b - if (1) - { - gdy[0]=0.02; gdy[1]=1000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]", kGreen+3, 1, 1); - - cAll100 = TCanvas("cAll100","cAll100",800,600) ; - gPad.SetLogx(1);gPad.SetLogy(1); - gPad.SetGridx(1);gPad.SetGridy(1); - hAll100.Draw("e3"); - hAll100gem.Draw("e3 same"); - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - ##leg_cc100.SetTextSize(0.0368); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(hAll100,"default emulator","f"); - leg_cc100.AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); - leg_cc100.AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100.AddEntry(hAll100gem,"Tracks: with >=2 stubs in 1.64<|#eta|<2.14",""); - leg_cc100.AddEntry(hAll100gem,"plus req. one stub from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex.SetNDC(); - tex.Draw(); - - Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b.png"); - - - cAll100r = TCanvas("cAll100r","cAll100r",800,300) ; - gPad.SetLogx(1); - gPad.SetGridx(1);gPad.SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,1.1); - hAll100gem_ratio.Draw("e1"); - - Print(cAll100r, "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__ratio.png"); - - result_gem_2s1b = hAll100gem; - ##result_def = hAll100; - - if (do_return) return; - } - - """ - - - -""" - - .L drawplot_gmtrt.C - drawplot_gmtrt("minbias_pt10_pat2") - hh = (TH1D*)result_gem.Clone("gem_new") - hh.SetFillColor(kGreen+4) - for (b = hh.FindBin(15); b <= hh.GetNbinsX(); ++b) hh.SetBinContent(b, 0); - drawplot_gmtrt("minbias_pt15_pat2") - h15 = (TH1D*)result_gem.Clone("gem15") - for (b = h15.FindBin(15); b < h15.FindBin(20); ++b) hh.SetBinContent(b, h15.GetBinContent(b)); - drawplot_gmtrt("minbias_pt20_pat2") - h20 = (TH1D*)result_gem.Clone("gem20") - for (b = h20.FindBin(20); b < h20.FindBin(30); ++b) hh.SetBinContent(b, h20.GetBinContent(b)); - drawplot_gmtrt("minbias_pt30_pat2") - h30 = (TH1D*)result_gem.Clone("gem30") - for (b = h30.FindBin(30); b <= h30.GetNbinsX(); ++b) hh.SetBinContent(b, h30.GetBinContent(b)); - for (b = 1; b <= hh.GetNbinsX(); ++b) if (hh.GetBinContent(b)==0) hh.SetBinError(b, 0.); - - (gROOT.FindObject("cAll100")).cd(); - result_def.Draw("e3"); - hh.Draw("same e3"); - - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(result_def,"default emulator","f"); - leg_cc100.AddEntry(result_def,"Tracks: with >=3 stubs in 1.14<|#eta|<2.14",""); - leg_cc100.AddEntry(hh,"with GEM match","f"); - leg_cc100.AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex.SetNDC(); - tex.Draw(); - - gPad.Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png") - - - (gROOT.FindObject("cAll100r")).cd(); - hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); - hh_ratio.Draw("e1"); - gPad.Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png") - - - (gROOT.FindObject("cAll100")).cd(); - result_def_3s1b.Draw("e3") - hh.Draw("same e3") - - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(result_def_3s1b,"default emulator","f"); - leg_cc100.AddEntry(hh,"with GEM match","f"); - leg_cc100.AddEntry(result_def_3s1b,"Tracks req. for both:",""); - leg_cc100.AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); - leg_cc100.AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex.SetNDC(); - tex.Draw(); - - gPad.Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png") - - - (gROOT.FindObject("cAll100r")).cd(); - hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); - hh_ratio.Draw("e1"); - gPad.Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png") - - - - - .L drawplot_gmtrt.C - drawplot_gmtrt("minbias_pt10_pat8") - hh = (TH1D*)result_gem.Clone("gem_new") - hh.SetFillColor(kGreen+4) - for (b = hh.FindBin(15); b <= hh.GetNbinsX(); ++b) hh.SetBinContent(b, 0); - drawplot_gmtrt("minbias_pt15_pat8") - h15 = (TH1D*)result_gem.Clone("gem15") - for (b = h15.FindBin(15); b < h15.FindBin(20); ++b) hh.SetBinContent(b, h15.GetBinContent(b)); - drawplot_gmtrt("minbias_pt20_pat8") - h20 = (TH1D*)result_gem.Clone("gem20") - for (b = h20.FindBin(20); b < h20.FindBin(30); ++b) hh.SetBinContent(b, h20.GetBinContent(b)); - drawplot_gmtrt("minbias_pt30_pat8") - h30 = (TH1D*)result_gem.Clone("gem30") - for (b = h30.FindBin(30); b <= h30.GetNbinsX(); ++b) hh.SetBinContent(b, h30.GetBinContent(b)); - for (b = 1; b <= hh.GetNbinsX(); ++b) if (hh.GetBinContent(b)==0) hh.SetBinError(b, 0.); - - - (gROOT.FindObject("cAll100")).cd(); - result_def.Draw("e3") - hh.Draw("same e3") - - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(result_def,"default emulator","f"); - leg_cc100.AddEntry(result_def,"Tracks: with >=3 stubs in 1.14<|#eta|<2.14",""); - leg_cc100.AddEntry(hh,"with GEM match","f"); - leg_cc100.AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex.SetNDC(); - tex.Draw(); - - gPad.Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png") - - - (gROOT.FindObject("cAll100r")).cd(); - hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); - hh_ratio.Draw("e1"); - gPad.Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png") - - - - (gROOT.FindObject("cAll100")).cd(); - result_def_3s1b.Draw("e3") - hh.Draw("same e3") - - leg_cc100 = TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); - const TObject obj; - leg_cc100.SetBorderSize(0); - leg_cc100.SetFillStyle(0); - leg_cc100.AddEntry(result_def_3s1b,"default emulator","f"); - leg_cc100.AddEntry(hh,"with GEM match","f"); - leg_cc100.AddEntry(result_def_3s1b,"Tracks req. for both:",""); - leg_cc100.AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); - leg_cc100.AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); - leg_cc100.Draw(); - - tex = TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex.SetNDC(); - tex.Draw(); - - gPad.Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png") - - - (gROOT.FindObject("cAll100r")).cd(); - hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); - hh_ratio.Draw("e1"); - gPad.Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png") - - -""" - - -if __name__ == "__main__": - print "It works!" diff --git a/SimMuL1/scripts/helpers.py b/SimMuL1/scripts/helpers.py deleted file mode 100644 index 9a18fe2086cbc..0000000000000 --- a/SimMuL1/scripts/helpers.py +++ /dev/null @@ -1,36 +0,0 @@ -def GetStat(h): - return h.FindObject("stats") - -def SetOptStat(h, op): - stat = GetStat(h) - stat.SetOptStat(op) - return stat - -def GetH(f, dir, name): - return fi.Get("%s/%s;1"%(dir,name)) - -def Print(c, name): - c.Print("%s/%s"%(pdir,name)) - -def myRebin(h, n): - nb = h.GetNbinsX() - entr = h.GetEntries() - bin0 = h.GetBinContent(0) - binN1 = h.GetBinContent(nb+1) - if (nb % n): - binN1 += h.Integral(nb - nb%n + 1, nb) - h.Rebin(n) - nb = h.GetNbinsX() - h.SetBinContent(0, bin0) - h.SetBinContent(nb+1, binN1) - h.SetEntries(entr) - -def scale(h): - rate = 40000. - nevents = 238000 - bx_window = 3 - bx_filling = 0.795 - h.Scale(rate*bx_filling/(bx_window*nevents)) - -if __name__ == "__main__": - print "It's Working!" diff --git a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.py b/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.py new file mode 100644 index 0000000000000..1adb06f8d7725 --- /dev/null +++ b/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.py @@ -0,0 +1,279 @@ +from triggerPlothelpers import * + +## ROOT modules +from ROOT import * + +## run quiet mode +import sys +sys.argv.append( '-b' ) + +import ROOT +ROOT.gROOT.SetBatch(1) + +gem_dir = "files/" +gem_label = "gem98" +dir = "SimMuL1StrictAll" + +def drawLumiLabel2(x=0.2, y=0.4): + tex = TLatex(x, y,"L = 4*10^{34} cm^{-2} s^{-1}") + tex.SetTextSize(0.05) + tex.SetNDC() + tex.Draw("same") + return tex + +def drawPULabel(x=0.17, y=0.15, font_size=0.): + tex = TLatex(x, y,"L=4*10^{34} (25ns PU100)") + if (font_size > 0.): + tex.SetFontSize(font_size) + tex.SetNDC() + tex.Draw("same") + return tex + +def setHistoEta(f_name, name, cname, title, lcolor, lstyle, lwidth): + f = TFile.Open(f_name) +## print "opening ",f + h0 = GetH(f,dir,name) + h = h0.Clone(name+cname) + h.SetTitle(title) + h.Sumw2() + scale(h) + h.SetLineColor(lcolor) + ##h.SetFillColor(lcolor) + h.SetLineStyle(lstyle) + h.SetLineWidth(lwidth) + h.SetTitle(title) + ##h.GetXaxis().SetRangeUser(1.2, 2.4) + h.GetYaxis().SetRangeUser(0.1,2500) + h.GetXaxis().SetTitleSize(0.055) + h.GetXaxis().SetTitleOffset(1.05) + h.GetXaxis().SetLabelSize(0.045) + h.GetXaxis().SetLabelOffset(0.003) + h.GetXaxis().SetTitleFont(62) + h.GetXaxis().SetLabelFont(62) + h.GetXaxis().SetMoreLogLabels(1) + h.GetYaxis().SetTitleSize(0.055) + h.GetYaxis().SetTitleOffset(0.9) + h.GetYaxis().SetLabelSize(0.045) + h.GetYaxis().SetTitleFont(62) + h.GetYaxis().SetLabelFont(62) + ##h.GetYaxis().SetLabelOffset(0.015) + return h + +def setHistoRatio(num, denom, title = "", ymin=0.4, ymax=1.6, color = kRed+3): + ratio = num.Clone("%s--%s_ratio"%(num.GetName(),denom.GetName())) + ratio.Divide(num, denom, 1., 1.) + ratio.SetTitle(title) + ratio.GetYaxis().SetRangeUser(ymin, ymax) + ratio.GetYaxis().SetTitle("ratio: (with GEM)/default") + ratio.GetYaxis().SetTitle("ratio") + ##ratio.GetYaxis().SetTitle("(ME1/b + GEM) / ME1/b") + ratio.GetYaxis().SetTitleSize(.14) + ##ratio.GetYaxis().SetTitleSize(.1) + ratio.GetYaxis().SetTitleOffset(0.4) + ratio.GetYaxis().SetLabelSize(.11) + ##ratio.GetXaxis().SetMoreLogLabels(1) + ##ratio.GetXaxis().SetTitle("track #eta") + ratio.GetXaxis().SetLabelSize(.11) + ratio.GetXaxis().SetTitleSize(.14) + ratio.GetXaxis().SetTitleOffset(1.) + ratio.SetLineWidth(2) + ratio.SetFillColor(color) + ratio.SetLineColor(color) + ratio.SetMarkerColor(color) + ratio.SetMarkerStyle(20) + ratio.SetLineColor(color) + ratio.SetMarkerColor(color) + ##ratio.Draw("e3") + return ratio + +def addRatioPlotLegend(h): + leg = TLegend(0.17,0.4,.47,0.5,"","brNDC") + leg.SetMargin(0.1) + leg.SetBorderSize(0) + leg.SetTextSize(0.1) + leg.SetFillStyle(1001) + leg.SetFillColor(kWhite) + leg.AddEntry(h, "GEM+CSC/CSC tight","P") + leg.Draw("same") + +def addRatePlotLegend(h, i, j, k, l): + leg = TLegend(0.16,0.67,.8,0.9,"L1 Selections (#geq" + k + " stations, L1 candidate p_{T}#geq" + l + " GeV/c):","brNDC") + leg.SetMargin(0.20) + leg.SetBorderSize(0) + leg.SetTextSize(0.04) + leg.SetFillStyle(1001) + leg.SetFillColor(kWhite) + leg.AddEntry(h,"CSC, loose","f") + leg.AddEntry(i,"CSC, tight","f") + leg.AddEntry(j,"GEM+CSC Integrated Trigger","f") + leg.Draw("same") + +def addRatePlots(h, i, j, col1, col2, col3, sty1, sty2, sty3, sty4, miny, maxy): + h.SetFillColor(col1) + i.SetFillColor(col2) + j.SetFillColor(col3) + + h.SetFillStyle(sty1) + i.SetFillStyle(sty2) + j.SetFillStyle(sty3) + + h.GetYaxis().SetRangeUser(miny,maxy) + i.GetYaxis().SetRangeUser(miny,maxy) + j.GetYaxis().SetRangeUser(miny,maxy) + + i_clone = i.Clone("i_clone") + j_clone = j.Clone("j_clone") + i_clone2 = i.Clone("i_clone2") + j_clone2 = j.Clone("j_clone2") + + for ii in range(0,15): + i_clone2.SetBinContent(ii,0) + j_clone2.SetBinContent(ii,0) + i_clone2.SetBinError(ii,0) + j_clone2.SetBinError(ii,0) + for ii in range(26,35): + i_clone2.SetBinContent(ii,0) + j_clone2.SetBinContent(ii,0) + i_clone2.SetBinError(ii,0) + j_clone2.SetBinError(ii,0) + for ii in range(15,26): + i_clone.SetBinContent(ii,0) + j_clone.SetBinContent(ii,0) + i_clone.SetBinError(ii,0) + j_clone.SetBinError(ii,0) + + j_clone.SetFillStyle(sty4) + + i_clone.Draw("hist e1 same") + j_clone.Draw("hist e1 same") + h.Draw("hist e1 same") + i_clone2.Draw("hist e1 same") + j_clone2.Draw("hist e1 same") + +def setPad1Attributes(pad1): + pad1.SetGridx(1) + pad1.SetGridy(1) + pad1.SetFrameBorderMode(0) + pad1.SetFillColor(kWhite) + pad1.SetTopMargin(0.06) + pad1.SetBottomMargin(0.13) + +def setPad2Attributes(pad2): + pad2.SetLogy(1) + pad2.SetGridx(1) + pad2.SetGridy(1) + pad2.SetFillColor(kWhite) + pad2.SetFrameBorderMode(0) + pad2.SetTopMargin(0.06) + pad2.SetBottomMargin(0.3) + +def produceRateVsEtaPlot(h, i, j, col1, col2, col3, sty1, sty2, sty3, sty4, miny, maxy, k, l, plots, ext): + c = TCanvas("c","c",800,800) + c.Clear() + pad1 = TPad("pad1","top pad",0.0,0.25,1.0,1.0) + pad1.Draw("") + pad2 = TPad("pad2","bottom pad",0,0.,1.0,.30) + pad2.Draw("same") + + pad1.cd() + setPad1Attributes(pad1) + addRatePlots(h,i,j,col1,col2,col3,sty1,sty2,sty3,3355,miny,maxy) + addRatePlotLegend(h, i, j, k,l) + drawLumiLabel2() + + pad2.cd() + setPad2Attributes(pad2) + gem_ratio = setHistoRatio(j, i, "", 0.01,2.0, col2) + gem_ratio.Draw("Pe") + addRatioPlotLegend(gem_ratio) + + c.SaveAs(plots + "rates_vs_eta__minpt" + l + "__PU100__def_" + k + "s_" + k + "s1b_" + k + "s1bgem" + ext) + +def produceRateVsEtaPlotsForApproval(ext, plots): + gStyle.SetOptStat(0) + gStyle.SetTitleStyle(0) + ## ##gStyle.SetPadTopMargin(0.08) + ## gStyle.SetTitleH(0.06) + + ## input files + f_def = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root" + f_g98_pt10 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt10_pat2.root" + f_g98_pt15 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt15_pat2.root" + f_g98_pt20 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt20_pat2.root" + f_g98_pt30 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat2.root" + f_g98_pt40 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat2.root" + + ## general stuff + hdir = "SimMuL1StrictAll" + + ## colors - same colors as for rate vs pt plots!! + col1 = kViolet+1 + col2 = kAzure+2 + col3 = kGreen-2 + + ## styles + sty1 = 3345 + sty2 = 2003 + sty3 = 2002 + + ## Declaration of histograms + ttl = " L1 Single Muon Trigger CMS Simulation;L1 muon candidate #eta;rate [kHz]" + + vs_eta_minpt = "10" + h_rt_tf10_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2) + h_rt_tf10_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2) + h_rt_tf10_gpt10_2s1b = setHistoEta(f_g98_pt10, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2) + h_rt_tf10_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2) + h_rt_tf10_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2) + h_rt_tf10_gpt10_3s1b = setHistoEta(f_g98_pt10, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 7, 2) + + vs_eta_minpt = "20" + h_rt_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2) + h_rt_tf20_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2) + h_rt_tf20_gpt20_2s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2) + h_rt_tf20_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2) + h_rt_tf20_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2) + h_rt_tf20_gpt20_3s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 1, 2) + + vs_eta_minpt = "30" + h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2) + h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2) + h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2) + h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2) + h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2) + h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 1, 2) + + ## Style + gStyle.SetStatW(0.07) + gStyle.SetStatH(0.06) + gStyle.SetOptStat(0) + gStyle.SetTitleStyle(0) + gStyle.SetTitleAlign(13)## coord in top left + gStyle.SetTitleX(0.) + gStyle.SetTitleY(1.) + gStyle.SetTitleW(1) + gStyle.SetTitleH(0.058) + gStyle.SetTitleBorderSize(0) + + ## ------------ +2 stubs, L1 candidate muon pt=10GeV ----------------## + produceRateVsEtaPlot(h_rt_tf10_2s,h_rt_tf10_2s1b,h_rt_tf10_gpt10_2s1b, + col1,col2,col3,sty1,sty2,sty3,3355,0.01,80,"2","10",plots,ext) + ## ------------ +2 stubs, L1 candidate muon pt=20GeV ----------------## + produceRateVsEtaPlot(h_rt_tf20_2s,h_rt_tf20_2s1b,h_rt_tf20_gpt20_2s1b, + col1,col2,col3,sty1,sty2,sty3,3355,0.01,40,"2","20",plots,ext) + ## ------------ +2 stubs, L1 candidate muon pt=30GeV ----------------## + produceRateVsEtaPlot(h_rt_tf30_2s,h_rt_tf30_2s1b,h_rt_tf30_gpt30_2s1b, + col1,col2,col3,sty1,sty2,sty3,3355,0.01,30,"2","30",plots,ext) + ## ------------ +3 stubs, L1 candidate muon pt=10GeV ----------------## + produceRateVsEtaPlot(h_rt_tf10_3s,h_rt_tf10_3s1b,h_rt_tf10_gpt10_3s1b, + col1,col2,col3,sty1,sty2,sty3,3355,0.01,25,"3","10",plots,ext) + ## ------------ +3 stubs, L1 candidate muon pt=20GeV ----------------## + produceRateVsEtaPlot(h_rt_tf20_3s,h_rt_tf20_3s1b,h_rt_tf20_gpt20_3s1b, + col1,col2,col3,sty1,sty2,sty3,3355,0.01,10,"3","20",plots,ext) + ## ------------ +3 stubs, L1 candidate muon pt=30GeV ----------------## + produceRateVsEtaPlot(h_rt_tf30_3s,h_rt_tf30_3s1b,h_rt_tf30_gpt30_3s1b, + col1,col2,col3,sty1,sty2,sty3,3355,0.01, 6,"3","30",plots,ext) + +if __name__ == "__main__": +## produceRateVsEtaPlotsForApproval(".C", "plots/rate_vs_eta/") + produceRateVsEtaPlotsForApproval(".pdf", "plots/rate_vs_eta/") diff --git a/SimMuL1/scripts/produceRateVsPtPlotsForApproval.py b/SimMuL1/scripts/produceRateVsPtPlotsForApproval.py new file mode 100644 index 0000000000000..9de3fb97a4925 --- /dev/null +++ b/SimMuL1/scripts/produceRateVsPtPlotsForApproval.py @@ -0,0 +1,477 @@ +from ROOT import * +from triggerPlotHelpers import * + +## run quiet mode +import sys +sys.argv.append( '-b' ) + +import ROOT +ROOT.gROOT.SetBatch(1) + +def drawEtaLabel(minEta, maxEta, x=0.17, y=0.35, font_size=0.): + label(minEta + " < |#eta| < " + maxEta) + tex = TLatex(x, y,label) + if (font_size > 0.): + tex.SetFontSize(font_size) + tex.SetTextSize(0.05) + tex.SetNDC() + tex.Draw() + return tex + +def drawLumiLabel(x=0.17, y=0.35): + tex = TLatex(x, y,"L = 4*10^{34} cm^{-2} s^{-1}") + tex.SetTextSize(0.05) + tex.SetNDC() + tex.Draw() + return tex + +def drawL1Label(x=0.17, y=0.35): + tex = TLatex(x, y,"L1 trigger in 2012 configuration") + tex.SetTextSize(0.04) + tex.SetNDC() + tex.Draw() + return tex + +def produceRatePlot(h, i, j, m, col0, col1, col2, col3, miny, maxy, k, l, plots, ext): + c = TCanvas("c","c",800,800) + c.Clear() + pad1 = TPad("pad1","top pad",0.0,0.25,1.0,1.0) + pad1.Draw() + pad2 = TPad("pad2","bottom pad",0,0.,1.0,.30) + pad2.Draw() + + pad1.cd() + pad1.SetLogx(1) + pad1.SetLogy(1) + pad1.SetGridx(1) + pad1.SetGridy(1) + pad1.SetFrameBorderMode(0) + pad1.SetFillColor(kWhite) + + h.SetFillColor(col0) + i.SetFillColor(col1) + j.SetFillColor(col2) + m.SetFillColor(col3) + + h.Draw("e3") + i.Draw("same e3") + j.Draw("same e3") + m.Draw("same e3") + h.Draw("same e3") + h.GetYaxis().SetRangeUser(miny, maxy) + h.GetXaxis().SetTitle("") + + leg = TLegend(0.45,0.7,.93,0.93,"","brNDC") + leg.SetMargin(0.25) + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetTextSize(0.04) + leg.SetFillStyle(1001) + leg.SetFillColor(kWhite) + leg.AddEntry(h, "GMT (2012 configuration)","f") + leg.AddEntry(0, "L1 selections (#geq " + k + " stations):","") + leg.AddEntry(i, "CSC, loose","f") + leg.AddEntry(j,"CSC, tight","f") + leg.AddEntry(m,"GEM+CSC integrated trigger","f") + leg.Draw() + + drawLumiLabel(0.17,.3) + drawEtaLabel("1.64","2.14",0.17,.37) + + pad2.cd() + pad2.SetLogx(1) + pad2.SetLogy(1) + pad2.SetGridx(1) + pad2.SetGridy(1) + pad2.SetFillColor(kWhite) + pad2.SetFrameBorderMode(0) + pad2.SetLeftMargin(0.126) + pad2.SetRightMargin(0.04) + pad2.SetTopMargin(0.06) + pad2.SetBottomMargin(0.4) + + hh_ratio = setHistoRatio(m, j, "", 0.01,1.1,col2) + hh_ratio.GetXaxis().SetTitle("L1 muon candidate p_{T}^{cut} [GeV/c]") + hh_ratio.Draw("P") + + hh_ratio_gmt = setHistoRatio(m, h, "", 0.01,1.1,col0) + hh_ratio_gmt.Draw("P same") + + leg = TLegend(0.15,0.45,.45,0.7,"","brNDC") + leg.SetMargin(0.1) + leg.SetBorderSize(0) + leg.SetTextSize(0.1) + leg.SetFillStyle(1001) + leg.SetFillColor(kWhite) + leg.AddEntry(hh_ratio_gmt, "(GEM+CSC)/GMT","p") + leg.AddEntry(hh_ratio, "(GEM+CSC)/CSC tight","p") + leg.Draw("same") + + c.SaveAs(plots + "rates_vs_pt__PU100__def_" + k + "s_" + k + "s1b_" + k + "s1bgem__" + l + ext) + +def produceRatePlots(ext): + gem_dir = "files/" + gem_label = "gem98" + + the_ttl = " L1 Single Muon Trigger CMS Simulation;L1 candidate muon p_{T}^{cut} [GeV/c];rate [kHz]" + plots = "plots/rate/" + + ##gStyle.SetStatW(0.13) + ##gStyle.SetStatH(0.08) + gStyle.SetStatW(0.07) + gStyle.SetStatH(0.06) + gStyle.SetOptStat(0) + + gStyle.SetTitleStyle(0) + gStyle.SetTitleAlign(13)## coord in top left + gStyle.SetTitleX(0.) + gStyle.SetTitleY(1.) + gStyle.SetTitleW(1) + gStyle.SetTitleH(0.058) + gStyle.SetTitleBorderSize(0) + + gStyle.SetPadLeftMargin(0.126) + gStyle.SetPadRightMargin(0.04) + gStyle.SetPadTopMargin(0.06) + gStyle.SetPadBottomMargin(0.13) + + gStyle.SetMarkerStyle(1) + + ## ********** PAT2 ********** + + getPTHistos("minbias_pt06_pat2") + + hh = result_def_3s1b.Clone("gem_new") + for b in range(hh.FindBin(6.01),hh.GetNbinsX()+1): hh.SetBinContent(b, 0) + hh_all = result_def_eta_all_3s1b.Clone("gem_new_eta_all"); + for b in range(hh_all.FindBin(6.01),hh_all.GetNbinsX()+1): hh.SetBinContent(b, 0) + hh_no1a = result_def_eta_no1a_3s1b.Clone("gem_new_eta_no1a"); + for b in range(hh_no1a.FindBin(6.01),hh_no1a.GetNbinsX()+1): hh.SetBinContent(b, 0) + hh_2s1b = result_def_2s1b.Clone("gem_new_2s1b"); + for (int b = hh_2s1b.FindBin(6.01); b <= hh_2s1b.GetNbinsX(); ++b) hh_2s1b.SetBinContent(b, 0); + + + + h06 = result_gem.Clone("gem_new_06"); + for (int b = h06.FindBin(6.01); b < h06.FindBin(10.01); ++b) {hh.SetBinContent(b, h06.GetBinContent(b)); hh.SetBinError(b, h06.GetBinError(b));} + + h06_all = result_gem_eta_all.Clone("gem_new_eta_all_06"); + for (int b = h06_all.FindBin(6.01); b < h06_all.FindBin(10.01); ++b) {hh_all.SetBinContent(b, h06_all.GetBinContent(b)); hh_all.SetBinError(b, h06_all.GetBinError(b));} + + h06_no1a = result_gem_eta_no1a.Clone("gem_new_eta_no1a_06"); + for (int b = h06_no1a.FindBin(6.01); b < h06_no1a.FindBin(10.01); ++b) {hh_no1a.SetBinContent(b, h06_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h06_no1a.GetBinError(b));} + + h06_2s1b = result_gem_2s1b.Clone("gem_new_2s1b_06"); + for (int b = h06_2s1b.FindBin(6.01); b < h06_2s1b.FindBin(10.01); ++b) {hh_2s1b.SetBinContent(b, h06_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h06_2s1b.GetBinError(b));} + + getPTHistos("minbias_pt10_pat2"); + h10 = result_gem.Clone("gem10"); + for (int b = h10.FindBin(10.01); b < h10.FindBin(15.01); ++b) {hh.SetBinContent(b, h10.GetBinContent(b)); hh.SetBinError(b, h10.GetBinError(b));} + h10_all = result_gem_eta_all.Clone("gem_new_eta_all_10"); + for (int b = h10_all.FindBin(10.01); b < h10_all.FindBin(15.01); ++b) {hh_all.SetBinContent(b, h10_all.GetBinContent(b)); hh_all.SetBinError(b, h10_all.GetBinError(b));} + h10_no1a = result_gem_eta_no1a.Clone("gem_new_eta_no1a_10"); + for (int b = h10_no1a.FindBin(10.01); b < h10_no1a.FindBin(15.01); ++b) {hh_no1a.SetBinContent(b, h10_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h10_no1a.GetBinError(b));} + h10_2s1b = result_gem_2s1b.Clone("gem_new_2s1b_10"); + for (int b = h10_2s1b.FindBin(10.01); b < h10_2s1b.FindBin(15.01); ++b) {hh_2s1b.SetBinContent(b, h10_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h10_2s1b.GetBinError(b));} + + getPTHistos("minbias_pt15_pat2"); + h15 = result_gem.Clone("gem15"); + for (int b = h15.FindBin(15.01); b < h15.FindBin(20.01); ++b) {hh.SetBinContent(b, h15.GetBinContent(b)); hh.SetBinError(b, h15.GetBinError(b));} + h15_all = result_gem_eta_all.Clone("gem_new_eta_all_15"); + for (int b = h15_all.FindBin(15.01); b < h15_all.FindBin(20.01); ++b) {hh_all.SetBinContent(b, h15_all.GetBinContent(b)); hh_all.SetBinError(b, h15_all.GetBinError(b));} + h15_no1a = result_gem_eta_no1a.Clone("gem_new_eta_no1a_15"); + for (int b = h15_no1a.FindBin(15.01); b < h15_no1a.FindBin(20.01); ++b) {hh_no1a.SetBinContent(b, h15_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h15_no1a.GetBinError(b));} + h15_2s1b = result_gem_2s1b.Clone("gem_new_2s1b_15"); + for (int b = h15_2s1b.FindBin(15.01); b < h15_2s1b.FindBin(20.01); ++b) {hh_2s1b.SetBinContent(b, h15_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h15_2s1b.GetBinError(b));} + + getPTHistos("minbias_pt20_pat2"); + h20 = result_gem.Clone("gem20"); + for (int b = h20.FindBin(20.01); b < h20.FindBin(30.01); ++b) {hh.SetBinContent(b, h20.GetBinContent(b)); hh.SetBinError(b, h20.GetBinError(b));} + h20_all = result_gem_eta_all.Clone("gem_new_eta_all_20"); + for (int b = h20_all.FindBin(20.01); b < h20_all.FindBin(30.01); ++b) {hh_all.SetBinContent(b, h20_all.GetBinContent(b)); hh_all.SetBinError(b, h20_all.GetBinError(b));} + h20_no1a = result_gem_eta_no1a.Clone("gem_new_eta_no1a_20"); + for (int b = h20_no1a.FindBin(20.01); b < h20_no1a.FindBin(30.01); ++b) {hh_no1a.SetBinContent(b, h20_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h20_no1a.GetBinError(b));} + h20_2s1b = result_gem_2s1b.Clone("gem_new_2s1b_20"); + for (int b = h20_2s1b.FindBin(20.01); b < h20_2s1b.FindBin(30.01); ++b) {hh_2s1b.SetBinContent(b, h20_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h20_2s1b.GetBinError(b));} + + getPTHistos("minbias_pt30_pat2"); + h30 = result_gem.Clone("gem30"); + for (int b = h30.FindBin(30.01); b <= h30.FindBin(40.01); ++b) {hh.SetBinContent(b, h30.GetBinContent(b)); hh.SetBinError(b, h30.GetBinError(b));} + h30_all = result_gem_eta_all.Clone("gem_new_eta_all_30"); + for (int b = h30_all.FindBin(30.01); b < h30_all.FindBin(40.01); ++b) {hh_all.SetBinContent(b, h30_all.GetBinContent(b)); hh_all.SetBinError(b, h30_all.GetBinError(b));} + h30_no1a = result_gem_eta_no1a.Clone("gem_new_eta_no1a_30"); + for (int b = h30_no1a.FindBin(30.01); b < h30_no1a.FindBin(40.01); ++b) {hh_no1a.SetBinContent(b, h30_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h30_no1a.GetBinError(b));} + h30_2s1b = result_gem_2s1b.Clone("gem_new_2s1b_30"); + for (int b = h30_2s1b.FindBin(30.01); b < h30_2s1b.FindBin(40.01); ++b) {hh_2s1b.SetBinContent(b, h30_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h30_2s1b.GetBinError(b));} + + getPTHistos("minbias_pt40_pat2"); + h40 = result_gem.Clone("gem30"); + for (int b = h40.FindBin(40.01); b <= h40.GetNbinsX(); ++b) {hh.SetBinContent(b, h40.GetBinContent(b)); hh.SetBinError(b, h40.GetBinError(b));} + h40_all = result_gem_eta_all.Clone("gem_new_eta_all_40"); + for (int b = h40_all.FindBin(40.01); b < h40_all.GetNbinsX(); ++b) {hh_all.SetBinContent(b, h40_all.GetBinContent(b)); hh_all.SetBinError(b, h40_all.GetBinError(b));} + h40_no1a = result_gem_eta_no1a.Clone("gem_new_eta_no1a_40"); + for (int b = h40_no1a.FindBin(40.01); b < h40_no1a.GetNbinsX(); ++b) {hh_no1a.SetBinContent(b, h40_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h40_no1a.GetBinError(b));} + h40_2s1b = result_gem_2s1b.Clone("gem_new_2s1b_40"); + for (int b = h40_2s1b.FindBin(40.01); b < h40_2s1b.GetNbinsX(); ++b) {hh_2s1b.SetBinContent(b, h40_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h40_2s1b.GetBinError(b));} + + for (int b = 1; b <= hh.GetNbinsX(); ++b) if (hh.GetBinContent(b)==0) hh.SetBinError(b, 0.); + for (int b = 1; b <= hh_all.GetNbinsX(); ++b) if (hh_all.GetBinContent(b)==0) hh_all.SetBinError(b, 0.); + for (int b = 1; b <= hh_no1a.GetNbinsX(); ++b) if (hh_no1a.GetBinContent(b)==0) hh_no1a.SetBinError(b, 0.); + for (int b = 1; b <= hh_2s1b.GetNbinsX(); ++b) if (hh_2s1b.GetBinContent(b)==0) hh_2s1b.SetBinError(b, 0.); + + hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); + hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); + hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); + hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); + + result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); + + result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); + result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); + result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); + result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); + + result_def_2s__pat2 = result_def_2s.Clone("result_def_2s__pat2"); + result_def_3s__pat2 = result_def.Clone("result_def_2s__pat2"); + result_def_2s1b__pat2 = result_def_2s1b.Clone("result_def_2s1b__pat2"); + result_def_3s1b__pat2 = result_def_3s1b.Clone("result_def_3s1b__pat2"); + result_gmtsing__pat2 = result_gmtsing.Clone("result_gmtsing__pat2");; + + result_gem_2s1b__pat2 = hh_2s1b.Clone("result_gem_2s1b__pat2"); + result_gem_3s1b__pat2 = hh.Clone("result_gem_2s1b__pat2"); + + ## ********** PAT8 ********** + + getPTHistos("minbias_pt06_pat8"); + hh = result_def_3s1b.Clone("gem_new"); + for (int b = hh.FindBin(6.01); b <= hh.GetNbinsX(); ++b) hh.SetBinContent(b, 0); + hh_all = result_def_eta_all_3s1b.Clone("gem_new_eta_all"); + for (int b = hh_all.FindBin(6.01); b <= hh_all.GetNbinsX(); ++b) hh_all.SetBinContent(b, 0); + hh_no1a = result_def_eta_no1a_3s1b.Clone("gem_new_eta_no1a"); + for (int b = hh_no1a.FindBin(6.01); b <= hh_no1a.GetNbinsX(); ++b) hh_no1a.SetBinContent(b, 0); + hh_2s1b = result_def_2s1b.Clone("gem_new_2s1b"); + for (int b = hh_2s1b.FindBin(6.01); b <= hh_2s1b.GetNbinsX(); ++b) hh_2s1b.SetBinContent(b, 0); + + h06 = result_gem.Clone("gem_new_06"); + for (int b = h06.FindBin(6.01); b < h06.FindBin(10.01); ++b) {hh.SetBinContent(b, h06.GetBinContent(b)); hh.SetBinError(b, h06.GetBinError(b));} + h06_all = result_gem_eta_all.Clone("gem_new_eta_all_06"); + for (int b = h06_all.FindBin(6.01); b < h06_all.FindBin(10.01); ++b) {hh_all.SetBinContent(b, h06_all.GetBinContent(b)); hh_all.SetBinError(b, h06_all.GetBinError(b));} + h06_no1a = result_gem_eta_no1a.Clone("gem_new_eta_no1a_06"); + for (int b = h06_no1a.FindBin(6.01); b < h06_no1a.FindBin(10.01); ++b) {hh_no1a.SetBinContent(b, h06_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h06_no1a.GetBinError(b));} + h06_2s1b = result_gem_2s1b.Clone("gem_new_2s1b_06"); + for (int b = h06_2s1b.FindBin(6.01); b < h06_2s1b.FindBin(10.01); ++b) {hh_2s1b.SetBinContent(b, h06_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h06_2s1b.GetBinError(b));} + + getPTHistos("minbias_pt10_pat8"); + h10 = result_gem.Clone("gem10"); + for (int b = h10.FindBin(10.01); b < h10.FindBin(15.01); ++b) {hh.SetBinContent(b, h10.GetBinContent(b)); hh.SetBinError(b, h10.GetBinError(b));} + h10_all = result_gem_eta_all.Clone("gem_new_eta_all_10"); + for (int b = h10_all.FindBin(10.01); b < h10_all.FindBin(15.01); ++b) {hh_all.SetBinContent(b, h10_all.GetBinContent(b)); hh_all.SetBinError(b, h10_all.GetBinError(b));} + h10_no1a = result_gem_eta_no1a.Clone("gem_new_eta_no1a_10"); + for (int b = h10_no1a.FindBin(10.01); b < h10_no1a.FindBin(15.01); ++b) {hh_no1a.SetBinContent(b, h10_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h10_no1a.GetBinError(b));} + h10_2s1b = result_gem_2s1b.Clone("gem_new_2s1b_10"); + for (int b = h10_2s1b.FindBin(10.01); b < h10_2s1b.FindBin(15.01); ++b) {hh_2s1b.SetBinContent(b, h10_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h10_2s1b.GetBinError(b));} + + getPTHistos("minbias_pt15_pat8"); + h15 = result_gem.Clone("gem15"); + for (int b = h15.FindBin(15.01); b < h15.FindBin(20.01); ++b) {hh.SetBinContent(b, h15.GetBinContent(b)); hh.SetBinError(b, h15.GetBinError(b));} + h15_all = result_gem_eta_all.Clone("gem_new_eta_all_15"); + for (int b = h15_all.FindBin(15.01); b < h15_all.FindBin(20.01); ++b) {hh_all.SetBinContent(b, h15_all.GetBinContent(b)); hh_all.SetBinError(b, h15_all.GetBinError(b));} + h15_no1a = result_gem_eta_no1a.Clone("gem_new_eta_no1a_15"); + for (int b = h15_no1a.FindBin(15.01); b < h15_no1a.FindBin(20.01); ++b) {hh_no1a.SetBinContent(b, h15_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h15_no1a.GetBinError(b));} + h15_2s1b = result_gem_2s1b.Clone("gem_new_2s1b_15"); + for (int b = h15_2s1b.FindBin(15.01); b < h15_2s1b.FindBin(20.01); ++b) {hh_2s1b.SetBinContent(b, h15_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h15_2s1b.GetBinError(b));} + + getPTHistos("minbias_pt20_pat8"); + h20 = result_gem.Clone("gem20"); + for (int b = h20.FindBin(20.01); b < h20.FindBin(30.01); ++b) {hh.SetBinContent(b, h20.GetBinContent(b)); hh.SetBinError(b, h20.GetBinError(b));} + h20_all = result_gem_eta_all.Clone("gem_new_eta_all_20"); + for (int b = h20_all.FindBin(20.01); b < h20_all.FindBin(30.01); ++b) {hh_all.SetBinContent(b, h20_all.GetBinContent(b)); hh_all.SetBinError(b, h20_all.GetBinError(b));} + h20_no1a = result_gem_eta_no1a.Clone("gem_new_eta_no1a_20"); + for (int b = h20_no1a.FindBin(20.01); b < h20_no1a.FindBin(30.01); ++b) {hh_no1a.SetBinContent(b, h20_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h20_no1a.GetBinError(b));} + h20_2s1b = result_gem_2s1b.Clone("gem_new_2s1b_20"); + for (int b = h20_2s1b.FindBin(20.01); b < h20_2s1b.FindBin(30.01); ++b) {hh_2s1b.SetBinContent(b, h20_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h20_2s1b.GetBinError(b));} + + getPTHistos("minbias_pt30_pat8"); + h30 = result_gem.Clone("gem30"); + for (int b = h30.FindBin(30.01); b <= h30.FindBin(40.01); ++b) {hh.SetBinContent(b, h30.GetBinContent(b)); hh.SetBinError(b, h30.GetBinError(b));} + h30_all = result_gem_eta_all.Clone("gem_new_eta_all_30"); + for (int b = h30_all.FindBin(30.01); b < h30_all.FindBin(40.01); ++b) {hh_all.SetBinContent(b, h30_all.GetBinContent(b)); hh_all.SetBinError(b, h30_all.GetBinError(b));} + h30_no1a = result_gem_eta_no1a.Clone("gem_new_eta_no1a_30"); + for (int b = h30_no1a.FindBin(30.01); b < h30_no1a.FindBin(40.01); ++b) {hh_no1a.SetBinContent(b, h30_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h30_no1a.GetBinError(b));} + h30_2s1b = result_gem_2s1b.Clone("gem_new_2s1b_30"); + for (int b = h30_2s1b.FindBin(30.01); b < h30_2s1b.FindBin(40.01); ++b) {hh_2s1b.SetBinContent(b, h30_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h30_2s1b.GetBinError(b));} + + getPTHistos("minbias_pt40_pat8"); + h40 = result_gem.Clone("gem30"); + for (int b = h40.FindBin(40.01); b <= h40.GetNbinsX(); ++b) {hh.SetBinContent(b, h40.GetBinContent(b)); hh.SetBinError(b, h40.GetBinError(b));} + h40_all = result_gem_eta_all.Clone("gem_new_eta_all_40"); + for (int b = h40_all.FindBin(40.01); b < h40_all.GetNbinsX(); ++b) {hh_all.SetBinContent(b, h40_all.GetBinContent(b)); hh_all.SetBinError(b, h40_all.GetBinError(b));} + h40_no1a = result_gem_eta_no1a.Clone("gem_new_eta_no1a_40"); + for (int b = h40_no1a.FindBin(40.01); b < h40_no1a.GetNbinsX(); ++b) {hh_no1a.SetBinContent(b, h40_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h40_no1a.GetBinError(b));} + h40_2s1b = result_gem_2s1b.Clone("gem_new_2s1b_40"); + for (int b = h40_2s1b.FindBin(40.01); b < h40_2s1b.GetNbinsX(); ++b) {hh_2s1b.SetBinContent(b, h40_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h40_2s1b.GetBinError(b));} + + for (int b = 1; b <= hh.GetNbinsX(); ++b) if (hh.GetBinContent(b)==0) hh.SetBinError(b, 0.); + for (int b = 1; b <= hh_all.GetNbinsX(); ++b) if (hh_all.GetBinContent(b)==0) hh_all.SetBinError(b, 0.); + for (int b = 1; b <= hh_no1a.GetNbinsX(); ++b) if (hh_no1a.GetBinContent(b)==0) hh_no1a.SetBinError(b, 0.); + for (int b = 1; b <= hh_2s1b.GetNbinsX(); ++b) if (hh_2s1b.GetBinContent(b)==0) hh_2s1b.SetBinError(b, 0.); + + hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); + hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); + hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); + hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); + + result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); + + result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); + result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); + result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); + result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); + + result_def_2s__pat8 = result_def_2s.Clone("result_def_2s__pat8"); + result_def_3s__pat8 = result_def.Clone("result_def_2s__pat8"); + result_def_2s1b__pat8 = result_def_2s1b.Clone("result_def_2s1b__pat8"); + result_def_3s1b__pat8 = result_def_3s1b.Clone("result_def_3s1b__pat8"); + result_gmtsing__pat8 = result_gmtsing.Clone("result_gmtsing__pat8");; + + result_gem_2s1b__pat8 = hh_2s1b.Clone("result_gem_2s1b__pat8"); + result_gem_3s1b__pat8 = hh.Clone("result_gem_2s1b__pat8"); + + ######################## + ## PLOTS FOR APPROVAL ## + ######################## + col0 = kRed; + col1 = kViolet+1; + col2 = kAzure+2; + col3 = kGreen-2; + + produceRatePlot(result_gmtsing__pat2, result_def_2s__pat2, result_def_2s1b__pat2, result_gem_2s1b__pat2, + col0, col1, col2, col3, 0.1, 10000, "2", "loose", plots, ext) + produceRatePlot(result_gmtsing__pat8, result_def_2s__pat8, result_def_2s1b__pat8, result_gem_2s1b__pat8, + col0, col1, col2, col3, 0.1, 10000, "2", "tight", plots, ext) + produceRatePlot(result_gmtsing__pat2, result_def_3s__pat2, result_def_3s1b__pat2, result_gem_3s1b__pat2, + col0, col1, col2, col3, 0.01, 10000, "3", "loose", plots, ext) + produceRatePlot(result_gmtsing__pat8, result_def_3s__pat8, result_def_3s1b__pat8, result_gem_3s1b__pat8, + col0, col1, col2, col3, 0.01, 10000, "3", "tight", plots, ext); + +""" + ## EXTRA PLOTS + bool produceTheBigPlots = false; + if (produceTheBigPlots) + { + result_def_2s__pat8.SetFillColor(kViolet+2); + result_def_2s1b__pat8.SetFillColor(kAzure+2); + result_gem_2s1b__pat8.SetFillColor(kGreen-1); + + ## GMT; CSCTF 2 stubs; CSCTF 2 stubs + ME1/b; CSCTF 2 stubs + ME1/b + GEM -- LOOSE & TIGHT + GEM-- Absolute + ratio + TCanvas* c = TCanvas("c","c",1000,800); + c.Clear(); + TPad *pad1 = TPad("pad1","top pad",0.0,0.0,1.0,1.0); + pad1.Draw(); + + pad1.cd(); + pad1.SetLogx(1); + pad1.SetLogy(1); + pad1.SetGridx(1); + pad1.SetGridy(1); + pad1.SetFrameBorderMode(0); + pad1.SetFillColor(kWhite); + + result_gmtsing__pat2.Draw("e3"); + result_def_2s__pat2.Draw("same e3"); + result_def_2s1b__pat2.Draw("same e3"); + result_gem_2s1b__pat2.Draw("same e3"); + result_def_2s__pat8.Draw("same e3"); + result_def_2s1b__pat8.Draw("same e3"); + result_gem_2s1b__pat8.Draw("same e3"); + result_gmtsing__pat2.Draw("same e3"); + result_gmtsing__pat2.GetYaxis().SetRangeUser(0.1, 10000.); + result_gmtsing__pat2.GetXaxis().SetTitle("p_{T}^{cut} [GeV/c]"); + + leg = TLegend(0.5,0.65,.92,0.92,"","brNDC"); + leg.SetBorderSize(0); + leg.SetFillStyle(0); + leg.SetTextSize(0.03); + leg.AddEntry((TObject*)0, "Global Muon Trigger [GMT]:",""); + leg.AddEntry(result_gmtsing__pat2, "default muon selection","f"); + leg.AddEntry((TObject*)0, "CSCTF tracks with:",""); + leg.AddEntry(result_def_2s__pat2, "#geq 2 stubs","f"); + leg.AddEntry(result_def_2s1b__pat2,"#geq 2 with ME1/b stub","f"); + leg.AddEntry(result_gem_2s1b__pat2,"#geq 2 with ME1/b stub and GEM pad","f"); + leg.AddEntry(result_def_2s__pat8, "#geq 2 stubs","f"); + leg.AddEntry(result_def_2s1b__pat8,"#geq 2 with ME1/b stub","f"); + leg.AddEntry(result_gem_2s1b__pat8,"#geq 2 with ME1/b stub and GEM pad","f"); + leg.SetFillStyle(1001); + leg.SetFillColor(kWhite); + leg.Draw(); + + drawLumiLabel(0.17,.3); + drawEtaLabel("1.64","2.14"); + + c.SaveAs(plots + "rates_vs_pt__PU100__def_2s_2s1b_2s1bgem" + ext); + } + + { + result_def_3s__pat8.SetFillColor(kViolet+2); + result_def_3s1b__pat8.SetFillColor(kAzure+2); + result_gem_3s1b__pat8.SetFillColor(kGreen-1); + + ## GMT; CSCTF 3 stubs; CSCTF 3 stubs + ME1/b; CSCTF 3 stubs + ME1/b + GEM -- LOOSE & TIGHT + GEM-- Absolute + ratio + TCanvas* c = TCanvas("c","c",1000,800); + c.Clear(); + TPad *pad1 = TPad("pad1","top pad",0.0,0.0,1.0,1.0); + pad1.Draw(); + + pad1.cd(); + pad1.SetLogx(1); + pad1.SetLogy(1); + pad1.SetGridx(1); + pad1.SetGridy(1); + pad1.SetFrameBorderMode(0); + pad1.SetFillColor(kWhite); + + result_gmtsing__pat2.Draw("e3"); + result_def_3s__pat2.Draw("same e3"); + result_def_3s1b__pat2.Draw("same e3"); + result_gem_3s1b__pat2.Draw("same e3"); + result_def_3s__pat8.Draw("same e3"); + result_def_3s1b__pat8.Draw("same e3"); + result_gem_3s1b__pat8.Draw("same e3"); + result_gmtsing__pat2.Draw("same e3"); + result_gmtsing__pat2.GetYaxis().SetRangeUser(0.01, 10000.); + result_gmtsing__pat2.GetXaxis().SetTitle("p_{T}^{cut} [GeV/c]"); + + leg = TLegend(0.5,0.65,.92,0.92,"","brNDC"); + leg.SetBorderSize(0); + leg.SetFillStyle(0); + leg.SetTextSize(0.03); + leg.AddEntry((TObject*)0, "Global Muon Trigger [GMT]:",""); + leg.AddEntry(result_gmtsing__pat2, "default muon selection","f"); + leg.AddEntry((TObject*)0, "CSCTF tracks with:",""); + leg.AddEntry(result_def_3s__pat2, "#geq 3 stubs","f"); + leg.AddEntry(result_def_3s1b__pat2,"#geq 3 with ME1/b stub","f"); + leg.AddEntry(result_gem_3s1b__pat2,"#geq 3 with ME1/b stub and GEM pad","f"); + leg.AddEntry(result_def_3s__pat8, "#geq 3 stubs","f"); + leg.AddEntry(result_def_3s1b__pat8,"#geq 3 with ME1/b stub","f"); + leg.AddEntry(result_gem_3s1b__pat8,"#geq 3 with ME1/b stub and GEM pad","f"); + leg.SetFillStyle(1001); + leg.SetFillColor(kWhite); + leg.Draw(); + + drawLumiLabel(0.17,.3); + drawEtaLabel("1.64","2.14"); + + c.SaveAs(plots + "rates_vs_pt__PU100__def_3s_3s1b_3s1bgem" + ext); +""" + +if __name__ == "__main__": + produceRatePlots(".C") + produceRatePlots(".eps") diff --git a/SimMuL1/scripts/triggerPlotHelpers.py b/SimMuL1/scripts/triggerPlotHelpers.py new file mode 100644 index 0000000000000..1b6281273df7f --- /dev/null +++ b/SimMuL1/scripts/triggerPlotHelpers.py @@ -0,0 +1,237 @@ +from ROOT import * + +ptscale = [-1., 0., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 6., 7., 8., 10., 12., 14., + 16., 18., 20., 25., 30., 35., 40., 45., 50., 60., 70., 80., 90., 100., 120., 140.] + +ptscaleb = [1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 6., 7., 8., 10., 12., 14., + 16., 18., 20., 25., 30., 35., 40., 45., 50., 60., 70., 80., 90., 100., 120., 140., 150.] + +ptscaleb_ = [1.25, 1.75, 2.25, 2.75, 3.25, 3.75, 4.25, 4.75, 5.5, 6.5, 7.5, 9., 11., 13., 15., + 17., 19., 22.5, 27.5, 32.5, 37.5, 42.5, 47.5, 55., 65., 75., 85., 95., 110., 130., 150.] + +def GetStat(h): + """Get the statistics options""" + return h.FindObject("stats") + +def SetOptStat(h, op): + """Set the statistics options""" + stat = GetStat(h) + stat.SetOptStat(op) + return stat + +def getH(f, dir, name): + """Get the histogram""" + dir = "SimMuL1StrictAll" + return f.Get("%s/%s;1"%(dir,name)) + +def Print(c, name): + """Print the histogram""" + c.Print("%s/%s"%(pdir,name)) + +def myRebin(h, n): + """Custom rebin function""" + nb = h.GetNbinsX() + entr = h.GetEntries() + bin0 = h.GetBinContent(0) + binN1 = h.GetBinContent(nb+1) + if (nb % n): + binN1 += h.Integral(nb - nb%n + 1, nb) + h.Rebin(n) + nb = h.GetNbinsX() + h.SetBinContent(0, bin0) + h.SetBinContent(nb+1, binN1) + h.SetEntries(entr) + +def scale(h): + """Calculate the trigger rate""" + rate = 40000. + nevents = 238000 + bx_window = 3 + bx_filling = 0.795 + h.Scale(rate*bx_filling/(bx_window*nevents)) + +def drawLumiBXPULabel(): + """Draw the luminosity + BX label -- not for TDR""" + tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}") + tex.SetNDC() + tex.Draw() + +def drawPULabel(x=0.17, y=0.15, font_size=0.): + tex = TLatex(x, y,"L=4*10^{34} (25ns PU100)") + if (font_size > 0.): + tex.SetFontSize(font_size) + tex.SetNDC() + tex.Draw() + return tex + +def setHistoPt(f_name, name, cname, title, lcolor, lstyle, lwidth): + """Set rate vs pt histogram""" + print "Opening ", f_name + f = TFile.Open(f_name) + h0 = getH(f, dir, name) + nb = h0.GetXaxis().GetNbins() + h = TH1D(name+cname,title,30,ptscaleb) + for b in range(1,nb+1): + bc = h0.GetBinContent(b) + if (bc==0): + continue + bin = h.GetXaxis().FindFixBin(h0.GetBinCenter(b)) + h.SetBinContent(bin, bc) + ##h.Sumw2() + scale(h) + return h + +def setHistoPtRaw(f_name, name, cname, title, lcolor, lstyle, lwidth): + """Set rate vs pt histogram""" + print "Opening ", f_name + f = TFile.Open(f_name) + h0 = getH(f, dir, name) + nb = h0.GetXaxis().GetNbins() + h = h0.Clone(name+cname) + ##h.Sumw2() + scale(h) + return h + +def setHistoEta(f_name, name, cname, title, lcolor, lstyle, lwidth): + """Set rate vs eta histogram""" + print "Opening", f_name + f = TFile.Open(f_name) + h0 = getH(f, dir, name) + nb = h0.GetXaxis().GetNbins() + h = h0.Clone(name+cname) + h.SetTitle(title) + h.Sumw2() + scale(h) + h.SetLineColor(lcolor) + ##h.SetFillColor(lcolor) + h.SetLineStyle(lstyle) + h.SetLineWidth(lwidth) + h.SetTitle(title) + ##h.GetXaxis().SetRangeUser(1.2, 2.4) + h.GetYaxis().SetRangeUser(gdy[0],gdy[1]) + h.GetXaxis().SetTitleSize(0.055) + h.GetXaxis().SetTitleOffset(1.05) + h.GetXaxis().SetLabelSize(0.045) + h.GetXaxis().SetLabelOffset(0.003) + h.GetXaxis().SetTitleFont(62) + h.GetXaxis().SetLabelFont(62) + h.GetXaxis().SetMoreLogLabels(1) + h.GetYaxis().SetTitleSize(0.055) + h.GetYaxis().SetTitleOffset(0.9) + h.GetYaxis().SetLabelSize(0.045) + h.GetYaxis().SetTitleFont(62) + h.GetYaxis().SetLabelFont(62) + ##h.GetYaxis().SetLabelOffset(0.015) + return h + +def getPTHisto(f_name, dir_name, h_name, clone_suffix = "_cln"): + """Get rate vs pt histogram""" + f = TFile.Open(f_name) + return f.Get(dir_name + "/" + h_name).Clone(h_name + clone_suffix) + +def setPTHisto(h0, title, lcolor, lstyle, lwidth): + nb = h0.GetXaxis().GetNbins() + h = TH1D("%s_varpt"%(h0.GetName(), title, 30, ptscaleb_)) + for b in range(1,nb+1): + bc = h0.GetBinContent(b) + if (bc==0): + continue + bin = h.GetXaxis().FindFixBin(h0.GetBinCenter(b)) + h.SetBinContent(bin, bc) + + ## integrate the bins to get the rate vs pt cut!! + for b in range(1,31): ## fixme this number is hard-coded to be 30 + ## should be independent of the number of bins!! + h.SetBinContent(b, h.Integral(b,31)) + h.Sumw2() + scale(h) + h.SetLineColor(lcolor) + h.SetFillColor(lcolor) + h.SetLineStyle(lstyle) + h.SetLineWidth(lwidth) + h.SetTitle(title) + h.GetXaxis().SetRangeUser(2, 129.) + h.GetYaxis().SetRangeUser(gdy[0],gdy[1]) + h.GetXaxis().SetTitleSize(0.055) + h.GetXaxis().SetTitleOffset(1.05) + h.GetXaxis().SetLabelSize(0.045) + h.GetXaxis().SetLabelOffset(0.003) + h.GetXaxis().SetTitleFont(62) + h.GetXaxis().SetLabelFont(62) + h.GetXaxis().SetMoreLogLabels(1) + h.GetYaxis().SetTitleSize(0.055) + h.GetYaxis().SetTitleOffset(0.9) + h.GetYaxis().SetLabelSize(0.045) + h.GetYaxis().SetTitleFont(62) + h.GetYaxis().SetLabelFont(62) + return h + +def setPTHisto(f_name, dir_name, h_name, clone_suffix, title, lcolor, lstyle, lwidth): + h0 = getPTHisto(f_name, dir_name, h_name, clone_suffix) + return setPTHisto(h0, title, lcolor, lstyle, lwidth) + +def setHisto(f_name, name, cname, title, lcolor, lstyle, lwidth): + print "Opening ", f_name + f = TFile.Open(f_name) + h0 = getH(f, dir, name) + nb = h0.GetXaxis().GetNbins() + ## FIXME - the number of bins is hard-coded to be 30!!! + h = TH1D(s_name + cname, title, len(ptscaleb_), ptscaleb_) + for b in range(1,nb+1): + bc = h0.GetBinContent(b) + if (bc==0): + continue + bin = h.GetXaxis().FindFixBin(h0.GetBinCenter(b)) + h.SetBinContent(bin, bc) + for b in range(1,31): + h.SetBinContent(b, h.Integral(b,31)) + + h.Sumw2() + scale(h) + h.SetLineColor(lcolor) + h.SetFillColor(lcolor) + h.SetLineStyle(lstyle) + h.SetLineWidth(lwidth) + h.SetTitle(title) + h.GetXaxis().SetRangeUser(2, 129.) + h.GetYaxis().SetRangeUser(gdy[0],gdy[1]) + h.GetXaxis().SetTitleSize(0.055) + h.GetXaxis().SetTitleOffset(1.05) + h.GetXaxis().SetLabelSize(0.045) + h.GetXaxis().SetLabelOffset(0.003) + h.GetXaxis().SetTitleFont(62) + h.GetXaxis().SetLabelFont(62) + h.GetXaxis().SetMoreLogLabels(1) + h.GetYaxis().SetTitleSize(0.055) + h.GetYaxis().SetTitleOffset(0.9) + h.GetYaxis().SetLabelSize(0.045) + h.GetYaxis().SetTitleFont(62) + h.GetYaxis().SetLabelFont(62) + ##h.GetYaxis().SetLabelOffset(0.015) + return h + +def setHistoRatio(num, denom, title = "", ymin=0.4, ymax=1.6, color = kRed+3): + ratio = num.Clone("%s--%s_ratio"%(num.GetName(),denom.GetName())) + ratio.Divide(num, denom, 1., 1.) + ratio.SetTitle(title) + ratio.GetYaxis().SetRangeUser(ymin, ymax) + ratio.GetYaxis().SetTitle("ratio: (with GEM)/default") + ratio.GetYaxis().SetTitleSize(.14) + ratio.GetYaxis().SetTitleOffset(0.4) + ratio.GetYaxis().SetLabelSize(.11) + ##ratio.GetXaxis().SetMoreLogLabels(1) + ratio.GetXaxis().SetTitle("p_{T}^{cut} [GeV/c]") + ratio.GetXaxis().SetLabelSize(.11) + ratio.GetXaxis().SetTitleSize(.14) + ratio.GetXaxis().SetTitleOffset(1.3) + ratio.SetLineWidth(2) + ratio.SetFillColor(color) + ratio.SetLineColor(color) + ratio.SetMarkerColor(color) + ratio.SetMarkerStyle(20) + ##ratio.Draw("e3") + return ratio + + +if __name__ == "__main__": + print "It's Working!" From aaff33b9e8c53212d6b58821bae8b3e4e6fc1905 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 16 Aug 2013 00:27:17 +0200 Subject: [PATCH 087/182] started to pyrootize the drawplot_etastep --- SimMuL1/scripts/drawplot_etastep.py | 2502 +++++++++++++++++++++++++++ 1 file changed, 2502 insertions(+) create mode 100644 SimMuL1/scripts/drawplot_etastep.py diff --git a/SimMuL1/scripts/drawplot_etastep.py b/SimMuL1/scripts/drawplot_etastep.py new file mode 100644 index 0000000000000..170e1ae579c37 --- /dev/null +++ b/SimMuL1/scripts/drawplot_etastep.py @@ -0,0 +1,2502 @@ +from ROOT import * +from triggerPlotHelpers import * + + + + + + +##kGray=920, kOrange=800, kSpring=820, kTeal=840, kAzure=860, kViolet=880, kPink=900 + +""" +char pdir[111] = "plots/" + +interactive = 1 +filesDir = "files/" +plotDir = "plots/efficiency/" +ext = ".pdf" + +yrange[2]={0.,1.04} +yrange05[2]={0.5,1.04} +yrange06[2]={0.6,1.04} +yrange07[2]={0.7,1.04} +##yrange[2]={0.5,1.02} +##yrange[2]={0.8,1.02} +xrange[2]={0.86,2.5} +xrangept[2]={0.,100.} + +do_h_eff_eta_steps_xchk1 = False +do_h_eff_eta_me1_after_alct_okAlct = False +h_eff_eta_steps_full10 = True + +##do_h_eff_eta_me1_after_alct_okAlct = True +""" + +def setEffHisto(num_name, den_name, dir, nrebin, lcolor, lstyle, lwidth, + htitle, xtitle, ytitle, x_range, y_range): + """Set efficiency histogram""" + hd0 = getH(dir,den_name) + hn0 = getH(dir,num_name) + + hd = hd0.Clone(den_name + "_cln") + hn = hn0.Clone(num_name + "_cln") + hd.Sumw2() + hn.Sumw2() + + myRebin(hd, nrebin) + myRebin(hn, nrebin) + heff = hn.Clone(num_name+"_eff") + + hd.Sumw2() + heff.Sumw2() + heff.Divide(heff,hd) + heff.SetLineColor(lcolor) + heff.SetLineStyle(lstyle) + heff.SetLineWidth(lwidth) + heff.SetTitle(htitle) + heff.GetXaxis().SetTitle(xtitle) + heff.GetYaxis().SetTitle(ytitle) + heff.GetXaxis().SetRangeUser(x_range[0],x_range[1]) + heff.GetYaxis().SetRangeUser(y_range[0],y_range[1]) + heff.GetXaxis().SetTitleSize(0.07) + heff.GetXaxis().SetTitleOffset(0.7) + heff.GetYaxis().SetLabelOffset(0.015) + heff.GetXaxis().SetLabelSize(0.05) + heff.GetYaxis().SetLabelSize(0.05) + return heff + + +def getEffHisto(fname, hdir, num_name, den_name, nrebin, lcolor, lstyle, lwidth, title, x_range, y_range): + fh = TFile.Open(fname) + + hd0 = fh.Get(hdir + "/" + den_name) + hn0 = fh.Get(hdir + "/" + num_name) + + hd = hd0.Clone(den_name+"_cln_"+fname) + hn = hn0.Clone(num_name+"_cln_"+fname) + hd.Sumw2() + hn.Sumw2() + + myRebin(hd, nrebin) + myRebin(hn, nrebin) + + heff = hn.Clone(num_name+"_eff_"+fname) + + hd.Sumw2() + heff.Sumw2() + + heff.Divide(heff,hd) + + heff.SetLineColor(lcolor) + heff.SetLineStyle(lstyle) + heff.SetLineWidth(lwidth) + + heff.SetTitle(title) + ##heff.GetXaxis().SetTitle(xtitle) + ##heff.GetYaxis().SetTitle(ytitle) + heff.GetXaxis().SetRangeUser(x_range[0],x_range[1]) + heff.GetYaxis().SetRangeUser(y_range[0],y_range[1]) + + heff.GetXaxis().SetTitleSize(0.07) + heff.GetXaxis().SetTitleOffset(0.7) + heff.GetYaxis().SetLabelOffset(0.015) + + heff.GetXaxis().SetLabelSize(0.05) + heff.GetYaxis().SetLabelSize(0.05) + + h1 = hn0 + h2 = hd0 + he = heff + + ##fh.Close() + return heff + +def gem_eff_draw(): + """Rate the efficiency plots""" + gStyle.SetOptStat(0) + gStyle.SetTitleStyle(0) + + ptreb=2 + + hdir = "SimMuL1StrictAll" + + ##f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_def_pat2.root" + f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem_dphi0_pat2.root" + f_g98_pt10 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt10_pat2.root" + f_g98_pt15 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt15_pat2.root" + f_g98_pt20 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt20_pat2.root" + f_g98_pt30 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt30_pat2.root" + f_g98_pt40 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt40_pat2.root" + + f_g95_pt10 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt10_pat2.root" + f_g95_pt20 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt20_pat2.root" + f_g95_pt30 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt30_pat2.root" + f_g95_pt40 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt40_pat2.root" + + rpt[2] = [0.,49.99] + + htitle = "Efficiency for #mu in 1.6<|#eta|<2.12 to have TF trackp_{T}^{MC}" + + hini = "h_pt_initial_1b" + h2s = "h_pt_after_tfcand_eta1b_2s" + h3s = "h_pt_after_tfcand_eta1b_3s" + h2s1b = "h_pt_after_tfcand_eta1b_2s1b" + h3s1b = "h_pt_after_tfcand_eta1b_3s1b" + + + h_eff_tf0_2s = getEffHisto(f_def, hdir, h2s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange) + h_eff_tf0_3s = getEffHisto(f_def, hdir, h3s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange) + h_eff_tf0_2s1b = getEffHisto(f_def, hdir, h2s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange) + h_eff_tf0_3s1b = getEffHisto(f_def, hdir, h3s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange) + + h_eff_tf10_2s = getEffHisto(f_def, hdir, h2s + "_pt10", hini, ptreb, kGreen+4, 1, 2, htitle, rpt,yrange) + h_eff_tf10_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange) + h_eff_tf10_3s = getEffHisto(f_def, hdir, h3s + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange) + h_eff_tf10_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange) + + ##h_eff_tf15_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange) + ##h_eff_tf15_3s = getEffHisto(f_def, hdir, h3s + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange) + ##h_eff_tf15_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange) + + h_eff_tf20_2s = getEffHisto(f_def, hdir, h2s + "_pt20", hini, ptreb, kOrange+4, 1, 2, htitle, rpt,yrange) + h_eff_tf20_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange) + h_eff_tf20_3s = getEffHisto(f_def, hdir, h3s + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange) + h_eff_tf20_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange) + + h_eff_tf30_2s = getEffHisto(f_def, hdir, h2s + "_pt30", hini, ptreb, kRed+4, 1, 2, htitle, rpt,yrange) + h_eff_tf30_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange) + h_eff_tf30_3s = getEffHisto(f_def, hdir, h3s + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange) + h_eff_tf30_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange) + + h_eff_tf40_2s = getEffHisto(f_def, hdir, h2s + "_pt40", hini, ptreb, kViolet+4, 1, 2, htitle, rpt,yrange) + h_eff_tf40_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt40", hini, ptreb, kViolet, 1, 2, htitle, rpt,yrange) + h_eff_tf40_3s = getEffHisto(f_def, hdir, h3s + "_pt40", hini, ptreb, kViolet, 1, 2, htitle, rpt,yrange) + h_eff_tf40_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt40", hini, ptreb, kViolet, 1, 2, htitle, rpt,yrange) + + h_eff_tf10_gpt10_2s1b = getEffHisto(f_g98_pt10, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 7, 2, htitle, rpt,yrange) + h_eff_tf10_gpt10_3s1b = getEffHisto(f_g98_pt10, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 7, 2, htitle, rpt,yrange) + + h_eff_tf15_gpt15_2s1b = getEffHisto(f_g98_pt15, hdir, h2s1b + "_pt15", hini, ptreb, kBlue, 7, 2, htitle, rpt,yrange) + h_eff_tf15_gpt15_3s1b = getEffHisto(f_g98_pt15, hdir, h3s1b + "_pt15", hini, ptreb, kBlue, 7, 2, htitle, rpt,yrange) + + h_eff_tf20_gpt20_2s1b = getEffHisto(f_g98_pt20, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 7, 2, htitle, rpt,yrange) + h_eff_tf20_gpt20_3s1b = getEffHisto(f_g98_pt20, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 7, 2, htitle, rpt,yrange) + + h_eff_tf30_gpt30_2s1b = getEffHisto(f_g98_pt30, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 7, 2, htitle, rpt,yrange) + h_eff_tf30_gpt30_3s1b = getEffHisto(f_g98_pt30, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 7, 2, htitle, rpt,yrange) + + h_eff_tf40_gpt40_2s1b = getEffHisto(f_g98_pt40, hdir, h2s1b + "_pt40", hini, ptreb, kViolet, 7, 2, htitle, rpt,yrange) + h_eff_tf40_gpt40_3s1b = getEffHisto(f_g98_pt40, hdir, h3s1b + "_pt40", hini, ptreb, kViolet, 7, 2, htitle, rpt,yrange) + + + c2s1b = TCanvas("c2s1b","c2s1b",800,600) + + """ + h_eff_gmt20_1b = getEffHisto(f_def, hdir, "h_pt_after_gmt_eta1b_1mu_pt20", hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange) + h_eff_gmt30_1b = getEffHisto(f_def, hdir, "h_pt_after_gmt_eta1b_1mu_pt30", hini, ptreb, kBlack-1, 1, 2, htitle, rpt, yrange) + h_eff_gmt40_1b = getEffHisto(f_def, hdir, "h_pt_after_gmt_eta1b_1mu_pt40", hini, ptreb, kBlack-2, 1, 2, htitle, rpt, yrange) + h_eff_gmt20_1b.Draw("hist") + h_eff_gmt30_1b.Draw("hist same") + h_eff_gmt40_1b.Draw("hist same") + return + + h_eff_tf40_3s.Draw("hist") + h_eff_tf40_3s1b.Draw("hist same") + h_eff_tf40_gpt40_3s1b.Draw("hist same") + return + """ + + + h_eff_tf10_gpt15_2s1b = getEffHisto(f_g98_pt15, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 3, 2, htitle, rpt,yrange) + h_eff_tf10_gpt15_3s1b = getEffHisto(f_g98_pt15, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 3, 2, htitle, rpt,yrange) + + h_eff_tf15_gpt20_2s1b = getEffHisto(f_g98_pt20, hdir, h2s1b + "_pt15", hini, ptreb, kViolet, 3, 2, htitle, rpt,yrange) + h_eff_tf15_gpt20_3s1b = getEffHisto(f_g98_pt20, hdir, h3s1b + "_pt15", hini, ptreb, kViolet, 3, 2, htitle, rpt,yrange) + + h_eff_tf20_gpt30_2s1b = getEffHisto(f_g98_pt30, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 3, 2, htitle, rpt,yrange) + h_eff_tf20_gpt30_3s1b = getEffHisto(f_g98_pt30, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 3, 2, htitle, rpt,yrange) + + h_eff_tf30_gpt40_2s1b = getEffHisto(f_g98_pt40, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 3, 2, htitle, rpt,yrange) + h_eff_tf30_gpt40_3s1b = getEffHisto(f_g98_pt40, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 3, 2, htitle, rpt,yrange) + + + h_eff_tf10_gpt20_2s1b = getEffHisto(f_g98_pt20, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 3, 2, htitle, rpt,yrange) + h_eff_tf10_gpt20_3s1b = getEffHisto(f_g98_pt20, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 3, 2, htitle, rpt,yrange) + + h_eff_tf15_gpt30_2s1b = getEffHisto(f_g98_pt30, hdir, h2s1b + "_pt15", hini, ptreb, kViolet, 3, 2, htitle, rpt,yrange) + h_eff_tf15_gpt30_3s1b = getEffHisto(f_g98_pt30, hdir, h3s1b + "_pt15", hini, ptreb, kViolet, 3, 2, htitle, rpt,yrange) + + h_eff_tf20_gpt40_2s1b = getEffHisto(f_g98_pt40, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 3, 2, htitle, rpt,yrange) + h_eff_tf20_gpt40_3s1b = getEffHisto(f_g98_pt40, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 3, 2, htitle, rpt,yrange) + + + + c2s1b = TCanvas("c2s1b","c2s1b",800,600) + + ##h_eff_tf0_2s1b.Draw("hist") + h_eff_tf10_2s1b.Draw("hist") + ##h_eff_tf15_2s1b.Draw("hist same") + h_eff_tf20_2s1b.Draw("hist same") + h_eff_tf30_2s1b.Draw("hist same") + ##h_eff_tf40_2s1b.Draw("hist same") + + h_eff_tf10_gpt10_2s1b.Draw("hist same") + h_eff_tf20_gpt20_2s1b.Draw("hist same") + h_eff_tf30_gpt30_2s1b.Draw("hist same") + + leg = TLegend(0.50,0.17,.999,0.57, "", "brNDC") + leg.SetNColumns(2) + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("TF track requires 2+ stubs, one from ME1") + leg.AddEntry(h_eff_tf10_2s1b, "Trigger p_{T}:", "") + leg.AddEntry(h_eff_tf10_gpt10_2s1b, "with GEM:", "") + leg.AddEntry(h_eff_tf10_2s1b, "p_{T}^{TF}>=10", "l") + leg.AddEntry(h_eff_tf10_gpt10_2s1b, "#Delta#phi for p_{T}=10", "l") + leg.AddEntry(h_eff_tf20_2s1b, "p_{T}^{TF}>=20", "l") + leg.AddEntry(h_eff_tf20_gpt20_2s1b, "#Delta#phi for p_{T}=20", "l") + leg.AddEntry(h_eff_tf30_2s1b, "p_{T}^{TF}>=30", "l") + leg.AddEntry(h_eff_tf30_gpt30_2s1b, "#Delta#phi for p_{T}=30", "l") + leg.Draw() + + c2s1b.Print(plotDir + "eff_2s1b" + ext) + + + c3s1b = TCanvas("c3s1b","c3s1b",800,600) + + h_eff_tf10_3s1b.Draw("hist") + h_eff_tf20_3s1b.Draw("hist same") + h_eff_tf30_3s1b.Draw("hist same") + + h_eff_tf10_gpt10_3s1b.Draw("hist same") + h_eff_tf20_gpt20_3s1b.Draw("hist same") + h_eff_tf30_gpt30_3s1b.Draw("hist same") + + leg = TLegend(0.50,0.17,.999,0.57, "", "brNDC") + leg.SetNColumns(2) + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("TF track requires 3+ stubs, one from ME1") + leg.AddEntry(h_eff_tf10_3s1b, "Trigger p_{T}:", "") + leg.AddEntry(h_eff_tf10_gpt10_3s1b, "with GEM:", "") + leg.AddEntry(h_eff_tf10_3s1b, "p_{T}^{TF}>=10", "l") + leg.AddEntry(h_eff_tf10_gpt10_3s1b, "#Delta#phi for p_{T}=10", "l") + leg.AddEntry(h_eff_tf20_3s1b, "p_{T}^{TF}>=20", "l") + leg.AddEntry(h_eff_tf20_gpt20_3s1b, "#Delta#phi for p_{T}=20", "l") + leg.AddEntry(h_eff_tf30_3s1b, "p_{T}^{TF}>=30", "l") + leg.AddEntry(h_eff_tf30_gpt30_3s1b, "#Delta#phi for p_{T}=30", "l") + leg.Draw() + + c3s1b.Print(plotDir + "eff_3s1b" + ext) + + + + c3s_2s1b = TCanvas("c3s_2s1b","c3s_2s1b",800,600) + + h_eff_tf10_3s.Draw("hist") + h_eff_tf20_3s.Draw("hist same") + h_eff_tf30_3s.Draw("hist same") + + h_eff_tf10_gpt10_2s1b.Draw("hist same") + h_eff_tf20_gpt20_2s1b.Draw("hist same") + h_eff_tf30_gpt30_2s1b.Draw("hist same") + + leg = TLegend(0.50,0.17,.999,0.57, "", "brNDC") + leg.SetNColumns(2) + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("TF track requires") + leg.AddEntry(h_eff_tf10_3s, "3+ stubs", "") + leg.AddEntry(h_eff_tf10_gpt10_2s1b, "2+ stubs with GEM in ME1", "") + leg.AddEntry(h_eff_tf10_3s, "p_{T}^{TF}>=10", "l") + leg.AddEntry(h_eff_tf10_gpt10_2s1b, "#Delta#phi for p_{T}=10", "l") + leg.AddEntry(h_eff_tf20_3s, "p_{T}^{TF}>=20", "l") + leg.AddEntry(h_eff_tf20_gpt20_2s1b, "#Delta#phi for p_{T}=20", "l") + leg.AddEntry(h_eff_tf30_3s, "p_{T}^{TF}>=30", "l") + leg.AddEntry(h_eff_tf30_gpt30_2s1b, "#Delta#phi for p_{T}=30", "l") + leg.Draw() + + c3s_2s1b.Print(plotDir + "eff_3s_2s1b" + ext) + + + + + c3s_def = TCanvas("c3s_def","c3s_def",800,600) + + h_eff_tf10_3s.Draw("hist") + h_eff_tf20_3s.Draw("hist same") + h_eff_tf30_3s.Draw("hist same") + + leg = TLegend(0.55,0.17,.999,0.57, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("TF track requires 3+ stubs and") + leg.AddEntry(h_eff_tf10_3s, "p_{T}^{TF}>=10", "l") + leg.AddEntry(h_eff_tf20_3s, "p_{T}^{TF}>=20", "l") + leg.AddEntry(h_eff_tf30_3s, "p_{T}^{TF}>=30", "l") + leg.Draw() + + c3s_def.Print(plotDir + "eff_3s_def" + ext) + + + c3s1b_def = TCanvas("c3s1b_def","c3s1b_def",800,600) + + h_eff_tf10_3s1b.Draw("hist") + h_eff_tf20_3s1b.Draw("hist same") + h_eff_tf30_3s1b.Draw("hist same") + + leg = TLegend(0.55,0.17,.999,0.57, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("TF track requires 3+ stubs with ME1 and") + leg.AddEntry(h_eff_tf10_3s, "p_{T}^{TF}>=10", "l") + leg.AddEntry(h_eff_tf20_3s, "p_{T}^{TF}>=20", "l") + leg.AddEntry(h_eff_tf30_3s, "p_{T}^{TF}>=30", "l") + leg.Draw() + + c3s1b_def.Print(plotDir + "eff_3s1b_def" + ext) + + + + h_eff_tf10_2s.SetLineColor(kAzure+2) + h_eff_tf10_2s1b.SetLineColor(kAzure+6) + h_eff_tf10_3s.SetLineColor(kAzure+3) + h_eff_tf10_3s1b.SetLineColor(kAzure+7) + h_eff_tf10_gpt10_2s1b.SetLineColor(kAzure+6) + h_eff_tf10_gpt10_3s1b.SetLineColor(kAzure+7) + + h_eff_tf20_2s.SetLineColor(kAzure+2) + h_eff_tf20_2s1b.SetLineColor(kAzure+6) + h_eff_tf20_3s.SetLineColor(kAzure+3) + h_eff_tf20_3s1b.SetLineColor(kAzure+7) + h_eff_tf20_gpt20_2s1b.SetLineColor(kAzure+6) + h_eff_tf20_gpt20_3s1b.SetLineColor(kAzure+7) + + h_eff_tf30_2s.SetLineColor(kAzure+2) + h_eff_tf30_2s1b.SetLineColor(kAzure+6) + h_eff_tf30_3s.SetLineColor(kAzure+3) + h_eff_tf30_3s1b.SetLineColor(kAzure+7) + h_eff_tf30_gpt30_2s1b.SetLineColor(kAzure+6) + h_eff_tf30_gpt30_3s1b.SetLineColor(kAzure+7) + + h_eff_tf40_2s.SetLineColor(kAzure+2) + h_eff_tf40_2s1b.SetLineColor(kAzure+6) + h_eff_tf40_3s.SetLineColor(kAzure+3) + h_eff_tf40_3s1b.SetLineColor(kAzure+7) + h_eff_tf40_gpt40_2s1b.SetLineColor(kAzure+6) + h_eff_tf40_gpt40_3s1b.SetLineColor(kAzure+7) + + + c2s_pt10_def = TCanvas("c2s_pt10_def","c2s_pt10_def",800,600) + + h_eff_tf10_2s.Draw("hist") + h_eff_tf10_2s1b.Draw("hist same") + + leg = TLegend(0.55,0.17,.999,0.57, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("TF track: p_{T}^{TF}>=10 and 2+ stubs") + leg.AddEntry(h_eff_tf10_2s, "anywhere", "l") + leg.AddEntry(h_eff_tf10_2s1b, "with ME1", "l") + leg.Draw() + + c2s_pt10_def.Print(plotDir + "eff_2s_pt10_def" + ext) + + h_eff_tf10_gpt10_2s1b.Draw("hist same") + leg.AddEntry(h_eff_tf10_gpt10_2s1b, "with (ME1 + GEM)", "l") + c2s_pt10_def.Print(plotDir + "eff_2s_pt10_gem" + ext) + + + + c3s_pt10_def = TCanvas("c3s_pt10_def","c3s_pt10_def",800,600) + + h_eff_tf10_3s.Draw("hist") + h_eff_tf10_3s1b.Draw("hist same") + + leg = TLegend(0.55,0.17,.999,0.57, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("TF track: p_{T}^{TF}>=10 and 3+ stubs") + leg.AddEntry(h_eff_tf10_3s, "anywhere", "l") + leg.AddEntry(h_eff_tf10_3s1b, "with ME1", "l") + leg.Draw() + + c3s_pt10_def.Print(plotDir + "eff_3s_pt10_def" + ext) + + h_eff_tf10_gpt10_3s1b.Draw("hist same") + leg.AddEntry(h_eff_tf10_gpt10_3s1b, "with (ME1 + GEM)", "l") + c3s_pt10_def.Print(plotDir + "eff_3s_pt10_gem" + ext) + + + + + c2s_pt20_def = TCanvas("c2s_pt20_def","c2s_pt20_def",800,600) + + h_eff_tf20_2s.Draw("hist") + h_eff_tf20_2s1b.Draw("hist same") + + leg = TLegend(0.55,0.17,.999,0.57, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("TF track: p_{T}^{TF}>=20 and 2+ stubs") + leg.AddEntry(h_eff_tf20_2s, "anywhere", "l") + leg.AddEntry(h_eff_tf20_2s1b, "with ME1", "l") + leg.Draw() + + c2s_pt20_def.Print(plotDir + "eff_2s_pt20_def" + ext) + + h_eff_tf20_gpt20_2s1b.Draw("hist same") + leg.AddEntry(h_eff_tf20_gpt20_2s1b, "with (ME1 + GEM)", "l") + c2s_pt20_def.Print(plotDir + "eff_2s_pt20_gem" + ext) + + + + c3s_pt20_def = TCanvas("c3s_pt20_def","c3s_pt20_def",800,600) + + h_eff_tf20_3s.Draw("hist") + h_eff_tf20_3s1b.Draw("hist same") + + leg = TLegend(0.55,0.17,.999,0.57, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("TF track: p_{T}^{TF}>=20 and 3+ stubs") + leg.AddEntry(h_eff_tf20_3s, "anywhere", "l") + leg.AddEntry(h_eff_tf20_3s1b, "with ME1", "l") + leg.Draw() + + c3s_pt20_def.Print(plotDir + "eff_3s_pt20_def" + ext) + + h_eff_tf20_gpt20_3s1b.Draw("hist same") + leg.AddEntry(h_eff_tf20_gpt20_3s1b, "with (ME1 + GEM)", "l") + c3s_pt20_def.Print(plotDir + "eff_3s_pt20_gem" + ext) + + + + c2s_pt30_def = TCanvas("c2s_pt30_def","c2s_pt30_def",800,600) + + h_eff_tf30_2s.Draw("hist") + h_eff_tf30_2s1b.Draw("hist same") + + leg = TLegend(0.55,0.17,.999,0.57, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("TF track: p_{T}^{TF}>=30 and 2+ stubs") + leg.AddEntry(h_eff_tf30_2s, "anywhere", "l") + leg.AddEntry(h_eff_tf30_2s1b, "with ME1", "l") + leg.Draw() + + c2s_pt30_def.Print(plotDir + "eff_2s_pt30_def" + ext) + + h_eff_tf30_gpt30_2s1b.Draw("hist same") + leg.AddEntry(h_eff_tf30_gpt30_2s1b, "with (ME1 + GEM)", "l") + c2s_pt30_def.Print(plotDir + "eff_2s_pt30_gem" + ext) + + + + c3s_pt30_def = TCanvas("c3s_pt30_def","c3s_pt30_def",800,600) + + h_eff_tf30_3s.Draw("hist") + h_eff_tf30_3s1b.Draw("hist same") + + leg = TLegend(0.55,0.17,.999,0.57, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("TF track: p_{T}^{TF}>=30 and 3+ stubs") + leg.AddEntry(h_eff_tf30_3s, "anywhere", "l") + leg.AddEntry(h_eff_tf30_3s1b, "with ME1", "l") + leg.Draw() + + c3s_pt30_def.Print(plotDir + "eff_3s_pt30_def" + ext) + + h_eff_tf30_gpt30_3s1b.Draw("hist same") + leg.AddEntry(h_eff_tf30_gpt30_3s1b, "with (ME1 + GEM)", "l") + c3s_pt30_def.Print(plotDir + "eff_3s_pt30_gem" + ext) + + + + c2s_pt40_def = TCanvas("c2s_pt40_def","c2s_pt40_def",800,600) + + h_eff_tf40_2s.Draw("hist") + h_eff_tf40_2s1b.Draw("hist same") + + leg = TLegend(0.55,0.17,.999,0.57, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("TF track: p_{T}^{TF}>=40 and 2+ stubs") + leg.AddEntry(h_eff_tf40_2s, "anywhere", "l") + leg.AddEntry(h_eff_tf40_2s1b, "with ME1", "l") + leg.Draw() + + c2s_pt40_def.Print(plotDir + "eff_2s_pt40_def" + ext) + + h_eff_tf40_gpt40_2s1b.Draw("hist same") + leg.AddEntry(h_eff_tf40_gpt40_2s1b, "with (ME1 + GEM)", "l") + c2s_pt40_def.Print(plotDir + "eff_2s_pt40_gem" + ext) + + + + c3s_pt40_def = TCanvas("c3s_pt40_def","c3s_pt40_def",800,600) + + h_eff_tf40_3s.Draw("hist") + h_eff_tf40_3s1b.Draw("hist same") + + leg = TLegend(0.55,0.17,.999,0.57, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("TF track: p_{T}^{TF}>=40 and 3+ stubs") + leg.AddEntry(h_eff_tf40_3s, "anywhere", "l") + leg.AddEntry(h_eff_tf40_3s1b, "with ME1", "l") + leg.Draw() + + c3s_pt40_def.Print(plotDir + "eff_3s_pt40_def" + ext) + + h_eff_tf40_gpt40_3s1b.Draw("hist same") + leg.AddEntry(h_eff_tf40_gpt40_3s1b, "with (ME1 + GEM)", "l") + c3s_pt40_def.Print(plotDir + "eff_3s_pt40_gem" + ext) + + + + ##return + + h_eff_tf10_gpt10_3s1b.SetLineColor(kBlue) + h_eff_tf10_gpt15_3s1b.SetLineColor(kMagenta) + h_eff_tf20_gpt20_3s1b.SetLineColor(kBlue+2) + h_eff_tf20_gpt30_3s1b.SetLineColor(kMagenta+2) + h_eff_tf30_gpt30_3s1b.SetLineColor(kBlue+4) + h_eff_tf30_gpt40_3s1b.SetLineColor(kMagenta+4) + + c3s_tight = TCanvas("c3s_tight","c3s_tight",800,600) + + h_eff_tf10_gpt10_3s1b.Draw("hist") + h_eff_tf10_gpt15_3s1b.Draw("hist same") + + ##h_eff_tf15_gpt15_3s1b.Draw("hist same") + ##h_eff_tf15_gpt20_3s1b.Draw("hist same") + + h_eff_tf20_gpt20_3s1b.Draw("hist same") + h_eff_tf20_gpt30_3s1b.Draw("hist same") + + h_eff_tf30_gpt30_3s1b.Draw("hist same") + h_eff_tf30_gpt40_3s1b.Draw("hist same") + + leg = TLegend(0.55,0.17,.999,0.57, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetNColumns(2) + leg.SetHeader("TF track: 3+ stubs with ME1") + leg.AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T}^{TF} cut and", "") + leg.AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T}^{TF} cut and", "") + leg.AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T} for #Delta#phi(GEM,LCT)", "") + leg.AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T} for #Delta#phi(GEM,LCT)", "") + leg.AddEntry(h_eff_tf10_gpt10_3s1b, "#geq10 and 10", "l") + leg.AddEntry(h_eff_tf10_gpt15_3s1b, "#geq10 and 15", "l") + leg.AddEntry(h_eff_tf20_gpt20_3s1b, "#geq20 and 20", "l") + leg.AddEntry(h_eff_tf20_gpt30_3s1b, "#geq20 and 30", "l") + leg.AddEntry(h_eff_tf30_gpt30_3s1b, "#geq30 and 30", "l") + leg.AddEntry(h_eff_tf30_gpt40_3s1b, "#geq30 and 40", "l") + leg.Draw() + + c3s_tight.Print(plotDir + "eff_3s_gemtight" + ext) + + + + h_eff_tf10_gpt10_3s1b.SetLineColor(kBlue) + h_eff_tf10_gpt20_3s1b.SetLineColor(kMagenta) + h_eff_tf15_gpt15_3s1b.SetLineColor(kBlue+2) + h_eff_tf15_gpt30_3s1b.SetLineColor(kMagenta+2) + h_eff_tf20_gpt20_3s1b.SetLineColor(kBlue+4) + h_eff_tf20_gpt40_3s1b.SetLineColor(kMagenta+4) + + c3s_tight = TCanvas("c3s_tight","c3s_tight",800,600) + + h_eff_tf10_gpt10_3s1b.Draw("hist") + h_eff_tf10_gpt20_3s1b.Draw("hist same") + + h_eff_tf15_gpt15_3s1b.Draw("hist same") + h_eff_tf15_gpt30_3s1b.Draw("hist same") + + h_eff_tf20_gpt20_3s1b.Draw("hist same") + h_eff_tf20_gpt40_3s1b.Draw("hist same") + + leg = TLegend(0.55,0.17,.999,0.57, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetNColumns(2) + leg.SetHeader("TF track: 3+ stubs with ME1") + leg.AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T}^{TF} cut and", "") + leg.AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T}^{TF} cut and", "") + leg.AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T} for #Delta#phi(GEM,LCT)", "") + leg.AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T} for #Delta#phi(GEM,LCT)", "") + leg.AddEntry(h_eff_tf10_gpt10_3s1b, "#geq10 and 10", "l") + leg.AddEntry(h_eff_tf10_gpt20_3s1b, "#geq10 and 20", "l") + leg.AddEntry(h_eff_tf15_gpt15_3s1b, "#geq15 and 15", "l") + leg.AddEntry(h_eff_tf15_gpt30_3s1b, "#geq15 and 30", "l") + leg.AddEntry(h_eff_tf20_gpt20_3s1b, "#geq20 and 20", "l") + leg.AddEntry(h_eff_tf20_gpt40_3s1b, "#geq20 and 40", "l") + leg.Draw() + + c3s_tight.Print(plotDir + "eff_3s_gemtightX" + ext) + + + +#### + + +def gem_eff_draw_gem1b(): + """Draw trigger efficiency plots""" + gStyle.SetOptStat(0) + gStyle.SetTitleStyle(0) + + ptreb=2 + + hdir = "SimMuL1StrictAll" + + ##f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_def_pat2.root" + f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem_dphi0_pat2.root" + + rpt[2] = {0.,49.99} + + + + hini = "h_pt_initial_gem_1b" + hini_g = "h_pt_gem_1b" + hini_gl = "h_pt_lctgem_1b" + + h2g_00 = "h_pt_after_tfcand_gem1b_2s1b" + h2g_00_123 = "h_pt_after_tfcand_gem1b_2s123" + h2g_00_13 = "h_pt_after_tfcand_gem1b_2s13" + h3g_00 = "h_pt_after_tfcand_gem1b_3s1b" + h2p_00 = "h_pt_after_tfcand_dphigem1b_2s1b" + h2p_00_123 = "h_pt_after_tfcand_dphigem1b_2s123" + h2p_00_13 = "h_pt_after_tfcand_dphigem1b_2s13" + h3p_00 = "h_pt_after_tfcand_dphigem1b_3s1b" + + h2g_15 = "h_pt_after_tfcand_gem1b_2s1b_pt15" + h2g_15_123 = "h_pt_after_tfcand_gem1b_2s123_pt15" + h2g_15_13 = "h_pt_after_tfcand_gem1b_2s13_pt15" + h3g_15 = "h_pt_after_tfcand_gem1b_3s1b_pt15" + h2p_15 = "h_pt_after_tfcand_dphigem1b_2s1b_pt15" + h2p_15_123 = "h_pt_after_tfcand_dphigem1b_2s123_pt15" + h2p_15_13 = "h_pt_after_tfcand_dphigem1b_2s13_pt15" + h3p_15 = "h_pt_after_tfcand_dphigem1b_3s1b_pt15" + + h2g_20 = "h_pt_after_tfcand_gem1b_2s1b_pt20" + h2g_20_123 = "h_pt_after_tfcand_gem1b_2s123_pt20" + h2g_20_13 = "h_pt_after_tfcand_gem1b_2s13_pt20" + h3g_20 = "h_pt_after_tfcand_gem1b_3s1b_pt20" + h2p_20 = "h_pt_after_tfcand_dphigem1b_2s1b_pt20" + h2p_20_123 = "h_pt_after_tfcand_dphigem1b_2s123_pt20" + h2p_20_13 = "h_pt_after_tfcand_dphigem1b_2s13_pt20" + h3p_20 = "h_pt_after_tfcand_dphigem1b_3s1b_pt20" + + h2g_30 = "h_pt_after_tfcand_gem1b_2s1b_pt30" + h2g_30_123 = "h_pt_after_tfcand_gem1b_2s123_pt30" + h2g_30_13 = "h_pt_after_tfcand_gem1b_2s13_pt30" + h3g_30 = "h_pt_after_tfcand_gem1b_3s1b_pt30" + h2p_30 = "h_pt_after_tfcand_dphigem1b_2s1b_pt30" + h2p_30_123 = "h_pt_after_tfcand_dphigem1b_2s123_pt30" + h2p_30_13 = "h_pt_after_tfcand_dphigem1b_2s13_pt30" + h3p_30 = "h_pt_after_tfcand_dphigem1b_3s1b_pt30" + + + c2 = TCanvas("c2","c2",800,600) + gPad.SetGridx(1) + gPad.SetGridy(1) + + + htitle = "Efficiency for #mu (GEM) in 1.64<|#eta|<2.05 to have TF track with ME1/b stubp_{T}^{MC}" + + hel = getEffHisto(f_def, hdir, hini_gl, hini_g, ptreb, kBlack, 1, 2, htitle, rpt, yrange07) + hel.Draw("hist") + het2 = getEffHisto(f_def, hdir, h2g_00, hini_g, ptreb, kGreen+2, 1, 2, htitle, rpt, yrange07) + het2.Draw("same hist") + het3 = getEffHisto(f_def, hdir, h3g_00, hini_g, ptreb, kGreen+2, 2, 2, htitle, rpt, yrange07) + het3.Draw("same hist") + het2pt20 = getEffHisto(f_def, hdir, h2g_20, hini_g, ptreb, kBlue, 1, 2, htitle, rpt, yrange07) + het2pt20.Draw("same hist") + het3pt20 = getEffHisto(f_def, hdir, h3g_20, hini_g, ptreb, kBlue, 2, 2, htitle, rpt, yrange07) + het3pt20.Draw("same hist") + + leg = TLegend(0.55,0.17,.999,0.57, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetNColumns(2) + ##leg.SetHeader("TF track: 3+ stubs with ME1") + leg.AddEntry(hel, "ME1/b LCT stub", "l") + leg.AddEntry(hel, " ", "") + leg.AddEntry(het2, "any p_{T}^{TF}, 2+ stubs", "l") + leg.AddEntry(het2pt20, "p_{T}^{TF}#geq20, 2+ stubs", "l") + leg.AddEntry(het3, "any p_{T}^{TF}, 3+ stubs", "l") + leg.AddEntry(het3pt20, "p_{T}^{TF}#geq20, 3+ stubs", "l") + leg.Draw() + + c2.Print(plotDir + "eff_gem1b_basegem" + ext) + + + + htitle = "Efficiency for #mu (GEM+LCT) in 1.64<|#eta|<2.05 to have TF track with ME1/b stubp_{T}^{MC}" + + helt2pt20 = getEffHisto(f_def, hdir, h2g_20, hini_gl, ptreb, kMagenta-3, 1, 2, htitle, rpt, yrange07) + helt2pt20.Draw("hist") + helt3pt20 = getEffHisto(f_def, hdir, h3g_20, hini_gl, ptreb, kMagenta-3, 2, 2, htitle, rpt, yrange07) + helt3pt20.Draw("same hist") + het2pt20.Draw("same hist") + het3pt20.Draw("same hist") + + leg = TLegend(0.55,0.17,.999,0.57, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetNColumns(2) + leg.SetHeader("TF track p_{T}^{TF}#geq20 with ME1") + leg.AddEntry(het2pt20, "GEM baseline", "") + leg.AddEntry(helt2pt20, "GEM+LCT baseline", "") + leg.AddEntry(het2pt20, "2+ stubs", "l") + leg.AddEntry(helt2pt20, "2+ stubs", "l") + leg.AddEntry(het3pt20, "3+ stubs", "l") + leg.AddEntry(helt3pt20, "3+ stubs", "l") + leg.Draw() + c2.Print(plotDir + "eff_gem1b_baselctgem" + ext) + + ##return + + htitle = "Efficiency for #mu (GEM) in 1.64<|#eta|<2.05 to have TF track with ME1/b stubp_{T}^{MC}" + + het2pt20.Draw("hist") + het3pt20.Draw("same hist") + het2pt20p = getEffHisto(f_def, hdir, h2p_20, hini_g, ptreb, kGray+2, 1, 2, htitle, rpt, yrange07) + het2pt20p.Draw("same hist") + het3pt20p = getEffHisto(f_def, hdir, h3p_20, hini_g, ptreb, kGray+2, 2, 2, htitle, rpt, yrange07) + het3pt20p.Draw("same hist") + + leg = TLegend(0.55,0.17,.999,0.57, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetNColumns(2) + leg.SetHeader("TF track p_{T}^{TF}#geq20 with ME1") + leg.AddEntry(het2pt20, "no GEM #Delta#phi", "") + leg.AddEntry(het2pt20p, "with GEM #Delta#phi", "l") + leg.AddEntry(het2pt20, "2+ stubs", "l") + leg.AddEntry(het2pt20p, "2+ stubs", "l") + leg.AddEntry(het3pt20, "3+ stubs", "l") + leg.AddEntry(het3pt20p, "3+ stubs", "l") + leg.Draw() + c2.Print(plotDir + "eff_gem1b_basegem_dphi" + ext) + + + htitle = "Efficiency for #mu (GEM+LCT) in 1.64<|#eta|<2.05 to have TF track with ME1/b stubp_{T}^{MC}" + + helt2pt20.Draw("hist") + helt3pt20.Draw("same hist") + helt2pt20p = getEffHisto(f_def, hdir, h2p_20, hini_gl, ptreb, kGray+2, 1, 2, htitle, rpt, yrange07) + helt2pt20p.Draw("same hist") + helt3pt20p = getEffHisto(f_def, hdir, h3p_20, hini_gl, ptreb, kGray+2, 2, 2, htitle, rpt, yrange07) + helt3pt20p.Draw("same hist") + + leg = TLegend(0.55,0.17,.999,0.57, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetNColumns(2) + leg.SetHeader("TF track p_{T}^{TF}#geq20 with ME1") + leg.AddEntry(helt2pt20, "no GEM #Delta#phi", "") + leg.AddEntry(helt2pt20p, "with GEM #Delta#phi", "l") + leg.AddEntry(helt2pt20, "2+ stubs", "l") + leg.AddEntry(helt2pt20p, "2+ stubs", "l") + leg.AddEntry(helt3pt20, "3+ stubs", "l") + leg.AddEntry(helt3pt20p, "3+ stubs", "l") + leg.Draw() + c2.Print(plotDir + "eff_gem1b_baselpcgem_dphi" + ext) + + + helt2pt20.Draw("hist") + helt3pt20.Draw("same hist") + helt2pt20_123 = getEffHisto(f_def, hdir, h2g_20_123, hini_gl, ptreb, kMagenta-3, 9, 2, htitle, rpt, yrange07) + helt2pt20_123.Draw("same hist") + helt3pt20_13 = getEffHisto(f_def, hdir, h2g_20_13, hini_gl, ptreb, kMagenta-3, 7, 2, htitle, rpt, yrange07) + helt3pt20_13.Draw("same hist") + + leg = TLegend(0.5,0.17,.999,0.55, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + ##leg.SetNColumns(2) + leg.SetHeader("TF track p_{T}^{TF}#geq20 with ME1") + ##leg.AddEntry(helt2pt20, "no GEM #Delta#phi", "") + ##leg.AddEntry(helt2pt20p, "with GEM #Delta#phi", "") + leg.AddEntry(helt2pt20, "2+ stubs", "l") + leg.AddEntry(helt2pt20_123, "2+ stubs (no ME1-4 tracks)", "l") + leg.AddEntry(helt3pt20_13, "2+ stubs (no ME1-2 and ME1-4)", "l") + leg.AddEntry(helt3pt20, "3+ stubs", "l") + leg.Draw() + c2.Print(plotDir + "eff_gem1b_baselpcgem_123" + ext) + + return + + hegl = getEffHisto(f_def, hdir, hgl, hini, ptreb, kRed, 1, 2, htitle, rpt, yrange) + hegl.Draw("same hist") + heg = getEffHisto(f_def, hdir, hg, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange) + heg.Draw("same hist") + + hini = "h_pt_initial_1b" + h2s = "h_pt_after_tfcand_eta1b_2s" + h3s = "h_pt_after_tfcand_eta1b_3s" + h2s1b = "h_pt_after_tfcand_eta1b_2s1b" + h3s1b = "h_pt_after_tfcand_eta1b_3s1b" + + + h_eff_tf0_2s = getEffHisto(f_def, hdir, h2s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange) + h_eff_tf0_3s = getEffHisto(f_def, hdir, h3s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange) + h_eff_tf0_2s1b = getEffHisto(f_def, hdir, h2s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange) + h_eff_tf0_3s1b = getEffHisto(f_def, hdir, h3s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange) + + + h_eff_tf10_2s = getEffHisto(f_def, hdir, h2s + "_pt10", hini, ptreb, kGreen+4, 1, 2, htitle, rpt,yrange) + h_eff_tf10_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange) + h_eff_tf10_3s = getEffHisto(f_def, hdir, h3s + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange) + h_eff_tf10_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange) + + +def drawplot_etastep(fname, pu, dname="tf"): + + ## directory for plots is made as + ## pdir = $PWD/pic[_{dname}]_{pu} + + ##gStyle.SetStatW(0.13) + ##gStyle.SetStatH(0.08) + gStyle.SetStatW(0.07) + gStyle.SetStatH(0.06) + + gStyle.SetOptStat(0) + + gStyle.SetTitleStyle(0) + + """ + if (strcmp(dname,"")>0) sprintf(d1,"_%s",dname) + if (strcmp(pu,"")>0) sprintf(d2,"_%s",pu) + sprintf(pdir,"pic%s%s",d1,d2) + + if (interactive){ + if( gSystem.AccessPathName(pdir)==0 ) { + cout<<"directory "<20 to leave #geq4 SimHits in") + l_eff_eta_simh.AddEntry(h_eta_initial_1st,"#geq1 CSC stations","pl") + l_eff_eta_simh.AddEntry(h_eta_initial_2st,"#geq2 CSC stations","pl") + l_eff_eta_simh.AddEntry(h_eta_initial_3st,"#geq3 CSC stations","pl") + l_eff_eta_simh.Draw() + + Print(c_eff_eta_simh,"c_eff_eta_simh" + ext) + + + c_eff_eta_mpc = TCanvas("c_eff_eta_mpc","c_eff_eta_mpc",1000,600 ) + + h_eta_mpc_1st = setEffHisto("h_eta_mpc_1st","h_eta_initial0",dir, etareb, kBlue, 1, 2, "eff(#eta): matched MPC in #geqN CSC stations","MC #eta","",xrange,yrange) + h_eta_mpc_2st = setEffHisto("h_eta_mpc_2st","h_eta_initial0",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange) + h_eta_mpc_3st = setEffHisto("h_eta_mpc_3st","h_eta_initial0",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange) + + h_eta_mpc_1st.Draw("hist") + h_eta_mpc_2st.Draw("hist same") + h_eta_mpc_3st.Draw("hist same") + + l_eff_eta_mpc = TLegend(0.347,0.222,0.926,0.535,"","brNDC") + l_eff_eta_mpc.SetBorderSize(0) + l_eff_eta_mpc.SetFillStyle(0) + l_eff_eta_mpc.SetHeader("Efficiency for #mu with p_{T}>20 to have matched MPCs in") + l_eff_eta_mpc.AddEntry(h_eta_mpc_1st,"#geq1 CSC stations","pl") + l_eff_eta_mpc.AddEntry(h_eta_mpc_2st,"#geq2 CSC stations","pl") + l_eff_eta_mpc.AddEntry(h_eta_mpc_3st,"#geq3 CSC stations","pl") + l_eff_eta_mpc.Draw() + + Print(c_eff_eta_mpc,"c_eff_eta_mpc" + ext) + + + c_eff_eta_mpc_relative = TCanvas("c_eff_eta_mpc_relative","c_eff_eta_mpc_relative",1000,600 ) + + h_eta_mpc_1st_r = setEffHisto("h_eta_mpc_1st","h_eta_initial_1st",dir, etareb, kBlue, 1, 2, "eff(#eta): matched MPC if SimHits#geq4 in #geqN CSC stations","MC #eta","",xrange,yrange) + h_eta_mpc_2st_r = setEffHisto("h_eta_mpc_2st","h_eta_initial_2st",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange) + h_eta_mpc_3st_r = setEffHisto("h_eta_mpc_3st","h_eta_initial_3st",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange) + + h_eta_mpc_1st_r.Draw("hist") + h_eta_mpc_2st_r.Draw("hist same") + h_eta_mpc_3st_r.Draw("hist same") + + l_eff_eta_mpc_relative = TLegend(0.347,0.222,0.926,0.535,"","brNDC") + l_eff_eta_mpc_relative.SetBorderSize(0) + l_eff_eta_mpc_relative.SetFillStyle(0) + l_eff_eta_mpc_relative.SetHeader("Efficiency for #mu with p_{T}>20 to have matched MPCs if it has SimHits#geq4 in") + l_eff_eta_mpc_relative.AddEntry(h_eta_mpc_1st_r,"#geq1 CSC stations","pl") + l_eff_eta_mpc_relative.AddEntry(h_eta_mpc_2st_r,"#geq2 CSC stations","pl") + l_eff_eta_mpc_relative.AddEntry(h_eta_mpc_3st_r,"#geq3 CSC stations","pl") + l_eff_eta_mpc_relative.Draw() + + Print(c_eff_eta_mpc_relative,"c_eff_eta_mpc_relative" + ext) + + + ################################################################################################## + if (interactive): + c_eff_eta_simh_me1 = TCanvas("c_eff_eta_simh_me1","c_eff_eta_simh_me1",1000,600 ) + + h_eta_me1_initial_ = setEffHisto("h_eta_me1_initial","h_eta_initial0",dir, etareb, kBlue, 1, 2, "eff(#eta): SimHits#geq4 in ME1 plus more stations","MC #eta","",xrange,yrange) + h_eta_me1_initial_2st = setEffHisto("h_eta_me1_initial_2st","h_eta_initial0",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange) + h_eta_me1_initial_3st = setEffHisto("h_eta_me1_initial_3st","h_eta_initial0",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange) + + h_eta_me1_initial_.Draw("hist") + h_eta_me1_initial_2st.Draw("hist same") + h_eta_me1_initial_3st.Draw("hist same") + + l_eff_eta_simh_me1 = TLegend(0.347,0.222,0.926,0.535,"","brNDC") + l_eff_eta_simh_me1.SetBorderSize(0) + l_eff_eta_simh_me1.SetFillStyle(0) + l_eff_eta_simh_me1.SetHeader("Efficiency for #mu with p_{T}>20 to leave #geq4 SimHits in") + l_eff_eta_simh_me1.AddEntry(h_eta_me1_initial_,"ME1","pl") + l_eff_eta_simh_me1.AddEntry(h_eta_me1_initial_2st,"ME1 + #geq1 stations","pl") + l_eff_eta_simh_me1.AddEntry(h_eta_me1_initial_3st,"ME1 + #geq2 stations","pl") + l_eff_eta_simh_me1.Draw() + + Print(c_eff_eta_simh_me1,"c_eff_eta_simh_me1" + ext) + + ################################################################################################## + + if (interactive): + c_eff_eta_me1_stubs = TCanvas("c_eff_eta_me1_stubs","c_eff_eta_me1_stubs",1000,600 ) + + h_eff_eta_me1_after_lct = setEffHisto("h_eta_me1_after_lct","h_eta_initial",dir, etareb, kRed, 2, 2, "eff(#eta): ME1 stub studies","#eta","",xrange,yrange) + h_eff_eta_me1_after_alct = setEffHisto("h_eta_me1_after_alct","h_eta_initial",dir, etareb, kBlue+1, 2, 2, "","","",xrange,yrange) + h_eff_eta_me1_after_clct = setEffHisto("h_eta_me1_after_clct","h_eta_initial",dir, etareb, kGreen+1, 2, 2, "","","",xrange,yrange) + h_eff_eta_me1_after_alct_okAlct = setEffHisto("h_eta_me1_after_alct_okAlct","h_eta_initial",dir, etareb, kBlue+1, 1, 2, "","","",xrange,yrange) + h_eff_eta_me1_after_clct_okClct = setEffHisto("h_eta_me1_after_clct_okClct","h_eta_initial",dir, etareb, kGreen+1, 1, 2, "","","",xrange,yrange) + h_eff_eta_me1_after_alctclct = setEffHisto("h_eta_me1_after_alctclct","h_eta_initial",dir, etareb, kYellow+2, 2, 2, "","","",xrange,yrange) + h_eff_eta_me1_after_alctclct_okAlctClct = setEffHisto("h_eta_me1_after_alctclct_okAlctClct","h_eta_initial",dir, etareb, kYellow+2, 1,2, "","","",xrange,yrange) + h_eff_eta_me1_after_lct_okClctAlct = setEffHisto("h_eta_me1_after_lct_okAlctClct","h_eta_initial",dir, etareb, kRed, 1,2, "","","",xrange,yrange) + + h_eff_eta_me1_after_lct.Draw("hist") + h_eff_eta_me1_after_alct.Draw("same hist") + h_eff_eta_me1_after_alct_okAlct.Draw("same hist") + h_eff_eta_me1_after_clct.Draw("same hist") + h_eff_eta_me1_after_clct_okClct.Draw("same hist") + h_eff_eta_me1_after_alctclct.Draw("same hist") + h_eff_eta_me1_after_alctclct_okAlctClct.Draw("same hist") + h_eff_eta_me1_after_lct.Draw("same hist") + h_eff_eta_me1_after_lct_okClctAlct.Draw("same hist") + + h_eff_eta_me1_after_lct_okClctAlct.Fit("pol0","R0","",1.63,2.38) + eff11 = (h_eff_eta_me1_after_lct_okClctAlct.GetFunction("pol0")).GetParameter(0) + print eff11 + h_eff_eta_me1_after_lct_okClctAlct.Fit("pol0","R0","",1.63,2.05) + eff1b = (h_eff_eta_me1_after_lct_okClctAlct.GetFunction("pol0")).GetParameter(0) + h_eff_eta_me1_after_lct_okClctAlct.Fit("pol0","R0","",2.05,2.38) + eff1a = (h_eff_eta_me1_after_lct_okClctAlct.GetFunction("pol0")).GetParameter(0) + print eff11, eff1b, eff1a + + leg = TLegend(0.347,0.222,0.926,0.535,"","brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetNColumns(2) + leg.SetHeader("Efficiency for #mu with p_{T}>20 crossing a ME1 chamber with") + leg.AddEntry(h_eff_eta_me1_after_alct,"any ALCT","pl") + leg.AddEntry(h_eff_eta_me1_after_alct_okAlct,"correct ALCT","pl") + leg.AddEntry(h_eff_eta_me1_after_clct,"any CLCT","pl") + leg.AddEntry(h_eff_eta_me1_after_clct_okClct,"correct CLCT","pl") + leg.AddEntry(h_eff_eta_me1_after_alctclct,"any ALCT and CLCT","pl") + leg.AddEntry(h_eff_eta_me1_after_alctclct_okAlctClct,"correct ALCT and CLCT","pl") + leg.AddEntry(h_eff_eta_me1_after_lct,"any LCT","pl") + leg.AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"correct LCT","pl") + leg.Draw() + + """ + if (interactive): + char ghn[111] + sprintf(ghn,"h_eff_eta_me1_after_lct_okClctAlct_%s",dname) + gh = (TH1F*)h_eff_eta_me1_after_lct_okClctAlct.Clone(ghn) + gh.GetYaxis().SetRangeUser(0.8,1.02) + + gh.SetTitle("LCT finding efficiency in ME1 for #mu with p_{T}>10") + gh.GetXaxis().SetRangeUser(0.8,2.5) + gh.GetYaxis().SetRangeUser(0.,1.05) + gh.GetXaxis().SetTitle("#eta") + gh.GetYaxis().SetTitle("Eff.") + gh.GetXaxis().SetTitleSize(0.07) + gh.GetXaxis().SetTitleOffset(0.7) + gh.GetYaxis().SetLabelOffset(0.015) + """ + + Print(c_eff_eta_me1_stubs,"h_eff_eta_me1_steps_stubs" + ext) + + ################################################################################################## + + if interactive: + c_eff_eta_me1_tf = TCanvas("c_eff_eta_me1_tf","c_eff_eta_me1_tf",1000,600 ) + + h_eff_eta_me1_after_lct_okClctAlct = setEffHisto("h_eta_me1_after_lct_okAlctClct","h_eta_initial",dir, etareb, kRed, 1,2, "eff(#eta): ME1 TF studies", "#eta","",xrange,yrange) + h_eff_eta_me1_after_mplct_okClctAlct_plus = setEffHisto("h_eta_me1_after_mplct_okAlctClct_plus","h_eta_initial",dir, etareb, kBlack, 1,2, "","","",xrange,yrange) + ##h_eff_eta_after_tfcand_ok_plus = setEffHisto("h_eta_after_tfcand_ok_plus","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange) + ##h_eff_eta_after_tfcand_ok_plus_pt10 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange) + h_eff_eta_me1_after_tf_ok_plus = setEffHisto("h_eta_me1_after_tf_ok_plus","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange) + h_eff_eta_me1_after_tf_ok_plus_pt10 = setEffHisto("h_eta_me1_after_tf_ok_plus_pt10","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange) + + h_eff_eta_me1_after_lct_okClctAlct.Draw("hist") + h_eff_eta_me1_after_mplct_okClctAlct_plus.Draw("same hist") + h_eff_eta_me1_after_tf_ok_plus.Draw("same hist") + h_eff_eta_me1_after_tf_ok_plus_pt10.Draw("same hist") + + leg = TLegend(0.347,0.222,0.926,0.535,"","brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("Eff. for #mu with p_{T}>20 crossing ME1+one more station with") + leg.AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"LCT matched in ME1","pl") + leg.AddEntry(h_eff_eta_me1_after_mplct_okClctAlct_plus,"MPC matched in ME1+one","pl") + leg.AddEntry(h_eff_eta_me1_after_tf_ok_plus,"TF track with matched stubs in ME1+one","pl") + leg.AddEntry(h_eff_eta_me1_after_tf_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in ME1+one","pl") + leg.Draw() + + Print(c_eff_eta_me1_tf,"h_eff_eta_me1_tf" + ext) + + + ################################################################################################## + + c_eff_eta_tf = TCanvas("c_eff_eta_tf","c_eff_eta_tf",1000,600 ) + + h_eff_eta_after_mpc_ok_plus = setEffHisto("h_eta_after_mpc_ok_plus","h_eta_initial",dir, etareb, kBlack, 1,2, "eff(#eta): TF studies","#eta","",xrange,yrange) + h_eff_eta_after_tfcand_ok_plus = setEffHisto("h_eta_after_tfcand_ok_plus","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange) + h_eff_eta_after_tfcand_ok_plus_pt10 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange) + + h_eff_eta_after_mpc_ok_plus.Draw("hist") + h_eff_eta_after_tfcand_ok_plus.Draw("same hist") + h_eff_eta_after_tfcand_ok_plus_pt10.Draw("same hist") + + leg = TLegend(0.347,0.19,0.926,0.45,"","brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("Eff. for #mu with p_{T}>20 crossing #geq2 stations with") + leg.AddEntry(h_eff_eta_after_mpc_ok_plus,"MPC matched in 2stations","pl") + leg.AddEntry(h_eff_eta_after_tfcand_ok_plus,"TF track with matched stubs in 2st","pl") + leg.AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl") + leg.Draw() + + Print(c_eff_eta_tf,"h_eff_eta_tf" + ext) + + ################################################################################################## + + c_eff_eta_tf_3st1a = TCanvas("c_eff_eta_tf_3st1a","c_eff_eta_tf_3st1a",1000,600 ) + + h_eff_eta_after_mpc_ok_plus = setEffHisto("h_eta_after_mpc_ok_plus","h_eta_initial",dir, etareb, kBlack, 1,2, "eff(#eta): TF studies (3TF stubs in ME1a)","#eta","",xrange,yrange) + h_eff_eta_after_mpc_ok_plus_3st = setEffHisto("h_eta_after_mpc_ok_plus_3st","h_eta_initial",dir, etareb, kOrange+2, 1,2, "","","",xrange,yrange) + ##h_eff_eta_after_mpc_ok_plus_3st1a = setEffHisto("h_eta_after_mpc_ok_plus_3st1a","h_eta_initial",dir, etareb, kBlack-4, 1,2, "","","",xrange,yrange) + h_eff_eta_after_tfcand_ok_plus_3st1a = setEffHisto("h_eta_after_tfcand_ok_plus_3st1a","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange) + h_eff_eta_after_tfcand_ok_plus_pt10_3st1a = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_3st1a","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange) + + h_eff_eta_after_mpc_ok_plus.Draw("hist") + h_eff_eta_after_mpc_ok_plus_3st.Draw("same hist") + ##h_eff_eta_after_mpc_ok_plus_3st1a.Draw("same hist") + h_eff_eta_after_tfcand_ok_plus_3st1a.Draw("same hist") + h_eff_eta_after_tfcand_ok_plus_pt10_3st1a.Draw("same hist") + + leg = TLegend(0.347,0.19,0.926,0.45,"","brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("Eff. for #mu with p_{T}>20 crossing #geq2 stations with") + leg.AddEntry(h_eff_eta_after_mpc_ok_plus,"MPC matched in 2stations","pl") + leg.AddEntry(h_eff_eta_after_mpc_ok_plus_3st,"MPC matched in 3stations","pl") + leg.AddEntry(h_eff_eta_after_tfcand_ok_plus_3st1a,"TF track with matched stubs in 2st","pl") + leg.AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_3st1a,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl") + leg.Draw() + + Print(c_eff_eta_tf_3st1a,"h_eff_eta_tf_3st1a" + ext) + + + ################################################################################################## + + c_eff_eta_tf_q = TCanvas("c_eff_eta_tf_q","c_eff_eta_tf_q",1000,600 ) + + h_eff_eta_after_tfcand_ok_plus_q1 = setEffHisto("h_eta_after_tfcand_ok_plus_q1","h_eta_after_mpc_ok_plus",dir, etareb, kBlue, 1,1, "eff(#eta): TF quality studies (denom: 2MPCs)","#eta","",xrange,yrange) + h_eff_eta_after_tfcand_ok_plus_q2 = setEffHisto("h_eta_after_tfcand_ok_plus_q2","h_eta_after_mpc_ok_plus",dir, etareb, kCyan+2, 1,1, "","","",xrange,yrange) + h_eff_eta_after_tfcand_ok_plus_q3 = setEffHisto("h_eta_after_tfcand_ok_plus_q3","h_eta_after_mpc_ok_plus",dir, etareb, kMagenta+1, 1,1, "","","",xrange,yrange) + + h_eff_eta_after_tfcand_ok_plus_pt10_q1 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_q1","h_eta_after_mpc_ok_plus",dir, etareb, kBlue, 2,2, "eff(#eta): TF quality studies (denom: 2MPCs)","#eta","",xrange,yrange) + h_eff_eta_after_tfcand_ok_plus_pt10_q2 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_q2","h_eta_after_mpc_ok_plus",dir, etareb, kCyan+2, 2,2, "","","",xrange,yrange) + h_eff_eta_after_tfcand_ok_plus_pt10_q3 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_q3","h_eta_after_mpc_ok_plus",dir, etareb, kMagenta+1, 2,2, "","","",xrange,yrange) + + h_eff_eta_after_tfcand_ok_plus_q1.Draw("hist") + h_eff_eta_after_tfcand_ok_plus_pt10_q1.Draw("same hist") + h_eff_eta_after_tfcand_ok_plus_q2.Draw("same hist") + h_eff_eta_after_tfcand_ok_plus_pt10_q2.Draw("same hist") + h_eff_eta_after_tfcand_ok_plus_q3.Draw("same hist") + h_eff_eta_after_tfcand_ok_plus_pt10_q3.Draw("same hist") + + leg = TLegend(0.347,0.19,0.926,0.45,"","brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetNColumns(2) + leg.SetHeader("TF track with matched stubs in 2st and ") + leg.AddEntry(h_eff_eta_after_tfcand_ok_plus_q1,"Q#geq1","pl") + leg.AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_q1,"Q#geq1, p_{T}^{TF}>10","pl") + leg.AddEntry(h_eff_eta_after_tfcand_ok_plus_q2,"Q#geq2","pl") + leg.AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_q2,"Q#geq2, p_{T}^{TF}>10","pl") + leg.AddEntry(h_eff_eta_after_tfcand_ok_plus_q3,"Q=3","pl") + leg.AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_q3,"Q=3, p_{T}^{TF}>10","pl") + leg.Draw() + + Print(c_eff_eta_tf_q,"h_eff_eta_tf_q" + ext) + + + ################################################################################################## + + c_eff_pt_tf = TCanvas("c_eff_pt_tf","c_eff_pt_tf",1000,600 ) + + h_eff_pt_after_mpc_ok_plus = setEffHisto("h_pt_after_mpc_ok_plus","h_pt_initial",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.2<#eta<2.1)","p_{T}","",xrangept,yrange) + h_eff_pt_after_tfcand_ok_plus = setEffHisto("h_pt_after_tfcand_ok_plus","h_pt_initial",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange) + h_eff_pt_after_tfcand_ok_plus_pt10 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10","h_pt_initial",dir, ptreb, kBlue, 2,2, "","","",xrangept,yrange) + + h_eff_pt_after_mpc_ok_plus.Draw("hist") + h_eff_pt_after_tfcand_ok_plus.Draw("same hist") + h_eff_pt_after_tfcand_ok_plus_pt10.Draw("same hist") + + leg1 = TLegend(0.347,0.19,0.926,0.45,"","brNDC") + leg1.SetBorderSize(0) + leg1.SetFillStyle(0) + leg1.SetHeader("Eff. for #mu crossing ME1+one more station in 1.2<#eta<2.1 with") + leg1.AddEntry(h_eff_pt_after_mpc_ok_plus,"MPC matched in 2stations","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_ok_plus,"TF track with matched stubs in 2st","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl") + leg1.Draw() + + Print(c_eff_pt_tf,"h_eff_pt_tf" + ext) + + + ################################################################################################## + + c_eff_pt_tf_eta1b_2s = TCanvas("c_eff_pt_tf_eta1b_2s","c_eff_pt_tf_eta1b_2s",1000,600 ) + + h_eff_pt_after_tfcand_eta1b_2s = setEffHisto("h_pt_after_tfcand_eta1b_2s","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange) + h_eff_pt_after_tfcand_eta1b_2s_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange) + h_eff_pt_after_tfcand_eta1b_2s_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange) + h_eff_pt_after_tfcand_eta1b_2s_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange) + h_eff_pt_after_tfcand_eta1b_2s_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange) + + h_eff_pt_after_tfcand_eta1b_2s.GetXaxis().SetRangeUser(0.,49.99) + + h_eff_pt_after_tfcand_eta1b_2s.Draw("hist") + h_eff_pt_after_tfcand_eta1b_2s_pt10.Draw("same hist") + h_eff_pt_after_tfcand_eta1b_2s_pt20.Draw("same hist") + h_eff_pt_after_tfcand_eta1b_2s_pt25.Draw("same hist") + h_eff_pt_after_tfcand_eta1b_2s_pt30.Draw("same hist") + + leg1 = TLegend(0.5,0.15,0.99,0.5,"","brNDC") + leg1.SetBorderSize(0) + leg1.SetFillStyle(0) + leg1.SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_2s,"stubs in (2+)st","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt10,"p_{T}^{TF}>=10, stubs in (2+)st","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt20,"p_{T}^{TF}>=20, stubs in (2+)st","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt25,"p_{T}^{TF}>=25, stubs in (2+)st","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt30,"p_{T}^{TF}>=30, stubs in (2+)st","pl") + leg1.Draw() + + Print(c_eff_pt_tf_eta1b_2s, "h_eff_pt_tf_eta1b_2s" + ext) + + ################################################################################################## + + c_eff_pt_tf_eta1b_2s1b = TCanvas("c_eff_pt_tf_eta1b_2s1b","c_eff_pt_tf_eta1b_2s1b",1000,600 ) + + h_eff_pt_after_tfcand_eta1b_2s1b = setEffHisto("h_pt_after_tfcand_eta1b_2s1b","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange) + h_eff_pt_after_tfcand_eta1b_2s1b_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange) + h_eff_pt_after_tfcand_eta1b_2s1b_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange) + h_eff_pt_after_tfcand_eta1b_2s1b_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange) + h_eff_pt_after_tfcand_eta1b_2s1b_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange) + + h_eff_pt_after_tfcand_eta1b_2s1b.GetXaxis().SetRangeUser(0.,49.99) + + h_eff_pt_after_tfcand_eta1b_2s1b.Draw("hist") + h_eff_pt_after_tfcand_eta1b_2s1b_pt10.Draw("same hist") + h_eff_pt_after_tfcand_eta1b_2s1b_pt20.Draw("same hist") + h_eff_pt_after_tfcand_eta1b_2s1b_pt25.Draw("same hist") + h_eff_pt_after_tfcand_eta1b_2s1b_pt30.Draw("same hist") + + leg1 = TLegend(0.5,0.15,0.99,0.5,"","brNDC") + leg1.SetBorderSize(0) + leg1.SetFillStyle(0) + leg1.SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b,"stubs in ME1+(1+)st","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt10,"p_{T}^{TF}>=10, stubs in ME1+(1+)st","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt20,"p_{T}^{TF}>=20, stubs in ME1+(1+)st","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt25,"p_{T}^{TF}>=25, stubs in ME1+(1+)st","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt30,"p_{T}^{TF}>=30, stubs in ME1+(1+)st","pl") + leg1.Draw() + + Print(c_eff_pt_tf_eta1b_2s1b, "h_eff_pt_tf_eta1b_2s1b" + ext) + + + ################################################################################################## + + c_eff_pt_tf_eta1b_3s = TCanvas("c_eff_pt_tf_eta1b_3s","c_eff_pt_tf_eta1b_3s",1000,600 ) + + h_eff_pt_after_tfcand_eta1b_3s = setEffHisto("h_pt_after_tfcand_eta1b_3s","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange) + h_eff_pt_after_tfcand_eta1b_3s_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange) + h_eff_pt_after_tfcand_eta1b_3s_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange) + h_eff_pt_after_tfcand_eta1b_3s_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange) + h_eff_pt_after_tfcand_eta1b_3s_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange) + + h_eff_pt_after_tfcand_eta1b_3s.GetXaxis().SetRangeUser(0.,49.99) + + h_eff_pt_after_tfcand_eta1b_3s.Draw("hist") + h_eff_pt_after_tfcand_eta1b_3s_pt10.Draw("same hist") + h_eff_pt_after_tfcand_eta1b_3s_pt20.Draw("same hist") + h_eff_pt_after_tfcand_eta1b_3s_pt25.Draw("same hist") + h_eff_pt_after_tfcand_eta1b_3s_pt30.Draw("same hist") + + leg1 = TLegend(0.5,0.15,0.99,0.5,"","brNDC") + leg1.SetBorderSize(0) + leg1.SetFillStyle(0) + leg1.SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_3s,"stubs in (3+)st","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt10,"p_{T}^{TF}>=10, stubs in (3+)st","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt20,"p_{T}^{TF}>=20, stubs in (3+)st","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt25,"p_{T}^{TF}>=25, stubs in (3+)st","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt30,"p_{T}^{TF}>=30, stubs in (3+)st","pl") + leg1.Draw() + + Print(c_eff_pt_tf_eta1b_3s, "h_eff_pt_tf_eta1b_3s" + ext) + + ################################################################################################## + + c_eff_pt_tf_eta1b_3s1b = TCanvas("c_eff_pt_tf_eta1b_3s1b","c_eff_pt_tf_eta1b_3s1b",1000,600 ) + + h_eff_pt_after_tfcand_eta1b_3s1b = setEffHisto("h_pt_after_tfcand_eta1b_3s1b","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange) + h_eff_pt_after_tfcand_eta1b_3s1b_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange) + h_eff_pt_after_tfcand_eta1b_3s1b_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange) + h_eff_pt_after_tfcand_eta1b_3s1b_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange) + h_eff_pt_after_tfcand_eta1b_3s1b_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange) + + h_eff_pt_after_tfcand_eta1b_3s1b.GetXaxis().SetRangeUser(0.,49.99) + + h_eff_pt_after_tfcand_eta1b_3s1b.Draw("hist") + h_eff_pt_after_tfcand_eta1b_3s1b_pt10.Draw("same hist") + h_eff_pt_after_tfcand_eta1b_3s1b_pt20.Draw("same hist") + h_eff_pt_after_tfcand_eta1b_3s1b_pt25.Draw("same hist") + h_eff_pt_after_tfcand_eta1b_3s1b_pt30.Draw("same hist") + + leg1 = TLegend(0.5,0.15,0.99,0.5,"","brNDC") + leg1.SetBorderSize(0) + leg1.SetFillStyle(0) + leg1.SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b,"stubs in ME1+(2+)st","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt10,"p_{T}^{TF}>=10, stubs in ME1+(2+)st","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt20,"p_{T}^{TF}>=20, stubs in ME1+(2+)st","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt25,"p_{T}^{TF}>=25, stubs in ME1+(2+)st","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt30,"p_{T}^{TF}>=30, stubs in ME1+(2+)st","pl") + leg1.Draw() + + Print(c_eff_pt_tf_eta1b_3s1b, "h_eff_pt_tf_eta1b_3s1b" + ext) + + + + ################################################################################################## + + """ + c_eff_pth_tf = TCanvas("c_eff_pth_tf","c_eff_pth_tf",1000,600 ) + + h_eff_pth_after_mpc_ok_plus = setEffHisto("h_pth_after_mpc_ok_plus","h_pth_initial",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (2.1<#eta<2.4)","p_{T}","",xrangept,yrange) + h_eff_pth_after_tfcand_ok_plus = setEffHisto("h_pth_after_tfcand_ok_plus","h_pth_initial",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange) + h_eff_pth_after_tfcand_ok_plus_pt10 = setEffHisto("h_pth_after_tfcand_ok_plus_pt10","h_pth_initial",dir, ptreb, kBlue, 2,2, "","","",xrangept,yrange) + + h_eff_pth_after_mpc_ok_plus.Draw("hist") + h_eff_pth_after_tfcand_ok_plus.Draw("same hist") + h_eff_pth_after_tfcand_ok_plus_pt10.Draw("same hist") + + leg1 = TLegend(0.347,0.19,0.926,0.45,"","brNDC") + leg1.SetBorderSize(0) + leg1.SetFillStyle(0) + leg1.SetHeader("Eff. for #mu crossing ME1+one more station in 2.1<#eta<2.4 with") + leg1.AddEntry(h_eff_pth_after_mpc_ok_plus,"MPC matched in 2stations","pl") + leg1.AddEntry(h_eff_pth_after_tfcand_ok_plus,"TF track with matched stubs in 2st","pl") + leg1.AddEntry(h_eff_pth_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl") + leg1.Draw() + + Print(c_eff_pth_tf,"h_eff_pth_tf" + ext) + """ + + ################################################################################################## + + """ + c_eff_pth_tf_3st1a = TCanvas("c_eff_pth_tf_3st1a","c_eff_pth_tf_3st1a",1000,600 ) + + h_eff_pth_after_mpc_ok_plus = setEffHisto("h_pth_after_mpc_ok_plus","h_pth_initial",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (2.1<#eta<2.4)","p_{T}","",xrangept,yrange) + h_eff_pth_after_tfcand_ok_plus_3st1a = setEffHisto("h_pth_after_tfcand_ok_plus_3st1a","h_pth_initial",dir, ptreb, kBlue, 1,2, "eff(p_{T}^{MC}): TF studies (denom: 2MPCs, 2.1<#eta<2.4)","p_{T}","",xrangept,yrange) + h_eff_pth_after_tfcand_ok_plus_pt10_3st1a = setEffHisto("h_pth_after_tfcand_ok_plus_pt10_3st1a","h_pth_initial",dir, ptreb, kBlue, 2,2, "","","",xrangept,yrange) + + h_eff_pth_after_mpc_ok_plus.Draw("hist") + h_eff_pth_after_tfcand_ok_plus_3st1a.Draw("same hist") + h_eff_pth_after_tfcand_ok_plus_pt10_3st1a.Draw("same hist") + + leg1 = TLegend(0.347,0.19,0.926,0.45,"","brNDC") + leg1.SetBorderSize(0) + leg1.SetFillStyle(0) + leg1.SetHeader("Eff. for #mu crossing ME1+one more station in 2.1<#eta<2.4 with") + leg1.AddEntry(h_eff_pth_after_mpc_ok_plus,"MPC matched in 2stations","pl") + leg1.AddEntry(h_eff_pth_after_tfcand_ok_plus_3st1a,"TF track with matched stubs in 3st","pl") + leg1.AddEntry(h_eff_pth_after_tfcand_ok_plus_pt10_3st1a,"p_{T}^{TF}>10 TF track with matched stubs in 3st","pl") + leg1.Draw() + + Print(c_eff_pth_tf_3st1a,"h_eff_pth_tf_3st1a" + ext) + + """ + ################################################################################################## + + if interactive : + c_eff_pt_tf_q = TCanvas("c_eff_pt_tf_q","c_eff_pt_tf_q",1000,600 ) + + h_eff_pt_after_tfcand_ok_plus_q1 = setEffHisto("h_pt_after_tfcand_ok_plus_q1","h_pt_after_mpc_ok_plus",dir, etareb, kBlue, 1,1, "eff(p_{T}^{MC}): TF quality studies (denom: 2MPCs, 1.2<#eta<2.1)","p_{T}^{MC}","",xrangept,yrange) + h_eff_pt_after_tfcand_ok_plus_q2 = setEffHisto("h_pt_after_tfcand_ok_plus_q2","h_pt_after_mpc_ok_plus",dir, etareb, kCyan+2, 1,1, "eff(p_{T}^{MC}): TF quality studies (denom: 2MPCs, 1.2<#eta<2.1)","p_{T}^{MC}","",xrangept,yrange) + h_eff_pt_after_tfcand_ok_plus_q3 = setEffHisto("h_pt_after_tfcand_ok_plus_q3","h_pt_after_mpc_ok_plus",dir, etareb, kMagenta+1, 1,1, "","","",xrangept,yrange) + + ##h_eff_pt_after_tfcand_ok_plus_pt10_q1 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q1","h_pt_after_mpc_ok_plus",dir, etareb, kBlue, 2,2, "","","",xrangept,yrange) + h_eff_pt_after_tfcand_ok_plus_pt10_q2 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q2","h_pt_after_mpc_ok_plus",dir, etareb, kCyan+2, 2,2, "","","",xrangept,yrange) + h_eff_pt_after_tfcand_ok_plus_pt10_q3 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q3","h_pt_after_mpc_ok_plus",dir, etareb, kMagenta+1, 2,2, "","","",xrangept,yrange) + + h_eff_pt_after_tfcand_ok_plus_q1.Draw("hist") + ##h_eff_pt_after_tfcand_ok_plus_pt10_q1.Draw("same hist") + h_eff_pt_after_tfcand_ok_plus_q2.Draw("same hist") + ##h_eff_pt_after_tfcand_ok_plus_pt10_q2.Draw("same hist") + h_eff_pt_after_tfcand_ok_plus_q3.Draw("same hist") + h_eff_pt_after_tfcand_ok_plus_pt10_q3.Draw("same hist") + + leg1 = TLegend(0.347,0.19,0.926,0.45,"","brNDC") + leg1.SetBorderSize(0) + leg1.SetFillStyle(0) + leg1.SetNColumns(2) + leg1.SetHeader("TF track with matched stubs in 2st and ") + leg1.AddEntry(h_eff_pt_after_tfcand_ok_plus_q1,"Q#geq1","pl") + ##leg1.AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q1,"Q#geq1, p_{T}^{TF}>10","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_ok_plus_q2,"Q#geq2","pl") + ##leg1.AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q2,"Q#geq2, p_{T}^{TF}>10","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_ok_plus_q3,"Q=3","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q3,"Q=3, p_{T}^{TF}>10","pl") + leg1.Draw() + + Print(c_eff_pt_tf_q,"h_eff_pt_tf_q" + ext) + + ################################################################################################## + + c_eff_ptres_tf = TCanvas("c_eff_ptres_tf","c_eff_ptres_tf",1000,600 ) + + h_eff_pt_after_tfcand_ok_plus_pt10 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10","h_pt_after_tfcand_ok_plus",dir, ptreb, kBlue, 1,2, "p_{T}^{TF}>10 assignment eff(p_{T}^{MC}) studies (denom: any p_{T}^{TF}, 1.2<#eta<2.1)","p_{T}^{MC}","",xrangept,yrange) + h_eff_pt_after_tfcand_ok_plus_pt10_q2 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q2","h_pt_after_tfcand_ok_plus_q2",dir, ptreb, kCyan+2, 1,2, "","","",xrangept,yrange) + h_eff_pt_after_tfcand_ok_plus_pt10_q3 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q3","h_pt_after_tfcand_ok_plus_q3",dir, ptreb, kMagenta+1, 1,2, "","","",xrangept,yrange) + + h_eff_pt_after_tfcand_ok_plus_pt10.Draw("hist") + h_eff_pt_after_tfcand_ok_plus_pt10_q2.Draw("same hist") + h_eff_pt_after_tfcand_ok_plus_pt10_q3.Draw("same hist") + + leg1 = TLegend(0.347,0.19,0.926,0.45,"","brNDC") + leg1.SetBorderSize(0) + leg1.SetFillStyle(0) + leg1.SetHeader("for #mu with p_{T}>20 crossing ME1+one station to pass p_{T}^{TF}>10 with") + leg1.AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10,"any Q","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q2,"Q#geq2","pl") + leg1.AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q3,"Q=3","pl") + leg1.Draw() + + Print(c_eff_ptres_tf,"h_eff_ptres_tf" + ext) + + + ################################################################################################## + + """ + c_eff_DR2_tf = TCanvas("c_eff_DR2_tf","c_eff_DR2_tf",1000,600 ) + + xrangeDR[2]={0.,3.5} + + h_eff_DR_2SimTr_after_tfcand_ok_plus = setEffHisto("h_DR_2SimTr_after_tfcand_ok_plus","h_DR_2SimTr_after_mpc_ok_plus",dir, 3, kBlue, 1,2, "eff(#DeltaR(Tr1,Tr2)): for Tr1: p_{T}^{MC}>20, denom: 2 MPCs, 1.2<#eta<2.1","#DeltaR(Tr1,Tr2)","",xrangeDR,yrange) + + h_eff_DR_2SimTr_after_tfcand_ok_plus.SetLineColor(0) + h_eff_DR_2SimTr_after_tfcand_ok_plus.Draw("hist") + + + TGraphAsymmErrors *gg = TGraphAsymmErrors() + gg.BayesDivide((const TH1*)h1,(const TH1*)h2) + gg.Draw("p") + + Print(c_eff_DR2_tf,"h_eff_DR_2SimTr_tf" + ext) + """ + + + """ + h_eta_initial = getH(dir,"h_eta_initial") + h_eta_after_mpc = getH(dir,"h_eta_after_mpc") + h_eta_after_mpc_st1 = getH(dir,"h_eta_after_mpc_st1") + h_eta_after_mpc_st1_good = getH(dir,"h_eta_after_mpc_st1_good") + h_eta_after_mpc_ok = getH(dir,"h_eta_after_mpc_ok") + h_eta_after_mpc_ok_plus = getH(dir,"h_eta_after_mpc_ok_plus") + + h_eta_after_tftrack = getH(dir,"h_eta_after_tftrack") + + h_eta_after_tfcand = getH(dir,"h_eta_after_tfcand") + h_eta_after_tfcand_q1 = getH(dir,"h_eta_after_tfcand_q1") + h_eta_after_tfcand_q2 = getH(dir,"h_eta_after_tfcand_q2") + h_eta_after_tfcand_q3 = getH(dir,"h_eta_after_tfcand_q3") + h_eta_after_tfcand_ok = getH(dir,"h_eta_after_tfcand_ok") + h_eta_after_tfcand_ok_plus = getH(dir,"h_eta_after_tfcand_ok_plus") + h_eta_after_tfcand_ok_pt10 = getH(dir,"h_eta_after_tfcand_ok_pt10") + h_eta_after_tfcand_ok_plus_pt10 = getH(dir,"h_eta_after_tfcand_ok_plus_pt10") + + h_eta_after_tfcand_all = getH(dir,"h_eta_after_tfcand_all") + h_eta_after_tfcand_all_pt10 = getH(dir,"h_eta_after_tfcand_all_pt10") + + h_eta_after_gmtreg = getH(dir,"h_eta_after_gmtreg") + h_eta_after_gmtreg_all = getH(dir,"h_eta_after_gmtreg_all") + h_eta_after_gmtreg_dr = getH(dir,"h_eta_after_gmtreg_dr") + h_eta_after_gmt = getH(dir,"h_eta_after_gmt") + h_eta_after_gmt_all = getH(dir,"h_eta_after_gmt_all") + h_eta_after_xtra = getH(dir,"h_eta_after_xtra") + h_eta_after_xtra_all = getH(dir,"h_eta_after_xtra_all") + h_eta_after_xtra_dr = getH(dir,"h_eta_after_xtra_dr") + + h_eta_after_tfcand_pt10 = getH(dir,"h_eta_after_tfcand_pt10") + h_eta_after_tfcand_my_st1 = getH(dir,"h_eta_after_tfcand_my_st1") + h_eta_after_tfcand_org_st1 = getH(dir,"h_eta_after_tfcand_org_st1") + h_eta_after_tfcand_comm_st1 = getH(dir,"h_eta_after_tfcand_comm_st1") + h_eta_after_tfcand_my_st1_pt10 = getH(dir,"h_eta_after_tfcand_my_st1_pt10") + h_eta_after_gmtreg_dr_pt10 = getH(dir,"h_eta_after_gmtreg_dr_pt10") + h_eta_after_gmtreg_pt10= getH(dir,"h_eta_after_gmtreg_pt10") + h_eta_after_gmt_pt10 = getH(dir,"h_eta_after_gmt_pt10") + h_eta_after_xtra_dr_pt10 = getH(dir,"h_eta_after_xtra_dr_pt10") + + ## = getH(dir,"") + + h_eta_me1_after_alct = getH(dir,"h_eta_me1_after_alct") + h_eta_me1_after_alct_okAlct = getH(dir,"h_eta_me1_after_alct_okAlct") + h_eta_me1_after_clct = getH(dir,"h_eta_me1_after_clct") + h_eta_me1_after_clct_okClct = getH(dir,"h_eta_me1_after_clct_okClct") + h_eta_me1_after_alctclct = getH(dir,"h_eta_me1_after_alctclct") + h_eta_me1_after_alctclct_okAlct = getH(dir,"h_eta_me1_after_alctclct_okAlct") + h_eta_me1_after_alctclct_okClct = getH(dir,"h_eta_me1_after_alctclct_okClct") + h_eta_me1_after_alctclct_okAlctClct = getH(dir,"h_eta_me1_after_alctclct_okAlctClct") + + h_eta_me1_after_lct = getH(dir,"h_eta_me1_after_lct") + h_eta_me1_after_lct_okAlct = getH(dir,"h_eta_me1_after_lct_okAlct") + h_eta_me1_after_lct_okAlctClct = getH(dir,"h_eta_me1_after_lct_okAlctClct") + h_eta_me1_after_lct_okClct = getH(dir,"h_eta_me1_after_lct_okClct") + h_eta_me1_after_lct_okClctAlct = getH(dir,"h_eta_me1_after_lct_okClctAlct") + h_eta_me1_after_mplct_okAlctClct = getH(dir,"h_eta_me1_after_mplct_okAlctClct") + h_eta_me1_after_mplct_okAlctClct_plus = getH(dir,"h_eta_me1_after_mplct_okAlctClct_plus") + h_eta_me1_after_tf_ok = getH(dir,"h_eta_me1_after_tf_ok") + h_eta_me1_after_tf_ok_pt10 = getH(dir,"h_eta_me1_after_tf_ok_pt10") + h_eta_me1_after_tf_ok_plus = getH(dir,"h_eta_me1_after_tf_ok_plus") + h_eta_me1_after_tf_ok_plus_pt10 = getH(dir,"h_eta_me1_after_tf_ok_plus_pt10") + + + + myRebin(h_eta_initial,etareb) + myRebin(h_eta_after_mpc,etareb) + myRebin(h_eta_after_mpc_st1,etareb) + myRebin(h_eta_after_mpc_st1_good,etareb) + myRebin(h_eta_after_mpc_ok,etareb) + myRebin(h_eta_after_mpc_ok_plus,etareb) + myRebin(h_eta_after_tftrack,etareb) + + myRebin(h_eta_after_tfcand,etareb) + myRebin(h_eta_after_tfcand_q1,etareb) + myRebin(h_eta_after_tfcand_q2,etareb) + myRebin(h_eta_after_tfcand_q3,etareb) + myRebin(h_eta_after_tfcand_ok,etareb) + myRebin(h_eta_after_tfcand_ok_plus,etareb) + myRebin(h_eta_after_tfcand_ok_pt10,etareb) + myRebin(h_eta_after_tfcand_ok_plus_pt10,etareb) + + myRebin(h_eta_after_tfcand_all,etareb) + myRebin(h_eta_after_tfcand_all_pt10,etareb) + + myRebin(h_eta_after_gmtreg ,etareb) + myRebin(h_eta_after_gmtreg_all,etareb) + myRebin(h_eta_after_gmtreg_dr ,etareb) + myRebin(h_eta_after_gmt ,etareb) + myRebin(h_eta_after_gmt_all ,etareb) + myRebin(h_eta_after_xtra ,etareb) + myRebin(h_eta_after_xtra_all ,etareb) + myRebin(h_eta_after_xtra_dr ,etareb) + + myRebin(h_eta_after_tfcand_pt10,etareb) + myRebin(h_eta_after_tfcand_my_st1,etareb) + myRebin(h_eta_after_tfcand_org_st1,etareb) + myRebin(h_eta_after_tfcand_comm_st1,etareb) + myRebin(h_eta_after_tfcand_my_st1_pt10,etareb) + myRebin(h_eta_after_gmtreg_pt10 ,etareb) + myRebin(h_eta_after_gmtreg_dr_pt10 ,etareb) + myRebin(h_eta_after_gmt_pt10 ,etareb) + myRebin(h_eta_after_xtra_dr_pt10 ,etareb) + + myRebin(h_eta_me1_after_alct,etareb) + myRebin(h_eta_me1_after_alct_okAlct,etareb) + myRebin(h_eta_me1_after_clct,etareb) + myRebin(h_eta_me1_after_clct_okClct,etareb) + myRebin(h_eta_me1_after_alctclct,etareb) + myRebin(h_eta_me1_after_alctclct_okAlct,etareb) + myRebin(h_eta_me1_after_alctclct_okClct,etareb) + myRebin(h_eta_me1_after_alctclct_okAlctClct,etareb) + + myRebin(h_eta_me1_after_lct ,etareb) + myRebin(h_eta_me1_after_lct_okAlct ,etareb) + myRebin(h_eta_me1_after_lct_okAlctClct ,etareb) + myRebin(h_eta_me1_after_lct_okClct ,etareb) + myRebin(h_eta_me1_after_lct_okClctAlct ,etareb) + myRebin(h_eta_me1_after_mplct_okAlctClct ,etareb) + myRebin(h_eta_me1_after_mplct_okAlctClct_plus ,etareb) + myRebin(h_eta_me1_after_tf_ok ,etareb) + myRebin(h_eta_me1_after_tf_ok_pt10 ,etareb) + myRebin(h_eta_me1_after_tf_ok_plus ,etareb) + myRebin(h_eta_me1_after_tf_ok_plus_pt10 ,etareb) + + h_eff_eta_after_mpc = h_eta_after_mpc.Clone("h_eff_eta_after_mpc") + h_eff_eta_after_mpc_st1 = h_eta_after_mpc_st1.Clone("h_eff_eta_after_mpc_st1") + h_eff_eta_after_mpc_st1_good = h_eta_after_mpc_st1_good.Clone("h_eff_eta_after_mpc_st1_good") + h_eff_eta_after_mpc_ok = h_eta_after_mpc_ok.Clone("h_eff_eta_after_mpc_ok") + h_eff_eta_after_mpc_ok_plus = h_eta_after_mpc_ok_plus.Clone("h_eff_eta_after_mpc_ok_plus") + h_eff_eta_after_tftrack = h_eta_after_tftrack.Clone("h_eff_eta_after_tftrack") + + h_eff_eta_after_tfcand = h_eta_after_tfcand.Clone("h_eff_eta_after_tfcand") + h_eff_eta_after_tfcand_q1 = h_eta_after_tfcand_q1.Clone("h_eff_eta_after_tfcand_q1") + h_eff_eta_after_tfcand_q2 = h_eta_after_tfcand_q2.Clone("h_eff_eta_after_tfcand_q2") + h_eff_eta_after_tfcand_q3 = h_eta_after_tfcand_q3.Clone("h_eff_eta_after_tfcand_q3") + h_eff_eta_after_tfcand_ok = h_eta_after_tfcand_ok.Clone("h_eff_eta_after_tfcand_ok") + h_eff_eta_after_tfcand_ok_plus = h_eta_after_tfcand_ok_plus.Clone("h_eff_eta_after_tfcand_ok_plus") + h_eff_eta_after_tfcand_ok_pt10 = h_eta_after_tfcand_ok_pt10.Clone("h_eff_eta_after_tfcand_ok_pt10") + h_eff_eta_after_tfcand_ok_plus_pt10 = h_eta_after_tfcand_ok_plus_pt10.Clone("h_eff_eta_after_tfcand_ok_plus_pt10") + + h_eff_eta_after_tfcand_all = h_eta_after_tfcand_all.Clone("h_eff_eta_after_tfcand_all") + h_eff_eta_after_tfcand_all_pt10 = h_eta_after_tfcand_all_pt10.Clone("h_eff_eta_after_tfcand_all_pt10") + + h_eff_eta_after_gmtreg = h_eta_after_gmtreg.Clone("h_eff_eta_after_gmtreg") + h_eff_eta_after_gmtreg_all = h_eta_after_gmtreg_all.Clone("h_eff_eta_after_gmtreg_all") + h_eff_eta_after_gmtreg_dr = h_eta_after_gmtreg_dr.Clone("h_eff_eta_after_gmtreg_dr") + h_eff_eta_after_gmt = h_eta_after_gmt.Clone("h_eff_eta_after_gmt") + h_eff_eta_after_gmt_all = h_eta_after_gmt_all.Clone("h_eff_eta_after_gmt_all") + h_eff_eta_after_xtra = h_eta_after_xtra.Clone("h_eff_eta_after_xtra") + h_eff_eta_after_xtra_all = h_eta_after_xtra_all.Clone("h_eff_eta_after_xtra_all") + h_eff_eta_after_xtra_dr = h_eta_after_xtra_dr.Clone("h_eff_eta_after_xtra_dr") + + h_eff_eta_after_tfcand_pt10 = h_eta_after_tfcand_pt10.Clone("h_eff_eta_after_tfcand_pt10") + h_eff_eta_after_tfcand_my_st1 = h_eta_after_tfcand_my_st1.Clone("h_eff_eta_after_tfcand_my_st1") + h_eff_eta_after_tfcand_org_st1 = h_eta_after_tfcand_org_st1.Clone("h_eff_eta_after_tfcand_org_st1") + h_eff_eta_after_tfcand_comm_st1 = h_eta_after_tfcand_comm_st1.Clone("h_eff_eta_after_tfcand_comm_st1") + h_eff_eta_after_tfcand_my_st1_pt10 = h_eta_after_tfcand_my_st1_pt10.Clone("h_eff_eta_after_tfcand_my_st1_pt10") + h_eff_eta_after_gmtreg_pt10 = h_eta_after_gmtreg_pt10.Clone("h_eff_eta_after_gmtreg_pt10") + h_eff_eta_after_gmtreg_dr_pt10 = h_eta_after_gmtreg_dr_pt10.Clone("h_eff_eta_after_gmtreg_dr_pt10") + h_eff_eta_after_gmt_pt10 = h_eta_after_gmt_pt10.Clone("h_eff_eta_after_gmt_pt10") + h_eff_eta_after_xtra_dr_pt10 = h_eta_after_xtra_dr_pt10.Clone("h_eff_eta_after_xtra_dr_pt10") + + h_eff_eta_me1_after_alct = h_eta_me1_after_alct.Clone("h_eff_eta_me1_after_alct") + h_eff_eta_me1_after_alct_okAlct = h_eta_me1_after_alct_okAlct.Clone("h_eff_eta_me1_after_alct_okAlct") + h_eff_eta_me1_after_clct = h_eta_me1_after_clct.Clone("h_eff_eta_me1_after_clct") + h_eff_eta_me1_after_clct_okClct = h_eta_me1_after_clct_okClct.Clone("h_eff_eta_me1_after_clct_okClct") + h_eff_eta_me1_after_alctclct = h_eta_me1_after_alctclct.Clone("h_eff_eta_me1_after_alctclct") + h_eff_eta_me1_after_alctclct_okAlct = h_eta_me1_after_alctclct_okAlct.Clone("h_eff_eta_me1_after_alctclct_okAlct") + h_eff_eta_me1_after_alctclct_okClct = h_eta_me1_after_alctclct_okClct.Clone("h_eff_eta_me1_after_alctclct_okClct") + h_eff_eta_me1_after_alctclct_okAlctClct = h_eta_me1_after_alctclct_okAlctClct.Clone("h_eff_eta_me1_after_alctclct_okAlctClct") + + h_eff_eta_me1_after_lct = h_eta_me1_after_lct.Clone("h_eff_eta_me1_after_lct") + h_eff_eta_me1_after_lct_okAlct = h_eta_me1_after_lct_okAlct.Clone("h_eff_eta_me1_after_lct_okAlct") + h_eff_eta_me1_after_lct_okAlctClct = h_eta_me1_after_lct_okAlctClct.Clone("h_eff_eta_me1_after_lct_okAlctClct") + h_eff_eta_me1_after_lct_okClct = h_eta_me1_after_lct_okClct.Clone("h_eff_eta_me1_after_lct_okClct") + h_eff_eta_me1_after_lct_okClctAlct = h_eta_me1_after_lct_okClctAlct.Clone("h_eff_eta_me1_after_lct_okClctAlct") + h_eff_eta_me1_after_mplct_okAlctClct = h_eta_me1_after_mplct_okAlctClct.Clone("h_eff_eta_me1_after_mplct_okAlctClct") + h_eff_eta_me1_after_mplct_okAlctClct_plus = h_eta_me1_after_mplct_okAlctClct_plus.Clone("h_eff_eta_me1_after_mplct_okAlctClct_plus") + h_eff_eta_me1_after_tf_ok = h_eta_me1_after_tf_ok.Clone("h_eff_eta_me1_after_tf_ok") + h_eff_eta_me1_after_tf_ok_pt10 = h_eta_me1_after_tf_ok_pt10.Clone("h_eff_eta_me1_after_tf_ok_pt10") + h_eff_eta_me1_after_tf_ok_plus = h_eta_me1_after_tf_ok_plus.Clone("h_eff_eta_me1_after_tf_ok_plus") + h_eff_eta_me1_after_tf_ok_plus_pt10 = h_eta_me1_after_tf_ok_plus_pt10.Clone("h_eff_eta_me1_after_tf_ok_plus_pt10") + + + h_eta_initial.Sumw2() + h_eff_eta_after_mpc_st1.Sumw2() + h_eff_eta_after_tfcand_my_st1.Sumw2() + h_eff_eta_me1_after_alctclct_okAlctClct.Sumw2() + h_eff_eta_me1_after_lct_okClctAlct.Sumw2() + + h_eff_eta_after_mpc.Divide(h_eff_eta_after_mpc,h_eta_initial) + h_eff_eta_after_mpc_st1.Divide(h_eff_eta_after_mpc_st1,h_eta_initial,1,1,"B") + h_eff_eta_after_mpc_st1_good.Divide(h_eff_eta_after_mpc_st1_good,h_eta_initial,1,1,"B") + h_eff_eta_after_mpc_ok.Divide(h_eff_eta_after_mpc_ok,h_eta_initial) + h_eff_eta_after_mpc_ok_plus.Divide(h_eff_eta_after_mpc_ok_plus,h_eta_initial) + + h_eff_eta_after_tftrack.Divide(h_eff_eta_after_tftrack,h_eta_initial) + h_eff_eta_after_tfcand.Divide(h_eff_eta_after_tfcand,h_eta_initial) + h_eff_eta_after_tfcand_q1.Divide(h_eff_eta_after_tfcand_q1,h_eta_initial) + h_eff_eta_after_tfcand_q2.Divide(h_eff_eta_after_tfcand_q2,h_eta_initial) + h_eff_eta_after_tfcand_q3.Divide(h_eff_eta_after_tfcand_q3,h_eta_initial) + h_eff_eta_after_tfcand_ok.Divide(h_eff_eta_after_tfcand_ok,h_eta_initial) + h_eff_eta_after_tfcand_ok_plus.Divide(h_eff_eta_after_tfcand_ok_plus,h_eta_initial) + h_eff_eta_after_tfcand_ok_pt10.Divide(h_eff_eta_after_tfcand_ok_pt10,h_eta_initial) + h_eff_eta_after_tfcand_ok_plus_pt10.Divide(h_eff_eta_after_tfcand_ok_plus_pt10,h_eta_initial) + h_eff_eta_after_tfcand_all .Divide(h_eff_eta_after_tfcand_all,h_eta_initial) + h_eff_eta_after_tfcand_all_pt10.Divide(h_eff_eta_after_tfcand_all_pt10,h_eta_initial) + + h_eff_eta_after_gmtreg .Divide(h_eff_eta_after_gmtreg,h_eta_initial) + h_eff_eta_after_gmtreg_all.Divide(h_eff_eta_after_gmtreg_all,h_eta_initial) + h_eff_eta_after_gmtreg_dr .Divide(h_eff_eta_after_gmtreg_dr,h_eta_initial) + h_eff_eta_after_gmt .Divide(h_eff_eta_after_gmt,h_eta_initial) + h_eff_eta_after_gmt_all .Divide(h_eff_eta_after_gmt_all,h_eta_initial) + h_eff_eta_after_xtra .Divide(h_eff_eta_after_xtra,h_eta_initial) + h_eff_eta_after_xtra_all .Divide(h_eff_eta_after_xtra_all,h_eta_initial) + h_eff_eta_after_xtra_dr .Divide(h_eff_eta_after_xtra_dr,h_eta_initial) + + h_eff_eta_after_tfcand_pt10 .Divide(h_eff_eta_after_tfcand_pt10,h_eta_initial,1,1,"B") + h_eff_eta_after_tfcand_my_st1 .Divide(h_eff_eta_after_tfcand_my_st1,h_eta_initial,1,1,"B") + h_eff_eta_after_tfcand_org_st1 .Divide(h_eff_eta_after_tfcand_org_st1,h_eta_initial,1,1,"B") + h_eff_eta_after_tfcand_comm_st1 .Divide(h_eff_eta_after_tfcand_comm_st1,h_eta_initial,1,1,"B") + h_eff_eta_after_tfcand_my_st1_pt10 .Divide(h_eff_eta_after_tfcand_my_st1_pt10,h_eta_initial,1,1,"B") + h_eff_eta_after_gmtreg_pt10 .Divide(h_eff_eta_after_gmtreg_pt10,h_eta_initial) + h_eff_eta_after_gmtreg_dr_pt10 .Divide(h_eff_eta_after_gmtreg_dr_pt10,h_eta_initial) + h_eff_eta_after_gmt_pt10 .Divide(h_eff_eta_after_gmt_pt10,h_eta_initial) + h_eff_eta_after_xtra_dr_pt10 .Divide(h_eff_eta_after_xtra_dr_pt10,h_eta_initial) + + + h_eff_eta_me1_after_alct.Divide(h_eff_eta_me1_after_alct,h_eta_initial) + h_eff_eta_me1_after_alct_okAlct.Divide(h_eff_eta_me1_after_alct_okAlct,h_eta_initial) + h_eff_eta_me1_after_clct.Divide(h_eff_eta_me1_after_clct,h_eta_initial) + h_eff_eta_me1_after_clct_okClct.Divide(h_eff_eta_me1_after_clct_okClct,h_eta_initial) + h_eff_eta_me1_after_alctclct.Divide(h_eff_eta_me1_after_alctclct,h_eta_initial) + h_eff_eta_me1_after_alctclct_okAlct.Divide(h_eff_eta_me1_after_alctclct_okAlct,h_eta_initial) + h_eff_eta_me1_after_alctclct_okClct.Divide(h_eff_eta_me1_after_alctclct_okClct,h_eta_initial) + h_eff_eta_me1_after_alctclct_okAlctClct.Divide(h_eff_eta_me1_after_alctclct_okAlctClct,h_eta_initial) + + h_eff_eta_me1_after_lct .Divide(h_eff_eta_me1_after_lct,h_eta_initial) + h_eff_eta_me1_after_lct_okAlct .Divide(h_eff_eta_me1_after_lct_okAlct,h_eta_initial) + h_eff_eta_me1_after_lct_okAlctClct.Divide(h_eff_eta_me1_after_lct_okAlctClct,h_eta_initial) + h_eff_eta_me1_after_lct_okClct .Divide(h_eff_eta_me1_after_lct_okClct,h_eta_initial) + h_eff_eta_me1_after_lct_okClctAlct.Divide(h_eff_eta_me1_after_lct_okClctAlct,h_eta_initial) + h_eff_eta_me1_after_mplct_okAlctClct.Divide(h_eff_eta_me1_after_mplct_okAlctClct,h_eta_initial) + h_eff_eta_me1_after_mplct_okAlctClct_plus.Divide(h_eff_eta_me1_after_mplct_okAlctClct_plus,h_eta_initial) + h_eff_eta_me1_after_tf_ok .Divide(h_eff_eta_me1_after_tf_ok,h_eta_initial) + h_eff_eta_me1_after_tf_ok_pt10 .Divide(h_eff_eta_me1_after_tf_ok_pt10,h_eta_initial) + h_eff_eta_me1_after_tf_ok_plus .Divide(h_eff_eta_me1_after_tf_ok_plus,h_eta_initial) + h_eff_eta_me1_after_tf_ok_plus_pt10 .Divide(h_eff_eta_me1_after_tf_ok_plus_pt10,h_eta_initial) + + + + ##h_eff_eta_after_mpc.SetFillColor(7) + ##h_eff_eta_after_tftrack.SetFillColor(8) + ## + ##h_eff_eta_after_tfcand .SetFillColor(1) + ##h_eff_eta_after_tfcand_q1.SetFillColor(2) + ##h_eff_eta_after_tfcand_q2.SetFillColor(3) + ##h_eff_eta_after_tfcand_q3.SetFillColor(4) + ## + ##h_eff_eta_after_tfcand_all .SetFillColor(5) + + + c2 = TCanvas("h_eff_eta","h_eff_eta",900,900 ) + c2.Divide(2,2) + c2.cd(1) + h_eff_eta_after_mpc.GetXaxis().SetRangeUser(0.9,2.5) + h_eff_eta_after_mpc.Draw("hist") + ##h_eff_eta_after_mpc_ok.Draw("same hist") + h_eff_eta_after_mpc_ok_plus.Draw("same hist") + ##h_eff_eta_after_tftrack.Draw("same hist") + h_eff_eta_after_tfcand.Draw("same hist") + ##h_eff_eta_after_tfcand_ok.Draw("same hist") + h_eff_eta_after_tfcand_ok_plus.Draw("same hist") + h_eff_eta_after_tfcand_ok_plus_pt10.Draw("same hist") + + c2.cd(2) + h_eff_eta_after_tfcand.GetXaxis().SetRangeUser(0.9,2.5) + h_eff_eta_after_tfcand .Draw("hist") + h_eff_eta_after_tfcand_q1.Draw("same hist") + h_eff_eta_after_tfcand_q2.Draw("same hist") + h_eff_eta_after_tfcand_q3.Draw("same hist") + c2.cd(3) + h_eff_eta_after_tfcand_all .GetXaxis().SetRangeUser(0.9,2.5) + h_eff_eta_after_tfcand_all .Draw("hist") + h_eff_eta_after_tfcand.Draw("same hist") + c2.cd(2) + Print(c2,"h_eff_eta" + ext) + + + h_eff_eta_after_mpc.SetLineColor(kBlack) + h_eff_eta_after_mpc_st1.SetLineColor(kBlack+2) + h_eff_eta_after_mpc_st1_good.SetLineColor(kBlack+4) + h_eff_eta_after_tftrack.SetLineColor(kViolet-2) + h_eff_eta_after_tfcand.SetLineColor(kBlue) + h_eff_eta_after_gmtreg.SetLineColor(kMagenta-2) + h_eff_eta_after_gmtreg_dr.SetLineColor(kOrange-3) + h_eff_eta_after_gmt.SetLineColor(kGreen+1) + h_eff_eta_after_xtra.SetLineColor(kPink-4) + h_eff_eta_after_xtra_dr.SetLineColor(kRed) + + h_eff_eta_after_tfcand_all .SetLineColor(kBlue) + h_eff_eta_after_gmtreg_all.SetLineColor(kMagenta-2) + h_eff_eta_after_gmt_all.SetLineColor(kGreen+1) + h_eff_eta_after_xtra_all.SetLineColor(kPink-4) + + + h_eff_eta_after_tfcand_pt10 .SetLineColor(kBlue) + h_eff_eta_after_tfcand_my_st1 .SetLineColor(kBlue) + h_eff_eta_after_tfcand_org_st1 .SetLineColor(kBlue) + h_eff_eta_after_tfcand_comm_st1 .SetLineColor(kBlue) + h_eff_eta_after_tfcand_my_st1_pt10 .SetLineColor(30) + h_eff_eta_after_gmtreg_pt10 .SetLineColor(kMagenta-2) + h_eff_eta_after_gmtreg_dr_pt10 .SetLineColor(kOrange-3) + h_eff_eta_after_gmt_pt10 .SetLineColor(kGreen+1) + h_eff_eta_after_xtra_dr_pt10 .SetLineColor(kRed) + + h_eff_eta_after_mpc_st1_good.SetLineStyle(7) + + h_eff_eta_after_tfcand_pt10 .SetLineStyle(7) + h_eff_eta_after_tfcand_my_st1 .SetLineStyle(7) + h_eff_eta_after_tfcand_org_st1 .SetLineStyle(3) + h_eff_eta_after_tfcand_comm_st1.SetLineStyle(2) + h_eff_eta_after_tfcand_my_st1_pt10.SetLineStyle(7) + h_eff_eta_after_gmtreg_pt10 .SetLineStyle(7) + h_eff_eta_after_gmtreg_dr_pt10 .SetLineStyle(7) + h_eff_eta_after_gmt_pt10 .SetLineStyle(7) + h_eff_eta_after_xtra_dr_pt10 .SetLineStyle(7) + + h_eff_eta_after_mpc.SetTitle("L1 CSC trigger efficiency dependence on #eta") + h_eff_eta_after_mpc.GetXaxis().SetRangeUser(0.85,2.5) + h_eff_eta_after_mpc.GetXaxis().SetTitle("#eta") + h_eff_eta_after_mpc.SetMinimum(0) + """ + + + """ + c22 = TCanvas("h_eff_eta_steps","h_eff_eta_steps",1200,900 ) + c22.Divide(1,2) + c22.cd(1) + h_eff_eta_after_mpc.Draw("hist") + ##h_eff_eta_after_tftrack.Draw("same") + h_eff_eta_after_tfcand.Draw("same") + ##h_eff_eta_after_gmtreg.Draw("same") + h_eff_eta_after_gmt.Draw("same") + ##h_eff_eta_after_xtra.Draw("same") + h_eff_eta_after_xtra_dr.Draw("same") + leg = TLegend(0.7815507,0.1702982,0.9846086,0.5740635,"","brNDC") + ##leg.SetTextFont(12) + leg.SetBorderSize(0) + leg.SetTextFont(12) + leg.SetLineColor(1) + leg.SetLineStyle(1) + leg.SetLineWidth(1) + leg.SetFillColor(19) + leg.SetFillStyle(0) + leg.AddEntry(h_eff_eta_after_mpc,"h_eff_eta_after_mpc","pl") + ##leg.AddEntry(h_eff_eta_after_tftrack,"h_eff_eta_after_tftrack","pl") + leg.AddEntry(h_eff_eta_after_tfcand,"h_eff_eta_after_tfcand","pl") + ##leg.AddEntry(h_eff_eta_after_gmtreg,"h_eff_eta_after_gmtreg","pl") + leg.AddEntry(h_eff_eta_after_gmt,"h_eff_eta_after_gmt","pl") + ##leg.AddEntry(h_eff_eta_after_xtra,"h_eff_eta_after_xtra","pl") + leg.AddEntry(h_eff_eta_after_xtra_dr,"h_eff_eta_after_xtra_dr","pl") + leg.Draw() + c22.cd(2) + h_eff_eta_after_mpc.GetXaxis().SetRangeUser(0.9,2.5) + h_eff_eta_after_mpc.Draw("hist") + ##h_eff_eta_after_tftrack.Draw("same") + h_eff_eta_after_tfcand_all.Draw("same") + ##h_eff_eta_after_gmtreg_all.Draw("same") + h_eff_eta_after_gmt_all.Draw("same") + ##h_eff_eta_after_xtra_all.Draw("same") + h_eff_eta_after_xtra_dr.Draw("same") + leg = TLegend(0.7815507,0.1702982,0.9846086,0.5740635,"","brNDC") + ##leg.SetTextFont(12) + leg.SetBorderSize(0) + leg.SetTextFont(12) + leg.SetLineColor(1) + leg.SetLineStyle(1) + leg.SetLineWidth(1) + leg.SetFillColor(19) + leg.SetFillStyle(0) + leg.AddEntry(h_eff_eta_after_mpc,"h_eff_eta_after_mpc","pl") + leg.AddEntry(h_eff_eta_after_tfcand_all,"h_eff_eta_after_tfcand_all","pl") + ##leg.AddEntry(h_eff_eta_after_gmtreg_all,"h_eff_eta_after_gmtreg_all","pl") + leg.AddEntry(h_eff_eta_after_gmt_all,"h_eff_eta_after_gmt_all","pl") + ##leg.AddEntry(h_eff_eta_after_xtra_all,"h_eff_eta_after_xtra_all","pl") + leg.AddEntry(h_eff_eta_after_xtra_dr,"h_eff_eta_after_xtra_dr","pl") + leg.Draw("hist") + Print(c22,"h_eff_eta_step.eps") + """ + + """ ## commented on 10/21/09 + c22x = TCanvas("h_eff_eta_steps_full","h_eff_eta_steps_full",1000,600 ) + + h_eff_eta_after_mpc.Draw("hist") + ####h_eff_eta_after_tftrack.Draw("same") + h_eff_eta_after_tfcand.Draw("same") + h_eff_eta_after_gmtreg.Draw("same") + ##h_eff_eta_after_gmtreg_dr.Draw("same") + h_eff_eta_after_gmt.Draw("same") + ####h_eff_eta_after_xtra.Draw("same") + ##h_eff_eta_after_xtra_dr.Draw("same") + + ##h_eff_eta_after_tfcand_pt10 .Draw("same") + ##h_eff_eta_after_gmtreg_pt10 .Draw("same") + ####h_eff_eta_after_gmtreg_dr_pt10 .Draw("same") + ##h_eff_eta_after_gmt_pt10 .Draw("same") + ##h_eff_eta_after_xtra_dr_pt10 .Draw("same") + + leg = TLegend(0.2518248,0.263986,0.830292,0.5332168,"","brNDC") + ##leg.SetTextFont(12) + leg.SetBorderSize(0) + ##leg.SetTextFont(12) + leg.SetFillStyle(0) + + leg.SetHeader("Efficiency after") + leg.AddEntry(h_eff_eta_after_mpc,"match to MPC","pl") + ##leg.AddEntry(h_eff_eta_after_tftrack,"h_eff_eta_after_tftrack","pl") + leg.AddEntry(h_eff_eta_after_tfcand,"match to MPC & TF track","pl") + leg.AddEntry(h_eff_eta_after_gmtreg,"match to MPC & TF trk & CSC GMT trk","pl") + ##leg.AddEntry(h_eff_eta_after_gmtreg_dr,"#Delta R match to CSC GMT trk","pl") + leg.AddEntry(h_eff_eta_after_gmt,"match to MPC & TF trk & GMT trk","pl") + ##leg.AddEntry(h_eff_eta_after_xtra,"h_eff_eta_after_xtra","pl") + ##leg.AddEntry(h_eff_eta_after_xtra_dr,"#Delta R match to GMT","pl") + ##leg.AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)","") + + leg.Draw() + Print(c22x,"h_eff_eta_steps_full.eps") + Print(c22x,"h_eff_eta_steps_full" + ext) + """ + h_eff_eta_steps_full10 = 0 + if (h_eff_eta_steps_full10): + + c22x10 = TCanvas("h_eff_eta_steps_full10","h_eff_eta_steps_full10",1000,600 ) + + h_eff_eta_after_mpc.Draw("hist") + h_eff_eta_after_tfcand_pt10 .Draw("same hist") + h_eff_eta_after_gmtreg_pt10 .Draw("same hist") + h_eff_eta_after_gmt_pt10 .Draw("same hist") + ##h_eff_eta_after_xtra_dr_pt10 .Draw("same hist") + + leg = TLegend(0.2518248,0.263986,0.830292,0.5332168,"","brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + + leg.SetHeader("With additional TF cut p_{T}>10 Efficiency after") + leg.AddEntry(h_eff_eta_after_mpc,"match to MPC","pl") + leg.AddEntry(h_eff_eta_after_tfcand_pt10,"match to MPC & TF track","pl") + leg.AddEntry(h_eff_eta_after_gmtreg_pt10,"match to MPC & TF trk & CSC GMT trk","pl") + leg.AddEntry(h_eff_eta_after_gmt_pt10,"match to MPC & TF trk & GMT trk","pl") + ##leg.AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)","") + + leg.Draw() + Print(c22x10,"h_eff_eta_steps_full10.eps") + Print(c22x10,"h_eff_eta_steps_full10" + ext) + Print(c22x10,"h_eff_eta_steps_full10.pdf") + + + """ + + c22x10tf = TCanvas("h_eff_eta_steps_full10tf","h_eff_eta_steps_full10tf",1000,600 ) + + h_eff_eta_after_tfcand_pt10 .SetLineStyle(1) + + h_eff_eta_after_mpc.Draw("hist") + h_eff_eta_after_mpc_st1.Draw("same hist") + ##h_eff_eta_after_mpc_st1_good.Draw("same hist") + h_eff_eta_after_tfcand_org_st1 .Draw("same hist") + ##h_eff_eta_after_tfcand_comm_st1 .Draw("same hist") + h_eff_eta_after_tfcand_pt10 .Draw("same hist") + h_eff_eta_after_tfcand_my_st1 .Draw("same hist") + h_eff_eta_after_tfcand_my_st1_pt10 .Draw("same hist") + ##h_eff_eta_after_xtra_dr_pt10 .Draw("same hist") + + leg = TLegend(0.2518248,0.263986,0.830292,0.5332168,"","brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + + leg.SetHeader("Efficiency after") + leg.AddEntry(h_eff_eta_after_mpc,"match to MPC","pl") + leg.AddEntry(h_eff_eta_after_mpc_st1,"match to MPC (at least one in ME1)","pl") + ##leg.AddEntry(h_eff_eta_after_mpc_st1_good,"match to MPC (at least one good in ME1)","pl") + leg.AddEntry(NUL,"match to MPC & TF track:","") + leg.AddEntry(h_eff_eta_after_tfcand_pt10," (a) with additional TF cut p_{T}>10","pl") + leg.AddEntry(h_eff_eta_after_tfcand_org_st1," (b) at least 1 original TF stub in ME1","pl") + leg.AddEntry(h_eff_eta_after_tfcand_my_st1," (c) at least 1 matched TF stub in ME1","pl") + leg.AddEntry(h_eff_eta_after_tfcand_my_st1_pt10," (d) at least 1 matched TF stub in ME1 and TF p_{T}>10","pl") + ##leg.AddEntry(h_eff_eta_after_tfcand_comm_st1," at least 1 my=original stub in St1","pl") + ##leg.AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)","") + + leg.Draw() + Print(c22x10tf,"h_eff_eta_steps_full10_tf.eps") + Print(c22x10tf,"h_eff_eta_steps_full10_tf" + ext) + + """ + + """ ## commented on 10/21/09 + c22x10tfs = TCanvas("h_eff_eta_steps_full10tfs","h_eff_eta_steps_full10tfs",1000,600 ) + + h_eff_eta_after_tfcand_pt10 .SetLineStyle(1) + + h_eff_eta_after_mpc.Draw("hist") + h_eff_eta_after_mpc_st1.Draw("same hist") + ##h_eff_eta_after_mpc_st1_good.Draw("same hist") + ##h_eff_eta_after_tfcand_org_st1 .Draw("same hist") + ##h_eff_eta_after_tfcand_comm_st1 .Draw("same hist") + h_eff_eta_after_tfcand_pt10 .Draw("same hist") + h_eff_eta_after_tfcand_my_st1 .Draw("same hist") + ##h_eff_eta_after_tfcand_my_st1_pt10 .Draw("same hist") + ##h_eff_eta_after_xtra_dr_pt10 .Draw("same hist") + + leg = TLegend(0.2518248,0.263986,0.830292,0.5332168,"","brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + + leg.SetHeader("Efficiency after") + leg.AddEntry(NUL,"match to MPC:","") + leg.AddEntry(h_eff_eta_after_mpc," at least one","pl") + leg.AddEntry(h_eff_eta_after_mpc_st1," at least one in ME1","pl") + ##leg.AddEntry(h_eff_eta_after_mpc_st1_good,"match to MPC (at least one good in ME1)","pl") + leg.AddEntry(NUL,"match to MPC & TF track:","") + leg.AddEntry(h_eff_eta_after_tfcand_pt10," with additional TF cut p_{T}>10","pl") + ##leg.AddEntry(h_eff_eta_after_tfcand_org_st1," (b) at least 1 original TF stub in ME1","pl") + leg.AddEntry(h_eff_eta_after_tfcand_my_st1," at least 1 matched TF stub in ME1","pl") + ##leg.AddEntry(h_eff_eta_after_tfcand_my_st1_pt10," (d) at least 1 matched TF stub in ME1 and TF p_{T}>10","pl") + ##leg.AddEntry(h_eff_eta_after_tfcand_comm_st1," at least 1 my=original stub in St1","pl") + ##leg.AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)","") + + leg.Draw() + Print(c22x10tfs,"h_eff_eta_steps_full10_tfs.eps") + Print(c22x10tfs,"h_eff_eta_steps_full10_tfs" + ext) + Print(c22x10tfs,"h_eff_eta_steps_full10_tfs.pdf") + """ + + + do_h_eff_eta_steps_xchk1 = 0 + if (do_h_eff_eta_steps_xchk1): + c222xx1 = TCanvas("h_eff_eta_steps_xchk1","h_eff_eta_steps_xchk1",1000,600 ) + + h_eff_eta_after_gmtreg.SetTitle("CSC GMT efficiency dependence on #eta (cross-check)") + h_eff_eta_after_gmtreg.GetXaxis().SetRangeUser(0.9,2.5) + h_eff_eta_after_gmtreg.GetXaxis().SetTitle("#eta") + h_eff_eta_after_gmtreg.SetMinimum(0) + h_eff_eta_after_gmtreg.Draw("hist") + h_eff_eta_after_gmtreg_dr.Draw("same hist") + + ##h_eff_eta_after_gmtreg_pt10 .Draw("same hist") + ##h_eff_eta_after_gmtreg_dr_pt10 .Draw("same hist") + + leg = TLegend(0.2518248,0.263986,0.830292,0.5332168,"","brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + + leg.SetHeader("Efficiency after") + leg.AddEntry(h_eff_eta_after_gmtreg,"match to MPC & TF trk & CSC GMT trk","pl") + leg.AddEntry(h_eff_eta_after_gmtreg_dr,"#Delta R match to CSC GMT trk","pl") + ##leg.AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)","") + + leg.Draw() + Print(c222xx1,"h_eff_eta_steps_xchk1.eps") + Print(c222xx1,"h_eff_eta_steps_xchk1" + ext) + + + """ + c222xx2 = TCanvas("h_eff_eta_steps_xchk2","h_eff_eta_steps_xchk2",1000,600 ) + + h_eff_eta_after_gmt.SetTitle("GMT efficiency dependence on #eta (cross-check)") + h_eff_eta_after_gmt.GetXaxis().SetRangeUser(0.9,2.5) + h_eff_eta_after_gmt.GetXaxis().SetTitle("#eta") + h_eff_eta_after_gmt.SetMinimum(0) + h_eff_eta_after_gmt.SetMaximum(1.05) + + h_eff_eta_after_gmt.Draw() + h_eff_eta_after_xtra_dr.Draw("same hist") + + ##h_eff_eta_after_gmt_pt10 .Draw("same hist") + ##h_eff_eta_after_xtra_dr_pt10 .Draw("same hist") + + leg = TLegend(0.2518248,0.263986,0.830292,0.5332168,"","brNDC") + ##leg.SetTextFont(12) + leg.SetBorderSize(0) + ##leg.SetTextFont(12) + leg.SetFillStyle(0) + + leg.SetHeader("Efficiency after") + leg.AddEntry(h_eff_eta_after_gmt,"match to MPC & TF trk & GMT trk","pl") + leg.AddEntry(h_eff_eta_after_xtra_dr,"#Delta R match to GMT","pl") + ##leg.AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)","") + + leg.Draw() + Print(c222xx2,"h_eff_eta_steps_xchk2.eps") + Print(c222xx2,"h_eff_eta_steps_xchk2" + ext) + return + + """ + + + + """ + h_eff_eta_me1_after_lct .SetLineColor(kRed) + h_eff_eta_me1_after_lct_okAlct .SetLineColor(kRed-6) + h_eff_eta_me1_after_lct_okAlctClct.SetLineColor(kMagenta-6) + h_eff_eta_me1_after_lct_okClct .SetLineColor(kRed-6) + h_eff_eta_me1_after_lct_okClctAlct.SetLineColor(kMagenta-6) + h_eff_eta_me1_after_mplct_okAlctClct.SetLineColor(kBlack) + h_eff_eta_me1_after_mplct_okAlctClct_plus.SetLineColor(kBlack) + h_eff_eta_me1_after_tf_ok .SetLineColor(kBlue) + h_eff_eta_me1_after_tf_ok_pt10 .SetLineColor(kBlue+2) + h_eff_eta_me1_after_tf_ok_plus .SetLineColor(kBlue) + h_eff_eta_me1_after_tf_ok_plus_pt10 .SetLineColor(kBlue+2) + + h_eff_eta_after_tfcand_all_pt10.SetLineColor(kCyan+2) + + h_eff_eta_me1_after_lct.SetLineWidth(2) + h_eff_eta_me1_after_lct_okAlct.SetLineWidth(2) + h_eff_eta_me1_after_lct_okAlctClct.SetLineWidth(2) + h_eff_eta_me1_after_lct_okClct.SetLineWidth(2) + h_eff_eta_me1_after_lct_okClctAlct.SetLineWidth(2) + + ##h_eff_eta_me1_after_lct.SetLineStyle(7) + h_eff_eta_me1_after_lct_okAlct.SetLineStyle(3) + h_eff_eta_me1_after_lct_okAlctClct.SetLineStyle(7) + h_eff_eta_me1_after_lct_okClct.SetLineStyle(3) + h_eff_eta_me1_after_lct_okClctAlct.SetLineStyle(7) + h_eff_eta_me1_after_mplct_okAlctClct_plus.SetLineStyle(7) + + h_eff_eta_me1_after_tf_ok_pt10.SetLineStyle(7) + h_eff_eta_me1_after_tf_ok_plus_pt10.SetLineStyle(7) + h_eff_eta_after_tfcand_all_pt10.SetLineStyle(3) + + h_eff_eta_me1_after_lct.SetTitle("efficiency dependence on #eta: ME1 studies") + h_eff_eta_me1_after_lct.GetXaxis().SetRangeUser(0.86,2.5) + h_eff_eta_me1_after_lct.GetXaxis().SetTitle("#eta") + h_eff_eta_me1_after_lct.SetMinimum(0) + h_eff_eta_me1_after_lct.GetYaxis().SetRangeUser(0.,1.05) + + + + cme1n1 = TCanvas("h_eff_eta_me1_after_lct","h_eff_eta_me1_after_lct",1000,600 ) + + + h_eff_eta_me1_after_lct.Draw("hist") + ##h_eff_eta_me1_after_lct_okAlct.Draw("same hist") + ##h_eff_eta_me1_after_lct_okAlctClct.Draw("same hist") + h_eff_eta_me1_after_lct_okClct.Draw("same hist") + h_eff_eta_me1_after_lct_okClctAlct.Draw("same hist") + h_eff_eta_me1_after_mplct_okAlctClct.Draw("same hist") + h_eff_eta_me1_after_mplct_okAlctClct_plus.Draw("same hist") + h_eff_eta_me1_after_tf_ok .Draw("same hist") + h_eff_eta_me1_after_tf_ok_pt10 .Draw("same hist") + h_eff_eta_after_tfcand_all_pt10.Draw("same hist") + + leg = TLegend(0.347,0.222,0.926,0.535,"","brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + + leg.SetHeader("Efficiency for muon with p_{T}>10") + ##leg.AddEntry(NUL,"match to LCT:","") + leg.AddEntry(h_eff_eta_me1_after_lct,"any LCT in ME1 chamber crossed by #mu","pl") + ##leg.AddEntry(h_eff_eta_me1_after_lct_okAlct," + track's ALCT","pl") + ##leg.AddEntry(h_eff_eta_me1_after_lct_okAlctClct," + track's CLCT","pl") + leg.AddEntry(h_eff_eta_me1_after_lct_okClct," + correct CLCT picked","pl") + leg.AddEntry(h_eff_eta_me1_after_lct_okClctAlct," + correct ALCT mached to CLCT","pl") + leg.AddEntry(h_eff_eta_me1_after_mplct_okAlctClct," + pass MPC selection","pl") + leg.AddEntry(h_eff_eta_me1_after_mplct_okAlctClct," + has two MPC matched","pl") + leg.AddEntry(h_eff_eta_me1_after_tf_ok," + stub used in any TF track","pl") + leg.AddEntry(h_eff_eta_me1_after_tf_ok_pt10," + stub used in TF track with p_{T}>10 GeV","pl") + leg.AddEntry(h_eff_eta_after_tfcand_all_pt10,"there is TF track p_{T}>10 in #Delta R<0.3","pl") + ##leg.AddEntry(," ","pl") + leg.Draw() + Print(cme1n1,"h_eff_eta_me1_steps_all.eps") + Print(cme1n1,"h_eff_eta_me1_steps_all" + ext) + Print(cme1n1,"h_eff_eta_me1_steps_all.pdf") + + + + + cme1n2 = TCanvas("h_eff_eta_me1_after_lct2","h_eff_eta_me1_after_lct2",800,600 ) + h_eff_eta_me1_after_mplct_okAlctClct.GetXaxis().SetRangeUser(0.86,2.5) + h_eff_eta_me1_after_mplct_okAlctClct.GetXaxis().SetTitle("#eta") + h_eff_eta_me1_after_mplct_okAlctClct.SetMinimum(0) + h_eff_eta_me1_after_mplct_okAlctClct.GetYaxis().SetRangeUser(0.,1.05) + h_eff_eta_me1_after_mplct_okAlctClct.SetTitle("Efficiency in ME1 for #mu with p_{T}>10") + h_eff_eta_me1_after_mplct_okAlctClct.GetYaxis().SetTitle("Eff.") + h_eff_eta_me1_after_mplct_okAlctClct.GetXaxis().SetTitleSize(0.07) + h_eff_eta_me1_after_mplct_okAlctClct.GetXaxis().SetTitleOffset(0.7) + h_eff_eta_me1_after_mplct_okAlctClct.GetYaxis().SetLabelOffset(0.015) + gStyle.SetTitleW(1) + gStyle.SetTitleH(0.08) + gStyle.SetTitleStyle(0) + h_eff_eta_me1_after_mplct_okAlctClct.Draw("hist") + h_eff_eta_me1_after_mplct_okAlctClct_plus.Draw("same hist") + h_eff_eta_me1_after_tf_ok .Draw("same hist") + h_eff_eta_me1_after_tf_ok_pt10 .Draw("same hist") + + + leg = TLegend(0.34,0.16,0.87,0.39,"","brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("SimMuon has matched") + leg.AddEntry(h_eff_eta_me1_after_mplct_okAlctClct,"MPC LCT stub in ME1","pl") + leg.AddEntry(h_eff_eta_me1_after_mplct_okAlctClct_plus," + one more MPC LCT stub in ME234 + ","pl") + leg.AddEntry(h_eff_eta_me1_after_tf_ok," + this stub was used by a TF track","pl") + leg.AddEntry(h_eff_eta_me1_after_tf_ok_pt10," + this TF track has p_{T}(TF)>10 GeV","pl") + leg.Draw() + Print(cme1n2,"h_eff_eta_me1_tf" + ext) + + + + cme1n2_plus = TCanvas("h_eff_eta_me1_after_tfplus","h_eff_eta_me1_after_tfplus",800,600 ) + h_eff_eta_me1_after_mplct_okAlctClct_plus.GetXaxis().SetRangeUser(0.86,2.5) + h_eff_eta_me1_after_mplct_okAlctClct_plus.GetXaxis().SetTitle("#eta") + h_eff_eta_me1_after_mplct_okAlctClct_plus.SetMinimum(0) + h_eff_eta_me1_after_mplct_okAlctClct_plus.GetYaxis().SetRangeUser(0.,1.05) + h_eff_eta_me1_after_mplct_okAlctClct_plus.SetTitle("Efficiency in ME1 for #mu with p_{T}>10") + h_eff_eta_me1_after_mplct_okAlctClct_plus.GetYaxis().SetTitle("Eff.") + h_eff_eta_me1_after_mplct_okAlctClct_plus.GetXaxis().SetTitleSize(0.07) + h_eff_eta_me1_after_mplct_okAlctClct_plus.GetXaxis().SetTitleOffset(0.7) + h_eff_eta_me1_after_mplct_okAlctClct_plus.GetYaxis().SetLabelOffset(0.015) + gStyle.SetTitleW(1) + gStyle.SetTitleH(0.08) + gStyle.SetTitleStyle(0) + h_eff_eta_me1_after_mplct_okAlctClct_plus.Draw("hist") + h_eff_eta_me1_after_tf_ok_plus .Draw("same hist") + h_eff_eta_me1_after_tf_ok_plus_pt10 .Draw("same hist") + h_eff_eta_me1_after_lct_okClctAlct.Draw("same hist") + + leg = TLegend(0.34,0.16,0.87,0.39,"","brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetHeader("SimMuon has matched") + leg.AddEntry(h_eff_eta_me1_after_mplct_okAlctClct_plus,"MPC LCT stubs in ME1 and some other station","pl") + leg.AddEntry(h_eff_eta_me1_after_tf_ok_plus," + these stubs were used by a TF track","pl") + leg.AddEntry(h_eff_eta_me1_after_tf_ok_plus_pt10," + this TF track has p_{T}(TF)>10 GeV","pl") + leg.Draw() + Print(cme1n2_plus,"h_eff_eta_me1_tfplus" + ext) + + + + + + + + h_eff_eta_me1_after_alct.SetLineColor(kBlue+1) + h_eff_eta_me1_after_alct_okAlct.SetLineColor(kBlue+1) + h_eff_eta_me1_after_clct.SetLineColor(kGreen+1) + h_eff_eta_me1_after_clct_okClct.SetLineColor(kGreen+1) + h_eff_eta_me1_after_alctclct.SetLineColor(kYellow+2) + h_eff_eta_me1_after_alctclct_okAlct.SetLineColor(kMagenta+2) + h_eff_eta_me1_after_alctclct_okClct.SetLineColor(kMagenta+3) + h_eff_eta_me1_after_alctclct_okAlctClct.SetLineColor(kYellow+2) + """ + """ + h_eff_eta_me1_after_alct + h_eff_eta_me1_after_alct_okAlct + h_eff_eta_me1_after_clct + h_eff_eta_me1_after_clct_okClct + h_eff_eta_me1_after_alctclct + h_eff_eta_me1_after_alctclct_okAlct + h_eff_eta_me1_after_alctclct_okClct + h_eff_eta_me1_after_alctclct_okAlctClct + """ + + """ + h_eff_eta_me1_after_alct.SetLineStyle(2) + h_eff_eta_me1_after_clct.SetLineStyle(2) + h_eff_eta_me1_after_alctclct.SetLineStyle(2) + + h_eff_eta_me1_after_alct.SetLineWidth(2) + h_eff_eta_me1_after_alct_okAlct.SetLineWidth(2) + h_eff_eta_me1_after_clct.SetLineWidth(2) + h_eff_eta_me1_after_clct_okClct.SetLineWidth(2) + h_eff_eta_me1_after_alctclct.SetLineWidth(2) + h_eff_eta_me1_after_alctclct_okAlct.SetLineWidth(2) + h_eff_eta_me1_after_alctclct_okClct.SetLineWidth(2) + h_eff_eta_me1_after_alctclct_okAlctClct.SetLineWidth(2) + + + h_eff_eta_me1_after_lct.SetLineStyle(2) + h_eff_eta_me1_after_lct_okClctAlct.SetLineStyle(1) + h_eff_eta_me1_after_lct_okClctAlct.SetLineColor(kRed) + + + + + + + + + + cme1na = TCanvas("h_eff_eta_me1_after_alct","h_eff_eta_me1_after_alct",1000,600 ) + + ##h_eff_eta_me1_after_lct.GetYaxis().SetRangeUser(0.,1.05) + ##h_eff_eta_me1_after_lct.GetYaxis().SetRangeUser(0.5,1.05) + ##h_eff_eta_me1_after_lct.GetYaxis().SetRangeUser(0.8,1.02) + h_eff_eta_me1_after_lct.GetYaxis().SetRangeUser(yrange[0],yrange[1]) + h_eff_eta_me1_after_lct.Draw("hist") + ##h_eff_eta_me1_after_lct_okClctAlct.Draw("same hist") + + h_eff_eta_me1_after_alct.Draw("same hist") + h_eff_eta_me1_after_alct_okAlct.Draw("same hist") + h_eff_eta_me1_after_clct.Draw("same hist") + h_eff_eta_me1_after_clct_okClct.Draw("same hist") + h_eff_eta_me1_after_alctclct.Draw("same hist") + ##h_eff_eta_me1_after_alctclct_okAlct.Draw("same hist") + ##h_eff_eta_me1_after_alctclct_okClct.Draw("same hist") + h_eff_eta_me1_after_alctclct_okAlctClct.Draw("same hist") + + h_eff_eta_me1_after_lct.Draw("same hist") + h_eff_eta_me1_after_lct_okClctAlct.Draw("same hist") + + h_eff_eta_me1_after_lct_okClctAlct.Fit("pol0","R0","",1.63,2.38) + eff11 = (h_eff_eta_me1_after_lct_okClctAlct.GetFunction("pol0")).GetParameter(0) + cout<10 crossing a ME1 chamber with") + + leg.AddEntry(h_eff_eta_me1_after_alct,"any ALCT","pl") + leg.AddEntry(h_eff_eta_me1_after_alct_okAlct,"correct ALCT","pl") + leg.AddEntry(h_eff_eta_me1_after_clct,"any CLCT","pl") + leg.AddEntry(h_eff_eta_me1_after_clct_okClct,"correct CLCT","pl") + + leg.AddEntry(h_eff_eta_me1_after_alctclct,"any ALCT and CLCT","pl") + ##leg.AddEntry(h_eff_eta_me1_after_alctclct_okAlct,"correct ALCT and any CLCT","pl") + ##leg.AddEntry(h_eff_eta_me1_after_alctclct_okClct,"any ALCT and correct CLCT","pl") + leg.AddEntry(h_eff_eta_me1_after_alctclct_okAlctClct,"correct ALCT and CLCT","pl") + + leg.AddEntry(h_eff_eta_me1_after_lct,"any LCT","pl") + leg.AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"correct LCT","pl") + + leg.Draw() + Print(cme1na,"h_eff_eta_me1_steps_stubs.eps") + Print(cme1na,"h_eff_eta_me1_steps_stubs" + ext) + Print(cme1na,"h_eff_eta_me1_steps_stubs.pdf") + + + + + char ghn[111] + sprintf(ghn,"h_eff_eta_me1_after_lct_okClctAlct_%s",dname) + gh = (TH1F*)h_eff_eta_me1_after_lct_okClctAlct.Clone(ghn) + gh.GetYaxis().SetRangeUser(0.8,1.02) + + gh.SetTitle("LCT finding efficiency in ME1 for #mu with p_{T}>10") + gh.GetXaxis().SetRangeUser(0.8,2.5) + gh.GetYaxis().SetRangeUser(0.,1.05) + gh.GetXaxis().SetTitle("#eta") + gh.GetYaxis().SetTitle("Eff.") + gh.GetXaxis().SetTitleSize(0.07) + gh.GetXaxis().SetTitleOffset(0.7) + gh.GetYaxis().SetLabelOffset(0.015) + """ + + + """ + + h_eff_eta_me1_after_clct.SetTitle("CLCT efficiency dependence on #eta: ME1 studies") + h_eff_eta_me1_after_clct.GetXaxis().SetRangeUser(0.86,2.5) + h_eff_eta_me1_after_clct.GetXaxis().SetTitle("#eta") + h_eff_eta_me1_after_clct.SetMinimum(0) + h_eff_eta_me1_after_clct.GetYaxis().SetRangeUser(0.,1.05) + + h_eff_eta_me1_after_clct_okClct.SetTitle("Correct CLCT efficiency dependence on #eta: ME1 studies") + h_eff_eta_me1_after_clct_okClct.GetXaxis().SetRangeUser(0.86,2.5) + h_eff_eta_me1_after_clct_okClct.GetXaxis().SetTitle("#eta") + h_eff_eta_me1_after_clct_okClct.SetMinimum(0) + h_eff_eta_me1_after_clct_okClct.GetYaxis().SetRangeUser(0.,1.05) + + cme1nc = TCanvas("h_eff_eta_me1_after_clct","h_eff_eta_me1_after_clct",1000,600 ) + + h_eff_eta_me1_after_clct_okClct.GetYaxis().SetRangeUser(0.5,1.02) + + ##h_eff_eta_me1_after_clct.Draw() + ##h_eff_eta_me1_after_clct_okClct.Draw("same hist") + h_eff_eta_me1_after_clct_okClct.Draw() + + + leg = TLegend(0.347,0.222,0.926,0.535,"","brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + + leg.SetNColumns(2) + leg.SetHeader("Efficiency for #mu with p_{T}>10 crossing a ME1 chamber with") + + leg.AddEntry(h_eff_eta_me1_after_alct,"any ALCT","pl") + leg.AddEntry(h_eff_eta_me1_after_alct_okAlct,"correct ALCT","pl") + leg.AddEntry(h_eff_eta_me1_after_clct,"any CLCT","pl") + leg.AddEntry(h_eff_eta_me1_after_clct_okClct,"correct CLCT","pl") + + leg.AddEntry(h_eff_eta_me1_after_alctclct,"any ALCT and CLCT","pl") + ##leg.AddEntry(h_eff_eta_me1_after_alctclct_okAlct,"correct ALCT and any CLCT","pl") + ##leg.AddEntry(h_eff_eta_me1_after_alctclct_okClct,"any ALCT and correct CLCT","pl") + leg.AddEntry(h_eff_eta_me1_after_alctclct_okAlctClct,"correct ALCT and CLCT","pl") + + leg.AddEntry(h_eff_eta_me1_after_lct,"any LCT","pl") + leg.AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"correct LCT","pl") + + leg.Draw() + + Print(cme1na,"h_eff_eta_me1_steps_stubs.eps") + Print(cme1na,"h_eff_eta_me1_steps_stubs" + ext) + Print(cme1na,"h_eff_eta_me1_steps_stubs.pdf") + """ + + ##return + + + + """ + if (do_h_eff_eta_me1_after_alct_okAlct) { + + h_eff_eta_me1_after_alct_okAlct.SetTitle("Correct ALCT efficiency dependence on #eta: ME1 studies") + h_eff_eta_me1_after_alct_okAlct.GetXaxis().SetRangeUser(0.86,2.5) + h_eff_eta_me1_after_alct_okAlct.GetXaxis().SetTitle("#eta") + h_eff_eta_me1_after_alct_okAlct.SetMinimum(0) + h_eff_eta_me1_after_alct_okAlct.GetYaxis().SetRangeUser(0.,1.05) + + cme1nc = TCanvas("h_eff_eta_me1_after_alctt","h_eff_eta_me1_after_alctt",1000,600 ) + + h_eff_eta_me1_after_alct_okAlct.GetYaxis().SetRangeUser(yrange[0],yrange[1]) + + ##h_eff_eta_me1_after_alct.Draw() + ##h_eff_eta_me1_after_alct_okAlct.Draw("same hist") + h_eff_eta_me1_after_alct_okAlct.Draw("hist") + + } + """ + + + #return + + ##/ EFFICIENCY dep. on WIREGROUP + + """ + h_wg_me11_initial = getH(dir,"h_wg_me11_initial") + h_wg_me11_after_alct_okAlct = getH(dir,"h_wg_me11_after_alct_okAlct") + h_wg_me11_after_alctclct_okAlctClct = getH(dir,"h_wg_me11_after_alctclct_okAlctClct") + h_wg_me11_after_lct_okAlctClct = getH(dir,"h_wg_me11_after_lct_okAlctClct") + + h_eff_wg_me11_after_alct_okAlct = h_wg_me11_after_alct_okAlct.Clone("h_eff_wg_me11_after_alct_okAlct") + h_eff_wg_me11_after_alctclct_okAlctClct = h_wg_me11_after_alctclct_okAlctClct.Clone("h_eff_wg_me11_after_alctclct_okAlctClct") + h_eff_wg_me11_after_lct_okAlctClct = h_wg_me11_after_lct_okAlctClct.Clone("h_eff_wg_me11_after_lct_okAlctClct") + + h_eff_wg_me11_after_alct_okAlct.Divide(h_eff_wg_me11_after_alct_okAlct,h_wg_me11_initial) + h_eff_wg_me11_after_alctclct_okAlctClct.Divide(h_eff_wg_me11_after_alctclct_okAlctClct,h_wg_me11_initial) + h_eff_wg_me11_after_lct_okAlctClct.Divide(h_eff_wg_me11_after_lct_okAlctClct,h_wg_me11_initial) + + h_eff_wg_me11_after_alct_okAlct.SetLineWidth(2) + h_eff_wg_me11_after_alctclct_okAlctClct.SetLineWidth(2) + h_eff_wg_me11_after_lct_okAlctClct.SetLineWidth(2) + + h_eff_wg_me11_after_alct_okAlct.SetLineColor(kBlue+1) + h_eff_wg_me11_after_alctclct_okAlctClct.SetLineColor(kYellow+2) + h_eff_wg_me11_after_lct_okAlctClct.SetLineColor(kRed) + + h_eff_wg_me11_after_alct_okAlct.SetTitle("Correct ALCT efficiency dependence on WG in ME11") + h_eff_wg_me11_after_alct_okAlct.SetTitle("wire group") + h_eff_wg_me11_after_alct_okAlct.SetMinimum(0) + h_eff_wg_me11_after_alct_okAlct.GetYaxis().SetRangeUser(0.,1.05) + + cme11wgv= TCanvas("h_eff_wg_me11_after_alct","h_eff_wg_me11_after_alct",1000,600 ) + h_eff_wg_me11_after_alct_okAlct.Draw("hist") + h_eff_wg_me11_after_alctclct_okAlctClct.Draw("same hist") + h_eff_wg_me11_after_lct_okAlctClct.Draw("same hist") + """ + +if __name__ == "__main__": + print "It works!" + From 16092a5ed7b3b8887ac3af3e6bb6d5ea131be7e5 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 16 Aug 2013 11:11:32 +0200 Subject: [PATCH 088/182] update --- SimMuL1/scripts/produceRateVsEtaPlotsForApproval.py | 2 +- SimMuL1/scripts/triggerPlotHelpers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.py b/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.py index 1adb06f8d7725..0e173e1bb12b6 100644 --- a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.py +++ b/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.py @@ -1,4 +1,4 @@ -from triggerPlothelpers import * +from triggerPlotHelpers import * ## ROOT modules from ROOT import * diff --git a/SimMuL1/scripts/triggerPlotHelpers.py b/SimMuL1/scripts/triggerPlotHelpers.py index 1b6281273df7f..ba0243a69d2d8 100644 --- a/SimMuL1/scripts/triggerPlotHelpers.py +++ b/SimMuL1/scripts/triggerPlotHelpers.py @@ -19,7 +19,7 @@ def SetOptStat(h, op): stat.SetOptStat(op) return stat -def getH(f, dir, name): +def GetH(f, dir, name): """Get the histogram""" dir = "SimMuL1StrictAll" return f.Get("%s/%s;1"%(dir,name)) From 533c9c6ef5d2e955d1cb1d525d4accb197d17c70 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 16 Aug 2013 11:15:04 +0200 Subject: [PATCH 089/182] merging local updates --- SimMuL1/interface/Helpers.h | 37 +++-------------- SimMuL1/plugins/GEMCSCTriggerRate.cc | 62 +++++++--------------------- 2 files changed, 20 insertions(+), 79 deletions(-) diff --git a/SimMuL1/interface/Helpers.h b/SimMuL1/interface/Helpers.h index 7ba04de2d9dcd..df48497607fb4 100644 --- a/SimMuL1/interface/Helpers.h +++ b/SimMuL1/interface/Helpers.h @@ -1,38 +1,13 @@ #ifndef SimMuL1_Helpers_h #define SimMuL1_Helpers_h -namespace helpers +namespace triggerHelpers { -bool -isME1bEtaRegion(float eta, float eta_min = 1.64, float eta_max = 2.14) -{ - return fabs(eta) >= eta_min && fabs(eta) <= eta_max; -} - -bool -isME1abEtaRegion(float eta, float eta_min = 1.64) -{ - return fabs(eta) >= eta_min; -} - -bool -isME1aEtaRegion(float eta, float eta_min = 2.14) -{ - return fabs(eta) >= eta_min; -} - -bool -isME42EtaRegion(float eta) -{ - return fabs(eta)>=1.2499 && fabs(eta)<=1.8; -} - -bool -isME42RPCEtaRegion(float eta) -{ - return fabs(eta)>=1.2499 && fabs(eta)<=1.6; -} - + bool isME1bEtaRegion(float eta, float eta_min = 1.64, float eta_max = 2.14); + bool isME1abEtaRegion(float eta, float eta_min = 1.64); + bool isME1aEtaRegion(float eta, float eta_min = 2.14); + bool isME42EtaRegion(float eta); + bool isME42RPCEtaRegion(float eta); } #endif diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.cc b/SimMuL1/plugins/GEMCSCTriggerRate.cc index 4592a4c3070aa..27d164969bc45 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRate.cc @@ -29,6 +29,7 @@ #include "DataFormats/MuonDetId/interface/GEMDetId.h" #include "Geometry/GEMGeometry/interface/GEMGeometry.h" #include "GEMCode/GEMValidation/src/SimTrackMatchManager.h" +#include "GEMCode/SimMuL1/interface/Helpers.h" using namespace std; using namespace reco; @@ -36,29 +37,8 @@ using namespace edm; namespace { - const Double_t ETA_BIN = 0.0125 *2; const Double_t PHI_BIN = 62.*M_PI/180./4096.; // 0.26 mrad - - bool isME1bEtaRegion(float eta, float eta_min = 1.64, float eta_max = 2.14) - { - if (fabs(eta) >= eta_min && fabs(eta) <= eta_max) return true; - else return false; - } - - bool isME1abEtaRegion(float eta, float eta_min = 1.64) - { - if (fabs(eta) >= eta_min) return true; - else return false; - } - - bool isME1aEtaRegion(float eta, float eta_min = 2.14) - { - if (fabs(eta) >= eta_min) return true; - else return false; - } - - } // ================================================================================================ @@ -1479,7 +1459,7 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup //cout<<"\n nnntf: "<nStubs(0,1,1,1,1)<nStubs()) myTFCand.tftrack->print("non-equal nstubs!"); //if (fabs(myTFCand.eta)>1.25 && fabs(myTFCand.eta)<1.9) { - if (isME42EtaRegion(myTFCand.eta)) { + if (triggerHelpers::isME42EtaRegion(myTFCand.eta)) { if (ntrg_stubs>=2) h_rt_tfcand_pt_h42_2st->Fill(tfpt); if (ntrg_stubs>=3) h_rt_tfcand_pt_h42_3st->Fill(tfpt); } @@ -1586,8 +1566,8 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup float geta = fabs(myGMTREGCand.eta); float gpt = myGMTREGCand.pt; - bool eta_me42 = isME42EtaRegion(myGMTREGCand.eta); - bool eta_me42r = isME42RPCEtaRegion(myGMTREGCand.eta); + bool eta_me42 = triggerHelpers::isME42EtaRegion(myGMTREGCand.eta); + bool eta_me42r = triggerHelpers::isME42RPCEtaRegion(myGMTREGCand.eta); //if (geta>=1.2 && geta<=1.8) eta_me42 = 1; bool eta_q = (geta > 1.2); @@ -1615,10 +1595,10 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup continue; } - bool eta_me1b = isME1bEtaRegion(myGMTREGCand.eta); - bool eta_me1ab = isME1abEtaRegion(myGMTREGCand.eta); - bool eta_me1a = isME1aEtaRegion(myGMTREGCand.eta); - bool eta_me1b_whole = isME1bEtaRegion(myGMTREGCand.eta, 1.6, 2.14); + bool eta_me1b = triggerHelpers::isME1bEtaRegion(myGMTREGCand.eta); + bool eta_me1ab = triggerHelpers::isME1abEtaRegion(myGMTREGCand.eta); + bool eta_me1a = triggerHelpers::isME1aEtaRegion(myGMTREGCand.eta); + bool eta_me1b_whole = triggerHelpers::isME1bEtaRegion(myGMTREGCand.eta, 1.6, 2.14); bool eta_no1a = (geta >= 1.2 && geta < 2.14); n_stubs = myGMTREGCand.nTFStubs; @@ -1744,7 +1724,7 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup // else cout<<"null tftrack!"<quality()>=3 && gpt >=40. && isME1bEtaRegion(myGMTREGCand.eta) ) { + // if (trk->quality()>=3 && gpt >=40. && triggerHelpers::isME1bEtaRegion(myGMTREGCand.eta) ) { // cout<<"highpt csctf in ME1b "<tftrack->print(""); // } @@ -1917,7 +1897,7 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup h_rt_gmt_rpcf_eta->Fill(fabs(myGMTREGCand.eta)); h_rt_gmt_rpcf_bx->Fill(trk->bx()); - bool eta_me42 = isME42RPCEtaRegion(myGMTREGCand.eta); + bool eta_me42 = triggerHelpers::isME42RPCEtaRegion(myGMTREGCand.eta); //if (fabs(myGMTREGCand.eta)>=1.2 && fabs(myGMTREGCand.eta)<=1.8) eta_me42 = 1; if(eta_me42) h_rt_gmt_rpcf_pt_42->Fill(myGMTREGCand.pt); @@ -2145,13 +2125,13 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup if ( (gmt_csc != NULL && gmt_rpcf != NULL) && !muItr->isMatchedCand() ) cout<<"csc&rpcf but not matched!"<=1.2 && geta<=1.8) eta_me42 = 1; bool eta_q = (geta > 1.2); - bool eta_me1b = isME1bEtaRegion(myGMTCand.eta); - //bool eta_me1b_whole = isME1bEtaRegion(myGMTCand.eta, 1.6, 2.14); + bool eta_me1b = triggerHelpers::isME1bEtaRegion(myGMTCand.eta); + //bool eta_me1b_whole = triggerHelpers::isME1bEtaRegion(myGMTCand.eta, 1.6, 2.14); bool eta_no1a = (geta >= 1.2 && geta < 2.14); //bool eta_csc = (geta > 0.9); // @@ -2473,20 +2453,6 @@ GEMCSCTriggerRate::cscTriggerSubsector(CSCDetId &id) } -// ================================================================================================ -bool GEMCSCTriggerRate::isME42EtaRegion(float eta) -{ - if (fabs(eta)>=1.2499 && fabs(eta)<=1.8) return true; - else return false; -} - -bool GEMCSCTriggerRate::isME42RPCEtaRegion(float eta) -{ - if (fabs(eta)>=1.2499 && fabs(eta)<=1.6) return true; - else return false; -} - - // ================================================================================================ void GEMCSCTriggerRate::setupTFModeHisto(TH1D* h) From 0e2ddd85a07a1099b16a7950042e8a62231f8249 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 16 Aug 2013 11:44:31 +0200 Subject: [PATCH 090/182] renaming Helpers to EtaRangeHelpers --- .../{Helpers.h => EtaRangeHelpers.h} | 6 +-- SimMuL1/plugins/GEMCSCTriggerEfficiency.cc | 27 ++---------- SimMuL1/plugins/GEMCSCTriggerEfficiency.h | 3 -- SimMuL1/plugins/GEMCSCTriggerRate.cc | 28 ++++++------- SimMuL1/plugins/GEMCSCTriggerRate.h | 3 -- SimMuL1/src/EtaRangeHelpers.cc | 41 +++++++++++++++++++ 6 files changed, 62 insertions(+), 46 deletions(-) rename SimMuL1/interface/{Helpers.h => EtaRangeHelpers.h} (74%) create mode 100644 SimMuL1/src/EtaRangeHelpers.cc diff --git a/SimMuL1/interface/Helpers.h b/SimMuL1/interface/EtaRangeHelpers.h similarity index 74% rename from SimMuL1/interface/Helpers.h rename to SimMuL1/interface/EtaRangeHelpers.h index 8087c9bf9fce6..8713353cb54fd 100644 --- a/SimMuL1/interface/Helpers.h +++ b/SimMuL1/interface/EtaRangeHelpers.h @@ -1,7 +1,7 @@ -#ifndef SimMuL1_Helpers_h -#define SimMuL1_Helpers_h +#ifndef SimMuL1_EtaRangeHelpers_h +#define SimMuL1_EtaRangeHelpers_h -namespace triggerHelpers +namespace etaRangeHelpers { bool isME1bEtaRegion(float eta, float eta_min = 1.64, float eta_max = 2.14); bool isME1abEtaRegion(float eta, float eta_min = 1.64); diff --git a/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc b/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc index 3c91a88fc948b..e1cbd9f45a811 100644 --- a/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc +++ b/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc @@ -36,6 +36,7 @@ #include "Geometry/GEMGeometry/interface/GEMGeometry.h" #include "GEMCode/GEMValidation/src/SimTrackMatchManager.h" +#include "GEMCode/SimMuL1/interface/EtaRangeHelpers.h" using namespace std; using namespace reco; @@ -69,12 +70,6 @@ namespace b = ( n*sxy -sx*sy ) / delta; } - bool isME1bEtaRegion(float eta, float eta_min = 1.64, float eta_max = 2.14) - { - if (fabs(eta) >= eta_min && fabs(eta) <= eta_max) return true; - else return false; - } - // // constants, enums and typedefs // @@ -1467,8 +1462,8 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& bool eta_ok = ( fabs(steta) >= 1.2 && fabs(steta) <= 2.14 ); bool etapt_ok = eta_ok && pt_ok; - bool eta_1b = isME1bEtaRegion(steta, 1.6, 2.12); - bool eta_gem_1b = isME1bEtaRegion(steta, 1.64, 2.05); + bool eta_1b = etaRangeHelpers::isME1bEtaRegion(steta, 1.6, 2.12); + bool eta_gem_1b = etaRangeHelpers::isME1bEtaRegion(steta, 1.64, 2.05); unsigned nst_with_hits = match->nStationsWithHits(); @@ -2298,7 +2293,7 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& // wor weight calculation //if (fabs(steta)>1.25 && fabs(steta)<1.9) { - if (isME42EtaRegion(steta)) { + if (etaRangeHelpers::isME42EtaRegion(steta)) { // double weight = rateWeight(stpt); if (tfc->tftrack->nStubs()>=2) { h_tf_pt_h42_2st->Fill(tfc_pt); @@ -4418,20 +4413,6 @@ GEMCSCTriggerEfficiency::cscTriggerSubsector(CSCDetId &id) return ((chamber-1) / 3) + 1; // [1,3] -> 1 , [4,6]->2 } -// ================================================================================================ -bool GEMCSCTriggerEfficiency::isME42EtaRegion(float eta) -{ - if (fabs(eta)>=1.2499 && fabs(eta)<=1.8) return true; - else return false; -} - -bool GEMCSCTriggerEfficiency::isME42RPCEtaRegion(float eta) -{ - if (fabs(eta)>=1.2499 && fabs(eta)<=1.6) return true; - else return false; -} - - // ================================================================================================ void GEMCSCTriggerEfficiency::setupTFModeHisto(TH1D* h) diff --git a/SimMuL1/plugins/GEMCSCTriggerEfficiency.h b/SimMuL1/plugins/GEMCSCTriggerEfficiency.h index 56f8936de66e3..308ead1aa40cc 100644 --- a/SimMuL1/plugins/GEMCSCTriggerEfficiency.h +++ b/SimMuL1/plugins/GEMCSCTriggerEfficiency.h @@ -202,9 +202,6 @@ class GEMCSCTriggerEfficiency : public edm::EDFilter // calculates the weight of the event to reproduce a min bias //spectrum, from G. Wrochna's note CMSS 1997/096 - bool isME42EtaRegion(float eta); - bool isME42RPCEtaRegion(float eta); - static void setupTFModeHisto(TH1D* h); std::pair intersectionEtaPhi(CSCDetId id, int wg, int hs); diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.cc b/SimMuL1/plugins/GEMCSCTriggerRate.cc index 27d164969bc45..2b3ebcf01bab8 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRate.cc @@ -29,7 +29,7 @@ #include "DataFormats/MuonDetId/interface/GEMDetId.h" #include "Geometry/GEMGeometry/interface/GEMGeometry.h" #include "GEMCode/GEMValidation/src/SimTrackMatchManager.h" -#include "GEMCode/SimMuL1/interface/Helpers.h" +#include "GEMCode/SimMuL1/interface/EtaRangeHelpers.h" using namespace std; using namespace reco; @@ -1459,7 +1459,7 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup //cout<<"\n nnntf: "<nStubs(0,1,1,1,1)<nStubs()) myTFCand.tftrack->print("non-equal nstubs!"); //if (fabs(myTFCand.eta)>1.25 && fabs(myTFCand.eta)<1.9) { - if (triggerHelpers::isME42EtaRegion(myTFCand.eta)) { + if (etaRangeHelpers::isME42EtaRegion(myTFCand.eta)) { if (ntrg_stubs>=2) h_rt_tfcand_pt_h42_2st->Fill(tfpt); if (ntrg_stubs>=3) h_rt_tfcand_pt_h42_3st->Fill(tfpt); } @@ -1566,8 +1566,8 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup float geta = fabs(myGMTREGCand.eta); float gpt = myGMTREGCand.pt; - bool eta_me42 = triggerHelpers::isME42EtaRegion(myGMTREGCand.eta); - bool eta_me42r = triggerHelpers::isME42RPCEtaRegion(myGMTREGCand.eta); + bool eta_me42 = etaRangeHelpers::isME42EtaRegion(myGMTREGCand.eta); + bool eta_me42r = etaRangeHelpers::isME42RPCEtaRegion(myGMTREGCand.eta); //if (geta>=1.2 && geta<=1.8) eta_me42 = 1; bool eta_q = (geta > 1.2); @@ -1595,10 +1595,10 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup continue; } - bool eta_me1b = triggerHelpers::isME1bEtaRegion(myGMTREGCand.eta); - bool eta_me1ab = triggerHelpers::isME1abEtaRegion(myGMTREGCand.eta); - bool eta_me1a = triggerHelpers::isME1aEtaRegion(myGMTREGCand.eta); - bool eta_me1b_whole = triggerHelpers::isME1bEtaRegion(myGMTREGCand.eta, 1.6, 2.14); + bool eta_me1b = etaRangeHelpers::isME1bEtaRegion(myGMTREGCand.eta); + bool eta_me1ab = etaRangeHelpers::isME1abEtaRegion(myGMTREGCand.eta); + bool eta_me1a = etaRangeHelpers::isME1aEtaRegion(myGMTREGCand.eta); + bool eta_me1b_whole = etaRangeHelpers::isME1bEtaRegion(myGMTREGCand.eta, 1.6, 2.14); bool eta_no1a = (geta >= 1.2 && geta < 2.14); n_stubs = myGMTREGCand.nTFStubs; @@ -1724,7 +1724,7 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup // else cout<<"null tftrack!"<quality()>=3 && gpt >=40. && triggerHelpers::isME1bEtaRegion(myGMTREGCand.eta) ) { + // if (trk->quality()>=3 && gpt >=40. && etaRangeHelpers::isME1bEtaRegion(myGMTREGCand.eta) ) { // cout<<"highpt csctf in ME1b "<tftrack->print(""); // } @@ -1897,7 +1897,7 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup h_rt_gmt_rpcf_eta->Fill(fabs(myGMTREGCand.eta)); h_rt_gmt_rpcf_bx->Fill(trk->bx()); - bool eta_me42 = triggerHelpers::isME42RPCEtaRegion(myGMTREGCand.eta); + bool eta_me42 = etaRangeHelpers::isME42RPCEtaRegion(myGMTREGCand.eta); //if (fabs(myGMTREGCand.eta)>=1.2 && fabs(myGMTREGCand.eta)<=1.8) eta_me42 = 1; if(eta_me42) h_rt_gmt_rpcf_pt_42->Fill(myGMTREGCand.pt); @@ -2125,13 +2125,13 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup if ( (gmt_csc != NULL && gmt_rpcf != NULL) && !muItr->isMatchedCand() ) cout<<"csc&rpcf but not matched!"<=1.2 && geta<=1.8) eta_me42 = 1; bool eta_q = (geta > 1.2); - bool eta_me1b = triggerHelpers::isME1bEtaRegion(myGMTCand.eta); - //bool eta_me1b_whole = triggerHelpers::isME1bEtaRegion(myGMTCand.eta, 1.6, 2.14); + bool eta_me1b = etaRangeHelpers::isME1bEtaRegion(myGMTCand.eta); + //bool eta_me1b_whole = etaRangeHelpers::isME1bEtaRegion(myGMTCand.eta, 1.6, 2.14); bool eta_no1a = (geta >= 1.2 && geta < 2.14); //bool eta_csc = (geta > 0.9); // diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.h b/SimMuL1/plugins/GEMCSCTriggerRate.h index f3cb99ff525f4..fbcd33210cc57 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.h +++ b/SimMuL1/plugins/GEMCSCTriggerRate.h @@ -201,9 +201,6 @@ class GEMCSCTriggerRate : public edm::EDFilter // calculates the weight of the event to reproduce a min bias //spectrum, from G. Wrochna's note CMSS 1997/096 - bool isME42EtaRegion(float eta); - bool isME42RPCEtaRegion(float eta); - static void setupTFModeHisto(TH1D* h); std::pair intersectionEtaPhi(CSCDetId id, int wg, int hs); diff --git a/SimMuL1/src/EtaRangeHelpers.cc b/SimMuL1/src/EtaRangeHelpers.cc new file mode 100644 index 0000000000000..8caa157f5a86d --- /dev/null +++ b/SimMuL1/src/EtaRangeHelpers.cc @@ -0,0 +1,41 @@ +#include "GEMCode/SimMuL1/interface/EtaRangeHelpers.h" + +#include + +bool +etaRangeHelpers::isME1bEtaRegion(float eta, float eta_min, float eta_max) +{ + return fabs(eta) >= eta_min && fabs(eta) <= eta_max; +} + +bool +etaRangeHelpers::isME1abEtaRegion(float eta, float eta_min) +{ + return fabs(eta) >= eta_min; +} + +bool +etaRangeHelpers::isME1aEtaRegion(float eta, float eta_min) +{ + return fabs(eta) >= eta_min; +} + +bool +etaRangeHelpers::isME42EtaRegion(float eta) +{ + return fabs(eta)>=1.2499 && fabs(eta)<=1.8; +} + +bool +etaRangeHelpers::isME42RPCEtaRegion(float eta) +{ + return fabs(eta)>=1.2499 && fabs(eta)<=1.6; +} + + + + + + + + From 102ef848f4f819a97b511f34382f3bc95875f33b Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 16 Aug 2013 13:42:38 +0200 Subject: [PATCH 091/182] don't use global namespaces + remove the regression stuff --- SimMuL1/plugins/GEMCSCTriggerEfficiency.cc | 840 ++++++++++----------- SimMuL1/plugins/GEMCSCTriggerRate.cc | 324 ++++---- 2 files changed, 563 insertions(+), 601 deletions(-) diff --git a/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc b/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc index e1cbd9f45a811..2fece2d9030de 100644 --- a/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc +++ b/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc @@ -38,61 +38,26 @@ #include "GEMCode/GEMValidation/src/SimTrackMatchManager.h" #include "GEMCode/SimMuL1/interface/EtaRangeHelpers.h" -using namespace std; -using namespace reco; -using namespace edm; - // ================================================================================================ namespace { - void linearRegression(int n, double *xx, double *yy, double &a, double &b) - { - // estimate a and b in y = a + b*x - // http://en.wikipedia.org/wiki/Linear_regression - - double sx=0., sx2=0., sy=0., sxy=0.; - for (int i=0;i("SimHitsFromCrossingFrame", false); - simHitsModuleName_ = iConfig.getUntrackedParameter("SimHitsModuleName", "g4SimHits"); - simHitsCollectionName_ = iConfig.getUntrackedParameter("SimHitsCollectionName","MuonCSCHits"); + simHitsModuleName_ = iConfig.getUntrackedParameter("SimHitsModuleName", "g4SimHits"); + simHitsCollectionName_ = iConfig.getUntrackedParameter("SimHitsCollectionName","MuonCSCHits"); theCSCSimHitMap.setUseCrossingFrame(simHitsFromCrossingFrame_); theCSCSimHitMap.setModuleName(simHitsModuleName_); theCSCSimHitMap.setCollectionName(simHitsCollectionName_); @@ -214,7 +179,7 @@ GEMCSCTriggerEfficiency::GEMCSCTriggerEfficiency(const edm::ParameterSet& iConfi minSimTrackDR_ = iConfig.getUntrackedParameter("minSimTrackDR", 0.); - ParameterSet stripPSet = iConfig.getParameter("strips"); + edm::ParameterSet stripPSet = iConfig.getParameter("strips"); theStripConditions = new CSCDbStripConditions(stripPSet); CSCTFSPset = iConfig.getParameter("SectorProcessor"); @@ -261,7 +226,7 @@ GEMCSCTriggerEfficiency::GEMCSCTriggerEfficiency(const edm::ParameterSet& iConfi // *********************************** HISTOGRAMS ****************************************** - Service fs; + edm::Service fs; int N_ETA_BINS=200; double ETA_START=-2.4999; @@ -488,9 +453,9 @@ GEMCSCTriggerEfficiency::GEMCSCTriggerEfficiency(const edm::ParameterSet& iConfi h_pt_after_tfcand_pt60_ok = fs->make("h_pt_after_tfcand_pt60_ok","h_pt_after_tfcand_pt60_ok",N_PT_BINS, PT_START, PT_END); const int Nthr = 7; - string str_pts[Nthr] = {"", "_pt10", "_pt15", "_pt20", "_pt25", "_pt30","_pt40"}; + std::string str_pts[Nthr] = {"", "_pt10", "_pt15", "_pt20", "_pt25", "_pt30","_pt40"}; for (int i = 0; i < Nthr; ++i) { - string prefix = "h_pt_after_tfcand_eta1b_"; + std::string prefix = "h_pt_after_tfcand_eta1b_"; h_pt_after_tfcand_eta1b_2s[i] = fs->make((prefix + "2s" + str_pts[i]).c_str(), (prefix + "2s" + str_pts[i]).c_str(), N_PT_BINS, PT_START, PT_END); h_pt_after_tfcand_eta1b_2s1b[i] = fs->make((prefix + "2s1b" + str_pts[i]).c_str(), (prefix + "2s1b" + str_pts[i]).c_str(), N_PT_BINS, PT_START, PT_END); h_pt_after_tfcand_eta1b_2s123[i] = fs->make((prefix + "2s123" + str_pts[i]).c_str(), (prefix + "2s123" + str_pts[i]).c_str(), N_PT_BINS, PT_START, PT_END); @@ -546,7 +511,7 @@ GEMCSCTriggerEfficiency::GEMCSCTriggerEfficiency(const edm::ParameterSet& iConfi h_pt_after_gmt_dr_nocsc_pt10 = fs->make("h_pt_after_gmt_dr_nocsc_pt10","h_pt_after_gmt_dr_nocsc_pt10",N_PT_BINS, PT_START, PT_END); for (int i = 0; i < Nthr; ++i) { - string prefix = "h_pt_after_gmt_eta1b_"; + std::string prefix = "h_pt_after_gmt_eta1b_"; h_pt_after_gmt_eta1b_1mu[i] = fs->make((prefix + "1mu" + str_pts[i]).c_str(), (prefix + "1mu" + str_pts[i]).c_str(), N_PT_BINS, PT_START, PT_END); prefix = "h_pt_after_gmt_gem1b_"; h_pt_after_gmt_gem1b_1mu[i] = fs->make((prefix + "1mu" + str_pts[i]).c_str(), (prefix + "1mu" + str_pts[i]).c_str(), N_PT_BINS, PT_START, PT_END); @@ -871,7 +836,7 @@ void GEMCSCTriggerEfficiency::bookDbgTTree() { // see http://cmslxr.fnal.gov/lxr/source/Calibration/IsolatedParticles/plugins/IsolatedTracksCone.cc - Service fs; + edm::Service fs; dbg_tree = fs->make("dbg_tree", "dbg_tree"); dbg_tree->Branch("evtn", &dbg_.evtn, "evtn/I"); dbg_tree->Branch("trkn", &dbg_.trkn, "trkn/I"); @@ -911,11 +876,12 @@ GEMCSCTriggerEfficiency::resetDbg(DbgStruct& d) // ================================================================================================ // ------------ method called to for each event ------------ -bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) +bool +GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) { nevt++; - cout<<" Entry Event "< cscGeom; + edm::ESHandle< CSCGeometry > cscGeom; iSetup.get< MuonGeometryRecord >().get(cscGeom); iSetup.get().get(muonGeometry); @@ -946,80 +912,80 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& // get MC - Handle< GenParticleCollection > hMCCand; + edm::Handle< reco::GenParticleCollection > hMCCand; iEvent.getByLabel("genParticles", hMCCand); - const GenParticleCollection & cands = *(hMCCand.product()); + const reco::GenParticleCollection & cands = *(hMCCand.product()); // get SimTracks - Handle< SimTrackContainer > hSimTracks; + edm::Handle< edm::SimTrackContainer > hSimTracks; iEvent.getByLabel("g4SimHits", hSimTracks); - const SimTrackContainer & simTracks = *(hSimTracks.product()); + const edm::SimTrackContainer & simTracks = *(hSimTracks.product()); // get simVertices - Handle< SimVertexContainer > hSimVertices; - //iEvent.getByType(hSimVertices); + edm::Handle< edm::SimVertexContainer > hSimVertices; + //iEvent.getByType(hSimVertices); iEvent.getByLabel("g4SimHits", hSimVertices); - const SimVertexContainer & simVertices = *(hSimVertices.product()); + const edm::SimVertexContainer & simVertices = *(hSimVertices.product()); // get SimHits theCSCSimHitMap.fill(iEvent); - edm::Handle< PSimHitContainer > MuonCSCHits; + edm::Handle< edm::PSimHitContainer > MuonCSCHits; iEvent.getByLabel("g4SimHits", "MuonCSCHits", MuonCSCHits); - const PSimHitContainer* allCSCSimHits = MuonCSCHits.product(); + const edm::PSimHitContainer* allCSCSimHits = MuonCSCHits.product(); // strip and wire digis - Handle< CSCWireDigiCollection > wireDigis; - Handle< CSCComparatorDigiCollection > compDigis; + edm::Handle< CSCWireDigiCollection > wireDigis; + edm::Handle< CSCComparatorDigiCollection > compDigis; iEvent.getByLabel("simMuonCSCDigis","MuonCSCWireDigi", wireDigis); iEvent.getByLabel("simMuonCSCDigis","MuonCSCComparatorDigi", compDigis); const CSCWireDigiCollection* wiredc = wireDigis.product(); const CSCComparatorDigiCollection* compdc = compDigis.product(); // ALCTs and CLCTs - Handle< CSCALCTDigiCollection > halcts; - Handle< CSCCLCTDigiCollection > hclcts; + edm::Handle< CSCALCTDigiCollection > halcts; + edm::Handle< CSCCLCTDigiCollection > hclcts; iEvent.getByLabel("simCscTriggerPrimitiveDigis", halcts); iEvent.getByLabel("simCscTriggerPrimitiveDigis", hclcts); const CSCALCTDigiCollection* alcts = halcts.product(); const CSCCLCTDigiCollection* clcts = hclcts.product(); // strip&wire matching output after TMB and after MPC sorting - Handle< CSCCorrelatedLCTDigiCollection > lcts_tmb; - Handle< CSCCorrelatedLCTDigiCollection > lcts_mpc; + edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_tmb; + edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_mpc; iEvent.getByLabel("simCscTriggerPrimitiveDigis", lcts_tmb); iEvent.getByLabel("simCscTriggerPrimitiveDigis", "MPCSORTED", lcts_mpc); const CSCCorrelatedLCTDigiCollection* lcts = lcts_tmb.product(); const CSCCorrelatedLCTDigiCollection* mplcts = lcts_mpc.product(); // DT primitives for input to TF -// Handle dttrig; +// edm::Handle dttrig; // iEvent.getByLabel("simDtTriggerPrimitiveDigis", dttrig); // const L1MuDTChambPhContainer* dttrigs = dttrig.product(); // tracks produced by TF - Handle< L1CSCTrackCollection > hl1Tracks; + edm::Handle< L1CSCTrackCollection > hl1Tracks; iEvent.getByLabel("simCsctfTrackDigis",hl1Tracks); const L1CSCTrackCollection* l1Tracks = hl1Tracks.product(); // L1 muon candidates after CSC sorter - Handle< vector< L1MuRegionalCand > > hl1TfCands; + edm::Handle< std::vector< L1MuRegionalCand > > hl1TfCands; iEvent.getByLabel("simCsctfDigis", "CSC", hl1TfCands); - const vector< L1MuRegionalCand > *l1TfCands = hl1TfCands.product(); + const std::vector< L1MuRegionalCand > *l1TfCands = hl1TfCands.product(); // GMT readout collection - Handle< L1MuGMTReadoutCollection > hl1GmtCands; + edm::Handle< L1MuGMTReadoutCollection > hl1GmtCands; if (!lightRun) iEvent.getByLabel("simGmtDigis", hl1GmtCands ) ;// InputTag("simCsctfDigis","CSC") //const L1MuGMTReadoutCollection* l1GmtCands = hl1GmtCands.product(); - vector l1GmtCands; - vector l1GmtfCands; - vector l1GmtCSCCands; - vector l1GmtRPCfCands; - vector l1GmtRPCbCands; - vector l1GmtDTCands; + std::vector l1GmtCands; + std::vector l1GmtfCands; + std::vector l1GmtCSCCands; + std::vector l1GmtRPCfCands; + std::vector l1GmtRPCbCands; + std::vector l1GmtDTCands; // key = BX - map > l1GmtCSCCandsInBXs; + std::map > l1GmtCSCCandsInBXs; // TOCHECK if( !lightRun ) @@ -1038,39 +1004,39 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& else { // Get GMT candidates from all bunch crossings - vector gmt_records = hl1GmtCands->getRecords(); - for ( vector< L1MuGMTReadoutRecord >::const_iterator rItr=gmt_records.begin(); rItr!=gmt_records.end() ; ++rItr ) + std::vector gmt_records = hl1GmtCands->getRecords(); + for ( std::vector< L1MuGMTReadoutRecord >::const_iterator rItr=gmt_records.begin(); rItr!=gmt_records.end() ; ++rItr ) { if (rItr->getBxInEvent() < minBxGMT_ || rItr->getBxInEvent() > maxBxGMT_) continue; - vector GMTCands = rItr->getGMTCands(); - for ( vector::const_iterator cItr = GMTCands.begin() ; cItr != GMTCands.end() ; ++cItr ) + std::vector GMTCands = rItr->getGMTCands(); + for ( std::vector::const_iterator cItr = GMTCands.begin() ; cItr != GMTCands.end() ; ++cItr ) if (!cItr->empty()) l1GmtCands.push_back(*cItr); - vector GMTfCands = rItr->getGMTFwdCands(); - for ( vector::const_iterator cItr = GMTfCands.begin() ; cItr != GMTfCands.end() ; ++cItr ) + std::vector GMTfCands = rItr->getGMTFwdCands(); + for ( std::vector::const_iterator cItr = GMTfCands.begin() ; cItr != GMTfCands.end() ; ++cItr ) if (!cItr->empty()) l1GmtfCands.push_back(*cItr); - //cout<<" ggg: "< CSCCands = rItr->getCSCCands(); + std::vector CSCCands = rItr->getCSCCands(); l1GmtCSCCandsInBXs[rItr->getBxInEvent()] = CSCCands; - for ( vector::const_iterator cItr = CSCCands.begin() ; cItr != CSCCands.end() ; ++cItr ) + for ( std::vector::const_iterator cItr = CSCCands.begin() ; cItr != CSCCands.end() ; ++cItr ) if (!cItr->empty()) l1GmtCSCCands.push_back(*cItr); - vector RPCfCands = rItr->getFwdRPCCands(); - for ( vector::const_iterator cItr = RPCfCands.begin() ; cItr != RPCfCands.end() ; ++cItr ) + std::vector RPCfCands = rItr->getFwdRPCCands(); + for ( std::vector::const_iterator cItr = RPCfCands.begin() ; cItr != RPCfCands.end() ; ++cItr ) if (!cItr->empty()) l1GmtRPCfCands.push_back(*cItr); - vector RPCbCands = rItr->getBrlRPCCands(); - for ( vector::const_iterator cItr = RPCbCands.begin() ; cItr != RPCbCands.end() ; ++cItr ) + std::vector RPCbCands = rItr->getBrlRPCCands(); + for ( std::vector::const_iterator cItr = RPCbCands.begin() ; cItr != RPCbCands.end() ; ++cItr ) if (!cItr->empty()) l1GmtRPCbCands.push_back(*cItr); - vector DTCands = rItr->getDTBXCands(); - for ( vector::const_iterator cItr = DTCands.begin() ; cItr != DTCands.end() ; ++cItr ) + std::vector DTCands = rItr->getDTBXCands(); + for ( std::vector::const_iterator cItr = DTCands.begin() ; cItr != DTCands.end() ; ++cItr ) if (!cItr->empty()) l1GmtDTCands.push_back(*cItr); } - //cout<<" sizes: "< hl1Muons; +// edm::Handle< l1extra::L1MuonParticleCollection > hl1Muons; // const l1extra::L1MuonParticleCollection* l1Muons = 0; // if (!lightRun) { // iEvent.getByLabel("l1extraParticles", hl1Muons); @@ -1113,11 +1079,11 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& // check MC truch loop for ( size_t ic = 0; ic < cands.size(); ic++ ) { - const GenParticle * cand = &(cands[ic]); + const reco::GenParticle * cand = &(cands[ic]); if ( abs(cand->pdgId()) == 13 && cand->status() == 1 ) { - //cout<<" MC MUON!"<eta(); mcphi = normalizedPhi( cand->phi() ); @@ -1130,10 +1096,10 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& if (fabs(mceta)>10) continue; // match with SimTrack - SimTrackContainer::const_iterator matchSimTr = simTracks.end(); + edm::SimTrackContainer::const_iterator matchSimTr = simTracks.end(); double minDeltaRSimTr = 999.; int numberSimTr=0; - for (SimTrackContainer::const_iterator istrk = simTracks.begin(); istrk != simTracks.end(); ++istrk) + for (edm::SimTrackContainer::const_iterator istrk = simTracks.begin(); istrk != simTracks.end(); ++istrk) { if ( abs(istrk->type()) != 13 ) continue; @@ -1162,7 +1128,7 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& h_N_simtr->Fill(numberSimTr); if (matchSimTr == simTracks.end()) { - cout<<"+++ Warning: no matching sim track for MC track!"<1) { deltaR2Tr = deltaR(sim_eta[0],sim_phi[0],sim_eta[1],sim_phi[1]); h_DR_2SimTr->Fill(deltaR2Tr); - if (deltaR2Tr>M_PI && debugALLEVENT) cout<<"PIM_PI && debugALLEVENT) std::cout<<"PI0.01){ @@ -1189,12 +1155,12 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& // debuggin' if (debugALLEVENT) { - cout<<"--- detIDs with hits: "< detIds = theCSCSimHitMap.detsWithHits(); + std::cout<<"--- detIDs with hits: "< detIds = theCSCSimHitMap.detsWithHits(); for (size_t di = 0; di < detIds.size(); di++) { CSCDetId layerId(detIds[di]); - PSimHitContainer hits = theCSCSimHitMap.hits(detIds[di]); - cout<<" "<< detIds[di]<<" "<get(layerId); for (CSCWireDigiCollection::const_iterator digiIt = rwired.first; digiIt != rwired.second; ++digiIt) { @@ -1217,10 +1183,10 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& LocalPoint digiLP = layerGeom->localCenterOfWireGroup(wiregroup); // x==0 GlobalPoint digiGP = csclayer->toGlobal(digiLP); double eta = digiGP.eta(); - cout <<" " << eta <<" "<< (*digiIt)<get(layerId); for (CSCComparatorDigiCollection::const_iterator digiIt = rcompd.first; digiIt != rcompd.second; ++digiIt) { @@ -1230,17 +1196,17 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& LocalPoint digiLP = layerGeom->topology()->localPosition(strip-0.5); GlobalPoint digiGP = csclayer->toGlobal(digiLP); double phi = normalizedPhi ( digiGP.phi() ); - cout <<" " << phi <<" strip/comparator/time ="<< (*digiIt)<begin(); // cdetUnitIt != alcts->end(); cdetUnitIt++) // { @@ -1250,12 +1216,12 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& // for (CSCALCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) // { // noALCTs++; - // if (debugALLEVENT) cout<<" * raw ID "<Fill( getCSCType( id ), noALCTs); // } - // if (debugALLEVENT) cout<<"--- ALL CLCTs ---"<begin(); // cdetUnitIt != clcts->end(); cdetUnitIt++) // { @@ -1265,7 +1231,7 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& // for (CSCCLCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) // { // noCLCTs++; - // if (debugALLEVENT) cout<<" * raw ID "<Fill( getCSCType( id ), noCLCTs); // } @@ -1275,17 +1241,17 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& // find primary vertex index and fill trkId2Index association: - if (debugALLEVENT) cout<<"--- SIMTRACKS: "<trackId()<<" "<<*istrk<trackId()<<" "<<*istrk<noVertex()) ) primaryVert = istrk->vertIndex(); trkId2Index[istrk->trackId()] = no; no++; } if ( primaryVert == -1 ) { - if (debugALLEVENT) cout<<" Warning: NO PRIMARY SIMVERTEX!"<0) return 0; } @@ -1293,27 +1259,27 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& // main loop over muon SimTracks: int numberSimTr=0; - for (SimTrackContainer::const_iterator istrk = simTracks.begin(); istrk != simTracks.end(); ++istrk) + for (edm::SimTrackContainer::const_iterator istrk = simTracks.begin(); istrk != simTracks.end(); ++istrk) { if ( !( abs(istrk->type()) == 13 && istrk->vertIndex() == primaryVert ) ) continue; stpt = sqrt(istrk->momentum().perp2()); if (stpt < minSimTrPt_ ) { - if (debugALLEVENT) cout<<" - rejected mu SimTrack: with low pt = "<trackId()<<" "<simHits.size()<ALCTs.size() <<" nCLCT: "<CLCTs.size() <<" nLCT: "<LCTs.size() <<" nMPLCT: "<MPLCTs.size() <<" TFTRACKs/All: "<TFTRACKs.size()<<"/"<TFTRACKsAll.size()<<" TFCANDs/All: "<TFCANDs.size()<<"/"<TFCANDsAll.size()<<" GMTREGs/All: "<GMTREGCANDs.size()<<"/"<GMTREGCANDsAll.size()<<" GMTRegBest:"<<(match->GMTREGCANDBest.l1reg != NULL)<<" GMTs/All: "<GMTCANDs.size()<<"/"<GMTCANDsAll.size()<<" GMTBest:"<<(match->GMTCANDBest.l1gmt != NULL)<<" L1EXTRAs/All: "<L1EXTRAs.size()<<"/"<L1EXTRAsAll.size()<<" L1EXTRABest:"<<(match->L1EXTRABest.l1extra != NULL)<trackId()<<" "<simHits.size()<ALCTs.size() <<" nCLCT: "<CLCTs.size() <<" nLCT: "<LCTs.size() <<" nMPLCT: "<MPLCTs.size() <<" TFTRACKs/All: "<TFTRACKs.size()<<"/"<TFTRACKsAll.size()<<" TFCANDs/All: "<TFCANDs.size()<<"/"<TFCANDsAll.size()<<" GMTREGs/All: "<GMTREGCANDs.size()<<"/"<GMTREGCANDsAll.size()<<" GMTRegBest:"<<(match->GMTREGCANDBest.l1reg != NULL)<<" GMTs/All: "<GMTCANDs.size()<<"/"<GMTCANDsAll.size()<<" GMTBest:"<<(match->GMTCANDBest.l1gmt != NULL)<<" L1EXTRAs/All: "<L1EXTRAs.size()<<"/"<L1EXTRAsAll.size()<<" L1EXTRABest:"<<(match->L1EXTRABest.l1extra != NULL)< ch_vecs[5]; - set ch_sets[5]; + std::vector ch_vecs[5]; + std::set ch_sets[5]; unsigned int im=0; for (; imchambersWithHits(); ch_sets[im].insert(ch_vecs[im].begin(), ch_vecs[im].end()); } - set ch_overlap; + std::set ch_overlap; if (im>1) set_intersection(ch_sets[0].begin(), ch_sets[0].end(), ch_sets[1].begin(), ch_sets[1].end(), - inserter(ch_overlap, ch_overlap.begin()) ); + std::inserter(ch_overlap, ch_overlap.begin()) ); if (debugALLEVENT) { - cout<<"Number of overlapping chambers = "<::iterator ich = ch_overlap.begin(); ich!= ch_overlap.end(); ich++) { + std::cout<<" in stations "; + for (std::set::iterator ich = ch_overlap.begin(); ich!= ch_overlap.end(); ich++) { CSCDetId chId (*ich); - cout< > detALCT; + std::map > detALCT; detALCT.clear(); for (CSCALCTDigiCollection::DigiRangeIterator adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); adetUnitIt++) { @@ -1412,7 +1378,7 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& } } // loop CSCALCTDigiCollection - map > detCLCT; + std::map > detCLCT; detCLCT.clear(); for (CSCCLCTDigiCollection::DigiRangeIterator cdetUnitIt = clcts->begin(); cdetUnitIt != clcts->end(); cdetUnitIt++) { @@ -1425,7 +1391,7 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& } } // loop CSCCLCTDigiCollection - map > detMPLCT; + std::map > detMPLCT; detMPLCT.clear(); for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator detUnitIt = mplcts->begin(); detUnitIt != mplcts->end(); detUnitIt++) { @@ -1445,7 +1411,7 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& for (unsigned int im=0; im rMPLCTs = match->MPLCTsInReadOut(); + std::vector rMPLCTs = match->MPLCTsInReadOut(); if (rMPLCTs.size()) { // count matched - set mpcStations; + std::set mpcStations; for (unsigned i=0; iTFCANDs.size() && pt_ok && fabs(steta) >= 1.65 && fabs(steta) <= 2.05) { - if (debugINHISTOS && tfc->pt < 7.99 ) cout<<" FAILS_TPT8!"<pt < 7.99 ) std::cout<<" FAILS_TPT8!"<pt >= 7.99) nokeey = 1; else nokeey = -1; @@ -1622,8 +1588,8 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& if (eta_1b) h_pt_initial_1b->Fill(stpt); if (eta_gem_1b) h_pt_initial_gem_1b->Fill(stpt); - vector chIds = match->chambersWithHits(); - vector fillIds; + std::vector chIds = match->chambersWithHits(); + std::vector fillIds; if (pt_ok) for (size_t ch = 0; ch < chIds.size(); ch++) { CSCDetId chId(chIds[ch]); @@ -1655,7 +1621,7 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& //const CSCStubMatcher& match_lct = gemcsc_match.cscStubs(); int match_has_gem = 0; - vector match_gem_chambers; + std::vector match_gem_chambers; auto gem_superch_ids = match_gem.superChamberIds(); for(auto d: gem_superch_ids) { @@ -1675,10 +1641,10 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& //============ ALCTs ================== - if (debugINHISTOS) cerr<<" check: on to ALCT "< ME1ALCTsOk; + if (debugINHISTOS) std::cerr<<" check: on to ALCT "< ME1ALCTsOk; bool hasME1alct = 0; - vector rALCTs = match->ALCTsInReadOut(); + std::vector rALCTs = match->ALCTsInReadOut(); if (rALCTs.size()) { if (eta_ok) h_pt_after_alct->Fill(stpt); @@ -1700,7 +1666,7 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& h_bx__alctOk_cscdet[ csct ]->Fill( bx ); h_bxf__alctOk_cscdet[ csct ]->Fill( bxf ); if (debugINHISTOS && bx<-1) { // method to dumpwire digis in case there is out of time alcts - cout<<" OOW good ALCT: "<<*(rALCTs[i].trgdigi)<Fill( minbx[i] ); - vector chIDs = match->chambersWithALCTs(); + std::vector chIDs = match->chambersWithALCTs(); if (pt_ok) h_n_ch_w_alct->Fill(chIDs.size()); if (pt_ok) for (size_t ch = 0; ch < chIDs.size(); ch++) { - vector chalcts = match->chamberALCTs(chIDs[ch]); + std::vector chalcts = match->chamberALCTs(chIDs[ch]); CSCDetId chId(chIDs[ch]); int csct = getCSCType( chId ); MatchCSCMuL1::ALCT *bestALCT = match->bestALCT( chId ); - if (bestALCT==0) cout<<"STRANGE: no best ALCT in chamber with ALCTs"<deltaOk) { h_bx__alctOkBest_cscdet[ csct ]->Fill( bestALCT->getBX() - 6 ); // useful histogram h_wg_vs_bx__alctOkBest_cscdet[ csct ]->Fill( match->wireGroupAndStripInChamber(chIDs[ch]).first, bestALCT->getBX() - 6); @@ -1735,16 +1701,16 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& { if (rALCTs[i].id.station() == 1) { - if (debugINHISTOS) cout<<" ALCT check: station "<<1<Fill(steta); - vector chIDs = match->chambersWithALCTs(); + std::vector chIDs = match->chambersWithALCTs(); for (size_t ch = 0; ch < chIDs.size(); ch++) { CSCDetId chId(chIDs[ch]); @@ -1787,7 +1753,7 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& // { // CSCDetId chId(chIds[ch]); // if (getCSCType( chId )==3) { - // cout<<" no good ME1a okME1alct="< ME1CLCTsOk; + if (debugINHISTOS) std::cerr<<" check: on to CLCT "< ME1CLCTsOk; bool hasME1clct = 0; - vector rCLCTs = match->CLCTsInReadOut(); + std::vector rCLCTs = match->CLCTsInReadOut(); if (rCLCTs.size()) { if (eta_ok) h_pt_after_clct->Fill(stpt); @@ -1809,16 +1775,16 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& if (etapt_ok) h_phi_after_clct->Fill(stphi); - vector chIDs = match->chambersWithCLCTs(); + std::vector chIDs = match->chambersWithCLCTs(); if (pt_ok) h_n_ch_w_clct->Fill(chIDs.size()); if (pt_ok) for (size_t ch = 0; ch < chIDs.size(); ch++) { - vector chcltcs = match->chamberCLCTs(chIDs[ch]); + std::vector chcltcs = match->chamberCLCTs(chIDs[ch]); CSCDetId chId(chIDs[ch]); int csct = getCSCType( chId ); MatchCSCMuL1::CLCT *bestCLCT = match->bestCLCT( chId ); - if (bestCLCT==0) cout<<"STRANGE: no best CLCT in chamber with CLCTs"<deltaOk) { h_bx__clctOkBest_cscdet[ csct ]->Fill( bestCLCT->trgdigi->getBX() - 6 ); // keep this but drop what is not related to this } @@ -1829,15 +1795,15 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& { if (rCLCTs[i].id.station() == 1) { - if (debugINHISTOS) cout<<" CLCT check: station "<<1< chIDs = match->chambersWithALCTs(); + std::vector chIDs = match->chambersWithALCTs(); for (size_t ch = 0; ch < chIDs.size(); ch++) { CSCDetId chId(chIDs[ch]); @@ -1890,7 +1856,7 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& // for (CSCCLCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) // { // if (!(*digiIt).isValid()) continue; - // cout<<" goodclct!!! "< ME1LCTsOk; - vector rLCTs = match->LCTsInReadOut(); + if (debugINHISTOS) std::cerr<<" check: on to LCT "< ME1LCTsOk; + std::vector rLCTs = match->LCTsInReadOut(); if (rLCTs.size()) { if (eta_ok) h_pt_after_lct->Fill(stpt); if (pt_ok) h_eta_after_lct->Fill(steta); if (etapt_ok) h_phi_after_lct->Fill(stphi); - vector chIDs = match->chambersWithLCTs(); + std::vector chIDs = match->chambersWithLCTs(); if (pt_ok) h_n_ch_w_lct->Fill(chIDs.size()); bool okME1lct = 0, okME1alct=0, okME1alctclct=0, okME1clct=0, okME1clctalct=0; - vector ME1LCTsOkCLCTNo, ME1LCTsOkCLCTOkALCTNo; + std::vector ME1LCTsOkCLCTNo, ME1LCTsOkCLCTOkALCTNo; if (pt_ok) for (unsigned i=0; ideltaOk) { - if (debugINHISTOS) cout<<" LCT check: alct-clct good "<<1<deltaOk) { okME1clct = 1; - if (debugINHISTOS) cout<<" LCT check: clct good "<<1<deltaOk) { - if (debugINHISTOS) cout<<" LCT check: clct-alct good "<<1<Fill(steta); - vector chIDs = match->chambersWithLCTs(); + std::vector chIDs = match->chambersWithLCTs(); for (size_t ch = 0; ch < chIDs.size(); ch++) { CSCDetId chId(chIDs[ch]); @@ -1972,7 +1938,7 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& } } if(okME1clctalct) h_eta_me1_after_lct_okClctAlct->Fill(steta); - if (debugINHISTOS) cout<<" LCT check: histo filled "<<1<Fill( ME1ALCTsOk[a].getBX(), // ME1ALCTsOk[a].getBX() - ME1CLCTsOk[c].getBX()); // if (debugINHISTOS) { - // cout<<"Correct ALCT&CLCT but no good LCT"<0 ) // { // if (debugINHISTOS) { - // cout<<"Correct LCT but no good ALCT&CLCT"<print("all STUFF",1,1,1,1,1,0); // } // } @@ -2028,12 +1994,12 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& //, nsimh_per_st_good[4]={0}; - vector ME1MPLCTsOk; - //vector ME1MPLCTs2Ok; + std::vector ME1MPLCTsOk; + //std::vector ME1MPLCTs2Ok; if (rMPLCTs.size()) { // count matched - set mpcStations; + std::set mpcStations; for (unsigned i=0; iTFCANDs.size()) { - if (tfc==NULL) cout<<" ALARM: tfc==NULL !!!"<tftrack->pt; unsigned ntf_stubs = tfc->tftrack->nStubs(); @@ -2115,7 +2081,7 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& h_tfdr->Fill(tfc->dr); // count matched - set tfStations; + std::set tfStations; for (unsigned i=0; i< tfc->tftrack->mplcts.size(); i++) { if ( !((tfc->tftrack->mplcts)[i]->deltaOk) ) continue; @@ -2436,7 +2402,7 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& if (match->TFCANDsAll.size()) { - if (tfcAll==NULL) cout<<" ALARM: tfcAll==NULL !!!"<Fill(stpt); @@ -2466,7 +2432,7 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& if (!lightRun) gmtrc = match->bestGMTREGCAND(match->GMTREGCANDs, bestPtMatch_); if (match->GMTREGCANDs.size()) { - if (gmtrc==NULL) cout<<" ALARM: gmtrc==NULL !!!"<Fill(stpt); if (eta_ok && gmtrc->pt>=10.) h_pt_after_gmtreg_pt10->Fill(stpt); if (pt_ok) h_eta_after_gmtreg->Fill(steta); @@ -2477,7 +2443,7 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& if (!lightRun) gmtrca = match->bestGMTREGCAND(match->GMTREGCANDsAll, bestPtMatch_); if (match->GMTREGCANDsAll.size()) { - if (gmtrca==NULL) cout<<" ALARM: gmtrca==NULL !!!"<Fill(stpt); if (eta_ok && gmtrca->pt>=10.) h_pt_after_gmtreg_all_pt10->Fill(stpt); if (pt_ok) h_eta_after_gmtreg_all->Fill(steta); @@ -2499,7 +2465,7 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& if (!lightRun) gmtc = match->bestGMTCAND(match->GMTCANDs, bestPtMatch_); if (match->GMTCANDs.size()) { - if (gmtc==NULL) cout<<" ALARM: gmtc==NULL !!!"<Fill(gmtc->pt); h_gmtphi->Fill(gmtc->phi); @@ -2545,7 +2511,7 @@ bool GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& if (!lightRun) gmtca = match->bestGMTCAND(match->GMTCANDsAll, bestPtMatch_); if (match->GMTCANDsAll.size()) { - if (gmtca==NULL) cout<<" ALARM: gmtca==NULL !!!"<Fill(stpt); if (eta_ok && gmtca->pt>=10.) h_pt_after_gmt_all_pt10->Fill(stpt); if (pt_ok) h_eta_after_gmt_all->Fill(steta); @@ -2690,9 +2656,9 @@ GEMCSCTriggerEfficiency::propagateToCSCStations(MatchCSCMuL1 *match) // ================================================================================================ void GEMCSCTriggerEfficiency::matchSimTrack2SimHits( MatchCSCMuL1 * match, - const SimTrackContainer & simTracks, - const SimVertexContainer & simVertices, - const PSimHitContainer * allCSCSimHits ) + const edm::SimTrackContainer & simTracks, + const edm::SimVertexContainer & simVertices, + const edm::PSimHitContainer * allCSCSimHits ) { // Matching of SimHits that were created by SimTrack @@ -2700,7 +2666,7 @@ GEMCSCTriggerEfficiency::matchSimTrack2SimHits( MatchCSCMuL1 * match, match->familyIds = fillSimTrackFamilyIds(match->strk->trackId(), simTracks, simVertices); // match SimHits to SimTracks - vector matchingSimHits = hitsFromSimTrack(match->familyIds, theCSCSimHitMap); + std::vector matchingSimHits = hitsFromSimTrack(match->familyIds, theCSCSimHitMap); for (unsigned i=0; iisInBadChamber( CSCDetId( matchingSimHits[i].detUnitId() ) ) ) continue; // skip 'bad' chamber @@ -2718,20 +2684,20 @@ GEMCSCTriggerEfficiency::matchSimTrack2SimHits( MatchCSCMuL1 * match, } if (doStrictSimHitToTrackMatch_ && stNhist != match->simHits.size()) { - cout <<" ALARM!!! matchSimTrack2SimHits: stNhist != stHits.size() ---> "< "<momentumAtEntry()<<" "<energyLoss()<<" "<particleType()<<" "<trackId()<momentumAtEntry()<<" "<energyLoss()<<" "<particleType()<<" "<trackId()<simHits.size()<simHits.size()<simHits.size(); j++) { PSimHit & sh = (match->simHits)[j]; - cout<<" "<strk->trackId()<strk->trackId()< > checkNALCT; + std::map > checkNALCT; checkNALCT.clear(); match->ALCTs.clear(); @@ -2775,25 +2741,25 @@ GEMCSCTriggerEfficiency::matchSimTrack2ALCTs(MatchCSCMuL1 *match, bool me1a_all = (defaultME1a && id.station()==1 && id.ring()==1 && (*digiIt).getKeyWG() <= 15); bool me1a_no_overlap = ( me1a_all && (*digiIt).getKeyWG() < 10 ); - vector trackHitsInChamber = match->chamberHits(id.rawId()); - vector trackHitsInChamber1a; + std::vector trackHitsInChamber = match->chamberHits(id.rawId()); + std::vector trackHitsInChamber1a; if (me1a_all) trackHitsInChamber1a = match->chamberHits(id1a.rawId()); if (trackHitsInChamber.size() + trackHitsInChamber1a.size() == 0 ) // no point to do any matching here { - if (debugALCT) cout<<"raw ID "< maxBX_ ) { - if (debugALCT) cout<<"discarding BX = "<< (*digiIt).getBX()-6 < match!"< match!"<ALCTs.push_back(malct); dymatch = true; @@ -2890,9 +2856,9 @@ GEMCSCTriggerEfficiency::matchSimTrack2ALCTs(MatchCSCMuL1 *match, if ( minDeltaYAnode_ < 0 ) { if (debugALCT) for (unsigned i=0; iALCTs.push_back(malct); if (me1a_all) match->ALCTs.push_back(malct1a); @@ -2905,39 +2871,39 @@ GEMCSCTriggerEfficiency::matchSimTrack2ALCTs(MatchCSCMuL1 *match, if (minNHitsShared_>=0) { if (!me1a_no_overlap && malct.nHitsShared >= minNHitsShared_) { - if (debugALCT) cout<<" --> shared hits match!"< shared hits match!"<ALCTs.push_back(malct); } if (me1a_all && malct1a.nHitsShared >= minNHitsShared_) { - if (debugALCT) cout<<" --> shared hits match!"< shared hits match!"<ALCTs.push_back(malct); } } // else proceed with deltaWire matching: if (!me1a_no_overlap && minDeltaWire_ <= malct.deltaWire && malct.deltaWire <= maxDeltaWire_){ - if (debugALCT) cout<<" --> deltaWire match!"< deltaWire match!"<ALCTs.push_back(malct); } // special case of default emulator with puts all ME11 alcts into ME1b // only for deltaWire matching! if (me1a_all && minDeltaWire_ <= malct1a.deltaWire && malct1a.deltaWire <= maxDeltaWire_){ - if (debugALCT) cout<<" --> deltaWire match!"< deltaWire match!"<ALCTs.push_back(malct); } } //debugALCT=0; } // loop CSCALCTDigiCollection - if (debugALCT) for(map >::const_iterator mapItr = checkNALCT.begin(); mapItr != checkNALCT.end(); ++mapItr) + if (debugALCT) for(std::map >::const_iterator mapItr = checkNALCT.begin(); mapItr != checkNALCT.end(); ++mapItr) if (mapItr->second.size()>2) { CSCDetId idd(mapItr->first); - cout<<"~~~~ checkNALCT WARNING! nALCT = "<second.size()<<" in ch "<< mapItr->first<<" "<second.size();i++) cout<<"~~~~~~ ALCT "<second)[i]<first<<" "<second.size();i++) std::cout<<"~~~~~~ ALCT "<second)[i]<strk->trackId()<strk->trackId()< > checkNCLCT; + std::map > checkNCLCT; checkNCLCT.clear(); match->CLCTs.clear(); @@ -2984,25 +2950,25 @@ GEMCSCTriggerEfficiency::matchSimTrack2CLCTs(MatchCSCMuL1 *match, cid = id1a; } - vector trackHitsInChamber = match->chamberHits(cid.rawId()); + std::vector trackHitsInChamber = match->chamberHits(cid.rawId()); if (trackHitsInChamber.size()==0) // no point to do any matching here { - if (debugCLCT) cout<<"raw ID "< maxBX_ ) { - if (debugCLCT) cout<<"discarding BX = "<< (*digiIt).getBX()-6 < match!"< match!"<CLCTs.push_back(mclct); continue; @@ -3059,9 +3025,9 @@ GEMCSCTriggerEfficiency::matchSimTrack2CLCTs(MatchCSCMuL1 *match, if ( minDeltaYCathode_ < 0 ) { if (debugCLCT) for (unsigned i=0; iCLCTs.push_back(mclct); continue; @@ -3071,7 +3037,7 @@ GEMCSCTriggerEfficiency::matchSimTrack2CLCTs(MatchCSCMuL1 *match, // else proceed with hit2hit matching: if (mclct.nHitsShared >= minNHitsShared_) { - if (debugCLCT) cout<<" --> shared hits match!"< shared hits match!"<CLCTs.push_back(mclct); } @@ -3079,14 +3045,14 @@ GEMCSCTriggerEfficiency::matchSimTrack2CLCTs(MatchCSCMuL1 *match, if (minNHitsShared_>=0) { if (mclct.nHitsShared >= minNHitsShared_) { - if (debugCLCT) cout<<" --> shared hits match!"< shared hits match!"<CLCTs.push_back(mclct); } } // else proceed with deltaStrip matching: if (abs(mclct.deltaStrip) <= minDeltaStrip_) { - if (debugCLCT) cout<<" --> deltaStrip match!"< deltaStrip match!"<CLCTs.push_back(mclct); } } @@ -3094,14 +3060,14 @@ GEMCSCTriggerEfficiency::matchSimTrack2CLCTs(MatchCSCMuL1 *match, } // loop CSCCLCTDigiCollection - if (debugCLCT) for(map >::const_iterator mapItr = checkNCLCT.begin(); mapItr != checkNCLCT.end(); ++mapItr) + if (debugCLCT) for(std::map >::const_iterator mapItr = checkNCLCT.begin(); mapItr != checkNCLCT.end(); ++mapItr) if (mapItr->second.size()>2) { CSCDetId idd(mapItr->first); - cout<<"~~~~ checkNCLCT WARNING! nCLCT = "<second.size()<<" in ch "<< mapItr->first<<" "<second.size();i++) cout<<"~~~~~~ CLCT "<second)[i]<first<<" "<second.size();i++) std::cout<<"~~~~~~ CLCT "<second)[i]<LCTs.clear(); @@ -3135,13 +3101,13 @@ GEMCSCTriggerEfficiency::matchSimTrack2LCTs(MatchCSCMuL1 *match, cid = id1a; } - if (debugLCT) cout<< "----- LCT in raw ID "< maxTMBBX_ ) { - if (debugLCT) cout<<"discarding BX = "<< (*digiIt).getBX()-6 <ALCTs)[i].id<<" "<<*((match->ALCTs)[i].trgdigi) <ALCTs)[i].id<<" "<<*((match->ALCTs)[i].trgdigi) <ALCTs)[i]); nmalct++; } - if (nmalct>1) cout<<"+++ ALARM in LCT: number of matching ALCTs is more than one: "<1) std::cout<<"+++ ALARM in LCT: number of matching ALCTs is more than one: "< vmclct; + std::vector vmclct; if ( clct_valid ) { for (unsigned i=0; i< match->CLCTs.size(); i++) @@ -3182,13 +3148,13 @@ GEMCSCTriggerEfficiency::matchSimTrack2LCTs(MatchCSCMuL1 *match, //(*digiIt).getCLCTPattern() == (match->CLCTs)[i].trgdigi->getPattern() ) (*digiIt).getPattern() == (match->CLCTs)[i].trgdigi->getPattern() ) { - if (debugLCT) cout<< " ----- CLCT matches LCT: "<<(match->CLCTs)[i].id<<" "<<*((match->CLCTs)[i].trgdigi) <CLCTs)[i].id<<" "<<*((match->CLCTs)[i].trgdigi) <CLCTs)[i]); vmclct.push_back(mclct); nmclct++; } if (nmclct>1) { - cout<<"+++ ALARM in LCT: number of matching CLCTs is more than one: "<getBX() LCT matches ALCT & CLCT "< LCT matches ALCT & CLCT "<LCTs.push_back(mlct); - // if (debugLCT) cout<< " ------------> LCT matches ALCT only"< LCT matches ALCT only"<LCTs.push_back(mlct); - if (debugLCT) cout<< " ------------> LCT matches CLCT only"< LCT matches CLCT only"< ghosts; + std::vector ghosts; if (addGhostLCTs_) { - vector chIDs = match->chambersWithLCTs(); + std::vector chIDs = match->chambersWithLCTs(); for (size_t ch = 0; ch < chIDs.size(); ch++) { - vector chlcts = match->chamberLCTs(chIDs[ch]); + std::vector chlcts = match->chamberLCTs(chIDs[ch]); if (chlcts.size()<2) continue; - if (debugLCT) cout<<"Ghost LCT combinatorics: "< > bxlcts; + if (debugLCT) std::cout<<"Ghost LCT combinatorics: "< > bxlcts; for (size_t t=0; t < chlcts.size(); t++) { int bx=chlcts[t].getBX(); bxlcts[bx].push_back(chlcts[t]); - if (bxlcts[bx].size() > 2 ) cout<<" Huh!?? "<<" n["< 2 ) std::cout<<" Huh!?? "<<" n["<trgdigi->getKeyWG() == lt[1].alct->trgdigi->getKeyWG() ); bool sameCLCT = ( lt[0].clct->trgdigi->getKeyStrip() == lt[1].clct->trgdigi->getKeyStrip() ); if (debugLCT) { - cout<<" n["<trgdigi),*(lt[1].clct->trgdigi)); q[1]=findQuality(*(lt[1].alct->trgdigi),*(lt[0].clct->trgdigi)); - if (debugLCT) cout<<" q0="<LCTs.insert( match->LCTs.end(), ghosts.begin(), ghosts.end()); } - if (debugLCT) cout<<"--- valid LCTs "<MPLCTs.clear(); @@ -3354,13 +3320,13 @@ GEMCSCTriggerEfficiency::matchSimTrack2MPLCTs(MatchCSCMuL1 *match, cid = id1a; } - if (debugMPLCT) cout<< "----- MPLCT in raw ID "< maxTMBBX_ ) { - if (debugMPLCT) cout<<"discarding BX = "<< (*digiIt).getBX()-6 < matched to corresponding LCT"< matched to corresponding LCT"<1) cout<<"+++ Warning in MPLCT: number of matching LCTs is more than one: "<1) std::cout<<"+++ Warning in MPLCT: number of matching LCTs is more than one: "< ghosts; + std::vector ghosts; if (addGhostLCTs_) { - vector chIDs = match->chambersWithMPLCTs(); + std::vector chIDs = match->chambersWithMPLCTs(); for (size_t ch = 0; ch < chIDs.size(); ch++) { - vector chmplcts = match->chamberMPLCTs(chIDs[ch]); + std::vector chmplcts = match->chamberMPLCTs(chIDs[ch]); if (chmplcts.size()<2) continue; - if (debugMPLCT) cout<<"Ghost MPLCT combinatorics: "< > bxmplcts; + if (debugMPLCT) std::cout<<"Ghost MPLCT combinatorics: "< > bxmplcts; for (size_t t=0; t < chmplcts.size(); t++) { int bx=chmplcts[t].getBX(); bxmplcts[bx].push_back(chmplcts[t]); - if (bxmplcts[bx].size() > 2 ) cout<<" Huh!?? mpc "<<" n["< 2 ) std::cout<<" Huh!?? mpc "<<" n["< chlcts = match->chamberLCTsp(chIDs[ch]); - if (debugMPLCT) cout<<" n["<trgdigi); + if (debugMPLCT) std::cout<<" ghost added: "<<*(chlcts[tc]->trgdigi); } } } @@ -3465,8 +3431,8 @@ GEMCSCTriggerEfficiency::matchSimTrack2MPLCTs(MatchCSCMuL1 *match, unsigned cscid = CSCTriggerNumbering::triggerCscIdFromLabels(mplct.id); unsigned cscid_special = cscid; if (mplct.id.station()==1 && mplct.id.ring()==4) cscid_special = cscid + 9; - //cout<<" id="<TFTRACKs.clear(); for ( L1CSCTrackCollection::const_iterator trk = l1Tracks->begin(); trk != l1Tracks->end(); trk++) @@ -3505,7 +3471,7 @@ GEMCSCTriggerEfficiency::matchSimtrack2TFTRACKs( MatchCSCMuL1 *match, /* if ( trk->first.bx() < minBX_ || trk->first.bx() > maxBX_ ) { - if (debugTFTRACK) cout<<"discarding BX = "<< trk->first.bx() <etaValue()<<"/"<phiValue()<<" ptValue "<ptValue()<etaValue()<<"/"<phiValue()<<" ptValue "<ptValue()<second.begin(); detUnitIt != trk->second.end(); detUnitIt++) @@ -3533,7 +3499,7 @@ GEMCSCTriggerEfficiency::matchSimtrack2TFTRACKs( MatchCSCMuL1 *match, const CSCCorrelatedLCTDigiCollection::Range& range = (*detUnitIt).second; for (CSCCorrelatedLCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) { - if (!((*digiIt).isValid())) cout<<"ALARM!!! matchSimtrack2TFTRACKs: L1CSCTrack.MPLCT is not valid id="< 127); if (me1a_case){ @@ -3541,7 +3507,7 @@ GEMCSCTriggerEfficiency::matchSimtrack2TFTRACKs( MatchCSCMuL1 *match, cid = id1a; } - if (debugTFTRACK) cout<< "------- L1CSCTrack.MPLCT in raw ID "< matched to MPLCTs["< matched to MPLCTs["<MPLCTs.size(); i++) { MatchCSCMuL1::MPLCT & mplct = match->MPLCTs[i]; - if (mplct.deltaOk) cout<<" "< &muScales, edm::ESHandle< L1MuTriggerPtScale > &muPtScale, - const vector< L1MuRegionalCand > *l1TfCands) + const std::vector< L1MuRegionalCand > *l1TfCands) { - if (debugTFCAND) cout<<"--- TFCAND ---- begin"<::const_iterator trk = l1TfCands->begin(); trk != l1TfCands->end(); trk++) + if (debugTFCAND) std::cout<<"--- TFCAND ---- begin"<::const_iterator trk = l1TfCands->begin(); trk != l1TfCands->end(); trk++) { /* if ( trk->bx() < minBX_ || trk->bx() > maxBX_ ) { - if (debugTFCAND) cout<<"discarding BX = "<< trk->bx() <eta_packed()<<"/"<phi_packed()<<" eta="<etaValue()<<"/"<phiValue()<<" ptValue "<ptValue()<eta_packed()<<"/"<phi_packed()<<" eta="<etaValue()<<"/"<phiValue()<<" ptValue "<ptValue()<TFTRACKs.size(); i++) { - //if (debugTFCAND) cout<< "------- l1t packed eta phi: "<phi_packed() != (match->TFTRACKs[i]).phi_packed || trk->pt_packed() != (match->TFTRACKs[i]).pt_packed || @@ -3643,15 +3609,15 @@ GEMCSCTriggerEfficiency::matchSimtrack2TFCANDs( MatchCSCMuL1 *match, mtfcand.tftrack = &(match->TFTRACKs[i]); mtfcand.ids = match->TFTRACKs[i].ids; - if (debugTFCAND) cout<< "---------> matched to TFTRACKs["< matched to TFTRACKs["<TFCANDsAll.push_back(mtfcand); if (mtfcand.tftrack != NULL) match->TFCANDs.push_back(mtfcand); - //else if (debugTFCAND) cout<<"----- Warning!!! NO TFTRACKs found for this L1MuRegionalCand"< &muScales, edm::ESHandle< L1MuTriggerPtScale > &muPtScale, - const vector< L1MuGMTExtendedCand> &l1GmtCands, - const vector &l1GmtCSCCands, - const map > &l1GmtCSCCandsInBXs) + const std::vector< L1MuGMTExtendedCand> &l1GmtCands, + const std::vector &l1GmtCSCCands, + const std::map > &l1GmtCSCCandsInBXs) { - if (debugGMTCAND) cout<<"--- GMTREGCAND ---- begin"<::const_iterator trk = l1GmtCSCCands.begin(); trk != l1GmtCSCCands.end(); trk++) + for ( std::vector::const_iterator trk = l1GmtCSCCands.begin(); trk != l1GmtCSCCands.end(); trk++) { /* if ( trk->bx() < minBX_ || trk->bx() > maxBX_ ) { - if (debugGMTCAND) cout<<"discarding BX = "<< trk->bx() <pt_packed()<<" eta="<etaValue()<<"/"<phiValue()<<" ptValue "<ptValue()<pt_packed()<<" eta="<etaValue()<<"/"<phiValue()<<" ptValue "<ptValue()<TFCANDs.size(); i++) @@ -3696,7 +3662,7 @@ GEMCSCTriggerEfficiency::matchSimtrack2GMTCANDs( MatchCSCMuL1 *match, mcand.tfcand = &(match->TFCANDs[i]); mcand.ids = match->TFCANDs[i].ids; - if (debugGMTCAND) cout<< "---------> matched to TFCANDs["< matched to TFCANDs["<GMTREGCANDs.push_back(mcand); @@ -3709,7 +3675,7 @@ GEMCSCTriggerEfficiency::matchSimtrack2GMTCANDs( MatchCSCMuL1 *match, mcand.tfcand = &(match->TFCANDsAll[i]); mcand.ids = match->TFCANDsAll[i].ids; - if (debugGMTCAND) cout<< "---------> matched to TFCANDsAll["< matched to TFCANDsAll["<GMTREGCANDsAll.push_back(mcand); @@ -3718,27 +3684,27 @@ GEMCSCTriggerEfficiency::matchSimtrack2GMTCANDs( MatchCSCMuL1 *match, { ptmatch = mcand.pt; grmatch = mcand; - if (debugGMTCAND) cout<< "---------> DR matched"< DR matched"<GMTREGCANDBest = grmatch; - if (debugGMTCAND) cout<<"---- # of matched GMTREGCANDs = "<GMTREGCANDs.size()<<" All = "<GMTREGCANDsAll.size()<<" DR = "<<(match->GMTREGCANDBest.l1reg != NULL)<::const_iterator muItr = l1GmtCands.begin() ; muItr != l1GmtCands.end() ; ++muItr) + for( std::vector< L1MuGMTExtendedCand >::const_iterator muItr = l1GmtCands.begin() ; muItr != l1GmtCands.end() ; ++muItr) { if( muItr->empty() ) continue; /* if ( muItr->bx() < minBX_ || muItr->bx() > maxBX_ ) { - if (debugGMTCAND) cout<<"discarding BX = "<< muItr->bx() <etaIndex()<<"/"<phiIndex()<<"/"<ptIndex()<<" eta="<charge_valid()<<") isRPC="<isRPC()<<" rank="<rank()<etaIndex()<<"/"<phiIndex()<<"/"<ptIndex()<<" eta="<charge_valid()<<") isRPC="<isRPC()<<" rank="<rank()<GMTREGCANDs[i]); mcand.ids = match->GMTREGCANDs[i].ids; - if (debugGMTCAND) cout<< "---------> matched to GMTREGCANDs["< matched to GMTREGCANDs["<GMTCANDs.push_back(mcand); @@ -3781,7 +3747,7 @@ GEMCSCTriggerEfficiency::matchSimtrack2GMTCANDs( MatchCSCMuL1 *match, mcand.regcand = &(match->GMTREGCANDsAll[i]); mcand.ids = match->GMTREGCANDsAll[i].ids; - if (debugGMTCAND) cout<< "---------> matched to GMTREGCANDsAll["< matched to GMTREGCANDsAll["<GMTCANDsAll.push_back(mcand); @@ -3790,65 +3756,65 @@ GEMCSCTriggerEfficiency::matchSimtrack2GMTCANDs( MatchCSCMuL1 *match, { ptmatch = mcand.pt; gmatch = mcand; - if (debugGMTCAND) cout<< "---------> DR matched"< DR matched"<GMTCANDBest = gmatch; - if (debugGMTCAND) cout<<"---- # of matched GMTCANDs = "<GMTCANDs.size()<<" All = "<GMTCANDsAll.size()<<" DR = "<<(match->GMTCANDBest.l1gmt != NULL)< +std::vector GEMCSCTriggerEfficiency::fillSimTrackFamilyIds(unsigned id, - const SimTrackContainer & simTracks, const SimVertexContainer & simVertices) + const edm::SimTrackContainer & simTracks, const edm::SimVertexContainer & simVertices) { int fdebug = 0; - vector result; + std::vector result; result.push_back(id); if (doStrictSimHitToTrackMatch_) return result; - if (fdebug) cout<<"--- fillSimTrackFamilyIds: id "<trackId()<trackId()<::iterator association = trkId2Index.find( parentId ); + std::map::iterator association = trkId2Index.find( parentId ); if ( association == trkId2Index.end() ) { - if (fdebug) cout<<" --- not in trkId2Index "<second<second<second ]; } if (ischild) { result.push_back(istrk->trackId()); - if (fdebug) cout<<" --- child pushed "< resultd = hitsFromSimTrack(ids[id], hitMap); + std::vector resultd = hitsFromSimTrack(ids[id], hitMap); result.insert(result.end(), resultd.begin(), resultd.end()); - if (fdebug) cout<<" --- n "< ids, SimHitAnalysis:: // ================================================================================================ -vector +std::vector GEMCSCTriggerEfficiency::hitsFromSimTrack(unsigned id, SimHitAnalysis::PSimHitMap &hitMap) { int fdebug = 0; - vector result; - vector detIds = hitMap.detsWithHits(); + std::vector result; + std::vector detIds = hitMap.detsWithHits(); - if (fdebug) cout<<"---- hitsFromSimTrack id "< resultd = hitsFromSimTrack(id, detIds[di], hitMap); + std::vector resultd = hitsFromSimTrack(id, detIds[di], hitMap); result.insert(result.end(), resultd.begin(), resultd.end()); - if (fdebug) cout<<" ---- det "< +std::vector GEMCSCTriggerEfficiency::hitsFromSimTrack(unsigned id, int detId, SimHitAnalysis::PSimHitMap &hitMap) { int fdebug = 0; - vector result; + std::vector result; CSCDetId chId(detId); if ( chId.station() == 1 && chId.ring() == 4 && !doME1a_) return result; - PSimHitContainer hits = hitMap.hits(detId); + edm::PSimHitContainer hits = hitMap.hits(detId); for(size_t h = 0; h< hits.size(); h++) if(hits[h].trackId() == id) { result.push_back(hits[h]); - if (fdebug) cout<<" --- "< "<< hits[h] <<" "< "<< hits[h] <<" "< hits = hitsFromSimTrack(simTrack,theCSCSimHitMap); + std::vector hits = hitsFromSimTrack(simTrack,theCSCSimHitMap); //if(hits.empty()) hits = dtHitsFromSimTrack(simTrack); //if(hits.empty()) hits = rpcHitsFromSimTrack(simTrack); if(!hits.empty()) result = hits[0].particleType(); @@ -3941,15 +3907,15 @@ GEMCSCTriggerEfficiency::compareSimHits(PSimHit &sh1, PSimHit &sh2) int fdebug = 0; if (fdebug && sh1.detUnitId() == sh2.detUnitId()) { - cout<<" compare hits in "<& allLayerInfo, - vector &matchedHit) +GEMCSCTriggerEfficiency::matchCSCAnodeHits(const std::vector& allLayerInfo, + std::vector &matchedHit) { // Match Anode hits in a chamber to SimHits @@ -3985,23 +3951,23 @@ GEMCSCTriggerEfficiency::matchCSCAnodeHits(const vector& allL int nhits=0; matchedHit.clear(); - vector::const_iterator pli; + std::vector::const_iterator pli; for (pli = allLayerInfo.begin(); pli != allLayerInfo.end(); pli++) { // For ALCT search, the key layer is the 3rd one, counting from 1. if (pli->getId().layer() == CSCConstants::KEY_ALCT_LAYER) { - vector thisLayerHits = pli->getSimHits(); + std::vector thisLayerHits = pli->getSimHits(); if (thisLayerHits.size() > 0) { // There can be only one RecDigi (and therefore only one SimHit) in a key layer. if (thisLayerHits.size() != 1) { - cout<< "+++ Warning in matchCSCAnodeHits: " << thisLayerHits.size() + std::cout<< "+++ Warning in matchCSCAnodeHits: " << thisLayerHits.size() << " SimHits in key layer " << CSCConstants::KEY_ALCT_LAYER << "! +++ \n"; for (unsigned i = 0; i < thisLayerHits.size(); i++) - cout<<" SimHit # " << i <<": "<< thisLayerHits[i] << "\n"; + std::cout<<" SimHit # " << i <<": "<< thisLayerHits[i] << "\n"; } matchedHit.push_back(thisLayerHits[0]); nhits++; @@ -4017,16 +3983,16 @@ GEMCSCTriggerEfficiency::matchCSCAnodeHits(const vector& allL // if there is any occurrence of simHit size greater that zero, use this. if ((pli->getRecDigis()).size() > 0 && (pli->getSimHits()).size() > 0) { - vector thisLayerHits = pli->getSimHits(); + std::vector thisLayerHits = pli->getSimHits(); // There can be several RecDigis and several SimHits in a nonkey layer. //if (thisLayerHits.size() != 1) //{ - // cout<< "+++ Warning in matchCSCAnodeHits: " << thisLayerHits.size() + // std::cout<< "+++ Warning in matchCSCAnodeHits: " << thisLayerHits.size() // << " SimHits in layer " << pli->getId().layer() <<" detID "<getId().rawId() // << "! +++ \n"; // for (unsigned i = 0; i < thisLayerHits.size(); i++) - // cout<<" "<& allL // ================================================================================================ unsigned -GEMCSCTriggerEfficiency::matchCSCCathodeHits(const vector& allLayerInfo, - vector &matchedHit) +GEMCSCTriggerEfficiency::matchCSCCathodeHits(const std::vector& allLayerInfo, + std::vector &matchedHit) { // It first tries to look for the SimHit in the key layer. If it is // unsuccessful, it loops over all layers and looks for an associated @@ -4055,23 +4021,23 @@ GEMCSCTriggerEfficiency::matchCSCCathodeHits(const vector& int nhits=0; matchedHit.clear(); - vector::const_iterator pli; + std::vector::const_iterator pli; for (pli = allLayerInfo.begin(); pli != allLayerInfo.end(); pli++) { // For ALCT search, the key layer is the 3rd one, counting from 1. if (pli->getId().layer() == key_layer) { - vector thisLayerHits = pli->getSimHits(); + std::vector thisLayerHits = pli->getSimHits(); if (thisLayerHits.size() > 0) { // There can be only one RecDigi (and therefore only one SimHit) in a key layer. if (thisLayerHits.size() != 1) { - cout<< "+++ Warning in matchCSCCathodeHits: " << thisLayerHits.size() + std::cout<< "+++ Warning in matchCSCCathodeHits: " << thisLayerHits.size() << " SimHits in key layer " << key_layer << "! +++ \n"; for (unsigned i = 0; i < thisLayerHits.size(); i++) - cout<<" SimHit # " << i <<": "<< thisLayerHits[i] << "\n"; + std::cout<<" SimHit # " << i <<": "<< thisLayerHits[i] << "\n"; } matchedHit.push_back(thisLayerHits[0]); nhits++; @@ -4087,16 +4053,16 @@ GEMCSCTriggerEfficiency::matchCSCCathodeHits(const vector& // if there is any occurrence of simHit size greater that zero, use this. if ((pli->getRecDigis()).size() > 0 && (pli->getSimHits()).size() > 0) { - vector thisLayerHits = pli->getSimHits(); + std::vector thisLayerHits = pli->getSimHits(); // There can be several RecDigis and several SimHits in a nonkey layer. //if (thisLayerHits.size() != 1) //{ - // cout<< "+++ Warning in matchCSCCathodeHits: " << thisLayerHits.size() + // std::cout<< "+++ Warning in matchCSCCathodeHits: " << thisLayerHits.size() // << " SimHits in layer " << pli->getId().layer() <<" detID "<getId().rawId() // << "! +++ \n"; // for (unsigned i = 0; i < thisLayerHits.size(); i++) - // cout<<" "<layer(layer1)->geometry()->numberOfWireGroups(); - cout<<"Wire digi dump in "< wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]; + std::vector wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]; static int fifo_tbins = 16; for (int i_layer = 0; i_layer < CSCConstants::NUM_LAYERS; i_layer++) { const CSCDetId layerId(chamberId + i_layer + 1); @@ -4300,7 +4266,7 @@ void GEMCSCTriggerEfficiency::dumpWireDigis(CSCDetId &id, const CSCWireDigiColle digiIt != rwired.second; ++digiIt) { int i_wire = digiIt->getWireGroup()-1; - vector bx_times = digiIt->getTimeBinsOn(); + std::vector bx_times = digiIt->getTimeBinsOn(); for (unsigned int i = 0; i < bx_times.size(); i++) { // Comparisons with data show that time bin 0 needs to be skipped. if (bx_times[i] > 0 && bx_times[i] < fifo_tbins) { @@ -4318,7 +4284,7 @@ void GEMCSCTriggerEfficiency::dumpWireDigis(CSCDetId &id, const CSCWireDigiColle digiIt != rwired1a.second; ++digiIt) { int i_wire = digiIt->getWireGroup()-1; - vector bx_times = digiIt->getTimeBinsOn(); + std::vector bx_times = digiIt->getTimeBinsOn(); for (unsigned int i = 0; i < bx_times.size(); i++) { if (bx_times[i] > 0 && bx_times[i] < fifo_tbins) { wire[i_layer][i_wire].push_back(bx_times[i]); @@ -4350,7 +4316,7 @@ void GEMCSCTriggerEfficiency::dumpWireDigis(CSCDetId &id, const CSCWireDigiColle else strstrm << "."; } } - cout<< strstrm.str() <GetXaxis()->GetNbins()<16) { - cout<<"TF mode histogram should have 16 bins, nbins="<GetXaxis()->GetNbins()< GEMCSCTriggerEfficiency::intersectionEtaPhi(CSCDetId id, int wg, int hs) +std::pair GEMCSCTriggerEfficiency::intersectionEtaPhi(CSCDetId id, int wg, int hs) { CSCDetId layerId(id.endcap(), id.station(), id.ring(), id.chamber(), CSCConstants::KEY_CLCT_LAYER); @@ -4462,7 +4428,7 @@ pair GEMCSCTriggerEfficiency::intersectionEtaPhi(CSCDetId id, int GlobalPoint csc_gp = cscGeometry->idToDet(layerId)->surface().toGlobal(csc_intersect); - return make_pair(csc_gp.eta(), csc_gp.phi()); + return std::make_pair(csc_gp.eta(), csc_gp.phi()); } // ================================================================================================ diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.cc b/SimMuL1/plugins/GEMCSCTriggerRate.cc index 2b3ebcf01bab8..d54e841048387 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRate.cc @@ -31,10 +31,6 @@ #include "GEMCode/GEMValidation/src/SimTrackMatchManager.h" #include "GEMCode/SimMuL1/interface/EtaRangeHelpers.h" -using namespace std; -using namespace reco; -using namespace edm; - namespace { const Double_t ETA_BIN = 0.0125 *2; @@ -44,13 +40,13 @@ namespace // ================================================================================================ // class' constants // -const string GEMCSCTriggerRate::csc_type[CSC_TYPES+1] = +const std::string GEMCSCTriggerRate::csc_type[CSC_TYPES+1] = { "ME1/1", "ME1/2", "ME1/3", "ME1/a", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2", "ME1/T"}; -const string GEMCSCTriggerRate::csc_type_[CSC_TYPES+1] = +const std::string GEMCSCTriggerRate::csc_type_[CSC_TYPES+1] = { "ME11", "ME12", "ME13", "ME1A", "ME21", "ME22", "ME31", "ME32", "ME41", "ME42", "ME1T"}; -const string GEMCSCTriggerRate::csc_type_a[CSC_TYPES+2] = +const std::string GEMCSCTriggerRate::csc_type_a[CSC_TYPES+2] = { "N/A", "ME1/a", "ME1/b", "ME1/2", "ME1/3", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2", "ME1/T"}; -const string GEMCSCTriggerRate::csc_type_a_[CSC_TYPES+2] = +const std::string GEMCSCTriggerRate::csc_type_a_[CSC_TYPES+2] = { "NA", "ME1A", "ME1B", "ME12", "ME13", "ME21", "ME22", "ME31", "ME32", "ME41", "ME42", "ME1T"}; const int GEMCSCTriggerRate::NCHAMBERS[CSC_TYPES] = @@ -86,8 +82,8 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): theCSCSimHitMap() { simHitsFromCrossingFrame_ = iConfig.getUntrackedParameter("SimHitsFromCrossingFrame", false); - simHitsModuleName_ = iConfig.getUntrackedParameter("SimHitsModuleName", "g4SimHits"); - simHitsCollectionName_ = iConfig.getUntrackedParameter("SimHitsCollectionName","MuonCSCHits"); + simHitsModuleName_ = iConfig.getUntrackedParameter("SimHitsModuleName", "g4SimHits"); + simHitsCollectionName_ = iConfig.getUntrackedParameter("SimHitsCollectionName","MuonCSCHits"); theCSCSimHitMap.setUseCrossingFrame(simHitsFromCrossingFrame_); theCSCSimHitMap.setModuleName(simHitsModuleName_); theCSCSimHitMap.setCollectionName(simHitsCollectionName_); @@ -171,7 +167,7 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): minSimTrackDR_ = iConfig.getUntrackedParameter("minSimTrackDR", 0.); - ParameterSet stripPSet = iConfig.getParameter("strips"); + edm::ParameterSet stripPSet = iConfig.getParameter("strips"); theStripConditions = new CSCDbStripConditions(stripPSet); CSCTFSPset = iConfig.getParameter("SectorProcessor"); @@ -217,7 +213,7 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): // *********************************** HISTOGRAMS ****************************************** - Service fs; + edm::Service fs; int N_ETA_BINS=200; double ETA_START=-2.4999; @@ -503,10 +499,10 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): h_rt_gmt_ptmax20_eta_dbl = fs->make("h_rt_gmt_ptmax20_eta_dbl","h_rt_gmt_ptmax20_eta_dbl",N_ETA_BINS_GMT, ETA_BINS_GMT); const int Nthr = 7; - string str_pts[Nthr] = {"", "_pt10", "_pt15", "_pt20", "_pt25", "_pt30","_pt40"}; + std::string str_pts[Nthr] = {"", "_pt10", "_pt15", "_pt20", "_pt25", "_pt30","_pt40"}; for (int i = 1; i < Nthr; ++i) { - string prefix = "h_rt_gmt_csc_mode_2s1b_1b_"; + std::string prefix = "h_rt_gmt_csc_mode_2s1b_1b_"; h_rt_gmt_csc_mode_2s1b_1b[i-1] = fs->make((prefix + str_pts[i]).c_str(), (prefix + str_pts[i]).c_str(), 16, -0.5, 15.5); setupTFModeHisto(h_rt_gmt_csc_mode_2s1b_1b[i-1]); } @@ -712,7 +708,7 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup { nevt++; - cout<<" Entry Event "< cscGeom; + edm::ESHandle< CSCGeometry > cscGeom; iSetup.get< MuonGeometryRecord >().get(cscGeom); iSetup.get().get(muonGeometry); @@ -774,49 +770,49 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup // const CSCComparatorDigiCollection* compdc = compDigis.product(); // ALCTs and CLCTs - Handle< CSCALCTDigiCollection > halcts; - Handle< CSCCLCTDigiCollection > hclcts; + edm::Handle< CSCALCTDigiCollection > halcts; + edm::Handle< CSCCLCTDigiCollection > hclcts; iEvent.getByLabel("simCscTriggerPrimitiveDigis", halcts); iEvent.getByLabel("simCscTriggerPrimitiveDigis", hclcts); const CSCALCTDigiCollection* alcts = halcts.product(); const CSCCLCTDigiCollection* clcts = hclcts.product(); // strip&wire matching output after TMB and after MPC sorting - Handle< CSCCorrelatedLCTDigiCollection > lcts_tmb; - Handle< CSCCorrelatedLCTDigiCollection > lcts_mpc; + edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_tmb; + edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_mpc; iEvent.getByLabel("simCscTriggerPrimitiveDigis", lcts_tmb); iEvent.getByLabel("simCscTriggerPrimitiveDigis", "MPCSORTED", lcts_mpc); const CSCCorrelatedLCTDigiCollection* lcts = lcts_tmb.product(); const CSCCorrelatedLCTDigiCollection* mplcts = lcts_mpc.product(); // DT primitives for input to TF - Handle dttrig; + edm::Handle dttrig; iEvent.getByLabel("simDtTriggerPrimitiveDigis", dttrig); const L1MuDTChambPhContainer* dttrigs = dttrig.product(); // tracks produced by TF - Handle< L1CSCTrackCollection > hl1Tracks; + edm::Handle< L1CSCTrackCollection > hl1Tracks; iEvent.getByLabel("simCsctfTrackDigis",hl1Tracks); const L1CSCTrackCollection* l1Tracks = hl1Tracks.product(); // L1 muon candidates after CSC sorter - Handle< vector< L1MuRegionalCand > > hl1TfCands; + edm::Handle< std::vector< L1MuRegionalCand > > hl1TfCands; iEvent.getByLabel("simCsctfDigis", "CSC", hl1TfCands); - const vector< L1MuRegionalCand > *l1TfCands = hl1TfCands.product(); + const std::vector< L1MuRegionalCand > *l1TfCands = hl1TfCands.product(); // GMT readout collection - Handle< L1MuGMTReadoutCollection > hl1GmtCands; + edm::Handle< L1MuGMTReadoutCollection > hl1GmtCands; if (!lightRun) iEvent.getByLabel("simGmtDigis", hl1GmtCands ) ;// InputTag("simCsctfDigis","CSC") //const L1MuGMTReadoutCollection* l1GmtCands = hl1GmtCands.product(); - vector l1GmtCands; - vector l1GmtfCands; - vector l1GmtCSCCands; - vector l1GmtRPCfCands; - vector l1GmtRPCbCands; - vector l1GmtDTCands; + std::vector l1GmtCands; + std::vector l1GmtfCands; + std::vector l1GmtCSCCands; + std::vector l1GmtRPCfCands; + std::vector l1GmtRPCbCands; + std::vector l1GmtDTCands; // key = BX - map > l1GmtCSCCandsInBXs; + std::map > l1GmtCSCCandsInBXs; // TOCHECK if( !lightRun ) @@ -835,39 +831,39 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup else { // Get GMT candidates from all bunch crossings - vector gmt_records = hl1GmtCands->getRecords(); - for ( vector< L1MuGMTReadoutRecord >::const_iterator rItr=gmt_records.begin(); rItr!=gmt_records.end() ; ++rItr ) + std::vector gmt_records = hl1GmtCands->getRecords(); + for ( std::vector< L1MuGMTReadoutRecord >::const_iterator rItr=gmt_records.begin(); rItr!=gmt_records.end() ; ++rItr ) { if (rItr->getBxInEvent() < minBxGMT_ || rItr->getBxInEvent() > maxBxGMT_) continue; - vector GMTCands = rItr->getGMTCands(); - for ( vector::const_iterator cItr = GMTCands.begin() ; cItr != GMTCands.end() ; ++cItr ) + std::vector GMTCands = rItr->getGMTCands(); + for ( std::vector::const_iterator cItr = GMTCands.begin() ; cItr != GMTCands.end() ; ++cItr ) if (!cItr->empty()) l1GmtCands.push_back(*cItr); - vector GMTfCands = rItr->getGMTFwdCands(); - for ( vector::const_iterator cItr = GMTfCands.begin() ; cItr != GMTfCands.end() ; ++cItr ) + std::vector GMTfCands = rItr->getGMTFwdCands(); + for ( std::vector::const_iterator cItr = GMTfCands.begin() ; cItr != GMTfCands.end() ; ++cItr ) if (!cItr->empty()) l1GmtfCands.push_back(*cItr); - //cout<<" ggg: "< CSCCands = rItr->getCSCCands(); + std::vector CSCCands = rItr->getCSCCands(); l1GmtCSCCandsInBXs[rItr->getBxInEvent()] = CSCCands; - for ( vector::const_iterator cItr = CSCCands.begin() ; cItr != CSCCands.end() ; ++cItr ) + for ( std::vector::const_iterator cItr = CSCCands.begin() ; cItr != CSCCands.end() ; ++cItr ) if (!cItr->empty()) l1GmtCSCCands.push_back(*cItr); - vector RPCfCands = rItr->getFwdRPCCands(); - for ( vector::const_iterator cItr = RPCfCands.begin() ; cItr != RPCfCands.end() ; ++cItr ) + std::vector RPCfCands = rItr->getFwdRPCCands(); + for ( std::vector::const_iterator cItr = RPCfCands.begin() ; cItr != RPCfCands.end() ; ++cItr ) if (!cItr->empty()) l1GmtRPCfCands.push_back(*cItr); - vector RPCbCands = rItr->getBrlRPCCands(); - for ( vector::const_iterator cItr = RPCbCands.begin() ; cItr != RPCbCands.end() ; ++cItr ) + std::vector RPCbCands = rItr->getBrlRPCCands(); + for ( std::vector::const_iterator cItr = RPCbCands.begin() ; cItr != RPCbCands.end() ; ++cItr ) if (!cItr->empty()) l1GmtRPCbCands.push_back(*cItr); - vector DTCands = rItr->getDTBXCands(); - for ( vector::const_iterator cItr = DTCands.begin() ; cItr != DTCands.end() ; ++cItr ) + std::vector DTCands = rItr->getDTBXCands(); + for ( std::vector::const_iterator cItr = DTCands.begin() ; cItr != DTCands.end() ; ++cItr ) if (!cItr->empty()) l1GmtDTCands.push_back(*cItr); } - //cout<<" sizes: "< > me11alcts; + if (debugRATE) std::cout<< "----- statring nalct"< > me11alcts; for (CSCALCTDigiCollection::DigiRangeIterator adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); adetUnitIt++) { const CSCDetId& id = (*adetUnitIt).first; @@ -932,22 +928,22 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup //if ( bx-6 < minBX_ || bx-6 > maxBX_ ) if ( bx < minBxALCT_ || bx > maxBxALCT_ ) { - if (debugRATE) cout<<"discarding BX = "<< bx-6 < >::const_iterator mapIt = me11alcts.begin(); + //std::map< CSCDetId , std::vector >::const_iterator mapIt = me11alcts.begin(); //for (;mapIt != me11alcts.end(); mapIt++){} - map< int , vector >::const_iterator aMapIt = me11alcts.begin(); + std::map< int , std::vector >::const_iterator aMapIt = me11alcts.begin(); for (;aMapIt != me11alcts.end(); aMapIt++) { CSCDetId id(aMapIt->first); @@ -1000,12 +996,12 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup } - if (debugRATE) cout<< "----- end nalct="<begin(); cdetUnitIt != clcts->end(); cdetUnitIt++) { const CSCDetId& id = (*cdetUnitIt).first; @@ -1037,13 +1033,13 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup //if ( bx-5 < minBX_ || bx-7 > maxBX_ ) if ( bx < minBxCLCT_ || bx > maxBxCLCT_ ) { - if (debugRATE) cout<<"discarding BX = "<< bx-6 <Fill(n_ch_clct_per_bx_cscdet[me][b]); } - if (debugRATE) cout<< "----- end nclct="< > me11lcts; + if (debugRATE) std::cout<< "----- statring nlct"<begin(); detUnitIt != lcts->end(); detUnitIt++) { const CSCDetId& id = (*detUnitIt).first; @@ -1113,12 +1109,12 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup if ((*digiIt).isValid()) { int bx = (*digiIt).getBX(); - //if (debugLCT) cout<< "----- LCT in raw ID "< maxBX_ ) if ( bx < minBxLCT_ || bx > maxBxLCT_ ) { - if (debugRATE) cout<<"discarding BX = "<< bx-6 < rtMPLCTs; + if (debugRATE) std::cout<< "----- statring nmplct"< rtMPLCTs; for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator detUnitIt = mplcts->begin(); detUnitIt != mplcts->end(); detUnitIt++) { const CSCDetId& id = (*detUnitIt).first; @@ -1237,13 +1233,13 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup { if ((*digiIt).isValid()) { - //if (debugRATE) cout<< "----- MPLCT in raw ID "< maxBX_ ) if ( bx < minBxMPLCT_ || bx > maxBxMPLCT_ ) { - if (debugRATE) cout<<"discarding BX = "<< (*digiIt).getBX()-6 <Fill(nmplct_trigsector_bx_st1[i][j],j+0.5); } } - if (debugRATE) cout<< "----- end nmplct="< rtTFTracks; - // if (debugTFInef && inefTF) cout<<"#################### TF INEFFICIENCY ALL TFTRACKs:"< rtTFTracks; + // if (debugTFInef && inefTF) std::cout<<"#################### TF INEFFICIENCY ALL TFTRACKs:"<begin(); trk != l1Tracks->end(); trk++) { if ( trk->first.bx() < minRateBX_ || trk->first.bx() > maxRateBX_ ) { - if (debugRATE) cout<<"discarding BX = "<< trk->first.bx() < 127); if (me1a_case){ CSCDetId id1a(id.endcap(),id.station(),4,id.chamber(),0); cid = id1a; } - //if (id.station()==1 && id.ring()==4) cout<<"me1adigi check: "<<(*digiIt)<<" "< 0.1) { myTFTrk.print(""); - cout<<"############### CSCTFSPCoreLogic printout for large deta12 = "<Fill(myTFTrk.mode()); } h_rt_ntftrack->Fill(ntftrack); - if (debugRATE) cout<< "----- end ntftrack="< rtTFCands; - for ( vector< L1MuRegionalCand >::const_iterator trk = l1TfCands->begin(); trk != l1TfCands->end(); trk++) + if (debugRATE) std::cout<< "----- statring ntfcand"< rtTFCands; + for ( std::vector< L1MuRegionalCand >::const_iterator trk = l1TfCands->begin(); trk != l1TfCands->end(); trk++) { if ( trk->bx() < minRateBX_ || trk->bx() > maxRateBX_ ) { - if (debugRATE) cout<<"discarding BX = "<< trk->bx() <eta_packed() & 0x1F) <eta_packed() & 0x1F) <=10.) ntfcandpt10++; @@ -1436,11 +1432,11 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup } rtTFCands.push_back(myTFCand); if(myTFCand.tftrack == NULL){ - cout<<"myTFCand.tftrack == NULL:"<pt_packed()<<" "<eta_packed()<<" "<phi_packed()<<" "<bx()<pt_packed()<<" "<eta_packed()<<" "<phi_packed()<<" "<bx()<bx()<bx()<trgdigis.size(); if (ntrg_stubs!=myTFCand.ids.size()) - cout<<"OBA!!! trgdigis.size()!=ids.size(): "<nStubs(0,1,1,1,1)<nStubs(0,1,1,1,1)<nStubs()) myTFCand.tftrack->print("non-equal nstubs!"); //if (fabs(myTFCand.eta)>1.25 && fabs(myTFCand.eta)<1.9) { if (etaRangeHelpers::isME42EtaRegion(myTFCand.eta)) { @@ -1486,18 +1482,18 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup h_rt_tfcand_pt_vs_eta_3st1a->Fill(tfpt,tfeta); } } - //else cout<<"Strange: myTFCand.tftrack != NULL"<Fill(ntfcand); h_rt_ntfcand_pt10->Fill(ntfcandpt10); - if (debugRATE) cout<< "----- end ntfcand/ntfcandpt10="< rtGMTREGCands; + if (debugRATE) std::cout<< "----- statring ngmt csc"< rtGMTREGCands; float max_pt_2s = -1, max_pt_3s = -1, max_pt_2q = -1, max_pt_3q = -1; float max_pt_2s_eta = -111, max_pt_3s_eta = -111, max_pt_2q_eta = -111, max_pt_3q_eta = -111; float max_pt_me42_2s = -1, max_pt_me42_3s = -1, max_pt_me42_2q = -1, max_pt_me42_3q = -1; @@ -1532,13 +1528,13 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup MatchCSCMuL1::TFTRACK *trk__max_pt_2s1b_1b = nullptr; const CSCCorrelatedLCTDigi * the_me1_stub = nullptr; CSCDetId the_me1_id; - map bx2n; + std::map bx2n; for (int bx=minRateBX_; bx<=maxRateBX_; bx++) bx2n[bx]=0; - for ( vector::const_iterator trk = l1GmtCSCCands.begin(); trk != l1GmtCSCCands.end(); trk++) + for ( std::vector::const_iterator trk = l1GmtCSCCands.begin(); trk != l1GmtCSCCands.end(); trk++) { if ( trk->bx() < minRateBX_ || trk->bx() > maxRateBX_ ) { - if (debugRATE) cout<<"discarding BX = "<< trk->bx() <tftrack->trgids; for (size_t i=0; iphi_packed()<<" "<eta_packed()<phi_packed()<<" "<eta_packed(); - cout<::const_iterator ctrk = l1TfCands->begin(); ctrk != l1TfCands->end(); ctrk++) - if (!( ctrk->bx() < minRateBX_ || ctrk->bx() > maxRateBX_ )) cout<<" "<phi_packed()<<" "<eta_packed(); - cout<phi_packed()<<" "<eta_packed()<phi_packed()<<" "<eta_packed(); + std::cout<::const_iterator ctrk = l1TfCands->begin(); ctrk != l1TfCands->end(); ctrk++) + if (!( ctrk->bx() < minRateBX_ || ctrk->bx() > maxRateBX_ )) std::cout<<" "<phi_packed()<<" "<eta_packed(); + std::cout<quality()>=2) { @@ -1719,17 +1715,17 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup } //if (trk->quality()>=3 && !(myGMTREGCand.ids.size()>=3) ) { - // cout<<"weird stubs number "<quality()>=3 && gpt >=40. && etaRangeHelpers::isME1bEtaRegion(myGMTREGCand.eta) ) { - // cout<<"highpt csctf in ME1b "<tftrack->print(""); // } if (has_me1_stub && n_stubs > 2 && gpt >= 30. && geta> 1.6 && geta < 2.15 ) { - cout<<"highpt csctf in ME1b "<tftrack->print(""); } @@ -1848,11 +1844,11 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup if (max_pt_me42r_2q>0) h_rt_gmt_csc_ptmax_2q42r->Fill(max_pt_me42r_2q); if (max_pt_me42r_3q>0) h_rt_gmt_csc_ptmax_3q42r->Fill(max_pt_me42r_3q); for (int bx=minRateBX_; bx<=maxRateBX_; bx++) h_rt_ngmt_csc_per_bx->Fill(bx2n[bx]); - if (debugRATE) cout<< "----- end ngmt csc/ngmtpt10="<=30.) { - cout<<"filled h_rt_gmt_csc_ptmax30_eta_3s_3s1b eta "<print(""); } @@ -1864,19 +1860,19 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup { h_rt_gmt_csc_mode_2s1b_1b[i]->Fill(trk__max_pt_2s1b_1b->mode()); } - if (the_me1_stub) cout<<"DBGMODE "<pt<<" "<mode()<<" "<getPattern()] <<" "<getGEMDPhi()<pt<<" "<mode()<<" "<getPattern()] <<" "<getGEMDPhi()< rtGMTRPCfCands; + if (debugRATE) std::cout<< "----- statring ngmt rpcf"< rtGMTRPCfCands; float max_pt_me42 = -1, max_pt = -1, max_pt_eta = -111; for (int bx=minRateBX_; bx<=maxRateBX_; bx++) bx2n[bx]=0; - for ( vector::const_iterator trk = l1GmtRPCfCands.begin(); trk != l1GmtRPCfCands.end(); trk++) + for ( std::vector::const_iterator trk = l1GmtRPCfCands.begin(); trk != l1GmtRPCfCands.end(); trk++) { if ( trk->bx() < minRateBX_ || trk->bx() > maxRateBX_ ) { - if (debugRATE) cout<<"discarding BX = "<< trk->bx() < rtGMTRPCbCands; + if (debugRATE) std::cout<< "----- statring ngmt rpcb"< rtGMTRPCbCands; max_pt = -1, max_pt_eta = -111; for (int bx=minRateBX_; bx<=maxRateBX_; bx++) bx2n[bx]=0; - for ( vector::const_iterator trk = l1GmtRPCbCands.begin(); trk != l1GmtRPCbCands.end(); trk++) + for ( std::vector::const_iterator trk = l1GmtRPCbCands.begin(); trk != l1GmtRPCbCands.end(); trk++) { if ( trk->bx() < minRateBX_ || trk->bx() > maxRateBX_ ) { - if (debugRATE) cout<<"discarding BX = "<< trk->bx() < rtGMTDTCands; + if (debugRATE) std::cout<< "----- statring ngmt dt"< rtGMTDTCands; max_pt = -1, max_pt_eta = -111; for (int bx=minRateBX_; bx<=maxRateBX_; bx++) bx2n[bx]=0; - for ( vector::const_iterator trk = l1GmtDTCands.begin(); trk != l1GmtDTCands.end(); trk++) + for ( std::vector::const_iterator trk = l1GmtDTCands.begin(); trk != l1GmtDTCands.end(); trk++) { if ( trk->bx() < minRateBX_ || trk->bx() > maxRateBX_ ) { - if (debugRATE) cout<<"discarding BX = "<< trk->bx() < rtGMTCands; + if (debugRATE) std::cout<< "----- statring ngmt"< rtGMTCands; max_pt_me42_2s = -1; max_pt_me42_3s = -1; max_pt_me42_2q = -1; max_pt_me42_3q = -1; max_pt_me42r_2s = -1; max_pt_me42r_3s = -1; max_pt_me42r_2q = -1; max_pt_me42r_3q = -1; float max_pt_me42_2s_sing = -1, max_pt_me42_3s_sing = -1, max_pt_me42_2q_sing = -1, max_pt_me42_3q_sing = -1; @@ -2028,23 +2024,23 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup float max_pt_dbl = -1, max_pt_eta_dbl = -999; - vector gmt_records = hl1GmtCands->getRecords(); - for ( vector< L1MuGMTReadoutRecord >::const_iterator rItr=gmt_records.begin(); rItr!=gmt_records.end() ; ++rItr ) + std::vector gmt_records = hl1GmtCands->getRecords(); + for ( std::vector< L1MuGMTReadoutRecord >::const_iterator rItr=gmt_records.begin(); rItr!=gmt_records.end() ; ++rItr ) { if (rItr->getBxInEvent() < minBxGMT_ || rItr->getBxInEvent() > maxBxGMT_) continue; - vector CSCCands = rItr->getCSCCands(); - vector DTCands = rItr->getDTBXCands(); - vector RPCfCands = rItr->getFwdRPCCands(); - vector RPCbCands = rItr->getBrlRPCCands(); - vector GMTCands = rItr->getGMTCands(); - for ( vector::const_iterator muItr = GMTCands.begin() ; muItr != GMTCands.end() ; ++muItr ) + std::vector CSCCands = rItr->getCSCCands(); + std::vector DTCands = rItr->getDTBXCands(); + std::vector RPCfCands = rItr->getFwdRPCCands(); + std::vector RPCbCands = rItr->getBrlRPCCands(); + std::vector GMTCands = rItr->getGMTCands(); + for ( std::vector::const_iterator muItr = GMTCands.begin() ; muItr != GMTCands.end() ; ++muItr ) { if( muItr->empty() ) continue; if ( muItr->bx() < minRateBX_ || muItr->bx() > maxRateBX_ ) { - if (debugRATE) cout<<"discarding BX = "<< muItr->bx() <ids; } @@ -2087,7 +2083,7 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup break; } if (my_i<99) gmt_rpcf = &rtGMTRPCfCands[my_i]; - else cout<<"DOES NOT EXIST IN rtGMTRPCfCands! Should not happen!"<isMatchedCand() ) cout<<"csc&rpcf but not matched!"<isMatchedCand() ) std::cout<<"csc&rpcf but not matched!"<isMatchedCand()) gtype = 6; else if (gmt_csc!=0) gtype = gmt_csc->l1reg->quality()+2; else if (gmt_rpcf!=0) gtype = gmt_rpcf->l1reg->quality()+1; - if (gtype==0) cout<<"weird: gtype=0 That shouldn't happen!"; + if (gtype==0) std::cout<<"weird: gtype=0 That shouldn't happen!"; h_rt_gmt_gq_vs_type_42r->Fill(muItr->quality(), gtype); h_rt_gmt_gq_vs_pt_42r->Fill(muItr->quality(), gpt); h_rt_gmt_gq_42r->Fill(muItr->quality()); @@ -2175,9 +2171,9 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup bool isRPCf = (gmt_rpcf != NULL); bool isRPCb = (gmt_rpcb != NULL); - if (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack == NULL) cout<<"warning: gmt_csc->tfcand->tftrack == NULL"<tfcand != NULL && gmt_csc->tfcand->tftrack == NULL) std::cout<<"warning: gmt_csc->tfcand->tftrack == NULL"<tfcand != NULL && gmt_csc->tfcand->tftrack != NULL && gmt_csc->tfcand->tftrack->l1trk == NULL) - cout<<"warning: gmt_csc->tfcand->tftrack->l1trk == NULL"<tfcand->tftrack->l1trk == NULL"<tfcand != NULL && myGMTCand.ids.size()>=2); //bool isCSC3s = (isCSC && gmt_csc->tfcand != NULL && myGMTCand.ids.size()>=3); bool isCSC2s = (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack != NULL && gmt_csc->tfcand->tftrack->nStubs()>=2); @@ -2334,7 +2330,7 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup if (max_pt_dbl>0) h_rt_gmt_ptmax_dbl->Fill(max_pt_dbl); if (max_pt_dbl>=10.) h_rt_gmt_ptmax10_eta_dbl->Fill(max_pt_eta_dbl); if (max_pt_dbl>=20.) h_rt_gmt_ptmax20_eta_dbl->Fill(max_pt_eta_dbl); - if (debugRATE) cout<< "----- end ngmt="<run(current_e_s); } } @@ -2459,7 +2455,7 @@ void GEMCSCTriggerRate::setupTFModeHisto(TH1D* h) { if (h==0) return; if (h->GetXaxis()->GetNbins()<16) { - cout<<"TF mode histogram should have 16 bins, nbins="<GetXaxis()->GetNbins()< GEMCSCTriggerRate::intersectionEtaPhi(CSCDetId id, int wg, int hs) +std::pair GEMCSCTriggerRate::intersectionEtaPhi(CSCDetId id, int wg, int hs) { CSCDetId layerId(id.endcap(), id.station(), id.ring(), id.chamber(), CSCConstants::KEY_CLCT_LAYER); @@ -2502,7 +2498,7 @@ pair GEMCSCTriggerRate::intersectionEtaPhi(CSCDetId id, int wg, in GlobalPoint csc_gp = cscGeometry->idToDet(layerId)->surface().toGlobal(csc_intersect); - return make_pair(csc_gp.eta(), csc_gp.phi()); + return std::make_pair(csc_gp.eta(), csc_gp.phi()); } // ================================================================================================ From 842bab2883536d00af711eacfef583e1f8aec50e Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 16 Aug 2013 18:08:44 +0200 Subject: [PATCH 092/182] Delete GEMCSCdPhiLib.py --- SimMuL1/scripts/GEMCSCdPhiLib.py | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 SimMuL1/scripts/GEMCSCdPhiLib.py diff --git a/SimMuL1/scripts/GEMCSCdPhiLib.py b/SimMuL1/scripts/GEMCSCdPhiLib.py deleted file mode 100644 index 9756ffc9c24be..0000000000000 --- a/SimMuL1/scripts/GEMCSCdPhiLib.py +++ /dev/null @@ -1,26 +0,0 @@ -dphi_lct_pad = { - "95" : { - 'pt5 ' : { 'odd' : 0.02023292, 'even' : 0.00833584 }, - 'pt10' : { 'odd' : 0.00977472, 'even' : 0.00435576 }, - 'pt15' : { 'odd' : 0.00661092, 'even' : 0.00324096 }, - 'pt20' : { 'odd' : 0.00512415, 'even' : 0.00272092 }, - 'pt30' : { 'odd' : 0.00374355, 'even' : 0.00221976 }, - 'pt40' : { 'odd' : 0.00307651, 'even' : 0.00198198 } - }, - "98" : { - 'pt5 ' : { 'odd' : 0.02203511, 'even' : 0.00930056 }, - 'pt10' : { 'odd' : 0.01066000, 'even' : 0.00483286 }, - 'pt15' : { 'odd' : 0.00722795, 'even' : 0.00363230 }, - 'pt20' : { 'odd' : 0.00562598, 'even' : 0.00304878 }, - 'pt30' : { 'odd' : 0.00416544, 'even' : 0.00253782 }, - 'pt40' : { 'odd' : 0.00342827, 'even' : 0.00230833 } - }, - "99" : { - 'pt5 ' : { 'odd' : 0.02344691, 'even' : 0.00995745 }, - 'pt10' : { 'odd' : 0.01137125, 'even' : 0.00520722 }, - 'pt15' : { 'odd' : 0.00769842, 'even' : 0.00389632 }, - 'pt20' : { 'odd' : 0.00599498, 'even' : 0.00331874 }, - 'pt30' : { 'odd' : 0.00446935, 'even' : 0.00278215 }, - 'pt40' : { 'odd' : 0.00368553, 'even' : 0.00254660 } - } -} From 4718217909727006feb7177584c4d59ea85ea89f Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 16 Aug 2013 21:22:10 +0200 Subject: [PATCH 093/182] Removing obsolete stuff in the trigger rate analyzer, such as unused variables, histograms and functions. Changed class type from filter to analyzer. Preparing to split the analyze function in smaller pieces. Preparing to ntuplize it. --- SimMuL1/plugins/GEMCSCTriggerRate.cc | 211 +++---- SimMuL1/plugins/GEMCSCTriggerRate.h | 809 +-------------------------- 2 files changed, 115 insertions(+), 905 deletions(-) diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.cc b/SimMuL1/plugins/GEMCSCTriggerRate.cc index d54e841048387..dd4db77109d8e 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRate.cc @@ -4,7 +4,7 @@ #include #include -#include "DataFormats/HepMCCandidate/interface/GenParticle.h" +// user include files #include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h" #include "DataFormats/L1Trigger/interface/L1MuonParticle.h" #include "DataFormats/MuonDetId/interface/CSCDetId.h" @@ -28,9 +28,41 @@ #include "DataFormats/GeometrySurface/interface/BoundCylinder.h" #include "DataFormats/MuonDetId/interface/GEMDetId.h" #include "Geometry/GEMGeometry/interface/GEMGeometry.h" -#include "GEMCode/GEMValidation/src/SimTrackMatchManager.h" #include "GEMCode/SimMuL1/interface/EtaRangeHelpers.h" +struct MyALCT +{ + Int_t nlayers, bx; + Float_t pt, eta, phi; + Char_t hit; // hits in MEX/Y or GE1/1 +}; + +struct MyCLCT +{ + Int_t nlayers, bx; + Float_t pt, eta, phi; + Char_t hit; // hits in MEX/Y or GE1/1 +}; + +struct MyLCT +{ + Int_t nlayers, bx; + Float_t pt, eta, phi; + Char_t hit; // hits in MEX/Y or GE1/1 +}; + +struct MyMPCLCT +{ + Int_t nlayers, bx; + Float_t pt, eta, phi; + Char_t hit; // hits in MEX/Y or GE1/1 +}; + +struct MyTFTrack{}; +struct MyTFCand{}; +struct MyGMTRegional{}; +struct MyGMT{}; + namespace { const Double_t ETA_BIN = 0.0125 *2; @@ -73,9 +105,6 @@ const double GEMCSCTriggerRate::PT_THRESHOLDS_FOR_ETA[N_PT_THRESHOLDS] = {10,15, // ================================================================================================ -// -// constructors and destructor -// GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): // theCSCSimHitMap("MuonCSCHits"), theDTSimHitMap("MuonDTHits"), theRPCSimHitMap("MuonRPCHits") ptLUT(0), @@ -88,20 +117,8 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): theCSCSimHitMap.setModuleName(simHitsModuleName_); theCSCSimHitMap.setCollectionName(simHitsCollectionName_); - doStrictSimHitToTrackMatch_ = iConfig.getUntrackedParameter("doStrictSimHitToTrackMatch", false); matchAllTrigPrimitivesInChamber_ = iConfig.getUntrackedParameter("matchAllTrigPrimitivesInChamber", false); - minNHitsShared_ = iConfig.getUntrackedParameter("minNHitsShared_", -1); - - minDeltaYAnode_ = iConfig.getUntrackedParameter("minDeltaYAnode", -1.); - minDeltaYCathode_ = iConfig.getUntrackedParameter("minDeltaYCathode", -1.); - - minDeltaWire_ = iConfig.getUntrackedParameter("minDeltaWire", 0); - maxDeltaWire_ = iConfig.getUntrackedParameter("maxDeltaWire", 2); - minDeltaStrip_ = iConfig.getUntrackedParameter("minDeltaStrip", 1); - - debugALLEVENT = iConfig.getUntrackedParameter("debugALLEVENT", 0); - debugINHISTOS = iConfig.getUntrackedParameter("debugINHISTOS", 0); debugALCT = iConfig.getUntrackedParameter("debugALCT", 0); debugCLCT = iConfig.getUntrackedParameter("debugCLCT", 0); debugLCT = iConfig.getUntrackedParameter("debugLCT", 0); @@ -112,14 +129,6 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): debugL1EXTRA = iConfig.getUntrackedParameter("debugL1EXTRA", 0); debugRATE = iConfig.getUntrackedParameter("debugRATE", 0); - minSimTrPt_ = iConfig.getUntrackedParameter("minSimTrPt", 2.); - minSimTrPhi_ = iConfig.getUntrackedParameter("minSimTrPhi",-3.15); - maxSimTrPhi_ = iConfig.getUntrackedParameter("maxSimTrPhi", 3.15); - minSimTrEta_ = iConfig.getUntrackedParameter("minSimTrEta",-5.); - maxSimTrEta_ = iConfig.getUntrackedParameter("maxSimTrEta", 5.); - invertSimTrPhiEta_ = iConfig.getUntrackedParameter("invertSimTrPhiEta", false); - bestPtMatch_ = iConfig.getUntrackedParameter("bestPtMatch", true); - minBX_ = iConfig.getUntrackedParameter< int >("minBX",-6); maxBX_ = iConfig.getUntrackedParameter< int >("maxBX",6); minTMBBX_ = iConfig.getUntrackedParameter< int >("minTMBBX",-6); @@ -143,12 +152,7 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): doSelectEtaForGMTRates_ = iConfig.getUntrackedParameter< bool >("doSelectEtaForGMTRates",false); - goodChambersOnly_ = iConfig.getUntrackedParameter< bool >("goodChambersOnly",false); - - lookAtTrackCondition_ = iConfig.getUntrackedParameter("lookAtTrackCondition", 0); - doME1a_ = iConfig.getUntrackedParameter< bool >("doME1a",false); - naiveME1a_ = iConfig.getUntrackedParameter< bool >("naiveME1a",true); // no GMT and L1Extra processing lightRun = iConfig.getUntrackedParameter("lightRun", true); @@ -156,17 +160,6 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): // special treatment of matching in ME1a for the case of the default emulator defaultME1a = iConfig.getUntrackedParameter("defaultME1a", false); - // properly treat ganged ME1a in matching (consider triple ambiguity) - gangedME1a = iConfig.getUntrackedParameter("gangedME1a", false); - //if (defaultME1a) gangedME1a = true; - - addGhostLCTs_ = iConfig.getUntrackedParameter< bool >("addGhostLCTs",true); - - minNStWith4Hits_ = iConfig.getUntrackedParameter< int >("minNStWith4Hits", 0); - requireME1With4Hits_ = iConfig.getUntrackedParameter< bool >("requireME1With4Hits",false); - - minSimTrackDR_ = iConfig.getUntrackedParameter("minSimTrackDR", 0.); - edm::ParameterSet stripPSet = iConfig.getParameter("strips"); theStripConditions = new CSCDbStripConditions(stripPSet); @@ -198,20 +191,11 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): muPtScaleCacheID_ = 0ULL ; fill_debug_tree_ = iConfig.getUntrackedParameter< bool >("fill_debug_tree",false); - - // processed event counter - nevt = 0; - - gemMatchCfg_ = iConfig.getParameterSet("simTrackGEMMatching"); - gemPTs_ = iConfig.getParameter >("gemPTs"); - gemDPhisOdd_ = iConfig.getParameter >("gemDPhisOdd"); - gemDPhisEven_ = iConfig.getParameter >("gemDPhisEven"); - - assert(std::is_sorted(gemPTs_.begin(), gemPTs_.end())); - assert(gemPTs_.size() == gemDPhisOdd_.size() && gemPTs_.size() == gemDPhisEven_.size()); - - +} +void +GEMCSCTriggerRate::beginJob() +{ // *********************************** HISTOGRAMS ****************************************** edm::Service fs; @@ -686,12 +670,6 @@ GEMCSCTriggerRate::~GEMCSCTriggerRate() } -// -// member functions -// -// ================================================================================================ - - void GEMCSCTriggerRate::resetDbg(DbgStruct& d) { @@ -701,41 +679,55 @@ GEMCSCTriggerRate::resetDbg(DbgStruct& d) d.meEtap = d.mePhip = d.mcStrip = d.mcWG = d.strip = d.wg = d.chamber = -1; } - -// ================================================================================================ -// ------------ method called to for each event ------------ -bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) +void +GEMCSCTriggerRate::beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) { - nevt++; - - std::cout<<" Entry Event "< cscGeom; - - iSetup.get< MuonGeometryRecord >().get(cscGeom); - iSetup.get().get(muonGeometry); - + iSetup.get().get(cscGeom); cscGeometry = &*cscGeom; - CSCTriggerGeometry::setGeometry(cscGeometry); - // get conditions for bad chambers (don't need random engine) - theStripConditions->initializeEvent(iSetup); + edm::ESHandle muonGeometry; + iSetup.get().get(muonGeometry); + // does the trigger sccale need to be defined in the beginrun or analyze method? + if (iSetup.get< L1MuTriggerScalesRcd >().cacheIdentifier() != muScalesCacheID_ || + iSetup.get< L1MuTriggerPtScaleRcd >().cacheIdentifier() != muPtScaleCacheID_ ) + { + iSetup.get< L1MuTriggerScalesRcd >().get( muScales ); - //Get the Magnetic field from the setup - iSetup.get().get(theBField); + iSetup.get< L1MuTriggerPtScaleRcd >().get( muPtScale ); + if (ptLUT) delete ptLUT; + ptLUT = new CSCTFPtLUT(ptLUTset, muScales.product(), muPtScale.product()); + + for(int e=0; e<2; e++) for (int s=0; s<6; s++){ + if (my_SPs[e][s]) delete my_SPs[e][s]; + my_SPs[e][s] = new CSCTFSectorProcessor(e+1, s+1, CSCTFSPset, true, muScales.product(), muPtScale.product()); + my_SPs[e][s]->initialize(iSetup); + } + muScalesCacheID_ = iSetup.get< L1MuTriggerScalesRcd >().cacheIdentifier(); + muPtScaleCacheID_ = iSetup.get< L1MuTriggerPtScaleRcd >().cacheIdentifier(); + } +} - // Get the propagators - iSetup.get().get("SmartPropagatorAnyRK", propagatorAlong); - iSetup.get().get("SmartPropagatorAnyOpposite", propagatorOpposite); +// ================================================================================================ +void +GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + // get conditions for bad chambers (don't need random engine) + theStripConditions->initializeEvent(iSetup); + + // get SimHits + theCSCSimHitMap.fill(iEvent); + +// analyzeALCTRate(iEvent); +// analyzeCLCTRate(iEvent); +// analyzeLCTRate(iEvent); +// analyzeMPLCTRate(iEvent); +// analyzeTFTrackRate(iEvent); +// analyzeTFCandRate(iEvent); +// analyzeGMTCandRate(iEvent); // get MC @@ -754,8 +746,6 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup // iEvent.getByLabel("g4SimHits", hSimVertices); // const SimVertexContainer & simVertices = *(hSimVertices.product()); - // get SimHits - theCSCSimHitMap.fill(iEvent); // edm::Handle< PSimHitContainer > MuonCSCHits; // iEvent.getByLabel("g4SimHits", "MuonCSCHits", MuonCSCHits); @@ -2333,26 +2323,10 @@ bool GEMCSCTriggerRate::filter(edm::Event& iEvent, const edm::EventSetup& iSetup if (debugRATE) std::cout<< "----- end ngmt="< 1/a, 1/b, 1/2, 1/3, 2/1... +// ================================================================================================ + // Returns chamber type (0-9) according to CSCChamberSpecs type + // 1..10 -> 1/a, 1/b, 1/2, 1/3, 2/1... int GEMCSCTriggerRate::getCSCSpecsType(CSCDetId &id) { @@ -2450,8 +2426,8 @@ GEMCSCTriggerRate::cscTriggerSubsector(CSCDetId &id) // ================================================================================================ - -void GEMCSCTriggerRate::setupTFModeHisto(TH1D* h) +void +GEMCSCTriggerRate::setupTFModeHisto(TH1D* h) { if (h==0) return; if (h->GetXaxis()->GetNbins()<16) { @@ -2479,8 +2455,8 @@ void GEMCSCTriggerRate::setupTFModeHisto(TH1D* h) } // ================================================================================================ - -std::pair GEMCSCTriggerRate::intersectionEtaPhi(CSCDetId id, int wg, int hs) +std::pair +GEMCSCTriggerRate::intersectionEtaPhi(CSCDetId id, int wg, int hs) { CSCDetId layerId(id.endcap(), id.station(), id.ring(), id.chamber(), CSCConstants::KEY_CLCT_LAYER); @@ -2502,8 +2478,8 @@ std::pair GEMCSCTriggerRate::intersectionEtaPhi(CSCDetId id, int w } // ================================================================================================ - -csctf::TrackStub GEMCSCTriggerRate::buildTrackStub(const CSCCorrelatedLCTDigi &d, CSCDetId id) +csctf::TrackStub +GEMCSCTriggerRate::buildTrackStub(const CSCCorrelatedLCTDigi &d, CSCDetId id) { unsigned fpga = (id.station() == 1) ? CSCTriggerNumbering::triggerSubSectorFromLabels(id) - 1 : id.station(); CSCSectorReceiverLUT* srLUT = srLUTs_[fpga][id.triggerSector()-1][id.endcap()-1]; @@ -2524,16 +2500,5 @@ csctf::TrackStub GEMCSCTriggerRate::buildTrackStub(const CSCCorrelatedLCTDigi &d return csctf::TrackStub(d, id, gblPhi.global_phi, gblEta.global_eta); } -// ================================================================================================ -// ------------ method called once each job just before starting event loop ------------ -void -GEMCSCTriggerRate::beginJob() {} - -// ================================================================================================ -// ------------ method called once each job just after ending the event loop ------------ -void -GEMCSCTriggerRate::endJob() {} - - //define this as a plug-in DEFINE_FWK_MODULE(GEMCSCTriggerRate); diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.h b/SimMuL1/plugins/GEMCSCTriggerRate.h index fbcd33210cc57..e0eee6acf1b4e 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.h +++ b/SimMuL1/plugins/GEMCSCTriggerRate.h @@ -7,7 +7,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -18,24 +18,12 @@ #include "FWCore/ServiceRegistry/interface/Service.h" #include "CommonTools/UtilAlgos/interface/TFileService.h" -#include "TH1.h" -#include "TH2.h" -#include "TTree.h" - -//#include "TLorentzVector.h" -//#include "DataFormats/Math/interface/LorentzVector.h" -//#include - #include "Geometry/Records/interface/MuonGeometryRecord.h" #include "Geometry/CSCGeometry/interface/CSCGeometry.h" //#include #include "Geometry/DTGeometry/interface/DTGeometry.h" #include "Geometry/RPCGeometry/interface/RPCGeometry.h" -#include "TrackingTools/GeomPropagators/interface/Propagator.h" -#include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h" - - #include "DataFormats/MuonDetId/interface/CSCDetId.h" //#include #include @@ -55,16 +43,19 @@ #include #include -#include "SimDataFormats/Track/interface/SimTrackContainer.h" -#include "SimDataFormats/Vertex/interface/SimVertexContainer.h" - #include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h" #include "CondFormats/L1TObjects/interface/L1MuTriggerPtScale.h" -//#include "SimMuon/MCTruth/interface/PSimHitMap.h" #include "GEMCode/SimMuL1/interface/PSimHitMap.h" #include "GEMCode/SimMuL1/interface/MatchCSCMuL1.h" +// ROOT +#include "TH1.h" +#include "TH2.h" +#include "TTree.h" + + + class DTGeometry; class CSCGeometry; class RPCGeometry; @@ -78,13 +69,20 @@ class CSCTFDTReceiver; class CSCStripConditions; -class GEMCSCTriggerRate : public edm::EDFilter +class GEMCSCTriggerRate : public edm::EDAnalyzer { public: explicit GEMCSCTriggerRate(const edm::ParameterSet&); + ~GEMCSCTriggerRate(); + virtual void beginJob(); + + virtual void beginRun(const edm::Run&, const edm::EventSetup&); + + virtual void analyze(const edm::Event&, const edm::EventSetup&); + enum trig_cscs {MAX_STATIONS = 4, CSC_TYPES = 10}; //Various useful constants static const std::string csc_type[CSC_TYPES+1]; @@ -94,129 +92,27 @@ class GEMCSCTriggerRate : public edm::EDFilter static const int NCHAMBERS[CSC_TYPES]; static const int MAX_WG[CSC_TYPES]; static const int MAX_HS[CSC_TYPES]; -// static const float ptscale[33]; static const int pbend[CSCConstants::NUM_CLCT_PATTERNS]; enum pt_thresh {N_PT_THRESHOLDS = 6}; static const double PT_THRESHOLDS[N_PT_THRESHOLDS]; static const double PT_THRESHOLDS_FOR_ETA[N_PT_THRESHOLDS]; - int getCSCType(CSCDetId &id); int isME11(int t); int getCSCSpecsType(CSCDetId &id); int cscTriggerSubsector(CSCDetId &id); - std::vector fillSimTrackFamilyIds(unsigned index, - const edm::SimTrackContainer & simTracks, const edm::SimVertexContainer & simVertices); - - std::vector hitsFromSimTrack(std::vector ids, SimHitAnalysis::PSimHitMap &hitMap); - std::vector hitsFromSimTrack(unsigned id, SimHitAnalysis::PSimHitMap &hitMap); - std::vector hitsFromSimTrack(unsigned id, int detId, SimHitAnalysis::PSimHitMap &hitMap); - - int particleType(int simTrack); - - bool compareSimHits(PSimHit &sh1, PSimHit &sh2); - - void propagateToCSCStations(MatchCSCMuL1 *match); - - void matchSimTrack2SimHits( MatchCSCMuL1 *match, - const edm::SimTrackContainer & simTracks, - const edm::SimVertexContainer & simVertices, - const edm::PSimHitContainer* allCSCSimHits); - - unsigned matchCSCAnodeHits( - const std::vector& allLayerInfo, - std::vector &matchedHit) ; - - unsigned matchCSCCathodeHits( - const std::vector& allLayerInfo, - std::vector &matchedHit) ; - - void matchSimTrack2ALCTs( MatchCSCMuL1 *match, - const edm::PSimHitContainer* allCSCSimHits, - const CSCALCTDigiCollection* alcts, - const CSCWireDigiCollection* wiredc ); - - void matchSimTrack2CLCTs( MatchCSCMuL1 *match, - const edm::PSimHitContainer* allCSCSimHits, - const CSCCLCTDigiCollection *clcts, - const CSCComparatorDigiCollection* compdc ); - - void matchSimTrack2LCTs( MatchCSCMuL1 *match, - const CSCCorrelatedLCTDigiCollection* lcts ); - - void matchSimTrack2MPLCTs( MatchCSCMuL1 *match, - const CSCCorrelatedLCTDigiCollection* mplcts ); - - void matchSimtrack2TFTRACKs( MatchCSCMuL1 *match, - edm::ESHandle< L1MuTriggerScales > &muScales, - edm::ESHandle< L1MuTriggerPtScale > &muPtScale, - const L1CSCTrackCollection* l1Tracks); - - void matchSimtrack2TFCANDs( MatchCSCMuL1 *match, - edm::ESHandle< L1MuTriggerScales > &muScales, - edm::ESHandle< L1MuTriggerPtScale > &muPtScale, - const std::vector< L1MuRegionalCand > *l1TfCands); - - void matchSimtrack2GMTCANDs( MatchCSCMuL1 *match, - edm::ESHandle< L1MuTriggerScales > &muScales, - edm::ESHandle< L1MuTriggerPtScale > &muPtScale, - const std::vector< L1MuGMTExtendedCand> &l1GmtCands, - const std::vector &l1GmtCSCCands, - const std::map > &l1GmtCSCCandsInBXs); - - - // fit muon's hits to a 2D linear stub in a chamber : - // wires: work in 2D plane going through z axis : - // z becomes a new x axis, and new y is perpendicular to it - // (using SimTrack's position point as well when there is <= 2 mu's hits in chamber) - // fit a 2D stub from SimHits matched to a digi - // set deltas between SimTrack's and Digi's 2D stubs in (Z,R) -> (x,y) plane - int calculate2DStubsDeltas(MatchCSCMuL1 *match, MatchCSCMuL1::ALCT &alct); - - // fit muon's hits to a 2D linear stub in a chamber : - // stripes: work in 2D cylindrical surface : - // z becomes a new x axis, and phi is a new y axis - // (using SimTrack stub with no-bend in phi if there is 1 mu's hit in chamber) - // fit a 2D stub from SimHits matched to a digi - // set deltas between SimTrack's and Digi's 2D stubs in (Z,Phi) -> (x,y) plane - int calculate2DStubsDeltas(MatchCSCMuL1 *match, MatchCSCMuL1::CLCT &clct); - - - math::XYZVectorD cscSimHitGlobalPosition ( PSimHit &h ); - math::XYZVectorD cscSimHitGlobalPositionX0( PSimHit &h ); - - TrajectoryStateOnSurface propagateSimTrackToZ(const SimTrack *track, const SimVertex *vtx, double z); - TrajectoryStateOnSurface propagateSimTrackToDT(const SimTrack *track, const SimVertex *vtx); - - // 4-bit LCT quality number - unsigned int findQuality(const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT); - - // Visualization of wire group digis - void dumpWireDigis(CSCDetId &id, const CSCWireDigiCollection* wiredc); - - // From Ingo: // calculates the weight of the event to reproduce a min bias //spectrum, from G. Wrochna's note CMSS 1997/096 - static void setupTFModeHisto(TH1D* h); std::pair intersectionEtaPhi(CSCDetId id, int wg, int hs); csctf::TrackStub buildTrackStub(const CSCCorrelatedLCTDigi &d, CSCDetId id); - void cleanUp(); - private: -// methods - virtual void beginJob() ; - //virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual bool filter(edm::Event&, const edm::EventSetup&); - virtual void endJob() ; - - edm::ParameterSet ptLUTset; edm::ParameterSet CSCTFSPset; CSCTFPtLUT* ptLUT; @@ -230,10 +126,17 @@ class GEMCSCTriggerRate : public edm::EDFilter edm::ESHandle< L1MuTriggerScales > muScales; edm::ESHandle< L1MuTriggerPtScale > muPtScale; -// config parameters: + void analyzeALCTRate(const edm::Event&); + void analyzeCLCTRate(const edm::Event&); + void analyzeLCTRate(const edm::Event&); + void analyzeMPLCTRate(const edm::Event&); + void analyzeTFTrackRate(const edm::Event&); + void analyzeTFCandRate(const edm::Event&); + void analyzeGMTRegionalRate(const edm::Event&); + void analyzeGMTCandRate(const edm::Event&); + // config parameters: bool lightRun; - bool gangedME1a; bool defaultME1a; bool doStrictSimHitToTrackMatch_; @@ -294,32 +197,25 @@ class GEMCSCTriggerRate : public edm::EDFilter bool doME1a_, naiveME1a_; - bool addGhostLCTs_; - bool minNStWith4Hits_; bool requireME1With4Hits_; double minSimTrackDR_; -// members + // members std::vector matches; - std::map trkId2Index; const CSCGeometry* cscGeometry; const DTGeometry* dtGeometry; const RPCGeometry* rpcGeometry; - edm::ESHandle muonGeometry; - const GEMGeometry* gemGeometry; edm::ParameterSet gemMatchCfg_; std::vector gemPTs_, gemDPhisOdd_, gemDPhisEven_; - bool isGEMDPhiGood(double dphi, double tfpt, int is_odd); - -// simhits for matching to simtracks: + // simhits for matching to simtracks: bool simHitsFromCrossingFrame_; std::string simHitsModuleName_; std::string simHitsCollectionName_; @@ -328,659 +224,8 @@ class GEMCSCTriggerRate : public edm::EDFilter //SimHitAnalysis::PSimHitMap theDTSimHitMap; //SimHitAnalysis::PSimHitMap theRPCSimHitMap; - CSCStripConditions * theStripConditions; - std::vector ghostLCTs; - - // propagators - edm::ESHandle propagatorAlong; - edm::ESHandle propagatorOpposite; - edm::ESHandle theBField; - - - int nevt; - - TH1D * h_N_mctr; - TH1D * h_N_simtr; - - TH1D * h_pt_mctr; - TH1D * h_eta_mctr; - TH1D * h_phi_mctr; - - TH1D * h_DR_mctr_simtr; - TH1D * h_MinDR_mctr_simtr; - - TH1D * h_DR_2SimTr; - TH1D * h_DR_2SimTr_looked; - TH1D * h_DR_2SimTr_after_mpc_ok_plus; - TH1D * h_DR_2SimTr_after_tfcand_ok_plus; - - TH2D * h_csctype_vs_alct_occup; - TH2D * h_csctype_vs_clct_occup; - - TH2D * h_eta_vs_nalct; - TH2D * h_eta_vs_nclct; - TH2D * h_eta_vs_nlct; - TH2D * h_eta_vs_nmplct; - - TH2D * h_pt_vs_nalct; - TH2D * h_pt_vs_nclct; - TH2D * h_pt_vs_nlct; - TH2D * h_pt_vs_nmplct; - - TH2D * h_csctype_vs_nlct; - TH2D * h_csctype_vs_nmplct; - - TH2D * h_eta_vs_nalct_cscstation[MAX_STATIONS]; - TH2D * h_eta_vs_nclct_cscstation[MAX_STATIONS]; - TH2D * h_eta_vs_nlct_cscstation[MAX_STATIONS]; - - TH2D * h_eta_vs_nalct_cscstation_ok[MAX_STATIONS]; - TH2D * h_eta_vs_nclct_cscstation_ok[MAX_STATIONS]; - TH2D * h_eta_vs_nlct_cscstation_ok[MAX_STATIONS]; - - TH2D * h_nmusimhits_vs_nalct_cscdet[CSC_TYPES]; - TH2D * h_nmusimhits_vs_nclct_cscdet[CSC_TYPES]; - TH2D * h_nmusimhits_vs_nlct_cscdet[CSC_TYPES]; - - TH1D * h_deltaY__alct_cscdet[CSC_TYPES]; - TH1D * h_deltaY__clct_cscdet[CSC_TYPES]; - TH1D * h_deltaPhi__alct_cscdet[CSC_TYPES]; - TH1D * h_deltaPhi__clct_cscdet[CSC_TYPES]; - -// TH1D * h_deltaY__alct_cscdet_nl[CSC_TYPES][7]; -// TH1D * h_deltaY__clct_cscdet_nl[CSC_TYPES][7]; -// TH1D * h_deltaPhi__alct_cscdet_nl[CSC_TYPES][7]; -// TH1D * h_deltaPhi__clct_cscdet_nl[CSC_TYPES][7]; - - - TH2D * h_ov_nmusimhits_vs_nalct_cscdet[CSC_TYPES]; - TH2D * h_ov_nmusimhits_vs_nclct_cscdet[CSC_TYPES]; - TH2D * h_ov_nmusimhits_vs_nlct_cscdet[CSC_TYPES]; - - TH1D * h_ov_deltaY__alct_cscdet[CSC_TYPES]; - TH1D * h_ov_deltaY__clct_cscdet[CSC_TYPES]; - TH1D * h_ov_deltaPhi__alct_cscdet[CSC_TYPES]; - TH1D * h_ov_deltaPhi__clct_cscdet[CSC_TYPES]; - -// TH1D * h_ov_deltaY__alct_cscdet_nl[CSC_TYPES][7]; -// TH1D * h_ov_deltaY__clct_cscdet_nl[CSC_TYPES][7]; -// TH1D * h_ov_deltaPhi__alct_cscdet_nl[CSC_TYPES][7]; -// TH1D * h_ov_deltaPhi__clct_cscdet_nl[CSC_TYPES][7]; - - TH1D * h_delta__wire_cscdet[CSC_TYPES]; - TH1D * h_delta__strip_cscdet[CSC_TYPES]; - - TH1D * h_ov_delta__wire_cscdet[CSC_TYPES]; - TH1D * h_ov_delta__strip_cscdet[CSC_TYPES]; - - TH1D * h_bx__alct_cscdet[CSC_TYPES]; - TH1D * h_bx__clct_cscdet[CSC_TYPES]; - TH1D * h_bx__lct_cscdet[CSC_TYPES]; - TH1D * h_bx__mpc_cscdet[CSC_TYPES]; - - TH2D * h_bx_lct__alct_vs_clct_cscdet[CSC_TYPES]; - - TH1D * h_bx_min__alct_cscdet[CSC_TYPES]; - TH1D * h_bx_min__clct_cscdet[CSC_TYPES]; - TH1D * h_bx_min__lct_cscdet[CSC_TYPES]; - TH1D * h_bx_min__mpc_cscdet[CSC_TYPES]; - - TH1D * h_bx__alctOk_cscdet[CSC_TYPES]; - TH1D * h_bx__clctOk_cscdet[CSC_TYPES]; - - TH1D * h_bx__alctOkBest_cscdet[CSC_TYPES]; - TH1D * h_bx__clctOkBest_cscdet[CSC_TYPES]; - - TH2D * h_wg_vs_bx__alctOkBest_cscdet[CSC_TYPES]; - - TH1D * h_bxf__alct_cscdet[CSC_TYPES]; - TH1D * h_bxf__clct_cscdet[CSC_TYPES]; - TH1D * h_bxf__alctOk_cscdet[CSC_TYPES]; - TH1D * h_bxf__clctOk_cscdet[CSC_TYPES]; - - TH1D * h_dbxbxf__alct_cscdet[CSC_TYPES]; - TH1D * h_dbxbxf__clct_cscdet[CSC_TYPES]; - - TH2D * h_bx_me11nomatchclct_alct_vs_clct; - TH2D * h_bx_me11nomatchalct_alct_vs_clct; - - TH2D * h_bx_me1_aclct_ok_lct_no__bx_alct_vs_dbx_ACLCT; - - TH2D * h_nMplct_vs_nDigiMplct; - TH2D * h_qu_vs_nDigiMplct; - - TH2D * h_ntftrackall_vs_ntftrack; - TH2D * h_ntfcandall_vs_ntfcand; - - TH2D * h_eta_vs_ntfcand; - TH2D * h_pt_vs_ntfcand; - - TH2D * h_pt_vs_qu; - TH2D * h_eta_vs_qu; - - TH1D * h_cscdet_of_chamber; - TH1D * h_cscdet_of_chamber_w_alct; - TH1D * h_cscdet_of_chamber_w_clct; - TH1D * h_cscdet_of_chamber_w_mplct; - - - - TH1D * h_pt_initial0; - TH1D * h_pt_initial; - TH1D * h_pt_initial_1b; - TH1D * h_pt_initial_gem_1b; - - TH1D * h_pt_me1_initial; - TH1D * h_pt_me2_initial; - TH1D * h_pt_me3_initial; - TH1D * h_pt_me4_initial; - - TH1D * h_pt_initial_1st; - TH1D * h_pt_initial_2st; - TH1D * h_pt_initial_3st; - - TH1D * h_pt_me1_initial_2st; - TH1D * h_pt_me1_initial_3st; - - - TH1D * h_pt_gem_1b; - TH1D * h_pt_lctgem_1b; - - TH1D * h_pt_me1_mpc; - TH1D * h_pt_me2_mpc; - TH1D * h_pt_me3_mpc; - TH1D * h_pt_me4_mpc; - - TH1D * h_pt_mpc_1st; - TH1D * h_pt_mpc_2st; - TH1D * h_pt_mpc_3st; - - TH1D * h_pt_me1_mpc_2st; - TH1D * h_pt_me1_mpc_3st; - - TH1D * h_pt_tf_initial0_tfpt[N_PT_THRESHOLDS]; - TH1D * h_pt_tf_initial_tfpt[N_PT_THRESHOLDS]; - TH1D * h_pt_tf_stubs222_tfpt[N_PT_THRESHOLDS]; - TH1D * h_pt_tf_stubs223_tfpt[N_PT_THRESHOLDS]; - TH1D * h_pt_tf_stubs233_tfpt[N_PT_THRESHOLDS]; - - - TH1D * h_pt_after_alct; - TH1D * h_pt_after_clct; - TH1D * h_pt_after_lct; - TH1D * h_pt_after_mpc; - TH1D * h_pt_after_mpc_ok_plus; - TH1D * h_pt_after_tftrack; - TH1D * h_pt_after_tfcand; - TH1D * h_pt_after_tfcand_pt10; - TH1D * h_pt_after_tfcand_pt20; - TH1D * h_pt_after_tfcand_pt40; - TH1D * h_pt_after_tfcand_pt60; - - TH1D * h_pt_after_tfcand_ok; - TH1D * h_pt_after_tfcand_pt10_ok; - TH1D * h_pt_after_tfcand_pt20_ok; - TH1D * h_pt_after_tfcand_pt40_ok; - TH1D * h_pt_after_tfcand_pt60_ok; - - TH1D * h_pt_after_tfcand_ok_plus; - TH1D * h_pt_after_tfcand_ok_plus_pt10; - TH1D * h_pt_after_tfcand_ok_plus_q[3]; - TH1D * h_pt_after_tfcand_ok_plus_pt10_q[3]; - - TH1D * h_pt_after_tfcand_all; - TH1D * h_pt_after_tfcand_all_ok; - TH1D * h_pt_after_tfcand_all_pt10_ok; - TH1D * h_pt_after_tfcand_all_pt20_ok; - TH1D * h_pt_after_tfcand_all_pt40_ok; - TH1D * h_pt_after_tfcand_all_pt60_ok; - - - TH1D * h_pt_after_tfcand_eta1b_2s[7]; - TH1D * h_pt_after_tfcand_eta1b_2s1b[7]; - TH1D * h_pt_after_tfcand_eta1b_2s123[7]; - TH1D * h_pt_after_tfcand_eta1b_2s13[7]; - TH1D * h_pt_after_tfcand_eta1b_3s[7]; - TH1D * h_pt_after_tfcand_eta1b_3s1b[7]; - TH1D * h_pt_after_tfcand_gem1b_2s1b[7]; - TH1D * h_pt_after_tfcand_gem1b_2s123[7]; - TH1D * h_pt_after_tfcand_gem1b_2s13[7]; - TH1D * h_pt_after_tfcand_gem1b_3s1b[7]; - TH1D * h_pt_after_tfcand_dphigem1b_2s1b[7]; - TH1D * h_pt_after_tfcand_dphigem1b_2s123[7]; - TH1D * h_pt_after_tfcand_dphigem1b_2s13[7]; - TH1D * h_pt_after_tfcand_dphigem1b_3s1b[7]; - - TH1D * h_mode_tfcand_gem1b_2s1b_1b[7]; - - - TH1D * h_pt_after_gmtreg; - TH1D * h_pt_after_gmtreg_all; - TH1D * h_pt_after_gmtreg_dr; - TH1D * h_pt_after_gmt; - TH1D * h_pt_after_gmt_all; - TH1D * h_pt_after_gmt_dr; - TH1D * h_pt_after_gmt_dr_nocsc; - TH1D * h_pt_after_gmtreg_pt10; - TH1D * h_pt_after_gmtreg_all_pt10; - TH1D * h_pt_after_gmtreg_dr_pt10; - TH1D * h_pt_after_gmt_pt10; - TH1D * h_pt_after_gmt_all_pt10; - TH1D * h_pt_after_gmt_dr_pt10; - TH1D * h_pt_after_gmt_dr_nocsc_pt10; - - TH1D * h_pt_after_gmt_eta1b_1mu[7]; - TH1D * h_pt_after_gmt_gem1b_1mu[7]; - TH1D * h_pt_after_gmt_dphigem1b_1mu[7]; - - TH1D * h_pt_after_xtra; - TH1D * h_pt_after_xtra_all; - TH1D * h_pt_after_xtra_dr; - TH1D * h_pt_after_xtra_pt10; - TH1D * h_pt_after_xtra_all_pt10; - TH1D * h_pt_after_xtra_dr_pt10; - - TH1D * h_pt_me1_after_mpc_ok_plus; - TH1D * h_pt_me1_after_tf_ok_plus; - TH1D * h_pt_me1_after_tf_ok_plus_pt10; - TH1D * h_pt_me1_after_tf_ok_plus_q[3]; - TH1D * h_pt_me1_after_tf_ok_plus_pt10_q[3]; - - - // high eta pt distros - TH1D * h_pth_initial; - TH1D * h_pth_after_mpc; - TH1D * h_pth_after_mpc_ok_plus; - - TH1D * h_pth_after_tfcand; - TH1D * h_pth_after_tfcand_pt10; - - TH1D * h_pth_after_tfcand_ok; - TH1D * h_pth_after_tfcand_pt10_ok; - - TH1D * h_pth_after_tfcand_ok_plus; - TH1D * h_pth_after_tfcand_ok_plus_pt10; - TH1D * h_pth_after_tfcand_ok_plus_q[3]; - TH1D * h_pth_after_tfcand_ok_plus_pt10_q[3]; - - TH1D * h_pth_me1_after_mpc_ok_plus; - TH1D * h_pth_me1_after_tf_ok_plus; - TH1D * h_pth_me1_after_tf_ok_plus_pt10; - TH1D * h_pth_me1_after_tf_ok_plus_q[3]; - TH1D * h_pth_me1_after_tf_ok_plus_pt10_q[3]; - - TH1D * h_pth_over_tfpt_resol; - TH2D * h_pth_over_tfpt_resol_vs_pt; - - - TH1D * h_pth_after_tfcand_ok_plus_3st1a; - TH1D * h_pth_after_tfcand_ok_plus_pt10_3st1a; - TH1D * h_pth_me1_after_tf_ok_plus_3st1a; - TH1D * h_pth_me1_after_tf_ok_plus_pt10_3st1a; - - - // - TH1D * h_eta_initial0; - TH1D * h_eta_initial; - - TH1D * h_eta_me1_initial; - TH1D * h_eta_me2_initial; - TH1D * h_eta_me3_initial; - TH1D * h_eta_me4_initial; - - TH1D * h_eta_initial_1st; - TH1D * h_eta_initial_2st; - TH1D * h_eta_initial_3st; - - TH1D * h_eta_me1_initial_2st; - TH1D * h_eta_me1_initial_3st; - - - TH1D * h_eta_me1_mpc; - TH1D * h_eta_me2_mpc; - TH1D * h_eta_me3_mpc; - TH1D * h_eta_me4_mpc; - - TH1D * h_eta_mpc_1st; - TH1D * h_eta_mpc_2st; - TH1D * h_eta_mpc_3st; - - TH1D * h_eta_me1_mpc_2st; - TH1D * h_eta_me1_mpc_3st; - - - TH1D * h_eta_tf_initial0_tfpt[N_PT_THRESHOLDS]; - TH1D * h_eta_tf_initial_tfpt[N_PT_THRESHOLDS]; - TH1D * h_eta_tf_stubs222_tfpt[N_PT_THRESHOLDS]; - TH1D * h_eta_tf_stubs223_tfpt[N_PT_THRESHOLDS]; - TH1D * h_eta_tf_stubs233_tfpt[N_PT_THRESHOLDS]; - - - TH1D * h_eta_after_alct; - TH1D * h_eta_after_clct; - TH1D * h_eta_after_lct; - TH1D * h_eta_after_mpc; - TH1D * h_eta_after_mpc_ok; - TH1D * h_eta_after_mpc_ok_plus; - TH1D * h_eta_after_mpc_ok_plus_3st; - TH1D * h_eta_after_mpc_st1; - TH1D * h_eta_after_mpc_st1_good; - TH1D * h_eta_after_tftrack; - TH1D * h_eta_after_tftrack_q[3]; - TH1D * h_eta_after_tfcand; - TH1D * h_eta_after_tfcand_q[3]; - TH1D * h_eta_after_tfcand_ok; - TH1D * h_eta_after_tfcand_ok_plus; - TH1D * h_eta_after_tfcand_ok_pt10; - TH1D * h_eta_after_tfcand_ok_plus_pt10; - TH1D * h_eta_after_tfcand_ok_plus_q[3]; - TH1D * h_eta_after_tfcand_ok_plus_pt10_q[3]; - TH1D * h_eta_after_tfcand_pt10; - TH1D * h_eta_after_tfcand_all; - TH1D * h_eta_after_tfcand_all_pt10; - TH1D * h_eta_after_tfcand_my_st1; - TH1D * h_eta_after_tfcand_org_st1; - TH1D * h_eta_after_tfcand_comm_st1; - TH1D * h_eta_after_tfcand_my_st1_pt10; - - TH1D * h_eta_after_gmtreg; - TH1D * h_eta_after_gmtreg_all; - TH1D * h_eta_after_gmtreg_dr; - TH1D * h_eta_after_gmt; - TH1D * h_eta_after_gmt_all; - TH1D * h_eta_after_gmt_dr; - TH1D * h_eta_after_gmt_dr_nocsc; - TH1D * h_eta_after_gmtreg_pt10; - TH1D * h_eta_after_gmtreg_all_pt10; - TH1D * h_eta_after_gmtreg_dr_pt10; - TH1D * h_eta_after_gmt_pt10; - TH1D * h_eta_after_gmt_all_pt10; - TH1D * h_eta_after_gmt_dr_pt10; - TH1D * h_eta_after_gmt_dr_nocsc_pt10; - - TH1D * h_eta_after_xtra; - TH1D * h_eta_after_xtra_all; - TH1D * h_eta_after_xtra_dr; - TH1D * h_eta_after_xtra_pt10; - TH1D * h_eta_after_xtra_all_pt10; - TH1D * h_eta_after_xtra_dr_pt10; - - TH2D * h_eta_vs_bx_after_alct; - TH2D * h_eta_vs_bx_after_clct; - TH2D * h_eta_vs_bx_after_lct; - TH2D * h_eta_vs_bx_after_mpc; - - TH1D * h_eta_me1_after_alct; - TH1D * h_eta_me1_after_alct_okAlct; - TH1D * h_eta_me1_after_clct; - TH1D * h_eta_me1_after_clct_okClct; - TH1D * h_eta_me1_after_alctclct; - TH1D * h_eta_me1_after_alctclct_okAlct; - TH1D * h_eta_me1_after_alctclct_okClct; - TH1D * h_eta_me1_after_alctclct_okAlctClct; - - TH1D * h_eta_me1_after_lct; - TH1D * h_eta_me1_after_lct_okAlct; - TH1D * h_eta_me1_after_lct_okAlctClct; - TH1D * h_eta_me1_after_lct_okClct; - TH1D * h_eta_me1_after_lct_okClctAlct; - TH1D * h_eta_me1_after_mplct_okAlctClct; - TH1D * h_eta_me1_after_mplct_okAlctClct_plus; - TH1D * h_eta_me1_after_tf_ok; - TH1D * h_eta_me1_after_tf_ok_pt10; - TH1D * h_eta_me1_after_tf_ok_plus; - TH1D * h_eta_me1_after_tf_ok_plus_pt10; - TH1D * h_eta_me1_after_tf_ok_plus_q[3]; - TH1D * h_eta_me1_after_tf_ok_plus_pt10_q[3]; - //TH1D * h_eta_me1_after_tf_all; - //TH1D * h_eta_me1_after_tf_all_pt10; - - - TH1D * h_eta_me1_after_mplct_ok; - TH1D * h_eta_me2_after_mplct_ok; - TH1D * h_eta_me3_after_mplct_ok; - TH1D * h_eta_me4_after_mplct_ok; - - - - TH1D * h_eta_after_mpc_ok_plus_3st1a; - TH1D * h_eta_after_tfcand_ok_plus_3st1a; - TH1D * h_eta_after_tfcand_ok_plus_pt10_3st1a; - TH1D * h_eta_me1_after_tf_ok_plus_3st1a; - TH1D * h_eta_me1_after_tf_ok_plus_pt10_3st1a; - - - TH1D * h_wg_me11_initial; - TH1D * h_wg_me11_after_alct_okAlct; - TH1D * h_wg_me11_after_alctclct_okAlctClct; - TH1D * h_wg_me11_after_lct_okAlctClct; - - TH1D * h_bx_after_alct; - TH1D * h_bx_after_clct; - TH1D * h_bx_after_lct; - TH1D * h_bx_after_mpc; - - TH1D * h_phi_initial; - TH1D * h_phi_after_alct; - TH1D * h_phi_after_clct; - TH1D * h_phi_after_lct; - TH1D * h_phi_after_mpc; - TH1D * h_phi_after_tftrack; - TH1D * h_phi_after_tfcand; - TH1D * h_phi_after_tfcand_all; - TH1D * h_phi_after_gmtreg; - TH1D * h_phi_after_gmtreg_all; - TH1D * h_phi_after_gmtreg_dr; - TH1D * h_phi_after_gmt; - TH1D * h_phi_after_gmt_all; - TH1D * h_phi_after_gmt_dr; - TH1D * h_phi_after_gmt_dr_nocsc; - TH1D * h_phi_after_xtra; - TH1D * h_phi_after_xtra_all; - TH1D * h_phi_after_xtra_dr; - - - TH1D * h_qu_alct; - TH1D * h_qu_clct; - TH1D * h_qu_lct; - TH1D * h_qu_mplct; - TH2D * h_qu_vs_bx__alct; - TH2D * h_qu_vs_bx__clct; - TH2D * h_qu_vs_bx__lct; - TH2D * h_qu_vs_bx__mplct; - - TH2D * h_qu_vs_bxclct__lct; - - TH2D * h_pt_vs_bend__clct_cscdet[CSC_TYPES]; - TH2D * h_pt_vs_bend__clctOk_cscdet[CSC_TYPES]; - TH1D * h_bend__clctOk_cscdet[CSC_TYPES]; - - TH1D * h_pattern_mplct; - TH1D * h_pattern_mplct_cscdet[CSC_TYPES]; - - TH1D * h_type_lct; - TH1D * h_type_lct_cscdet[CSC_TYPES]; - - TH2D * h_bxdbx_alct_a1_da2; - TH2D * h_bxdbx_alct_a1_da2_cscdet[CSC_TYPES]; - TH2D * h_bxdbx_clct_c1_dc2; - TH2D * h_bxdbx_clct_c1_dc2_cscdet[CSC_TYPES]; - - TH2D * h_dbx_lct_a1_a2; - TH2D * h_dbx_lct_a1_a2_cscdet[CSC_TYPES]; - TH2D * h_bx_lct_a1_a2; - TH2D * h_bx_lct_a1_a2_cscdet[CSC_TYPES]; - - TH1D * h_tf_stub_bx; - TH1D * h_tf_stub_bx_cscdet[CSC_TYPES]; - TH1D * h_tf_stub_qu; - TH1D * h_tf_stub_qu_cscdet[CSC_TYPES]; - TH2D * h_tf_stub_qu_vs_bx; - TH2D * h_tf_stub_qu_vs_bx_cscdet[CSC_TYPES]; - TH1D * h_tf_stub_csctype; - TH1D * h_tf_stub_csctype_org; - TH1D * h_tf_stub_csctype_org_unmatch; - - TH1D * h_tf_stub_bxclct; - TH1D * h_tf_stub_bxclct_cscdet[CSC_TYPES]; - - TH1D * h_tf_stub_pattern; - TH1D * h_tf_stub_pattern_cscdet[CSC_TYPES]; - - TH1D * h_tf_n_uncommon_stubs; - TH1D * h_tf_n_stubs; - TH1D * h_tf_n_matchstubs; - TH2D * h_tf_n_stubs_vs_matchstubs; - - TH1D * h_tfpt; - TH2D * h_tfpt_vs_qu; - TH1D * h_tfeta; - TH1D * h_tfphi; - TH1D * h_tfbx; - TH1D * h_tfqu; - TH1D * h_tfdr; - TH1D * h_tf_mode; - - TH1D * h_tf_pt_h42_2st; - TH1D * h_tf_pt_h42_3st; - TH1D * h_tf_pt_h42_2st_w; - TH1D * h_tf_pt_h42_3st_w; - - TH1D * h_tf_check_mode; - TH1D * h_tf_check_bx; - TH2D * h_tf_check_n_stubs_vs_matched; - TH2D * h_tf_check_st1_mcStrip_vs_ptbin; - TH2D * h_tf_check_st1_mcStrip_vs_ptbin_all; - TH2D * h_tf_check_st1_mcWG_vs_ptbin_all; - TH1D * h_tf_check_st1_wg; - TH1D * h_tf_check_st1_strip; - TH1D * h_tf_check_st1_mcStrip; - TH1D * h_tf_check_st1_chamber; - //TH2D * h_tf_check_st1_scaledDPhi12_vs_ptbin; - //TH2D * h_tf_check_st1_scaledDPhi12_vs_ptbin_ok; - //TH2D * h_tf_check_st1_scaledDPhi23_vs_ptbin; - //TH2D * h_tf_check_st1_scaledDPhi23_vs_ptbin_ok; - - TH1D * h_gmtpt; - TH1D * h_gmteta; - TH1D * h_gmtphi; - TH1D * h_gmtbx; - TH1D * h_gmtrank; - TH1D * h_gmtqu; - TH1D * h_gmtisrpc; - TH1D * h_gmtdr; - - TH1D * h_gmtxpt; - TH1D * h_gmtxeta; - TH1D * h_gmtxphi; - TH1D * h_gmtxbx; - TH1D * h_gmtxrank; - TH1D * h_gmtxqu; - TH1D * h_gmtxisrpc; - TH1D * h_gmtxdr; - - TH1D * h_gmtxpt_nocsc; - TH1D * h_gmtxeta_nocsc; - TH1D * h_gmtxphi_nocsc; - TH1D * h_gmtxbx_nocsc; - TH1D * h_gmtxrank_nocsc; - TH1D * h_gmtxqu_nocsc; - TH1D * h_gmtxisrpc_nocsc; - TH1D * h_gmtxdr_nocsc; - - TH1D * h_gmtxqu_nogmtreg; - TH1D * h_gmtxisrpc_nogmtreg; - TH1D * h_gmtxqu_notfcand; - TH1D * h_gmtxisrpc_notfcand; - TH1D * h_gmtxqu_nompc; - TH1D * h_gmtxisrpc_nompc; - - TH1D * h_xtrapt; - TH1D * h_xtraeta; - TH1D * h_xtraphi; - TH1D * h_xtrabx; - TH1D * h_xtradr; - - TH1D * h_n_alct; - TH1D * h_n_clct; - TH1D * h_n_lct; - TH1D * h_n_mplct; - TH1D * h_n_tftrack; - TH1D * h_n_tftrack_all; - TH1D * h_n_tfcand; - TH1D * h_n_tfcand_all; - TH1D * h_n_gmtregcand; - TH1D * h_n_gmtregcand_all; - TH1D * h_n_gmtcand; - TH1D * h_n_gmtcand_all; - TH1D * h_n_xtra; - TH1D * h_n_xtra_all; - - TH1D * h_n_ch_w_alct; - TH1D * h_n_ch_w_clct; - TH1D * h_n_ch_w_lct; - TH1D * h_n_ch_w_mplct; - - TH1D * h_n_bx_per_ch_alct; - TH1D * h_n_bx_per_ch_clct; - TH1D * h_n_bx_per_ch_lct; - - TH1D * h_n_per_ch_alct; - TH1D * h_n_per_ch_clct; - TH1D * h_n_per_ch_lct; - TH1D * h_n_per_ch_mplct; - TH1D * h_n_per_ch_alct_cscdet[CSC_TYPES]; - TH2D * h_n_per_ch_alct_vs_bx_cscdet[CSC_TYPES]; - TH1D * h_n_per_ch_clct_cscdet[CSC_TYPES]; - TH1D * h_n_per_ch_lct_cscdet[CSC_TYPES]; - TH1D * h_n_per_ch_mplct_cscdet[CSC_TYPES]; - - TH2D * h_n_per_ch_me1nomatchclct_alct_vs_bx_cscdet[CSC_TYPES]; - TH2D * h_n_per_ch_me1nomatchclct_clct_vs_bx_cscdet[CSC_TYPES]; - TH1D * h_n_per_ch_me1nomatchclct_clct_cscdet[CSC_TYPES]; - - TH2D * h_n_per_ch_me1nomatchalct_alct_vs_bx_cscdet[CSC_TYPES]; - TH2D * h_n_per_ch_me1nomatchalct_clct_vs_bx_cscdet[CSC_TYPES]; - TH1D * h_n_per_ch_me1nomatchalct_clct_cscdet[CSC_TYPES]; - - TH2D * h_n_per_ch_me1nomatch_alct_vs_bx_cscdet[CSC_TYPES]; - TH1D * h_n_per_ch_me1nomatch_clct_cscdet[CSC_TYPES]; - - - TH1D * h_station_tf_pu_ok; - TH1D * h_station_tf_pu_no; - TH1D * h_station_tf_pu_ok_once; - TH1D * h_station_tf_pu_no_once; - TH1D * h_station_tforg_pu_ok; - TH1D * h_station_tforg_pu_no; - TH1D * h_station_tforg_pu_ok_once; - TH1D * h_station_tforg_pu_no_once; - TH1D * h_tfqu_pt10; - TH1D * h_tfqu_pt10_no; - - TH1D * h_dBx_LctAlct; - TH1D * h_dBx_LctClct; - TH1D * h_dBx_1inCh_LctClct; - TH1D * h_dBx_2inCh_LctClct; - TH2D * h_dBx_2inCh_LctClct2; - - TH1D * h_dBx_LctClct_cscdet[CSC_TYPES]; - TH1D * h_dBx_1inCh_LctClct_cscdet[CSC_TYPES]; - TH1D * h_dBx_2inCh_LctClct_cscdet[CSC_TYPES]; - TH2D * h_dBx_2inCh_LctClct2_cscdet[CSC_TYPES]; - - TH1D * h_pt_over_tfpt_resol; - TH2D * h_pt_over_tfpt_resol_vs_pt; - - TH1D * h_eta_minus_tfeta_resol; - TH1D * h_phi_minus_tfphi_resol; - - TH2D * h_strip_v_wireg_me1a; - TH2D * h_strip_v_wireg_me1b; - - // --- rate histograms --- TH1D * h_rt_lct_per_sector; From e82b5771a89bb1bc510a309d947cbe825f93417d Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 16 Aug 2013 21:37:19 +0200 Subject: [PATCH 094/182] Removed more unnecessary stuff. Added the skeleton for the separate analyzers. --- SimMuL1/plugins/GEMCSCTriggerRate.cc | 562 ++++++++++++++------------- 1 file changed, 285 insertions(+), 277 deletions(-) diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.cc b/SimMuL1/plugins/GEMCSCTriggerRate.cc index dd4db77109d8e..f695b94b0cac0 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRate.cc @@ -70,8 +70,6 @@ namespace } // ================================================================================================ -// class' constants -// const std::string GEMCSCTriggerRate::csc_type[CSC_TYPES+1] = { "ME1/1", "ME1/2", "ME1/3", "ME1/a", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2", "ME1/T"}; const std::string GEMCSCTriggerRate::csc_type_[CSC_TYPES+1] = @@ -99,10 +97,6 @@ const int GEMCSCTriggerRate::pbend[CSCConstants::NUM_CLCT_PATTERNS]= const double GEMCSCTriggerRate::PT_THRESHOLDS[N_PT_THRESHOLDS] = {0,10,20,30,40,50}; const double GEMCSCTriggerRate::PT_THRESHOLDS_FOR_ETA[N_PT_THRESHOLDS] = {10,15,30,40,55,70}; -// -// static data member definitions -// - // ================================================================================================ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): @@ -721,43 +715,14 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet // get SimHits theCSCSimHitMap.fill(iEvent); -// analyzeALCTRate(iEvent); -// analyzeCLCTRate(iEvent); -// analyzeLCTRate(iEvent); -// analyzeMPLCTRate(iEvent); -// analyzeTFTrackRate(iEvent); -// analyzeTFCandRate(iEvent); -// analyzeGMTCandRate(iEvent); - + analyzeALCTRate(iEvent); + analyzeCLCTRate(iEvent); + analyzeLCTRate(iEvent); + analyzeMPLCTRate(iEvent); + analyzeTFTrackRate(iEvent); + analyzeTFCandRate(iEvent); + analyzeGMTCandRate(iEvent); - // get MC -// Handle< GenParticleCollection > hMCCand; -// iEvent.getByLabel("genParticles", hMCCand); -// const GenParticleCollection & cands = *(hMCCand.product()); - - // get SimTracks -// Handle< SimTrackContainer > hSimTracks; -// iEvent.getByLabel("g4SimHits", hSimTracks); -// const SimTrackContainer & simTracks = *(hSimTracks.product()); - - // get simVertices -// Handle< SimVertexContainer > hSimVertices; -// //iEvent.getByType(hSimVertices); -// iEvent.getByLabel("g4SimHits", hSimVertices); -// const SimVertexContainer & simVertices = *(hSimVertices.product()); - - -// edm::Handle< PSimHitContainer > MuonCSCHits; -// iEvent.getByLabel("g4SimHits", "MuonCSCHits", MuonCSCHits); -// const PSimHitContainer* allCSCSimHits = MuonCSCHits.product(); - - // strip and wire digis -// Handle< CSCWireDigiCollection > wireDigis; -// Handle< CSCComparatorDigiCollection > compDigis; -// iEvent.getByLabel("simMuonCSCDigis","MuonCSCWireDigi", wireDigis); -// iEvent.getByLabel("simMuonCSCDigis","MuonCSCComparatorDigi", compDigis); -// const CSCWireDigiCollection* wiredc = wireDigis.product(); -// const CSCComparatorDigiCollection* compdc = compDigis.product(); // ALCTs and CLCTs edm::Handle< CSCALCTDigiCollection > halcts; @@ -2016,255 +1981,255 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet std::vector gmt_records = hl1GmtCands->getRecords(); for ( std::vector< L1MuGMTReadoutRecord >::const_iterator rItr=gmt_records.begin(); rItr!=gmt_records.end() ; ++rItr ) - { - if (rItr->getBxInEvent() < minBxGMT_ || rItr->getBxInEvent() > maxBxGMT_) continue; - - std::vector CSCCands = rItr->getCSCCands(); - std::vector DTCands = rItr->getDTBXCands(); - std::vector RPCfCands = rItr->getFwdRPCCands(); - std::vector RPCbCands = rItr->getBrlRPCCands(); - std::vector GMTCands = rItr->getGMTCands(); - for ( std::vector::const_iterator muItr = GMTCands.begin() ; muItr != GMTCands.end() ; ++muItr ) - { - if( muItr->empty() ) continue; + { + if (rItr->getBxInEvent() < minBxGMT_ || rItr->getBxInEvent() > maxBxGMT_) continue; + + std::vector CSCCands = rItr->getCSCCands(); + std::vector DTCands = rItr->getDTBXCands(); + std::vector RPCfCands = rItr->getFwdRPCCands(); + std::vector RPCbCands = rItr->getBrlRPCCands(); + std::vector GMTCands = rItr->getGMTCands(); + for ( std::vector::const_iterator muItr = GMTCands.begin() ; muItr != GMTCands.end() ; ++muItr ) + { + if( muItr->empty() ) continue; - if ( muItr->bx() < minRateBX_ || muItr->bx() > maxRateBX_ ) - { - if (debugRATE) std::cout<<"discarding BX = "<< muItr->bx() <bx() < minRateBX_ || muItr->bx() > maxRateBX_ ) + { + if (debugRATE) std::cout<<"discarding BX = "<< muItr->bx() <isFwd() && ( muItr->isMatchedCand() || !muItr->isRPC())) { - L1MuRegionalCand rcsc = CSCCands[muItr->getDTCSCIndex()]; - unsigned my_i = 999; - for (unsigned i=0; i< rtGMTREGCands.size(); i++) - { - if (rcsc.getDataWord()!=rtGMTREGCands[i].l1reg->getDataWord()) continue; - my_i = i; - break; - } - if (my_i<99) gmt_csc = &rtGMTREGCands[my_i]; - else std::cout<<"DOES NOT EXIST IN rtGMTREGCands! Should not happen!"<ids; - } + MatchCSCMuL1::GMTCAND myGMTCand; + myGMTCand.init( &*muItr , muScales, muPtScale); + myGMTCand.dr = 999.; + if (doSelectEtaForGMTRates_ && myGMTCand.eta<0) continue; + + myGMTCand.regcand = NULL; + myGMTCand.regcand_rpc = NULL; + + float gpt = myGMTCand.pt; + float geta = fabs(myGMTCand.eta); + + MatchCSCMuL1::GMTREGCAND * gmt_csc = NULL; + if (muItr->isFwd() && ( muItr->isMatchedCand() || !muItr->isRPC())) { + L1MuRegionalCand rcsc = CSCCands[muItr->getDTCSCIndex()]; + unsigned my_i = 999; + for (unsigned i=0; i< rtGMTREGCands.size(); i++) + { + if (rcsc.getDataWord()!=rtGMTREGCands[i].l1reg->getDataWord()) continue; + my_i = i; + break; + } + if (my_i<99) gmt_csc = &rtGMTREGCands[my_i]; + else std::cout<<"DOES NOT EXIST IN rtGMTREGCands! Should not happen!"<ids; + } - MatchCSCMuL1::GMTREGCAND * gmt_rpcf = NULL; - if (muItr->isFwd() && (muItr->isMatchedCand() || muItr->isRPC())) - { - L1MuRegionalCand rrpcf = RPCfCands[muItr->getRPCIndex()]; - unsigned my_i = 999; - for (unsigned i=0; i< rtGMTRPCfCands.size(); i++) - { - if (rrpcf.getDataWord()!=rtGMTRPCfCands[i].l1reg->getDataWord()) continue; - my_i = i; - break; - } - if (my_i<99) gmt_rpcf = &rtGMTRPCfCands[my_i]; - else std::cout<<"DOES NOT EXIST IN rtGMTRPCfCands! Should not happen!"<isFwd() && (muItr->isMatchedCand() || muItr->isRPC())) + { + L1MuRegionalCand rrpcf = RPCfCands[muItr->getRPCIndex()]; + unsigned my_i = 999; + for (unsigned i=0; i< rtGMTRPCfCands.size(); i++) + { + if (rrpcf.getDataWord()!=rtGMTRPCfCands[i].l1reg->getDataWord()) continue; + my_i = i; + break; + } + if (my_i<99) gmt_rpcf = &rtGMTRPCfCands[my_i]; + else std::cout<<"DOES NOT EXIST IN rtGMTRPCfCands! Should not happen!"<isFwd()) && (muItr->isMatchedCand() || muItr->isRPC())) - { - L1MuRegionalCand rrpcb = RPCbCands[muItr->getRPCIndex()]; - unsigned my_i = 999; - for (unsigned i=0; i< rtGMTRPCbCands.size(); i++) - { - if (rrpcb.getDataWord()!=rtGMTRPCbCands[i].l1reg->getDataWord()) continue; - my_i = i; - break; - } - if (my_i<99) gmt_rpcb = &rtGMTRPCbCands[my_i]; - else std::cout<<"DOES NOT EXIST IN rtGMTRPCbCands! Should not happen!"<isFwd()) && (muItr->isMatchedCand() || muItr->isRPC())) + { + L1MuRegionalCand rrpcb = RPCbCands[muItr->getRPCIndex()]; + unsigned my_i = 999; + for (unsigned i=0; i< rtGMTRPCbCands.size(); i++) + { + if (rrpcb.getDataWord()!=rtGMTRPCbCands[i].l1reg->getDataWord()) continue; + my_i = i; + break; + } + if (my_i<99) gmt_rpcb = &rtGMTRPCbCands[my_i]; + else std::cout<<"DOES NOT EXIST IN rtGMTRPCbCands! Should not happen!"<isFwd()) && (muItr->isMatchedCand() || !(muItr->isRPC()))) - { - L1MuRegionalCand rdt = DTCands[muItr->getDTCSCIndex()]; - unsigned my_i = 999; - for (unsigned i=0; i< rtGMTDTCands.size(); i++) - { - if (rdt.getDataWord()!=rtGMTDTCands[i].l1reg->getDataWord()) continue; - my_i = i; - break; - } - if (my_i<99) gmt_dt = &rtGMTDTCands[my_i]; - else std::cout<<"DOES NOT EXIST IN rtGMTDTCands! Should not happen!"<isFwd()) && (muItr->isMatchedCand() || !(muItr->isRPC()))) + { + L1MuRegionalCand rdt = DTCands[muItr->getDTCSCIndex()]; + unsigned my_i = 999; + for (unsigned i=0; i< rtGMTDTCands.size(); i++) + { + if (rdt.getDataWord()!=rtGMTDTCands[i].l1reg->getDataWord()) continue; + my_i = i; + break; + } + if (my_i<99) gmt_dt = &rtGMTDTCands[my_i]; + else std::cout<<"DOES NOT EXIST IN rtGMTDTCands! Should not happen!"<isMatchedCand() ) std::cout<<"csc&rpcf but not matched!"<isMatchedCand() ) std::cout<<"csc&rpcf but not matched!"<=1.2 && geta<=1.8) eta_me42 = 1; - bool eta_q = (geta > 1.2); + bool eta_me42 = etaRangeHelpers::isME42EtaRegion(myGMTCand.eta); + bool eta_me42r = etaRangeHelpers::isME42RPCEtaRegion(myGMTCand.eta); + //if (geta>=1.2 && geta<=1.8) eta_me42 = 1; + bool eta_q = (geta > 1.2); - bool eta_me1b = etaRangeHelpers::isME1bEtaRegion(myGMTCand.eta); - //bool eta_me1b_whole = etaRangeHelpers::isME1bEtaRegion(myGMTCand.eta, 1.6, 2.14); - bool eta_no1a = (geta >= 1.2 && geta < 2.14); - //bool eta_csc = (geta > 0.9); - // + bool eta_me1b = etaRangeHelpers::isME1bEtaRegion(myGMTCand.eta); + //bool eta_me1b_whole = etaRangeHelpers::isME1bEtaRegion(myGMTCand.eta, 1.6, 2.14); + bool eta_no1a = (geta >= 1.2 && geta < 2.14); + //bool eta_csc = (geta > 0.9); + // - size_t n_stubs = 0; - if (gmt_csc) n_stubs = gmt_csc->nTFStubs; + size_t n_stubs = 0; + if (gmt_csc) n_stubs = gmt_csc->nTFStubs; - bool has_me1_stub = false; - if (gmt_csc && gmt_csc->tfcand && gmt_csc->tfcand->tftrack) - { - has_me1_stub = gmt_csc->tfcand->tftrack->hasStub(1); - } + bool has_me1_stub = false; + if (gmt_csc && gmt_csc->tfcand && gmt_csc->tfcand->tftrack) + { + has_me1_stub = gmt_csc->tfcand->tftrack->hasStub(1); + } - if (eta_me42) h_rt_gmt_gq_42->Fill(muItr->quality()); - if (eta_me42r) { - int gtype = 0; - if (muItr->isMatchedCand()) gtype = 6; - else if (gmt_csc!=0) gtype = gmt_csc->l1reg->quality()+2; - else if (gmt_rpcf!=0) gtype = gmt_rpcf->l1reg->quality()+1; - if (gtype==0) std::cout<<"weird: gtype=0 That shouldn't happen!"; - h_rt_gmt_gq_vs_type_42r->Fill(muItr->quality(), gtype); - h_rt_gmt_gq_vs_pt_42r->Fill(muItr->quality(), gpt); - h_rt_gmt_gq_42r->Fill(muItr->quality()); - } - h_rt_gmt_gq->Fill(muItr->quality()); - - h_rt_gmt_bx->Fill(muItr->bx()); - - //if (muItr->quality()<4) continue; // not good for single muon trigger! - - bool isSingleTrigOk = muItr->useInSingleMuonTrigger(); // good for single trigger - bool isDoubleTrigOk = muItr->useInDiMuonTrigger(); // good for single trigger - - bool isSingle6TrigOk = (muItr->quality() >= 6); // unmatched or matched CSC or DT - - if (muItr->quality()<3) continue; // not good for neither single nor dimuon triggers - - bool isCSC = (gmt_csc != NULL); - bool isDT = (gmt_dt != NULL); - bool isRPCf = (gmt_rpcf != NULL); - bool isRPCb = (gmt_rpcb != NULL); - - if (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack == NULL) std::cout<<"warning: gmt_csc->tfcand->tftrack == NULL"<tfcand != NULL && gmt_csc->tfcand->tftrack != NULL && gmt_csc->tfcand->tftrack->l1trk == NULL) - std::cout<<"warning: gmt_csc->tfcand->tftrack->l1trk == NULL"<tfcand != NULL && myGMTCand.ids.size()>=2); - //bool isCSC3s = (isCSC && gmt_csc->tfcand != NULL && myGMTCand.ids.size()>=3); - bool isCSC2s = (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack != NULL && gmt_csc->tfcand->tftrack->nStubs()>=2); - bool isCSC3s = (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack != NULL - && ( (!eta_q && isCSC2s) || (eta_q && gmt_csc->tfcand->tftrack->nStubs()>=3) ) ); - bool isCSC2q = (isCSC && gmt_csc->l1reg != NULL && gmt_csc->l1reg->quality()>=2); - bool isCSC3q = (isCSC && gmt_csc->l1reg != NULL - && ( (!eta_q && isCSC2q) || (eta_q && gmt_csc->l1reg->quality()>=3) ) ); - - myGMTCand.isCSC = isCSC; - myGMTCand.isDT = isDT; - myGMTCand.isRPCf = isRPCf; - myGMTCand.isRPCb = isRPCb; - myGMTCand.isCSC2s = isCSC2s; - myGMTCand.isCSC3s = isCSC3s; - myGMTCand.isCSC2q = isCSC2q; - myGMTCand.isCSC3q = isCSC3q; - - rtGMTCands.push_back(myGMTCand); - - - if (isCSC2q || isRPCf) { - h_rt_gmt_pt_2q->Fill(gpt); - if (eta_me42) { - h_rt_gmt_pt_2q42->Fill(gpt); - if (gpt > max_pt_me42_2q) max_pt_me42_2q = gpt; - if (isSingleTrigOk && gpt > max_pt_me42_2q_sing) max_pt_me42_2q_sing = gpt; - } - if (eta_me42r) { - h_rt_gmt_pt_2q42r->Fill(gpt); - if (gpt > max_pt_me42r_2q) max_pt_me42r_2q = gpt; - if (isSingleTrigOk && gpt > max_pt_me42r_2q_sing) max_pt_me42r_2q_sing = gpt; - } - } - if (isCSC3q || isRPCf) { - h_rt_gmt_pt_3q->Fill(gpt); - if (eta_me42) { - h_rt_gmt_pt_3q42->Fill(gpt); - if (gpt > max_pt_me42_3q) max_pt_me42_3q = gpt; - if (isSingleTrigOk && gpt > max_pt_me42_3q_sing) max_pt_me42_3q_sing = gpt; - } - if (eta_me42r) { - h_rt_gmt_pt_3q42r->Fill(gpt); - if (gpt > max_pt_me42r_3q) max_pt_me42r_3q = gpt; - if (isSingleTrigOk && gpt > max_pt_me42r_3q_sing) max_pt_me42r_3q_sing = gpt; - } - } + if (eta_me42) h_rt_gmt_gq_42->Fill(muItr->quality()); + if (eta_me42r) { + int gtype = 0; + if (muItr->isMatchedCand()) gtype = 6; + else if (gmt_csc!=0) gtype = gmt_csc->l1reg->quality()+2; + else if (gmt_rpcf!=0) gtype = gmt_rpcf->l1reg->quality()+1; + if (gtype==0) std::cout<<"weird: gtype=0 That shouldn't happen!"; + h_rt_gmt_gq_vs_type_42r->Fill(muItr->quality(), gtype); + h_rt_gmt_gq_vs_pt_42r->Fill(muItr->quality(), gpt); + h_rt_gmt_gq_42r->Fill(muItr->quality()); + } + h_rt_gmt_gq->Fill(muItr->quality()); + + h_rt_gmt_bx->Fill(muItr->bx()); + + //if (muItr->quality()<4) continue; // not good for single muon trigger! + + bool isSingleTrigOk = muItr->useInSingleMuonTrigger(); // good for single trigger + bool isDoubleTrigOk = muItr->useInDiMuonTrigger(); // good for single trigger + + bool isSingle6TrigOk = (muItr->quality() >= 6); // unmatched or matched CSC or DT + + if (muItr->quality()<3) continue; // not good for neither single nor dimuon triggers + + bool isCSC = (gmt_csc != NULL); + bool isDT = (gmt_dt != NULL); + bool isRPCf = (gmt_rpcf != NULL); + bool isRPCb = (gmt_rpcb != NULL); + + if (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack == NULL) std::cout<<"warning: gmt_csc->tfcand->tftrack == NULL"<tfcand != NULL && gmt_csc->tfcand->tftrack != NULL && gmt_csc->tfcand->tftrack->l1trk == NULL) + std::cout<<"warning: gmt_csc->tfcand->tftrack->l1trk == NULL"<tfcand != NULL && myGMTCand.ids.size()>=2); + //bool isCSC3s = (isCSC && gmt_csc->tfcand != NULL && myGMTCand.ids.size()>=3); + bool isCSC2s = (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack != NULL && gmt_csc->tfcand->tftrack->nStubs()>=2); + bool isCSC3s = (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack != NULL + && ( (!eta_q && isCSC2s) || (eta_q && gmt_csc->tfcand->tftrack->nStubs()>=3) ) ); + bool isCSC2q = (isCSC && gmt_csc->l1reg != NULL && gmt_csc->l1reg->quality()>=2); + bool isCSC3q = (isCSC && gmt_csc->l1reg != NULL + && ( (!eta_q && isCSC2q) || (eta_q && gmt_csc->l1reg->quality()>=3) ) ); + + myGMTCand.isCSC = isCSC; + myGMTCand.isDT = isDT; + myGMTCand.isRPCf = isRPCf; + myGMTCand.isRPCb = isRPCb; + myGMTCand.isCSC2s = isCSC2s; + myGMTCand.isCSC3s = isCSC3s; + myGMTCand.isCSC2q = isCSC2q; + myGMTCand.isCSC3q = isCSC3q; + + rtGMTCands.push_back(myGMTCand); + + + if (isCSC2q || isRPCf) { + h_rt_gmt_pt_2q->Fill(gpt); + if (eta_me42) { + h_rt_gmt_pt_2q42->Fill(gpt); + if (gpt > max_pt_me42_2q) max_pt_me42_2q = gpt; + if (isSingleTrigOk && gpt > max_pt_me42_2q_sing) max_pt_me42_2q_sing = gpt; + } + if (eta_me42r) { + h_rt_gmt_pt_2q42r->Fill(gpt); + if (gpt > max_pt_me42r_2q) max_pt_me42r_2q = gpt; + if (isSingleTrigOk && gpt > max_pt_me42r_2q_sing) max_pt_me42r_2q_sing = gpt; + } + } + if (isCSC3q || isRPCf) { + h_rt_gmt_pt_3q->Fill(gpt); + if (eta_me42) { + h_rt_gmt_pt_3q42->Fill(gpt); + if (gpt > max_pt_me42_3q) max_pt_me42_3q = gpt; + if (isSingleTrigOk && gpt > max_pt_me42_3q_sing) max_pt_me42_3q_sing = gpt; + } + if (eta_me42r) { + h_rt_gmt_pt_3q42r->Fill(gpt); + if (gpt > max_pt_me42r_3q) max_pt_me42r_3q = gpt; + if (isSingleTrigOk && gpt > max_pt_me42r_3q_sing) max_pt_me42r_3q_sing = gpt; + } + } - if (isCSC2s || isRPCf) { - h_rt_gmt_pt_2st->Fill(gpt); - if (eta_me42) { - h_rt_gmt_pt_2s42->Fill(gpt); - if (gpt > max_pt_me42_2s) max_pt_me42_2s = gpt; - if (isSingleTrigOk && gpt > max_pt_me42_2s_sing) max_pt_me42_2s_sing = gpt; - } - if (eta_me42r) { - h_rt_gmt_pt_2s42r->Fill(gpt); - if (gpt > max_pt_me42r_2s) max_pt_me42r_2s = gpt; - if (isSingleTrigOk && gpt > max_pt_me42r_2s_sing) max_pt_me42r_2s_sing = gpt; - } - } - if (isCSC3s || isRPCf) { - h_rt_gmt_pt_3st->Fill(gpt); - if (eta_me42) { - h_rt_gmt_pt_3s42->Fill(gpt); - if (gpt > max_pt_me42_3s) max_pt_me42_3s = gpt; - if (isSingleTrigOk && gpt > max_pt_me42_3s_sing) max_pt_me42_3s_sing = gpt; - } - if (eta_me42r) { - h_rt_gmt_pt_3s42r->Fill(gpt); - if (gpt > max_pt_me42r_3s) max_pt_me42r_3s = gpt; - if (isSingleTrigOk && gpt > max_pt_me42r_3s_sing) max_pt_me42r_3s_sing = gpt; - } - } + if (isCSC2s || isRPCf) { + h_rt_gmt_pt_2st->Fill(gpt); + if (eta_me42) { + h_rt_gmt_pt_2s42->Fill(gpt); + if (gpt > max_pt_me42_2s) max_pt_me42_2s = gpt; + if (isSingleTrigOk && gpt > max_pt_me42_2s_sing) max_pt_me42_2s_sing = gpt; + } + if (eta_me42r) { + h_rt_gmt_pt_2s42r->Fill(gpt); + if (gpt > max_pt_me42r_2s) max_pt_me42r_2s = gpt; + if (isSingleTrigOk && gpt > max_pt_me42r_2s_sing) max_pt_me42r_2s_sing = gpt; + } + } + if (isCSC3s || isRPCf) { + h_rt_gmt_pt_3st->Fill(gpt); + if (eta_me42) { + h_rt_gmt_pt_3s42->Fill(gpt); + if (gpt > max_pt_me42_3s) max_pt_me42_3s = gpt; + if (isSingleTrigOk && gpt > max_pt_me42_3s_sing) max_pt_me42_3s_sing = gpt; + } + if (eta_me42r) { + h_rt_gmt_pt_3s42r->Fill(gpt); + if (gpt > max_pt_me42r_3s) max_pt_me42r_3s = gpt; + if (isSingleTrigOk && gpt > max_pt_me42r_3s_sing) max_pt_me42r_3s_sing = gpt; + } + } - ngmt++; - h_rt_gmt_pt->Fill(gpt); - h_rt_gmt_eta->Fill(geta); - if (gpt > max_pt) {max_pt = gpt; max_pt_eta = geta;} - if (isDoubleTrigOk && gpt > max_pt_dbl) {max_pt_dbl = gpt; max_pt_eta_dbl = geta;} - if (isSingleTrigOk) - { - if ( gpt > max_pt_sing ) { max_pt_sing = gpt; max_pt_eta_sing = geta;} - if (isCSC && gpt > max_pt_sing_csc ) { max_pt_sing_csc = gpt; max_pt_eta_sing_csc = geta; } - if ((isCSC||isDT) && gpt > max_pt_sing_dtcsc ) { max_pt_sing_dtcsc = gpt; max_pt_eta_sing_dtcsc = geta; } - if (gpt > max_pt_sing_3s && ( !isCSC || isCSC3s ) ) {max_pt_sing_3s = gpt; max_pt_eta_sing_3s = geta;} - if (eta_me1b && gpt > max_pt_sing_1b ) { max_pt_sing_1b = gpt; /*max_pt_eta_sing_1b = geta;*/ } - if (eta_no1a && gpt > max_pt_sing_no1a) { max_pt_sing_no1a = gpt; /*max_pt_eta_sing_no1a = geta;*/ } - } - if (isSingle6TrigOk) - { - if ( gpt > max_pt_sing6 ) { max_pt_sing6 = gpt; max_pt_eta_sing6 = geta;} - if (isCSC && gpt > max_pt_sing6_csc ) { max_pt_sing6_csc = gpt; max_pt_eta_sing6_csc = geta; } - if (gpt > max_pt_sing6_3s && ( !isCSC || isCSC3s ) ) {max_pt_sing6_3s = gpt; max_pt_eta_sing6_3s = geta;} - if (eta_me1b && gpt > max_pt_sing6_1b ) { max_pt_sing6_1b = gpt; /*max_pt_eta_sing6_1b = geta;*/ } - if (eta_no1a && gpt > max_pt_sing6_no1a) { max_pt_sing6_no1a = gpt; /*max_pt_eta_sing6_no1a = geta;*/ } - if (eta_no1a && gpt > max_pt_sing6_3s1b_no1a && - (!eta_me1b || (eta_me1b && has_me1_stub && n_stubs >=3) ) ) { max_pt_sing6_3s1b_no1a = gpt; /*max_pt_eta_sing6_no1a = geta;*/ } - } - } - } + ngmt++; + h_rt_gmt_pt->Fill(gpt); + h_rt_gmt_eta->Fill(geta); + if (gpt > max_pt) {max_pt = gpt; max_pt_eta = geta;} + if (isDoubleTrigOk && gpt > max_pt_dbl) {max_pt_dbl = gpt; max_pt_eta_dbl = geta;} + if (isSingleTrigOk) + { + if ( gpt > max_pt_sing ) { max_pt_sing = gpt; max_pt_eta_sing = geta;} + if (isCSC && gpt > max_pt_sing_csc ) { max_pt_sing_csc = gpt; max_pt_eta_sing_csc = geta; } + if ((isCSC||isDT) && gpt > max_pt_sing_dtcsc ) { max_pt_sing_dtcsc = gpt; max_pt_eta_sing_dtcsc = geta; } + if (gpt > max_pt_sing_3s && ( !isCSC || isCSC3s ) ) {max_pt_sing_3s = gpt; max_pt_eta_sing_3s = geta;} + if (eta_me1b && gpt > max_pt_sing_1b ) { max_pt_sing_1b = gpt; /*max_pt_eta_sing_1b = geta;*/ } + if (eta_no1a && gpt > max_pt_sing_no1a) { max_pt_sing_no1a = gpt; /*max_pt_eta_sing_no1a = geta;*/ } + } + if (isSingle6TrigOk) + { + if ( gpt > max_pt_sing6 ) { max_pt_sing6 = gpt; max_pt_eta_sing6 = geta;} + if (isCSC && gpt > max_pt_sing6_csc ) { max_pt_sing6_csc = gpt; max_pt_eta_sing6_csc = geta; } + if (gpt > max_pt_sing6_3s && ( !isCSC || isCSC3s ) ) {max_pt_sing6_3s = gpt; max_pt_eta_sing6_3s = geta;} + if (eta_me1b && gpt > max_pt_sing6_1b ) { max_pt_sing6_1b = gpt; /*max_pt_eta_sing6_1b = geta;*/ } + if (eta_no1a && gpt > max_pt_sing6_no1a) { max_pt_sing6_no1a = gpt; /*max_pt_eta_sing6_no1a = geta;*/ } + if (eta_no1a && gpt > max_pt_sing6_3s1b_no1a && + (!eta_me1b || (eta_me1b && has_me1_stub && n_stubs >=3) ) ) { max_pt_sing6_3s1b_no1a = gpt; /*max_pt_eta_sing6_no1a = geta;*/ } + } + } + } h_rt_ngmt->Fill(ngmt); if (max_pt_me42_2s>0) h_rt_gmt_ptmax_2s42->Fill(max_pt_me42_2s); if (max_pt_me42_3s>0) h_rt_gmt_ptmax_3s42->Fill(max_pt_me42_3s); @@ -2325,6 +2290,49 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet } +// ================================================================================================ +void +GEMCSCTriggerRate::analyzeALCTRate(const edm::Event& iEvent) +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRate::analyzeCLCTRate(const edm::Event& iEvent) +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRate::analyzeLCTRate(const edm::Event& iEvent) +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRate::analyzeMPLCTRate(const edm::Event& iEvent) +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRate::analyzeTFTrackRate(const edm::Event& iEvent) +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRate::analyzeTFCandRate(const edm::Event& iEvent) +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRate::analyzeGMTCandRate(const edm::Event& iEvent) +{ +} + + // ================================================================================================ From 63485f85da81f31552141d027685ede82d17d357 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 16 Aug 2013 21:47:40 +0200 Subject: [PATCH 095/182] removing the rate histograms in the efficiency analyzer --- SimMuL1/plugins/GEMCSCTriggerEfficiency.h | 368 +--------------------- 1 file changed, 2 insertions(+), 366 deletions(-) diff --git a/SimMuL1/plugins/GEMCSCTriggerEfficiency.h b/SimMuL1/plugins/GEMCSCTriggerEfficiency.h index 308ead1aa40cc..33f7f7a9deb87 100644 --- a/SimMuL1/plugins/GEMCSCTriggerEfficiency.h +++ b/SimMuL1/plugins/GEMCSCTriggerEfficiency.h @@ -981,372 +981,8 @@ class GEMCSCTriggerEfficiency : public edm::EDFilter TH2D * h_strip_v_wireg_me1a; TH2D * h_strip_v_wireg_me1b; - - // --- rate histograms --- - - TH1D * h_rt_lct_per_sector; - TH2D * h_rt_lct_per_sector_vs_bx; - TH1D * h_rt_mplct_per_sector; - TH2D * h_rt_mplct_per_sector_vs_bx; - TH1D * h_rt_lct_per_sector_st[MAX_STATIONS]; - TH2D * h_rt_lct_per_sector_vs_bx_st[MAX_STATIONS]; - TH1D * h_rt_mplct_per_sector_st[MAX_STATIONS]; - TH2D * h_rt_mplct_per_sector_vs_bx_st[MAX_STATIONS]; - TH2D * h_rt_lct_per_sector_vs_bx_st1t; - TH2D * h_rt_mplct_per_sector_vs_bx_st1t; - - TH1D * h_rt_nalct; - TH1D * h_rt_nclct; - TH1D * h_rt_nlct; - TH1D * h_rt_nmplct; - TH1D * h_rt_ntftrack; - TH1D * h_rt_ntfcand; - TH1D * h_rt_ntfcand_pt10; - TH1D * h_rt_ngmt_csc; - TH1D * h_rt_ngmt_csc_pt10; - TH1D * h_rt_ngmt_csc_per_bx; - TH1D * h_rt_ngmt_rpcf; - TH1D * h_rt_ngmt_rpcf_pt10; - TH1D * h_rt_ngmt_rpcf_per_bx; - TH1D * h_rt_ngmt_rpcb; - TH1D * h_rt_ngmt_rpcb_pt10; - TH1D * h_rt_ngmt_rpcb_per_bx; - TH1D * h_rt_ngmt_dt; - TH1D * h_rt_ngmt_dt_pt10; - TH1D * h_rt_ngmt_dt_per_bx; - TH1D * h_rt_ngmt; - TH1D * h_rt_nxtra; - - TH1D * h_rt_nalct_per_bx; - TH1D * h_rt_nclct_per_bx; - TH1D * h_rt_nlct_per_bx; - - TH1D * h_rt_alct_bx; - TH1D * h_rt_clct_bx; - TH1D * h_rt_lct_bx; - TH1D * h_rt_mplct_bx; - TH1D * h_rt_csctype_alct_bx567; - TH1D * h_rt_csctype_clct_bx567; - TH1D * h_rt_csctype_lct_bx567; - TH1D * h_rt_csctype_mplct_bx567; - TH1D * h_rt_alct_bx_cscdet[CSC_TYPES+1]; - TH1D * h_rt_clct_bx_cscdet[CSC_TYPES+1]; - TH1D * h_rt_lct_bx_cscdet[CSC_TYPES+1]; - TH1D * h_rt_mplct_bx_cscdet[CSC_TYPES+1]; - - TH2D * h_rt_lct_qu_vs_bx; - TH2D * h_rt_mplct_qu_vs_bx; - - TH2D * h_rt_nalct_vs_bx; - TH2D * h_rt_nclct_vs_bx; - TH2D * h_rt_nlct_vs_bx; - TH2D * h_rt_nmplct_vs_bx; - - TH2D * h_rt_n_per_ch_alct_vs_bx_cscdet[CSC_TYPES+1]; - TH2D * h_rt_n_per_ch_clct_vs_bx_cscdet[CSC_TYPES+1]; - TH2D * h_rt_n_per_ch_lct_vs_bx_cscdet[CSC_TYPES+1]; - - TH1D * h_rt_n_ch_alct_per_bx_cscdet[CSC_TYPES+1]; - TH1D * h_rt_n_ch_clct_per_bx_cscdet[CSC_TYPES+1]; - TH1D * h_rt_n_ch_lct_per_bx_cscdet[CSC_TYPES+1]; - - TH1D * h_rt_n_ch_alct_per_bx_st[MAX_STATIONS]; - TH1D * h_rt_n_ch_clct_per_bx_st[MAX_STATIONS]; - TH1D * h_rt_n_ch_lct_per_bx_st[MAX_STATIONS]; - - TH1D * h_rt_n_ch_alct_per_bx; - TH1D * h_rt_n_ch_clct_per_bx; - TH1D * h_rt_n_ch_lct_per_bx; - - TH1D * h_rt_lct_qu; - TH1D * h_rt_mplct_qu; - - TH2D * h_rt_qu_vs_bxclct__lct; - - TH1D * h_rt_mplct_pattern; - TH1D * h_rt_mplct_pattern_cscdet[CSC_TYPES+1]; - - TH1D * h_rt_tftrack_pt; - TH1D * h_rt_tfcand_pt; - - TH1D * h_rt_tfcand_pt_2st; - TH1D * h_rt_tfcand_pt_3st; - - TH1D * h_rt_tfcand_pt_h42_2st; - TH1D * h_rt_tfcand_pt_h42_3st; - - TH1D * h_rt_tftrack_bx; - TH1D * h_rt_tfcand_bx; - - TH1D * h_rt_tfcand_eta; - TH1D * h_rt_tfcand_eta_pt5; - TH1D * h_rt_tfcand_eta_pt10; - TH1D * h_rt_tfcand_eta_pt15; - - TH1D * h_rt_tfcand_eta_3st; - TH1D * h_rt_tfcand_eta_pt5_3st; - TH1D * h_rt_tfcand_eta_pt10_3st; - TH1D * h_rt_tfcand_eta_pt15_3st; - - TH1D * h_rt_tfcand_eta_3st1a; - TH1D * h_rt_tfcand_eta_pt5_3st1a; - TH1D * h_rt_tfcand_eta_pt10_3st1a; - TH1D * h_rt_tfcand_eta_pt15_3st1a; - - TH2D * h_rt_tfcand_pt_vs_eta; - TH2D * h_rt_tfcand_pt_vs_eta_3st; - TH2D * h_rt_tfcand_pt_vs_eta_3st1a; - - TH1D * h_rt_gmt_csc_pt; - TH1D * h_rt_gmt_csc_ptmax_2s; - TH1D * h_rt_gmt_csc_ptmax_2s_1b; - TH1D * h_rt_gmt_csc_ptmax_2s_no1a; - TH1D * h_rt_gmt_csc_ptmax_3s; - TH1D * h_rt_gmt_csc_ptmax_3s_1b; - TH1D * h_rt_gmt_csc_ptmax_3s_no1a; - TH1D * h_rt_gmt_csc_ptmax_3s_2s1b; - TH1D * h_rt_gmt_csc_ptmax_3s_2s1b_1b; - TH1D * h_rt_gmt_csc_ptmax_3s_2s123_1b; - TH1D * h_rt_gmt_csc_ptmax_3s_2s13_1b; - TH1D * h_rt_gmt_csc_ptmax_3s_2s1b_no1a; - TH1D * h_rt_gmt_csc_ptmax_3s_2s123_no1a; - TH1D * h_rt_gmt_csc_ptmax_3s_2s13_no1a; - TH1D * h_rt_gmt_csc_ptmax_3s_3s1b; - TH1D * h_rt_gmt_csc_ptmax_3s_3s1b_1b; - TH1D * h_rt_gmt_csc_ptmax_3s_3s1b_no1a; - TH1D * h_rt_gmt_csc_ptmax_2q; - TH1D * h_rt_gmt_csc_ptmax_3q; - TH1D * h_rt_gmt_csc_pt_2s42; - TH1D * h_rt_gmt_csc_pt_3s42; - TH1D * h_rt_gmt_csc_ptmax_2s42; - TH1D * h_rt_gmt_csc_ptmax_3s42; - TH1D * h_rt_gmt_csc_pt_2q42; - TH1D * h_rt_gmt_csc_pt_3q42; - TH1D * h_rt_gmt_csc_ptmax_2q42; - TH1D * h_rt_gmt_csc_ptmax_3q42; - TH1D * h_rt_gmt_csc_pt_2s42r; - TH1D * h_rt_gmt_csc_pt_3s42r; - TH1D * h_rt_gmt_csc_ptmax_2s42r; - TH1D * h_rt_gmt_csc_ptmax_3s42r; - TH1D * h_rt_gmt_csc_pt_2q42r; - TH1D * h_rt_gmt_csc_pt_3q42r; - TH1D * h_rt_gmt_csc_ptmax_2q42r; - TH1D * h_rt_gmt_csc_ptmax_3q42r; - - - TH1D * h_rt_gmt_rpcf_pt; - TH1D * h_rt_gmt_rpcf_pt_42; - TH1D * h_rt_gmt_rpcf_ptmax; - TH1D * h_rt_gmt_rpcf_ptmax_42; - - TH1D * h_rt_gmt_rpcb_pt; - TH1D * h_rt_gmt_rpcb_ptmax; - - TH1D * h_rt_gmt_dt_pt; - TH1D * h_rt_gmt_dt_ptmax; - - TH1D * h_rt_gmt_pt; - TH1D * h_rt_gmt_pt_2s42; - TH1D * h_rt_gmt_pt_3s42; - TH1D * h_rt_gmt_ptmax_2s42; - TH1D * h_rt_gmt_ptmax_3s42; - TH1D * h_rt_gmt_ptmax_2s42_sing; - TH1D * h_rt_gmt_ptmax_3s42_sing; - TH1D * h_rt_gmt_pt_2s42r; - TH1D * h_rt_gmt_pt_3s42r; - TH1D * h_rt_gmt_ptmax_2s42r; - TH1D * h_rt_gmt_ptmax_3s42r; - TH1D * h_rt_gmt_ptmax_2s42r_sing; - TH1D * h_rt_gmt_ptmax_3s42r_sing; - TH1D * h_rt_gmt_ptmax; - TH1D * h_rt_gmt_ptmax_sing; - TH1D * h_rt_gmt_ptmax_sing_3s; - TH1D * h_rt_gmt_ptmax_sing_csc; - TH1D * h_rt_gmt_ptmax_sing_1b; - TH1D * h_rt_gmt_ptmax_sing_no1a; - TH1D * h_rt_gmt_ptmax_sing6; - TH1D * h_rt_gmt_ptmax_sing6_3s; - TH1D * h_rt_gmt_ptmax_sing6_csc; - TH1D * h_rt_gmt_ptmax_sing6_1b; - TH1D * h_rt_gmt_ptmax_sing6_no1a; - TH1D * h_rt_gmt_ptmax_sing6_3s1b_no1a; - TH1D * h_rt_gmt_ptmax_dbl; - TH1D * h_rt_gmt_pt_2q42; - TH1D * h_rt_gmt_pt_3q42; - TH1D * h_rt_gmt_ptmax_2q42; - TH1D * h_rt_gmt_ptmax_3q42; - TH1D * h_rt_gmt_ptmax_2q42_sing; - TH1D * h_rt_gmt_ptmax_3q42_sing; - TH1D * h_rt_gmt_pt_2q42r; - TH1D * h_rt_gmt_pt_3q42r; - TH1D * h_rt_gmt_ptmax_2q42r; - TH1D * h_rt_gmt_ptmax_3q42r; - TH1D * h_rt_gmt_ptmax_2q42r_sing; - TH1D * h_rt_gmt_ptmax_3q42r_sing; - - - TH1D * h_rt_gmt_csc_eta; - TH1D * h_rt_gmt_csc_ptmax10_eta_2s; - TH1D * h_rt_gmt_csc_ptmax10_eta_2s_2s1b; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_1b; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_no1a; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s1b; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s1b_1b; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s123_1b; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s13_1b; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s1b_no1a; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s123_no1a; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s13_no1a; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_3s1b; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_3s1b_1b; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_3s1b_no1a; - TH1D * h_rt_gmt_csc_ptmax10_eta_2q; - TH1D * h_rt_gmt_csc_ptmax10_eta_3q; - - TH1D * h_rt_gmt_csc_ptmax20_eta_2s; - TH1D * h_rt_gmt_csc_ptmax20_eta_2s_2s1b; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_1b; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_no1a; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s1b; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s1b_1b; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s123_1b; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s13_1b; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s1b_no1a; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s123_no1a; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s13_no1a; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_3s1b; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_3s1b_1b; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_3s1b_no1a; - TH1D * h_rt_gmt_csc_ptmax20_eta_2q; - TH1D * h_rt_gmt_csc_ptmax20_eta_3q; - - TH1D * h_rt_gmt_csc_ptmax30_eta_2s; - TH1D * h_rt_gmt_csc_ptmax30_eta_2s_2s1b; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_1b; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_no1a; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s1b; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s1b_1b; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s123_1b; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s13_1b; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s1b_no1a; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s123_no1a; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s13_no1a; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_3s1b; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_3s1b_1b; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_3s1b_no1a; - TH1D * h_rt_gmt_csc_ptmax30_eta_2q; - TH1D * h_rt_gmt_csc_ptmax30_eta_3q; - - TH1D * h_rt_gmt_csc_mode_2s1b_1b[6]; - - TH1D * h_rt_gmt_rpcf_eta; - TH1D * h_rt_gmt_rpcf_ptmax10_eta; - TH1D * h_rt_gmt_rpcf_ptmax20_eta; - TH1D * h_rt_gmt_rpcb_eta; - TH1D * h_rt_gmt_rpcb_ptmax10_eta; - TH1D * h_rt_gmt_rpcb_ptmax20_eta; - TH1D * h_rt_gmt_dt_eta; - TH1D * h_rt_gmt_dt_ptmax10_eta; - TH1D * h_rt_gmt_dt_ptmax20_eta; - TH1D * h_rt_gmt_eta; - TH1D * h_rt_gmt_ptmax10_eta; - TH1D * h_rt_gmt_ptmax10_eta_sing; - TH1D * h_rt_gmt_ptmax10_eta_sing_3s; - TH1D * h_rt_gmt_ptmax10_eta_dbl; - TH1D * h_rt_gmt_ptmax20_eta; - TH1D * h_rt_gmt_ptmax20_eta_sing; - TH1D * h_rt_gmt_ptmax20_eta_sing_csc; - TH1D * h_rt_gmt_ptmax20_eta_sing_dtcsc; - TH1D * h_rt_gmt_ptmax20_eta_sing_3s; - TH1D * h_rt_gmt_ptmax30_eta_sing; - TH1D * h_rt_gmt_ptmax30_eta_sing_csc; - TH1D * h_rt_gmt_ptmax30_eta_sing_dtcsc; - TH1D * h_rt_gmt_ptmax30_eta_sing_3s; - TH1D * h_rt_gmt_ptmax10_eta_sing6; - TH1D * h_rt_gmt_ptmax10_eta_sing6_3s; - TH1D * h_rt_gmt_ptmax20_eta_sing6; - TH1D * h_rt_gmt_ptmax20_eta_sing6_csc; - TH1D * h_rt_gmt_ptmax20_eta_sing6_dtcsc; - TH1D * h_rt_gmt_ptmax20_eta_sing6_3s; - TH1D * h_rt_gmt_ptmax30_eta_sing6; - TH1D * h_rt_gmt_ptmax30_eta_sing6_csc; - TH1D * h_rt_gmt_ptmax30_eta_sing6_dtcsc; - TH1D * h_rt_gmt_ptmax30_eta_sing6_3s; - TH1D * h_rt_gmt_ptmax20_eta_dbl; - - TH1D * h_rt_gmt_csc_pt_2st; - TH1D * h_rt_gmt_csc_pt_3st; - TH1D * h_rt_gmt_csc_pt_2q; - TH1D * h_rt_gmt_csc_pt_3q; - TH1D * h_rt_gmt_pt_2st; - TH1D * h_rt_gmt_pt_3st; - TH1D * h_rt_gmt_pt_2q; - TH1D * h_rt_gmt_pt_3q; - - TH1D * h_rt_gmt_csc_bx; - TH1D * h_rt_gmt_rpcf_bx; - TH1D * h_rt_gmt_rpcb_bx; - TH1D * h_rt_gmt_dt_bx; - TH1D * h_rt_gmt_bx; - - TH1D * h_rt_gmt_csc_q; - TH1D * h_rt_gmt_csc_q_42; - TH1D * h_rt_gmt_csc_q_42r; - TH1D * h_rt_gmt_rpcf_q; - TH1D * h_rt_gmt_rpcf_q_42; - TH1D * h_rt_gmt_rpcb_q; - TH1D * h_rt_gmt_dt_q; - TH1D * h_rt_gmt_gq; - TH1D * h_rt_gmt_gq_42; - TH1D * h_rt_gmt_gq_42r; - TH2D * h_rt_gmt_gq_vs_pt_42r; - TH2D * h_rt_gmt_gq_vs_type_42r; - TH1D * h_rt_tftrack_mode; - - - TH1D * h_gmt_mindr; - TH1D * h_gmt_dr_maxrank; - - TH1D * h_gmt_pt_initial_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_dt_initial_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_csc_initial_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_dtcsc_initial_gpt[N_PT_THRESHOLDS]; - - TH1D * h_gmt_pt_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_2s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_3s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_dt_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_csc_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_csc_2s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_csc_3s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_dtcsc_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_dtcsc_2s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_dtcsc_3s_sing_gpt[N_PT_THRESHOLDS]; - - - TH1D * h_gmt_eta_initial_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_dt_initial_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_csc_initial_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_rpcf_initial_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_rpcb_initial_gpt[N_PT_THRESHOLDS]; - - TH1D * h_gmt_eta_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_2s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_3s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_2q_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_3q_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_csc_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_csc_2s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_csc_3s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_csc_2q_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_csc_3q_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_dt_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_rpcf_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_rpcb_sing_gpt[N_PT_THRESHOLDS]; - + TH1D * h_gmt_mindr; + TH1D * h_gmt_dr_maxrank; bool fill_debug_tree_; TTree* dbg_tree; void bookDbgTTree(); From 1ff41a427451d35a1dd45507b03ce098cc6bfbaa Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sat, 17 Aug 2013 20:45:55 +0200 Subject: [PATCH 096/182] Removing the light run option (I always want GMT information), adding the skeletons in place for booking the trees, removing obsolete class inclusions, removing the debug tree (wasn't used anyway), moving the ALCT rate analzyer code fragment to the dedicated function and other minor aesthetic clean-ups --- SimMuL1/plugins/GEMCSCTriggerRate.cc | 617 +++++++++++++-------------- SimMuL1/plugins/GEMCSCTriggerRate.h | 95 ++--- 2 files changed, 333 insertions(+), 379 deletions(-) diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.cc b/SimMuL1/plugins/GEMCSCTriggerRate.cc index f695b94b0cac0..aacdb0547c7d5 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRate.cc @@ -1,35 +1,5 @@ #include "GEMCode/SimMuL1/plugins/GEMCSCTriggerRate.h" -// system include files -#include -#include - -// user include files -#include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h" -#include "DataFormats/L1Trigger/interface/L1MuonParticle.h" -#include "DataFormats/MuonDetId/interface/CSCDetId.h" -#include "TrackingTools/Records/interface/TrackingComponentsRecord.h" -#include -#include "L1Trigger/CSCCommonTrigger/interface/CSCTriggerGeometry.h" -#include "L1Trigger/CSCTrackFinder/interface/CSCTFSectorProcessor.h" -#include "L1Trigger/CSCTrackFinder/interface/CSCSectorReceiverLUT.h" -#include "L1Trigger/CSCTrackFinder/interface/CSCTrackFinderDataTypes.h" -#include -#include "CondFormats/DataRecord/interface/L1MuTriggerScalesRcd.h" -#include "CondFormats/DataRecord/interface/L1MuTriggerPtScaleRcd.h" -#include "DataFormats/Math/interface/normalizedPhi.h" -#include "DataFormats/Math/interface/deltaPhi.h" -#include "DataFormats/Math/interface/deltaR.h" -#include "SimMuon/CSCDigitizer/src/CSCDbStripConditions.h" -#include -#include "TrackingTools/DetLayers/interface/DetLayer.h" -#include "RecoMuon/DetLayers/interface/MuonDetLayerGeometry.h" -#include "RecoMuon/Records/interface/MuonRecoGeometryRecord.h" -#include "DataFormats/GeometrySurface/interface/BoundCylinder.h" -#include "DataFormats/MuonDetId/interface/GEMDetId.h" -#include "Geometry/GEMGeometry/interface/GEMGeometry.h" -#include "GEMCode/SimMuL1/interface/EtaRangeHelpers.h" - struct MyALCT { Int_t nlayers, bx; @@ -148,9 +118,6 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): doME1a_ = iConfig.getUntrackedParameter< bool >("doME1a",false); - // no GMT and L1Extra processing - lightRun = iConfig.getUntrackedParameter("lightRun", true); - // special treatment of matching in ME1a for the case of the default emulator defaultME1a = iConfig.getUntrackedParameter("defaultME1a", false); @@ -164,17 +131,18 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): for(int e=0; e<2; e++) for (int s=0; s<6; s++) my_SPs[e][s] = NULL; bool TMB07 = true; - for(int endcap = 1; endcap<=2; endcap++){ + for(int endcap = 1; endcap<=2; endcap++) + { for(int sector=1; sector<=6; sector++) + { + for(int station=1,fpga=0; station<=4 && fpga<5; station++) { - for(int station=1,fpga=0; station<=4 && fpga<5; station++) - { - if(station==1) for(int subSector=0; subSector<2; subSector++) - srLUTs_[fpga++][sector-1][endcap-1] = new CSCSectorReceiverLUT(endcap, sector, subSector+1, station, srLUTset, TMB07); - else - srLUTs_[fpga++][sector-1][endcap-1] = new CSCSectorReceiverLUT(endcap, sector, 0, station, srLUTset, TMB07); - } + if(station==1) for(int subSector=0; subSector<2; subSector++) + srLUTs_[fpga++][sector-1][endcap-1] = new CSCSectorReceiverLUT(endcap, sector, subSector+1, station, srLUTset, TMB07); + else + srLUTs_[fpga++][sector-1][endcap-1] = new CSCSectorReceiverLUT(endcap, sector, 0, station, srLUTset, TMB07); } + } } @@ -184,13 +152,56 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): muScalesCacheID_ = 0ULL ; muPtScaleCacheID_ = 0ULL ; - fill_debug_tree_ = iConfig.getUntrackedParameter< bool >("fill_debug_tree",false); + bookALCTTree(); + bookCLCTTree(); + bookLCTTree(); + bookMPLCTTree(); + bookTFTrackTree(); + bookTFCandTree(); + bookGMTRegionalTree(); + bookGMTCandTree(); +} + +// ================================================================================================ +GEMCSCTriggerRate::~GEMCSCTriggerRate() +{ + + if(ptLUT) delete ptLUT; + ptLUT = NULL; + + for(int e=0; e<2; e++) for (int s=0; s<6; s++){ + if (my_SPs[e][s]) delete my_SPs[e][s]; + my_SPs[e][s] = NULL; + + for(int fpga=0; fpga<5; fpga++) + { + if (srLUTs_[fpga][s][e]) delete srLUTs_[fpga][s][e]; + srLUTs_[fpga][s][e] = NULL; + } + } + + if(my_dtrc) delete my_dtrc; + my_dtrc = NULL; + + if (theStripConditions) delete theStripConditions; + theStripConditions = 0; +} + +// ================================================================================================ +void +GEMCSCTriggerRate::beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) +{ + edm::ESHandle< CSCGeometry > cscGeom; + iSetup.get().get(cscGeom); + cscGeometry = &*cscGeom; + CSCTriggerGeometry::setGeometry(cscGeometry); + } +// ================================================================================================ void GEMCSCTriggerRate::beginJob() { - // *********************************** HISTOGRAMS ****************************************** edm::Service fs; int N_ETA_BINS=200; @@ -216,8 +227,8 @@ GEMCSCTriggerRate::beginJob() 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.75, 1.8, 1.85, 1.9, 1.95, 2, 2.05, 2.1, 2.15, 2.2, 2.25, 2.3, 2.35, 2.4, 2.45}; - - + + h_rt_nalct = fs->make("h_rt_nalct","h_rt_nalct",101,-0.5, 100.5); h_rt_nclct = fs->make("h_rt_nclct","h_rt_nclct",101,-0.5, 100.5); @@ -632,78 +643,8 @@ GEMCSCTriggerRate::beginJob() h_gmt_mindr = fs->make("h_gmt_mindr","h_gmt_mindr",500, 0, 2*M_PI); h_gmt_dr_maxrank = fs->make("h_gmt_dr_maxrank","h_gmt_dr_maxrank",500, 0, 2*M_PI); - - - -} - - -// ================================================================================================ -GEMCSCTriggerRate::~GEMCSCTriggerRate() -{ - - if(ptLUT) delete ptLUT; - ptLUT = NULL; - - for(int e=0; e<2; e++) for (int s=0; s<6; s++){ - if (my_SPs[e][s]) delete my_SPs[e][s]; - my_SPs[e][s] = NULL; - - for(int fpga=0; fpga<5; fpga++) - { - if (srLUTs_[fpga][s][e]) delete srLUTs_[fpga][s][e]; - srLUTs_[fpga][s][e] = NULL; - } - } - - if(my_dtrc) delete my_dtrc; - my_dtrc = NULL; - - if (theStripConditions) delete theStripConditions; - theStripConditions = 0; -} - - -void -GEMCSCTriggerRate::resetDbg(DbgStruct& d) -{ - d.evtn = d.trkn = -1; - d.pt = d.eta = d.phi = d.tfpt = d.tfeta = d.tfphi = -1.; - d.tfpt_packed = d.tfeta_packed = d.tfphi_packed = d.dPhi12 = d.dPhi23 = d.nseg = d.nseg_ok = -1; - d.meEtap = d.mePhip = d.mcStrip = d.mcWG = d.strip = d.wg = d.chamber = -1; } -void -GEMCSCTriggerRate::beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) -{ - edm::ESHandle< CSCGeometry > cscGeom; - iSetup.get().get(cscGeom); - cscGeometry = &*cscGeom; - CSCTriggerGeometry::setGeometry(cscGeometry); - - edm::ESHandle muonGeometry; - iSetup.get().get(muonGeometry); - - // does the trigger sccale need to be defined in the beginrun or analyze method? - if (iSetup.get< L1MuTriggerScalesRcd >().cacheIdentifier() != muScalesCacheID_ || - iSetup.get< L1MuTriggerPtScaleRcd >().cacheIdentifier() != muPtScaleCacheID_ ) - { - iSetup.get< L1MuTriggerScalesRcd >().get( muScales ); - - iSetup.get< L1MuTriggerPtScaleRcd >().get( muPtScale ); - - if (ptLUT) delete ptLUT; - ptLUT = new CSCTFPtLUT(ptLUTset, muScales.product(), muPtScale.product()); - - for(int e=0; e<2; e++) for (int s=0; s<6; s++){ - if (my_SPs[e][s]) delete my_SPs[e][s]; - my_SPs[e][s] = new CSCTFSectorProcessor(e+1, s+1, CSCTFSPset, true, muScales.product(), muPtScale.product()); - my_SPs[e][s]->initialize(iSetup); - } - muScalesCacheID_ = iSetup.get< L1MuTriggerScalesRcd >().cacheIdentifier(); - muPtScaleCacheID_ = iSetup.get< L1MuTriggerPtScaleRcd >().cacheIdentifier(); - } -} // ================================================================================================ void @@ -715,21 +656,9 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet // get SimHits theCSCSimHitMap.fill(iEvent); - analyzeALCTRate(iEvent); - analyzeCLCTRate(iEvent); - analyzeLCTRate(iEvent); - analyzeMPLCTRate(iEvent); - analyzeTFTrackRate(iEvent); - analyzeTFCandRate(iEvent); - analyzeGMTCandRate(iEvent); - - // ALCTs and CLCTs - edm::Handle< CSCALCTDigiCollection > halcts; edm::Handle< CSCCLCTDigiCollection > hclcts; - iEvent.getByLabel("simCscTriggerPrimitiveDigis", halcts); iEvent.getByLabel("simCscTriggerPrimitiveDigis", hclcts); - const CSCALCTDigiCollection* alcts = halcts.product(); const CSCCLCTDigiCollection* clcts = hclcts.product(); // strip&wire matching output after TMB and after MPC sorting @@ -757,7 +686,8 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet // GMT readout collection edm::Handle< L1MuGMTReadoutCollection > hl1GmtCands; - if (!lightRun) iEvent.getByLabel("simGmtDigis", hl1GmtCands ) ;// InputTag("simCsctfDigis","CSC") + iEvent.getByLabel("simGmtDigis", hl1GmtCands ) ;// InputTag("simCsctfDigis","CSC") + //const L1MuGMTReadoutCollection* l1GmtCands = hl1GmtCands.product(); std::vector l1GmtCands; std::vector l1GmtfCands; @@ -770,59 +700,56 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet std::map > l1GmtCSCCandsInBXs; // TOCHECK - if( !lightRun ) - { - if ( centralBxOnlyGMT_ ) - { - // Get GMT candidates from central bunch crossing only - l1GmtCands = hl1GmtCands->getRecord().getGMTCands() ; - l1GmtfCands = hl1GmtCands->getRecord().getGMTFwdCands() ; - l1GmtCSCCands = hl1GmtCands->getRecord().getCSCCands() ; - l1GmtRPCfCands = hl1GmtCands->getRecord().getFwdRPCCands() ; - l1GmtRPCbCands = hl1GmtCands->getRecord().getBrlRPCCands() ; - l1GmtDTCands = hl1GmtCands->getRecord().getDTBXCands() ; - l1GmtCSCCandsInBXs[hl1GmtCands->getRecord().getBxInEvent()] = l1GmtCSCCands; - } - else - { - // Get GMT candidates from all bunch crossings - std::vector gmt_records = hl1GmtCands->getRecords(); - for ( std::vector< L1MuGMTReadoutRecord >::const_iterator rItr=gmt_records.begin(); rItr!=gmt_records.end() ; ++rItr ) - { - if (rItr->getBxInEvent() < minBxGMT_ || rItr->getBxInEvent() > maxBxGMT_) continue; - - std::vector GMTCands = rItr->getGMTCands(); - for ( std::vector::const_iterator cItr = GMTCands.begin() ; cItr != GMTCands.end() ; ++cItr ) - if (!cItr->empty()) l1GmtCands.push_back(*cItr); - - std::vector GMTfCands = rItr->getGMTFwdCands(); - for ( std::vector::const_iterator cItr = GMTfCands.begin() ; cItr != GMTfCands.end() ; ++cItr ) - if (!cItr->empty()) l1GmtfCands.push_back(*cItr); - - //std::cout<<" ggg: "< CSCCands = rItr->getCSCCands(); - l1GmtCSCCandsInBXs[rItr->getBxInEvent()] = CSCCands; - for ( std::vector::const_iterator cItr = CSCCands.begin() ; cItr != CSCCands.end() ; ++cItr ) - if (!cItr->empty()) l1GmtCSCCands.push_back(*cItr); - - std::vector RPCfCands = rItr->getFwdRPCCands(); - for ( std::vector::const_iterator cItr = RPCfCands.begin() ; cItr != RPCfCands.end() ; ++cItr ) - if (!cItr->empty()) l1GmtRPCfCands.push_back(*cItr); - - std::vector RPCbCands = rItr->getBrlRPCCands(); - for ( std::vector::const_iterator cItr = RPCbCands.begin() ; cItr != RPCbCands.end() ; ++cItr ) - if (!cItr->empty()) l1GmtRPCbCands.push_back(*cItr); - - std::vector DTCands = rItr->getDTBXCands(); - for ( std::vector::const_iterator cItr = DTCands.begin() ; cItr != DTCands.end() ; ++cItr ) - if (!cItr->empty()) l1GmtDTCands.push_back(*cItr); - } - //std::cout<<" sizes: "<getRecord().getGMTCands() ; + l1GmtfCands = hl1GmtCands->getRecord().getGMTFwdCands() ; + l1GmtCSCCands = hl1GmtCands->getRecord().getCSCCands() ; + l1GmtRPCfCands = hl1GmtCands->getRecord().getFwdRPCCands() ; + l1GmtRPCbCands = hl1GmtCands->getRecord().getBrlRPCCands() ; + l1GmtDTCands = hl1GmtCands->getRecord().getDTBXCands() ; + l1GmtCSCCandsInBXs[hl1GmtCands->getRecord().getBxInEvent()] = l1GmtCSCCands; + } + else + { + // Get GMT candidates from all bunch crossings + std::vector gmt_records = hl1GmtCands->getRecords(); + for ( std::vector< L1MuGMTReadoutRecord >::const_iterator rItr=gmt_records.begin(); rItr!=gmt_records.end() ; ++rItr ) + { + if (rItr->getBxInEvent() < minBxGMT_ || rItr->getBxInEvent() > maxBxGMT_) continue; + + std::vector GMTCands = rItr->getGMTCands(); + for ( std::vector::const_iterator cItr = GMTCands.begin() ; cItr != GMTCands.end() ; ++cItr ) + if (!cItr->empty()) l1GmtCands.push_back(*cItr); + + std::vector GMTfCands = rItr->getGMTFwdCands(); + for ( std::vector::const_iterator cItr = GMTfCands.begin() ; cItr != GMTfCands.end() ; ++cItr ) + if (!cItr->empty()) l1GmtfCands.push_back(*cItr); + + //std::cout<<" ggg: "< CSCCands = rItr->getCSCCands(); + l1GmtCSCCandsInBXs[rItr->getBxInEvent()] = CSCCands; + for ( std::vector::const_iterator cItr = CSCCands.begin() ; cItr != CSCCands.end() ; ++cItr ) + if (!cItr->empty()) l1GmtCSCCands.push_back(*cItr); + + std::vector RPCfCands = rItr->getFwdRPCCands(); + for ( std::vector::const_iterator cItr = RPCfCands.begin() ; cItr != RPCfCands.end() ; ++cItr ) + if (!cItr->empty()) l1GmtRPCfCands.push_back(*cItr); + + std::vector RPCbCands = rItr->getBrlRPCCands(); + for ( std::vector::const_iterator cItr = RPCbCands.begin() ; cItr != RPCbCands.end() ; ++cItr ) + if (!cItr->empty()) l1GmtRPCbCands.push_back(*cItr); + + std::vector DTCands = rItr->getDTBXCands(); + for ( std::vector::const_iterator cItr = DTCands.begin() ; cItr != DTCands.end() ; ++cItr ) + if (!cItr->empty()) l1GmtDTCands.push_back(*cItr); + } + //std::cout<<" sizes: "<().cacheIdentifier() != muScalesCacheID_ || iSetup.get< L1MuTriggerPtScaleRcd >().cacheIdentifier() != muPtScaleCacheID_ ) { @@ -842,117 +769,19 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet muPtScaleCacheID_ = iSetup.get< L1MuTriggerPtScaleRcd >().cacheIdentifier(); } - - - - // //======================================================================= // //============================= RATES =================================== + analyzeALCTRate(iEvent); + analyzeCLCTRate(iEvent); + analyzeLCTRate(iEvent); + analyzeMPLCTRate(iEvent); + analyzeTFTrackRate(iEvent); + analyzeTFCandRate(iEvent); + analyzeGMTCandRate(iEvent); //============ RATE ALCT ================== - int nalct=0; - int nalct_per_bx[16]; - int n_ch_alct_per_bx[16]; - int n_ch_alct_per_bx_st[MAX_STATIONS][16]; - int n_ch_alct_per_bx_cscdet[CSC_TYPES+1][16]; - for (int b=0;b<16;b++) - { - nalct_per_bx[b] = n_ch_alct_per_bx[b] = 0; - for (int s=0; s > me11alcts; - for (CSCALCTDigiCollection::DigiRangeIterator adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); adetUnitIt++) - { - const CSCDetId& id = (*adetUnitIt).first; - //if (id.endcap() != 1) continue; - CSCDetId idd(id.rawId()); - int csct = getCSCType( idd ); - int cscst = getCSCSpecsType( idd ); - //int is11 = isME11(csct); - int nalct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - const CSCALCTDigiCollection::Range& range = (*adetUnitIt).second; - for (CSCALCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) - { - if ((*digiIt).isValid()) - { - int bx = (*digiIt).getBX(); - //if ( bx-6 < minBX_ || bx-6 > maxBX_ ) - if ( bx < minBxALCT_ || bx > maxBxALCT_ ) - { - if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill( bx - 6 ); - h_rt_alct_bx_cscdet[csct]->Fill( bx - 6 ); - if (bx>=5 && bx<=7) h_rt_csctype_alct_bx567->Fill(cscst); - - } //if (alct_valid) - } - for (int b=0;b<16;b++) - { - if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; - h_rt_n_per_ch_alct_vs_bx_cscdet[csct]->Fill(nalct_per_ch_bx[b],b); - if (nalct_per_ch_bx[b]>0) { - ++n_ch_alct_per_bx[b]; - ++n_ch_alct_per_bx_st[id.station()-1][b]; - ++n_ch_alct_per_bx_cscdet[csct][b]; - } - } - } // loop CSCALCTDigiCollection - //std::map< CSCDetId , std::vector >::const_iterator mapIt = me11alcts.begin(); - //for (;mapIt != me11alcts.end(); mapIt++){} - std::map< int , std::vector >::const_iterator aMapIt = me11alcts.begin(); - for (;aMapIt != me11alcts.end(); aMapIt++) - { - CSCDetId id(aMapIt->first); - int nalct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - for (size_t i=0; i<(aMapIt->second).size(); i++) - { - int bx = (aMapIt->second)[i]->getBX(); - ++nalct_per_ch_bx[bx]; - } - for (int b=0;b<16;b++) - { - if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; - h_rt_n_per_ch_alct_vs_bx_cscdet[10]->Fill(nalct_per_ch_bx[b],b); - if (nalct_per_ch_bx[b]>0) ++n_ch_alct_per_bx_cscdet[10][b]; - } - } - h_rt_nalct->Fill(nalct); - for (int b=0;b<16;b++) { - if (b < minBxALCT_ || b > maxBxALCT_) continue; - h_rt_nalct_vs_bx->Fill(nalct_per_bx[b],b); - h_rt_nalct_per_bx->Fill(nalct_per_bx[b]); - h_rt_n_ch_alct_per_bx->Fill(n_ch_alct_per_bx[b]); - for (int s=0; sFill(n_ch_alct_per_bx_st[s][b]); - for (int me=0; me<=CSC_TYPES; me++) - h_rt_n_ch_alct_per_bx_cscdet[me]->Fill(n_ch_alct_per_bx_cscdet[me][b]); - } - - - if (debugRATE) std::cout<< "----- end nalct="<Fill(n_ch_lct_per_bx_cscdet[me][b]); } - for (int s=0; s6) continue; // only ME1 has 12 subsectors - h_rt_lct_per_sector->Fill(nlct_sector_st[s][i]); - h_rt_lct_per_sector_st[s]->Fill(nlct_sector_st[s][i]); - for (int j=0; j<16; j++) { - if ( j < minBxALCT_ || j > maxBxALCT_ ) continue; - h_rt_lct_per_sector_vs_bx->Fill(nlct_sector_bx_st[s][i][j],j+0.5); - h_rt_lct_per_sector_vs_bx_st[s]->Fill(nlct_sector_bx_st[s][i][j],j+0.5); - if (s==0 && i<7) h_rt_lct_per_sector_vs_bx_st1t->Fill(nlct_trigsector_bx_st1[i][j],j+0.5); - } - } + for (int s=0; s6) continue; // only ME1 has 12 subsectors + h_rt_lct_per_sector->Fill(nlct_sector_st[s][i]); + h_rt_lct_per_sector_st[s]->Fill(nlct_sector_st[s][i]); + for (int j=0; j<16; j++) { + if ( j < minBxALCT_ || j > maxBxALCT_ ) continue; + h_rt_lct_per_sector_vs_bx->Fill(nlct_sector_bx_st[s][i][j],j+0.5); + h_rt_lct_per_sector_vs_bx_st[s]->Fill(nlct_sector_bx_st[s][i][j],j+0.5); + if (s==0 && i<7) h_rt_lct_per_sector_vs_bx_st1t->Fill(nlct_trigsector_bx_st1[i][j],j+0.5); + } + } if (debugRATE) std::cout<< "----- end nlct="< maxBxALCT_ ) continue; h_rt_nmplct_vs_bx->Fill(nmplct_per_bx[b],b); } - for (int s=0; s6) continue; // only ME1 has 12 subsectors - h_rt_mplct_per_sector->Fill(nmplct_sector_st[s][i]); - h_rt_mplct_per_sector_st[s]->Fill(nmplct_sector_st[s][i]); - for (int j=0; j<16; j++) { - if ( j < minBxALCT_ || j > maxBxALCT_ ) continue; - h_rt_mplct_per_sector_vs_bx->Fill(nmplct_sector_bx_st[s][i][j],j+0.5); - h_rt_mplct_per_sector_vs_bx_st[s]->Fill(nmplct_sector_bx_st[s][i][j],j+0.5); - if (s==0 && i<7) h_rt_mplct_per_sector_vs_bx_st1t->Fill(nmplct_trigsector_bx_st1[i][j],j+0.5); - } - } + for (int s=0; s6) continue; // only ME1 has 12 subsectors + h_rt_mplct_per_sector->Fill(nmplct_sector_st[s][i]); + h_rt_mplct_per_sector_st[s]->Fill(nmplct_sector_st[s][i]); + for (int j=0; j<16; j++) { + if ( j < minBxALCT_ || j > maxBxALCT_ ) continue; + h_rt_mplct_per_sector_vs_bx->Fill(nmplct_sector_bx_st[s][i][j],j+0.5); + h_rt_mplct_per_sector_vs_bx_st[s]->Fill(nmplct_sector_bx_st[s][i][j],j+0.5); + if (s==0 && i<7) h_rt_mplct_per_sector_vs_bx_st1t->Fill(nmplct_trigsector_bx_st1[i][j],j+0.5); + } + } if (debugRATE) std::cout<< "----- end nmplct="<=10.) h_rt_gmt_ptmax10_eta_dbl->Fill(max_pt_eta_dbl); if (max_pt_dbl>=20.) h_rt_gmt_ptmax20_eta_dbl->Fill(max_pt_eta_dbl); if (debugRATE) std::cout<< "----- end ngmt="< halcts; + iEvent.getByLabel("simCscTriggerPrimitiveDigis", halcts); + const CSCALCTDigiCollection* alcts = halcts.product(); + + int nalct=0; + int nalct_per_bx[16]; + int n_ch_alct_per_bx[16]; + int n_ch_alct_per_bx_st[MAX_STATIONS][16]; + int n_ch_alct_per_bx_cscdet[CSC_TYPES+1][16]; + for (int b=0;b<16;b++) + { + nalct_per_bx[b] = n_ch_alct_per_bx[b] = 0; + for (int s=0; s > me11alcts; + for (CSCALCTDigiCollection::DigiRangeIterator adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); adetUnitIt++) + { + const CSCDetId& id = (*adetUnitIt).first; + //if (id.endcap() != 1) continue; + CSCDetId idd(id.rawId()); + int csct = getCSCType( idd ); + int cscst = getCSCSpecsType( idd ); + //int is11 = isME11(csct); + int nalct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + const CSCALCTDigiCollection::Range& range = (*adetUnitIt).second; + for (CSCALCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) + { + if ((*digiIt).isValid()) + { + int bx = (*digiIt).getBX(); + //if ( bx-6 < minBX_ || bx-6 > maxBX_ ) + if ( bx < minBxALCT_ || bx > maxBxALCT_ ) + { + if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill( bx - 6 ); + h_rt_alct_bx_cscdet[csct]->Fill( bx - 6 ); + if (bx>=5 && bx<=7) h_rt_csctype_alct_bx567->Fill(cscst); + + } //if (alct_valid) + } + for (int b=0;b<16;b++) + { + if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; + h_rt_n_per_ch_alct_vs_bx_cscdet[csct]->Fill(nalct_per_ch_bx[b],b); + if (nalct_per_ch_bx[b]>0) + { + ++n_ch_alct_per_bx[b]; + ++n_ch_alct_per_bx_st[id.station()-1][b]; + ++n_ch_alct_per_bx_cscdet[csct][b]; + } + } + } // loop CSCALCTDigiCollection + //std::map< CSCDetId , std::vector >::const_iterator mapIt = me11alcts.begin(); + //for (;mapIt != me11alcts.end(); mapIt++){} + std::map< int , std::vector >::const_iterator aMapIt = me11alcts.begin(); + for (;aMapIt != me11alcts.end(); aMapIt++) + { + CSCDetId id(aMapIt->first); + int nalct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + for (size_t i=0; i<(aMapIt->second).size(); i++) + { + int bx = (aMapIt->second)[i]->getBX(); + ++nalct_per_ch_bx[bx]; + } + for (int b=0;b<16;b++) + { + if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; + h_rt_n_per_ch_alct_vs_bx_cscdet[10]->Fill(nalct_per_ch_bx[b],b); + if (nalct_per_ch_bx[b]>0) ++n_ch_alct_per_bx_cscdet[10][b]; + } + } + h_rt_nalct->Fill(nalct); + for (int b=0;b<16;b++) + { + if (b < minBxALCT_ || b > maxBxALCT_) continue; + h_rt_nalct_vs_bx->Fill(nalct_per_bx[b],b); + h_rt_nalct_per_bx->Fill(nalct_per_bx[b]); + h_rt_n_ch_alct_per_bx->Fill(n_ch_alct_per_bx[b]); + for (int s=0; sFill(n_ch_alct_per_bx_st[s][b]); + for (int me=0; me<=CSC_TYPES; me++) + h_rt_n_ch_alct_per_bx_cscdet[me]->Fill(n_ch_alct_per_bx_cscdet[me][b]); + } + + + if (debugRATE) std::cout<< "----- end nalct="< current_e_s = stub_list.get(e+1, s+1); - if (current_e_s.get().size()>0) { + if (current_e_s.get().size()>0) + { std::cout<<"sector "<run(current_e_s); } } - } // ================================================================================================ @@ -2402,15 +2388,14 @@ GEMCSCTriggerRate::isME11(int t) } // ================================================================================================ - // Returns chamber type (0-9) according to CSCChamberSpecs type - // 1..10 -> 1/a, 1/b, 1/2, 1/3, 2/1... +// Returns chamber type (0-9) according to CSCChamberSpecs type +// 1..10 -> 1/a, 1/b, 1/2, 1/3, 2/1... int GEMCSCTriggerRate::getCSCSpecsType(CSCDetId &id) { return cscGeometry->chamber(id)->specs()->chamberType(); } - // ================================================================================================ int GEMCSCTriggerRate::cscTriggerSubsector(CSCDetId &id) diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.h b/SimMuL1/plugins/GEMCSCTriggerRate.h index e0eee6acf1b4e..9155bf2df9648 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.h +++ b/SimMuL1/plugins/GEMCSCTriggerRate.h @@ -8,7 +8,6 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/EDAnalyzer.h" - #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/ESHandle.h" @@ -20,32 +19,36 @@ #include "Geometry/Records/interface/MuonGeometryRecord.h" #include "Geometry/CSCGeometry/interface/CSCGeometry.h" -//#include -#include "Geometry/DTGeometry/interface/DTGeometry.h" -#include "Geometry/RPCGeometry/interface/RPCGeometry.h" - -#include "DataFormats/MuonDetId/interface/CSCDetId.h" -//#include -#include -#include -#include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h" -#include -#include - -#include -#include "DataFormats/L1CSCTrackFinder/interface/L1CSCTrackCollection.h" -#include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutCollection.h" +#include "DataFormats/CSCDigi/interface/CSCALCTDigiCollection.h" +#include "DataFormats/CSCDigi/interface/CSCCLCTDigiCollection.h" +#include "DataFormats/CSCDigi/interface/CSCComparatorDigiCollection.h" +#include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h" +#include "DataFormats/L1CSCTrackFinder/interface/L1CSCTrackCollection.h" +#include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutCollection.h" #include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h" #include "DataFormats/L1Trigger/interface/L1MuonParticle.h" +#include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h" +#include "DataFormats/L1Trigger/interface/L1MuonParticle.h" +#include "DataFormats/Math/interface/deltaPhi.h" -#include -#include +#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h" +#include "L1Trigger/CSCCommonTrigger/interface/CSCTriggerGeometry.h" +#include "L1Trigger/CSCTrackFinder/interface/CSCTFPtLUT.h" +#include "L1Trigger/CSCTrackFinder/interface/CSCTFSectorProcessor.h" +#include "L1Trigger/CSCTrackFinder/interface/CSCSectorReceiverLUT.h" +#include "L1Trigger/CSCTrackFinder/interface/CSCTrackFinderDataTypes.h" +#include "L1Trigger/CSCTrackFinder/src/CSCTFDTReceiver.h" #include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h" #include "CondFormats/L1TObjects/interface/L1MuTriggerPtScale.h" +#include "CondFormats/DataRecord/interface/L1MuTriggerScalesRcd.h" +#include "CondFormats/DataRecord/interface/L1MuTriggerPtScaleRcd.h" + +#include "SimMuon/CSCDigitizer/src/CSCDbStripConditions.h" +#include "GEMCode/SimMuL1/interface/EtaRangeHelpers.h" #include "GEMCode/SimMuL1/interface/PSimHitMap.h" #include "GEMCode/SimMuL1/interface/MatchCSCMuL1.h" @@ -54,21 +57,6 @@ #include "TH2.h" #include "TTree.h" - - -class DTGeometry; -class CSCGeometry; -class RPCGeometry; -class GEMGeometry; -class MuonDetLayerGeometry; - -class CSCTFSectorProcessor; -class CSCSectorReceiverLUT; -class CSCTFDTReceiver; - -class CSCStripConditions; - - class GEMCSCTriggerRate : public edm::EDAnalyzer { public: @@ -77,10 +65,10 @@ class GEMCSCTriggerRate : public edm::EDAnalyzer ~GEMCSCTriggerRate(); - virtual void beginJob(); - virtual void beginRun(const edm::Run&, const edm::EventSetup&); + virtual void beginJob(); + virtual void analyze(const edm::Event&, const edm::EventSetup&); enum trig_cscs {MAX_STATIONS = 4, CSC_TYPES = 10}; @@ -126,6 +114,15 @@ class GEMCSCTriggerRate : public edm::EDAnalyzer edm::ESHandle< L1MuTriggerScales > muScales; edm::ESHandle< L1MuTriggerPtScale > muPtScale; + void bookALCTTree(); + void bookCLCTTree(); + void bookLCTTree(); + void bookMPLCTTree(); + void bookTFTrackTree(); + void bookTFCandTree(); + void bookGMTRegionalTree(); + void bookGMTCandTree(); + void analyzeALCTRate(const edm::Event&); void analyzeCLCTRate(const edm::Event&); void analyzeLCTRate(const edm::Event&); @@ -136,7 +133,6 @@ class GEMCSCTriggerRate : public edm::EDAnalyzer void analyzeGMTCandRate(const edm::Event&); // config parameters: - bool lightRun; bool defaultME1a; bool doStrictSimHitToTrackMatch_; @@ -202,15 +198,11 @@ class GEMCSCTriggerRate : public edm::EDAnalyzer double minSimTrackDR_; - // members std::vector matches; std::map trkId2Index; const CSCGeometry* cscGeometry; - const DTGeometry* dtGeometry; - const RPCGeometry* rpcGeometry; - const GEMGeometry* gemGeometry; edm::ParameterSet gemMatchCfg_; std::vector gemPTs_, gemDPhisOdd_, gemDPhisEven_; @@ -593,29 +585,6 @@ class GEMCSCTriggerRate : public edm::EDAnalyzer TH1D * h_gmt_eta_dt_sing_gpt[N_PT_THRESHOLDS]; TH1D * h_gmt_eta_rpcf_sing_gpt[N_PT_THRESHOLDS]; TH1D * h_gmt_eta_rpcb_sing_gpt[N_PT_THRESHOLDS]; - - bool fill_debug_tree_; - TTree* dbg_tree; - void bookDbgTTree(); - struct DbgStruct - { - int evtn; - int trkn; - float pt,eta,phi; - float tfpt, tfeta, tfphi; - int tfpt_packed, tfeta_packed, tfphi_packed; - int nseg, nseg_ok; - int dPhi12; - int dPhi23; - int meEtap, mePhip; - int mcStrip; - int mcWG; - int strip; - int wg; - int chamber; - }; - DbgStruct dbg_; - void resetDbg(DbgStruct& d); }; #endif From d896dbf2e5423f3882fcd8aacc602971f9eda3e9 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sat, 17 Aug 2013 22:15:43 +0200 Subject: [PATCH 097/182] Removing more unnecessary stuff, putting the variables in the constructor in the right order, putting the struct declarations in the header file, outlining to improve legibility. --- SimMuL1/plugins/GEMCSCTriggerRate.cc | 622 ++++++++++++--------------- SimMuL1/plugins/GEMCSCTriggerRate.h | 160 ++++--- 2 files changed, 341 insertions(+), 441 deletions(-) diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.cc b/SimMuL1/plugins/GEMCSCTriggerRate.cc index aacdb0547c7d5..bf7b700a7d3e6 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRate.cc @@ -1,44 +1,5 @@ #include "GEMCode/SimMuL1/plugins/GEMCSCTriggerRate.h" -struct MyALCT -{ - Int_t nlayers, bx; - Float_t pt, eta, phi; - Char_t hit; // hits in MEX/Y or GE1/1 -}; - -struct MyCLCT -{ - Int_t nlayers, bx; - Float_t pt, eta, phi; - Char_t hit; // hits in MEX/Y or GE1/1 -}; - -struct MyLCT -{ - Int_t nlayers, bx; - Float_t pt, eta, phi; - Char_t hit; // hits in MEX/Y or GE1/1 -}; - -struct MyMPCLCT -{ - Int_t nlayers, bx; - Float_t pt, eta, phi; - Char_t hit; // hits in MEX/Y or GE1/1 -}; - -struct MyTFTrack{}; -struct MyTFCand{}; -struct MyGMTRegional{}; -struct MyGMT{}; - -namespace -{ - const Double_t ETA_BIN = 0.0125 *2; - const Double_t PHI_BIN = 62.*M_PI/180./4096.; // 0.26 mrad -} - // ================================================================================================ const std::string GEMCSCTriggerRate::csc_type[CSC_TYPES+1] = { "ME1/1", "ME1/2", "ME1/3", "ME1/a", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2", "ME1/T"}; @@ -48,87 +9,46 @@ const std::string GEMCSCTriggerRate::csc_type_a[CSC_TYPES+2] = { "N/A", "ME1/a", "ME1/b", "ME1/2", "ME1/3", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2", "ME1/T"}; const std::string GEMCSCTriggerRate::csc_type_a_[CSC_TYPES+2] = { "NA", "ME1A", "ME1B", "ME12", "ME13", "ME21", "ME22", "ME31", "ME32", "ME41", "ME42", "ME1T"}; - -const int GEMCSCTriggerRate::NCHAMBERS[CSC_TYPES] = - { 36, 36, 36, 36, 18, 36, 18, 36, 18, 36}; - -const int GEMCSCTriggerRate::MAX_WG[CSC_TYPES] = - { 48, 64, 32, 48, 112, 64, 96, 64, 96, 64};//max. number of wiregroups - -const int GEMCSCTriggerRate::MAX_HS[CSC_TYPES] = - { 128, 160, 128, 96, 160, 160, 160, 160, 160, 160}; // max. # of halfstrips - -//const int GEMCSCTriggerRate::ptype[CSCConstants::NUM_CLCT_PATTERNS_PRE_TMB07]= -// { -999, 3, -3, 2, -2, 1, -1, 0}; // "signed" pattern (== phiBend) const int GEMCSCTriggerRate::pbend[CSCConstants::NUM_CLCT_PATTERNS]= { -999, -5, 4, -4, 3, -3, 2, -2, 1, -1, 0}; // "signed" pattern (== phiBend) - - const double GEMCSCTriggerRate::PT_THRESHOLDS[N_PT_THRESHOLDS] = {0,10,20,30,40,50}; const double GEMCSCTriggerRate::PT_THRESHOLDS_FOR_ETA[N_PT_THRESHOLDS] = {10,15,30,40,55,70}; // ================================================================================================ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): - // theCSCSimHitMap("MuonCSCHits"), theDTSimHitMap("MuonDTHits"), theRPCSimHitMap("MuonRPCHits") + CSCTFSPset(iConfig.getParameter("SectorProcessor")), + ptLUTset(CSCTFSPset.getParameter("PTLUT")), ptLUT(0), - theCSCSimHitMap() -{ - simHitsFromCrossingFrame_ = iConfig.getUntrackedParameter("SimHitsFromCrossingFrame", false); - simHitsModuleName_ = iConfig.getUntrackedParameter("SimHitsModuleName", "g4SimHits"); - simHitsCollectionName_ = iConfig.getUntrackedParameter("SimHitsCollectionName","MuonCSCHits"); - theCSCSimHitMap.setUseCrossingFrame(simHitsFromCrossingFrame_); - theCSCSimHitMap.setModuleName(simHitsModuleName_); - theCSCSimHitMap.setCollectionName(simHitsCollectionName_); - - matchAllTrigPrimitivesInChamber_ = iConfig.getUntrackedParameter("matchAllTrigPrimitivesInChamber", false); - - debugALCT = iConfig.getUntrackedParameter("debugALCT", 0); - debugCLCT = iConfig.getUntrackedParameter("debugCLCT", 0); - debugLCT = iConfig.getUntrackedParameter("debugLCT", 0); - debugMPLCT = iConfig.getUntrackedParameter("debugMPLCT", 0); - debugTFTRACK = iConfig.getUntrackedParameter("debugTFTRACK", 0); - debugTFCAND = iConfig.getUntrackedParameter("debugTFCAND", 0); - debugGMTCAND = iConfig.getUntrackedParameter("debugGMTCAND", 0); - debugL1EXTRA = iConfig.getUntrackedParameter("debugL1EXTRA", 0); - debugRATE = iConfig.getUntrackedParameter("debugRATE", 0); - - minBX_ = iConfig.getUntrackedParameter< int >("minBX",-6); - maxBX_ = iConfig.getUntrackedParameter< int >("maxBX",6); - minTMBBX_ = iConfig.getUntrackedParameter< int >("minTMBBX",-6); - maxTMBBX_ = iConfig.getUntrackedParameter< int >("maxTMBBX",6); - minRateBX_ = iConfig.getUntrackedParameter< int >("minRateBX",-1); - maxRateBX_ = iConfig.getUntrackedParameter< int >("maxRateBX",1); - - minBxALCT_ = iConfig.getUntrackedParameter< int >("minBxALCT",5); - maxBxALCT_ = iConfig.getUntrackedParameter< int >("maxBxALCT",7); - minBxCLCT_ = iConfig.getUntrackedParameter< int >("minBxCLCT",5); - maxBxCLCT_ = iConfig.getUntrackedParameter< int >("maxBxCLCT",7); - minBxLCT_ = iConfig.getUntrackedParameter< int >("minBxLCT",5); - maxBxLCT_ = iConfig.getUntrackedParameter< int >("maxBxLCT",7); - minBxMPLCT_ = iConfig.getUntrackedParameter< int >("minBxMPLCT",5); - maxBxMPLCT_ = iConfig.getUntrackedParameter< int >("maxBxMPLCT",7); - - minBxGMT_ = iConfig.getUntrackedParameter< int >("minBxGMT",-1); - maxBxGMT_ = iConfig.getUntrackedParameter< int >("maxBxGMT",1); - - centralBxOnlyGMT_ = iConfig.getUntrackedParameter< bool >("centralBxOnlyGMT",false); - - doSelectEtaForGMTRates_ = iConfig.getUntrackedParameter< bool >("doSelectEtaForGMTRates",false); - - doME1a_ = iConfig.getUntrackedParameter< bool >("doME1a",false); - + matchAllTrigPrimitivesInChamber_(iConfig.getUntrackedParameter("matchAllTrigPrimitivesInChamber", false)), + debugRATE(iConfig.getUntrackedParameter("debugRATE", 0)), + minBX_(iConfig.getUntrackedParameter("minBX",-6)), + maxBX_(iConfig.getUntrackedParameter("maxBX",6)), + minTMBBX_(iConfig.getUntrackedParameter("minTMBBX",-6)), + maxTMBBX_(iConfig.getUntrackedParameter("maxTMBBX",6)), + minRateBX_(iConfig.getUntrackedParameter("minRateBX",-1)), + maxRateBX_(iConfig.getUntrackedParameter("maxRateBX",1)), + minBxALCT_(iConfig.getUntrackedParameter("minBxALCT",5)), + maxBxALCT_(iConfig.getUntrackedParameter("maxBxALCT",7)), + minBxCLCT_(iConfig.getUntrackedParameter("minBxCLCT",5)), + maxBxCLCT_(iConfig.getUntrackedParameter("maxBxCLCT",7)), + minBxLCT_(iConfig.getUntrackedParameter("minBxLCT",5)), + maxBxLCT_(iConfig.getUntrackedParameter("maxBxLCT",7)), + minBxMPLCT_(iConfig.getUntrackedParameter("minBxMPLCT",5)), + maxBxMPLCT_(iConfig.getUntrackedParameter("maxBxMPLCT",7)), + minBxGMT_(iConfig.getUntrackedParameter("minBxGMT",-1)), + maxBxGMT_(iConfig.getUntrackedParameter("maxBxGMT",1)), + centralBxOnlyGMT_(iConfig.getUntrackedParameter< bool >("centralBxOnlyGMT",false)), + doSelectEtaForGMTRates_(iConfig.getUntrackedParameter< bool >("doSelectEtaForGMTRates",false)), + doME1a_(iConfig.getUntrackedParameter< bool >("doME1a",false)), // special treatment of matching in ME1a for the case of the default emulator - defaultME1a = iConfig.getUntrackedParameter("defaultME1a", false); - - edm::ParameterSet stripPSet = iConfig.getParameter("strips"); - theStripConditions = new CSCDbStripConditions(stripPSet); - - CSCTFSPset = iConfig.getParameter("SectorProcessor"); - ptLUTset = CSCTFSPset.getParameter("PTLUT"); + defaultME1a(iConfig.getUntrackedParameter("defaultME1a", false)) +{ edm::ParameterSet srLUTset = CSCTFSPset.getParameter("SRLUT"); - for(int e=0; e<2; e++) for (int s=0; s<6; s++) my_SPs[e][s] = NULL; + for(int e=0; e<2; e++) + for (int s=0; s<6; s++) + my_SPs[e][s] = NULL; bool TMB07 = true; for(int endcap = 1; endcap<=2; endcap++) @@ -145,7 +65,6 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): } } - my_dtrc = new CSCTFDTReceiver(); // cache flags for event setup records @@ -165,7 +84,6 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): // ================================================================================================ GEMCSCTriggerRate::~GEMCSCTriggerRate() { - if(ptLUT) delete ptLUT; ptLUT = NULL; @@ -182,9 +100,6 @@ GEMCSCTriggerRate::~GEMCSCTriggerRate() if(my_dtrc) delete my_dtrc; my_dtrc = NULL; - - if (theStripConditions) delete theStripConditions; - theStripConditions = 0; } // ================================================================================================ @@ -195,7 +110,6 @@ GEMCSCTriggerRate::beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) iSetup.get().get(cscGeom); cscGeometry = &*cscGeom; CSCTriggerGeometry::setGeometry(cscGeometry); - } // ================================================================================================ @@ -204,6 +118,8 @@ GEMCSCTriggerRate::beginJob() { edm::Service fs; + Double_t ETA_BIN = 0.0125 *2; + //Double_t PHI_BIN = 62.*M_PI/180./4096.; // 0.26 mrad int N_ETA_BINS=200; double ETA_START=-2.4999; double ETA_END = ETA_START + ETA_BIN*N_ETA_BINS; @@ -228,8 +144,6 @@ GEMCSCTriggerRate::beginJob() 1.85, 1.9, 1.95, 2, 2.05, 2.1, 2.15, 2.2, 2.25, 2.3, 2.35, 2.4, 2.45}; - - h_rt_nalct = fs->make("h_rt_nalct","h_rt_nalct",101,-0.5, 100.5); h_rt_nclct = fs->make("h_rt_nclct","h_rt_nclct",101,-0.5, 100.5); h_rt_nlct = fs->make("h_rt_nlct","h_rt_nlct",101,-0.5, 100.5); @@ -558,8 +472,6 @@ GEMCSCTriggerRate::beginJob() h_rt_tfcand_pt_vs_eta_3st = fs->make("h_rt_tfcand_pt_vs_eta_3st","h_rt_tfcand_pt_vs_eta_3st",600, 0.,150.,N_ETA_BINS, ETA_START, ETA_END); h_rt_tfcand_pt_vs_eta_3st1a = fs->make("h_rt_tfcand_pt_vs_eta_3st1a","h_rt_tfcand_pt_vs_eta_3st1a",600, 0.,150.,N_ETA_BINS, ETA_START, ETA_END); - - char label[200]; for (int me=0; me<=CSC_TYPES; me++) { @@ -598,9 +510,6 @@ GEMCSCTriggerRate::beginJob() sprintf(label,"h_rt_mplct_bx_cscdet_%s",csc_type_[me].c_str()); h_rt_mplct_bx_cscdet[me] = fs->make(label, label,13,-6.5, 6.5); -// sprintf(label,"_cscdet_%s",csc_type_[me].c_str()); -// _cscdet[me] = fs->make(label, label, 15,-7.5, 7.5); - }//for (int me=0; memake("h_rt_lct_per_sector","h_rt_lct_per_sector",20,0., 20.); @@ -634,8 +543,6 @@ GEMCSCTriggerRate::beginJob() sprintf(label,"h_rt_mplct_per_sector_vs_bx_st%d",i+1); h_rt_mplct_per_sector_vs_bx_st[i] = fs->make(label, label, 20,0., 20.,16,0,16); - //sprintf(label,"_st%d",i+1); - //_st[i] = fs->make(label, label, 20,0., 20.,16,0,16); } h_rt_mplct_pattern = fs->make("h_rt_mplct_pattern","h_rt_mplct_pattern",13,-0.5, 12.5); @@ -650,12 +557,6 @@ GEMCSCTriggerRate::beginJob() void GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { - // get conditions for bad chambers (don't need random engine) - theStripConditions->initializeEvent(iSetup); - - // get SimHits - theCSCSimHitMap.fill(iEvent); - // ALCTs and CLCTs edm::Handle< CSCCLCTDigiCollection > hclcts; iEvent.getByLabel("simCscTriggerPrimitiveDigis", hclcts); @@ -1821,245 +1722,246 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet std::vector RPCbCands = rItr->getBrlRPCCands(); std::vector GMTCands = rItr->getGMTCands(); for ( std::vector::const_iterator muItr = GMTCands.begin() ; muItr != GMTCands.end() ; ++muItr ) + { + if( muItr->empty() ) continue; + + if ( muItr->bx() < minRateBX_ || muItr->bx() > maxRateBX_ ) { - if( muItr->empty() ) continue; - - if ( muItr->bx() < minRateBX_ || muItr->bx() > maxRateBX_ ) - { - if (debugRATE) std::cout<<"discarding BX = "<< muItr->bx() <isFwd() && ( muItr->isMatchedCand() || !muItr->isRPC())) { - L1MuRegionalCand rcsc = CSCCands[muItr->getDTCSCIndex()]; - unsigned my_i = 999; - for (unsigned i=0; i< rtGMTREGCands.size(); i++) - { - if (rcsc.getDataWord()!=rtGMTREGCands[i].l1reg->getDataWord()) continue; - my_i = i; - break; - } - if (my_i<99) gmt_csc = &rtGMTREGCands[my_i]; - else std::cout<<"DOES NOT EXIST IN rtGMTREGCands! Should not happen!"<ids; + if (debugRATE) std::cout<<"discarding BX = "<< muItr->bx() <isFwd() && ( muItr->isMatchedCand() || !muItr->isRPC())) + { + L1MuRegionalCand rcsc = CSCCands[muItr->getDTCSCIndex()]; + unsigned my_i = 999; + for (unsigned i=0; i< rtGMTREGCands.size(); i++) + { + if (rcsc.getDataWord()!=rtGMTREGCands[i].l1reg->getDataWord()) continue; + my_i = i; + break; } - - MatchCSCMuL1::GMTREGCAND * gmt_rpcf = NULL; - if (muItr->isFwd() && (muItr->isMatchedCand() || muItr->isRPC())) - { - L1MuRegionalCand rrpcf = RPCfCands[muItr->getRPCIndex()]; - unsigned my_i = 999; - for (unsigned i=0; i< rtGMTRPCfCands.size(); i++) - { - if (rrpcf.getDataWord()!=rtGMTRPCfCands[i].l1reg->getDataWord()) continue; - my_i = i; - break; - } - if (my_i<99) gmt_rpcf = &rtGMTRPCfCands[my_i]; - else std::cout<<"DOES NOT EXIST IN rtGMTRPCfCands! Should not happen!"<isFwd()) && (muItr->isMatchedCand() || muItr->isRPC())) - { - L1MuRegionalCand rrpcb = RPCbCands[muItr->getRPCIndex()]; - unsigned my_i = 999; - for (unsigned i=0; i< rtGMTRPCbCands.size(); i++) - { - if (rrpcb.getDataWord()!=rtGMTRPCbCands[i].l1reg->getDataWord()) continue; - my_i = i; - break; - } - if (my_i<99) gmt_rpcb = &rtGMTRPCbCands[my_i]; - else std::cout<<"DOES NOT EXIST IN rtGMTRPCbCands! Should not happen!"<isFwd()) && (muItr->isMatchedCand() || !(muItr->isRPC()))) - { - L1MuRegionalCand rdt = DTCands[muItr->getDTCSCIndex()]; - unsigned my_i = 999; - for (unsigned i=0; i< rtGMTDTCands.size(); i++) - { - if (rdt.getDataWord()!=rtGMTDTCands[i].l1reg->getDataWord()) continue; - my_i = i; - break; - } - if (my_i<99) gmt_dt = &rtGMTDTCands[my_i]; - else std::cout<<"DOES NOT EXIST IN rtGMTDTCands! Should not happen!"<isMatchedCand() ) std::cout<<"csc&rpcf but not matched!"<=1.2 && geta<=1.8) eta_me42 = 1; - bool eta_q = (geta > 1.2); - - bool eta_me1b = etaRangeHelpers::isME1bEtaRegion(myGMTCand.eta); - //bool eta_me1b_whole = etaRangeHelpers::isME1bEtaRegion(myGMTCand.eta, 1.6, 2.14); - bool eta_no1a = (geta >= 1.2 && geta < 2.14); - //bool eta_csc = (geta > 0.9); - // - - size_t n_stubs = 0; - if (gmt_csc) n_stubs = gmt_csc->nTFStubs; - - bool has_me1_stub = false; - if (gmt_csc && gmt_csc->tfcand && gmt_csc->tfcand->tftrack) + if (my_i<99) gmt_csc = &rtGMTREGCands[my_i]; + else std::cout<<"DOES NOT EXIST IN rtGMTREGCands! Should not happen!"<ids; + } + + MatchCSCMuL1::GMTREGCAND * gmt_rpcf = NULL; + if (muItr->isFwd() && (muItr->isMatchedCand() || muItr->isRPC())) + { + L1MuRegionalCand rrpcf = RPCfCands[muItr->getRPCIndex()]; + unsigned my_i = 999; + for (unsigned i=0; i< rtGMTRPCfCands.size(); i++) + { + if (rrpcf.getDataWord()!=rtGMTRPCfCands[i].l1reg->getDataWord()) continue; + my_i = i; + break; + } + if (my_i<99) gmt_rpcf = &rtGMTRPCfCands[my_i]; + else std::cout<<"DOES NOT EXIST IN rtGMTRPCfCands! Should not happen!"<isFwd()) && (muItr->isMatchedCand() || muItr->isRPC())) + { + L1MuRegionalCand rrpcb = RPCbCands[muItr->getRPCIndex()]; + unsigned my_i = 999; + for (unsigned i=0; i< rtGMTRPCbCands.size(); i++) + { + if (rrpcb.getDataWord()!=rtGMTRPCbCands[i].l1reg->getDataWord()) continue; + my_i = i; + break; + } + if (my_i<99) gmt_rpcb = &rtGMTRPCbCands[my_i]; + else std::cout<<"DOES NOT EXIST IN rtGMTRPCbCands! Should not happen!"<isFwd()) && (muItr->isMatchedCand() || !(muItr->isRPC()))) + { + L1MuRegionalCand rdt = DTCands[muItr->getDTCSCIndex()]; + unsigned my_i = 999; + for (unsigned i=0; i< rtGMTDTCands.size(); i++) { - has_me1_stub = gmt_csc->tfcand->tftrack->hasStub(1); + if (rdt.getDataWord()!=rtGMTDTCands[i].l1reg->getDataWord()) continue; + my_i = i; + break; } - - - if (eta_me42) h_rt_gmt_gq_42->Fill(muItr->quality()); + if (my_i<99) gmt_dt = &rtGMTDTCands[my_i]; + else std::cout<<"DOES NOT EXIST IN rtGMTDTCands! Should not happen!"<isMatchedCand() ) std::cout<<"csc&rpcf but not matched!"<=1.2 && geta<=1.8) eta_me42 = 1; + bool eta_q = (geta > 1.2); + + bool eta_me1b = etaRangeHelpers::isME1bEtaRegion(myGMTCand.eta); + //bool eta_me1b_whole = etaRangeHelpers::isME1bEtaRegion(myGMTCand.eta, 1.6, 2.14); + bool eta_no1a = (geta >= 1.2 && geta < 2.14); + //bool eta_csc = (geta > 0.9); + // + + size_t n_stubs = 0; + if (gmt_csc) n_stubs = gmt_csc->nTFStubs; + + bool has_me1_stub = false; + if (gmt_csc && gmt_csc->tfcand && gmt_csc->tfcand->tftrack) + { + has_me1_stub = gmt_csc->tfcand->tftrack->hasStub(1); + } + + + if (eta_me42) h_rt_gmt_gq_42->Fill(muItr->quality()); + if (eta_me42r) { + int gtype = 0; + if (muItr->isMatchedCand()) gtype = 6; + else if (gmt_csc!=0) gtype = gmt_csc->l1reg->quality()+2; + else if (gmt_rpcf!=0) gtype = gmt_rpcf->l1reg->quality()+1; + if (gtype==0) std::cout<<"weird: gtype=0 That shouldn't happen!"; + h_rt_gmt_gq_vs_type_42r->Fill(muItr->quality(), gtype); + h_rt_gmt_gq_vs_pt_42r->Fill(muItr->quality(), gpt); + h_rt_gmt_gq_42r->Fill(muItr->quality()); + } + h_rt_gmt_gq->Fill(muItr->quality()); + + h_rt_gmt_bx->Fill(muItr->bx()); + + //if (muItr->quality()<4) continue; // not good for single muon trigger! + + bool isSingleTrigOk = muItr->useInSingleMuonTrigger(); // good for single trigger + bool isDoubleTrigOk = muItr->useInDiMuonTrigger(); // good for single trigger + + bool isSingle6TrigOk = (muItr->quality() >= 6); // unmatched or matched CSC or DT + + if (muItr->quality()<3) continue; // not good for neither single nor dimuon triggers + + bool isCSC = (gmt_csc != NULL); + bool isDT = (gmt_dt != NULL); + bool isRPCf = (gmt_rpcf != NULL); + bool isRPCb = (gmt_rpcb != NULL); + + if (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack == NULL) std::cout<<"warning: gmt_csc->tfcand->tftrack == NULL"<tfcand != NULL && gmt_csc->tfcand->tftrack != NULL && gmt_csc->tfcand->tftrack->l1trk == NULL) + std::cout<<"warning: gmt_csc->tfcand->tftrack->l1trk == NULL"<tfcand != NULL && myGMTCand.ids.size()>=2); + //bool isCSC3s = (isCSC && gmt_csc->tfcand != NULL && myGMTCand.ids.size()>=3); + bool isCSC2s = (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack != NULL && gmt_csc->tfcand->tftrack->nStubs()>=2); + bool isCSC3s = (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack != NULL + && ( (!eta_q && isCSC2s) || (eta_q && gmt_csc->tfcand->tftrack->nStubs()>=3) ) ); + bool isCSC2q = (isCSC && gmt_csc->l1reg != NULL && gmt_csc->l1reg->quality()>=2); + bool isCSC3q = (isCSC && gmt_csc->l1reg != NULL + && ( (!eta_q && isCSC2q) || (eta_q && gmt_csc->l1reg->quality()>=3) ) ); + + myGMTCand.isCSC = isCSC; + myGMTCand.isDT = isDT; + myGMTCand.isRPCf = isRPCf; + myGMTCand.isRPCb = isRPCb; + myGMTCand.isCSC2s = isCSC2s; + myGMTCand.isCSC3s = isCSC3s; + myGMTCand.isCSC2q = isCSC2q; + myGMTCand.isCSC3q = isCSC3q; + + rtGMTCands.push_back(myGMTCand); + + + if (isCSC2q || isRPCf) { + h_rt_gmt_pt_2q->Fill(gpt); + if (eta_me42) { + h_rt_gmt_pt_2q42->Fill(gpt); + if (gpt > max_pt_me42_2q) max_pt_me42_2q = gpt; + if (isSingleTrigOk && gpt > max_pt_me42_2q_sing) max_pt_me42_2q_sing = gpt; + } if (eta_me42r) { - int gtype = 0; - if (muItr->isMatchedCand()) gtype = 6; - else if (gmt_csc!=0) gtype = gmt_csc->l1reg->quality()+2; - else if (gmt_rpcf!=0) gtype = gmt_rpcf->l1reg->quality()+1; - if (gtype==0) std::cout<<"weird: gtype=0 That shouldn't happen!"; - h_rt_gmt_gq_vs_type_42r->Fill(muItr->quality(), gtype); - h_rt_gmt_gq_vs_pt_42r->Fill(muItr->quality(), gpt); - h_rt_gmt_gq_42r->Fill(muItr->quality()); + h_rt_gmt_pt_2q42r->Fill(gpt); + if (gpt > max_pt_me42r_2q) max_pt_me42r_2q = gpt; + if (isSingleTrigOk && gpt > max_pt_me42r_2q_sing) max_pt_me42r_2q_sing = gpt; } - h_rt_gmt_gq->Fill(muItr->quality()); - - h_rt_gmt_bx->Fill(muItr->bx()); - - //if (muItr->quality()<4) continue; // not good for single muon trigger! - - bool isSingleTrigOk = muItr->useInSingleMuonTrigger(); // good for single trigger - bool isDoubleTrigOk = muItr->useInDiMuonTrigger(); // good for single trigger - - bool isSingle6TrigOk = (muItr->quality() >= 6); // unmatched or matched CSC or DT - - if (muItr->quality()<3) continue; // not good for neither single nor dimuon triggers - - bool isCSC = (gmt_csc != NULL); - bool isDT = (gmt_dt != NULL); - bool isRPCf = (gmt_rpcf != NULL); - bool isRPCb = (gmt_rpcb != NULL); - - if (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack == NULL) std::cout<<"warning: gmt_csc->tfcand->tftrack == NULL"<tfcand != NULL && gmt_csc->tfcand->tftrack != NULL && gmt_csc->tfcand->tftrack->l1trk == NULL) - std::cout<<"warning: gmt_csc->tfcand->tftrack->l1trk == NULL"<tfcand != NULL && myGMTCand.ids.size()>=2); - //bool isCSC3s = (isCSC && gmt_csc->tfcand != NULL && myGMTCand.ids.size()>=3); - bool isCSC2s = (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack != NULL && gmt_csc->tfcand->tftrack->nStubs()>=2); - bool isCSC3s = (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack != NULL - && ( (!eta_q && isCSC2s) || (eta_q && gmt_csc->tfcand->tftrack->nStubs()>=3) ) ); - bool isCSC2q = (isCSC && gmt_csc->l1reg != NULL && gmt_csc->l1reg->quality()>=2); - bool isCSC3q = (isCSC && gmt_csc->l1reg != NULL - && ( (!eta_q && isCSC2q) || (eta_q && gmt_csc->l1reg->quality()>=3) ) ); - - myGMTCand.isCSC = isCSC; - myGMTCand.isDT = isDT; - myGMTCand.isRPCf = isRPCf; - myGMTCand.isRPCb = isRPCb; - myGMTCand.isCSC2s = isCSC2s; - myGMTCand.isCSC3s = isCSC3s; - myGMTCand.isCSC2q = isCSC2q; - myGMTCand.isCSC3q = isCSC3q; - - rtGMTCands.push_back(myGMTCand); - - - if (isCSC2q || isRPCf) { - h_rt_gmt_pt_2q->Fill(gpt); - if (eta_me42) { - h_rt_gmt_pt_2q42->Fill(gpt); - if (gpt > max_pt_me42_2q) max_pt_me42_2q = gpt; - if (isSingleTrigOk && gpt > max_pt_me42_2q_sing) max_pt_me42_2q_sing = gpt; - } - if (eta_me42r) { - h_rt_gmt_pt_2q42r->Fill(gpt); - if (gpt > max_pt_me42r_2q) max_pt_me42r_2q = gpt; - if (isSingleTrigOk && gpt > max_pt_me42r_2q_sing) max_pt_me42r_2q_sing = gpt; - } + } + if (isCSC3q || isRPCf) { + h_rt_gmt_pt_3q->Fill(gpt); + if (eta_me42) { + h_rt_gmt_pt_3q42->Fill(gpt); + if (gpt > max_pt_me42_3q) max_pt_me42_3q = gpt; + if (isSingleTrigOk && gpt > max_pt_me42_3q_sing) max_pt_me42_3q_sing = gpt; } - if (isCSC3q || isRPCf) { - h_rt_gmt_pt_3q->Fill(gpt); - if (eta_me42) { - h_rt_gmt_pt_3q42->Fill(gpt); - if (gpt > max_pt_me42_3q) max_pt_me42_3q = gpt; - if (isSingleTrigOk && gpt > max_pt_me42_3q_sing) max_pt_me42_3q_sing = gpt; - } - if (eta_me42r) { - h_rt_gmt_pt_3q42r->Fill(gpt); - if (gpt > max_pt_me42r_3q) max_pt_me42r_3q = gpt; - if (isSingleTrigOk && gpt > max_pt_me42r_3q_sing) max_pt_me42r_3q_sing = gpt; - } + if (eta_me42r) { + h_rt_gmt_pt_3q42r->Fill(gpt); + if (gpt > max_pt_me42r_3q) max_pt_me42r_3q = gpt; + if (isSingleTrigOk && gpt > max_pt_me42r_3q_sing) max_pt_me42r_3q_sing = gpt; } + } - if (isCSC2s || isRPCf) { - h_rt_gmt_pt_2st->Fill(gpt); - if (eta_me42) { - h_rt_gmt_pt_2s42->Fill(gpt); - if (gpt > max_pt_me42_2s) max_pt_me42_2s = gpt; - if (isSingleTrigOk && gpt > max_pt_me42_2s_sing) max_pt_me42_2s_sing = gpt; - } - if (eta_me42r) { - h_rt_gmt_pt_2s42r->Fill(gpt); - if (gpt > max_pt_me42r_2s) max_pt_me42r_2s = gpt; - if (isSingleTrigOk && gpt > max_pt_me42r_2s_sing) max_pt_me42r_2s_sing = gpt; - } + if (isCSC2s || isRPCf) { + h_rt_gmt_pt_2st->Fill(gpt); + if (eta_me42) { + h_rt_gmt_pt_2s42->Fill(gpt); + if (gpt > max_pt_me42_2s) max_pt_me42_2s = gpt; + if (isSingleTrigOk && gpt > max_pt_me42_2s_sing) max_pt_me42_2s_sing = gpt; } - if (isCSC3s || isRPCf) { - h_rt_gmt_pt_3st->Fill(gpt); - if (eta_me42) { - h_rt_gmt_pt_3s42->Fill(gpt); - if (gpt > max_pt_me42_3s) max_pt_me42_3s = gpt; - if (isSingleTrigOk && gpt > max_pt_me42_3s_sing) max_pt_me42_3s_sing = gpt; - } - if (eta_me42r) { - h_rt_gmt_pt_3s42r->Fill(gpt); - if (gpt > max_pt_me42r_3s) max_pt_me42r_3s = gpt; - if (isSingleTrigOk && gpt > max_pt_me42r_3s_sing) max_pt_me42r_3s_sing = gpt; - } + if (eta_me42r) { + h_rt_gmt_pt_2s42r->Fill(gpt); + if (gpt > max_pt_me42r_2s) max_pt_me42r_2s = gpt; + if (isSingleTrigOk && gpt > max_pt_me42r_2s_sing) max_pt_me42r_2s_sing = gpt; + } + } + if (isCSC3s || isRPCf) { + h_rt_gmt_pt_3st->Fill(gpt); + if (eta_me42) { + h_rt_gmt_pt_3s42->Fill(gpt); + if (gpt > max_pt_me42_3s) max_pt_me42_3s = gpt; + if (isSingleTrigOk && gpt > max_pt_me42_3s_sing) max_pt_me42_3s_sing = gpt; + } + if (eta_me42r) { + h_rt_gmt_pt_3s42r->Fill(gpt); + if (gpt > max_pt_me42r_3s) max_pt_me42r_3s = gpt; + if (isSingleTrigOk && gpt > max_pt_me42r_3s_sing) max_pt_me42r_3s_sing = gpt; } - - ngmt++; - h_rt_gmt_pt->Fill(gpt); - h_rt_gmt_eta->Fill(geta); - if (gpt > max_pt) {max_pt = gpt; max_pt_eta = geta;} - if (isDoubleTrigOk && gpt > max_pt_dbl) {max_pt_dbl = gpt; max_pt_eta_dbl = geta;} - if (isSingleTrigOk) - { - if ( gpt > max_pt_sing ) { max_pt_sing = gpt; max_pt_eta_sing = geta;} - if (isCSC && gpt > max_pt_sing_csc ) { max_pt_sing_csc = gpt; max_pt_eta_sing_csc = geta; } - if ((isCSC||isDT) && gpt > max_pt_sing_dtcsc ) { max_pt_sing_dtcsc = gpt; max_pt_eta_sing_dtcsc = geta; } - if (gpt > max_pt_sing_3s && ( !isCSC || isCSC3s ) ) {max_pt_sing_3s = gpt; max_pt_eta_sing_3s = geta;} - if (eta_me1b && gpt > max_pt_sing_1b ) { max_pt_sing_1b = gpt; /*max_pt_eta_sing_1b = geta;*/ } - if (eta_no1a && gpt > max_pt_sing_no1a) { max_pt_sing_no1a = gpt; /*max_pt_eta_sing_no1a = geta;*/ } - } - if (isSingle6TrigOk) - { - if ( gpt > max_pt_sing6 ) { max_pt_sing6 = gpt; max_pt_eta_sing6 = geta;} - if (isCSC && gpt > max_pt_sing6_csc ) { max_pt_sing6_csc = gpt; max_pt_eta_sing6_csc = geta; } - if (gpt > max_pt_sing6_3s && ( !isCSC || isCSC3s ) ) {max_pt_sing6_3s = gpt; max_pt_eta_sing6_3s = geta;} - if (eta_me1b && gpt > max_pt_sing6_1b ) { max_pt_sing6_1b = gpt; /*max_pt_eta_sing6_1b = geta;*/ } - if (eta_no1a && gpt > max_pt_sing6_no1a) { max_pt_sing6_no1a = gpt; /*max_pt_eta_sing6_no1a = geta;*/ } - if (eta_no1a && gpt > max_pt_sing6_3s1b_no1a && - (!eta_me1b || (eta_me1b && has_me1_stub && n_stubs >=3) ) ) { max_pt_sing6_3s1b_no1a = gpt; /*max_pt_eta_sing6_no1a = geta;*/ } - } } + + ngmt++; + h_rt_gmt_pt->Fill(gpt); + h_rt_gmt_eta->Fill(geta); + if (gpt > max_pt) {max_pt = gpt; max_pt_eta = geta;} + if (isDoubleTrigOk && gpt > max_pt_dbl) {max_pt_dbl = gpt; max_pt_eta_dbl = geta;} + if (isSingleTrigOk) + { + if ( gpt > max_pt_sing ) { max_pt_sing = gpt; max_pt_eta_sing = geta;} + if (isCSC && gpt > max_pt_sing_csc ) { max_pt_sing_csc = gpt; max_pt_eta_sing_csc = geta; } + if ((isCSC||isDT) && gpt > max_pt_sing_dtcsc ) { max_pt_sing_dtcsc = gpt; max_pt_eta_sing_dtcsc = geta; } + if (gpt > max_pt_sing_3s && ( !isCSC || isCSC3s ) ) {max_pt_sing_3s = gpt; max_pt_eta_sing_3s = geta;} + if (eta_me1b && gpt > max_pt_sing_1b ) { max_pt_sing_1b = gpt; /*max_pt_eta_sing_1b = geta;*/ } + if (eta_no1a && gpt > max_pt_sing_no1a) { max_pt_sing_no1a = gpt; /*max_pt_eta_sing_no1a = geta;*/ } + } + if (isSingle6TrigOk) + { + if ( gpt > max_pt_sing6 ) { max_pt_sing6 = gpt; max_pt_eta_sing6 = geta;} + if (isCSC && gpt > max_pt_sing6_csc ) { max_pt_sing6_csc = gpt; max_pt_eta_sing6_csc = geta; } + if (gpt > max_pt_sing6_3s && ( !isCSC || isCSC3s ) ) {max_pt_sing6_3s = gpt; max_pt_eta_sing6_3s = geta;} + if (eta_me1b && gpt > max_pt_sing6_1b ) { max_pt_sing6_1b = gpt; /*max_pt_eta_sing6_1b = geta;*/ } + if (eta_no1a && gpt > max_pt_sing6_no1a) { max_pt_sing6_no1a = gpt; /*max_pt_eta_sing6_no1a = geta;*/ } + if (eta_no1a && gpt > max_pt_sing6_3s1b_no1a && + (!eta_me1b || (eta_me1b && has_me1_stub && n_stubs >=3) ) ) { max_pt_sing6_3s1b_no1a = gpt; /*max_pt_eta_sing6_no1a = geta;*/ } + } + } } h_rt_ngmt->Fill(ngmt); if (max_pt_me42_2s>0) h_rt_gmt_ptmax_2s42->Fill(max_pt_me42_2s); @@ -2123,6 +2025,14 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet void GEMCSCTriggerRate::bookALCTTree() { + edm::Service< TFileService > fs; + alct_tree_ = fs->make("ALCTs", "ALCTs"); + alct_tree_->Branch("charge",&alct_.nlayers); + alct_tree_->Branch("pt",&alct_.pt); + alct_tree_->Branch("eta",&alct_.eta); + alct_tree_->Branch("phi",&alct_.phi); + alct_tree_->Branch("endcap",&alct_.bx); + // alct_tree_->Branch("gem_sh_layer1",&alct_.); } // ================================================================================================ diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.h b/SimMuL1/plugins/GEMCSCTriggerRate.h index 9155bf2df9648..5e8bfeb2911ac 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.h +++ b/SimMuL1/plugins/GEMCSCTriggerRate.h @@ -46,10 +46,7 @@ #include "CondFormats/DataRecord/interface/L1MuTriggerScalesRcd.h" #include "CondFormats/DataRecord/interface/L1MuTriggerPtScaleRcd.h" -#include "SimMuon/CSCDigitizer/src/CSCDbStripConditions.h" - #include "GEMCode/SimMuL1/interface/EtaRangeHelpers.h" -#include "GEMCode/SimMuL1/interface/PSimHitMap.h" #include "GEMCode/SimMuL1/interface/MatchCSCMuL1.h" // ROOT @@ -57,18 +54,51 @@ #include "TH2.h" #include "TTree.h" -class GEMCSCTriggerRate : public edm::EDAnalyzer +struct MyALCT { -public: + Int_t nlayers, bx; + Float_t pt, eta, phi; + Char_t hit; // hits in MEX/Y or GE1/1 +}; - explicit GEMCSCTriggerRate(const edm::ParameterSet&); +struct MyCLCT +{ + Int_t nlayers, bx; + Float_t pt, eta, phi; + Char_t hit; // hits in MEX/Y or GE1/1 +}; + +struct MyLCT +{ + Int_t nlayers, bx; + Float_t pt, eta, phi; + Char_t hit; // hits in MEX/Y or GE1/1 +}; + +struct MyMPCLCT +{ + Int_t nlayers, bx; + Float_t pt, eta, phi; + Char_t hit; // hits in MEX/Y or GE1/1 +}; +struct MyTFTrack{}; +struct MyTFCand{}; +struct MyGMTRegional{}; +struct MyGMT{}; + +class GEMCSCTriggerRate : public edm::EDAnalyzer +{ + public: + + explicit GEMCSCTriggerRate(const edm::ParameterSet&); + ~GEMCSCTriggerRate(); virtual void beginRun(const edm::Run&, const edm::EventSetup&); virtual void beginJob(); - + virtual void analyze(const edm::Event&, const edm::EventSetup&); enum trig_cscs {MAX_STATIONS = 4, CSC_TYPES = 10}; @@ -77,15 +107,15 @@ class GEMCSCTriggerRate : public edm::EDAnalyzer static const std::string csc_type_[CSC_TYPES+1]; static const std::string csc_type_a[CSC_TYPES+2]; static const std::string csc_type_a_[CSC_TYPES+2]; - static const int NCHAMBERS[CSC_TYPES]; - static const int MAX_WG[CSC_TYPES]; - static const int MAX_HS[CSC_TYPES]; static const int pbend[CSCConstants::NUM_CLCT_PATTERNS]; enum pt_thresh {N_PT_THRESHOLDS = 6}; static const double PT_THRESHOLDS[N_PT_THRESHOLDS]; static const double PT_THRESHOLDS_FOR_ETA[N_PT_THRESHOLDS]; - + + private: + + // functions int getCSCType(CSCDetId &id); int isME11(int t); int getCSCSpecsType(CSCDetId &id); @@ -94,26 +124,12 @@ class GEMCSCTriggerRate : public edm::EDAnalyzer // From Ingo: // calculates the weight of the event to reproduce a min bias //spectrum, from G. Wrochna's note CMSS 1997/096 - static void setupTFModeHisto(TH1D* h); + void setupTFModeHisto(TH1D* h); + void runCSCTFSP(const CSCCorrelatedLCTDigiCollection*, const L1MuDTChambPhContainer*); std::pair intersectionEtaPhi(CSCDetId id, int wg, int hs); csctf::TrackStub buildTrackStub(const CSCCorrelatedLCTDigi &d, CSCDetId id); -private: - - edm::ParameterSet ptLUTset; - edm::ParameterSet CSCTFSPset; - CSCTFPtLUT* ptLUT; - CSCTFSectorProcessor* my_SPs[2][6]; - CSCSectorReceiverLUT* srLUTs_[5][6][2]; - CSCTFDTReceiver* my_dtrc; - void runCSCTFSP(const CSCCorrelatedLCTDigiCollection*, const L1MuDTChambPhContainer*); - unsigned long long muScalesCacheID_; - unsigned long long muPtScaleCacheID_; - - edm::ESHandle< L1MuTriggerScales > muScales; - edm::ESHandle< L1MuTriggerPtScale > muPtScale; - void bookALCTTree(); void bookCLCTTree(); void bookLCTTree(); @@ -132,39 +148,23 @@ class GEMCSCTriggerRate : public edm::EDAnalyzer void analyzeGMTRegionalRate(const edm::Event&); void analyzeGMTCandRate(const edm::Event&); - // config parameters: - bool defaultME1a; + // parameters + edm::ParameterSet CSCTFSPset; + edm::ParameterSet ptLUTset; + CSCTFPtLUT* ptLUT; + CSCTFSectorProcessor* my_SPs[2][6]; + CSCSectorReceiverLUT* srLUTs_[5][6][2]; + CSCTFDTReceiver* my_dtrc; + unsigned long long muScalesCacheID_; + unsigned long long muPtScaleCacheID_; - bool doStrictSimHitToTrackMatch_; + edm::ESHandle< L1MuTriggerScales > muScales; + edm::ESHandle< L1MuTriggerPtScale > muPtScale; + + // config parameters: bool matchAllTrigPrimitivesInChamber_; - int minNHitsShared_; - double minDeltaYAnode_; - double minDeltaYCathode_; - int minDeltaWire_; - int maxDeltaWire_; - int minDeltaStrip_; - - // debugging switches: - int debugALLEVENT; - int debugINHISTOS; - int debugALCT; - int debugCLCT; - int debugLCT; - int debugMPLCT; - int debugTFTRACK; - int debugTFCAND; - int debugGMTCAND; - int debugL1EXTRA; int debugRATE; - double minSimTrPt_; - double minSimTrPhi_; - double maxSimTrPhi_; - double minSimTrEta_; - double maxSimTrEta_; - bool invertSimTrPhiEta_; - bool bestPtMatch_; - int minBX_; int maxBX_; int minTMBBX_; @@ -184,39 +184,29 @@ class GEMCSCTriggerRate : public edm::EDAnalyzer int maxBxGMT_; bool centralBxOnlyGMT_; - bool doSelectEtaForGMTRates_; - - bool goodChambersOnly_; - - int lookAtTrackCondition_; - - bool doME1a_, naiveME1a_; - - bool minNStWith4Hits_; - bool requireME1With4Hits_; - - double minSimTrackDR_; - - // members - std::vector matches; - std::map trkId2Index; + bool doME1a_; + bool defaultME1a; const CSCGeometry* cscGeometry; - edm::ParameterSet gemMatchCfg_; - std::vector gemPTs_, gemDPhisOdd_, gemDPhisEven_; - - // simhits for matching to simtracks: - bool simHitsFromCrossingFrame_; - std::string simHitsModuleName_; - std::string simHitsCollectionName_; - - SimHitAnalysis::PSimHitMap theCSCSimHitMap; - //SimHitAnalysis::PSimHitMap theDTSimHitMap; - //SimHitAnalysis::PSimHitMap theRPCSimHitMap; - - CSCStripConditions * theStripConditions; + TTree* alct_tree_; + TTree* clct_tree_; + TTree* lct_tree_; + TTree* mplct_tree_; + TTree* tftrack_tree_; + TTree* tfcand_tree_; + TTree* gmtreg_tree_; + TTree* gmt_tree_; + + MyALCT alct_; + MyALCT clct_; + MyALCT lct_; + MyALCT mplct_; + MyALCT tftrack_; + MyALCT tfcand_; + MyALCT gmtreg_; + MyALCT gmt_; // --- rate histograms --- From 4fb1a1e1a5e697a0e9f0cd7c9db7d574fcb5917e Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sun, 18 Aug 2013 00:39:04 +0200 Subject: [PATCH 098/182] Filling trees for ALCT and CLCT --- SimMuL1/plugins/GEMCSCTriggerRate.cc | 99 ++++++++++++++++++++++-- SimMuL1/plugins/GEMCSCTriggerRate.h | 71 ++++++++++++----- SimMuL1/python/GEMCSCTriggerRate_cfi.py | 29 ------- SimMuL1/test/runGEMCSCTriggerRate_cfg.py | 16 ---- 4 files changed, 141 insertions(+), 74 deletions(-) diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.cc b/SimMuL1/plugins/GEMCSCTriggerRate.cc index bf7b700a7d3e6..8772ec1889167 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRate.cc @@ -20,7 +20,6 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): CSCTFSPset(iConfig.getParameter("SectorProcessor")), ptLUTset(CSCTFSPset.getParameter("PTLUT")), ptLUT(0), - matchAllTrigPrimitivesInChamber_(iConfig.getUntrackedParameter("matchAllTrigPrimitivesInChamber", false)), debugRATE(iConfig.getUntrackedParameter("debugRATE", 0)), minBX_(iConfig.getUntrackedParameter("minBX",-6)), maxBX_(iConfig.getUntrackedParameter("maxBX",6)), @@ -74,7 +73,7 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): bookALCTTree(); bookCLCTTree(); bookLCTTree(); - bookMPLCTTree(); + bookMPCLCTTree(); bookTFTrackTree(); bookTFCandTree(); bookGMTRegionalTree(); @@ -675,7 +674,7 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet analyzeALCTRate(iEvent); analyzeCLCTRate(iEvent); analyzeLCTRate(iEvent); - analyzeMPLCTRate(iEvent); + analyzeMPCLCTRate(iEvent); analyzeTFTrackRate(iEvent); analyzeTFCandRate(iEvent); analyzeGMTCandRate(iEvent); @@ -2027,30 +2026,54 @@ GEMCSCTriggerRate::bookALCTTree() { edm::Service< TFileService > fs; alct_tree_ = fs->make("ALCTs", "ALCTs"); - alct_tree_->Branch("charge",&alct_.nlayers); + alct_tree_->Branch("event",&alct_.event); + alct_tree_->Branch("detId",&alct_.detId); alct_tree_->Branch("pt",&alct_.pt); alct_tree_->Branch("eta",&alct_.eta); alct_tree_->Branch("phi",&alct_.phi); - alct_tree_->Branch("endcap",&alct_.bx); - // alct_tree_->Branch("gem_sh_layer1",&alct_.); + alct_tree_->Branch("bx",&alct_.bx); } // ================================================================================================ void GEMCSCTriggerRate::bookCLCTTree() { + edm::Service< TFileService > fs; + clct_tree_ = fs->make("CLCTs", "CLCTs"); + clct_tree_->Branch("event",&clct_.event); + clct_tree_->Branch("detId",&clct_.detId); + clct_tree_->Branch("pt",&clct_.pt); + clct_tree_->Branch("eta",&clct_.eta); + clct_tree_->Branch("phi",&clct_.phi); + clct_tree_->Branch("bx",&clct_.bx); } // ================================================================================================ void GEMCSCTriggerRate::bookLCTTree() { + // edm::Service< TFileService > fs; + // lct_tree_ = fs->make("LCTs", "LCTs"); + // lct_tree_->Branch("event",&lct_.event); + // lct_tree_->Branch("detId",&lct_.detId); + // lct_tree_->Branch("pt",&lct_.pt); + // lct_tree_->Branch("eta",&lct_.eta); + // lct_tree_->Branch("phi",&lct_.phi); + // lct_tree_->Branch("bx",&lct_.bx); } // ================================================================================================ void -GEMCSCTriggerRate::bookMPLCTTree() +GEMCSCTriggerRate::bookMPCLCTTree() { + // edm::Service< TFileService > fs; + // mpclct_tree_ = fs->make("MPCLCTs", "MPCLCTs"); + // mpclct_tree_->Branch("event",&mpclct_.event); + // mpclct_tree_->Branch("detId",&mpclct_.detId); + // mpclct_tree_->Branch("pt",&mpclct_.pt); + // mpclct_tree_->Branch("eta",&mpclct_.eta); + // mpclct_tree_->Branch("phi",&mpclct_.phi); + // mpclct_tree_->Branch("bx",&mpclct_.bx); } // ================================================================================================ @@ -2097,6 +2120,7 @@ GEMCSCTriggerRate::analyzeALCTRate(const edm::Event& iEvent) for (int me=0; me<=CSC_TYPES; me++) n_ch_alct_per_bx_cscdet[me][b]=0; } if (debugRATE) std::cout<< "----- statring nalct"< > me11alcts; for (CSCALCTDigiCollection::DigiRangeIterator adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); adetUnitIt++) { @@ -2121,7 +2145,7 @@ GEMCSCTriggerRate::analyzeALCTRate(const edm::Event& iEvent) } // store all ME11 alcts together so we can look at them later - // take into acstd::cout that 10<=WG<=15 alcts are present in both 1a and 1b + // take into acount that 10<=WG<=15 alcts are present in both 1a and 1b if (csct==0) me11alcts[idd.rawId()].push_back(&(*digiIt)); if (csct==3 && (*digiIt).getKeyWG() < 10) { @@ -2189,12 +2213,71 @@ GEMCSCTriggerRate::analyzeALCTRate(const edm::Event& iEvent) if (debugRATE) std::cout<< "----- end nalct="< maxBxALCT_) + { + if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill(); + } + */ } // ================================================================================================ void GEMCSCTriggerRate::analyzeCLCTRate(const edm::Event& iEvent) { + edm::Handle< CSCCLCTDigiCollection > hclcts; + iEvent.getByLabel("simCscTriggerPrimitiveDigis", hclcts); + const CSCCLCTDigiCollection* clcts = hclcts.product(); + + /* + // Loop on all CLCTs + for (auto adetUnitIt& : clcts); + { + CSCDetId detId((*adetUnitIt).first); + if (detId.endcap() != 1) continue; + clct_.event = iEvent.id().event(); + clct_.detId = id; + auto range = (*adetUnitIt).second; + // loop on all CLCTs in that detId + for (auto digiIt& : range) + { + const int bx((*digiIt).getBX()); + if (bx < minBxCLCT_ || bx > maxBxCLCT_) + { + if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill(); + } + */ } // ================================================================================================ diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.h b/SimMuL1/plugins/GEMCSCTriggerRate.h index 5e8bfeb2911ac..6caac8d008842 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.h +++ b/SimMuL1/plugins/GEMCSCTriggerRate.h @@ -56,36 +56,65 @@ struct MyALCT { - Int_t nlayers, bx; + Int_t event, detId, bx, pattern; Float_t pt, eta, phi; - Char_t hit; // hits in MEX/Y or GE1/1 }; struct MyCLCT { - Int_t nlayers, bx; + Int_t event, detId, bx; Float_t pt, eta, phi; - Char_t hit; // hits in MEX/Y or GE1/1 }; struct MyLCT { - Int_t nlayers, bx; + Int_t event, detId, bx; Float_t pt, eta, phi; - Char_t hit; // hits in MEX/Y or GE1/1 + Char_t hasGEM; }; struct MyMPCLCT { - Int_t nlayers, bx; + Int_t event, detId, bx; Float_t pt, eta, phi; - Char_t hit; // hits in MEX/Y or GE1/1 + Char_t hasGEM; }; -struct MyTFTrack{}; -struct MyTFCand{}; -struct MyGMTRegional{}; -struct MyGMT{}; +struct MyTFTrack +{ + Int_t event, bx; + Float_t pt, eta, phi; + Char_t hasME1a, hasME1b, hasME12, hasME13; + Char_t hasME21, hasME22; + Char_t hasME31, hasME32; + Char_t hasME41, hasME42; + Char_t hasGEM; +}; + +struct MyTFCand +{ + Int_t event, bx; + Float_t pt, eta, phi; + Char_t hasME1a, hasME1b, hasME12, hasME13; + Char_t hasME21, hasME22; + Char_t hasME31, hasME32; + Char_t hasME41, hasME42; + Char_t hasGEM; +}; + +struct MyGMTRegional +{ + Int_t event, bx; + Float_t pt, eta, phi; + Char_t hasCSC, hasRPC, hasDT, hasGEM; +}; + +struct MyGMT +{ + Int_t event, bx; + Float_t pt, eta, phi; + Char_t hasCSC, hasRPC, hasDT, hasGEM; +}; class GEMCSCTriggerRate : public edm::EDAnalyzer { @@ -133,7 +162,7 @@ class GEMCSCTriggerRate : public edm::EDAnalyzer void bookALCTTree(); void bookCLCTTree(); void bookLCTTree(); - void bookMPLCTTree(); + void bookMPCLCTTree(); void bookTFTrackTree(); void bookTFCandTree(); void bookGMTRegionalTree(); @@ -142,7 +171,7 @@ class GEMCSCTriggerRate : public edm::EDAnalyzer void analyzeALCTRate(const edm::Event&); void analyzeCLCTRate(const edm::Event&); void analyzeLCTRate(const edm::Event&); - void analyzeMPLCTRate(const edm::Event&); + void analyzeMPCLCTRate(const edm::Event&); void analyzeTFTrackRate(const edm::Event&); void analyzeTFCandRate(const edm::Event&); void analyzeGMTRegionalRate(const edm::Event&); @@ -200,13 +229,13 @@ class GEMCSCTriggerRate : public edm::EDAnalyzer TTree* gmt_tree_; MyALCT alct_; - MyALCT clct_; - MyALCT lct_; - MyALCT mplct_; - MyALCT tftrack_; - MyALCT tfcand_; - MyALCT gmtreg_; - MyALCT gmt_; + MyCLCT clct_; + MyLCT lct_; + MyMPCLCT mpclct_; + MyTFTrack tftrack_; + MyTFCand tfcand_; + MyGMTReg gmtreg_; + MyGMT gmt_; // --- rate histograms --- diff --git a/SimMuL1/python/GEMCSCTriggerRate_cfi.py b/SimMuL1/python/GEMCSCTriggerRate_cfi.py index 8715d4c56ede8..fa1249a056458 100644 --- a/SimMuL1/python/GEMCSCTriggerRate_cfi.py +++ b/SimMuL1/python/GEMCSCTriggerRate_cfi.py @@ -1,25 +1,8 @@ import FWCore.ParameterSet.Config as cms GEMCSCTriggerRate = cms.EDFilter("GEMCSCTriggerRate", - doStrictSimHitToTrackMatch = cms.untracked.bool(True), - matchAllTrigPrimitivesInChamber = cms.untracked.bool(True), - - minDeltaWire = cms.untracked.int32(-2), - maxDeltaWire = cms.untracked.int32(2), - minDeltaStrip = cms.untracked.int32(2), - - minNStWith4Hits = cms.untracked.int32(0), - requireME1With4Hits = cms.untracked.bool(False), - - ## add option to include the bending angle library in here!!! - gemPTs = cms.vdouble(0., 6., 10., 15., 20., 30., 40.), - gemDPhisOdd = cms.vdouble(1., 0.0182579, 0.01066 , 0.00722795 , 0.00562598 , 0.00416544 , 0.00342827), - gemDPhisEven = cms.vdouble(1., 0.00790009, 0.00483286, 0.0036323, 0.00304879, 0.00253782, 0.00230833), - doME1a = cms.untracked.bool(True), defaultME1a = cms.untracked.bool(False), - gangedME1a = cms.untracked.bool(False), - minBxALCT = cms.untracked.int32(5), maxBxALCT = cms.untracked.int32(7), minBxCLCT = cms.untracked.int32(5), @@ -28,18 +11,6 @@ maxBxLCT = cms.untracked.int32(7), minBxMPLCT = cms.untracked.int32(5), maxBxMPLCT = cms.untracked.int32(7), - - minSimTrDR = cms.untracked.double(0.0), - minSimTrPt = cms.untracked.double(2.), - minSimTrPhi = cms.untracked.double(-9.), - maxSimTrPhi = cms.untracked.double(9.), - minSimTrEta = cms.untracked.double(-2.5), - maxSimTrEta = cms.untracked.double(2.5), - invertSimTrPhiEta = cms.untracked.bool(False), - - goodChambersOnly = cms.untracked.bool(False), - - simTrackGEMMatching = cms.untracked.PSet(), sectorProcessor = cms.untracked.PSet(), strips = cms.untracked.PSet() ) diff --git a/SimMuL1/test/runGEMCSCTriggerRate_cfg.py b/SimMuL1/test/runGEMCSCTriggerRate_cfg.py index 5d76b1e96bf93..4163d33dd4106 100644 --- a/SimMuL1/test/runGEMCSCTriggerRate_cfg.py +++ b/SimMuL1/test/runGEMCSCTriggerRate_cfg.py @@ -76,8 +76,6 @@ process.simCsctfTrackDigis.SectorProcessor.isCoreVerbose = cms.bool(True) process.options = cms.untracked.PSet( -# Rethrow = cms.untracked.vstring('ProductNotFound'), -# FailPath = cms.untracked.vstring('ProductNotFound'), makeTriggerResults = cms.untracked.bool(False), wantSummary = cms.untracked.bool(True) ) @@ -101,21 +99,7 @@ fileName = cms.string(outputFileName) ) -from GEMCode.GEMValidation.simTrackMatching_cfi import SimTrackMatching -#SimTrackMatching.verboseSimHit = 1 -#SimTrackMatching.verboseGEMDigi = 1 -#SimTrackMatching.verboseCSCDigi = 1 -#SimTrackMatching.verboseCSCStub = 1 -#SimTrackMatching.simMuOnlyGEM = False -#SimTrackMatching.simMuOnlyCSC = False -#SimTrackMatching.discardEleHitsCSC = False -#SimTrackMatching.discardEleHitsGEM = False - process.load('GEMCode.SimMuL1.GEMCSCTriggerRate_cfi') -process.GEMCSCTriggerRate.minDeltaWire = -1*deltaMatch -process.GEMCSCTriggerRate.maxDeltaWire = deltaMatch -process.GEMCSCTriggerRate.minDeltaStrip = -1*deltaMatch -process.GEMCSCTriggerRate.simTrackGEMMatching = SimTrackMatching process.GEMCSCTriggerRate.minBxALCT = readout_windows[0][0] process.GEMCSCTriggerRate.maxBxALCT = readout_windows[0][1] process.GEMCSCTriggerRate.minBxCLCT = readout_windows[1][0] From ec73ea2a0b1fee72babfb598f611de637f951f59 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sun, 18 Aug 2013 01:06:27 +0200 Subject: [PATCH 099/182] Filling trees for LCT and MPCLCT --- SimMuL1/plugins/GEMCSCTriggerRate.cc | 96 +++++++++++++++++++++++++--- SimMuL1/plugins/GEMCSCTriggerRate.h | 4 +- 2 files changed, 91 insertions(+), 9 deletions(-) diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.cc b/SimMuL1/plugins/GEMCSCTriggerRate.cc index 8772ec1889167..ba8b1c6a7a2a7 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRate.cc @@ -563,10 +563,11 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet // strip&wire matching output after TMB and after MPC sorting edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_tmb; - edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_mpc; iEvent.getByLabel("simCscTriggerPrimitiveDigis", lcts_tmb); - iEvent.getByLabel("simCscTriggerPrimitiveDigis", "MPCSORTED", lcts_mpc); const CSCCorrelatedLCTDigiCollection* lcts = lcts_tmb.product(); + + edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_mpc; + iEvent.getByLabel("simCscTriggerPrimitiveDigis", "MPCSORTED", lcts_mpc); const CSCCorrelatedLCTDigiCollection* mplcts = lcts_mpc.product(); // DT primitives for input to TF @@ -2135,7 +2136,7 @@ GEMCSCTriggerRate::analyzeALCTRate(const edm::Event& iEvent) for (CSCALCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) { if ((*digiIt).isValid()) - { + {o int bx = (*digiIt).getBX(); //if ( bx-6 < minBX_ || bx-6 > maxBX_ ) if ( bx < minBxALCT_ || bx > maxBxALCT_ ) @@ -2220,8 +2221,6 @@ GEMCSCTriggerRate::analyzeALCTRate(const edm::Event& iEvent) { CSCDetId detId((*adetUnitIt).first); if (detId.endcap() != 1) continue; - alct_.event = iEvent.id().event(); - alct_.detId = id; auto range = (*adetUnitIt).second; // loop on all ALCTs in that detId for (auto digiIt& : range) @@ -2233,6 +2232,8 @@ GEMCSCTriggerRate::analyzeALCTRate(const edm::Event& iEvent) continue; } // central bx for CSC is 6!!! + alct_.event = iEvent.id().event(); + alct_.detId = id; alct_.bx = bx - 6; alct_.pt = pt(); alct_.eta = eta(); @@ -2257,8 +2258,6 @@ GEMCSCTriggerRate::analyzeCLCTRate(const edm::Event& iEvent) { CSCDetId detId((*adetUnitIt).first); if (detId.endcap() != 1) continue; - clct_.event = iEvent.id().event(); - clct_.detId = id; auto range = (*adetUnitIt).second; // loop on all CLCTs in that detId for (auto digiIt& : range) @@ -2270,6 +2269,8 @@ GEMCSCTriggerRate::analyzeCLCTRate(const edm::Event& iEvent) continue; } // central bx for CSC is 6!!! + clct_.event = iEvent.id().event(); + clct_.detId = id; clct_.bx = bx - 6; clct_.pt = pt(); clct_.eta = eta(); @@ -2284,12 +2285,91 @@ GEMCSCTriggerRate::analyzeCLCTRate(const edm::Event& iEvent) void GEMCSCTriggerRate::analyzeLCTRate(const edm::Event& iEvent) { + /* + edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_tmb; + iEvent.getByLabel("simCscTriggerPrimitiveDigis", lcts_tmb); + const CSCCorrelatedLCTDigiCollection* lcts = lcts_tmb.product(); + + for (auto detUnitIt& : lcts); + { + CSCDetId detId((*adetUnitIt).first); + if (detId.endcap() != 1) continue; + auto range = (*adetUnitIt).second; + // loop on all CLCTs in that detId + for (auto digiIt& : range) + { + const int bx((*digiIt).getBX()); + if (bx < minBxLCT_ || bx > maxBxLCT_) + { + if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill(); + } + */ } // ================================================================================================ void -GEMCSCTriggerRate::analyzeMPLCTRate(const edm::Event& iEvent) +GEMCSCTriggerRate::analyzeMPCLCTRate(const edm::Event& iEvent) { + /* + edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_mpc; + iEvent.getByLabel("simCscTriggerPrimitiveDigis", "MPCSORTED", lcts_mpc); + const CSCCorrelatedLCTDigiCollection* mpclcts = lcts_mpc.product(); + + for (auto detUnitIt& : mpclcts); + { + CSCDetId detId((*adetUnitIt).first); + if (detId.endcap() != 1) continue; + auto range = (*adetUnitIt).second; + // loop on all CMpclcts in that detId + for (auto digiIt& : range) + { + const int bx((*digiIt).getBX()); + if (bx < minBxMPCLCT_ || bx > maxBxMPCLCT_) + { + if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <getRegionalEtaScale(2)->getCenter(gblEta.global_eta); + // //float phi_lut = normalizedPhi( muScales->getPhiScale()->getLowEdge(gblPhi.global_phi)); + // csctf::TrackStub stub = buildTrackStub((*digiIt), id); + // float eta_lut = stub.etaValue(); + // float phi_lut = stub.phiValue(); + // std::cout<<"DBGSRLUT "<Fill(); + } + } +*/ } // ================================================================================================ diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.h b/SimMuL1/plugins/GEMCSCTriggerRate.h index 6caac8d008842..673c849925ef3 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.h +++ b/SimMuL1/plugins/GEMCSCTriggerRate.h @@ -62,7 +62,7 @@ struct MyALCT struct MyCLCT { - Int_t event, detId, bx; + Int_t event, detId, bx, pattern; Float_t pt, eta, phi; }; @@ -70,6 +70,7 @@ struct MyLCT { Int_t event, detId, bx; Float_t pt, eta, phi; + Int_t quality, strip; Char_t hasGEM; }; @@ -77,6 +78,7 @@ struct MyMPCLCT { Int_t event, detId, bx; Float_t pt, eta, phi; + Int_t quality, strip; Char_t hasGEM; }; From e8561bdcf79644ba0b8da40506de54cfc2d2cfe5 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sun, 18 Aug 2013 13:16:53 +0200 Subject: [PATCH 100/182] starting to fill trees for TFTrack --- SimMuL1/plugins/GEMCSCTriggerRate.cc | 312 +++++++++++++++++---------- 1 file changed, 203 insertions(+), 109 deletions(-) diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.cc b/SimMuL1/plugins/GEMCSCTriggerRate.cc index ba8b1c6a7a2a7..5bf08000d4f3f 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRate.cc @@ -557,6 +557,10 @@ void GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { // ALCTs and CLCTs + edm::Handle< CSCALCTDigiCollection > halcts; + iEvent.getByLabel("simCscTriggerPrimitiveDigis", halcts); + const CSCALCTDigiCollection* alcts = halcts.product(); + edm::Handle< CSCCLCTDigiCollection > hclcts; iEvent.getByLabel("simCscTriggerPrimitiveDigis", hclcts); const CSCCLCTDigiCollection* clcts = hclcts.product(); @@ -683,6 +687,112 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet //============ RATE ALCT ================== + int nalct=0; + int nalct_per_bx[16]; + int n_ch_alct_per_bx[16]; + int n_ch_alct_per_bx_st[MAX_STATIONS][16]; + int n_ch_alct_per_bx_cscdet[CSC_TYPES+1][16]; + for (int b=0;b<16;b++) + { + nalct_per_bx[b] = n_ch_alct_per_bx[b] = 0; + for (int s=0; s > me11alcts; + for (CSCALCTDigiCollection::DigiRangeIterator adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); adetUnitIt++) + { + const CSCDetId& id = (*adetUnitIt).first; + //if (id.endcap() != 1) continue; + CSCDetId idd(id.rawId()); + int csct = getCSCType( idd ); + int cscst = getCSCSpecsType( idd ); + //int is11 = isME11(csct); + int nalct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + const CSCALCTDigiCollection::Range& range = (*adetUnitIt).second; + for (CSCALCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) + { + if ((*digiIt).isValid()) + {o + int bx = (*digiIt).getBX(); + //if ( bx-6 < minBX_ || bx-6 > maxBX_ ) + if ( bx < minBxALCT_ || bx > maxBxALCT_ ) + { + if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill( bx - 6 ); + h_rt_alct_bx_cscdet[csct]->Fill( bx - 6 ); + if (bx>=5 && bx<=7) h_rt_csctype_alct_bx567->Fill(cscst); + + } //if (alct_valid) + } + for (int b=0;b<16;b++) + { + if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; + h_rt_n_per_ch_alct_vs_bx_cscdet[csct]->Fill(nalct_per_ch_bx[b],b); + if (nalct_per_ch_bx[b]>0) + { + ++n_ch_alct_per_bx[b]; + ++n_ch_alct_per_bx_st[id.station()-1][b]; + ++n_ch_alct_per_bx_cscdet[csct][b]; + } + } + } // loop CSCALCTDigiCollection + //std::map< CSCDetId , std::vector >::const_iterator mapIt = me11alcts.begin(); + //for (;mapIt != me11alcts.end(); mapIt++){} + std::map< int , std::vector >::const_iterator aMapIt = me11alcts.begin(); + for (;aMapIt != me11alcts.end(); aMapIt++) + { + CSCDetId id(aMapIt->first); + int nalct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + for (size_t i=0; i<(aMapIt->second).size(); i++) + { + int bx = (aMapIt->second)[i]->getBX(); + ++nalct_per_ch_bx[bx]; + } + for (int b=0;b<16;b++) + { + if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; + h_rt_n_per_ch_alct_vs_bx_cscdet[10]->Fill(nalct_per_ch_bx[b],b); + if (nalct_per_ch_bx[b]>0) ++n_ch_alct_per_bx_cscdet[10][b]; + } + } + h_rt_nalct->Fill(nalct); + for (int b=0;b<16;b++) + { + if (b < minBxALCT_ || b > maxBxALCT_) continue; + h_rt_nalct_vs_bx->Fill(nalct_per_bx[b],b); + h_rt_nalct_per_bx->Fill(nalct_per_bx[b]); + h_rt_n_ch_alct_per_bx->Fill(n_ch_alct_per_bx[b]); + for (int s=0; sFill(n_ch_alct_per_bx_st[s][b]); + for (int me=0; me<=CSC_TYPES; me++) + h_rt_n_ch_alct_per_bx_cscdet[me]->Fill(n_ch_alct_per_bx_cscdet[me][b]); + } + + + if (debugRATE) std::cout<< "----- end nalct="< > me11alcts; - for (CSCALCTDigiCollection::DigiRangeIterator adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); adetUnitIt++) - { - const CSCDetId& id = (*adetUnitIt).first; - //if (id.endcap() != 1) continue; - CSCDetId idd(id.rawId()); - int csct = getCSCType( idd ); - int cscst = getCSCSpecsType( idd ); - //int is11 = isME11(csct); - int nalct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - const CSCALCTDigiCollection::Range& range = (*adetUnitIt).second; - for (CSCALCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) - { - if ((*digiIt).isValid()) - {o - int bx = (*digiIt).getBX(); - //if ( bx-6 < minBX_ || bx-6 > maxBX_ ) - if ( bx < minBxALCT_ || bx > maxBxALCT_ ) - { - if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill( bx - 6 ); - h_rt_alct_bx_cscdet[csct]->Fill( bx - 6 ); - if (bx>=5 && bx<=7) h_rt_csctype_alct_bx567->Fill(cscst); - - } //if (alct_valid) - } - for (int b=0;b<16;b++) - { - if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; - h_rt_n_per_ch_alct_vs_bx_cscdet[csct]->Fill(nalct_per_ch_bx[b],b); - if (nalct_per_ch_bx[b]>0) - { - ++n_ch_alct_per_bx[b]; - ++n_ch_alct_per_bx_st[id.station()-1][b]; - ++n_ch_alct_per_bx_cscdet[csct][b]; - } - } - } // loop CSCALCTDigiCollection - //std::map< CSCDetId , std::vector >::const_iterator mapIt = me11alcts.begin(); - //for (;mapIt != me11alcts.end(); mapIt++){} - std::map< int , std::vector >::const_iterator aMapIt = me11alcts.begin(); - for (;aMapIt != me11alcts.end(); aMapIt++) - { - CSCDetId id(aMapIt->first); - int nalct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - for (size_t i=0; i<(aMapIt->second).size(); i++) - { - int bx = (aMapIt->second)[i]->getBX(); - ++nalct_per_ch_bx[bx]; - } - for (int b=0;b<16;b++) - { - if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; - h_rt_n_per_ch_alct_vs_bx_cscdet[10]->Fill(nalct_per_ch_bx[b],b); - if (nalct_per_ch_bx[b]>0) ++n_ch_alct_per_bx_cscdet[10][b]; - } - } - h_rt_nalct->Fill(nalct); - for (int b=0;b<16;b++) - { - if (b < minBxALCT_ || b > maxBxALCT_) continue; - h_rt_nalct_vs_bx->Fill(nalct_per_bx[b],b); - h_rt_nalct_per_bx->Fill(nalct_per_bx[b]); - h_rt_n_ch_alct_per_bx->Fill(n_ch_alct_per_bx[b]); - for (int s=0; sFill(n_ch_alct_per_bx_st[s][b]); - for (int me=0; me<=CSC_TYPES; me++) - h_rt_n_ch_alct_per_bx_cscdet[me]->Fill(n_ch_alct_per_bx_cscdet[me][b]); - } - - - if (debugRATE) std::cout<< "----- end nalct="< hl1Tracks; + iEvent.getByLabel("simCsctfTrackDigis",hl1Tracks); + const L1CSCTrackCollection* l1Tracks = hl1Tracks.product(); + + for (auto& trk : l1Tracks) + { + const int bx(trk->first.bx()); + if ( bx < minRateBX_ || bx > maxRateBX_ ) + { + if (debugRATE) std::cout<<"discarding BX = "<< bx <Fill(myTFTrk.pt); + // h_rt_tftrack_bx->Fill(); + + } + + + // MatchCSCMuL1::TFTRACK myTFTrk; + // myTFTrk.init( &(trk->first) , ptLUT, muScales, muPtScale); + // myTFTrk.dr = 999.; + + // for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator detUnitIt = trk->second.begin(); + // detUnitIt != trk->second.end(); detUnitIt++) + // { + // const CSCDetId& id = (*detUnitIt).first; + // CSCDetId cid = id; + // const CSCCorrelatedLCTDigiCollection::Range& range = (*detUnitIt).second; + // for (CSCCorrelatedLCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) + // { + // if (!((*digiIt).isValid())) std::cout<<"ALARM!!! match TFCAND to TFTRACK in rates: not valid id="< 127); + // if (me1a_case){ + // CSCDetId id1a(id.endcap(),id.station(),4,id.chamber(),0); + // cid = id1a; + // } + // //if (id.station()==1 && id.ring()==4) std::cout<<"me1adigi check: "<<(*digiIt)<<" "<= 20. && myTFTrk.hasStub(1) && myTFTrk.hasStub(2)){ + // int i1=-1, i2=-1, k=0; + // for (auto id: myTFTrk.trgids) + // { + // if (id.station()==1) i1 = k; + // if (id.station()==2) i2 = k; + // ++k; + // } + // if (i1>=0 && i2 >=0 ) { + // auto etaphi1 = myTFTrk.trgetaphis[i1]; + // auto etaphi2 = myTFTrk.trgetaphis[i2]; + // auto d = myTFTrk.trgids[i1]; + // auto &stub = *(myTFTrk.trgdigis[i1]); + // std::cout<<"DBGdeta12 "< 0.1) { + // myTFTrk.print(""); + // std::cout<<"############### CSCTFSPCoreLogic printout for large deta12 = "<Fill(myTFTrk.mode()); + // } } // ================================================================================================ From 39521968285267d79d418cc1aabe94e5b6340ef2 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 19 Aug 2013 11:05:28 +0200 Subject: [PATCH 101/182] Adding Alexei's suggestions of 18/08/2013 --- SimMuL1/scripts/drawplot_eff.C | 82 +++++++++++++++++++++++++-------- SimMuL1/scripts/drawplot_eff.py | 38 ++++++++------- 2 files changed, 86 insertions(+), 34 deletions(-) diff --git a/SimMuL1/scripts/drawplot_eff.C b/SimMuL1/scripts/drawplot_eff.C index 904d2c17777dc..12db65c4baba0 100644 --- a/SimMuL1/scripts/drawplot_eff.C +++ b/SimMuL1/scripts/drawplot_eff.C @@ -14,7 +14,7 @@ gROOT->SetBatch(1); TString filesDir = "files/"; TString plotDir = "plots/efficiency/"; -TString ext = ".pdf"; +TString ext = ".eps"; TCut ok_sh1 = "(has_csc_sh&1) > 0"; TCut ok_sh2 = "(has_csc_sh&2) > 0"; @@ -62,6 +62,11 @@ TCut ok_dphi2 = "dphi_pad_even < 10."; enum {GEM_EFF95 = 0, GEM_EFF98, GEM_EFF99}; enum {DPHI_PT10 = 0, DPHI_PT15, DPHI_PT20, DPHI_PT30, DPHI_PT40}; +double mymod(double x, double y) +{ + return fmod(x,y); +} + void setDPhi(int label_pt, int label_eff = GEM_EFF98) { float dphi_odd[3][20] = { @@ -177,7 +182,6 @@ void gemTurnOns(int label_eff = GEM_EFF98) } -double mymod(double x, double y) {return fmod(x,y);} void eff_hs_dphi(TString f_name, TString p_name) { @@ -189,8 +193,8 @@ void eff_hs_dphi(TString f_name, TString p_name) TTree *t = getTree(f_name); setDPhi(DPHI_PT40, GEM_EFF98); - TH1F* ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta && ok_gsh1 , ok_pad1, "", kRed); - TH1F* he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta && ok_gsh2, ok_pad2, "same"); + // TH1F* ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta && ok_gsh1 , ok_pad1, "", kRed); + // TH1F* he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta && ok_gsh2, ok_pad2, "same"); //TH1F* ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta, ok_gsh1, "", kRed); //TH1F* he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta, ok_gsh2, "same"); @@ -282,7 +286,7 @@ void eff_hs_overlap(TString f_name, TString p_name, TString pt) TTree *t = getTree(f_name); TH1F* ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;LCT half-strip number;Efficiency", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1_overlap, "", kRed); - TH1F* he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;LCT half-strip number;Efficiency", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2_overlap, "same"); + TH1F* he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;LCT half-strip number;Efficiency", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2_overlap, "same"); TF1 fo("fo", "pol0", 6., 123.); ho->Fit("fo","RN"); @@ -313,6 +317,40 @@ void eff_hs_overlap(TString f_name, TString p_name, TString pt) } +void eff_deg_overlap(TString f_name, TString p_name, TString pt) +{ + // efficiency vs half-strip - including overlaps in odd&even + TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12"; + + TTree *t = getTree(f_name); + TH1F* ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;local #Phi [deg];Efficiency", + "h_odd", "(130,-5,5)", "fmod(180*phi/TMath::Pi(),5)", ok_lct1 && ok_eta , ok_pad1_overlap, "", kRed); + TH1F* he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;local #Phi [deg];Efficiency", + "h_evn", "(130,-5,5)", "fmod(180*phi/TMath::Pi(),5)", ok_lct2 && ok_eta , ok_pad2_overlap, "same"); + ho->SetMinimum(0.); + TLegend *leg = new TLegend(0.25,0.23,.75,0.5, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.06); + leg->AddEntry((TObject*)0,"muon p_{T} = " + pt + " GeV/c",""); + leg->AddEntry(he, "\"Close\" chamber pairs","l"); + leg->AddEntry(ho, "\"Far\" chamber pairs","l"); + leg->Draw(); + + // Print additional information + TLatex* tex2 = new TLatex(.67,.8," L1 Trigger"); + tex2->SetTextSize(0.05); + tex2->SetNDC(); + tex2->Draw(); + + TLatex * tex = new TLatex(.66,.73,"1.64<|#eta|<2.12"); + tex->SetTextSize(0.05); + tex->SetNDC(); + tex->Draw(); + + gPad->Print(p_name); +} + void drawplot_eff_eta() { @@ -437,19 +475,27 @@ void drawplot_eff() TCanvas* cEff = new TCanvas("cEff","cEff",700,500); - eff_hs(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt05" + ext,"5"); - eff_hs(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt10" + ext,"10"); - eff_hs(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt15" + ext,"15"); - eff_hs(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt20" + ext,"20"); - eff_hs(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30" + ext,"30"); - eff_hs(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40" + ext,"40"); - - eff_hs_overlap(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt05_overlap" + ext,"5"); - eff_hs_overlap(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt10_overlap" + ext,"10"); - eff_hs_overlap(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt15_overlap" + ext,"15"); - eff_hs_overlap(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt20_overlap" + ext,"20"); - eff_hs_overlap(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30_overlap" + ext,"30"); - eff_hs_overlap(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40_overlap" + ext,"40"); + // eff_hs(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt05" + ext,"5"); + // eff_hs(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt10" + ext,"10"); + // eff_hs(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt15" + ext,"15"); + // eff_hs(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt20" + ext,"20"); + // eff_hs(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30" + ext,"30"); + // eff_hs(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40" + ext,"40"); + + // eff_hs_overlap(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt05_overlap" + ext,"5"); + // eff_hs_overlap(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt10_overlap" + ext,"10"); + // eff_hs_overlap(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt15_overlap" + ext,"15"); + // eff_hs_overlap(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt20_overlap" + ext,"20"); + // eff_hs_overlap(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30_overlap" + ext,"30"); + // eff_hs_overlap(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40_overlap" + ext,"40"); + + eff_deg_overlap(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsDeg_pt05_overlap" + ext,"5"); + eff_deg_overlap(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsDeg_pt10_overlap" + ext,"10"); + eff_deg_overlap(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsDeg_pt15_overlap" + ext,"15"); + eff_deg_overlap(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsDeg_pt20_overlap" + ext,"20"); + eff_deg_overlap(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsDeg_pt30_overlap" + ext,"30"); + eff_deg_overlap(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsDeg_pt40_overlap" + ext,"40"); + //gemTurnOns(); diff --git a/SimMuL1/scripts/drawplot_eff.py b/SimMuL1/scripts/drawplot_eff.py index 5d8b776f4d629..caa8f58e7f842 100644 --- a/SimMuL1/scripts/drawplot_eff.py +++ b/SimMuL1/scripts/drawplot_eff.py @@ -287,8 +287,8 @@ def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): pt_labels = ["10 GeV/c","20 GeV/c","30 GeV/c","40 GeV/c"] dphis = [0.,0.,0.,0.] - marker_colors = [kRed, kViolet+1, kAzure+1, kGreen-2] - marker_styles = [20,21,23,24] + marker_colors = [kRed, kViolet+1, kAzure+2, kGreen-2] + marker_styles = [20,21,23,22] t = getTree("%sgem_csc_eff_pt2pt50_pad4.root"%(filesDir)); @@ -296,12 +296,21 @@ def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): c.SetGridx(1) c.SetGridy(1) c.cd() +# h = TH1F(""," GEM-CSC bending Angle: p_{T} measurement, CMS Simulation;p_{T} [GeV/c];",50,0.,50.) + h = TH1F(""," GEM-CSC bending Angle CMS Simulation;p_{T} [GeV/c];",50,0.,50.) + superscript = "p_{T}>p_{T}^{min}" + subscript = "0" + h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<|#Delta#phi_{%s}^{%s}| Cut Efficiency"%(subscript,superscript)); + h.GetYaxis().SetTitleOffset(.9) + h.SetStats(0) + ## label sizes more leglible + h.GetXaxis().SetLabelSize(.05) + h.GetXaxis().SetLabelOffset(.005) + h.GetYaxis().SetLabelSize(.05) + h.GetYaxis().SetLabelOffset(.005) - h = TH1F(""," GEM-CSC bending Angle: p_{T} measurement, CMS Simulation;p_{T} [GeV/c];Efficiency",50,0.,50.) - h.SetStats(0) h.Draw("") - histoList = [] for i in range(len(pt)): dphi = getDphi("%s"%(eff),"%s"%(pt[i]),"%s"%(oddEven)) @@ -315,28 +324,25 @@ def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): denom_cut = ok_pad1_lct1_eta closeFar = "Far" - h2 = draw_eff(t, "GEM-CSC bending angle: momentum measurement;p_{T} [GeV/c];Efficiency", "h2", "(50,0.,50.)", "pt", + h2 = draw_eff(t, "", "h2", "(50,0.,50.)", "pt", denom_cut, ok_dphi, marker_colors[i], marker_styles[i]) - ## Eff. for track with LCT to have matched GEM pad histoList.append(h2) h2.SetMarkerSize(1) h2.Draw("same") ## add legend - ## leg_header = " #Delta#phi(GEM,CSC) is %s%% efficient for"%(eff) - ## leg.AddEntry(0, "%s chambers at pt"%(oddEven), "") - leg = TLegend(0.37,0.15,.93,0.6, "", "brNDC") - leg_header = " " - leg.AddEntry(0, 'High efficiency patterns:', "") + leg = TLegend(0.52,0.15,.93,0.57, "High efficiency patterns:", "brNDC") for n in range(len(pt)): - leg.AddEntry(histoList[n], "|#Delta#Phi_{(GEM,CSC)}|<%.4f (p_{T}^{th}>%s)"%(dphis[n],pt_labels[n]), "p") + superscript = "p_{T}>%s"%(pt_labels[n]) + subscript = "0" + leg.AddEntry(histoList[n], "#Delta#phi_{%s}^{%s} = %.4f rad"%(subscript,superscript,dphis[n]), "p") + leg.SetBorderSize(0) leg.SetMargin(0.1) leg.SetFillStyle(0) leg.SetFillStyle(1001) leg.SetFillColor(kWhite) - leg.SetHeader(leg_header) leg.SetTextSize(0.05) leg.Draw("same") @@ -1031,8 +1037,8 @@ def eff_hs(filesDir, plotDir, ext): etaMatchingEfficiencies("files/", "plots/efficiency/", ".png") """ gemTurnOns("files/", "plots/efficiency/", ".pdf") - gemTurnOns("files/", "plots/efficiency/", ".eps") - gemTurnOns("files/", "plots/efficiency/", ".png") +# gemTurnOns("files/", "plots/efficiency/", ".eps") +# gemTurnOns("files/", "plots/efficiency/", ".png") """ eff_hs("files/", "plots/efficiency/", ".pdf") eff_hs("files/", "plots/efficiency/", ".eps") From 6fc6f07f2cf2c71661a69ac068dc1827a52eb65b Mon Sep 17 00:00:00 2001 From: Geonmo Date: Tue, 27 Aug 2013 23:40:19 +0900 Subject: [PATCH 102/182] modify helpers namespace --- SimMuL1/interface/Helpers.h | 2 +- SimMuL1/plugins/GEMCSCTriggerRate.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SimMuL1/interface/Helpers.h b/SimMuL1/interface/Helpers.h index 2d52bea460dc0..977e48fc7d571 100644 --- a/SimMuL1/interface/Helpers.h +++ b/SimMuL1/interface/Helpers.h @@ -1,7 +1,7 @@ #ifndef SimMuL1_Helpers_h #define SimMuL1_Helpers_h -namespace helpers +namespace SimMuL1_helpers { bool isME1bEtaRegion(float eta, float eta_min = 1.64, float eta_max = 2.14) diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.cc b/SimMuL1/plugins/GEMCSCTriggerRate.cc index a21fb5f7b25e4..f96f13baec2bb 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRate.cc @@ -29,11 +29,11 @@ #include "DataFormats/MuonDetId/interface/GEMDetId.h" #include "Geometry/GEMGeometry/interface/GEMGeometry.h" #include "GEMCode/GEMValidation/src/SimTrackMatchManager.h" - +#include "GEMCode/SimMuL1/interface/Helpers.h" using namespace std; using namespace reco; using namespace edm; - +using namespace SimMuL1_helpers; namespace { const Double_t ETA_BIN = 0.0125 *2; From 08d41b91fa707e37ff1ba749ec659bdb416f990d Mon Sep 17 00:00:00 2001 From: Geonmo Date: Wed, 28 Aug 2013 00:21:12 +0900 Subject: [PATCH 103/182] modify namespace "helpers" to "SimMuL1_helpers" --- SimMuL1/plugins/GEMCSCTriggerRate.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.cc b/SimMuL1/plugins/GEMCSCTriggerRate.cc index f96f13baec2bb..ba2ed4c6b0933 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRate.cc @@ -33,6 +33,7 @@ using namespace std; using namespace reco; using namespace edm; + using namespace SimMuL1_helpers; namespace { From 0679aa4690b011375a5840a2057183be86251f39 Mon Sep 17 00:00:00 2001 From: Geonmo Date: Wed, 28 Aug 2013 14:26:11 +0900 Subject: [PATCH 104/182] Delete member function "isME4XX". These are merged to Helper header. --- SimMuL1/plugins/GEMCSCTriggerRate.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.h b/SimMuL1/plugins/GEMCSCTriggerRate.h index f3cb99ff525f4..4d8b00f92c351 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.h +++ b/SimMuL1/plugins/GEMCSCTriggerRate.h @@ -201,8 +201,8 @@ class GEMCSCTriggerRate : public edm::EDFilter // calculates the weight of the event to reproduce a min bias //spectrum, from G. Wrochna's note CMSS 1997/096 - bool isME42EtaRegion(float eta); - bool isME42RPCEtaRegion(float eta); + //bool isME42EtaRegion(float eta); + //bool isME42RPCEtaRegion(float eta); static void setupTFModeHisto(TH1D* h); From 633775e25c44e0334e700cd37d3fec3a30d3b6a6 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 2 Sep 2013 12:49:51 +0200 Subject: [PATCH 105/182] updating the plots after first pre-approval talk --- SimMuL1/scripts/drawplot_eff.C | 582 +++----------- SimMuL1/scripts/drawplot_eff.py | 716 +++++++----------- .../scripts/drawplot_frankenstein_ptshift.C | 139 +++- .../scripts/drawplot_frankenstein_ptshiftX.C | 147 +++- SimMuL1/scripts/effFunctions.C | 2 +- SimMuL1/scripts/plotGEMCSCdPhi.py | 82 +- .../produceRateVsEtaPlotsForApproval.C | 59 +- .../scripts/produceRateVsPtPlotsForApproval.C | 9 +- 8 files changed, 747 insertions(+), 989 deletions(-) diff --git a/SimMuL1/scripts/drawplot_eff.C b/SimMuL1/scripts/drawplot_eff.C index 12db65c4baba0..204d87bfbc4ae 100644 --- a/SimMuL1/scripts/drawplot_eff.C +++ b/SimMuL1/scripts/drawplot_eff.C @@ -4,17 +4,9 @@ gROOT->SetBatch(1); -/* - - .L - - "gem_csc_eff_pt2pt50_pad4.root" - -*/ - TString filesDir = "files/"; TString plotDir = "plots/efficiency/"; -TString ext = ".eps"; +TString ext = ".pdf"; TCut ok_sh1 = "(has_csc_sh&1) > 0"; TCut ok_sh2 = "(has_csc_sh&2) > 0"; @@ -96,93 +88,6 @@ TTree* getTree(TString f_name) return gt; } - -void gemTurnOns(int label_eff = GEM_EFF98) -{ - // gROOT->ProcessLine(".L effFunctions.C"); - - TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.14"; - - const int N = 5; - - int pt_lbl[N] = {DPHI_PT10, DPHI_PT15, DPHI_PT20, DPHI_PT30, DPHI_PT40}; - TString pt[N] = {"pt10","pt15","pt20","pt30","pt40"}; - int marker_styles[5] = {24, 28, 22 , 21, 20}; - - TCanvas* gEff = new TCanvas("gEff","gEff",700,500); - gEff->SetGridx(1); gEff->SetGridy(1); - TCanvas* gEff_odd = new TCanvas("gEff_odd","gEff_odd",700,500); - gEff_odd->SetGridx(1); gEff_odd->SetGridy(1); - TCanvas* gEff_even = new TCanvas("gEff_even","gEff_even",700,500); - gEff_even->SetGridx(1); gEff_even->SetGridy(1); - - TTree *t = getTree(filesDir + "gem_csc_eff_pt2pt50_pad4.root"); - TH1F *ho[N], *he[N]; - for (int n=0; n0) opt = "same p"; - setDPhi(n, label_eff); - gEff->cd(); - ho[n] = draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", Form("h_odd%d",n), "(50,0.,50.)", "pt", ok_lct1 && ok_eta && ok_pad1, ok_dphi1, opt, kRed, marker_styles[n]); - he[n] = draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", Form("h_evn%d",n), "(50,0.,50.)", "pt", ok_lct2 && ok_eta && ok_pad2, ok_dphi2, "same p", kBlue, marker_styles[n]); - gEff_odd->cd(); - ho[n]->Draw(opt); - gEff_even->cd(); - he[n]->Draw(opt); - } - - TString pts[N] = {"10","15","20","30","40"}; - TString efs[5] = {"95", "98", "99"}; - TString leg_header = " #Delta#phi(LCT,GEM) is " + efs[label_eff] + "% efficient for"; - - gEff->cd(); - TLegend *leg = new TLegend(0.50,0.17,.99,0.57, NULL, "brNDC"); - leg->SetNColumns(2); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->SetHeader(leg_header); - leg->AddEntry(ho[0], "odd chambers", ""); - leg->AddEntry(he[0], "even chambers", ""); - leg->AddEntry(ho[0], "at pt", ""); - leg->AddEntry(he[0], "at pt", ""); - for (int n=0; nAddEntry(ho[n], pts[n], "p"); - leg->AddEntry(he[n], pts[n], "p"); - } - leg->Draw(); - gEff->Print(plotDir + "gem_pad_eff_for_LCT_gemEff" + efs[label_eff] +"" + ext); - - gEff_odd->cd(); - TLegend *leg = new TLegend(0.50,0.17,.99,0.57, NULL, "brNDC"); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->SetHeader(leg_header); - leg->AddEntry(ho[0], "odd chambers at pt", ""); - for (int n=0; nAddEntry(ho[n], pts[n], "p"); - } - leg->Draw(); - gEff_odd->Print(plotDir + "gem_pad_eff_for_LCT_gemEff" + efs[label_eff] +"_odd" + ext); - - gEff_even->cd(); - TLegend *leg = new TLegend(0.50,0.17,.99,0.57, NULL, "brNDC"); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->SetHeader(leg_header); - leg->AddEntry(ho[0], "even chambers at pt", ""); - for (int n=0; nAddEntry(he[n], pts[n], "p"); - } - leg->Draw(); - gEff_even->Print(plotDir + "gem_pad_eff_for_LCT_gemEff" + efs[label_eff] +"_even" + ext); -} - - - void eff_hs_dphi(TString f_name, TString p_name) { // efficiency vs half-strip - separate odd-even @@ -222,7 +127,7 @@ void eff_hs_dphi(TString f_name, TString p_name) } -void eff_hs(TString f_name, TString p_name, TString pt) +void efficiency_1(TString f_name, TString p_name, TString pt, bool overlap) { gStyle->SetTitleStyle(0); @@ -242,10 +147,25 @@ void eff_hs(TString f_name, TString p_name, TString pt) // efficiency vs half-strip - separate odd-even TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12"; + TCut cut1; + TCut cut2; + if (overlap) + { + cut1 = ok_pad1_overlap; + cut2 = ok_pad2_overlap; + } + else + { + cut1 = ok_pad1; + cut2 = ok_pad2; + } TTree *t = getTree(f_name); - TH1F* ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;LCT half-strip number;Efficiency", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1, "", kRed); - TH1F* he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;LCT half-strip number;Efficiency", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2, "same"); + TH1F* ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation Preliminary;LCT half-strip number;Efficiency", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , cut1, "", kRed); + TH1F* he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation Preliminary;LCT half-strip number;Efficiency", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , cut2, "same"); + ho->SetMinimum(0.9); + ho->GetXaxis()->SetLabelSize(0.05); + ho->GetYaxis()->SetLabelSize(0.05); TLegend *leg = new TLegend(0.25,0.23,.75,0.5, NULL, "brNDC"); leg->SetBorderSize(0); @@ -255,19 +175,11 @@ void eff_hs(TString f_name, TString p_name, TString pt) leg->AddEntry(he, "\"Close\" chamber pairs","l"); leg->AddEntry(ho, "\"Far\" chamber pairs","l"); leg->Draw(); - // TLegend *leg = new TLegend(0.35,0.2,.65,0.4, NULL, "brNDC"); - // leg->SetBorderSize(0); - // leg->SetTextSize(0.06); - // leg->SetFillStyle(0); - // leg->AddEntry((TObject*)0,"muon p_{T} = " + pt + " GeV/c",""); - // leg->AddEntry(ho,"odd chambers","l"); - // leg->AddEntry(he,"even chambers","l"); - // leg->Draw(); - TLatex* tex2 = new TLatex(.67,.8," L1 Trigger"); - tex2->SetTextSize(0.05); - tex2->SetNDC(); - tex2->Draw(); + // TLatex* tex2 = new TLatex(.67,.8," L1 Trigger"); + // tex2->SetTextSize(0.05); + // tex2->SetNDC(); + // tex2->Draw(); TLatex * tex = new TLatex(.66,.73,"1.64<|#eta|<2.12"); tex->SetTextSize(0.05); @@ -278,72 +190,77 @@ void eff_hs(TString f_name, TString p_name, TString pt) } -void eff_hs_overlap(TString f_name, TString p_name, TString pt) +void efficiency_2(TString f_name, TString p_name, TString pt, bool overlap) { // efficiency vs half-strip - including overlaps in odd&even TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12"; - + TCut cut1; + TCut cut2; + if (overlap) + { + cut1 = ok_pad1_overlap; + cut2 = ok_pad2_overlap; + } + else + { + cut1 = ok_pad1; + cut2 = ok_pad2; + } TTree *t = getTree(f_name); - TH1F* ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;LCT half-strip number;Efficiency", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1_overlap, "", kRed); - TH1F* he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;LCT half-strip number;Efficiency", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2_overlap, "same"); - TF1 fo("fo", "pol0", 6., 123.); - ho->Fit("fo","RN"); - TF1 fe("fe", "pol0", 6., 123.); - he->Fit("fe","RN"); + // latest instructions by Vadim: 21-08-2013 - TLegend *leg = new TLegend(0.25,0.23,.75,0.5, NULL, "brNDC"); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->SetTextSize(0.06); - leg->AddEntry((TObject*)0,"muon p_{T} = " + pt + " GeV/c",""); - leg->AddEntry(he, "\"Close\" chamber pairs","l"); - leg->AddEntry(ho, "\"Far\" chamber pairs","l"); - leg->Draw(); + TGraphAsymmErrors* hgn = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;Generated muon phi #phi [deg];Efficiency", "h_odd", "(100,-10,10)", "mymod(phi*180./TMath::Pi(), 360/18.)", ok_eta&&Qn, ok_pad1 || ok_pad2,"", kRed); + TGraphAsymmErrors* hgp = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;Generated muon phi #phi [deg];Effciency", "h_odd", "(100,-10,10)", "mymod(phi*180./TMath::Pi(), 360/18.)", ok_eta&&Qp, ok_pad1 || ok_pad2,"same", kBlue); + double maxi = 1.0; + double mini = 0.9; + hgn->SetMinimum(mini); + hgn->SetMaximum(maxi); + TLine *l1 = new TLine(-5,mini,-5,maxi); + l1->SetLineStyle(2); + l1->Draw(); + TLine *l1 = new TLine(5,mini,5,maxi); + l1->SetLineStyle(2); + l1->Draw(); - // Print additional information - TLatex* tex2 = new TLatex(.67,.8," L1 Trigger"); - tex2->SetTextSize(0.05); - tex2->SetNDC(); - tex2->Draw(); - - TLatex * tex = new TLatex(.66,.73,"1.64<|#eta|<2.12"); - tex->SetTextSize(0.05); - tex->SetNDC(); - tex->Draw(); + hgn->Fit("pol0","R0","",-10,10); + hgp->Fit("pol0","R0","",-10,10); + double eff_neg = (hgn->GetFunction("pol0"))->GetParameter(0); + double eff_pos = (hgp->GetFunction("pol0"))->GetParameter(0); + std::cout << "negative efficiency" << eff_neg << " " + << "positive efficiency" << eff_pos << std::endl; + + // ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;local #phi [deg];Efficiency", "h_odd", "(150,-10,10)", "mymod(phi+TMath::Pi()/36., TMath::Pi()/18.) * 180./TMath::Pi()", ok_eta&&Qn, ok_pad1 || ok_pad2, "", kRed); + // he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;local #phi [deg];Efficiency", "h_odd", "(150,-10,10)", "mymod(phi+TMath::Pi()/36., TMath::Pi()/18.) * 180./TMath::Pi()", ok_eta&&Qp, ok_pad1 || ok_pad2, "same",kBlue); + + // TH1F* ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;local #phi [deg];Efficiency", "h_odd", "(130,-5,5)", "fmod(180*phi/TMath::Pi(),5)", ok_lct1 && ok_eta , cut1, "", kRed); + // TH1F* he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;local #phi [deg];Efficiency", "h_evn", "(130,-5,5)", "fmod(180*phi/TMath::Pi(),5)", ok_lct2 && ok_eta , cut2, "same"); + // ho->SetMinimum(0.); + hgn->GetXaxis()->SetLabelSize(0.05); + hgn->GetYaxis()->SetLabelSize(0.05); - gPad->Print(p_name); -} -void eff_deg_overlap(TString f_name, TString p_name, TString pt) -{ - // efficiency vs half-strip - including overlaps in odd&even - TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12"; - - TTree *t = getTree(f_name); - TH1F* ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;local #Phi [deg];Efficiency", - "h_odd", "(130,-5,5)", "fmod(180*phi/TMath::Pi(),5)", ok_lct1 && ok_eta , ok_pad1_overlap, "", kRed); - TH1F* he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;local #Phi [deg];Efficiency", - "h_evn", "(130,-5,5)", "fmod(180*phi/TMath::Pi(),5)", ok_lct2 && ok_eta , ok_pad2_overlap, "same"); - ho->SetMinimum(0.); TLegend *leg = new TLegend(0.25,0.23,.75,0.5, NULL, "brNDC"); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.06); leg->AddEntry((TObject*)0,"muon p_{T} = " + pt + " GeV/c",""); - leg->AddEntry(he, "\"Close\" chamber pairs","l"); - leg->AddEntry(ho, "\"Far\" chamber pairs","l"); + leg->AddEntry(hgp, "Postive muons","l"); + leg->AddEntry(hgn, "Negative muons","l"); leg->Draw(); // Print additional information + /* TLatex* tex2 = new TLatex(.67,.8," L1 Trigger"); tex2->SetTextSize(0.05); tex2->SetNDC(); tex2->Draw(); - - TLatex * tex = new TLatex(.66,.73,"1.64<|#eta|<2.12"); + */ + + // TLatex * tex = new TLatex(.66,.73,"1.64<|#eta|<2.12"); + TLatex * tex = new TLatex(.7,.2,"1.64<|#eta|<2.12"); tex->SetTextSize(0.05); tex->SetNDC(); tex->Draw(); @@ -456,7 +373,6 @@ void drawplot_eff_eta() } - void drawplot_eff() { gROOT->ProcessLine(".L effFunctions.C"); @@ -471,41 +387,41 @@ void drawplot_eff() gStyle->SetTitleH(0.058); gStyle->SetTitleBorderSize(0); - gf_name = ""; - TCanvas* cEff = new TCanvas("cEff","cEff",700,500); - // eff_hs(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt05" + ext,"5"); - // eff_hs(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt10" + ext,"10"); - // eff_hs(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt15" + ext,"15"); - // eff_hs(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt20" + ext,"20"); - // eff_hs(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30" + ext,"30"); - // eff_hs(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40" + ext,"40"); - - // eff_hs_overlap(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt05_overlap" + ext,"5"); - // eff_hs_overlap(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt10_overlap" + ext,"10"); - // eff_hs_overlap(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt15_overlap" + ext,"15"); - // eff_hs_overlap(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt20_overlap" + ext,"20"); - // eff_hs_overlap(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt30_overlap" + ext,"30"); - // eff_hs_overlap(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsHS_pt40_overlap" + ext,"40"); - - eff_deg_overlap(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsDeg_pt05_overlap" + ext,"5"); - eff_deg_overlap(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsDeg_pt10_overlap" + ext,"10"); - eff_deg_overlap(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsDeg_pt15_overlap" + ext,"15"); - eff_deg_overlap(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsDeg_pt20_overlap" + ext,"20"); - eff_deg_overlap(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsDeg_pt30_overlap" + ext,"30"); - eff_deg_overlap(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vsDeg_pt40_overlap" + ext,"40"); - - - //gemTurnOns(); - - //drawplot_eff_eta(); + efficiency_1(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt05" + ext, "5", false); + efficiency_1(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt10" + ext, "10", false); + efficiency_1(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt15" + ext, "15", false); + efficiency_1(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt20" + ext, "20", false); + efficiency_1(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt30" + ext, "30", false); + efficiency_1(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt40" + ext, "40", false); + + efficiency_1(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt05_overlap" + ext, "5", true); + efficiency_1(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt10_overlap" + ext, "10", true); + efficiency_1(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt15_overlap" + ext, "15", true); + efficiency_1(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt20_overlap" + ext, "20", true); + efficiency_1(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt30_overlap" + ext, "30", true); + efficiency_1(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt40_overlap" + ext, "40", true); + + efficiency_2(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt05" + ext, "5", false); + efficiency_2(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt10" + ext, "10", false); + efficiency_2(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt15" + ext, "15", false); + efficiency_2(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt20" + ext, "20", false); + efficiency_2(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt30" + ext, "30", false); + efficiency_2(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt40" + ext, "40", false); + + efficiency_2(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt05_overlap" + ext, "5", true); + efficiency_2(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt10_overlap" + ext, "10", true); + efficiency_2(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt15_overlap" + ext, "15", true); + efficiency_2(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt20_overlap" + ext, "20", true); + efficiency_2(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt30_overlap" + ext, "30", true); + efficiency_2(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt40_overlap" + ext, "40", true); + + // drawplot_eff_eta(); } /* - - TTree *gt = getTree("gem_csc_delta_pt40_pad4.root"); @@ -645,302 +561,4 @@ void drawplot_eff() nm->Draw() nmlct->Draw("same") - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --------------------------- 2012 Oct 30 ----------------------- - - .L shFunctions.C - - //fname="shtree_std_pt100.root"; suff = "std_pt100"; - fname="shtree_POSTLS161_pt100.root"; suff = "postls1_pt100"; - - - TFile *f = TFile::Open(fname) - tree = (TTree *) f->Get("neutronAna/CSCSimHitsTree"); - - TCanvas c1("c1","c1",1200,600); - c1->SetBorderSize(0); - c1->SetLeftMargin(0.084); - c1->SetRightMargin(0.033); - c1->SetTopMargin(0.089); - c1->SetBottomMargin(0.086); - c1->SetGridy(); - c1->SetTickx(1); - c1->SetTicky(1); - gStyle->SetOptStat(0); - - - - - TH2D *hc = new TH2D("hc","Strip readout channels closest to SimHit",21,-10.5,10.5,82,0,82); - hc->Draw() - setupH2DType(hc); - hc->GetYaxis()->SetTitle("readout channel #"); - - tree->Draw("sh.chan:(3-2*id.e)*id.t","","same", 10000000, 0); - g = (TGraph*)gPad->FindObject("Graph"); - g->SetMarkerColor(kBlue); - g->SetMarkerStyle(2); - g->SetMarkerSize(0.4); - gPad->Modified() - - c1.Print((string("chan_")+suff+"" + ext).c_str()) - - - - - TH2D *hc = new TH2D("hc","Strips closest to SimHit",21,-10.5,10.5,82,0,82) - for(int b=1; b<=hc->GetXaxis()->GetNbins(); ++b) hc->GetXaxis()->SetBinLabel(b, types2[b].c_str()) - hc->Draw() - setupH2DType(hc); - hc->GetYaxis()->SetTitle("strip #"); - - tree->Draw("sh.s:(3-2*id.e)*id.t","","same", 10000000, 0); - g = (TGraph*)gPad->FindObject("Graph"); - g->SetMarkerColor(kBlue); - g->SetMarkerStyle(2); - g->SetMarkerSize(0.4); - gPad->Modified() - - c1.Print((string("strip_")+suff+"" + ext).c_str()) - - - - TH2D *hc = new TH2D("hc","Wire groups closest to SimHit",21,-10.5,10.5,115,-1,114) - for(int b=1; b<=hc->GetXaxis()->GetNbins(); ++b) hc->GetXaxis()->SetBinLabel(b, types2[b].c_str()) - hc->Draw() - setupH2DType(hc); - hc->GetYaxis()->SetTitle("wiregroup #"); - hc->GetYaxis()->SetNdivisions(1020); - - - tree->Draw("sh.w:(3-2*id.e)*id.t","","same", 10000000, 0); - g = (TGraph*)gPad->FindObject("Graph"); - g->SetMarkerColor(kBlue); - g->SetMarkerStyle(2); - g->SetMarkerSize(0.4); - gPad->Modified() - - c1.Print((string("wg_")+suff+"" + ext).c_str()) - - - - - - .L shFunctions.C - //fname="shtree_POSTLS161_pt100.root"; suff = "postls1_pt100"; - //fname="shtree_POSTLS161_pt10.root"; suff = "postls1_pt10"; - fname="shtree_POSTLS161_pt1000.root"; suff = "postls1_pt1000"; - TFile *f = TFile::Open(fname) - - globalPosfromTree("+ME1", f, 1, 1, "rphi_+ME1_postls1" + ext) - globalPosfromTree("+ME2", f, 1, 2, "rphi_+ME2_postls1" + ext) - globalPosfromTree("+ME3", f, 1, 3, "rphi_+ME3_postls1" + ext) - globalPosfromTree("+ME4", f, 1, 4, "rphi_+ME4_postls1" + ext) - globalPosfromTree("-ME1", f, 2, 1, "rphi_-ME1_postls1" + ext) - globalPosfromTree("-ME2", f, 2, 2, "rphi_-ME2_postls1" + ext) - globalPosfromTree("-ME3", f, 2, 3, "rphi_-ME3_postls1" + ext) - globalPosfromTree("-ME4", f, 2, 4, "rphi_-ME4_postls1" + ext) - - .L shFunctions.C - fname="shtree_std_pt100.root"; suff = "std_pt100"; - TFile *f = TFile::Open(fname) - globalPosfromTree("+ME1", f, 1, 1, "rphi_+ME1_std" + ext) - globalPosfromTree("+ME2", f, 1, 2, "rphi_+ME2_std" + ext) - globalPosfromTree("+ME3", f, 1, 3, "rphi_+ME3_std" + ext) - globalPosfromTree("+ME4", f, 1, 4, "rphi_+ME4_std" + ext) - globalPosfromTree("-ME1", f, 2, 1, "rphi_-ME1_std" + ext) - globalPosfromTree("-ME2", f, 2, 2, "rphi_-ME2_std" + ext) - globalPosfromTree("-ME3", f, 2, 3, "rphi_-ME3_std" + ext) - globalPosfromTree("-ME4", f, 2, 4, "rphi_-ME4_std" + ext) - - - - - - - fname="shtree_std_pt100.root"; suff = "std_pt100"; - //fname="shtree_POSTLS161_pt100.root"; suff = "postls1_pt100"; - - - TFile *f = TFile::Open(fname) - tree = (TTree *) f->Get("neutronAna/CSCSimHitsTree"); - - TCanvas c1("c1","c1",900,900); - c1->SetBorderSize(0); - c1->SetLeftMargin(0.13); - c1->SetRightMargin(0.012); - c1->SetTopMargin(0.022); - c1->SetBottomMargin(0.111); - c1->SetGridy(); - c1->SetTickx(1); - c1->SetTicky(1); - gStyle->SetOptStat(0); - - - - TH2D *hc = new TH2D("hc",";z, cm;r, cm",2,560,1070,82,70,710); - hc->Draw() - h->GetXaxis()->SetTickLength(0.02); - h->GetYaxis()->SetTickLength(0.02); - - tree->Draw("sh.r:sh.gz","","same", 10000000, 0); - g = (TGraph*)gPad->FindObject("Graph"); - g->SetMarkerColor(kBlue); - g->SetMarkerStyle(1); - g->SetMarkerSize(0.1); - gPad->Modified() - - c1.Print((string("rz_+ME_")+suff+"" + ext).c_str()) - - - - TH2D *hc = new TH2D("hc",";z, cm;r, cm",2,-1070,-560,82,70,710); - hc->Draw() - h->GetXaxis()->SetTickLength(0.02); - h->GetYaxis()->SetTickLength(0.02); - - tree->Draw("sh.r:sh.gz","","same", 10000000, 0); - g = (TGraph*)gPad->FindObject("Graph"); - g->SetMarkerColor(kBlue); - g->SetMarkerStyle(1); - g->SetMarkerSize(0.1); - gPad->Modified() - - c1.Print((string("rz_-ME_")+suff+"" + ext).c_str()) - - - - - - - - TFile *f1 = TFile::Open("shtree_std_pt100.root") - t1 = (TTree *) f1->Get("neutronAna/CSCSimHitsTree"); - TFile *f2 = TFile::Open("shtree_POSTLS161_pt100.root") - t2 = (TTree *) f2->Get("neutronAna/CSCSimHitsTree"); - - TCanvas c1("c1","c1",900,900); - c1->SetBorderSize(0); - c1->SetLeftMargin(0.13); - c1->SetRightMargin(0.023); - c1->SetTopMargin(0.081); - c1->SetBottomMargin(0.13); - c1->SetGridy(); - c1->SetTickx(1); - c1->SetTicky(1); - c1->SetLogy(1); - gStyle->SetOptStat(0); - - t1->Draw("TMath::Log10(sh.e*1000000)>>htmp(100,-2.5,2.5)","","", 10000000, 0); - htmp->SetTitle("SimHit energy loss"); - htmp->SetXTitle("log_{10}E_{loss}, eV"); - htmp->SetYTitle("entries"); - htmp->SetLineWidth(2); - htmp->GetXaxis()->SetNdivisions(509); - t2->Draw("TMath::Log10(sh.e*1000000)>>htmp2(100,-2.5,2.5)","","same", 10000000, 0); - htmp2->SetLineWidth(2); - htmp2->SetLineStyle(7); - htmp2->SetLineColor(kRed); - scale = htmp->GetEntries()/(1.*htmp2->GetEntries()); - htmp2->Scale(scale); - gPad->Modified(); - - TLegend *leg1 = new TLegend(0.17,0.7,0.47,0.85,NULL,"brNDC"); - leg1->SetBorderSize(0); - leg1->SetFillStyle(0); - leg1->AddEntry(htmp,"6_0_0_patch1","l"); - leg1->AddEntry(htmp2,"POSTLS161","l"); - leg1->Draw(); - - c1.Print("sh_eloss" + ext) - - - - - - TFile *f1 = TFile::Open("shtree_std_pt100.root") - t1 = (TTree *) f1->Get("neutronAna/CSCSimHitsTree"); - TFile *f2 = TFile::Open("shtree_POSTLS161_pt100.root") - t2 = (TTree *) f2->Get("neutronAna/CSCSimHitsTree"); - - TCanvas c1("c1","c1",900,900); - c1->SetBorderSize(0); - c1->SetLeftMargin(0.13); - c1->SetRightMargin(0.023); - c1->SetTopMargin(0.081); - c1->SetBottomMargin(0.13); - c1->SetGridy(); - c1->SetTickx(1); - c1->SetTicky(1); - //c1->SetLogy(1); - gStyle->SetOptStat(0); - - t1->Draw("sh.t>>htmp(200,0,50.)","","", 10000000, 0); - htmp->SetTitle("SimHit TOF"); - htmp->SetXTitle("TOF, ns"); - htmp->SetYTitle("entries"); - htmp->SetLineWidth(2); - t2->Draw("sh.t>>htmp2(200,0,50)","","same", 10000000, 0); - htmp2->SetLineWidth(2); - htmp2->SetLineStyle(7); - htmp2->SetLineColor(kRed); - scale = htmp->GetEntries()/(1.*htmp2->GetEntries()); - htmp2->Scale(scale); - gPad->Modified(); - - TLegend *leg1 = new TLegend(0.17,0.7,0.47,0.85,NULL,"brNDC"); - leg1->SetBorderSize(0); - leg1->SetFillStyle(0); - leg1->AddEntry(htmp,"6_0_0_patch1","l"); - leg1->AddEntry(htmp2,"POSTLS161","l"); - leg1->Draw(); - - c1.Print("sh_tof" + ext) - - - - - - - - - - - - cvs co -r V50-00-00 CondFormats/CSCObjects - V01-21-03-03 Configuration/StandardSequences - V50-00-00 DataFormats/MuonDetId - V50-00-00 L1Trigger/CSCTrackFinder - V50-00-00 L1Trigger/CSCTriggerPrimitives - V00-00-02 SLHCUpgradeSimulations/Configuration - V00-00-04 SLHCUpgradeSimulations/Geometry - - */ diff --git a/SimMuL1/scripts/drawplot_eff.py b/SimMuL1/scripts/drawplot_eff.py index caa8f58e7f842..e22def950e3e5 100644 --- a/SimMuL1/scripts/drawplot_eff.py +++ b/SimMuL1/scripts/drawplot_eff.py @@ -34,7 +34,7 @@ gStyle.SetMarkerStyle(1) - +#_______________________________________________________________________________ def getTree(fileName): """Get tree for given filename""" @@ -56,54 +56,283 @@ def getTree(fileName): return tree -def eff_halfStrip(f_name,p_name): - """efficiency vs half-strip - separate odd-even""" - - t = getTree(f_name) - ho = draw_eff(t, "Efficiency for track with LCT to have GEM pad in chamber;LCT half-strip;Efficiency", - "h_odd", "(130,0.5,130.5)", "hs_lct_odd", TCut("%s && %s" %(ok_lct1.GetTitle(),ok_eta.GetTitle())), ok_pad1, kRed, 5) - he = draw_eff(t, "Efficiency for track with LCT to have GEM pad in chamber;LCT half-strip;Efficiency", - "h_evn", "(130,0.5,130.5)", "hs_lct_even", TCut("%s && %s" %(ok_lct2.GetTitle(),ok_eta.GetTitle())), ok_pad2, kBlue, 5) +#_______________________________________________________________________________ +def getDphi(eff,pt,evenOdd): + """Return the delta Phi cut value""" - c = TCanvas("c","c",700,500) - c.Clear() + return dphi_lct_pad["%s"%(eff)]["%s"%(pt)]["%s"%(evenOdd)] + + +#_______________________________________________________________________________ +def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): + """Produce GEM turn-on curve""" + + pt = ["pt10","pt20","pt30","pt40"] + pt_labels = ["10","20","30","40"] +# pt_labels = ["10 GeV/c","20 GeV/c","30 GeV/c","40 GeV/c"] + dphis = [0.,0.,0.,0.] + + marker_colors = [kRed, kViolet+1, kAzure+2, kGreen-2] + marker_styles = [20,21,23,22] + + t = getTree("%sgem_csc_eff_pt2pt50_pad4.root"%(filesDir)); + + c = TCanvas("c","c",800,600) c.SetGridx(1) c.SetGridy(1) - h = TH1F("","Efficiency for track with LCT to have GEM pad in chamber",130,0.5,130.5) - h.SetTitle("Efficiency for track with LCT to have GEM pad in chamber") - h.GetXaxis().SetTitle("LCT half-strip") - h.GetYaxis().SetTitle("Efficiency") + c.cd() + h = TH1F(""," GEM-CSC bending Angle CMS Simulation Preliminary;Generated muon p_{T} [GeV/c];",50,0.,50.) + superscript = "p_{T}>p_{T}^{min}" + subscript = "0" + h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<|#Delta#phi_{0}^{WP}| Cut Efficiency"); +## h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<|#Delta#phi_{%s}^{%s}| Cut Efficiency"%(subscript,superscript)); + h.GetYaxis().SetTitleOffset(.9) h.SetStats(0) - h.Draw() - ho.Draw("same") - he.Draw("same") - pt = f_name[f_name.find('pt'):] - pt = pt[2:] - pt = pt[:pt.find('_pad')] - leg = TLegend(0.40,0.2,.7,0.5,"","brNDC") + + ## label sizes more leglible + h.GetXaxis().SetLabelSize(.05) + h.GetXaxis().SetLabelOffset(.005) + h.GetYaxis().SetLabelSize(.05) + h.GetYaxis().SetLabelOffset(.005) + + h.Draw("") + histoList = [] + for i in range(len(pt)): + dphi = getDphi("%s"%(eff),"%s"%(pt[i]),"%s"%(oddEven)) + dphis[i] = dphi + if oddEven=="even": + ok_dphi = TCut("TMath::Abs(dphi_pad_even) < %f"%(dphi)) + denom_cut = ok_pad2_lct2_eta + closeFar = "Close" + else: + ok_dphi = TCut("TMath::Abs(dphi_pad_odd) < %f"%(dphi)) + denom_cut = ok_pad1_lct1_eta + closeFar = "Far" + + h2 = draw_eff(t, "", "h2", "(50,0.,50.)", "pt", + denom_cut, ok_dphi, marker_colors[i], marker_styles[i]) + histoList.append(h2) + h2.SetMarkerSize(1) + h2.Draw("same") + + ## add legend + leg = TLegend(0.52,0.17,.93,0.57, "High efficiency patterns:", "brNDC") + for n in range(len(pt)): +# superscript = "p_{T}>%s"%(pt_labels[n]) + superscript = "\"%s\""%(pt_labels[n]) + subscript = "0" + #leg.AddEntry(histoList[n], "#Delta#phi_{%s}^{%s} = %.1f mrad"%(subscript,superscript,dphis[n]*1000), "p") + leg.AddEntry(histoList[n], "WP = %s"%(pt_labels[n]), "p") + + leg.SetBorderSize(0) + leg.SetMargin(0.1) leg.SetFillStyle(0) - leg.SetTextSize(.05) - leg.AddEntry(0, "p_{T} = %s GeV/c"%(pt), "") - leg.AddEntry(0, "a pad spans 4 strips", "") - leg.AddEntry(ho,"odd chambers","l") - leg.AddEntry(he,"even chambers","l") + leg.SetFillStyle(1001) + leg.SetFillColor(kWhite) + leg.SetTextSize(0.05) leg.Draw("same") - c.SaveAs(p_name) -def eff_halfStrip_overlap(f_name, p_name): - """efficiency vs half-strip - including overlaps in odd&even""" + ## Adding additional information - top right + """ + tex2 = TLatex(.75,.82,' L1 Trigger') + tex2.SetTextSize(0.05) + tex2.SetNDC() + tex2.Draw("same") + """ + + tex3 = TLatex(.735,.82,'1.64<|#eta|<2.14') + tex3.SetTextSize(0.05) + tex3.SetNDC() + tex3.Draw("same") + + ## hardcore nitpicking over here! + if closeFar == "Close": + xpos = 0.57 + else: + xpos = 0.611 + + tex = TLatex(xpos,.75,'"%s" chamber pairs'%(closeFar)) + tex.Draw("same") + tex.SetTextSize(0.05) + tex.SetNDC() + + ## save the file + c.SaveAs("%sGEM_turnon_%s_%s%s"%(plotDir, eff,oddEven,ext)) + + +#_______________________________________________________________________________ +def efficiency_1(f_name, p_name, pt, overlap): + """efficiency vs half-strip - separate odd-even""" + + """ + gStyle->SetTitleStyle(0); + gStyle->SetTitleAlign(13); // coord in top left + gStyle->SetTitleX(0.); + gStyle->SetTitleY(1.); + gStyle->SetTitleW(1); + gStyle->SetTitleH(0.058); + gStyle->SetTitleBorderSize(0); + + gStyle->SetPadLeftMargin(0.126); + gStyle->SetPadRightMargin(0.04); + gStyle->SetPadTopMargin(0.06); + gStyle->SetPadBottomMargin(0.13); + gStyle->SetOptStat(0); + gStyle->SetMarkerStyle(1); + """ + + ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12" + if (overlap): + cut1 = ok_pad1_overlap + cut2 = ok_pad2_overlap + else: + cut1 = ok_pad1 + cut2 = ok_pad2 t = getTree(f_name) + ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation Preliminary;LCT half-strip number;Efficiency", + "h_odd", "(130,0.5,130.5)", "hs_lct_odd", TCut("%s&&%s"(ok_lct1.GetTitle), ok_eta.GetTitle()), cut1, "", kRed) + he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation Preliminary;LCT half-strip number;Efficiency", + "h_evn", "(130,0.5,130.5)", "hs_lct_even", TCut("%s&&%s"(ok_lct1.GetTitle), ok_eta.GetTitle()), cut2, "same") + ho.SetMinimum(0.) + ho.GetXaxis().SetLabelSize(0.05) + ho.GetYaxis().SetLabelSize(0.05) + + leg = TLegend(0.25,0.23,.75,0.5, "", "brNDC"); + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetTextSize(0.06) + leg.AddEntry(0,"muon p_{T} = %s GeV/c"%(pt),"") + leg.AddEntry(he, "\"Close\" chamber pairs","l") + leg.AddEntry(ho, "\"Far\" chamber pairs","l") + leg.Draw(); + + tex2 = TLatex(.67,.8," L1 Trigger") + tex2.SetTextSize(0.05) + tex2.SetNDC() + tex2.Draw() + + tex = TLatex(.66,.73,"1.64<|#eta|<2.12") + tex.SetTextSize(0.05) + tex.SetNDC() + tex.Draw() + +## this has to be fixed + gPad.Print(p_name) + + +""" +void efficiency_2(TString f_name, TString p_name, TString pt, bool overlap) +{ + // efficiency vs half-strip - including overlaps in odd&even + TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12"; + TCut cut1; + TCut cut2; + if (overlap) + { + cut1 = ok_pad1_overlap; + cut2 = ok_pad2_overlap; + } + else + { + cut1 = ok_pad1; + cut2 = ok_pad2; + } + + TTree *t = getTree(f_name); + TH1F* ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation Preliminary;local #phi [deg];Efficiency", "h_odd", "(130,-5,5)", "fmod(180*phi/TMath::Pi(),5)", ok_lct1 && ok_eta , cut1, "", kRed); + TH1F* he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation Preliminary;local #phi [deg];Efficiency", "h_evn", "(130,-5,5)", "fmod(180*phi/TMath::Pi(),5)", ok_lct2 && ok_eta , cut2, "same"); + ho->SetMinimum(0.); + ho->GetXaxis()->SetLabelSize(0.05); + ho->GetYaxis()->SetLabelSize(0.05); + + TLegend *leg = new TLegend(0.25,0.23,.75,0.5, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.06); + leg->AddEntry((TObject*)0,"muon p_{T} = " + pt + " GeV/c",""); + leg->AddEntry(he, "\"Close\" chamber pairs","l"); + leg->AddEntry(ho, "\"Far\" chamber pairs","l"); + leg->Draw(); + + // Print additional information + TLatex* tex2 = new TLatex(.67,.8," L1 Trigger"); + tex2->SetTextSize(0.05); + tex2->SetNDC(); + tex2->Draw(); + + TLatex * tex = new TLatex(.66,.73,"1.64<|#eta|<2.12"); + tex->SetTextSize(0.05); + tex->SetNDC(); + tex->Draw(); + + gPad->Print(p_name); +} +""" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +def efficiency_1(f_name, p_name, overlap): + """Efficiency to match LCT to GEM pad vs half-strip for even and odd numbered chambers. Option to include chamber overlaps""" + + t = getTree(f_name) + if overlap: + cut1 = ok_pad1_overlap + cut2 = ok_pad2_overlap + else: + cut1 = ok_pad1 + cut2 = ok_pad2 + ho = draw_eff(t, "Efficiency for track with LCT to have GEM pad in chamber;LCT half-strip;Efficiency", - "h_odd", "(130,0.5,130.5)", "hs_lct_odd", TCut("%s && %s" %(ok_lct1.GetTitle(),ok_eta.GetTitle())), ok_pad1_overlap, kRed, 5) + "h_odd", "(130,0.5,130.5)", "hs_lct_odd", TCut("%s && %s" %(ok_lct1.GetTitle(),ok_eta.GetTitle())), cut1, kRed, 5) he = draw_eff(t, "Efficiency for track with LCT to have GEM pad in chamber;LCT half-strip;Efficiency", - "h_evn", "(130,0.5,130.5)", "hs_lct_even", TCut("%s && %s" %(ok_lct2.GetTitle(),ok_eta.GetTitle())), ok_pad2_overlap, kBlue, 5) + "h_evn", "(130,0.5,130.5)", "hs_lct_even", TCut("%s && %s" %(ok_lct2.GetTitle(),ok_eta.GetTitle())), cut2, kBlue, 5) c = TCanvas("c","c",700,500) c.Clear() - c.SetGridx(1); - c.SetGridy(1); + c.SetGridx(1) + c.SetGridy(1) h = TH1F("","Efficiency for track with LCT to have GEM pad in chamber",130,0.5,130.5) h.SetTitle("Efficiency for track with LCT to have GEM pad in chamber") h.GetXaxis().SetTitle("LCT half-strip") @@ -113,11 +342,6 @@ def eff_halfStrip_overlap(f_name, p_name): ho.Draw("same") he.Draw("same") -## fo = TF1("fo", "pol0", 6., 123.) -## fe = TF1("fe", "pol0", 6., 123.) -## ho.Fit("fo") -## he.Fit("fe") - pt = f_name[f_name.find('pt'):] pt = pt[2:] pt = pt[:pt.find('_pad')] @@ -129,14 +353,11 @@ def eff_halfStrip_overlap(f_name, p_name): leg.AddEntry(0, "a pad spans 4 strips", "") leg.AddEntry(ho,"odd chambers","l") leg.AddEntry(he,"even chambers","l") -## leg.AddEntry(ho, Form("odd chambers (%0.2f #pm %0.2f)%%", 100.*fo.GetParameter(0), 100.*fo.GetParError(0)),"l"); -## leg.AddEntry(he, Form("even chambers (%0.1f #pm %0.1f)%%", 100.*fe.GetParameter(0), 100.*fe.GetParError(0)),"l"); leg.Draw("same") c.SaveAs(p_name) - def drawplot_eff_eta(f_name, plotDir, ext = ".pdf"): - """efficiency vs eta""" + """Efficiency to match LCT to GEM pad vs LCT eta for even and odd numbered chambers. Option to include chamber overlaps""" c = TCanvas("c","c",700,500) c.Clear() @@ -274,120 +495,7 @@ def etaMatchingEfficiencies(filesDir, plotDir, ext = ".pdf"): drawplot_eff_eta("%sgem_csc_delta_pt40_pad4.root"%(filesDir), plotDir, ext) -def getDphi(eff,pt,evenOdd): - """Return the delta Phi cut value""" - - return dphi_lct_pad["%s"%(eff)]["%s"%(pt)]["%s"%(evenOdd)] - - -def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): - """Produce GEM turn-on curve""" - - pt = ["pt10","pt20","pt30","pt40"] - pt_labels = ["10 GeV/c","20 GeV/c","30 GeV/c","40 GeV/c"] - dphis = [0.,0.,0.,0.] - - marker_colors = [kRed, kViolet+1, kAzure+2, kGreen-2] - marker_styles = [20,21,23,22] - - t = getTree("%sgem_csc_eff_pt2pt50_pad4.root"%(filesDir)); - - c = TCanvas("c","c",800,600) - c.SetGridx(1) - c.SetGridy(1) - c.cd() -# h = TH1F(""," GEM-CSC bending Angle: p_{T} measurement, CMS Simulation;p_{T} [GeV/c];",50,0.,50.) - h = TH1F(""," GEM-CSC bending Angle CMS Simulation;p_{T} [GeV/c];",50,0.,50.) - superscript = "p_{T}>p_{T}^{min}" - subscript = "0" - h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<|#Delta#phi_{%s}^{%s}| Cut Efficiency"%(subscript,superscript)); - h.GetYaxis().SetTitleOffset(.9) - h.SetStats(0) - - ## label sizes more leglible - h.GetXaxis().SetLabelSize(.05) - h.GetXaxis().SetLabelOffset(.005) - h.GetYaxis().SetLabelSize(.05) - h.GetYaxis().SetLabelOffset(.005) - - h.Draw("") - histoList = [] - for i in range(len(pt)): - dphi = getDphi("%s"%(eff),"%s"%(pt[i]),"%s"%(oddEven)) - dphis[i] = dphi - if oddEven=="even": - ok_dphi = TCut("TMath::Abs(dphi_pad_even) < %f"%(dphi)) - denom_cut = ok_pad2_lct2_eta - closeFar = "Close" - else: - ok_dphi = TCut("TMath::Abs(dphi_pad_odd) < %f"%(dphi)) - denom_cut = ok_pad1_lct1_eta - closeFar = "Far" - - h2 = draw_eff(t, "", "h2", "(50,0.,50.)", "pt", - denom_cut, ok_dphi, marker_colors[i], marker_styles[i]) - histoList.append(h2) - h2.SetMarkerSize(1) - h2.Draw("same") - - - ## add legend - leg = TLegend(0.52,0.15,.93,0.57, "High efficiency patterns:", "brNDC") - for n in range(len(pt)): - superscript = "p_{T}>%s"%(pt_labels[n]) - subscript = "0" - leg.AddEntry(histoList[n], "#Delta#phi_{%s}^{%s} = %.4f rad"%(subscript,superscript,dphis[n]), "p") - - leg.SetBorderSize(0) - leg.SetMargin(0.1) - leg.SetFillStyle(0) - leg.SetFillStyle(1001) - leg.SetFillColor(kWhite) - leg.SetTextSize(0.05) - leg.Draw("same") - - ## Adding additional information - top right - tex2 = TLatex(.75,.82,' L1 Trigger') - tex2.SetTextSize(0.05) - tex2.SetNDC() - tex2.Draw("same") - tex3 = TLatex(.735,.75,'1.64<|#eta|<2.14') - tex3.SetTextSize(0.05) - tex3.SetNDC() - tex3.Draw("same") - - ## hardcore nitpicking over here! - if closeFar == "Close": - xpos = 0.57 - else: - xpos = 0.611 - - tex = TLatex(xpos,.68,'"%s" chamber pairs'%(closeFar)) - tex.Draw("same") - tex.SetTextSize(0.05) - tex.SetNDC() - - - ## save the file - c.SaveAs("%sGEM_turnon_%s_%s%s"%(plotDir, eff,oddEven,ext)) - - -def gemTurnOns(filesDir, plotDir, ext): - """Produce the GEM turn-on curves""" - - """ - gemTurnOn(filesDir, plotDir, "95", "even", ext) - gemTurnOn(filesDir, plotDir, "95", "odd", ext) - """ - gemTurnOn(filesDir, plotDir, "98", "even", ext) - gemTurnOn(filesDir, plotDir, "98", "odd", ext) - """ - gemTurnOn(filesDir, plotDir, "99", "even", ext) - gemTurnOn(filesDir, plotDir, "99", "odd", ext) - """ - -##double mymod(double x, double y) {return fmod(x,y);} def eff_hs_1(filesDir, plotDir, f_name, ext): @@ -746,286 +854,6 @@ def eff_hs(filesDir, plotDir, ext): ## nm.Draw() ## nmlct.Draw("same") - - - - - - - - - - - - - - - - - - - - - - - - - - - -## --------------------------- 2012 Oct 30 ----------------------- - -## .L shFunctions.C - -## //fname="shtree_std_pt100.root"; suff = "std_pt100"; -## fname="shtree_POSTLS161_pt100.root"; suff = "postls1_pt100"; - - -## TFile *f = TFile::Open(fname) -## tree = (TTree *) f.Get("neutronAna/CSCSimHitsTree"); - -## TCanvas c1("c1","c1",1200,600); -## c1.SetBorderSize(0); -## c1.SetLeftMargin(0.084); -## c1.SetRightMargin(0.033); -## c1.SetTopMargin(0.089); -## c1.SetBottomMargin(0.086); -## c1.SetGridy(); -## c1.SetTickx(1); -## c1.SetTicky(1); -## gStyle.SetOptStat(0); - - - - -## TH2D *hc = new TH2D("hc","Strip readout channels closest to SimHit",21,-10.5,10.5,82,0,82); -## hc.Draw() -## setupH2DType(hc); -## hc.GetYaxis().SetTitle("readout channel #"); - -## tree.Draw("sh.chan:(3-2*id.e)*id.t","","same", 10000000, 0); -## g = (TGraph*)gPad.FindObject("Graph"); -## g.SetMarkerColor(kBlue); -## g.SetMarkerStyle(2); -## g.SetMarkerSize(0.4); -## gPad.Modified() - -## c1.Print((string("chan_")+suff+".png").c_str()) - - - - -## TH2D *hc = new TH2D("hc","Strips closest to SimHit",21,-10.5,10.5,82,0,82) -## for(int b=1; b<=hc.GetXaxis().GetNbins(); ++b) hc.GetXaxis().SetBinLabel(b, types2[b].c_str()) -## hc.Draw() -## setupH2DType(hc); -## hc.GetYaxis().SetTitle("strip #"); - -## tree.Draw("sh.s:(3-2*id.e)*id.t","","same", 10000000, 0); -## g = (TGraph*)gPad.FindObject("Graph"); -## g.SetMarkerColor(kBlue); -## g.SetMarkerStyle(2); -## g.SetMarkerSize(0.4); -## gPad.Modified() - -## c1.Print((string("strip_")+suff+".png").c_str()) - - - -## TH2D *hc = new TH2D("hc","Wire groups closest to SimHit",21,-10.5,10.5,115,-1,114) -## for(int b=1; b<=hc.GetXaxis().GetNbins(); ++b) hc.GetXaxis().SetBinLabel(b, types2[b].c_str()) -## hc.Draw() -## setupH2DType(hc); -## hc.GetYaxis().SetTitle("wiregroup #"); -## hc.GetYaxis().SetNdivisions(1020); - - -## tree.Draw("sh.w:(3-2*id.e)*id.t","","same", 10000000, 0); -## g = (TGraph*)gPad.FindObject("Graph"); -## g.SetMarkerColor(kBlue); -## g.SetMarkerStyle(2); -## g.SetMarkerSize(0.4); -## gPad.Modified() - -## c1.Print((string("wg_")+suff+".png").c_str()) - - - - - -## .L shFunctions.C -## //fname="shtree_POSTLS161_pt100.root"; suff = "postls1_pt100"; -## //fname="shtree_POSTLS161_pt10.root"; suff = "postls1_pt10"; -## fname="shtree_POSTLS161_pt1000.root"; suff = "postls1_pt1000"; -## TFile *f = TFile::Open(fname) - -## globalPosfromTree("+ME1", f, 1, 1, "rphi_+ME1_postls1.png") -## globalPosfromTree("+ME2", f, 1, 2, "rphi_+ME2_postls1.png") -## globalPosfromTree("+ME3", f, 1, 3, "rphi_+ME3_postls1.png") -## globalPosfromTree("+ME4", f, 1, 4, "rphi_+ME4_postls1.png") -## globalPosfromTree("-ME1", f, 2, 1, "rphi_-ME1_postls1.png") -## globalPosfromTree("-ME2", f, 2, 2, "rphi_-ME2_postls1.png") -## globalPosfromTree("-ME3", f, 2, 3, "rphi_-ME3_postls1.png") -## globalPosfromTree("-ME4", f, 2, 4, "rphi_-ME4_postls1.png") - -## .L shFunctions.C -## fname="shtree_std_pt100.root"; suff = "std_pt100"; -## TFile *f = TFile::Open(fname) -## globalPosfromTree("+ME1", f, 1, 1, "rphi_+ME1_std.png") -## globalPosfromTree("+ME2", f, 1, 2, "rphi_+ME2_std.png") -## globalPosfromTree("+ME3", f, 1, 3, "rphi_+ME3_std.png") -## globalPosfromTree("+ME4", f, 1, 4, "rphi_+ME4_std.png") -## globalPosfromTree("-ME1", f, 2, 1, "rphi_-ME1_std.png") -## globalPosfromTree("-ME2", f, 2, 2, "rphi_-ME2_std.png") -## globalPosfromTree("-ME3", f, 2, 3, "rphi_-ME3_std.png") -## globalPosfromTree("-ME4", f, 2, 4, "rphi_-ME4_std.png") - - - - - - -## fname="shtree_std_pt100.root"; suff = "std_pt100"; -## //fname="shtree_POSTLS161_pt100.root"; suff = "postls1_pt100"; - - -## TFile *f = TFile::Open(fname) -## tree = (TTree *) f.Get("neutronAna/CSCSimHitsTree"); - -## TCanvas c1("c1","c1",900,900); -## c1.SetBorderSize(0); -## c1.SetLeftMargin(0.13); -## c1.SetRightMargin(0.012); -## c1.SetTopMargin(0.022); -## c1.SetBottomMargin(0.111); -## c1.SetGridy(); -## c1.SetTickx(1); -## c1.SetTicky(1); -## gStyle.SetOptStat(0); - - - -## TH2D *hc = new TH2D("hc",";z, cm;r, cm",2,560,1070,82,70,710); -## hc.Draw() -## h.GetXaxis().SetTickLength(0.02); -## h.GetYaxis().SetTickLength(0.02); - -## tree.Draw("sh.r:sh.gz","","same", 10000000, 0); -## g = (TGraph*)gPad.FindObject("Graph"); -## g.SetMarkerColor(kBlue); -## g.SetMarkerStyle(1); -## g.SetMarkerSize(0.1); -## gPad.Modified() - -## c1.Print((string("rz_+ME_")+suff+".png").c_str()) - - - -## TH2D *hc = new TH2D("hc",";z, cm;r, cm",2,-1070,-560,82,70,710); -## hc.Draw() -## h.GetXaxis().SetTickLength(0.02); -## h.GetYaxis().SetTickLength(0.02); - -## tree.Draw("sh.r:sh.gz","","same", 10000000, 0); -## g = (TGraph*)gPad.FindObject("Graph"); -## g.SetMarkerColor(kBlue); -## g.SetMarkerStyle(1); -## g.SetMarkerSize(0.1); -## gPad.Modified() - -## c1.Print((string("rz_-ME_")+suff+".png").c_str()) - - - - - - - -## TFile *f1 = TFile::Open("shtree_std_pt100.root") -## t1 = (TTree *) f1.Get("neutronAna/CSCSimHitsTree"); -## TFile *f2 = TFile::Open("shtree_POSTLS161_pt100.root") -## t2 = (TTree *) f2.Get("neutronAna/CSCSimHitsTree"); - -## TCanvas c1("c1","c1",900,900); -## c1.SetBorderSize(0); -## c1.SetLeftMargin(0.13); -## c1.SetRightMargin(0.023); -## c1.SetTopMargin(0.081); -## c1.SetBottomMargin(0.13); -## c1.SetGridy(); -## c1.SetTickx(1); -## c1.SetTicky(1); -## c1.SetLogy(1); -## gStyle.SetOptStat(0); - -## t1.Draw("TMath::Log10(sh.e*1000000)>>htmp(100,-2.5,2.5)","","", 10000000, 0); -## htmp.SetTitle("SimHit energy loss"); -## htmp.SetXTitle("log_{10}E_{loss}, eV"); -## htmp.SetYTitle("entries"); -## htmp.SetLineWidth(2); -## htmp.GetXaxis().SetNdivisions(509); -## t2.Draw("TMath::Log10(sh.e*1000000)>>htmp2(100,-2.5,2.5)","","same", 10000000, 0); -## htmp2.SetLineWidth(2); -## htmp2.SetLineStyle(7); -## htmp2.SetLineColor(kRed); -## scale = htmp.GetEntries()/(1.*htmp2.GetEntries()); -## htmp2.Scale(scale); -## gPad.Modified(); - -## TLegend *leg1 = new TLegend(0.17,0.7,0.47,0.85,NULL,"brNDC"); -## leg1.SetBorderSize(0); -## leg1.SetFillStyle(0); -## leg1.AddEntry(htmp,"6_0_0_patch1","l"); -## leg1.AddEntry(htmp2,"POSTLS161","l"); -## leg1.Draw(); - -## c1.Print("sh_eloss.png") - - - - - -## TFile *f1 = TFile::Open("shtree_std_pt100.root") -## t1 = (TTree *) f1.Get("neutronAna/CSCSimHitsTree"); -## TFile *f2 = TFile::Open("shtree_POSTLS161_pt100.root") -## t2 = (TTree *) f2.Get("neutronAna/CSCSimHitsTree"); - -## TCanvas c1("c1","c1",900,900); -## c1.SetBorderSize(0); -## c1.SetLeftMargin(0.13); -## c1.SetRightMargin(0.023); -## c1.SetTopMargin(0.081); -## c1.SetBottomMargin(0.13); -## c1.SetGridy(); -## c1.SetTickx(1); -## c1.SetTicky(1); -## //c1.SetLogy(1); -## gStyle.SetOptStat(0); - -## t1.Draw("sh.t>>htmp(200,0,50.)","","", 10000000, 0); -## htmp.SetTitle("SimHit TOF"); -## htmp.SetXTitle("TOF, ns"); -## htmp.SetYTitle("entries"); -## htmp.SetLineWidth(2); -## t2.Draw("sh.t>>htmp2(200,0,50)","","same", 10000000, 0); -## htmp2.SetLineWidth(2); -## htmp2.SetLineStyle(7); -## htmp2.SetLineColor(kRed); -## scale = htmp.GetEntries()/(1.*htmp2.GetEntries()); -## htmp2.Scale(scale); -## gPad.Modified(); - -## TLegend *leg1 = new TLegend(0.17,0.7,0.47,0.85,NULL,"brNDC"); -## leg1.SetBorderSize(0); -## leg1.SetFillStyle(0); -## leg1.AddEntry(htmp,"6_0_0_patch1","l"); -## leg1.AddEntry(htmp2,"POSTLS161","l"); -## leg1.Draw(); - -## c1.Print("sh_tof.png") - -## */ - if __name__ == "__main__": """ halfStripEfficiencies("files/", "plots/efficiency/", ".pdf") @@ -1036,11 +864,11 @@ def eff_hs(filesDir, plotDir, ext): etaMatchingEfficiencies("files/", "plots/efficiency/", ".eps") etaMatchingEfficiencies("files/", "plots/efficiency/", ".png") """ - gemTurnOns("files/", "plots/efficiency/", ".pdf") -# gemTurnOns("files/", "plots/efficiency/", ".eps") -# gemTurnOns("files/", "plots/efficiency/", ".png") - """ - eff_hs("files/", "plots/efficiency/", ".pdf") - eff_hs("files/", "plots/efficiency/", ".eps") - eff_hs("files/", "plots/efficiency/", ".png") - """ + gemTurnOn("files/", "plots/efficiency/", "98", "even", ".pdf") + gemTurnOn("files/", "plots/efficiency/", "98", "odd", ".pdf") + gemTurnOn("files/", "plots/efficiency/", "98", "even", ".png") + gemTurnOn("files/", "plots/efficiency/", "98", "odd", ".png") + + +# efficiency_1("files/", "plots/efficiency/", "20", False, ".pdf") + diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshift.C b/SimMuL1/scripts/drawplot_frankenstein_ptshift.C index df31a99173a7f..ae35f0a613025 100644 --- a/SimMuL1/scripts/drawplot_frankenstein_ptshift.C +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshift.C @@ -1,3 +1,114 @@ +TLatex* drawEtaLabel(TString minEta, TString maxEta, float x=0.17, float y=0.35, float font_size=0.) +{ + TString label(minEta + " < |#eta| < " + maxEta); + TLatex * tex = new TLatex(x, y,label); + if (font_size > 0.) tex->SetFontSize(font_size); + tex->SetTextSize(0.05); + tex->SetNDC(); + tex->Draw(); + return tex; +} + +TLatex* drawLumiLabel(float x=0.17, float y=0.35) +{ + TLatex * tex = new TLatex(x, y,"L = 4*10^{34} cm^{-2} s^{-1}"); + tex->SetTextSize(0.05); + tex->SetNDC(); + tex->Draw(); + return tex; +} + +TLatex* drawL1Label(float x=0.17, float y=0.35) +{ + TLatex * tex = new TLatex(x, y,"L1 trigger in 2012 configuration"); + tex->SetTextSize(0.04); + tex->SetNDC(); + tex->Draw(); + return tex; +} + +void produceRatePlot(TH1D* h, TH1D* i, TH1D* j, TH1D* m, Color_t col0, Color_t col1, Color_t col2, Color_t col3, + float miny, float maxy, TString k, TString l, TString plots, TString ext) +) +{ + TCanvas* c = new TCanvas("c","c",800,800); + c->Clear(); + TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); + pad1->Draw(); + TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); + pad2->Draw(); + + pad1->cd(); + pad1->SetLogx(1); + pad1->SetLogy(1); + pad1->SetGridx(1); + pad1->SetGridy(1); + pad1->SetFrameBorderMode(0); + pad1->SetFillColor(kWhite); + + h->SetFillColor(col0); + i->SetFillColor(col1); + j->SetFillColor(col2); + m->SetFillColor(col3); + + h->Draw("e3"); + i->Draw("same e3"); + j->Draw("same e3"); + m->Draw("same e3"); + h->Draw("same e3"); + h->GetYaxis()->SetRangeUser(miny, maxy); + h->GetXaxis()->SetTitle(""); + + TLegend *leg = new TLegend(0.45,0.7,.93,0.93,"","brNDC"); + leg->SetMargin(0.25); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.04); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(h, "GMT (2012 configuration)","f"); + leg->AddEntry((TObject*)0, "L1 selections (#geq " + k + " stations):",""); + leg->AddEntry(i, "CSC, loose","f"); + leg->AddEntry(j,"CSC, tight","f"); + leg->AddEntry(m,"GEM+CSC integrated trigger","f"); + leg->Draw(); + + drawLumiLabel(0.17,.3); + drawEtaLabel("1.64","2.14",0.17,.37); + + pad2->cd(); + pad2->SetLogx(1); + pad2->SetLogy(1); + pad2->SetGridx(1); + pad2->SetGridy(1); + pad2->SetFillColor(kWhite); + pad2->SetFrameBorderMode(0); + pad2->SetLeftMargin(0.126); + pad2->SetRightMargin(0.04); + pad2->SetTopMargin(0.06); + pad2->SetBottomMargin(0.4); + + TH1D* hh_ratio = setHistoRatio(m, j, "", 0.01,1.1,col2); + hh_ratio->GetXaxis()->SetTitle("L1 muon candidate p_{T}^{cut} [GeV/c]"); + hh_ratio->Draw("P"); + + TH1D* hh_ratio_gmt = setHistoRatio(m, h, "", 0.01,1.1,col0); + hh_ratio_gmt->Draw("P same"); + + leg = new TLegend(0.15,0.45,.45,0.7,NULL,"brNDC"); + leg->SetMargin(0.1); + leg->SetBorderSize(0); + leg->SetTextSize(0.1); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(hh_ratio_gmt, "(GEM+CSC)/GMT","p"); + leg->AddEntry(hh_ratio, "(GEM+CSC)/CSC tight","p"); + leg->Draw("same"); + + c->SaveAs(plots + "rates_vs_pt__PU100__def_" + k + "s_" + k + "s1b_" + k + "s1bgem__" + l + ext); +} + + /* .L drawplot_gmtrt.C @@ -161,7 +272,10 @@ for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0 for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); -TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]"; +//TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]"; + + TString the_ttl = " L1 Single Muon Trigger CMS Simulation;L1 candidate muon p_{T}^{cut} [GeV/c];rate [kHz]"; + hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); @@ -1079,6 +1193,29 @@ drawPULabel(); gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2" + ext); + Color_t col0 = kRed; + Color_t col1 = kViolet+1; + Color_t col2 = kAzure+2; + Color_t col3 = kGreen-2; + + TString plots = "plots/rate_vs_pt_shift/"; + TString ext = ".pdf"; + + + + produceRatePlot(result_gmtsing, result_def_2s__pat2, result_def_2s1b__pat2, result_gem_2s1b__pat2, + col0, col1, col2, col3, 0.1, 10000, "2", "loose", plots, ext); + produceRatePlot(result_gmtsing, result_def_2s__pat8, result_def_2s1b__pat8, result_gem_2s1b__pat8, + col0, col1, col2, col3, 0.1, 10000, "2", "tight", plots, ext); + produceRatePlot(result_gmtsing, result_def_3s__pat2, result_def_3s1b__pat2, result_gem_3s1b__pat2, + col0, col1, col2, col3, 0.01, 10000, "3", "loose", plots, ext); + produceRatePlot(result_gmtsing, result_def_3s__pat8, result_def_3s1b__pat8, result_gem_3s1b__pat8, + col0, col1, col2, col3, 0.01, 10000, "3", "tight", plots, ext); + + + + + return; diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C index c23e4bc37baa6..858c68c544593 100644 --- a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C @@ -1,3 +1,118 @@ +TLatex* drawEtaLabel(TString minEta, TString maxEta, float x=0.17, float y=0.35, float font_size=0.) +{ + TString label(minEta + " < |#eta| < " + maxEta); + TLatex * tex = new TLatex(x, y,label); + if (font_size > 0.) tex->SetFontSize(font_size); + tex->SetTextSize(0.05); + tex->SetNDC(); + tex->Draw(); + return tex; +} + +TLatex* drawLumiLabel(float x=0.17, float y=0.35) +{ + TLatex * tex = new TLatex(x, y,"L = 4*10^{34} cm^{-2} s^{-1}"); + tex->SetTextSize(0.05); + tex->SetNDC(); + tex->Draw(); + return tex; +} + +TLatex* drawL1Label(float x=0.17, float y=0.35) +{ + TLatex * tex = new TLatex(x, y,"L1 trigger in 2012 configuration"); + tex->SetTextSize(0.04); + tex->SetNDC(); + tex->Draw(); + return tex; +} + +void produceRatePlot(TH1D* h, TH1D* i, TH1D* j, TH1D* m, Color_t col0, Color_t col1, Color_t col2, Color_t col3, + float miny, float maxy, TString k, TString l, TString plots, TString ext) +) +{ + TCanvas* c = new TCanvas("c","c",800,800); + c->Clear(); + TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); + pad1->Draw(); + TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); + pad2->Draw(); + + pad1->cd(); + pad1->SetLogx(1); + pad1->SetLogy(1); + pad1->SetGridx(1); + pad1->SetGridy(1); + pad1->SetFrameBorderMode(0); + pad1->SetFillColor(kWhite); + + h->SetFillColor(col0); + i->SetFillColor(col1); + j->SetFillColor(col2); + m->SetFillColor(col3); + + h->Draw("e3"); + i->Draw("same e3"); + j->Draw("same e3"); + m->Draw("same e3"); + h->Draw("same e3"); + h->GetYaxis()->SetRangeUser(miny, maxy); + h->GetXaxis()->SetTitle(""); + + TLegend *leg = new TLegend(0.45,0.7,.93,0.93,"","brNDC"); + leg->SetMargin(0.25); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.04); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(h, "L1 single muon trigger","f"); + leg->AddEntry((TObject*)0, "(final 2012 configuration)",""); + // leg->AddEntry((TObject*)0, "L1 selections (#geq " + k + " stations):",""); + leg->AddEntry(i,"CSC #geq" + k + " stubs (anywhere)","f"); + leg->AddEntry(j,"CSC #geq" + k + " stubs (one in ME1/b)","f"); + leg->AddEntry(m,"GEM+CSC integrated trigger","f"); + leg->Draw(); + + drawLumiLabel(0.17,.3); + drawEtaLabel("1.64","2.14",0.17,.37); + + pad2->cd(); + pad2->SetLogx(1); + pad2->SetLogy(1); + pad2->SetGridx(1); + pad2->SetGridy(1); + pad2->SetFillColor(kWhite); + pad2->SetFrameBorderMode(0); + pad2->SetLeftMargin(0.126); + pad2->SetRightMargin(0.04); + pad2->SetTopMargin(0.06); + pad2->SetBottomMargin(0.4); + + TH1D* hh_ratio = setHistoRatio(m, j, "", 0.01,1.1,col2); + hh_ratio->GetXaxis()->SetTitle("L1 muon candidate p_{T}^{cut} [GeV/c]"); + hh_ratio->GetYaxis()->SetNdivisions(3); + hh_ratio->Draw("P"); + + TH1D* hh_ratio_gmt = setHistoRatio(m, h, "", 0.01,1.1,col0); + hh_ratio_gmt->Draw("P same"); + + + + leg = new TLegend(0.15,0.45,.45,0.7,NULL,"brNDC"); + leg->SetMargin(0.1); + leg->SetBorderSize(0); + leg->SetTextSize(0.1); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(hh_ratio_gmt, "(GEM+CSC)/GMT","p"); + leg->AddEntry(hh_ratio, "(GEM+CSC)/CSC #geq" + k + " stubs","p"); + leg->Draw("same"); + + c->SaveAs(plots + "rates_vs_pt__PU100__def_" + k + "s_" + k + "s1b_" + k + "s1bgem__" + l + ext); +} + + /* .L drawplot_gmtrt.C @@ -162,7 +277,12 @@ for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0 for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); -TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]"; +//TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]"; + +// TString the_ttl = " L1 Single Muon Trigger CMS Simulation Preliminary;L1 candidate muon p_{T}^{cut} [GeV/c];rate [kHz]"; + TString the_ttl = " CMS Simulation Preliminary;L1 muon candidate p_{T}^{cut} [GeV/c];rate [kHz]"; + + hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); @@ -302,7 +422,7 @@ gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_p ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); +gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio.C"); // --- def-3s-3s1b gem-3s-2s1b @@ -1081,6 +1201,29 @@ drawPULabel(); gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2" + ext); + + + Color_t col0 = kRed; + Color_t col1 = kViolet+1; + Color_t col2 = kAzure+2; + Color_t col3 = kGreen-2; + + TString plots = "plots/rate_vs_pt_shiftX/"; + TString ext = ".pdf"; + + + + produceRatePlot(result_gmtsing, result_def_2s__pat2, result_def_2s1b__pat2, result_gem_2s1b__pat2, + col0, col1, col2, col3, 0.1, 10000, "2", "loose", plots, ext); + //produceRatePlot(result_gmtsing, result_def_2s, result_def_2s1b, result_gem_2s1b, + // col0, col1, col2, col3, 0.1, 10000, "2", "tight", plots, ext); + produceRatePlot(result_gmtsing, result_def_3s__pat2, result_def_3s1b__pat2, result_gem_3s1b__pat2, + col0, col1, col2, col3, 0.01, 10000, "3", "loose", plots, ext); + // produceRatePlot(result_gmtsing, result_def_3s, result_def_3s1b, result_gem_3s1b, + // col0, col1, col2, col3, 0.01, 10000, "3", "tight", plots, ext); + + + return; diff --git a/SimMuL1/scripts/effFunctions.C b/SimMuL1/scripts/effFunctions.C index 43e4d242a2d8a..c38497833bb5b 100644 --- a/SimMuL1/scripts/effFunctions.C +++ b/SimMuL1/scripts/effFunctions.C @@ -34,7 +34,7 @@ TGraphAsymmErrors* draw_geff(TTree *t, TString title, TString h_name, TString h_ if (!opt.Contains("same")) { num->Reset(); - num->GetYaxis()->SetRangeUser(0.,1.05); + num->GetYaxis()->SetRangeUser(0.9,1.0); num->SetStats(0); num->SetTitle(title); num->Draw(); diff --git a/SimMuL1/scripts/plotGEMCSCdPhi.py b/SimMuL1/scripts/plotGEMCSCdPhi.py index 85864aeb73f2c..7961837a46842 100644 --- a/SimMuL1/scripts/plotGEMCSCdPhi.py +++ b/SimMuL1/scripts/plotGEMCSCdPhi.py @@ -34,13 +34,13 @@ def getTree(fileName): def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): """Plot the GEM-CSC bending angles""" - t = getTree("%sgem_csc_delta_pt5_pad4.root"%(filesDir)); - t1 = getTree("%sgem_csc_delta_pt20_pad4.root"%(filesDir)); + t = getTree("%sgem_csc_delta_pt5_pad4.root"%(filesDir)) + t1 = getTree("%sgem_csc_delta_pt20_pad4.root"%(filesDir)) - dphi_pt5 = TH1F("dphi_pt5","",600,0.0,0.03); - dphi_pt20 = TH1F("dphi_pt20","",600,0.0,0.03); + dphi_pt5 = TH1F("dphi_pt5","",600,0.0,0.03) + dphi_pt20 = TH1F("dphi_pt20","",600,0.0,0.03) - c = TCanvas("c","c",700,450); + c = TCanvas("c","c",700,450) c.Clear() ## c.SetGridx(1) ## c.SetGridy(1) @@ -71,42 +71,47 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): var = "dphi_pad_odd" closeFar = "Far" - t.Draw("TMath::Abs(%s)>>dphi_pt5"%(var) , ok_pad_lct); - t1.Draw("TMath::Abs(%s)>>dphi_pt20"%(var) , ok_pad_lct); + t.Draw("TMath::Abs(%s)>>dphi_pt5"%(var) , ok_pad_lct) + t1.Draw("TMath::Abs(%s)>>dphi_pt20"%(var) , ok_pad_lct) - dphi_pt5.Scale(1/dphi_pt5.Integral()); - dphi_pt20.Scale(1/dphi_pt20.Integral()); + dphi_pt5.Scale(1/dphi_pt5.Integral()) + dphi_pt20.Scale(1/dphi_pt20.Integral()) - dphi_pt5.SetLineColor(kRed); - dphi_pt20.SetLineColor(kBlue); - dphi_pt5.SetLineWidth(2); - dphi_pt20.SetLineWidth(2); - - dphi_pt20.GetXaxis().SetTitle("#Delta#Phi(GEM,CSC) [rad]"); - dphi_pt20.GetYaxis().SetTitle("A.U."); - dphi_pt20.SetTitle(" GEM-CSC Bending Angle CMS Simulation"); - - dphi_pt20.Draw(); - dphi_pt5.Draw("same"); - - legend = TLegend(.4,.45,.7,.6); - legend.SetFillColor(kWhite); - legend.SetFillStyle(0); - legend.SetBorderSize(0); - legend.SetTextSize(0.06); - legend.SetMargin(0.13); - ## legend.AddEntry(0,"1.64<|#eta|<2.14:",""); - legend.AddEntry(dphi_pt5,"muon p_{T} = 5 GeV/c","L"); - legend.AddEntry(dphi_pt20,"muon p_{T} = 20 GeV/c","L"); - legend.Draw("same"); + dphi_pt5.SetLineColor(kRed) + dphi_pt20.SetLineColor(kBlue) + dphi_pt5.SetLineWidth(2) + dphi_pt20.SetLineWidth(2) + + dphi_pt20.GetXaxis().SetTitle("#Delta#phi(GEM,CSC) [rad]") + dphi_pt20.GetYaxis().SetTitle("Arbitray units") + dphi_pt20.SetTitle(" GEM-CSC Bending Angle CMS Simulation Preliminary") + + dphi_pt20.GetXaxis().SetLabelSize(0.05) + dphi_pt20.GetYaxis().SetLabelSize(0.05) + + dphi_pt20.Draw() + dphi_pt5.Draw("same") + + legend = TLegend(.4,.45,.7,.6) + legend.SetFillColor(kWhite) + legend.SetFillStyle(0) + legend.SetBorderSize(0) + legend.SetTextSize(0.06) + legend.SetMargin(0.13) + ## legend.AddEntry(0,"1.64<|#eta|<2.14:","") + legend.AddEntry(dphi_pt5,"muon p_{T} = 5 GeV/c","L") + legend.AddEntry(dphi_pt20,"muon p_{T} = 20 GeV/c","L") + legend.Draw("same") ## Adding additional information - top right + """ tex2 = TLatex(.73,.85,' L1 Trigger') tex2.SetTextSize(0.06) tex2.SetNDC() tex2.Draw("same") + """ - tex3 = TLatex(.72,.75,'1.64<|#eta|<2.14') + tex3 = TLatex(.72,.85,'1.64<|#eta|<2.14') tex3.SetTextSize(0.06) tex3.SetNDC() tex3.Draw("same") @@ -125,11 +130,16 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): c.SaveAs("%sGEMCSCdPhi_%s_chambers%s"%(plotDir, oddEven, ext)) if __name__ == "__main__": - plotGEMCSCdPhi("files/", "plots/bending/", "even", ".png") - plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".png") - plotGEMCSCdPhi("files/", "plots/bending/", "even", ".pdf") - plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".pdf") +# plotGEMCSCdPhi("files/", "plots/bending/", "even", ".png") +# plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".png") +# plotGEMCSCdPhi("files/", "plots/bending/", "even", ".pdf") +# plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".pdf") plotGEMCSCdPhi("files/", "plots/bending/", "even", ".eps") plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".eps") + plotGEMCSCdPhi("files/", "plots/bending/", "even", ".pdf") + plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".pdf") + plotGEMCSCdPhi("files/", "plots/bending/", "even", ".png") + plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".png") + diff --git a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C b/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C index c09ebe747e744..b494a4608356a 100644 --- a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C +++ b/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C @@ -119,7 +119,7 @@ TH1D* setHistoRatio(TH1D* num, TH1D* denom, TString title = "", double ymin=0.4, -void addRatioPlotLegend(TH1* h) +void addRatioPlotLegend(TH1* h, TString k) { TLegend* leg = new TLegend(0.17,0.4,.47,0.5,NULL,"brNDC"); leg->SetMargin(0.1); @@ -127,7 +127,7 @@ void addRatioPlotLegend(TH1* h) leg->SetTextSize(0.1); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry(h, "GEM+CSC/CSC tight","P"); + leg->AddEntry(h, "(GEM+CSC)/CSC #geq" + k + " stubs","P"); leg->Draw("same"); } @@ -139,9 +139,9 @@ void addRatePlotLegend(TH1* h, TH1* i, TH1* j, TString k, TString l) leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry(h,"CSC, loose","f"); - leg->AddEntry(i,"CSC, tight","f"); - leg->AddEntry(j,"GEM+CSC Integrated Trigger","f"); + leg->AddEntry(h,"CSC #geq" + k + " stubs (anywhere)","l"); + leg->AddEntry(i,"CSC #geq" + k + " stubs (one in ME1/b)","l"); + leg->AddEntry(j,"GEM+CSC integrated trigger","l"); leg->Draw("same"); } @@ -156,6 +156,19 @@ void addRatePlots(TH1* h, TH1* i, TH1* j, Color_t col1, Color_t col2, Color_t co i->SetFillStyle(sty2); j->SetFillStyle(sty3); + // Slava's proposal + h->SetFillStyle(0); + i->SetFillStyle(0); + j->SetFillStyle(0); + + h->SetLineStyle(1); + i->SetLineStyle(4); + j->SetLineStyle(2); + + h->SetLineWidth(2); + i->SetLineWidth(2); + j->SetLineWidth(2); + h->GetYaxis()->SetRangeUser(miny,maxy); i->GetYaxis()->SetRangeUser(miny,maxy); j->GetYaxis()->SetRangeUser(miny,maxy); @@ -164,7 +177,7 @@ void addRatePlots(TH1* h, TH1* i, TH1* j, Color_t col1, Color_t col2, Color_t co TH1* j_clone = j->Clone("j_clone"); TH1* i_clone2 = i->Clone("i_clone2"); TH1* j_clone2 = j->Clone("j_clone2"); - + /* for (int ii=0; ii<=14; ++ii){ i_clone2->SetBinContent(ii,0); j_clone2->SetBinContent(ii,0); @@ -176,8 +189,9 @@ void addRatePlots(TH1* h, TH1* i, TH1* j, Color_t col1, Color_t col2, Color_t co j_clone2->SetBinContent(ii,0); i_clone2->SetBinError(ii,0); j_clone2->SetBinError(ii,0); - - } + j_clone2->GetXaxis()->SetRangeUser(1.62,2.12); + i_clone2->GetXaxis()->SetRangeUser(1.62,2.12); + } for (int ii=15; ii<=25; ++ii){ i_clone->SetBinContent(ii,0); @@ -185,14 +199,15 @@ void addRatePlots(TH1* h, TH1* i, TH1* j, Color_t col1, Color_t col2, Color_t co i_clone->SetBinError(ii,0); j_clone->SetBinError(ii,0); } + */ - j_clone->SetFillStyle(sty4); + // j_clone->SetFillStyle(sty4); i_clone->Draw("hist e1 same"); j_clone->Draw("hist e1 same"); h->Draw("hist e1 same"); - i_clone2->Draw("hist e1 same"); - j_clone2->Draw("hist e1 same"); + // i_clone2->Draw("hist e1 same"); + // j_clone2->Draw("hist e1 same"); } void setPad1Attributes(TPad* pad1) @@ -237,12 +252,14 @@ void produceRateVsEtaPlot(TH1D* h, TH1D* i, TH1D* j, Color_t col1, Color_t col2, setPad2Attributes(pad2); TH1D* gem_ratio = setHistoRatio(j, i, "", 0.01,2.0, col2); gem_ratio->Draw("Pe"); - addRatioPlotLegend(gem_ratio); + gem_ratio->GetYaxis()->SetNdivisions(3); + + addRatioPlotLegend(gem_ratio, k); c->SaveAs(plots + "rates_vs_eta__minpt" + l + "__PU100__def_" + k + "s_" + k + "s1b_" + k + "s1bgem" + ext); } -void produceRateVsEtaPlotsForApproval() +void produceRateVsEtaPlotsForApproval(TString ext, TString plots) { gStyle->SetOptStat(0); gStyle->SetTitleStyle(0); @@ -257,11 +274,8 @@ void produceRateVsEtaPlotsForApproval() TString f_g98_pt30 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat2.root"; TString f_g98_pt40 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat2.root"; - // general stuff TString hdir = "SimMuL1StrictAll"; - TString ext = ".pdf"; - TString plots = "plots/rate_vs_eta/"; // colors - same colors as for rate vs pt plots!! Color_t col1 = kViolet+1; @@ -270,12 +284,13 @@ void produceRateVsEtaPlotsForApproval() // styles Style_t sty1 = 3345; - Style_t sty2 = 2003; + Style_t sty2 = 3003; Style_t sty3 = 2002; // Declaration of histograms TString vs_eta_minpt = "10"; - TString ttl = " L1 Single Muon Trigger CMS Simulation;L1 muon candidate #eta;rate [kHz]"; + // TString ttl = " L1 Single Muon Trigger CMS Simulation Preliminary;L1 muon candidate #eta;rate [kHz]"; + TString ttl = " CMS Simulation Preliminary;L1 muon candidate #eta;rate [kHz]"; TH1D* h_rt_tf10_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); TH1D* h_rt_tf10_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); TH1D* h_rt_tf10_gpt10_2s1b = setHistoEta(f_g98_pt10, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); @@ -335,7 +350,13 @@ void produceRateVsEtaPlotsForApproval() col1,col2,col3,sty1,sty2,sty3,3355,miny,6,"3","30",plots,ext); } - +void produceRateVsEtaPlotsForApproval() +{ + // produceRateVsEtaPlotsForApproval(".C", "plots/rate_vs_eta/"); + //produceRateVsEtaPlotsForApproval(".png", "plots/rate_vs_eta/"); + produceRateVsEtaPlotsForApproval(".pdf", "plots/rate_vs_eta/"); + //produceRateVsEtaPlotsForApproval(".C", "plots/rate_vs_eta/"); +} /* void gem_rate_draw() { diff --git a/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C b/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C index afeba580bd65c..39bbd7b58cd1b 100644 --- a/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C +++ b/SimMuL1/scripts/produceRateVsPtPlotsForApproval.C @@ -68,8 +68,8 @@ void produceRatePlot(TH1D* h, TH1D* i, TH1D* j, TH1D* m, Color_t col0, Color_t c leg->SetFillColor(kWhite); leg->AddEntry(h, "GMT (2012 configuration)","f"); leg->AddEntry((TObject*)0, "L1 selections (#geq " + k + " stations):",""); - leg->AddEntry(i, "CSC, loose","f"); - leg->AddEntry(j,"CSC, tight","f"); + leg->AddEntry(i,"CSC #geq" + k + " stubs (anywhere)","f"); + leg->AddEntry(j,"CSC #geq" + k + " stubs (one in ME1/b)","f"); leg->AddEntry(m,"GEM+CSC integrated trigger","f"); leg->Draw(); @@ -113,7 +113,7 @@ void produceRatePlots(TString ext) gem_dir = "files/"; gem_label = "gem98"; - TString the_ttl = " L1 Single Muon Trigger CMS Simulation;L1 candidate muon p_{T}^{cut} [GeV/c];rate [kHz]"; + TString the_ttl = " L1 Single Muon Trigger CMS Simulation Preliminary;L1 candidate muon p_{T}^{cut} [GeV/c];rate [kHz]"; TString plots = "plots/rate/"; //gStyle->SetStatW(0.13); @@ -140,7 +140,6 @@ void produceRatePlots(TString ext) // ********** PAT2 ********** getPTHistos("minbias_pt06_pat2"); - hh = (TH1D*)result_def_3s1b->Clone("gem_new"); for (int b = hh->FindBin(6.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); @@ -483,4 +482,6 @@ void produceRateVsPtPlotsForApproval() gROOT->SetBatch(true); produceRatePlots(".pdf"); + produceRatePlots(".eps"); + produceRatePlots(".png"); } From aec3bfd469b2c756c6b95140cc616c759a73fb2d Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 13 Sep 2013 15:35:17 +0200 Subject: [PATCH 106/182] Axis title update --- SimMuL1/scripts/drawplot_eff.py | 11 +++-------- SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C | 4 ++-- SimMuL1/scripts/drawplot_gmtrt.C | 2 +- SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C | 6 +++--- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/SimMuL1/scripts/drawplot_eff.py b/SimMuL1/scripts/drawplot_eff.py index e22def950e3e5..9dfd74095156e 100644 --- a/SimMuL1/scripts/drawplot_eff.py +++ b/SimMuL1/scripts/drawplot_eff.py @@ -81,7 +81,7 @@ def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): c.SetGridx(1) c.SetGridy(1) c.cd() - h = TH1F(""," GEM-CSC bending Angle CMS Simulation Preliminary;Generated muon p_{T} [GeV/c];",50,0.,50.) + h = TH1F(""," GEM-CSC bending Angle CMS Simulation Preliminary;Generated muon p_{T} [GeV/c];",50,0.,50.) superscript = "p_{T}>p_{T}^{min}" subscript = "0" h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<|#Delta#phi_{0}^{WP}| Cut Efficiency"); @@ -864,11 +864,6 @@ def eff_hs(filesDir, plotDir, ext): etaMatchingEfficiencies("files/", "plots/efficiency/", ".eps") etaMatchingEfficiencies("files/", "plots/efficiency/", ".png") """ - gemTurnOn("files/", "plots/efficiency/", "98", "even", ".pdf") - gemTurnOn("files/", "plots/efficiency/", "98", "odd", ".pdf") - gemTurnOn("files/", "plots/efficiency/", "98", "even", ".png") - gemTurnOn("files/", "plots/efficiency/", "98", "odd", ".png") + gemTurnOn("files/", "plots/efficiency/", "98", "even", ".eps") + gemTurnOn("files/", "plots/efficiency/", "98", "odd", ".eps") - -# efficiency_1("files/", "plots/efficiency/", "20", False, ".pdf") - diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C index 858c68c544593..fc2b92ced25a6 100644 --- a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C @@ -280,7 +280,7 @@ for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0 //TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]"; // TString the_ttl = " L1 Single Muon Trigger CMS Simulation Preliminary;L1 candidate muon p_{T}^{cut} [GeV/c];rate [kHz]"; - TString the_ttl = " CMS Simulation Preliminary;L1 muon candidate p_{T}^{cut} [GeV/c];rate [kHz]"; + TString the_ttl = " CMS Simulation Preliminary;L1 muon candidate p_{T}^{cut} [GeV/c];Trigger rate [kHz]"; @@ -1209,7 +1209,7 @@ gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2 Color_t col3 = kGreen-2; TString plots = "plots/rate_vs_pt_shiftX/"; - TString ext = ".pdf"; + TString ext = ".png"; diff --git a/SimMuL1/scripts/drawplot_gmtrt.C b/SimMuL1/scripts/drawplot_gmtrt.C index 2768777727d18..df817c8edf918 100644 --- a/SimMuL1/scripts/drawplot_gmtrt.C +++ b/SimMuL1/scripts/drawplot_gmtrt.C @@ -446,7 +446,7 @@ TH1D* setHistoRatio(TH1D* num, TH1D* denom, TString title = "", double ymin=0.4, ratio->GetYaxis()->SetRangeUser(ymin, ymax); ratio->GetYaxis()->SetTitle("ratio: (with GEM)/default"); - ratio->GetYaxis()->SetTitle("ratio"); + ratio->GetYaxis()->SetTitle("Ratio"); // ratio->GetYaxis()->SetTitle("(ME1/b + GEM) / ME1/b"); ratio->GetYaxis()->SetTitleSize(.14); // ratio->GetYaxis()->SetTitleSize(.1); diff --git a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C b/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C index b494a4608356a..5afcf472efb56 100644 --- a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C +++ b/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C @@ -94,7 +94,7 @@ TH1D* setHistoRatio(TH1D* num, TH1D* denom, TString title = "", double ymin=0.4, ratio->SetTitle(title); ratio->GetYaxis()->SetRangeUser(ymin, ymax); ratio->GetYaxis()->SetTitle("ratio: (with GEM)/default"); - ratio->GetYaxis()->SetTitle("ratio"); + ratio->GetYaxis()->SetTitle("Ratio"); //ratio->GetYaxis()->SetTitle("(ME1/b + GEM) / ME1/b"); ratio->GetYaxis()->SetTitleSize(.14); //ratio->GetYaxis()->SetTitleSize(.1); @@ -290,7 +290,7 @@ void produceRateVsEtaPlotsForApproval(TString ext, TString plots) // Declaration of histograms TString vs_eta_minpt = "10"; // TString ttl = " L1 Single Muon Trigger CMS Simulation Preliminary;L1 muon candidate #eta;rate [kHz]"; - TString ttl = " CMS Simulation Preliminary;L1 muon candidate #eta;rate [kHz]"; + TString ttl = " CMS Simulation Preliminary;L1 muon candidate #eta;Trigger rate [kHz]"; TH1D* h_rt_tf10_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); TH1D* h_rt_tf10_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); TH1D* h_rt_tf10_gpt10_2s1b = setHistoEta(f_g98_pt10, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); @@ -354,7 +354,7 @@ void produceRateVsEtaPlotsForApproval() { // produceRateVsEtaPlotsForApproval(".C", "plots/rate_vs_eta/"); //produceRateVsEtaPlotsForApproval(".png", "plots/rate_vs_eta/"); - produceRateVsEtaPlotsForApproval(".pdf", "plots/rate_vs_eta/"); + produceRateVsEtaPlotsForApproval(".png", "plots/rate_vs_eta/"); //produceRateVsEtaPlotsForApproval(".C", "plots/rate_vs_eta/"); } /* From 8c2a44c4be691ac492d1b763ddb893def60ae9f1 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 16 Sep 2013 00:40:20 +0200 Subject: [PATCH 107/182] rebasing --- SimMuL1/plugins/GEMCSCTriggerRate.cc | 314 +++------------------------ SimMuL1/plugins/GEMCSCTriggerRate.h | 2 +- 2 files changed, 29 insertions(+), 287 deletions(-) diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.cc b/SimMuL1/plugins/GEMCSCTriggerRate.cc index 5bf08000d4f3f..c7a6e76815192 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRate.cc @@ -20,6 +20,7 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): CSCTFSPset(iConfig.getParameter("SectorProcessor")), ptLUTset(CSCTFSPset.getParameter("PTLUT")), ptLUT(0), + matchAllTrigPrimitivesInChamber_(iConfig.getUntrackedParameter("matchAllTrigPrimitivesInChamber", false)), debugRATE(iConfig.getUntrackedParameter("debugRATE", 0)), minBX_(iConfig.getUntrackedParameter("minBX",-6)), maxBX_(iConfig.getUntrackedParameter("maxBX",6)), @@ -70,14 +71,14 @@ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): muScalesCacheID_ = 0ULL ; muPtScaleCacheID_ = 0ULL ; - bookALCTTree(); - bookCLCTTree(); - bookLCTTree(); - bookMPCLCTTree(); - bookTFTrackTree(); - bookTFCandTree(); - bookGMTRegionalTree(); - bookGMTCandTree(); +// bookALCTTree(); +// bookCLCTTree(); +// bookLCTTree(); +// bookMPLCTTree(); +// bookTFTrackTree(); +// bookTFCandTree(); +// bookGMTRegionalTree(); +// bookGMTCandTree(); } // ================================================================================================ @@ -560,18 +561,16 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet edm::Handle< CSCALCTDigiCollection > halcts; iEvent.getByLabel("simCscTriggerPrimitiveDigis", halcts); const CSCALCTDigiCollection* alcts = halcts.product(); - edm::Handle< CSCCLCTDigiCollection > hclcts; iEvent.getByLabel("simCscTriggerPrimitiveDigis", hclcts); const CSCCLCTDigiCollection* clcts = hclcts.product(); // strip&wire matching output after TMB and after MPC sorting edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_tmb; - iEvent.getByLabel("simCscTriggerPrimitiveDigis", lcts_tmb); - const CSCCorrelatedLCTDigiCollection* lcts = lcts_tmb.product(); - edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_mpc; + iEvent.getByLabel("simCscTriggerPrimitiveDigis", lcts_tmb); iEvent.getByLabel("simCscTriggerPrimitiveDigis", "MPCSORTED", lcts_mpc); + const CSCCorrelatedLCTDigiCollection* lcts = lcts_tmb.product(); const CSCCorrelatedLCTDigiCollection* mplcts = lcts_mpc.product(); // DT primitives for input to TF @@ -676,17 +675,16 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet // //======================================================================= // //============================= RATES =================================== - analyzeALCTRate(iEvent); - analyzeCLCTRate(iEvent); - analyzeLCTRate(iEvent); - analyzeMPCLCTRate(iEvent); - analyzeTFTrackRate(iEvent); - analyzeTFCandRate(iEvent); - analyzeGMTCandRate(iEvent); +// analyzeALCTRate(iEvent); +// analyzeCLCTRate(iEvent); +// analyzeLCTRate(iEvent); +// analyzeMPLCTRate(iEvent); +// analyzeTFTrackRate(iEvent); +// analyzeTFCandRate(iEvent); +// analyzeGMTCandRate(iEvent); //============ RATE ALCT ================== - int nalct=0; int nalct_per_bx[16]; int n_ch_alct_per_bx[16]; @@ -699,7 +697,6 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet for (int me=0; me<=CSC_TYPES; me++) n_ch_alct_per_bx_cscdet[me][b]=0; } if (debugRATE) std::cout<< "----- statring nalct"< > me11alcts; for (CSCALCTDigiCollection::DigiRangeIterator adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); adetUnitIt++) { @@ -714,7 +711,7 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet for (CSCALCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) { if ((*digiIt).isValid()) - {o + { int bx = (*digiIt).getBX(); //if ( bx-6 < minBX_ || bx-6 > maxBX_ ) if ( bx < minBxALCT_ || bx > maxBxALCT_ ) @@ -724,7 +721,7 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet } // store all ME11 alcts together so we can look at them later - // take into acount that 10<=WG<=15 alcts are present in both 1a and 1b + // take into acstd::cout that 10<=WG<=15 alcts are present in both 1a and 1b if (csct==0) me11alcts[idd.rawId()].push_back(&(*digiIt)); if (csct==3 && (*digiIt).getKeyWG() < 10) { @@ -2135,56 +2132,32 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet void GEMCSCTriggerRate::bookALCTTree() { - edm::Service< TFileService > fs; - alct_tree_ = fs->make("ALCTs", "ALCTs"); - alct_tree_->Branch("event",&alct_.event); - alct_tree_->Branch("detId",&alct_.detId); - alct_tree_->Branch("pt",&alct_.pt); - alct_tree_->Branch("eta",&alct_.eta); - alct_tree_->Branch("phi",&alct_.phi); - alct_tree_->Branch("bx",&alct_.bx); +// edm::Service< TFileService > fs; +// alct_tree_ = fs->make("ALCTs", "ALCTs"); +// alct_tree_->Branch("charge",&alct_.nlayers); +// alct_tree_->Branch("pt",&alct_.pt); +// alct_tree_->Branch("eta",&alct_.eta); +// alct_tree_->Branch("phi",&alct_.phi); +// alct_tree_->Branch("endcap",&alct_.bx); + // alct_tree_->Branch("gem_sh_layer1",&alct_.); } // ================================================================================================ void GEMCSCTriggerRate::bookCLCTTree() { - edm::Service< TFileService > fs; - clct_tree_ = fs->make("CLCTs", "CLCTs"); - clct_tree_->Branch("event",&clct_.event); - clct_tree_->Branch("detId",&clct_.detId); - clct_tree_->Branch("pt",&clct_.pt); - clct_tree_->Branch("eta",&clct_.eta); - clct_tree_->Branch("phi",&clct_.phi); - clct_tree_->Branch("bx",&clct_.bx); } // ================================================================================================ void GEMCSCTriggerRate::bookLCTTree() { - // edm::Service< TFileService > fs; - // lct_tree_ = fs->make("LCTs", "LCTs"); - // lct_tree_->Branch("event",&lct_.event); - // lct_tree_->Branch("detId",&lct_.detId); - // lct_tree_->Branch("pt",&lct_.pt); - // lct_tree_->Branch("eta",&lct_.eta); - // lct_tree_->Branch("phi",&lct_.phi); - // lct_tree_->Branch("bx",&lct_.bx); } // ================================================================================================ void GEMCSCTriggerRate::bookMPCLCTTree() { - // edm::Service< TFileService > fs; - // mpclct_tree_ = fs->make("MPCLCTs", "MPCLCTs"); - // mpclct_tree_->Branch("event",&mpclct_.event); - // mpclct_tree_->Branch("detId",&mpclct_.detId); - // mpclct_tree_->Branch("pt",&mpclct_.pt); - // mpclct_tree_->Branch("eta",&mpclct_.eta); - // mpclct_tree_->Branch("phi",&mpclct_.phi); - // mpclct_tree_->Branch("bx",&mpclct_.bx); } // ================================================================================================ @@ -2215,261 +2188,30 @@ GEMCSCTriggerRate::bookGMTCandTree() void GEMCSCTriggerRate::analyzeALCTRate(const edm::Event& iEvent) { - edm::Handle< CSCALCTDigiCollection > halcts; - iEvent.getByLabel("simCscTriggerPrimitiveDigis", halcts); - const CSCALCTDigiCollection* alcts = halcts.product(); - - // start of the ntuplization - /* - // Loop on all ALCTs - for (auto& adetUnitIt : alcts); - { - CSCDetId detId((*adetUnitIt).first); - if (detId.endcap() != 1) continue; - auto range = (*adetUnitIt).second; - // loop on all ALCTs in that detId - for (auto digiIt& : range) - { - const int bx((*digiIt).getBX()); - if (bx < minBxALCT_ || bx > maxBxALCT_) - { - if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill(); - } - */ } // ================================================================================================ void GEMCSCTriggerRate::analyzeCLCTRate(const edm::Event& iEvent) { - edm::Handle< CSCCLCTDigiCollection > hclcts; - iEvent.getByLabel("simCscTriggerPrimitiveDigis", hclcts); - const CSCCLCTDigiCollection* clcts = hclcts.product(); - - /* - // Loop on all CLCTs - for (auto& adetUnitIt : clcts); - { - CSCDetId detId((*adetUnitIt).first); - if (detId.endcap() != 1) continue; - auto range = (*adetUnitIt).second; - // loop on all CLCTs in that detId - for (auto digiIt& : range) - { - const int bx((*digiIt).getBX()); - if (bx < minBxCLCT_ || bx > maxBxCLCT_) - { - if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill(); - } - */ } // ================================================================================================ void GEMCSCTriggerRate::analyzeLCTRate(const edm::Event& iEvent) { - /* - edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_tmb; - iEvent.getByLabel("simCscTriggerPrimitiveDigis", lcts_tmb); - const CSCCorrelatedLCTDigiCollection* lcts = lcts_tmb.product(); - - for (auto& detUnitIt : lcts); - { - CSCDetId detId((*adetUnitIt).first); - if (detId.endcap() != 1) continue; - auto range = (*adetUnitIt).second; - // loop on all CLCTs in that detId - for (auto digiIt& : range) - { - const int bx((*digiIt).getBX()); - if (bx < minBxLCT_ || bx > maxBxLCT_) - { - if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill(); - } - */ } // ================================================================================================ void GEMCSCTriggerRate::analyzeMPCLCTRate(const edm::Event& iEvent) { - /* - edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_mpc; - iEvent.getByLabel("simCscTriggerPrimitiveDigis", "MPCSORTED", lcts_mpc); - const CSCCorrelatedLCTDigiCollection* mpclcts = lcts_mpc.product(); - - for (auto& detUnitIt : mpclcts); - { - CSCDetId detId((*adetUnitIt).first); - if (detId.endcap() != 1) continue; - auto range = (*adetUnitIt).second; - // loop on all CMpclcts in that detId - for (auto digiIt& : range) - { - const int bx((*digiIt).getBX()); - if (bx < minBxMPCLCT_ || bx > maxBxMPCLCT_) - { - if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <getRegionalEtaScale(2)->getCenter(gblEta.global_eta); - // //float phi_lut = normalizedPhi( muScales->getPhiScale()->getLowEdge(gblPhi.global_phi)); - // csctf::TrackStub stub = buildTrackStub((*digiIt), id); - // float eta_lut = stub.etaValue(); - // float phi_lut = stub.phiValue(); - // std::cout<<"DBGSRLUT "<Fill(); - } - } -*/ } // ================================================================================================ void GEMCSCTriggerRate::analyzeTFTrackRate(const edm::Event& iEvent) { - // tracks produced by TF - edm::Handle< L1CSCTrackCollection > hl1Tracks; - iEvent.getByLabel("simCsctfTrackDigis",hl1Tracks); - const L1CSCTrackCollection* l1Tracks = hl1Tracks.product(); - - for (auto& trk : l1Tracks) - { - const int bx(trk->first.bx()); - if ( bx < minRateBX_ || bx > maxRateBX_ ) - { - if (debugRATE) std::cout<<"discarding BX = "<< bx <Fill(myTFTrk.pt); - // h_rt_tftrack_bx->Fill(); - - } - - - // MatchCSCMuL1::TFTRACK myTFTrk; - // myTFTrk.init( &(trk->first) , ptLUT, muScales, muPtScale); - // myTFTrk.dr = 999.; - - // for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator detUnitIt = trk->second.begin(); - // detUnitIt != trk->second.end(); detUnitIt++) - // { - // const CSCDetId& id = (*detUnitIt).first; - // CSCDetId cid = id; - // const CSCCorrelatedLCTDigiCollection::Range& range = (*detUnitIt).second; - // for (CSCCorrelatedLCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) - // { - // if (!((*digiIt).isValid())) std::cout<<"ALARM!!! match TFCAND to TFTRACK in rates: not valid id="< 127); - // if (me1a_case){ - // CSCDetId id1a(id.endcap(),id.station(),4,id.chamber(),0); - // cid = id1a; - // } - // //if (id.station()==1 && id.ring()==4) std::cout<<"me1adigi check: "<<(*digiIt)<<" "<= 20. && myTFTrk.hasStub(1) && myTFTrk.hasStub(2)){ - // int i1=-1, i2=-1, k=0; - // for (auto id: myTFTrk.trgids) - // { - // if (id.station()==1) i1 = k; - // if (id.station()==2) i2 = k; - // ++k; - // } - // if (i1>=0 && i2 >=0 ) { - // auto etaphi1 = myTFTrk.trgetaphis[i1]; - // auto etaphi2 = myTFTrk.trgetaphis[i2]; - // auto d = myTFTrk.trgids[i1]; - // auto &stub = *(myTFTrk.trgdigis[i1]); - // std::cout<<"DBGdeta12 "< 0.1) { - // myTFTrk.print(""); - // std::cout<<"############### CSCTFSPCoreLogic printout for large deta12 = "<Fill(myTFTrk.mode()); - // } } // ================================================================================================ diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.h b/SimMuL1/plugins/GEMCSCTriggerRate.h index 673c849925ef3..2f08e622ad664 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.h +++ b/SimMuL1/plugins/GEMCSCTriggerRate.h @@ -104,7 +104,7 @@ struct MyTFCand Char_t hasGEM; }; -struct MyGMTRegional +struct MyGMTReg { Int_t event, bx; Float_t pt, eta, phi; From c018d385114e408a2303d8a0103fa8496d2f87eb Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 16 Sep 2013 00:41:48 +0200 Subject: [PATCH 108/182] deleting GEMGeometryTools --- GEMGeometryTools/python/ge11Dimensions.py | 47 --- .../python/gemAlgorithmSection.xml | 209 ------------- .../python/gemMaterialSection.xml | 43 --- GEMGeometryTools/python/gemPosPartSection.xml | 291 ------------------ GEMGeometryTools/python/gemXMLproducer.py | 212 ------------- 5 files changed, 802 deletions(-) delete mode 100644 GEMGeometryTools/python/ge11Dimensions.py delete mode 100644 GEMGeometryTools/python/gemAlgorithmSection.xml delete mode 100644 GEMGeometryTools/python/gemMaterialSection.xml delete mode 100644 GEMGeometryTools/python/gemPosPartSection.xml delete mode 100644 GEMGeometryTools/python/gemXMLproducer.py diff --git a/GEMGeometryTools/python/ge11Dimensions.py b/GEMGeometryTools/python/ge11Dimensions.py deleted file mode 100644 index b587917416e51..0000000000000 --- a/GEMGeometryTools/python/ge11Dimensions.py +++ /dev/null @@ -1,47 +0,0 @@ -# configuration file to produce GEM XML geometries - -## number of eta partitions -dzEta = [7.630,7.630,6.188,6.188,5.190,5.190,5.056,5.056] -nEta = len(dzEta) -etaDim = "cm" - -## gap half width -dzGap = 0.2500 -dzGapDim = "cm" -nGap = nEta - 1 - -dzIn = sum(dzEta) + nGap * dzGap - -## bottom half width -dxBot = 12.513 -dxBotDim = "cm" - -## top half width -dxTop = 20.997 -dxTopDim = "cm" - -## slope [cm] -slope = (dxTop - dxBot) / (2.*dzIn) - -## distance of centre of chamber to bottom -dzTot = 50.820 -dzTotDim = "cm" - -# distance from beam-line [cm] -dBeamLine = 1338 -dBeamLineDim = "mm" -rPos = dBeamLine + dzTot - -##GE1/1 -rMin = 1.3 -rMinDim = "m" -rMax = 2.51 -rMaxDim = "m" -dz = 4.5 -dzDim = "cm" - -## gas -ga_dy = [1.050,0.500,1.600] -ga_dy_dim = "mm" -ga_dx = 0.5 -ga_dx_dim = "mm" diff --git a/GEMGeometryTools/python/gemAlgorithmSection.xml b/GEMGeometryTools/python/gemAlgorithmSection.xml deleted file mode 100644 index a7447901093ed..0000000000000 --- a/GEMGeometryTools/python/gemAlgorithmSection.xml +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/GEMGeometryTools/python/gemMaterialSection.xml b/GEMGeometryTools/python/gemMaterialSection.xml deleted file mode 100644 index 7457f02bde8a5..0000000000000 --- a/GEMGeometryTools/python/gemMaterialSection.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/GEMGeometryTools/python/gemPosPartSection.xml b/GEMGeometryTools/python/gemPosPartSection.xml deleted file mode 100644 index 5e0106fbe5ef2..0000000000000 --- a/GEMGeometryTools/python/gemPosPartSection.xml +++ /dev/null @@ -1,291 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/GEMGeometryTools/python/gemXMLproducer.py b/GEMGeometryTools/python/gemXMLproducer.py deleted file mode 100644 index 9e03991b6210e..0000000000000 --- a/GEMGeometryTools/python/gemXMLproducer.py +++ /dev/null @@ -1,212 +0,0 @@ -import sys -from ge11Dimensions import * - -def writeHeader(): - """Print the XML file header""" - print '' - print '' - - -def writeConstantsSection(): - """Print the section containing chamber dimensions""" - - print - print '' - print ' '%(dzTot,dzTotDim) - print ' '%(dBeamLine,dBeamLineDim) - for i in range(1,nEta+1): - print ' '%(i,dzEta[i-1],etaDim) - - ## print gap - print ' '%(dzGap,dzGapDim) - - print ' '%(nGap) - - print ' ' - for i in range(2,nEta+1): - print ' '%(i,i-1,i-1,i) - - print ' '%(dxBot,dxBotDim) - print ' '%(dxTop,dxTopDim) - print ' ' - - ## assignment of the z values - z = [0]*nEta - z[0] = dzIn - dzEta[0] - for i in range(1,nEta): - z[i] = z[i-1] - dzEta[i-1] - 2*dzGap - dzEta[i] - - a= sum(dzEta) + nGap * dzGap - print dzTot, dzIn, a - - ## assignment of the dx values - for i in range(1,nEta+1): - for j in range(1,3): - if j%2: - sign = "+" - else: - sign = "-" - - print ' ' - - -def writeMaterialSection(): - """Write the materials section""" - - f = open("gemMaterialSection.xml",'r') - print f.read() - f.close() - -def writeSolidSection(): - """Write the solid component section""" - - print '' - print ' '%(rMin,rMinDim,rMax,rMaxDim, dz, dzDim) - print """ - - - - - - - - - - """ - print - - ## gem gas - gas_layers = ['F','G','H'] - for g in range(len(gas_layers)): - gas = gas_layers[g] - ga_dy1 = ga_dy[g] - for i in range(1,nEta+1): - print ' '%( - gas,i,i,ga_dy1,ga_dy_dim,ga_dy1,ga_dy_dim,i,i) - print - - - ## spacers - spacers = ['C','D','E'] - for sp in range(len(spacers)): - spac = spacers[sp] - ga_dy1 = ga_dy[sp] - for i in range(1,nEta+1): - print ' '%( - spac,i,i,ga_dy1,ga_dy_dim,ga_dx,ga_dx_dim) - print - - print '' - -def writeLogicalPartSection(): - """Write the logical part section""" - print """ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -""" - ## gem gas - gas_layers = ['F','G','H'] - for g in range(len(gas_layers)): - gas = gas_layers[g] - for i in range(1,nEta+1): - print """ - - - """%(gas,i,gas,i) - - ## spacers - spacers = ['D','E','E'] - for sp in spacers: - for i in range(1,nEta+1): - print """ - - - """%(sp,i,sp,i) - - print '' - -def writePosPartSection(): - """Write the positional part section""" - - f = open("gemPosPartSection.xml",'r') - print f.read() - f.close() - -def writeAlgorithmSection(): - """Write the algorithm section""" - - f = open("gemAlgorithmSection.xml",'r') - print f.read() - f.close() - - -def gemXMLproducer(): - """Produce the entire XML file""" - - writeHeader() - writeConstantsSection() - writeMaterialSection() - writeSolidSection() - writeLogicalPartSection() - writePosPartSection() - writeAlgorithmSection() - -if __name__ == "__main__": - gemXMLproducer() From 0275c495cb0acdff836873dbfc0298e0c9cd8d39 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 16 Sep 2013 00:44:08 +0200 Subject: [PATCH 109/182] delete obsolete files --- SimMuL1/plugins/NeutronSimHitAnalyzer.cc.txt | 933 ------------------ .../python/NeutronSimHitAnalyzer_cfi.py.txt | 52 - .../test/runNeutronSimHitAnalyzer_cfg.py.txt | 34 - 3 files changed, 1019 deletions(-) delete mode 100644 SimMuL1/plugins/NeutronSimHitAnalyzer.cc.txt delete mode 100644 SimMuL1/python/NeutronSimHitAnalyzer_cfi.py.txt delete mode 100644 SimMuL1/test/runNeutronSimHitAnalyzer_cfg.py.txt diff --git a/SimMuL1/plugins/NeutronSimHitAnalyzer.cc.txt b/SimMuL1/plugins/NeutronSimHitAnalyzer.cc.txt deleted file mode 100644 index c4f5a3968d248..0000000000000 --- a/SimMuL1/plugins/NeutronSimHitAnalyzer.cc.txt +++ /dev/null @@ -1,933 +0,0 @@ -// system include files -#include -#include -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" - -#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" - -#include "Geometry/Records/interface/MuonGeometryRecord.h" -#include "Geometry/CSCGeometry/interface/CSCGeometry.h" -#include "Geometry/RPCGeometry/interface/RPCGeometry.h" -#include "Geometry/DTGeometry/interface/DTGeometry.h" -#include "Geometry/GEMGeometry/interface/GEMGeometry.h" - -#include "DataFormats/MuonDetId/interface/CSCDetId.h" -#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h" -#include "L1Trigger/CSCCommonTrigger/interface/CSCTriggerGeometry.h" - -#include "DataFormats/MuonDetId/interface/RPCDetId.h" -#include "DataFormats/MuonDetId/interface/GEMDetId.h" - -#include "TH1.h" -#include "TH2.h" -#include "TTree.h" -#include "TString.h" - -#include "GEMCode/SimMuL1/interface/PSimHitMapCSC.h" - -// -// class declaration -// - -struct MyCSCDetId -{ - void init(CSCDetId &id); - Int_t e, s, r, c, l; - Int_t t; // type 1-10: ME1/a,1/b,1/2,1/3,2/1...4/2 -}; - -struct MyCSCSimHit -{ - void init(PSimHit &sh, const CSCGeometry* csc_g); - Float_t x, y, z; // local - Float_t r, eta, phi, gz; // global - Float_t e; // energy deposit - Float_t t; // TOF - Int_t pdg; // PDG - Int_t w, s; // WG & Strip -}; - -struct MyCSCLayer -{ - void init(int l, std::vector &shits); - std::vector hits; - Int_t ln; // layer # - Int_t nh; // # of hits - Float_t mint, maxt; // min/max TOF - Float_t meant, sigmat;// mean&stdev of TOF - Int_t minw, maxw, mins, maxs; // min/max WG & Strip -}; - -struct MyCSCChamber -{ - void init(std::vector &slayers); - Int_t nh; // nhits - Int_t nl, l1, ln; // nlayers, 1st and last layer # - Float_t mint, maxt; // min/max TOF - Float_t meant, sigmat;// mean&stdev of TOF - Int_t minw, maxw, mins, maxs; // min/max WG & Strip -}; - -struct MyCSCEvent -{ - void init(std::vector &schambers); - Int_t nh; // nhits - Int_t nch; // nchambers -}; - - -struct MyRPCDetId -{ - void init(RPCDetId &id); - Int_t reg, ring, st, sec, layer, subsec, roll; - Int_t t; // type 1-8: RE1/2,1/3,2/2,2/3,3/2,3/3,4/2,4/3 -}; - -struct MyRPCSimHit -{ - void init(const PSimHit &sh, const RPCGeometry* rpc_g); - Float_t x, y, z; // local - Float_t r, eta, phi, gz; // global - Float_t e; // energy deposit - Float_t t; // TOF - Int_t pdg; // PDG - //Int_t w, s; // WG & Strip -}; - -struct MyGEMDetId -{ - void init(GEMDetId &id); - Int_t region, ring, station, layer, chamber, roll; - Int_t t; // GE1/1 -}; - -struct MyGEMSimHit -{ - void init(const PSimHit &sh, const GEMGeometry* gem_g); - Float_t l_x, l_y, l_z; // local - Float_t g_r, g_eta, g_phi, g_z; // global - Float_t energy; // energy deposit - Float_t tof; // TOF - Int_t pdg; // PDG - Int_t strip; -}; - - -class NeutronSimHitAnalyzer : public edm::EDAnalyzer -{ -public: - - typedef std::vector vstring; - typedef std::vector vdouble; - typedef std::vector vint; - - explicit NeutronSimHitAnalyzer(const edm::ParameterSet&); - ~NeutronSimHitAnalyzer(); - - virtual void beginRun(const edm::Run &, const edm::EventSetup &); - virtual void beginJob(); - virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual void endJob(); - -private: - - // configuration parameters: - edm::InputTag defaultInputTagCSC_; - edm::InputTag defaultInputTagGEM_; - edm::InputTag defaultInputTagRPC_; - edm::InputTag defaultInputTagDT_; - edm::InputTag inputTagCSC_; - edm::InputTag inputTagGEM_; - edm::InputTag inputTagRPC_; - edm::InputTag inputTagDT_; - - // misc utilities - const CSCGeometry* csc_geometry; - const DTGeometry* dt_geometry; - const RPCGeometry* rpc_geometry; - const GEMGeometry* gem_geometry; - - // some counters: - int evtn; - int csc_shn; - int rpc_shn; - int gem_shn; - int nevt_with_cscsh, nevt_with_cscsh_in_rpc; - int n_cscsh, n_cscsh_in_rpc; - int nevt_with_rpcsh, nevt_with_rpcsh_e, nevt_with_rpcsh_b; - int n_rpcsh, n_rpcsh_e, n_rpcsh_b; - int nevt_with_gemsh; - int n_gemsh; - - // some histos: - TH2D* h_csc_rz_sh_xray; - TH1D* h_csc_nlayers_in_ch[11]; - TH1D* h_csc_nevt_fraction_with_sh; - TH1D* h_csc_shflux_per_layer; - TH1D* h_rpcf_nevt_fraction_with_sh; - TH1D* h_rpcf_shflux_per_layer; - TH1D* h_rpcb_nevt_fraction_with_sh; - TH1D* h_gem_nevt_fraction_with_sh; - TH1D* h_gem_shflux_per_layer; - TH2D* h_csc_rz_sh_heatmap; - TH2D* h_rpc_rz_sh_heatmap; - TH2D* h_gem_rz_sh_heatmap; - TH2D* h_mu_rz_sh_heatmap; - - // quantities for rate calculation - int pu_; - double fractionEmptyBX_; - int bxRate_; - - // Muon detector types (long and short) - int maxCSCStations_; - int nCSCTypes_; - int maxDTStations_; - int nDTTypes_; - int maxRPCfStations_; - int nRPCfTypes_; - int maxRPCbStations_; - int nRPCbTypes_; - int maxGEMStations_; - int nGEMTypes_; - - vstring cscTypesLong_; - vstring cscTypesShort_; - vstring dtTypesLong_; - vstring dtTypesShort_; - vstring rpcfTypesLong_; - vstring rpcfTypesShort_; - vstring rpcbTypesLong_; - vstring rpcbTypesShort_; - vstring gemTypesLong_; - vstring gemTypesShort_; - - SimHitAnalysis::PSimHitMapCSC simhit_map_csc; - bool inputIsNeutrons_; - - // chamber sizes and segmentation - vdouble cscAreascm2_; - vdouble rpcfAreascm2_; - vdouble gemAreascm2_; - vint cscRadialSegmentation_; - vint rpcfRadialSegmentation_; - vint gemRadialSegmentation_; - - // layers - int nRPCLayers_; - int nGEMLayers_; - int nCSCLayers_; - - // ntuples: - void bookCSCChambersTree(); - void bookCSCLayersTree(); - void bookCSCSimHitsTree(); - void bookRPCSimHitsTree(); - void bookGEMSimHitsTree(); - - TTree* csc_ch_tree; - TTree* csc_la_tree; - TTree* csc_sh_tree; - TTree* rpc_sh_tree; - TTree* gem_sh_tree; - - MyCSCDetId c_id; - MyCSCDetId c_cid; - MyCSCSimHit c_h; - MyCSCLayer c_la; - MyCSCChamber c_ch; - MyRPCDetId r_id; - MyRPCSimHit r_h; - MyGEMDetId g_id; - MyGEMSimHit g_h; -}; - -// ================================================================================================ -NeutronSimHitAnalyzer::NeutronSimHitAnalyzer(const edm::ParameterSet& iConfig): - defaultInputTagCSC_(iConfig.getParameter("defaultInputTagCSC")), - defaultInputTagGEM_(iConfig.getParameter("defaultInputTagCSC")), - defaultInputTagRPC_(iConfig.getParameter("defaultInputTagCSC")), - defaultInputTagDT_(iConfig.getParameter("defaultInputTagCSC")), - inputTagCSC_(iConfig.getParameter("inputTagCSC")), - inputTagGEM_(iConfig.getParameter("inputTagGEM")), - inputTagRPC_(iConfig.getParameter("inputTagRPC")), - inputTagDT_(iConfig.getParameter("inputTagDT")), - pu_(iConfig.getParameter("pu")), - fractionEmptyBX_(iConfig.getParameter("fractionEmptyBX")), - bxRate_(iConfig.getParameter( "bxRate")), - maxCSCStations_(iConfig.getParameter("maxCSCStations")), - nCSCTypes_(iConfig.getParameter("nCSCTypes")), - maxDTStations_(iConfig.getParameter("maxDTStations")), - nDTTypes_(iConfig.getParameter("nDTTypes")), - maxRPCfStations_(iConfig.getParameter("maxRPCfStations")), - nRPCfTypes_(iConfig.getParameter("nRPCfTypes")), - maxRPCbStations_(iConfig.getParameter("maxRPCbStations")), - nRPCbTypes_(iConfig.getParameter("nRPCbTypes")), - maxGEMStations_(iConfig.getParameter("maxGEMStations")), - nGEMTypes_(iConfig.getParameter("nGEMTypes")), - cscTypesLong_(iConfig.getParameter("cscTypesLong")), - cscTypesShort_(iConfig.getParameter("cscTypesShort")), - dtTypesLong_(iConfig.getParameter("dtTypesLong")), - dtTypesShort_(iConfig.getParameter("dtTypesShort")), - rpcfTypesLong_(iConfig.getParameter("rpcfTypesLong")), - rpcfTypesShort_(iConfig.getParameter("rpcfTypesShort")), - rpcbTypesLong_(iConfig.getParameter("rpcbTypesLong")), - rpcbTypesShort_(iConfig.getParameter("rpcbTypesShort")), - gemTypesLong_(iConfig.getParameter("gemTypesLong")), - gemTypesShort_(iConfig.getParameter("gemTypesLong")), - simhit_map_csc(), - // should be set to false if running over a regular MB sample - inputIsNeutrons_(iConfig.getParameter("inputIsNeutrons")), - //chambers sizes - cscAreascm2_(iConfig.getParameter("cscAreascm2")), - rpcfAreascm2_(iConfig.getParameter("rpfcAreascm2")), - gemAreascm2_(iConfig.getParameter("gemAreascm2")), - cscRadialSegmentation_(iConfig.getParameter("cscRadialSegmentation")), - rpcfRadialSegmentation_(iConfig.getParameter("rpcfRadialSegmentation")), - gemRadialSegmentation_(iConfig.getParameter("gemRadialSegmentation")), - nRPCLayers_(iConfig.getParameter("nRPCLayers")), - nGEMLayers_(iConfig.getParameter("nGEMLayers")), - nCSCLayers_(iConfig.getParameter("nCSCLayers")) -{ - bookCSCSimHitsTree(); - bookCSCLayersTree(); - bookCSCChambersTree(); - bookRPCSimHitsTree(); - bookGEMSimHitsTree(); - - if (inputIsNeutrons_) - { - inputTagCSC_ = defaultInputTagCSC_; - inputTagGEM_ = defaultInputTagGEM_; - inputTagRPC_ = defaultInputTagRPC_; - inputTagDT_ = defaultInputTagDT_; - } - - simhit_map_csc.setInputTag(inputTagCSC_); - nevt_with_cscsh = nevt_with_cscsh_in_rpc = n_cscsh = n_cscsh_in_rpc = 0; - nevt_with_rpcsh = nevt_with_rpcsh_e = nevt_with_rpcsh_b = n_rpcsh = n_rpcsh_e = n_rpcsh_b = 0; - - edm::Service fs; - - const TString n_simhits(inputIsNeutrons_? "n-SimHits" : "SimHits"); - - // Heat map - h_csc_rz_sh_xray = fs->make("h_csc_rz_sh_xray","CSC "+n_simhits+" #rho-z X-ray;z, cm;#rho, cm",2060,550,1080,750,0,750); - h_csc_rz_sh_heatmap = fs->make("h_csc_rz_sh_heatmap","CSC "+n_simhits+" #rho-z;z, cm;#rho, cm",230,550,1080,150,0,750); - h_rpc_rz_sh_heatmap = fs->make("h_rpc_rz_sh_heatmap","RPC "+n_simhits+" #rho-z;z, cm;#rho, cm",450,0,1080,160,0,800); - h_gem_rz_sh_heatmap = fs->make("h_gem_rz_sh_heatmap","GEM "+n_simhits+" #rho-z;z, cm;#rho, cm",450,0,1080,160,0,800); - h_mu_rz_sh_heatmap = fs->make("h_mu_rz_sh_heatmap", n_simhits+" #rho-z;z, cm;#rho, cm",480,0,1100,160,0,800); - - - // CSC - char label[200], nlabel[200]; - for (int me=0; me<=nCSCTypes_; me++) - { - sprintf(label,"h_csc_nlayers_in_ch_%s",cscTypesShort_.at(me).c_str()); - sprintf(nlabel,"# of layers with %s: %s CSC;# layers", n_simhits.Data(), cscTypesLong_.at(me).c_str()); - h_csc_nlayers_in_ch[me] = fs->make(label, nlabel, 6, 0.5, 6.5); - } - h_csc_nevt_fraction_with_sh = - fs->make("h_csc_nevt_fraction_with_sh", "Fraction of events with "+n_simhits+" by CSC type", nCSCTypes_+1, -0.5, nCSCTypes_+0.5); - for (int i=1; i<=h_csc_nevt_fraction_with_sh->GetXaxis()->GetNbins();i++) - h_csc_nevt_fraction_with_sh->GetXaxis()->SetBinLabel(i,cscTypesLong_.at(i-1).c_str()); - - h_csc_shflux_per_layer = fs->make("h_csc_shflux_per_layer", n_simhits+" Flux per CSC layer at L=10^{34};;Hz/cm^{2}", nCSCTypes_, 0.5, nCSCTypes_+0.5); - for (int i=1; i<=h_csc_shflux_per_layer->GetXaxis()->GetNbins();i++) - h_csc_shflux_per_layer->GetXaxis()->SetBinLabel(i,cscTypesLong_.at(i).c_str()); - - // RPC - h_rpcf_nevt_fraction_with_sh = - fs->make("h_rpcf_nevt_fraction_with_sh", "Fraction of events with "+n_simhits+" by RPCf type", nRPCfTypes_+1, -0.5, nRPCfTypes_+0.5); - for (int i=1; i<=h_rpcf_nevt_fraction_with_sh->GetXaxis()->GetNbins();i++) - h_rpcf_nevt_fraction_with_sh->GetXaxis()->SetBinLabel(i,rpcfTypesLong_.at(i-1).c_str()); - - h_rpcf_shflux_per_layer = fs->make("h_rpcf_shflux_per_layer", n_simhits+" Flux in RPCf at L=10^{34};;Hz/cm^{2}", nRPCfTypes_, 0.5, nRPCfTypes_+0.5); - for (int i=1; i<=h_rpcf_shflux_per_layer->GetXaxis()->GetNbins();i++) - h_rpcf_shflux_per_layer->GetXaxis()->SetBinLabel(i,rpcfTypesLong_.at(i).c_str()); - - h_rpcb_nevt_fraction_with_sh = - fs->make("h_rpcb_nevt_fraction_with_sh", "Fraction of events with "+n_simhits+" by RPCb type", nRPCbTypes_+1, -0.5, nRPCbTypes_+0.5); - for (int i=1; i<=h_rpcb_nevt_fraction_with_sh->GetXaxis()->GetNbins();i++) - h_rpcb_nevt_fraction_with_sh->GetXaxis()->SetBinLabel(i,rpcbTypesLong_.at(i-1).c_str()); - - // GEM - h_gem_nevt_fraction_with_sh = - fs->make("h_gem_nevt_fraction_with_sh", "Fraction of events with "+n_simhits+" by GEM type", nGEMTypes_+1, -0.5, nGEMTypes_+0.5); - for (int i=1; i<=h_gem_nevt_fraction_with_sh->GetXaxis()->GetNbins();i++) - h_gem_nevt_fraction_with_sh->GetXaxis()->SetBinLabel(i,gemTypesLong_.at(i-1).c_str()); - - h_gem_shflux_per_layer = fs->make("h_gem_shflux_per_layer", n_simhits+" Flux per GEM layer at L=10^{34};;Hz/cm^{2}", nGEMTypes_, 0.5, nGEMTypes_+0.5); - for (int i=1; i<=h_gem_shflux_per_layer->GetXaxis()->GetNbins();i++) - h_gem_shflux_per_layer->GetXaxis()->SetBinLabel(i,gemTypesLong_.at(i).c_str()); -} - -// ================================================================================================ -NeutronSimHitAnalyzer::~NeutronSimHitAnalyzer() -{} - - -// ================================================================================================ -void -NeutronSimHitAnalyzer::bookCSCSimHitsTree() -{ - edm::Service fs; - csc_sh_tree = fs->make("CSCSimHitsTree", "CSCSimHitsTree"); - csc_sh_tree->Branch("evtn", &evtn); - csc_sh_tree->Branch("shn", &csc_shn); - csc_sh_tree->Branch("id", &c_id.e,"e/I:s:r:c:l:t"); - csc_sh_tree->Branch("sh", &c_h.x,"x/F:y:z:r:eta:phi:gz:e:t:pdg/I:w:s"); -} - - -// ================================================================================================ -void -NeutronSimHitAnalyzer::bookCSCLayersTree() -{ - edm::Service fs; - csc_la_tree = fs->make("CSCLayersTree", "CSCLayersTree"); - csc_la_tree->Branch("evtn", &evtn,"evtn/i"); - csc_la_tree->Branch("id", &c_id.e,"e/I:s:r:c:l:t"); - csc_la_tree->Branch("la", &c_la.ln,"ln/I:nh:mint/F:maxt:meant:sigmat:minw/I:maxw:mins:maxs"); -} - - -// ================================================================================================ -void -NeutronSimHitAnalyzer::bookCSCChambersTree() -{ - edm::Service fs; - csc_ch_tree = fs->make("CSCChambersTree", "CSCChambersTree"); - csc_ch_tree->Branch("evtn", &evtn,"evtn/i"); - csc_ch_tree->Branch("id", &c_cid.e,"e/I:s:r:c:l:t"); - csc_ch_tree->Branch("ch", &c_ch.nh,"nh/I:nl:l1:ln:mint/F:maxt:meant:sigmat:minw/I:maxw:mins:maxs"); -} - - -// ================================================================================================ -void -NeutronSimHitAnalyzer::bookRPCSimHitsTree() -{ - edm::Service fs; - rpc_sh_tree = fs->make("RPCSimHitsTree", "RPCSimHitsTree"); - rpc_sh_tree->Branch("evtn", &evtn,"evtn/i"); - rpc_sh_tree->Branch("shn", &rpc_shn,"shn/i"); - rpc_sh_tree->Branch("id", &r_id.reg,"reg/I:ring:st:sec:layer:subsec:roll:t"); - rpc_sh_tree->Branch("sh", &r_h.x,"x/F:y:z:r:eta:phi:gz:e:t:pdg/I"); -} - - -// ================================================================================================ -void -NeutronSimHitAnalyzer::bookGEMSimHitsTree() -{ - edm::Service fs; - gem_sh_tree = fs->make("GEMSimHitsTree", "GEMSimHitsTree"); - gem_sh_tree->Branch("evtn", &evtn,"evtn/i"); - gem_sh_tree->Branch("shn", &gem_shn,"shn/i"); - gem_sh_tree->Branch("region", &g_id.region); - gem_sh_tree->Branch("ring", &g_id.ring); - gem_sh_tree->Branch("station", &g_id.station); - gem_sh_tree->Branch("layer", &g_id.layer); - gem_sh_tree->Branch("chamber", &g_id.chamber); - gem_sh_tree->Branch("roll", &g_id.roll); - gem_sh_tree->Branch("l_x", &g_h.l_x); - gem_sh_tree->Branch("l_y", &g_h.l_y); - gem_sh_tree->Branch("l_z", &g_h.g_z); - gem_sh_tree->Branch("g_r", &g_h.g_r); - gem_sh_tree->Branch("g_eta", &g_h.g_eta); - gem_sh_tree->Branch("g_phi", &g_h.g_phi); - gem_sh_tree->Branch("g_z", &g_h.g_z); - gem_sh_tree->Branch("energyLoss", &g_h.energy); - gem_sh_tree->Branch("timeOfFlight", &g_h.tof); - gem_sh_tree->Branch("particleType", &g_h.pdg); - gem_sh_tree->Branch("strip", &g_h.strip); -} - - -// ================================================================================================ -void -MyCSCDetId::init(CSCDetId &id) -{ - e = id.endcap(); - s = id.station(); - r = id.ring(); - c = id.chamber(); - l = id.layer(); - t = id.iChamberType(); -} - - -// ================================================================================================ -void -MyCSCSimHit::init(PSimHit &sh, const CSCGeometry* csc_g) -{ - const LocalPoint hitLP(sh.localPosition()); - - x = hitLP.x(); - y = hitLP.y(); - z = hitLP.z(); - e = sh.energyLoss(); - t = sh.tof(); - pdg = sh.particleType(); - - const CSCDetId layerId(sh.detUnitId()); - const CSCLayer* csclayer(csc_g->layer(layerId)); - const GlobalPoint hitGP(csclayer->toGlobal(hitLP)); - - r = hitGP.perp(); - eta = hitGP.eta(); - phi = hitGP.phi(); - gz = hitGP.z(); - - w = csclayer->geometry()->wireGroup(csclayer->geometry()->nearestWire(hitLP)); - s = csclayer->geometry()->nearestStrip(hitLP); -} - - -// ================================================================================================ -void -MyCSCLayer::init(int l, std::vector &shits) -{ - hits = shits; - ln = l; - nh = hits.size(); - mint = 1000.; - maxt = -1.; - meant = 0; - sigmat = 0; - minw = 1000.; - maxw = -1; - mins = 1000; - maxs = -1; - if (nh==0) return; - for (std::vector::const_iterator itr = hits.begin(); itr != hits.end(); itr++) - { - const MyCSCSimHit sh(*itr); - if (sh.t < mint) mint = sh.t; - if (sh.t > maxt) maxt = sh.t; - if (sh.w < minw) minw = sh.w; - if (sh.w > maxw) maxw = sh.w; - if (sh.s < mins) mins = sh.s; - if (sh.s > maxs) maxs = sh.s; - meant += sh.t; - sigmat += sh.t*sh.t; - } - meant = meant/nh; - sigmat = sqrt( sigmat/nh - meant*meant); -} - - -// ================================================================================================ -void -MyCSCChamber::init(std::vector &slayers) -{ - nh = 0; - nl = slayers.size(); - mint = 1000.; - maxt = -1.; - meant = 0; - sigmat = 0; - minw = 1000.; - maxw = -1; - mins = 1000; - maxs = -1; - if (nl==0) return; - l1 = slayers[0].ln; - ln = slayers[nl-1].ln; - for (std::vector::const_iterator sl = slayers.begin(); sl != slayers.end(); sl++) - { - nh += sl->hits.size(); - for (std::vector::const_iterator itr = sl->hits.begin(); itr != sl->hits.end(); itr++) - { - const MyCSCSimHit sh(*itr); - if (sh.t < mint) mint = sh.t; - if (sh.t > maxt) maxt = sh.t; - if (sh.w < minw) minw = sh.w; - if (sh.w > maxw) maxw = sh.w; - if (sh.s < mins) mins = sh.s; - if (sh.s > maxs) maxs = sh.s; - meant += sh.t; - sigmat += sh.t*sh.t; - } - } - meant = meant/nh; - sigmat = sqrt( sigmat/nh - meant*meant); -} - - -// ================================================================================================ -void -MyCSCEvent::init(std::vector &schambers) -{ - nh = 0; - nch = 0; -} - - -// ================================================================================================ -void -MyRPCDetId::init(RPCDetId &id) -{ - reg = id.region(); - ring = id.ring(); - st = id.station(); - sec = id.sector(); - layer = id.layer(); - subsec = id.subsector(); - roll = id.roll(); - if (reg!=0) t = st*2 + ring - 3; // endcap - else t = st*3 + abs(ring) - 2; -} - - -// ================================================================================================ -void -MyRPCSimHit::init(const PSimHit &sh, const RPCGeometry* rpc_g) -{ - const LocalPoint hitLP(sh.localPosition()); - - x = hitLP.x(); - y = hitLP.y(); - z = hitLP.z(); - e = sh.energyLoss(); - t = sh.tof(); - pdg = sh.particleType(); - - const GlobalPoint hitGP(rpc_g->idToDet(DetId(sh.detUnitId()))->surface().toGlobal(hitLP)); - - r = hitGP.perp(); - eta = hitGP.eta(); - phi = hitGP.phi(); - gz = hitGP.z(); -} - -// ================================================================================================ -void -MyGEMDetId::init(GEMDetId &id) -{ - region = id.region(); - ring = id.ring(); - station = id.station(); - layer = id.layer(); - chamber = id.chamber(); - roll = id.roll(); - t = 1; -} - -// ================================================================================================ -void -MyGEMSimHit::init(const PSimHit &sh, const GEMGeometry* gem_g) -{ - const LocalPoint hitLP(sh.localPosition()); - - l_x = hitLP.x(); - l_y = hitLP.y(); - l_z = hitLP.z(); - energy = sh.energyLoss(); - tof = sh.tof(); - pdg = sh.particleType(); - - const GlobalPoint hitGP(gem_g->idToDet(DetId(sh.detUnitId()))->surface().toGlobal(hitLP)); - - g_r = hitGP.perp(); - g_eta = hitGP.eta(); - g_phi = hitGP.phi(); - g_z = hitGP.z(); - - const LocalPoint hitEP(sh.entryPoint()); - strip = gem_g->etaPartition(sh.detUnitId())->strip(hitEP); -} - -void -NeutronSimHitAnalyzer::beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) -{ - // Get the geometry - edm::ESHandle csc_geom; - iSetup.get< MuonGeometryRecord >().get(csc_geom); - csc_geometry = &*csc_geom; - - edm::ESHandle dt_geom; - iSetup.get< MuonGeometryRecord >().get(dt_geom); - dt_geometry = &*dt_geom; - - edm::ESHandle rpc_geom; - iSetup.get< MuonGeometryRecord >().get(rpc_geom); - rpc_geometry = &*rpc_geom; - - edm::ESHandle gem_geom; - iSetup.get< MuonGeometryRecord >().get(gem_geom); - gem_geometry = &*gem_geom; -} - -// ================================================================================================ -void -NeutronSimHitAnalyzer::beginJob() {} - - -// ================================================================================================ -void -NeutronSimHitAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) -{ - evtn += 1; - csc_shn = 0; - rpc_shn = 0; - - // get SimHits - simhit_map_csc.fill(iEvent); - - vint chIds = simhit_map_csc.chambersWithHits(); - if (chIds.size()) { - //std::cout<<"--- chambers with hits: "< chamber_layers; - for (size_t la = 0; la < layer_ids.size(); la++) - { - CSCDetId layerId(layer_ids[la]); - c_id.init(layerId); - - edm::PSimHitContainer hits(simhit_map_csc.hits(layer_ids[la])); - //std::couts<<" "<< layer_ids[la]<<" "<0) ? (double)n_rpcsh_b/nevt_with_rpcsh_b : 0 )<<" sh/evt with hits)"<Sumw2(); - h_gem_nevt_fraction_with_sh->Scale(1./evtn); - h_csc_nevt_fraction_with_sh->Sumw2(); - h_csc_nevt_fraction_with_sh->Scale(1./evtn); - h_rpcf_nevt_fraction_with_sh->Sumw2(); - h_rpcf_nevt_fraction_with_sh->Scale(1./evtn); - h_rpcb_nevt_fraction_with_sh->Sumw2(); - h_rpcb_nevt_fraction_with_sh->Scale(1./evtn); - - // ---- calculate fluxes at L=10^34 - - h_csc_shflux_per_layer->Sumw2(); - for (int t=1; t<=nCSCTypes_; t++) - { - // 2 endcaps , 6 layers - const double scale(bxRate_ * pu_ * fractionEmptyBX_ /cscAreascm2_.at(t)/cscRadialSegmentation_.at(t)/2/nCSCLayers_ /evtn); - const double rt(scale * h_csc_shflux_per_layer->GetBinContent(t)); - const double er(scale * h_csc_shflux_per_layer->GetBinError(t)); - h_csc_shflux_per_layer->SetBinContent(t,rt); - h_csc_shflux_per_layer->SetBinError(t,er); - } - - h_rpcf_shflux_per_layer->Sumw2(); - for (int t=1; t<=nRPCfTypes_; t++) - { - // 2 endcaps , 1 layer - const double scale(bxRate_ * pu_ * fractionEmptyBX_ /rpcfAreascm2_.at(t)/rpcfRadialSegmentation_.at(t)/2/nRPCLayers_ /evtn); - const double rt(scale * h_rpcf_shflux_per_layer->GetBinContent(t)); - const double er(scale * h_rpcf_shflux_per_layer->GetBinError(t)); - h_rpcf_shflux_per_layer->SetBinContent(t,rt); - h_rpcf_shflux_per_layer->SetBinError(t,er); - } - - h_gem_shflux_per_layer->Sumw2(); - for (int t=1; t<=nGEMTypes_; t++) - { - // 2 endcaps , 2 layers - const double scale(bxRate_ * pu_ * fractionEmptyBX_ /gemAreascm2_.at(t)/gemRadialSegmentation_.at(t)/2/nGEMLayers_ /evtn); - const double rt(scale * h_gem_shflux_per_layer->GetBinContent(t)); - const double er(scale * h_gem_shflux_per_layer->GetBinError(t)); - h_gem_shflux_per_layer->SetBinContent(t,rt); - h_gem_shflux_per_layer->SetBinError(t,er); - } -} - -//define this as a plug-in -DEFINE_FWK_MODULE(NeutronSimHitAnalyzer); diff --git a/SimMuL1/python/NeutronSimHitAnalyzer_cfi.py.txt b/SimMuL1/python/NeutronSimHitAnalyzer_cfi.py.txt deleted file mode 100644 index 1ce4603e9e939..0000000000000 --- a/SimMuL1/python/NeutronSimHitAnalyzer_cfi.py.txt +++ /dev/null @@ -1,52 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -NeutronSimHitAnalyzer = cms.EDAnalyzer("NeutronSimHitAnalyzer", - inputIsNeutrons = cms.bool(True), - defaultInputTagCSC = cms.InputTag("cscNeutronWriter",""), - defaultInputTagRPC = cms.InputTag("rpcNeutronWriter",""), - defaultInputTagGEM = cms.InputTag("gemNeutronWriter",""), - defaultInputTagDT = cms.InputTag("dtNeutronWriter",""), - inputTagCSC = cms.InputTag("g4SimHits","MuonCSCHits"), - inputTagGEM = cms.InputTag("g4SimHits","MuonGEMHits"), - inputTagRPC = cms.InputTag("g4SimHits","MuonRPCHits"), - inputTagDT = cms.InputTag("g4SimHits","MuonDTHits"), - ## - maxCSCStations = cms.int32(4), - nCSCTypes = cms.int32(10), - maxDTStations = cms.int32(4), - nDTTypes = cms.int32(4), - maxRPCfStations = cms.int32(8), - nRPCfTypes = cms.int32(8), - maxRPCbStations = cms.int32(4), - nRPCbTypes = cms.int32(12), - maxGEMStations = cms.int32(1), - nGEMTypes = cms.int32(1), - ## chamber types - cscTypesLong = cms.vstring("Any", "ME1/a", "ME1/b", "ME1/2", "ME1/3", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2"), - cscTypesShort = cms.vstring("Any", "ME1a", "ME1b", "ME12", "ME13", "ME21", "ME22", "ME31", "ME32", "ME41", "ME42"), - dtTypesLong = cms.vstring("Any", "MB1/0", "MB1/1", "MB1/2", "MB2/0", "MB2/1", "MB2/2", "MB3/0", "MB3/1", "MB3/2", "MB4/0", "MB4/1", "MB4/2"), - dtTypesShort = cms.vstring("Any", "MB10", "MB11", "MB12", "MB20", "MB21", "MB22", "MB30", "MB31", "MB32", "MB40", "MB41", "MB42"), - rpcfTypesLong = cms.vstring("Any", "RE1/2", "RE1/3", "RE2/2", "RE2/3", "RE3/2", "RE3/3", "RE4/2", "RE4/3"), - rpcfTypesShort = cms.vstring("Any", "RE12", "RE13", "RE22", "RE23", "RE32", "RE33", "RE42", "RE43"), - rpcbTypesLong = cms.vstring("Any", "RB1/0", "RB1/1", "RB1/2", "RB2/0", "RB2/1", "RB2/2", "RB3/0", "RB3/1", "RB3/2", "RB4/0", "RB4/1", "RB4/2"), - rpcbTypesShort = cms.vstring("Any", "RB10", "RB11", "RB12", "RB20", "RB21", "RB22", "RB30", "RB31", "RB32", "RB40", "RB41", "RB42"), - gemTypesLong = cms.vstring("Any", "GE1/1"), - gemTypesShort = cms.vstring("Any", "GE11"), - ## add chamber areas - pu = cms.int32(25), - fractionEmptyBX = cms.double(0.77), - bxRate = cms.int32(40000000), - ## chamber areas - ## are these sensitive volumes? - cscAreascm2 = cms.vdouble(100000, 1068.32, 4108.77, 10872.75, 13559.025, 16986, 31121.2, 15716.4, 31121.2, 14542.5, 31121.2), ##why 100000 for ANY? - rpfcAreascm2 = cms.vdouble(100000, 11700, 17360, 11690, 19660, 11690, 19660, 11690, 19660), - gemAreascm2 = cms.vdouble(100000, 3226.446), ## current geometry - ##gemAreascm2 = cms.vdouble(100000, 4082.091), ## extended geometry cscRadialSegmentation = cms.vint32(100, 36, 36, 36, 36, 18, 36, 18, 36, 18, 36), ##why 100? for ANY? - rpcfRadialSegmentation = cms.int32(100, 36), - gemRadialSegmentation = cms.int32(100, 36), - ##layers - nRPCLayers = cms.int32(1), - nGEMLayers = cms.int32(2), - nCSCLayers = cms.int32(6) -) - diff --git a/SimMuL1/test/runNeutronSimHitAnalyzer_cfg.py.txt b/SimMuL1/test/runNeutronSimHitAnalyzer_cfg.py.txt deleted file mode 100644 index 8793b58dc85e4..0000000000000 --- a/SimMuL1/test/runNeutronSimHitAnalyzer_cfg.py.txt +++ /dev/null @@ -1,34 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -process = cms.Process("NEUTRON") - -## Standard sequence -process.load('Configuration.StandardSequences.Services_cff') -process.load('FWCore.MessageService.MessageLogger_cfi') -process.load('Configuration.Geometry.GeometryExtended2019Reco_cff') -process.load('Configuration.Geometry.GeometryExtended2019_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') - -## TrackingComponentsRecord required for matchers -process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorOpposite_cfi') -process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAlong_cfi') - -## global tag for 2019 upgrade studies -from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgrade2019', '') - -# the analyzer configuration -process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) ) - -process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring("file:out_sim.root") -) - -process.TFileService = cms.Service("TFileService", - fileName = cms.string("neutron_sh_ana.root") -) - -process.p = cms.Path(process.NeutronSimHitAnalyzer) From 2f26e736c3e87c1c6dd11f4dbdb23fb2ec60f467 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 16 Sep 2013 01:24:10 +0200 Subject: [PATCH 110/182] Updating MuGeometryHelpers --- SimMuL1/interface/EtaRangeHelpers.h | 13 ----- SimMuL1/interface/MuGeometryHelpers.h | 13 +++++ SimMuL1/plugins/GEMCSCTriggerEfficiency.cc | 2 +- SimMuL1/plugins/GEMCSCTriggerRate.cc | 68 +++++++++------------- SimMuL1/plugins/GEMCSCTriggerRate.h | 2 +- SimMuL1/src/EtaRangeHelpers.cc | 41 ------------- 6 files changed, 44 insertions(+), 95 deletions(-) delete mode 100644 SimMuL1/interface/EtaRangeHelpers.h delete mode 100644 SimMuL1/src/EtaRangeHelpers.cc diff --git a/SimMuL1/interface/EtaRangeHelpers.h b/SimMuL1/interface/EtaRangeHelpers.h deleted file mode 100644 index 8713353cb54fd..0000000000000 --- a/SimMuL1/interface/EtaRangeHelpers.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef SimMuL1_EtaRangeHelpers_h -#define SimMuL1_EtaRangeHelpers_h - -namespace etaRangeHelpers -{ - bool isME1bEtaRegion(float eta, float eta_min = 1.64, float eta_max = 2.14); - bool isME1abEtaRegion(float eta, float eta_min = 1.64); - bool isME1aEtaRegion(float eta, float eta_min = 2.14); - bool isME42EtaRegion(float eta); - bool isME42RPCEtaRegion(float eta); -} - -#endif diff --git a/SimMuL1/interface/MuGeometryHelpers.h b/SimMuL1/interface/MuGeometryHelpers.h index 721c13a8a2aad..e7154248a959a 100644 --- a/SimMuL1/interface/MuGeometryHelpers.h +++ b/SimMuL1/interface/MuGeometryHelpers.h @@ -14,6 +14,7 @@ #include "DataFormats/MuonDetId/interface/DTWireId.h" #include +#include class CSCGeometry; class GEMGeometry; @@ -23,6 +24,13 @@ class DTGeometry; namespace mugeo { +// check valid region +inline bool isME1bEtaRegion(float eta, float eta_min = 1.64, float eta_max = 2.14){return fabs(eta) >= eta_min && fabs(eta) <= eta_max;} +inline bool isME1abEtaRegion(float eta, float eta_min = 1.64){return fabs(eta) >= eta_min;} +inline bool isME1aEtaRegion(float eta, float eta_min = 2.14){return fabs(eta) >= eta_min;} +inline bool isME42EtaRegion(float eta){return fabs(eta)>=1.2499 && fabs(eta)<=1.8;} +inline bool isME42RPCEtaRegion(float eta){return fabs(eta)>=1.2499 && fabs(eta)<=1.6;} + // constants enum ETrigCSC {MAX_CSC_STATIONS = 4, CSC_TYPES = 10}; enum ETrigGEM {MAX_GEM_STATIONS = 1, GEM_TYPES = 1}; @@ -66,6 +74,11 @@ const std::string rpcb_type[RPCB_TYPES+1] = const std::string rpcb_type_[RPCB_TYPES+1] = { "all", "RB10", "RB11", "RB12", "RB20", "RB21", "RB22", "RB30", "RB31", "RB32", "RB40", "RB41", "RB42",}; +const std::string csc_type_a[CSC_TYPES+2] = + { "N/A", "ME1/a", "ME1/b", "ME1/2", "ME1/3", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2", "ME1/T"}; +const std::string csc_type_a_[CSC_TYPES+2] = + { "NA", "ME1A", "ME1B", "ME12", "ME13", "ME21", "ME22", "ME31", "ME32", "ME41", "ME42", "ME1T"}; + // chamber radial segmentation numbers (including factor of 2 for non-zero wheels in barrel): const double csc_radial_segm[CSC_TYPES+1] = {1, 36, 36, 36, 36, 18, 36, 18, 36, 18, 36}; const double gem_radial_segm[GEM_TYPES+1] = {1, 36}; diff --git a/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc b/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc index 2fece2d9030de..d398737c5adb6 100644 --- a/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc +++ b/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc @@ -36,7 +36,7 @@ #include "Geometry/GEMGeometry/interface/GEMGeometry.h" #include "GEMCode/GEMValidation/src/SimTrackMatchManager.h" -#include "GEMCode/SimMuL1/interface/EtaRangeHelpers.h" +#include "GEMCode/SimMuL1/interface/MuGeometryHelpers.h" // ================================================================================================ namespace diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.cc b/SimMuL1/plugins/GEMCSCTriggerRate.cc index c7a6e76815192..775573168958d 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRate.cc @@ -1,20 +1,10 @@ #include "GEMCode/SimMuL1/plugins/GEMCSCTriggerRate.h" -// ================================================================================================ -const std::string GEMCSCTriggerRate::csc_type[CSC_TYPES+1] = - { "ME1/1", "ME1/2", "ME1/3", "ME1/a", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2", "ME1/T"}; -const std::string GEMCSCTriggerRate::csc_type_[CSC_TYPES+1] = - { "ME11", "ME12", "ME13", "ME1A", "ME21", "ME22", "ME31", "ME32", "ME41", "ME42", "ME1T"}; -const std::string GEMCSCTriggerRate::csc_type_a[CSC_TYPES+2] = - { "N/A", "ME1/a", "ME1/b", "ME1/2", "ME1/3", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2", "ME1/T"}; -const std::string GEMCSCTriggerRate::csc_type_a_[CSC_TYPES+2] = - { "NA", "ME1A", "ME1B", "ME12", "ME13", "ME21", "ME22", "ME31", "ME32", "ME41", "ME42", "ME1T"}; const int GEMCSCTriggerRate::pbend[CSCConstants::NUM_CLCT_PATTERNS]= - { -999, -5, 4, -4, 3, -3, 2, -2, 1, -1, 0}; // "signed" pattern (== phiBend) + { -999, -5, 4, -4, 3, -3, 2, -2, 1, -1, 0}; // "signed" pattern (== phiBend) const double GEMCSCTriggerRate::PT_THRESHOLDS[N_PT_THRESHOLDS] = {0,10,20,30,40,50}; const double GEMCSCTriggerRate::PT_THRESHOLDS_FOR_ETA[N_PT_THRESHOLDS] = {10,15,30,40,55,70}; - // ================================================================================================ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): CSCTFSPset(iConfig.getParameter("SectorProcessor")), @@ -180,10 +170,10 @@ GEMCSCTriggerRate::beginJob() h_rt_csctype_lct_bx567 = fs->make("h_rt_csctype_lct_bx567", "CSC type vs LCT rate", 10, 0.5, 10.5); h_rt_csctype_mplct_bx567 = fs->make("h_rt_csctype_mplct_bx567", "CSC type vs MPC LCT rate", 10, 0.5, 10.5); for (int i=1; i<=CSC_TYPES;i++) { - h_rt_csctype_alct_bx567->GetXaxis()->SetBinLabel(i,csc_type_a[i].c_str()); - h_rt_csctype_clct_bx567->GetXaxis()->SetBinLabel(i,csc_type_a[i].c_str()); - h_rt_csctype_lct_bx567->GetXaxis()->SetBinLabel(i,csc_type_a[i].c_str()); - h_rt_csctype_mplct_bx567->GetXaxis()->SetBinLabel(i,csc_type_a[i].c_str()); + h_rt_csctype_alct_bx567->GetXaxis()->SetBinLabel(i,mugeo::csc_type_a[i].c_str()); + h_rt_csctype_clct_bx567->GetXaxis()->SetBinLabel(i,mugeo::csc_type_a[i].c_str()); + h_rt_csctype_lct_bx567->GetXaxis()->SetBinLabel(i,mugeo::csc_type_a[i].c_str()); + h_rt_csctype_mplct_bx567->GetXaxis()->SetBinLabel(i,mugeo::csc_type_a[i].c_str()); } h_rt_lct_qu_vs_bx = fs->make("h_rt_lct_qu_vs_bx","h_rt_lct_qu_vs_bx",20,0., 20.,13,-6.5, 6.5); @@ -477,37 +467,37 @@ GEMCSCTriggerRate::beginJob() { if (me==3 && !doME1a_) continue; // ME1/a - sprintf(label,"h_rt_n_per_ch_alct_vs_bx_cscdet_%s",csc_type_[me].c_str()); + sprintf(label,"h_rt_n_per_ch_alct_vs_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); h_rt_n_per_ch_alct_vs_bx_cscdet[me] = fs->make(label, label, 5,0,5, 16,-.5, 15.5); - sprintf(label,"h_rt_n_per_ch_clct_vs_bx_cscdet_%s",csc_type_[me].c_str()); + sprintf(label,"h_rt_n_per_ch_clct_vs_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); h_rt_n_per_ch_clct_vs_bx_cscdet[me] = fs->make(label, label, 5,0,5, 16,-.5, 15.5); - sprintf(label,"h_rt_n_per_ch_lct_vs_bx_cscdet_%s",csc_type_[me].c_str()); + sprintf(label,"h_rt_n_per_ch_lct_vs_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); h_rt_n_per_ch_lct_vs_bx_cscdet[me] = fs->make(label, label, 5,0,5, 16,-.5, 15.5); - sprintf(label,"h_rt_n_ch_alct_per_bx_cscdet_%s",csc_type_[me].c_str()); + sprintf(label,"h_rt_n_ch_alct_per_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); h_rt_n_ch_alct_per_bx_cscdet[me] = fs->make(label, label, 51,-0.5, 50.5); - sprintf(label,"h_rt_n_ch_clct_per_bx_cscdet_%s",csc_type_[me].c_str()); + sprintf(label,"h_rt_n_ch_clct_per_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); h_rt_n_ch_clct_per_bx_cscdet[me] = fs->make(label, label, 51,-0.5, 50.5); - sprintf(label,"h_rt_n_ch_lct_per_bx_cscdet_%s",csc_type_[me].c_str()); + sprintf(label,"h_rt_n_ch_lct_per_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); h_rt_n_ch_lct_per_bx_cscdet[me] = fs->make(label, label, 51,-0.5, 50.5); - sprintf(label,"h_rt_mplct_pattern_cscdet_%s",csc_type_[me].c_str()); + sprintf(label,"h_rt_mplct_pattern_cscdet_%s",mugeo::csc_type_[me].c_str()); h_rt_mplct_pattern_cscdet[me] = fs->make(label, label, 13,-0.5, 12.5); - sprintf(label,"h_rt_alct_bx_cscdet_%s",csc_type_[me].c_str()); + sprintf(label,"h_rt_alct_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); h_rt_alct_bx_cscdet[me] = fs->make(label, label,13,-6.5, 6.5); - sprintf(label,"h_rt_clct_bx_cscdet_%s",csc_type_[me].c_str()); + sprintf(label,"h_rt_clct_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); h_rt_clct_bx_cscdet[me] = fs->make(label, label,13,-6.5, 6.5); - sprintf(label,"h_rt_lct_bx_cscdet_%s",csc_type_[me].c_str()); + sprintf(label,"h_rt_lct_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); h_rt_lct_bx_cscdet[me] = fs->make(label, label,13,-6.5, 6.5); - sprintf(label,"h_rt_mplct_bx_cscdet_%s",csc_type_[me].c_str()); + sprintf(label,"h_rt_mplct_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); h_rt_mplct_bx_cscdet[me] = fs->make(label, label,13,-6.5, 6.5); }//for (int me=0; menStubs(0,1,1,1,1)<nStubs()) myTFCand.tftrack->print("non-equal nstubs!"); //if (fabs(myTFCand.eta)>1.25 && fabs(myTFCand.eta)<1.9) { - if (etaRangeHelpers::isME42EtaRegion(myTFCand.eta)) { + if (mugeo::isME42EtaRegion(myTFCand.eta)) { if (ntrg_stubs>=2) h_rt_tfcand_pt_h42_2st->Fill(tfpt); if (ntrg_stubs>=3) h_rt_tfcand_pt_h42_3st->Fill(tfpt); } @@ -1356,8 +1346,8 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet float geta = fabs(myGMTREGCand.eta); float gpt = myGMTREGCand.pt; - bool eta_me42 = etaRangeHelpers::isME42EtaRegion(myGMTREGCand.eta); - bool eta_me42r = etaRangeHelpers::isME42RPCEtaRegion(myGMTREGCand.eta); + bool eta_me42 = mugeo::isME42EtaRegion(myGMTREGCand.eta); + bool eta_me42r = mugeo::isME42RPCEtaRegion(myGMTREGCand.eta); //if (geta>=1.2 && geta<=1.8) eta_me42 = 1; bool eta_q = (geta > 1.2); @@ -1385,10 +1375,10 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet continue; } - bool eta_me1b = etaRangeHelpers::isME1bEtaRegion(myGMTREGCand.eta); - bool eta_me1ab = etaRangeHelpers::isME1abEtaRegion(myGMTREGCand.eta); - bool eta_me1a = etaRangeHelpers::isME1aEtaRegion(myGMTREGCand.eta); - bool eta_me1b_whole = etaRangeHelpers::isME1bEtaRegion(myGMTREGCand.eta, 1.6, 2.14); + bool eta_me1b = mugeo::isME1bEtaRegion(myGMTREGCand.eta); + bool eta_me1ab = mugeo::isME1abEtaRegion(myGMTREGCand.eta); + bool eta_me1a = mugeo::isME1aEtaRegion(myGMTREGCand.eta); + bool eta_me1b_whole = mugeo::isME1bEtaRegion(myGMTREGCand.eta, 1.6, 2.14); bool eta_no1a = (geta >= 1.2 && geta < 2.14); n_stubs = myGMTREGCand.nTFStubs; @@ -1514,7 +1504,7 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet // else std::cout<<"null tftrack!"<quality()>=3 && gpt >=40. && etaRangeHelpers::isME1bEtaRegion(myGMTREGCand.eta) ) { + // if (trk->quality()>=3 && gpt >=40. && mugeo::isME1bEtaRegion(myGMTREGCand.eta) ) { // std::cout<<"highpt csctf in ME1b "<tftrack->print(""); // } @@ -1687,7 +1677,7 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet h_rt_gmt_rpcf_eta->Fill(fabs(myGMTREGCand.eta)); h_rt_gmt_rpcf_bx->Fill(trk->bx()); - bool eta_me42 = etaRangeHelpers::isME42RPCEtaRegion(myGMTREGCand.eta); + bool eta_me42 = mugeo::isME42RPCEtaRegion(myGMTREGCand.eta); //if (fabs(myGMTREGCand.eta)>=1.2 && fabs(myGMTREGCand.eta)<=1.8) eta_me42 = 1; if(eta_me42) h_rt_gmt_rpcf_pt_42->Fill(myGMTREGCand.pt); @@ -1916,13 +1906,13 @@ GEMCSCTriggerRate::analyze(const edm::Event& iEvent, const edm::EventSetup& iSet if ( (gmt_csc != NULL && gmt_rpcf != NULL) && !muItr->isMatchedCand() ) std::cout<<"csc&rpcf but not matched!"<=1.2 && geta<=1.8) eta_me42 = 1; bool eta_q = (geta > 1.2); - bool eta_me1b = etaRangeHelpers::isME1bEtaRegion(myGMTCand.eta); - //bool eta_me1b_whole = etaRangeHelpers::isME1bEtaRegion(myGMTCand.eta, 1.6, 2.14); + bool eta_me1b = mugeo::isME1bEtaRegion(myGMTCand.eta); + //bool eta_me1b_whole = mugeo::isME1bEtaRegion(myGMTCand.eta, 1.6, 2.14); bool eta_no1a = (geta >= 1.2 && geta < 2.14); //bool eta_csc = (geta > 0.9); // diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.h b/SimMuL1/plugins/GEMCSCTriggerRate.h index 2f08e622ad664..335d5f40fa13c 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.h +++ b/SimMuL1/plugins/GEMCSCTriggerRate.h @@ -46,7 +46,7 @@ #include "CondFormats/DataRecord/interface/L1MuTriggerScalesRcd.h" #include "CondFormats/DataRecord/interface/L1MuTriggerPtScaleRcd.h" -#include "GEMCode/SimMuL1/interface/EtaRangeHelpers.h" +#include "GEMCode/SimMuL1/interface/MuGeometryHelpers.h" #include "GEMCode/SimMuL1/interface/MatchCSCMuL1.h" // ROOT diff --git a/SimMuL1/src/EtaRangeHelpers.cc b/SimMuL1/src/EtaRangeHelpers.cc deleted file mode 100644 index 8caa157f5a86d..0000000000000 --- a/SimMuL1/src/EtaRangeHelpers.cc +++ /dev/null @@ -1,41 +0,0 @@ -#include "GEMCode/SimMuL1/interface/EtaRangeHelpers.h" - -#include - -bool -etaRangeHelpers::isME1bEtaRegion(float eta, float eta_min, float eta_max) -{ - return fabs(eta) >= eta_min && fabs(eta) <= eta_max; -} - -bool -etaRangeHelpers::isME1abEtaRegion(float eta, float eta_min) -{ - return fabs(eta) >= eta_min; -} - -bool -etaRangeHelpers::isME1aEtaRegion(float eta, float eta_min) -{ - return fabs(eta) >= eta_min; -} - -bool -etaRangeHelpers::isME42EtaRegion(float eta) -{ - return fabs(eta)>=1.2499 && fabs(eta)<=1.8; -} - -bool -etaRangeHelpers::isME42RPCEtaRegion(float eta) -{ - return fabs(eta)>=1.2499 && fabs(eta)<=1.6; -} - - - - - - - - From 463ad1fc80e38bb07ff2d215a3b3e89614fbfa3f Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 16 Sep 2013 01:25:43 +0200 Subject: [PATCH 111/182] updating README --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4accdbd5aee4b..2c7b77f91720d 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,10 @@ http://cms-sw.github.io/cmssw/index.html ###CMSSW environment setup -
cmsrel CMSSW_6_1_2_SLHC6_patch1
-cd CMSSW_6_1_2_SLHC6_patch1/src
+!!! Use CMSSW_6_1_2_SLHC8_patch1 !!!
+
+
cmsrel CMSSW_6_1_2_SLHC8_patch1
+cd CMSSW_6_1_2_SLHC8_patch1/src
 cmsenv
 git init
 
From 3c55744ab7b8a8d0be169c4785c59446eac7eac2 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 16 Sep 2013 01:37:02 +0200 Subject: [PATCH 112/182] toy to ntuplize the rate analyzer --- SimMuL1/plugins/GEMCSCTriggerRateTree.cc | 2396 ++++++++++++++++++ SimMuL1/plugins/GEMCSCTriggerRateTree.h | 611 +++++ SimMuL1/python/GEMCSCTriggerRateTree_cfi.py | 16 + SimMuL1/test/runGEMCSCTriggerRateTree_cfg.py | 129 + 4 files changed, 3152 insertions(+) create mode 100644 SimMuL1/plugins/GEMCSCTriggerRateTree.cc create mode 100644 SimMuL1/plugins/GEMCSCTriggerRateTree.h create mode 100644 SimMuL1/python/GEMCSCTriggerRateTree_cfi.py create mode 100644 SimMuL1/test/runGEMCSCTriggerRateTree_cfg.py diff --git a/SimMuL1/plugins/GEMCSCTriggerRateTree.cc b/SimMuL1/plugins/GEMCSCTriggerRateTree.cc new file mode 100644 index 0000000000000..62cc0ba646547 --- /dev/null +++ b/SimMuL1/plugins/GEMCSCTriggerRateTree.cc @@ -0,0 +1,2396 @@ +#include "GEMCode/SimMuL1/plugins/GEMCSCTriggerRateTree.h" + +const int GEMCSCTriggerRateTree::pbend[CSCConstants::NUM_CLCT_PATTERNS]= + { -999, -5, 4, -4, 3, -3, 2, -2, 1, -1, 0}; // "signed" pattern (== phiBend) +const double GEMCSCTriggerRateTree::PT_THRESHOLDS[N_PT_THRESHOLDS] = {0,10,20,30,40,50}; +const double GEMCSCTriggerRateTree::PT_THRESHOLDS_FOR_ETA[N_PT_THRESHOLDS] = {10,15,30,40,55,70}; + +// ================================================================================================ +GEMCSCTriggerRateTree::GEMCSCTriggerRateTree(const edm::ParameterSet& iConfig): + CSCTFSPset(iConfig.getParameter("SectorProcessor")), + ptLUTset(CSCTFSPset.getParameter("PTLUT")), + ptLUT(0), + matchAllTrigPrimitivesInChamber_(iConfig.getUntrackedParameter("matchAllTrigPrimitivesInChamber", false)), + debugRATE(iConfig.getUntrackedParameter("debugRATE", 0)), + minBX_(iConfig.getUntrackedParameter("minBX",-6)), + maxBX_(iConfig.getUntrackedParameter("maxBX",6)), + minTMBBX_(iConfig.getUntrackedParameter("minTMBBX",-6)), + maxTMBBX_(iConfig.getUntrackedParameter("maxTMBBX",6)), + minRateBX_(iConfig.getUntrackedParameter("minRateBX",-1)), + maxRateBX_(iConfig.getUntrackedParameter("maxRateBX",1)), + minBxALCT_(iConfig.getUntrackedParameter("minBxALCT",5)), + maxBxALCT_(iConfig.getUntrackedParameter("maxBxALCT",7)), + minBxCLCT_(iConfig.getUntrackedParameter("minBxCLCT",5)), + maxBxCLCT_(iConfig.getUntrackedParameter("maxBxCLCT",7)), + minBxLCT_(iConfig.getUntrackedParameter("minBxLCT",5)), + maxBxLCT_(iConfig.getUntrackedParameter("maxBxLCT",7)), + minBxMPLCT_(iConfig.getUntrackedParameter("minBxMPLCT",5)), + maxBxMPLCT_(iConfig.getUntrackedParameter("maxBxMPLCT",7)), + minBxGMT_(iConfig.getUntrackedParameter("minBxGMT",-1)), + maxBxGMT_(iConfig.getUntrackedParameter("maxBxGMT",1)), + centralBxOnlyGMT_(iConfig.getUntrackedParameter< bool >("centralBxOnlyGMT",false)), + doSelectEtaForGMTRates_(iConfig.getUntrackedParameter< bool >("doSelectEtaForGMTRates",false)), + doME1a_(iConfig.getUntrackedParameter< bool >("doME1a",false)), + // special treatment of matching in ME1a for the case of the default emulator + defaultME1a(iConfig.getUntrackedParameter("defaultME1a", false)) +{ + edm::ParameterSet srLUTset = CSCTFSPset.getParameter("SRLUT"); + + for(int e=0; e<2; e++) + for (int s=0; s<6; s++) + my_SPs[e][s] = NULL; + + bool TMB07 = true; + for(int endcap = 1; endcap<=2; endcap++) + { + for(int sector=1; sector<=6; sector++) + { + for(int station=1,fpga=0; station<=4 && fpga<5; station++) + { + if(station==1) for(int subSector=0; subSector<2; subSector++) + srLUTs_[fpga++][sector-1][endcap-1] = new CSCSectorReceiverLUT(endcap, sector, subSector+1, station, srLUTset, TMB07); + else + srLUTs_[fpga++][sector-1][endcap-1] = new CSCSectorReceiverLUT(endcap, sector, 0, station, srLUTset, TMB07); + } + } + } + + my_dtrc = new CSCTFDTReceiver(); + + // cache flags for event setup records + muScalesCacheID_ = 0ULL ; + muPtScaleCacheID_ = 0ULL ; + +// bookALCTTree(); +// bookCLCTTree(); +// bookLCTTree(); +// bookMPLCTTree(); +// bookTFTrackTree(); +// bookTFCandTree(); +// bookGMTRegionalTree(); +// bookGMTCandTree(); +} + +// ================================================================================================ +GEMCSCTriggerRateTree::~GEMCSCTriggerRateTree() +{ + if(ptLUT) delete ptLUT; + ptLUT = NULL; + + for(int e=0; e<2; e++) for (int s=0; s<6; s++){ + if (my_SPs[e][s]) delete my_SPs[e][s]; + my_SPs[e][s] = NULL; + + for(int fpga=0; fpga<5; fpga++) + { + if (srLUTs_[fpga][s][e]) delete srLUTs_[fpga][s][e]; + srLUTs_[fpga][s][e] = NULL; + } + } + + if(my_dtrc) delete my_dtrc; + my_dtrc = NULL; +} + +// ================================================================================================ +void +GEMCSCTriggerRateTree::beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) +{ + edm::ESHandle< CSCGeometry > cscGeom; + iSetup.get().get(cscGeom); + cscGeometry = &*cscGeom; + CSCTriggerGeometry::setGeometry(cscGeometry); +} + +// ================================================================================================ +void +GEMCSCTriggerRateTree::beginJob() +{ + edm::Service fs; + + Double_t ETA_BIN = 0.0125 *2; + //Double_t PHI_BIN = 62.*M_PI/180./4096.; // 0.26 mrad + int N_ETA_BINS=200; + double ETA_START=-2.4999; + double ETA_END = ETA_START + ETA_BIN*N_ETA_BINS; + + int N_ETA_BINS_CSC = 32; + double ETA_START_CSC = 0.9; + double ETA_END_CSC = 2.5; + + int N_ETA_BINS_DT = 32; + double ETA_START_DT = 0.; + double ETA_END_DT = 1.2; + + const int N_ETA_BINS_RPC = 17; + double ETA_BINS_RPC[N_ETA_BINS_RPC+1] = + {0, 0.07, 0.27, 0.44, 0.58, 0.72, 0.83, 0.93, 1.04, 1.14, + 1.24, 1.36, 1.48, 1.61, 1.73, 1.85, 1.97, 2.1}; + + const int N_ETA_BINS_GMT = 32; + double ETA_BINS_GMT[N_ETA_BINS_GMT+1] = + {0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, + 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.75, 1.8, + 1.85, 1.9, 1.95, 2, 2.05, 2.1, 2.15, 2.2, 2.25, 2.3, + 2.35, 2.4, 2.45}; + + h_rt_nalct = fs->make("h_rt_nalct","h_rt_nalct",101,-0.5, 100.5); + h_rt_nclct = fs->make("h_rt_nclct","h_rt_nclct",101,-0.5, 100.5); + h_rt_nlct = fs->make("h_rt_nlct","h_rt_nlct",101,-0.5, 100.5); + h_rt_nmplct = fs->make("h_rt_nmplct","h_rt_nmplct",101,-0.5, 100.5); + h_rt_ntftrack = fs->make("h_rt_ntftrack","h_rt_ntftrack",31,-0.5, 30.5); + h_rt_ntfcand = fs->make("h_rt_ntfcand","h_rt_ntfcand",31,-0.5, 30.5); + h_rt_ntfcand_pt10 = fs->make("h_rt_ntfcand_pt10","h_rt_ntfcand_pt10",31,-0.5, 30.5); + h_rt_ngmt_csc = fs->make("h_rt_ngmt_csc","h_rt_ngmt_csc",11,-0.5, 10.5); + h_rt_ngmt_csc_pt10 = fs->make("h_rt_ngmt_csc_pt10","h_rt_ngmt_csc_pt10",11,-0.5, 10.5); + h_rt_ngmt_csc_per_bx = fs->make("h_rt_ngmt_csc_per_bx","h_rt_ngmt_csc_per_bx",11,-0.5, 10.5); + h_rt_ngmt_rpcf = fs->make("h_rt_ngmt_rpcf","h_rt_ngmt_rpcf",11,-0.5, 10.5); + h_rt_ngmt_rpcf_pt10 = fs->make("h_rt_ngmt_rpcf_pt10","h_rt_ngmt_rpcf_pt10",11,-0.5, 10.5); + h_rt_ngmt_rpcf_per_bx = fs->make("h_rt_ngmt_rpcf_per_bx","h_rt_ngmt_rpcf_per_bx",11,-0.5, 10.5); + h_rt_ngmt_rpcb = fs->make("h_rt_ngmt_rpcb","h_rt_ngmt_rpcb",11,-0.5, 10.5); + h_rt_ngmt_rpcb_pt10 = fs->make("h_rt_ngmt_rpcb_pt10","h_rt_ngmt_rpcb_pt10",11,-0.5, 10.5); + h_rt_ngmt_rpcb_per_bx = fs->make("h_rt_ngmt_rpcb_per_bx","h_rt_ngmt_rpcb_per_bx",11,-0.5, 10.5); + h_rt_ngmt_dt = fs->make("h_rt_ngmt_dt","h_rt_ngmt_dt",11,-0.5, 10.5); + h_rt_ngmt_dt_pt10 = fs->make("h_rt_ngmt_dt_pt10","h_rt_ngmt_dt_pt10",11,-0.5, 10.5); + h_rt_ngmt_dt_per_bx = fs->make("h_rt_ngmt_dt_per_bx","h_rt_ngmt_dt_per_bx",11,-0.5, 10.5); + h_rt_ngmt = fs->make("h_rt_ngmt","h_rt_ngmt",11,-0.5, 10.5); + h_rt_nxtra = fs->make("h_rt_nxtra","h_rt_nxtra",11,-0.5, 10.5); + + h_rt_nalct_per_bx = fs->make("h_rt_nalct_per_bx", "h_rt_nalct_per_bx", 51,-0.5, 50.5); + h_rt_nclct_per_bx = fs->make("h_rt_nclct_per_bx", "h_rt_nclct_per_bx", 51,-0.5, 50.5); + h_rt_nlct_per_bx = fs->make("h_rt_nlct_per_bx", "h_rt_nlct_per_bx", 51,-0.5, 50.5); + + h_rt_alct_bx = fs->make("h_rt_alct_bx","h_rt_alct_bx",13,-6.5, 6.5); + h_rt_clct_bx = fs->make("h_rt_clct_bx","h_rt_clct_bx",13,-6.5, 6.5); + h_rt_lct_bx = fs->make("h_rt_lct_bx","h_rt_lct_bx",13,-6.5, 6.5); + h_rt_mplct_bx = fs->make("h_rt_mplct_bx","h_rt_mplct_bx",13,-6.5, 6.5); + + h_rt_csctype_alct_bx567 = fs->make("h_rt_csctype_alct_bx567", "CSC type vs ALCT rate", 10, 0.5, 10.5); + h_rt_csctype_clct_bx567 = fs->make("h_rt_csctype_clct_bx567", "CSC type vs CLCT rate", 10, 0.5, 10.5); + h_rt_csctype_lct_bx567 = fs->make("h_rt_csctype_lct_bx567", "CSC type vs LCT rate", 10, 0.5, 10.5); + h_rt_csctype_mplct_bx567 = fs->make("h_rt_csctype_mplct_bx567", "CSC type vs MPC LCT rate", 10, 0.5, 10.5); + for (int i=1; i<=CSC_TYPES;i++) { + h_rt_csctype_alct_bx567->GetXaxis()->SetBinLabel(i,mugeo::csc_type_a[i].c_str()); + h_rt_csctype_clct_bx567->GetXaxis()->SetBinLabel(i,mugeo::csc_type_a[i].c_str()); + h_rt_csctype_lct_bx567->GetXaxis()->SetBinLabel(i,mugeo::csc_type_a[i].c_str()); + h_rt_csctype_mplct_bx567->GetXaxis()->SetBinLabel(i,mugeo::csc_type_a[i].c_str()); + } + + h_rt_lct_qu_vs_bx = fs->make("h_rt_lct_qu_vs_bx","h_rt_lct_qu_vs_bx",20,0., 20.,13,-6.5, 6.5); + h_rt_mplct_qu_vs_bx = fs->make("h_rt_mplct_qu_vs_bx","h_rt_mplct_qu_vs_bx",20,0., 20.,13,-6.5, 6.5); + + h_rt_nalct_vs_bx = fs->make("h_rt_nalct_vs_bx","h_rt_nalct_vs_bx",20,0., 20.,16,-.5, 15.5); + h_rt_nclct_vs_bx = fs->make("h_rt_nclct_vs_bx","h_rt_nclct_vs_bx",20,0., 20.,16,-.5, 15.5); + h_rt_nlct_vs_bx = fs->make("h_rt_nlct_vs_bx","h_rt_nlct_vs_bx",20,0., 20.,16,-.5, 15.5); + h_rt_nmplct_vs_bx = fs->make("h_rt_nmplct_vs_bx","h_rt_nmplct_vs_bx",20,0., 20.,16,-.5, 15.5); + + h_rt_lct_qu = fs->make("h_rt_lct_qu","h_rt_lct_qu",20,0., 20.); + h_rt_mplct_qu = fs->make("h_rt_mplct_qu","h_rt_mplct_qu",20,0., 20.); + + h_rt_qu_vs_bxclct__lct = fs->make("h_rt_qu_vs_bxclct__lct","h_rt_qu_vs_bxclct__lct",17,-0.5, 16.5, 15,-7.5, 7.5); + + h_rt_tftrack_pt = fs->make("h_rt_tftrack_pt","h_rt_tftrack_pt",600, 0.,150.); + h_rt_tfcand_pt = fs->make("h_rt_tfcand_pt","h_rt_tfcand_pt",600, 0.,150.); + + + h_rt_gmt_csc_pt = fs->make("h_rt_gmt_csc_pt","h_rt_gmt_csc_pt",600, 0.,150.); + h_rt_gmt_csc_pt_2st = fs->make("h_rt_gmt_csc_pt_2st","h_rt_gmt_csc_pt_2st",600, 0.,150.); + h_rt_gmt_csc_pt_3st = fs->make("h_rt_gmt_csc_pt_3st","h_rt_gmt_csc_pt_3st",600, 0.,150.); + h_rt_gmt_csc_pt_2q = fs->make("h_rt_gmt_csc_pt_2q","h_rt_gmt_csc_pt_2q",600, 0.,150.); + h_rt_gmt_csc_pt_3q = fs->make("h_rt_gmt_csc_pt_3q","h_rt_gmt_csc_pt_3q",600, 0.,150.); + h_rt_gmt_csc_ptmax_2s = fs->make("h_rt_gmt_csc_ptmax_2s","h_rt_gmt_csc_ptmax_2s",600, 0.,150.); + h_rt_gmt_csc_ptmax_2s_1b = fs->make("h_rt_gmt_csc_ptmax_2s_1b","h_rt_gmt_csc_ptmax_2s_1b",600, 0.,150.); + h_rt_gmt_csc_ptmax_2s_no1a = fs->make("h_rt_gmt_csc_ptmax_2s_no1a","h_rt_gmt_csc_ptmax_2s_no1a",600, 0.,150.); + h_rt_gmt_csc_ptmax_3s = fs->make("h_rt_gmt_csc_ptmax_3s","h_rt_gmt_csc_ptmax_3s",600, 0.,150.); + h_rt_gmt_csc_ptmax_3s_1b = fs->make("h_rt_gmt_csc_ptmax_3s_1b","h_rt_gmt_csc_ptmax_3s_1b",600, 0.,150.); + h_rt_gmt_csc_ptmax_3s_no1a = fs->make("h_rt_gmt_csc_ptmax_3s_no1a","h_rt_gmt_csc_ptmax_3s_no1a",600, 0.,150.); + h_rt_gmt_csc_ptmax_3s_2s1b = fs->make("h_rt_gmt_csc_ptmax_3s_2s1b","h_rt_gmt_csc_ptmax_3s_2s1b",600, 0.,150.); + h_rt_gmt_csc_ptmax_3s_2s1b_1b = fs->make("h_rt_gmt_csc_ptmax_3s_2s1b_1b","h_rt_gmt_csc_ptmax_3s_2s1b_1b",600, 0.,150.); + h_rt_gmt_csc_ptmax_3s_2s123_1b = fs->make("h_rt_gmt_csc_ptmax_3s_2s123_1b","h_rt_gmt_csc_ptmax_3s_2s123_1b",600, 0.,150.); + h_rt_gmt_csc_ptmax_3s_2s13_1b = fs->make("h_rt_gmt_csc_ptmax_3s_2s13_1b","h_rt_gmt_csc_ptmax_3s_2s13_1b",600, 0.,150.); + h_rt_gmt_csc_ptmax_3s_2s1b_no1a = fs->make("h_rt_gmt_csc_ptmax_3s_2s1b_no1a","h_rt_gmt_csc_ptmax_3s_2s1b_no1a",600, 0.,150.); + h_rt_gmt_csc_ptmax_3s_2s123_no1a = fs->make("h_rt_gmt_csc_ptmax_3s_2s123_no1a","h_rt_gmt_csc_ptmax_3s_2s123_no1a",600, 0.,150.); + h_rt_gmt_csc_ptmax_3s_2s13_no1a = fs->make("h_rt_gmt_csc_ptmax_3s_2s13_no1a","h_rt_gmt_csc_ptmax_3s_2s13_no1a",600, 0.,150.); + h_rt_gmt_csc_ptmax_3s_3s1b = fs->make("h_rt_gmt_csc_ptmax_3s_3s1b","h_rt_gmt_csc_ptmax_3s_3s1b",600, 0.,150.); + h_rt_gmt_csc_ptmax_3s_3s1b_1b = fs->make("h_rt_gmt_csc_ptmax_3s_3s1b_1b","h_rt_gmt_csc_ptmax_3s_3s1b_1b",600, 0.,150.); + h_rt_gmt_csc_ptmax_3s_3s1b_no1a = fs->make("h_rt_gmt_csc_ptmax_3s_3s1b_no1a","h_rt_gmt_csc_ptmax_3s_3s1b_no1a",600, 0.,150.); + h_rt_gmt_csc_ptmax_2q = fs->make("h_rt_gmt_csc_ptmax_2q","h_rt_gmt_csc_ptmax_2q",600, 0.,150.); + h_rt_gmt_csc_ptmax_3q = fs->make("h_rt_gmt_csc_ptmax_3q","h_rt_gmt_csc_ptmax_3q",600, 0.,150.); + h_rt_gmt_csc_pt_2s42 = fs->make("h_rt_gmt_csc_pt_2s42","h_rt_gmt_csc_pt_2s42",600, 0.,150.); + h_rt_gmt_csc_pt_3s42 = fs->make("h_rt_gmt_csc_pt_3s42","h_rt_gmt_csc_pt_3s42",600, 0.,150.); + h_rt_gmt_csc_ptmax_2s42 = fs->make("h_rt_gmt_csc_ptmax_2s42","h_rt_gmt_csc_ptmax_2s42",600, 0.,150.); + h_rt_gmt_csc_ptmax_3s42 = fs->make("h_rt_gmt_csc_ptmax_3s42","h_rt_gmt_csc_ptmax_3s42",600, 0.,150.); + h_rt_gmt_csc_pt_2q42 = fs->make("h_rt_gmt_csc_pt_2q42","h_rt_gmt_csc_pt_2q42",600, 0.,150.); + h_rt_gmt_csc_pt_3q42 = fs->make("h_rt_gmt_csc_pt_3q42","h_rt_gmt_csc_pt_3q42",600, 0.,150.); + h_rt_gmt_csc_ptmax_2q42 = fs->make("h_rt_gmt_csc_ptmax_2q42","h_rt_gmt_csc_ptmax_2q42",600, 0.,150.); + h_rt_gmt_csc_ptmax_3q42 = fs->make("h_rt_gmt_csc_ptmax_3q42","h_rt_gmt_csc_ptmax_3q42",600, 0.,150.); + h_rt_gmt_csc_pt_2s42r = fs->make("h_rt_gmt_csc_pt_2s42r","h_rt_gmt_csc_pt_2s42r",600, 0.,150.); + h_rt_gmt_csc_pt_3s42r = fs->make("h_rt_gmt_csc_pt_3s42r","h_rt_gmt_csc_pt_3s42r",600, 0.,150.); + h_rt_gmt_csc_ptmax_2s42r = fs->make("h_rt_gmt_csc_ptmax_2s42r","h_rt_gmt_csc_ptmax_2s42r",600, 0.,150.); + h_rt_gmt_csc_ptmax_3s42r = fs->make("h_rt_gmt_csc_ptmax_3s42r","h_rt_gmt_csc_ptmax_3s42r",600, 0.,150.); + h_rt_gmt_csc_pt_2q42r = fs->make("h_rt_gmt_csc_pt_2q42r","h_rt_gmt_csc_pt_2q42r",600, 0.,150.); + h_rt_gmt_csc_pt_3q42r = fs->make("h_rt_gmt_csc_pt_3q42r","h_rt_gmt_csc_pt_3q42r",600, 0.,150.); + h_rt_gmt_csc_ptmax_2q42r = fs->make("h_rt_gmt_csc_ptmax_2q42r","h_rt_gmt_csc_ptmax_2q42r",600, 0.,150.); + h_rt_gmt_csc_ptmax_3q42r = fs->make("h_rt_gmt_csc_ptmax_3q42r","h_rt_gmt_csc_ptmax_3q42r",600, 0.,150.); + + + h_rt_gmt_rpcf_pt = fs->make("h_rt_gmt_rpcf_pt","h_rt_gmt_rpcf_pt",600, 0.,150.); + h_rt_gmt_rpcf_pt_42 = fs->make("h_rt_gmt_rpcf_pt_42","h_rt_gmt_rpcf_pt_42",600, 0.,150.); + h_rt_gmt_rpcf_ptmax = fs->make("h_rt_gmt_rpcf_ptmax","h_rt_gmt_rpcf_ptmax",600, 0.,150.); + h_rt_gmt_rpcf_ptmax_42 = fs->make("h_rt_gmt_rpcf_ptmax_42","h_rt_gmt_rpcf_ptmax_42",600, 0.,150.); + + h_rt_gmt_rpcb_pt = fs->make("h_rt_gmt_rpcb_pt","h_rt_gmt_rpcb_pt",600, 0.,150.); + h_rt_gmt_rpcb_ptmax = fs->make("h_rt_gmt_rpcb_ptmax","h_rt_gmt_rpcb_ptmax",600, 0.,150.); + + h_rt_gmt_dt_pt = fs->make("h_rt_gmt_dt_pt","h_rt_gmt_dt_pt",600, 0.,150.); + h_rt_gmt_dt_ptmax = fs->make("h_rt_gmt_dt_ptmax","h_rt_gmt_dt_ptmax",600, 0.,150.); + + h_rt_gmt_pt = fs->make("h_rt_gmt_pt","h_rt_gmt_pt",600, 0.,150.); + h_rt_gmt_pt_2st = fs->make("h_rt_gmt_pt_2st","h_rt_gmt_pt_2st",600, 0.,150.); + h_rt_gmt_pt_3st = fs->make("h_rt_gmt_pt_3st","h_rt_gmt_pt_3st",600, 0.,150.); + h_rt_gmt_pt_2q = fs->make("h_rt_gmt_pt_2q","h_rt_gmt_pt_2q",600, 0.,150.); + h_rt_gmt_pt_3q = fs->make("h_rt_gmt_pt_3q","h_rt_gmt_pt_3q",600, 0.,150.); + h_rt_gmt_ptmax = fs->make("h_rt_gmt_ptmax","h_rt_gmt_ptmax",600, 0.,150.); + h_rt_gmt_ptmax_sing = fs->make("h_rt_gmt_ptmax_sing","h_rt_gmt_ptmax_sing",600, 0.,150.); + h_rt_gmt_ptmax_sing_3s = fs->make("h_rt_gmt_ptmax_sing_3s","h_rt_gmt_ptmax_sing_3s",600, 0.,150.); + h_rt_gmt_ptmax_sing_csc = fs->make("h_rt_gmt_ptmax_sing_csc","h_rt_gmt_ptmax_sing_csc",600, 0.,150.); + h_rt_gmt_ptmax_sing_1b = fs->make("h_rt_gmt_ptmax_sing_1b","h_rt_gmt_ptmax_sing_no1a",600, 0.,150.); + h_rt_gmt_ptmax_sing_no1a = fs->make("h_rt_gmt_ptmax_sing_no1a","h_rt_gmt_ptmax_sing_no1a",600, 0.,150.); + h_rt_gmt_ptmax_sing6 = fs->make("h_rt_gmt_ptmax_sing6","h_rt_gmt_ptmax_sing6",600, 0.,150.); + h_rt_gmt_ptmax_sing6_3s = fs->make("h_rt_gmt_ptmax_sing6_3s","h_rt_gmt_ptmax_sing6_3s",600, 0.,150.); + h_rt_gmt_ptmax_sing6_csc = fs->make("h_rt_gmt_ptmax_sing6_csc","h_rt_gmt_ptmax_sing6_csc",600, 0.,150.); + h_rt_gmt_ptmax_sing6_1b = fs->make("h_rt_gmt_ptmax_sing6_1b","h_rt_gmt_ptmax_sing6_1b",600, 0.,150.); + h_rt_gmt_ptmax_sing6_no1a = fs->make("h_rt_gmt_ptmax_sing6_no1a","h_rt_gmt_ptmax_sing6_no1a",600, 0.,150.); + h_rt_gmt_ptmax_sing6_3s1b_no1a = fs->make("h_rt_gmt_ptmax_sing6_3s1b_no1a","h_rt_gmt_ptmax_sing6_3s1b_no1a",600, 0.,150.); + h_rt_gmt_ptmax_dbl = fs->make("h_rt_gmt_ptmax_dbl","h_rt_gmt_ptmax_dbl",600, 0.,150.); + h_rt_gmt_pt_2s42 = fs->make("h_rt_gmt_pt_2s42","h_rt_gmt_pt_2s42",600, 0.,150.); + h_rt_gmt_pt_3s42 = fs->make("h_rt_gmt_pt_3s42","h_rt_gmt_pt_3s42",600, 0.,150.); + h_rt_gmt_ptmax_2s42 = fs->make("h_rt_gmt_ptmax_2s42","h_rt_gmt_ptmax_2s42",600, 0.,150.); + h_rt_gmt_ptmax_3s42 = fs->make("h_rt_gmt_ptmax_3s42","h_rt_gmt_ptmax_3s42",600, 0.,150.); + h_rt_gmt_ptmax_2s42_sing = fs->make("h_rt_gmt_ptmax_2s42_sing","h_rt_gmt_ptmax_2s42_sing",600, 0.,150.); + h_rt_gmt_ptmax_3s42_sing = fs->make("h_rt_gmt_ptmax_3s42_sing","h_rt_gmt_ptmax_3s42_sing",600, 0.,150.); + h_rt_gmt_pt_2q42 = fs->make("h_rt_gmt_pt_2q42","h_rt_gmt_pt_2q42",600, 0.,150.); + h_rt_gmt_pt_3q42 = fs->make("h_rt_gmt_pt_3q42","h_rt_gmt_pt_3q42",600, 0.,150.); + h_rt_gmt_ptmax_2q42 = fs->make("h_rt_gmt_ptmax_2q42","h_rt_gmt_ptmax_2q42",600, 0.,150.); + h_rt_gmt_ptmax_3q42 = fs->make("h_rt_gmt_ptmax_3q42","h_rt_gmt_ptmax_3q42",600, 0.,150.); + h_rt_gmt_ptmax_2q42_sing = fs->make("h_rt_gmt_ptmax_2q42_sing","h_rt_gmt_ptmax_2q42_sing",600, 0.,150.); + h_rt_gmt_ptmax_3q42_sing = fs->make("h_rt_gmt_ptmax_3q42_sing","h_rt_gmt_ptmax_3q42_sing",600, 0.,150.); + h_rt_gmt_pt_2s42r = fs->make("h_rt_gmt_pt_2s42r","h_rt_gmt_pt_2s42r",600, 0.,150.); + h_rt_gmt_pt_3s42r = fs->make("h_rt_gmt_pt_3s42r","h_rt_gmt_pt_3s42r",600, 0.,150.); + h_rt_gmt_ptmax_2s42r = fs->make("h_rt_gmt_ptmax_2s42r","h_rt_gmt_ptmax_2s42r",600, 0.,150.); + h_rt_gmt_ptmax_3s42r = fs->make("h_rt_gmt_ptmax_3s42r","h_rt_gmt_ptmax_3s42r",600, 0.,150.); + h_rt_gmt_ptmax_2s42r_sing = fs->make("h_rt_gmt_ptmax_2s42r_sing","h_rt_gmt_ptmax_2s42r_sing",600, 0.,150.); + h_rt_gmt_ptmax_3s42r_sing = fs->make("h_rt_gmt_ptmax_3s42r_sing","h_rt_gmt_ptmax_3s42r_sing",600, 0.,150.); + h_rt_gmt_pt_2q42r = fs->make("h_rt_gmt_pt_2q42r","h_rt_gmt_pt_2q42r",600, 0.,150.); + h_rt_gmt_pt_3q42r = fs->make("h_rt_gmt_pt_3q42r","h_rt_gmt_pt_3q42r",600, 0.,150.); + h_rt_gmt_ptmax_2q42r = fs->make("h_rt_gmt_ptmax_2q42r","h_rt_gmt_ptmax_2q42r",600, 0.,150.); + h_rt_gmt_ptmax_3q42r = fs->make("h_rt_gmt_ptmax_3q42r","h_rt_gmt_ptmax_3q42r",600, 0.,150.); + h_rt_gmt_ptmax_2q42r_sing = fs->make("h_rt_gmt_ptmax_2q42r_sing","h_rt_gmt_ptmax_2q42r_sing",600, 0.,150.); + h_rt_gmt_ptmax_3q42r_sing = fs->make("h_rt_gmt_ptmax_3q42r_sing","h_rt_gmt_ptmax_3q42r_sing",600, 0.,150.); + + + h_rt_gmt_csc_eta = fs->make("h_rt_gmt_csc_eta","h_rt_gmt_csc_eta",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax10_eta_2s = fs->make("h_rt_gmt_csc_ptmax10_eta_2s","h_rt_gmt_csc_ptmax10_eta_2s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax10_eta_2s_2s1b = fs->make("h_rt_gmt_csc_ptmax10_eta_2s_2s1b","h_rt_gmt_csc_ptmax10_eta_2s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax10_eta_3s = fs->make("h_rt_gmt_csc_ptmax10_eta_3s","h_rt_gmt_csc_ptmax10_eta_3s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax10_eta_3s_1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_1b","h_rt_gmt_csc_ptmax10_eta_3s_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax10_eta_3s_no1a = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_no1a","h_rt_gmt_csc_ptmax10_eta_3s_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax10_eta_3s_2s1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s1b","h_rt_gmt_csc_ptmax10_eta_3s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax10_eta_3s_2s1b_1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s1b_1b","h_rt_gmt_csc_ptmax10_eta_3s_2s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax10_eta_3s_2s123_1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s123_1b","h_rt_gmt_csc_ptmax10_eta_3s_2s123_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax10_eta_3s_2s13_1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s13_1b","h_rt_gmt_csc_ptmax10_eta_3s_2s13_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax10_eta_3s_2s1b_no1a = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s1b_no1a","h_rt_gmt_csc_ptmax10_eta_3s_2s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax10_eta_3s_2s123_no1a = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s123_no1a","h_rt_gmt_csc_ptmax10_eta_3s_2s123_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax10_eta_3s_2s13_no1a = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s13_no1a","h_rt_gmt_csc_ptmax10_eta_3s_2s13_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax10_eta_3s_3s1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_3s1b","h_rt_gmt_csc_ptmax10_eta_3s_3s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax10_eta_3s_3s1b_1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_3s1b_1b","h_rt_gmt_csc_ptmax10_eta_3s_3s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax10_eta_3s_3s1b_no1a = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_3s1b_no1a","h_rt_gmt_csc_ptmax10_eta_3s_3s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax10_eta_2q = fs->make("h_rt_gmt_csc_ptmax10_eta_2q","h_rt_gmt_csc_ptmax10_eta_2q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax10_eta_3q = fs->make("h_rt_gmt_csc_ptmax10_eta_3q","h_rt_gmt_csc_ptmax10_eta_3q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + + h_rt_gmt_csc_ptmax20_eta_2s = fs->make("h_rt_gmt_csc_ptmax20_eta_2s","h_rt_gmt_csc_ptmax20_eta_2s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax20_eta_2s_2s1b = fs->make("h_rt_gmt_csc_ptmax20_eta_2s_2s1b","h_rt_gmt_csc_ptmax20_eta_2s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax20_eta_3s = fs->make("h_rt_gmt_csc_ptmax20_eta_3s","h_rt_gmt_csc_ptmax20_eta_3s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + + h_rt_gmt_csc_ptmax20_eta_3s_1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_1b","h_rt_gmt_csc_ptmax20_eta_3s_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax20_eta_3s_1ab = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_1ab","h_rt_gmt_csc_ptmax20_eta_3s_1ab",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + + h_rt_gmt_csc_ptmax20_eta_3s_no1a = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_no1a","h_rt_gmt_csc_ptmax20_eta_3s_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax20_eta_3s_2s1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s1b","h_rt_gmt_csc_ptmax20_eta_3s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax20_eta_3s_2s1b_1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s1b_1b","h_rt_gmt_csc_ptmax20_eta_3s_2s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax20_eta_3s_2s123_1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s123_1b","h_rt_gmt_csc_ptmax20_eta_3s_2s123_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax20_eta_3s_2s13_1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s13_1b","h_rt_gmt_csc_ptmax20_eta_3s_2s13_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax20_eta_3s_2s1b_no1a = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s1b_no1a","h_rt_gmt_csc_ptmax20_eta_3s_2s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax20_eta_3s_2s123_no1a = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s123_no1a","h_rt_gmt_csc_ptmax20_eta_3s_2s123_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax20_eta_3s_2s13_no1a = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s13_no1a","h_rt_gmt_csc_ptmax20_eta_3s_2s13_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + + h_rt_gmt_csc_ptmax20_eta_3s_3s1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_3s1b","h_rt_gmt_csc_ptmax20_eta_3s_3s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax20_eta_3s_3s1ab = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_3s1ab","h_rt_gmt_csc_ptmax20_eta_3s_3s1ab",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + + h_rt_gmt_csc_ptmax20_eta_3s_3s1b_1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_3s1b_1b","h_rt_gmt_csc_ptmax20_eta_3s_3s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax20_eta_3s_3s1b_no1a = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_3s1b_no1a","h_rt_gmt_csc_ptmax20_eta_3s_3s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax20_eta_2q = fs->make("h_rt_gmt_csc_ptmax20_eta_2q","h_rt_gmt_csc_ptmax20_eta_2q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax20_eta_3q = fs->make("h_rt_gmt_csc_ptmax20_eta_3q","h_rt_gmt_csc_ptmax20_eta_3q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + + h_rt_gmt_csc_ptmax30_eta_2s = fs->make("h_rt_gmt_csc_ptmax30_eta_2s","h_rt_gmt_csc_ptmax30_eta_2s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax30_eta_2s_2s1b = fs->make("h_rt_gmt_csc_ptmax30_eta_2s_2s1b","h_rt_gmt_csc_ptmax30_eta_2s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax30_eta_3s = fs->make("h_rt_gmt_csc_ptmax30_eta_3s","h_rt_gmt_csc_ptmax30_eta_3s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + + h_rt_gmt_csc_ptmax30_eta_3s_1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_1b","h_rt_gmt_csc_ptmax30_eta_3s_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax30_eta_3s_1ab = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_1ab","h_rt_gmt_csc_ptmax30_eta_3s_1ab",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + + h_rt_gmt_csc_ptmax30_eta_3s_no1a = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_no1a","h_rt_gmt_csc_ptmax30_eta_3s_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax30_eta_3s_2s1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s1b","h_rt_gmt_csc_ptmax30_eta_3s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax30_eta_3s_2s1b_1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s1b_1b","h_rt_gmt_csc_ptmax30_eta_3s_2s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax30_eta_3s_2s123_1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s123_1b","h_rt_gmt_csc_ptmax30_eta_3s_2s123_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax30_eta_3s_2s13_1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s13_1b","h_rt_gmt_csc_ptmax30_eta_3s_2s13_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax30_eta_3s_2s1b_no1a = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s1b_no1a","h_rt_gmt_csc_ptmax30_eta_3s_2s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax30_eta_3s_2s123_no1a = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s123_no1a","h_rt_gmt_csc_ptmax30_eta_3s_2s123_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax30_eta_3s_2s13_no1a = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s13_no1a","h_rt_gmt_csc_ptmax30_eta_3s_2s13_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + + h_rt_gmt_csc_ptmax30_eta_3s_3s1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_3s1b","h_rt_gmt_csc_ptmax30_eta_3s_3s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax30_eta_3s_3s1ab = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_3s1ab","h_rt_gmt_csc_ptmax30_eta_3s_3s1ab",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + + + h_rt_gmt_csc_ptmax30_eta_3s_3s1b_1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_3s1b_1b","h_rt_gmt_csc_ptmax30_eta_3s_3s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax30_eta_3s_3s1b_no1a = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_3s1b_no1a","h_rt_gmt_csc_ptmax30_eta_3s_3s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax30_eta_2q = fs->make("h_rt_gmt_csc_ptmax30_eta_2q","h_rt_gmt_csc_ptmax30_eta_2q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + h_rt_gmt_csc_ptmax30_eta_3q = fs->make("h_rt_gmt_csc_ptmax30_eta_3q","h_rt_gmt_csc_ptmax30_eta_3q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + + h_rt_gmt_rpcf_eta = fs->make("h_rt_gmt_rpcf_eta","h_rt_gmt_rpcf_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); + h_rt_gmt_rpcf_ptmax10_eta = fs->make("h_rt_gmt_rpcf_ptmax10_eta","h_rt_gmt_rpcf_ptmax10_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); + h_rt_gmt_rpcf_ptmax20_eta = fs->make("h_rt_gmt_rpcf_ptmax20_eta","h_rt_gmt_rpcf_ptmax20_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); + h_rt_gmt_rpcb_eta = fs->make("h_rt_gmt_rpcb_eta","h_rt_gmt_rpcb_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); + h_rt_gmt_rpcb_ptmax10_eta = fs->make("h_rt_gmt_rpcb_ptmax10_eta","h_rt_gmt_rpcb_ptmax10_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); + h_rt_gmt_rpcb_ptmax20_eta = fs->make("h_rt_gmt_rpcb_ptmax20_eta","h_rt_gmt_rpcb_ptmax20_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); + h_rt_gmt_dt_eta = fs->make("h_rt_gmt_dt_eta","h_rt_gmt_dt_eta",N_ETA_BINS_DT, ETA_START_DT, ETA_END_DT); + h_rt_gmt_dt_ptmax10_eta = fs->make("h_rt_gmt_dt_ptmax10_eta","h_rt_gmt_dt_ptmax10_eta",N_ETA_BINS_DT, ETA_START_DT, ETA_END_DT); + h_rt_gmt_dt_ptmax20_eta = fs->make("h_rt_gmt_dt_ptmax20_eta","h_rt_gmt_dt_ptmax20_eta",N_ETA_BINS_DT, ETA_START_DT, ETA_END_DT); + h_rt_gmt_eta = fs->make("h_rt_gmt_eta","h_rt_gmt_eta",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax10_eta = fs->make("h_rt_gmt_ptmax10_eta","h_rt_gmt_ptmax10_eta",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax10_eta_sing = fs->make("h_rt_gmt_ptmax10_eta_sing","h_rt_gmt_ptmax10_eta_sing",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax10_eta_sing_3s = fs->make("h_rt_gmt_ptmax10_eta_sing_3s","h_rt_gmt_ptmax10_eta_sing_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax10_eta_sing6 = fs->make("h_rt_gmt_ptmax10_eta_sing6","h_rt_gmt_ptmax10_eta_sing6",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax10_eta_sing6_3s = fs->make("h_rt_gmt_ptmax10_eta_sing6_3s","h_rt_gmt_ptmax10_eta_sing6_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax20_eta = fs->make("h_rt_gmt_ptmax20_eta","h_rt_gmt_ptmax20_eta",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax20_eta_sing = fs->make("h_rt_gmt_ptmax20_eta_sing","h_rt_gmt_ptmax20_eta_sing",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax20_eta_sing_csc = fs->make("h_rt_gmt_ptmax20_eta_sing_csc","h_rt_gmt_ptmax20_eta_sing_csc",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax20_eta_sing_dtcsc = fs->make("h_rt_gmt_ptmax20_eta_sing_dtcsc","h_rt_gmt_ptmax20_eta_sing_dtcsc",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax20_eta_sing_3s = fs->make("h_rt_gmt_ptmax20_eta_sing_3s","h_rt_gmt_ptmax20_eta_sing_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax20_eta_sing6 = fs->make("h_rt_gmt_ptmax20_eta_sing6","h_rt_gmt_ptmax20_eta_sing6",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax20_eta_sing6_csc = fs->make("h_rt_gmt_ptmax20_eta_sing6_csc","h_rt_gmt_ptmax20_eta_sing6_csc",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax20_eta_sing6_3s = fs->make("h_rt_gmt_ptmax20_eta_sing6_3s","h_rt_gmt_ptmax20_eta_sing6_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax30_eta_sing = fs->make("h_rt_gmt_ptmax30_eta_sing","h_rt_gmt_ptmax30_eta_sing",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax30_eta_sing_csc = fs->make("h_rt_gmt_ptmax30_eta_sing_csc","h_rt_gmt_ptmax30_eta_sing_csc",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax30_eta_sing_dtcsc = fs->make("h_rt_gmt_ptmax30_eta_sing_dtcsc","h_rt_gmt_ptmax30_eta_sing_dtcsc",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax30_eta_sing_3s = fs->make("h_rt_gmt_ptmax30_eta_sing_3s","h_rt_gmt_ptmax30_eta_sing_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax30_eta_sing6 = fs->make("h_rt_gmt_ptmax30_eta_sing6","h_rt_gmt_ptmax30_eta_sing6",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax30_eta_sing6_csc = fs->make("h_rt_gmt_ptmax30_eta_sing6_csc","h_rt_gmt_ptmax30_eta_sing6_csc",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax30_eta_sing6_3s = fs->make("h_rt_gmt_ptmax30_eta_sing6_3s","h_rt_gmt_ptmax30_eta_sing6_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); + + h_rt_gmt_ptmax10_eta_dbl = fs->make("h_rt_gmt_ptmax10_eta_dbl","h_rt_gmt_ptmax10_eta_dbl",N_ETA_BINS_GMT, ETA_BINS_GMT); + h_rt_gmt_ptmax20_eta_dbl = fs->make("h_rt_gmt_ptmax20_eta_dbl","h_rt_gmt_ptmax20_eta_dbl",N_ETA_BINS_GMT, ETA_BINS_GMT); + + const int Nthr = 7; + std::string str_pts[Nthr] = {"", "_pt10", "_pt15", "_pt20", "_pt25", "_pt30","_pt40"}; + + for (int i = 1; i < Nthr; ++i) { + std::string prefix = "h_rt_gmt_csc_mode_2s1b_1b_"; + h_rt_gmt_csc_mode_2s1b_1b[i-1] = fs->make((prefix + str_pts[i]).c_str(), (prefix + str_pts[i]).c_str(), 16, -0.5, 15.5); + setupTFModeHisto(h_rt_gmt_csc_mode_2s1b_1b[i-1]); + } + + h_rt_tfcand_pt_2st = fs->make("h_rt_tfcand_pt_2st","h_rt_tfcand_pt_2st",600, 0.,150.); + h_rt_tfcand_pt_3st = fs->make("h_rt_tfcand_pt_3st","h_rt_tfcand_pt_3st",600, 0.,150.); + + h_rt_tfcand_pt_h42_2st = fs->make("h_rt_tfcand_pt_h42_2st","h_rt_tfcand_pt_h42_2st",600, 0.,150.); + h_rt_tfcand_pt_h42_3st = fs->make("h_rt_tfcand_pt_h42_3st","h_rt_tfcand_pt_h42_3st",600, 0.,150.); + + h_rt_tftrack_bx = fs->make("h_rt_tftrack_bx","h_rt_tftrack_bx",13,-6.5, 6.5); + h_rt_tfcand_bx = fs->make("h_rt_tfcand_bx","h_rt_tfcand_bx",13,-6.5, 6.5); + h_rt_gmt_csc_bx = fs->make("h_rt_gmt_csc_bx","h_rt_gmt_csc_bx",13,-6.5, 6.5); + h_rt_gmt_rpcf_bx = fs->make("h_rt_gmt_rpcf_bx","h_rt_gmt_rpcf_bx",13,-6.5, 6.5); + h_rt_gmt_rpcb_bx = fs->make("h_rt_gmt_rpcb_bx","h_rt_gmt_rpcb_bx",13,-6.5, 6.5); + h_rt_gmt_dt_bx = fs->make("h_rt_gmt_dt_bx","h_rt_gmt_dt_bx",13,-6.5, 6.5); + h_rt_gmt_bx = fs->make("h_rt_gmt_bx","h_rt_gmt_bx",13,-6.5, 6.5); + + h_rt_gmt_csc_q = fs->make("h_rt_gmt_csc_q","h_rt_gmt_csc_q",8,-.5, 7.5); + h_rt_gmt_csc_q_42 = fs->make("h_rt_gmt_csc_q_42","h_rt_gmt_csc_q_42",8,-.5, 7.5); + h_rt_gmt_csc_q_42r = fs->make("h_rt_gmt_csc_q_42r","h_rt_gmt_csc_q_42r",8,-.5, 7.5); + h_rt_gmt_rpcf_q = fs->make("h_rt_gmt_rpcf_q","h_rt_gmt_rpcf_q",8,-.5, 7.5); + h_rt_gmt_rpcf_q_42 = fs->make("h_rt_gmt_rpcf_q_42","h_rt_gmt_rpcf_q_42",8,-.5, 7.5); + h_rt_gmt_rpcb_q = fs->make("h_rt_gmt_rpcb_q","h_rt_gmt_rpcb_q",8,-.5, 7.5); + h_rt_gmt_dt_q = fs->make("h_rt_gmt_dt_q","h_rt_gmt_dt_q",8,-.5, 7.5); + h_rt_gmt_gq = fs->make("h_rt_gmt_gq","h_rt_gmt_gq",8,-.5, 7.5); + h_rt_gmt_gq_42 = fs->make("h_rt_gmt_gq_42","h_rt_gmt_gq_42",8,-.5, 7.5); + h_rt_gmt_gq_42r = fs->make("h_rt_gmt_gq_42","h_rt_gmt_gq_42r",8,-.5, 7.5); + h_rt_gmt_gq_vs_pt_42r = fs->make("h_rt_gmt_gq_vs_pt_42r","h_rt_gmt_gq_vs_pt_42r",8,-.5, 7.5, 600, 0.,150.); + h_rt_gmt_gq_vs_type_42r = fs->make("h_rt_gmt_gq_vs_type_42r","h_rt_gmt_gq_vs_type_42r",8,-.5, 7.5, 7,-0.5,6.5); + h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(1,"?"); + h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(2,"RPC q=0"); + h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(3,"RPC q=1"); + h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(4,"CSC q=1"); + h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(5,"CSC q=2"); + h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(6,"CSC q=3"); + h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(7,"matched"); + + h_rt_tftrack_mode = fs->make("h_rt_tftrack_mode","TF Track Mode", 16, -0.5, 15.5); + setupTFModeHisto(h_rt_tftrack_mode); + h_rt_tftrack_mode->SetTitle("TF Track Mode (all TF tracks)"); + + h_rt_n_ch_alct_per_bx = fs->make("h_rt_n_ch_alct_per_bx", "h_rt_n_ch_alct_per_bx", 51,-0.5, 50.5); + h_rt_n_ch_clct_per_bx = fs->make("h_rt_n_ch_clct_per_bx", "h_rt_n_ch_clct_per_bx", 51,-0.5, 50.5); + h_rt_n_ch_lct_per_bx = fs->make("h_rt_n_ch_lct_per_bx", "h_rt_n_ch_lct_per_bx", 51,-0.5, 50.5); + + + h_rt_tfcand_eta = fs->make("h_rt_tfcand_eta","h_rt_tfcand_eta",N_ETA_BINS, ETA_START, ETA_END); + h_rt_tfcand_eta_pt5 = fs->make("h_rt_tfcand_eta_pt5","h_rt_tfcand_eta_pt5",N_ETA_BINS, ETA_START, ETA_END); + h_rt_tfcand_eta_pt10 = fs->make("h_rt_tfcand_eta_pt10","h_rt_tfcand_eta_pt10",N_ETA_BINS, ETA_START, ETA_END); + h_rt_tfcand_eta_pt15 = fs->make("h_rt_tfcand_eta_pt15","h_rt_tfcand_eta_pt15",N_ETA_BINS, ETA_START, ETA_END); + + h_rt_tfcand_eta_3st = fs->make("h_rt_tfcand_eta_3st","h_rt_tfcand_eta_3st",N_ETA_BINS, ETA_START, ETA_END); + h_rt_tfcand_eta_pt5_3st = fs->make("h_rt_tfcand_eta_pt5_3st","h_rt_tfcand_eta_pt5_3st",N_ETA_BINS, ETA_START, ETA_END); + h_rt_tfcand_eta_pt10_3st = fs->make("h_rt_tfcand_eta_pt10_3st","h_rt_tfcand_eta_pt10_3st",N_ETA_BINS, ETA_START, ETA_END); + h_rt_tfcand_eta_pt15_3st = fs->make("h_rt_tfcand_eta_pt15_3st","h_rt_tfcand_eta_pt15_3st",N_ETA_BINS, ETA_START, ETA_END); + + h_rt_tfcand_eta_3st1a = fs->make("h_rt_tfcand_eta_3st1a","h_rt_tfcand_eta_3st1a",N_ETA_BINS, ETA_START, ETA_END); + h_rt_tfcand_eta_pt5_3st1a = fs->make("h_rt_tfcand_eta_pt5_3st1a","h_rt_tfcand_eta_pt5_3st1a",N_ETA_BINS, ETA_START, ETA_END); + h_rt_tfcand_eta_pt10_3st1a = fs->make("h_rt_tfcand_eta_pt10_3st1a","h_rt_tfcand_eta_pt10_3st1a",N_ETA_BINS, ETA_START, ETA_END); + h_rt_tfcand_eta_pt15_3st1a = fs->make("h_rt_tfcand_eta_pt15_3st1a","h_rt_tfcand_eta_pt15_3st1a",N_ETA_BINS, ETA_START, ETA_END); + + h_rt_tfcand_pt_vs_eta = fs->make("h_rt_tfcand_pt_vs_eta","h_rt_tfcand_pt_vs_eta",600, 0.,150.,N_ETA_BINS, ETA_START, ETA_END); + h_rt_tfcand_pt_vs_eta_3st = fs->make("h_rt_tfcand_pt_vs_eta_3st","h_rt_tfcand_pt_vs_eta_3st",600, 0.,150.,N_ETA_BINS, ETA_START, ETA_END); + h_rt_tfcand_pt_vs_eta_3st1a = fs->make("h_rt_tfcand_pt_vs_eta_3st1a","h_rt_tfcand_pt_vs_eta_3st1a",600, 0.,150.,N_ETA_BINS, ETA_START, ETA_END); + + char label[200]; + for (int me=0; me<=CSC_TYPES; me++) + { + if (me==3 && !doME1a_) continue; // ME1/a + + sprintf(label,"h_rt_n_per_ch_alct_vs_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); + h_rt_n_per_ch_alct_vs_bx_cscdet[me] = fs->make(label, label, 5,0,5, 16,-.5, 15.5); + + sprintf(label,"h_rt_n_per_ch_clct_vs_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); + h_rt_n_per_ch_clct_vs_bx_cscdet[me] = fs->make(label, label, 5,0,5, 16,-.5, 15.5); + + sprintf(label,"h_rt_n_per_ch_lct_vs_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); + h_rt_n_per_ch_lct_vs_bx_cscdet[me] = fs->make(label, label, 5,0,5, 16,-.5, 15.5); + + + sprintf(label,"h_rt_n_ch_alct_per_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); + h_rt_n_ch_alct_per_bx_cscdet[me] = fs->make(label, label, 51,-0.5, 50.5); + + sprintf(label,"h_rt_n_ch_clct_per_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); + h_rt_n_ch_clct_per_bx_cscdet[me] = fs->make(label, label, 51,-0.5, 50.5); + + sprintf(label,"h_rt_n_ch_lct_per_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); + h_rt_n_ch_lct_per_bx_cscdet[me] = fs->make(label, label, 51,-0.5, 50.5); + + + sprintf(label,"h_rt_mplct_pattern_cscdet_%s",mugeo::csc_type_[me].c_str()); + h_rt_mplct_pattern_cscdet[me] = fs->make(label, label, 13,-0.5, 12.5); + + + sprintf(label,"h_rt_alct_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); + h_rt_alct_bx_cscdet[me] = fs->make(label, label,13,-6.5, 6.5); + sprintf(label,"h_rt_clct_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); + h_rt_clct_bx_cscdet[me] = fs->make(label, label,13,-6.5, 6.5); + sprintf(label,"h_rt_lct_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); + h_rt_lct_bx_cscdet[me] = fs->make(label, label,13,-6.5, 6.5); + sprintf(label,"h_rt_mplct_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); + h_rt_mplct_bx_cscdet[me] = fs->make(label, label,13,-6.5, 6.5); + + }//for (int me=0; memake("h_rt_lct_per_sector","h_rt_lct_per_sector",20,0., 20.); + h_rt_lct_per_sector_vs_bx = fs->make("h_rt_lct_per_sector_vs_bx","h_rt_lct_per_sector_vs_bx",20,0., 20.,16,0,16); + h_rt_mplct_per_sector = fs->make("h_rt_mplct_per_sector","h_rt_mplct_per_sector",20,0., 20.); + h_rt_mplct_per_sector_vs_bx = fs->make("h_rt_mplct_per_sector_vs_bx","h_rt_mplct_per_sector_vs_bx",20,0., 20.,16,0,16); + h_rt_lct_per_sector_vs_bx_st1t = fs->make("h_rt_lct_per_sector_vs_bx_st1t","h_rt_lct_per_sector_vs_bx_st1t",20,0., 20.,16,0,16); + h_rt_mplct_per_sector_vs_bx_st1t = fs->make("h_rt_mplct_per_sector_vs_bx_st1t","h_rt_mplct_per_sector_vs_bx_st1t",20,0., 20.,16,0,16); + + for (int i=0; imake(label, label, 51,-0.5, 50.5); + + sprintf(label,"h_rt_n_ch_clct_per_bx_st%d",i+1); + h_rt_n_ch_clct_per_bx_st[i] = fs->make(label, label, 51,-0.5, 50.5); + + sprintf(label,"h_rt_n_ch_lct_per_bx_st%d",i+1); + h_rt_n_ch_lct_per_bx_st[i] = fs->make(label, label, 51,-0.5, 50.5); + + + sprintf(label,"h_rt_lct_per_sector_st%d",i+1); + h_rt_lct_per_sector_st[i] = fs->make(label, label, 20,0., 20.); + + sprintf(label,"h_rt_lct_per_sector_vs_bx_st%d",i+1); + h_rt_lct_per_sector_vs_bx_st[i] = fs->make(label, label, 20,0., 20.,16,0,16); + + sprintf(label,"h_rt_mplct_per_sector_st%d",i+1); + h_rt_mplct_per_sector_st[i] = fs->make(label, label, 20,0., 20.); + + sprintf(label,"h_rt_mplct_per_sector_vs_bx_st%d",i+1); + h_rt_mplct_per_sector_vs_bx_st[i] = fs->make(label, label, 20,0., 20.,16,0,16); + + } + + h_rt_mplct_pattern = fs->make("h_rt_mplct_pattern","h_rt_mplct_pattern",13,-0.5, 12.5); + + + h_gmt_mindr = fs->make("h_gmt_mindr","h_gmt_mindr",500, 0, 2*M_PI); + h_gmt_dr_maxrank = fs->make("h_gmt_dr_maxrank","h_gmt_dr_maxrank",500, 0, 2*M_PI); +} + + +// ================================================================================================ +void +GEMCSCTriggerRateTree::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + // ALCTs and CLCTs + edm::Handle< CSCALCTDigiCollection > halcts; + iEvent.getByLabel("simCscTriggerPrimitiveDigis", halcts); + const CSCALCTDigiCollection* alcts = halcts.product(); + edm::Handle< CSCCLCTDigiCollection > hclcts; + iEvent.getByLabel("simCscTriggerPrimitiveDigis", hclcts); + const CSCCLCTDigiCollection* clcts = hclcts.product(); + + // strip&wire matching output after TMB and after MPC sorting + edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_tmb; + edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_mpc; + iEvent.getByLabel("simCscTriggerPrimitiveDigis", lcts_tmb); + iEvent.getByLabel("simCscTriggerPrimitiveDigis", "MPCSORTED", lcts_mpc); + const CSCCorrelatedLCTDigiCollection* lcts = lcts_tmb.product(); + const CSCCorrelatedLCTDigiCollection* mplcts = lcts_mpc.product(); + + // DT primitives for input to TF + edm::Handle dttrig; + iEvent.getByLabel("simDtTriggerPrimitiveDigis", dttrig); + const L1MuDTChambPhContainer* dttrigs = dttrig.product(); + + // tracks produced by TF + edm::Handle< L1CSCTrackCollection > hl1Tracks; + iEvent.getByLabel("simCsctfTrackDigis",hl1Tracks); + const L1CSCTrackCollection* l1Tracks = hl1Tracks.product(); + + // L1 muon candidates after CSC sorter + edm::Handle< std::vector< L1MuRegionalCand > > hl1TfCands; + iEvent.getByLabel("simCsctfDigis", "CSC", hl1TfCands); + const std::vector< L1MuRegionalCand > *l1TfCands = hl1TfCands.product(); + + // GMT readout collection + edm::Handle< L1MuGMTReadoutCollection > hl1GmtCands; + iEvent.getByLabel("simGmtDigis", hl1GmtCands ) ;// InputTag("simCsctfDigis","CSC") + + //const L1MuGMTReadoutCollection* l1GmtCands = hl1GmtCands.product(); + std::vector l1GmtCands; + std::vector l1GmtfCands; + std::vector l1GmtCSCCands; + std::vector l1GmtRPCfCands; + std::vector l1GmtRPCbCands; + std::vector l1GmtDTCands; + + // key = BX + std::map > l1GmtCSCCandsInBXs; + + // TOCHECK + if ( centralBxOnlyGMT_ ) + { + // Get GMT candidates from central bunch crossing only + l1GmtCands = hl1GmtCands->getRecord().getGMTCands() ; + l1GmtfCands = hl1GmtCands->getRecord().getGMTFwdCands() ; + l1GmtCSCCands = hl1GmtCands->getRecord().getCSCCands() ; + l1GmtRPCfCands = hl1GmtCands->getRecord().getFwdRPCCands() ; + l1GmtRPCbCands = hl1GmtCands->getRecord().getBrlRPCCands() ; + l1GmtDTCands = hl1GmtCands->getRecord().getDTBXCands() ; + l1GmtCSCCandsInBXs[hl1GmtCands->getRecord().getBxInEvent()] = l1GmtCSCCands; + } + else + { + // Get GMT candidates from all bunch crossings + std::vector gmt_records = hl1GmtCands->getRecords(); + for ( std::vector< L1MuGMTReadoutRecord >::const_iterator rItr=gmt_records.begin(); rItr!=gmt_records.end() ; ++rItr ) + { + if (rItr->getBxInEvent() < minBxGMT_ || rItr->getBxInEvent() > maxBxGMT_) continue; + + std::vector GMTCands = rItr->getGMTCands(); + for ( std::vector::const_iterator cItr = GMTCands.begin() ; cItr != GMTCands.end() ; ++cItr ) + if (!cItr->empty()) l1GmtCands.push_back(*cItr); + + std::vector GMTfCands = rItr->getGMTFwdCands(); + for ( std::vector::const_iterator cItr = GMTfCands.begin() ; cItr != GMTfCands.end() ; ++cItr ) + if (!cItr->empty()) l1GmtfCands.push_back(*cItr); + + //std::cout<<" ggg: "< CSCCands = rItr->getCSCCands(); + l1GmtCSCCandsInBXs[rItr->getBxInEvent()] = CSCCands; + for ( std::vector::const_iterator cItr = CSCCands.begin() ; cItr != CSCCands.end() ; ++cItr ) + if (!cItr->empty()) l1GmtCSCCands.push_back(*cItr); + + std::vector RPCfCands = rItr->getFwdRPCCands(); + for ( std::vector::const_iterator cItr = RPCfCands.begin() ; cItr != RPCfCands.end() ; ++cItr ) + if (!cItr->empty()) l1GmtRPCfCands.push_back(*cItr); + + std::vector RPCbCands = rItr->getBrlRPCCands(); + for ( std::vector::const_iterator cItr = RPCbCands.begin() ; cItr != RPCbCands.end() ; ++cItr ) + if (!cItr->empty()) l1GmtRPCbCands.push_back(*cItr); + + std::vector DTCands = rItr->getDTBXCands(); + for ( std::vector::const_iterator cItr = DTCands.begin() ; cItr != DTCands.end() ; ++cItr ) + if (!cItr->empty()) l1GmtDTCands.push_back(*cItr); + } + //std::cout<<" sizes: "<().cacheIdentifier() != muScalesCacheID_ || + iSetup.get< L1MuTriggerPtScaleRcd >().cacheIdentifier() != muPtScaleCacheID_ ) + { + iSetup.get< L1MuTriggerScalesRcd >().get( muScales ); + + iSetup.get< L1MuTriggerPtScaleRcd >().get( muPtScale ); + + if (ptLUT) delete ptLUT; + ptLUT = new CSCTFPtLUT(ptLUTset, muScales.product(), muPtScale.product()); + + for(int e=0; e<2; e++) for (int s=0; s<6; s++){ + if (my_SPs[e][s]) delete my_SPs[e][s]; + my_SPs[e][s] = new CSCTFSectorProcessor(e+1, s+1, CSCTFSPset, true, muScales.product(), muPtScale.product()); + my_SPs[e][s]->initialize(iSetup); + } + muScalesCacheID_ = iSetup.get< L1MuTriggerScalesRcd >().cacheIdentifier(); + muPtScaleCacheID_ = iSetup.get< L1MuTriggerPtScaleRcd >().cacheIdentifier(); + } + + // //======================================================================= + // //============================= RATES =================================== +// analyzeALCTRate(iEvent); +// analyzeCLCTRate(iEvent); +// analyzeLCTRate(iEvent); +// analyzeMPLCTRate(iEvent); +// analyzeTFTrackRate(iEvent); +// analyzeTFCandRate(iEvent); +// analyzeGMTCandRate(iEvent); + + + //============ RATE ALCT ================== + int nalct=0; + int nalct_per_bx[16]; + int n_ch_alct_per_bx[16]; + int n_ch_alct_per_bx_st[MAX_STATIONS][16]; + int n_ch_alct_per_bx_cscdet[CSC_TYPES+1][16]; + for (int b=0;b<16;b++) + { + nalct_per_bx[b] = n_ch_alct_per_bx[b] = 0; + for (int s=0; s > me11alcts; + for (CSCALCTDigiCollection::DigiRangeIterator adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); adetUnitIt++) + { + const CSCDetId& id = (*adetUnitIt).first; + //if (id.endcap() != 1) continue; + CSCDetId idd(id.rawId()); + int csct = getCSCType( idd ); + int cscst = getCSCSpecsType( idd ); + //int is11 = isME11(csct); + int nalct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + const CSCALCTDigiCollection::Range& range = (*adetUnitIt).second; + for (CSCALCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) + { + if ((*digiIt).isValid()) + { + int bx = (*digiIt).getBX(); + //if ( bx-6 < minBX_ || bx-6 > maxBX_ ) + if ( bx < minBxALCT_ || bx > maxBxALCT_ ) + { + if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill( bx - 6 ); + h_rt_alct_bx_cscdet[csct]->Fill( bx - 6 ); + if (bx>=5 && bx<=7) h_rt_csctype_alct_bx567->Fill(cscst); + + } //if (alct_valid) + } + for (int b=0;b<16;b++) + { + if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; + h_rt_n_per_ch_alct_vs_bx_cscdet[csct]->Fill(nalct_per_ch_bx[b],b); + if (nalct_per_ch_bx[b]>0) + { + ++n_ch_alct_per_bx[b]; + ++n_ch_alct_per_bx_st[id.station()-1][b]; + ++n_ch_alct_per_bx_cscdet[csct][b]; + } + } + } // loop CSCALCTDigiCollection + //std::map< CSCDetId , std::vector >::const_iterator mapIt = me11alcts.begin(); + //for (;mapIt != me11alcts.end(); mapIt++){} + std::map< int , std::vector >::const_iterator aMapIt = me11alcts.begin(); + for (;aMapIt != me11alcts.end(); aMapIt++) + { + CSCDetId id(aMapIt->first); + int nalct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + for (size_t i=0; i<(aMapIt->second).size(); i++) + { + int bx = (aMapIt->second)[i]->getBX(); + ++nalct_per_ch_bx[bx]; + } + for (int b=0;b<16;b++) + { + if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; + h_rt_n_per_ch_alct_vs_bx_cscdet[10]->Fill(nalct_per_ch_bx[b],b); + if (nalct_per_ch_bx[b]>0) ++n_ch_alct_per_bx_cscdet[10][b]; + } + } + h_rt_nalct->Fill(nalct); + for (int b=0;b<16;b++) + { + if (b < minBxALCT_ || b > maxBxALCT_) continue; + h_rt_nalct_vs_bx->Fill(nalct_per_bx[b],b); + h_rt_nalct_per_bx->Fill(nalct_per_bx[b]); + h_rt_n_ch_alct_per_bx->Fill(n_ch_alct_per_bx[b]); + for (int s=0; sFill(n_ch_alct_per_bx_st[s][b]); + for (int me=0; me<=CSC_TYPES; me++) + h_rt_n_ch_alct_per_bx_cscdet[me]->Fill(n_ch_alct_per_bx_cscdet[me][b]); + } + + + if (debugRATE) std::cout<< "----- end nalct="< > detCLCT; + detCLCT.clear(); + int nclct=0; + int nclct_per_bx[16]; + int n_ch_clct_per_bx[16]; + int n_ch_clct_per_bx_st[MAX_STATIONS][16]; + int n_ch_clct_per_bx_cscdet[CSC_TYPES+1][16]; + for (int b=0;b<16;b++) + { + nclct_per_bx[b] = n_ch_clct_per_bx[b] = 0; + for (int s=0; sbegin(); cdetUnitIt != clcts->end(); cdetUnitIt++) + { + const CSCDetId& id = (*cdetUnitIt).first; + //if (id.endcap() != 1) continue; + CSCDetId idd(id.rawId()); + int csct = getCSCType( idd ); + int cscst = getCSCSpecsType( idd ); + int nclct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + const CSCCLCTDigiCollection::Range& range = (*cdetUnitIt).second; + for (CSCCLCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) + { + if ((*digiIt).isValid()) + { + // detCLCT[id.rawId()].push_back(*digiIt); + int bx = (*digiIt).getBX(); + //if ( bx-5 < minBX_ || bx-7 > maxBX_ ) + if ( bx < minBxCLCT_ || bx > maxBxCLCT_ ) + { + if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill( bx - 6 ); + h_rt_clct_bx_cscdet[csct]->Fill( bx - 6 ); + if (bx>=5 && bx<=7) h_rt_csctype_clct_bx567->Fill(cscst); + } //if (clct_valid) + } + for (int b=0;b<16;b++) + { + if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; + h_rt_n_per_ch_clct_vs_bx_cscdet[csct]->Fill(nclct_per_ch_bx[b],b); + if (nclct_per_ch_bx[b]>0) { + ++n_ch_clct_per_bx[b]; + ++n_ch_clct_per_bx_st[id.station()-1][b]; + ++n_ch_clct_per_bx_cscdet[csct][b]; + } + } + } // loop CSCCLCTDigiCollection + h_rt_nclct->Fill(nclct); + for (int b=0;b<16;b++) { + if (b < minBxALCT_ || b > maxBxALCT_) continue; + h_rt_nclct_vs_bx->Fill(nclct_per_bx[b],b); + h_rt_nclct_per_bx->Fill(nclct_per_bx[b]); + h_rt_n_ch_clct_per_bx->Fill(n_ch_clct_per_bx[b]); + for (int s=0; sFill(n_ch_clct_per_bx_st[s][b]); + for (int me=0; me<=CSC_TYPES; me++) + h_rt_n_ch_clct_per_bx_cscdet[me]->Fill(n_ch_clct_per_bx_cscdet[me][b]); + } + if (debugRATE) std::cout<< "----- end nclct="< > me11lcts; + if (debugRATE) std::cout<< "----- statring nlct"<begin(); detUnitIt != lcts->end(); detUnitIt++) + { + const CSCDetId& id = (*detUnitIt).first; + //if (id.endcap() != 1) continue; + CSCDetId idd(id.rawId()); + int csct = getCSCType( idd ); + int cscst = getCSCSpecsType( idd ); + CSCDetId id11(id.rawId()); + if (csct==3) id11=CSCDetId(id11.endcap(),1,1,id11.chamber()); + int nlct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + const CSCCorrelatedLCTDigiCollection::Range& range = (*detUnitIt).second; + for (CSCCorrelatedLCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) + { + if ((*digiIt).isValid()) + { + int bx = (*digiIt).getBX(); + //if (debugLCT) std::cout<< "----- LCT in raw ID "< maxBX_ ) + if ( bx < minBxLCT_ || bx > maxBxLCT_ ) + { + if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill( bx - 6 ); + h_rt_lct_bx_cscdet[csct]->Fill( bx - 6 ); + if (bx>=5 && bx<=7) h_rt_csctype_lct_bx567->Fill(cscst); + + h_rt_lct_qu_vs_bx->Fill( quality, bx - 6); + h_rt_lct_qu->Fill( quality ); + + std::map >::const_iterator mapItr = detCLCT.find(id.rawId()); + if(mapItr != detCLCT.end()) + for ( unsigned i=0; isecond.size(); i++ ) + if( (*digiIt).getStrip() == ((mapItr->second)[i]).getKeyStrip() && + (*digiIt).getPattern() == ((mapItr->second)[i]).getPattern() ) + { + h_rt_qu_vs_bxclct__lct->Fill(quality, ((mapItr->second)[i]).getBX() - 6 ); + } + } + } + for (int b=0;b<16;b++) + { + if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; + h_rt_n_per_ch_lct_vs_bx_cscdet[csct]->Fill(nlct_per_ch_bx[b],b); + if (nlct_per_ch_bx[b]>0) { + ++n_ch_lct_per_bx[b]; + ++n_ch_lct_per_bx_st[id.station()-1][b]; + ++n_ch_lct_per_bx_cscdet[csct][b]; + } + } + } + std::map< int , std::vector >::const_iterator mapIt = me11lcts.begin(); + for (;mapIt != me11lcts.end(); mapIt++) + { + CSCDetId id(mapIt->first); + int nlct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + for (size_t i=0; i<(mapIt->second).size(); i++) + { + int bx = (mapIt->second)[i]->getBX(); + ++nlct_per_ch_bx[bx]; + } + for (int b=0;b<16;b++) + { + if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; + h_rt_n_per_ch_lct_vs_bx_cscdet[10]->Fill(nlct_per_ch_bx[b],b); + if (nlct_per_ch_bx[b]>0) ++n_ch_lct_per_bx_cscdet[10][b]; + } + } + h_rt_nlct->Fill(nlct); + for (int b=0;b<16;b++) { + if (b < minBxALCT_ || b > maxBxALCT_) continue; + h_rt_nlct_vs_bx->Fill(nlct_per_bx[b],b); + h_rt_nlct_per_bx->Fill(nlct_per_bx[b]); + h_rt_n_ch_lct_per_bx->Fill(n_ch_lct_per_bx[b]); + for (int s=0; sFill(n_ch_lct_per_bx_st[s][b]); + for (int me=0; me<=CSC_TYPES; me++) + h_rt_n_ch_lct_per_bx_cscdet[me]->Fill(n_ch_lct_per_bx_cscdet[me][b]); + } + for (int s=0; s6) continue; // only ME1 has 12 subsectors + h_rt_lct_per_sector->Fill(nlct_sector_st[s][i]); + h_rt_lct_per_sector_st[s]->Fill(nlct_sector_st[s][i]); + for (int j=0; j<16; j++) { + if ( j < minBxALCT_ || j > maxBxALCT_ ) continue; + h_rt_lct_per_sector_vs_bx->Fill(nlct_sector_bx_st[s][i][j],j+0.5); + h_rt_lct_per_sector_vs_bx_st[s]->Fill(nlct_sector_bx_st[s][i][j],j+0.5); + if (s==0 && i<7) h_rt_lct_per_sector_vs_bx_st1t->Fill(nlct_trigsector_bx_st1[i][j],j+0.5); + } + } + if (debugRATE) std::cout<< "----- end nlct="< rtMPLCTs; + for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator detUnitIt = mplcts->begin(); detUnitIt != mplcts->end(); detUnitIt++) + { + const CSCDetId& id = (*detUnitIt).first; + //if ( id.endcap() != 1) continue; + CSCDetId idd(id.rawId()); + int csct = getCSCType( idd ); + int cscst = getCSCSpecsType( idd ); + const CSCCorrelatedLCTDigiCollection::Range& range = (*detUnitIt).second; + for (CSCCorrelatedLCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) + { + if ((*digiIt).isValid()) + { + //if (debugRATE) std::cout<< "----- MPLCT in raw ID "< maxBX_ ) + if ( bx < minBxMPLCT_ || bx > maxBxMPLCT_ ) + { + if (debugRATE) std::cout<<"discarding BX = "<< (*digiIt).getBX()-6 <Fill( bx - 6 ); + h_rt_mplct_bx_cscdet[csct]->Fill( bx - 6 ); + if (bx>=5 && bx<=7) h_rt_csctype_mplct_bx567->Fill(cscst); + + h_rt_mplct_qu_vs_bx->Fill( quality, bx - 6); + h_rt_mplct_qu->Fill( quality ); + + + h_rt_mplct_pattern->Fill( (*digiIt).getPattern() ); + h_rt_mplct_pattern_cscdet[csct]->Fill( (*digiIt).getPattern() ); + + const bool dbg_lut = false; + if (dbg_lut ) + { + auto etaphi = intersectionEtaPhi(id, (*digiIt).getKeyWG(), (*digiIt).getStrip()); + + //float eta_lut = muScales->getRegionalEtaScale(2)->getCenter(gblEta.global_eta); + //float phi_lut = normalizedPhi( muScales->getPhiScale()->getLowEdge(gblPhi.global_phi)); + csctf::TrackStub stub = buildTrackStub((*digiIt), id); + float eta_lut = stub.etaValue(); + float phi_lut = stub.phiValue(); + + std::cout<<"DBGSRLUT "<Fill(nmplct); + for (int b=0;b<16;b++) { + if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; + h_rt_nmplct_vs_bx->Fill(nmplct_per_bx[b],b); + } + for (int s=0; s6) continue; // only ME1 has 12 subsectors + h_rt_mplct_per_sector->Fill(nmplct_sector_st[s][i]); + h_rt_mplct_per_sector_st[s]->Fill(nmplct_sector_st[s][i]); + for (int j=0; j<16; j++) { + if ( j < minBxALCT_ || j > maxBxALCT_ ) continue; + h_rt_mplct_per_sector_vs_bx->Fill(nmplct_sector_bx_st[s][i][j],j+0.5); + h_rt_mplct_per_sector_vs_bx_st[s]->Fill(nmplct_sector_bx_st[s][i][j],j+0.5); + if (s==0 && i<7) h_rt_mplct_per_sector_vs_bx_st1t->Fill(nmplct_trigsector_bx_st1[i][j],j+0.5); + } + } + if (debugRATE) std::cout<< "----- end nmplct="< rtTFTracks; + // if (debugTFInef && inefTF) std::cout<<"#################### TF INEFFICIENCY ALL TFTRACKs:"<begin(); trk != l1Tracks->end(); trk++) + { + if ( trk->first.bx() < minRateBX_ || trk->first.bx() > maxRateBX_ ) + { + if (debugRATE) std::cout<<"discarding BX = "<< trk->first.bx() <first.endcap()!=1) continue; + + MatchCSCMuL1::TFTRACK myTFTrk; + myTFTrk.init( &(trk->first) , ptLUT, muScales, muPtScale); + myTFTrk.dr = 999.; + + for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator detUnitIt = trk->second.begin(); + detUnitIt != trk->second.end(); detUnitIt++) + { + const CSCDetId& id = (*detUnitIt).first; + CSCDetId cid = id; + const CSCCorrelatedLCTDigiCollection::Range& range = (*detUnitIt).second; + for (CSCCorrelatedLCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) + { + if (!((*digiIt).isValid())) std::cout<<"ALARM!!! match TFCAND to TFTRACK in rates: not valid id="< 127); + if (me1a_case){ + CSCDetId id1a(id.endcap(),id.station(),4,id.chamber(),0); + cid = id1a; + } + //if (id.station()==1 && id.ring()==4) std::cout<<"me1adigi check: "<<(*digiIt)<<" "<= 20. && myTFTrk.hasStub(1) && myTFTrk.hasStub(2)){ + int i1=-1, i2=-1, k=0; + for (auto id: myTFTrk.trgids) + { + if (id.station()==1) i1 = k; + if (id.station()==2) i2 = k; + ++k; + } + if (i1>=0 && i2 >=0 ) { + auto etaphi1 = myTFTrk.trgetaphis[i1]; + auto etaphi2 = myTFTrk.trgetaphis[i2]; + auto d = myTFTrk.trgids[i1]; + auto &stub = *(myTFTrk.trgdigis[i1]); + std::cout<<"DBGdeta12 "< 0.1) { + myTFTrk.print(""); + std::cout<<"############### CSCTFSPCoreLogic printout for large deta12 = "<Fill(myTFTrk.pt); + h_rt_tftrack_bx->Fill(trk->first.bx()); + h_rt_tftrack_mode->Fill(myTFTrk.mode()); + } + h_rt_ntftrack->Fill(ntftrack); + if (debugRATE) std::cout<< "----- end ntftrack="< rtTFCands; + for ( std::vector< L1MuRegionalCand >::const_iterator trk = l1TfCands->begin(); trk != l1TfCands->end(); trk++) + { + if ( trk->bx() < minRateBX_ || trk->bx() > maxRateBX_ ) + { + if (debugRATE) std::cout<<"discarding BX = "<< trk->bx() <eta_packed() & 0x20) == 0) ? 1.:-1; + //if ( sign_eta<0) continue; + if (doSelectEtaForGMTRates_ && sign_eta<0) continue; + + MatchCSCMuL1::TFCAND myTFCand; + myTFCand.init( &*trk , ptLUT, muScales, muPtScale); + myTFCand.dr = 999.; + //double tfpt = myTFCand.pt; + + //if (debugRATE) std::cout<< "----- eta/phi/pt "<eta_packed() & 0x1F) <=10.) ntfcandpt10++; + //h_rt_tfcand_pt->Fill(tfpt); + h_rt_tfcand_bx->Fill(trk->bx()); + + // find TF Candidate's TF Track and its stubs: + myTFCand.tftrack = 0; + for (size_t tt = 0; ttbx() != rtTFTracks[tt].l1trk->bx()|| + trk->phi_packed() != rtTFTracks[tt].phi_packed || + trk->pt_packed() != rtTFTracks[tt].pt_packed || + trk->eta_packed() != rtTFTracks[tt].eta_packed ) continue; + myTFCand.tftrack = &(rtTFTracks[tt]); + // ids now hold *trigger segments IDs* + myTFCand.ids = rtTFTracks[tt].trgids; + myTFCand.nTFStubs = rtTFTracks[tt].nStubs(1,1,1,1,1); + } + rtTFCands.push_back(myTFCand); + if(myTFCand.tftrack == NULL){ + std::cout<<"myTFCand.tftrack == NULL:"<pt_packed()<<" "<eta_packed()<<" "<phi_packed()<<" "<bx()<bx()<pt; + double tfeta = myTFCand.tftrack->eta; + + if (tfpt>=10.) ntfcandpt10++; + + h_rt_tfcand_pt->Fill(tfpt); + + unsigned int ntrg_stubs = myTFCand.tftrack->trgdigis.size(); + if (ntrg_stubs!=myTFCand.ids.size()) + std::cout<<"OBA!!! trgdigis.size()!=ids.size(): "<=2) h_rt_tfcand_pt_2st->Fill(tfpt); + if (ntrg_stubs>=3) h_rt_tfcand_pt_3st->Fill(tfpt); + //std::cout<<"\n nnntf: "<nStubs(0,1,1,1,1)<nStubs()) myTFCand.tftrack->print("non-equal nstubs!"); + //if (fabs(myTFCand.eta)>1.25 && fabs(myTFCand.eta)<1.9) { + if (mugeo::isME42EtaRegion(myTFCand.eta)) { + if (ntrg_stubs>=2) h_rt_tfcand_pt_h42_2st->Fill(tfpt); + if (ntrg_stubs>=3) h_rt_tfcand_pt_h42_3st->Fill(tfpt); + } + + h_rt_tfcand_eta->Fill(tfeta); + if (tfpt>=5.) h_rt_tfcand_eta_pt5->Fill(tfeta); + if (tfpt>=10.) h_rt_tfcand_eta_pt10->Fill(tfeta); + if (tfpt>=15.) h_rt_tfcand_eta_pt15->Fill(tfeta); + h_rt_tfcand_pt_vs_eta->Fill(tfpt,tfeta); + + unsigned ntf_stubs = myTFCand.tftrack->nStubs(); + if (ntf_stubs>=3) { + h_rt_tfcand_eta_3st->Fill(tfeta); + if (tfpt>=5.) h_rt_tfcand_eta_pt5_3st->Fill(tfeta); + if (tfpt>=10.) h_rt_tfcand_eta_pt10_3st->Fill(tfeta); + if (tfpt>=15.) h_rt_tfcand_eta_pt15_3st->Fill(tfeta); + h_rt_tfcand_pt_vs_eta_3st->Fill(tfpt,tfeta); + } + if (tfeta<2.0999 || ntf_stubs>=3) { + h_rt_tfcand_eta_3st1a->Fill(tfeta); + if (tfpt>=5.) h_rt_tfcand_eta_pt5_3st1a->Fill(tfeta); + if (tfpt>=10.) h_rt_tfcand_eta_pt10_3st1a->Fill(tfeta); + if (tfpt>=15.) h_rt_tfcand_eta_pt15_3st1a->Fill(tfeta); + h_rt_tfcand_pt_vs_eta_3st1a->Fill(tfpt,tfeta); + } + } + //else std::cout<<"Strange: myTFCand.tftrack != NULL"<Fill(ntfcand); + h_rt_ntfcand_pt10->Fill(ntfcandpt10); + if (debugRATE) std::cout<< "----- end ntfcand/ntfcandpt10="< rtGMTREGCands; + float max_pt_2s = -1, max_pt_3s = -1, max_pt_2q = -1, max_pt_3q = -1; + float max_pt_2s_eta = -111, max_pt_3s_eta = -111, max_pt_2q_eta = -111, max_pt_3q_eta = -111; + float max_pt_me42_2s = -1, max_pt_me42_3s = -1, max_pt_me42_2q = -1, max_pt_me42_3q = -1; + float max_pt_me42r_2s = -1, max_pt_me42r_3s = -1, max_pt_me42r_2q = -1, max_pt_me42r_3q = -1; + + float max_pt_2s_2s1b = -1, max_pt_2s_2s1b_eta = -111; + float max_pt_2s_no1a = -1;//, max_pt_2s_eta_no1a = -111; + float max_pt_2s_1b = -1;//, max_pt_2s_eta_1b = -111; + float max_pt_3s_no1a = -1, max_pt_3s_eta_no1a = -111; + float max_pt_3s_1b = -1, max_pt_3s_eta_1b = -111; + float max_pt_3s_1ab = -1, max_pt_3s_eta_1ab = -111; + + float max_pt_3s_2s1b = -1, max_pt_3s_2s1b_eta = -111; + float max_pt_3s_2s1b_no1a = -1, max_pt_3s_2s1b_eta_no1a = -111; + float max_pt_3s_2s123_no1a = -1, max_pt_3s_2s123_eta_no1a = -111; + float max_pt_3s_2s13_no1a = -1, max_pt_3s_2s13_eta_no1a = -111; + float max_pt_3s_2s1b_1b = -1, max_pt_3s_2s1b_eta_1b = -111; + float max_pt_3s_2s123_1b = -1, max_pt_3s_2s123_eta_1b = -111; + float max_pt_3s_2s13_1b = -1, max_pt_3s_2s13_eta_1b = -111; + + float max_pt_3s_3s1b = -1, max_pt_3s_3s1b_eta = -111; + float max_pt_3s_3s1b_no1a = -1, max_pt_3s_3s1b_eta_no1a = -111; + float max_pt_3s_3s1b_1b = -1, max_pt_3s_3s1b_eta_1b = -111; + + + float max_pt_3s_3s1ab = -1, max_pt_3s_3s1ab_eta = -111; + float max_pt_3s_3s1ab_no1a = -1;//, max_pt_3s_3s1ab_eta_no1a = -111; + float max_pt_3s_3s1ab_1b = -1;//, max_pt_3s_3s1ab_eta_1b = -111; + + MatchCSCMuL1::TFTRACK *trk__max_pt_3s_3s1b_eta = nullptr; + // MatchCSCMuL1::TFTRACK *trk__max_pt_3s_3s1ab_eta = nullptr; + MatchCSCMuL1::TFTRACK *trk__max_pt_2s1b_1b = nullptr; + const CSCCorrelatedLCTDigi * the_me1_stub = nullptr; + CSCDetId the_me1_id; + std::map bx2n; + for (int bx=minRateBX_; bx<=maxRateBX_; bx++) bx2n[bx]=0; + for ( std::vector::const_iterator trk = l1GmtCSCCands.begin(); trk != l1GmtCSCCands.end(); trk++) + { + if ( trk->bx() < minRateBX_ || trk->bx() > maxRateBX_ ) + { + if (debugRATE) std::cout<<"discarding BX = "<< trk->bx() <eta_packed() & 0x20) == 0) ? 1.:-1; + if (doSelectEtaForGMTRates_ && sign_eta<0) continue; + + bx2n[trk->bx()] += 1; + + MatchCSCMuL1::GMTREGCAND myGMTREGCand; + myGMTREGCand.init( &*trk , muScales, muPtScale); + myGMTREGCand.dr = 999.; + + myGMTREGCand.tfcand = NULL; + for (unsigned i=0; i< rtTFCands.size(); i++) + { + if ( trk->bx() != rtTFCands[i].l1cand->bx() || + trk->phi_packed() != rtTFCands[i].l1cand->phi_packed() || + trk->eta_packed() != rtTFCands[i].l1cand->eta_packed() ) continue; + myGMTREGCand.tfcand = &(rtTFCands[i]); + myGMTREGCand.ids = rtTFCands[i].ids; + myGMTREGCand.nTFStubs = rtTFCands[i].nTFStubs; + break; + } + rtGMTREGCands.push_back(myGMTREGCand); + + float geta = fabs(myGMTREGCand.eta); + float gpt = myGMTREGCand.pt; + + bool eta_me42 = mugeo::isME42EtaRegion(myGMTREGCand.eta); + bool eta_me42r = mugeo::isME42RPCEtaRegion(myGMTREGCand.eta); + //if (geta>=1.2 && geta<=1.8) eta_me42 = 1; + bool eta_q = (geta > 1.2); + + bool has_me1_stub = false; + size_t n_stubs = 0; + + if (myGMTREGCand.tfcand != NULL) + { + //rtGMTREGCands.push_back(myGMTREGCand); + + if (myGMTREGCand.tfcand->tftrack != NULL) + { + has_me1_stub = myGMTREGCand.tfcand->tftrack->hasStub(1); + } + + bool has_1b_stub = false; + for (auto& id: myGMTREGCand.ids) if (id.iChamberType() == 2) { + has_1b_stub = true; + continue; + } + + bool has_1a_stub = false; + for (auto& id: myGMTREGCand.ids) if (id.iChamberType() == 1) { + has_1a_stub = true; + continue; + } + + bool eta_me1b = mugeo::isME1bEtaRegion(myGMTREGCand.eta); + bool eta_me1ab = mugeo::isME1abEtaRegion(myGMTREGCand.eta); + bool eta_me1a = mugeo::isME1aEtaRegion(myGMTREGCand.eta); + bool eta_me1b_whole = mugeo::isME1bEtaRegion(myGMTREGCand.eta, 1.6, 2.14); + bool eta_no1a = (geta >= 1.2 && geta < 2.14); + + n_stubs = myGMTREGCand.nTFStubs; + size_t n_stubs_id = myGMTREGCand.ids.size(); + //if (n_stubs == n_stubs_id) std::cout<<"n_stubs good"<tftrack->trgids; + for (size_t i=0; itftrack->trgdigis)[i]; + the_me1_id = stub_ids[i]; + } + + int tf_mode = myGMTREGCand.tfcand->tftrack->mode(); + bool ok_2s123 = (tf_mode != 0xd); // excludes ME1-ME4 stub tf tracks + bool ok_2s13 = (ok_2s123 && (tf_mode != 0x6)); // excludes ME1-ME2 and ME1-ME4 stub tf tracks + + if (n_stubs >= 2) + { + h_rt_gmt_csc_pt_2st->Fill(gpt); + if (eta_me42) h_rt_gmt_csc_pt_2s42->Fill(gpt); + if (eta_me42r) h_rt_gmt_csc_pt_2s42r->Fill(gpt); + if ( gpt > max_pt_2s ) { max_pt_2s = gpt; max_pt_2s_eta = geta; } + if (eta_me1b && gpt > max_pt_2s_1b ) { max_pt_2s_1b = gpt; /*max_pt_2s_eta_1b = geta;*/ } + if (eta_no1a && gpt > max_pt_2s_no1a) { max_pt_2s_no1a = gpt; /*max_pt_2s_eta_no1a = geta;*/ } + if (eta_me42 && gpt > max_pt_me42_2s) max_pt_me42_2s = gpt; + if (eta_me42r && gpt>max_pt_me42r_2s) max_pt_me42r_2s = gpt; + } + if ( (has_1b_stub && n_stubs >=2) || ( !has_1b_stub && !eta_me1b_whole && n_stubs >=2 ) ) + { + if ( gpt > max_pt_2s_2s1b) { max_pt_2s_2s1b = gpt; max_pt_2s_2s1b_eta = geta; } + } + + if (n_stubs >= 3) + { + h_rt_gmt_csc_pt_3st->Fill(gpt); + if (eta_me42) h_rt_gmt_csc_pt_3s42->Fill(gpt); + if (eta_me42r) h_rt_gmt_csc_pt_3s42r->Fill(gpt); + if ( gpt > max_pt_3s ) { max_pt_3s = gpt; max_pt_3s_eta = geta; } + + + if (eta_me1b && gpt > max_pt_3s_1b ) { max_pt_3s_1b = gpt; max_pt_3s_eta_1b = geta; } + if (eta_me1ab && gpt > max_pt_3s_1ab ) { max_pt_3s_1ab = gpt; max_pt_3s_eta_1ab = geta; } + + if (eta_no1a && gpt > max_pt_3s_no1a) { max_pt_3s_no1a = gpt; max_pt_3s_eta_no1a = geta; } + if (eta_me42 && gpt > max_pt_me42_3s) max_pt_me42_3s = gpt; + if (eta_me42r && gpt>max_pt_me42r_3s) max_pt_me42r_3s = gpt; + } + + if ( (has_1b_stub && n_stubs >=2) || ( !has_1b_stub && !eta_me1b_whole && n_stubs >=3 ) ) + { + if ( gpt > max_pt_3s_2s1b ) { max_pt_3s_2s1b = gpt; max_pt_3s_2s1b_eta = geta; } + + if (eta_me1b && gpt > max_pt_3s_2s1b_1b ) { max_pt_3s_2s1b_1b = gpt; max_pt_3s_2s1b_eta_1b = geta; + trk__max_pt_2s1b_1b = myGMTREGCand.tfcand->tftrack; } + if (eta_me1b && gpt > max_pt_3s_2s123_1b && ok_2s123 ) + { max_pt_3s_2s123_1b = gpt; max_pt_3s_2s123_eta_1b = geta; } + if (eta_me1b && gpt > max_pt_3s_2s13_1b && ok_2s13 ) + { max_pt_3s_2s13_1b = gpt; max_pt_3s_2s13_eta_1b = geta; } + + if (eta_no1a && gpt > max_pt_3s_2s1b_no1a) { max_pt_3s_2s1b_no1a = gpt; max_pt_3s_2s1b_eta_no1a = geta; } + if (eta_no1a && gpt > max_pt_3s_2s123_no1a && (!eta_me1b || (eta_me1b && ok_2s123) ) ) + { max_pt_3s_2s123_no1a = gpt; max_pt_3s_2s123_eta_no1a = geta; } + if (eta_no1a && gpt > max_pt_3s_2s13_no1a && (!eta_me1b || (eta_me1b && ok_2s13) ) ) + { max_pt_3s_2s13_no1a = gpt; max_pt_3s_2s13_eta_no1a = geta; } + } + + if ( (has_1b_stub && n_stubs >=3) || ( !has_1b_stub && !eta_me1b_whole && n_stubs >=3 ) ) + { + if ( gpt > max_pt_3s_3s1b ) { max_pt_3s_3s1b = gpt; max_pt_3s_3s1b_eta = geta; + trk__max_pt_3s_3s1b_eta = myGMTREGCand.tfcand->tftrack; } + if (eta_me1b && gpt > max_pt_3s_3s1b_1b ) { max_pt_3s_3s1b_1b = gpt; max_pt_3s_3s1b_eta_1b = geta; } + if (eta_no1a && gpt > max_pt_3s_3s1b_no1a ) { max_pt_3s_3s1b_no1a = gpt; max_pt_3s_3s1b_eta_no1a = geta; } + } + + if (n_stubs >=3 && ( (eta_me1a && has_1a_stub) || (eta_me1b && has_1b_stub) || (!has_1a_stub && !has_1b_stub && !eta_me1ab) ) ) + { + if ( gpt > max_pt_3s_3s1ab ) { max_pt_3s_3s1ab = gpt; max_pt_3s_3s1ab_eta = geta; + //trk__max_pt_3s_3s1ab_eta = myGMTREGCand.tfcand->tftrack; + } + if (eta_me1b && gpt > max_pt_3s_3s1ab_1b ) { max_pt_3s_3s1ab_1b = gpt; + //max_pt_3s_3s1ab_eta_1b = geta; + } + if (eta_no1a && gpt > max_pt_3s_3s1ab_no1a ) { max_pt_3s_3s1ab_no1a = gpt; + //max_pt_3s_3s1ab_eta_no1a = geta; + } + } + + + } else { + std::cout<<"GMTCSC match not found pt="<phi_packed()<<" "<eta_packed()<phi_packed()<<" "<eta_packed(); + std::cout<::const_iterator ctrk = l1TfCands->begin(); ctrk != l1TfCands->end(); ctrk++) + if (!( ctrk->bx() < minRateBX_ || ctrk->bx() > maxRateBX_ )) std::cout<<" "<phi_packed()<<" "<eta_packed(); + std::cout<quality()>=2) { + h_rt_gmt_csc_pt_2q->Fill(gpt); + if (eta_me42) h_rt_gmt_csc_pt_2q42->Fill(gpt); + if (eta_me42r) h_rt_gmt_csc_pt_2q42r->Fill(gpt); + if (gpt > max_pt_2q) {max_pt_2q = gpt; max_pt_2q_eta = geta;} + if (eta_me42 && gpt > max_pt_me42_2q) max_pt_me42_2q = gpt; + if (eta_me42r && gpt > max_pt_me42r_2q) max_pt_me42r_2q = gpt; + } + if ((!eta_q && trk->quality()>=2) || ( eta_q && trk->quality()>=3) ) { + h_rt_gmt_csc_pt_3q->Fill(gpt); + if (eta_me42) h_rt_gmt_csc_pt_3q42->Fill(gpt); + if (eta_me42r) h_rt_gmt_csc_pt_3q42r->Fill(gpt); + if (gpt > max_pt_3q) {max_pt_3q = gpt; max_pt_3q_eta = geta;} + if (eta_me42 && gpt > max_pt_me42_3q) max_pt_me42_3q = gpt; + if (eta_me42r && gpt > max_pt_me42r_3q) max_pt_me42r_3q = gpt; + } + + //if (trk->quality()>=3 && !(myGMTREGCand.ids.size()>=3) ) { + // std::cout<<"weird stubs number "<quality()>=3 && gpt >=40. && mugeo::isME1bEtaRegion(myGMTREGCand.eta) ) { + // std::cout<<"highpt csctf in ME1b "<tftrack->print(""); + // } + if (has_me1_stub && n_stubs > 2 && gpt >= 30. && geta> 1.6 && geta < 2.15 ) { + std::cout<<"highpt csctf in ME1b "<tftrack->print(""); + } + + + ngmtcsc++; + if (gpt>=10.) ngmtcscpt10++; + h_rt_gmt_csc_pt->Fill(gpt); + h_rt_gmt_csc_eta->Fill(geta); + h_rt_gmt_csc_bx->Fill(trk->bx()); + + h_rt_gmt_csc_q->Fill(trk->quality()); + if (eta_me42) h_rt_gmt_csc_q_42->Fill(trk->quality()); + if (eta_me42r) h_rt_gmt_csc_q_42r->Fill(trk->quality()); + } + + h_rt_ngmt_csc->Fill(ngmtcsc); + h_rt_ngmt_csc_pt10->Fill(ngmtcscpt10); + if (max_pt_2s>0) h_rt_gmt_csc_ptmax_2s->Fill(max_pt_2s); + if (max_pt_3s>0) h_rt_gmt_csc_ptmax_3s->Fill(max_pt_3s); + + if (max_pt_2s_1b>0) h_rt_gmt_csc_ptmax_2s_1b->Fill(max_pt_2s_1b); + if (max_pt_2s_no1a>0) h_rt_gmt_csc_ptmax_2s_no1a->Fill(max_pt_2s_no1a); + if (max_pt_3s_1b>0) h_rt_gmt_csc_ptmax_3s_1b->Fill(max_pt_3s_1b); + if (max_pt_3s_no1a>0) h_rt_gmt_csc_ptmax_3s_no1a->Fill(max_pt_3s_no1a); + if (max_pt_3s_2s1b>0) h_rt_gmt_csc_ptmax_3s_2s1b->Fill(max_pt_3s_2s1b); + if (max_pt_3s_2s1b_1b>0) h_rt_gmt_csc_ptmax_3s_2s1b_1b->Fill(max_pt_3s_2s1b_1b); + if (max_pt_3s_2s123_1b>0) h_rt_gmt_csc_ptmax_3s_2s123_1b->Fill(max_pt_3s_2s123_1b); + if (max_pt_3s_2s13_1b>0) h_rt_gmt_csc_ptmax_3s_2s13_1b->Fill(max_pt_3s_2s13_1b); + if (max_pt_3s_2s1b_no1a>0) h_rt_gmt_csc_ptmax_3s_2s1b_no1a->Fill(max_pt_3s_2s1b_no1a); + if (max_pt_3s_2s123_no1a>0) h_rt_gmt_csc_ptmax_3s_2s123_no1a->Fill(max_pt_3s_2s123_no1a); + if (max_pt_3s_2s13_no1a>0) h_rt_gmt_csc_ptmax_3s_2s13_no1a->Fill(max_pt_3s_2s13_no1a); + if (max_pt_3s_3s1b>0) h_rt_gmt_csc_ptmax_3s_3s1b->Fill(max_pt_3s_3s1b); + if (max_pt_3s_3s1b_1b>0) h_rt_gmt_csc_ptmax_3s_3s1b_1b->Fill(max_pt_3s_3s1b_1b); + if (max_pt_3s_3s1b_no1a>0) h_rt_gmt_csc_ptmax_3s_3s1b_no1a->Fill(max_pt_3s_3s1b_no1a); + + if (max_pt_2q>0) h_rt_gmt_csc_ptmax_2q->Fill(max_pt_2q); + if (max_pt_3q>0) h_rt_gmt_csc_ptmax_3q->Fill(max_pt_3q); + + if (max_pt_2s>=10.) h_rt_gmt_csc_ptmax10_eta_2s->Fill(max_pt_2s_eta); + if (max_pt_2s_2s1b>=10.) h_rt_gmt_csc_ptmax10_eta_2s_2s1b->Fill(max_pt_2s_2s1b_eta); + if (max_pt_3s>=10.) h_rt_gmt_csc_ptmax10_eta_3s->Fill(max_pt_3s_eta); + if (max_pt_3s_1b>=10.) h_rt_gmt_csc_ptmax10_eta_3s_1b->Fill(max_pt_3s_eta_1b); + if (max_pt_3s_no1a>=10.) h_rt_gmt_csc_ptmax10_eta_3s_no1a->Fill(max_pt_3s_eta_no1a); + if (max_pt_3s_2s1b>=10.) h_rt_gmt_csc_ptmax10_eta_3s_2s1b->Fill(max_pt_3s_2s1b_eta); + if (max_pt_3s_2s1b_1b>=10.) h_rt_gmt_csc_ptmax10_eta_3s_2s1b_1b->Fill(max_pt_3s_2s1b_eta_1b); + if (max_pt_3s_2s123_1b>=10.) h_rt_gmt_csc_ptmax10_eta_3s_2s123_1b->Fill(max_pt_3s_2s123_eta_1b); + if (max_pt_3s_2s13_1b>=10.) h_rt_gmt_csc_ptmax10_eta_3s_2s13_1b->Fill(max_pt_3s_2s13_eta_1b); + if (max_pt_3s_2s1b_no1a>=10.) h_rt_gmt_csc_ptmax10_eta_3s_2s1b_no1a->Fill(max_pt_3s_2s1b_eta_no1a); + if (max_pt_3s_2s123_no1a>=10.) h_rt_gmt_csc_ptmax10_eta_3s_2s123_no1a->Fill(max_pt_3s_2s123_eta_no1a); + if (max_pt_3s_2s13_no1a>=10.) h_rt_gmt_csc_ptmax10_eta_3s_2s13_no1a->Fill(max_pt_3s_2s13_eta_no1a); + if (max_pt_3s_3s1b>=10.) h_rt_gmt_csc_ptmax10_eta_3s_3s1b->Fill(max_pt_3s_3s1b_eta); + if (max_pt_3s_3s1b_1b>=10.) h_rt_gmt_csc_ptmax10_eta_3s_3s1b_1b->Fill(max_pt_3s_3s1b_eta_1b); + if (max_pt_3s_3s1b_no1a>=10.) h_rt_gmt_csc_ptmax10_eta_3s_3s1b_no1a->Fill(max_pt_3s_3s1b_eta_no1a); + if (max_pt_2q>=10.) h_rt_gmt_csc_ptmax10_eta_2q->Fill(max_pt_2q_eta); + if (max_pt_3q>=10.) h_rt_gmt_csc_ptmax10_eta_3q->Fill(max_pt_3q_eta); + + if (max_pt_2s>=20.) h_rt_gmt_csc_ptmax20_eta_2s->Fill(max_pt_2s_eta); + if (max_pt_2s_2s1b>=20.) h_rt_gmt_csc_ptmax20_eta_2s_2s1b->Fill(max_pt_2s_2s1b_eta); + if (max_pt_3s>=20.) h_rt_gmt_csc_ptmax20_eta_3s->Fill(max_pt_3s_eta); + + if (max_pt_3s_1b>=20.) h_rt_gmt_csc_ptmax20_eta_3s_1b->Fill(max_pt_3s_eta_1b); + if (max_pt_3s_1ab>=20.) h_rt_gmt_csc_ptmax20_eta_3s_1ab->Fill(max_pt_3s_eta_1ab); + + if (max_pt_3s_no1a>=20.) h_rt_gmt_csc_ptmax20_eta_3s_no1a->Fill(max_pt_3s_eta_no1a); + if (max_pt_3s_2s1b>=20.) h_rt_gmt_csc_ptmax20_eta_3s_2s1b->Fill(max_pt_3s_2s1b_eta); + if (max_pt_3s_2s1b_1b>=20.) h_rt_gmt_csc_ptmax20_eta_3s_2s1b_1b->Fill(max_pt_3s_2s1b_eta_1b); + if (max_pt_3s_2s123_1b>=20.) h_rt_gmt_csc_ptmax20_eta_3s_2s123_1b->Fill(max_pt_3s_2s123_eta_1b); + if (max_pt_3s_2s13_1b>=20.) h_rt_gmt_csc_ptmax20_eta_3s_2s13_1b->Fill(max_pt_3s_2s13_eta_1b); + if (max_pt_3s_2s1b_no1a>=20.) h_rt_gmt_csc_ptmax20_eta_3s_2s1b_no1a->Fill(max_pt_3s_2s1b_eta_no1a); + if (max_pt_3s_2s123_no1a>=20.) h_rt_gmt_csc_ptmax20_eta_3s_2s123_no1a->Fill(max_pt_3s_2s123_eta_no1a); + if (max_pt_3s_2s13_no1a>=20.) h_rt_gmt_csc_ptmax20_eta_3s_2s13_no1a->Fill(max_pt_3s_2s13_eta_no1a); + + if (max_pt_3s_3s1b>=20.) h_rt_gmt_csc_ptmax20_eta_3s_3s1b->Fill(max_pt_3s_3s1b_eta); + if (max_pt_3s_3s1ab>=20.) h_rt_gmt_csc_ptmax20_eta_3s_3s1ab->Fill(max_pt_3s_3s1b_eta); + + if (max_pt_3s_3s1b_1b>=20.) h_rt_gmt_csc_ptmax20_eta_3s_3s1b_1b->Fill(max_pt_3s_3s1b_eta_1b); + if (max_pt_3s_3s1b_no1a>=20.) h_rt_gmt_csc_ptmax20_eta_3s_3s1b_no1a->Fill(max_pt_3s_3s1b_eta_no1a); + if (max_pt_2q>=20.) h_rt_gmt_csc_ptmax20_eta_2q->Fill(max_pt_2q_eta); + if (max_pt_3q>=20.) h_rt_gmt_csc_ptmax20_eta_3q->Fill(max_pt_3q_eta); + + if (max_pt_2s>=30.) h_rt_gmt_csc_ptmax30_eta_2s->Fill(max_pt_2s_eta); + if (max_pt_2s_2s1b>=30.) h_rt_gmt_csc_ptmax30_eta_2s_2s1b->Fill(max_pt_2s_2s1b_eta); + if (max_pt_3s>=30.) h_rt_gmt_csc_ptmax30_eta_3s->Fill(max_pt_3s_eta); + + if (max_pt_3s_1b>=30.) h_rt_gmt_csc_ptmax30_eta_3s_1b->Fill(max_pt_3s_eta_1b); + if (max_pt_3s_1ab>=30.) h_rt_gmt_csc_ptmax30_eta_3s_1ab->Fill(max_pt_3s_eta_1ab); + + + if (max_pt_3s_no1a>=30.) h_rt_gmt_csc_ptmax30_eta_3s_no1a->Fill(max_pt_3s_eta_no1a); + if (max_pt_3s_2s1b>=30.) h_rt_gmt_csc_ptmax30_eta_3s_2s1b->Fill(max_pt_3s_2s1b_eta); + if (max_pt_3s_2s1b_1b>=30.) h_rt_gmt_csc_ptmax30_eta_3s_2s1b_1b->Fill(max_pt_3s_2s1b_eta_1b); + if (max_pt_3s_2s123_1b>=30.) h_rt_gmt_csc_ptmax30_eta_3s_2s123_1b->Fill(max_pt_3s_2s123_eta_1b); + if (max_pt_3s_2s13_1b>=30.) h_rt_gmt_csc_ptmax30_eta_3s_2s13_1b->Fill(max_pt_3s_2s13_eta_1b); + if (max_pt_3s_2s1b_no1a>=30.) h_rt_gmt_csc_ptmax30_eta_3s_2s1b_no1a->Fill(max_pt_3s_2s1b_eta_no1a); + if (max_pt_3s_2s123_no1a>=30.) h_rt_gmt_csc_ptmax30_eta_3s_2s123_no1a->Fill(max_pt_3s_2s123_eta_no1a); + if (max_pt_3s_2s13_no1a>=30.) h_rt_gmt_csc_ptmax30_eta_3s_2s13_no1a->Fill(max_pt_3s_2s13_eta_no1a); + + + if (max_pt_3s_3s1b>=30.) h_rt_gmt_csc_ptmax30_eta_3s_3s1b->Fill(max_pt_3s_3s1b_eta); + if (max_pt_3s_3s1ab>=30.) h_rt_gmt_csc_ptmax30_eta_3s_3s1ab->Fill(max_pt_3s_3s1ab_eta); + + + + if (max_pt_3s_3s1b_1b>=30.) h_rt_gmt_csc_ptmax30_eta_3s_3s1b_1b->Fill(max_pt_3s_3s1b_eta_1b); + if (max_pt_3s_3s1b_no1a>=30.) h_rt_gmt_csc_ptmax30_eta_3s_3s1b_no1a->Fill(max_pt_3s_3s1b_eta_no1a); + + if (max_pt_2q>=30.) h_rt_gmt_csc_ptmax30_eta_2q->Fill(max_pt_2q_eta); + if (max_pt_3q>=30.) h_rt_gmt_csc_ptmax30_eta_3q->Fill(max_pt_3q_eta); + + if (max_pt_me42_2s>0) h_rt_gmt_csc_ptmax_2s42->Fill(max_pt_me42_2s); + if (max_pt_me42_3s>0) h_rt_gmt_csc_ptmax_3s42->Fill(max_pt_me42_3s); + if (max_pt_me42_2q>0) h_rt_gmt_csc_ptmax_2q42->Fill(max_pt_me42_2q); + if (max_pt_me42_3q>0) h_rt_gmt_csc_ptmax_3q42->Fill(max_pt_me42_3q); + if (max_pt_me42r_2s>0) h_rt_gmt_csc_ptmax_2s42r->Fill(max_pt_me42r_2s); + if (max_pt_me42r_3s>0) h_rt_gmt_csc_ptmax_3s42r->Fill(max_pt_me42r_3s); + if (max_pt_me42r_2q>0) h_rt_gmt_csc_ptmax_2q42r->Fill(max_pt_me42r_2q); + if (max_pt_me42r_3q>0) h_rt_gmt_csc_ptmax_3q42r->Fill(max_pt_me42r_3q); + for (int bx=minRateBX_; bx<=maxRateBX_; bx++) h_rt_ngmt_csc_per_bx->Fill(bx2n[bx]); + if (debugRATE) std::cout<< "----- end ngmt csc/ngmtpt10="<=30.) + { + std::cout<<"filled h_rt_gmt_csc_ptmax30_eta_3s_3s1b eta "<print(""); + } + + if (max_pt_3s_2s1b_1b >= 10. && trk__max_pt_2s1b_1b) + { + const int Nthr = 6; + float tfc_pt_thr[Nthr] = {10., 15., 20., 25., 30., 40.}; + for (int i=0; i= tfc_pt_thr[i]) + { + h_rt_gmt_csc_mode_2s1b_1b[i]->Fill(trk__max_pt_2s1b_1b->mode()); + } + if (the_me1_stub) std::cout<<"DBGMODE "<pt<<" "<mode()<<" "<getPattern()] <<" "<getGEMDPhi()< rtGMTRPCfCands; + float max_pt_me42 = -1, max_pt = -1, max_pt_eta = -111; + for (int bx=minRateBX_; bx<=maxRateBX_; bx++) bx2n[bx]=0; + for ( std::vector::const_iterator trk = l1GmtRPCfCands.begin(); trk != l1GmtRPCfCands.end(); trk++) + { + if ( trk->bx() < minRateBX_ || trk->bx() > maxRateBX_ ) + { + if (debugRATE) std::cout<<"discarding BX = "<< trk->bx() <eta_packed() & 0x20) == 0) ? 1.:-1; + if (doSelectEtaForGMTRates_ && sign_eta<0) continue; + + bx2n[trk->bx()] += 1; + MatchCSCMuL1::GMTREGCAND myGMTREGCand; + + myGMTREGCand.init( &*trk , muScales, muPtScale); + myGMTREGCand.dr = 999.; + + myGMTREGCand.tfcand = NULL; + rtGMTRPCfCands.push_back(myGMTREGCand); + + ngmtrpcf++; + if (myGMTREGCand.pt>=10.) ngmtrpcfpt10++; + h_rt_gmt_rpcf_pt->Fill(myGMTREGCand.pt); + h_rt_gmt_rpcf_eta->Fill(fabs(myGMTREGCand.eta)); + h_rt_gmt_rpcf_bx->Fill(trk->bx()); + + bool eta_me42 = mugeo::isME42RPCEtaRegion(myGMTREGCand.eta); + //if (fabs(myGMTREGCand.eta)>=1.2 && fabs(myGMTREGCand.eta)<=1.8) eta_me42 = 1; + + if(eta_me42) h_rt_gmt_rpcf_pt_42->Fill(myGMTREGCand.pt); + if(eta_me42 && myGMTREGCand.pt > max_pt_me42) max_pt_me42 = myGMTREGCand.pt; + if(myGMTREGCand.pt > max_pt) { max_pt = myGMTREGCand.pt; max_pt_eta = fabs(myGMTREGCand.eta);} + + h_rt_gmt_rpcf_q->Fill(trk->quality()); + if (eta_me42) h_rt_gmt_rpcf_q_42->Fill(trk->quality()); + } + h_rt_ngmt_rpcf->Fill(ngmtrpcf); + h_rt_ngmt_rpcf_pt10->Fill(ngmtrpcfpt10); + for (int bx=minRateBX_; bx<=maxRateBX_; bx++) h_rt_ngmt_rpcf_per_bx->Fill(bx2n[bx]); + if (max_pt>0) h_rt_gmt_rpcf_ptmax->Fill(max_pt); + if (max_pt>=10.) h_rt_gmt_rpcf_ptmax10_eta->Fill(max_pt_eta); + if (max_pt>=20.) h_rt_gmt_rpcf_ptmax20_eta->Fill(max_pt_eta); + if (max_pt_me42>0) h_rt_gmt_rpcf_ptmax_42->Fill(max_pt_me42); + if (debugRATE) std::cout<< "----- end ngmt rpcf/ngmtpt10="< rtGMTRPCbCands; + max_pt = -1, max_pt_eta = -111; + for (int bx=minRateBX_; bx<=maxRateBX_; bx++) bx2n[bx]=0; + for ( std::vector::const_iterator trk = l1GmtRPCbCands.begin(); trk != l1GmtRPCbCands.end(); trk++) + { + if ( trk->bx() < minRateBX_ || trk->bx() > maxRateBX_ ) + { + if (debugRATE) std::cout<<"discarding BX = "<< trk->bx() <eta_packed() & 0x20) == 0) ? 1.:-1; + if (doSelectEtaForGMTRates_ && sign_eta<0) continue; + + bx2n[trk->bx()] += 1; + MatchCSCMuL1::GMTREGCAND myGMTREGCand; + + myGMTREGCand.init( &*trk , muScales, muPtScale); + myGMTREGCand.dr = 999.; + + myGMTREGCand.tfcand = NULL; + rtGMTRPCbCands.push_back(myGMTREGCand); + + ngmtrpcb++; + if (myGMTREGCand.pt>=10.) ngmtrpcbpt10++; + h_rt_gmt_rpcb_pt->Fill(myGMTREGCand.pt); + h_rt_gmt_rpcb_eta->Fill(fabs(myGMTREGCand.eta)); + h_rt_gmt_rpcb_bx->Fill(trk->bx()); + + if(myGMTREGCand.pt > max_pt) { max_pt = myGMTREGCand.pt; max_pt_eta = fabs(myGMTREGCand.eta);} + + h_rt_gmt_rpcb_q->Fill(trk->quality()); + } + h_rt_ngmt_rpcb->Fill(ngmtrpcb); + h_rt_ngmt_rpcb_pt10->Fill(ngmtrpcbpt10); + for (int bx=minRateBX_; bx<=maxRateBX_; bx++) h_rt_ngmt_rpcb_per_bx->Fill(bx2n[bx]); + if (max_pt>0) h_rt_gmt_rpcb_ptmax->Fill(max_pt); + if (max_pt>=10.) h_rt_gmt_rpcb_ptmax10_eta->Fill(max_pt_eta); + if (max_pt>=20.) h_rt_gmt_rpcb_ptmax20_eta->Fill(max_pt_eta); + if (debugRATE) std::cout<< "----- end ngmt rpcb/ngmtpt10="< rtGMTDTCands; + max_pt = -1, max_pt_eta = -111; + for (int bx=minRateBX_; bx<=maxRateBX_; bx++) bx2n[bx]=0; + for ( std::vector::const_iterator trk = l1GmtDTCands.begin(); trk != l1GmtDTCands.end(); trk++) + { + if ( trk->bx() < minRateBX_ || trk->bx() > maxRateBX_ ) + { + if (debugRATE) std::cout<<"discarding BX = "<< trk->bx() <eta_packed() & 0x20) == 0) ? 1.:-1; + if (doSelectEtaForGMTRates_ && sign_eta<0) continue; + + bx2n[trk->bx()] += 1; + MatchCSCMuL1::GMTREGCAND myGMTREGCand; + + myGMTREGCand.init( &*trk , muScales, muPtScale); + myGMTREGCand.dr = 999.; + + myGMTREGCand.tfcand = NULL; + rtGMTDTCands.push_back(myGMTREGCand); + + ngmtdt++; + if (myGMTREGCand.pt>=10.) ngmtdtpt10++; + h_rt_gmt_dt_pt->Fill(myGMTREGCand.pt); + h_rt_gmt_dt_eta->Fill(fabs(myGMTREGCand.eta)); + h_rt_gmt_dt_bx->Fill(trk->bx()); + + if(myGMTREGCand.pt > max_pt) { max_pt = myGMTREGCand.pt; max_pt_eta = fabs(myGMTREGCand.eta);} + + h_rt_gmt_dt_q->Fill(trk->quality()); + } + h_rt_ngmt_dt->Fill(ngmtdt); + h_rt_ngmt_dt_pt10->Fill(ngmtdtpt10); + for (int bx=minRateBX_; bx<=maxRateBX_; bx++) h_rt_ngmt_dt_per_bx->Fill(bx2n[bx]); + if (max_pt>0) h_rt_gmt_dt_ptmax->Fill(max_pt); + if (max_pt>=10.) h_rt_gmt_dt_ptmax10_eta->Fill(max_pt_eta); + if (max_pt>=20.) h_rt_gmt_dt_ptmax20_eta->Fill(max_pt_eta); + if (debugRATE) std::cout<< "----- end ngmt dt/ngmtpt10="< rtGMTCands; + max_pt_me42_2s = -1; max_pt_me42_3s = -1; max_pt_me42_2q = -1; max_pt_me42_3q = -1; + max_pt_me42r_2s = -1; max_pt_me42r_3s = -1; max_pt_me42r_2q = -1; max_pt_me42r_3q = -1; + float max_pt_me42_2s_sing = -1, max_pt_me42_3s_sing = -1, max_pt_me42_2q_sing = -1, max_pt_me42_3q_sing = -1; + float max_pt_me42r_2s_sing = -1, max_pt_me42r_3s_sing = -1, max_pt_me42r_2q_sing = -1, max_pt_me42r_3q_sing = -1; + max_pt = -1, max_pt_eta = -999; + + float max_pt_sing = -1, max_pt_eta_sing = -999, max_pt_sing_3s = -1, max_pt_eta_sing_3s = -999; + float max_pt_sing_csc = -1., max_pt_eta_sing_csc = -999.; + float max_pt_sing_dtcsc = -1., max_pt_eta_sing_dtcsc = -999.; + float max_pt_sing_1b = -1.;//, max_pt_eta_sing_1b = -999; + float max_pt_sing_no1a = -1.;//, max_pt_eta_sing_no1a = -999.; + + float max_pt_sing6 = -1, max_pt_eta_sing6 = -999, max_pt_sing6_3s = -1, max_pt_eta_sing6_3s = -999; + float max_pt_sing6_csc = -1., max_pt_eta_sing6_csc = -999.; + float max_pt_sing6_1b = -1.;//, max_pt_eta_sing6_1b = -999; + float max_pt_sing6_no1a = -1.;//, max_pt_eta_sing6_no1a = -999.; + float max_pt_sing6_3s1b_no1a = -1.;//, max_pt_eta_sing6_3s1b_no1a = -999.; + + float max_pt_dbl = -1, max_pt_eta_dbl = -999; + + std::vector gmt_records = hl1GmtCands->getRecords(); + for ( std::vector< L1MuGMTReadoutRecord >::const_iterator rItr=gmt_records.begin(); rItr!=gmt_records.end() ; ++rItr ) + { + if (rItr->getBxInEvent() < minBxGMT_ || rItr->getBxInEvent() > maxBxGMT_) continue; + + std::vector CSCCands = rItr->getCSCCands(); + std::vector DTCands = rItr->getDTBXCands(); + std::vector RPCfCands = rItr->getFwdRPCCands(); + std::vector RPCbCands = rItr->getBrlRPCCands(); + std::vector GMTCands = rItr->getGMTCands(); + for ( std::vector::const_iterator muItr = GMTCands.begin() ; muItr != GMTCands.end() ; ++muItr ) + { + if( muItr->empty() ) continue; + + if ( muItr->bx() < minRateBX_ || muItr->bx() > maxRateBX_ ) + { + if (debugRATE) std::cout<<"discarding BX = "<< muItr->bx() <isFwd() && ( muItr->isMatchedCand() || !muItr->isRPC())) + { + L1MuRegionalCand rcsc = CSCCands[muItr->getDTCSCIndex()]; + unsigned my_i = 999; + for (unsigned i=0; i< rtGMTREGCands.size(); i++) + { + if (rcsc.getDataWord()!=rtGMTREGCands[i].l1reg->getDataWord()) continue; + my_i = i; + break; + } + if (my_i<99) gmt_csc = &rtGMTREGCands[my_i]; + else std::cout<<"DOES NOT EXIST IN rtGMTREGCands! Should not happen!"<ids; + } + + MatchCSCMuL1::GMTREGCAND * gmt_rpcf = NULL; + if (muItr->isFwd() && (muItr->isMatchedCand() || muItr->isRPC())) + { + L1MuRegionalCand rrpcf = RPCfCands[muItr->getRPCIndex()]; + unsigned my_i = 999; + for (unsigned i=0; i< rtGMTRPCfCands.size(); i++) + { + if (rrpcf.getDataWord()!=rtGMTRPCfCands[i].l1reg->getDataWord()) continue; + my_i = i; + break; + } + if (my_i<99) gmt_rpcf = &rtGMTRPCfCands[my_i]; + else std::cout<<"DOES NOT EXIST IN rtGMTRPCfCands! Should not happen!"<isFwd()) && (muItr->isMatchedCand() || muItr->isRPC())) + { + L1MuRegionalCand rrpcb = RPCbCands[muItr->getRPCIndex()]; + unsigned my_i = 999; + for (unsigned i=0; i< rtGMTRPCbCands.size(); i++) + { + if (rrpcb.getDataWord()!=rtGMTRPCbCands[i].l1reg->getDataWord()) continue; + my_i = i; + break; + } + if (my_i<99) gmt_rpcb = &rtGMTRPCbCands[my_i]; + else std::cout<<"DOES NOT EXIST IN rtGMTRPCbCands! Should not happen!"<isFwd()) && (muItr->isMatchedCand() || !(muItr->isRPC()))) + { + L1MuRegionalCand rdt = DTCands[muItr->getDTCSCIndex()]; + unsigned my_i = 999; + for (unsigned i=0; i< rtGMTDTCands.size(); i++) + { + if (rdt.getDataWord()!=rtGMTDTCands[i].l1reg->getDataWord()) continue; + my_i = i; + break; + } + if (my_i<99) gmt_dt = &rtGMTDTCands[my_i]; + else std::cout<<"DOES NOT EXIST IN rtGMTDTCands! Should not happen!"<isMatchedCand() ) std::cout<<"csc&rpcf but not matched!"<=1.2 && geta<=1.8) eta_me42 = 1; + bool eta_q = (geta > 1.2); + + bool eta_me1b = mugeo::isME1bEtaRegion(myGMTCand.eta); + //bool eta_me1b_whole = mugeo::isME1bEtaRegion(myGMTCand.eta, 1.6, 2.14); + bool eta_no1a = (geta >= 1.2 && geta < 2.14); + //bool eta_csc = (geta > 0.9); + // + + size_t n_stubs = 0; + if (gmt_csc) n_stubs = gmt_csc->nTFStubs; + + bool has_me1_stub = false; + if (gmt_csc && gmt_csc->tfcand && gmt_csc->tfcand->tftrack) + { + has_me1_stub = gmt_csc->tfcand->tftrack->hasStub(1); + } + + + if (eta_me42) h_rt_gmt_gq_42->Fill(muItr->quality()); + if (eta_me42r) { + int gtype = 0; + if (muItr->isMatchedCand()) gtype = 6; + else if (gmt_csc!=0) gtype = gmt_csc->l1reg->quality()+2; + else if (gmt_rpcf!=0) gtype = gmt_rpcf->l1reg->quality()+1; + if (gtype==0) std::cout<<"weird: gtype=0 That shouldn't happen!"; + h_rt_gmt_gq_vs_type_42r->Fill(muItr->quality(), gtype); + h_rt_gmt_gq_vs_pt_42r->Fill(muItr->quality(), gpt); + h_rt_gmt_gq_42r->Fill(muItr->quality()); + } + h_rt_gmt_gq->Fill(muItr->quality()); + + h_rt_gmt_bx->Fill(muItr->bx()); + + //if (muItr->quality()<4) continue; // not good for single muon trigger! + + bool isSingleTrigOk = muItr->useInSingleMuonTrigger(); // good for single trigger + bool isDoubleTrigOk = muItr->useInDiMuonTrigger(); // good for single trigger + + bool isSingle6TrigOk = (muItr->quality() >= 6); // unmatched or matched CSC or DT + + if (muItr->quality()<3) continue; // not good for neither single nor dimuon triggers + + bool isCSC = (gmt_csc != NULL); + bool isDT = (gmt_dt != NULL); + bool isRPCf = (gmt_rpcf != NULL); + bool isRPCb = (gmt_rpcb != NULL); + + if (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack == NULL) std::cout<<"warning: gmt_csc->tfcand->tftrack == NULL"<tfcand != NULL && gmt_csc->tfcand->tftrack != NULL && gmt_csc->tfcand->tftrack->l1trk == NULL) + std::cout<<"warning: gmt_csc->tfcand->tftrack->l1trk == NULL"<tfcand != NULL && myGMTCand.ids.size()>=2); + //bool isCSC3s = (isCSC && gmt_csc->tfcand != NULL && myGMTCand.ids.size()>=3); + bool isCSC2s = (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack != NULL && gmt_csc->tfcand->tftrack->nStubs()>=2); + bool isCSC3s = (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack != NULL + && ( (!eta_q && isCSC2s) || (eta_q && gmt_csc->tfcand->tftrack->nStubs()>=3) ) ); + bool isCSC2q = (isCSC && gmt_csc->l1reg != NULL && gmt_csc->l1reg->quality()>=2); + bool isCSC3q = (isCSC && gmt_csc->l1reg != NULL + && ( (!eta_q && isCSC2q) || (eta_q && gmt_csc->l1reg->quality()>=3) ) ); + + myGMTCand.isCSC = isCSC; + myGMTCand.isDT = isDT; + myGMTCand.isRPCf = isRPCf; + myGMTCand.isRPCb = isRPCb; + myGMTCand.isCSC2s = isCSC2s; + myGMTCand.isCSC3s = isCSC3s; + myGMTCand.isCSC2q = isCSC2q; + myGMTCand.isCSC3q = isCSC3q; + + rtGMTCands.push_back(myGMTCand); + + + if (isCSC2q || isRPCf) { + h_rt_gmt_pt_2q->Fill(gpt); + if (eta_me42) { + h_rt_gmt_pt_2q42->Fill(gpt); + if (gpt > max_pt_me42_2q) max_pt_me42_2q = gpt; + if (isSingleTrigOk && gpt > max_pt_me42_2q_sing) max_pt_me42_2q_sing = gpt; + } + if (eta_me42r) { + h_rt_gmt_pt_2q42r->Fill(gpt); + if (gpt > max_pt_me42r_2q) max_pt_me42r_2q = gpt; + if (isSingleTrigOk && gpt > max_pt_me42r_2q_sing) max_pt_me42r_2q_sing = gpt; + } + } + if (isCSC3q || isRPCf) { + h_rt_gmt_pt_3q->Fill(gpt); + if (eta_me42) { + h_rt_gmt_pt_3q42->Fill(gpt); + if (gpt > max_pt_me42_3q) max_pt_me42_3q = gpt; + if (isSingleTrigOk && gpt > max_pt_me42_3q_sing) max_pt_me42_3q_sing = gpt; + } + if (eta_me42r) { + h_rt_gmt_pt_3q42r->Fill(gpt); + if (gpt > max_pt_me42r_3q) max_pt_me42r_3q = gpt; + if (isSingleTrigOk && gpt > max_pt_me42r_3q_sing) max_pt_me42r_3q_sing = gpt; + } + } + + if (isCSC2s || isRPCf) { + h_rt_gmt_pt_2st->Fill(gpt); + if (eta_me42) { + h_rt_gmt_pt_2s42->Fill(gpt); + if (gpt > max_pt_me42_2s) max_pt_me42_2s = gpt; + if (isSingleTrigOk && gpt > max_pt_me42_2s_sing) max_pt_me42_2s_sing = gpt; + } + if (eta_me42r) { + h_rt_gmt_pt_2s42r->Fill(gpt); + if (gpt > max_pt_me42r_2s) max_pt_me42r_2s = gpt; + if (isSingleTrigOk && gpt > max_pt_me42r_2s_sing) max_pt_me42r_2s_sing = gpt; + } + } + if (isCSC3s || isRPCf) { + h_rt_gmt_pt_3st->Fill(gpt); + if (eta_me42) { + h_rt_gmt_pt_3s42->Fill(gpt); + if (gpt > max_pt_me42_3s) max_pt_me42_3s = gpt; + if (isSingleTrigOk && gpt > max_pt_me42_3s_sing) max_pt_me42_3s_sing = gpt; + } + if (eta_me42r) { + h_rt_gmt_pt_3s42r->Fill(gpt); + if (gpt > max_pt_me42r_3s) max_pt_me42r_3s = gpt; + if (isSingleTrigOk && gpt > max_pt_me42r_3s_sing) max_pt_me42r_3s_sing = gpt; + } + } + + ngmt++; + h_rt_gmt_pt->Fill(gpt); + h_rt_gmt_eta->Fill(geta); + if (gpt > max_pt) {max_pt = gpt; max_pt_eta = geta;} + if (isDoubleTrigOk && gpt > max_pt_dbl) {max_pt_dbl = gpt; max_pt_eta_dbl = geta;} + if (isSingleTrigOk) + { + if ( gpt > max_pt_sing ) { max_pt_sing = gpt; max_pt_eta_sing = geta;} + if (isCSC && gpt > max_pt_sing_csc ) { max_pt_sing_csc = gpt; max_pt_eta_sing_csc = geta; } + if ((isCSC||isDT) && gpt > max_pt_sing_dtcsc ) { max_pt_sing_dtcsc = gpt; max_pt_eta_sing_dtcsc = geta; } + if (gpt > max_pt_sing_3s && ( !isCSC || isCSC3s ) ) {max_pt_sing_3s = gpt; max_pt_eta_sing_3s = geta;} + if (eta_me1b && gpt > max_pt_sing_1b ) { max_pt_sing_1b = gpt; /*max_pt_eta_sing_1b = geta;*/ } + if (eta_no1a && gpt > max_pt_sing_no1a) { max_pt_sing_no1a = gpt; /*max_pt_eta_sing_no1a = geta;*/ } + } + if (isSingle6TrigOk) + { + if ( gpt > max_pt_sing6 ) { max_pt_sing6 = gpt; max_pt_eta_sing6 = geta;} + if (isCSC && gpt > max_pt_sing6_csc ) { max_pt_sing6_csc = gpt; max_pt_eta_sing6_csc = geta; } + if (gpt > max_pt_sing6_3s && ( !isCSC || isCSC3s ) ) {max_pt_sing6_3s = gpt; max_pt_eta_sing6_3s = geta;} + if (eta_me1b && gpt > max_pt_sing6_1b ) { max_pt_sing6_1b = gpt; /*max_pt_eta_sing6_1b = geta;*/ } + if (eta_no1a && gpt > max_pt_sing6_no1a) { max_pt_sing6_no1a = gpt; /*max_pt_eta_sing6_no1a = geta;*/ } + if (eta_no1a && gpt > max_pt_sing6_3s1b_no1a && + (!eta_me1b || (eta_me1b && has_me1_stub && n_stubs >=3) ) ) { max_pt_sing6_3s1b_no1a = gpt; /*max_pt_eta_sing6_no1a = geta;*/ } + } + } + } + h_rt_ngmt->Fill(ngmt); + if (max_pt_me42_2s>0) h_rt_gmt_ptmax_2s42->Fill(max_pt_me42_2s); + if (max_pt_me42_3s>0) h_rt_gmt_ptmax_3s42->Fill(max_pt_me42_3s); + if (max_pt_me42_2q>0) h_rt_gmt_ptmax_2q42->Fill(max_pt_me42_2q); + if (max_pt_me42_3q>0) h_rt_gmt_ptmax_3q42->Fill(max_pt_me42_3q); + if (max_pt_me42_2s_sing>0) h_rt_gmt_ptmax_2s42_sing->Fill(max_pt_me42_2s_sing); + if (max_pt_me42_3s_sing>0) h_rt_gmt_ptmax_3s42_sing->Fill(max_pt_me42_3s_sing); + if (max_pt_me42_2q_sing>0) h_rt_gmt_ptmax_2q42_sing->Fill(max_pt_me42_2q_sing); + if (max_pt_me42_3q_sing>0) h_rt_gmt_ptmax_3q42_sing->Fill(max_pt_me42_3q_sing); + if (max_pt_me42r_2s>0) h_rt_gmt_ptmax_2s42r->Fill(max_pt_me42r_2s); + if (max_pt_me42r_3s>0) h_rt_gmt_ptmax_3s42r->Fill(max_pt_me42r_3s); + if (max_pt_me42r_2q>0) h_rt_gmt_ptmax_2q42r->Fill(max_pt_me42r_2q); + if (max_pt_me42r_3q>0) h_rt_gmt_ptmax_3q42r->Fill(max_pt_me42r_3q); + if (max_pt_me42r_2s_sing>0) h_rt_gmt_ptmax_2s42r_sing->Fill(max_pt_me42r_2s_sing); + if (max_pt_me42r_3s_sing>0) h_rt_gmt_ptmax_3s42r_sing->Fill(max_pt_me42r_3s_sing); + if (max_pt_me42r_2q_sing>0) h_rt_gmt_ptmax_2q42r_sing->Fill(max_pt_me42r_2q_sing); + if (max_pt_me42r_3q_sing>0) h_rt_gmt_ptmax_3q42r_sing->Fill(max_pt_me42r_3q_sing); + if (max_pt>0) h_rt_gmt_ptmax->Fill(max_pt); + if (max_pt>=10.) h_rt_gmt_ptmax10_eta->Fill(max_pt_eta); + if (max_pt>=20.) h_rt_gmt_ptmax20_eta->Fill(max_pt_eta); + + if (max_pt_sing>0) h_rt_gmt_ptmax_sing->Fill(max_pt_sing); + if (max_pt_sing_3s>0) h_rt_gmt_ptmax_sing_3s->Fill(max_pt_sing_3s); + if (max_pt_sing>=10.) h_rt_gmt_ptmax10_eta_sing->Fill(max_pt_eta_sing); + if (max_pt_sing_3s>=10.) h_rt_gmt_ptmax10_eta_sing_3s->Fill(max_pt_eta_sing_3s); + if (max_pt_sing>=20.) h_rt_gmt_ptmax20_eta_sing->Fill(max_pt_eta_sing); + if (max_pt_sing_csc>=20.) h_rt_gmt_ptmax20_eta_sing_csc->Fill(max_pt_eta_sing_csc); + if (max_pt_sing_dtcsc>=20.) h_rt_gmt_ptmax20_eta_sing_dtcsc->Fill(max_pt_eta_sing_dtcsc); + if (max_pt_sing_3s>=20.) h_rt_gmt_ptmax20_eta_sing_3s->Fill(max_pt_eta_sing_3s); + if (max_pt_sing>=30.) h_rt_gmt_ptmax30_eta_sing->Fill(max_pt_eta_sing); + if (max_pt_sing_csc>=30.) h_rt_gmt_ptmax30_eta_sing_csc->Fill(max_pt_eta_sing_csc); + if (max_pt_sing_dtcsc>=30.) h_rt_gmt_ptmax30_eta_sing_dtcsc->Fill(max_pt_eta_sing_dtcsc); + if (max_pt_sing_3s>=30.) h_rt_gmt_ptmax30_eta_sing_3s->Fill(max_pt_eta_sing_3s); + if (max_pt_sing_csc > 0.) h_rt_gmt_ptmax_sing_csc->Fill(max_pt_sing_csc); + if (max_pt_sing_1b > 0. ) h_rt_gmt_ptmax_sing_1b->Fill(max_pt_sing_1b); + if (max_pt_sing_no1a > 0.) h_rt_gmt_ptmax_sing_no1a->Fill(max_pt_sing_no1a); + + if (max_pt_sing6>0) h_rt_gmt_ptmax_sing6->Fill(max_pt_sing6); + if (max_pt_sing6_3s>0) h_rt_gmt_ptmax_sing6_3s->Fill(max_pt_sing6_3s); + if (max_pt_sing6>=10.) h_rt_gmt_ptmax10_eta_sing6->Fill(max_pt_eta_sing6); + if (max_pt_sing6_3s>=10.) h_rt_gmt_ptmax10_eta_sing6_3s->Fill(max_pt_eta_sing6_3s); + if (max_pt_sing6>=20.) h_rt_gmt_ptmax20_eta_sing6->Fill(max_pt_eta_sing6); + if (max_pt_sing6_csc>=20.) h_rt_gmt_ptmax20_eta_sing6_csc->Fill(max_pt_eta_sing6_csc); + if (max_pt_sing6_3s>=20.) h_rt_gmt_ptmax20_eta_sing6_3s->Fill(max_pt_eta_sing6_3s); + if (max_pt_sing6>=30.) h_rt_gmt_ptmax30_eta_sing6->Fill(max_pt_eta_sing6); + if (max_pt_sing6_csc>=30.) h_rt_gmt_ptmax30_eta_sing6_csc->Fill(max_pt_eta_sing6_csc); + if (max_pt_sing6_3s>=30.) h_rt_gmt_ptmax30_eta_sing6_3s->Fill(max_pt_eta_sing6_3s); + if (max_pt_sing6_csc > 0.) h_rt_gmt_ptmax_sing6_csc->Fill(max_pt_sing6_csc); + if (max_pt_sing6_1b > 0. ) h_rt_gmt_ptmax_sing6_1b->Fill(max_pt_sing6_1b); + if (max_pt_sing6_no1a > 0.) h_rt_gmt_ptmax_sing6_no1a->Fill(max_pt_sing6_no1a); + if (max_pt_sing6_3s1b_no1a > 0.) h_rt_gmt_ptmax_sing6_3s1b_no1a->Fill(max_pt_sing6_3s1b_no1a); + + if (max_pt_dbl>0) h_rt_gmt_ptmax_dbl->Fill(max_pt_dbl); + if (max_pt_dbl>=10.) h_rt_gmt_ptmax10_eta_dbl->Fill(max_pt_eta_dbl); + if (max_pt_dbl>=20.) h_rt_gmt_ptmax20_eta_dbl->Fill(max_pt_eta_dbl); + if (debugRATE) std::cout<< "----- end ngmt="< fs; +// alct_tree_ = fs->make("ALCTs", "ALCTs"); +// alct_tree_->Branch("charge",&alct_.nlayers); +// alct_tree_->Branch("pt",&alct_.pt); +// alct_tree_->Branch("eta",&alct_.eta); +// alct_tree_->Branch("phi",&alct_.phi); +// alct_tree_->Branch("endcap",&alct_.bx); + // alct_tree_->Branch("gem_sh_layer1",&alct_.); +} + +// ================================================================================================ +void +GEMCSCTriggerRateTree::bookCLCTTree() +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRateTree::bookLCTTree() +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRateTree::bookMPCLCTTree() +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRateTree::bookTFTrackTree() +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRateTree::bookTFCandTree() +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRateTree::bookGMTRegionalTree() +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRateTree::bookGMTCandTree() +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRateTree::analyzeALCTRate(const edm::Event& iEvent) +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRateTree::analyzeCLCTRate(const edm::Event& iEvent) +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRateTree::analyzeLCTRate(const edm::Event& iEvent) +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRateTree::analyzeMPCLCTRate(const edm::Event& iEvent) +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRateTree::analyzeTFTrackRate(const edm::Event& iEvent) +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRateTree::analyzeTFCandRate(const edm::Event& iEvent) +{ +} + +// ================================================================================================ +void +GEMCSCTriggerRateTree::analyzeGMTCandRate(const edm::Event& iEvent) +{ +} + + + + +// ================================================================================================ +void +GEMCSCTriggerRateTree::runCSCTFSP(const CSCCorrelatedLCTDigiCollection* mplcts, const L1MuDTChambPhContainer* dttrig) + //, L1CSCTrackCollection*, CSCTriggerContainer*) +{ +// Just run it for the sake of its debug printout, do not return any results + + // Create csctf::TrackStubs collection from MPC LCTs + CSCTriggerContainer stub_list; + CSCCorrelatedLCTDigiCollection::DigiRangeIterator Citer; + for(Citer = mplcts->begin(); Citer != mplcts->end(); Citer++) + { + CSCCorrelatedLCTDigiCollection::const_iterator Diter = (*Citer).second.first; + CSCCorrelatedLCTDigiCollection::const_iterator Dend = (*Citer).second.second; + for(; Diter != Dend; Diter++) + { + csctf::TrackStub theStub((*Diter),(*Citer).first); + stub_list.push_back(theStub); + } + } + + // Now we append the track stubs the the DT Sector Collector + // after processing from the DT Receiver. + CSCTriggerContainer dtstubs = my_dtrc->process(dttrig); + stub_list.push_many(dtstubs); + + //for(int e=0; e<2; e++) for (int s=0; s<6; s++) { + int e=0; + for (int s=0; s<6; s++) + { + CSCTriggerContainer current_e_s = stub_list.get(e+1, s+1); + if (current_e_s.get().size()>0) + { + std::cout<<"sector "<run(current_e_s); + } + } +} + +// ================================================================================================ +// Returns chamber type (0-9) according to the station and ring number +int +GEMCSCTriggerRateTree::getCSCType(CSCDetId &id) +{ + int type = -999; + + if (id.station() == 1) { + type = (id.triggerCscId()-1)/3; + if (id.ring() == 4) { + type = 3; + } + } + else { // stations 2-4 + type = 3 + id.ring() + 2*(id.station()-2); + } + assert(type >= 0 && type < CSC_TYPES); // include ME4/2 + return type; +} + +// ================================================================================================ +int +GEMCSCTriggerRateTree::isME11(int t) +{ + if (t==0 || t==3) return CSC_TYPES; + return 0; +} + +// ================================================================================================ +// Returns chamber type (0-9) according to CSCChamberSpecs type +// 1..10 -> 1/a, 1/b, 1/2, 1/3, 2/1... +int +GEMCSCTriggerRateTree::getCSCSpecsType(CSCDetId &id) +{ + return cscGeometry->chamber(id)->specs()->chamberType(); +} + +// ================================================================================================ +int +GEMCSCTriggerRateTree::cscTriggerSubsector(CSCDetId &id) +{ + if(id.station() != 1) return 0; // only station one has subsectors + int chamber = id.chamber(); + switch(chamber) // first make things easier to deal with + { + case 1: + chamber = 36; + break; + case 2: + chamber = 35; + break; + default: + chamber -= 2; + } + chamber = ((chamber-1)%6) + 1; // renumber all chambers to 1-6 + return ((chamber-1) / 3) + 1; // [1,3] -> 1 , [4,6]->2 +} + + +// ================================================================================================ +void +GEMCSCTriggerRateTree::setupTFModeHisto(TH1D* h) +{ + if (h==0) return; + if (h->GetXaxis()->GetNbins()<16) { + std::cout<<"TF mode histogram should have 16 bins, nbins="<GetXaxis()->GetNbins()<GetXaxis()->SetTitle("Track Type"); + h->GetXaxis()->SetTitleOffset(1.2); + h->GetXaxis()->SetBinLabel(1,"No Track"); + h->GetXaxis()->SetBinLabel(2,"Bad Phi Road"); + h->GetXaxis()->SetBinLabel(3,"ME1-2-3(-4)"); + h->GetXaxis()->SetBinLabel(4,"ME1-2-4"); + h->GetXaxis()->SetBinLabel(5,"ME1-3-4"); + h->GetXaxis()->SetBinLabel(6,"ME2-3-4"); + h->GetXaxis()->SetBinLabel(7,"ME1-2"); + h->GetXaxis()->SetBinLabel(8,"ME1-3"); + h->GetXaxis()->SetBinLabel(9,"ME2-3"); + h->GetXaxis()->SetBinLabel(10,"ME2-4"); + h->GetXaxis()->SetBinLabel(11,"ME3-4"); + h->GetXaxis()->SetBinLabel(12,"B1-ME3,B1-ME1-"); + h->GetXaxis()->SetBinLabel(13,"B1-ME2(-3)"); + h->GetXaxis()->SetBinLabel(14,"ME1-4"); + h->GetXaxis()->SetBinLabel(15,"B1-ME1(-2)(-3)"); + h->GetXaxis()->SetBinLabel(16,"Halo Trigger"); +} + +// ================================================================================================ +std::pair +GEMCSCTriggerRateTree::intersectionEtaPhi(CSCDetId id, int wg, int hs) +{ + + CSCDetId layerId(id.endcap(), id.station(), id.ring(), id.chamber(), CSCConstants::KEY_CLCT_LAYER); + const CSCLayer* csclayer = cscGeometry->layer(layerId); + const CSCLayerGeometry* layer_geo = csclayer->geometry(); + + // LCT::getKeyWG() starts from 0 + float wire = layer_geo->middleWireOfGroup(wg + 1); + + // half-strip to strip + // note that LCT's HS starts from 0, but in geometry strips start from 1 + float fractional_strip = 0.5 * (hs + 1) - 0.25; + + LocalPoint csc_intersect = layer_geo->intersectionOfStripAndWire(fractional_strip, wire); + + GlobalPoint csc_gp = cscGeometry->idToDet(layerId)->surface().toGlobal(csc_intersect); + + return std::make_pair(csc_gp.eta(), csc_gp.phi()); +} + +// ================================================================================================ +csctf::TrackStub +GEMCSCTriggerRateTree::buildTrackStub(const CSCCorrelatedLCTDigi &d, CSCDetId id) +{ + unsigned fpga = (id.station() == 1) ? CSCTriggerNumbering::triggerSubSectorFromLabels(id) - 1 : id.station(); + CSCSectorReceiverLUT* srLUT = srLUTs_[fpga][id.triggerSector()-1][id.endcap()-1]; + + unsigned cscid = CSCTriggerNumbering::triggerCscIdFromLabels(id); + unsigned cscid_special = cscid; + if (id.station()==1 && id.ring()==4) cscid_special = cscid + 9; + + lclphidat lclPhi; + lclPhi = srLUT->localPhi(d.getStrip(), d.getPattern(), d.getQuality(), d.getBend()); + + gblphidat gblPhi; + gblPhi = srLUT->globalPhiME(lclPhi.phi_local, d.getKeyWG(), cscid_special); + + gbletadat gblEta; + gblEta = srLUT->globalEtaME(lclPhi.phi_bend_local, lclPhi.phi_local, d.getKeyWG(), cscid); + + return csctf::TrackStub(d, id, gblPhi.global_phi, gblEta.global_eta); +} + +//define this as a plug-in +DEFINE_FWK_MODULE(GEMCSCTriggerRateTree); diff --git a/SimMuL1/plugins/GEMCSCTriggerRateTree.h b/SimMuL1/plugins/GEMCSCTriggerRateTree.h new file mode 100644 index 0000000000000..cec91716464db --- /dev/null +++ b/SimMuL1/plugins/GEMCSCTriggerRateTree.h @@ -0,0 +1,611 @@ +#ifndef SimMuL1_GEMCSCTriggerRateTree_h +#define SimMuL1_GEMCSCTriggerRateTree_h + +// system include files +#include +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/ESHandle.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Utilities/interface/InputTag.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" + +#include "Geometry/Records/interface/MuonGeometryRecord.h" +#include "Geometry/CSCGeometry/interface/CSCGeometry.h" + +#include "DataFormats/CSCDigi/interface/CSCALCTDigiCollection.h" +#include "DataFormats/CSCDigi/interface/CSCCLCTDigiCollection.h" +#include "DataFormats/CSCDigi/interface/CSCComparatorDigiCollection.h" + +#include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h" +#include "DataFormats/L1CSCTrackFinder/interface/L1CSCTrackCollection.h" +#include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutCollection.h" +#include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h" +#include "DataFormats/L1Trigger/interface/L1MuonParticle.h" +#include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h" +#include "DataFormats/L1Trigger/interface/L1MuonParticle.h" +#include "DataFormats/Math/interface/deltaPhi.h" + +#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h" +#include "L1Trigger/CSCCommonTrigger/interface/CSCTriggerGeometry.h" +#include "L1Trigger/CSCTrackFinder/interface/CSCTFPtLUT.h" +#include "L1Trigger/CSCTrackFinder/interface/CSCTFSectorProcessor.h" +#include "L1Trigger/CSCTrackFinder/interface/CSCSectorReceiverLUT.h" +#include "L1Trigger/CSCTrackFinder/interface/CSCTrackFinderDataTypes.h" +#include "L1Trigger/CSCTrackFinder/src/CSCTFDTReceiver.h" + +#include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h" +#include "CondFormats/L1TObjects/interface/L1MuTriggerPtScale.h" +#include "CondFormats/DataRecord/interface/L1MuTriggerScalesRcd.h" +#include "CondFormats/DataRecord/interface/L1MuTriggerPtScaleRcd.h" + +#include "GEMCode/SimMuL1/interface/MuGeometryHelpers.h" +#include "GEMCode/SimMuL1/interface/MatchCSCMuL1.h" + +// ROOT +#include "TH1.h" +#include "TH2.h" +#include "TTree.h" + +struct MyALCT +{ + Int_t event, detId, bx, pattern; + Float_t pt, eta, phi; +}; + +struct MyCLCT +{ + Int_t event, detId, bx, pattern; + Float_t pt, eta, phi; +}; + +struct MyLCT +{ + Int_t event, detId, bx; + Float_t pt, eta, phi; + Int_t quality, strip; + Char_t hasGEM; +}; + +struct MyMPCLCT +{ + Int_t event, detId, bx; + Float_t pt, eta, phi; + Int_t quality, strip; + Char_t hasGEM; +}; + +struct MyTFTrack +{ + Int_t event, bx; + Float_t pt, eta, phi; + Char_t hasME1a, hasME1b, hasME12, hasME13; + Char_t hasME21, hasME22; + Char_t hasME31, hasME32; + Char_t hasME41, hasME42; + Char_t hasGEM; +}; + +struct MyTFCand +{ + Int_t event, bx; + Float_t pt, eta, phi; + Char_t hasME1a, hasME1b, hasME12, hasME13; + Char_t hasME21, hasME22; + Char_t hasME31, hasME32; + Char_t hasME41, hasME42; + Char_t hasGEM; +}; + +struct MyGMTReg +{ + Int_t event, bx; + Float_t pt, eta, phi; + Char_t hasCSC, hasRPC, hasDT, hasGEM; +}; + +struct MyGMT +{ + Int_t event, bx; + Float_t pt, eta, phi; + Char_t hasCSC, hasRPC, hasDT, hasGEM; +}; + +class GEMCSCTriggerRateTree : public edm::EDAnalyzer +{ + public: + + explicit GEMCSCTriggerRateTree(const edm::ParameterSet&); + + ~GEMCSCTriggerRateTree(); + + virtual void beginRun(const edm::Run&, const edm::EventSetup&); + + virtual void beginJob(); + + virtual void analyze(const edm::Event&, const edm::EventSetup&); + + enum trig_cscs {MAX_STATIONS = 4, CSC_TYPES = 10}; + //Various useful constants + static const std::string csc_type[CSC_TYPES+1]; + static const std::string csc_type_[CSC_TYPES+1]; + static const std::string csc_type_a[CSC_TYPES+2]; + static const std::string csc_type_a_[CSC_TYPES+2]; + static const int pbend[CSCConstants::NUM_CLCT_PATTERNS]; + + enum pt_thresh {N_PT_THRESHOLDS = 6}; + static const double PT_THRESHOLDS[N_PT_THRESHOLDS]; + static const double PT_THRESHOLDS_FOR_ETA[N_PT_THRESHOLDS]; + + private: + + // functions + int getCSCType(CSCDetId &id); + int isME11(int t); + int getCSCSpecsType(CSCDetId &id); + int cscTriggerSubsector(CSCDetId &id); + + // From Ingo: + // calculates the weight of the event to reproduce a min bias + //spectrum, from G. Wrochna's note CMSS 1997/096 + void setupTFModeHisto(TH1D* h); + void runCSCTFSP(const CSCCorrelatedLCTDigiCollection*, const L1MuDTChambPhContainer*); + + std::pair intersectionEtaPhi(CSCDetId id, int wg, int hs); + csctf::TrackStub buildTrackStub(const CSCCorrelatedLCTDigi &d, CSCDetId id); + + void bookALCTTree(); + void bookCLCTTree(); + void bookLCTTree(); + void bookMPCLCTTree(); + void bookTFTrackTree(); + void bookTFCandTree(); + void bookGMTRegionalTree(); + void bookGMTCandTree(); + + void analyzeALCTRate(const edm::Event&); + void analyzeCLCTRate(const edm::Event&); + void analyzeLCTRate(const edm::Event&); + void analyzeMPCLCTRate(const edm::Event&); + void analyzeTFTrackRate(const edm::Event&); + void analyzeTFCandRate(const edm::Event&); + void analyzeGMTRegionalRate(const edm::Event&); + void analyzeGMTCandRate(const edm::Event&); + + // parameters + edm::ParameterSet CSCTFSPset; + edm::ParameterSet ptLUTset; + CSCTFPtLUT* ptLUT; + CSCTFSectorProcessor* my_SPs[2][6]; + CSCSectorReceiverLUT* srLUTs_[5][6][2]; + CSCTFDTReceiver* my_dtrc; + unsigned long long muScalesCacheID_; + unsigned long long muPtScaleCacheID_; + + edm::ESHandle< L1MuTriggerScales > muScales; + edm::ESHandle< L1MuTriggerPtScale > muPtScale; + + // config parameters: + bool matchAllTrigPrimitivesInChamber_; + int debugRATE; + + int minBX_; + int maxBX_; + int minTMBBX_; + int maxTMBBX_; + int minRateBX_; + int maxRateBX_; + + int minBxALCT_; + int maxBxALCT_; + int minBxCLCT_; + int maxBxCLCT_; + int minBxLCT_; + int maxBxLCT_; + int minBxMPLCT_; + int maxBxMPLCT_; + int minBxGMT_; + int maxBxGMT_; + + bool centralBxOnlyGMT_; + bool doSelectEtaForGMTRates_; + bool doME1a_; + bool defaultME1a; + + const CSCGeometry* cscGeometry; + + TTree* alct_tree_; + TTree* clct_tree_; + TTree* lct_tree_; + TTree* mplct_tree_; + TTree* tftrack_tree_; + TTree* tfcand_tree_; + TTree* gmtreg_tree_; + TTree* gmt_tree_; + + MyALCT alct_; + MyCLCT clct_; + MyLCT lct_; + MyMPCLCT mpclct_; + MyTFTrack tftrack_; + MyTFCand tfcand_; + MyGMTReg gmtreg_; + MyGMT gmt_; + + // --- rate histograms --- + + TH1D * h_rt_lct_per_sector; + TH2D * h_rt_lct_per_sector_vs_bx; + TH1D * h_rt_mplct_per_sector; + TH2D * h_rt_mplct_per_sector_vs_bx; + TH1D * h_rt_lct_per_sector_st[MAX_STATIONS]; + TH2D * h_rt_lct_per_sector_vs_bx_st[MAX_STATIONS]; + TH1D * h_rt_mplct_per_sector_st[MAX_STATIONS]; + TH2D * h_rt_mplct_per_sector_vs_bx_st[MAX_STATIONS]; + TH2D * h_rt_lct_per_sector_vs_bx_st1t; + TH2D * h_rt_mplct_per_sector_vs_bx_st1t; + + TH1D * h_rt_nalct; + TH1D * h_rt_nclct; + TH1D * h_rt_nlct; + TH1D * h_rt_nmplct; + TH1D * h_rt_ntftrack; + TH1D * h_rt_ntfcand; + TH1D * h_rt_ntfcand_pt10; + TH1D * h_rt_ngmt_csc; + TH1D * h_rt_ngmt_csc_pt10; + TH1D * h_rt_ngmt_csc_per_bx; + TH1D * h_rt_ngmt_rpcf; + TH1D * h_rt_ngmt_rpcf_pt10; + TH1D * h_rt_ngmt_rpcf_per_bx; + TH1D * h_rt_ngmt_rpcb; + TH1D * h_rt_ngmt_rpcb_pt10; + TH1D * h_rt_ngmt_rpcb_per_bx; + TH1D * h_rt_ngmt_dt; + TH1D * h_rt_ngmt_dt_pt10; + TH1D * h_rt_ngmt_dt_per_bx; + TH1D * h_rt_ngmt; + TH1D * h_rt_nxtra; + + TH1D * h_rt_nalct_per_bx; + TH1D * h_rt_nclct_per_bx; + TH1D * h_rt_nlct_per_bx; + + TH1D * h_rt_alct_bx; + TH1D * h_rt_clct_bx; + TH1D * h_rt_lct_bx; + TH1D * h_rt_mplct_bx; + TH1D * h_rt_csctype_alct_bx567; + TH1D * h_rt_csctype_clct_bx567; + TH1D * h_rt_csctype_lct_bx567; + TH1D * h_rt_csctype_mplct_bx567; + TH1D * h_rt_alct_bx_cscdet[CSC_TYPES+1]; + TH1D * h_rt_clct_bx_cscdet[CSC_TYPES+1]; + TH1D * h_rt_lct_bx_cscdet[CSC_TYPES+1]; + TH1D * h_rt_mplct_bx_cscdet[CSC_TYPES+1]; + + TH2D * h_rt_lct_qu_vs_bx; + TH2D * h_rt_mplct_qu_vs_bx; + + TH2D * h_rt_nalct_vs_bx; + TH2D * h_rt_nclct_vs_bx; + TH2D * h_rt_nlct_vs_bx; + TH2D * h_rt_nmplct_vs_bx; + + TH2D * h_rt_n_per_ch_alct_vs_bx_cscdet[CSC_TYPES+1]; + TH2D * h_rt_n_per_ch_clct_vs_bx_cscdet[CSC_TYPES+1]; + TH2D * h_rt_n_per_ch_lct_vs_bx_cscdet[CSC_TYPES+1]; + + TH1D * h_rt_n_ch_alct_per_bx_cscdet[CSC_TYPES+1]; + TH1D * h_rt_n_ch_clct_per_bx_cscdet[CSC_TYPES+1]; + TH1D * h_rt_n_ch_lct_per_bx_cscdet[CSC_TYPES+1]; + + TH1D * h_rt_n_ch_alct_per_bx_st[MAX_STATIONS]; + TH1D * h_rt_n_ch_clct_per_bx_st[MAX_STATIONS]; + TH1D * h_rt_n_ch_lct_per_bx_st[MAX_STATIONS]; + + TH1D * h_rt_n_ch_alct_per_bx; + TH1D * h_rt_n_ch_clct_per_bx; + TH1D * h_rt_n_ch_lct_per_bx; + + TH1D * h_rt_lct_qu; + TH1D * h_rt_mplct_qu; + + TH2D * h_rt_qu_vs_bxclct__lct; + + TH1D * h_rt_mplct_pattern; + TH1D * h_rt_mplct_pattern_cscdet[CSC_TYPES+1]; + + TH1D * h_rt_tftrack_pt; + TH1D * h_rt_tfcand_pt; + + TH1D * h_rt_tfcand_pt_2st; + TH1D * h_rt_tfcand_pt_3st; + + TH1D * h_rt_tfcand_pt_h42_2st; + TH1D * h_rt_tfcand_pt_h42_3st; + + TH1D * h_rt_tftrack_bx; + TH1D * h_rt_tfcand_bx; + + TH1D * h_rt_tfcand_eta; + TH1D * h_rt_tfcand_eta_pt5; + TH1D * h_rt_tfcand_eta_pt10; + TH1D * h_rt_tfcand_eta_pt15; + + TH1D * h_rt_tfcand_eta_3st; + TH1D * h_rt_tfcand_eta_pt5_3st; + TH1D * h_rt_tfcand_eta_pt10_3st; + TH1D * h_rt_tfcand_eta_pt15_3st; + + TH1D * h_rt_tfcand_eta_3st1a; + TH1D * h_rt_tfcand_eta_pt5_3st1a; + TH1D * h_rt_tfcand_eta_pt10_3st1a; + TH1D * h_rt_tfcand_eta_pt15_3st1a; + + TH2D * h_rt_tfcand_pt_vs_eta; + TH2D * h_rt_tfcand_pt_vs_eta_3st; + TH2D * h_rt_tfcand_pt_vs_eta_3st1a; + + TH1D * h_rt_gmt_csc_pt; + TH1D * h_rt_gmt_csc_ptmax_2s; + TH1D * h_rt_gmt_csc_ptmax_2s_1b; + TH1D * h_rt_gmt_csc_ptmax_2s_no1a; + TH1D * h_rt_gmt_csc_ptmax_3s; + TH1D * h_rt_gmt_csc_ptmax_3s_1b; + TH1D * h_rt_gmt_csc_ptmax_3s_no1a; + TH1D * h_rt_gmt_csc_ptmax_3s_2s1b; + TH1D * h_rt_gmt_csc_ptmax_3s_2s1b_1b; + TH1D * h_rt_gmt_csc_ptmax_3s_2s123_1b; + TH1D * h_rt_gmt_csc_ptmax_3s_2s13_1b; + TH1D * h_rt_gmt_csc_ptmax_3s_2s1b_no1a; + TH1D * h_rt_gmt_csc_ptmax_3s_2s123_no1a; + TH1D * h_rt_gmt_csc_ptmax_3s_2s13_no1a; + TH1D * h_rt_gmt_csc_ptmax_3s_3s1b; + TH1D * h_rt_gmt_csc_ptmax_3s_3s1b_1b; + TH1D * h_rt_gmt_csc_ptmax_3s_3s1b_no1a; + TH1D * h_rt_gmt_csc_ptmax_2q; + TH1D * h_rt_gmt_csc_ptmax_3q; + TH1D * h_rt_gmt_csc_pt_2s42; + TH1D * h_rt_gmt_csc_pt_3s42; + TH1D * h_rt_gmt_csc_ptmax_2s42; + TH1D * h_rt_gmt_csc_ptmax_3s42; + TH1D * h_rt_gmt_csc_pt_2q42; + TH1D * h_rt_gmt_csc_pt_3q42; + TH1D * h_rt_gmt_csc_ptmax_2q42; + TH1D * h_rt_gmt_csc_ptmax_3q42; + TH1D * h_rt_gmt_csc_pt_2s42r; + TH1D * h_rt_gmt_csc_pt_3s42r; + TH1D * h_rt_gmt_csc_ptmax_2s42r; + TH1D * h_rt_gmt_csc_ptmax_3s42r; + TH1D * h_rt_gmt_csc_pt_2q42r; + TH1D * h_rt_gmt_csc_pt_3q42r; + TH1D * h_rt_gmt_csc_ptmax_2q42r; + TH1D * h_rt_gmt_csc_ptmax_3q42r; + + + TH1D * h_rt_gmt_rpcf_pt; + TH1D * h_rt_gmt_rpcf_pt_42; + TH1D * h_rt_gmt_rpcf_ptmax; + TH1D * h_rt_gmt_rpcf_ptmax_42; + + TH1D * h_rt_gmt_rpcb_pt; + TH1D * h_rt_gmt_rpcb_ptmax; + + TH1D * h_rt_gmt_dt_pt; + TH1D * h_rt_gmt_dt_ptmax; + + TH1D * h_rt_gmt_pt; + TH1D * h_rt_gmt_pt_2s42; + TH1D * h_rt_gmt_pt_3s42; + TH1D * h_rt_gmt_ptmax_2s42; + TH1D * h_rt_gmt_ptmax_3s42; + TH1D * h_rt_gmt_ptmax_2s42_sing; + TH1D * h_rt_gmt_ptmax_3s42_sing; + TH1D * h_rt_gmt_pt_2s42r; + TH1D * h_rt_gmt_pt_3s42r; + TH1D * h_rt_gmt_ptmax_2s42r; + TH1D * h_rt_gmt_ptmax_3s42r; + TH1D * h_rt_gmt_ptmax_2s42r_sing; + TH1D * h_rt_gmt_ptmax_3s42r_sing; + TH1D * h_rt_gmt_ptmax; + TH1D * h_rt_gmt_ptmax_sing; + TH1D * h_rt_gmt_ptmax_sing_3s; + TH1D * h_rt_gmt_ptmax_sing_csc; + TH1D * h_rt_gmt_ptmax_sing_1b; + TH1D * h_rt_gmt_ptmax_sing_no1a; + TH1D * h_rt_gmt_ptmax_sing6; + TH1D * h_rt_gmt_ptmax_sing6_3s; + TH1D * h_rt_gmt_ptmax_sing6_csc; + TH1D * h_rt_gmt_ptmax_sing6_1b; + TH1D * h_rt_gmt_ptmax_sing6_no1a; + TH1D * h_rt_gmt_ptmax_sing6_3s1b_no1a; + TH1D * h_rt_gmt_ptmax_dbl; + TH1D * h_rt_gmt_pt_2q42; + TH1D * h_rt_gmt_pt_3q42; + TH1D * h_rt_gmt_ptmax_2q42; + TH1D * h_rt_gmt_ptmax_3q42; + TH1D * h_rt_gmt_ptmax_2q42_sing; + TH1D * h_rt_gmt_ptmax_3q42_sing; + TH1D * h_rt_gmt_pt_2q42r; + TH1D * h_rt_gmt_pt_3q42r; + TH1D * h_rt_gmt_ptmax_2q42r; + TH1D * h_rt_gmt_ptmax_3q42r; + TH1D * h_rt_gmt_ptmax_2q42r_sing; + TH1D * h_rt_gmt_ptmax_3q42r_sing; + + TH1D * h_rt_gmt_csc_eta; + TH1D * h_rt_gmt_csc_ptmax10_eta_2s; + TH1D * h_rt_gmt_csc_ptmax10_eta_2s_2s1b; + TH1D * h_rt_gmt_csc_ptmax10_eta_3s; + TH1D * h_rt_gmt_csc_ptmax10_eta_3s_1b; + TH1D * h_rt_gmt_csc_ptmax10_eta_3s_no1a; + TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s1b; + TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s1b_1b; + TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s123_1b; + TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s13_1b; + TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s1b_no1a; + TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s123_no1a; + TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s13_no1a; + TH1D * h_rt_gmt_csc_ptmax10_eta_3s_3s1b; + TH1D * h_rt_gmt_csc_ptmax10_eta_3s_3s1b_1b; + TH1D * h_rt_gmt_csc_ptmax10_eta_3s_3s1b_no1a; + TH1D * h_rt_gmt_csc_ptmax10_eta_2q; + TH1D * h_rt_gmt_csc_ptmax10_eta_3q; + + TH1D * h_rt_gmt_csc_ptmax20_eta_2s; + TH1D * h_rt_gmt_csc_ptmax20_eta_2s_2s1b; + TH1D * h_rt_gmt_csc_ptmax20_eta_3s; + TH1D * h_rt_gmt_csc_ptmax20_eta_3s_1b; + TH1D * h_rt_gmt_csc_ptmax20_eta_3s_1ab; + TH1D * h_rt_gmt_csc_ptmax20_eta_3s_no1a; + TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s1b; + TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s1b_1b; + TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s123_1b; + TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s13_1b; + TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s1b_no1a; + TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s123_no1a; + TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s13_no1a; + TH1D * h_rt_gmt_csc_ptmax20_eta_3s_3s1b; + TH1D * h_rt_gmt_csc_ptmax20_eta_3s_3s1b_1b; + TH1D * h_rt_gmt_csc_ptmax20_eta_3s_3s1b_no1a; + TH1D * h_rt_gmt_csc_ptmax20_eta_3s_3s1ab; + TH1D * h_rt_gmt_csc_ptmax20_eta_2q; + TH1D * h_rt_gmt_csc_ptmax20_eta_3q; + + TH1D * h_rt_gmt_csc_ptmax30_eta_2s; + TH1D * h_rt_gmt_csc_ptmax30_eta_2s_2s1b; + TH1D * h_rt_gmt_csc_ptmax30_eta_3s; + TH1D * h_rt_gmt_csc_ptmax30_eta_3s_1b; + TH1D * h_rt_gmt_csc_ptmax30_eta_3s_1ab; + TH1D * h_rt_gmt_csc_ptmax30_eta_3s_no1a; + TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s1b; + TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s1b_1b; + TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s123_1b; + TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s13_1b; + TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s1b_no1a; + TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s123_no1a; + TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s13_no1a; + TH1D * h_rt_gmt_csc_ptmax30_eta_3s_3s1b; + TH1D * h_rt_gmt_csc_ptmax30_eta_3s_3s1b_1b; + TH1D * h_rt_gmt_csc_ptmax30_eta_3s_3s1b_no1a; + TH1D * h_rt_gmt_csc_ptmax30_eta_3s_3s1ab; + TH1D * h_rt_gmt_csc_ptmax30_eta_2q; + TH1D * h_rt_gmt_csc_ptmax30_eta_3q; + + TH1D * h_rt_gmt_csc_mode_2s1b_1b[6]; + + TH1D * h_rt_gmt_rpcf_eta; + TH1D * h_rt_gmt_rpcf_ptmax10_eta; + TH1D * h_rt_gmt_rpcf_ptmax20_eta; + TH1D * h_rt_gmt_rpcb_eta; + TH1D * h_rt_gmt_rpcb_ptmax10_eta; + TH1D * h_rt_gmt_rpcb_ptmax20_eta; + TH1D * h_rt_gmt_dt_eta; + TH1D * h_rt_gmt_dt_ptmax10_eta; + TH1D * h_rt_gmt_dt_ptmax20_eta; + TH1D * h_rt_gmt_eta; + TH1D * h_rt_gmt_ptmax10_eta; + TH1D * h_rt_gmt_ptmax10_eta_sing; + TH1D * h_rt_gmt_ptmax10_eta_sing_3s; + TH1D * h_rt_gmt_ptmax10_eta_dbl; + TH1D * h_rt_gmt_ptmax20_eta; + TH1D * h_rt_gmt_ptmax20_eta_sing; + TH1D * h_rt_gmt_ptmax20_eta_sing_csc; + TH1D * h_rt_gmt_ptmax20_eta_sing_dtcsc; + TH1D * h_rt_gmt_ptmax20_eta_sing_3s; + TH1D * h_rt_gmt_ptmax30_eta_sing; + TH1D * h_rt_gmt_ptmax30_eta_sing_csc; + TH1D * h_rt_gmt_ptmax30_eta_sing_dtcsc; + TH1D * h_rt_gmt_ptmax30_eta_sing_3s; + TH1D * h_rt_gmt_ptmax10_eta_sing6; + TH1D * h_rt_gmt_ptmax10_eta_sing6_3s; + TH1D * h_rt_gmt_ptmax20_eta_sing6; + TH1D * h_rt_gmt_ptmax20_eta_sing6_csc; + TH1D * h_rt_gmt_ptmax20_eta_sing6_dtcsc; + TH1D * h_rt_gmt_ptmax20_eta_sing6_3s; + TH1D * h_rt_gmt_ptmax30_eta_sing6; + TH1D * h_rt_gmt_ptmax30_eta_sing6_csc; + TH1D * h_rt_gmt_ptmax30_eta_sing6_dtcsc; + TH1D * h_rt_gmt_ptmax30_eta_sing6_3s; + TH1D * h_rt_gmt_ptmax20_eta_dbl; + + TH1D * h_rt_gmt_csc_pt_2st; + TH1D * h_rt_gmt_csc_pt_3st; + TH1D * h_rt_gmt_csc_pt_2q; + TH1D * h_rt_gmt_csc_pt_3q; + TH1D * h_rt_gmt_pt_2st; + TH1D * h_rt_gmt_pt_3st; + TH1D * h_rt_gmt_pt_2q; + TH1D * h_rt_gmt_pt_3q; + + TH1D * h_rt_gmt_csc_bx; + TH1D * h_rt_gmt_rpcf_bx; + TH1D * h_rt_gmt_rpcb_bx; + TH1D * h_rt_gmt_dt_bx; + TH1D * h_rt_gmt_bx; + + TH1D * h_rt_gmt_csc_q; + TH1D * h_rt_gmt_csc_q_42; + TH1D * h_rt_gmt_csc_q_42r; + TH1D * h_rt_gmt_rpcf_q; + TH1D * h_rt_gmt_rpcf_q_42; + TH1D * h_rt_gmt_rpcb_q; + TH1D * h_rt_gmt_dt_q; + TH1D * h_rt_gmt_gq; + TH1D * h_rt_gmt_gq_42; + TH1D * h_rt_gmt_gq_42r; + TH2D * h_rt_gmt_gq_vs_pt_42r; + TH2D * h_rt_gmt_gq_vs_type_42r; + TH1D * h_rt_tftrack_mode; + + + TH1D * h_gmt_mindr; + TH1D * h_gmt_dr_maxrank; + + TH1D * h_gmt_pt_initial_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_pt_dt_initial_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_pt_csc_initial_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_pt_dtcsc_initial_gpt[N_PT_THRESHOLDS]; + + TH1D * h_gmt_pt_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_pt_2s_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_pt_3s_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_pt_dt_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_pt_csc_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_pt_csc_2s_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_pt_csc_3s_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_pt_dtcsc_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_pt_dtcsc_2s_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_pt_dtcsc_3s_sing_gpt[N_PT_THRESHOLDS]; + + + TH1D * h_gmt_eta_initial_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_eta_dt_initial_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_eta_csc_initial_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_eta_rpcf_initial_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_eta_rpcb_initial_gpt[N_PT_THRESHOLDS]; + + TH1D * h_gmt_eta_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_eta_2s_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_eta_3s_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_eta_2q_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_eta_3q_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_eta_csc_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_eta_csc_2s_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_eta_csc_3s_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_eta_csc_2q_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_eta_csc_3q_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_eta_dt_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_eta_rpcf_sing_gpt[N_PT_THRESHOLDS]; + TH1D * h_gmt_eta_rpcb_sing_gpt[N_PT_THRESHOLDS]; +}; + +#endif diff --git a/SimMuL1/python/GEMCSCTriggerRateTree_cfi.py b/SimMuL1/python/GEMCSCTriggerRateTree_cfi.py new file mode 100644 index 0000000000000..dfe4712f6e688 --- /dev/null +++ b/SimMuL1/python/GEMCSCTriggerRateTree_cfi.py @@ -0,0 +1,16 @@ +import FWCore.ParameterSet.Config as cms + +GEMCSCTriggerRateTree = cms.EDFilter("GEMCSCTriggerRateTree", + doME1a = cms.untracked.bool(True), + defaultME1a = cms.untracked.bool(False), + minBxALCT = cms.untracked.int32(5), + maxBxALCT = cms.untracked.int32(7), + minBxCLCT = cms.untracked.int32(5), + maxBxCLCT = cms.untracked.int32(7), + minBxLCT = cms.untracked.int32(5), + maxBxLCT = cms.untracked.int32(7), + minBxMPLCT = cms.untracked.int32(5), + maxBxMPLCT = cms.untracked.int32(7), + sectorProcessor = cms.untracked.PSet(), + strips = cms.untracked.PSet() +) diff --git a/SimMuL1/test/runGEMCSCTriggerRateTree_cfg.py b/SimMuL1/test/runGEMCSCTriggerRateTree_cfg.py new file mode 100644 index 0000000000000..fc4b7593d6835 --- /dev/null +++ b/SimMuL1/test/runGEMCSCTriggerRateTree_cfg.py @@ -0,0 +1,129 @@ +import FWCore.ParameterSet.Config as cms +import os + +## initialization +process = cms.Process('GEMCSCTRGANA') + +## CMSSW RELEASE +cmssw = os.getenv( "CMSSW_VERSION" ) + +## steering +deltaMatch = 2 +pileup = 100 +events = 1000000 +#sample = 'dimu' +sample = 'minbias' +globalTag = 'upgrade2019' + +## input +from GEMCode.SimMuL1.GEMCSCTriggerSamplesLib import files +suffix = '_gem_dphi_pat2_PU0' +inputDir = files[suffix] +inputDir = ['/afs/cern.ch/user/d/dildick/work/GEM/CMSSW_6_1_2_SLHC6_patch1/src/tempDir/'] +inputFiles = [] +import os +for d in range(len(inputDir)): + my_dir = inputDir[d] + if not os.path.isdir(my_dir): + print "ERROR: This is not a valid directory: ", my_dir + if d==len(inputDir)-1: + print "ERROR: No input files were selected" + exit() + continue + print "Proceed to next directory" + ls = os.listdir(my_dir) + inputFiles.extend([my_dir[:] + 'file:' + x for x in ls if x.endswith('root')]) + +print "inputFiles:", inputFiles + +## readout windows +w = 3 +if w==3: + readout_windows = [ [5,7],[5,7],[5,7],[5,7] ] +if w==11: + readout_windows = [ [1,11],[1,11],[1,11],[1,11] ] +if w==7: + readout_windows = [ [5,11],[5,11],[5,11],[5,11] ] +if w==61: + readout_windows = [ [5,10],[1,11],[1,11],[1,11] ] + +## output +outputFileName = 'hp_' + sample + "_" + cmssw + "_" + globalTag + "_pu%d"%(pileup) + '_w%d'%(w) + suffix + '.root' +print "outputFile:", outputFileName + +# import of standard configurations +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.StandardSequences.Services_cff') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.Geometry.GeometryExtended2019Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2019_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgrade2019', '') +process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +process.load('L1TriggerConfig.L1ScalesProducers.L1MuTriggerScalesConfig_cff') +process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") +process.load("Configuration.StandardSequences.L1Emulator_cff") +process.load("Configuration.StandardSequences.L1Extra_cff") +process.load("RecoMuon.TrackingTools.MuonServiceProxy_cff") +process.load("SimMuon.CSCDigitizer.muonCSCDigis_cfi") +process.load('Configuration.StandardSequences.Digi_cff') +process.load('L1Trigger.CSCTrackFinder.csctfTrackDigisUngangedME1a_cfi') +process.simCsctfTrackDigis = process.csctfTrackDigisUngangedME1a.clone() +process.simCsctfTrackDigis.DTproducer = cms.untracked.InputTag("simDtTriggerPrimitiveDigis") +process.simCsctfTrackDigis.SectorReceiverInput = cms.untracked.InputTag("simCscTriggerPrimitiveDigis","MPCSORTED") +process.simCsctfTrackDigis.SectorProcessor.isCoreVerbose = cms.bool(True) + +process.options = cms.untracked.PSet( + makeTriggerResults = cms.untracked.bool(False), + wantSummary = cms.untracked.bool(True) +) + +process.source = cms.Source("PoolSource", + duplicateCheckMode = cms.untracked.string('noDuplicateCheck'), +# inputCommands = cms.untracked.vstring( +# 'keep *_*_*_*', +# 'drop *_simDtTriggerPrimitiveDigis_*_MUTRG' +# ), + fileNames = cms.untracked.vstring( + *inputFiles + ) +) + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(events) +) + +process.TFileService = cms.Service("TFileService", + fileName = cms.string(outputFileName) +) + +process.load('GEMCode.SimMuL1.GEMCSCTriggerRateTree_cfi') +process.GEMCSCTriggerRateTree.minBxALCT = readout_windows[0][0] +process.GEMCSCTriggerRateTree.maxBxALCT = readout_windows[0][1] +process.GEMCSCTriggerRateTree.minBxCLCT = readout_windows[1][0] +process.GEMCSCTriggerRateTree.maxBxCLCT = readout_windows[1][1] +process.GEMCSCTriggerRateTree.minBxLCT = readout_windows[2][0] +process.GEMCSCTriggerRateTree.maxBxLCT = readout_windows[2][1] +process.GEMCSCTriggerRateTree.minBxMPLCT = readout_windows[3][0] +process.GEMCSCTriggerRateTree.maxBxMPLCT = readout_windows[3][1] +process.GEMCSCTriggerRateTree.sectorProcessor = process.simCsctfTrackDigis.SectorProcessor +process.GEMCSCTriggerRateTree.strips = process.simMuonCSCDigis.strips + + +## customization +from SLHCUpgradeSimulations.Configuration.muonCustoms import * +process = customise_csc_Geometry(process) +process = digitizer_timing_pre3_median(process) +process = customise_csc_L1Extra_allsim(process) + +## Sequence and schedule +process.ana_seq = cms.Sequence(process.GEMCSCTriggerRateTree) +process.l1extra_step = cms.Path(process.L1Extra) +process.ana_step = cms.Path(process.ana_seq) + +process.schedule = cms.Schedule( +# process.l1extra_step, + process.ana_step +) From 8c185b41a57aedec1fa6a8d07782680c423ffc51 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 16 Sep 2013 01:37:30 +0200 Subject: [PATCH 113/182] wrong namespace --- SimMuL1/plugins/GEMCSCTriggerEfficiency.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc b/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc index d398737c5adb6..04c37ff19e386 100644 --- a/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc +++ b/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc @@ -1428,8 +1428,8 @@ GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& iSetu bool eta_ok = ( fabs(steta) >= 1.2 && fabs(steta) <= 2.14 ); bool etapt_ok = eta_ok && pt_ok; - bool eta_1b = etaRangeHelpers::isME1bEtaRegion(steta, 1.6, 2.12); - bool eta_gem_1b = etaRangeHelpers::isME1bEtaRegion(steta, 1.64, 2.05); + bool eta_1b = mugeo::isME1bEtaRegion(steta, 1.6, 2.12); + bool eta_gem_1b = mugeo::isME1bEtaRegion(steta, 1.64, 2.05); unsigned nst_with_hits = match->nStationsWithHits(); @@ -2259,7 +2259,7 @@ GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& iSetu // wor weight calculation //if (fabs(steta)>1.25 && fabs(steta)<1.9) { - if (etaRangeHelpers::isME42EtaRegion(steta)) { + if (mugeo::isME42EtaRegion(steta)) { // double weight = rateWeight(stpt); if (tfc->tftrack->nStubs()>=2) { h_tf_pt_h42_2st->Fill(tfc_pt); From 7350a75778e23b91f9427292cb598bcdfb22ba76 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 16 Sep 2013 09:36:48 +0200 Subject: [PATCH 114/182] ALCTs --- SimMuL1/plugins/GEMCSCTriggerRateTree.cc | 1577 +++++++++++----------- SimMuL1/plugins/GEMCSCTriggerRateTree.h | 708 +++++----- 2 files changed, 1160 insertions(+), 1125 deletions(-) diff --git a/SimMuL1/plugins/GEMCSCTriggerRateTree.cc b/SimMuL1/plugins/GEMCSCTriggerRateTree.cc index 62cc0ba646547..be19c70b38249 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRateTree.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRateTree.cc @@ -38,7 +38,7 @@ GEMCSCTriggerRateTree::GEMCSCTriggerRateTree(const edm::ParameterSet& iConfig): for(int e=0; e<2; e++) for (int s=0; s<6; s++) - my_SPs[e][s] = NULL; + my_SPs[e][s] = nullptr; bool TMB07 = true; for(int endcap = 1; endcap<=2; endcap++) @@ -61,35 +61,35 @@ GEMCSCTriggerRateTree::GEMCSCTriggerRateTree(const edm::ParameterSet& iConfig): muScalesCacheID_ = 0ULL ; muPtScaleCacheID_ = 0ULL ; -// bookALCTTree(); -// bookCLCTTree(); -// bookLCTTree(); -// bookMPLCTTree(); -// bookTFTrackTree(); -// bookTFCandTree(); -// bookGMTRegionalTree(); -// bookGMTCandTree(); + bookALCTTree(); + bookCLCTTree(); + bookLCTTree(); + bookMPCLCTTree(); + bookTFTrackTree(); + bookTFCandTree(); + bookGMTRegionalTree(); + bookGMTCandTree(); } // ================================================================================================ GEMCSCTriggerRateTree::~GEMCSCTriggerRateTree() { if(ptLUT) delete ptLUT; - ptLUT = NULL; + ptLUT = nullptr; for(int e=0; e<2; e++) for (int s=0; s<6; s++){ if (my_SPs[e][s]) delete my_SPs[e][s]; - my_SPs[e][s] = NULL; + my_SPs[e][s] = nullptr; for(int fpga=0; fpga<5; fpga++) { if (srLUTs_[fpga][s][e]) delete srLUTs_[fpga][s][e]; - srLUTs_[fpga][s][e] = NULL; + srLUTs_[fpga][s][e] = nullptr; } } if(my_dtrc) delete my_dtrc; - my_dtrc = NULL; + my_dtrc = nullptr; } // ================================================================================================ @@ -106,440 +106,440 @@ GEMCSCTriggerRateTree::beginRun(const edm::Run &iRun, const edm::EventSetup &iSe void GEMCSCTriggerRateTree::beginJob() { - edm::Service fs; +// edm::Service fs; - Double_t ETA_BIN = 0.0125 *2; - //Double_t PHI_BIN = 62.*M_PI/180./4096.; // 0.26 mrad - int N_ETA_BINS=200; - double ETA_START=-2.4999; - double ETA_END = ETA_START + ETA_BIN*N_ETA_BINS; +// Double_t ETA_BIN = 0.0125 *2; +// //Double_t PHI_BIN = 62.*M_PI/180./4096.; // 0.26 mrad +// int N_ETA_BINS=200; +// double ETA_START=-2.4999; +// double ETA_END = ETA_START + ETA_BIN*N_ETA_BINS; - int N_ETA_BINS_CSC = 32; - double ETA_START_CSC = 0.9; - double ETA_END_CSC = 2.5; - - int N_ETA_BINS_DT = 32; - double ETA_START_DT = 0.; - double ETA_END_DT = 1.2; - - const int N_ETA_BINS_RPC = 17; - double ETA_BINS_RPC[N_ETA_BINS_RPC+1] = - {0, 0.07, 0.27, 0.44, 0.58, 0.72, 0.83, 0.93, 1.04, 1.14, - 1.24, 1.36, 1.48, 1.61, 1.73, 1.85, 1.97, 2.1}; - - const int N_ETA_BINS_GMT = 32; - double ETA_BINS_GMT[N_ETA_BINS_GMT+1] = - {0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, - 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.75, 1.8, - 1.85, 1.9, 1.95, 2, 2.05, 2.1, 2.15, 2.2, 2.25, 2.3, - 2.35, 2.4, 2.45}; +// int N_ETA_BINS_CSC = 32; +// double ETA_START_CSC = 0.9; +// double ETA_END_CSC = 2.5; + +// int N_ETA_BINS_DT = 32; +// double ETA_START_DT = 0.; +// double ETA_END_DT = 1.2; + +// const int N_ETA_BINS_RPC = 17; +// double ETA_BINS_RPC[N_ETA_BINS_RPC+1] = +// {0, 0.07, 0.27, 0.44, 0.58, 0.72, 0.83, 0.93, 1.04, 1.14, +// 1.24, 1.36, 1.48, 1.61, 1.73, 1.85, 1.97, 2.1}; + +// const int N_ETA_BINS_GMT = 32; +// double ETA_BINS_GMT[N_ETA_BINS_GMT+1] = +// {0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, +// 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.75, 1.8, +// 1.85, 1.9, 1.95, 2, 2.05, 2.1, 2.15, 2.2, 2.25, 2.3, +// 2.35, 2.4, 2.45}; - h_rt_nalct = fs->make("h_rt_nalct","h_rt_nalct",101,-0.5, 100.5); - h_rt_nclct = fs->make("h_rt_nclct","h_rt_nclct",101,-0.5, 100.5); - h_rt_nlct = fs->make("h_rt_nlct","h_rt_nlct",101,-0.5, 100.5); - h_rt_nmplct = fs->make("h_rt_nmplct","h_rt_nmplct",101,-0.5, 100.5); - h_rt_ntftrack = fs->make("h_rt_ntftrack","h_rt_ntftrack",31,-0.5, 30.5); - h_rt_ntfcand = fs->make("h_rt_ntfcand","h_rt_ntfcand",31,-0.5, 30.5); - h_rt_ntfcand_pt10 = fs->make("h_rt_ntfcand_pt10","h_rt_ntfcand_pt10",31,-0.5, 30.5); - h_rt_ngmt_csc = fs->make("h_rt_ngmt_csc","h_rt_ngmt_csc",11,-0.5, 10.5); - h_rt_ngmt_csc_pt10 = fs->make("h_rt_ngmt_csc_pt10","h_rt_ngmt_csc_pt10",11,-0.5, 10.5); - h_rt_ngmt_csc_per_bx = fs->make("h_rt_ngmt_csc_per_bx","h_rt_ngmt_csc_per_bx",11,-0.5, 10.5); - h_rt_ngmt_rpcf = fs->make("h_rt_ngmt_rpcf","h_rt_ngmt_rpcf",11,-0.5, 10.5); - h_rt_ngmt_rpcf_pt10 = fs->make("h_rt_ngmt_rpcf_pt10","h_rt_ngmt_rpcf_pt10",11,-0.5, 10.5); - h_rt_ngmt_rpcf_per_bx = fs->make("h_rt_ngmt_rpcf_per_bx","h_rt_ngmt_rpcf_per_bx",11,-0.5, 10.5); - h_rt_ngmt_rpcb = fs->make("h_rt_ngmt_rpcb","h_rt_ngmt_rpcb",11,-0.5, 10.5); - h_rt_ngmt_rpcb_pt10 = fs->make("h_rt_ngmt_rpcb_pt10","h_rt_ngmt_rpcb_pt10",11,-0.5, 10.5); - h_rt_ngmt_rpcb_per_bx = fs->make("h_rt_ngmt_rpcb_per_bx","h_rt_ngmt_rpcb_per_bx",11,-0.5, 10.5); - h_rt_ngmt_dt = fs->make("h_rt_ngmt_dt","h_rt_ngmt_dt",11,-0.5, 10.5); - h_rt_ngmt_dt_pt10 = fs->make("h_rt_ngmt_dt_pt10","h_rt_ngmt_dt_pt10",11,-0.5, 10.5); - h_rt_ngmt_dt_per_bx = fs->make("h_rt_ngmt_dt_per_bx","h_rt_ngmt_dt_per_bx",11,-0.5, 10.5); - h_rt_ngmt = fs->make("h_rt_ngmt","h_rt_ngmt",11,-0.5, 10.5); - h_rt_nxtra = fs->make("h_rt_nxtra","h_rt_nxtra",11,-0.5, 10.5); - - h_rt_nalct_per_bx = fs->make("h_rt_nalct_per_bx", "h_rt_nalct_per_bx", 51,-0.5, 50.5); - h_rt_nclct_per_bx = fs->make("h_rt_nclct_per_bx", "h_rt_nclct_per_bx", 51,-0.5, 50.5); - h_rt_nlct_per_bx = fs->make("h_rt_nlct_per_bx", "h_rt_nlct_per_bx", 51,-0.5, 50.5); - - h_rt_alct_bx = fs->make("h_rt_alct_bx","h_rt_alct_bx",13,-6.5, 6.5); - h_rt_clct_bx = fs->make("h_rt_clct_bx","h_rt_clct_bx",13,-6.5, 6.5); - h_rt_lct_bx = fs->make("h_rt_lct_bx","h_rt_lct_bx",13,-6.5, 6.5); - h_rt_mplct_bx = fs->make("h_rt_mplct_bx","h_rt_mplct_bx",13,-6.5, 6.5); - - h_rt_csctype_alct_bx567 = fs->make("h_rt_csctype_alct_bx567", "CSC type vs ALCT rate", 10, 0.5, 10.5); - h_rt_csctype_clct_bx567 = fs->make("h_rt_csctype_clct_bx567", "CSC type vs CLCT rate", 10, 0.5, 10.5); - h_rt_csctype_lct_bx567 = fs->make("h_rt_csctype_lct_bx567", "CSC type vs LCT rate", 10, 0.5, 10.5); - h_rt_csctype_mplct_bx567 = fs->make("h_rt_csctype_mplct_bx567", "CSC type vs MPC LCT rate", 10, 0.5, 10.5); - for (int i=1; i<=CSC_TYPES;i++) { - h_rt_csctype_alct_bx567->GetXaxis()->SetBinLabel(i,mugeo::csc_type_a[i].c_str()); - h_rt_csctype_clct_bx567->GetXaxis()->SetBinLabel(i,mugeo::csc_type_a[i].c_str()); - h_rt_csctype_lct_bx567->GetXaxis()->SetBinLabel(i,mugeo::csc_type_a[i].c_str()); - h_rt_csctype_mplct_bx567->GetXaxis()->SetBinLabel(i,mugeo::csc_type_a[i].c_str()); - } +// h_rt_nalct = fs->make("h_rt_nalct","h_rt_nalct",101,-0.5, 100.5); +// h_rt_nclct = fs->make("h_rt_nclct","h_rt_nclct",101,-0.5, 100.5); +// h_rt_nlct = fs->make("h_rt_nlct","h_rt_nlct",101,-0.5, 100.5); +// h_rt_nmplct = fs->make("h_rt_nmplct","h_rt_nmplct",101,-0.5, 100.5); +// h_rt_ntftrack = fs->make("h_rt_ntftrack","h_rt_ntftrack",31,-0.5, 30.5); +// h_rt_ntfcand = fs->make("h_rt_ntfcand","h_rt_ntfcand",31,-0.5, 30.5); +// h_rt_ntfcand_pt10 = fs->make("h_rt_ntfcand_pt10","h_rt_ntfcand_pt10",31,-0.5, 30.5); +// h_rt_ngmt_csc = fs->make("h_rt_ngmt_csc","h_rt_ngmt_csc",11,-0.5, 10.5); +// h_rt_ngmt_csc_pt10 = fs->make("h_rt_ngmt_csc_pt10","h_rt_ngmt_csc_pt10",11,-0.5, 10.5); +// h_rt_ngmt_csc_per_bx = fs->make("h_rt_ngmt_csc_per_bx","h_rt_ngmt_csc_per_bx",11,-0.5, 10.5); +// h_rt_ngmt_rpcf = fs->make("h_rt_ngmt_rpcf","h_rt_ngmt_rpcf",11,-0.5, 10.5); +// h_rt_ngmt_rpcf_pt10 = fs->make("h_rt_ngmt_rpcf_pt10","h_rt_ngmt_rpcf_pt10",11,-0.5, 10.5); +// h_rt_ngmt_rpcf_per_bx = fs->make("h_rt_ngmt_rpcf_per_bx","h_rt_ngmt_rpcf_per_bx",11,-0.5, 10.5); +// h_rt_ngmt_rpcb = fs->make("h_rt_ngmt_rpcb","h_rt_ngmt_rpcb",11,-0.5, 10.5); +// h_rt_ngmt_rpcb_pt10 = fs->make("h_rt_ngmt_rpcb_pt10","h_rt_ngmt_rpcb_pt10",11,-0.5, 10.5); +// h_rt_ngmt_rpcb_per_bx = fs->make("h_rt_ngmt_rpcb_per_bx","h_rt_ngmt_rpcb_per_bx",11,-0.5, 10.5); +// h_rt_ngmt_dt = fs->make("h_rt_ngmt_dt","h_rt_ngmt_dt",11,-0.5, 10.5); +// h_rt_ngmt_dt_pt10 = fs->make("h_rt_ngmt_dt_pt10","h_rt_ngmt_dt_pt10",11,-0.5, 10.5); +// h_rt_ngmt_dt_per_bx = fs->make("h_rt_ngmt_dt_per_bx","h_rt_ngmt_dt_per_bx",11,-0.5, 10.5); +// h_rt_ngmt = fs->make("h_rt_ngmt","h_rt_ngmt",11,-0.5, 10.5); +// h_rt_nxtra = fs->make("h_rt_nxtra","h_rt_nxtra",11,-0.5, 10.5); + +// h_rt_nalct_per_bx = fs->make("h_rt_nalct_per_bx", "h_rt_nalct_per_bx", 51,-0.5, 50.5); +// h_rt_nclct_per_bx = fs->make("h_rt_nclct_per_bx", "h_rt_nclct_per_bx", 51,-0.5, 50.5); +// h_rt_nlct_per_bx = fs->make("h_rt_nlct_per_bx", "h_rt_nlct_per_bx", 51,-0.5, 50.5); + +// h_rt_alct_bx = fs->make("h_rt_alct_bx","h_rt_alct_bx",13,-6.5, 6.5); +// h_rt_clct_bx = fs->make("h_rt_clct_bx","h_rt_clct_bx",13,-6.5, 6.5); +// h_rt_lct_bx = fs->make("h_rt_lct_bx","h_rt_lct_bx",13,-6.5, 6.5); +// h_rt_mplct_bx = fs->make("h_rt_mplct_bx","h_rt_mplct_bx",13,-6.5, 6.5); + +// h_rt_csctype_alct_bx567 = fs->make("h_rt_csctype_alct_bx567", "CSC type vs ALCT rate", 10, 0.5, 10.5); +// h_rt_csctype_clct_bx567 = fs->make("h_rt_csctype_clct_bx567", "CSC type vs CLCT rate", 10, 0.5, 10.5); +// h_rt_csctype_lct_bx567 = fs->make("h_rt_csctype_lct_bx567", "CSC type vs LCT rate", 10, 0.5, 10.5); +// h_rt_csctype_mplct_bx567 = fs->make("h_rt_csctype_mplct_bx567", "CSC type vs MPC LCT rate", 10, 0.5, 10.5); +// for (int i=1; i<=CSC_TYPES;i++) { +// h_rt_csctype_alct_bx567->GetXaxis()->SetBinLabel(i,mugeo::csc_type_a[i].c_str()); +// h_rt_csctype_clct_bx567->GetXaxis()->SetBinLabel(i,mugeo::csc_type_a[i].c_str()); +// h_rt_csctype_lct_bx567->GetXaxis()->SetBinLabel(i,mugeo::csc_type_a[i].c_str()); +// h_rt_csctype_mplct_bx567->GetXaxis()->SetBinLabel(i,mugeo::csc_type_a[i].c_str()); +// } - h_rt_lct_qu_vs_bx = fs->make("h_rt_lct_qu_vs_bx","h_rt_lct_qu_vs_bx",20,0., 20.,13,-6.5, 6.5); - h_rt_mplct_qu_vs_bx = fs->make("h_rt_mplct_qu_vs_bx","h_rt_mplct_qu_vs_bx",20,0., 20.,13,-6.5, 6.5); - - h_rt_nalct_vs_bx = fs->make("h_rt_nalct_vs_bx","h_rt_nalct_vs_bx",20,0., 20.,16,-.5, 15.5); - h_rt_nclct_vs_bx = fs->make("h_rt_nclct_vs_bx","h_rt_nclct_vs_bx",20,0., 20.,16,-.5, 15.5); - h_rt_nlct_vs_bx = fs->make("h_rt_nlct_vs_bx","h_rt_nlct_vs_bx",20,0., 20.,16,-.5, 15.5); - h_rt_nmplct_vs_bx = fs->make("h_rt_nmplct_vs_bx","h_rt_nmplct_vs_bx",20,0., 20.,16,-.5, 15.5); - - h_rt_lct_qu = fs->make("h_rt_lct_qu","h_rt_lct_qu",20,0., 20.); - h_rt_mplct_qu = fs->make("h_rt_mplct_qu","h_rt_mplct_qu",20,0., 20.); - - h_rt_qu_vs_bxclct__lct = fs->make("h_rt_qu_vs_bxclct__lct","h_rt_qu_vs_bxclct__lct",17,-0.5, 16.5, 15,-7.5, 7.5); - - h_rt_tftrack_pt = fs->make("h_rt_tftrack_pt","h_rt_tftrack_pt",600, 0.,150.); - h_rt_tfcand_pt = fs->make("h_rt_tfcand_pt","h_rt_tfcand_pt",600, 0.,150.); - - - h_rt_gmt_csc_pt = fs->make("h_rt_gmt_csc_pt","h_rt_gmt_csc_pt",600, 0.,150.); - h_rt_gmt_csc_pt_2st = fs->make("h_rt_gmt_csc_pt_2st","h_rt_gmt_csc_pt_2st",600, 0.,150.); - h_rt_gmt_csc_pt_3st = fs->make("h_rt_gmt_csc_pt_3st","h_rt_gmt_csc_pt_3st",600, 0.,150.); - h_rt_gmt_csc_pt_2q = fs->make("h_rt_gmt_csc_pt_2q","h_rt_gmt_csc_pt_2q",600, 0.,150.); - h_rt_gmt_csc_pt_3q = fs->make("h_rt_gmt_csc_pt_3q","h_rt_gmt_csc_pt_3q",600, 0.,150.); - h_rt_gmt_csc_ptmax_2s = fs->make("h_rt_gmt_csc_ptmax_2s","h_rt_gmt_csc_ptmax_2s",600, 0.,150.); - h_rt_gmt_csc_ptmax_2s_1b = fs->make("h_rt_gmt_csc_ptmax_2s_1b","h_rt_gmt_csc_ptmax_2s_1b",600, 0.,150.); - h_rt_gmt_csc_ptmax_2s_no1a = fs->make("h_rt_gmt_csc_ptmax_2s_no1a","h_rt_gmt_csc_ptmax_2s_no1a",600, 0.,150.); - h_rt_gmt_csc_ptmax_3s = fs->make("h_rt_gmt_csc_ptmax_3s","h_rt_gmt_csc_ptmax_3s",600, 0.,150.); - h_rt_gmt_csc_ptmax_3s_1b = fs->make("h_rt_gmt_csc_ptmax_3s_1b","h_rt_gmt_csc_ptmax_3s_1b",600, 0.,150.); - h_rt_gmt_csc_ptmax_3s_no1a = fs->make("h_rt_gmt_csc_ptmax_3s_no1a","h_rt_gmt_csc_ptmax_3s_no1a",600, 0.,150.); - h_rt_gmt_csc_ptmax_3s_2s1b = fs->make("h_rt_gmt_csc_ptmax_3s_2s1b","h_rt_gmt_csc_ptmax_3s_2s1b",600, 0.,150.); - h_rt_gmt_csc_ptmax_3s_2s1b_1b = fs->make("h_rt_gmt_csc_ptmax_3s_2s1b_1b","h_rt_gmt_csc_ptmax_3s_2s1b_1b",600, 0.,150.); - h_rt_gmt_csc_ptmax_3s_2s123_1b = fs->make("h_rt_gmt_csc_ptmax_3s_2s123_1b","h_rt_gmt_csc_ptmax_3s_2s123_1b",600, 0.,150.); - h_rt_gmt_csc_ptmax_3s_2s13_1b = fs->make("h_rt_gmt_csc_ptmax_3s_2s13_1b","h_rt_gmt_csc_ptmax_3s_2s13_1b",600, 0.,150.); - h_rt_gmt_csc_ptmax_3s_2s1b_no1a = fs->make("h_rt_gmt_csc_ptmax_3s_2s1b_no1a","h_rt_gmt_csc_ptmax_3s_2s1b_no1a",600, 0.,150.); - h_rt_gmt_csc_ptmax_3s_2s123_no1a = fs->make("h_rt_gmt_csc_ptmax_3s_2s123_no1a","h_rt_gmt_csc_ptmax_3s_2s123_no1a",600, 0.,150.); - h_rt_gmt_csc_ptmax_3s_2s13_no1a = fs->make("h_rt_gmt_csc_ptmax_3s_2s13_no1a","h_rt_gmt_csc_ptmax_3s_2s13_no1a",600, 0.,150.); - h_rt_gmt_csc_ptmax_3s_3s1b = fs->make("h_rt_gmt_csc_ptmax_3s_3s1b","h_rt_gmt_csc_ptmax_3s_3s1b",600, 0.,150.); - h_rt_gmt_csc_ptmax_3s_3s1b_1b = fs->make("h_rt_gmt_csc_ptmax_3s_3s1b_1b","h_rt_gmt_csc_ptmax_3s_3s1b_1b",600, 0.,150.); - h_rt_gmt_csc_ptmax_3s_3s1b_no1a = fs->make("h_rt_gmt_csc_ptmax_3s_3s1b_no1a","h_rt_gmt_csc_ptmax_3s_3s1b_no1a",600, 0.,150.); - h_rt_gmt_csc_ptmax_2q = fs->make("h_rt_gmt_csc_ptmax_2q","h_rt_gmt_csc_ptmax_2q",600, 0.,150.); - h_rt_gmt_csc_ptmax_3q = fs->make("h_rt_gmt_csc_ptmax_3q","h_rt_gmt_csc_ptmax_3q",600, 0.,150.); - h_rt_gmt_csc_pt_2s42 = fs->make("h_rt_gmt_csc_pt_2s42","h_rt_gmt_csc_pt_2s42",600, 0.,150.); - h_rt_gmt_csc_pt_3s42 = fs->make("h_rt_gmt_csc_pt_3s42","h_rt_gmt_csc_pt_3s42",600, 0.,150.); - h_rt_gmt_csc_ptmax_2s42 = fs->make("h_rt_gmt_csc_ptmax_2s42","h_rt_gmt_csc_ptmax_2s42",600, 0.,150.); - h_rt_gmt_csc_ptmax_3s42 = fs->make("h_rt_gmt_csc_ptmax_3s42","h_rt_gmt_csc_ptmax_3s42",600, 0.,150.); - h_rt_gmt_csc_pt_2q42 = fs->make("h_rt_gmt_csc_pt_2q42","h_rt_gmt_csc_pt_2q42",600, 0.,150.); - h_rt_gmt_csc_pt_3q42 = fs->make("h_rt_gmt_csc_pt_3q42","h_rt_gmt_csc_pt_3q42",600, 0.,150.); - h_rt_gmt_csc_ptmax_2q42 = fs->make("h_rt_gmt_csc_ptmax_2q42","h_rt_gmt_csc_ptmax_2q42",600, 0.,150.); - h_rt_gmt_csc_ptmax_3q42 = fs->make("h_rt_gmt_csc_ptmax_3q42","h_rt_gmt_csc_ptmax_3q42",600, 0.,150.); - h_rt_gmt_csc_pt_2s42r = fs->make("h_rt_gmt_csc_pt_2s42r","h_rt_gmt_csc_pt_2s42r",600, 0.,150.); - h_rt_gmt_csc_pt_3s42r = fs->make("h_rt_gmt_csc_pt_3s42r","h_rt_gmt_csc_pt_3s42r",600, 0.,150.); - h_rt_gmt_csc_ptmax_2s42r = fs->make("h_rt_gmt_csc_ptmax_2s42r","h_rt_gmt_csc_ptmax_2s42r",600, 0.,150.); - h_rt_gmt_csc_ptmax_3s42r = fs->make("h_rt_gmt_csc_ptmax_3s42r","h_rt_gmt_csc_ptmax_3s42r",600, 0.,150.); - h_rt_gmt_csc_pt_2q42r = fs->make("h_rt_gmt_csc_pt_2q42r","h_rt_gmt_csc_pt_2q42r",600, 0.,150.); - h_rt_gmt_csc_pt_3q42r = fs->make("h_rt_gmt_csc_pt_3q42r","h_rt_gmt_csc_pt_3q42r",600, 0.,150.); - h_rt_gmt_csc_ptmax_2q42r = fs->make("h_rt_gmt_csc_ptmax_2q42r","h_rt_gmt_csc_ptmax_2q42r",600, 0.,150.); - h_rt_gmt_csc_ptmax_3q42r = fs->make("h_rt_gmt_csc_ptmax_3q42r","h_rt_gmt_csc_ptmax_3q42r",600, 0.,150.); +// h_rt_lct_qu_vs_bx = fs->make("h_rt_lct_qu_vs_bx","h_rt_lct_qu_vs_bx",20,0., 20.,13,-6.5, 6.5); +// h_rt_mplct_qu_vs_bx = fs->make("h_rt_mplct_qu_vs_bx","h_rt_mplct_qu_vs_bx",20,0., 20.,13,-6.5, 6.5); + +// h_rt_nalct_vs_bx = fs->make("h_rt_nalct_vs_bx","h_rt_nalct_vs_bx",20,0., 20.,16,-.5, 15.5); +// h_rt_nclct_vs_bx = fs->make("h_rt_nclct_vs_bx","h_rt_nclct_vs_bx",20,0., 20.,16,-.5, 15.5); +// h_rt_nlct_vs_bx = fs->make("h_rt_nlct_vs_bx","h_rt_nlct_vs_bx",20,0., 20.,16,-.5, 15.5); +// h_rt_nmplct_vs_bx = fs->make("h_rt_nmplct_vs_bx","h_rt_nmplct_vs_bx",20,0., 20.,16,-.5, 15.5); + +// h_rt_lct_qu = fs->make("h_rt_lct_qu","h_rt_lct_qu",20,0., 20.); +// h_rt_mplct_qu = fs->make("h_rt_mplct_qu","h_rt_mplct_qu",20,0., 20.); + +// h_rt_qu_vs_bxclct__lct = fs->make("h_rt_qu_vs_bxclct__lct","h_rt_qu_vs_bxclct__lct",17,-0.5, 16.5, 15,-7.5, 7.5); + +// h_rt_tftrack_pt = fs->make("h_rt_tftrack_pt","h_rt_tftrack_pt",600, 0.,150.); +// h_rt_tfcand_pt = fs->make("h_rt_tfcand_pt","h_rt_tfcand_pt",600, 0.,150.); + + +// h_rt_gmt_csc_pt = fs->make("h_rt_gmt_csc_pt","h_rt_gmt_csc_pt",600, 0.,150.); +// h_rt_gmt_csc_pt_2st = fs->make("h_rt_gmt_csc_pt_2st","h_rt_gmt_csc_pt_2st",600, 0.,150.); +// h_rt_gmt_csc_pt_3st = fs->make("h_rt_gmt_csc_pt_3st","h_rt_gmt_csc_pt_3st",600, 0.,150.); +// h_rt_gmt_csc_pt_2q = fs->make("h_rt_gmt_csc_pt_2q","h_rt_gmt_csc_pt_2q",600, 0.,150.); +// h_rt_gmt_csc_pt_3q = fs->make("h_rt_gmt_csc_pt_3q","h_rt_gmt_csc_pt_3q",600, 0.,150.); +// h_rt_gmt_csc_ptmax_2s = fs->make("h_rt_gmt_csc_ptmax_2s","h_rt_gmt_csc_ptmax_2s",600, 0.,150.); +// h_rt_gmt_csc_ptmax_2s_1b = fs->make("h_rt_gmt_csc_ptmax_2s_1b","h_rt_gmt_csc_ptmax_2s_1b",600, 0.,150.); +// h_rt_gmt_csc_ptmax_2s_no1a = fs->make("h_rt_gmt_csc_ptmax_2s_no1a","h_rt_gmt_csc_ptmax_2s_no1a",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3s = fs->make("h_rt_gmt_csc_ptmax_3s","h_rt_gmt_csc_ptmax_3s",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3s_1b = fs->make("h_rt_gmt_csc_ptmax_3s_1b","h_rt_gmt_csc_ptmax_3s_1b",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3s_no1a = fs->make("h_rt_gmt_csc_ptmax_3s_no1a","h_rt_gmt_csc_ptmax_3s_no1a",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3s_2s1b = fs->make("h_rt_gmt_csc_ptmax_3s_2s1b","h_rt_gmt_csc_ptmax_3s_2s1b",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3s_2s1b_1b = fs->make("h_rt_gmt_csc_ptmax_3s_2s1b_1b","h_rt_gmt_csc_ptmax_3s_2s1b_1b",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3s_2s123_1b = fs->make("h_rt_gmt_csc_ptmax_3s_2s123_1b","h_rt_gmt_csc_ptmax_3s_2s123_1b",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3s_2s13_1b = fs->make("h_rt_gmt_csc_ptmax_3s_2s13_1b","h_rt_gmt_csc_ptmax_3s_2s13_1b",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3s_2s1b_no1a = fs->make("h_rt_gmt_csc_ptmax_3s_2s1b_no1a","h_rt_gmt_csc_ptmax_3s_2s1b_no1a",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3s_2s123_no1a = fs->make("h_rt_gmt_csc_ptmax_3s_2s123_no1a","h_rt_gmt_csc_ptmax_3s_2s123_no1a",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3s_2s13_no1a = fs->make("h_rt_gmt_csc_ptmax_3s_2s13_no1a","h_rt_gmt_csc_ptmax_3s_2s13_no1a",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3s_3s1b = fs->make("h_rt_gmt_csc_ptmax_3s_3s1b","h_rt_gmt_csc_ptmax_3s_3s1b",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3s_3s1b_1b = fs->make("h_rt_gmt_csc_ptmax_3s_3s1b_1b","h_rt_gmt_csc_ptmax_3s_3s1b_1b",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3s_3s1b_no1a = fs->make("h_rt_gmt_csc_ptmax_3s_3s1b_no1a","h_rt_gmt_csc_ptmax_3s_3s1b_no1a",600, 0.,150.); +// h_rt_gmt_csc_ptmax_2q = fs->make("h_rt_gmt_csc_ptmax_2q","h_rt_gmt_csc_ptmax_2q",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3q = fs->make("h_rt_gmt_csc_ptmax_3q","h_rt_gmt_csc_ptmax_3q",600, 0.,150.); +// h_rt_gmt_csc_pt_2s42 = fs->make("h_rt_gmt_csc_pt_2s42","h_rt_gmt_csc_pt_2s42",600, 0.,150.); +// h_rt_gmt_csc_pt_3s42 = fs->make("h_rt_gmt_csc_pt_3s42","h_rt_gmt_csc_pt_3s42",600, 0.,150.); +// h_rt_gmt_csc_ptmax_2s42 = fs->make("h_rt_gmt_csc_ptmax_2s42","h_rt_gmt_csc_ptmax_2s42",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3s42 = fs->make("h_rt_gmt_csc_ptmax_3s42","h_rt_gmt_csc_ptmax_3s42",600, 0.,150.); +// h_rt_gmt_csc_pt_2q42 = fs->make("h_rt_gmt_csc_pt_2q42","h_rt_gmt_csc_pt_2q42",600, 0.,150.); +// h_rt_gmt_csc_pt_3q42 = fs->make("h_rt_gmt_csc_pt_3q42","h_rt_gmt_csc_pt_3q42",600, 0.,150.); +// h_rt_gmt_csc_ptmax_2q42 = fs->make("h_rt_gmt_csc_ptmax_2q42","h_rt_gmt_csc_ptmax_2q42",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3q42 = fs->make("h_rt_gmt_csc_ptmax_3q42","h_rt_gmt_csc_ptmax_3q42",600, 0.,150.); +// h_rt_gmt_csc_pt_2s42r = fs->make("h_rt_gmt_csc_pt_2s42r","h_rt_gmt_csc_pt_2s42r",600, 0.,150.); +// h_rt_gmt_csc_pt_3s42r = fs->make("h_rt_gmt_csc_pt_3s42r","h_rt_gmt_csc_pt_3s42r",600, 0.,150.); +// h_rt_gmt_csc_ptmax_2s42r = fs->make("h_rt_gmt_csc_ptmax_2s42r","h_rt_gmt_csc_ptmax_2s42r",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3s42r = fs->make("h_rt_gmt_csc_ptmax_3s42r","h_rt_gmt_csc_ptmax_3s42r",600, 0.,150.); +// h_rt_gmt_csc_pt_2q42r = fs->make("h_rt_gmt_csc_pt_2q42r","h_rt_gmt_csc_pt_2q42r",600, 0.,150.); +// h_rt_gmt_csc_pt_3q42r = fs->make("h_rt_gmt_csc_pt_3q42r","h_rt_gmt_csc_pt_3q42r",600, 0.,150.); +// h_rt_gmt_csc_ptmax_2q42r = fs->make("h_rt_gmt_csc_ptmax_2q42r","h_rt_gmt_csc_ptmax_2q42r",600, 0.,150.); +// h_rt_gmt_csc_ptmax_3q42r = fs->make("h_rt_gmt_csc_ptmax_3q42r","h_rt_gmt_csc_ptmax_3q42r",600, 0.,150.); - h_rt_gmt_rpcf_pt = fs->make("h_rt_gmt_rpcf_pt","h_rt_gmt_rpcf_pt",600, 0.,150.); - h_rt_gmt_rpcf_pt_42 = fs->make("h_rt_gmt_rpcf_pt_42","h_rt_gmt_rpcf_pt_42",600, 0.,150.); - h_rt_gmt_rpcf_ptmax = fs->make("h_rt_gmt_rpcf_ptmax","h_rt_gmt_rpcf_ptmax",600, 0.,150.); - h_rt_gmt_rpcf_ptmax_42 = fs->make("h_rt_gmt_rpcf_ptmax_42","h_rt_gmt_rpcf_ptmax_42",600, 0.,150.); - - h_rt_gmt_rpcb_pt = fs->make("h_rt_gmt_rpcb_pt","h_rt_gmt_rpcb_pt",600, 0.,150.); - h_rt_gmt_rpcb_ptmax = fs->make("h_rt_gmt_rpcb_ptmax","h_rt_gmt_rpcb_ptmax",600, 0.,150.); - - h_rt_gmt_dt_pt = fs->make("h_rt_gmt_dt_pt","h_rt_gmt_dt_pt",600, 0.,150.); - h_rt_gmt_dt_ptmax = fs->make("h_rt_gmt_dt_ptmax","h_rt_gmt_dt_ptmax",600, 0.,150.); - - h_rt_gmt_pt = fs->make("h_rt_gmt_pt","h_rt_gmt_pt",600, 0.,150.); - h_rt_gmt_pt_2st = fs->make("h_rt_gmt_pt_2st","h_rt_gmt_pt_2st",600, 0.,150.); - h_rt_gmt_pt_3st = fs->make("h_rt_gmt_pt_3st","h_rt_gmt_pt_3st",600, 0.,150.); - h_rt_gmt_pt_2q = fs->make("h_rt_gmt_pt_2q","h_rt_gmt_pt_2q",600, 0.,150.); - h_rt_gmt_pt_3q = fs->make("h_rt_gmt_pt_3q","h_rt_gmt_pt_3q",600, 0.,150.); - h_rt_gmt_ptmax = fs->make("h_rt_gmt_ptmax","h_rt_gmt_ptmax",600, 0.,150.); - h_rt_gmt_ptmax_sing = fs->make("h_rt_gmt_ptmax_sing","h_rt_gmt_ptmax_sing",600, 0.,150.); - h_rt_gmt_ptmax_sing_3s = fs->make("h_rt_gmt_ptmax_sing_3s","h_rt_gmt_ptmax_sing_3s",600, 0.,150.); - h_rt_gmt_ptmax_sing_csc = fs->make("h_rt_gmt_ptmax_sing_csc","h_rt_gmt_ptmax_sing_csc",600, 0.,150.); - h_rt_gmt_ptmax_sing_1b = fs->make("h_rt_gmt_ptmax_sing_1b","h_rt_gmt_ptmax_sing_no1a",600, 0.,150.); - h_rt_gmt_ptmax_sing_no1a = fs->make("h_rt_gmt_ptmax_sing_no1a","h_rt_gmt_ptmax_sing_no1a",600, 0.,150.); - h_rt_gmt_ptmax_sing6 = fs->make("h_rt_gmt_ptmax_sing6","h_rt_gmt_ptmax_sing6",600, 0.,150.); - h_rt_gmt_ptmax_sing6_3s = fs->make("h_rt_gmt_ptmax_sing6_3s","h_rt_gmt_ptmax_sing6_3s",600, 0.,150.); - h_rt_gmt_ptmax_sing6_csc = fs->make("h_rt_gmt_ptmax_sing6_csc","h_rt_gmt_ptmax_sing6_csc",600, 0.,150.); - h_rt_gmt_ptmax_sing6_1b = fs->make("h_rt_gmt_ptmax_sing6_1b","h_rt_gmt_ptmax_sing6_1b",600, 0.,150.); - h_rt_gmt_ptmax_sing6_no1a = fs->make("h_rt_gmt_ptmax_sing6_no1a","h_rt_gmt_ptmax_sing6_no1a",600, 0.,150.); - h_rt_gmt_ptmax_sing6_3s1b_no1a = fs->make("h_rt_gmt_ptmax_sing6_3s1b_no1a","h_rt_gmt_ptmax_sing6_3s1b_no1a",600, 0.,150.); - h_rt_gmt_ptmax_dbl = fs->make("h_rt_gmt_ptmax_dbl","h_rt_gmt_ptmax_dbl",600, 0.,150.); - h_rt_gmt_pt_2s42 = fs->make("h_rt_gmt_pt_2s42","h_rt_gmt_pt_2s42",600, 0.,150.); - h_rt_gmt_pt_3s42 = fs->make("h_rt_gmt_pt_3s42","h_rt_gmt_pt_3s42",600, 0.,150.); - h_rt_gmt_ptmax_2s42 = fs->make("h_rt_gmt_ptmax_2s42","h_rt_gmt_ptmax_2s42",600, 0.,150.); - h_rt_gmt_ptmax_3s42 = fs->make("h_rt_gmt_ptmax_3s42","h_rt_gmt_ptmax_3s42",600, 0.,150.); - h_rt_gmt_ptmax_2s42_sing = fs->make("h_rt_gmt_ptmax_2s42_sing","h_rt_gmt_ptmax_2s42_sing",600, 0.,150.); - h_rt_gmt_ptmax_3s42_sing = fs->make("h_rt_gmt_ptmax_3s42_sing","h_rt_gmt_ptmax_3s42_sing",600, 0.,150.); - h_rt_gmt_pt_2q42 = fs->make("h_rt_gmt_pt_2q42","h_rt_gmt_pt_2q42",600, 0.,150.); - h_rt_gmt_pt_3q42 = fs->make("h_rt_gmt_pt_3q42","h_rt_gmt_pt_3q42",600, 0.,150.); - h_rt_gmt_ptmax_2q42 = fs->make("h_rt_gmt_ptmax_2q42","h_rt_gmt_ptmax_2q42",600, 0.,150.); - h_rt_gmt_ptmax_3q42 = fs->make("h_rt_gmt_ptmax_3q42","h_rt_gmt_ptmax_3q42",600, 0.,150.); - h_rt_gmt_ptmax_2q42_sing = fs->make("h_rt_gmt_ptmax_2q42_sing","h_rt_gmt_ptmax_2q42_sing",600, 0.,150.); - h_rt_gmt_ptmax_3q42_sing = fs->make("h_rt_gmt_ptmax_3q42_sing","h_rt_gmt_ptmax_3q42_sing",600, 0.,150.); - h_rt_gmt_pt_2s42r = fs->make("h_rt_gmt_pt_2s42r","h_rt_gmt_pt_2s42r",600, 0.,150.); - h_rt_gmt_pt_3s42r = fs->make("h_rt_gmt_pt_3s42r","h_rt_gmt_pt_3s42r",600, 0.,150.); - h_rt_gmt_ptmax_2s42r = fs->make("h_rt_gmt_ptmax_2s42r","h_rt_gmt_ptmax_2s42r",600, 0.,150.); - h_rt_gmt_ptmax_3s42r = fs->make("h_rt_gmt_ptmax_3s42r","h_rt_gmt_ptmax_3s42r",600, 0.,150.); - h_rt_gmt_ptmax_2s42r_sing = fs->make("h_rt_gmt_ptmax_2s42r_sing","h_rt_gmt_ptmax_2s42r_sing",600, 0.,150.); - h_rt_gmt_ptmax_3s42r_sing = fs->make("h_rt_gmt_ptmax_3s42r_sing","h_rt_gmt_ptmax_3s42r_sing",600, 0.,150.); - h_rt_gmt_pt_2q42r = fs->make("h_rt_gmt_pt_2q42r","h_rt_gmt_pt_2q42r",600, 0.,150.); - h_rt_gmt_pt_3q42r = fs->make("h_rt_gmt_pt_3q42r","h_rt_gmt_pt_3q42r",600, 0.,150.); - h_rt_gmt_ptmax_2q42r = fs->make("h_rt_gmt_ptmax_2q42r","h_rt_gmt_ptmax_2q42r",600, 0.,150.); - h_rt_gmt_ptmax_3q42r = fs->make("h_rt_gmt_ptmax_3q42r","h_rt_gmt_ptmax_3q42r",600, 0.,150.); - h_rt_gmt_ptmax_2q42r_sing = fs->make("h_rt_gmt_ptmax_2q42r_sing","h_rt_gmt_ptmax_2q42r_sing",600, 0.,150.); - h_rt_gmt_ptmax_3q42r_sing = fs->make("h_rt_gmt_ptmax_3q42r_sing","h_rt_gmt_ptmax_3q42r_sing",600, 0.,150.); - - - h_rt_gmt_csc_eta = fs->make("h_rt_gmt_csc_eta","h_rt_gmt_csc_eta",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax10_eta_2s = fs->make("h_rt_gmt_csc_ptmax10_eta_2s","h_rt_gmt_csc_ptmax10_eta_2s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax10_eta_2s_2s1b = fs->make("h_rt_gmt_csc_ptmax10_eta_2s_2s1b","h_rt_gmt_csc_ptmax10_eta_2s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax10_eta_3s = fs->make("h_rt_gmt_csc_ptmax10_eta_3s","h_rt_gmt_csc_ptmax10_eta_3s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax10_eta_3s_1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_1b","h_rt_gmt_csc_ptmax10_eta_3s_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax10_eta_3s_no1a = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_no1a","h_rt_gmt_csc_ptmax10_eta_3s_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax10_eta_3s_2s1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s1b","h_rt_gmt_csc_ptmax10_eta_3s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax10_eta_3s_2s1b_1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s1b_1b","h_rt_gmt_csc_ptmax10_eta_3s_2s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax10_eta_3s_2s123_1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s123_1b","h_rt_gmt_csc_ptmax10_eta_3s_2s123_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax10_eta_3s_2s13_1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s13_1b","h_rt_gmt_csc_ptmax10_eta_3s_2s13_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax10_eta_3s_2s1b_no1a = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s1b_no1a","h_rt_gmt_csc_ptmax10_eta_3s_2s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax10_eta_3s_2s123_no1a = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s123_no1a","h_rt_gmt_csc_ptmax10_eta_3s_2s123_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax10_eta_3s_2s13_no1a = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s13_no1a","h_rt_gmt_csc_ptmax10_eta_3s_2s13_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax10_eta_3s_3s1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_3s1b","h_rt_gmt_csc_ptmax10_eta_3s_3s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax10_eta_3s_3s1b_1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_3s1b_1b","h_rt_gmt_csc_ptmax10_eta_3s_3s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax10_eta_3s_3s1b_no1a = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_3s1b_no1a","h_rt_gmt_csc_ptmax10_eta_3s_3s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax10_eta_2q = fs->make("h_rt_gmt_csc_ptmax10_eta_2q","h_rt_gmt_csc_ptmax10_eta_2q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax10_eta_3q = fs->make("h_rt_gmt_csc_ptmax10_eta_3q","h_rt_gmt_csc_ptmax10_eta_3q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - - h_rt_gmt_csc_ptmax20_eta_2s = fs->make("h_rt_gmt_csc_ptmax20_eta_2s","h_rt_gmt_csc_ptmax20_eta_2s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax20_eta_2s_2s1b = fs->make("h_rt_gmt_csc_ptmax20_eta_2s_2s1b","h_rt_gmt_csc_ptmax20_eta_2s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax20_eta_3s = fs->make("h_rt_gmt_csc_ptmax20_eta_3s","h_rt_gmt_csc_ptmax20_eta_3s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - - h_rt_gmt_csc_ptmax20_eta_3s_1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_1b","h_rt_gmt_csc_ptmax20_eta_3s_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax20_eta_3s_1ab = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_1ab","h_rt_gmt_csc_ptmax20_eta_3s_1ab",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - - h_rt_gmt_csc_ptmax20_eta_3s_no1a = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_no1a","h_rt_gmt_csc_ptmax20_eta_3s_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax20_eta_3s_2s1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s1b","h_rt_gmt_csc_ptmax20_eta_3s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax20_eta_3s_2s1b_1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s1b_1b","h_rt_gmt_csc_ptmax20_eta_3s_2s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax20_eta_3s_2s123_1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s123_1b","h_rt_gmt_csc_ptmax20_eta_3s_2s123_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax20_eta_3s_2s13_1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s13_1b","h_rt_gmt_csc_ptmax20_eta_3s_2s13_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax20_eta_3s_2s1b_no1a = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s1b_no1a","h_rt_gmt_csc_ptmax20_eta_3s_2s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax20_eta_3s_2s123_no1a = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s123_no1a","h_rt_gmt_csc_ptmax20_eta_3s_2s123_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax20_eta_3s_2s13_no1a = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s13_no1a","h_rt_gmt_csc_ptmax20_eta_3s_2s13_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - - h_rt_gmt_csc_ptmax20_eta_3s_3s1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_3s1b","h_rt_gmt_csc_ptmax20_eta_3s_3s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax20_eta_3s_3s1ab = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_3s1ab","h_rt_gmt_csc_ptmax20_eta_3s_3s1ab",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - - h_rt_gmt_csc_ptmax20_eta_3s_3s1b_1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_3s1b_1b","h_rt_gmt_csc_ptmax20_eta_3s_3s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax20_eta_3s_3s1b_no1a = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_3s1b_no1a","h_rt_gmt_csc_ptmax20_eta_3s_3s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax20_eta_2q = fs->make("h_rt_gmt_csc_ptmax20_eta_2q","h_rt_gmt_csc_ptmax20_eta_2q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax20_eta_3q = fs->make("h_rt_gmt_csc_ptmax20_eta_3q","h_rt_gmt_csc_ptmax20_eta_3q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - - h_rt_gmt_csc_ptmax30_eta_2s = fs->make("h_rt_gmt_csc_ptmax30_eta_2s","h_rt_gmt_csc_ptmax30_eta_2s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax30_eta_2s_2s1b = fs->make("h_rt_gmt_csc_ptmax30_eta_2s_2s1b","h_rt_gmt_csc_ptmax30_eta_2s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax30_eta_3s = fs->make("h_rt_gmt_csc_ptmax30_eta_3s","h_rt_gmt_csc_ptmax30_eta_3s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - - h_rt_gmt_csc_ptmax30_eta_3s_1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_1b","h_rt_gmt_csc_ptmax30_eta_3s_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax30_eta_3s_1ab = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_1ab","h_rt_gmt_csc_ptmax30_eta_3s_1ab",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - - h_rt_gmt_csc_ptmax30_eta_3s_no1a = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_no1a","h_rt_gmt_csc_ptmax30_eta_3s_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax30_eta_3s_2s1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s1b","h_rt_gmt_csc_ptmax30_eta_3s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax30_eta_3s_2s1b_1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s1b_1b","h_rt_gmt_csc_ptmax30_eta_3s_2s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax30_eta_3s_2s123_1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s123_1b","h_rt_gmt_csc_ptmax30_eta_3s_2s123_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax30_eta_3s_2s13_1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s13_1b","h_rt_gmt_csc_ptmax30_eta_3s_2s13_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax30_eta_3s_2s1b_no1a = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s1b_no1a","h_rt_gmt_csc_ptmax30_eta_3s_2s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax30_eta_3s_2s123_no1a = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s123_no1a","h_rt_gmt_csc_ptmax30_eta_3s_2s123_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax30_eta_3s_2s13_no1a = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s13_no1a","h_rt_gmt_csc_ptmax30_eta_3s_2s13_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - - h_rt_gmt_csc_ptmax30_eta_3s_3s1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_3s1b","h_rt_gmt_csc_ptmax30_eta_3s_3s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax30_eta_3s_3s1ab = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_3s1ab","h_rt_gmt_csc_ptmax30_eta_3s_3s1ab",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - - - h_rt_gmt_csc_ptmax30_eta_3s_3s1b_1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_3s1b_1b","h_rt_gmt_csc_ptmax30_eta_3s_3s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax30_eta_3s_3s1b_no1a = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_3s1b_no1a","h_rt_gmt_csc_ptmax30_eta_3s_3s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax30_eta_2q = fs->make("h_rt_gmt_csc_ptmax30_eta_2q","h_rt_gmt_csc_ptmax30_eta_2q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - h_rt_gmt_csc_ptmax30_eta_3q = fs->make("h_rt_gmt_csc_ptmax30_eta_3q","h_rt_gmt_csc_ptmax30_eta_3q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); - - h_rt_gmt_rpcf_eta = fs->make("h_rt_gmt_rpcf_eta","h_rt_gmt_rpcf_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); - h_rt_gmt_rpcf_ptmax10_eta = fs->make("h_rt_gmt_rpcf_ptmax10_eta","h_rt_gmt_rpcf_ptmax10_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); - h_rt_gmt_rpcf_ptmax20_eta = fs->make("h_rt_gmt_rpcf_ptmax20_eta","h_rt_gmt_rpcf_ptmax20_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); - h_rt_gmt_rpcb_eta = fs->make("h_rt_gmt_rpcb_eta","h_rt_gmt_rpcb_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); - h_rt_gmt_rpcb_ptmax10_eta = fs->make("h_rt_gmt_rpcb_ptmax10_eta","h_rt_gmt_rpcb_ptmax10_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); - h_rt_gmt_rpcb_ptmax20_eta = fs->make("h_rt_gmt_rpcb_ptmax20_eta","h_rt_gmt_rpcb_ptmax20_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); - h_rt_gmt_dt_eta = fs->make("h_rt_gmt_dt_eta","h_rt_gmt_dt_eta",N_ETA_BINS_DT, ETA_START_DT, ETA_END_DT); - h_rt_gmt_dt_ptmax10_eta = fs->make("h_rt_gmt_dt_ptmax10_eta","h_rt_gmt_dt_ptmax10_eta",N_ETA_BINS_DT, ETA_START_DT, ETA_END_DT); - h_rt_gmt_dt_ptmax20_eta = fs->make("h_rt_gmt_dt_ptmax20_eta","h_rt_gmt_dt_ptmax20_eta",N_ETA_BINS_DT, ETA_START_DT, ETA_END_DT); - h_rt_gmt_eta = fs->make("h_rt_gmt_eta","h_rt_gmt_eta",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax10_eta = fs->make("h_rt_gmt_ptmax10_eta","h_rt_gmt_ptmax10_eta",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax10_eta_sing = fs->make("h_rt_gmt_ptmax10_eta_sing","h_rt_gmt_ptmax10_eta_sing",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax10_eta_sing_3s = fs->make("h_rt_gmt_ptmax10_eta_sing_3s","h_rt_gmt_ptmax10_eta_sing_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax10_eta_sing6 = fs->make("h_rt_gmt_ptmax10_eta_sing6","h_rt_gmt_ptmax10_eta_sing6",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax10_eta_sing6_3s = fs->make("h_rt_gmt_ptmax10_eta_sing6_3s","h_rt_gmt_ptmax10_eta_sing6_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax20_eta = fs->make("h_rt_gmt_ptmax20_eta","h_rt_gmt_ptmax20_eta",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax20_eta_sing = fs->make("h_rt_gmt_ptmax20_eta_sing","h_rt_gmt_ptmax20_eta_sing",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax20_eta_sing_csc = fs->make("h_rt_gmt_ptmax20_eta_sing_csc","h_rt_gmt_ptmax20_eta_sing_csc",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax20_eta_sing_dtcsc = fs->make("h_rt_gmt_ptmax20_eta_sing_dtcsc","h_rt_gmt_ptmax20_eta_sing_dtcsc",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax20_eta_sing_3s = fs->make("h_rt_gmt_ptmax20_eta_sing_3s","h_rt_gmt_ptmax20_eta_sing_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax20_eta_sing6 = fs->make("h_rt_gmt_ptmax20_eta_sing6","h_rt_gmt_ptmax20_eta_sing6",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax20_eta_sing6_csc = fs->make("h_rt_gmt_ptmax20_eta_sing6_csc","h_rt_gmt_ptmax20_eta_sing6_csc",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax20_eta_sing6_3s = fs->make("h_rt_gmt_ptmax20_eta_sing6_3s","h_rt_gmt_ptmax20_eta_sing6_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax30_eta_sing = fs->make("h_rt_gmt_ptmax30_eta_sing","h_rt_gmt_ptmax30_eta_sing",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax30_eta_sing_csc = fs->make("h_rt_gmt_ptmax30_eta_sing_csc","h_rt_gmt_ptmax30_eta_sing_csc",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax30_eta_sing_dtcsc = fs->make("h_rt_gmt_ptmax30_eta_sing_dtcsc","h_rt_gmt_ptmax30_eta_sing_dtcsc",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax30_eta_sing_3s = fs->make("h_rt_gmt_ptmax30_eta_sing_3s","h_rt_gmt_ptmax30_eta_sing_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax30_eta_sing6 = fs->make("h_rt_gmt_ptmax30_eta_sing6","h_rt_gmt_ptmax30_eta_sing6",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax30_eta_sing6_csc = fs->make("h_rt_gmt_ptmax30_eta_sing6_csc","h_rt_gmt_ptmax30_eta_sing6_csc",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax30_eta_sing6_3s = fs->make("h_rt_gmt_ptmax30_eta_sing6_3s","h_rt_gmt_ptmax30_eta_sing6_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); - - h_rt_gmt_ptmax10_eta_dbl = fs->make("h_rt_gmt_ptmax10_eta_dbl","h_rt_gmt_ptmax10_eta_dbl",N_ETA_BINS_GMT, ETA_BINS_GMT); - h_rt_gmt_ptmax20_eta_dbl = fs->make("h_rt_gmt_ptmax20_eta_dbl","h_rt_gmt_ptmax20_eta_dbl",N_ETA_BINS_GMT, ETA_BINS_GMT); - - const int Nthr = 7; - std::string str_pts[Nthr] = {"", "_pt10", "_pt15", "_pt20", "_pt25", "_pt30","_pt40"}; - - for (int i = 1; i < Nthr; ++i) { - std::string prefix = "h_rt_gmt_csc_mode_2s1b_1b_"; - h_rt_gmt_csc_mode_2s1b_1b[i-1] = fs->make((prefix + str_pts[i]).c_str(), (prefix + str_pts[i]).c_str(), 16, -0.5, 15.5); - setupTFModeHisto(h_rt_gmt_csc_mode_2s1b_1b[i-1]); - } - - h_rt_tfcand_pt_2st = fs->make("h_rt_tfcand_pt_2st","h_rt_tfcand_pt_2st",600, 0.,150.); - h_rt_tfcand_pt_3st = fs->make("h_rt_tfcand_pt_3st","h_rt_tfcand_pt_3st",600, 0.,150.); - - h_rt_tfcand_pt_h42_2st = fs->make("h_rt_tfcand_pt_h42_2st","h_rt_tfcand_pt_h42_2st",600, 0.,150.); - h_rt_tfcand_pt_h42_3st = fs->make("h_rt_tfcand_pt_h42_3st","h_rt_tfcand_pt_h42_3st",600, 0.,150.); - - h_rt_tftrack_bx = fs->make("h_rt_tftrack_bx","h_rt_tftrack_bx",13,-6.5, 6.5); - h_rt_tfcand_bx = fs->make("h_rt_tfcand_bx","h_rt_tfcand_bx",13,-6.5, 6.5); - h_rt_gmt_csc_bx = fs->make("h_rt_gmt_csc_bx","h_rt_gmt_csc_bx",13,-6.5, 6.5); - h_rt_gmt_rpcf_bx = fs->make("h_rt_gmt_rpcf_bx","h_rt_gmt_rpcf_bx",13,-6.5, 6.5); - h_rt_gmt_rpcb_bx = fs->make("h_rt_gmt_rpcb_bx","h_rt_gmt_rpcb_bx",13,-6.5, 6.5); - h_rt_gmt_dt_bx = fs->make("h_rt_gmt_dt_bx","h_rt_gmt_dt_bx",13,-6.5, 6.5); - h_rt_gmt_bx = fs->make("h_rt_gmt_bx","h_rt_gmt_bx",13,-6.5, 6.5); - - h_rt_gmt_csc_q = fs->make("h_rt_gmt_csc_q","h_rt_gmt_csc_q",8,-.5, 7.5); - h_rt_gmt_csc_q_42 = fs->make("h_rt_gmt_csc_q_42","h_rt_gmt_csc_q_42",8,-.5, 7.5); - h_rt_gmt_csc_q_42r = fs->make("h_rt_gmt_csc_q_42r","h_rt_gmt_csc_q_42r",8,-.5, 7.5); - h_rt_gmt_rpcf_q = fs->make("h_rt_gmt_rpcf_q","h_rt_gmt_rpcf_q",8,-.5, 7.5); - h_rt_gmt_rpcf_q_42 = fs->make("h_rt_gmt_rpcf_q_42","h_rt_gmt_rpcf_q_42",8,-.5, 7.5); - h_rt_gmt_rpcb_q = fs->make("h_rt_gmt_rpcb_q","h_rt_gmt_rpcb_q",8,-.5, 7.5); - h_rt_gmt_dt_q = fs->make("h_rt_gmt_dt_q","h_rt_gmt_dt_q",8,-.5, 7.5); - h_rt_gmt_gq = fs->make("h_rt_gmt_gq","h_rt_gmt_gq",8,-.5, 7.5); - h_rt_gmt_gq_42 = fs->make("h_rt_gmt_gq_42","h_rt_gmt_gq_42",8,-.5, 7.5); - h_rt_gmt_gq_42r = fs->make("h_rt_gmt_gq_42","h_rt_gmt_gq_42r",8,-.5, 7.5); - h_rt_gmt_gq_vs_pt_42r = fs->make("h_rt_gmt_gq_vs_pt_42r","h_rt_gmt_gq_vs_pt_42r",8,-.5, 7.5, 600, 0.,150.); - h_rt_gmt_gq_vs_type_42r = fs->make("h_rt_gmt_gq_vs_type_42r","h_rt_gmt_gq_vs_type_42r",8,-.5, 7.5, 7,-0.5,6.5); - h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(1,"?"); - h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(2,"RPC q=0"); - h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(3,"RPC q=1"); - h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(4,"CSC q=1"); - h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(5,"CSC q=2"); - h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(6,"CSC q=3"); - h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(7,"matched"); - - h_rt_tftrack_mode = fs->make("h_rt_tftrack_mode","TF Track Mode", 16, -0.5, 15.5); - setupTFModeHisto(h_rt_tftrack_mode); - h_rt_tftrack_mode->SetTitle("TF Track Mode (all TF tracks)"); +// h_rt_gmt_rpcf_pt = fs->make("h_rt_gmt_rpcf_pt","h_rt_gmt_rpcf_pt",600, 0.,150.); +// h_rt_gmt_rpcf_pt_42 = fs->make("h_rt_gmt_rpcf_pt_42","h_rt_gmt_rpcf_pt_42",600, 0.,150.); +// h_rt_gmt_rpcf_ptmax = fs->make("h_rt_gmt_rpcf_ptmax","h_rt_gmt_rpcf_ptmax",600, 0.,150.); +// h_rt_gmt_rpcf_ptmax_42 = fs->make("h_rt_gmt_rpcf_ptmax_42","h_rt_gmt_rpcf_ptmax_42",600, 0.,150.); + +// h_rt_gmt_rpcb_pt = fs->make("h_rt_gmt_rpcb_pt","h_rt_gmt_rpcb_pt",600, 0.,150.); +// h_rt_gmt_rpcb_ptmax = fs->make("h_rt_gmt_rpcb_ptmax","h_rt_gmt_rpcb_ptmax",600, 0.,150.); + +// h_rt_gmt_dt_pt = fs->make("h_rt_gmt_dt_pt","h_rt_gmt_dt_pt",600, 0.,150.); +// h_rt_gmt_dt_ptmax = fs->make("h_rt_gmt_dt_ptmax","h_rt_gmt_dt_ptmax",600, 0.,150.); + +// h_rt_gmt_pt = fs->make("h_rt_gmt_pt","h_rt_gmt_pt",600, 0.,150.); +// h_rt_gmt_pt_2st = fs->make("h_rt_gmt_pt_2st","h_rt_gmt_pt_2st",600, 0.,150.); +// h_rt_gmt_pt_3st = fs->make("h_rt_gmt_pt_3st","h_rt_gmt_pt_3st",600, 0.,150.); +// h_rt_gmt_pt_2q = fs->make("h_rt_gmt_pt_2q","h_rt_gmt_pt_2q",600, 0.,150.); +// h_rt_gmt_pt_3q = fs->make("h_rt_gmt_pt_3q","h_rt_gmt_pt_3q",600, 0.,150.); +// h_rt_gmt_ptmax = fs->make("h_rt_gmt_ptmax","h_rt_gmt_ptmax",600, 0.,150.); +// h_rt_gmt_ptmax_sing = fs->make("h_rt_gmt_ptmax_sing","h_rt_gmt_ptmax_sing",600, 0.,150.); +// h_rt_gmt_ptmax_sing_3s = fs->make("h_rt_gmt_ptmax_sing_3s","h_rt_gmt_ptmax_sing_3s",600, 0.,150.); +// h_rt_gmt_ptmax_sing_csc = fs->make("h_rt_gmt_ptmax_sing_csc","h_rt_gmt_ptmax_sing_csc",600, 0.,150.); +// h_rt_gmt_ptmax_sing_1b = fs->make("h_rt_gmt_ptmax_sing_1b","h_rt_gmt_ptmax_sing_no1a",600, 0.,150.); +// h_rt_gmt_ptmax_sing_no1a = fs->make("h_rt_gmt_ptmax_sing_no1a","h_rt_gmt_ptmax_sing_no1a",600, 0.,150.); +// h_rt_gmt_ptmax_sing6 = fs->make("h_rt_gmt_ptmax_sing6","h_rt_gmt_ptmax_sing6",600, 0.,150.); +// h_rt_gmt_ptmax_sing6_3s = fs->make("h_rt_gmt_ptmax_sing6_3s","h_rt_gmt_ptmax_sing6_3s",600, 0.,150.); +// h_rt_gmt_ptmax_sing6_csc = fs->make("h_rt_gmt_ptmax_sing6_csc","h_rt_gmt_ptmax_sing6_csc",600, 0.,150.); +// h_rt_gmt_ptmax_sing6_1b = fs->make("h_rt_gmt_ptmax_sing6_1b","h_rt_gmt_ptmax_sing6_1b",600, 0.,150.); +// h_rt_gmt_ptmax_sing6_no1a = fs->make("h_rt_gmt_ptmax_sing6_no1a","h_rt_gmt_ptmax_sing6_no1a",600, 0.,150.); +// h_rt_gmt_ptmax_sing6_3s1b_no1a = fs->make("h_rt_gmt_ptmax_sing6_3s1b_no1a","h_rt_gmt_ptmax_sing6_3s1b_no1a",600, 0.,150.); +// h_rt_gmt_ptmax_dbl = fs->make("h_rt_gmt_ptmax_dbl","h_rt_gmt_ptmax_dbl",600, 0.,150.); +// h_rt_gmt_pt_2s42 = fs->make("h_rt_gmt_pt_2s42","h_rt_gmt_pt_2s42",600, 0.,150.); +// h_rt_gmt_pt_3s42 = fs->make("h_rt_gmt_pt_3s42","h_rt_gmt_pt_3s42",600, 0.,150.); +// h_rt_gmt_ptmax_2s42 = fs->make("h_rt_gmt_ptmax_2s42","h_rt_gmt_ptmax_2s42",600, 0.,150.); +// h_rt_gmt_ptmax_3s42 = fs->make("h_rt_gmt_ptmax_3s42","h_rt_gmt_ptmax_3s42",600, 0.,150.); +// h_rt_gmt_ptmax_2s42_sing = fs->make("h_rt_gmt_ptmax_2s42_sing","h_rt_gmt_ptmax_2s42_sing",600, 0.,150.); +// h_rt_gmt_ptmax_3s42_sing = fs->make("h_rt_gmt_ptmax_3s42_sing","h_rt_gmt_ptmax_3s42_sing",600, 0.,150.); +// h_rt_gmt_pt_2q42 = fs->make("h_rt_gmt_pt_2q42","h_rt_gmt_pt_2q42",600, 0.,150.); +// h_rt_gmt_pt_3q42 = fs->make("h_rt_gmt_pt_3q42","h_rt_gmt_pt_3q42",600, 0.,150.); +// h_rt_gmt_ptmax_2q42 = fs->make("h_rt_gmt_ptmax_2q42","h_rt_gmt_ptmax_2q42",600, 0.,150.); +// h_rt_gmt_ptmax_3q42 = fs->make("h_rt_gmt_ptmax_3q42","h_rt_gmt_ptmax_3q42",600, 0.,150.); +// h_rt_gmt_ptmax_2q42_sing = fs->make("h_rt_gmt_ptmax_2q42_sing","h_rt_gmt_ptmax_2q42_sing",600, 0.,150.); +// h_rt_gmt_ptmax_3q42_sing = fs->make("h_rt_gmt_ptmax_3q42_sing","h_rt_gmt_ptmax_3q42_sing",600, 0.,150.); +// h_rt_gmt_pt_2s42r = fs->make("h_rt_gmt_pt_2s42r","h_rt_gmt_pt_2s42r",600, 0.,150.); +// h_rt_gmt_pt_3s42r = fs->make("h_rt_gmt_pt_3s42r","h_rt_gmt_pt_3s42r",600, 0.,150.); +// h_rt_gmt_ptmax_2s42r = fs->make("h_rt_gmt_ptmax_2s42r","h_rt_gmt_ptmax_2s42r",600, 0.,150.); +// h_rt_gmt_ptmax_3s42r = fs->make("h_rt_gmt_ptmax_3s42r","h_rt_gmt_ptmax_3s42r",600, 0.,150.); +// h_rt_gmt_ptmax_2s42r_sing = fs->make("h_rt_gmt_ptmax_2s42r_sing","h_rt_gmt_ptmax_2s42r_sing",600, 0.,150.); +// h_rt_gmt_ptmax_3s42r_sing = fs->make("h_rt_gmt_ptmax_3s42r_sing","h_rt_gmt_ptmax_3s42r_sing",600, 0.,150.); +// h_rt_gmt_pt_2q42r = fs->make("h_rt_gmt_pt_2q42r","h_rt_gmt_pt_2q42r",600, 0.,150.); +// h_rt_gmt_pt_3q42r = fs->make("h_rt_gmt_pt_3q42r","h_rt_gmt_pt_3q42r",600, 0.,150.); +// h_rt_gmt_ptmax_2q42r = fs->make("h_rt_gmt_ptmax_2q42r","h_rt_gmt_ptmax_2q42r",600, 0.,150.); +// h_rt_gmt_ptmax_3q42r = fs->make("h_rt_gmt_ptmax_3q42r","h_rt_gmt_ptmax_3q42r",600, 0.,150.); +// h_rt_gmt_ptmax_2q42r_sing = fs->make("h_rt_gmt_ptmax_2q42r_sing","h_rt_gmt_ptmax_2q42r_sing",600, 0.,150.); +// h_rt_gmt_ptmax_3q42r_sing = fs->make("h_rt_gmt_ptmax_3q42r_sing","h_rt_gmt_ptmax_3q42r_sing",600, 0.,150.); + + +// h_rt_gmt_csc_eta = fs->make("h_rt_gmt_csc_eta","h_rt_gmt_csc_eta",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax10_eta_2s = fs->make("h_rt_gmt_csc_ptmax10_eta_2s","h_rt_gmt_csc_ptmax10_eta_2s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax10_eta_2s_2s1b = fs->make("h_rt_gmt_csc_ptmax10_eta_2s_2s1b","h_rt_gmt_csc_ptmax10_eta_2s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax10_eta_3s = fs->make("h_rt_gmt_csc_ptmax10_eta_3s","h_rt_gmt_csc_ptmax10_eta_3s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax10_eta_3s_1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_1b","h_rt_gmt_csc_ptmax10_eta_3s_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax10_eta_3s_no1a = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_no1a","h_rt_gmt_csc_ptmax10_eta_3s_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax10_eta_3s_2s1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s1b","h_rt_gmt_csc_ptmax10_eta_3s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax10_eta_3s_2s1b_1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s1b_1b","h_rt_gmt_csc_ptmax10_eta_3s_2s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax10_eta_3s_2s123_1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s123_1b","h_rt_gmt_csc_ptmax10_eta_3s_2s123_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax10_eta_3s_2s13_1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s13_1b","h_rt_gmt_csc_ptmax10_eta_3s_2s13_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax10_eta_3s_2s1b_no1a = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s1b_no1a","h_rt_gmt_csc_ptmax10_eta_3s_2s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax10_eta_3s_2s123_no1a = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s123_no1a","h_rt_gmt_csc_ptmax10_eta_3s_2s123_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax10_eta_3s_2s13_no1a = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_2s13_no1a","h_rt_gmt_csc_ptmax10_eta_3s_2s13_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax10_eta_3s_3s1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_3s1b","h_rt_gmt_csc_ptmax10_eta_3s_3s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax10_eta_3s_3s1b_1b = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_3s1b_1b","h_rt_gmt_csc_ptmax10_eta_3s_3s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax10_eta_3s_3s1b_no1a = fs->make("h_rt_gmt_csc_ptmax10_eta_3s_3s1b_no1a","h_rt_gmt_csc_ptmax10_eta_3s_3s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax10_eta_2q = fs->make("h_rt_gmt_csc_ptmax10_eta_2q","h_rt_gmt_csc_ptmax10_eta_2q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax10_eta_3q = fs->make("h_rt_gmt_csc_ptmax10_eta_3q","h_rt_gmt_csc_ptmax10_eta_3q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + +// h_rt_gmt_csc_ptmax20_eta_2s = fs->make("h_rt_gmt_csc_ptmax20_eta_2s","h_rt_gmt_csc_ptmax20_eta_2s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax20_eta_2s_2s1b = fs->make("h_rt_gmt_csc_ptmax20_eta_2s_2s1b","h_rt_gmt_csc_ptmax20_eta_2s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax20_eta_3s = fs->make("h_rt_gmt_csc_ptmax20_eta_3s","h_rt_gmt_csc_ptmax20_eta_3s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + +// h_rt_gmt_csc_ptmax20_eta_3s_1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_1b","h_rt_gmt_csc_ptmax20_eta_3s_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax20_eta_3s_1ab = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_1ab","h_rt_gmt_csc_ptmax20_eta_3s_1ab",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + +// h_rt_gmt_csc_ptmax20_eta_3s_no1a = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_no1a","h_rt_gmt_csc_ptmax20_eta_3s_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax20_eta_3s_2s1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s1b","h_rt_gmt_csc_ptmax20_eta_3s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax20_eta_3s_2s1b_1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s1b_1b","h_rt_gmt_csc_ptmax20_eta_3s_2s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax20_eta_3s_2s123_1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s123_1b","h_rt_gmt_csc_ptmax20_eta_3s_2s123_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax20_eta_3s_2s13_1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s13_1b","h_rt_gmt_csc_ptmax20_eta_3s_2s13_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax20_eta_3s_2s1b_no1a = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s1b_no1a","h_rt_gmt_csc_ptmax20_eta_3s_2s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax20_eta_3s_2s123_no1a = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s123_no1a","h_rt_gmt_csc_ptmax20_eta_3s_2s123_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax20_eta_3s_2s13_no1a = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_2s13_no1a","h_rt_gmt_csc_ptmax20_eta_3s_2s13_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + +// h_rt_gmt_csc_ptmax20_eta_3s_3s1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_3s1b","h_rt_gmt_csc_ptmax20_eta_3s_3s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax20_eta_3s_3s1ab = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_3s1ab","h_rt_gmt_csc_ptmax20_eta_3s_3s1ab",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + +// h_rt_gmt_csc_ptmax20_eta_3s_3s1b_1b = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_3s1b_1b","h_rt_gmt_csc_ptmax20_eta_3s_3s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax20_eta_3s_3s1b_no1a = fs->make("h_rt_gmt_csc_ptmax20_eta_3s_3s1b_no1a","h_rt_gmt_csc_ptmax20_eta_3s_3s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax20_eta_2q = fs->make("h_rt_gmt_csc_ptmax20_eta_2q","h_rt_gmt_csc_ptmax20_eta_2q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax20_eta_3q = fs->make("h_rt_gmt_csc_ptmax20_eta_3q","h_rt_gmt_csc_ptmax20_eta_3q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + +// h_rt_gmt_csc_ptmax30_eta_2s = fs->make("h_rt_gmt_csc_ptmax30_eta_2s","h_rt_gmt_csc_ptmax30_eta_2s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax30_eta_2s_2s1b = fs->make("h_rt_gmt_csc_ptmax30_eta_2s_2s1b","h_rt_gmt_csc_ptmax30_eta_2s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax30_eta_3s = fs->make("h_rt_gmt_csc_ptmax30_eta_3s","h_rt_gmt_csc_ptmax30_eta_3s",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + +// h_rt_gmt_csc_ptmax30_eta_3s_1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_1b","h_rt_gmt_csc_ptmax30_eta_3s_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax30_eta_3s_1ab = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_1ab","h_rt_gmt_csc_ptmax30_eta_3s_1ab",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + +// h_rt_gmt_csc_ptmax30_eta_3s_no1a = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_no1a","h_rt_gmt_csc_ptmax30_eta_3s_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax30_eta_3s_2s1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s1b","h_rt_gmt_csc_ptmax30_eta_3s_2s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax30_eta_3s_2s1b_1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s1b_1b","h_rt_gmt_csc_ptmax30_eta_3s_2s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax30_eta_3s_2s123_1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s123_1b","h_rt_gmt_csc_ptmax30_eta_3s_2s123_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax30_eta_3s_2s13_1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s13_1b","h_rt_gmt_csc_ptmax30_eta_3s_2s13_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax30_eta_3s_2s1b_no1a = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s1b_no1a","h_rt_gmt_csc_ptmax30_eta_3s_2s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax30_eta_3s_2s123_no1a = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s123_no1a","h_rt_gmt_csc_ptmax30_eta_3s_2s123_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax30_eta_3s_2s13_no1a = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_2s13_no1a","h_rt_gmt_csc_ptmax30_eta_3s_2s13_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + +// h_rt_gmt_csc_ptmax30_eta_3s_3s1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_3s1b","h_rt_gmt_csc_ptmax30_eta_3s_3s1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax30_eta_3s_3s1ab = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_3s1ab","h_rt_gmt_csc_ptmax30_eta_3s_3s1ab",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + + +// h_rt_gmt_csc_ptmax30_eta_3s_3s1b_1b = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_3s1b_1b","h_rt_gmt_csc_ptmax30_eta_3s_3s1b_1b",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax30_eta_3s_3s1b_no1a = fs->make("h_rt_gmt_csc_ptmax30_eta_3s_3s1b_no1a","h_rt_gmt_csc_ptmax30_eta_3s_3s1b_no1a",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax30_eta_2q = fs->make("h_rt_gmt_csc_ptmax30_eta_2q","h_rt_gmt_csc_ptmax30_eta_2q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); +// h_rt_gmt_csc_ptmax30_eta_3q = fs->make("h_rt_gmt_csc_ptmax30_eta_3q","h_rt_gmt_csc_ptmax30_eta_3q",N_ETA_BINS_CSC, ETA_START_CSC, ETA_END_CSC); + +// h_rt_gmt_rpcf_eta = fs->make("h_rt_gmt_rpcf_eta","h_rt_gmt_rpcf_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); +// h_rt_gmt_rpcf_ptmax10_eta = fs->make("h_rt_gmt_rpcf_ptmax10_eta","h_rt_gmt_rpcf_ptmax10_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); +// h_rt_gmt_rpcf_ptmax20_eta = fs->make("h_rt_gmt_rpcf_ptmax20_eta","h_rt_gmt_rpcf_ptmax20_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); +// h_rt_gmt_rpcb_eta = fs->make("h_rt_gmt_rpcb_eta","h_rt_gmt_rpcb_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); +// h_rt_gmt_rpcb_ptmax10_eta = fs->make("h_rt_gmt_rpcb_ptmax10_eta","h_rt_gmt_rpcb_ptmax10_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); +// h_rt_gmt_rpcb_ptmax20_eta = fs->make("h_rt_gmt_rpcb_ptmax20_eta","h_rt_gmt_rpcb_ptmax20_eta",N_ETA_BINS_RPC, ETA_BINS_RPC); +// h_rt_gmt_dt_eta = fs->make("h_rt_gmt_dt_eta","h_rt_gmt_dt_eta",N_ETA_BINS_DT, ETA_START_DT, ETA_END_DT); +// h_rt_gmt_dt_ptmax10_eta = fs->make("h_rt_gmt_dt_ptmax10_eta","h_rt_gmt_dt_ptmax10_eta",N_ETA_BINS_DT, ETA_START_DT, ETA_END_DT); +// h_rt_gmt_dt_ptmax20_eta = fs->make("h_rt_gmt_dt_ptmax20_eta","h_rt_gmt_dt_ptmax20_eta",N_ETA_BINS_DT, ETA_START_DT, ETA_END_DT); +// h_rt_gmt_eta = fs->make("h_rt_gmt_eta","h_rt_gmt_eta",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax10_eta = fs->make("h_rt_gmt_ptmax10_eta","h_rt_gmt_ptmax10_eta",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax10_eta_sing = fs->make("h_rt_gmt_ptmax10_eta_sing","h_rt_gmt_ptmax10_eta_sing",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax10_eta_sing_3s = fs->make("h_rt_gmt_ptmax10_eta_sing_3s","h_rt_gmt_ptmax10_eta_sing_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax10_eta_sing6 = fs->make("h_rt_gmt_ptmax10_eta_sing6","h_rt_gmt_ptmax10_eta_sing6",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax10_eta_sing6_3s = fs->make("h_rt_gmt_ptmax10_eta_sing6_3s","h_rt_gmt_ptmax10_eta_sing6_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax20_eta = fs->make("h_rt_gmt_ptmax20_eta","h_rt_gmt_ptmax20_eta",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax20_eta_sing = fs->make("h_rt_gmt_ptmax20_eta_sing","h_rt_gmt_ptmax20_eta_sing",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax20_eta_sing_csc = fs->make("h_rt_gmt_ptmax20_eta_sing_csc","h_rt_gmt_ptmax20_eta_sing_csc",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax20_eta_sing_dtcsc = fs->make("h_rt_gmt_ptmax20_eta_sing_dtcsc","h_rt_gmt_ptmax20_eta_sing_dtcsc",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax20_eta_sing_3s = fs->make("h_rt_gmt_ptmax20_eta_sing_3s","h_rt_gmt_ptmax20_eta_sing_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax20_eta_sing6 = fs->make("h_rt_gmt_ptmax20_eta_sing6","h_rt_gmt_ptmax20_eta_sing6",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax20_eta_sing6_csc = fs->make("h_rt_gmt_ptmax20_eta_sing6_csc","h_rt_gmt_ptmax20_eta_sing6_csc",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax20_eta_sing6_3s = fs->make("h_rt_gmt_ptmax20_eta_sing6_3s","h_rt_gmt_ptmax20_eta_sing6_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax30_eta_sing = fs->make("h_rt_gmt_ptmax30_eta_sing","h_rt_gmt_ptmax30_eta_sing",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax30_eta_sing_csc = fs->make("h_rt_gmt_ptmax30_eta_sing_csc","h_rt_gmt_ptmax30_eta_sing_csc",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax30_eta_sing_dtcsc = fs->make("h_rt_gmt_ptmax30_eta_sing_dtcsc","h_rt_gmt_ptmax30_eta_sing_dtcsc",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax30_eta_sing_3s = fs->make("h_rt_gmt_ptmax30_eta_sing_3s","h_rt_gmt_ptmax30_eta_sing_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax30_eta_sing6 = fs->make("h_rt_gmt_ptmax30_eta_sing6","h_rt_gmt_ptmax30_eta_sing6",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax30_eta_sing6_csc = fs->make("h_rt_gmt_ptmax30_eta_sing6_csc","h_rt_gmt_ptmax30_eta_sing6_csc",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax30_eta_sing6_3s = fs->make("h_rt_gmt_ptmax30_eta_sing6_3s","h_rt_gmt_ptmax30_eta_sing6_3s",N_ETA_BINS_GMT, ETA_BINS_GMT); + +// h_rt_gmt_ptmax10_eta_dbl = fs->make("h_rt_gmt_ptmax10_eta_dbl","h_rt_gmt_ptmax10_eta_dbl",N_ETA_BINS_GMT, ETA_BINS_GMT); +// h_rt_gmt_ptmax20_eta_dbl = fs->make("h_rt_gmt_ptmax20_eta_dbl","h_rt_gmt_ptmax20_eta_dbl",N_ETA_BINS_GMT, ETA_BINS_GMT); + +// const int Nthr = 7; +// std::string str_pts[Nthr] = {"", "_pt10", "_pt15", "_pt20", "_pt25", "_pt30","_pt40"}; + +// for (int i = 1; i < Nthr; ++i) { +// std::string prefix = "h_rt_gmt_csc_mode_2s1b_1b_"; +// h_rt_gmt_csc_mode_2s1b_1b[i-1] = fs->make((prefix + str_pts[i]).c_str(), (prefix + str_pts[i]).c_str(), 16, -0.5, 15.5); +// setupTFModeHisto(h_rt_gmt_csc_mode_2s1b_1b[i-1]); +// } + +// h_rt_tfcand_pt_2st = fs->make("h_rt_tfcand_pt_2st","h_rt_tfcand_pt_2st",600, 0.,150.); +// h_rt_tfcand_pt_3st = fs->make("h_rt_tfcand_pt_3st","h_rt_tfcand_pt_3st",600, 0.,150.); + +// h_rt_tfcand_pt_h42_2st = fs->make("h_rt_tfcand_pt_h42_2st","h_rt_tfcand_pt_h42_2st",600, 0.,150.); +// h_rt_tfcand_pt_h42_3st = fs->make("h_rt_tfcand_pt_h42_3st","h_rt_tfcand_pt_h42_3st",600, 0.,150.); + +// h_rt_tftrack_bx = fs->make("h_rt_tftrack_bx","h_rt_tftrack_bx",13,-6.5, 6.5); +// h_rt_tfcand_bx = fs->make("h_rt_tfcand_bx","h_rt_tfcand_bx",13,-6.5, 6.5); +// h_rt_gmt_csc_bx = fs->make("h_rt_gmt_csc_bx","h_rt_gmt_csc_bx",13,-6.5, 6.5); +// h_rt_gmt_rpcf_bx = fs->make("h_rt_gmt_rpcf_bx","h_rt_gmt_rpcf_bx",13,-6.5, 6.5); +// h_rt_gmt_rpcb_bx = fs->make("h_rt_gmt_rpcb_bx","h_rt_gmt_rpcb_bx",13,-6.5, 6.5); +// h_rt_gmt_dt_bx = fs->make("h_rt_gmt_dt_bx","h_rt_gmt_dt_bx",13,-6.5, 6.5); +// h_rt_gmt_bx = fs->make("h_rt_gmt_bx","h_rt_gmt_bx",13,-6.5, 6.5); + +// h_rt_gmt_csc_q = fs->make("h_rt_gmt_csc_q","h_rt_gmt_csc_q",8,-.5, 7.5); +// h_rt_gmt_csc_q_42 = fs->make("h_rt_gmt_csc_q_42","h_rt_gmt_csc_q_42",8,-.5, 7.5); +// h_rt_gmt_csc_q_42r = fs->make("h_rt_gmt_csc_q_42r","h_rt_gmt_csc_q_42r",8,-.5, 7.5); +// h_rt_gmt_rpcf_q = fs->make("h_rt_gmt_rpcf_q","h_rt_gmt_rpcf_q",8,-.5, 7.5); +// h_rt_gmt_rpcf_q_42 = fs->make("h_rt_gmt_rpcf_q_42","h_rt_gmt_rpcf_q_42",8,-.5, 7.5); +// h_rt_gmt_rpcb_q = fs->make("h_rt_gmt_rpcb_q","h_rt_gmt_rpcb_q",8,-.5, 7.5); +// h_rt_gmt_dt_q = fs->make("h_rt_gmt_dt_q","h_rt_gmt_dt_q",8,-.5, 7.5); +// h_rt_gmt_gq = fs->make("h_rt_gmt_gq","h_rt_gmt_gq",8,-.5, 7.5); +// h_rt_gmt_gq_42 = fs->make("h_rt_gmt_gq_42","h_rt_gmt_gq_42",8,-.5, 7.5); +// h_rt_gmt_gq_42r = fs->make("h_rt_gmt_gq_42","h_rt_gmt_gq_42r",8,-.5, 7.5); +// h_rt_gmt_gq_vs_pt_42r = fs->make("h_rt_gmt_gq_vs_pt_42r","h_rt_gmt_gq_vs_pt_42r",8,-.5, 7.5, 600, 0.,150.); +// h_rt_gmt_gq_vs_type_42r = fs->make("h_rt_gmt_gq_vs_type_42r","h_rt_gmt_gq_vs_type_42r",8,-.5, 7.5, 7,-0.5,6.5); +// h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(1,"?"); +// h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(2,"RPC q=0"); +// h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(3,"RPC q=1"); +// h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(4,"CSC q=1"); +// h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(5,"CSC q=2"); +// h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(6,"CSC q=3"); +// h_rt_gmt_gq_vs_type_42r->GetYaxis()->SetBinLabel(7,"matched"); + +// h_rt_tftrack_mode = fs->make("h_rt_tftrack_mode","TF Track Mode", 16, -0.5, 15.5); +// setupTFModeHisto(h_rt_tftrack_mode); +// h_rt_tftrack_mode->SetTitle("TF Track Mode (all TF tracks)"); - h_rt_n_ch_alct_per_bx = fs->make("h_rt_n_ch_alct_per_bx", "h_rt_n_ch_alct_per_bx", 51,-0.5, 50.5); - h_rt_n_ch_clct_per_bx = fs->make("h_rt_n_ch_clct_per_bx", "h_rt_n_ch_clct_per_bx", 51,-0.5, 50.5); - h_rt_n_ch_lct_per_bx = fs->make("h_rt_n_ch_lct_per_bx", "h_rt_n_ch_lct_per_bx", 51,-0.5, 50.5); +// h_rt_n_ch_alct_per_bx = fs->make("h_rt_n_ch_alct_per_bx", "h_rt_n_ch_alct_per_bx", 51,-0.5, 50.5); +// h_rt_n_ch_clct_per_bx = fs->make("h_rt_n_ch_clct_per_bx", "h_rt_n_ch_clct_per_bx", 51,-0.5, 50.5); +// h_rt_n_ch_lct_per_bx = fs->make("h_rt_n_ch_lct_per_bx", "h_rt_n_ch_lct_per_bx", 51,-0.5, 50.5); - h_rt_tfcand_eta = fs->make("h_rt_tfcand_eta","h_rt_tfcand_eta",N_ETA_BINS, ETA_START, ETA_END); - h_rt_tfcand_eta_pt5 = fs->make("h_rt_tfcand_eta_pt5","h_rt_tfcand_eta_pt5",N_ETA_BINS, ETA_START, ETA_END); - h_rt_tfcand_eta_pt10 = fs->make("h_rt_tfcand_eta_pt10","h_rt_tfcand_eta_pt10",N_ETA_BINS, ETA_START, ETA_END); - h_rt_tfcand_eta_pt15 = fs->make("h_rt_tfcand_eta_pt15","h_rt_tfcand_eta_pt15",N_ETA_BINS, ETA_START, ETA_END); +// h_rt_tfcand_eta = fs->make("h_rt_tfcand_eta","h_rt_tfcand_eta",N_ETA_BINS, ETA_START, ETA_END); +// h_rt_tfcand_eta_pt5 = fs->make("h_rt_tfcand_eta_pt5","h_rt_tfcand_eta_pt5",N_ETA_BINS, ETA_START, ETA_END); +// h_rt_tfcand_eta_pt10 = fs->make("h_rt_tfcand_eta_pt10","h_rt_tfcand_eta_pt10",N_ETA_BINS, ETA_START, ETA_END); +// h_rt_tfcand_eta_pt15 = fs->make("h_rt_tfcand_eta_pt15","h_rt_tfcand_eta_pt15",N_ETA_BINS, ETA_START, ETA_END); - h_rt_tfcand_eta_3st = fs->make("h_rt_tfcand_eta_3st","h_rt_tfcand_eta_3st",N_ETA_BINS, ETA_START, ETA_END); - h_rt_tfcand_eta_pt5_3st = fs->make("h_rt_tfcand_eta_pt5_3st","h_rt_tfcand_eta_pt5_3st",N_ETA_BINS, ETA_START, ETA_END); - h_rt_tfcand_eta_pt10_3st = fs->make("h_rt_tfcand_eta_pt10_3st","h_rt_tfcand_eta_pt10_3st",N_ETA_BINS, ETA_START, ETA_END); - h_rt_tfcand_eta_pt15_3st = fs->make("h_rt_tfcand_eta_pt15_3st","h_rt_tfcand_eta_pt15_3st",N_ETA_BINS, ETA_START, ETA_END); +// h_rt_tfcand_eta_3st = fs->make("h_rt_tfcand_eta_3st","h_rt_tfcand_eta_3st",N_ETA_BINS, ETA_START, ETA_END); +// h_rt_tfcand_eta_pt5_3st = fs->make("h_rt_tfcand_eta_pt5_3st","h_rt_tfcand_eta_pt5_3st",N_ETA_BINS, ETA_START, ETA_END); +// h_rt_tfcand_eta_pt10_3st = fs->make("h_rt_tfcand_eta_pt10_3st","h_rt_tfcand_eta_pt10_3st",N_ETA_BINS, ETA_START, ETA_END); +// h_rt_tfcand_eta_pt15_3st = fs->make("h_rt_tfcand_eta_pt15_3st","h_rt_tfcand_eta_pt15_3st",N_ETA_BINS, ETA_START, ETA_END); - h_rt_tfcand_eta_3st1a = fs->make("h_rt_tfcand_eta_3st1a","h_rt_tfcand_eta_3st1a",N_ETA_BINS, ETA_START, ETA_END); - h_rt_tfcand_eta_pt5_3st1a = fs->make("h_rt_tfcand_eta_pt5_3st1a","h_rt_tfcand_eta_pt5_3st1a",N_ETA_BINS, ETA_START, ETA_END); - h_rt_tfcand_eta_pt10_3st1a = fs->make("h_rt_tfcand_eta_pt10_3st1a","h_rt_tfcand_eta_pt10_3st1a",N_ETA_BINS, ETA_START, ETA_END); - h_rt_tfcand_eta_pt15_3st1a = fs->make("h_rt_tfcand_eta_pt15_3st1a","h_rt_tfcand_eta_pt15_3st1a",N_ETA_BINS, ETA_START, ETA_END); +// h_rt_tfcand_eta_3st1a = fs->make("h_rt_tfcand_eta_3st1a","h_rt_tfcand_eta_3st1a",N_ETA_BINS, ETA_START, ETA_END); +// h_rt_tfcand_eta_pt5_3st1a = fs->make("h_rt_tfcand_eta_pt5_3st1a","h_rt_tfcand_eta_pt5_3st1a",N_ETA_BINS, ETA_START, ETA_END); +// h_rt_tfcand_eta_pt10_3st1a = fs->make("h_rt_tfcand_eta_pt10_3st1a","h_rt_tfcand_eta_pt10_3st1a",N_ETA_BINS, ETA_START, ETA_END); +// h_rt_tfcand_eta_pt15_3st1a = fs->make("h_rt_tfcand_eta_pt15_3st1a","h_rt_tfcand_eta_pt15_3st1a",N_ETA_BINS, ETA_START, ETA_END); - h_rt_tfcand_pt_vs_eta = fs->make("h_rt_tfcand_pt_vs_eta","h_rt_tfcand_pt_vs_eta",600, 0.,150.,N_ETA_BINS, ETA_START, ETA_END); - h_rt_tfcand_pt_vs_eta_3st = fs->make("h_rt_tfcand_pt_vs_eta_3st","h_rt_tfcand_pt_vs_eta_3st",600, 0.,150.,N_ETA_BINS, ETA_START, ETA_END); - h_rt_tfcand_pt_vs_eta_3st1a = fs->make("h_rt_tfcand_pt_vs_eta_3st1a","h_rt_tfcand_pt_vs_eta_3st1a",600, 0.,150.,N_ETA_BINS, ETA_START, ETA_END); +// h_rt_tfcand_pt_vs_eta = fs->make("h_rt_tfcand_pt_vs_eta","h_rt_tfcand_pt_vs_eta",600, 0.,150.,N_ETA_BINS, ETA_START, ETA_END); +// h_rt_tfcand_pt_vs_eta_3st = fs->make("h_rt_tfcand_pt_vs_eta_3st","h_rt_tfcand_pt_vs_eta_3st",600, 0.,150.,N_ETA_BINS, ETA_START, ETA_END); +// h_rt_tfcand_pt_vs_eta_3st1a = fs->make("h_rt_tfcand_pt_vs_eta_3st1a","h_rt_tfcand_pt_vs_eta_3st1a",600, 0.,150.,N_ETA_BINS, ETA_START, ETA_END); - char label[200]; - for (int me=0; me<=CSC_TYPES; me++) - { - if (me==3 && !doME1a_) continue; // ME1/a +// char label[200]; +// for (int me=0; me<=CSC_TYPES; me++) +// { +// if (me==3 && !doME1a_) continue; // ME1/a - sprintf(label,"h_rt_n_per_ch_alct_vs_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); - h_rt_n_per_ch_alct_vs_bx_cscdet[me] = fs->make(label, label, 5,0,5, 16,-.5, 15.5); +// sprintf(label,"h_rt_n_per_ch_alct_vs_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); +// h_rt_n_per_ch_alct_vs_bx_cscdet[me] = fs->make(label, label, 5,0,5, 16,-.5, 15.5); - sprintf(label,"h_rt_n_per_ch_clct_vs_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); - h_rt_n_per_ch_clct_vs_bx_cscdet[me] = fs->make(label, label, 5,0,5, 16,-.5, 15.5); +// sprintf(label,"h_rt_n_per_ch_clct_vs_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); +// h_rt_n_per_ch_clct_vs_bx_cscdet[me] = fs->make(label, label, 5,0,5, 16,-.5, 15.5); - sprintf(label,"h_rt_n_per_ch_lct_vs_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); - h_rt_n_per_ch_lct_vs_bx_cscdet[me] = fs->make(label, label, 5,0,5, 16,-.5, 15.5); +// sprintf(label,"h_rt_n_per_ch_lct_vs_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); +// h_rt_n_per_ch_lct_vs_bx_cscdet[me] = fs->make(label, label, 5,0,5, 16,-.5, 15.5); - sprintf(label,"h_rt_n_ch_alct_per_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); - h_rt_n_ch_alct_per_bx_cscdet[me] = fs->make(label, label, 51,-0.5, 50.5); +// sprintf(label,"h_rt_n_ch_alct_per_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); +// h_rt_n_ch_alct_per_bx_cscdet[me] = fs->make(label, label, 51,-0.5, 50.5); - sprintf(label,"h_rt_n_ch_clct_per_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); - h_rt_n_ch_clct_per_bx_cscdet[me] = fs->make(label, label, 51,-0.5, 50.5); +// sprintf(label,"h_rt_n_ch_clct_per_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); +// h_rt_n_ch_clct_per_bx_cscdet[me] = fs->make(label, label, 51,-0.5, 50.5); - sprintf(label,"h_rt_n_ch_lct_per_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); - h_rt_n_ch_lct_per_bx_cscdet[me] = fs->make(label, label, 51,-0.5, 50.5); +// sprintf(label,"h_rt_n_ch_lct_per_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); +// h_rt_n_ch_lct_per_bx_cscdet[me] = fs->make(label, label, 51,-0.5, 50.5); - sprintf(label,"h_rt_mplct_pattern_cscdet_%s",mugeo::csc_type_[me].c_str()); - h_rt_mplct_pattern_cscdet[me] = fs->make(label, label, 13,-0.5, 12.5); +// sprintf(label,"h_rt_mplct_pattern_cscdet_%s",mugeo::csc_type_[me].c_str()); +// h_rt_mplct_pattern_cscdet[me] = fs->make(label, label, 13,-0.5, 12.5); - sprintf(label,"h_rt_alct_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); - h_rt_alct_bx_cscdet[me] = fs->make(label, label,13,-6.5, 6.5); - sprintf(label,"h_rt_clct_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); - h_rt_clct_bx_cscdet[me] = fs->make(label, label,13,-6.5, 6.5); - sprintf(label,"h_rt_lct_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); - h_rt_lct_bx_cscdet[me] = fs->make(label, label,13,-6.5, 6.5); - sprintf(label,"h_rt_mplct_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); - h_rt_mplct_bx_cscdet[me] = fs->make(label, label,13,-6.5, 6.5); +// sprintf(label,"h_rt_alct_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); +// h_rt_alct_bx_cscdet[me] = fs->make(label, label,13,-6.5, 6.5); +// sprintf(label,"h_rt_clct_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); +// h_rt_clct_bx_cscdet[me] = fs->make(label, label,13,-6.5, 6.5); +// sprintf(label,"h_rt_lct_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); +// h_rt_lct_bx_cscdet[me] = fs->make(label, label,13,-6.5, 6.5); +// sprintf(label,"h_rt_mplct_bx_cscdet_%s",mugeo::csc_type_[me].c_str()); +// h_rt_mplct_bx_cscdet[me] = fs->make(label, label,13,-6.5, 6.5); - }//for (int me=0; memake("h_rt_lct_per_sector","h_rt_lct_per_sector",20,0., 20.); - h_rt_lct_per_sector_vs_bx = fs->make("h_rt_lct_per_sector_vs_bx","h_rt_lct_per_sector_vs_bx",20,0., 20.,16,0,16); - h_rt_mplct_per_sector = fs->make("h_rt_mplct_per_sector","h_rt_mplct_per_sector",20,0., 20.); - h_rt_mplct_per_sector_vs_bx = fs->make("h_rt_mplct_per_sector_vs_bx","h_rt_mplct_per_sector_vs_bx",20,0., 20.,16,0,16); - h_rt_lct_per_sector_vs_bx_st1t = fs->make("h_rt_lct_per_sector_vs_bx_st1t","h_rt_lct_per_sector_vs_bx_st1t",20,0., 20.,16,0,16); - h_rt_mplct_per_sector_vs_bx_st1t = fs->make("h_rt_mplct_per_sector_vs_bx_st1t","h_rt_mplct_per_sector_vs_bx_st1t",20,0., 20.,16,0,16); +// h_rt_lct_per_sector = fs->make("h_rt_lct_per_sector","h_rt_lct_per_sector",20,0., 20.); +// h_rt_lct_per_sector_vs_bx = fs->make("h_rt_lct_per_sector_vs_bx","h_rt_lct_per_sector_vs_bx",20,0., 20.,16,0,16); +// h_rt_mplct_per_sector = fs->make("h_rt_mplct_per_sector","h_rt_mplct_per_sector",20,0., 20.); +// h_rt_mplct_per_sector_vs_bx = fs->make("h_rt_mplct_per_sector_vs_bx","h_rt_mplct_per_sector_vs_bx",20,0., 20.,16,0,16); +// h_rt_lct_per_sector_vs_bx_st1t = fs->make("h_rt_lct_per_sector_vs_bx_st1t","h_rt_lct_per_sector_vs_bx_st1t",20,0., 20.,16,0,16); +// h_rt_mplct_per_sector_vs_bx_st1t = fs->make("h_rt_mplct_per_sector_vs_bx_st1t","h_rt_mplct_per_sector_vs_bx_st1t",20,0., 20.,16,0,16); - for (int i=0; imake(label, label, 51,-0.5, 50.5); +// for (int i=0; imake(label, label, 51,-0.5, 50.5); - sprintf(label,"h_rt_n_ch_clct_per_bx_st%d",i+1); - h_rt_n_ch_clct_per_bx_st[i] = fs->make(label, label, 51,-0.5, 50.5); +// sprintf(label,"h_rt_n_ch_clct_per_bx_st%d",i+1); +// h_rt_n_ch_clct_per_bx_st[i] = fs->make(label, label, 51,-0.5, 50.5); - sprintf(label,"h_rt_n_ch_lct_per_bx_st%d",i+1); - h_rt_n_ch_lct_per_bx_st[i] = fs->make(label, label, 51,-0.5, 50.5); +// sprintf(label,"h_rt_n_ch_lct_per_bx_st%d",i+1); +// h_rt_n_ch_lct_per_bx_st[i] = fs->make(label, label, 51,-0.5, 50.5); - sprintf(label,"h_rt_lct_per_sector_st%d",i+1); - h_rt_lct_per_sector_st[i] = fs->make(label, label, 20,0., 20.); +// sprintf(label,"h_rt_lct_per_sector_st%d",i+1); +// h_rt_lct_per_sector_st[i] = fs->make(label, label, 20,0., 20.); - sprintf(label,"h_rt_lct_per_sector_vs_bx_st%d",i+1); - h_rt_lct_per_sector_vs_bx_st[i] = fs->make(label, label, 20,0., 20.,16,0,16); +// sprintf(label,"h_rt_lct_per_sector_vs_bx_st%d",i+1); +// h_rt_lct_per_sector_vs_bx_st[i] = fs->make(label, label, 20,0., 20.,16,0,16); - sprintf(label,"h_rt_mplct_per_sector_st%d",i+1); - h_rt_mplct_per_sector_st[i] = fs->make(label, label, 20,0., 20.); +// sprintf(label,"h_rt_mplct_per_sector_st%d",i+1); +// h_rt_mplct_per_sector_st[i] = fs->make(label, label, 20,0., 20.); - sprintf(label,"h_rt_mplct_per_sector_vs_bx_st%d",i+1); - h_rt_mplct_per_sector_vs_bx_st[i] = fs->make(label, label, 20,0., 20.,16,0,16); +// sprintf(label,"h_rt_mplct_per_sector_vs_bx_st%d",i+1); +// h_rt_mplct_per_sector_vs_bx_st[i] = fs->make(label, label, 20,0., 20.,16,0,16); - } +// } - h_rt_mplct_pattern = fs->make("h_rt_mplct_pattern","h_rt_mplct_pattern",13,-0.5, 12.5); +// h_rt_mplct_pattern = fs->make("h_rt_mplct_pattern","h_rt_mplct_pattern",13,-0.5, 12.5); - h_gmt_mindr = fs->make("h_gmt_mindr","h_gmt_mindr",500, 0, 2*M_PI); - h_gmt_dr_maxrank = fs->make("h_gmt_dr_maxrank","h_gmt_dr_maxrank",500, 0, 2*M_PI); +// h_gmt_mindr = fs->make("h_gmt_mindr","h_gmt_mindr",500, 0, 2*M_PI); +// h_gmt_dr_maxrank = fs->make("h_gmt_dr_maxrank","h_gmt_dr_maxrank",500, 0, 2*M_PI); } @@ -547,312 +547,132 @@ GEMCSCTriggerRateTree::beginJob() void GEMCSCTriggerRateTree::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { - // ALCTs and CLCTs - edm::Handle< CSCALCTDigiCollection > halcts; - iEvent.getByLabel("simCscTriggerPrimitiveDigis", halcts); - const CSCALCTDigiCollection* alcts = halcts.product(); - edm::Handle< CSCCLCTDigiCollection > hclcts; - iEvent.getByLabel("simCscTriggerPrimitiveDigis", hclcts); - const CSCCLCTDigiCollection* clcts = hclcts.product(); - - // strip&wire matching output after TMB and after MPC sorting - edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_tmb; - edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_mpc; - iEvent.getByLabel("simCscTriggerPrimitiveDigis", lcts_tmb); - iEvent.getByLabel("simCscTriggerPrimitiveDigis", "MPCSORTED", lcts_mpc); - const CSCCorrelatedLCTDigiCollection* lcts = lcts_tmb.product(); - const CSCCorrelatedLCTDigiCollection* mplcts = lcts_mpc.product(); + analyzeALCTRate(iEvent); + analyzeCLCTRate(iEvent); + analyzeLCTRate(iEvent); + analyzeMPCLCTRate(iEvent); + analyzeTFTrackRate(iEvent); + analyzeTFCandRate(iEvent); + analyzeGMTCandRate(iEvent); + + +// // strip&wire matching output after TMB and after MPC sorting +// edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_tmb; +// edm::Handle< CSCCorrelatedLCTDigiCollection > lcts_mpc; +// iEvent.getByLabel("simCscTriggerPrimitiveDigis", lcts_tmb); +// iEvent.getByLabel("simCscTriggerPrimitiveDigis", "MPCSORTED", lcts_mpc); +// const CSCCorrelatedLCTDigiCollection* lcts = lcts_tmb.product(); +// const CSCCorrelatedLCTDigiCollection* mplcts = lcts_mpc.product(); - // DT primitives for input to TF - edm::Handle dttrig; - iEvent.getByLabel("simDtTriggerPrimitiveDigis", dttrig); - const L1MuDTChambPhContainer* dttrigs = dttrig.product(); - - // tracks produced by TF - edm::Handle< L1CSCTrackCollection > hl1Tracks; - iEvent.getByLabel("simCsctfTrackDigis",hl1Tracks); - const L1CSCTrackCollection* l1Tracks = hl1Tracks.product(); - - // L1 muon candidates after CSC sorter - edm::Handle< std::vector< L1MuRegionalCand > > hl1TfCands; - iEvent.getByLabel("simCsctfDigis", "CSC", hl1TfCands); - const std::vector< L1MuRegionalCand > *l1TfCands = hl1TfCands.product(); - - // GMT readout collection - edm::Handle< L1MuGMTReadoutCollection > hl1GmtCands; - iEvent.getByLabel("simGmtDigis", hl1GmtCands ) ;// InputTag("simCsctfDigis","CSC") - - //const L1MuGMTReadoutCollection* l1GmtCands = hl1GmtCands.product(); - std::vector l1GmtCands; - std::vector l1GmtfCands; - std::vector l1GmtCSCCands; - std::vector l1GmtRPCfCands; - std::vector l1GmtRPCbCands; - std::vector l1GmtDTCands; - - // key = BX - std::map > l1GmtCSCCandsInBXs; - - // TOCHECK - if ( centralBxOnlyGMT_ ) - { - // Get GMT candidates from central bunch crossing only - l1GmtCands = hl1GmtCands->getRecord().getGMTCands() ; - l1GmtfCands = hl1GmtCands->getRecord().getGMTFwdCands() ; - l1GmtCSCCands = hl1GmtCands->getRecord().getCSCCands() ; - l1GmtRPCfCands = hl1GmtCands->getRecord().getFwdRPCCands() ; - l1GmtRPCbCands = hl1GmtCands->getRecord().getBrlRPCCands() ; - l1GmtDTCands = hl1GmtCands->getRecord().getDTBXCands() ; - l1GmtCSCCandsInBXs[hl1GmtCands->getRecord().getBxInEvent()] = l1GmtCSCCands; - } - else - { - // Get GMT candidates from all bunch crossings - std::vector gmt_records = hl1GmtCands->getRecords(); - for ( std::vector< L1MuGMTReadoutRecord >::const_iterator rItr=gmt_records.begin(); rItr!=gmt_records.end() ; ++rItr ) - { - if (rItr->getBxInEvent() < minBxGMT_ || rItr->getBxInEvent() > maxBxGMT_) continue; +// // DT primitives for input to TF +// edm::Handle dttrig; +// iEvent.getByLabel("simDtTriggerPrimitiveDigis", dttrig); +// const L1MuDTChambPhContainer* dttrigs = dttrig.product(); + +// // tracks produced by TF +// edm::Handle< L1CSCTrackCollection > hl1Tracks; +// iEvent.getByLabel("simCsctfTrackDigis",hl1Tracks); +// const L1CSCTrackCollection* l1Tracks = hl1Tracks.product(); + +// // L1 muon candidates after CSC sorter +// edm::Handle< std::vector< L1MuRegionalCand > > hl1TfCands; +// iEvent.getByLabel("simCsctfDigis", "CSC", hl1TfCands); +// const std::vector< L1MuRegionalCand > *l1TfCands = hl1TfCands.product(); + +// // GMT readout collection +// edm::Handle< L1MuGMTReadoutCollection > hl1GmtCands; +// iEvent.getByLabel("simGmtDigis", hl1GmtCands ) ;// InputTag("simCsctfDigis","CSC") + +// //const L1MuGMTReadoutCollection* l1GmtCands = hl1GmtCands.product(); +// std::vector l1GmtCands; +// std::vector l1GmtfCands; +// std::vector l1GmtCSCCands; +// std::vector l1GmtRPCfCands; +// std::vector l1GmtRPCbCands; +// std::vector l1GmtDTCands; + +// // key = BX +// std::map > l1GmtCSCCandsInBXs; + +// // TOCHECK +// if ( centralBxOnlyGMT_ ) +// { +// // Get GMT candidates from central bunch crossing only +// l1GmtCands = hl1GmtCands->getRecord().getGMTCands() ; +// l1GmtfCands = hl1GmtCands->getRecord().getGMTFwdCands() ; +// l1GmtCSCCands = hl1GmtCands->getRecord().getCSCCands() ; +// l1GmtRPCfCands = hl1GmtCands->getRecord().getFwdRPCCands() ; +// l1GmtRPCbCands = hl1GmtCands->getRecord().getBrlRPCCands() ; +// l1GmtDTCands = hl1GmtCands->getRecord().getDTBXCands() ; +// l1GmtCSCCandsInBXs[hl1GmtCands->getRecord().getBxInEvent()] = l1GmtCSCCands; +// } +// else +// { +// // Get GMT candidates from all bunch crossings +// std::vector gmt_records = hl1GmtCands->getRecords(); +// for ( std::vector< L1MuGMTReadoutRecord >::const_iterator rItr=gmt_records.begin(); rItr!=gmt_records.end() ; ++rItr ) +// { +// if (rItr->getBxInEvent() < minBxGMT_ || rItr->getBxInEvent() > maxBxGMT_) continue; - std::vector GMTCands = rItr->getGMTCands(); - for ( std::vector::const_iterator cItr = GMTCands.begin() ; cItr != GMTCands.end() ; ++cItr ) - if (!cItr->empty()) l1GmtCands.push_back(*cItr); +// std::vector GMTCands = rItr->getGMTCands(); +// for ( std::vector::const_iterator cItr = GMTCands.begin() ; cItr != GMTCands.end() ; ++cItr ) +// if (!cItr->empty()) l1GmtCands.push_back(*cItr); - std::vector GMTfCands = rItr->getGMTFwdCands(); - for ( std::vector::const_iterator cItr = GMTfCands.begin() ; cItr != GMTfCands.end() ; ++cItr ) - if (!cItr->empty()) l1GmtfCands.push_back(*cItr); +// std::vector GMTfCands = rItr->getGMTFwdCands(); +// for ( std::vector::const_iterator cItr = GMTfCands.begin() ; cItr != GMTfCands.end() ; ++cItr ) +// if (!cItr->empty()) l1GmtfCands.push_back(*cItr); - //std::cout<<" ggg: "< CSCCands = rItr->getCSCCands(); - l1GmtCSCCandsInBXs[rItr->getBxInEvent()] = CSCCands; - for ( std::vector::const_iterator cItr = CSCCands.begin() ; cItr != CSCCands.end() ; ++cItr ) - if (!cItr->empty()) l1GmtCSCCands.push_back(*cItr); +// std::vector CSCCands = rItr->getCSCCands(); +// l1GmtCSCCandsInBXs[rItr->getBxInEvent()] = CSCCands; +// for ( std::vector::const_iterator cItr = CSCCands.begin() ; cItr != CSCCands.end() ; ++cItr ) +// if (!cItr->empty()) l1GmtCSCCands.push_back(*cItr); - std::vector RPCfCands = rItr->getFwdRPCCands(); - for ( std::vector::const_iterator cItr = RPCfCands.begin() ; cItr != RPCfCands.end() ; ++cItr ) - if (!cItr->empty()) l1GmtRPCfCands.push_back(*cItr); +// std::vector RPCfCands = rItr->getFwdRPCCands(); +// for ( std::vector::const_iterator cItr = RPCfCands.begin() ; cItr != RPCfCands.end() ; ++cItr ) +// if (!cItr->empty()) l1GmtRPCfCands.push_back(*cItr); - std::vector RPCbCands = rItr->getBrlRPCCands(); - for ( std::vector::const_iterator cItr = RPCbCands.begin() ; cItr != RPCbCands.end() ; ++cItr ) - if (!cItr->empty()) l1GmtRPCbCands.push_back(*cItr); +// std::vector RPCbCands = rItr->getBrlRPCCands(); +// for ( std::vector::const_iterator cItr = RPCbCands.begin() ; cItr != RPCbCands.end() ; ++cItr ) +// if (!cItr->empty()) l1GmtRPCbCands.push_back(*cItr); - std::vector DTCands = rItr->getDTBXCands(); - for ( std::vector::const_iterator cItr = DTCands.begin() ; cItr != DTCands.end() ; ++cItr ) - if (!cItr->empty()) l1GmtDTCands.push_back(*cItr); - } - //std::cout<<" sizes: "< DTCands = rItr->getDTBXCands(); +// for ( std::vector::const_iterator cItr = DTCands.begin() ; cItr != DTCands.end() ; ++cItr ) +// if (!cItr->empty()) l1GmtDTCands.push_back(*cItr); +// } +// //std::cout<<" sizes: "<().cacheIdentifier() != muScalesCacheID_ || - iSetup.get< L1MuTriggerPtScaleRcd >().cacheIdentifier() != muPtScaleCacheID_ ) - { - iSetup.get< L1MuTriggerScalesRcd >().get( muScales ); +// // does the trigger sccale need to be defined in the beginrun or analyze method? +// if (iSetup.get< L1MuTriggerScalesRcd >().cacheIdentifier() != muScalesCacheID_ || +// iSetup.get< L1MuTriggerPtScaleRcd >().cacheIdentifier() != muPtScaleCacheID_ ) +// { +// iSetup.get< L1MuTriggerScalesRcd >().get( muScales ); - iSetup.get< L1MuTriggerPtScaleRcd >().get( muPtScale ); +// iSetup.get< L1MuTriggerPtScaleRcd >().get( muPtScale ); - if (ptLUT) delete ptLUT; - ptLUT = new CSCTFPtLUT(ptLUTset, muScales.product(), muPtScale.product()); +// if (ptLUT) delete ptLUT; +// ptLUT = new CSCTFPtLUT(ptLUTset, muScales.product(), muPtScale.product()); - for(int e=0; e<2; e++) for (int s=0; s<6; s++){ - if (my_SPs[e][s]) delete my_SPs[e][s]; - my_SPs[e][s] = new CSCTFSectorProcessor(e+1, s+1, CSCTFSPset, true, muScales.product(), muPtScale.product()); - my_SPs[e][s]->initialize(iSetup); - } - muScalesCacheID_ = iSetup.get< L1MuTriggerScalesRcd >().cacheIdentifier(); - muPtScaleCacheID_ = iSetup.get< L1MuTriggerPtScaleRcd >().cacheIdentifier(); - } +// for(int e=0; e<2; e++) for (int s=0; s<6; s++){ +// if (my_SPs[e][s]) delete my_SPs[e][s]; +// my_SPs[e][s] = new CSCTFSectorProcessor(e+1, s+1, CSCTFSPset, true, muScales.product(), muPtScale.product()); +// my_SPs[e][s]->initialize(iSetup); +// } +// muScalesCacheID_ = iSetup.get< L1MuTriggerScalesRcd >().cacheIdentifier(); +// muPtScaleCacheID_ = iSetup.get< L1MuTriggerPtScaleRcd >().cacheIdentifier(); +// } // //======================================================================= // //============================= RATES =================================== -// analyzeALCTRate(iEvent); -// analyzeCLCTRate(iEvent); -// analyzeLCTRate(iEvent); -// analyzeMPLCTRate(iEvent); -// analyzeTFTrackRate(iEvent); -// analyzeTFCandRate(iEvent); -// analyzeGMTCandRate(iEvent); - - - //============ RATE ALCT ================== - int nalct=0; - int nalct_per_bx[16]; - int n_ch_alct_per_bx[16]; - int n_ch_alct_per_bx_st[MAX_STATIONS][16]; - int n_ch_alct_per_bx_cscdet[CSC_TYPES+1][16]; - for (int b=0;b<16;b++) - { - nalct_per_bx[b] = n_ch_alct_per_bx[b] = 0; - for (int s=0; s > me11alcts; - for (CSCALCTDigiCollection::DigiRangeIterator adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); adetUnitIt++) - { - const CSCDetId& id = (*adetUnitIt).first; - //if (id.endcap() != 1) continue; - CSCDetId idd(id.rawId()); - int csct = getCSCType( idd ); - int cscst = getCSCSpecsType( idd ); - //int is11 = isME11(csct); - int nalct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - const CSCALCTDigiCollection::Range& range = (*adetUnitIt).second; - for (CSCALCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) - { - if ((*digiIt).isValid()) - { - int bx = (*digiIt).getBX(); - //if ( bx-6 < minBX_ || bx-6 > maxBX_ ) - if ( bx < minBxALCT_ || bx > maxBxALCT_ ) - { - if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill( bx - 6 ); - h_rt_alct_bx_cscdet[csct]->Fill( bx - 6 ); - if (bx>=5 && bx<=7) h_rt_csctype_alct_bx567->Fill(cscst); - - } //if (alct_valid) - } - for (int b=0;b<16;b++) - { - if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; - h_rt_n_per_ch_alct_vs_bx_cscdet[csct]->Fill(nalct_per_ch_bx[b],b); - if (nalct_per_ch_bx[b]>0) - { - ++n_ch_alct_per_bx[b]; - ++n_ch_alct_per_bx_st[id.station()-1][b]; - ++n_ch_alct_per_bx_cscdet[csct][b]; - } - } - } // loop CSCALCTDigiCollection - //std::map< CSCDetId , std::vector >::const_iterator mapIt = me11alcts.begin(); - //for (;mapIt != me11alcts.end(); mapIt++){} - std::map< int , std::vector >::const_iterator aMapIt = me11alcts.begin(); - for (;aMapIt != me11alcts.end(); aMapIt++) - { - CSCDetId id(aMapIt->first); - int nalct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - for (size_t i=0; i<(aMapIt->second).size(); i++) - { - int bx = (aMapIt->second)[i]->getBX(); - ++nalct_per_ch_bx[bx]; - } - for (int b=0;b<16;b++) - { - if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; - h_rt_n_per_ch_alct_vs_bx_cscdet[10]->Fill(nalct_per_ch_bx[b],b); - if (nalct_per_ch_bx[b]>0) ++n_ch_alct_per_bx_cscdet[10][b]; - } - } - h_rt_nalct->Fill(nalct); - for (int b=0;b<16;b++) - { - if (b < minBxALCT_ || b > maxBxALCT_) continue; - h_rt_nalct_vs_bx->Fill(nalct_per_bx[b],b); - h_rt_nalct_per_bx->Fill(nalct_per_bx[b]); - h_rt_n_ch_alct_per_bx->Fill(n_ch_alct_per_bx[b]); - for (int s=0; sFill(n_ch_alct_per_bx_st[s][b]); - for (int me=0; me<=CSC_TYPES; me++) - h_rt_n_ch_alct_per_bx_cscdet[me]->Fill(n_ch_alct_per_bx_cscdet[me][b]); - } - - if (debugRATE) std::cout<< "----- end nalct="< > detCLCT; - detCLCT.clear(); - int nclct=0; - int nclct_per_bx[16]; - int n_ch_clct_per_bx[16]; - int n_ch_clct_per_bx_st[MAX_STATIONS][16]; - int n_ch_clct_per_bx_cscdet[CSC_TYPES+1][16]; - for (int b=0;b<16;b++) - { - nclct_per_bx[b] = n_ch_clct_per_bx[b] = 0; - for (int s=0; sbegin(); cdetUnitIt != clcts->end(); cdetUnitIt++) - { - const CSCDetId& id = (*cdetUnitIt).first; - //if (id.endcap() != 1) continue; - CSCDetId idd(id.rawId()); - int csct = getCSCType( idd ); - int cscst = getCSCSpecsType( idd ); - int nclct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - const CSCCLCTDigiCollection::Range& range = (*cdetUnitIt).second; - for (CSCCLCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) - { - if ((*digiIt).isValid()) - { - // detCLCT[id.rawId()].push_back(*digiIt); - int bx = (*digiIt).getBX(); - //if ( bx-5 < minBX_ || bx-7 > maxBX_ ) - if ( bx < minBxCLCT_ || bx > maxBxCLCT_ ) - { - if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill( bx - 6 ); - h_rt_clct_bx_cscdet[csct]->Fill( bx - 6 ); - if (bx>=5 && bx<=7) h_rt_csctype_clct_bx567->Fill(cscst); - } //if (clct_valid) - } - for (int b=0;b<16;b++) - { - if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; - h_rt_n_per_ch_clct_vs_bx_cscdet[csct]->Fill(nclct_per_ch_bx[b],b); - if (nclct_per_ch_bx[b]>0) { - ++n_ch_clct_per_bx[b]; - ++n_ch_clct_per_bx_st[id.station()-1][b]; - ++n_ch_clct_per_bx_cscdet[csct][b]; - } - } - } // loop CSCCLCTDigiCollection - h_rt_nclct->Fill(nclct); - for (int b=0;b<16;b++) { - if (b < minBxALCT_ || b > maxBxALCT_) continue; - h_rt_nclct_vs_bx->Fill(nclct_per_bx[b],b); - h_rt_nclct_per_bx->Fill(nclct_per_bx[b]); - h_rt_n_ch_clct_per_bx->Fill(n_ch_clct_per_bx[b]); - for (int s=0; sFill(n_ch_clct_per_bx_st[s][b]); - for (int me=0; me<=CSC_TYPES; me++) - h_rt_n_ch_clct_per_bx_cscdet[me]->Fill(n_ch_clct_per_bx_cscdet[me][b]); - } - if (debugRATE) std::cout<< "----- end nclct="<pt_packed()<<" "<eta_packed()<<" "<phi_packed()<<" "<bx()<bx()<pt; double tfeta = myTFCand.tftrack->eta; @@ -1266,7 +1086,7 @@ GEMCSCTriggerRateTree::analyze(const edm::Event& iEvent, const edm::EventSetup& h_rt_tfcand_pt_vs_eta_3st1a->Fill(tfpt,tfeta); } } - //else std::cout<<"Strange: myTFCand.tftrack != NULL"<Fill(ntfcand); h_rt_ntfcand_pt10->Fill(ntfcandpt10); @@ -1330,7 +1150,7 @@ GEMCSCTriggerRateTree::analyze(const edm::Event& iEvent, const edm::EventSetup& myGMTREGCand.init( &*trk , muScales, muPtScale); myGMTREGCand.dr = 999.; - myGMTREGCand.tfcand = NULL; + myGMTREGCand.tfcand = nullptr; for (unsigned i=0; i< rtTFCands.size(); i++) { if ( trk->bx() != rtTFCands[i].l1cand->bx() || @@ -1354,11 +1174,11 @@ GEMCSCTriggerRateTree::analyze(const edm::Event& iEvent, const edm::EventSetup& bool has_me1_stub = false; size_t n_stubs = 0; - if (myGMTREGCand.tfcand != NULL) + if (myGMTREGCand.tfcand != nullptr) { //rtGMTREGCands.push_back(myGMTREGCand); - if (myGMTREGCand.tfcand->tftrack != NULL) + if (myGMTREGCand.tfcand->tftrack != nullptr) { has_me1_stub = myGMTREGCand.tfcand->tftrack->hasStub(1); } @@ -1405,8 +1225,8 @@ GEMCSCTriggerRateTree::analyze(const edm::Event& iEvent, const edm::EventSetup& if (eta_me42) h_rt_gmt_csc_pt_2s42->Fill(gpt); if (eta_me42r) h_rt_gmt_csc_pt_2s42r->Fill(gpt); if ( gpt > max_pt_2s ) { max_pt_2s = gpt; max_pt_2s_eta = geta; } - if (eta_me1b && gpt > max_pt_2s_1b ) { max_pt_2s_1b = gpt; /*max_pt_2s_eta_1b = geta;*/ } - if (eta_no1a && gpt > max_pt_2s_no1a) { max_pt_2s_no1a = gpt; /*max_pt_2s_eta_no1a = geta;*/ } + if (eta_me1b && gpt > max_pt_2s_1b ) { max_pt_2s_1b = gpt; max_pt_2s_eta_1b = geta; } + if (eta_no1a && gpt > max_pt_2s_no1a) { max_pt_2s_no1a = gpt; max_pt_2s_eta_no1a = geta; } if (eta_me42 && gpt > max_pt_me42_2s) max_pt_me42_2s = gpt; if (eta_me42r && gpt>max_pt_me42r_2s) max_pt_me42r_2s = gpt; } @@ -1500,7 +1320,7 @@ GEMCSCTriggerRateTree::analyze(const edm::Event& iEvent, const edm::EventSetup& //if (trk->quality()>=3 && !(myGMTREGCand.ids.size()>=3) ) { // std::cout<<"weird stubs number "<tftrack != nullptr) myGMTREGCand.tfcand->tftrack->print(""); // else std::cout<<"null tftrack!"<isFwd() && ( muItr->isMatchedCand() || !muItr->isRPC())) { L1MuRegionalCand rcsc = CSCCands[muItr->getDTCSCIndex()]; @@ -1856,7 +1676,7 @@ GEMCSCTriggerRateTree::analyze(const edm::Event& iEvent, const edm::EventSetup& myGMTCand.ids = gmt_csc->ids; } - MatchCSCMuL1::GMTREGCAND * gmt_rpcf = NULL; + MatchCSCMuL1::GMTREGCAND * gmt_rpcf = nullptr; if (muItr->isFwd() && (muItr->isMatchedCand() || muItr->isRPC())) { L1MuRegionalCand rrpcf = RPCfCands[muItr->getRPCIndex()]; @@ -1872,7 +1692,7 @@ GEMCSCTriggerRateTree::analyze(const edm::Event& iEvent, const edm::EventSetup& myGMTCand.regcand_rpc = gmt_rpcf; } - MatchCSCMuL1::GMTREGCAND * gmt_rpcb = NULL; + MatchCSCMuL1::GMTREGCAND * gmt_rpcb = nullptr; if (!(muItr->isFwd()) && (muItr->isMatchedCand() || muItr->isRPC())) { L1MuRegionalCand rrpcb = RPCbCands[muItr->getRPCIndex()]; @@ -1888,7 +1708,7 @@ GEMCSCTriggerRateTree::analyze(const edm::Event& iEvent, const edm::EventSetup& myGMTCand.regcand_rpc = gmt_rpcb; } - MatchCSCMuL1::GMTREGCAND * gmt_dt = NULL; + MatchCSCMuL1::GMTREGCAND * gmt_dt = nullptr; if (!(muItr->isFwd()) && (muItr->isMatchedCand() || !(muItr->isRPC()))) { L1MuRegionalCand rdt = DTCands[muItr->getDTCSCIndex()]; @@ -1904,7 +1724,7 @@ GEMCSCTriggerRateTree::analyze(const edm::Event& iEvent, const edm::EventSetup& myGMTCand.regcand = gmt_dt; } - if ( (gmt_csc != NULL && gmt_rpcf != NULL) && !muItr->isMatchedCand() ) std::cout<<"csc&rpcf but not matched!"<isMatchedCand() ) std::cout<<"csc&rpcf but not matched!"<quality()<3) continue; // not good for neither single nor dimuon triggers - bool isCSC = (gmt_csc != NULL); - bool isDT = (gmt_dt != NULL); - bool isRPCf = (gmt_rpcf != NULL); - bool isRPCb = (gmt_rpcb != NULL); + bool isCSC = (gmt_csc != nullptr); + bool isDT = (gmt_dt != nullptr); + bool isRPCf = (gmt_rpcf != nullptr); + bool isRPCb = (gmt_rpcb != nullptr); - if (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack == NULL) std::cout<<"warning: gmt_csc->tfcand->tftrack == NULL"<tfcand != NULL && gmt_csc->tfcand->tftrack != NULL && gmt_csc->tfcand->tftrack->l1trk == NULL) - std::cout<<"warning: gmt_csc->tfcand->tftrack->l1trk == NULL"<tfcand != NULL && myGMTCand.ids.size()>=2); - //bool isCSC3s = (isCSC && gmt_csc->tfcand != NULL && myGMTCand.ids.size()>=3); - bool isCSC2s = (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack != NULL && gmt_csc->tfcand->tftrack->nStubs()>=2); - bool isCSC3s = (isCSC && gmt_csc->tfcand != NULL && gmt_csc->tfcand->tftrack != NULL + if (isCSC && gmt_csc->tfcand != nullptr && gmt_csc->tfcand->tftrack == nullptr) std::cout<<"warning: gmt_csc->tfcand->tftrack == nullptr"<tfcand != nullptr && gmt_csc->tfcand->tftrack != nullptr && gmt_csc->tfcand->tftrack->l1trk == nullptr) + std::cout<<"warning: gmt_csc->tfcand->tftrack->l1trk == nullptr"<tfcand != nullptr && myGMTCand.ids.size()>=2); + //bool isCSC3s = (isCSC && gmt_csc->tfcand != nullptr && myGMTCand.ids.size()>=3); + bool isCSC2s = (isCSC && gmt_csc->tfcand != nullptr && gmt_csc->tfcand->tftrack != nullptr && gmt_csc->tfcand->tftrack->nStubs()>=2); + bool isCSC3s = (isCSC && gmt_csc->tfcand != nullptr && gmt_csc->tfcand->tftrack != nullptr && ( (!eta_q && isCSC2s) || (eta_q && gmt_csc->tfcand->tftrack->nStubs()>=3) ) ); - bool isCSC2q = (isCSC && gmt_csc->l1reg != NULL && gmt_csc->l1reg->quality()>=2); - bool isCSC3q = (isCSC && gmt_csc->l1reg != NULL + bool isCSC2q = (isCSC && gmt_csc->l1reg != nullptr && gmt_csc->l1reg->quality()>=2); + bool isCSC3q = (isCSC && gmt_csc->l1reg != nullptr && ( (!eta_q && isCSC2q) || (eta_q && gmt_csc->l1reg->quality()>=3) ) ); myGMTCand.isCSC = isCSC; @@ -2045,18 +1865,18 @@ GEMCSCTriggerRateTree::analyze(const edm::Event& iEvent, const edm::EventSetup& if (isCSC && gpt > max_pt_sing_csc ) { max_pt_sing_csc = gpt; max_pt_eta_sing_csc = geta; } if ((isCSC||isDT) && gpt > max_pt_sing_dtcsc ) { max_pt_sing_dtcsc = gpt; max_pt_eta_sing_dtcsc = geta; } if (gpt > max_pt_sing_3s && ( !isCSC || isCSC3s ) ) {max_pt_sing_3s = gpt; max_pt_eta_sing_3s = geta;} - if (eta_me1b && gpt > max_pt_sing_1b ) { max_pt_sing_1b = gpt; /*max_pt_eta_sing_1b = geta;*/ } - if (eta_no1a && gpt > max_pt_sing_no1a) { max_pt_sing_no1a = gpt; /*max_pt_eta_sing_no1a = geta;*/ } + if (eta_me1b && gpt > max_pt_sing_1b ) { max_pt_sing_1b = gpt; max_pt_eta_sing_1b = geta; } + if (eta_no1a && gpt > max_pt_sing_no1a) { max_pt_sing_no1a = gpt; max_pt_eta_sing_no1a = geta; } } if (isSingle6TrigOk) { if ( gpt > max_pt_sing6 ) { max_pt_sing6 = gpt; max_pt_eta_sing6 = geta;} if (isCSC && gpt > max_pt_sing6_csc ) { max_pt_sing6_csc = gpt; max_pt_eta_sing6_csc = geta; } if (gpt > max_pt_sing6_3s && ( !isCSC || isCSC3s ) ) {max_pt_sing6_3s = gpt; max_pt_eta_sing6_3s = geta;} - if (eta_me1b && gpt > max_pt_sing6_1b ) { max_pt_sing6_1b = gpt; /*max_pt_eta_sing6_1b = geta;*/ } - if (eta_no1a && gpt > max_pt_sing6_no1a) { max_pt_sing6_no1a = gpt; /*max_pt_eta_sing6_no1a = geta;*/ } + if (eta_me1b && gpt > max_pt_sing6_1b ) { max_pt_sing6_1b = gpt; max_pt_eta_sing6_1b = geta; } + if (eta_no1a && gpt > max_pt_sing6_no1a) { max_pt_sing6_no1a = gpt; max_pt_eta_sing6_no1a = geta; } if (eta_no1a && gpt > max_pt_sing6_3s1b_no1a && - (!eta_me1b || (eta_me1b && has_me1_stub && n_stubs >=3) ) ) { max_pt_sing6_3s1b_no1a = gpt; /*max_pt_eta_sing6_no1a = geta;*/ } + (!eta_me1b || (eta_me1b && has_me1_stub && n_stubs >=3) ) ) { max_pt_sing6_3s1b_no1a = gpt; max_pt_eta_sing6_no1a = geta; } } } } @@ -2116,26 +1936,31 @@ GEMCSCTriggerRateTree::analyze(const edm::Event& iEvent, const edm::EventSetup& if (max_pt_dbl>=10.) h_rt_gmt_ptmax10_eta_dbl->Fill(max_pt_eta_dbl); if (max_pt_dbl>=20.) h_rt_gmt_ptmax20_eta_dbl->Fill(max_pt_eta_dbl); if (debugRATE) std::cout<< "----- end ngmt="< fs; -// alct_tree_ = fs->make("ALCTs", "ALCTs"); -// alct_tree_->Branch("charge",&alct_.nlayers); -// alct_tree_->Branch("pt",&alct_.pt); -// alct_tree_->Branch("eta",&alct_.eta); -// alct_tree_->Branch("phi",&alct_.phi); -// alct_tree_->Branch("endcap",&alct_.bx); - // alct_tree_->Branch("gem_sh_layer1",&alct_.); + edm::Service< TFileService > fs; + alct_tree_ = fs->make("ALCTs", "ALCTs"); + alct_tree_->Branch("event",&alct_.event); + alct_tree_->Branch("bx",&alct_.bx); + alct_tree_->Branch("station",&alct_.station); + alct_tree_->Branch("detId",&alct_.detId); } // ================================================================================================ void GEMCSCTriggerRateTree::bookCLCTTree() { + edm::Service< TFileService > fs; + clct_tree_ = fs->make("CLCTs", "CLCTs"); + clct_tree_->Branch("event",&clct_.event); + clct_tree_->Branch("bx",&clct_.bx); + clct_tree_->Branch("station",&clct_.station); + clct_tree_->Branch("detId",&clct_.detId); } // ================================================================================================ @@ -2178,12 +2003,228 @@ GEMCSCTriggerRateTree::bookGMTCandTree() void GEMCSCTriggerRateTree::analyzeALCTRate(const edm::Event& iEvent) { + edm::Handle< CSCALCTDigiCollection > halcts; + iEvent.getByLabel("simCscTriggerPrimitiveDigis", halcts); + const CSCALCTDigiCollection* alcts = halcts.product(); + + // Loop on all ALCTs + for (CSCALCTDigiCollection::DigiRangeIterator adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); ++adetUnitIt) + { + CSCDetId detId((*adetUnitIt).first); + if (detId.endcap() != 1) continue; + auto range = (*adetUnitIt).second; + // loop on all ALCTs in that detId + for (CSCALCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; ++digiIt) + { + const int bx((*digiIt).getBX()); + if (bx < minBxALCT_ || bx > maxBxALCT_) + { + if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill(); + } + } + +// int nalct=0; +// int nalct_per_bx[16]; +// int n_ch_alct_per_bx[16]; +// int n_ch_alct_per_bx_st[MAX_STATIONS][16]; +// int n_ch_alct_per_bx_cscdet[CSC_TYPES+1][16]; +// for (int b=0;b<16;b++) +// { +// nalct_per_bx[b] = n_ch_alct_per_bx[b] = 0; +// for (int s=0; s > me11alcts; +// for (CSCALCTDigiCollection::DigiRangeIterator adetUnitIt = alcts->begin(); adetUnitIt != alcts->end(); adetUnitIt++) +// { +// const CSCDetId& id = (*adetUnitIt).first; +// //if (id.endcap() != 1) continue; +// CSCDetId idd(id.rawId()); +// int csct = getCSCType( idd ); +// // int cscst = getCSCSpecsType( idd ); +// //int is11 = isME11(csct); +// int nalct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; +// const CSCALCTDigiCollection::Range& range = (*adetUnitIt).second; +// for (CSCALCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) +// { +// if ((*digiIt).isValid()) +// { +// int bx = (*digiIt).getBX(); +// //if ( bx-6 < minBX_ || bx-6 > maxBX_ ) +// if ( bx < minBxALCT_ || bx > maxBxALCT_ ) +// { +// if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill( bx - 6 ); +// // h_rt_alct_bx_cscdet[csct]->Fill( bx - 6 ); +// // if (bx>=5 && bx<=7) h_rt_csctype_alct_bx567->Fill(cscst); + +// } //if (alct_valid) +// } +// for (int b=0;b<16;b++) +// { +// if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; +// // h_rt_n_per_ch_alct_vs_bx_cscdet[csct]->Fill(nalct_per_ch_bx[b],b); +// if (nalct_per_ch_bx[b]>0) +// { +// ++n_ch_alct_per_bx[b]; +// ++n_ch_alct_per_bx_st[id.station()-1][b]; +// ++n_ch_alct_per_bx_cscdet[csct][b]; +// } +// } +// } // loop CSCALCTDigiCollection +// //std::map< CSCDetId , std::vector >::const_iterator mapIt = me11alcts.begin(); +// //for (;mapIt != me11alcts.end(); mapIt++){} +// std::map< int , std::vector >::const_iterator aMapIt = me11alcts.begin(); +// for (;aMapIt != me11alcts.end(); aMapIt++) +// { +// CSCDetId id(aMapIt->first); +// int nalct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; +// for (size_t i=0; i<(aMapIt->second).size(); i++) +// { +// int bx = (aMapIt->second)[i]->getBX(); +// ++nalct_per_ch_bx[bx]; +// } +// for (int b=0;b<16;b++) +// { +// if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; +// // h_rt_n_per_ch_alct_vs_bx_cscdet[10]->Fill(nalct_per_ch_bx[b],b); +// if (nalct_per_ch_bx[b]>0) ++n_ch_alct_per_bx_cscdet[10][b]; +// } +// } +// // h_rt_nalct->Fill(nalct); +// for (int b=0;b<16;b++) +// { +// if (b < minBxALCT_ || b > maxBxALCT_) continue; +// // h_rt_nalct_vs_bx->Fill(nalct_per_bx[b],b); +// // h_rt_nalct_per_bx->Fill(nalct_per_bx[b]); +// // h_rt_n_ch_alct_per_bx->Fill(n_ch_alct_per_bx[b]); +// // for (int s=0; sFill(n_ch_alct_per_bx_st[s][b]); +// // for (int me=0; me<=CSC_TYPES; me++) +// // h_rt_n_ch_alct_per_bx_cscdet[me]->Fill(n_ch_alct_per_bx_cscdet[me][b]); +// } + } // ================================================================================================ void GEMCSCTriggerRateTree::analyzeCLCTRate(const edm::Event& iEvent) { + edm::Handle< CSCCLCTDigiCollection > hclcts; + iEvent.getByLabel("simCscTriggerPrimitiveDigis", hclcts); + const CSCCLCTDigiCollection* clcts = hclcts.product(); + + // Loop on all CLCTs + for (CSCCLCTDigiCollection::DigiRangeIterator adetUnitIt = clcts->begin(); adetUnitIt != clcts->end(); ++adetUnitIt) + { + CSCDetId detId((*adetUnitIt).first); + if (detId.endcap() != 1) continue; + auto range = (*adetUnitIt).second; + // loop on all CLCTs in that detId + for (CSCCLCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; ++digiIt) + { + const int bx((*digiIt).getBX()); + if (bx < minBxCLCT_ || bx > maxBxCLCT_) + { + if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill(); + } + } + +// std::map > detCLCT; +// detCLCT.clear(); +// int nclct=0; +// int nclct_per_bx[16]; +// int n_ch_clct_per_bx[16]; +// int n_ch_clct_per_bx_st[MAX_STATIONS][16]; +// int n_ch_clct_per_bx_cscdet[CSC_TYPES+1][16]; +// for (CSCCLCTDigiCollection::DigiRangeIterator cdetUnitIt = clcts->begin(); cdetUnitIt != clcts->end(); cdetUnitIt++) +// { +// const CSCDetId& id = (*cdetUnitIt).first; +// //if (id.endcap() != 1) continue; +// CSCDetId idd(id.rawId()); +// int csct = getCSCType( idd ); +// int cscst = getCSCSpecsType( idd ); +// int nclct_per_ch_bx[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; +// const CSCCLCTDigiCollection::Range& range = (*cdetUnitIt).second; +// for (CSCCLCTDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; digiIt++) +// { +// if ((*digiIt).isValid()) +// { +// // detCLCT[id.rawId()].push_back(*digiIt); +// int bx = (*digiIt).getBX(); +// //if ( bx-5 < minBX_ || bx-7 > maxBX_ ) +// if ( bx < minBxCLCT_ || bx > maxBxCLCT_ ) +// { +// if (debugRATE) std::cout<<"discarding BX = "<< bx-6 <Fill( bx - 6 ); +// h_rt_clct_bx_cscdet[csct]->Fill( bx - 6 ); +// if (bx>=5 && bx<=7) h_rt_csctype_clct_bx567->Fill(cscst); +// } //if (clct_valid) +// } +// for (int b=0;b<16;b++) +// { +// if ( b < minBxALCT_ || b > maxBxALCT_ ) continue; +// h_rt_n_per_ch_clct_vs_bx_cscdet[csct]->Fill(nclct_per_ch_bx[b],b); +// if (nclct_per_ch_bx[b]>0) { +// ++n_ch_clct_per_bx[b]; +// ++n_ch_clct_per_bx_st[id.station()-1][b]; +// ++n_ch_clct_per_bx_cscdet[csct][b]; +// } +// } +// } // loop CSCCLCTDigiCollection +// h_rt_nclct->Fill(nclct); +// for (int b=0;b<16;b++) { +// if (b < minBxALCT_ || b > maxBxALCT_) continue; +// h_rt_nclct_vs_bx->Fill(nclct_per_bx[b],b); +// h_rt_nclct_per_bx->Fill(nclct_per_bx[b]); +// h_rt_n_ch_clct_per_bx->Fill(n_ch_clct_per_bx[b]); +// for (int s=0; sFill(n_ch_clct_per_bx_st[s][b]); +// for (int me=0; me<=CSC_TYPES; me++) +// h_rt_n_ch_clct_per_bx_cscdet[me]->Fill(n_ch_clct_per_bx_cscdet[me][b]); +// } +// if (debugRATE) std::cout<< "----- end nclct="<GetXaxis()->GetNbins()<16) { - std::cout<<"TF mode histogram should have 16 bins, nbins="<GetXaxis()->GetNbins()<GetXaxis()->SetTitle("Track Type"); - h->GetXaxis()->SetTitleOffset(1.2); - h->GetXaxis()->SetBinLabel(1,"No Track"); - h->GetXaxis()->SetBinLabel(2,"Bad Phi Road"); - h->GetXaxis()->SetBinLabel(3,"ME1-2-3(-4)"); - h->GetXaxis()->SetBinLabel(4,"ME1-2-4"); - h->GetXaxis()->SetBinLabel(5,"ME1-3-4"); - h->GetXaxis()->SetBinLabel(6,"ME2-3-4"); - h->GetXaxis()->SetBinLabel(7,"ME1-2"); - h->GetXaxis()->SetBinLabel(8,"ME1-3"); - h->GetXaxis()->SetBinLabel(9,"ME2-3"); - h->GetXaxis()->SetBinLabel(10,"ME2-4"); - h->GetXaxis()->SetBinLabel(11,"ME3-4"); - h->GetXaxis()->SetBinLabel(12,"B1-ME3,B1-ME1-"); - h->GetXaxis()->SetBinLabel(13,"B1-ME2(-3)"); - h->GetXaxis()->SetBinLabel(14,"ME1-4"); - h->GetXaxis()->SetBinLabel(15,"B1-ME1(-2)(-3)"); - h->GetXaxis()->SetBinLabel(16,"Halo Trigger"); -} +// void +// GEMCSCTriggerRateTree::setupTFModeHisto(TH1D* h) +// { +// if (h==0) return; +// if (h->GetXaxis()->GetNbins()<16) { +// std::cout<<"TF mode histogram should have 16 bins, nbins="<GetXaxis()->GetNbins()<GetXaxis()->SetTitle("Track Type"); +// h->GetXaxis()->SetTitleOffset(1.2); +// h->GetXaxis()->SetBinLabel(1,"No Track"); +// h->GetXaxis()->SetBinLabel(2,"Bad Phi Road"); +// h->GetXaxis()->SetBinLabel(3,"ME1-2-3(-4)"); +// h->GetXaxis()->SetBinLabel(4,"ME1-2-4"); +// h->GetXaxis()->SetBinLabel(5,"ME1-3-4"); +// h->GetXaxis()->SetBinLabel(6,"ME2-3-4"); +// h->GetXaxis()->SetBinLabel(7,"ME1-2"); +// h->GetXaxis()->SetBinLabel(8,"ME1-3"); +// h->GetXaxis()->SetBinLabel(9,"ME2-3"); +// h->GetXaxis()->SetBinLabel(10,"ME2-4"); +// h->GetXaxis()->SetBinLabel(11,"ME3-4"); +// h->GetXaxis()->SetBinLabel(12,"B1-ME3,B1-ME1-"); +// h->GetXaxis()->SetBinLabel(13,"B1-ME2(-3)"); +// h->GetXaxis()->SetBinLabel(14,"ME1-4"); +// h->GetXaxis()->SetBinLabel(15,"B1-ME1(-2)(-3)"); +// h->GetXaxis()->SetBinLabel(16,"Halo Trigger"); +// } // ================================================================================================ std::pair diff --git a/SimMuL1/plugins/GEMCSCTriggerRateTree.h b/SimMuL1/plugins/GEMCSCTriggerRateTree.h index cec91716464db..2fa20348fa122 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRateTree.h +++ b/SimMuL1/plugins/GEMCSCTriggerRateTree.h @@ -56,14 +56,12 @@ struct MyALCT { - Int_t event, detId, bx, pattern; - Float_t pt, eta, phi; + Int_t event, detId, bx, station; }; struct MyCLCT { - Int_t event, detId, bx, pattern; - Float_t pt, eta, phi; + Int_t event, detId, bx, station; }; struct MyLCT @@ -134,10 +132,6 @@ class GEMCSCTriggerRateTree : public edm::EDAnalyzer enum trig_cscs {MAX_STATIONS = 4, CSC_TYPES = 10}; //Various useful constants - static const std::string csc_type[CSC_TYPES+1]; - static const std::string csc_type_[CSC_TYPES+1]; - static const std::string csc_type_a[CSC_TYPES+2]; - static const std::string csc_type_a_[CSC_TYPES+2]; static const int pbend[CSCConstants::NUM_CLCT_PATTERNS]; enum pt_thresh {N_PT_THRESHOLDS = 6}; @@ -239,373 +233,373 @@ class GEMCSCTriggerRateTree : public edm::EDAnalyzer MyGMTReg gmtreg_; MyGMT gmt_; - // --- rate histograms --- - - TH1D * h_rt_lct_per_sector; - TH2D * h_rt_lct_per_sector_vs_bx; - TH1D * h_rt_mplct_per_sector; - TH2D * h_rt_mplct_per_sector_vs_bx; - TH1D * h_rt_lct_per_sector_st[MAX_STATIONS]; - TH2D * h_rt_lct_per_sector_vs_bx_st[MAX_STATIONS]; - TH1D * h_rt_mplct_per_sector_st[MAX_STATIONS]; - TH2D * h_rt_mplct_per_sector_vs_bx_st[MAX_STATIONS]; - TH2D * h_rt_lct_per_sector_vs_bx_st1t; - TH2D * h_rt_mplct_per_sector_vs_bx_st1t; - - TH1D * h_rt_nalct; - TH1D * h_rt_nclct; - TH1D * h_rt_nlct; - TH1D * h_rt_nmplct; - TH1D * h_rt_ntftrack; - TH1D * h_rt_ntfcand; - TH1D * h_rt_ntfcand_pt10; - TH1D * h_rt_ngmt_csc; - TH1D * h_rt_ngmt_csc_pt10; - TH1D * h_rt_ngmt_csc_per_bx; - TH1D * h_rt_ngmt_rpcf; - TH1D * h_rt_ngmt_rpcf_pt10; - TH1D * h_rt_ngmt_rpcf_per_bx; - TH1D * h_rt_ngmt_rpcb; - TH1D * h_rt_ngmt_rpcb_pt10; - TH1D * h_rt_ngmt_rpcb_per_bx; - TH1D * h_rt_ngmt_dt; - TH1D * h_rt_ngmt_dt_pt10; - TH1D * h_rt_ngmt_dt_per_bx; - TH1D * h_rt_ngmt; - TH1D * h_rt_nxtra; - - TH1D * h_rt_nalct_per_bx; - TH1D * h_rt_nclct_per_bx; - TH1D * h_rt_nlct_per_bx; - - TH1D * h_rt_alct_bx; - TH1D * h_rt_clct_bx; - TH1D * h_rt_lct_bx; - TH1D * h_rt_mplct_bx; - TH1D * h_rt_csctype_alct_bx567; - TH1D * h_rt_csctype_clct_bx567; - TH1D * h_rt_csctype_lct_bx567; - TH1D * h_rt_csctype_mplct_bx567; - TH1D * h_rt_alct_bx_cscdet[CSC_TYPES+1]; - TH1D * h_rt_clct_bx_cscdet[CSC_TYPES+1]; - TH1D * h_rt_lct_bx_cscdet[CSC_TYPES+1]; - TH1D * h_rt_mplct_bx_cscdet[CSC_TYPES+1]; - - TH2D * h_rt_lct_qu_vs_bx; - TH2D * h_rt_mplct_qu_vs_bx; - - TH2D * h_rt_nalct_vs_bx; - TH2D * h_rt_nclct_vs_bx; - TH2D * h_rt_nlct_vs_bx; - TH2D * h_rt_nmplct_vs_bx; +/* // --- rate histograms --- */ + +/* TH1D * h_rt_lct_per_sector; */ +/* TH2D * h_rt_lct_per_sector_vs_bx; */ +/* TH1D * h_rt_mplct_per_sector; */ +/* TH2D * h_rt_mplct_per_sector_vs_bx; */ +/* TH1D * h_rt_lct_per_sector_st[MAX_STATIONS]; */ +/* TH2D * h_rt_lct_per_sector_vs_bx_st[MAX_STATIONS]; */ +/* TH1D * h_rt_mplct_per_sector_st[MAX_STATIONS]; */ +/* TH2D * h_rt_mplct_per_sector_vs_bx_st[MAX_STATIONS]; */ +/* TH2D * h_rt_lct_per_sector_vs_bx_st1t; */ +/* TH2D * h_rt_mplct_per_sector_vs_bx_st1t; */ + +/* TH1D * h_rt_nalct; */ +/* TH1D * h_rt_nclct; */ +/* TH1D * h_rt_nlct; */ +/* TH1D * h_rt_nmplct; */ +/* TH1D * h_rt_ntftrack; */ +/* TH1D * h_rt_ntfcand; */ +/* TH1D * h_rt_ntfcand_pt10; */ +/* TH1D * h_rt_ngmt_csc; */ +/* TH1D * h_rt_ngmt_csc_pt10; */ +/* TH1D * h_rt_ngmt_csc_per_bx; */ +/* TH1D * h_rt_ngmt_rpcf; */ +/* TH1D * h_rt_ngmt_rpcf_pt10; */ +/* TH1D * h_rt_ngmt_rpcf_per_bx; */ +/* TH1D * h_rt_ngmt_rpcb; */ +/* TH1D * h_rt_ngmt_rpcb_pt10; */ +/* TH1D * h_rt_ngmt_rpcb_per_bx; */ +/* TH1D * h_rt_ngmt_dt; */ +/* TH1D * h_rt_ngmt_dt_pt10; */ +/* TH1D * h_rt_ngmt_dt_per_bx; */ +/* TH1D * h_rt_ngmt; */ +/* TH1D * h_rt_nxtra; */ + +/* TH1D * h_rt_nalct_per_bx; */ +/* TH1D * h_rt_nclct_per_bx; */ +/* TH1D * h_rt_nlct_per_bx; */ + +/* TH1D * h_rt_alct_bx; */ +/* TH1D * h_rt_clct_bx; */ +/* TH1D * h_rt_lct_bx; */ +/* TH1D * h_rt_mplct_bx; */ +/* TH1D * h_rt_csctype_alct_bx567; */ +/* TH1D * h_rt_csctype_clct_bx567; */ +/* TH1D * h_rt_csctype_lct_bx567; */ +/* TH1D * h_rt_csctype_mplct_bx567; */ +/* TH1D * h_rt_alct_bx_cscdet[CSC_TYPES+1]; */ +/* TH1D * h_rt_clct_bx_cscdet[CSC_TYPES+1]; */ +/* TH1D * h_rt_lct_bx_cscdet[CSC_TYPES+1]; */ +/* TH1D * h_rt_mplct_bx_cscdet[CSC_TYPES+1]; */ + +/* TH2D * h_rt_lct_qu_vs_bx; */ +/* TH2D * h_rt_mplct_qu_vs_bx; */ + +/* TH2D * h_rt_nalct_vs_bx; */ +/* TH2D * h_rt_nclct_vs_bx; */ +/* TH2D * h_rt_nlct_vs_bx; */ +/* TH2D * h_rt_nmplct_vs_bx; */ - TH2D * h_rt_n_per_ch_alct_vs_bx_cscdet[CSC_TYPES+1]; - TH2D * h_rt_n_per_ch_clct_vs_bx_cscdet[CSC_TYPES+1]; - TH2D * h_rt_n_per_ch_lct_vs_bx_cscdet[CSC_TYPES+1]; +/* TH2D * h_rt_n_per_ch_alct_vs_bx_cscdet[CSC_TYPES+1]; */ +/* TH2D * h_rt_n_per_ch_clct_vs_bx_cscdet[CSC_TYPES+1]; */ +/* TH2D * h_rt_n_per_ch_lct_vs_bx_cscdet[CSC_TYPES+1]; */ - TH1D * h_rt_n_ch_alct_per_bx_cscdet[CSC_TYPES+1]; - TH1D * h_rt_n_ch_clct_per_bx_cscdet[CSC_TYPES+1]; - TH1D * h_rt_n_ch_lct_per_bx_cscdet[CSC_TYPES+1]; +/* TH1D * h_rt_n_ch_alct_per_bx_cscdet[CSC_TYPES+1]; */ +/* TH1D * h_rt_n_ch_clct_per_bx_cscdet[CSC_TYPES+1]; */ +/* TH1D * h_rt_n_ch_lct_per_bx_cscdet[CSC_TYPES+1]; */ - TH1D * h_rt_n_ch_alct_per_bx_st[MAX_STATIONS]; - TH1D * h_rt_n_ch_clct_per_bx_st[MAX_STATIONS]; - TH1D * h_rt_n_ch_lct_per_bx_st[MAX_STATIONS]; +/* TH1D * h_rt_n_ch_alct_per_bx_st[MAX_STATIONS]; */ +/* TH1D * h_rt_n_ch_clct_per_bx_st[MAX_STATIONS]; */ +/* TH1D * h_rt_n_ch_lct_per_bx_st[MAX_STATIONS]; */ - TH1D * h_rt_n_ch_alct_per_bx; - TH1D * h_rt_n_ch_clct_per_bx; - TH1D * h_rt_n_ch_lct_per_bx; +/* TH1D * h_rt_n_ch_alct_per_bx; */ +/* TH1D * h_rt_n_ch_clct_per_bx; */ +/* TH1D * h_rt_n_ch_lct_per_bx; */ - TH1D * h_rt_lct_qu; - TH1D * h_rt_mplct_qu; +/* TH1D * h_rt_lct_qu; */ +/* TH1D * h_rt_mplct_qu; */ - TH2D * h_rt_qu_vs_bxclct__lct; +/* TH2D * h_rt_qu_vs_bxclct__lct; */ - TH1D * h_rt_mplct_pattern; - TH1D * h_rt_mplct_pattern_cscdet[CSC_TYPES+1]; +/* TH1D * h_rt_mplct_pattern; */ +/* TH1D * h_rt_mplct_pattern_cscdet[CSC_TYPES+1]; */ - TH1D * h_rt_tftrack_pt; - TH1D * h_rt_tfcand_pt; +/* TH1D * h_rt_tftrack_pt; */ +/* TH1D * h_rt_tfcand_pt; */ - TH1D * h_rt_tfcand_pt_2st; - TH1D * h_rt_tfcand_pt_3st; +/* TH1D * h_rt_tfcand_pt_2st; */ +/* TH1D * h_rt_tfcand_pt_3st; */ - TH1D * h_rt_tfcand_pt_h42_2st; - TH1D * h_rt_tfcand_pt_h42_3st; +/* TH1D * h_rt_tfcand_pt_h42_2st; */ +/* TH1D * h_rt_tfcand_pt_h42_3st; */ - TH1D * h_rt_tftrack_bx; - TH1D * h_rt_tfcand_bx; +/* TH1D * h_rt_tftrack_bx; */ +/* TH1D * h_rt_tfcand_bx; */ - TH1D * h_rt_tfcand_eta; - TH1D * h_rt_tfcand_eta_pt5; - TH1D * h_rt_tfcand_eta_pt10; - TH1D * h_rt_tfcand_eta_pt15; +/* TH1D * h_rt_tfcand_eta; */ +/* TH1D * h_rt_tfcand_eta_pt5; */ +/* TH1D * h_rt_tfcand_eta_pt10; */ +/* TH1D * h_rt_tfcand_eta_pt15; */ - TH1D * h_rt_tfcand_eta_3st; - TH1D * h_rt_tfcand_eta_pt5_3st; - TH1D * h_rt_tfcand_eta_pt10_3st; - TH1D * h_rt_tfcand_eta_pt15_3st; - - TH1D * h_rt_tfcand_eta_3st1a; - TH1D * h_rt_tfcand_eta_pt5_3st1a; - TH1D * h_rt_tfcand_eta_pt10_3st1a; - TH1D * h_rt_tfcand_eta_pt15_3st1a; - - TH2D * h_rt_tfcand_pt_vs_eta; - TH2D * h_rt_tfcand_pt_vs_eta_3st; - TH2D * h_rt_tfcand_pt_vs_eta_3st1a; - - TH1D * h_rt_gmt_csc_pt; - TH1D * h_rt_gmt_csc_ptmax_2s; - TH1D * h_rt_gmt_csc_ptmax_2s_1b; - TH1D * h_rt_gmt_csc_ptmax_2s_no1a; - TH1D * h_rt_gmt_csc_ptmax_3s; - TH1D * h_rt_gmt_csc_ptmax_3s_1b; - TH1D * h_rt_gmt_csc_ptmax_3s_no1a; - TH1D * h_rt_gmt_csc_ptmax_3s_2s1b; - TH1D * h_rt_gmt_csc_ptmax_3s_2s1b_1b; - TH1D * h_rt_gmt_csc_ptmax_3s_2s123_1b; - TH1D * h_rt_gmt_csc_ptmax_3s_2s13_1b; - TH1D * h_rt_gmt_csc_ptmax_3s_2s1b_no1a; - TH1D * h_rt_gmt_csc_ptmax_3s_2s123_no1a; - TH1D * h_rt_gmt_csc_ptmax_3s_2s13_no1a; - TH1D * h_rt_gmt_csc_ptmax_3s_3s1b; - TH1D * h_rt_gmt_csc_ptmax_3s_3s1b_1b; - TH1D * h_rt_gmt_csc_ptmax_3s_3s1b_no1a; - TH1D * h_rt_gmt_csc_ptmax_2q; - TH1D * h_rt_gmt_csc_ptmax_3q; - TH1D * h_rt_gmt_csc_pt_2s42; - TH1D * h_rt_gmt_csc_pt_3s42; - TH1D * h_rt_gmt_csc_ptmax_2s42; - TH1D * h_rt_gmt_csc_ptmax_3s42; - TH1D * h_rt_gmt_csc_pt_2q42; - TH1D * h_rt_gmt_csc_pt_3q42; - TH1D * h_rt_gmt_csc_ptmax_2q42; - TH1D * h_rt_gmt_csc_ptmax_3q42; - TH1D * h_rt_gmt_csc_pt_2s42r; - TH1D * h_rt_gmt_csc_pt_3s42r; - TH1D * h_rt_gmt_csc_ptmax_2s42r; - TH1D * h_rt_gmt_csc_ptmax_3s42r; - TH1D * h_rt_gmt_csc_pt_2q42r; - TH1D * h_rt_gmt_csc_pt_3q42r; - TH1D * h_rt_gmt_csc_ptmax_2q42r; - TH1D * h_rt_gmt_csc_ptmax_3q42r; +/* TH1D * h_rt_tfcand_eta_3st; */ +/* TH1D * h_rt_tfcand_eta_pt5_3st; */ +/* TH1D * h_rt_tfcand_eta_pt10_3st; */ +/* TH1D * h_rt_tfcand_eta_pt15_3st; */ + +/* TH1D * h_rt_tfcand_eta_3st1a; */ +/* TH1D * h_rt_tfcand_eta_pt5_3st1a; */ +/* TH1D * h_rt_tfcand_eta_pt10_3st1a; */ +/* TH1D * h_rt_tfcand_eta_pt15_3st1a; */ + +/* TH2D * h_rt_tfcand_pt_vs_eta; */ +/* TH2D * h_rt_tfcand_pt_vs_eta_3st; */ +/* TH2D * h_rt_tfcand_pt_vs_eta_3st1a; */ + +/* TH1D * h_rt_gmt_csc_pt; */ +/* TH1D * h_rt_gmt_csc_ptmax_2s; */ +/* TH1D * h_rt_gmt_csc_ptmax_2s_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax_2s_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax_3s; */ +/* TH1D * h_rt_gmt_csc_ptmax_3s_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax_3s_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax_3s_2s1b; */ +/* TH1D * h_rt_gmt_csc_ptmax_3s_2s1b_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax_3s_2s123_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax_3s_2s13_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax_3s_2s1b_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax_3s_2s123_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax_3s_2s13_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax_3s_3s1b; */ +/* TH1D * h_rt_gmt_csc_ptmax_3s_3s1b_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax_3s_3s1b_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax_2q; */ +/* TH1D * h_rt_gmt_csc_ptmax_3q; */ +/* TH1D * h_rt_gmt_csc_pt_2s42; */ +/* TH1D * h_rt_gmt_csc_pt_3s42; */ +/* TH1D * h_rt_gmt_csc_ptmax_2s42; */ +/* TH1D * h_rt_gmt_csc_ptmax_3s42; */ +/* TH1D * h_rt_gmt_csc_pt_2q42; */ +/* TH1D * h_rt_gmt_csc_pt_3q42; */ +/* TH1D * h_rt_gmt_csc_ptmax_2q42; */ +/* TH1D * h_rt_gmt_csc_ptmax_3q42; */ +/* TH1D * h_rt_gmt_csc_pt_2s42r; */ +/* TH1D * h_rt_gmt_csc_pt_3s42r; */ +/* TH1D * h_rt_gmt_csc_ptmax_2s42r; */ +/* TH1D * h_rt_gmt_csc_ptmax_3s42r; */ +/* TH1D * h_rt_gmt_csc_pt_2q42r; */ +/* TH1D * h_rt_gmt_csc_pt_3q42r; */ +/* TH1D * h_rt_gmt_csc_ptmax_2q42r; */ +/* TH1D * h_rt_gmt_csc_ptmax_3q42r; */ - TH1D * h_rt_gmt_rpcf_pt; - TH1D * h_rt_gmt_rpcf_pt_42; - TH1D * h_rt_gmt_rpcf_ptmax; - TH1D * h_rt_gmt_rpcf_ptmax_42; +/* TH1D * h_rt_gmt_rpcf_pt; */ +/* TH1D * h_rt_gmt_rpcf_pt_42; */ +/* TH1D * h_rt_gmt_rpcf_ptmax; */ +/* TH1D * h_rt_gmt_rpcf_ptmax_42; */ - TH1D * h_rt_gmt_rpcb_pt; - TH1D * h_rt_gmt_rpcb_ptmax; +/* TH1D * h_rt_gmt_rpcb_pt; */ +/* TH1D * h_rt_gmt_rpcb_ptmax; */ - TH1D * h_rt_gmt_dt_pt; - TH1D * h_rt_gmt_dt_ptmax; - - TH1D * h_rt_gmt_pt; - TH1D * h_rt_gmt_pt_2s42; - TH1D * h_rt_gmt_pt_3s42; - TH1D * h_rt_gmt_ptmax_2s42; - TH1D * h_rt_gmt_ptmax_3s42; - TH1D * h_rt_gmt_ptmax_2s42_sing; - TH1D * h_rt_gmt_ptmax_3s42_sing; - TH1D * h_rt_gmt_pt_2s42r; - TH1D * h_rt_gmt_pt_3s42r; - TH1D * h_rt_gmt_ptmax_2s42r; - TH1D * h_rt_gmt_ptmax_3s42r; - TH1D * h_rt_gmt_ptmax_2s42r_sing; - TH1D * h_rt_gmt_ptmax_3s42r_sing; - TH1D * h_rt_gmt_ptmax; - TH1D * h_rt_gmt_ptmax_sing; - TH1D * h_rt_gmt_ptmax_sing_3s; - TH1D * h_rt_gmt_ptmax_sing_csc; - TH1D * h_rt_gmt_ptmax_sing_1b; - TH1D * h_rt_gmt_ptmax_sing_no1a; - TH1D * h_rt_gmt_ptmax_sing6; - TH1D * h_rt_gmt_ptmax_sing6_3s; - TH1D * h_rt_gmt_ptmax_sing6_csc; - TH1D * h_rt_gmt_ptmax_sing6_1b; - TH1D * h_rt_gmt_ptmax_sing6_no1a; - TH1D * h_rt_gmt_ptmax_sing6_3s1b_no1a; - TH1D * h_rt_gmt_ptmax_dbl; - TH1D * h_rt_gmt_pt_2q42; - TH1D * h_rt_gmt_pt_3q42; - TH1D * h_rt_gmt_ptmax_2q42; - TH1D * h_rt_gmt_ptmax_3q42; - TH1D * h_rt_gmt_ptmax_2q42_sing; - TH1D * h_rt_gmt_ptmax_3q42_sing; - TH1D * h_rt_gmt_pt_2q42r; - TH1D * h_rt_gmt_pt_3q42r; - TH1D * h_rt_gmt_ptmax_2q42r; - TH1D * h_rt_gmt_ptmax_3q42r; - TH1D * h_rt_gmt_ptmax_2q42r_sing; - TH1D * h_rt_gmt_ptmax_3q42r_sing; - - TH1D * h_rt_gmt_csc_eta; - TH1D * h_rt_gmt_csc_ptmax10_eta_2s; - TH1D * h_rt_gmt_csc_ptmax10_eta_2s_2s1b; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_1b; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_no1a; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s1b; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s1b_1b; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s123_1b; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s13_1b; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s1b_no1a; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s123_no1a; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s13_no1a; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_3s1b; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_3s1b_1b; - TH1D * h_rt_gmt_csc_ptmax10_eta_3s_3s1b_no1a; - TH1D * h_rt_gmt_csc_ptmax10_eta_2q; - TH1D * h_rt_gmt_csc_ptmax10_eta_3q; - - TH1D * h_rt_gmt_csc_ptmax20_eta_2s; - TH1D * h_rt_gmt_csc_ptmax20_eta_2s_2s1b; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_1b; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_1ab; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_no1a; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s1b; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s1b_1b; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s123_1b; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s13_1b; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s1b_no1a; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s123_no1a; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s13_no1a; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_3s1b; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_3s1b_1b; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_3s1b_no1a; - TH1D * h_rt_gmt_csc_ptmax20_eta_3s_3s1ab; - TH1D * h_rt_gmt_csc_ptmax20_eta_2q; - TH1D * h_rt_gmt_csc_ptmax20_eta_3q; - - TH1D * h_rt_gmt_csc_ptmax30_eta_2s; - TH1D * h_rt_gmt_csc_ptmax30_eta_2s_2s1b; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_1b; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_1ab; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_no1a; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s1b; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s1b_1b; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s123_1b; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s13_1b; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s1b_no1a; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s123_no1a; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s13_no1a; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_3s1b; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_3s1b_1b; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_3s1b_no1a; - TH1D * h_rt_gmt_csc_ptmax30_eta_3s_3s1ab; - TH1D * h_rt_gmt_csc_ptmax30_eta_2q; - TH1D * h_rt_gmt_csc_ptmax30_eta_3q; - - TH1D * h_rt_gmt_csc_mode_2s1b_1b[6]; - - TH1D * h_rt_gmt_rpcf_eta; - TH1D * h_rt_gmt_rpcf_ptmax10_eta; - TH1D * h_rt_gmt_rpcf_ptmax20_eta; - TH1D * h_rt_gmt_rpcb_eta; - TH1D * h_rt_gmt_rpcb_ptmax10_eta; - TH1D * h_rt_gmt_rpcb_ptmax20_eta; - TH1D * h_rt_gmt_dt_eta; - TH1D * h_rt_gmt_dt_ptmax10_eta; - TH1D * h_rt_gmt_dt_ptmax20_eta; - TH1D * h_rt_gmt_eta; - TH1D * h_rt_gmt_ptmax10_eta; - TH1D * h_rt_gmt_ptmax10_eta_sing; - TH1D * h_rt_gmt_ptmax10_eta_sing_3s; - TH1D * h_rt_gmt_ptmax10_eta_dbl; - TH1D * h_rt_gmt_ptmax20_eta; - TH1D * h_rt_gmt_ptmax20_eta_sing; - TH1D * h_rt_gmt_ptmax20_eta_sing_csc; - TH1D * h_rt_gmt_ptmax20_eta_sing_dtcsc; - TH1D * h_rt_gmt_ptmax20_eta_sing_3s; - TH1D * h_rt_gmt_ptmax30_eta_sing; - TH1D * h_rt_gmt_ptmax30_eta_sing_csc; - TH1D * h_rt_gmt_ptmax30_eta_sing_dtcsc; - TH1D * h_rt_gmt_ptmax30_eta_sing_3s; - TH1D * h_rt_gmt_ptmax10_eta_sing6; - TH1D * h_rt_gmt_ptmax10_eta_sing6_3s; - TH1D * h_rt_gmt_ptmax20_eta_sing6; - TH1D * h_rt_gmt_ptmax20_eta_sing6_csc; - TH1D * h_rt_gmt_ptmax20_eta_sing6_dtcsc; - TH1D * h_rt_gmt_ptmax20_eta_sing6_3s; - TH1D * h_rt_gmt_ptmax30_eta_sing6; - TH1D * h_rt_gmt_ptmax30_eta_sing6_csc; - TH1D * h_rt_gmt_ptmax30_eta_sing6_dtcsc; - TH1D * h_rt_gmt_ptmax30_eta_sing6_3s; - TH1D * h_rt_gmt_ptmax20_eta_dbl; - - TH1D * h_rt_gmt_csc_pt_2st; - TH1D * h_rt_gmt_csc_pt_3st; - TH1D * h_rt_gmt_csc_pt_2q; - TH1D * h_rt_gmt_csc_pt_3q; - TH1D * h_rt_gmt_pt_2st; - TH1D * h_rt_gmt_pt_3st; - TH1D * h_rt_gmt_pt_2q; - TH1D * h_rt_gmt_pt_3q; - - TH1D * h_rt_gmt_csc_bx; - TH1D * h_rt_gmt_rpcf_bx; - TH1D * h_rt_gmt_rpcb_bx; - TH1D * h_rt_gmt_dt_bx; - TH1D * h_rt_gmt_bx; +/* TH1D * h_rt_gmt_dt_pt; */ +/* TH1D * h_rt_gmt_dt_ptmax; */ + +/* TH1D * h_rt_gmt_pt; */ +/* TH1D * h_rt_gmt_pt_2s42; */ +/* TH1D * h_rt_gmt_pt_3s42; */ +/* TH1D * h_rt_gmt_ptmax_2s42; */ +/* TH1D * h_rt_gmt_ptmax_3s42; */ +/* TH1D * h_rt_gmt_ptmax_2s42_sing; */ +/* TH1D * h_rt_gmt_ptmax_3s42_sing; */ +/* TH1D * h_rt_gmt_pt_2s42r; */ +/* TH1D * h_rt_gmt_pt_3s42r; */ +/* TH1D * h_rt_gmt_ptmax_2s42r; */ +/* TH1D * h_rt_gmt_ptmax_3s42r; */ +/* TH1D * h_rt_gmt_ptmax_2s42r_sing; */ +/* TH1D * h_rt_gmt_ptmax_3s42r_sing; */ +/* TH1D * h_rt_gmt_ptmax; */ +/* TH1D * h_rt_gmt_ptmax_sing; */ +/* TH1D * h_rt_gmt_ptmax_sing_3s; */ +/* TH1D * h_rt_gmt_ptmax_sing_csc; */ +/* TH1D * h_rt_gmt_ptmax_sing_1b; */ +/* TH1D * h_rt_gmt_ptmax_sing_no1a; */ +/* TH1D * h_rt_gmt_ptmax_sing6; */ +/* TH1D * h_rt_gmt_ptmax_sing6_3s; */ +/* TH1D * h_rt_gmt_ptmax_sing6_csc; */ +/* TH1D * h_rt_gmt_ptmax_sing6_1b; */ +/* TH1D * h_rt_gmt_ptmax_sing6_no1a; */ +/* TH1D * h_rt_gmt_ptmax_sing6_3s1b_no1a; */ +/* TH1D * h_rt_gmt_ptmax_dbl; */ +/* TH1D * h_rt_gmt_pt_2q42; */ +/* TH1D * h_rt_gmt_pt_3q42; */ +/* TH1D * h_rt_gmt_ptmax_2q42; */ +/* TH1D * h_rt_gmt_ptmax_3q42; */ +/* TH1D * h_rt_gmt_ptmax_2q42_sing; */ +/* TH1D * h_rt_gmt_ptmax_3q42_sing; */ +/* TH1D * h_rt_gmt_pt_2q42r; */ +/* TH1D * h_rt_gmt_pt_3q42r; */ +/* TH1D * h_rt_gmt_ptmax_2q42r; */ +/* TH1D * h_rt_gmt_ptmax_3q42r; */ +/* TH1D * h_rt_gmt_ptmax_2q42r_sing; */ +/* TH1D * h_rt_gmt_ptmax_3q42r_sing; */ + +/* TH1D * h_rt_gmt_csc_eta; */ +/* TH1D * h_rt_gmt_csc_ptmax10_eta_2s; */ +/* TH1D * h_rt_gmt_csc_ptmax10_eta_2s_2s1b; */ +/* TH1D * h_rt_gmt_csc_ptmax10_eta_3s; */ +/* TH1D * h_rt_gmt_csc_ptmax10_eta_3s_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax10_eta_3s_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s1b; */ +/* TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s1b_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s123_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s13_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s1b_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s123_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax10_eta_3s_2s13_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax10_eta_3s_3s1b; */ +/* TH1D * h_rt_gmt_csc_ptmax10_eta_3s_3s1b_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax10_eta_3s_3s1b_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax10_eta_2q; */ +/* TH1D * h_rt_gmt_csc_ptmax10_eta_3q; */ + +/* TH1D * h_rt_gmt_csc_ptmax20_eta_2s; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_2s_2s1b; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_3s; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_3s_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_3s_1ab; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_3s_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s1b; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s1b_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s123_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s13_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s1b_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s123_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_3s_2s13_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_3s_3s1b; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_3s_3s1b_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_3s_3s1b_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_3s_3s1ab; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_2q; */ +/* TH1D * h_rt_gmt_csc_ptmax20_eta_3q; */ + +/* TH1D * h_rt_gmt_csc_ptmax30_eta_2s; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_2s_2s1b; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_3s; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_3s_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_3s_1ab; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_3s_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s1b; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s1b_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s123_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s13_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s1b_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s123_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_3s_2s13_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_3s_3s1b; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_3s_3s1b_1b; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_3s_3s1b_no1a; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_3s_3s1ab; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_2q; */ +/* TH1D * h_rt_gmt_csc_ptmax30_eta_3q; */ + +/* TH1D * h_rt_gmt_csc_mode_2s1b_1b[6]; */ + +/* TH1D * h_rt_gmt_rpcf_eta; */ +/* TH1D * h_rt_gmt_rpcf_ptmax10_eta; */ +/* TH1D * h_rt_gmt_rpcf_ptmax20_eta; */ +/* TH1D * h_rt_gmt_rpcb_eta; */ +/* TH1D * h_rt_gmt_rpcb_ptmax10_eta; */ +/* TH1D * h_rt_gmt_rpcb_ptmax20_eta; */ +/* TH1D * h_rt_gmt_dt_eta; */ +/* TH1D * h_rt_gmt_dt_ptmax10_eta; */ +/* TH1D * h_rt_gmt_dt_ptmax20_eta; */ +/* TH1D * h_rt_gmt_eta; */ +/* TH1D * h_rt_gmt_ptmax10_eta; */ +/* TH1D * h_rt_gmt_ptmax10_eta_sing; */ +/* TH1D * h_rt_gmt_ptmax10_eta_sing_3s; */ +/* TH1D * h_rt_gmt_ptmax10_eta_dbl; */ +/* TH1D * h_rt_gmt_ptmax20_eta; */ +/* TH1D * h_rt_gmt_ptmax20_eta_sing; */ +/* TH1D * h_rt_gmt_ptmax20_eta_sing_csc; */ +/* TH1D * h_rt_gmt_ptmax20_eta_sing_dtcsc; */ +/* TH1D * h_rt_gmt_ptmax20_eta_sing_3s; */ +/* TH1D * h_rt_gmt_ptmax30_eta_sing; */ +/* TH1D * h_rt_gmt_ptmax30_eta_sing_csc; */ +/* TH1D * h_rt_gmt_ptmax30_eta_sing_dtcsc; */ +/* TH1D * h_rt_gmt_ptmax30_eta_sing_3s; */ +/* TH1D * h_rt_gmt_ptmax10_eta_sing6; */ +/* TH1D * h_rt_gmt_ptmax10_eta_sing6_3s; */ +/* TH1D * h_rt_gmt_ptmax20_eta_sing6; */ +/* TH1D * h_rt_gmt_ptmax20_eta_sing6_csc; */ +/* TH1D * h_rt_gmt_ptmax20_eta_sing6_dtcsc; */ +/* TH1D * h_rt_gmt_ptmax20_eta_sing6_3s; */ +/* TH1D * h_rt_gmt_ptmax30_eta_sing6; */ +/* TH1D * h_rt_gmt_ptmax30_eta_sing6_csc; */ +/* TH1D * h_rt_gmt_ptmax30_eta_sing6_dtcsc; */ +/* TH1D * h_rt_gmt_ptmax30_eta_sing6_3s; */ +/* TH1D * h_rt_gmt_ptmax20_eta_dbl; */ + +/* TH1D * h_rt_gmt_csc_pt_2st; */ +/* TH1D * h_rt_gmt_csc_pt_3st; */ +/* TH1D * h_rt_gmt_csc_pt_2q; */ +/* TH1D * h_rt_gmt_csc_pt_3q; */ +/* TH1D * h_rt_gmt_pt_2st; */ +/* TH1D * h_rt_gmt_pt_3st; */ +/* TH1D * h_rt_gmt_pt_2q; */ +/* TH1D * h_rt_gmt_pt_3q; */ + +/* TH1D * h_rt_gmt_csc_bx; */ +/* TH1D * h_rt_gmt_rpcf_bx; */ +/* TH1D * h_rt_gmt_rpcb_bx; */ +/* TH1D * h_rt_gmt_dt_bx; */ +/* TH1D * h_rt_gmt_bx; */ - TH1D * h_rt_gmt_csc_q; - TH1D * h_rt_gmt_csc_q_42; - TH1D * h_rt_gmt_csc_q_42r; - TH1D * h_rt_gmt_rpcf_q; - TH1D * h_rt_gmt_rpcf_q_42; - TH1D * h_rt_gmt_rpcb_q; - TH1D * h_rt_gmt_dt_q; - TH1D * h_rt_gmt_gq; - TH1D * h_rt_gmt_gq_42; - TH1D * h_rt_gmt_gq_42r; - TH2D * h_rt_gmt_gq_vs_pt_42r; - TH2D * h_rt_gmt_gq_vs_type_42r; - TH1D * h_rt_tftrack_mode; - - - TH1D * h_gmt_mindr; - TH1D * h_gmt_dr_maxrank; - - TH1D * h_gmt_pt_initial_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_dt_initial_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_csc_initial_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_dtcsc_initial_gpt[N_PT_THRESHOLDS]; - - TH1D * h_gmt_pt_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_2s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_3s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_dt_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_csc_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_csc_2s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_csc_3s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_dtcsc_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_dtcsc_2s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_pt_dtcsc_3s_sing_gpt[N_PT_THRESHOLDS]; - - - TH1D * h_gmt_eta_initial_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_dt_initial_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_csc_initial_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_rpcf_initial_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_rpcb_initial_gpt[N_PT_THRESHOLDS]; - - TH1D * h_gmt_eta_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_2s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_3s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_2q_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_3q_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_csc_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_csc_2s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_csc_3s_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_csc_2q_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_csc_3q_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_dt_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_rpcf_sing_gpt[N_PT_THRESHOLDS]; - TH1D * h_gmt_eta_rpcb_sing_gpt[N_PT_THRESHOLDS]; +/* TH1D * h_rt_gmt_csc_q; */ +/* TH1D * h_rt_gmt_csc_q_42; */ +/* TH1D * h_rt_gmt_csc_q_42r; */ +/* TH1D * h_rt_gmt_rpcf_q; */ +/* TH1D * h_rt_gmt_rpcf_q_42; */ +/* TH1D * h_rt_gmt_rpcb_q; */ +/* TH1D * h_rt_gmt_dt_q; */ +/* TH1D * h_rt_gmt_gq; */ +/* TH1D * h_rt_gmt_gq_42; */ +/* TH1D * h_rt_gmt_gq_42r; */ +/* TH2D * h_rt_gmt_gq_vs_pt_42r; */ +/* TH2D * h_rt_gmt_gq_vs_type_42r; */ +/* TH1D * h_rt_tftrack_mode; */ + + +/* TH1D * h_gmt_mindr; */ +/* TH1D * h_gmt_dr_maxrank; */ + +/* TH1D * h_gmt_pt_initial_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_pt_dt_initial_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_pt_csc_initial_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_pt_dtcsc_initial_gpt[N_PT_THRESHOLDS]; */ + +/* TH1D * h_gmt_pt_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_pt_2s_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_pt_3s_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_pt_dt_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_pt_csc_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_pt_csc_2s_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_pt_csc_3s_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_pt_dtcsc_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_pt_dtcsc_2s_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_pt_dtcsc_3s_sing_gpt[N_PT_THRESHOLDS]; */ + + +/* TH1D * h_gmt_eta_initial_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_eta_dt_initial_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_eta_csc_initial_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_eta_rpcf_initial_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_eta_rpcb_initial_gpt[N_PT_THRESHOLDS]; */ + +/* TH1D * h_gmt_eta_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_eta_2s_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_eta_3s_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_eta_2q_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_eta_3q_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_eta_csc_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_eta_csc_2s_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_eta_csc_3s_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_eta_csc_2q_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_eta_csc_3q_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_eta_dt_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_eta_rpcf_sing_gpt[N_PT_THRESHOLDS]; */ +/* TH1D * h_gmt_eta_rpcb_sing_gpt[N_PT_THRESHOLDS]; */ }; #endif From 614e7ab19c6d73947388c7b38c0959ced54ecb01 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 16 Sep 2013 22:07:27 +0200 Subject: [PATCH 115/182] PyROOTization of eta plotter complete --- .../produceRateVsEtaPlotsForApproval.C | 510 ------------------ .../produceRateVsEtaPlotsForApproval.py | 326 +++++++---- 2 files changed, 235 insertions(+), 601 deletions(-) delete mode 100644 SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C diff --git a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C b/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C deleted file mode 100644 index 5afcf472efb56..0000000000000 --- a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.C +++ /dev/null @@ -1,510 +0,0 @@ -// Design LHC orbit: 2808 filled bickets out of 3564 ---> 0.7879 filled BX fraction - -TString gem_dir = "files/"; -TString gem_label = "gem98"; -char dir[111]="SimMuL1StrictAll"; -int gNPU=100; -int gNEvt=238000; -//int gNEvt=128000; -float gdy[2]={0.1,2500}; - -TLatex* drawLumiLabel2(float x=0.2, float y=0.4) -{ - TLatex * tex = new TLatex(x, y,"L = 4*10^{34} cm^{-2} s^{-1}"); - tex->SetTextSize(0.05); - tex->SetNDC(); - tex->Draw(); - return tex; -} - -TLatex* drawPULabel(float x=0.17, float y=0.15, float font_size=0.) -{ - TLatex * tex = new TLatex(x, y,"L=4*10^{34} (25ns PU100)"); - if (font_size > 0.) tex->SetFontSize(font_size); - tex->SetNDC(); - tex->Draw(); - return tex; -} - -TH1D* setHistoEta(TString f_name, char *name, char *cname, char *title, - Color_t lcolor, int lstyle, int lwidth) -{ - cout<<"opening "<GetXaxis()->GetNbins(); - - TH1D* h = (TH1D*)h0->Clone(s_name+cname); - h->SetTitle(title); - h->Sumw2(); - h->Scale(40000./gNEvt/3.*0.795); - h->SetLineColor(lcolor); - //h->SetFillColor(lcolor); - h->SetLineStyle(lstyle); - h->SetLineWidth(lwidth); - h->SetTitle(title); - //h->GetXaxis()->SetRangeUser(1.2, 2.4); - h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); - h->GetXaxis()->SetTitleSize(0.055); - h->GetXaxis()->SetTitleOffset(1.05); - h->GetXaxis()->SetLabelSize(0.045); - h->GetXaxis()->SetLabelOffset(0.003); - h->GetXaxis()->SetTitleFont(62); - h->GetXaxis()->SetLabelFont(62); - h->GetXaxis()->SetMoreLogLabels(1); - h->GetYaxis()->SetTitleSize(0.055); - h->GetYaxis()->SetTitleOffset(0.9); - h->GetYaxis()->SetLabelSize(0.045); - h->GetYaxis()->SetTitleFont(62); - h->GetYaxis()->SetLabelFont(62); - //h->GetYaxis()->SetLabelOffset(0.015); - return h; -} - -TObject* getH(char dir[100], char name[100]) -{ - char nm[222]; - sprintf(nm,"%s/%s;1",dir,name); - return f->Get(nm); -} - -TObject* getH(TFile *fi, char dir[100], char name[100]) -{ - char nm[222]; - sprintf(nm,"%s/%s;1",dir,name); - return fi->Get(nm); -} - -void Print(TCanvas *c, char nm[200]) -{ - if (do_not_print) return; - if (strcmp(pdir,"")<=0) return; - gPad->RedrawAxis(); - char dirnm[200]; - sprintf(dirnm,"%s/%s",pdir,nm); - c->Print(dirnm); -} - -TH1D* setHistoRatio(TH1D* num, TH1D* denom, TString title = "", double ymin=0.4, double ymax=1.6, int color = kRed+3) -{ - ratio = (TH1D*) num->Clone(Form("%s--%s_ratio",num->GetName(),denom->GetName()) ); - ratio->Divide(num, denom, 1., 1.); - ratio->SetTitle(title); - ratio->GetYaxis()->SetRangeUser(ymin, ymax); - ratio->GetYaxis()->SetTitle("ratio: (with GEM)/default"); - ratio->GetYaxis()->SetTitle("Ratio"); - //ratio->GetYaxis()->SetTitle("(ME1/b + GEM) / ME1/b"); - ratio->GetYaxis()->SetTitleSize(.14); - //ratio->GetYaxis()->SetTitleSize(.1); - ratio->GetYaxis()->SetTitleOffset(0.4); - ratio->GetYaxis()->SetLabelSize(.11); - //ratio->GetXaxis()->SetMoreLogLabels(1); - //ratio->GetXaxis()->SetTitle("track #eta"); - ratio->GetXaxis()->SetLabelSize(.11); - ratio->GetXaxis()->SetTitleSize(.14); - ratio->GetXaxis()->SetTitleOffset(1.); - ratio->SetLineWidth(2); - ratio->SetFillColor(color); - ratio->SetLineColor(color); - ratio->SetMarkerColor(color); - ratio->SetMarkerStyle(20); - ratio->SetLineColor(color); - ratio->SetMarkerColor(color); - //ratio->Draw("e3"); - - return ratio; -} - - - -void addRatioPlotLegend(TH1* h, TString k) -{ - TLegend* leg = new TLegend(0.17,0.4,.47,0.5,NULL,"brNDC"); - leg->SetMargin(0.1); - leg->SetBorderSize(0); - leg->SetTextSize(0.1); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(h, "(GEM+CSC)/CSC #geq" + k + " stubs","P"); - leg->Draw("same"); -} - -void addRatePlotLegend(TH1* h, TH1* i, TH1* j, TString k, TString l) -{ - TLegend *leg = new TLegend(0.16,0.67,.8,0.9,"L1 Selections (#geq" + k + " stations, L1 candidate p_{T}#geq" + l + " GeV/c):","brNDC"); - leg->SetMargin(0.20); - leg->SetBorderSize(0); - leg->SetTextSize(0.04); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(h,"CSC #geq" + k + " stubs (anywhere)","l"); - leg->AddEntry(i,"CSC #geq" + k + " stubs (one in ME1/b)","l"); - leg->AddEntry(j,"GEM+CSC integrated trigger","l"); - leg->Draw("same"); -} - -void addRatePlots(TH1* h, TH1* i, TH1* j, Color_t col1, Color_t col2, Color_t col3, - Style_t sty1, Style_t sty2, Style_t sty3, Style_t sty4, int miny, int maxy) -{ - h->SetFillColor(col1); - i->SetFillColor(col2); - j->SetFillColor(col3); - - h->SetFillStyle(sty1); - i->SetFillStyle(sty2); - j->SetFillStyle(sty3); - - // Slava's proposal - h->SetFillStyle(0); - i->SetFillStyle(0); - j->SetFillStyle(0); - - h->SetLineStyle(1); - i->SetLineStyle(4); - j->SetLineStyle(2); - - h->SetLineWidth(2); - i->SetLineWidth(2); - j->SetLineWidth(2); - - h->GetYaxis()->SetRangeUser(miny,maxy); - i->GetYaxis()->SetRangeUser(miny,maxy); - j->GetYaxis()->SetRangeUser(miny,maxy); - - TH1* i_clone = i->Clone("i_clone"); - TH1* j_clone = j->Clone("j_clone"); - TH1* i_clone2 = i->Clone("i_clone2"); - TH1* j_clone2 = j->Clone("j_clone2"); - /* - for (int ii=0; ii<=14; ++ii){ - i_clone2->SetBinContent(ii,0); - j_clone2->SetBinContent(ii,0); - i_clone2->SetBinError(ii,0); - j_clone2->SetBinError(ii,0); - } - for (int ii=26; ii<=34; ++ii){ - i_clone2->SetBinContent(ii,0); - j_clone2->SetBinContent(ii,0); - i_clone2->SetBinError(ii,0); - j_clone2->SetBinError(ii,0); - j_clone2->GetXaxis()->SetRangeUser(1.62,2.12); - i_clone2->GetXaxis()->SetRangeUser(1.62,2.12); - } - - for (int ii=15; ii<=25; ++ii){ - i_clone->SetBinContent(ii,0); - j_clone->SetBinContent(ii,0); - i_clone->SetBinError(ii,0); - j_clone->SetBinError(ii,0); - } - */ - - // j_clone->SetFillStyle(sty4); - - i_clone->Draw("hist e1 same"); - j_clone->Draw("hist e1 same"); - h->Draw("hist e1 same"); - // i_clone2->Draw("hist e1 same"); - // j_clone2->Draw("hist e1 same"); -} - -void setPad1Attributes(TPad* pad1) -{ - pad1->SetGridx(1); - pad1->SetGridy(1); - pad1->SetFrameBorderMode(0); - pad1->SetFillColor(kWhite); - pad1->SetTopMargin(0.06); - pad1->SetBottomMargin(0.13); -} - -void setPad2Attributes(TPad* pad2) -{ - pad2->SetLogy(1); - pad2->SetGridx(1); - pad2->SetGridy(1); - pad2->SetFillColor(kWhite); - pad2->SetFrameBorderMode(0); - pad2->SetTopMargin(0.06); - pad2->SetBottomMargin(0.3); -} - -void produceRateVsEtaPlot(TH1D* h, TH1D* i, TH1D* j, Color_t col1, Color_t col2, Color_t col3, - Style_t sty1, Style_t sty2, Style_t sty3, Style_t sty4, int miny, int maxy, - TString k, TString l, TString plots, TString ext) -{ - TCanvas* c = new TCanvas("c","c",800,800); - c->Clear(); - TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); - pad1->Draw(); - TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); - pad2->Draw(); - - pad1->cd(); - setPad1Attributes(pad1); - addRatePlots(h,i,j,col1,col2,col3,sty1,sty2,sty3,3355,miny,maxy); - addRatePlotLegend(h, i, j, k,l); - drawLumiLabel2(); - - pad2->cd(); - setPad2Attributes(pad2); - TH1D* gem_ratio = setHistoRatio(j, i, "", 0.01,2.0, col2); - gem_ratio->Draw("Pe"); - gem_ratio->GetYaxis()->SetNdivisions(3); - - addRatioPlotLegend(gem_ratio, k); - - c->SaveAs(plots + "rates_vs_eta__minpt" + l + "__PU100__def_" + k + "s_" + k + "s1b_" + k + "s1bgem" + ext); -} - -void produceRateVsEtaPlotsForApproval(TString ext, TString plots) -{ - gStyle->SetOptStat(0); - gStyle->SetTitleStyle(0); - // //gStyle->SetPadTopMargin(0.08); - // gStyle->SetTitleH(0.06); - - // input files - TString f_def = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; - TString f_g98_pt10 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt10_pat2.root"; - TString f_g98_pt15 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt15_pat2.root"; - TString f_g98_pt20 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt20_pat2.root"; - TString f_g98_pt30 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat2.root"; - TString f_g98_pt40 = gem_dir + "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat2.root"; - - // general stuff - TString hdir = "SimMuL1StrictAll"; - - // colors - same colors as for rate vs pt plots!! - Color_t col1 = kViolet+1; - Color_t col2 = kAzure+2; - Color_t col3 = kGreen-2; - - // styles - Style_t sty1 = 3345; - Style_t sty2 = 3003; - Style_t sty3 = 2002; - - // Declaration of histograms - TString vs_eta_minpt = "10"; - // TString ttl = " L1 Single Muon Trigger CMS Simulation Preliminary;L1 muon candidate #eta;rate [kHz]"; - TString ttl = " CMS Simulation Preliminary;L1 muon candidate #eta;Trigger rate [kHz]"; - TH1D* h_rt_tf10_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); - TH1D* h_rt_tf10_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); - TH1D* h_rt_tf10_gpt10_2s1b = setHistoEta(f_g98_pt10, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); - - TH1D* h_rt_tf10_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2); - TH1D* h_rt_tf10_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2); - TH1D* h_rt_tf10_gpt10_3s1b = setHistoEta(f_g98_pt10, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 7, 2); - - TString vs_eta_minpt = "20"; - TH1D* h_rt_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); - TH1D* h_rt_tf20_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); - TH1D* h_rt_tf20_gpt20_2s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); - TH1D* h_rt_tf20_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2); - TH1D* h_rt_tf20_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2); - TH1D* h_rt_tf20_gpt20_3s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 1, 2); - - TString vs_eta_minpt = "30"; - TH1D* h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2); - TH1D* h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2); - TH1D* h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2); - TH1D* h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2); - TH1D* h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2); - TH1D* h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 1, 2); - - // Style - gStyle->SetStatW(0.07); - gStyle->SetStatH(0.06); - gStyle->SetOptStat(0); - gStyle->SetTitleStyle(0); - gStyle->SetTitleAlign(13);// coord in top left - gStyle->SetTitleX(0.); - gStyle->SetTitleY(1.); - gStyle->SetTitleW(1); - gStyle->SetTitleH(0.058); - gStyle->SetTitleBorderSize(0); - - // producing the histograms - float miny = 0.01, maxy; - - // ------------ +2 stubs, L1 candidate muon pt=10GeV ----------------// - produceRateVsEtaPlot(h_rt_tf10_2s,h_rt_tf10_2s1b,h_rt_tf10_gpt10_2s1b, - col1,col2,col3,sty1,sty2,sty3,3355,miny,80,"2","10",plots,ext); - // ------------ +2 stubs, L1 candidate muon pt=20GeV ----------------// - produceRateVsEtaPlot(h_rt_tf20_2s,h_rt_tf20_2s1b,h_rt_tf20_gpt20_2s1b, - col1,col2,col3,sty1,sty2,sty3,3355,miny,40,"2","20",plots,ext); - // ------------ +2 stubs, L1 candidate muon pt=30GeV ----------------// - produceRateVsEtaPlot(h_rt_tf30_2s,h_rt_tf30_2s1b,h_rt_tf30_gpt30_2s1b, - col1,col2,col3,sty1,sty2,sty3,3355,miny,30,"2","30",plots,ext); - // ------------ +3 stubs, L1 candidate muon pt=10GeV ----------------// - produceRateVsEtaPlot(h_rt_tf10_3s,h_rt_tf10_3s1b,h_rt_tf10_gpt10_3s1b, - col1,col2,col3,sty1,sty2,sty3,3355,miny,25,"3","10",plots,ext); - // ------------ +3 stubs, L1 candidate muon pt=20GeV ----------------// - produceRateVsEtaPlot(h_rt_tf20_3s,h_rt_tf20_3s1b,h_rt_tf20_gpt20_3s1b, - col1,col2,col3,sty1,sty2,sty3,3355,miny,10,"3","20",plots,ext); - // ------------ +3 stubs, L1 candidate muon pt=30GeV ----------------// - produceRateVsEtaPlot(h_rt_tf30_3s,h_rt_tf30_3s1b,h_rt_tf30_gpt30_3s1b, - col1,col2,col3,sty1,sty2,sty3,3355,miny,6,"3","30",plots,ext); -} - -void produceRateVsEtaPlotsForApproval() -{ - // produceRateVsEtaPlotsForApproval(".C", "plots/rate_vs_eta/"); - //produceRateVsEtaPlotsForApproval(".png", "plots/rate_vs_eta/"); - produceRateVsEtaPlotsForApproval(".png", "plots/rate_vs_eta/"); - //produceRateVsEtaPlotsForApproval(".C", "plots/rate_vs_eta/"); -} -/* -void gem_rate_draw() -{ - -- KEEP THIS FRAGMENT FOR THE TIME BEING!! -- - -- NEED TO FIGURE OUT WHAT TO DO WITH ME1A -- - - // // Including the region ME1/1a - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - - // maxy = 30.;//10; - - // h_rt_tf20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); - // h_rt_tf20_gpt20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); - - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // h_rt_tf20_3s->Draw("hist e1"); - // h_rt_tf20_gpt20_3s1ab->Draw("hist e1 same"); - // h_rt_tf20_3s->Draw("hist e1 same"); - // h_rt_tf20_3s1ab->Draw("hist e1 same"); - - // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); - // leg->AddEntry(h_rt_tf20_3s,"anywhere","l"); - // leg->AddEntry(h_rt_tf20_3s1ab,"with ME1 in 1.6<|#eta|","l"); - // leg->AddEntry(h_rt_tf20_gpt20_3s1ab,"with (ME1+GEM) in 1.6<|#eta|","l"); - // leg->Draw(); - - // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // tex->SetNDC(); - // tex->Draw(); - - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); - - - // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); - - // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1ab, h_rt_tf20_3s1ab, "", 0.,1.8); - // gem_ratio->Draw("e1"); - - // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); - - - - vs_eta_minpt = "30"; - ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate [kHz]"; - - - TH1D* h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); - TH1D* h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); - TH1D* h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); - TH1D* h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); - TH1D* h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); - TH1D* h_rt_tf30_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kAzure+2, 1, 2); - TH1D* h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); - TH1D* h_rt_tf30_gpt30_3s1ab = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kGreen, 7, 2); - - - - - - // //========================== Including the ME1a - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - - // h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); - // h_rt_tf30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf30_gpt30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // h_rt_tf30_3s->Draw("hist e1"); - // h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same"); - // h_rt_tf30_3s->Draw("hist e1 same"); - // h_rt_tf30_3s1ab->Draw("hist e1 same"); - - // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); - // leg->AddEntry(h_rt_tf30_3s,"anywhere","l"); - // leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|","l"); - // leg->AddEntry(h_rt_tf30_gpt30_3s1ab,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - // leg->Draw(); - - // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // tex->SetNDC(); - // tex->Draw(); - - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); - - // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); - - // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1ab, h_rt_tf30_3s1ab, "", 0.,1.8); - // gem_ratio->Draw("e1"); - - // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); - - - - // //========================== Comparison with/withous Stub in ME1a ==========================// - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - - // h_rt_tf30_3s1b->Draw("hist e1"); - // h_rt_tf30_3s1ab->Draw("hist e1 same"); - - // TLegend *leg = new TLegend(0.2,0.65,.80,0.90,NULL,"brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf30_3s1b,"Tracks: p_{T}>=30, 3+ stubs",""); - // leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - // leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|<2.4","l"); - // leg->Draw(); - - - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); - - - // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); - - // gem_ratio = setHistoRatio2(h_rt_tf30_3s1ab, h_rt_tf30_3s1b, "", 0.,1.8); - // gem_ratio->Draw("e1"); - - // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio_compstubME1a.png").Data()); - - - //========================== Comparison with/withous Stub in ME1a + GEMS ==========================// - - ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - - h_rt_tf30_gpt30_3s1b->Draw("hist e1"); - h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same"); - - TLegend *leg = new TLegend(0.2,0.65,.80,0.90,NULL,"brNDC"); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->AddEntry(h_rt_tf30_3s1b,"Tracks: p_{T}>=30, 3+ stubs",""); - leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|<2.4","l"); - leg->Draw(); - - - Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); -} -*/ diff --git a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.py b/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.py index 0e173e1bb12b6..f2f4a151b0814 100644 --- a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.py +++ b/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.py @@ -1,4 +1,4 @@ -from triggerPlotHelpers import * +from helpers import * ## ROOT modules from ROOT import * @@ -64,9 +64,7 @@ def setHistoRatio(num, denom, title = "", ymin=0.4, ymax=1.6, color = kRed+3): ratio.Divide(num, denom, 1., 1.) ratio.SetTitle(title) ratio.GetYaxis().SetRangeUser(ymin, ymax) - ratio.GetYaxis().SetTitle("ratio: (with GEM)/default") - ratio.GetYaxis().SetTitle("ratio") - ##ratio.GetYaxis().SetTitle("(ME1/b + GEM) / ME1/b") + ratio.GetYaxis().SetTitle("Ratio") ratio.GetYaxis().SetTitleSize(.14) ##ratio.GetYaxis().SetTitleSize(.1) ratio.GetYaxis().SetTitleOffset(0.4) @@ -86,69 +84,61 @@ def setHistoRatio(num, denom, title = "", ymin=0.4, ymax=1.6, color = kRed+3): ##ratio.Draw("e3") return ratio -def addRatioPlotLegend(h): - leg = TLegend(0.17,0.4,.47,0.5,"","brNDC") +def addRatioPlotLegend(h,k): + leg = TLegend(0.17,0.35,.47,0.5,"","brNDC") leg.SetMargin(0.1) leg.SetBorderSize(0) leg.SetTextSize(0.1) leg.SetFillStyle(1001) leg.SetFillColor(kWhite) - leg.AddEntry(h, "GEM+CSC/CSC tight","P") + leg.AddEntry(h, "(GEM+CSC)/CSC #geq%d stubs (one in ME1/b)"%(k),"P"); leg.Draw("same") + return leg def addRatePlotLegend(h, i, j, k, l): - leg = TLegend(0.16,0.67,.8,0.9,"L1 Selections (#geq" + k + " stations, L1 candidate p_{T}#geq" + l + " GeV/c):","brNDC") + leg = TLegend(0.16,0.67,.8,0.9,"L1 Selections (#geq%d stubs, L1 candidate p_{T}#geq%d GeV/c):"%(k,l),"brNDC"); leg.SetMargin(0.20) leg.SetBorderSize(0) leg.SetTextSize(0.04) leg.SetFillStyle(1001) leg.SetFillColor(kWhite) - leg.AddEntry(h,"CSC, loose","f") - leg.AddEntry(i,"CSC, tight","f") - leg.AddEntry(j,"GEM+CSC Integrated Trigger","f") + leg.AddEntry(h,"CSC #geq%d stubs (anywhere)"%(k),"l"); + leg.AddEntry(i,"CSC #geq%d stubs (one in ME1/b)"%(k),"l"); + leg.AddEntry(j,"GEM+CSC integrated trigger","l"); leg.Draw("same") - -def addRatePlots(h, i, j, col1, col2, col3, sty1, sty2, sty3, sty4, miny, maxy): - h.SetFillColor(col1) - i.SetFillColor(col2) - j.SetFillColor(col3) - - h.SetFillStyle(sty1) - i.SetFillStyle(sty2) - j.SetFillStyle(sty3) + ## carbage collection in PyROOT is something to pay attention to! + SetOwnership(leg, False) + return leg + +def addRatePlot(h, i, j, col1, col2, col3, sty1, sty2, sty3, sty4, miny, maxy): + h.SetFillColor(col1); + i.SetFillColor(col2); + j.SetFillColor(col3); - h.GetYaxis().SetRangeUser(miny,maxy) - i.GetYaxis().SetRangeUser(miny,maxy) - j.GetYaxis().SetRangeUser(miny,maxy) + h.SetFillStyle(sty1); + i.SetFillStyle(sty2); + j.SetFillStyle(sty3); - i_clone = i.Clone("i_clone") - j_clone = j.Clone("j_clone") - i_clone2 = i.Clone("i_clone2") - j_clone2 = j.Clone("j_clone2") - - for ii in range(0,15): - i_clone2.SetBinContent(ii,0) - j_clone2.SetBinContent(ii,0) - i_clone2.SetBinError(ii,0) - j_clone2.SetBinError(ii,0) - for ii in range(26,35): - i_clone2.SetBinContent(ii,0) - j_clone2.SetBinContent(ii,0) - i_clone2.SetBinError(ii,0) - j_clone2.SetBinError(ii,0) - for ii in range(15,26): - i_clone.SetBinContent(ii,0) - j_clone.SetBinContent(ii,0) - i_clone.SetBinError(ii,0) - j_clone.SetBinError(ii,0) - - j_clone.SetFillStyle(sty4) + ## Slava's proposal + h.SetFillStyle(0); + i.SetFillStyle(0); + j.SetFillStyle(0); + + h.SetLineStyle(1); + i.SetLineStyle(4); + j.SetLineStyle(2); + + h.SetLineWidth(2); + i.SetLineWidth(2); + j.SetLineWidth(2); - i_clone.Draw("hist e1 same") - j_clone.Draw("hist e1 same") - h.Draw("hist e1 same") - i_clone2.Draw("hist e1 same") - j_clone2.Draw("hist e1 same") + h.GetYaxis().SetRangeUser(miny,maxy); + i.GetYaxis().SetRangeUser(miny,maxy); + j.GetYaxis().SetRangeUser(miny,maxy); + + i.Draw("hist e1"); + j.Draw("same hist e1"); + h.Draw("same hist e1"); def setPad1Attributes(pad1): pad1.SetGridx(1) @@ -167,27 +157,30 @@ def setPad2Attributes(pad2): pad2.SetTopMargin(0.06) pad2.SetBottomMargin(0.3) -def produceRateVsEtaPlot(h, i, j, col1, col2, col3, sty1, sty2, sty3, sty4, miny, maxy, k, l, plots, ext): +def produceRateVsEtaPlot(h, i, j, col1, col2, col3, sty1, sty2, sty3, sty4, + miny, maxy, k, l, plots, ext): c = TCanvas("c","c",800,800) c.Clear() + pad1 = TPad("pad1","top pad",0.0,0.25,1.0,1.0) pad1.Draw("") - pad2 = TPad("pad2","bottom pad",0,0.,1.0,.30) + pad2 = TPad("pad2","bottom pad",0.,0.,1.0,.30) pad2.Draw("same") pad1.cd() setPad1Attributes(pad1) - addRatePlots(h,i,j,col1,col2,col3,sty1,sty2,sty3,3355,miny,maxy) - addRatePlotLegend(h, i, j, k,l) - drawLumiLabel2() - + addRatePlot(h,i,j,col1,col2,col3,sty1,sty2,sty3,3355,miny,maxy) + leg = addRatePlotLegend(h, i, j, k, l) + tex = drawLumiLabel2() + pad2.cd() setPad2Attributes(pad2) gem_ratio = setHistoRatio(j, i, "", 0.01,2.0, col2) + gem_ratio.GetYaxis().SetNdivisions(3) gem_ratio.Draw("Pe") - addRatioPlotLegend(gem_ratio) - - c.SaveAs(plots + "rates_vs_eta__minpt" + l + "__PU100__def_" + k + "s_" + k + "s1b_" + k + "s1bgem" + ext) + leg = addRatioPlotLegend(gem_ratio,k) + + c.SaveAs(plots + "rates_vs_eta__minpt%d__PU100__def_%ds_%ds1b_%ds1bgem%s"%(l,k,k,k,ext)) def produceRateVsEtaPlotsForApproval(ext, plots): gStyle.SetOptStat(0) @@ -213,35 +206,35 @@ def produceRateVsEtaPlotsForApproval(ext, plots): ## styles sty1 = 3345 - sty2 = 2003 + sty2 = 3003 sty3 = 2002 ## Declaration of histograms - ttl = " L1 Single Muon Trigger CMS Simulation;L1 muon candidate #eta;rate [kHz]" - - vs_eta_minpt = "10" - h_rt_tf10_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2) - h_rt_tf10_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2) - h_rt_tf10_gpt10_2s1b = setHistoEta(f_g98_pt10, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2) - h_rt_tf10_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2) - h_rt_tf10_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2) - h_rt_tf10_gpt10_3s1b = setHistoEta(f_g98_pt10, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 7, 2) + ttl = " CMS Simulation Preliminary;L1 muon candidate #eta;Trigger rate [kHz]"; + + pt = 10 + h_rt_tf10_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s"%(pt), "_hAll100", ttl, col1, 1, 2) + h_rt_tf10_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s_2s1b"%(pt), "_hAll100", ttl, col2, 1, 2) + h_rt_tf10_gpt10_2s1b = setHistoEta(f_g98_pt10, "h_rt_gmt_csc_ptmax%d_eta_2s_2s1b"%(pt), "_hAll100", ttl, col3, 1, 2) + h_rt_tf10_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s"%(pt), "_hAll100", ttl, col1, 1, 2) + h_rt_tf10_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b"%(pt), "_hAll100", ttl, col2, 1, 2) + h_rt_tf10_gpt10_3s1b = setHistoEta(f_g98_pt10, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b"%(pt), "_hAll100", ttl, col3, 7, 2) - vs_eta_minpt = "20" - h_rt_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2) - h_rt_tf20_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2) - h_rt_tf20_gpt20_2s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2) - h_rt_tf20_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2) - h_rt_tf20_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2) - h_rt_tf20_gpt20_3s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 1, 2) - - vs_eta_minpt = "30" - h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, col1, 1, 2) - h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col2, 1, 2) - h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, col3, 1, 2) - h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, col1, 1, 2) - h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col2, 1, 2) - h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, col3, 1, 2) + pt = 20 + h_rt_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s"%(pt), "_hAll100", ttl, col1, 1, 2) + h_rt_tf20_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s_2s1b"%(pt), "_hAll100", ttl, col2, 1, 2) + h_rt_tf20_gpt20_2s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax%d_eta_2s_2s1b"%(pt), "_hAll100", ttl, col3, 1, 2) + h_rt_tf20_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s"%(pt), "_hAll100", ttl, col1, 1, 2) + h_rt_tf20_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b"%(pt), "_hAll100", ttl, col2, 1, 2) + h_rt_tf20_gpt20_3s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b"%(pt), "_hAll100", ttl, col3, 1, 2) + + pt = 30 + h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s"%(pt), "_hAll100", ttl, col1, 1, 2) + h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s_2s1b"%(pt), "_hAll100", ttl, col2, 1, 2) + h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax%d_eta_2s_2s1b"%(pt), "_hAll100", ttl, col3, 1, 2) + h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s"%(pt), "_hAll100", ttl, col1, 1, 2) + h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b"%(pt), "_hAll100", ttl, col2, 1, 2) + h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b"%(pt), "_hAll100", ttl, col3, 1, 2) ## Style gStyle.SetStatW(0.07) @@ -257,23 +250,174 @@ def produceRateVsEtaPlotsForApproval(ext, plots): ## ------------ +2 stubs, L1 candidate muon pt=10GeV ----------------## produceRateVsEtaPlot(h_rt_tf10_2s,h_rt_tf10_2s1b,h_rt_tf10_gpt10_2s1b, - col1,col2,col3,sty1,sty2,sty3,3355,0.01,80,"2","10",plots,ext) + col1,col2,col3,sty1,sty2,sty3,3355,0.01,80,2,10,plots,ext) ## ------------ +2 stubs, L1 candidate muon pt=20GeV ----------------## produceRateVsEtaPlot(h_rt_tf20_2s,h_rt_tf20_2s1b,h_rt_tf20_gpt20_2s1b, - col1,col2,col3,sty1,sty2,sty3,3355,0.01,40,"2","20",plots,ext) + col1,col2,col3,sty1,sty2,sty3,3355,0.01,40,2,20,plots,ext) ## ------------ +2 stubs, L1 candidate muon pt=30GeV ----------------## produceRateVsEtaPlot(h_rt_tf30_2s,h_rt_tf30_2s1b,h_rt_tf30_gpt30_2s1b, - col1,col2,col3,sty1,sty2,sty3,3355,0.01,30,"2","30",plots,ext) + col1,col2,col3,sty1,sty2,sty3,3355,0.01,30,2,30,plots,ext) ## ------------ +3 stubs, L1 candidate muon pt=10GeV ----------------## produceRateVsEtaPlot(h_rt_tf10_3s,h_rt_tf10_3s1b,h_rt_tf10_gpt10_3s1b, - col1,col2,col3,sty1,sty2,sty3,3355,0.01,25,"3","10",plots,ext) + col1,col2,col3,sty1,sty2,sty3,3355,0.01,25,3,10,plots,ext) ## ------------ +3 stubs, L1 candidate muon pt=20GeV ----------------## produceRateVsEtaPlot(h_rt_tf20_3s,h_rt_tf20_3s1b,h_rt_tf20_gpt20_3s1b, - col1,col2,col3,sty1,sty2,sty3,3355,0.01,10,"3","20",plots,ext) + col1,col2,col3,sty1,sty2,sty3,3355,0.01,10,3,20,plots,ext) ## ------------ +3 stubs, L1 candidate muon pt=30GeV ----------------## produceRateVsEtaPlot(h_rt_tf30_3s,h_rt_tf30_3s1b,h_rt_tf30_gpt30_3s1b, - col1,col2,col3,sty1,sty2,sty3,3355,0.01, 6,"3","30",plots,ext) + col1,col2,col3,sty1,sty2,sty3,3355,0.01, 6,3,30,plots,ext) if __name__ == "__main__": -## produceRateVsEtaPlotsForApproval(".C", "plots/rate_vs_eta/") produceRateVsEtaPlotsForApproval(".pdf", "plots/rate_vs_eta/") + +""" +void gem_rate_draw() +{ + -- KEEP THIS FRAGMENT FOR THE TIME BEING!! -- + -- NEED TO FIGURE OUT WHAT TO DO WITH ME1A -- + + // // Including the region ME1/1a + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + + // maxy = 30.;//10; + + // h_rt_tf20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf20_gpt20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf20_3s->Draw("hist e1"); + // h_rt_tf20_gpt20_3s1ab->Draw("hist e1 same"); + // h_rt_tf20_3s->Draw("hist e1 same"); + // h_rt_tf20_3s1ab->Draw("hist e1 same"); + + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); + // leg->AddEntry(h_rt_tf20_3s,"anywhere","l"); + // leg->AddEntry(h_rt_tf20_3s1ab,"with ME1 in 1.6<|#eta|","l"); + // leg->AddEntry(h_rt_tf20_gpt20_3s1ab,"with (ME1+GEM) in 1.6<|#eta|","l"); + // leg->Draw(); + + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); + + + // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1ab, h_rt_tf20_3s1ab, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); + + + + vs_eta_minpt = "30"; + ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate [kHz]"; + + + TH1D* h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); + TH1D* h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); + TH1D* h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); + TH1D* h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); + TH1D* h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); + TH1D* h_rt_tf30_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kAzure+2, 1, 2); + TH1D* h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); + TH1D* h_rt_tf30_gpt30_3s1ab = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kGreen, 7, 2); + + + + + + // //========================== Including the ME1a + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + + // h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); + // h_rt_tf30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + h_rt_tf30_gpt30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + // h_rt_tf30_3s->Draw("hist e1"); + // h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same"); + // h_rt_tf30_3s->Draw("hist e1 same"); + // h_rt_tf30_3s1ab->Draw("hist e1 same"); + + // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); + // leg->AddEntry(h_rt_tf30_3s,"anywhere","l"); + // leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|","l"); + // leg->AddEntry(h_rt_tf30_gpt30_3s1ab,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); + // leg->Draw(); + + // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); + // tex->SetNDC(); + // tex->Draw(); + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); + + // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1ab, h_rt_tf30_3s1ab, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); + + + + // //========================== Comparison with/withous Stub in ME1a ==========================// + + // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + + // h_rt_tf30_3s1b->Draw("hist e1"); + // h_rt_tf30_3s1ab->Draw("hist e1 same"); + + // TLegend *leg = new TLegend(0.2,0.65,.80,0.90,NULL,"brNDC"); + // leg->SetBorderSize(0); + // leg->SetFillStyle(0); + // leg->AddEntry(h_rt_tf30_3s1b,"Tracks: p_{T}>=30, 3+ stubs",""); + // leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + // leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|<2.4","l"); + // leg->Draw(); + + + // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); + + + // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; + // gPad->SetGridx(1);gPad->SetGridy(1); + + // gem_ratio = setHistoRatio2(h_rt_tf30_3s1ab, h_rt_tf30_3s1b, "", 0.,1.8); + // gem_ratio->Draw("e1"); + + // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio_compstubME1a.png").Data()); + + + //========================== Comparison with/withous Stub in ME1a + GEMS ==========================// + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + + h_rt_tf30_gpt30_3s1b->Draw("hist e1"); + h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same"); + + TLegend *leg = new TLegend(0.2,0.65,.80,0.90,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(h_rt_tf30_3s1b,"Tracks: p_{T}>=30, 3+ stubs",""); + leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); + leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|<2.4","l"); + leg->Draw(); + + + Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); +} +""" From 05df90d43f37be564c55f95927aef74521d498de Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 16 Sep 2013 23:13:48 +0200 Subject: [PATCH 116/182] update --- SimMuL1/scripts/drawplot_eff.C | 2 +- SimMuL1/scripts/effFunctions.C | 2 +- SimMuL1/scripts/getPTHistos.py | 10 +- SimMuL1/scripts/rateVsPtPlotter.py | 468 +++++++++++++++++++++++++++++ 4 files changed, 479 insertions(+), 3 deletions(-) create mode 100644 SimMuL1/scripts/rateVsPtPlotter.py diff --git a/SimMuL1/scripts/drawplot_eff.C b/SimMuL1/scripts/drawplot_eff.C index 204d87bfbc4ae..9599539251da2 100644 --- a/SimMuL1/scripts/drawplot_eff.C +++ b/SimMuL1/scripts/drawplot_eff.C @@ -214,7 +214,7 @@ void efficiency_2(TString f_name, TString p_name, TString pt, bool overlap) TGraphAsymmErrors* hgn = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;Generated muon phi #phi [deg];Efficiency", "h_odd", "(100,-10,10)", "mymod(phi*180./TMath::Pi(), 360/18.)", ok_eta&&Qn, ok_pad1 || ok_pad2,"", kRed); TGraphAsymmErrors* hgp = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;Generated muon phi #phi [deg];Effciency", "h_odd", "(100,-10,10)", "mymod(phi*180./TMath::Pi(), 360/18.)", ok_eta&&Qp, ok_pad1 || ok_pad2,"same", kBlue); double maxi = 1.0; - double mini = 0.9; + double mini = 0.0; hgn->SetMinimum(mini); hgn->SetMaximum(maxi); TLine *l1 = new TLine(-5,mini,-5,maxi); diff --git a/SimMuL1/scripts/effFunctions.C b/SimMuL1/scripts/effFunctions.C index c38497833bb5b..e30b14b044f1c 100644 --- a/SimMuL1/scripts/effFunctions.C +++ b/SimMuL1/scripts/effFunctions.C @@ -34,7 +34,7 @@ TGraphAsymmErrors* draw_geff(TTree *t, TString title, TString h_name, TString h_ if (!opt.Contains("same")) { num->Reset(); - num->GetYaxis()->SetRangeUser(0.9,1.0); + num->GetYaxis()->SetRangeUser(0.0,1.0); num->SetStats(0); num->SetTitle(title); num->Draw(); diff --git a/SimMuL1/scripts/getPTHistos.py b/SimMuL1/scripts/getPTHistos.py index 4568145dcd275..d1ae4edafba71 100644 --- a/SimMuL1/scripts/getPTHistos.py +++ b/SimMuL1/scripts/getPTHistos.py @@ -1,3 +1,10 @@ +from ROOT import * + +def getPTHisto(f_name, dir_name, h_name, clone_suffix = "_cln"): + f = TFile.Open(f_name) + h0 = f.Get("%s/%s"%(dir_name,h_name)).Clone(h_name + clone_suffix) + return h0 + def getPtHistos(f_def, f_gem, dname): if "_pat8" in dname: f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root" @@ -35,4 +42,5 @@ def getPtHistos(f_def, f_gem, dname): ##result_gmtsing = getPTHisto(f_gem, dir, "h_rt_gmt_ptmax_sing_1b", "_def") if __name__ == "__main__": - getPtHistos("f_def", "f_gem", "test") + #print confirmation message - not supposed to work in standalone mode + print "It works!" diff --git a/SimMuL1/scripts/rateVsPtPlotter.py b/SimMuL1/scripts/rateVsPtPlotter.py new file mode 100644 index 0000000000000..94609f7613ecd --- /dev/null +++ b/SimMuL1/scripts/rateVsPtPlotter.py @@ -0,0 +1,468 @@ +## ROOT modules +from ROOT import * +from getPTHistos import * + +## run quiet mode +import sys +sys.argv.append( '-b' ) + +import ROOT +ROOT.gROOT.SetBatch(1) + +## functions +def drawEtaLabel(minEta, maxEta, x=0.17, y=0.35, font_size=0.): + label = minEta + " < |#eta| < " + maxEta + tex = TLatex(x, y,label) + if font_size > 0.: + tex.SetFontSize(font_size) + tex.SetTextSize(0.05) + tex.SetNDC() + tex.Draw() + return tex + +def drawLumiLabel(x=0.17, y=0.35): + tex = TLatex(x, y,"L = 4*10^{34} cm^{-2} s^{-1}") + tex.SetTextSize(0.05) + tex.SetNDC() + tex.Draw() + return tex + +def drawL1Label(x=0.17, y=0.35): + tex = TLatex(x, y,"L1 trigger in 2012 configuration") + tex.SetTextSize(0.04) + tex.SetNDC() + tex.Draw() + return tex + +def produceRatePlot(h, i, j, m, col0, col1, col2, col3, miny, maxy, k, l, plots, ext): + c = TCanvas("c","c",800,800) + c.Clear() + pad1 = TPad("pad1","top pad",0.0,0.25,1.0,1.0) + pad1.Draw() + pad2 = TPad("pad2","bottom pad",0,0.,1.0,.30) + pad2.Draw() + + pad1.cd() + pad1.SetLogx(1) + pad1.SetLogy(1) + pad1.SetGridx(1) + pad1.SetGridy(1) + pad1.SetFrameBorderMode(0) + pad1.SetFillColor(kWhite) + + h.SetFillColor(col0) + i.SetFillColor(col1) + j.SetFillColor(col2) + m.SetFillColor(col3) + + h.Draw("e3") + i.Draw("same e3") + j.Draw("same e3") + m.Draw("same e3") + h.Draw("same e3") + h.GetYaxis().SetRangeUser(miny, maxy) + h.GetXaxis().SetTitle("") + + leg = TLegend(0.45,0.7,.93,0.93,"","brNDC") + leg.SetMargin(0.25) + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetTextSize(0.04) + leg.SetFillStyle(1001) + leg.SetFillColor(kWhite) + leg.AddEntry(h, "L1 single muon trigger","f") + leg.AddEntry(0, "(final 2012 configuration)","") + ##leg.AddEntry((TObject*)0, "L1 selections (#geq " + k + " stations):","") + leg.AddEntry(i,"CSC #geq%d stubs (anywhere)"%(k),"f") + leg.AddEntry(j,"CSC #geq%d stubs (one in ME1/b)"%(k),"f") + leg.AddEntry(m,"GEM+CSC integrated trigger","f") + leg.Draw() + + drawLumiLabel(0.17,.3) + drawEtaLabel("1.64","2.14",0.17,.37) + + pad2.cd() + pad2.SetLogx(1) + pad2.SetLogy(1) + pad2.SetGridx(1) + pad2.SetGridy(1) + pad2.SetFillColor(kWhite) + pad2.SetFrameBorderMode(0) + pad2.SetLeftMargin(0.126) + pad2.SetRightMargin(0.04) + pad2.SetTopMargin(0.06) + pad2.SetBottomMargin(0.4) + + hh_ratio = setHistoRatio(m, j, "", 0.01,1.1,col2) + hh_ratio.GetXaxis().SetTitle("L1 muon candidate p_{T}^{cut} [GeV/c]") + hh_ratio.GetYaxis().SetNdivisions(3) + hh_ratio.Draw("P") + + hh_ratio_gmt = setHistoRatio(m, h, "", 0.01,1.1,col0) + hh_ratio_gmt.Draw("P same") + + leg = TLegend(0.15,0.45,.45,0.7,NULL,"brNDC") + leg.SetMargin(0.1) + leg.SetBorderSize(0) + leg.SetTextSize(0.1) + leg.SetFillStyle(1001) + leg.SetFillColor(kWhite) + leg.AddEntry(hh_ratio_gmt, "(GEM+CSC)/GMT","p") + leg.AddEntry(hh_ratio, "(GEM+CSC)/CSC #geq%d stubs"%(k),"p") + leg.Draw("same") + + c.SaveAs(plots + "rates_vs_pt__PU100__def_%ds_%ds1b_%ds1bgem__%s%s"%(k,k,k,l,ext)) + + +""" +TString ext = ".png"; +TString filesDir = "files/"; +TString plotDir = "plots/"; + +void getPTHistos(TString dname) +{ +TString f_def = filesDir; +TString f_gem = filesDir; + +if (dname.Contains("_pat8")) f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root"; +if (dname == "minbias_pt05_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat8.root"; +if (dname == "minbias_pt06_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat8.root"; +if (dname == "minbias_pt10_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat8.root"; +if (dname == "minbias_pt15_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat8.root"; +if (dname == "minbias_pt20_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat8.root"; +if (dname == "minbias_pt30_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat8.root"; +if (dname == "minbias_pt40_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat8.root"; + +if (dname.Contains("_pat2")) f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; +if (dname == "minbias_pt05_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat2.root"; +if (dname == "minbias_pt06_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat2.root"; +if (dname == "minbias_pt10_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat2.root"; +if (dname == "minbias_pt15_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat2.root"; +if (dname == "minbias_pt20_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat2.root"; +if (dname == "minbias_pt30_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat2.root"; +if (dname == "minbias_pt40_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat2.root"; + +result_def = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_1b", "_def"); +result_def_2s = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_2s_1b", "_def"); +result_def_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_def"); +result_def_2s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_def"); +result_def_eta_all = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s", "_def"); +result_def_eta_all_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_def"); +result_def_eta_no1a = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_no1a", "_def"); +result_def_eta_no1a_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_def"); +result_gmtsing = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); + +result_gem = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_gem"); +result_gem_2s1b = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_gem"); +result_gem_eta_all = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_gem"); +result_gem_eta_no1a = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_gem"); +//result_gmtsing = getPTHisto(f_gem, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); +} +""" + + +void drawplot_frankenstein_ptshiftX() +{ + gROOT.ProcessLine(".L drawplot_gmtrt.C"); + + //gem_dir = "gemPTX/"; + gem_dir = "plots/rate_vs_pt_shiftX/"; + gem_label = "gem98"; + +//gem_dir = "gem95/"; gem_label = "gem95"; + +//do_not_print = true; + +gROOT.SetBatch(true); + +//gStyle.SetStatW(0.13); +//gStyle.SetStatH(0.08); +gStyle.SetStatW(0.07); +gStyle.SetStatH(0.06); + +gStyle.SetOptStat(0); + +gStyle.SetTitleStyle(0); +gStyle.SetTitleAlign(13);// coord in top left +gStyle.SetTitleX(0.); +gStyle.SetTitleY(1.); +gStyle.SetTitleW(1); +gStyle.SetTitleH(0.058); +gStyle.SetTitleBorderSize(0); + +gStyle.SetPadLeftMargin(0.126); +gStyle.SetPadRightMargin(0.04); +gStyle.SetPadTopMargin(0.06); +gStyle.SetPadBottomMargin(0.13); + +gStyle.SetMarkerStyle(1); + +TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; +gPad.SetLogx(1); +gPad.SetGridx(1);gPad.SetGridy(1); + +TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; +gPad.SetLogx(1);gPad.SetLogy(1); +gPad.SetGridx(1);gPad.SetGridy(1); + + +// ********** PAT2 ********** + +getPTHistos("minbias_pt10_pat2"); +hh = (TH1D*)result_def_3s1b.Clone("gem_new"); +for (int b = hh.FindBin(7.01); b <= hh.GetNbinsX(); ++b) hh.SetBinContent(b, 0); +hh_all = (TH1D*)result_def_eta_all_3s1b.Clone("gem_new_eta_all"); +for (int b = hh_all.FindBin(7.01); b <= hh_all.GetNbinsX(); ++b) hh_all.SetBinContent(b, 0); +hh_no1a = (TH1D*)result_def_eta_no1a_3s1b.Clone("gem_new_eta_no1a"); +for (int b = hh_no1a.FindBin(7.01); b <= hh_no1a.GetNbinsX(); ++b) hh_no1a.SetBinContent(b, 0); +hh_2s1b = (TH1D*)result_def_2s1b.Clone("gem_new_2s1b"); +for (int b = hh_2s1b.FindBin(7.01); b <= hh_2s1b.GetNbinsX(); ++b) hh_2s1b.SetBinContent(b, 0); + +h06 = (TH1D*)result_gem.Clone("gem_new_06"); +for (int b = h06.FindBin(7.01); b < h06.FindBin(8.01); ++b) {hh.SetBinContent(b, h06.GetBinContent(b)); hh.SetBinError(b, h06.GetBinError(b));} +h06_all = (TH1D*)result_gem_eta_all.Clone("gem_new_eta_all_06"); +for (int b = h06_all.FindBin(7.01); b < h06_all.FindBin(8.01); ++b) {hh_all.SetBinContent(b, h06_all.GetBinContent(b)); hh_all.SetBinError(b, h06_all.GetBinError(b));} +h06_no1a = (TH1D*)result_gem_eta_no1a.Clone("gem_new_eta_no1a_06"); +for (int b = h06_no1a.FindBin(7.01); b < h06_no1a.FindBin(8.01); ++b) {hh_no1a.SetBinContent(b, h06_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h06_no1a.GetBinError(b));} +h06_2s1b = (TH1D*)result_gem_2s1b.Clone("gem_new_2s1b_06"); +for (int b = h06_2s1b.FindBin(7.01); b < h06_2s1b.FindBin(8.01); ++b) {hh_2s1b.SetBinContent(b, h06_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h06_2s1b.GetBinError(b));} + +getPTHistos("minbias_pt15_pat2"); +h10 = (TH1D*)result_gem.Clone("gem10"); +for (int b = h10.FindBin(8.01); b < h10.FindBin(10.01); ++b) {hh.SetBinContent(b, h10.GetBinContent(b)); hh.SetBinError(b, h10.GetBinError(b));} +h10_all = (TH1D*)result_gem_eta_all.Clone("gem_new_eta_all_10"); +for (int b = h10_all.FindBin(8.01); b < h10_all.FindBin(10.01); ++b) {hh_all.SetBinContent(b, h10_all.GetBinContent(b)); hh_all.SetBinError(b, h10_all.GetBinError(b));} +h10_no1a = (TH1D*)result_gem_eta_no1a.Clone("gem_new_eta_no1a_10"); +for (int b = h10_no1a.FindBin(8.01); b < h10_no1a.FindBin(10.01); ++b) {hh_no1a.SetBinContent(b, h10_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h10_no1a.GetBinError(b));} +h10_2s1b = (TH1D*)result_gem_2s1b.Clone("gem_new_2s1b_10"); +for (int b = h10_2s1b.FindBin(8.01); b < h10_2s1b.FindBin(10.01); ++b) {hh_2s1b.SetBinContent(b, h10_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h10_2s1b.GetBinError(b));} + +getPTHistos("minbias_pt20_pat2"); +h15 = (TH1D*)result_gem.Clone("gem15"); +for (int b = h15.FindBin(10.01); b < h15.FindBin(15.01); ++b) {hh.SetBinContent(b, h15.GetBinContent(b)); hh.SetBinError(b, h15.GetBinError(b));} +h15_all = (TH1D*)result_gem_eta_all.Clone("gem_new_eta_all_15"); +for (int b = h15_all.FindBin(10.01); b < h15_all.FindBin(15.01); ++b) {hh_all.SetBinContent(b, h15_all.GetBinContent(b)); hh_all.SetBinError(b, h15_all.GetBinError(b));} +h15_no1a = (TH1D*)result_gem_eta_no1a.Clone("gem_new_eta_no1a_15"); +for (int b = h15_no1a.FindBin(10.01); b < h15_no1a.FindBin(15.01); ++b) {hh_no1a.SetBinContent(b, h15_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h15_no1a.GetBinError(b));} +h15_2s1b = (TH1D*)result_gem_2s1b.Clone("gem_new_2s1b_15"); +for (int b = h15_2s1b.FindBin(10.01); b < h15_2s1b.FindBin(15.01); ++b) {hh_2s1b.SetBinContent(b, h15_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h15_2s1b.GetBinError(b));} + +getPTHistos("minbias_pt30_pat2"); +h20 = (TH1D*)result_gem.Clone("gem20"); +for (int b = h20.FindBin(15.01); b < h20.FindBin(20.01); ++b) {hh.SetBinContent(b, h20.GetBinContent(b)); hh.SetBinError(b, h20.GetBinError(b));} +h20_all = (TH1D*)result_gem_eta_all.Clone("gem_new_eta_all_20"); +for (int b = h20_all.FindBin(15.01); b < h20_all.FindBin(20.01); ++b) {hh_all.SetBinContent(b, h20_all.GetBinContent(b)); hh_all.SetBinError(b, h20_all.GetBinError(b));} +h20_no1a = (TH1D*)result_gem_eta_no1a.Clone("gem_new_eta_no1a_20"); +for (int b = h20_no1a.FindBin(15.01); b < h20_no1a.FindBin(20.01); ++b) {hh_no1a.SetBinContent(b, h20_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h20_no1a.GetBinError(b));} +h20_2s1b = (TH1D*)result_gem_2s1b.Clone("gem_new_2s1b_20"); +for (int b = h20_2s1b.FindBin(15.01); b < h20_2s1b.FindBin(20.01); ++b) {hh_2s1b.SetBinContent(b, h20_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h20_2s1b.GetBinError(b));} + +getPTHistos("minbias_pt40_pat2"); +h30 = (TH1D*)result_gem.Clone("gem30"); +for (int b = h30.FindBin(20.01); b <= h30.GetNbinsX(); ++b) {hh.SetBinContent(b, h30.GetBinContent(b)); hh.SetBinError(b, h30.GetBinError(b));} +h30_all = (TH1D*)result_gem_eta_all.Clone("gem_new_eta_all_30"); +for (int b = h30_all.FindBin(20.01); b < h30_all.GetNbinsX(); ++b) {hh_all.SetBinContent(b, h30_all.GetBinContent(b)); hh_all.SetBinError(b, h30_all.GetBinError(b));} +h30_no1a = (TH1D*)result_gem_eta_no1a.Clone("gem_new_eta_no1a_30"); +for (int b = h30_no1a.FindBin(20.01); b < h30_no1a.GetNbinsX(); ++b) {hh_no1a.SetBinContent(b, h30_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h30_no1a.GetBinError(b));} +h30_2s1b = (TH1D*)result_gem_2s1b.Clone("gem_new_2s1b_30"); +for (int b = h30_2s1b.FindBin(20.01); b < h30_2s1b.GetNbinsX(); ++b) {hh_2s1b.SetBinContent(b, h30_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h30_2s1b.GetBinError(b));} + +for (int b = 1; b <= hh.GetNbinsX(); ++b) if (hh.GetBinContent(b)==0) hh.SetBinError(b, 0.); +for (int b = 1; b <= hh_all.GetNbinsX(); ++b) if (hh_all.GetBinContent(b)==0) hh_all.SetBinError(b, 0.); +for (int b = 1; b <= hh_no1a.GetNbinsX(); ++b) if (hh_no1a.GetBinContent(b)==0) hh_no1a.SetBinError(b, 0.); +for (int b = 1; b <= hh_2s1b.GetNbinsX(); ++b) if (hh_2s1b.GetBinContent(b)==0) hh_2s1b.SetBinError(b, 0.); + + +//TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]"; + +// TString the_ttl = " L1 Single Muon Trigger CMS Simulation Preliminary;L1 candidate muon p_{T}^{cut} [GeV/c];rate [kHz]"; + TString the_ttl = " CMS Simulation Preliminary;L1 muon candidate p_{T}^{cut} [GeV/c];Trigger rate [kHz]"; + + + +hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); +hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); +hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); +hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); + +result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); + +result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); +result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); +result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); +result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); +result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); +result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); +result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); +result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); + +hh.SetFillColor(kGreen+4); +hh_all.SetFillColor(kGreen+4); +hh_no1a.SetFillColor(kGreen+4); +hh_2s1b.SetFillColor(kGreen+4); + +result_def_2s__pat2 = (TH1D*) result_def_2s.Clone("result_def_2s__pat2"); +result_def_3s__pat2 = (TH1D*) result_def.Clone("result_def_3s__pat2"); +result_def_2s1b__pat2 = (TH1D*) result_def_2s1b.Clone("result_def_2s1b__pat2"); +result_def_3s1b__pat2 = (TH1D*) result_def_3s1b.Clone("result_def_3s1b__pat2"); +result_gmtsing__pat2 = (TH1D*) result_gmtsing.Clone("result_gmtsing__pat2");; + +result_gem_2s1b__pat2 = (TH1D*) hh_2s1b.Clone("result_gem_2s1b__pat2"); +result_gem_3s1b__pat2 = (TH1D*) hh.Clone("result_gem_3s1b__pat2"); + + +// ********** PAT8 ********** + +getPTHistos("minbias_pt10_pat8"); +hh = (TH1D*)result_def_3s1b.Clone("gem_new"); +for (int b = hh.FindBin(7.01); b <= hh.GetNbinsX(); ++b) hh.SetBinContent(b, 0); +hh_all = (TH1D*)result_def_eta_all_3s1b.Clone("gem_new_eta_all"); +for (int b = hh_all.FindBin(7.01); b <= hh_all.GetNbinsX(); ++b) hh_all.SetBinContent(b, 0); +hh_no1a = (TH1D*)result_def_eta_no1a_3s1b.Clone("gem_new_eta_no1a"); +for (int b = hh_no1a.FindBin(7.01); b <= hh_no1a.GetNbinsX(); ++b) hh_no1a.SetBinContent(b, 0); +hh_2s1b = (TH1D*)result_def_2s1b.Clone("gem_new_2s1b"); +for (int b = hh_2s1b.FindBin(7.01); b <= hh_2s1b.GetNbinsX(); ++b) hh_2s1b.SetBinContent(b, 0); + +h06 = (TH1D*)result_gem.Clone("gem_new_06"); +for (int b = h06.FindBin(7.01); b < h06.FindBin(8.01); ++b) {hh.SetBinContent(b, h06.GetBinContent(b)); hh.SetBinError(b, h06.GetBinError(b));} +h06_all = (TH1D*)result_gem_eta_all.Clone("gem_new_eta_all_06"); +for (int b = h06_all.FindBin(7.01); b < h06_all.FindBin(8.01); ++b) {hh_all.SetBinContent(b, h06_all.GetBinContent(b)); hh_all.SetBinError(b, h06_all.GetBinError(b));} +h06_no1a = (TH1D*)result_gem_eta_no1a.Clone("gem_new_eta_no1a_06"); +for (int b = h06_no1a.FindBin(7.01); b < h06_no1a.FindBin(8.01); ++b) {hh_no1a.SetBinContent(b, h06_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h06_no1a.GetBinError(b));} +h06_2s1b = (TH1D*)result_gem_2s1b.Clone("gem_new_2s1b_06"); +for (int b = h06_2s1b.FindBin(7.01); b < h06_2s1b.FindBin(8.01); ++b) {hh_2s1b.SetBinContent(b, h06_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h06_2s1b.GetBinError(b));} + +getPTHistos("minbias_pt15_pat8"); +h10 = (TH1D*)result_gem.Clone("gem10"); +for (int b = h10.FindBin(8.01); b < h10.FindBin(10.01); ++b) {hh.SetBinContent(b, h10.GetBinContent(b)); hh.SetBinError(b, h10.GetBinError(b));} +h10_all = (TH1D*)result_gem_eta_all.Clone("gem_new_eta_all_10"); +for (int b = h10_all.FindBin(8.01); b < h10_all.FindBin(10.01); ++b) {hh_all.SetBinContent(b, h10_all.GetBinContent(b)); hh_all.SetBinError(b, h10_all.GetBinError(b));} +h10_no1a = (TH1D*)result_gem_eta_no1a.Clone("gem_new_eta_no1a_10"); +for (int b = h10_no1a.FindBin(8.01); b < h10_no1a.FindBin(10.01); ++b) {hh_no1a.SetBinContent(b, h10_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h10_no1a.GetBinError(b));} +h10_2s1b = (TH1D*)result_gem_2s1b.Clone("gem_new_2s1b_10"); +for (int b = h10_2s1b.FindBin(8.01); b < h10_2s1b.FindBin(10.01); ++b) {hh_2s1b.SetBinContent(b, h10_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h10_2s1b.GetBinError(b));} + +getPTHistos("minbias_pt20_pat8"); +h15 = (TH1D*)result_gem.Clone("gem15"); +for (int b = h15.FindBin(10.01); b < h15.FindBin(15.01); ++b) {hh.SetBinContent(b, h15.GetBinContent(b)); hh.SetBinError(b, h15.GetBinError(b));} +h15_all = (TH1D*)result_gem_eta_all.Clone("gem_new_eta_all_15"); +for (int b = h15_all.FindBin(10.01); b < h15_all.FindBin(15.01); ++b) {hh_all.SetBinContent(b, h15_all.GetBinContent(b)); hh_all.SetBinError(b, h15_all.GetBinError(b));} +h15_no1a = (TH1D*)result_gem_eta_no1a.Clone("gem_new_eta_no1a_15"); +for (int b = h15_no1a.FindBin(10.01); b < h15_no1a.FindBin(15.01); ++b) {hh_no1a.SetBinContent(b, h15_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h15_no1a.GetBinError(b));} +h15_2s1b = (TH1D*)result_gem_2s1b.Clone("gem_new_2s1b_15"); +for (int b = h15_2s1b.FindBin(10.01); b < h15_2s1b.FindBin(15.01); ++b) {hh_2s1b.SetBinContent(b, h15_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h15_2s1b.GetBinError(b));} + +getPTHistos("minbias_pt30_pat8"); +h20 = (TH1D*)result_gem.Clone("gem20"); +for (int b = h20.FindBin(15.01); b < h20.FindBin(20.01); ++b) {hh.SetBinContent(b, h20.GetBinContent(b)); hh.SetBinError(b, h20.GetBinError(b));} +h20_all = (TH1D*)result_gem_eta_all.Clone("gem_new_eta_all_20"); +for (int b = h20_all.FindBin(15.01); b < h20_all.FindBin(20.01); ++b) {hh_all.SetBinContent(b, h20_all.GetBinContent(b)); hh_all.SetBinError(b, h20_all.GetBinError(b));} +h20_no1a = (TH1D*)result_gem_eta_no1a.Clone("gem_new_eta_no1a_20"); +for (int b = h20_no1a.FindBin(15.01); b < h20_no1a.FindBin(20.01); ++b) {hh_no1a.SetBinContent(b, h20_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h20_no1a.GetBinError(b));} +h20_2s1b = (TH1D*)result_gem_2s1b.Clone("gem_new_2s1b_20"); +for (int b = h20_2s1b.FindBin(15.01); b < h20_2s1b.FindBin(20.01); ++b) {hh_2s1b.SetBinContent(b, h20_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h20_2s1b.GetBinError(b));} + +getPTHistos("minbias_pt40_pat8"); +h30 = (TH1D*)result_gem.Clone("gem30"); +for (int b = h30.FindBin(20.01); b <= h30.GetNbinsX(); ++b) {hh.SetBinContent(b, h30.GetBinContent(b)); hh.SetBinError(b, h30.GetBinError(b));} +h30_all = (TH1D*)result_gem_eta_all.Clone("gem_new_eta_all_30"); +for (int b = h30_all.FindBin(20.01); b < h30_all.GetNbinsX(); ++b) {hh_all.SetBinContent(b, h30_all.GetBinContent(b)); hh_all.SetBinError(b, h30_all.GetBinError(b));} +h30_no1a = (TH1D*)result_gem_eta_no1a.Clone("gem_new_eta_no1a_30"); +for (int b = h30_no1a.FindBin(20.01); b < h30_no1a.GetNbinsX(); ++b) {hh_no1a.SetBinContent(b, h30_no1a.GetBinContent(b)); hh_no1a.SetBinError(b, h30_no1a.GetBinError(b));} +h30_2s1b = (TH1D*)result_gem_2s1b.Clone("gem_new_2s1b_30"); +for (int b = h30_2s1b.FindBin(20.01); b < h30_2s1b.GetNbinsX(); ++b) {hh_2s1b.SetBinContent(b, h30_2s1b.GetBinContent(b)); hh_2s1b.SetBinError(b, h30_2s1b.GetBinError(b));} + +for (int b = 1; b <= hh.GetNbinsX(); ++b) if (hh.GetBinContent(b)==0) hh.SetBinError(b, 0.); +for (int b = 1; b <= hh_all.GetNbinsX(); ++b) if (hh_all.GetBinContent(b)==0) hh_all.SetBinError(b, 0.); +for (int b = 1; b <= hh_no1a.GetNbinsX(); ++b) if (hh_no1a.GetBinContent(b)==0) hh_no1a.SetBinError(b, 0.); +for (int b = 1; b <= hh_2s1b.GetNbinsX(); ++b) if (hh_2s1b.GetBinContent(b)==0) hh_2s1b.SetBinError(b, 0.); + + +hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); +hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); +hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); +hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); + +result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); + +result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); +result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); +result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); +result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); +result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); +result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); +result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); +result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); + +hh.SetFillColor(kGreen+4); +hh_all.SetFillColor(kGreen+4); +hh_no1a.SetFillColor(kGreen+4); +hh_2s1b.SetFillColor(kGreen+4); + +result_def_2s__pat8 = (TH1D*) result_def_2s.Clone("result_def_2s__pat8"); +result_def_3s__pat8 = (TH1D*) result_def.Clone("result_def_3s__pat8"); +result_def_2s1b__pat8 = (TH1D*) result_def_2s1b.Clone("result_def_2s1b__pat8"); +result_def_3s1b__pat8 = (TH1D*) result_def_3s1b.Clone("result_def_3s1b__pat8"); +result_gmtsing__pat8 = (TH1D*) result_gmtsing.Clone("result_gmtsing__pat8");; + +result_gem_2s1b__pat8 = (TH1D*) hh_2s1b.Clone("result_gem_2s1b__pat8"); +result_gem_3s1b__pat8 = (TH1D*) hh.Clone("result_gem_3s1b__pat8"); + +//-------------------------- "Sequential" combinations ----------------------------- + +result_def_2s__pat2.SetFillColor(kAzure+2); +result_def_2s1b__pat2.SetFillColor(kAzure+5); +result_def_3s__pat2.SetFillColor(kAzure+3); +result_def_3s1b__pat2.SetFillColor(kAzure+6); + +result_def_2s__pat8.SetFillColor(kViolet); +result_def_2s1b__pat8.SetFillColor(kViolet+3); +result_def_3s__pat8.SetFillColor(kViolet+1); +result_def_3s1b__pat8.SetFillColor(kViolet+4); + +result_gmtsing__pat2.SetFillColor(kRed); +result_gmtsing__pat8.SetFillColor(kRed); + +result_gem_2s1b__pat2.SetFillColor(kGreen+1); +result_gem_3s1b__pat2.SetFillColor(kGreen+3); +result_gem_2s1b__pat8.SetFillColor(kGreen-2); +result_gem_3s1b__pat8.SetFillColor(kGreen-3); + +/* +result_def_2s__pat2.GetYaxis().SetRangeUser(0.01, 3000.); +result_def_2s__pat8.GetYaxis().SetRangeUser(0.01, 3000.); +result_def_3s__pat2.GetYaxis().SetRangeUser(0.01, 3000.); +result_def_3s__pat8.GetYaxis().SetRangeUser(0.01, 3000.); +result_gmtsing__pat2.GetYaxis().SetRangeUser(.1, 1000.); +result_gmtsing__pat8.GetYaxis().SetRangeUser(.1, 1000.); +*/ +result_def_2s__pat2.GetYaxis().SetRangeUser(0.01, 8000.); +result_def_2s__pat8.GetYaxis().SetRangeUser(0.01, 8000.); +result_def_3s__pat2.GetYaxis().SetRangeUser(0.01, 8000.); +result_def_3s__pat8.GetYaxis().SetRangeUser(0.01, 8000.); +result_gem_2s1b__pat2.GetYaxis().SetRangeUser(0.01, 8000.); +result_gem_3s1b__pat2.GetYaxis().SetRangeUser(0.01, 8000.); +result_gmtsing__pat2.GetYaxis().SetRangeUser(.1, 5000.); +result_gmtsing__pat8.GetYaxis().SetRangeUser(.1, 5000.); + + + + Color_t col0 = kRed; + Color_t col1 = kViolet+1; + Color_t col2 = kAzure+2; + Color_t col3 = kGreen-2; + + TString plots = "plots/rate_vs_pt_shiftX/"; + TString ext = ".png"; + + + + produceRatePlot(result_gmtsing, result_def_2s__pat2, result_def_2s1b__pat2, result_gem_2s1b__pat2, + col0, col1, col2, col3, 0.1, 10000, "2", "loose", plots, ext); + ##produceRatePlot(result_gmtsing, result_def_2s, result_def_2s1b, result_gem_2s1b, + ## col0, col1, col2, col3, 0.1, 10000, "2", "tight", plots, ext); + produceRatePlot(result_gmtsing, result_def_3s__pat2, result_def_3s1b__pat2, result_gem_3s1b__pat2, + col0, col1, col2, col3, 0.01, 10000, "3", "loose", plots, ext); + ## produceRatePlot(result_gmtsing, result_def_3s, result_def_3s1b, result_gem_3s1b, + ## col0, col1, col2, col3, 0.01, 10000, "3", "tight", plots, ext); + From db5b6dd17c0951c55b2745dd615996385739e719 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 16 Sep 2013 23:33:03 +0200 Subject: [PATCH 117/182] update --- SimMuL1/scripts/drawplot_eff.C | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SimMuL1/scripts/drawplot_eff.C b/SimMuL1/scripts/drawplot_eff.C index 9599539251da2..16c85d0068c52 100644 --- a/SimMuL1/scripts/drawplot_eff.C +++ b/SimMuL1/scripts/drawplot_eff.C @@ -164,8 +164,9 @@ void efficiency_1(TString f_name, TString p_name, TString pt, bool overlap) TH1F* ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation Preliminary;LCT half-strip number;Efficiency", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , cut1, "", kRed); TH1F* he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation Preliminary;LCT half-strip number;Efficiency", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , cut2, "same"); ho->SetMinimum(0.9); - ho->GetXaxis()->SetLabelSize(0.05); - ho->GetYaxis()->SetLabelSize(0.05); + ho->GetXaxis()->SetLabelSize(0.06); + ho->GetYaxis()->SetLabelSize(0.06); + TLegend *leg = new TLegend(0.25,0.23,.75,0.5, NULL, "brNDC"); leg->SetBorderSize(0); @@ -217,6 +218,9 @@ void efficiency_2(TString f_name, TString p_name, TString pt, bool overlap) double mini = 0.0; hgn->SetMinimum(mini); hgn->SetMaximum(maxi); + hgn->GetXaxis()->SetLabelSize(0.06); + hgn->GetYaxis()->SetLabelSize(0.06); + TLine *l1 = new TLine(-5,mini,-5,maxi); l1->SetLineStyle(2); l1->Draw(); @@ -237,10 +241,6 @@ void efficiency_2(TString f_name, TString p_name, TString pt, bool overlap) // TH1F* ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;local #phi [deg];Efficiency", "h_odd", "(130,-5,5)", "fmod(180*phi/TMath::Pi(),5)", ok_lct1 && ok_eta , cut1, "", kRed); // TH1F* he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;local #phi [deg];Efficiency", "h_evn", "(130,-5,5)", "fmod(180*phi/TMath::Pi(),5)", ok_lct2 && ok_eta , cut2, "same"); // ho->SetMinimum(0.); - hgn->GetXaxis()->SetLabelSize(0.05); - hgn->GetYaxis()->SetLabelSize(0.05); - - TLegend *leg = new TLegend(0.25,0.23,.75,0.5, NULL, "brNDC"); leg->SetBorderSize(0); From 8f7b2bde1a21811da1811f90db352f0f412ba0c3 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 16 Sep 2013 23:35:48 +0200 Subject: [PATCH 118/182] commented out the temporary C code --- SimMuL1/scripts/rateVsPtPlotter.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SimMuL1/scripts/rateVsPtPlotter.py b/SimMuL1/scripts/rateVsPtPlotter.py index 94609f7613ecd..9a671535a1519 100644 --- a/SimMuL1/scripts/rateVsPtPlotter.py +++ b/SimMuL1/scripts/rateVsPtPlotter.py @@ -158,7 +158,6 @@ def produceRatePlot(h, i, j, m, col0, col1, col2, col3, miny, maxy, k, l, plots, result_gem_eta_no1a = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_gem"); //result_gmtsing = getPTHisto(f_gem, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); } -""" void drawplot_frankenstein_ptshiftX() @@ -465,4 +464,4 @@ def produceRatePlot(h, i, j, m, col0, col1, col2, col3, miny, maxy, k, l, plots, col0, col1, col2, col3, 0.01, 10000, "3", "loose", plots, ext); ## produceRatePlot(result_gmtsing, result_def_3s, result_def_3s1b, result_gem_3s1b, ## col0, col1, col2, col3, 0.01, 10000, "3", "tight", plots, ext); - +""" From 12d7d649450f9b5813e7dce1e26617805fd22ad6 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 17 Sep 2013 10:14:42 +0200 Subject: [PATCH 119/182] extending eta range --- GEMValidation/python/SingleMuPt40Fwdv2_cfi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GEMValidation/python/SingleMuPt40Fwdv2_cfi.py b/GEMValidation/python/SingleMuPt40Fwdv2_cfi.py index 9faf973607da9..f1d6225cbb547 100755 --- a/GEMValidation/python/SingleMuPt40Fwdv2_cfi.py +++ b/GEMValidation/python/SingleMuPt40Fwdv2_cfi.py @@ -7,8 +7,8 @@ PartID = cms.vint32(-13), MinPhi = cms.double(-3.14159265359), MaxPhi = cms.double(3.14159265359), - MinEta = cms.double(-2.2), - MaxEta = cms.double(2.2) + MinEta = cms.double(-2.5), + MaxEta = cms.double(2.5) ), Verbosity = cms.untracked.int32(0), psethack = cms.string('single mu pt 40 forward'), From 6e36d174c61a31336d9b95092d219dcef757f019 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 17 Sep 2013 10:29:32 +0200 Subject: [PATCH 120/182] Updating to SLHC version --- .../python/SingleMuPt40Fwdv2_cfi_GEN_SIM.py | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/GEMValidation/python/SingleMuPt40Fwdv2_cfi_GEN_SIM.py b/GEMValidation/python/SingleMuPt40Fwdv2_cfi_GEN_SIM.py index 02b14a9fb83a6..4c9050c1453e7 100644 --- a/GEMValidation/python/SingleMuPt40Fwdv2_cfi_GEN_SIM.py +++ b/GEMValidation/python/SingleMuPt40Fwdv2_cfi_GEN_SIM.py @@ -1,8 +1,8 @@ # Auto generated configuration file # using: -# Revision: 1.400 -# Source: /local/reps/CMSSW/CMSSW/Configuration/PyReleaseValidation/python/ConfigBuilder.py,v -# with command line options: SingleMuPt100_cfi -s GEN,SIM --conditions POSTLS161_V12::All --geometry Geometry/GEMGeometry/cmsExtendedGeometryPostLS1plusGEMXML_cfi --datatier GEN-SIM --eventcontent FEVTDEBUG -n 200 --no_exec --fileout out_sim.root +# Revision: 1.14 +# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v +# with command line options: SingleMuPt40Fwdv2_cfi -s GEN,SIM --conditions auto:upgrade2019 --customise SLHCUpgradeSimulations/Configuration/combinedCustoms.cust_2019 --magField 38T_PostLS1 --datatier GEN-SIM --eventcontent FEVTDEBUG --evt_type GEMCode/GEMValidation/SingleMuPt40Fwdv2_cfi -n 1000 --no_exec --fileout out_file_name.root import FWCore.ParameterSet.Config as cms process = cms.Process('SIM') @@ -14,9 +14,8 @@ process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMXML_cfi') -#process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMr10v01XML_cfi') -process.load('Configuration.StandardSequences.MagneticField_38T_cff') +process.load('Configuration.Geometry.GeometrySimDB_cff') +process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic8TeVCollision_cfi') process.load('GeneratorInterface.Core.genFilterSummary_cff') @@ -25,7 +24,7 @@ process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(100000) + input = cms.untracked.int32(1000) ) # Input source @@ -37,9 +36,9 @@ # Production Info process.configurationMetadata = cms.untracked.PSet( - version = cms.untracked.string('$Revision: 1.2 $'), - annotation = cms.untracked.string('SingleMuPt100_cfi nevts:200'), - name = cms.untracked.string('PyReleaseValidation') + version = cms.untracked.string('$Revision: 1.14 $'), + annotation = cms.untracked.string('GEMCode/GEMValidation/SingleMuPt40Fwdv2_cfi nevts:1000'), + name = cms.untracked.string('Applications') ) # Output definition @@ -48,7 +47,7 @@ splitLevel = cms.untracked.int32(0), eventAutoFlushCompressedSize = cms.untracked.int32(5242880), outputCommands = process.FEVTDEBUGEventContent.outputCommands, - fileName = cms.untracked.string('out_sim.root'), + fileName = cms.untracked.string('out_file_name.root'), dataset = cms.untracked.PSet( filterName = cms.untracked.string(''), dataTier = cms.untracked.string('GEN-SIM') @@ -63,16 +62,16 @@ # Other statements process.genstepfilter.triggerConditions=cms.vstring("generation_step") from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'POSTLS161_V12::All', '') +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgrade2019', '') process.generator = cms.EDProducer("FlatRandomPtGunProducer", PGunParameters = cms.PSet( MaxPt = cms.double(40.01), MinPt = cms.double(39.99), PartID = cms.vint32(-13), - MaxEta = cms.double(2.2), + MaxEta = cms.double(2.5), MaxPhi = cms.double(3.14159265359), - MinEta = cms.double(-2.2), + MinEta = cms.double(-2.5), MinPhi = cms.double(-3.14159265359) ), Verbosity = cms.untracked.int32(0), @@ -81,37 +80,38 @@ firstRun = cms.untracked.uint32(1) ) -# select generated muons and antimuons process.genMuons = cms.EDFilter("PdgIdCandViewSelector", - src = cms.InputTag("genParticles"), - pdgId = cms.vint32( 13, -13 ) -) + src = cms.InputTag("genParticles"), + pdgId = cms.vint32( 13, -13 ) + ) -# filter by applying cuts to these generated muons process.genMuonsGEM = cms.EDFilter("CandViewSelector", - src = cms.InputTag("genMuons"), - cut = cms.string( "abs(eta)<2.14 & abs(eta)>1.45" ), # or whatever cut expression is deemed necessary - filter = cms.bool(True) -) - -#process.genANDfilter = cms.Sequence(process.generator * process.genMuons * process.genMuonsGEM) - -process.gen_mu_select = cms.Sequence(process.genMuons * process.genMuonsGEM) + src = cms.InputTag("genMuons"), + # whatever cut expression is deemed necessary + cut = cms.string( "pt > 5. & abs(eta)<2.5 & abs(eta)>1.45" ), + filter = cms.bool(True) + ) # Path and EndPath definitions +process.gen_mu_select = cms.Sequence(process.genMuons * process.genMuonsGEM) process.generation_step = cms.Path(process.pgen * process.gen_mu_select) process.simulation_step = cms.Path(process.gen_mu_select * process.psim) process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) process.endjob_step = cms.EndPath(process.endOfProcess) process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) -process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) - # Schedule definition process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.endjob_step,process.FEVTDEBUGoutput_step) # filter all path with the production filter sequence for path in process.paths: - getattr(process,path)._seq = process.generator * getattr(process,path)._seq -#for path in process.paths: -# getattr(process,path)._seq = process.genANDfilter * getattr(process,path)._seq + getattr(process,path)._seq = process.generator * getattr(process,path)._seq + +# customisation of the process. + +# Automatic addition of the customisation function from SLHCUpgradeSimulations.Configuration.combinedCustoms +from SLHCUpgradeSimulations.Configuration.combinedCustoms import cust_2019 + +#call to customisation function cust_2019 imported from SLHCUpgradeSimulations.Configuration.combinedCustoms +process = cust_2019(process) +# End of customisation functions From b6e759c912bb16b0098c6ee0d79a5677df02b2b2 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 19 Sep 2013 00:27:09 +0200 Subject: [PATCH 121/182] Update plotGEMCSCdPhi.py --- SimMuL1/scripts/plotGEMCSCdPhi.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/SimMuL1/scripts/plotGEMCSCdPhi.py b/SimMuL1/scripts/plotGEMCSCdPhi.py index 7961837a46842..e5ef2a2b48fcd 100644 --- a/SimMuL1/scripts/plotGEMCSCdPhi.py +++ b/SimMuL1/scripts/plotGEMCSCdPhi.py @@ -1,3 +1,7 @@ +## +## This script overlays the histograms of bending angles for even and odd chambers +## + from cuts import * from tdrStyle import * @@ -76,19 +80,15 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): dphi_pt5.Scale(1/dphi_pt5.Integral()) dphi_pt20.Scale(1/dphi_pt20.Integral()) - dphi_pt5.SetLineColor(kRed) dphi_pt20.SetLineColor(kBlue) dphi_pt5.SetLineWidth(2) dphi_pt20.SetLineWidth(2) - dphi_pt20.GetXaxis().SetTitle("#Delta#phi(GEM,CSC) [rad]") dphi_pt20.GetYaxis().SetTitle("Arbitray units") dphi_pt20.SetTitle(" GEM-CSC Bending Angle CMS Simulation Preliminary") - dphi_pt20.GetXaxis().SetLabelSize(0.05) dphi_pt20.GetYaxis().SetLabelSize(0.05) - dphi_pt20.Draw() dphi_pt5.Draw("same") @@ -130,16 +130,9 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): c.SaveAs("%sGEMCSCdPhi_%s_chambers%s"%(plotDir, oddEven, ext)) if __name__ == "__main__": -# plotGEMCSCdPhi("files/", "plots/bending/", "even", ".png") -# plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".png") -# plotGEMCSCdPhi("files/", "plots/bending/", "even", ".pdf") -# plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".pdf") plotGEMCSCdPhi("files/", "plots/bending/", "even", ".eps") plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".eps") plotGEMCSCdPhi("files/", "plots/bending/", "even", ".pdf") plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".pdf") plotGEMCSCdPhi("files/", "plots/bending/", "even", ".png") plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".png") - - - From 3a3dfd4a1d977f499c00691e18b9668b469c1889 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 19 Sep 2013 00:48:07 +0200 Subject: [PATCH 122/182] Separating script for high efficiency patterns --- SimMuL1/scripts/highEfficiencyPatterns.py | 199 ++++++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 SimMuL1/scripts/highEfficiencyPatterns.py diff --git a/SimMuL1/scripts/highEfficiencyPatterns.py b/SimMuL1/scripts/highEfficiencyPatterns.py new file mode 100644 index 0000000000000..38d9f6a7c758d --- /dev/null +++ b/SimMuL1/scripts/highEfficiencyPatterns.py @@ -0,0 +1,199 @@ +## custom modules +from cuts import * +from tdrStyle import * +from GEMCSCdPhiDict import * +from math import * + +## ROOT modules +from ROOT import * + +## run quiet mode +import sys +sys.argv.append( '-b' ) + +import ROOT +ROOT.gROOT.SetBatch(1) + +gStyle.SetStatW(0.07) +gStyle.SetStatH(0.06) + +gStyle.SetOptStat(0) + +gStyle.SetTitleStyle(0) +gStyle.SetTitleAlign(13) ##// coord in top left +gStyle.SetTitleX(0.) +gStyle.SetTitleY(1.) +gStyle.SetTitleW(1) +gStyle.SetTitleH(0.058) +gStyle.SetTitleBorderSize(0) + +gStyle.SetPadLeftMargin(0.126) +gStyle.SetPadRightMargin(0.04) +gStyle.SetPadTopMargin(0.06) +gStyle.SetPadBottomMargin(0.13) + +gStyle.SetMarkerStyle(1) + +#_______________________________________________________________________________ +def draw_eff(t,title, h_name, h_bins, to_draw, denom_cut, extra_num_cut, + color = kBlue, marker_st = 20): + """Make an efficiency plot""" + + ## total numerator selection cut + num_cut = TCut("%s && %s" %(denom_cut.GetTitle(), extra_num_cut.GetTitle())) + + t.Draw(to_draw + ">>num_" + h_name + h_bins, num_cut, "goff") + num = TH1F(gDirectory.Get("num_" + h_name).Clone("num_" + h_name)) + t.Draw(to_draw + ">>denom_" + h_name + h_bins, denom_cut, "goff") + den = TH1F(gDirectory.Get("denom_" + h_name).Clone("denom_" + h_name)) + + useTEfficiency = True + if useTEfficiency: + eff = TEfficiency(num, den) + else: + eff = TGraphAsymmErrors(num, den) + + eff.SetTitle(title) + eff.SetLineWidth(2) + eff.SetLineColor(color) + eff.SetMarkerStyle(marker_st) + eff.SetMarkerColor(color) + eff.SetMarkerSize(.5) + return eff + + +#_______________________________________________________________________________ +def getTree(fileName): + """Get tree for given filename""" + + analyzer = "GEMCSCAnalyzer" + trk_eff = "trk_eff" + + file = TFile.Open(fileName) + if not file: + sys.exit('Input ROOT file %s is missing.' %(fileName)) + + dir = file.Get(analyzer) + if not dir: + sys.exit('Directory %s does not exist.' %(dir)) + + tree = dir.Get(trk_eff) + if not tree: + sys.exit('Tree %s does not exist.' %(tree)) + + return tree + + +#_______________________________________________________________________________ +def getDphi(eff,pt,evenOdd): + """Return the delta phi cut value given: (1) an efficiency, (2) a pt value and (3) choice for even/odd chambers""" + + return dphi_lct_pad["%s"%(eff)]["%s"%(pt)]["%s"%(evenOdd)] + + +#_______________________________________________________________________________ +def highEfficiencyPatterns(filesDir, plotDir, eff, oddEven, ext): + """Produce plot with GEM high efficiency patterns""" + + pt = ["pt10","pt20","pt30","pt40"] + pt_labels = ["10","20","30","40"] +# pt_labels = ["10 GeV/c","20 GeV/c","30 GeV/c","40 GeV/c"] + dphis = [0.,0.,0.,0.] + + marker_colors = [kRed, kViolet+1, kAzure+2, kGreen-2] + marker_styles = [20,21,23,22] + + t = getTree("%sgem_csc_eff_pt2pt50_pad4.root"%(filesDir)); + + c = TCanvas("c","c",800,600) + c.SetGridx(1) + c.SetGridy(1) + c.cd() + h = TH1F(""," GEM-CSC bending Angle CMS Simulation Preliminary;Generated muon p_{T} [GeV/c];",50,0.,50.) + superscript = "p_{T}>p_{T}^{min}" + subscript = "0" +## h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<|#Delta#phi_{0}^{WP}| Cut Efficiency"); +## h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<|#Delta#phi_{%s}^{%s}| Cut Efficiency"%(subscript,superscript)); + h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<#Delta#phi_{%s} Cut Efficiency"%(subscript)); + h.GetYaxis().SetTitleOffset(.9) + h.SetStats(0) + + ## label sizes more leglible + h.GetXaxis().SetLabelSize(.05) + h.GetXaxis().SetLabelOffset(.005) + h.GetYaxis().SetLabelSize(.05) + h.GetYaxis().SetLabelOffset(.005) + + h.Draw("") + histoList = [] + for i in range(len(pt)): + dphi = getDphi("%d"%(eff),"%s"%(pt[i]),"%s"%(oddEven)) + dphis[i] = dphi + if oddEven=="even": + ok_dphi = TCut("TMath::Abs(dphi_pad_even) < %f"%(dphi)) + denom_cut = ok_pad2_lct2_eta + closeFar = "Close" + else: + ok_dphi = TCut("TMath::Abs(dphi_pad_odd) < %f"%(dphi)) + denom_cut = ok_pad1_lct1_eta + closeFar = "Far" + + h2 = draw_eff(t, "", "h2", "(50,0.,50.)", "pt", + denom_cut, ok_dphi, marker_colors[i], marker_styles[i]) + histoList.append(h2) + h2.SetMarkerSize(1) + h2.Draw("same") + + ## add legend + leg = TLegend(0.52,0.17,.93,0.57, "High efficiency patterns:", "brNDC") + for n in range(len(pt)): + superscript = "\"%s\""%(pt_labels[n]) + superscript = "p_{T}>%s"%(pt_labels[n]) + subscript = "0" + #leg.AddEntry(histoList[n], "#Delta#phi_{%s}^{%s} = %.1f mrad"%(subscript,superscript,dphis[n]*1000), "p") + leg.AddEntry(histoList[n], "#Delta#phi_{%s} = %.1f mrad"%(subscript,dphis[n]*1000), "p") + #leg.AddEntry(histoList[n], "WP = %s"%(pt_labels[n]), "p") + + + leg.SetBorderSize(0) + leg.SetMargin(0.1) + leg.SetFillStyle(0) + leg.SetFillStyle(1001) + leg.SetFillColor(kWhite) + leg.SetTextSize(0.05) + leg.Draw("same") + + ## Adding additional information - top right + """ + tex2 = TLatex(.75,.82,' L1 Trigger') + tex2.SetTextSize(0.05) + tex2.SetNDC() + tex2.Draw("same") + """ + + tex3 = TLatex(.735,.82,'1.64<|#eta|<2.14') + tex3.SetTextSize(0.05) + tex3.SetNDC() + tex3.Draw("same") + + ## hardcore nitpicking over here! + if closeFar == "Close": + xpos = 0.57 + else: + xpos = 0.611 + + tex = TLatex(xpos,.75,'"%s" chamber pairs'%(closeFar)) + tex.Draw("same") + tex.SetTextSize(0.05) + tex.SetNDC() + + ## save the file + c.SaveAs("%sGEM_highEffPatterns_%s_%s%s"%(plotDir, eff,oddEven,ext)) + +if __name__ == "__main__": + highEfficiencyPatterns("files/", "plots/highEffPatterns/", 98, "even", ".pdf") + highEfficiencyPatterns("files/", "plots/highEffPatterns/", 98, "odd", ".pdf") + highEfficiencyPatterns("files/", "plots/highEffPatterns/", 98, "even", ".png") + highEfficiencyPatterns("files/", "plots/highEffPatterns/", 98, "odd", ".png") + highEfficiencyPatterns("files/", "plots/highEffPatterns/", 98, "even", ".eps") + highEfficiencyPatterns("files/", "plots/highEffPatterns/", 98, "odd", ".eps") From 27c11a52b49ad064b3d1ea1d1e8b1a74055ff4aa Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 19 Sep 2013 00:51:14 +0200 Subject: [PATCH 123/182] Added some comments --- SimMuL1/scripts/highEfficiencyPatterns.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SimMuL1/scripts/highEfficiencyPatterns.py b/SimMuL1/scripts/highEfficiencyPatterns.py index 38d9f6a7c758d..017e4f4602b53 100644 --- a/SimMuL1/scripts/highEfficiencyPatterns.py +++ b/SimMuL1/scripts/highEfficiencyPatterns.py @@ -1,3 +1,9 @@ +## +## This script plots the high efficiency patterns for 4 different working points +## Todo: Integrate the draf_eff() function in effFunctions.py +## Note: use TEfficiency class for these plots +## + ## custom modules from cuts import * from tdrStyle import * From c00182604788cdeb186d894cdd3c2f7a823af4c0 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 19 Sep 2013 00:56:25 +0200 Subject: [PATCH 124/182] change name of script --- .../scripts/{drawplot_etastep.C => triggerEfficiencyVsPtPlots.C} | 0 .../{drawplot_etastep.py => triggerEfficiencyVsPtPlots.py} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename SimMuL1/scripts/{drawplot_etastep.C => triggerEfficiencyVsPtPlots.C} (100%) rename SimMuL1/scripts/{drawplot_etastep.py => triggerEfficiencyVsPtPlots.py} (100%) diff --git a/SimMuL1/scripts/drawplot_etastep.C b/SimMuL1/scripts/triggerEfficiencyVsPtPlots.C similarity index 100% rename from SimMuL1/scripts/drawplot_etastep.C rename to SimMuL1/scripts/triggerEfficiencyVsPtPlots.C diff --git a/SimMuL1/scripts/drawplot_etastep.py b/SimMuL1/scripts/triggerEfficiencyVsPtPlots.py similarity index 100% rename from SimMuL1/scripts/drawplot_etastep.py rename to SimMuL1/scripts/triggerEfficiencyVsPtPlots.py From 75f9f4038df0d5e6efbd1ede47413651181f3a6f Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 19 Sep 2013 14:58:39 +0200 Subject: [PATCH 125/182] renaming drawplot_eff to matchingEfficiency --- .../{drawplot_eff.C => matchingEfficiency.C} | 114 +++++++------- ...{drawplot_eff.py => matchingEfficiency.py} | 139 ++++++++++++++++-- 2 files changed, 189 insertions(+), 64 deletions(-) rename SimMuL1/scripts/{drawplot_eff.C => matchingEfficiency.C} (84%) rename SimMuL1/scripts/{drawplot_eff.py => matchingEfficiency.py} (88%) diff --git a/SimMuL1/scripts/drawplot_eff.C b/SimMuL1/scripts/matchingEfficiency.C similarity index 84% rename from SimMuL1/scripts/drawplot_eff.C rename to SimMuL1/scripts/matchingEfficiency.C index 16c85d0068c52..4293359a13bbf 100644 --- a/SimMuL1/scripts/drawplot_eff.C +++ b/SimMuL1/scripts/matchingEfficiency.C @@ -48,30 +48,30 @@ TCut ok_pt = "pt > 20"; -TCut ok_dphi1 = "dphi_pad_odd < 10."; -TCut ok_dphi2 = "dphi_pad_even < 10."; +// TCut ok_dphi1 = "dphi_pad_odd < 10."; +// TCut ok_dphi2 = "dphi_pad_even < 10."; -enum {GEM_EFF95 = 0, GEM_EFF98, GEM_EFF99}; -enum {DPHI_PT10 = 0, DPHI_PT15, DPHI_PT20, DPHI_PT30, DPHI_PT40}; +// enum {GEM_EFF95 = 0, GEM_EFF98, GEM_EFF99}; +// enum {DPHI_PT10 = 0, DPHI_PT15, DPHI_PT20, DPHI_PT30, DPHI_PT40}; double mymod(double x, double y) { return fmod(x,y); } -void setDPhi(int label_pt, int label_eff = GEM_EFF98) -{ - float dphi_odd[3][20] = { - {0.009887, 0.006685, 0.005194, 0.003849, 0.003133}, - {0.01076 , 0.007313, 0.005713, 0.004263, 0.003513}, - {0.011434, 0.007860, 0.006162, 0.004615, 0.003891} }; - float dphi_even[3][20] = { - {0.004418, 0.003274, 0.002751, 0.002259, 0.002008}, - {0.004863, 0.003638, 0.003063, 0.002563, 0.002313}, - {0.005238, 0.003931, 0.003354, 0.002809, 0.002574} }; - ok_dphi1 = Form("TMath::Abs(dphi_pad_odd) < %f", dphi_odd[label_eff][label_pt]); - ok_dphi2 = Form("TMath::Abs(dphi_pad_even) < %f", dphi_even[label_eff][label_pt]); -} +// void setDPhi(int label_pt, int label_eff = GEM_EFF98) +// { +// float dphi_odd[3][20] = { +// {0.009887, 0.006685, 0.005194, 0.003849, 0.003133}, +// {0.01076 , 0.007313, 0.005713, 0.004263, 0.003513}, +// {0.011434, 0.007860, 0.006162, 0.004615, 0.003891} }; +// float dphi_even[3][20] = { +// {0.004418, 0.003274, 0.002751, 0.002259, 0.002008}, +// {0.004863, 0.003638, 0.003063, 0.002563, 0.002313}, +// {0.005238, 0.003931, 0.003354, 0.002809, 0.002574} }; +// ok_dphi1 = Form("TMath::Abs(dphi_pad_odd) < %f", dphi_odd[label_eff][label_pt]); +// ok_dphi2 = Form("TMath::Abs(dphi_pad_even) < %f", dphi_even[label_eff][label_pt]); +// } TFile* gf = 0; @@ -211,15 +211,16 @@ void efficiency_2(TString f_name, TString p_name, TString pt, bool overlap) TTree *t = getTree(f_name); // latest instructions by Vadim: 21-08-2013 - - TGraphAsymmErrors* hgn = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;Generated muon phi #phi [deg];Efficiency", "h_odd", "(100,-10,10)", "mymod(phi*180./TMath::Pi(), 360/18.)", ok_eta&&Qn, ok_pad1 || ok_pad2,"", kRed); - TGraphAsymmErrors* hgp = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;Generated muon phi #phi [deg];Effciency", "h_odd", "(100,-10,10)", "mymod(phi*180./TMath::Pi(), 360/18.)", ok_eta&&Qp, ok_pad1 || ok_pad2,"same", kBlue); - double maxi = 1.0; + TGraphAsymmErrors* hgn = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;Generated muon #phi [deg];Efficiency", "h_odd", "(40,-10,10)", "mymod(phi*180./TMath::Pi(), 360/18.)", ok_eta&&Qn, ok_pad1 || ok_pad2,"", kRed); + TGraphAsymmErrors* hgp = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;Generated muon #phi [deg];Effciency", "h_odd", "(40,-10,10)", "mymod(phi*180./TMath::Pi(), 360/18.)", ok_eta&&Qp, ok_pad1 || ok_pad2,"same", kBlue); + double maxi = 1.1; double mini = 0.0; hgn->SetMinimum(mini); hgn->SetMaximum(maxi); - hgn->GetXaxis()->SetLabelSize(0.06); - hgn->GetYaxis()->SetLabelSize(0.06); + hgn->GetXaxis()->SetLabelSize(0.05); + hgn->GetYaxis()->SetLabelSize(0.05); + hgp->GetXaxis()->SetLabelSize(0.05); + hgp->GetYaxis()->SetLabelSize(0.05); TLine *l1 = new TLine(-5,mini,-5,maxi); l1->SetLineStyle(2); @@ -228,12 +229,12 @@ void efficiency_2(TString f_name, TString p_name, TString pt, bool overlap) l1->SetLineStyle(2); l1->Draw(); - hgn->Fit("pol0","R0","",-10,10); - hgp->Fit("pol0","R0","",-10,10); - double eff_neg = (hgn->GetFunction("pol0"))->GetParameter(0); - double eff_pos = (hgp->GetFunction("pol0"))->GetParameter(0); - std::cout << "negative efficiency" << eff_neg << " " - << "positive efficiency" << eff_pos << std::endl; + // hgn->Fit("pol0","R0","",-10,10); + // hgp->Fit("pol0","R0","",-10,10); + // double eff_neg = (hgn->GetFunction("pol0"))->GetParameter(0); + // double eff_pos = (hgp->GetFunction("pol0"))->GetParameter(0); + // std::cout << "negative efficiency" << eff_neg << " " + // << "positive efficiency" << eff_pos << std::endl; // ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;local #phi [deg];Efficiency", "h_odd", "(150,-10,10)", "mymod(phi+TMath::Pi()/36., TMath::Pi()/18.) * 180./TMath::Pi()", ok_eta&&Qn, ok_pad1 || ok_pad2, "", kRed); // he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;local #phi [deg];Efficiency", "h_odd", "(150,-10,10)", "mymod(phi+TMath::Pi()/36., TMath::Pi()/18.) * 180./TMath::Pi()", ok_eta&&Qp, ok_pad1 || ok_pad2, "same",kBlue); @@ -389,33 +390,36 @@ void drawplot_eff() TCanvas* cEff = new TCanvas("cEff","cEff",700,500); - efficiency_1(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt05" + ext, "5", false); - efficiency_1(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt10" + ext, "10", false); - efficiency_1(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt15" + ext, "15", false); - efficiency_1(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt20" + ext, "20", false); - efficiency_1(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt30" + ext, "30", false); - efficiency_1(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt40" + ext, "40", false); - - efficiency_1(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt05_overlap" + ext, "5", true); - efficiency_1(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt10_overlap" + ext, "10", true); - efficiency_1(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt15_overlap" + ext, "15", true); - efficiency_1(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt20_overlap" + ext, "20", true); - efficiency_1(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt30_overlap" + ext, "30", true); - efficiency_1(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt40_overlap" + ext, "40", true); - - efficiency_2(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt05" + ext, "5", false); - efficiency_2(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt10" + ext, "10", false); - efficiency_2(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt15" + ext, "15", false); - efficiency_2(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt20" + ext, "20", false); - efficiency_2(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt30" + ext, "30", false); - efficiency_2(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt40" + ext, "40", false); - - efficiency_2(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt05_overlap" + ext, "5", true); - efficiency_2(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt10_overlap" + ext, "10", true); - efficiency_2(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt15_overlap" + ext, "15", true); + // efficiency_1(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt05" + ext, "5", false); + // efficiency_1(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt10" + ext, "10", false); + // efficiency_1(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt15" + ext, "15", false); + // efficiency_1(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt20" + ext, "20", false); + // efficiency_1(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt30" + ext, "30", false); + // efficiency_1(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt40" + ext, "40", false); + + // efficiency_1(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt05_overlap" + ext, "5", true); + // efficiency_1(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt10_overlap" + ext, "10", true); + // efficiency_1(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt15_overlap" + ext, "15", true); + // efficiency_1(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt20_overlap" + ext, "20", true); + // efficiency_1(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt30_overlap" + ext, "30", true); + // efficiency_1(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt40_overlap" + ext, "40", true); + + // efficiency_2(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt05" + ext, "5", false); + // efficiency_2(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt10" + ext, "10", false); + // efficiency_2(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt15" + ext, "15", false); + // efficiency_2(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt20" + ext, "20", false); + // efficiency_2(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt30" + ext, "30", false); + // efficiency_2(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt40" + ext, "40", false); + + // efficiency_2(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt05_overlap" + ext, "5", true); + // efficiency_2(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt10_overlap" + ext, "10", true); + // efficiency_2(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt15_overlap" + ext, "15", true); + efficiency_2(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt20_overlap" + ext, "20", true); - efficiency_2(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt30_overlap" + ext, "30", true); - efficiency_2(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt40_overlap" + ext, "40", true); + + + // efficiency_2(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt30_overlap" + ext, "30", true); + // efficiency_2(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt40_overlap" + ext, "40", true); // drawplot_eff_eta(); } diff --git a/SimMuL1/scripts/drawplot_eff.py b/SimMuL1/scripts/matchingEfficiency.py similarity index 88% rename from SimMuL1/scripts/drawplot_eff.py rename to SimMuL1/scripts/matchingEfficiency.py index 9dfd74095156e..a30b88bbddf57 100644 --- a/SimMuL1/scripts/drawplot_eff.py +++ b/SimMuL1/scripts/matchingEfficiency.py @@ -3,6 +3,7 @@ from cuts import * from tdrStyle import * from GEMCSCdPhiDict import * +from math import * ## ROOT modules from ROOT import * @@ -58,14 +59,14 @@ def getTree(fileName): #_______________________________________________________________________________ def getDphi(eff,pt,evenOdd): - """Return the delta Phi cut value""" + """Return the delta phi cut value given: (1) an efficiency, (2) a pt value and (3) choice for even/odd chambers""" return dphi_lct_pad["%s"%(eff)]["%s"%(pt)]["%s"%(evenOdd)] #_______________________________________________________________________________ def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): - """Produce GEM turn-on curve""" + """Produce plot with GEM high efficiency patterns""" pt = ["pt10","pt20","pt30","pt40"] pt_labels = ["10","20","30","40"] @@ -84,8 +85,9 @@ def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): h = TH1F(""," GEM-CSC bending Angle CMS Simulation Preliminary;Generated muon p_{T} [GeV/c];",50,0.,50.) superscript = "p_{T}>p_{T}^{min}" subscript = "0" - h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<|#Delta#phi_{0}^{WP}| Cut Efficiency"); +## h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<|#Delta#phi_{0}^{WP}| Cut Efficiency"); ## h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<|#Delta#phi_{%s}^{%s}| Cut Efficiency"%(subscript,superscript)); + h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<#Delta#phi_{%s} Cut Efficiency"%(subscript)); h.GetYaxis().SetTitleOffset(.9) h.SetStats(0) @@ -110,7 +112,7 @@ def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): closeFar = "Far" h2 = draw_eff(t, "", "h2", "(50,0.,50.)", "pt", - denom_cut, ok_dphi, marker_colors[i], marker_styles[i]) + denom_cut, ok_dphi, marker_colors[i], marker_styles[i]) histoList.append(h2) h2.SetMarkerSize(1) h2.Draw("same") @@ -118,11 +120,12 @@ def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): ## add legend leg = TLegend(0.52,0.17,.93,0.57, "High efficiency patterns:", "brNDC") for n in range(len(pt)): -# superscript = "p_{T}>%s"%(pt_labels[n]) superscript = "\"%s\""%(pt_labels[n]) + superscript = "p_{T}>%s"%(pt_labels[n]) subscript = "0" #leg.AddEntry(histoList[n], "#Delta#phi_{%s}^{%s} = %.1f mrad"%(subscript,superscript,dphis[n]*1000), "p") - leg.AddEntry(histoList[n], "WP = %s"%(pt_labels[n]), "p") + leg.AddEntry(histoList[n], "#Delta#phi_{%s} = %.1f mrad"%(subscript,dphis[n]*1000), "p") + #leg.AddEntry(histoList[n], "WP = %s"%(pt_labels[n]), "p") leg.SetBorderSize(0) @@ -161,6 +164,102 @@ def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): c.SaveAs("%sGEM_turnon_%s_%s%s"%(plotDir, eff,oddEven,ext)) +#_______________________________________________________________________________ +def padMatchingEffVsGenMuonPhiForPosAndNegMuons( + filesDir, plotDir, pt, doOverlaps, ext): + + """ + This functions makes the matching effciency vs generated muon phi + for positive and negative muons. These plots were used in the approval round of + September 9th 2013. + """ + + ok_eta = TCut("abs(eta)>1.64 && abs(eta)<2.12") + if (doOverlaps): + cut1 = ok_pad1_overlap + cut2 = ok_pad2_overlap + overlapStr = "_overlap" + else: + cut1 = ok_pad1 + cut2 = ok_pad2 + overlapStr = "" + + t = getTree("%sgem_csc_delta_pt%d_pad4.root"%(filesDir,pt)); + + ## latest instructions by Vadim on 21-08-2013 + ok_pad1_or_pad2 = TCut("%s || %s" %(ok_pad1.GetTitle(),ok_pad2.GetTitle())) + ok_eta_and_Qn = TCut("%s && %s" %(ok_eta.GetTitle(),ok_Qn.GetTitle())) + ok_eta_and_Qp = TCut("%s && %s" %(ok_eta.GetTitle(),ok_Qp.GetTitle())) + + ## variables for the plot + title = " " * 9 + "GEM pad matching" + " " * 16 + "CMS Simulation Preliminary" + xTitle = "Generated muon #phi [deg]" + yTitle = "Efficiency" + toPlot = "fmod(phi*180./TMath::Pi(), 360/18.)" + h_bins = "(40,-10,10)" + nBins = int(h_bins[1:-1].split(',')[0]) + minBin = int(h_bins[1:-1].split(',')[1]) + maxBin = int(h_bins[1:-1].split(',')[2]) + + c = TCanvas("c","c",800,600) + c.cd() + base = TH1F("base","",nBins,minBin,maxBin) + base.SetMinimum(0.0) + base.SetMaximum(1.1) + base.Draw("") + base.GetXaxis().SetLabelSize(0.05) + base.GetYaxis().SetLabelSize(0.05) + base.SetTitle("%s;%s;%s"%(title,xTitle,yTitle)) + hgn = draw_geff(t, "%s;%s;%s"%(title,xTitle,yTitle), h_bins, + toPlot, ok_eta_and_Qn, ok_pad1_or_pad2,"same", kRed) + hgp = draw_geff(t, "%s;%s;%s"%(title,xTitle,yTitle), h_bins, + toPlot, ok_eta_and_Qp, ok_pad1_or_pad2,"same", kBlue) + + maxi = 1.1 + mini = 0.0 + """ + hgn.SetMinimum(mini) + hgn.SetMaximum(maxi) + hgn.GetXaxis().SetLabelSize(0.05) + hgn.GetYaxis().SetLabelSize(0.05) + hgp.GetXaxis().SetLabelSize(0.05) + hgp.GetYaxis().SetLabelSize(0.05) + """ + + l1 = TLine(-5,mini,-5,maxi) + l1.SetLineStyle(2) + l1.Draw() + l2 = TLine(5,mini,5,maxi) + l2.SetLineStyle(2) + l2.Draw() + + leg = TLegend(0.25,0.23,.75,0.5, "", "brNDC") + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetTextSize(0.06) + leg.AddEntry(0,"muon p_{T} = %d GeV/c"%(pt),"") + leg.AddEntry(hgp, "Postive muons","l") + leg.AddEntry(hgn, "Negative muons","l") + leg.Draw() + + ## Print additional information + """ + tex2 = TLatex(.67,.8," L1 Trigger") + tex2.SetTextSize(0.05) + tex2.SetNDC() + tex2.Draw() + """ + + tex = TLatex(.7,.2,"1.64<|#eta|<2.12") + tex.SetTextSize(0.05) + tex.SetNDC() + tex.Draw() + +# gPad.Print("%sgem_pad_eff_for_LCT_vs_phi_pt20%s%s"%(plotDir,overlapStr,ext)) + c.Print("%sgem_pad_eff_for_LCT_vs_phi_pt20%s%s"%(plotDir,overlapStr,ext)) + + + #_______________________________________________________________________________ def efficiency_1(f_name, p_name, pt, overlap): """efficiency vs half-strip - separate odd-even""" @@ -180,7 +279,7 @@ def efficiency_1(f_name, p_name, pt, overlap): gStyle->SetPadBottomMargin(0.13); gStyle->SetOptStat(0); gStyle->SetMarkerStyle(1); - """ + ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12" if (overlap): @@ -218,8 +317,9 @@ def efficiency_1(f_name, p_name, pt, overlap): tex.SetNDC() tex.Draw() -## this has to be fixed + ## this has to be fixed gPad.Print(p_name) + """ """ @@ -854,7 +954,11 @@ def eff_hs(filesDir, plotDir, ext): ## nm.Draw() ## nmlct.Draw("same") -if __name__ == "__main__": +if __name__ == "__main__": + """ + We don't always need all plots, hence lots of comments. + """ + """ halfStripEfficiencies("files/", "plots/efficiency/", ".pdf") halfStripEfficiencies("files/", "plots/efficiency/", ".eps") @@ -864,6 +968,23 @@ def eff_hs(filesDir, plotDir, ext): etaMatchingEfficiencies("files/", "plots/efficiency/", ".eps") etaMatchingEfficiencies("files/", "plots/efficiency/", ".png") """ + + """ + gemTurnOn("files/", "plots/efficiency/", "98", "even", ".pdf") + gemTurnOn("files/", "plots/efficiency/", "98", "odd", ".pdf") + gemTurnOn("files/", "plots/efficiency/", "98", "even", ".png") + gemTurnOn("files/", "plots/efficiency/", "98", "odd", ".png") gemTurnOn("files/", "plots/efficiency/", "98", "even", ".eps") gemTurnOn("files/", "plots/efficiency/", "98", "odd", ".eps") + """ + +# efficiency_2(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt20_overlap" + ext, "20", true); + + padMatchingEffVsGenMuonPhiForPosAndNegMuons( + "files/","plots/tempDir/", 20, True, '.pdf') + padMatchingEffVsGenMuonPhiForPosAndNegMuons( + "files/","plots/tempDir/", 20, True, '.eps') + padMatchingEffVsGenMuonPhiForPosAndNegMuons( + "files/","plots/tempDir/", 20, True, '.png') + From 4224213ddbff1e57bf14da74a4cad08296325e1b Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 19 Sep 2013 14:59:10 +0200 Subject: [PATCH 126/182] Add instructions for produceDphiDict --- SimMuL1/scripts/produceDphiDict.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SimMuL1/scripts/produceDphiDict.py b/SimMuL1/scripts/produceDphiDict.py index 69a01d8acf12b..663617e535746 100644 --- a/SimMuL1/scripts/produceDphiDict.py +++ b/SimMuL1/scripts/produceDphiDict.py @@ -1,5 +1,8 @@ -from cuts import * +## +## This script produces the dictionary of bending angles +## +from cuts import * ## run quiet mode import sys @@ -29,7 +32,7 @@ def getTree(fileName): return tree def dphiCut(h, fractionToKeep): - """Get the dPhi cut corresponding to the fracionToKeep [95,98,99]""" + """Get the dPhi cut corresponding to the fractionToKeep [95,98,99]""" ax = h.GetXaxis() total = h.Integral() From b676d7409d29798282986dce42c1e6e3313a06fb Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 19 Sep 2013 14:59:54 +0200 Subject: [PATCH 127/182] Add instructions for plotGEMCSCdPhi --- SimMuL1/scripts/plotGEMCSCdPhi.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/SimMuL1/scripts/plotGEMCSCdPhi.py b/SimMuL1/scripts/plotGEMCSCdPhi.py index 7961837a46842..311f062c01755 100644 --- a/SimMuL1/scripts/plotGEMCSCdPhi.py +++ b/SimMuL1/scripts/plotGEMCSCdPhi.py @@ -1,3 +1,7 @@ +## +## This script overlays the histograms of bending angles for even and odd chambers +## + from cuts import * from tdrStyle import * @@ -76,19 +80,15 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): dphi_pt5.Scale(1/dphi_pt5.Integral()) dphi_pt20.Scale(1/dphi_pt20.Integral()) - dphi_pt5.SetLineColor(kRed) dphi_pt20.SetLineColor(kBlue) dphi_pt5.SetLineWidth(2) dphi_pt20.SetLineWidth(2) - dphi_pt20.GetXaxis().SetTitle("#Delta#phi(GEM,CSC) [rad]") dphi_pt20.GetYaxis().SetTitle("Arbitray units") dphi_pt20.SetTitle(" GEM-CSC Bending Angle CMS Simulation Preliminary") - dphi_pt20.GetXaxis().SetLabelSize(0.05) dphi_pt20.GetYaxis().SetLabelSize(0.05) - dphi_pt20.Draw() dphi_pt5.Draw("same") @@ -130,10 +130,6 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): c.SaveAs("%sGEMCSCdPhi_%s_chambers%s"%(plotDir, oddEven, ext)) if __name__ == "__main__": -# plotGEMCSCdPhi("files/", "plots/bending/", "even", ".png") -# plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".png") -# plotGEMCSCdPhi("files/", "plots/bending/", "even", ".pdf") -# plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".pdf") plotGEMCSCdPhi("files/", "plots/bending/", "even", ".eps") plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".eps") plotGEMCSCdPhi("files/", "plots/bending/", "even", ".pdf") From 9689d47ec0dbf2131973319b3b3ed63bb3516420 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 19 Sep 2013 17:47:21 +0200 Subject: [PATCH 128/182] deleting obsolete file --- SimMuL1/scripts/plotGlobalMuonTriggerRate.py | 2150 ------------------ 1 file changed, 2150 deletions(-) delete mode 100644 SimMuL1/scripts/plotGlobalMuonTriggerRate.py diff --git a/SimMuL1/scripts/plotGlobalMuonTriggerRate.py b/SimMuL1/scripts/plotGlobalMuonTriggerRate.py deleted file mode 100644 index e0932d5a4d59d..0000000000000 --- a/SimMuL1/scripts/plotGlobalMuonTriggerRate.py +++ /dev/null @@ -1,2150 +0,0 @@ -from ROOT import * - -## run quiet mode -import sys -sys.argv.append( '-b' ) - -import ROOT -ROOT.gROOT.SetBatch(1) - -def getTriggerSF(): - """Calculate the factor to scale the trigger rate""" - - events = 238000 ## number of events - rate = 40000. ## the collision frequency [kHz] - bxwindow = 3. ##[-1,0,1] width of the bx window used to calculate the rates (see also the analyzer) - bxfilling = 0.795 ##average bx filling - trgScaleFactor = rate/events/bxwindow*bxfilling - return trgScaleFactor - -def Print(c, dirName, outFileName): - """Print the canvas""" - - gPad.RedrawAxis() - c.SaveAs("%s%s"%(dirName, outFileName)) - - -""" -TFile *f=0; -char pdir[111]=""; -char dir[111]="SimMuL1StrictAll"; - -TObject* NUL; - -TH1D *gh; -TH1D *ght; -TLegend *leg; - -TH1D* result_gem = 0; -TH1D* result_def = 0; -TH1D* result_def_2s = 0; -TH1D* result_def_3s1b = 0; - -TH1D* result_gem_2s1b = 0; -TH1D* result_def_2s1b = 0; - -TH1D* result_gem_eta_all = 0; -TH1D* result_def_eta_all = 0; -TH1D* result_def_eta_all_3s1b = 0; - -TH1D* result_gem_eta_no1a = 0; -TH1D* result_def_eta_no1a = 0; -TH1D* result_def_eta_no1a_3s1b = 0; - -TH1D* result_gmtsing = 0; - -// for later use -TH1D* result_def_2s__pat2 = 0; -TH1D* result_def_3s__pat2 = 0; -TH1D* result_def_2s1b__pat2 = 0; -TH1D* result_def_3s1b__pat2 = 0; -TH1D* result_def_2s__pat8 = 0; -TH1D* result_def_3s__pat8 = 0; -TH1D* result_def_2s1b__pat8 = 0; -TH1D* result_def_3s1b__pat8 = 0; - -TH1D* result_gmtsing__pat2 = 0; -TH1D* result_gmtsing__pat8 = 0; - -TH1D* result_gem_2s1b__pat2 = 0; -TH1D* result_gem_3s1b__pat2 = 0; -TH1D* result_gem_2s1b__pat8 = 0; -TH1D* result_gem_3s1b__pat8 = 0; - -TH1D* hAll100 = 0; - - -int interactive = 1; -bool do_not_print = false; - -TString gem_dir = "files/"; -TString gem_label = "gem98"; - - - -int gNPU=100; -int gNEvt=238000; -//int gNEvt=128000; -float gdy[2]={0.1,2500}; - -double ptscale[32] = { - -1., 0., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 6., 7., 8., 10., 12., 14., - 16., 18., 20., 25., 30., 35., 40., 45., 50., 60., 70., 80., 90., 100., 120., 140. -}; -const Double_t ptscaleb[31] = { - 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 6., 7., 8., 10., 12., 14., - 16., 18., 20., 25., 30., 35., 40., 45., 50., 60., 70., 80., 90., 100., 120., 140., 150. -}; -const Double_t ptscaleb_[31] = { - 1.25, 1.75, 2.25, 2.75, 3.25, 3.75, 4.25, 4.75, 5.5, 6.5, 7.5, 9., 11., 13., 15., - 17., 19., 22.5, 27.5, 32.5, 37.5, 42.5, 47.5, 55., 65., 75., 85., 95., 110., 130., 150. -}; - -void dpr(char *prc, int pu, char *suffix="") -//void dpr(char *prc, char *g, int pu, int st, char *suffix="") -{ - gNPU=pu; - char nm[300], fnm[300],onm[300]; - char spu[20]; - sprintf(spu,"%03d",pu); - //sprintf(nm,"%s_2_2_6_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); - //sprintf(nm,"%s_3_6_2_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); - //sprintf(nm,"%s_3_6_2_mu_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,spu,g,st,suffix); - sprintf(nm,"%s_6_0_1_POSTLS161_V12__pu%s_w3%s",prc,spu,suffix); - sprintf(fnm,"../hp_%s.root",nm); - - sprintf(onm,"rttf_%s",nm); - drawplot_tfrt(fnm,"StrictChamber",onm); -} - - -TPaveStats* GetStat(TH1*h) -{ - TPaveStats* stat = (TPaveStats*)h->FindObject("stats"); - return stat; -} - -TPaveStats* SetOptStat(TH1*h,int op) -{ - TPaveStats* stat = GetStat(h); - stat->SetOptStat(op); - return stat; -} - - -TObject* getH(char dir[100], char name[100]) -{ - char nm[222]; - sprintf(nm,"%s/%s;1",dir,name); - return f->Get(nm); -} - -TObject* getH(TFile *fi, char dir[100], char name[100]) -{ - char nm[222]; - sprintf(nm,"%s/%s;1",dir,name); - return fi->Get(nm); -} - - - - -void myRebin(TH1D* h, int n) -{ - int nb = h->GetNbinsX(); - Double_t entr = h->GetEntries(); - Double_t bin0 = h->GetBinContent(0); - Double_t binN1 = h->GetBinContent(nb+1); - if (nb % n) binN1 += h->Integral(nb - nb%n + 1,nb); - h->Rebin(n); - nb = h->GetNbinsX(); - h->SetBinContent(0,bin0); - h->SetBinContent(nb+1,binN1); - h->SetEntries(entr); -} - -//########################################################################### -TH1D* setHistoPt(char *f_name, char *name, char *cname, char *title, - int lcolor, int lstyle, int lwidth) -//double *x_range, double *y_range) -{ - cout<<"opening "<GetXaxis()->GetNbins(); - - h = new TH1D(s_name+cname,title,30,ptscaleb); - for (int b=1 ; b<=nb; b++) { - double bc = h0->GetBinContent(b); - if (bc==0) continue; - int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); - //cout<SetBinContent(bin, bc); - } - //h->Sumw2(); - h->Scale(40000./gNEvt/3.*0.795); - - return h; -} - -TH1D* setHistoPtRaw(char *f_name, char *name, char *cname, char *title, - int lcolor, int lstyle, int lwidth) -//double *x_range, double *y_range) -{ - cout<<"opening "<GetXaxis()->GetNbins(); - h = (TH1D*)h0->Clone(s_name+cname); - //h->Sumw2(); - h->Scale(40000./gNEvt/3.*0.795); - - return h; -} - - -TH1D* setHisto2(char *f_name, char *name1, char *name2, char *cname, char *title, - int lcolor, int lstyle, int lwidth) -//double *x_range, double *y_range) -{ - cout<<"opening "<Clone(s_name+cname); - h0->Add(h2); - int nb = h0->GetXaxis()->GetNbins(); - - h = new TH1D(s_name+cname,title,30,ptscaleb); - for (int b=1 ; b<=nb; b++) { - double bc = h0->GetBinContent(b); - if (bc==0) continue; - int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); - //cout<SetBinContent(bin, bc); - } - for (int b=1 ; b<=30; b++) - h->SetBinContent(b, h->Integral(b,31)); - - /* - h = (TH1D*)h0->Clone(s_name+cname); - for (int b=1 ; b<=nb; b++) - h->SetBinContent(b, h0->Integral(b,nb+1)); - */ - - h->Sumw2(); - h->Scale(40000000./gNEvt/3.*0.795/10); - - h->SetLineColor(lcolor); - h->SetFillColor(lcolor); - h->SetLineStyle(lstyle); - h->SetLineWidth(lwidth); - - h->SetTitle(title); - //h->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); - //h->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); - - h->GetXaxis()->SetRangeUser(3,130); - h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); - //h->GetYaxis()->SetRangeUser(0.01,3000); - - h->GetXaxis()->SetMoreLogLabels(1); - - h->GetXaxis()->SetTitleSize(0.055); - h->GetXaxis()->SetTitleOffset(1.05); - h->GetXaxis()->SetLabelSize(0.045); - h->GetXaxis()->SetLabelOffset(0.003); - h->GetXaxis()->SetTitleFont(62); - h->GetXaxis()->SetLabelFont(62); - - h->GetYaxis()->SetTitleSize(0.055); - h->GetYaxis()->SetTitleOffset(0.9); - h->GetYaxis()->SetLabelSize(0.045); - h->GetYaxis()->SetTitleFont(62); - h->GetYaxis()->SetLabelFont(62); - - //h->GetYaxis()->SetLabelOffset(0.015); - - return h; -} - -""" - -def setHistoEta(f_name, name, cname, title, lcolor, lstyle, lwidth): - f = TFile.Open(f_name) - dirName = "SimMuL1StrictAll" - if not file: - sys.exit('Input ROOT file %s is missing.' %(f_name)) - h0 = f.Get("%s/%s"%(dirName,name)) - if not h0: - sys.exit("No such histogram") - - nb = h0.GetXaxis().GetNbins(); - h = h0.Clone("%s%s"%(name,cname)) - h.SetTitle(title) - h.Sumw2() - h.Scale(getTriggerSF()) - h.SetLineColor(lcolor) - ##h.SetFillColor(lcolor) - h.SetLineStyle(lstyle) - h.SetLineWidth(lwidth) - h.SetTitle(title) - ##h.GetXaxis().SetRangeUser(1.2, 2.4) - ##h.GetYaxis().SetRangeUser(gdy[0],gdy[1]) - h.GetYaxis().SetRangeUser(0,8) - h.GetXaxis().SetTitleSize(0.055) - h.GetXaxis().SetTitleOffset(1.05) - h.GetXaxis().SetLabelSize(0.045) - h.GetXaxis().SetLabelOffset(0.003) - h.GetXaxis().SetTitleFont(62) - h.GetXaxis().SetLabelFont(62) - h.GetXaxis().SetMoreLogLabels(1) - h.GetYaxis().SetTitleSize(0.055) - h.GetYaxis().SetTitleOffset(0.9) - h.GetYaxis().SetLabelSize(0.045) - h.GetYaxis().SetTitleFont(62) - h.GetYaxis().SetLabelFont(62) - ##h.GetYaxis().SetLabelOffset(0.015) - - return h - - -def setHistoRatio(num, denom, title = "", ymin=0.4, ymax=1.6, color = kRed+3): - - ratio = num.Clone("%s__%s_ratio"%(num.GetName(), denom.GetName())) - ratio.Divide(num, denom, 1., 1.) - ratio.SetTitle(title) - - ratio.GetYaxis().SetRangeUser(ymin, ymax) - ratio.GetYaxis().SetTitle("ratio: (with GEM)/default") - ratio.GetYaxis().SetTitle("ratio") - ## ratio.GetYaxis().SetTitle("(ME1/b + GEM) / ME1/b") - ratio.GetYaxis().SetTitleSize(.14) - ## ratio.GetYaxis().SetTitleSize(.1) - ratio.GetYaxis().SetTitleOffset(0.4) - ratio.GetYaxis().SetLabelSize(.11) - - - ## ratio.GetXaxis().SetMoreLogLabels(1) - ratio.GetXaxis().SetTitle("p_{T}^{cut} [GeV/c]") - ratio.GetXaxis().SetLabelSize(.11) - ratio.GetXaxis().SetTitleSize(.14) - ratio.GetXaxis().SetTitleOffset(1.3) - ratio.SetLineWidth(2) - ratio.SetFillColor(color) - ratio.SetLineColor(color) - ratio.SetMarkerColor(color) - ratio.SetMarkerStyle(20) - ##ratio.Draw("e3") - - return ratio - - - -""" - - -TH1D* getPTHisto(TString f_name, TString dir_name, TString h_name, TString clone_suffix = "_cln") -{ - f = TFile::Open(f_name) - //cout<Get(dir_name + "/" + h_name)->Clone(h_name + clone_suffix); - return h0; -} - -TH1D* setPTHisto(TH1D* h0, TString title, int lcolor, int lstyle, int lwidth) -{ - int nb = h0->GetXaxis()->GetNbins(); - - h = new TH1D(Form("%s_varpt", h0->GetName()), title, 30, ptscaleb_); - for (int b=1 ; b<=nb; b++) { - double bc = h0->GetBinContent(b); - if (bc==0) continue; - int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); - //cout<GetBinCenter(b)<<" -> "<SetBinContent(bin, bc); - } - for (int b=1 ; b<=30; b++) - h->SetBinContent(b, h->Integral(b,31)); - - h->Sumw2(); - h->Scale(40000./gNEvt/3.*0.795); - - h->SetLineColor(lcolor); - h->SetFillColor(lcolor); - h->SetLineStyle(lstyle); - h->SetLineWidth(lwidth); - - h->SetTitle(title); - - h->GetXaxis()->SetRangeUser(2, 129.); - h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); - - h->GetXaxis()->SetTitleSize(0.055); - h->GetXaxis()->SetTitleOffset(1.05); - h->GetXaxis()->SetLabelSize(0.045); - h->GetXaxis()->SetLabelOffset(0.003); - h->GetXaxis()->SetTitleFont(62); - h->GetXaxis()->SetLabelFont(62); - h->GetXaxis()->SetMoreLogLabels(1); - - h->GetYaxis()->SetTitleSize(0.055); - h->GetYaxis()->SetTitleOffset(0.9); - h->GetYaxis()->SetLabelSize(0.045); - h->GetYaxis()->SetTitleFont(62); - h->GetYaxis()->SetLabelFont(62); - - return h; -} - -TH1D* setPTHisto(TString f_name, TString dir_name, TString h_name, TString clone_suffix, - TString title, int lcolor, int lstyle, int lwidth) -{ - TH1D* h0 = getPTHisto(f_name, dir_name, h_name, clone_suffix); - return setPTHisto(h0, title, lcolor, lstyle, lwidth); -} - - - - -TH1D* setHisto(TString f_name, char *name, char *cname, char *title, - int lcolor, int lstyle, int lwidth) -{ - cout<<"opening "<GetXaxis()->GetNbins(); - - h = new TH1D(s_name+cname,title,30,ptscaleb_); - for (int b=1 ; b<=nb; b++) { - double bc = h0->GetBinContent(b); - if (bc==0) continue; - int bin = h->GetXaxis()->FindFixBin(h0->GetBinCenter(b)); - //cout<GetBinCenter(b)<<" -> "<SetBinContent(bin, bc); - } - for (int b=1 ; b<=30; b++) - h->SetBinContent(b, h->Integral(b,31)); - - /* - h = (TH1D*)h0->Clone(s_name+cname); - for (int b=1 ; b<=nb; b++) - h->SetBinContent(b, h0->Integral(b,nb+1)); - */ - - h->Sumw2(); - h->Scale(40000./gNEvt/3.*0.795); - - h->SetLineColor(lcolor); - h->SetFillColor(lcolor); - h->SetLineStyle(lstyle); - h->SetLineWidth(lwidth); - - h->SetTitle(title); - - h->GetXaxis()->SetRangeUser(2, 129.); - h->GetYaxis()->SetRangeUser(gdy[0],gdy[1]); - - h->GetXaxis()->SetTitleSize(0.055); - h->GetXaxis()->SetTitleOffset(1.05); - h->GetXaxis()->SetLabelSize(0.045); - h->GetXaxis()->SetLabelOffset(0.003); - h->GetXaxis()->SetTitleFont(62); - h->GetXaxis()->SetLabelFont(62); - h->GetXaxis()->SetMoreLogLabels(1); - - h->GetYaxis()->SetTitleSize(0.055); - h->GetYaxis()->SetTitleOffset(0.9); - h->GetYaxis()->SetLabelSize(0.045); - h->GetYaxis()->SetTitleFont(62); - h->GetYaxis()->SetLabelFont(62); - - //h->GetYaxis()->SetLabelOffset(0.015); - - return h; -} - - -TH1D* setHistoRatio2(TH1D* num, TH1D* denom, TString title = "", double ymin=0.4, double ymax=1.6) -{ - ratio = (TH1D*) num->Clone(Form("%s--%s_ratio",num->GetName(),denom->GetName()) ); - ratio->Divide(num, denom, 1., 1.); - ratio->SetTitle(title); - ratio->GetYaxis()->SetRangeUser(ymin, ymax); - ratio->GetYaxis()->SetTitle("ratio: stub (ME1b&ME1a)/only ME1b"); - ratio->GetYaxis()->SetLabelSize(0.07); - ratio->GetYaxis()->SetTitleSize(0.07); - ratio->GetYaxis()->SetTitleOffset(0.6); - ratio->GetXaxis()->SetMoreLogLabels(1); - ratio->SetLineWidth(2); - ratio->SetFillColor(kRed+3); - ratio->SetLineColor(kRed+3); - ratio->SetMarkerColor(kRed+3); - ratio->SetMarkerStyle(20); - //ratio->Draw("e3"); - - return ratio; -} - - - -TH1D* getEnrichRate() -{ - f = TFile::Open("meb1_genpt4_EnrichMu_st.root"); - TTree *tr = (TTree*) f->Get("SimTrackAna/trk"); - tr->Draw("pt>>pppt()"); -} - - - -TH1D* getEffHisto(TString fname, TString hdir, TString num_name, TString den_name, int nrebin, int lcolor, int lstyle, int lwidth, - TString title, double *x_range, double *y_range) -{ - TFile *fh = TFile::Open(fname); - - TH1D* hd0 = (TH1D*)fh->Get(hdir + "/" + den_name); - TH1D* hn0 = (TH1D*)fh->Get(hdir + "/" + num_name); - - TH1D* hd = (TH1D*)hd0->Clone(den_name+"_cln_"+fname); - TH1D* hn = (TH1D*)hn0->Clone(num_name+"_cln_"+fname); - hd->Sumw2(); - hn->Sumw2(); - - myRebin(hd, nrebin); - myRebin(hn, nrebin); - - TH1D* heff = (TH1D*)hn->Clone(num_name+"_eff_"+fname); - - hd->Sumw2(); - heff->Sumw2(); - - heff->Divide(heff,hd); - - heff->SetLineColor(lcolor); - heff->SetLineStyle(lstyle); - heff->SetLineWidth(lwidth); - - heff->SetTitle(title); - //heff->GetXaxis()->SetTitle(xtitle); - //heff->GetYaxis()->SetTitle(ytitle); - heff->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); - heff->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); - - heff->GetXaxis()->SetTitleSize(0.07); - heff->GetXaxis()->SetTitleOffset(0.7); - heff->GetYaxis()->SetLabelOffset(0.015); - - heff->GetXaxis()->SetLabelSize(0.05); - heff->GetYaxis()->SetLabelSize(0.05); - - h1 = hn0; - h2 = hd0; - he = heff; - - //fh->Close(); - return heff; -} - - -TLatex* drawPULabel(float x=0.17, float y=0.25, float font_size=0.) -{ - TLatex * tex = new TLatex(x, y,"BX = 25 ns, PU = 100"); - if (font_size > 0.) tex->SetFontSize(font_size); - tex->SetTextSize(0.04); - tex->SetNDC(); - tex->Draw(); - return tex; -} -""" - -def etaTriggerRate(filesDir, plotDir, ext): - """Produce trigger rate plots versus eta.""" - - gStyle.SetOptStat(0) - gStyle.SetTitleStyle(0) - ##gStyle.SetPadTopMargin(0.08) - gStyle.SetTitleH(0.06) - - hdir = "SimMuL1StrictAll" - - f_def = "%shp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"%(filesDir) - f_g98_pt10 = "%shp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt10_pat2.root"%(filesDir) - f_g98_pt15 = "%shp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt15_pat2.root"%(filesDir) - f_g98_pt20 = "%shp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt20_pat2.root"%(filesDir) - f_g98_pt30 = "%shp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat2.root"%(filesDir) - f_g98_pt40 = "%shp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat2.root"%(filesDir) - - htitle = "Efficiency for #mu in 1.6<|#eta|<2.12 to have TF track;p_{T}^{MC} [GeV/c]" - - minpt = 10 - ttl = "CSC L1 trigger rates for p_{T}^{TF}>%d GeV/c;track #eta;rate/bin [kHz]"%(minpt) - - h_rt_def_tf10_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); - h_rt_def_tf10_2s_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s_2s1b"%(minpt), "_hAll100", ttl, kAzure+5, 1, 2); - h_rt_def_tf10_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s"%(minpt), "_hAll100", ttl, kAzure+3, 1, 2); - h_rt_def_tf10_3s_no1a = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_no1a"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); - h_rt_def_tf10_3s_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_1b"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); - h_rt_def_tf10_3s_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_2s1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_def_tf10_3s_2s1b_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_2s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_def_tf10_3s_2s1b_no1a = setHistoEta(f_def,"h_rt_gmt_csc_ptmax%d_eta_3s_2s1b_no1a"%(minpt),"_hAll100", ttl, kAzure+3, 7, 2); - h_rt_def_tf10_3s_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_def_tf10_3s_3s1b_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_def_tf10_3s_3s1b_no1a = setHistoEta(f_def,"h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_no1a"%(minpt),"_hAll100", ttl, kAzure+3, 7, 2); - - minpt = 20 - ttl = "CSC L1 trigger rates for p_{T}^{TF}>%d GeV/c;track #eta;rate/bin [kHz]"%(minpt) - - h_rt_def_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); - h_rt_def_tf20_2s_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s_2s1b"%(minpt), "_hAll100", ttl, kAzure+5, 1, 2); - h_rt_def_tf20_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s"%(minpt), "_hAll100", ttl, kAzure+3, 1, 2); - h_rt_def_tf20_3s_no1a = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_no1a"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); - h_rt_def_tf20_3s_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_1b"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); - h_rt_def_tf20_3s_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_2s1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_def_tf20_3s_2s1b_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_2s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_def_tf20_3s_2s1b_no1a = setHistoEta(f_def,"h_rt_gmt_csc_ptmax%d_eta_3s_2s1b_no1a"%(minpt),"_hAll100", ttl, kAzure+3, 7, 2); - h_rt_def_tf20_3s_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_def_tf20_3s_3s1b_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_def_tf20_3s_3s1b_no1a = setHistoEta(f_def,"h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_no1a"%(minpt),"_hAll100", ttl, kAzure+3, 7, 2); - - h_rt_def_tf20_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); - h_rt_def_tf20_2s_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s_2s1b"%(minpt), "_hAll100", ttl, kAzure+5, 1, 2); - h_rt_def_tf20_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s"%(minpt), "_hAll100", ttl, kAzure+3, 1, 2); - h_rt_def_tf20_3s_no1a = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_no1a"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); - h_rt_def_tf20_3s_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_1b"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); - h_rt_def_tf20_3s_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_2s1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_def_tf20_3s_2s1b_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_2s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_def_tf20_3s_2s1b_no1a = setHistoEta(f_def,"h_rt_gmt_csc_ptmax%d_eta_3s_2s1b_no1a"%(minpt),"_hAll100", ttl, kAzure+3, 7, 2); - h_rt_def_tf20_3s_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_def_tf20_3s_3s1b_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_def_tf20_3s_3s1b_no1a = setHistoEta(f_def,"h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_no1a"%(minpt),"_hAll100", ttl, kAzure+3, 7, 2); - - minpt = 30 - ttl = "CSC L1 trigger rates for p_{T}^{TF}>%d GeV/c;track #eta;rate/bin [kHz]"%(minpt) - - h_rt_def_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s"%(minpt), "_hAll300", ttl, kAzure+2, 1, 2); - h_rt_def_tf30_2s_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_2s_2s1b"%(minpt), "_hAll100", ttl, kAzure+5, 1, 2); - h_rt_def_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s"%(minpt), "_hAll100", ttl, kAzure+3, 1, 2); - h_rt_def_tf30_3s_no1a = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_no1a"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); - h_rt_def_tf30_3s_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_1b"%(minpt), "_hAll100", ttl, kAzure+2, 1, 2); - h_rt_def_tf30_3s_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_2s1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_def_tf30_3s_2s1b_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_2s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_def_tf30_3s_2s1b_no1a = setHistoEta(f_def,"h_rt_gmt_csc_ptmax%d_eta_3s_2s1b_no1a"%(minpt),"_hAll100", ttl, kAzure+3, 7, 2); - h_rt_def_tf30_3s_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_def_tf30_3s_3s1b_1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_def_tf30_3s_3s1b_no1a = setHistoEta(f_def,"h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_no1a"%(minpt),"_hAll100", ttl, kAzure+3, 7, 2); - - - - - - h_rt_tf20_gpt20_2s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax%d_eta_2s_2s1b"%(minpt), "_hAll100", ttl, kGreen+1, 7, 2); - h_rt_tf20_gpt20_3s1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b"%(minpt), "_hAll100", ttl, kGreen+3, 7, 2); - h_rt_tf20_gpt20_3s1b_1b = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_1b"%(minpt), "_hAll100", ttl, kAzure+6, 1, 2); - h_rt_tf20_gpt20_3s1b_no1a = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1b_no1a"%(minpt), "_hAll100", ttl, kAzure+3, 7, 2); - - ## h_rt_tf20_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1ab"%(minpt), "_hAll100", ttl, kBlue, 1, 2); - ## h_rt_tf20_gpt20_3s1ab = setHistoEta(f_g98_pt20, "h_rt_gmt_csc_ptmax%d_eta_3s_3s1ab"%(minpt), "_hAll100", ttl, kRed, 7, 2); - - -""" - c = TCanvas("c","c",800,600) - c.SetLogy(1) - - miny = 0.01 - maxy = 300 - - h_rt_tf20_2s.GetYaxis().SetRangeUser(miny,maxy) - h_rt_tf20_2s1b.GetYaxis().SetRangeUser(miny,maxy) - h_rt_tf20_gpt20_2s1b.GetYaxis().SetRangeUser(miny,maxy) - - h_rt_tf20_2s.Draw("hist e1") - h_rt_tf20_2s1b.Draw("hist e1 same") - h_rt_tf20_gpt20_2s1b.Draw("hist e1 same") - - leg = TLegend(0.4,0.63,.98,0.90,"","brNDC") - leg.SetBorderSize(0) - leg.SetFillStyle(0) - leg.AddEntry(h_rt_tf20_2s,"Tracks: p_{T}>=20, 2+ stubs","") - leg.AddEntry(h_rt_tf20_2s,"anywhere","l") - leg.AddEntry(h_rt_tf20_2s1b,"with ME1 in 1.6<|#eta|<2.14","l") - leg.AddEntry(h_rt_tf20_gpt20_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l") - leg.Draw() - - tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}") - tex.SetNDC() - tex.Draw("same") - - Print(c, plotDir, "rates__vs_eta__minpt%s__PU100__def-2s-2s1b__gem-2s-2s1b%s"%(minpt,ext)) - - ## Ratio plot - cAll100r = TCanvas("cAll100r","cAll100r",800,300) - gPad.SetGridx(1) - gPad.SetGridy(1) - gem_ratio = setHistoRatio(h_rt_tf20_gpt20_2s1b, h_rt_tf20_2s1b, "", 0.,1.8) - gem_ratio.Draw("e1") - - Print(cAll100r, plotDir, "rates__vs_eta__minpt%d__PU100__def-2s-2s1b__gem-2s-2s1b__ratio%s"%(minpt, ext)) - - - ##======================== 3+ Stubs ================================// - - c.Clear() - c.cd() - - maxy = 30 - h_rt_tf20_3s.GetYaxis().SetRangeUser(miny,maxy) - h_rt_tf20_3s1b.GetYaxis().SetRangeUser(miny,maxy) - h_rt_tf20_gpt20_3s1b.GetYaxis().SetRangeUser(miny,maxy) - - h_rt_tf20_3s.Draw("hist e1") - h_rt_tf20_gpt20_3s1b.Draw("hist e1 same") - h_rt_tf20_3s.Draw("hist e1 same") - h_rt_tf20_3s1b.Draw("hist e1 same") - - - - leg = TLegend(0.4,0.63,.98,0.90,"","brNDC") - leg.SetBorderSize(0) - leg.SetFillStyle(0) - leg.AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs","") - leg.AddEntry(h_rt_tf20_3s,"anywhere","l") - leg.AddEntry(h_rt_tf20_3s1b,"with ME1 in 1.6<|#eta|<2.14","l") - leg.AddEntry(h_rt_tf20_gpt20_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l") - leg.Draw() - - tex = TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}") - tex.SetNDC() - tex.Draw() - - Print(c, plotDir, "rates__vs_eta__minpt%s__PU100__def-3s-3s1b__gem-3s-3s1b%s"%(minpt,ext)) - - - cAll100r = TCanvas("cAll100r","cAll100r",800,300) - gPad.SetGridx(1) - gPad.SetGridy(1) - gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1b, h_rt_tf20_3s1b, "", 0.,1.8) - gem_ratio.Draw("e1") - - Print(cAll100r, plotDir, "rates__vs_eta__minpt%d__PU100__def-3s-3s1b__gem-3s-3s1b__ratio%s"%(minpt, ext)) - - - - ##========================= Comparing default with/without stub in ME1a ============================================== - - - c.Clear() - c.cd() - h_rt_tf20_3s1b.Draw("hist e1") - h_rt_tf20_3s.Draw("same hist e1") - h_rt_tf20_3s1b_1b.Draw("same hist e1") - h_rt_tf20_3s1b_no1a.Draw("same hist e1") - - h_rt_tf20_3s1b_1b.SetLineColor(kRed) - h_rt_tf20_3s1b_no1a.SetLineColor(kGreen+2) - h_rt_tf20_3s1b_1b.GetYaxis().SetRangeUser(miny,maxy) - h_rt_tf20_gpt20_3s1b_no1a.GetYaxis().SetRangeUser(miny,maxy) - - -# h_rt_tf20_3s1ab.Draw("hist e1 same") - - leg = TLegend(0.25,0.65,.85,0.90,"","brNDC") - leg.SetBorderSize(0) - leg.SetFillStyle(0) - leg.AddEntry(h_rt_tf20_3s1b,"Tracks: p_{T}>=20, 3+ stubs","") - leg.AddEntry(h_rt_tf20_3s1b,"Requiring stub in ME1b","l") - ## leg.AddEntry(h_rt_tf20_3s1ab,"Requiring stub in ME1b and ME1a","l") - leg.Draw() - - tex = TLatex(0.15, 0.85,"#splitline{L=4*10^{34}}{(25ns PU100)}") - tex.SetNDC() - tex.Draw() - - Print(c, plotDir, "test.pdf") - ##)rates__vs_eta__minpt%s__PU100__def-3s-3s1b__def-3s-3s1b_compstubME1a%s"%(minpt,ext) - - cAll100r = TCanvas("cAll100r","cAll100r",800,300) - gPad.SetGridx(1) - gPad.SetGridy(1) - gem_ratio = setHistoRatio(h_rt_tf20_3s1ab, h_rt_tf20_3s1b, "", 0.,1.8) - gem_ratio.Draw("e1") - - Print(cAll100r, plotDir, "rates__vs_eta__minpt%d__PU100__def-3s-3s1b__gem-3s-3s1b__ratio_compstubME1a%s"%(minpt, ext)) - - - - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - - // maxy = 30.;//10; - - // h_rt_tf20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); - // h_rt_tf20_gpt20_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // h_rt_tf20_3s->Draw("hist e1"); - // h_rt_tf20_gpt20_3s1ab->Draw("hist e1 same"); - // h_rt_tf20_3s->Draw("hist e1 same"); - // h_rt_tf20_3s1ab->Draw("hist e1 same"); - - - // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,"","brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf20_3s,"Tracks: p_{T}>=20, 3+ stubs",""); - // leg->AddEntry(h_rt_tf20_3s,"anywhere","l"); - // leg->AddEntry(h_rt_tf20_3s1ab,"with ME1 in 1.6<|#eta|","l"); - // leg->AddEntry(h_rt_tf20_gpt20_3s1ab,"with (ME1+GEM) in 1.6<|#eta|","l"); - // leg->Draw(); - - // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // tex->SetNDC(); - // tex->Draw(); - - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); - - - // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); - - // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1ab, h_rt_tf20_3s1ab, "", 0.,1.8); - // gem_ratio->Draw("e1"); - - // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); - - - - - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // h_rt_tf20_gpt20_3s1b->Draw("hist e1"); - // h_rt_tf20_gpt20_3s1ab->Draw("hist e1 same"); - - // TLegend *leg = new TLegend(0.25,0.65,.85,0.90,"","brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf20_gpt20_3s1b,"Tracks: p_{T}>=20, 3+ stubs",""); - // leg->AddEntry(h_rt_tf20_gpt20_3s1b,"Requiring stub in ME1b (ME1+GEM)","l"); - // leg->AddEntry(h_rt_tf20_gpt20_3s1ab,"Requiring stub in ME1b and ME1a (ME1+GEM)","l"); - // leg->Draw(); - - // TLatex * tex = new TLatex(0.15, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // tex->SetNDC(); - // tex->Draw(); - - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__gme-3s-3s1b__gem-3s-3s1b_compstubME1a.png").Data()); - - // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); - - // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1ab, h_rt_tf20_gpt20_3s1b, "", 0.,1.8); - // gem_ratio->Draw("e1"); - - // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__gem-3s-3s1b__gem-3s-3s1b__ratio_compstubME1a.png").Data()); - - - - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // h_rt_tf20_3s1ab->Draw("hist e1"); - // h_rt_tf20_gpt20_3s1ab->Draw("hist e1 same"); - - // TLegend *leg = new TLegend(0.25,0.65,.85,0.90,"","brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf20_3s1ab,"Tracks: p_{T}>=20, 3+ stubs",""); - // leg->AddEntry(h_rt_tf20_3s1ab,"Requiring stub in ME1b","l"); - // leg->AddEntry(h_rt_tf20_gpt20_3s1ab,"Requiring stub in ME1b and ME1a (ME1+GEMs)","l"); - // leg->Draw(); - - // TLatex * tex = new TLatex(0.15, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // tex->SetNDC(); - // tex->Draw(); - - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b_compstubME1a.png").Data()); - - // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); - - // gem_ratio = setHistoRatio(h_rt_tf20_gpt20_3s1ab, h_rt_tf20_3s1ab, "", 0.,1.8); - // gem_ratio->Draw("e1"); - - // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio_compstubME1a.png").Data()); - - - //********************************** TF track pT>30 GeV ************************************************// - - vs_eta_minpt = "30"; - ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin, kHz"; - - // TH1D* h_rt_tf30_2s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s", "_hAll100", ttl, kAzure+2, 1, 2); - // TH1D* h_rt_tf30_2s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kAzure+5, 1, 2); - // TH1D* h_rt_tf30_gpt30_2s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_2s_2s1b", "_hAll100", ttl, kGreen+1, 7, 2); - - - TH1D* h_rt_tf30_3s = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+3, 1, 2); - TH1D* h_rt_tf30_3s1b = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+6, 1, 2); - TH1D* h_rt_tf30_3s1ab = setHistoEta(f_def, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kAzure+2, 1, 2); - TH1D* h_rt_tf30_gpt30_3s1b = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kGreen+3, 7, 2); - TH1D* h_rt_tf30_gpt30_3s1ab = setHistoEta(f_g98_pt30, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1ab", "_hAll100", ttl, kRed, 7, 2); - - - // // maxy = 120.;//35.; - // // h_rt_tf30_2s->GetYaxis()->SetRangeUser(miny,maxy); - // // h_rt_tf30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - // // h_rt_tf30_gpt30_2s1b->GetYaxis()->SetRangeUser(miny,maxy); - - - // TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - // cAll100->SetLogy(1); - // // h_rt_tf30_2s->Draw("hist e1"); - // // h_rt_tf30_gpt30_2s1b->Draw("hist e1 same"); - // // h_rt_tf30_2s->Draw("hist e1 same"); - // // h_rt_tf30_2s1b->Draw("hist e1 same"); - - // // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,"","brNDC"); - // // leg->SetBorderSize(0); - // // leg->SetFillStyle(0); - // // leg->AddEntry(h_rt_tf30_2s,"Tracks: p_{T}>=30, 2+ stubs",""); - // // leg->AddEntry(h_rt_tf30_2s,"anywhere","l"); - // // leg->AddEntry(h_rt_tf30_2s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - // // leg->AddEntry(h_rt_tf30_gpt30_2s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - // // leg->Draw(); - - // // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // // tex->SetNDC(); - // // tex->Draw(); - - // // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); - - - // // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - // // gPad->SetGridx(1);gPad->SetGridy(1); - - // // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_2s1b, h_rt_tf30_2s1b, "", 0.,1.8); - // // gem_ratio->Draw("e1"); - - // // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b__ratio.png").Data()); - - - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - - maxy = 30.;//7.; - h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf30_gpt30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // h_rt_tf30_3s->Draw("hist e1"); - // h_rt_tf30_gpt30_3s1b->Draw("hist e1 same"); - // h_rt_tf30_3s->Draw("hist e1 same"); - // h_rt_tf30_3s1b->Draw("hist e1 same"); - - // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,"","brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); - // leg->AddEntry(h_rt_tf30_3s,"anywhere","l"); - // leg->AddEntry(h_rt_tf30_3s1b,"with ME1 in 1.6<|#eta|<2.14","l"); - // leg->AddEntry(h_rt_tf30_gpt30_3s1b,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - // leg->Draw(); - - // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // tex->SetNDC(); - // tex->Draw(); - - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); - - - - - // TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); - - // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1b, h_rt_tf30_3s1b, "", 0.,1.8); - // gem_ratio->Draw("e1"); - - // Print(cAll100r, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png").Data()); - - - - - - // //========================== Including the ME1a - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - - h_rt_tf30_3s->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf30_gpt30_3s1ab->GetYaxis()->SetRangeUser(miny,maxy); - h_rt_tf30_gpt30_3s1b->GetYaxis()->SetRangeUser(miny,maxy); - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - // h_rt_tf30_3s->Draw("hist e1"); - // h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same"); - // h_rt_tf30_3s->Draw("hist e1 same"); - // h_rt_tf30_3s1ab->Draw("hist e1 same"); - - // TLegend *leg = new TLegend(0.4,0.63,.98,0.90,"","brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - - // leg->AddEntry(h_rt_tf30_3s,"Tracks: p_{T}>=30, 3+ stubs",""); - // leg->AddEntry(h_rt_tf30_3s,"anywhere","l"); - // leg->AddEntry(h_rt_tf30_3s1ab,"with ME1 in 1.6<|#eta|","l"); - // leg->AddEntry(h_rt_tf30_gpt30_3s1ab,"with (ME1+GEM) in 1.6<|#eta|<2.14","l"); - // leg->Draw(); - - // TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // tex->SetNDC(); - // tex->Draw(); - - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); - - // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); - - // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1ab, h_rt_tf30_3s1ab, "", 0.,1.8); - // gem_ratio->Draw("e1"); - - // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio.png").Data()); - - - - //========================== Comparison with/without Stub in ME1a ==========================// - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - - // h_rt_tf30_3s1b->Draw("hist e1"); - // h_rt_tf30_3s1ab->Draw("hist e1 same"); - - // TLegend *leg = new TLegend(0.25,0.65,.85,0.90,"","brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf30_3s1b,"Tracks: p_{T}>=30, 3+ stubs",""); - // leg->AddEntry(h_rt_tf30_3s1b,"Requiring stub in ME1b","l"); - // leg->AddEntry(h_rt_tf30_3s1ab,"Requiring stub in ME1b and ME1a ","l"); - // leg->Draw(); - - // TLatex * tex = new TLatex(0.15, 0.85,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // tex->SetNDC(); - // tex->Draw(); - - - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__compstubME1a.png").Data()); - - - // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); - - // gem_ratio = setHistoRatio2(h_rt_tf30_3s1ab, h_rt_tf30_3s1b, "", 0.,1.8); - // gem_ratio->Draw("e1"); - - // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__ratio_compstubME1a.png").Data()); - - - // //========================== Comparison with/withous Stub in ME1a + GEMS ==========================// - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - - // h_rt_tf30_gpt30_3s1b->Draw("hist e1"); - // h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same "); - - // TLegend *leg = new TLegend(0.25,0.65,.85,0.90,"","brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf30_gpt30_3s1b,"Tracks: p_{T}>=30, 3+ stubs" ,""); - // leg->AddEntry(h_rt_tf30_gpt30_3s1b,"Requiring stub in ME1b (ME1+GEM)","l"); - // leg->AddEntry(h_rt_tf30_gpt30_3s1ab,"Requiring stub in ME1b and ME1a (ME1+GEM) ","l"); - // leg->Draw(); - - // TLatex * tex = new TLatex(0.15, 0.85,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // tex->SetNDC(); - // tex->Draw(); - - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__gem-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); - - // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); - - // gem_ratio = setHistoRatio2(h_rt_tf30_gpt30_3s1ab, h_rt_tf30_gpt30_3s1b, "", 0.,1.8); - // gem_ratio->Draw("e1"); - - // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__gem-3s-3s1ab__gem-3s-3s1ab__ratio_compstubME1a.png").Data()); - - - // //========================== Comparison with stubs in ME1a CSC/CSC+GEMS ==========================// - - // ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - - // h_rt_tf30_3s1ab->Draw("hist e1"); - // h_rt_tf30_gpt30_3s1ab->Draw("hist e1 same"); - - // TLegend *leg = new TLegend(0.25,0.65,.85,0.90,"","brNDC"); - // leg->SetBorderSize(0); - // leg->SetFillStyle(0); - // leg->AddEntry(h_rt_tf30_3s1ab,"Tracks: p_{T}>=30, 3+ stubs, 1 stub in ME1b or ME1a",""); - // leg->AddEntry(h_rt_tf30_3s1ab,"Requiring stub in ME1b and ME1a ","l"); - // leg->AddEntry(h_rt_tf30_gpt30_3s1ab,"Requiring stub in ME1b and ME1a (ME1+GEM)","l"); - // leg->Draw(); - - // TLatex * tex = new TLatex(0.15, 0.85,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - // tex->SetNDC(); - // tex->Draw(); - - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab_compstubME1a.png").Data()); - - - // TCanvas* cAll100r2 = new TCanvas("cAll100r2","cAll100r2",800,300) ; - // gPad->SetGridx(1);gPad->SetGridy(1); - - // gem_ratio = setHistoRatio(h_rt_tf30_gpt30_3s1ab, h_rt_tf30_3s1ab, "", 0.,1.8); - // gem_ratio->Draw("e1"); - - // Print(cAll100r2, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab__ratio_compstubME1a.png").Data()); - - - - - - - -} - -def etaTriggerRates(filesDir, plotDir, ext): - Produce trigger rate plots versus eta for pt values and specific patterns - - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt10_pat2.root', plotDir, ext) - - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt15_pat2.root', plotDir, ext) - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt20_pat2.root', plotDir, ext) - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt30_pat2.root', plotDir, ext) - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt40_pat2.root', plotDir, ext) - - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt10_pat8.root', plotDir, ext) - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt15_pat8.root', plotDir, ext) - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt20_pat8.root', plotDir, ext) - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt30_pat8.root', plotDir, ext) - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem95_pt40_pat8.root', plotDir, ext) - - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt10_pat2.root', plotDir, ext) - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt15_pat2.root', plotDir, ext) - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt20_pat2.root', plotDir, ext) - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat2.root', plotDir, ext) - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat2.root', plotDir, ext) - - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt10_pat8.root', plotDir, ext) - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt15_pat8.root', plotDir, ext) - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt20_pat8.root', plotDir, ext) - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt30_pat8.root', plotDir, ext) - etaTriggerRate(filesDir, 'hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem98_pt40_pat8.root', plotDir, ext) - - """ - -""" -/* -//########################################################################### -//########################################################################### - -//void drawplot_gmtrt(char *fname, char *dname="tf") -void drawplot_gmtrt(TString dname = "", TString vs_eta_minpt = "") -{ - - bool vs_eta = false; - if (vs_eta_minpt.Length() > 0) vs_eta = true; - - // directory for plots is made as - // pdir = $PWD/pic[_{dname}]_{pu} - - //gStyle->SetStatW(0.13); - //gStyle->SetStatH(0.08); - gStyle->SetStatW(0.07); - gStyle->SetStatH(0.06); - - gStyle->SetOptStat(0); - - gStyle->SetTitleStyle(0); - gStyle->SetTitleAlign(13);// coord in top left - gStyle->SetTitleX(0.); - gStyle->SetTitleY(1.); - gStyle->SetTitleW(1); - gStyle->SetTitleH(0.058); - gStyle->SetTitleBorderSize(0); - - gStyle->SetPadLeftMargin(0.126); - gStyle->SetPadRightMargin(0.04); - gStyle->SetPadTopMargin(0.06); - gStyle->SetPadBottomMargin(0.13); - - gStyle->SetMarkerStyle(1); - - - - char d1[111]="",d2[111]=""; - if (dname != "") sprintf(d1,"_%s", dname.Data()); - //if (strcmp(pu,"")>0) sprintf(d2,"_%s",pu); - //sprintf(pdir,"pic%s%s",d1,d2); - - if (interactive && dname != "") { - sprintf(pdir,"pic%s%s",d1,d2); - if( gSystem->AccessPathName(pdir)==0 ) { - //cout<<"directory "<Exec(cmd) != 0) {cout<<"can't remode directory! exiting..."<MakeDirectory(pdir); - } - } - - //cout<<"opening "<Get("SimMuL1/;1"); - - char f_pu050_me42_re4[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; - char f_pu050_re4[200] ="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; - char f_pu050[200] ="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; - char f_pu050_me42_rev1[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rev1_rpc.root"; - char f_pu050_me42_rev2[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rev2_rpc.root"; - - - char f_pu050_hneu_me42_re4[200]="hp_minbias_3_6_2_hnpu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; - char f_pu050_neu_me42_re4[200]="hp_minbias_3_6_2_npu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; - - - char f_pu200_hneu_me42_re4[200]="hp_minbias_3_6_2_hnpu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; - char f_pu200_rneu_me42_re4[200]="hp_minbias_3_6_2_rnpu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; - - char f_pu200_neu_me42_re4[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; - char f_pu200_me42_re4[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; - - char f_pu200_neu_re4[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; - char f_pu200_re4[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; - hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat8.root - char f_pu200_neu[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; - char f_pu200[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; - - - - - TString f_pu100_pat8 = gem_dir; - TString f_pu100_pat8_gem = gem_dir; - - //TString f_pu100_pat2 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat2.root"; - //TString f_pu100_pat8 ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat8.root"; - //TString f_pu100_pat2_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat2.root"; - //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat8.root"; - - //TString f_pu100_pat8 ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_pat2.root"; - //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat2.root"; - - - if (dname.Contains("_pat8")) f_pu100_pat8 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root"; - if (dname == "minbias_pt05_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat8.root"; - if (dname == "minbias_pt06_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat8.root"; - if (dname == "minbias_pt10_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat8.root"; - if (dname == "minbias_pt15_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat8.root"; - if (dname == "minbias_pt20_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat8.root"; - if (dname == "minbias_pt30_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat8.root"; - if (dname == "minbias_pt40_pat8") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat8.root"; - - if (dname.Contains("_pat2")) f_pu100_pat8 += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; - if (dname == "minbias_pt05_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat2.root"; - if (dname == "minbias_pt06_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat2.root"; - if (dname == "minbias_pt10_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat2.root"; - if (dname == "minbias_pt15_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat2.root"; - if (dname == "minbias_pt20_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat2.root"; - if (dname == "minbias_pt30_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat2.root"; - if (dname == "minbias_pt40_pat2") f_pu100_pat8_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat2.root"; - - //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemx_pt20_pat2.root"; - //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemOldx_pt20_pat2.root"; - //TString f_pu100_pat8_gem ="hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gemOld_pt20_pat2.root"; - - - bool do_return = false; - - - - //#################################### PU100 #################################### - - // full eta 1. - 2.4 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b - if (vs_eta) - { - gdy[0]=0; gdy[1]=7.; - if (vs_eta_minpt=="20") gdy[1]=10.; - - TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin, kHz"; - hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100", ttl, kAzure+9, 1, 2); - hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - - //gStyle->SetPadTopMargin(0.08); - gStyle->SetTitleH(0.06); - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - hAll100->Draw("hist e1"); - hAll100gem->Draw("hist e1 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","l"); - leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); - leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); - leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); - leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-2s1b__gem-3s-2s1b.png").Data()); - - if (do_return) return; - } - - - - // full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b - if (vs_eta) - { - gdy[0]=0; gdy[1]=7.; - if (vs_eta_minpt=="20") gdy[1]=10.; - - TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin, kHz"; - hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100", ttl, kAzure+9, 1, 2); - hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - - //gStyle->SetPadTopMargin(0.08); - gStyle->SetTitleH(0.06); - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - hAll100->Draw("hist e1"); - hAll100gem->Draw("hist e1 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","l"); - leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); - leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); - leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100->AddEntry(hAll100,"in ME1/b region also require",""); - leg_cc100->AddEntry(hAll100,"one stub to be from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); - - if (do_return) return; - } - - // full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b - if (vs_eta) - { - gdy[0]=0; gdy[1]=7.; - if (vs_eta_minpt=="20") gdy[1]=10.; - - TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin, kHz"; - hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); - hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_2s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - - //gStyle->SetPadTopMargin(0.08); - gStyle->SetTitleH(0.06); - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - hAll100->Draw("hist e1"); - hAll100gem->Draw("hist e1 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","l"); - leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); - leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); - leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-2s1b.png").Data()); - - if (do_return) return; - } - - - // full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b - if (vs_eta) - { - gdy[0]=0; gdy[1]=7.; - if (vs_eta_minpt=="20") gdy[1]=10.; - - TString ttl = "CSC L1 trigger rates for p_{T}^{TF}>" + vs_eta_minpt + " GeV/c;track #eta;rate/bin, kHz"; - hAll100 = setHistoEta(f_pu100_pat8, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s", "_hAll100", ttl, kAzure+9, 1, 2); - hAll100gem = setHistoEta(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax" + vs_eta_minpt + "_eta_3s_3s1b", "_hAll100gem", ttl, kGreen+3, 1, 2); - - //gStyle->SetPadTopMargin(0.08); - gStyle->SetTitleH(0.06); - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - hAll100->Draw("hist e1"); - hAll100gem->Draw("hist e1 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","l"); - leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100->AddEntry(hAll100gem,"with GEM match","l"); - leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100->AddEntry(hAll100,"in ME1/b region also require",""); - leg_cc100->AddEntry(hAll100,"one stub to be from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.82,"#splitline{L=4*10^{34}}{(25ns PU100)}"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s__gem-3s-3s1b.png").Data()); - - if (do_return) return; - } - - - if (vs_eta) return; - - - - // full eta 1. - 2.4 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b - if (1) - { - gdy[0]=2; gdy[1]=2000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); - - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - gPad->SetLogx(1);gPad->SetLogy(1); - gPad->SetGridx(1);gPad->SetGridy(1); - hAll100->Draw("e3"); - hAll100gem->Draw("e3 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","f"); - leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); - leg_cc100->AddEntry(hAll100,">=3 stubs in 1<|#eta|<2.4",""); - leg_cc100->AddEntry(hAll100,"except in ME1/b region require",""); - leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, "rates__1-2.4__PU100__def-3s-2s1b__gem-3s-2s1b.png"); - - - TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - gPad->SetLogx(1);//gPad->SetLogy(1); - gPad->SetGridx(1);gPad->SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.4); - hAll100gem_ratio->Draw("e1"); - - Print(cAll100r, "rates__1-2.4__PU100__def-3s-2s1b__gem-3s-2s1b__ratio.png"); - - if (do_return) return; - } - - - - // full eta 1. - 2.4 Default: 3station GEM: 3station, 2s & 1b - if (1) - { - gdy[0]=2; gdy[1]=2000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); - - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - gPad->SetLogx(1);gPad->SetLogy(1); - gPad->SetGridx(1);gPad->SetGridy(1); - hAll100->Draw("e3"); - hAll100gem->Draw("e3 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","f"); - leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.4",""); - leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100->AddEntry(hAll100,"Tracks: same, except in ME1/b region req.",""); - leg_cc100->AddEntry(hAll100,">=2 stubs and one of them from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, "rates__1-2.4__PU100__def-3s__gem-3s-2s1b.png"); - - - TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - gPad->SetLogx(1);//gPad->SetLogy(1); - gPad->SetGridx(1);gPad->SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); - hAll100gem_ratio->Draw("e1"); - - Print(cAll100r, "rates__1-2.4__PU100__def-3s__gem-3s-2s1b__ratio.png"); - - if (do_return) return; - } - - - - // no ME1/a eta 1. - 2.1 Default: 3station GEM: 3station, 3s & 1b - if (1) - { - gdy[0]=2; gdy[1]=2000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_no1a", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); - - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - gPad->SetLogx(1);gPad->SetLogy(1); - gPad->SetGridx(1);gPad->SetGridy(1); - hAll100->Draw("e3"); - hAll100gem->Draw("e3 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","f"); - leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.1",""); - leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100->AddEntry(hAll100,"Tracks: same, except in ME1/b region req.",""); - leg_cc100->AddEntry(hAll100,">=3 stubs and one of them from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, "rates__1-2.1__PU100__def-3s__gem-3s-3s1b.png"); - - - TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - gPad->SetLogx(1); - gPad->SetGridx(1);gPad->SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); - hAll100gem_ratio->Draw("e1"); - - Print(cAll100r, "rates__1-2.1__PU100__def-3s__gem-3s-3s1b__ratio.png"); - - - result_gem_eta_no1a = hAll100gem; - result_def_eta_no1a = hAll100; - - if (do_return) return; - } - - - // no ME1/a eta 1. - 2.1 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b - if (1) - { - gdy[0]=2; gdy[1]=2000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); - - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - gPad->SetLogx(1);gPad->SetLogy(1); - gPad->SetGridx(1);gPad->SetGridy(1); - hAll100->Draw("e3"); - hAll100gem->Draw("e3 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","f"); - leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); - leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1<|#eta|<2.1",""); - leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, "rates__1-2.1__PU100__def-3s-3s1b__gem-3s-3s1b.png"); - - - TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - gPad->SetLogx(1); - gPad->SetGridx(1);gPad->SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); - hAll100gem_ratio->Draw("e1"); - - Print(cAll100r, "rates__1-2.1__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); - - //result_gem_eta_no1a = hAll100gem; - result_def_eta_no1a_3s1b = hAll100; - - if (do_return) return; - } - - - // Full eta 1. - 2.4 Default: 3station GEM: 3station, 3s & 1b - if (1) - { - gdy[0]=2; gdy[1]=2000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); - - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - gPad->SetLogx(1);gPad->SetLogy(1); - gPad->SetGridx(1);gPad->SetGridy(1); - hAll100->Draw("e3"); - hAll100gem->Draw("e3 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","f"); - leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1<|#eta|<2.4",""); - leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100->AddEntry(hAll100,"Tracks: same, except",""); - leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, "rates__1-2.4__PU100__def-3s__gem-3s-3s1b.png"); - - - TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - gPad->SetLogx(1); - gPad->SetGridx(1);gPad->SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.2); - hAll100gem_ratio->Draw("e1"); - - Print(cAll100r, "rates__1-2.4__PU100__def-3s__gem-3s-3s1b__ratio.png"); - - result_gem_eta_all = hAll100gem; - result_def_eta_all = hAll100; - - if (do_return) return; - } - - - - // Full eta 1. - 2.4 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b - if (1) - { - gdy[0]=2; gdy[1]=2000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100s3", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b", "_hAll100gem", "CSC L1 trigger rates;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); - - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - gPad->SetLogx(1);gPad->SetLogy(1); - gPad->SetGridx(1);gPad->SetGridy(1); - hAll100->Draw("e3"); - hAll100gem->Draw("e3 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","f"); - leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); - leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1<|#eta|<2.4",""); - leg_cc100->AddEntry(hAll100,"for ME1/b etas require one stub from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, "rates__1-2.4__PU100__def-3s-3s1b__gem-3s-3s1b.png"); - - - TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - gPad->SetLogx(1); - gPad->SetGridx(1);gPad->SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.4,1.6); - hAll100gem_ratio->Draw(); - - Print(cAll100r, "rates__1-2.4__PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); - - //result_gem_eta_all = hAll100gem; - result_def_eta_all_3s1b = hAll100; - - if (do_return) return; - } - - - - // ME1b eta 1.64 - 2.14 Default: 3station, 3s & 1b GEM: 3station, 3s & 1b - if (1) - { - gdy[0]=0.02; gdy[1]=1000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); - - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - gPad->SetLogx(1);gPad->SetLogy(1); - gPad->SetGridx(1);gPad->SetGridy(1); - hAll100->Draw("e3"); - hAll100gem->Draw("e3 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","f"); - leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); - leg_cc100->AddEntry(hAll100,"with >=3 stubs in 1.64<|#eta|<2.14",""); - leg_cc100->AddEntry(hAll100,"and require one stub to be from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b.png"); - - - TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - gPad->SetLogx(1); - gPad->SetGridx(1);gPad->SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,2.1); - hAll100gem_ratio->Draw("e1"); - - Print(cAll100r, "rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__ratio.png"); - - result_gem = hAll100gem; - result_def_3s1b = hAll100; - - if (do_return) return; - } - - - - // ME1b eta 1.64 - 2.14 Default: 3station, 3s GEM: 3station, 3s & 1b - if (1) - { - gdy[0]=0.02; gdy[1]=1000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); - - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - gPad->SetLogx(1);gPad->SetLogy(1); - gPad->SetGridx(1);gPad->SetGridy(1); - hAll100->Draw("e3"); - hAll100gem->Draw("e3 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","f"); - leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); - leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100->AddEntry(hAll100,"Tracks: same, plus req. one stub from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b.png"); - - - TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - gPad->SetLogx(1); - gPad->SetGridx(1);gPad->SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,1.1); - hAll100gem_ratio->Draw("e1"); - - Print(cAll100r, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__ratio.png"); - - //result_gem = hAll100gem; - result_def = hAll100; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_2s_1b", "_hAll100s2", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); - result_def_2s = hAll100; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_2s_1b", "_hAll100s2", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); - result_def_2s = hAll100; - - if (do_return) return; - } - - - - // ME1b eta 1.64 - 2.14 Default: 3station, 3s GMT single trigg - if (1) - { - gdy[0]=0.02; gdy[1]=1000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_ptmax_sing_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+1, 1, 1); - - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - gPad->SetLogx(1);gPad->SetLogy(1); - gPad->SetGridx(1);gPad->SetGridy(1); - hAll100->Draw("e3"); - hAll100gem->Draw("e3 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); - leg_cc100->AddEntry(hAll100gem,"GMT selection for Single Trigger","f"); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gmtsing.png"); - - result_gmtsing = hAll100gem; - - if (do_return) return; - } - - - // ME1b eta 1.64 - 2.14 Default: 3station, 2s & 1b GEM: 3station, 2s & 1b - if (1) - { - gdy[0]=0.02; gdy[1]=1000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); - - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - gPad->SetLogx(1);gPad->SetLogy(1); - gPad->SetGridx(1);gPad->SetGridy(1); - hAll100->Draw("e3"); - hAll100gem->Draw("e3 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","f"); - leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100->AddEntry(hAll100,"Tracks req. for both:",""); - leg_cc100->AddEntry(hAll100,"with >=2 stubs in 1.64<|#eta|<2.14",""); - leg_cc100->AddEntry(hAll100,"and require one stub to be from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b.png"); - - - TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - gPad->SetLogx(1); - gPad->SetGridx(1);gPad->SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,2.1); - hAll100gem_ratio->Draw("e1"); - - Print(cAll100r, "rates__1.6-2.1_PU100__def-3s-2s1b__gem-3s-2s1b__ratio.png"); - - result_gem_2s1b = hAll100gem; - result_def_2s1b = hAll100; - - if (do_return) return; - } - - - // this was commented out - - // ME1b eta 1.64 - 2.14 Default: 3station, 3s GEM: 3station, 2s & 1b - if (1) - { - gdy[0]=0.02; gdy[1]=1000.; - - hAll100 = setHisto(f_pu100_pat8, "h_rt_gmt_csc_ptmax_3s_1b", "_hAll100s3", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kAzure+9, 1, 1); - hAll100gem = setHisto(f_pu100_pat8_gem, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_hAll100gem", "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut}, GeV/c;rate, kHz", kGreen+3, 1, 1); - - TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; - gPad->SetLogx(1);gPad->SetLogy(1); - gPad->SetGridx(1);gPad->SetGridy(1); - hAll100->Draw("e3"); - hAll100gem->Draw("e3 same"); - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - //leg_cc100->SetTextSize(0.0368); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(hAll100,"default emulator","f"); - leg_cc100->AddEntry(hAll100,"Tracks: with >=3 stubs in 1.64<|#eta|<2.14",""); - leg_cc100->AddEntry(hAll100gem,"with GEM match","f"); - leg_cc100->AddEntry(hAll100gem,"Tracks: with >=2 stubs in 1.64<|#eta|<2.14",""); - leg_cc100->AddEntry(hAll100gem,"plus req. one stub from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex->SetNDC(); - tex->Draw(); - - Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b.png"); - - - TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; - gPad->SetLogx(1); - gPad->SetGridx(1);gPad->SetGridy(1); - - hAll100gem_ratio = setHistoRatio(hAll100gem, hAll100, "", 0.,1.1); - hAll100gem_ratio->Draw("e1"); - - Print(cAll100r, "rates__1.6-2.1_PU100__def-3s__gem-3s-2s1b__ratio.png"); - - result_gem_2s1b = hAll100gem; - //result_def = hAll100; - - if (do_return) return; - } - - - - - return; -} -*/ - -/* - - .L drawplot_gmtrt.C - drawplot_gmtrt("minbias_pt10_pat2") - hh = (TH1D*)result_gem->Clone("gem_new") - hh->SetFillColor(kGreen+4) - for (int b = hh->FindBin(15); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); - drawplot_gmtrt("minbias_pt15_pat2") - h15 = (TH1D*)result_gem->Clone("gem15") - for (int b = h15->FindBin(15); b < h15->FindBin(20); ++b) hh->SetBinContent(b, h15->GetBinContent(b)); - drawplot_gmtrt("minbias_pt20_pat2") - h20 = (TH1D*)result_gem->Clone("gem20") - for (int b = h20->FindBin(20); b < h20->FindBin(30); ++b) hh->SetBinContent(b, h20->GetBinContent(b)); - drawplot_gmtrt("minbias_pt30_pat2") - h30 = (TH1D*)result_gem->Clone("gem30") - for (int b = h30->FindBin(30); b <= h30->GetNbinsX(); ++b) hh->SetBinContent(b, h30->GetBinContent(b)); - for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); - - ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - result_def->Draw("e3"); - hh->Draw("same e3"); - - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(result_def,"default emulator","f"); - leg_cc100->AddEntry(result_def,"Tracks: with >=3 stubs in 1.14<|#eta|<2.14",""); - leg_cc100->AddEntry(hh,"with GEM match","f"); - leg_cc100->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex->SetNDC(); - tex->Draw(); - - gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2.png") - - - ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); - hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); - hh_ratio->Draw("e1"); - gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio.png") - - - ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - result_def_3s1b->Draw("e3") - hh->Draw("same e3") - - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(result_def_3s1b,"default emulator","f"); - leg_cc100->AddEntry(hh,"with GEM match","f"); - leg_cc100->AddEntry(result_def_3s1b,"Tracks req. for both:",""); - leg_cc100->AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); - leg_cc100->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex->SetNDC(); - tex->Draw(); - - gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2.png") - - - ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); - hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); - hh_ratio->Draw("e1"); - gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio.png") - - - - - .L drawplot_gmtrt.C - drawplot_gmtrt("minbias_pt10_pat8") - hh = (TH1D*)result_gem->Clone("gem_new") - hh->SetFillColor(kGreen+4) - for (int b = hh->FindBin(15); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); - drawplot_gmtrt("minbias_pt15_pat8") - h15 = (TH1D*)result_gem->Clone("gem15") - for (int b = h15->FindBin(15); b < h15->FindBin(20); ++b) hh->SetBinContent(b, h15->GetBinContent(b)); - drawplot_gmtrt("minbias_pt20_pat8") - h20 = (TH1D*)result_gem->Clone("gem20") - for (int b = h20->FindBin(20); b < h20->FindBin(30); ++b) hh->SetBinContent(b, h20->GetBinContent(b)); - drawplot_gmtrt("minbias_pt30_pat8") - h30 = (TH1D*)result_gem->Clone("gem30") - for (int b = h30->FindBin(30); b <= h30->GetNbinsX(); ++b) hh->SetBinContent(b, h30->GetBinContent(b)); - for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); - - - ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - result_def->Draw("e3") - hh->Draw("same e3") - - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(result_def,"default emulator","f"); - leg_cc100->AddEntry(result_def,"Tracks: with >=3 stubs in 1.14<|#eta|<2.14",""); - leg_cc100->AddEntry(hh,"with GEM match","f"); - leg_cc100->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex->SetNDC(); - tex->Draw(); - - gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8.png") - - - ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); - hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); - hh_ratio->Draw("e1"); - gPad->Print("gem/rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio.png") - - - - ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); - result_def_3s1b->Draw("e3") - hh->Draw("same e3") - - TLegend *leg_cc100 = new TLegend(0.4,0.65,.98,0.92,"","brNDC"); - const TObject obj; - leg_cc100->SetBorderSize(0); - leg_cc100->SetFillStyle(0); - leg_cc100->AddEntry(result_def_3s1b,"default emulator","f"); - leg_cc100->AddEntry(hh,"with GEM match","f"); - leg_cc100->AddEntry(result_def_3s1b,"Tracks req. for both:",""); - leg_cc100->AddEntry(result_def_3s1b,"with >=3 stubs in 1.64<|#eta|<2.14",""); - leg_cc100->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); - leg_cc100->Draw(); - - TLatex * tex = new TLatex(0.17, 0.15,"L=4*10^{34} (25ns PU100)"); - tex->SetNDC(); - tex->Draw(); - - gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8.png") - - - ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); - hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); - hh_ratio->Draw("e1"); - gPad->Print("gem/rates__1.6-2.1_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio.png") - - -*/ - -""" - -def plotGlobalMuonTriggerRate(filesDir, plotDir, ext): - """Produce trigger rate plots versus eta""" - etaTriggerRate(filesDir, plotDir, ext) - -if __name__ == '__main__': - - plotGlobalMuonTriggerRate("files/", "plots/rate/", ".pdf") - - - -#### PNG -""" - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1ab__gem-3s-3s1ab.png").Data()); - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__gme-3s-3s1b__gem-3s-3s1b_compstubME1a.png").Data()); - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b_compstubME1a.png").Data()); - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-2s-2s1b__gem-2s-2s1b.png").Data()); - // Print(cAll100, ("rates__vs_eta__minpt"+ vs_eta_minpt +"__PU100__def-3s-3s1b__gem-3s-3s1b.png").Data()); - Print(cAll100, "rates__1.6-2.1_PU100__def-3s__gem-3s-3s1b.png"); -""" From 8978a034195f2a9e6de62b8e2bded5133c4c7747 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 19 Sep 2013 18:10:34 +0200 Subject: [PATCH 129/182] moving common part to getPTHistos --- SimMuL1/scripts/drawplot_frankenstein.C | 2121 ++++++++--------- .../scripts/drawplot_frankenstein_ptshift.C | 1609 ++++++------- .../scripts/drawplot_frankenstein_ptshiftX.C | 1682 ++++++------- SimMuL1/scripts/getPTHistos.C | 15 +- 4 files changed, 2611 insertions(+), 2816 deletions(-) diff --git a/SimMuL1/scripts/drawplot_frankenstein.C b/SimMuL1/scripts/drawplot_frankenstein.C index f6bb975376e47..0cc1386a4d32c 100644 --- a/SimMuL1/scripts/drawplot_frankenstein.C +++ b/SimMuL1/scripts/drawplot_frankenstein.C @@ -1,520 +1,455 @@ - -/* -.L drawplot_gmtrt.C - -*/ - -TString ext = ".png"; -TString filesDir = "files/"; -TString plotDir = "plots/rate_vs_pt/"; - -void getPTHistos(TString dname) -{ -TString f_def = filesDir; -TString f_gem = filesDir; - -if (dname.Contains("_pat8")) f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root"; -if (dname == "minbias_pt05_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat8.root"; -if (dname == "minbias_pt06_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat8.root"; -if (dname == "minbias_pt10_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat8.root"; -if (dname == "minbias_pt15_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat8.root"; -if (dname == "minbias_pt20_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat8.root"; -if (dname == "minbias_pt30_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat8.root"; -if (dname == "minbias_pt40_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat8.root"; - -if (dname.Contains("_pat2")) f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; -if (dname == "minbias_pt05_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat2.root"; -if (dname == "minbias_pt06_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat2.root"; -if (dname == "minbias_pt10_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat2.root"; -if (dname == "minbias_pt15_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat2.root"; -if (dname == "minbias_pt20_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat2.root"; -if (dname == "minbias_pt30_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat2.root"; -if (dname == "minbias_pt40_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat2.root"; - -result_def = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_1b", "_def"); -result_def_2s = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_2s_1b", "_def"); -result_def_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_def"); -result_def_2s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_def"); -result_def_2s123 = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_2s123_1b", "_def"); -result_def_2s13 = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_2s13_1b", "_def"); -result_def_eta_all = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s", "_def"); -result_def_eta_all_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_def"); -result_def_eta_no1a = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_no1a", "_def"); -result_def_eta_no1a_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_def"); -result_def_gmtsing = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); -result_def_gmtsing_no1a = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing6_no1a", "_def"); - -result_gem = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_gem"); -result_gem_2s1b = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_gem"); -result_gem_2s123 = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_2s123_1b", "_gem"); -result_gem_2s13 = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_2s13_1b", "_gem"); -result_gem_eta_all = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_gem"); -result_gem_eta_no1a = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_gem"); -//result_gem_gmtsing = getPTHisto(f_gem, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); -result_gem_gmtsing_no1a = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing6_3s1b_no1a", "_def"); -} - - - void drawplot_frankenstein() { - + TString ext = ".png"; + TString filesDir = "files/"; + TString plotDir = "plots/rate_vs_pt/"; + gROOT->ProcessLine(".L drawplot_gmtrt.C"); + gROOT->ProcessLine(".L getPTHistos.C"); - //gem_dir = "gem_vadim/"; - gem_dir = plotDir; gem_label = "gem98"; -//gem_dir = "gem95/"; gem_label = "gem95"; - -//do_not_print = true; - -//gROOT->SetBatch(true); - -//gStyle->SetStatW(0.13); -//gStyle->SetStatH(0.08); -gStyle->SetStatW(0.07); -gStyle->SetStatH(0.06); - -gStyle->SetOptStat(0); - -gStyle->SetTitleStyle(0); -gStyle->SetTitleAlign(13);// coord in top left -gStyle->SetTitleX(0.); -gStyle->SetTitleY(1.); -gStyle->SetTitleW(1); -gStyle->SetTitleH(0.058); -gStyle->SetTitleBorderSize(0); - -gStyle->SetPadLeftMargin(0.126); -gStyle->SetPadRightMargin(0.04); -gStyle->SetPadTopMargin(0.06); -gStyle->SetPadBottomMargin(0.13); - -gStyle->SetMarkerStyle(1); - -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); - -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); - - -// ********** PAT2 ********** - -getPTHistos("minbias_pt06_pat2"); -hh = (TH1D*)result_def_3s1b->Clone("gem_new"); -for (int b = hh->FindBin(6.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); -hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); -for (int b = hh_all->FindBin(6.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); -hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); -for (int b = hh_no1a->FindBin(6.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); -hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); -for (int b = hh_2s1b->FindBin(6.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); -hh_2s123 = (TH1D*)result_def_2s123->Clone("gem_new_2s123"); -for (int b = hh_2s123->FindBin(6.01); b <= hh_2s123->GetNbinsX(); ++b) hh_2s123->SetBinContent(b, 0); -hh_2s13 = (TH1D*)result_def_2s13->Clone("gem_new_2s13"); -for (int b = hh_2s13->FindBin(6.01); b <= hh_2s13->GetNbinsX(); ++b) hh_2s13->SetBinContent(b, 0); -hh_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("hh_sing_no1a"); -for (int b = hh_sing_no1a->FindBin(6.01); b <= hh_sing_no1a->GetNbinsX(); ++b) hh_sing_no1a->SetBinContent(b, 0); - -h06 = (TH1D*)result_gem->Clone("gem_new_06"); -for (int b = h06->FindBin(6.01); b < h06->FindBin(10.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} -h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); -for (int b = h06_all->FindBin(6.01); b < h06_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} -h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); -for (int b = h06_no1a->FindBin(6.01); b < h06_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} -h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); -for (int b = h06_2s1b->FindBin(6.01); b < h06_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} -h06_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_06"); -for (int b = h06_2s123->FindBin(6.01); b < h06_2s123->FindBin(10.01); ++b) {hh_2s123->SetBinContent(b, h06_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h06_2s123->GetBinError(b));} -h06_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_06"); -for (int b = h06_2s13->FindBin(6.01); b < h06_2s13->FindBin(10.01); ++b) {hh_2s13->SetBinContent(b, h06_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h06_2s13->GetBinError(b));} -h06_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_06"); -for (int b = h06_sing_no1a->FindBin(6.01); b < h06_sing_no1a->FindBin(10.01); ++b) {hh_sing_no1a->SetBinContent(b, h06_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h06_sing_no1a->GetBinError(b));} - -getPTHistos("minbias_pt10_pat2"); -h10 = (TH1D*)result_gem->Clone("gem10"); -for (int b = h10->FindBin(10.01); b < h10->FindBin(15.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} -h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); -for (int b = h10_all->FindBin(10.01); b < h10_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} -h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); -for (int b = h10_no1a->FindBin(10.01); b < h10_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} -h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); -for (int b = h10_2s1b->FindBin(10.01); b < h10_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} -h10_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_10"); -for (int b = h10_2s123->FindBin(10.01); b < h10_2s123->FindBin(15.01); ++b) {hh_2s123->SetBinContent(b, h10_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h10_2s123->GetBinError(b));} -h10_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_10"); -for (int b = h10_2s13->FindBin(10.01); b < h10_2s13->FindBin(15.01); ++b) {hh_2s13->SetBinContent(b, h10_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h10_2s13->GetBinError(b));} -h10_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_10"); -for (int b = h10_sing_no1a->FindBin(10.01); b < h10_sing_no1a->FindBin(15.01); ++b) {hh_sing_no1a->SetBinContent(b, h10_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h10_sing_no1a->GetBinError(b));} - -getPTHistos("minbias_pt15_pat2"); -h15 = (TH1D*)result_gem->Clone("gem15"); -for (int b = h15->FindBin(15.01); b < h15->FindBin(20.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} -h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); -for (int b = h15_all->FindBin(15.01); b < h15_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} -h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); -for (int b = h15_no1a->FindBin(15.01); b < h15_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} -h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); -for (int b = h15_2s1b->FindBin(15.01); b < h15_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} -h15_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_15"); -for (int b = h15_2s123->FindBin(15.01); b < h15_2s123->FindBin(20.01); ++b) {hh_2s123->SetBinContent(b, h15_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h15_2s123->GetBinError(b));} -h15_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_15"); -for (int b = h15_2s13->FindBin(15.01); b < h15_2s13->FindBin(20.01); ++b) {hh_2s13->SetBinContent(b, h15_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h15_2s13->GetBinError(b));} -h15_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_15"); -for (int b = h15_sing_no1a->FindBin(15.01); b < h15_sing_no1a->FindBin(20.01); ++b) {hh_sing_no1a->SetBinContent(b, h15_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h15_sing_no1a->GetBinError(b));} - -getPTHistos("minbias_pt20_pat2"); -h20 = (TH1D*)result_gem->Clone("gem20"); -for (int b = h20->FindBin(20.01); b < h20->FindBin(30.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} -h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); -for (int b = h20_all->FindBin(20.01); b < h20_all->FindBin(30.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} -h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); -for (int b = h20_no1a->FindBin(20.01); b < h20_no1a->FindBin(30.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} -h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); -for (int b = h20_2s1b->FindBin(20.01); b < h20_2s1b->FindBin(30.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} -h20_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_20"); -for (int b = h20_2s123->FindBin(20.01); b < h20_2s123->FindBin(30.01); ++b) {hh_2s123->SetBinContent(b, h20_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h20_2s123->GetBinError(b));} -h20_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_20"); -for (int b = h20_2s13->FindBin(20.01); b < h20_2s13->FindBin(30.01); ++b) {hh_2s13->SetBinContent(b, h20_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h20_2s13->GetBinError(b));} -h20_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_20"); -for (int b = h20_sing_no1a->FindBin(20.01); b < h20_sing_no1a->FindBin(30.01); ++b) {hh_sing_no1a->SetBinContent(b, h20_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h20_sing_no1a->GetBinError(b));} - -getPTHistos("minbias_pt30_pat2"); -h30 = (TH1D*)result_gem->Clone("gem30"); -for (int b = h30->FindBin(30.01); b <= h30->FindBin(40.01); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} -h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); -for (int b = h30_all->FindBin(30.01); b < h30_all->FindBin(40.01); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} -h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); -for (int b = h30_no1a->FindBin(30.01); b < h30_no1a->FindBin(40.01); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} -h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); -for (int b = h30_2s1b->FindBin(30.01); b < h30_2s1b->FindBin(40.01); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} -h30_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_30"); -for (int b = h30_2s123->FindBin(30.01); b < h30_2s123->FindBin(40.01); ++b) {hh_2s123->SetBinContent(b, h30_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h30_2s123->GetBinError(b));} -h30_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_30"); -for (int b = h30_2s13->FindBin(30.01); b < h30_2s13->FindBin(40.01); ++b) {hh_2s13->SetBinContent(b, h30_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h30_2s13->GetBinError(b));} -h30_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_30"); -for (int b = h30_sing_no1a->FindBin(30.01); b < h30_sing_no1a->FindBin(40.01); ++b) {hh_sing_no1a->SetBinContent(b, h30_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h30_sing_no1a->GetBinError(b));} - -getPTHistos("minbias_pt40_pat2"); -h40 = (TH1D*)result_gem->Clone("gem30"); -for (int b = h40->FindBin(40.01); b <= h40->GetNbinsX(); ++b) {hh->SetBinContent(b, h40->GetBinContent(b)); hh->SetBinError(b, h40->GetBinError(b));} -h40_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_40"); -for (int b = h40_all->FindBin(40.01); b < h40_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h40_all->GetBinContent(b)); hh_all->SetBinError(b, h40_all->GetBinError(b));} -h40_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_40"); -for (int b = h40_no1a->FindBin(40.01); b < h40_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h40_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h40_no1a->GetBinError(b));} -h40_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_40"); -for (int b = h40_2s1b->FindBin(40.01); b < h40_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h40_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h40_2s1b->GetBinError(b));} -h40_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_40"); -for (int b = h40_2s123->FindBin(40.01); b < h40_2s123->GetNbinsX(); ++b) {hh_2s123->SetBinContent(b, h40_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h40_2s123->GetBinError(b));} -h40_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_40"); -for (int b = h40_2s13->FindBin(40.01); b < h40_2s13->GetNbinsX(); ++b) {hh_2s13->SetBinContent(b, h40_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h40_2s13->GetBinError(b));} -h40_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_40"); -for (int b = h40_sing_no1a->FindBin(40.01); b < h40_sing_no1a->GetNbinsX(); ++b) {hh_sing_no1a->SetBinContent(b, h40_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h40_sing_no1a->GetBinError(b));} - -for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); -for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); -for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); -for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); -for (int b = 1; b <= hh_2s123->GetNbinsX(); ++b) if (hh_2s123->GetBinContent(b)==0) hh_2s123->SetBinError(b, 0.); -for (int b = 1; b <= hh_2s13->GetNbinsX(); ++b) if (hh_2s13->GetBinContent(b)==0) hh_2s13->SetBinError(b, 0.); -for (int b = 1; b <= hh_sing_no1a->GetNbinsX(); ++b) if (hh_sing_no1a->GetBinContent(b)==0) hh_sing_no1a->SetBinError(b, 0.); - - -TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]"; -TString the_ttl_no1a = "CSC L1 trigger rates in 1.2<|#eta|<2.14;p_{T}^{cut} [GeV/c];rate [kHz]"; -TString the_ttl_all = "CSC L1 trigger rates in 1.<|#eta|<2.4;p_{T}^{cut} [GeV/c];rate [kHz]"; - -hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); -hh_all = setPTHisto(hh_all, the_ttl_all, kGreen+3, 1, 1); -hh_no1a = setPTHisto(hh_no1a, the_ttl_no1a, kGreen+3, 1, 1); -hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); -hh_2s123 = setPTHisto(hh_2s123, the_ttl, kGreen+3, 1, 1); -hh_2s13 = setPTHisto(hh_2s13, the_ttl, kGreen+3, 1, 1); -hh_sing_no1a = setPTHisto(hh_sing_no1a, the_ttl_no1a, kGreen+3, 1, 1); - -result_def_gmtsing = setPTHisto(result_def_gmtsing, the_ttl, kAzure+1, 1, 1); -result_def_gmtsing_no1a = setPTHisto(result_def_gmtsing_no1a, the_ttl_no1a, kAzure+1, 1, 1); - -result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); -result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); -result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); -result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); -result_def_2s123 = setPTHisto(result_def_2s123, the_ttl, kAzure+9, 1, 1); -result_def_2s13 = setPTHisto(result_def_2s13, the_ttl, kAzure+9, 1, 1); -result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl_all, kAzure+9, 1, 1); -result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl_all, kAzure+9, 1, 1); -result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl_no1a, kAzure+9, 1, 1); -result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl_no1a, kAzure+9, 1, 1); - - - -hh->SetFillColor(kGreen+4); -hh_all->SetFillColor(kGreen+4); -hh_no1a->SetFillColor(kGreen+4); -hh_2s1b->SetFillColor(kGreen+4); -hh_2s123->SetFillColor(kGreen+4); -hh_2s13->SetFillColor(kGreen+4); -hh_sing_no1a->SetFillColor(kGreen+4); - -result_def_2s__pat2 = (TH1D*) result_def_2s->Clone("result_def_2s__pat2"); -result_def_3s__pat2 = (TH1D*) result_def->Clone("result_def_3s__pat2"); -result_def_2s1b__pat2 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat2"); -result_def_2s123__pat2 = (TH1D*) result_def_2s123->Clone("result_def_2s123__pat2"); -result_def_2s13__pat2 = (TH1D*) result_def_2s13->Clone("result_def_2s13__pat2"); -result_def_3s1b__pat2 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat2"); -result_def_gmtsing__pat2 = (TH1D*) result_def_gmtsing->Clone("result_def_gmtsing__pat2");; -result_def_gmtsing_no1a__pat2 = (TH1D*) result_def_gmtsing_no1a->Clone("result_def_gmtsing_no1a__pat2");; - -result_gem_2s1b__pat2 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat2"); -result_gem_2s123__pat2 = (TH1D*) hh_2s123->Clone("result_gem_2s123__pat2"); -result_gem_2s13__pat2 = (TH1D*) hh_2s13->Clone("result_gem_2s13__pat2"); -result_gem_3s1b__pat2 = (TH1D*) hh->Clone("result_gem_3s1b__pat2"); -result_gem_sing_no1a__pat2 = (TH1D*)hh_sing_no1a->Clone("result_gem_sing_no1a__pat2"); - - -// --- def-3s gem-3s-3s1b - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def->Draw("e3"); -hh->Draw("same e3"); - -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def,"default emulator","f"); -leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh,"with GEM match","f"); -leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); - -drawPULabel(); - -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); - - -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); - - -// --- def-3s-3s1b gem-3s-3s1b + //gROOT->SetBatch(true); + //gStyle->SetStatW(0.13); + //gStyle->SetStatH(0.08); + gStyle->SetStatW(0.07); + gStyle->SetStatH(0.06); + gStyle->SetOptStat(0); + gStyle->SetTitleStyle(0); + gStyle->SetTitleAlign(13);// coord in top left + gStyle->SetTitleX(0.); + gStyle->SetTitleY(1.); + gStyle->SetTitleW(1); + gStyle->SetTitleH(0.058); + gStyle->SetTitleBorderSize(0); + gStyle->SetPadLeftMargin(0.126); + gStyle->SetPadRightMargin(0.04); + gStyle->SetPadTopMargin(0.06); + gStyle->SetPadBottomMargin(0.13); + gStyle->SetMarkerStyle(1); + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + + // ********** PAT2 ********** + + getPTHistos("minbias_pt06_pat2",filesDir, filesDir, gem_label); + hh = (TH1D*)result_def_3s1b->Clone("gem_new"); + for (int b = hh->FindBin(6.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); + hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); + for (int b = hh_all->FindBin(6.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); + hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); + for (int b = hh_no1a->FindBin(6.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); + hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); + for (int b = hh_2s1b->FindBin(6.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); + hh_2s123 = (TH1D*)result_def_2s123->Clone("gem_new_2s123"); + for (int b = hh_2s123->FindBin(6.01); b <= hh_2s123->GetNbinsX(); ++b) hh_2s123->SetBinContent(b, 0); + hh_2s13 = (TH1D*)result_def_2s13->Clone("gem_new_2s13"); + for (int b = hh_2s13->FindBin(6.01); b <= hh_2s13->GetNbinsX(); ++b) hh_2s13->SetBinContent(b, 0); + hh_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("hh_sing_no1a"); + for (int b = hh_sing_no1a->FindBin(6.01); b <= hh_sing_no1a->GetNbinsX(); ++b) hh_sing_no1a->SetBinContent(b, 0); + + h06 = (TH1D*)result_gem->Clone("gem_new_06"); + for (int b = h06->FindBin(6.01); b < h06->FindBin(10.01); ++b){hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} + h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); + for (int b = h06_all->FindBin(6.01); b < h06_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} + h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); + for (int b = h06_no1a->FindBin(6.01); b < h06_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} + h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); + for (int b = h06_2s1b->FindBin(6.01); b < h06_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} + h06_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_06"); + for (int b = h06_2s123->FindBin(6.01); b < h06_2s123->FindBin(10.01); ++b) {hh_2s123->SetBinContent(b, h06_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h06_2s123->GetBinError(b));} + h06_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_06"); + for (int b = h06_2s13->FindBin(6.01); b < h06_2s13->FindBin(10.01); ++b) {hh_2s13->SetBinContent(b, h06_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h06_2s13->GetBinError(b));} + h06_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_06"); + for (int b = h06_sing_no1a->FindBin(6.01); b < h06_sing_no1a->FindBin(10.01); ++b) {hh_sing_no1a->SetBinContent(b, h06_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h06_sing_no1a->GetBinError(b));} + + getPTHistos("minbias_pt10_pat2",filesDir, filesDir, gem_label); + h10 = (TH1D*)result_gem->Clone("gem10"); + for (int b = h10->FindBin(10.01); b < h10->FindBin(15.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} + h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); + for (int b = h10_all->FindBin(10.01); b < h10_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} + h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); + for (int b = h10_no1a->FindBin(10.01); b < h10_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} + h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); + for (int b = h10_2s1b->FindBin(10.01); b < h10_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} + h10_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_10"); + for (int b = h10_2s123->FindBin(10.01); b < h10_2s123->FindBin(15.01); ++b) {hh_2s123->SetBinContent(b, h10_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h10_2s123->GetBinError(b));} + h10_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_10"); + for (int b = h10_2s13->FindBin(10.01); b < h10_2s13->FindBin(15.01); ++b) {hh_2s13->SetBinContent(b, h10_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h10_2s13->GetBinError(b));} + h10_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_10"); + for (int b = h10_sing_no1a->FindBin(10.01); b < h10_sing_no1a->FindBin(15.01); ++b) {hh_sing_no1a->SetBinContent(b, h10_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h10_sing_no1a->GetBinError(b));} + + getPTHistos("minbias_pt15_pat2",filesDir, filesDir, gem_label); + h15 = (TH1D*)result_gem->Clone("gem15"); + for (int b = h15->FindBin(15.01); b < h15->FindBin(20.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} + h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); + for (int b = h15_all->FindBin(15.01); b < h15_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} + h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); + for (int b = h15_no1a->FindBin(15.01); b < h15_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} + h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); + for (int b = h15_2s1b->FindBin(15.01); b < h15_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} + h15_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_15"); + for (int b = h15_2s123->FindBin(15.01); b < h15_2s123->FindBin(20.01); ++b) {hh_2s123->SetBinContent(b, h15_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h15_2s123->GetBinError(b));} + h15_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_15"); + for (int b = h15_2s13->FindBin(15.01); b < h15_2s13->FindBin(20.01); ++b) {hh_2s13->SetBinContent(b, h15_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h15_2s13->GetBinError(b));} + h15_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_15"); + for (int b = h15_sing_no1a->FindBin(15.01); b < h15_sing_no1a->FindBin(20.01); ++b) {hh_sing_no1a->SetBinContent(b, h15_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h15_sing_no1a->GetBinError(b));} + + getPTHistos("minbias_pt20_pat2",filesDir, filesDir, gem_label); + h20 = (TH1D*)result_gem->Clone("gem20"); + for (int b = h20->FindBin(20.01); b < h20->FindBin(30.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} + h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); + for (int b = h20_all->FindBin(20.01); b < h20_all->FindBin(30.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} + h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); + for (int b = h20_no1a->FindBin(20.01); b < h20_no1a->FindBin(30.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} + h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); + for (int b = h20_2s1b->FindBin(20.01); b < h20_2s1b->FindBin(30.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} + h20_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_20"); + for (int b = h20_2s123->FindBin(20.01); b < h20_2s123->FindBin(30.01); ++b) {hh_2s123->SetBinContent(b, h20_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h20_2s123->GetBinError(b));} + h20_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_20"); + for (int b = h20_2s13->FindBin(20.01); b < h20_2s13->FindBin(30.01); ++b) {hh_2s13->SetBinContent(b, h20_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h20_2s13->GetBinError(b));} + h20_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_20"); + for (int b = h20_sing_no1a->FindBin(20.01); b < h20_sing_no1a->FindBin(30.01); ++b) {hh_sing_no1a->SetBinContent(b, h20_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h20_sing_no1a->GetBinError(b));} + + getPTHistos("minbias_pt30_pat2",filesDir, filesDir, gem_label); + h30 = (TH1D*)result_gem->Clone("gem30"); + for (int b = h30->FindBin(30.01); b <= h30->FindBin(40.01); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} + h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); + for (int b = h30_all->FindBin(30.01); b < h30_all->FindBin(40.01); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} + h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); + for (int b = h30_no1a->FindBin(30.01); b < h30_no1a->FindBin(40.01); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} + h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); + for (int b = h30_2s1b->FindBin(30.01); b < h30_2s1b->FindBin(40.01); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} + h30_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_30"); + for (int b = h30_2s123->FindBin(30.01); b < h30_2s123->FindBin(40.01); ++b) {hh_2s123->SetBinContent(b, h30_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h30_2s123->GetBinError(b));} + h30_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_30"); + for (int b = h30_2s13->FindBin(30.01); b < h30_2s13->FindBin(40.01); ++b) {hh_2s13->SetBinContent(b, h30_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h30_2s13->GetBinError(b));} + h30_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_30"); + for (int b = h30_sing_no1a->FindBin(30.01); b < h30_sing_no1a->FindBin(40.01); ++b) {hh_sing_no1a->SetBinContent(b, h30_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h30_sing_no1a->GetBinError(b));} + + getPTHistos("minbias_pt40_pat2",filesDir, filesDir, gem_label); + h40 = (TH1D*)result_gem->Clone("gem30"); + for (int b = h40->FindBin(40.01); b <= h40->GetNbinsX(); ++b) {hh->SetBinContent(b, h40->GetBinContent(b)); hh->SetBinError(b, h40->GetBinError(b));} + h40_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_40"); + for (int b = h40_all->FindBin(40.01); b < h40_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h40_all->GetBinContent(b)); hh_all->SetBinError(b, h40_all->GetBinError(b));} + h40_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_40"); + for (int b = h40_no1a->FindBin(40.01); b < h40_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h40_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h40_no1a->GetBinError(b));} + h40_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_40"); + for (int b = h40_2s1b->FindBin(40.01); b < h40_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h40_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h40_2s1b->GetBinError(b));} + h40_2s123 = (TH1D*)result_gem_2s123->Clone("gem_new_2s123_40"); + for (int b = h40_2s123->FindBin(40.01); b < h40_2s123->GetNbinsX(); ++b) {hh_2s123->SetBinContent(b, h40_2s123->GetBinContent(b)); hh_2s123->SetBinError(b, h40_2s123->GetBinError(b));} + h40_2s13 = (TH1D*)result_gem_2s13->Clone("gem_new_2s13_40"); + for (int b = h40_2s13->FindBin(40.01); b < h40_2s13->GetNbinsX(); ++b) {hh_2s13->SetBinContent(b, h40_2s13->GetBinContent(b)); hh_2s13->SetBinError(b, h40_2s13->GetBinError(b));} + h40_sing_no1a = (TH1D*)result_gem_gmtsing_no1a->Clone("gem_new_sing_40"); + for (int b = h40_sing_no1a->FindBin(40.01); b < h40_sing_no1a->GetNbinsX(); ++b) {hh_sing_no1a->SetBinContent(b, h40_sing_no1a->GetBinContent(b)); hh_sing_no1a->SetBinError(b, h40_sing_no1a->GetBinError(b));} + + for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); + for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); + for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); + for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); + for (int b = 1; b <= hh_2s123->GetNbinsX(); ++b) if (hh_2s123->GetBinContent(b)==0) hh_2s123->SetBinError(b, 0.); + for (int b = 1; b <= hh_2s13->GetNbinsX(); ++b) if (hh_2s13->GetBinContent(b)==0) hh_2s13->SetBinError(b, 0.); + for (int b = 1; b <= hh_sing_no1a->GetNbinsX(); ++b) if (hh_sing_no1a->GetBinContent(b)==0) hh_sing_no1a->SetBinError(b, 0.); + + + TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]"; + TString the_ttl_no1a = "CSC L1 trigger rates in 1.2<|#eta|<2.14;p_{T}^{cut} [GeV/c];rate [kHz]"; + TString the_ttl_all = "CSC L1 trigger rates in 1.<|#eta|<2.4;p_{T}^{cut} [GeV/c];rate [kHz]"; + + hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); + hh_all = setPTHisto(hh_all, the_ttl_all, kGreen+3, 1, 1); + hh_no1a = setPTHisto(hh_no1a, the_ttl_no1a, kGreen+3, 1, 1); + hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); + hh_2s123 = setPTHisto(hh_2s123, the_ttl, kGreen+3, 1, 1); + hh_2s13 = setPTHisto(hh_2s13, the_ttl, kGreen+3, 1, 1); + hh_sing_no1a = setPTHisto(hh_sing_no1a, the_ttl_no1a, kGreen+3, 1, 1); + + result_def_gmtsing = setPTHisto(result_def_gmtsing, the_ttl, kAzure+1, 1, 1); + result_def_gmtsing_no1a = setPTHisto(result_def_gmtsing_no1a, the_ttl_no1a, kAzure+1, 1, 1); + + result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); + result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); + result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); + result_def_2s123 = setPTHisto(result_def_2s123, the_ttl, kAzure+9, 1, 1); + result_def_2s13 = setPTHisto(result_def_2s13, the_ttl, kAzure+9, 1, 1); + result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl_all, kAzure+9, 1, 1); + result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl_all, kAzure+9, 1, 1); + result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl_no1a, kAzure+9, 1, 1); + result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl_no1a, kAzure+9, 1, 1); + + + + hh->SetFillColor(kGreen+4); + hh_all->SetFillColor(kGreen+4); + hh_no1a->SetFillColor(kGreen+4); + hh_2s1b->SetFillColor(kGreen+4); + hh_2s123->SetFillColor(kGreen+4); + hh_2s13->SetFillColor(kGreen+4); + hh_sing_no1a->SetFillColor(kGreen+4); + + result_def_2s__pat2 = (TH1D*) result_def_2s->Clone("result_def_2s__pat2"); + result_def_3s__pat2 = (TH1D*) result_def->Clone("result_def_3s__pat2"); + result_def_2s1b__pat2 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat2"); + result_def_2s123__pat2 = (TH1D*) result_def_2s123->Clone("result_def_2s123__pat2"); + result_def_2s13__pat2 = (TH1D*) result_def_2s13->Clone("result_def_2s13__pat2"); + result_def_3s1b__pat2 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat2"); + result_def_gmtsing__pat2 = (TH1D*) result_def_gmtsing->Clone("result_def_gmtsing__pat2");; + result_def_gmtsing_no1a__pat2 = (TH1D*) result_def_gmtsing_no1a->Clone("result_def_gmtsing_no1a__pat2");; + + result_gem_2s1b__pat2 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat2"); + result_gem_2s123__pat2 = (TH1D*) hh_2s123->Clone("result_gem_2s123__pat2"); + result_gem_2s13__pat2 = (TH1D*) hh_2s13->Clone("result_gem_2s13__pat2"); + result_gem_3s1b__pat2 = (TH1D*) hh->Clone("result_gem_3s1b__pat2"); + result_gem_sing_no1a__pat2 = (TH1D*)hh_sing_no1a->Clone("result_gem_sing_no1a__pat2"); + + + // --- def-3s gem-3s-3s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def,"default emulator","f"); + leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh,"with GEM match","f"); + leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + + + // --- def-3s-3s1b gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s1b->Draw("e3"); -hh->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3"); + hh->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s1b,"default emulator","f"); -leg->AddEntry(hh,"with GEM match","f"); -leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s1b,"default emulator","f"); + leg->AddEntry(hh,"with GEM match","f"); + leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); -// --- def-3s-2s1b gem-3s-2s1b + // --- def-3s-2s1b gem-3s-2s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s1b->Draw("e3"); -hh_2s1b->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s1b->Draw("e3"); + hh_2s1b->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_2s1b,"default emulator","f"); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s1b,"default emulator","f"); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); -// --- def-3s gem-3s-2s1b + // --- def-3s gem-3s-2s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def->Draw("e3"); -hh_2s1b->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh_2s1b->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def,"default emulator","f"); -leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def,"default emulator","f"); + leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); -// --- def-3s-3s1b gem-3s-2s1b + // --- def-3s-3s1b gem-3s-2s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s1b->Draw("e3"); -hh_2s1b->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3"); + hh_2s1b->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s1b,"default emulator","f"); -leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s1b,"default emulator","f"); + leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); -// --- eta 1-2.4 def-3s gem-3s-3s1b + // --- eta 1-2.4 def-3s gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_all->Draw("e3"); -hh_all->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_all->Draw("e3"); + hh_all->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_all,"default emulator","f"); -leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); -leg->AddEntry(hh_all,"with GEM match","f"); -leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_all,"default emulator","f"); + leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); + leg->AddEntry(hh_all,"with GEM match","f"); + leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); -// --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b + // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_all_3s1b->Draw("e3"); -hh_all->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_all_3s1b->Draw("e3"); + hh_all->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); -leg->AddEntry(hh_all,"with GEM match","f"); -leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); + leg->AddEntry(hh_all,"with GEM match","f"); + leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); -// --- eta 1.2-2.1 def-3s gem-3s-3s1b + // --- eta 1.2-2.1 def-3s gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_no1a->Draw("e3"); -hh_no1a->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_no1a->Draw("e3"); + hh_no1a->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_no1a,"default emulator","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.2<|#eta|<2.14",""); -leg->AddEntry(hh_no1a,"with GEM match","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_no1a,"default emulator","f"); + leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.2<|#eta|<2.14",""); + leg->AddEntry(hh_no1a,"with GEM match","f"); + leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__120-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__120-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__120-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__120-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); -// --- eta 1.2-2.1 def-3s-3s1b gem-3s-3s1b + // --- eta 1.2-2.1 def-3s-3s1b gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_no1a_3s1b->Draw("e3"); -hh_no1a->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_no1a_3s1b->Draw("e3"); + hh_no1a->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); -leg->AddEntry(hh_no1a,"with GEM match","f"); -leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.2<|#eta|<2.14",""); -leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); + leg->AddEntry(hh_no1a,"with GEM match","f"); + leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.2<|#eta|<2.14",""); + leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__120-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__120-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__120-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__120-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); @@ -522,854 +457,854 @@ gPad->Print(gem_dir + "rates__120-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenst -// ********** PAT8 ********** + // ********** PAT8 ********** -getPTHistos("minbias_pt06_pat8"); -hh = (TH1D*)result_def_3s1b->Clone("gem_new"); -for (int b = hh->FindBin(6.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); -hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); -for (int b = hh_all->FindBin(6.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); -hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); -for (int b = hh_no1a->FindBin(6.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); -hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); -for (int b = hh_2s1b->FindBin(6.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); + getPTHistos("minbias_pt06_pat8",filesDir, filesDir, gem_label); + hh = (TH1D*)result_def_3s1b->Clone("gem_new"); + for (int b = hh->FindBin(6.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); + hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); + for (int b = hh_all->FindBin(6.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); + hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); + for (int b = hh_no1a->FindBin(6.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); + hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); + for (int b = hh_2s1b->FindBin(6.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); -h06 = (TH1D*)result_gem->Clone("gem_new_06"); -for (int b = h06->FindBin(6.01); b < h06->FindBin(10.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} -h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); -for (int b = h06_all->FindBin(6.01); b < h06_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} -h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); -for (int b = h06_no1a->FindBin(6.01); b < h06_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} -h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); -for (int b = h06_2s1b->FindBin(6.01); b < h06_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} - -getPTHistos("minbias_pt10_pat8"); -h10 = (TH1D*)result_gem->Clone("gem10"); -for (int b = h10->FindBin(10.01); b < h10->FindBin(15.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} -h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); -for (int b = h10_all->FindBin(10.01); b < h10_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} -h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); -for (int b = h10_no1a->FindBin(10.01); b < h10_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} -h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); -for (int b = h10_2s1b->FindBin(10.01); b < h10_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} + h06 = (TH1D*)result_gem->Clone("gem_new_06"); + for (int b = h06->FindBin(6.01); b < h06->FindBin(10.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} + h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); + for (int b = h06_all->FindBin(6.01); b < h06_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} + h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); + for (int b = h06_no1a->FindBin(6.01); b < h06_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} + h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); + for (int b = h06_2s1b->FindBin(6.01); b < h06_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt10_pat8",filesDir, filesDir, gem_label); + h10 = (TH1D*)result_gem->Clone("gem10"); + for (int b = h10->FindBin(10.01); b < h10->FindBin(15.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} + h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); + for (int b = h10_all->FindBin(10.01); b < h10_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} + h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); + for (int b = h10_no1a->FindBin(10.01); b < h10_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} + h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); + for (int b = h10_2s1b->FindBin(10.01); b < h10_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} -getPTHistos("minbias_pt15_pat8"); -h15 = (TH1D*)result_gem->Clone("gem15"); -for (int b = h15->FindBin(15.01); b < h15->FindBin(20.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} -h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); -for (int b = h15_all->FindBin(15.01); b < h15_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} -h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); -for (int b = h15_no1a->FindBin(15.01); b < h15_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} -h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); -for (int b = h15_2s1b->FindBin(15.01); b < h15_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} + getPTHistos("minbias_pt15_pat8",filesDir, filesDir, gem_label); + h15 = (TH1D*)result_gem->Clone("gem15"); + for (int b = h15->FindBin(15.01); b < h15->FindBin(20.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} + h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); + for (int b = h15_all->FindBin(15.01); b < h15_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} + h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); + for (int b = h15_no1a->FindBin(15.01); b < h15_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} + h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); + for (int b = h15_2s1b->FindBin(15.01); b < h15_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} -getPTHistos("minbias_pt20_pat8"); -h20 = (TH1D*)result_gem->Clone("gem20"); -for (int b = h20->FindBin(20.01); b < h20->FindBin(30.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} -h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); -for (int b = h20_all->FindBin(20.01); b < h20_all->FindBin(30.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} -h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); -for (int b = h20_no1a->FindBin(20.01); b < h20_no1a->FindBin(30.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} -h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); -for (int b = h20_2s1b->FindBin(20.01); b < h20_2s1b->FindBin(30.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} - -getPTHistos("minbias_pt30_pat8"); -h30 = (TH1D*)result_gem->Clone("gem30"); -for (int b = h30->FindBin(30.01); b <= h30->FindBin(40.01); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} -h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); -for (int b = h30_all->FindBin(30.01); b < h30_all->FindBin(40.01); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} -h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); -for (int b = h30_no1a->FindBin(30.01); b < h30_no1a->FindBin(40.01); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} -h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); -for (int b = h30_2s1b->FindBin(30.01); b < h30_2s1b->FindBin(40.01); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} + getPTHistos("minbias_pt20_pat8",filesDir, filesDir, gem_label); + h20 = (TH1D*)result_gem->Clone("gem20"); + for (int b = h20->FindBin(20.01); b < h20->FindBin(30.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} + h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); + for (int b = h20_all->FindBin(20.01); b < h20_all->FindBin(30.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} + h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); + for (int b = h20_no1a->FindBin(20.01); b < h20_no1a->FindBin(30.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} + h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); + for (int b = h20_2s1b->FindBin(20.01); b < h20_2s1b->FindBin(30.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt30_pat8",filesDir, filesDir, gem_label); + h30 = (TH1D*)result_gem->Clone("gem30"); + for (int b = h30->FindBin(30.01); b <= h30->FindBin(40.01); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} + h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); + for (int b = h30_all->FindBin(30.01); b < h30_all->FindBin(40.01); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} + h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); + for (int b = h30_no1a->FindBin(30.01); b < h30_no1a->FindBin(40.01); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} + h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); + for (int b = h30_2s1b->FindBin(30.01); b < h30_2s1b->FindBin(40.01); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} -getPTHistos("minbias_pt40_pat8"); -h40 = (TH1D*)result_gem->Clone("gem30"); -for (int b = h40->FindBin(40.01); b <= h40->GetNbinsX(); ++b) {hh->SetBinContent(b, h40->GetBinContent(b)); hh->SetBinError(b, h40->GetBinError(b));} -h40_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_40"); -for (int b = h40_all->FindBin(40.01); b < h40_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h40_all->GetBinContent(b)); hh_all->SetBinError(b, h40_all->GetBinError(b));} -h40_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_40"); -for (int b = h40_no1a->FindBin(40.01); b < h40_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h40_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h40_no1a->GetBinError(b));} -h40_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_40"); -for (int b = h40_2s1b->FindBin(40.01); b < h40_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h40_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h40_2s1b->GetBinError(b));} - -for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); -for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); -for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); -for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); - - -hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); -hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); -hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); -hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); + getPTHistos("minbias_pt40_pat8",filesDir, filesDir, gem_label); + h40 = (TH1D*)result_gem->Clone("gem30"); + for (int b = h40->FindBin(40.01); b <= h40->GetNbinsX(); ++b) {hh->SetBinContent(b, h40->GetBinContent(b)); hh->SetBinError(b, h40->GetBinError(b));} + h40_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_40"); + for (int b = h40_all->FindBin(40.01); b < h40_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h40_all->GetBinContent(b)); hh_all->SetBinError(b, h40_all->GetBinError(b));} + h40_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_40"); + for (int b = h40_no1a->FindBin(40.01); b < h40_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h40_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h40_no1a->GetBinError(b));} + h40_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_40"); + for (int b = h40_2s1b->FindBin(40.01); b < h40_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h40_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h40_2s1b->GetBinError(b));} + + for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); + for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); + for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); + for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); + + + hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); + hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); + hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); + hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); -result_def_gmtsing = setPTHisto(result_def_gmtsing, the_ttl, kAzure+1, 1, 1); + result_def_gmtsing = setPTHisto(result_def_gmtsing, the_ttl, kAzure+1, 1, 1); -result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); -result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); -result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); -result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); -result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); -result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); -result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); -result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); + result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); + result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); + result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); + result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); -hh->SetFillColor(kGreen+4); -hh_all->SetFillColor(kGreen+4); -hh_no1a->SetFillColor(kGreen+4); -hh_2s1b->SetFillColor(kGreen+4); - -result_def_2s__pat8 = (TH1D*) result_def_2s->Clone("result_def_2s__pat8"); -result_def_3s__pat8 = (TH1D*) result_def->Clone("result_def_3s__pat8"); -result_def_2s1b__pat8 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat8"); -result_def_3s1b__pat8 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat8"); -result_def_gmtsing__pat8 = (TH1D*) result_def_gmtsing->Clone("result_def_gmtsing__pat8");; - -result_gem_2s1b__pat8 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat8"); -result_gem_3s1b__pat8 = (TH1D*) hh->Clone("result_gem_3s1b__pat8"); - - -// --- def-3s gem-3s-3s1b - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def->Draw("e3"); -hh->Draw("same e3"); - -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def,"default emulator","f"); -leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh,"with GEM match","f"); -leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); + hh->SetFillColor(kGreen+4); + hh_all->SetFillColor(kGreen+4); + hh_no1a->SetFillColor(kGreen+4); + hh_2s1b->SetFillColor(kGreen+4); + + result_def_2s__pat8 = (TH1D*) result_def_2s->Clone("result_def_2s__pat8"); + result_def_3s__pat8 = (TH1D*) result_def->Clone("result_def_3s__pat8"); + result_def_2s1b__pat8 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat8"); + result_def_3s1b__pat8 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat8"); + result_def_gmtsing__pat8 = (TH1D*) result_def_gmtsing->Clone("result_def_gmtsing__pat8");; + + result_gem_2s1b__pat8 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat8"); + result_gem_3s1b__pat8 = (TH1D*) hh->Clone("result_gem_3s1b__pat8"); + + + // --- def-3s gem-3s-3s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def,"default emulator","f"); + leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh,"with GEM match","f"); + leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -// --- def-3s-3s1b gem-3s-3s1b + // --- def-3s-3s1b gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s1b->Draw("e3"); -hh->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3"); + hh->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s1b,"default emulator","f"); -leg->AddEntry(hh,"with GEM match","f"); -leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s1b,"default emulator","f"); + leg->AddEntry(hh,"with GEM match","f"); + leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -// --- def-3s-2s1b gem-3s-2s1b + // --- def-3s-2s1b gem-3s-2s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s1b->Draw("e3"); -hh_2s1b->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s1b->Draw("e3"); + hh_2s1b->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_2s1b,"default emulator","f"); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s1b,"default emulator","f"); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); -// --- def-3s gem-3s-2s1b + // --- def-3s gem-3s-2s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def->Draw("e3"); -hh_2s1b->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh_2s1b->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def,"default emulator","f"); -leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def,"default emulator","f"); + leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); -// --- def-3s-3s1b gem-3s-2s1b + // --- def-3s-3s1b gem-3s-2s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s1b->Draw("e3"); -hh_2s1b->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3"); + hh_2s1b->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s1b,"default emulator","f"); -leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s1b,"default emulator","f"); + leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); -// --- eta 1-2.4 def-3s gem-3s-3s1b + // --- eta 1-2.4 def-3s gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_all->Draw("e3"); -hh_all->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_all->Draw("e3"); + hh_all->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_all,"default emulator","f"); -leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); -leg->AddEntry(hh_all,"with GEM match","f"); -leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_all,"default emulator","f"); + leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); + leg->AddEntry(hh_all,"with GEM match","f"); + leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -// --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b + // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_all_3s1b->Draw("e3"); -hh_all->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_all_3s1b->Draw("e3"); + hh_all->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); -leg->AddEntry(hh_all,"with GEM match","f"); -leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); + leg->AddEntry(hh_all,"with GEM match","f"); + leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -// --- eta 1.2-2.1 def-3s gem-3s-3s1b + // --- eta 1.2-2.1 def-3s gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_no1a->Draw("e3"); -hh_no1a->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_no1a->Draw("e3"); + hh_no1a->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_no1a,"default emulator","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.2<|#eta|<2.14",""); -leg->AddEntry(hh_no1a,"with GEM match","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_no1a,"default emulator","f"); + leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.2<|#eta|<2.14",""); + leg->AddEntry(hh_no1a,"with GEM match","f"); + leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__120-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__120-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__120-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__120-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -// --- eta 1.2-2.1 def-3s-3s1b gem-3s-3s1b + // --- eta 1.2-2.1 def-3s-3s1b gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_no1a_3s1b->Draw("e3"); -hh_no1a->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_no1a_3s1b->Draw("e3"); + hh_no1a->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); -leg->AddEntry(hh_no1a,"with GEM match","f"); -leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.2<|#eta|<2.14",""); -leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); + leg->AddEntry(hh_no1a,"with GEM match","f"); + leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.2<|#eta|<2.14",""); + leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__120-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__120-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__120-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__120-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -//-------------------------- "Sequential" combinations ----------------------------- + //-------------------------- "Sequential" combinations ----------------------------- -result_def_2s__pat2->SetFillColor(kAzure+2); -result_def_2s1b__pat2->SetFillColor(kAzure+5); -result_def_2s123__pat2->SetFillColor(kViolet+3); -result_def_2s13__pat2->SetFillColor(kViolet+1); -result_def_3s__pat2->SetFillColor(kAzure+3); -result_def_3s1b__pat2->SetFillColor(kAzure+6); + result_def_2s__pat2->SetFillColor(kAzure+2); + result_def_2s1b__pat2->SetFillColor(kAzure+5); + result_def_2s123__pat2->SetFillColor(kViolet+3); + result_def_2s13__pat2->SetFillColor(kViolet+1); + result_def_3s__pat2->SetFillColor(kAzure+3); + result_def_3s1b__pat2->SetFillColor(kAzure+6); -result_def_2s__pat8->SetFillColor(kViolet); -result_def_2s1b__pat8->SetFillColor(kViolet+3); -result_def_3s__pat8->SetFillColor(kViolet+1); -result_def_3s1b__pat8->SetFillColor(kViolet+4); - -result_def_gmtsing__pat2->SetFillColor(kRed); -result_def_gmtsing__pat8->SetFillColor(kRed); - -result_def_gmtsing_no1a__pat2->SetFillColor(kRed); - -result_gem_2s1b__pat2->SetFillColor(kGreen+1); -result_gem_2s123__pat2->SetFillColor(kGreen-2); -result_gem_2s13__pat2->SetFillColor(kGreen-3); -result_gem_3s1b__pat2->SetFillColor(kGreen+3); -result_gem_2s1b__pat8->SetFillColor(kGreen-2); -result_gem_3s1b__pat8->SetFillColor(kGreen-3); + result_def_2s__pat8->SetFillColor(kViolet); + result_def_2s1b__pat8->SetFillColor(kViolet+3); + result_def_3s__pat8->SetFillColor(kViolet+1); + result_def_3s1b__pat8->SetFillColor(kViolet+4); + + result_def_gmtsing__pat2->SetFillColor(kRed); + result_def_gmtsing__pat8->SetFillColor(kRed); + + result_def_gmtsing_no1a__pat2->SetFillColor(kRed); + + result_gem_2s1b__pat2->SetFillColor(kGreen+1); + result_gem_2s123__pat2->SetFillColor(kGreen-2); + result_gem_2s13__pat2->SetFillColor(kGreen-3); + result_gem_3s1b__pat2->SetFillColor(kGreen+3); + result_gem_2s1b__pat8->SetFillColor(kGreen-2); + result_gem_3s1b__pat8->SetFillColor(kGreen-3); -result_gem_sing_no1a__pat2->SetFillColor(kGreen+1); + result_gem_sing_no1a__pat2->SetFillColor(kGreen+1); -/* -result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); -result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); -result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); -result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); -result_def_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 1000.); -result_def_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 1000.); -*/ -result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); -result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); -result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); -result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); -result_gem_2s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); -result_gem_3s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); -result_def_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 5000.); -result_def_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 5000.); + /* + result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); + result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); + result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); + result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); + result_def_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 1000.); + result_def_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 1000.); + */ + result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); + result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); + result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); + result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); + result_gem_2s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); + result_gem_3s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); + result_def_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 5000.); + result_def_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 5000.); -result_def_gmtsing_no1a__pat2->GetYaxis()->SetRangeUser(1., 8000.); + result_def_gmtsing_no1a__pat2->GetYaxis()->SetRangeUser(1., 8000.); -bool get_ptshift = true; -TH1D* result_gem_3s1b__pat2_ptshift, *result_gem_2s1b__pat2_ptshift; -TH1D* result_gem_3s1b__pat2_ptshiftX, *result_gem_2s1b__pat2_ptshiftX; -TFile *fsave; -TFile *fsaveX; -if (get_ptshift) { -fsave = new TFile(filesDir + "gem_3plus_ptshift.root"); -result_gem_3s1b__pat2__ptshift = (TH1D*) fsave->Get("result_gem_3s1b__pat2")->Clone("result_gem_3s1b__pat2__ptshift"); -result_gem_3s1b__pat2__ptshift->SetFillColor(kGreen-5); -result_gem_3s1b__pat2__ptshift->SetLineColor(kGreen-5); -result_gem_2s1b__pat2__ptshift = (TH1D*) fsave->Get("result_gem_2s1b__pat2")->Clone("result_gem_2s1b__pat2__ptshift"); -result_gem_2s1b__pat2__ptshift->SetFillColor(kGreen-5); -result_gem_2s1b__pat2__ptshift->SetLineColor(kGreen-5); + bool get_ptshift = true; + TH1D* result_gem_3s1b__pat2_ptshift, *result_gem_2s1b__pat2_ptshift; + TH1D* result_gem_3s1b__pat2_ptshiftX, *result_gem_2s1b__pat2_ptshiftX; + TFile *fsave; + TFile *fsaveX; + if (get_ptshift) { + fsave = new TFile(filesDir + "gem_3plus_ptshift.root"); + result_gem_3s1b__pat2__ptshift = (TH1D*) fsave->Get("result_gem_3s1b__pat2")->Clone("result_gem_3s1b__pat2__ptshift"); + result_gem_3s1b__pat2__ptshift->SetFillColor(kGreen-5); + result_gem_3s1b__pat2__ptshift->SetLineColor(kGreen-5); + result_gem_2s1b__pat2__ptshift = (TH1D*) fsave->Get("result_gem_2s1b__pat2")->Clone("result_gem_2s1b__pat2__ptshift"); + result_gem_2s1b__pat2__ptshift->SetFillColor(kGreen-5); + result_gem_2s1b__pat2__ptshift->SetLineColor(kGreen-5); -fsaveX = new TFile(filesDir + "gem_3plus_ptshiftX.root"); -result_gem_3s1b__pat2__ptshiftX = (TH1D*) fsaveX->Get("result_gem_3s1b__pat2")->Clone("result_gem_3s1b__pat2__ptshiftX"); -result_gem_3s1b__pat2__ptshiftX->SetFillColor(kGreen-5); -result_gem_3s1b__pat2__ptshiftX->SetLineColor(kGreen-5); -result_gem_2s1b__pat2__ptshiftX = (TH1D*) fsaveX->Get("result_gem_2s1b__pat2")->Clone("result_gem_2s1b__pat2__ptshiftX"); -result_gem_2s1b__pat2__ptshiftX->SetFillColor(kGreen-5); -result_gem_2s1b__pat2__ptshiftX->SetLineColor(kGreen-5); - } + fsaveX = new TFile(filesDir + "gem_3plus_ptshiftX.root"); + result_gem_3s1b__pat2__ptshiftX = (TH1D*) fsaveX->Get("result_gem_3s1b__pat2")->Clone("result_gem_3s1b__pat2__ptshiftX"); + result_gem_3s1b__pat2__ptshiftX->SetFillColor(kGreen-5); + result_gem_3s1b__pat2__ptshiftX->SetLineColor(kGreen-5); + result_gem_2s1b__pat2__ptshiftX = (TH1D*) fsaveX->Get("result_gem_2s1b__pat2")->Clone("result_gem_2s1b__pat2__ptshiftX"); + result_gem_2s1b__pat2__ptshiftX->SetFillColor(kGreen-5); + result_gem_2s1b__pat2__ptshiftX->SetLineColor(kGreen-5); + } -///----- 3 stubs - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s__pat2->Draw("e3"); -result_def_3s1b__pat2->Draw("same e3"); -result_gem_3s1b__pat2->Draw("same e3"); - -TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); -leg->AddEntry(result_def_3s__pat2,"any stubs","f"); -leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); -leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); -leg->Draw(); + ///----- 3 stubs + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat2->Draw("e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_gem_3s1b__pat2->Draw("same e3"); + + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_def_3s__pat2,"any stubs","f"); + leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); + leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); -hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); + hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s__pat2->Draw("e3"); -result_def_3s1b__pat2->Draw("same e3"); -result_def_gmtsing__pat2->Draw("same e3"); -result_gem_3s1b__pat2->Draw("same e3"); - -TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_gmtsing__pat2,"GMT single Mu selection","f"); -leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); -leg->AddEntry(result_def_3s__pat2,"any stubs","f"); -leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); -leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); -leg->Draw(); - -drawPULabel(); - -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); - -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_gmtsing__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); - + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat2->Draw("e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_def_gmtsing__pat2->Draw("same e3"); + result_gem_3s1b__pat2->Draw("same e3"); + + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_gmtsing__pat2,"GMT single Mu selection","f"); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_def_3s__pat2,"any stubs","f"); + leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); + leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_gmtsing__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); + -if (get_ptshift) { //----- - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_gem_3s1b__pat2->Draw("e3"); -result_gem_3s1b__pat2__ptshift->Draw("same e3"); - -TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); -leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub",""); -leg->AddEntry(result_gem_3s1b__pat2,"#Delta#phi(GEM.LCT) as for PT threshold","f"); -leg->AddEntry(result_gem_3s1b__pat2__ptshift,"tighter #Delta#phi(GEM.LCT)","f"); -leg->Draw(); + if (get_ptshift) { //----- + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_gem_3s1b__pat2->Draw("e3"); + result_gem_3s1b__pat2__ptshift->Draw("same e3"); + + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub",""); + leg->AddEntry(result_gem_3s1b__pat2,"#Delta#phi(GEM.LCT) as for PT threshold","f"); + leg->AddEntry(result_gem_3s1b__pat2__ptshift,"tighter #Delta#phi(GEM.LCT)","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_tightGEM__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s_tightGEM__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_3s1b__pat2__ptshift, result_gem_3s1b__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_tightGEM__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_3s1b__pat2__ptshift, result_gem_3s1b__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s_tightGEM__Frankenstein_pat2__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_gem_3s1b__pat2->Draw("e3"); -result_gem_3s1b__pat2__ptshiftX->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_gem_3s1b__pat2->Draw("e3"); + result_gem_3s1b__pat2__ptshiftX->Draw("same e3"); -TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); -leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub",""); -leg->AddEntry(result_gem_3s1b__pat2,"#Delta#phi(GEM.LCT) as for PT threshold","f"); -leg->AddEntry(result_gem_3s1b__pat2__ptshiftX,"tighter #Delta#phi(GEM.LCT)","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub",""); + leg->AddEntry(result_gem_3s1b__pat2,"#Delta#phi(GEM.LCT) as for PT threshold","f"); + leg->AddEntry(result_gem_3s1b__pat2__ptshiftX,"tighter #Delta#phi(GEM.LCT)","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_xtightGEM__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s_xtightGEM__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_3s1b__pat2__ptshiftX, result_gem_3s1b__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_xtightGEM__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_3s1b__pat2__ptshiftX, result_gem_3s1b__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s_xtightGEM__Frankenstein_pat2__ratio" + ext); -} //----- + } //----- -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s__pat8->Draw("e3"); -result_def_3s1b__pat8->Draw("same e3"); -result_gem_3s1b__pat8->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat8->Draw("e3"); + result_def_3s1b__pat8->Draw("same e3"); + result_gem_3s1b__pat8->Draw("same e3"); -TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s__pat8,"CSCTF tracks #geq3 stubs:",""); -leg->AddEntry(result_def_3s__pat8,"any stubs","f"); -leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub","f"); -leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat8,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_def_3s__pat8,"any stubs","f"); + leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub","f"); + leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s__pat2->Draw("e3"); -result_def_3s__pat8->Draw("same e3"); -result_def_3s1b__pat8->Draw("same e3"); -result_gem_3s1b__pat8->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat2->Draw("e3"); + result_def_3s__pat8->Draw("same e3"); + result_def_3s1b__pat8->Draw("same e3"); + result_gem_3s1b__pat8->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); -leg->AddEntry(result_def_3s__pat2,"any stubs","f"); -leg->AddEntry(result_def_3s__pat8,"any stubs, tight patt.","f"); -leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub, tight patt.","f"); -leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_def_3s__pat2,"any stubs","f"); + leg->AddEntry(result_def_3s__pat8,"any stubs, tight patt.","f"); + leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub, tight patt.","f"); + leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s__Frankenstein" + ext); -/// ----- 2 stubs + /// ----- 2 stubs -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s__pat2->Draw("e3"); -result_def_2s1b__pat2->Draw("same e3"); -result_gem_2s1b__pat2->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s__pat2->Draw("e3"); + result_def_2s1b__pat2->Draw("same e3"); + result_gem_2s1b__pat2->Draw("same e3"); -TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); -leg->AddEntry(result_def_2s__pat2,"any stubs","f"); -leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); -leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_def_2s__pat2,"any stubs","f"); + leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s__pat2->Draw("e3"); -result_def_2s1b__pat2->Draw("same e3"); -result_def_gmtsing__pat2->Draw("same e3"); -result_gem_2s1b__pat2->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s__pat2->Draw("e3"); + result_def_2s1b__pat2->Draw("same e3"); + result_def_gmtsing__pat2->Draw("same e3"); + result_gem_2s1b__pat2->Draw("same e3"); -TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_gmtsing__pat2,"GMT single Mu selection","f"); -leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); -leg->AddEntry(result_def_2s__pat2,"any stubs","f"); -leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); -leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_gmtsing__pat2,"GMT single Mu selection","f"); + leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_def_2s__pat2,"any stubs","f"); + leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_gmtsing__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_gmtsing__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); -if (get_ptshift) { //----- + if (get_ptshift) { //----- -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_gem_2s1b__pat2->Draw("e3"); -result_gem_2s1b__pat2__ptshift->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_gem_2s1b__pat2->Draw("e3"); + result_gem_2s1b__pat2__ptshift->Draw("same e3"); -TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); -leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub",""); -leg->AddEntry(result_gem_2s1b__pat2,"#Delta#phi(GEM.LCT) as for PT threshold","f"); -leg->AddEntry(result_gem_2s1b__pat2__ptshift,"tighter #Delta#phi(GEM.LCT)","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub",""); + leg->AddEntry(result_gem_2s1b__pat2,"#Delta#phi(GEM.LCT) as for PT threshold","f"); + leg->AddEntry(result_gem_2s1b__pat2__ptshift,"tighter #Delta#phi(GEM.LCT)","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_tightGEM__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s_tightGEM__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_2s1b__pat2__ptshift, result_gem_2s1b__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_tightGEM__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_2s1b__pat2__ptshift, result_gem_2s1b__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s_tightGEM__Frankenstein_pat2__ratio" + ext); -fsave->Close(); + fsave->Close(); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_gem_2s1b__pat2->Draw("e3"); -result_gem_2s1b__pat2__ptshiftX->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_gem_2s1b__pat2->Draw("e3"); + result_gem_2s1b__pat2__ptshiftX->Draw("same e3"); -TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); -leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub",""); -leg->AddEntry(result_gem_2s1b__pat2,"#Delta#phi(GEM.LCT) as for PT threshold","f"); -leg->AddEntry(result_gem_2s1b__pat2__ptshiftX,"tighter #Delta#phi(GEM.LCT)","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub",""); + leg->AddEntry(result_gem_2s1b__pat2,"#Delta#phi(GEM.LCT) as for PT threshold","f"); + leg->AddEntry(result_gem_2s1b__pat2__ptshiftX,"tighter #Delta#phi(GEM.LCT)","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_xtightGEM__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s_xtightGEM__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_2s1b__pat2__ptshiftX, result_gem_2s1b__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_xtightGEM__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_2s1b__pat2__ptshiftX, result_gem_2s1b__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s_xtightGEM__Frankenstein_pat2__ratio" + ext); -fsaveX->Close(); + fsaveX->Close(); -} //----- + } //----- -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s__pat8->Draw("e3"); -result_def_2s1b__pat8->Draw("same e3"); -result_gem_2s1b__pat8->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s__pat8->Draw("e3"); + result_def_2s1b__pat8->Draw("same e3"); + result_gem_2s1b__pat8->Draw("same e3"); -TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_2s__pat8,"CSCTF tracks #geq2 stubs:",""); -leg->AddEntry(result_def_2s__pat8,"any stubs","f"); -leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub","f"); -leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s__pat8,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_def_2s__pat8,"any stubs","f"); + leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s__pat2->Draw("e3"); -result_def_2s__pat8->Draw("same e3"); -result_def_2s1b__pat8->Draw("same e3"); -result_gem_2s1b__pat8->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s__pat2->Draw("e3"); + result_def_2s__pat8->Draw("same e3"); + result_def_2s1b__pat8->Draw("same e3"); + result_gem_2s1b__pat8->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); -leg->AddEntry(result_def_2s__pat2,"any stubs","f"); -leg->AddEntry(result_def_2s__pat8,"any stubs, tight patt.","f"); -leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub, tight patt.","f"); -leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_def_2s__pat2,"any stubs","f"); + leg->AddEntry(result_def_2s__pat8,"any stubs, tight patt.","f"); + leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub, tight patt.","f"); + leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s__Frankenstein" + ext); -/// ----- GMT current "default" single trigger + /// ----- GMT current "default" single trigger -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_gmtsing__pat2->Draw("e3"); -result_def_2s__pat2->Draw("same e3"); -result_def_2s1b__pat2->Draw("same e3"); -result_def_3s__pat2->Draw("same e3"); -result_def_3s1b__pat2->Draw("same e3"); -result_def_gmtsing__pat2->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_gmtsing__pat2->Draw("e3"); + result_def_2s__pat2->Draw("same e3"); + result_def_2s1b__pat2->Draw("same e3"); + result_def_3s__pat2->Draw("same e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_def_gmtsing__pat2->Draw("same e3"); -TLegend *leg = new TLegend(0.49,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_gmtsing__pat2,"GMT single Mu selection","f"); -leg->AddEntry(result_def_2s__pat2,"Tracks: #geq2 stubs","f"); -leg->AddEntry(result_def_2s1b__pat2," #geq2 with ME1/b stubs","f"); -leg->AddEntry(result_def_3s__pat2," #geq3 stubs","f"); -leg->AddEntry(result_def_3s1b__pat2," #geq3 with ME1/b stubs","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.49,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_gmtsing__pat2,"GMT single Mu selection","f"); + leg->AddEntry(result_def_2s__pat2,"Tracks: #geq2 stubs","f"); + leg->AddEntry(result_def_2s1b__pat2," #geq2 with ME1/b stubs","f"); + leg->AddEntry(result_def_3s__pat2," #geq3 stubs","f"); + leg->AddEntry(result_def_3s1b__pat2," #geq3 with ME1/b stubs","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__GMT__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__GMT__Frankenstein_pat2" + ext); -///----- 2 & 3 stubs + ///----- 2 & 3 stubs -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s__pat2->Draw("e3"); -result_def_3s1b__pat2->Draw("same e3"); -result_gem_2s1b__pat2->Draw("same e3"); -result_gem_3s1b__pat2->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat2->Draw("e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_gem_2s1b__pat2->Draw("same e3"); + result_gem_3s1b__pat2->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s__pat2,"CSCTF tracks with:",""); -leg->AddEntry(result_def_3s__pat2,"3+ stubs","f"); -leg->AddEntry(result_def_3s1b__pat2,"3+ stubs with ME1/b stub","f"); -leg->AddEntry(result_gem_2s1b__pat2,"2+ stubs with (ME1/b + GEM) stub","f"); -leg->AddEntry(result_gem_3s1b__pat2,"3+ stubs with (ME1/b + GEM) stub","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks with:",""); + leg->AddEntry(result_def_3s__pat2,"3+ stubs","f"); + leg->AddEntry(result_def_3s1b__pat2,"3+ stubs with ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat2,"2+ stubs with (ME1/b + GEM) stub","f"); + leg->AddEntry(result_gem_3s1b__pat2,"3+ stubs with (ME1/b + GEM) stub","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2" + ext); -///----- 2 & 123 & 13 & 3 stubs + ///----- 2 & 123 & 13 & 3 stubs -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -//result_def_3s__pat2->Draw("e3"); -//result_def_2s1b__pat2->Draw("same e2"); -//result_def_2s123__pat2->Draw("same e2"); -//result_def_2s13__pat2->Draw("same e2"); -//result_def_3s1b__pat2->Draw("same e3"); -result_gem_2s1b__pat2->Draw("e3"); -result_gem_2s123__pat2->Draw("same e3"); -result_gem_2s13__pat2->Draw("same e3"); -result_gem_3s1b__pat2->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + //result_def_3s__pat2->Draw("e3"); + //result_def_2s1b__pat2->Draw("same e2"); + //result_def_2s123__pat2->Draw("same e2"); + //result_def_2s13__pat2->Draw("same e2"); + //result_def_3s1b__pat2->Draw("same e3"); + result_gem_2s1b__pat2->Draw("e3"); + result_gem_2s123__pat2->Draw("same e3"); + result_gem_2s13__pat2->Draw("same e3"); + result_gem_3s1b__pat2->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_gem_2s1b__pat2,"CSCTF tracks that have",""); -leg->AddEntry(result_gem_2s1b__pat2,"(ME1/b + GEM) stub, with total ",""); -leg->AddEntry(result_gem_2s1b__pat2,"2+ stubs","f"); -leg->AddEntry(result_gem_2s123__pat2,"2+ stubs (no ME1-4 tracks)","f"); -leg->AddEntry(result_gem_2s13__pat2,"2+ stubs (no ME1-2 and ME1-4)","f"); -leg->AddEntry(result_gem_3s1b__pat2,"3+ stubs","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_gem_2s1b__pat2,"CSCTF tracks that have",""); + leg->AddEntry(result_gem_2s1b__pat2,"(ME1/b + GEM) stub, with total ",""); + leg->AddEntry(result_gem_2s1b__pat2,"2+ stubs","f"); + leg->AddEntry(result_gem_2s123__pat2,"2+ stubs (no ME1-4 tracks)","f"); + leg->AddEntry(result_gem_2s13__pat2,"2+ stubs (no ME1-2 and ME1-4)","f"); + leg->AddEntry(result_gem_3s1b__pat2,"3+ stubs","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s123__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s3s123__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_2s123__pat2, result_gem_2s1b__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s123__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_2s123__pat2, result_gem_2s1b__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s3s123__Frankenstein_pat2__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_2s13__pat2, result_gem_3s1b__pat2, "", 0.,1.4); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s2s13__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_2s13__pat2, result_gem_3s1b__pat2, "", 0.,1.4); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s2s13__Frankenstein_pat2__ratio" + ext); -///----- GMT 1.2 eta 2.14 + ///----- GMT 1.2 eta 2.14 -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_gmtsing_no1a__pat2->Draw("e3"); -result_gem_sing_no1a__pat2->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_gmtsing_no1a__pat2->Draw("e3"); + result_gem_sing_no1a__pat2->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("GMT Single tracks 1.2<|#eta|<2.14"); -leg->AddEntry(result_def_gmtsing_no1a__pat2,"whole #eta range","f"); -leg->AddEntry(result_gem_sing_no1a__pat2,"Whole range except in ME1/b:","f"); -leg->AddEntry(result_gem_sing_no1a__pat2,"3+ stubs with (ME1/b + GEM)",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("GMT Single tracks 1.2<|#eta|<2.14"); + leg->AddEntry(result_def_gmtsing_no1a__pat2,"whole #eta range","f"); + leg->AddEntry(result_gem_sing_no1a__pat2,"Whole range except in ME1/b:","f"); + leg->AddEntry(result_gem_sing_no1a__pat2,"3+ stubs with (ME1/b + GEM)",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__120-214_PU100__sequential__GMT2s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__120-214_PU100__sequential__GMT2s1b__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_sing_no1a__pat2, result_def_gmtsing_no1a__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__120-214_PU100__sequential__GMT2s1b__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_sing_no1a__pat2, result_def_gmtsing_no1a__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__120-214_PU100__sequential__GMT2s1b__Frankenstein_pat2__ratio" + ext); -return; + return; } diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshift.C b/SimMuL1/scripts/drawplot_frankenstein_ptshift.C index ae35f0a613025..b91f32553257c 100644 --- a/SimMuL1/scripts/drawplot_frankenstein_ptshift.C +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshift.C @@ -108,1090 +108,1037 @@ void produceRatePlot(TH1D* h, TH1D* i, TH1D* j, TH1D* m, Color_t col0, Color_t c c->SaveAs(plots + "rates_vs_pt__PU100__def_" + k + "s_" + k + "s1b_" + k + "s1bgem__" + l + ext); } - - -/* -.L drawplot_gmtrt.C - -*/ - -TString ext = ".png"; -TString filesDir = "files/"; -TString plotDir = "plots/rate_vs_pt/"; - -void getPTHistos(TString dname) -{ -TString f_def = filesDir; -TString f_gem = filesDir; - -if (dname.Contains("_pat8")) f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root"; -if (dname == "minbias_pt05_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat8.root"; -if (dname == "minbias_pt06_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat8.root"; -if (dname == "minbias_pt10_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat8.root"; -if (dname == "minbias_pt15_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat8.root"; -if (dname == "minbias_pt20_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat8.root"; -if (dname == "minbias_pt30_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat8.root"; -if (dname == "minbias_pt40_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat8.root"; - -if (dname.Contains("_pat2")) f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; -if (dname == "minbias_pt05_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat2.root"; -if (dname == "minbias_pt06_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat2.root"; -if (dname == "minbias_pt10_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat2.root"; -if (dname == "minbias_pt15_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat2.root"; -if (dname == "minbias_pt20_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat2.root"; -if (dname == "minbias_pt30_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat2.root"; -if (dname == "minbias_pt40_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat2.root"; - -result_def = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_1b", "_def"); -result_def_2s = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_2s_1b", "_def"); -result_def_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_def"); -result_def_2s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_def"); -result_def_eta_all = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s", "_def"); -result_def_eta_all_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_def"); -result_def_eta_no1a = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_no1a", "_def"); -result_def_eta_no1a_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_def"); -result_gmtsing = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); - -result_gem = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_gem"); -result_gem_2s1b = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_gem"); -result_gem_eta_all = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_gem"); -result_gem_eta_no1a = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_gem"); -//result_gmtsing = getPTHisto(f_gem, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); -} - - - void drawplot_frankenstein_ptshift() { + TString ext = ".png"; + TString filesDir = "files/"; + TString plotDir = "plots/rate_vs_pt_shift/"; + gROOT->ProcessLine(".L drawplot_gmtrt.C"); + gROOT->ProcessLine(".L getPTHistos.C"); - gem_dir = "plots/rate_vs_pt_shift/"; gem_label = "gem98"; -//gem_dir = "gem95/"; gem_label = "gem95"; - -//do_not_print = true; - -gROOT->SetBatch(true); - -//gStyle->SetStatW(0.13); -//gStyle->SetStatH(0.08); -gStyle->SetStatW(0.07); -gStyle->SetStatH(0.06); - -gStyle->SetOptStat(0); - -gStyle->SetTitleStyle(0); -gStyle->SetTitleAlign(13);// coord in top left -gStyle->SetTitleX(0.); -gStyle->SetTitleY(1.); -gStyle->SetTitleW(1); -gStyle->SetTitleH(0.058); -gStyle->SetTitleBorderSize(0); - -gStyle->SetPadLeftMargin(0.126); -gStyle->SetPadRightMargin(0.04); -gStyle->SetPadTopMargin(0.06); -gStyle->SetPadBottomMargin(0.13); - -gStyle->SetMarkerStyle(1); - -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); - -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); - - -// ********** PAT2 ********** - -getPTHistos("minbias_pt10_pat2"); -hh = (TH1D*)result_def_3s1b->Clone("gem_new"); -for (int b = hh->FindBin(7.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); -hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); -for (int b = hh_all->FindBin(7.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); -hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); -for (int b = hh_no1a->FindBin(7.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); -hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); -for (int b = hh_2s1b->FindBin(7.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); - -h06 = (TH1D*)result_gem->Clone("gem_new_06"); -for (int b = h06->FindBin(7.01); b < h06->FindBin(10.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} -h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); -for (int b = h06_all->FindBin(7.01); b < h06_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} -h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); -for (int b = h06_no1a->FindBin(7.01); b < h06_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} -h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); -for (int b = h06_2s1b->FindBin(7.01); b < h06_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} - -getPTHistos("minbias_pt15_pat2"); -h10 = (TH1D*)result_gem->Clone("gem10"); -for (int b = h10->FindBin(10.01); b < h10->FindBin(15.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} -h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); -for (int b = h10_all->FindBin(10.01); b < h10_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} -h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); -for (int b = h10_no1a->FindBin(10.01); b < h10_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} -h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); -for (int b = h10_2s1b->FindBin(10.01); b < h10_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} - -getPTHistos("minbias_pt20_pat2"); -h15 = (TH1D*)result_gem->Clone("gem15"); -for (int b = h15->FindBin(15.01); b < h15->FindBin(20.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} -h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); -for (int b = h15_all->FindBin(15.01); b < h15_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} -h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); -for (int b = h15_no1a->FindBin(15.01); b < h15_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} -h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); -for (int b = h15_2s1b->FindBin(15.01); b < h15_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} - -getPTHistos("minbias_pt30_pat2"); -h20 = (TH1D*)result_gem->Clone("gem20"); -for (int b = h20->FindBin(20.01); b < h20->FindBin(30.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} -h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); -for (int b = h20_all->FindBin(20.01); b < h20_all->FindBin(30.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} -h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); -for (int b = h20_no1a->FindBin(20.01); b < h20_no1a->FindBin(30.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} -h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); -for (int b = h20_2s1b->FindBin(20.01); b < h20_2s1b->FindBin(30.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} - -getPTHistos("minbias_pt40_pat2"); -h30 = (TH1D*)result_gem->Clone("gem30"); -for (int b = h30->FindBin(30.01); b <= h30->GetNbinsX(); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} -h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); -for (int b = h30_all->FindBin(30.01); b < h30_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} -h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); -for (int b = h30_no1a->FindBin(30.01); b < h30_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} -h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); -for (int b = h30_2s1b->FindBin(30.01); b < h30_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} - -for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); -for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); -for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); -for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); - - -//TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]"; + gROOT->SetBatch(true); + + //gStyle->SetStatW(0.13); + //gStyle->SetStatH(0.08); + gStyle->SetStatW(0.07); + gStyle->SetStatH(0.06); + + gStyle->SetOptStat(0); + + gStyle->SetTitleStyle(0); + gStyle->SetTitleAlign(13);// coord in top left + gStyle->SetTitleX(0.); + gStyle->SetTitleY(1.); + gStyle->SetTitleW(1); + gStyle->SetTitleH(0.058); + gStyle->SetTitleBorderSize(0); + + gStyle->SetPadLeftMargin(0.126); + gStyle->SetPadRightMargin(0.04); + gStyle->SetPadTopMargin(0.06); + gStyle->SetPadBottomMargin(0.13); + + gStyle->SetMarkerStyle(1); + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + + // ********** PAT2 ********** + + getPTHistos("minbias_pt10_pat2", filesDir, filesDir, gem_label); + hh = (TH1D*)result_def_3s1b->Clone("gem_new"); + for (int b = hh->FindBin(7.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); + hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); + for (int b = hh_all->FindBin(7.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); + hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); + for (int b = hh_no1a->FindBin(7.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); + hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); + for (int b = hh_2s1b->FindBin(7.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); + + h06 = (TH1D*)result_gem->Clone("gem_new_06"); + for (int b = h06->FindBin(7.01); b < h06->FindBin(10.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} + h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); + for (int b = h06_all->FindBin(7.01); b < h06_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} + h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); + for (int b = h06_no1a->FindBin(7.01); b < h06_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} + h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); + for (int b = h06_2s1b->FindBin(7.01); b < h06_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt15_pat2", filesDir, filesDir, gem_label); + h10 = (TH1D*)result_gem->Clone("gem10"); + for (int b = h10->FindBin(10.01); b < h10->FindBin(15.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} + h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); + for (int b = h10_all->FindBin(10.01); b < h10_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} + h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); + for (int b = h10_no1a->FindBin(10.01); b < h10_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} + h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); + for (int b = h10_2s1b->FindBin(10.01); b < h10_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt20_pat2", filesDir, filesDir, gem_label); + h15 = (TH1D*)result_gem->Clone("gem15"); + for (int b = h15->FindBin(15.01); b < h15->FindBin(20.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} + h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); + for (int b = h15_all->FindBin(15.01); b < h15_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} + h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); + for (int b = h15_no1a->FindBin(15.01); b < h15_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} + h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); + for (int b = h15_2s1b->FindBin(15.01); b < h15_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt30_pat2", filesDir, filesDir, gem_label); + h20 = (TH1D*)result_gem->Clone("gem20"); + for (int b = h20->FindBin(20.01); b < h20->FindBin(30.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} + h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); + for (int b = h20_all->FindBin(20.01); b < h20_all->FindBin(30.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} + h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); + for (int b = h20_no1a->FindBin(20.01); b < h20_no1a->FindBin(30.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} + h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); + for (int b = h20_2s1b->FindBin(20.01); b < h20_2s1b->FindBin(30.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt40_pat2", filesDir, filesDir, gem_label); + h30 = (TH1D*)result_gem->Clone("gem30"); + for (int b = h30->FindBin(30.01); b <= h30->GetNbinsX(); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} + h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); + for (int b = h30_all->FindBin(30.01); b < h30_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} + h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); + for (int b = h30_no1a->FindBin(30.01); b < h30_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} + h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); + for (int b = h30_2s1b->FindBin(30.01); b < h30_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} + + for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); + for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); + for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); + for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); + + + //TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]"; TString the_ttl = " L1 Single Muon Trigger CMS Simulation;L1 candidate muon p_{T}^{cut} [GeV/c];rate [kHz]"; -hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); -hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); -hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); -hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); - -result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); - -result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); -result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); -result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); -result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); -result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); -result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); -result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); -result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); - + hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); + hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); + hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); + hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); + result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); -hh->SetFillColor(kGreen+4); -hh_all->SetFillColor(kGreen+4); -hh_no1a->SetFillColor(kGreen+4); -hh_2s1b->SetFillColor(kGreen+4); + result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); + result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); + result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); + result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); -result_def_2s__pat2 = (TH1D*) result_def_2s->Clone("result_def_2s__pat2"); -result_def_3s__pat2 = (TH1D*) result_def->Clone("result_def_3s__pat2"); -result_def_2s1b__pat2 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat2"); -result_def_3s1b__pat2 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat2"); -result_gmtsing__pat2 = (TH1D*) result_gmtsing->Clone("result_gmtsing__pat2");; -result_gem_2s1b__pat2 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat2"); -result_gem_3s1b__pat2 = (TH1D*) hh->Clone("result_gem_3s1b__pat2"); + hh->SetFillColor(kGreen+4); + hh_all->SetFillColor(kGreen+4); + hh_no1a->SetFillColor(kGreen+4); + hh_2s1b->SetFillColor(kGreen+4); + result_def_2s__pat2 = (TH1D*) result_def_2s->Clone("result_def_2s__pat2"); + result_def_3s__pat2 = (TH1D*) result_def->Clone("result_def_3s__pat2"); + result_def_2s1b__pat2 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat2"); + result_def_3s1b__pat2 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat2"); + result_gmtsing__pat2 = (TH1D*) result_gmtsing->Clone("result_gmtsing__pat2");; -// --- def-3s gem-3s-3s1b + result_gem_2s1b__pat2 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat2"); + result_gem_3s1b__pat2 = (TH1D*) hh->Clone("result_gem_3s1b__pat2"); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def->Draw("e3"); -hh->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def,"default emulator","f"); -leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh,"with GEM match","f"); -leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); -drawPULabel(); + // --- def-3s gem-3s-3s1b -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh->Draw("same e3"); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def,"default emulator","f"); + leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh,"with GEM match","f"); + leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); - - -// --- def-3s-3s1b gem-3s-3s1b - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s1b->Draw("e3"); -hh->Draw("same e3"); - -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s1b,"default emulator","f"); -leg->AddEntry(hh,"with GEM match","f"); -leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); - -drawPULabel(); - -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); - + drawPULabel(); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); -// --- def-3s-2s1b gem-3s-2s1b + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s1b->Draw("e3"); -hh_2s1b->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_2s1b,"default emulator","f"); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + // --- def-3s-3s1b gem-3s-3s1b -drawPULabel(); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3"); + hh->Draw("same e3"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s1b,"default emulator","f"); + leg->AddEntry(hh,"with GEM match","f"); + leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + drawPULabel(); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); -// --- def-3s gem-3s-2s1b + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def->Draw("e3"); -hh_2s1b->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def,"default emulator","f"); -leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + // --- def-3s-2s1b gem-3s-2s1b -drawPULabel(); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s1b->Draw("e3"); + hh_2s1b->Draw("same e3"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s1b,"default emulator","f"); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + drawPULabel(); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); -// --- def-3s-3s1b gem-3s-2s1b + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s1b->Draw("e3"); -hh_2s1b->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s1b,"default emulator","f"); -leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + // --- def-3s gem-3s-2s1b -drawPULabel(); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh_2s1b->Draw("same e3"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def,"default emulator","f"); + leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + drawPULabel(); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); -// --- eta 1-2.4 def-3s gem-3s-3s1b + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_all->Draw("e3"); -hh_all->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_all,"default emulator","f"); -leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); -leg->AddEntry(hh_all,"with GEM match","f"); -leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); + // --- def-3s-3s1b gem-3s-2s1b -drawPULabel(); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3"); + hh_2s1b->Draw("same e3"); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s1b,"default emulator","f"); + leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + drawPULabel(); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); -// --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_all_3s1b->Draw("e3"); -hh_all->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); -leg->AddEntry(hh_all,"with GEM match","f"); -leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + // --- eta 1-2.4 def-3s gem-3s-3s1b -drawPULabel(); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_all->Draw("e3"); + hh_all->Draw("same e3"); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_all,"default emulator","f"); + leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); + leg->AddEntry(hh_all,"with GEM match","f"); + leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); + drawPULabel(); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); -// --- eta 1-2.1 def-3s gem-3s-3s1b + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_no1a->Draw("e3"); -hh_no1a->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_no1a,"default emulator","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.14",""); -leg->AddEntry(hh_no1a,"with GEM match","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); + // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b -drawPULabel(); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_all_3s1b->Draw("e3"); + hh_all->Draw("same e3"); -gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); + leg->AddEntry(hh_all,"with GEM match","f"); + leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + drawPULabel(); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); -// --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_no1a_3s1b->Draw("e3"); -hh_no1a->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); -leg->AddEntry(hh_no1a,"with GEM match","f"); -leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + // --- eta 1-2.1 def-3s gem-3s-3s1b -drawPULabel(); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_no1a->Draw("e3"); + hh_no1a->Draw("same e3"); -gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_no1a,"default emulator","f"); + leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.14",""); + leg->AddEntry(hh_no1a,"with GEM match","f"); + leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); + drawPULabel(); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + + + // --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_no1a_3s1b->Draw("e3"); + hh_no1a->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); + leg->AddEntry(hh_no1a,"with GEM match","f"); + leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); -// ********** PAT8 ********** -getPTHistos("minbias_pt10_pat8"); -hh = (TH1D*)result_def_3s1b->Clone("gem_new"); -for (int b = hh->FindBin(7.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); -hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); -for (int b = hh_all->FindBin(7.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); -hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); -for (int b = hh_no1a->FindBin(7.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); -hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); -for (int b = hh_2s1b->FindBin(7.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); -h06 = (TH1D*)result_gem->Clone("gem_new_06"); -for (int b = h06->FindBin(7.01); b < h06->FindBin(10.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} -h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); -for (int b = h06_all->FindBin(7.01); b < h06_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} -h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); -for (int b = h06_no1a->FindBin(7.01); b < h06_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} -h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); -for (int b = h06_2s1b->FindBin(7.01); b < h06_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} + // ********** PAT8 ********** -getPTHistos("minbias_pt15_pat8"); -h10 = (TH1D*)result_gem->Clone("gem10"); -for (int b = h10->FindBin(10.01); b < h10->FindBin(15.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} -h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); -for (int b = h10_all->FindBin(10.01); b < h10_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} -h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); -for (int b = h10_no1a->FindBin(10.01); b < h10_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} -h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); -for (int b = h10_2s1b->FindBin(10.01); b < h10_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} + getPTHistos("minbias_pt10_pat8", filesDir, filesDir, gem_label); + hh = (TH1D*)result_def_3s1b->Clone("gem_new"); + for (int b = hh->FindBin(7.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); + hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); + for (int b = hh_all->FindBin(7.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); + hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); + for (int b = hh_no1a->FindBin(7.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); + hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); + for (int b = hh_2s1b->FindBin(7.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); -getPTHistos("minbias_pt20_pat8"); -h15 = (TH1D*)result_gem->Clone("gem15"); -for (int b = h15->FindBin(15.01); b < h15->FindBin(20.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} -h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); -for (int b = h15_all->FindBin(15.01); b < h15_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} -h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); -for (int b = h15_no1a->FindBin(15.01); b < h15_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} -h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); -for (int b = h15_2s1b->FindBin(15.01); b < h15_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} + h06 = (TH1D*)result_gem->Clone("gem_new_06"); + for (int b = h06->FindBin(7.01); b < h06->FindBin(10.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} + h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); + for (int b = h06_all->FindBin(7.01); b < h06_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} + h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); + for (int b = h06_no1a->FindBin(7.01); b < h06_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} + h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); + for (int b = h06_2s1b->FindBin(7.01); b < h06_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} -getPTHistos("minbias_pt30_pat8"); -h20 = (TH1D*)result_gem->Clone("gem20"); -for (int b = h20->FindBin(20.01); b < h20->FindBin(30.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} -h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); -for (int b = h20_all->FindBin(20.01); b < h20_all->FindBin(30.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} -h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); -for (int b = h20_no1a->FindBin(20.01); b < h20_no1a->FindBin(30.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} -h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); -for (int b = h20_2s1b->FindBin(20.01); b < h20_2s1b->FindBin(30.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} + getPTHistos("minbias_pt15_pat8", filesDir, filesDir, gem_label); + h10 = (TH1D*)result_gem->Clone("gem10"); + for (int b = h10->FindBin(10.01); b < h10->FindBin(15.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} + h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); + for (int b = h10_all->FindBin(10.01); b < h10_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} + h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); + for (int b = h10_no1a->FindBin(10.01); b < h10_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} + h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); + for (int b = h10_2s1b->FindBin(10.01); b < h10_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} -getPTHistos("minbias_pt40_pat8"); -h30 = (TH1D*)result_gem->Clone("gem30"); -for (int b = h30->FindBin(30.01); b <= h30->GetNbinsX(); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} -h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); -for (int b = h30_all->FindBin(30.01); b < h30_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} -h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); -for (int b = h30_no1a->FindBin(30.01); b < h30_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} -h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); -for (int b = h30_2s1b->FindBin(30.01); b < h30_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} + getPTHistos("minbias_pt20_pat8", filesDir, filesDir, gem_label); + h15 = (TH1D*)result_gem->Clone("gem15"); + for (int b = h15->FindBin(15.01); b < h15->FindBin(20.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} + h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); + for (int b = h15_all->FindBin(15.01); b < h15_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} + h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); + for (int b = h15_no1a->FindBin(15.01); b < h15_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} + h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); + for (int b = h15_2s1b->FindBin(15.01); b < h15_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} -for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); -for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); -for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); -for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); + getPTHistos("minbias_pt30_pat8", filesDir, filesDir, gem_label); + h20 = (TH1D*)result_gem->Clone("gem20"); + for (int b = h20->FindBin(20.01); b < h20->FindBin(30.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} + h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); + for (int b = h20_all->FindBin(20.01); b < h20_all->FindBin(30.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} + h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); + for (int b = h20_no1a->FindBin(20.01); b < h20_no1a->FindBin(30.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} + h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); + for (int b = h20_2s1b->FindBin(20.01); b < h20_2s1b->FindBin(30.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} + getPTHistos("minbias_pt40_pat8", filesDir, filesDir, gem_label); + h30 = (TH1D*)result_gem->Clone("gem30"); + for (int b = h30->FindBin(30.01); b <= h30->GetNbinsX(); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} + h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); + for (int b = h30_all->FindBin(30.01); b < h30_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} + h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); + for (int b = h30_no1a->FindBin(30.01); b < h30_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} + h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); + for (int b = h30_2s1b->FindBin(30.01); b < h30_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} -hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); -hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); -hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); -hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); + for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); + for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); + for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); + for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); -result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); -result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); -result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); -result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); -result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); -result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); -result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); -result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); -result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); + hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); + hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); + hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); + hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); + result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); + result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); + result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); + result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); + result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); -hh->SetFillColor(kGreen+4); -hh_all->SetFillColor(kGreen+4); -hh_no1a->SetFillColor(kGreen+4); -hh_2s1b->SetFillColor(kGreen+4); -result_def_2s__pat8 = (TH1D*) result_def_2s->Clone("result_def_2s__pat8"); -result_def_3s__pat8 = (TH1D*) result_def->Clone("result_def_3s__pat8"); -result_def_2s1b__pat8 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat8"); -result_def_3s1b__pat8 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat8"); -result_gmtsing__pat8 = (TH1D*) result_gmtsing->Clone("result_gmtsing__pat8");; -result_gem_2s1b__pat8 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat8"); -result_gem_3s1b__pat8 = (TH1D*) hh->Clone("result_gem_3s1b__pat8"); - - -// --- def-3s gem-3s-3s1b - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def->Draw("e3"); -hh->Draw("same e3"); - -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def,"default emulator","f"); -leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh,"with GEM match","f"); -leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); + hh->SetFillColor(kGreen+4); + hh_all->SetFillColor(kGreen+4); + hh_no1a->SetFillColor(kGreen+4); + hh_2s1b->SetFillColor(kGreen+4); + + result_def_2s__pat8 = (TH1D*) result_def_2s->Clone("result_def_2s__pat8"); + result_def_3s__pat8 = (TH1D*) result_def->Clone("result_def_3s__pat8"); + result_def_2s1b__pat8 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat8"); + result_def_3s1b__pat8 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat8"); + result_gmtsing__pat8 = (TH1D*) result_gmtsing->Clone("result_gmtsing__pat8");; + + result_gem_2s1b__pat8 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat8"); + result_gem_3s1b__pat8 = (TH1D*) hh->Clone("result_gem_3s1b__pat8"); + + + // --- def-3s gem-3s-3s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def,"default emulator","f"); + leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh,"with GEM match","f"); + leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -// --- def-3s-3s1b gem-3s-3s1b + // --- def-3s-3s1b gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s1b->Draw("e3"); -hh->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3"); + hh->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s1b,"default emulator","f"); -leg->AddEntry(hh,"with GEM match","f"); -leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s1b,"default emulator","f"); + leg->AddEntry(hh,"with GEM match","f"); + leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -// --- def-3s-2s1b gem-3s-2s1b + // --- def-3s-2s1b gem-3s-2s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s1b->Draw("e3"); -hh_2s1b->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s1b->Draw("e3"); + hh_2s1b->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_2s1b,"default emulator","f"); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s1b,"default emulator","f"); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); -// --- def-3s gem-3s-2s1b + // --- def-3s gem-3s-2s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def->Draw("e3"); -hh_2s1b->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh_2s1b->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def,"default emulator","f"); -leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def,"default emulator","f"); + leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); -// --- def-3s-3s1b gem-3s-2s1b + // --- def-3s-3s1b gem-3s-2s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s1b->Draw("e3"); -hh_2s1b->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3"); + hh_2s1b->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s1b,"default emulator","f"); -leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s1b,"default emulator","f"); + leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); -// --- eta 1-2.4 def-3s gem-3s-3s1b + // --- eta 1-2.4 def-3s gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_all->Draw("e3"); -hh_all->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_all->Draw("e3"); + hh_all->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_all,"default emulator","f"); -leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); -leg->AddEntry(hh_all,"with GEM match","f"); -leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_all,"default emulator","f"); + leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); + leg->AddEntry(hh_all,"with GEM match","f"); + leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -// --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b + // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_all_3s1b->Draw("e3"); -hh_all->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_all_3s1b->Draw("e3"); + hh_all->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); -leg->AddEntry(hh_all,"with GEM match","f"); -leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.4",""); -leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); + leg->AddEntry(hh_all,"with GEM match","f"); + leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.4",""); + leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -// --- eta 1-2.1 def-3s gem-3s-3s1b + // --- eta 1-2.1 def-3s gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_no1a->Draw("e3"); -hh_no1a->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_no1a->Draw("e3"); + hh_no1a->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_no1a,"default emulator","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.14",""); -leg->AddEntry(hh_no1a,"with GEM match","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_no1a,"default emulator","f"); + leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.14",""); + leg->AddEntry(hh_no1a,"with GEM match","f"); + leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -// --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b + // --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_no1a_3s1b->Draw("e3"); -hh_no1a->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_no1a_3s1b->Draw("e3"); + hh_no1a->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); -leg->AddEntry(hh_no1a,"with GEM match","f"); -leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); + leg->AddEntry(hh_no1a,"with GEM match","f"); + leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -//-------------------------- "Sequential" combinations ----------------------------- + //-------------------------- "Sequential" combinations ----------------------------- -result_def_2s__pat2->SetFillColor(kAzure+2); -result_def_2s1b__pat2->SetFillColor(kAzure+5); -result_def_3s__pat2->SetFillColor(kAzure+3); -result_def_3s1b__pat2->SetFillColor(kAzure+6); + result_def_2s__pat2->SetFillColor(kAzure+2); + result_def_2s1b__pat2->SetFillColor(kAzure+5); + result_def_3s__pat2->SetFillColor(kAzure+3); + result_def_3s1b__pat2->SetFillColor(kAzure+6); -result_def_2s__pat8->SetFillColor(kViolet); -result_def_2s1b__pat8->SetFillColor(kViolet+3); -result_def_3s__pat8->SetFillColor(kViolet+1); -result_def_3s1b__pat8->SetFillColor(kViolet+4); + result_def_2s__pat8->SetFillColor(kViolet); + result_def_2s1b__pat8->SetFillColor(kViolet+3); + result_def_3s__pat8->SetFillColor(kViolet+1); + result_def_3s1b__pat8->SetFillColor(kViolet+4); -result_gmtsing__pat2->SetFillColor(kRed); -result_gmtsing__pat8->SetFillColor(kRed); + result_gmtsing__pat2->SetFillColor(kRed); + result_gmtsing__pat8->SetFillColor(kRed); -result_gem_2s1b__pat2->SetFillColor(kGreen+1); -result_gem_3s1b__pat2->SetFillColor(kGreen+3); -result_gem_2s1b__pat8->SetFillColor(kGreen-2); -result_gem_3s1b__pat8->SetFillColor(kGreen-3); + result_gem_2s1b__pat2->SetFillColor(kGreen+1); + result_gem_3s1b__pat2->SetFillColor(kGreen+3); + result_gem_2s1b__pat8->SetFillColor(kGreen-2); + result_gem_3s1b__pat8->SetFillColor(kGreen-3); -/* -result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); -result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); -result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); -result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); -result_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 1000.); -result_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 1000.); -*/ -result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); -result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); -result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); -result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); -result_gem_2s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); -result_gem_3s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); -result_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 5000.); -result_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 5000.); + /* + result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); + result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); + result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); + result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); + result_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 1000.); + result_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 1000.); + */ + result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); + result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); + result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); + result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); + result_gem_2s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); + result_gem_3s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); + result_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 5000.); + result_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 5000.); -///----- 3 stubs + ///----- 3 stubs -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s__pat2->Draw("e3"); -result_def_3s1b__pat2->Draw("same e3"); -result_gem_3s1b__pat2->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat2->Draw("e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_gem_3s1b__pat2->Draw("same e3"); -TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); -leg->AddEntry(result_def_3s__pat2,"any stubs","f"); -leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); -leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_def_3s__pat2,"any stubs","f"); + leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); + leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); -hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); + hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s__pat2->Draw("e3"); -result_def_3s1b__pat2->Draw("same e3"); -result_gmtsing__pat2->Draw("same e3"); -result_gem_3s1b__pat2->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat2->Draw("e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_gmtsing__pat2->Draw("same e3"); + result_gem_3s1b__pat2->Draw("same e3"); -TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); -leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); -leg->AddEntry(result_def_3s__pat2,"any stubs","f"); -leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); -leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_def_3s__pat2,"any stubs","f"); + leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); + leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); -TFile fsave("gem_3plus_ptshift.root", "RECREATE"); -result_gem_2s1b__pat2->Write(); -result_gem_3s1b__pat2->Write(); -fsave.Write(); -fsave.Close(); + TFile fsave("gem_3plus_ptshift.root", "RECREATE"); + result_gem_2s1b__pat2->Write(); + result_gem_3s1b__pat2->Write(); + fsave.Write(); + fsave.Close(); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s__pat8->Draw("e3"); -result_def_3s1b__pat8->Draw("same e3"); -result_gem_3s1b__pat8->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat8->Draw("e3"); + result_def_3s1b__pat8->Draw("same e3"); + result_gem_3s1b__pat8->Draw("same e3"); -TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s__pat8,"CSCTF tracks #geq3 stubs:",""); -leg->AddEntry(result_def_3s__pat8,"any stubs","f"); -leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub","f"); -leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat8,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_def_3s__pat8,"any stubs","f"); + leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub","f"); + leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s__pat2->Draw("e3"); -result_def_3s__pat8->Draw("same e3"); -result_def_3s1b__pat8->Draw("same e3"); -result_gem_3s1b__pat8->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat2->Draw("e3"); + result_def_3s__pat8->Draw("same e3"); + result_def_3s1b__pat8->Draw("same e3"); + result_gem_3s1b__pat8->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); -leg->AddEntry(result_def_3s__pat2,"any stubs","f"); -leg->AddEntry(result_def_3s__pat8,"any stubs, tight patt.","f"); -leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub, tight patt.","f"); -leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_def_3s__pat2,"any stubs","f"); + leg->AddEntry(result_def_3s__pat8,"any stubs, tight patt.","f"); + leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub, tight patt.","f"); + leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s__Frankenstein" + ext); -/// ----- 2 stubs + /// ----- 2 stubs -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s__pat2->Draw("e3"); -result_def_2s1b__pat2->Draw("same e3"); -result_gem_2s1b__pat2->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s__pat2->Draw("e3"); + result_def_2s1b__pat2->Draw("same e3"); + result_gem_2s1b__pat2->Draw("same e3"); -TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); -leg->AddEntry(result_def_2s__pat2,"any stubs","f"); -leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); -leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_def_2s__pat2,"any stubs","f"); + leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s__pat2->Draw("e3"); -result_def_2s1b__pat2->Draw("same e3"); -result_gmtsing__pat2->Draw("same e3"); -result_gem_2s1b__pat2->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s__pat2->Draw("e3"); + result_def_2s1b__pat2->Draw("same e3"); + result_gmtsing__pat2->Draw("same e3"); + result_gem_2s1b__pat2->Draw("same e3"); -TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); -leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); -leg->AddEntry(result_def_2s__pat2,"any stubs","f"); -leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); -leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); + leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_def_2s__pat2,"any stubs","f"); + leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s__pat8->Draw("e3"); -result_def_2s1b__pat8->Draw("same e3"); -result_gem_2s1b__pat8->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s__pat8->Draw("e3"); + result_def_2s1b__pat8->Draw("same e3"); + result_gem_2s1b__pat8->Draw("same e3"); -TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_2s__pat8,"CSCTF tracks #geq2 stubs:",""); -leg->AddEntry(result_def_2s__pat8,"any stubs","f"); -leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub","f"); -leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s__pat8,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_def_2s__pat8,"any stubs","f"); + leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s__pat2->Draw("e3"); -result_def_2s__pat8->Draw("same e3"); -result_def_2s1b__pat8->Draw("same e3"); -result_gem_2s1b__pat8->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s__pat2->Draw("e3"); + result_def_2s__pat8->Draw("same e3"); + result_def_2s1b__pat8->Draw("same e3"); + result_gem_2s1b__pat8->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); -leg->AddEntry(result_def_2s__pat2,"any stubs","f"); -leg->AddEntry(result_def_2s__pat8,"any stubs, tight patt.","f"); -leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub, tight patt.","f"); -leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_def_2s__pat2,"any stubs","f"); + leg->AddEntry(result_def_2s__pat8,"any stubs, tight patt.","f"); + leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub, tight patt.","f"); + leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s__Frankenstein" + ext); -/// ----- GMT current "default" single trigger + /// ----- GMT current "default" single trigger -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_gmtsing__pat2->Draw("e3"); -result_def_2s__pat2->Draw("same e3"); -result_def_2s1b__pat2->Draw("same e3"); -result_def_3s__pat2->Draw("same e3"); -result_def_3s1b__pat2->Draw("same e3"); -result_gmtsing__pat2->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_gmtsing__pat2->Draw("e3"); + result_def_2s__pat2->Draw("same e3"); + result_def_2s1b__pat2->Draw("same e3"); + result_def_3s__pat2->Draw("same e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_gmtsing__pat2->Draw("same e3"); -TLegend *leg = new TLegend(0.49,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); -leg->AddEntry(result_def_2s__pat2,"Tracks: #geq2 stubs","f"); -leg->AddEntry(result_def_2s1b__pat2," #geq2 with ME1/b stubs","f"); -leg->AddEntry(result_def_3s__pat2," #geq3 stubs","f"); -leg->AddEntry(result_def_3s1b__pat2," #geq3 with ME1/b stubs","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.49,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); + leg->AddEntry(result_def_2s__pat2,"Tracks: #geq2 stubs","f"); + leg->AddEntry(result_def_2s1b__pat2," #geq2 with ME1/b stubs","f"); + leg->AddEntry(result_def_3s__pat2," #geq3 stubs","f"); + leg->AddEntry(result_def_3s1b__pat2," #geq3 with ME1/b stubs","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__GMT__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__GMT__Frankenstein_pat2" + ext); -///----- 2 & 3 stubs + ///----- 2 & 3 stubs -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s__pat2->Draw("e3"); -result_def_3s1b__pat2->Draw("same e3"); -result_gem_2s1b__pat2->Draw("same e3"); -result_gem_3s1b__pat2->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat2->Draw("e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_gem_2s1b__pat2->Draw("same e3"); + result_gem_3s1b__pat2->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s__pat2,"CSCTF tracks with:",""); -leg->AddEntry(result_def_3s__pat2,"3+ stubs","f"); -leg->AddEntry(result_def_3s1b__pat2,"3+ stubs with ME1/b stub","f"); -leg->AddEntry(result_gem_2s1b__pat2,"2+ stubs with (ME1/b + GEM) stub","f"); -leg->AddEntry(result_gem_2s1b__pat2,"3+ stubs with (ME1/b + GEM) stub","f"); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks with:",""); + leg->AddEntry(result_def_3s__pat2,"3+ stubs","f"); + leg->AddEntry(result_def_3s1b__pat2,"3+ stubs with ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat2,"2+ stubs with (ME1/b + GEM) stub","f"); + leg->AddEntry(result_gem_2s1b__pat2,"3+ stubs with (ME1/b + GEM) stub","f"); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2" + ext); Color_t col0 = kRed; Color_t col1 = kViolet+1; @@ -1217,7 +1164,7 @@ gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2 -return; + return; } diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C index fc2b92ced25a6..0c8cfa9edb405 100644 --- a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C @@ -59,7 +59,7 @@ void produceRatePlot(TH1D* h, TH1D* i, TH1D* j, TH1D* m, Color_t col0, Color_t c h->GetYaxis()->SetRangeUser(miny, maxy); h->GetXaxis()->SetTitle(""); - TLegend *leg = new TLegend(0.45,0.7,.93,0.93,"","brNDC"); + TLegend *leg = new TLegend(0.45,0.65,.93,0.93,"","brNDC"); leg->SetMargin(0.25); leg->SetBorderSize(0); leg->SetFillStyle(0); @@ -72,6 +72,7 @@ void produceRatePlot(TH1D* h, TH1D* i, TH1D* j, TH1D* m, Color_t col0, Color_t c leg->AddEntry(i,"CSC #geq" + k + " stubs (anywhere)","f"); leg->AddEntry(j,"CSC #geq" + k + " stubs (one in ME1/b)","f"); leg->AddEntry(m,"GEM+CSC integrated trigger","f"); + leg->AddEntry((TObject*)0,"with #geq" + k + " stubs",""); leg->Draw(); drawLumiLabel(0.17,.3); @@ -96,1111 +97,1024 @@ void produceRatePlot(TH1D* h, TH1D* i, TH1D* j, TH1D* m, Color_t col0, Color_t c TH1D* hh_ratio_gmt = setHistoRatio(m, h, "", 0.01,1.1,col0); hh_ratio_gmt->Draw("P same"); - - - - leg = new TLegend(0.15,0.45,.45,0.7,NULL,"brNDC"); - leg->SetMargin(0.1); + + leg = new TLegend(0.14,0.38,.45,0.65,NULL,"brNDC"); + leg->SetMargin(0.04); leg->SetBorderSize(0); leg->SetTextSize(0.1); - leg->SetFillStyle(1001); - leg->SetFillColor(kWhite); - leg->AddEntry(hh_ratio_gmt, "(GEM+CSC)/GMT","p"); - leg->AddEntry(hh_ratio, "(GEM+CSC)/CSC #geq" + k + " stubs","p"); + leg->SetFillStyle(0); + // leg->SetFillStyle(1001); + // leg->SetFillColor(kWhite); + leg->AddEntry(hh_ratio_gmt, "(GEM+CSC)/L1 single muon trigger","p"); + leg->AddEntry(hh_ratio, "(GEM+CSC)/CSC #geq" + k + " stubs (one in ME1/b)","p"); leg->Draw("same"); c->SaveAs(plots + "rates_vs_pt__PU100__def_" + k + "s_" + k + "s1b_" + k + "s1bgem__" + l + ext); } - -/* -.L drawplot_gmtrt.C - -*/ - -TString ext = ".png"; +TString ext = ".pdf"; TString filesDir = "files/"; TString plotDir = "plots/"; -void getPTHistos(TString dname) -{ -TString f_def = filesDir; -TString f_gem = filesDir; - -if (dname.Contains("_pat8")) f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root"; -if (dname == "minbias_pt05_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat8.root"; -if (dname == "minbias_pt06_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat8.root"; -if (dname == "minbias_pt10_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat8.root"; -if (dname == "minbias_pt15_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat8.root"; -if (dname == "minbias_pt20_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat8.root"; -if (dname == "minbias_pt30_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat8.root"; -if (dname == "minbias_pt40_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat8.root"; - -if (dname.Contains("_pat2")) f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat2.root"; -if (dname == "minbias_pt05_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat2.root"; -if (dname == "minbias_pt06_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat2.root"; -if (dname == "minbias_pt10_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt10_pat2.root"; -if (dname == "minbias_pt15_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt15_pat2.root"; -if (dname == "minbias_pt20_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt20_pat2.root"; -if (dname == "minbias_pt30_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt30_pat2.root"; -if (dname == "minbias_pt40_pat2") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt40_pat2.root"; - -result_def = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_1b", "_def"); -result_def_2s = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_2s_1b", "_def"); -result_def_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_def"); -result_def_2s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_def"); -result_def_eta_all = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s", "_def"); -result_def_eta_all_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_def"); -result_def_eta_no1a = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_no1a", "_def"); -result_def_eta_no1a_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_def"); -result_gmtsing = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); - -result_gem = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_gem"); -result_gem_2s1b = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_gem"); -result_gem_eta_all = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_gem"); -result_gem_eta_no1a = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_gem"); -//result_gmtsing = getPTHisto(f_gem, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); -} - - - void drawplot_frankenstein_ptshiftX() { gROOT->ProcessLine(".L drawplot_gmtrt.C"); + gROOT->ProcessLine(".L getPTHistos.C"); //gem_dir = "gemPTX/"; gem_dir = "plots/rate_vs_pt_shiftX/"; gem_label = "gem98"; -//gem_dir = "gem95/"; gem_label = "gem95"; - -//do_not_print = true; - -gROOT->SetBatch(true); - -//gStyle->SetStatW(0.13); -//gStyle->SetStatH(0.08); -gStyle->SetStatW(0.07); -gStyle->SetStatH(0.06); - -gStyle->SetOptStat(0); - -gStyle->SetTitleStyle(0); -gStyle->SetTitleAlign(13);// coord in top left -gStyle->SetTitleX(0.); -gStyle->SetTitleY(1.); -gStyle->SetTitleW(1); -gStyle->SetTitleH(0.058); -gStyle->SetTitleBorderSize(0); - -gStyle->SetPadLeftMargin(0.126); -gStyle->SetPadRightMargin(0.04); -gStyle->SetPadTopMargin(0.06); -gStyle->SetPadBottomMargin(0.13); - -gStyle->SetMarkerStyle(1); - -TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; -gPad->SetLogx(1); -gPad->SetGridx(1);gPad->SetGridy(1); - -TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; -gPad->SetLogx(1);gPad->SetLogy(1); -gPad->SetGridx(1);gPad->SetGridy(1); - - -// ********** PAT2 ********** - -getPTHistos("minbias_pt10_pat2"); -hh = (TH1D*)result_def_3s1b->Clone("gem_new"); -for (int b = hh->FindBin(7.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); -hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); -for (int b = hh_all->FindBin(7.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); -hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); -for (int b = hh_no1a->FindBin(7.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); -hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); -for (int b = hh_2s1b->FindBin(7.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); - -h06 = (TH1D*)result_gem->Clone("gem_new_06"); -for (int b = h06->FindBin(7.01); b < h06->FindBin(8.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} -h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); -for (int b = h06_all->FindBin(7.01); b < h06_all->FindBin(8.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} -h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); -for (int b = h06_no1a->FindBin(7.01); b < h06_no1a->FindBin(8.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} -h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); -for (int b = h06_2s1b->FindBin(7.01); b < h06_2s1b->FindBin(8.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} - -getPTHistos("minbias_pt15_pat2"); -h10 = (TH1D*)result_gem->Clone("gem10"); -for (int b = h10->FindBin(8.01); b < h10->FindBin(10.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} -h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); -for (int b = h10_all->FindBin(8.01); b < h10_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} -h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); -for (int b = h10_no1a->FindBin(8.01); b < h10_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} -h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); -for (int b = h10_2s1b->FindBin(8.01); b < h10_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} - -getPTHistos("minbias_pt20_pat2"); -h15 = (TH1D*)result_gem->Clone("gem15"); -for (int b = h15->FindBin(10.01); b < h15->FindBin(15.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} -h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); -for (int b = h15_all->FindBin(10.01); b < h15_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} -h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); -for (int b = h15_no1a->FindBin(10.01); b < h15_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} -h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); -for (int b = h15_2s1b->FindBin(10.01); b < h15_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} - -getPTHistos("minbias_pt30_pat2"); -h20 = (TH1D*)result_gem->Clone("gem20"); -for (int b = h20->FindBin(15.01); b < h20->FindBin(20.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} -h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); -for (int b = h20_all->FindBin(15.01); b < h20_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} -h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); -for (int b = h20_no1a->FindBin(15.01); b < h20_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} -h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); -for (int b = h20_2s1b->FindBin(15.01); b < h20_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} - -getPTHistos("minbias_pt40_pat2"); -h30 = (TH1D*)result_gem->Clone("gem30"); -for (int b = h30->FindBin(20.01); b <= h30->GetNbinsX(); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} -h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); -for (int b = h30_all->FindBin(20.01); b < h30_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} -h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); -for (int b = h30_no1a->FindBin(20.01); b < h30_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} -h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); -for (int b = h30_2s1b->FindBin(20.01); b < h30_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} - -for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); -for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); -for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); -for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); - - -//TString the_ttl = "CSC L1 trigger rates in ME1/b eta region;p_{T}^{cut} [GeV/c];rate [kHz]"; - -// TString the_ttl = " L1 Single Muon Trigger CMS Simulation Preliminary;L1 candidate muon p_{T}^{cut} [GeV/c];rate [kHz]"; + //gem_dir = "gem95/"; gem_label = "gem95"; + + //do_not_print = true; + + gROOT->SetBatch(true); + + //gStyle->SetStatW(0.13); + //gStyle->SetStatH(0.08); + gStyle->SetStatW(0.07); + gStyle->SetStatH(0.06); + + gStyle->SetOptStat(0); + + gStyle->SetTitleStyle(0); + gStyle->SetTitleAlign(13);// coord in top left + gStyle->SetTitleX(0.); + gStyle->SetTitleY(1.); + gStyle->SetTitleW(1); + gStyle->SetTitleH(0.058); + gStyle->SetTitleBorderSize(0); + + gStyle->SetPadLeftMargin(0.126); + gStyle->SetPadRightMargin(0.04); + gStyle->SetPadTopMargin(0.06); + gStyle->SetPadBottomMargin(0.13); + + gStyle->SetMarkerStyle(1); + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + + // ********** PAT2 ********** + + getPTHistos("minbias_pt10_pat2", filesDir, filesDir, gem_label); + hh = (TH1D*)result_def_3s1b->Clone("gem_new"); + for (int b = hh->FindBin(7.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); + hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); + for (int b = hh_all->FindBin(7.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); + hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); + for (int b = hh_no1a->FindBin(7.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); + hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); + for (int b = hh_2s1b->FindBin(7.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); + + h06 = (TH1D*)result_gem->Clone("gem_new_06"); + for (int b = h06->FindBin(7.01); b < h06->FindBin(8.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} + h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); + for (int b = h06_all->FindBin(7.01); b < h06_all->FindBin(8.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} + h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); + for (int b = h06_no1a->FindBin(7.01); b < h06_no1a->FindBin(8.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} + h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); + for (int b = h06_2s1b->FindBin(7.01); b < h06_2s1b->FindBin(8.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt15_pat2", filesDir, filesDir, gem_label); + h10 = (TH1D*)result_gem->Clone("gem10"); + for (int b = h10->FindBin(8.01); b < h10->FindBin(10.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} + h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); + for (int b = h10_all->FindBin(8.01); b < h10_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} + h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); + for (int b = h10_no1a->FindBin(8.01); b < h10_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} + h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); + for (int b = h10_2s1b->FindBin(8.01); b < h10_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt20_pat2", filesDir, filesDir, gem_label); + h15 = (TH1D*)result_gem->Clone("gem15"); + for (int b = h15->FindBin(10.01); b < h15->FindBin(15.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} + h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); + for (int b = h15_all->FindBin(10.01); b < h15_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} + h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); + for (int b = h15_no1a->FindBin(10.01); b < h15_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} + h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); + for (int b = h15_2s1b->FindBin(10.01); b < h15_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt30_pat2", filesDir, filesDir, gem_label); + h20 = (TH1D*)result_gem->Clone("gem20"); + for (int b = h20->FindBin(15.01); b < h20->FindBin(20.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} + h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); + for (int b = h20_all->FindBin(15.01); b < h20_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} + h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); + for (int b = h20_no1a->FindBin(15.01); b < h20_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} + h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); + for (int b = h20_2s1b->FindBin(15.01); b < h20_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt40_pat2", filesDir, filesDir, gem_label); + h30 = (TH1D*)result_gem->Clone("gem30"); + for (int b = h30->FindBin(20.01); b <= h30->GetNbinsX(); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} + h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); + for (int b = h30_all->FindBin(20.01); b < h30_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} + h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); + for (int b = h30_no1a->FindBin(20.01); b < h30_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} + h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); + for (int b = h30_2s1b->FindBin(20.01); b < h30_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} + + for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); + for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); + for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); + for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); + + + // TString the_ttl = " L1 Single Muon Trigger CMS Simulation Preliminary;L1 candidate muon p_{T}^{cut} [GeV/c];rate [kHz]"; TString the_ttl = " CMS Simulation Preliminary;L1 muon candidate p_{T}^{cut} [GeV/c];Trigger rate [kHz]"; + hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); + hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); + hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); + hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); + result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); -hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); -hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); -hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); -hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); - -result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); - -result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); -result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); -result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); -result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); -result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); -result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); -result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); -result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); - - - -hh->SetFillColor(kGreen+4); -hh_all->SetFillColor(kGreen+4); -hh_no1a->SetFillColor(kGreen+4); -hh_2s1b->SetFillColor(kGreen+4); - -result_def_2s__pat2 = (TH1D*) result_def_2s->Clone("result_def_2s__pat2"); -result_def_3s__pat2 = (TH1D*) result_def->Clone("result_def_3s__pat2"); -result_def_2s1b__pat2 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat2"); -result_def_3s1b__pat2 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat2"); -result_gmtsing__pat2 = (TH1D*) result_gmtsing->Clone("result_gmtsing__pat2");; - -result_gem_2s1b__pat2 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat2"); -result_gem_3s1b__pat2 = (TH1D*) hh->Clone("result_gem_3s1b__pat2"); - - - -// --- def-3s gem-3s-3s1b - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def->Draw("e3"); -hh->Draw("same e3"); - -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def,"default emulator","f"); -leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh,"with GEM match","f"); -leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); - -drawPULabel(); - -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); - - -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); - - -// --- def-3s-3s1b gem-3s-3s1b - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s1b->Draw("e3"); -hh->Draw("same e3"); - -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s1b,"default emulator","f"); -leg->AddEntry(hh,"with GEM match","f"); -leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); - -drawPULabel(); - -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); - - -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); - + result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); + result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); + result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); + result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); -// --- def-3s-2s1b gem-3s-2s1b + hh->SetFillColor(kGreen+4); + hh_all->SetFillColor(kGreen+4); + hh_no1a->SetFillColor(kGreen+4); + hh_2s1b->SetFillColor(kGreen+4); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s1b->Draw("e3"); -hh_2s1b->Draw("same e3"); + result_def_2s__pat2 = (TH1D*) result_def_2s->Clone("result_def_2s__pat2"); + result_def_3s__pat2 = (TH1D*) result_def->Clone("result_def_3s__pat2"); + result_def_2s1b__pat2 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat2"); + result_def_3s1b__pat2 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat2"); + result_gmtsing__pat2 = (TH1D*) result_gmtsing->Clone("result_gmtsing__pat2");; -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_2s1b,"default emulator","f"); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + result_gem_2s1b__pat2 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat2"); + result_gem_3s1b__pat2 = (TH1D*) hh->Clone("result_gem_3s1b__pat2"); -drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); + // --- def-3s gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh->Draw("same e3"); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def,"default emulator","f"); + leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh,"with GEM match","f"); + leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); -// --- def-3s gem-3s-2s1b - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def->Draw("e3"); -hh_2s1b->Draw("same e3"); - -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def,"default emulator","f"); -leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); - -drawPULabel(); - -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); - - -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio.C"); - - -// --- def-3s-3s1b gem-3s-2s1b - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s1b->Draw("e3"); -hh_2s1b->Draw("same e3"); - -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s1b,"default emulator","f"); -leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); - -drawPULabel(); - -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); - - -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); - - -// --- eta 1-2.4 def-3s gem-3s-3s1b - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_all->Draw("e3"); -hh_all->Draw("same e3"); - -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_all,"default emulator","f"); -leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); -leg->AddEntry(hh_all,"with GEM match","f"); -leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); - -drawPULabel(); - -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); - - -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); - - -// --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_all_3s1b->Draw("e3"); -hh_all->Draw("same e3"); - -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); -leg->AddEntry(hh_all,"with GEM match","f"); -leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.4",""); -leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); - -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); -// --- eta 1-2.1 def-3s gem-3s-3s1b + // --- def-3s-3s1b gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_no1a->Draw("e3"); -hh_no1a->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3"); + hh->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_no1a,"default emulator","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); -leg->AddEntry(hh_no1a,"with GEM match","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s1b,"default emulator","f"); + leg->AddEntry(hh,"with GEM match","f"); + leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); -// --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b + // --- def-3s-2s1b gem-3s-2s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_no1a_3s1b->Draw("e3"); -hh_no1a->Draw("same e3"); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s1b->Draw("e3"); + hh_2s1b->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); -leg->AddEntry(hh_no1a,"with GEM match","f"); -leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s1b,"default emulator","f"); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -drawPULabel(); + drawPULabel(); -gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); + // --- def-3s gem-3s-2s1b + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh_2s1b->Draw("same e3"); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def,"default emulator","f"); + leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + drawPULabel(); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); -// ********** PAT8 ********** -getPTHistos("minbias_pt10_pat8"); -hh = (TH1D*)result_def_3s1b->Clone("gem_new"); -for (int b = hh->FindBin(7.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); -hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); -for (int b = hh_all->FindBin(7.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); -hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); -for (int b = hh_no1a->FindBin(7.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); -hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); -for (int b = hh_2s1b->FindBin(7.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); -h06 = (TH1D*)result_gem->Clone("gem_new_06"); -for (int b = h06->FindBin(7.01); b < h06->FindBin(8.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} -h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); -for (int b = h06_all->FindBin(7.01); b < h06_all->FindBin(8.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} -h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); -for (int b = h06_no1a->FindBin(7.01); b < h06_no1a->FindBin(8.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} -h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); -for (int b = h06_2s1b->FindBin(7.01); b < h06_2s1b->FindBin(8.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} -getPTHistos("minbias_pt15_pat8"); -h10 = (TH1D*)result_gem->Clone("gem10"); -for (int b = h10->FindBin(8.01); b < h10->FindBin(10.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} -h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); -for (int b = h10_all->FindBin(8.01); b < h10_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} -h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); -for (int b = h10_no1a->FindBin(8.01); b < h10_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} -h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); -for (int b = h10_2s1b->FindBin(8.01); b < h10_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} + // --- def-3s-3s1b gem-3s-2s1b -getPTHistos("minbias_pt20_pat8"); -h15 = (TH1D*)result_gem->Clone("gem15"); -for (int b = h15->FindBin(10.01); b < h15->FindBin(15.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} -h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); -for (int b = h15_all->FindBin(10.01); b < h15_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} -h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); -for (int b = h15_no1a->FindBin(10.01); b < h15_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} -h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); -for (int b = h15_2s1b->FindBin(10.01); b < h15_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3"); + hh_2s1b->Draw("same e3"); -getPTHistos("minbias_pt30_pat8"); -h20 = (TH1D*)result_gem->Clone("gem20"); -for (int b = h20->FindBin(15.01); b < h20->FindBin(20.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} -h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); -for (int b = h20_all->FindBin(15.01); b < h20_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} -h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); -for (int b = h20_no1a->FindBin(15.01); b < h20_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} -h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); -for (int b = h20_2s1b->FindBin(15.01); b < h20_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s1b,"default emulator","f"); + leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -getPTHistos("minbias_pt40_pat8"); -h30 = (TH1D*)result_gem->Clone("gem30"); -for (int b = h30->FindBin(20.01); b <= h30->GetNbinsX(); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} -h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); -for (int b = h30_all->FindBin(20.01); b < h30_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} -h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); -for (int b = h30_no1a->FindBin(20.01); b < h30_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} -h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); -for (int b = h30_2s1b->FindBin(20.01); b < h30_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} + drawPULabel(); -for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); -for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); -for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); -for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); -hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); -hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); -hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); -hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); -result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); -result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); -result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); -result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); -result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); -result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); -result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); -result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); -result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); + // --- eta 1-2.4 def-3s gem-3s-3s1b + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_all->Draw("e3"); + hh_all->Draw("same e3"); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_all,"default emulator","f"); + leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); + leg->AddEntry(hh_all,"with GEM match","f"); + leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); -hh->SetFillColor(kGreen+4); -hh_all->SetFillColor(kGreen+4); -hh_no1a->SetFillColor(kGreen+4); -hh_2s1b->SetFillColor(kGreen+4); + drawPULabel(); -result_def_2s__pat8 = (TH1D*) result_def_2s->Clone("result_def_2s__pat8"); -result_def_3s__pat8 = (TH1D*) result_def->Clone("result_def_3s__pat8"); -result_def_2s1b__pat8 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat8"); -result_def_3s1b__pat8 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat8"); -result_gmtsing__pat8 = (TH1D*) result_gmtsing->Clone("result_gmtsing__pat8");; + gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); -result_gem_2s1b__pat8 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat8"); -result_gem_3s1b__pat8 = (TH1D*) hh->Clone("result_gem_3s1b__pat8"); - - -// --- def-3s gem-3s-3s1b - -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def->Draw("e3"); -hh->Draw("same e3"); - -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def,"default emulator","f"); -leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh,"with GEM match","f"); -leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); -drawPULabel(); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); + // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_all_3s1b->Draw("e3"); + hh_all->Draw("same e3"); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); + leg->AddEntry(hh_all,"with GEM match","f"); + leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.4",""); + leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -// --- def-3s-3s1b gem-3s-3s1b + drawPULabel(); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s1b->Draw("e3"); -hh->Draw("same e3"); + gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s1b,"default emulator","f"); -leg->AddEntry(hh,"with GEM match","f"); -leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); -drawPULabel(); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); + // --- eta 1-2.1 def-3s gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_no1a->Draw("e3"); + hh_no1a->Draw("same e3"); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_no1a,"default emulator","f"); + leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); + leg->AddEntry(hh_no1a,"with GEM match","f"); + leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); -// --- def-3s-2s1b gem-3s-2s1b + drawPULabel(); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s1b->Draw("e3"); -hh_2s1b->Draw("same e3"); + gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_2s1b,"default emulator","f"); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); -drawPULabel(); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + + + // --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_no1a_3s1b->Draw("e3"); + hh_no1a->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); + leg->AddEntry(hh_no1a,"with GEM match","f"); + leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); -// --- def-3s gem-3s-2s1b -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def->Draw("e3"); -hh_2s1b->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def,"default emulator","f"); -leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + // ********** PAT8 ********** -drawPULabel(); + getPTHistos("minbias_pt10_pat8", filesDir, filesDir, gem_label); + hh = (TH1D*)result_def_3s1b->Clone("gem_new"); + for (int b = hh->FindBin(7.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); + hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); + for (int b = hh_all->FindBin(7.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); + hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); + for (int b = hh_no1a->FindBin(7.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); + hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); + for (int b = hh_2s1b->FindBin(7.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); + h06 = (TH1D*)result_gem->Clone("gem_new_06"); + for (int b = h06->FindBin(7.01); b < h06->FindBin(8.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} + h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); + for (int b = h06_all->FindBin(7.01); b < h06_all->FindBin(8.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} + h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); + for (int b = h06_no1a->FindBin(7.01); b < h06_no1a->FindBin(8.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} + h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); + for (int b = h06_2s1b->FindBin(7.01); b < h06_2s1b->FindBin(8.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} + getPTHistos("minbias_pt15_pat8", filesDir, filesDir, gem_label); + h10 = (TH1D*)result_gem->Clone("gem10"); + for (int b = h10->FindBin(8.01); b < h10->FindBin(10.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} + h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); + for (int b = h10_all->FindBin(8.01); b < h10_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} + h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); + for (int b = h10_no1a->FindBin(8.01); b < h10_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} + h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); + for (int b = h10_2s1b->FindBin(8.01); b < h10_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); + getPTHistos("minbias_pt20_pat8", filesDir, filesDir, gem_label); + h15 = (TH1D*)result_gem->Clone("gem15"); + for (int b = h15->FindBin(10.01); b < h15->FindBin(15.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} + h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); + for (int b = h15_all->FindBin(10.01); b < h15_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} + h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); + for (int b = h15_no1a->FindBin(10.01); b < h15_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} + h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); + for (int b = h15_2s1b->FindBin(10.01); b < h15_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} + getPTHistos("minbias_pt30_pat8", filesDir, filesDir, gem_label); + h20 = (TH1D*)result_gem->Clone("gem20"); + for (int b = h20->FindBin(15.01); b < h20->FindBin(20.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} + h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); + for (int b = h20_all->FindBin(15.01); b < h20_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} + h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); + for (int b = h20_no1a->FindBin(15.01); b < h20_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} + h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); + for (int b = h20_2s1b->FindBin(15.01); b < h20_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} -// --- def-3s-3s1b gem-3s-2s1b + getPTHistos("minbias_pt40_pat8", filesDir, filesDir, gem_label); + h30 = (TH1D*)result_gem->Clone("gem30"); + for (int b = h30->FindBin(20.01); b <= h30->GetNbinsX(); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} + h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); + for (int b = h30_all->FindBin(20.01); b < h30_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} + h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); + for (int b = h30_no1a->FindBin(20.01); b < h30_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} + h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); + for (int b = h30_2s1b->FindBin(20.01); b < h30_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s1b->Draw("e3"); -hh_2s1b->Draw("same e3"); + for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); + for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); + for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); + for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s1b,"default emulator","f"); -leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); -leg->AddEntry(hh_2s1b,"with GEM match","f"); -leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); -drawPULabel(); + hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); + hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); + hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); + hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); + result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); + result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); + result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); + result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); + result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); -// --- eta 1-2.4 def-3s gem-3s-3s1b + hh->SetFillColor(kGreen+4); + hh_all->SetFillColor(kGreen+4); + hh_no1a->SetFillColor(kGreen+4); + hh_2s1b->SetFillColor(kGreen+4); + + result_def_2s__pat8 = (TH1D*) result_def_2s->Clone("result_def_2s__pat8"); + result_def_3s__pat8 = (TH1D*) result_def->Clone("result_def_3s__pat8"); + result_def_2s1b__pat8 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat8"); + result_def_3s1b__pat8 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat8"); + result_gmtsing__pat8 = (TH1D*) result_gmtsing->Clone("result_gmtsing__pat8");; + + result_gem_2s1b__pat8 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat8"); + result_gem_3s1b__pat8 = (TH1D*) hh->Clone("result_gem_3s1b__pat8"); + + + // --- def-3s gem-3s-3s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def,"default emulator","f"); + leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh,"with GEM match","f"); + leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_all->Draw("e3"); -hh_all->Draw("same e3"); + drawPULabel(); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_all,"default emulator","f"); -leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); -leg->AddEntry(hh_all,"with GEM match","f"); -leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); -drawPULabel(); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + // --- def-3s-3s1b gem-3s-3s1b + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3"); + hh->Draw("same e3"); -// --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s1b,"default emulator","f"); + leg->AddEntry(hh,"with GEM match","f"); + leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_all_3s1b->Draw("e3"); -hh_all->Draw("same e3"); + drawPULabel(); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); -leg->AddEntry(hh_all,"with GEM match","f"); -leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); -drawPULabel(); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + // --- def-3s-2s1b gem-3s-2s1b + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s1b->Draw("e3"); + hh_2s1b->Draw("same e3"); -// --- eta 1-2.1 def-3s gem-3s-3s1b + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s1b,"default emulator","f"); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_no1a->Draw("e3"); -hh_no1a->Draw("same e3"); + drawPULabel(); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_no1a,"default emulator","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.14",""); -leg->AddEntry(hh_no1a,"with GEM match","f"); -leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); -leg->Draw(); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); -drawPULabel(); -gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + // --- def-3s gem-3s-2s1b + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh_2s1b->Draw("same e3"); -// --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def,"default emulator","f"); + leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_eta_no1a_3s1b->Draw("e3"); -hh_no1a->Draw("same e3"); + drawPULabel(); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); -leg->AddEntry(hh_no1a,"with GEM match","f"); -leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); -leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); -leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); -leg->Draw(); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); -drawPULabel(); -gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + // --- def-3s-3s1b gem-3s-2s1b + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3"); + hh_2s1b->Draw("same e3"); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s1b,"default emulator","f"); + leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + drawPULabel(); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); -//-------------------------- "Sequential" combinations ----------------------------- -result_def_2s__pat2->SetFillColor(kAzure+2); -result_def_2s1b__pat2->SetFillColor(kAzure+5); -result_def_3s__pat2->SetFillColor(kAzure+3); -result_def_3s1b__pat2->SetFillColor(kAzure+6); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); -result_def_2s__pat8->SetFillColor(kViolet); -result_def_2s1b__pat8->SetFillColor(kViolet+3); -result_def_3s__pat8->SetFillColor(kViolet+1); -result_def_3s1b__pat8->SetFillColor(kViolet+4); -result_gmtsing__pat2->SetFillColor(kRed); -result_gmtsing__pat8->SetFillColor(kRed); + // --- eta 1-2.4 def-3s gem-3s-3s1b -result_gem_2s1b__pat2->SetFillColor(kGreen+1); -result_gem_3s1b__pat2->SetFillColor(kGreen+3); -result_gem_2s1b__pat8->SetFillColor(kGreen-2); -result_gem_3s1b__pat8->SetFillColor(kGreen-3); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_all->Draw("e3"); + hh_all->Draw("same e3"); -/* -result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); -result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); -result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); -result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); -result_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 1000.); -result_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 1000.); -*/ -result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); -result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); -result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); -result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); -result_gem_2s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); -result_gem_3s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); -result_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 5000.); -result_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 5000.); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_all,"default emulator","f"); + leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); + leg->AddEntry(hh_all,"with GEM match","f"); + leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); + drawPULabel(); -///----- 3 stubs + gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s__pat2->Draw("e3"); -result_def_3s1b__pat2->Draw("same e3"); -result_gem_3s1b__pat2->Draw("same e3"); -TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); -leg->AddEntry(result_def_3s__pat2,"any stubs","f"); -leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); -leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); -leg->Draw(); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2" + ext); + // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); -hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_all_3s1b->Draw("e3"); + hh_all->Draw("same e3"); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); + leg->AddEntry(hh_all,"with GEM match","f"); + leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + drawPULabel(); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s__pat2->Draw("e3"); -result_def_3s1b__pat2->Draw("same e3"); -result_gmtsing__pat2->Draw("same e3"); -result_gem_3s1b__pat2->Draw("same e3"); + gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); -TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); -leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); -leg->AddEntry(result_def_3s__pat2,"any stubs","f"); -leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); -leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); -leg->Draw(); -drawPULabel(); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); + // --- eta 1-2.1 def-3s gem-3s-3s1b + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_no1a->Draw("e3"); + hh_no1a->Draw("same e3"); -TFile fsave("gem_3plus_ptshiftX.root", "RECREATE"); -result_gem_2s1b__pat2->Write(); -result_gem_3s1b__pat2->Write(); -fsave.Write(); -fsave.Close(); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_no1a,"default emulator","f"); + leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.14",""); + leg->AddEntry(hh_no1a,"with GEM match","f"); + leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); + drawPULabel(); + gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s__pat8->Draw("e3"); -result_def_3s1b__pat8->Draw("same e3"); -result_gem_3s1b__pat8->Draw("same e3"); -TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s__pat8,"CSCTF tracks #geq3 stubs:",""); -leg->AddEntry(result_def_3s__pat8,"any stubs","f"); -leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub","f"); -leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub","f"); -leg->Draw(); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat8" + ext); + // --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_no1a_3s1b->Draw("e3"); + hh_no1a->Draw("same e3"); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); + leg->AddEntry(hh_no1a,"with GEM match","f"); + leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + drawPULabel(); + gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s__pat2->Draw("e3"); -result_def_3s__pat8->Draw("same e3"); -result_def_3s1b__pat8->Draw("same e3"); -result_gem_3s1b__pat8->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); -leg->AddEntry(result_def_3s__pat2,"any stubs","f"); -leg->AddEntry(result_def_3s__pat8,"any stubs, tight patt.","f"); -leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub, tight patt.","f"); -leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); -leg->Draw(); -drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein" + ext); + //-------------------------- "Sequential" combinations ----------------------------- -/// ----- 2 stubs + result_def_2s__pat2->SetFillColor(kAzure+2); + result_def_2s1b__pat2->SetFillColor(kAzure+5); + result_def_3s__pat2->SetFillColor(kAzure+3); + result_def_3s1b__pat2->SetFillColor(kAzure+6); + result_def_2s__pat8->SetFillColor(kViolet); + result_def_2s1b__pat8->SetFillColor(kViolet+3); + result_def_3s__pat8->SetFillColor(kViolet+1); + result_def_3s1b__pat8->SetFillColor(kViolet+4); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s__pat2->Draw("e3"); -result_def_2s1b__pat2->Draw("same e3"); -result_gem_2s1b__pat2->Draw("same e3"); + result_gmtsing__pat2->SetFillColor(kRed); + result_gmtsing__pat8->SetFillColor(kRed); -TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); -leg->AddEntry(result_def_2s__pat2,"any stubs","f"); -leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); -leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); -leg->Draw(); + result_gem_2s1b__pat2->SetFillColor(kGreen+1); + result_gem_3s1b__pat2->SetFillColor(kGreen+3); + result_gem_2s1b__pat8->SetFillColor(kGreen-2); + result_gem_3s1b__pat8->SetFillColor(kGreen-3); -drawPULabel(); + /* + result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); + result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); + result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); + result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); + result_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 1000.); + result_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 1000.); + */ + result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); + result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); + result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); + result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); + result_gem_2s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); + result_gem_3s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); + result_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 5000.); + result_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 5000.); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); + ///----- 3 stubs + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat2->Draw("e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_gem_3s1b__pat2->Draw("same e3"); + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_def_3s__pat2,"any stubs","f"); + leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); + leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); + leg->Draw(); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s__pat2->Draw("e3"); -result_def_2s1b__pat2->Draw("same e3"); -result_gmtsing__pat2->Draw("same e3"); -result_gem_2s1b__pat2->Draw("same e3"); + drawPULabel(); -TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); -leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); -leg->AddEntry(result_def_2s__pat2,"any stubs","f"); -leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); -leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); -leg->Draw(); + gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2" + ext); -drawPULabel(); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); + hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); -((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); -hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); -hh_ratio->Draw("e1"); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat2->Draw("e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_gmtsing__pat2->Draw("same e3"); + result_gem_3s1b__pat2->Draw("same e3"); + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_def_3s__pat2,"any stubs","f"); + leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); + leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); + leg->Draw(); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s__pat8->Draw("e3"); -result_def_2s1b__pat8->Draw("same e3"); -result_gem_2s1b__pat8->Draw("same e3"); + drawPULabel(); -TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_2s__pat8,"CSCTF tracks #geq2 stubs:",""); -leg->AddEntry(result_def_2s__pat8,"any stubs","f"); -leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub","f"); -leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub","f"); -leg->Draw(); + gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); -drawPULabel(); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat8" + ext); + TFile fsave("gem_3plus_ptshiftX.root", "RECREATE"); + result_gem_2s1b__pat2->Write(); + result_gem_3s1b__pat2->Write(); + fsave.Write(); + fsave.Close(); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_2s__pat2->Draw("e3"); -result_def_2s__pat8->Draw("same e3"); -result_def_2s1b__pat8->Draw("same e3"); -result_gem_2s1b__pat8->Draw("same e3"); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); -leg->AddEntry(result_def_2s__pat2,"any stubs","f"); -leg->AddEntry(result_def_2s__pat8,"any stubs, tight patt.","f"); -leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub, tight patt.","f"); -leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); -leg->Draw(); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat8->Draw("e3"); + result_def_3s1b__pat8->Draw("same e3"); + result_gem_3s1b__pat8->Draw("same e3"); -drawPULabel(); + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat8,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_def_3s__pat8,"any stubs","f"); + leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub","f"); + leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub","f"); + leg->Draw(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein" + ext); + drawPULabel(); + gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat8" + ext); -/// ----- GMT current "default" single trigger + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat2->Draw("e3"); + result_def_3s__pat8->Draw("same e3"); + result_def_3s1b__pat8->Draw("same e3"); + result_gem_3s1b__pat8->Draw("same e3"); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_def_3s__pat2,"any stubs","f"); + leg->AddEntry(result_def_3s__pat8,"any stubs, tight patt.","f"); + leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub, tight patt.","f"); + leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); + leg->Draw(); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_gmtsing__pat2->Draw("e3"); -result_def_2s__pat2->Draw("same e3"); -result_def_2s1b__pat2->Draw("same e3"); -result_def_3s__pat2->Draw("same e3"); -result_def_3s1b__pat2->Draw("same e3"); -result_gmtsing__pat2->Draw("same e3"); + drawPULabel(); -TLegend *leg = new TLegend(0.49,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); -leg->AddEntry(result_def_2s__pat2,"Tracks: #geq2 stubs","f"); -leg->AddEntry(result_def_2s1b__pat2," #geq2 with ME1/b stubs","f"); -leg->AddEntry(result_def_3s__pat2," #geq3 stubs","f"); -leg->AddEntry(result_def_3s1b__pat2," #geq3 with ME1/b stubs","f"); -leg->Draw(); + gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein" + ext); -drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__GMT__Frankenstein_pat2" + ext); + /// ----- 2 stubs -///----- 2 & 3 stubs + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s__pat2->Draw("e3"); + result_def_2s1b__pat2->Draw("same e3"); + result_gem_2s1b__pat2->Draw("same e3"); + TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_def_2s__pat2,"any stubs","f"); + leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); + leg->Draw(); + drawPULabel(); -((TCanvas*)gROOT->FindObject("cAll100"))->cd(); -result_def_3s__pat2->Draw("e3"); -result_def_3s1b__pat2->Draw("same e3"); -result_gem_2s1b__pat2->Draw("same e3"); -result_gem_3s1b__pat2->Draw("same e3"); + gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat2" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); -TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->AddEntry(result_def_3s__pat2,"CSCTF tracks with:",""); -leg->AddEntry(result_def_3s__pat2,"3+ stubs","f"); -leg->AddEntry(result_def_3s1b__pat2,"3+ stubs with ME1/b stub","f"); -leg->AddEntry(result_gem_2s1b__pat2,"2+ stubs with (ME1/b + GEM) stub","f"); -leg->AddEntry(result_gem_2s1b__pat2,"3+ stubs with (ME1/b + GEM) stub","f"); -leg->Draw(); -drawPULabel(); -gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2" + ext); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s__pat2->Draw("e3"); + result_def_2s1b__pat2->Draw("same e3"); + result_gmtsing__pat2->Draw("same e3"); + result_gem_2s1b__pat2->Draw("same e3"); + TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); + leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_def_2s__pat2,"any stubs","f"); + leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); + leg->Draw(); + drawPULabel(); + gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s__pat8->Draw("e3"); + result_def_2s1b__pat8->Draw("same e3"); + result_gem_2s1b__pat8->Draw("same e3"); + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s__pat8,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_def_2s__pat8,"any stubs","f"); + leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub","f"); + leg->Draw(); + drawPULabel(); + gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat8" + ext); + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s__pat2->Draw("e3"); + result_def_2s__pat8->Draw("same e3"); + result_def_2s1b__pat8->Draw("same e3"); + result_gem_2s1b__pat8->Draw("same e3"); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_def_2s__pat2,"any stubs","f"); + leg->AddEntry(result_def_2s__pat8,"any stubs, tight patt.","f"); + leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub, tight patt.","f"); + leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); + leg->Draw(); + drawPULabel(); + gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein" + ext); + + + /// ----- GMT current "default" single trigger + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_gmtsing__pat2->Draw("e3"); + result_def_2s__pat2->Draw("same e3"); + result_def_2s1b__pat2->Draw("same e3"); + result_def_3s__pat2->Draw("same e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_gmtsing__pat2->Draw("same e3"); + TLegend *leg = new TLegend(0.49,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); + leg->AddEntry(result_def_2s__pat2,"Tracks: #geq2 stubs","f"); + leg->AddEntry(result_def_2s1b__pat2," #geq2 with ME1/b stubs","f"); + leg->AddEntry(result_def_3s__pat2," #geq3 stubs","f"); + leg->AddEntry(result_def_3s1b__pat2," #geq3 with ME1/b stubs","f"); + leg->Draw(); + drawPULabel(); + gPad->Print(gem_dir + "rates__164-214_PU100__sequential__GMT__Frankenstein_pat2" + ext); + + ///----- 2 & 3 stubs + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat2->Draw("e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_gem_2s1b__pat2->Draw("same e3"); + result_gem_3s1b__pat2->Draw("same e3"); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks with:",""); + leg->AddEntry(result_def_3s__pat2,"3+ stubs","f"); + leg->AddEntry(result_def_3s1b__pat2,"3+ stubs with ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat2,"2+ stubs with (ME1/b + GEM) stub","f"); + leg->AddEntry(result_gem_2s1b__pat2,"3+ stubs with (ME1/b + GEM) stub","f"); + leg->Draw(); + drawPULabel(); + gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2" + ext); Color_t col0 = kRed; @@ -1209,9 +1123,7 @@ gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2 Color_t col3 = kGreen-2; TString plots = "plots/rate_vs_pt_shiftX/"; - TString ext = ".png"; - - + TString ext = ".eps"; produceRatePlot(result_gmtsing, result_def_2s__pat2, result_def_2s1b__pat2, result_gem_2s1b__pat2, col0, col1, col2, col3, 0.1, 10000, "2", "loose", plots, ext); @@ -1222,10 +1134,6 @@ gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2 // produceRatePlot(result_gmtsing, result_def_3s, result_def_3s1b, result_gem_3s1b, // col0, col1, col2, col3, 0.01, 10000, "3", "tight", plots, ext); - - -return; - - + return; } diff --git a/SimMuL1/scripts/getPTHistos.C b/SimMuL1/scripts/getPTHistos.C index 3d51e54bcd437..736c55a571a70 100644 --- a/SimMuL1/scripts/getPTHistos.C +++ b/SimMuL1/scripts/getPTHistos.C @@ -1,8 +1,5 @@ -void getPTHistos(TString dname) +void getPTHistos(TString dname, TString f_def, TString f_gem, TString gem_label) { - TString f_def = gem_dir; - TString f_gem = gem_dir; - if (dname.Contains("_pat8")) f_def += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_def_pat8.root"; if (dname == "minbias_pt05_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt05_pat8.root"; if (dname == "minbias_pt06_pat8") f_gem += "hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_" + gem_label + "_pt06_pat8.root"; @@ -25,15 +22,23 @@ void getPTHistos(TString dname) result_def_2s = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_2s_1b", "_def"); result_def_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_def"); result_def_2s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_def"); + result_def_2s123 = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_2s123_1b", "_def"); + result_def_2s13 = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_2s13_1b", "_def"); result_def_eta_all = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s", "_def"); result_def_eta_all_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_def"); result_def_eta_no1a = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_no1a", "_def"); result_def_eta_no1a_3s1b = getPTHisto(f_def, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_def"); result_gmtsing = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); - + result_def_gmtsing = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); + result_def_gmtsing_no1a = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing6_no1a", "_def"); + result_gem = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_1b", "_gem"); result_gem_2s1b = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_2s1b_1b", "_gem"); + result_gem_2s123 = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_2s123_1b", "_gem"); + result_gem_2s13 = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_2s13_1b", "_gem"); result_gem_eta_all = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b", "_gem"); result_gem_eta_no1a = getPTHisto(f_gem, dir, "h_rt_gmt_csc_ptmax_3s_3s1b_no1a", "_gem"); //result_gmtsing = getPTHisto(f_gem, dir, "h_rt_gmt_ptmax_sing_1b", "_def"); + result_gem_gmtsing_no1a = getPTHisto(f_def, dir, "h_rt_gmt_ptmax_sing6_3s1b_no1a", "_def"); + } From 3314035cb92e5374c6c6c0b2c5dacc524b8c0872 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 19 Sep 2013 19:32:57 +0200 Subject: [PATCH 130/182] Added extra comments --- ...orApproval.py => triggerRateVsEtaPlots.py} | 87 +++++++++++++------ 1 file changed, 62 insertions(+), 25 deletions(-) rename SimMuL1/scripts/{produceRateVsEtaPlotsForApproval.py => triggerRateVsEtaPlots.py} (87%) diff --git a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.py b/SimMuL1/scripts/triggerRateVsEtaPlots.py similarity index 87% rename from SimMuL1/scripts/produceRateVsEtaPlotsForApproval.py rename to SimMuL1/scripts/triggerRateVsEtaPlots.py index f2f4a151b0814..d35d032ffdb0a 100644 --- a/SimMuL1/scripts/produceRateVsEtaPlotsForApproval.py +++ b/SimMuL1/scripts/triggerRateVsEtaPlots.py @@ -14,14 +14,18 @@ gem_label = "gem98" dir = "SimMuL1StrictAll" +#_______________________________________________________________________________ def drawLumiLabel2(x=0.2, y=0.4): + """Label for the luminosity""" tex = TLatex(x, y,"L = 4*10^{34} cm^{-2} s^{-1}") tex.SetTextSize(0.05) tex.SetNDC() tex.Draw("same") return tex +#_______________________________________________________________________________ def drawPULabel(x=0.17, y=0.15, font_size=0.): + """Label for luminosity, pile-up and bx""" tex = TLatex(x, y,"L=4*10^{34} (25ns PU100)") if (font_size > 0.): tex.SetFontSize(font_size) @@ -29,7 +33,9 @@ def drawPULabel(x=0.17, y=0.15, font_size=0.): tex.Draw("same") return tex +#_______________________________________________________________________________ def setHistoEta(f_name, name, cname, title, lcolor, lstyle, lwidth): + """Style for rate plot""" f = TFile.Open(f_name) ## print "opening ",f h0 = GetH(f,dir,name) @@ -59,7 +65,9 @@ def setHistoEta(f_name, name, cname, title, lcolor, lstyle, lwidth): ##h.GetYaxis().SetLabelOffset(0.015) return h +#_______________________________________________________________________________ def setHistoRatio(num, denom, title = "", ymin=0.4, ymax=1.6, color = kRed+3): + """Style for ratio plot""" ratio = num.Clone("%s--%s_ratio"%(num.GetName(),denom.GetName())) ratio.Divide(num, denom, 1., 1.) ratio.SetTitle(title) @@ -84,32 +92,42 @@ def setHistoRatio(num, denom, title = "", ymin=0.4, ymax=1.6, color = kRed+3): ##ratio.Draw("e3") return ratio -def addRatioPlotLegend(h,k): - leg = TLegend(0.17,0.35,.47,0.5,"","brNDC") - leg.SetMargin(0.1) - leg.SetBorderSize(0) - leg.SetTextSize(0.1) - leg.SetFillStyle(1001) - leg.SetFillColor(kWhite) - leg.AddEntry(h, "(GEM+CSC)/CSC #geq%d stubs (one in ME1/b)"%(k),"P"); - leg.Draw("same") - return leg - +#_______________________________________________________________________________ def addRatePlotLegend(h, i, j, k, l): - leg = TLegend(0.16,0.67,.8,0.9,"L1 Selections (#geq%d stubs, L1 candidate p_{T}#geq%d GeV/c):"%(k,l),"brNDC"); - leg.SetMargin(0.20) + """Add legend to the trigger rate plot""" + leg = TLegend(0.16,0.67,.8,0.9, + "L1 Selections (L1 muon candidate p_{T}#geq%d GeV/c):"%(l),"brNDC"); + leg.SetMargin(0.15) leg.SetBorderSize(0) leg.SetTextSize(0.04) leg.SetFillStyle(1001) leg.SetFillColor(kWhite) leg.AddEntry(h,"CSC #geq%d stubs (anywhere)"%(k),"l"); leg.AddEntry(i,"CSC #geq%d stubs (one in ME1/b)"%(k),"l"); - leg.AddEntry(j,"GEM+CSC integrated trigger","l"); + leg.AddEntry(j,"GEM+CSC integrated trigger with #geq%d stubs"%(k),"l"); +# leg.AddEntry(0,"with #geq%d stubs"%(k),""); leg.Draw("same") - ## carbage collection in PyROOT is something to pay attention to! + ## carbage collection in PyROOT is something to pay attention to + ## if you leave out this line, no legend will be drawn! SetOwnership(leg, False) return leg +#_______________________________________________________________________________ +def addRatioPlotLegend(h,k): + """Add legend to the ratio plot""" + leg = TLegend(0.15,0.09,.45,0.65,"","brNDC"); + #leg = TLegend(0.17,0.35,.47,0.5,"","brNDC") + leg.SetMargin(0.1) + leg.SetBorderSize(0) + leg.SetTextSize(0.1) + leg.SetFillStyle(0); + ## leg.SetFillStyle(1001) + ## leg.SetFillColor(kWhite) + leg.AddEntry(h, "(GEM+CSC)/CSC #geq%d stubs (one in ME1/b)"%(k),"P"); + leg.Draw("same") + return leg + +#_______________________________________________________________________________ def addRatePlot(h, i, j, col1, col2, col3, sty1, sty2, sty3, sty4, miny, maxy): h.SetFillColor(col1); i.SetFillColor(col2); @@ -125,8 +143,8 @@ def addRatePlot(h, i, j, col1, col2, col3, sty1, sty2, sty3, sty4, miny, maxy): j.SetFillStyle(0); h.SetLineStyle(1); - i.SetLineStyle(4); - j.SetLineStyle(2); + i.SetLineStyle(1); + j.SetLineStyle(1); h.SetLineWidth(2); i.SetLineWidth(2); @@ -140,7 +158,9 @@ def addRatePlot(h, i, j, col1, col2, col3, sty1, sty2, sty3, sty4, miny, maxy): j.Draw("same hist e1"); h.Draw("same hist e1"); +#_______________________________________________________________________________ def setPad1Attributes(pad1): + """Attributes for the top pad""" pad1.SetGridx(1) pad1.SetGridy(1) pad1.SetFrameBorderMode(0) @@ -148,7 +168,9 @@ def setPad1Attributes(pad1): pad1.SetTopMargin(0.06) pad1.SetBottomMargin(0.13) +#_______________________________________________________________________________ def setPad2Attributes(pad2): + """Attributes for the bottom pad""" pad2.SetLogy(1) pad2.SetGridx(1) pad2.SetGridy(1) @@ -157,8 +179,10 @@ def setPad2Attributes(pad2): pad2.SetTopMargin(0.06) pad2.SetBottomMargin(0.3) +#_______________________________________________________________________________ def produceRateVsEtaPlot(h, i, j, col1, col2, col3, sty1, sty2, sty3, sty4, miny, maxy, k, l, plots, ext): + """Build the rate and ratio plot on a canvas""" c = TCanvas("c","c",800,800) c.Clear() @@ -182,7 +206,9 @@ def produceRateVsEtaPlot(h, i, j, col1, col2, col3, sty1, sty2, sty3, sty4, c.SaveAs(plots + "rates_vs_eta__minpt%d__PU100__def_%ds_%ds1b_%ds1bgem%s"%(l,k,k,k,ext)) +#_______________________________________________________________________________ def produceRateVsEtaPlotsForApproval(ext, plots): + """Produce the (6) rate & ratio vs eta plots""" gStyle.SetOptStat(0) gStyle.SetTitleStyle(0) ## ##gStyle.SetPadTopMargin(0.08) @@ -207,7 +233,7 @@ def produceRateVsEtaPlotsForApproval(ext, plots): ## styles sty1 = 3345 sty2 = 3003 - sty3 = 2002 + sty3 = 1001 ## Declaration of histograms ttl = " CMS Simulation Preliminary;L1 muon candidate #eta;Trigger rate [kHz]"; @@ -248,27 +274,38 @@ def produceRateVsEtaPlotsForApproval(ext, plots): gStyle.SetTitleH(0.058) gStyle.SetTitleBorderSize(0) + """ ## ------------ +2 stubs, L1 candidate muon pt=10GeV ----------------## produceRateVsEtaPlot(h_rt_tf10_2s,h_rt_tf10_2s1b,h_rt_tf10_gpt10_2s1b, col1,col2,col3,sty1,sty2,sty3,3355,0.01,80,2,10,plots,ext) - ## ------------ +2 stubs, L1 candidate muon pt=20GeV ----------------## - produceRateVsEtaPlot(h_rt_tf20_2s,h_rt_tf20_2s1b,h_rt_tf20_gpt20_2s1b, - col1,col2,col3,sty1,sty2,sty3,3355,0.01,40,2,20,plots,ext) - ## ------------ +2 stubs, L1 candidate muon pt=30GeV ----------------## - produceRateVsEtaPlot(h_rt_tf30_2s,h_rt_tf30_2s1b,h_rt_tf30_gpt30_2s1b, - col1,col2,col3,sty1,sty2,sty3,3355,0.01,30,2,30,plots,ext) + ## ------------ +3 stubs, L1 candidate muon pt=10GeV ----------------## produceRateVsEtaPlot(h_rt_tf10_3s,h_rt_tf10_3s1b,h_rt_tf10_gpt10_3s1b, col1,col2,col3,sty1,sty2,sty3,3355,0.01,25,3,10,plots,ext) + """ + + ## ------------ +2 stubs, L1 candidate muon pt=20GeV ----------------## + produceRateVsEtaPlot(h_rt_tf20_2s,h_rt_tf20_2s1b,h_rt_tf20_gpt20_2s1b, + col1,col2,col3,sty1,sty2,sty3,3355,0.01,33,2,20,plots,ext) ## ------------ +3 stubs, L1 candidate muon pt=20GeV ----------------## produceRateVsEtaPlot(h_rt_tf20_3s,h_rt_tf20_3s1b,h_rt_tf20_gpt20_3s1b, - col1,col2,col3,sty1,sty2,sty3,3355,0.01,10,3,20,plots,ext) + col1,col2,col3,sty1,sty2,sty3,3355,0.01,8,3,20,plots,ext) + + """ + ## ------------ +2 stubs, L1 candidate muon pt=30GeV ----------------## + produceRateVsEtaPlot(h_rt_tf30_2s,h_rt_tf30_2s1b,h_rt_tf30_gpt30_2s1b, + col1,col2,col3,sty1,sty2,sty3,3355,0.01,30,2,30,plots,ext) ## ------------ +3 stubs, L1 candidate muon pt=30GeV ----------------## produceRateVsEtaPlot(h_rt_tf30_3s,h_rt_tf30_3s1b,h_rt_tf30_gpt30_3s1b, col1,col2,col3,sty1,sty2,sty3,3355,0.01, 6,3,30,plots,ext) + """ +#_______________________________________________________________________________ if __name__ == "__main__": produceRateVsEtaPlotsForApproval(".pdf", "plots/rate_vs_eta/") + produceRateVsEtaPlotsForApproval(".png", "plots/rate_vs_eta/") + produceRateVsEtaPlotsForApproval(".eps", "plots/rate_vs_eta/") + """ void gem_rate_draw() From 93d83a5af86f180a1f7f08eaf718dac886978b85 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 19 Sep 2013 19:44:53 +0200 Subject: [PATCH 131/182] remove links to very old files --- SimMuL1/scripts/drawplot_gmtrt.C | 38 +------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/SimMuL1/scripts/drawplot_gmtrt.C b/SimMuL1/scripts/drawplot_gmtrt.C index df817c8edf918..9d883790a946c 100644 --- a/SimMuL1/scripts/drawplot_gmtrt.C +++ b/SimMuL1/scripts/drawplot_gmtrt.C @@ -62,7 +62,7 @@ TH1D* result_gem_3s1b__pat8 = 0; int interactive = 1; bool do_not_print = false; -TString gem_dir = "gem/"; +TString gem_dir = "files/"; TString gem_label = "gem98"; int gNPU=100; @@ -493,16 +493,6 @@ TH1D* setHistoRatio2(TH1D* num, TH1D* denom, TString title = "", double ymin=0.4 -TH1D* getEnrichRate() -{ - f = TFile::Open("meb1_genpt4_EnrichMu_st.root"); - TTree *tr = (TTree*) f->Get("SimTrackAna/trk"); - tr->Draw("pt>>pppt()"); - -} - - - TH1D* getEffHisto(TString fname, TString hdir, TString num_name, TString den_name, int nrebin, int lcolor, int lstyle, int lwidth, TString title, double *x_range, double *y_range) { @@ -1015,32 +1005,6 @@ void drawplot_gmtrt(TString dname = "", TString vs_eta_minpt = "") // = (TH1D*)f->Get("SimMuL1/;1"); - char f_pu050_me42_re4[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; - char f_pu050_re4[200] ="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; - char f_pu050[200] ="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; - char f_pu050_me42_rev1[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rev1_rpc.root"; - char f_pu050_me42_rev2[200]="hp_minbias_3_6_2_pu050_me42_me1a_2pi_step_40_pre3_w3_rev2_rpc.root"; - - - char f_pu050_hneu_me42_re4[200]="hp_minbias_3_6_2_hnpu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; - char f_pu050_neu_me42_re4[200]="hp_minbias_3_6_2_npu050_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; - - - char f_pu200_hneu_me42_re4[200]="hp_minbias_3_6_2_hnpu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; - char f_pu200_rneu_me42_re4[200]="hp_minbias_3_6_2_rnpu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; - - char f_pu200_neu_me42_re4[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; - char f_pu200_me42_re4[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_rpc.root"; - - char f_pu200_neu_re4[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; - char f_pu200_re4[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_nome42_rpc.root"; - hp_minbias_6_0_1_POSTLS161_V12__pu100_w3_gem_pat8.root - char f_pu200_neu[200]="hp_minbias_3_6_2_npu200_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; - char f_pu200[200]="hp_minbias_3_6_2_pu200_me42_me1a_2pi_step_40_pre3_w3_nome42_nore4_rpc.root"; - - - - TString f_pu100_pat8 = gem_dir; TString f_pu100_pat8_gem = gem_dir; From 223033aa2497c4849f55ae4809cf0d83abd2f07d Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 19 Sep 2013 19:46:27 +0200 Subject: [PATCH 132/182] remove redundant variables --- .../scripts/drawplot_frankenstein_ptshiftX.C | 127 ++++++++---------- 1 file changed, 57 insertions(+), 70 deletions(-) diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C index 0c8cfa9edb405..8482f3b27b8f2 100644 --- a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C @@ -113,32 +113,24 @@ void produceRatePlot(TH1D* h, TH1D* i, TH1D* j, TH1D* m, Color_t col0, Color_t c } -TString ext = ".pdf"; -TString filesDir = "files/"; -TString plotDir = "plots/"; void drawplot_frankenstein_ptshiftX() { gROOT->ProcessLine(".L drawplot_gmtrt.C"); gROOT->ProcessLine(".L getPTHistos.C"); - //gem_dir = "gemPTX/"; - gem_dir = "plots/rate_vs_pt_shiftX/"; - gem_label = "gem98"; - - //gem_dir = "gem95/"; gem_label = "gem95"; + TString ext = ".pdf"; + TString filesDir = "files/"; + TString plotDir = "plots/rate_vs_pt_shiftX/"; - //do_not_print = true; + gem_label = "gem98"; gROOT->SetBatch(true); - //gStyle->SetStatW(0.13); //gStyle->SetStatH(0.08); gStyle->SetStatW(0.07); gStyle->SetStatH(0.06); - gStyle->SetOptStat(0); - gStyle->SetTitleStyle(0); gStyle->SetTitleAlign(13);// coord in top left gStyle->SetTitleX(0.); @@ -146,12 +138,10 @@ void drawplot_frankenstein_ptshiftX() gStyle->SetTitleW(1); gStyle->SetTitleH(0.058); gStyle->SetTitleBorderSize(0); - gStyle->SetPadLeftMargin(0.126); gStyle->SetPadRightMargin(0.04); gStyle->SetPadTopMargin(0.06); gStyle->SetPadBottomMargin(0.13); - gStyle->SetMarkerStyle(1); TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; @@ -282,13 +272,13 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-3s1b gem-3s-3s1b @@ -309,13 +299,13 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-2s1b gem-3s-2s1b @@ -336,13 +326,13 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s gem-3s-2s1b @@ -363,13 +353,13 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- def-3s-3s1b gem-3s-2s1b @@ -391,13 +381,13 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.4 def-3s gem-3s-3s1b @@ -417,13 +407,13 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b @@ -444,13 +434,13 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.1 def-3s gem-3s-3s1b @@ -470,13 +460,13 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); // --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b @@ -497,13 +487,13 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); @@ -628,13 +618,13 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-3s1b gem-3s-3s1b @@ -655,13 +645,13 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-2s1b gem-3s-2s1b @@ -682,13 +672,13 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s gem-3s-2s1b @@ -709,13 +699,13 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- def-3s-3s1b gem-3s-2s1b @@ -737,13 +727,13 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.4 def-3s gem-3s-3s1b @@ -763,13 +753,13 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b @@ -790,13 +780,13 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.1 def-3s gem-3s-3s1b @@ -816,13 +806,13 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); // --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b @@ -839,13 +829,13 @@ void drawplot_frankenstein_ptshiftX() leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); leg->Draw(); drawPULabel(); - gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); @@ -907,15 +897,15 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); @@ -937,12 +927,12 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); TFile fsave("gem_3plus_ptshiftX.root", "RECREATE"); @@ -969,7 +959,7 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat8" + ext); @@ -991,7 +981,7 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__sequential__3s__Frankenstein" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s__Frankenstein" + ext); /// ----- 2 stubs @@ -1013,12 +1003,12 @@ void drawplot_frankenstein_ptshiftX() drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); @@ -1037,11 +1027,11 @@ void drawplot_frankenstein_ptshiftX() leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); leg->Draw(); drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); hh_ratio->Draw("e1"); - gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); @@ -1057,7 +1047,7 @@ void drawplot_frankenstein_ptshiftX() leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub","f"); leg->Draw(); drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat8" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat8" + ext); ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); @@ -1075,7 +1065,7 @@ void drawplot_frankenstein_ptshiftX() leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); leg->Draw(); drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s__Frankenstein" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s__Frankenstein" + ext); /// ----- GMT current "default" single trigger @@ -1096,7 +1086,7 @@ void drawplot_frankenstein_ptshiftX() leg->AddEntry(result_def_3s1b__pat2," #geq3 with ME1/b stubs","f"); leg->Draw(); drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__sequential__GMT__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__GMT__Frankenstein_pat2" + ext); ///----- 2 & 3 stubs ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); @@ -1114,7 +1104,7 @@ void drawplot_frankenstein_ptshiftX() leg->AddEntry(result_gem_2s1b__pat2,"3+ stubs with (ME1/b + GEM) stub","f"); leg->Draw(); drawPULabel(); - gPad->Print(gem_dir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2" + ext); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2" + ext); Color_t col0 = kRed; @@ -1122,15 +1112,12 @@ void drawplot_frankenstein_ptshiftX() Color_t col2 = kAzure+2; Color_t col3 = kGreen-2; - TString plots = "plots/rate_vs_pt_shiftX/"; - TString ext = ".eps"; - produceRatePlot(result_gmtsing, result_def_2s__pat2, result_def_2s1b__pat2, result_gem_2s1b__pat2, - col0, col1, col2, col3, 0.1, 10000, "2", "loose", plots, ext); + col0, col1, col2, col3, 0.1, 10000, "2", "loose", plotDir, ext); //produceRatePlot(result_gmtsing, result_def_2s, result_def_2s1b, result_gem_2s1b, // col0, col1, col2, col3, 0.1, 10000, "2", "tight", plots, ext); produceRatePlot(result_gmtsing, result_def_3s__pat2, result_def_3s1b__pat2, result_gem_3s1b__pat2, - col0, col1, col2, col3, 0.01, 10000, "3", "loose", plots, ext); + col0, col1, col2, col3, 0.01, 10000, "3", "loose", plotDir, ext); // produceRatePlot(result_gmtsing, result_def_3s, result_def_3s1b, result_gem_3s1b, // col0, col1, col2, col3, 0.01, 10000, "3", "tight", plots, ext); From 7ecc064993f405ce22d3545d02cb0b0b1774cd86 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 19 Sep 2013 19:52:02 +0200 Subject: [PATCH 133/182] change user range --- SimMuL1/scripts/effFunctions.C | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/SimMuL1/scripts/effFunctions.C b/SimMuL1/scripts/effFunctions.C index e30b14b044f1c..342c23ca745ff 100644 --- a/SimMuL1/scripts/effFunctions.C +++ b/SimMuL1/scripts/effFunctions.C @@ -33,12 +33,12 @@ TGraphAsymmErrors* draw_geff(TTree *t, TString title, TString h_name, TString h_ TGraphAsymmErrors *eff = new TGraphAsymmErrors(num, den); if (!opt.Contains("same")) { - num->Reset(); - num->GetYaxis()->SetRangeUser(0.0,1.0); - num->SetStats(0); - num->SetTitle(title); - num->Draw(); - eff_base = num; + num->Reset(); + num->GetYaxis()->SetRangeUser(0.0,1.1); + num->SetStats(0); + num->SetTitle(title); + num->Draw(); + eff_base = num; } eff->SetLineWidth(2); eff->SetLineColor(color); @@ -46,6 +46,8 @@ TGraphAsymmErrors* draw_geff(TTree *t, TString title, TString h_name, TString h_ eff->SetMarkerStyle(marker_st); eff->SetMarkerColor(color); eff->SetMarkerSize(marker_sz); + eff->GetXaxis()->SetLabelSize(0.05); + eff->GetYaxis()->SetLabelSize(0.05); return eff; } From df606a258d3c28976b45f1108786ca184652f26a Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 19 Sep 2013 19:53:04 +0200 Subject: [PATCH 134/182] clean-up --- SimMuL1/scripts/effFunctions.py | 57 ++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 11 deletions(-) diff --git a/SimMuL1/scripts/effFunctions.py b/SimMuL1/scripts/effFunctions.py index 7fb0dcd4287d1..d72462543a6b4 100644 --- a/SimMuL1/scripts/effFunctions.py +++ b/SimMuL1/scripts/effFunctions.py @@ -1,11 +1,15 @@ -from ROOT import TH1F, TTree, TString, TCut, TGraphAsymmErrors, TEfficiency -from ROOT import kBlue,TColor,gDirectory +from ROOT import * -def draw_eff(t,title, h_name, h_bins, to_draw, denom_cut, extra_num_cut, color = kBlue, marker_st = 20): +#_______________________________________________________________________________ +def draw_eff(t,title, h_name, h_bins, to_draw, denom_cut, extra_num_cut, + color = kBlue, marker_st = 20): """Make an efficiency plot""" - t.Draw(to_draw + ">>num_" + h_name + h_bins, TCut("%s && %s" %(denom_cut.GetTitle(), extra_num_cut.GetTitle())), "goff") + ## total numerator selection cut + num_cut = TCut("%s && %s" %(denom_cut.GetTitle(), extra_num_cut.GetTitle())) + + t.Draw(to_draw + ">>num_" + h_name + h_bins, num_cut, "goff") num = TH1F(gDirectory.Get("num_" + h_name).Clone("num_" + h_name)) t.Draw(to_draw + ">>denom_" + h_name + h_bins, denom_cut, "goff") den = TH1F(gDirectory.Get("denom_" + h_name).Clone("denom_" + h_name)) @@ -24,18 +28,46 @@ def draw_eff(t,title, h_name, h_bins, to_draw, denom_cut, extra_num_cut, color = eff.SetMarkerSize(.5) return eff -def draw_geff(t, title, h_name, h_bins, to_draw, denom_cut, extra_num_cut, opt = "", color = kBlue, marker_st = 1, marker_sz = 1.): + +#_______________________________________________________________________________ +def draw_geff(t, title, h_bins, to_draw, den_cut, extra_num_cut, + opt = "", color = kBlue, marker_st = 1, marker_sz = 1.): """Make an efficiency plot""" - t.Draw(to_draw + ">>num_" + h_name + h_bins, TCut("%s && %s" %(denom_cut.GetTitle(), extra_num_cut.GetTitle())), "goff") - num = TH1F(gDirectory.Get("num_" + h_name).Clone("eff_" + h_name)) - t.Draw(to_draw + ">>denom_" + h_name + h_bins, denom_cut, "goff") - den = TH1F(gDirectory.Get("denom_" + h_name).Clone("denom_" + h_name)) + ## total numerator selection cut + ## the extra brackets around the extra_num_cut are necessary !! + num_cut = TCut("%s && (%s)" %(den_cut.GetTitle(), extra_num_cut.GetTitle())) - eff = TGraphAsymmErrors(num, den) + ## PyROOT works a little different than ROOT when you are plotting + ## histograms directly from tree. Hence, this work-around + nBins = int(h_bins[1:-1].split(',')[0]) + minBin = int(h_bins[1:-1].split(',')[1]) + maxBin = int(h_bins[1:-1].split(',')[2]) + num = TH1F("num", "", nBins, minBin, maxBin) + den = TH1F("den", "", nBins, minBin, maxBin) + + t.Draw(to_draw + ">>num", num_cut, "goff") + t.Draw(to_draw + ">>den", den_cut, "goff") + + doConsistencyCheck = False + if doConsistencyCheck: + for i in range(0,nBins): + print i, num.GetBinContent(i), den.GetBinContent(i) + if num.GetBinContent(i) > den.GetBinContent(i): + print ">>>Error: passed entries > total entries" + + eff = TEfficiency(num, den) + + """ + eff = TEfficiency(num, den) + eff.Draw() + eff.Paint("") + eff = eff.GetPaintedGraph() + """ + if not "same" in opt: num.Reset() - num.GetYaxis().SetRangeUser(0.,1.05) + num.GetYaxis().SetRangeUser(0.0,1.1) num.SetStats(0) num.SetTitle(title) num.Draw() @@ -46,7 +78,10 @@ def draw_geff(t, title, h_name, h_bins, to_draw, denom_cut, extra_num_cut, opt = eff.SetMarkerStyle(marker_st) eff.SetMarkerColor(color) eff.SetMarkerSize(marker_sz) + + SetOwnership(eff, False) return eff + From 1e199c45453123e0b83101ebaaecc5c18f5e047e Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 24 Sep 2013 05:31:21 +0200 Subject: [PATCH 135/182] Added option to write Even(close) or Close(even) --- SimMuL1/scripts/plotGEMCSCdPhi.py | 50 ++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/SimMuL1/scripts/plotGEMCSCdPhi.py b/SimMuL1/scripts/plotGEMCSCdPhi.py index 311f062c01755..8574c97d34bc1 100644 --- a/SimMuL1/scripts/plotGEMCSCdPhi.py +++ b/SimMuL1/scripts/plotGEMCSCdPhi.py @@ -35,7 +35,7 @@ def getTree(fileName): return tree -def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): +def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png", useReverseOrdering = False): """Plot the GEM-CSC bending angles""" t = getTree("%sgem_csc_delta_pt5_pad4.root"%(filesDir)) @@ -65,16 +65,22 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): gStyle.SetMarkerStyle(1) #setTDRStyle() - + if oddEven == "even": ok_pad_lct = ok_pad2_lct2 var = "dphi_pad_even" - closeFar = "Close" + if useReverseOrdering: + closeFar = 'Even ("close")' + else: + closeFar = '"Close" (even)' else: ok_pad_lct = ok_pad1_lct1 var = "dphi_pad_odd" - closeFar = "Far" - + if useReverseOrdering: + closeFar = 'Odd ("far")' + else: + closeFar = '"Far" (odd)' + t.Draw("TMath::Abs(%s)>>dphi_pt5"%(var) , ok_pad_lct) t1.Draw("TMath::Abs(%s)>>dphi_pt20"%(var) , ok_pad_lct) @@ -86,7 +92,7 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): dphi_pt20.SetLineWidth(2) dphi_pt20.GetXaxis().SetTitle("#Delta#phi(GEM,CSC) [rad]") dphi_pt20.GetYaxis().SetTitle("Arbitray units") - dphi_pt20.SetTitle(" GEM-CSC Bending Angle CMS Simulation Preliminary") + dphi_pt20.SetTitle(" GEM-CSC Bending Angle CMS Phase-2 Simulation Preliminary") dphi_pt20.GetXaxis().SetLabelSize(0.05) dphi_pt20.GetYaxis().SetLabelSize(0.05) dphi_pt20.Draw() @@ -117,25 +123,35 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png"): tex3.Draw("same") ## hardcore nitpicking over here! - if closeFar == "Close": - xpos = 0.22##0.61 + if oddEven == "even": + xpos = 0.2##0.61 else: xpos = 0.25##0.64 - tex = TLatex(xpos,.85,'"%s" chamber pairs'%(closeFar)) + tex = TLatex(xpos,.85,"%s chamber pairs"%(closeFar)) tex.Draw("same") tex.SetTextSize(0.06) tex.SetNDC() - c.SaveAs("%sGEMCSCdPhi_%s_chambers%s"%(plotDir, oddEven, ext)) + if useReverseOrdering: + c.SaveAs("%sGEMCSCdPhi_%s_chambers_reverse%s"%(plotDir, oddEven, ext)) + else: + c.SaveAs("%sGEMCSCdPhi_%s_chambers%s"%(plotDir, oddEven, ext)) -if __name__ == "__main__": - plotGEMCSCdPhi("files/", "plots/bending/", "even", ".eps") - plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".eps") - plotGEMCSCdPhi("files/", "plots/bending/", "even", ".pdf") - plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".pdf") - plotGEMCSCdPhi("files/", "plots/bending/", "even", ".png") - plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".png") +if __name__ == "__main__": + plotGEMCSCdPhi("files/", "plots/bending/", "even", ".eps", False) + plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".eps", False) + plotGEMCSCdPhi("files/", "plots/bending/", "even", ".pdf", False) + plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".pdf", False) + plotGEMCSCdPhi("files/", "plots/bending/", "even", ".png", False) + plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".png", False) + + plotGEMCSCdPhi("files/", "plots/bending/", "even", ".eps", True) + plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".eps", True) + plotGEMCSCdPhi("files/", "plots/bending/", "even", ".pdf", True) + plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".pdf", True) + plotGEMCSCdPhi("files/", "plots/bending/", "even", ".png", True) + plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".png", True) From 651917a03744a730b8d2fa2fda10be50fd3e5f88 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 26 Sep 2013 14:17:41 +0200 Subject: [PATCH 136/182] adding gemRecHit label --- GEMValidation/python/simTrackMatching_cfi.py | 4 +++- GEMValidation/test/runGEMDigiAnalyzer_cfg.py | 1 + GEMValidation/test/runGEMSimHitAnalyzer_cfg.py | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/GEMValidation/python/simTrackMatching_cfi.py b/GEMValidation/python/simTrackMatching_cfi.py index 26128ced9b3f6..74ca0df0b21cf 100644 --- a/GEMValidation/python/simTrackMatching_cfi.py +++ b/GEMValidation/python/simTrackMatching_cfi.py @@ -38,5 +38,7 @@ minBXALCT = cms.untracked.int32(3), maxBXALCT = cms.untracked.int32(8), minBXLCT = cms.untracked.int32(3), - maxBXLCT = cms.untracked.int32(8) + maxBXLCT = cms.untracked.int32(8), + ## GEM RecHit + gemRecHitInput = cms.untracked.InputTag("gemRecHits") ) diff --git a/GEMValidation/test/runGEMDigiAnalyzer_cfg.py b/GEMValidation/test/runGEMDigiAnalyzer_cfg.py index 6439267dc8389..1567441e99907 100644 --- a/GEMValidation/test/runGEMDigiAnalyzer_cfg.py +++ b/GEMValidation/test/runGEMDigiAnalyzer_cfg.py @@ -25,6 +25,7 @@ process.GEMDigiAnalyzer.simTrackMatching.cscCLCTInput = "" process.GEMDigiAnalyzer.simTrackMatching.cscALCTInput = "" process.GEMDigiAnalyzer.simTrackMatching.cscLCTInput = "" +process.GEMSimHitAnalyzer.simTrackMatching.gemRecHitInput = "" process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) diff --git a/GEMValidation/test/runGEMSimHitAnalyzer_cfg.py b/GEMValidation/test/runGEMSimHitAnalyzer_cfg.py index 64605a9fd999d..61840208f8a7d 100644 --- a/GEMValidation/test/runGEMSimHitAnalyzer_cfg.py +++ b/GEMValidation/test/runGEMSimHitAnalyzer_cfg.py @@ -28,7 +28,8 @@ process.GEMSimHitAnalyzer.simTrackMatching.cscCLCTInput = "" process.GEMSimHitAnalyzer.simTrackMatching.cscALCTInput = "" process.GEMSimHitAnalyzer.simTrackMatching.cscLCTInput = "" - +process.GEMSimHitAnalyzer.simTrackMatching.gemRecHitInput = "" + process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) ) process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) From f5b309f111747cadc6121dfae4c1b06acb9d2256 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 26 Sep 2013 23:10:47 +0200 Subject: [PATCH 137/182] MinBias_TuneZ2star_14TeV_pythia6_cff.py --- .../MinBias_TuneZ2star_14TeV_pythia6_cff.py | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 GEMPhysics/python/MinBias_TuneZ2star_14TeV_pythia6_cff.py diff --git a/GEMPhysics/python/MinBias_TuneZ2star_14TeV_pythia6_cff.py b/GEMPhysics/python/MinBias_TuneZ2star_14TeV_pythia6_cff.py new file mode 100644 index 0000000000000..bd5f1dfba7b20 --- /dev/null +++ b/GEMPhysics/python/MinBias_TuneZ2star_14TeV_pythia6_cff.py @@ -0,0 +1,46 @@ +import FWCore.ParameterSet.Config as cms + +generator = cms.EDFilter("Pythia6GeneratorFilter", + pythiaPylistVerbosity = cms.untracked.int32(1), + filterEfficiency = cms.untracked.double(1.0), + pythiaHepMCVerbosity = cms.untracked.bool(False), + comEnergy = cms.double(14000.0), + crossSection = cms.untracked.double(79300000000.0), + maxEventsToPrint = cms.untracked.int32(0), + PythiaParameters = cms.PSet( + pythiaUESettings = cms.vstring('MSTU(21)=1 ! Check on possible errors during program execution', + 'MSTJ(22)=2 ! Decay those unstable particles', + 'PARJ(71)=10 . ! for which ctau 10 mm', + 'MSTP(33)=0 ! no K factors in hard cross sections', + 'MSTP(2)=1 ! which order running alphaS', + 'MSTP(51)=10042 ! structure function chosen (external PDF CTEQ6L1)', + 'MSTP(52)=2 ! work with LHAPDF', + 'PARP(82)=1.921 ! pt cutoff for multiparton interactions', + 'PARP(89)=1800. ! sqrts for which PARP82 is set', + 'PARP(90)=0.227 ! Multiple interactions: rescaling power', + 'MSTP(95)=6 ! CR (color reconnection parameters)', + 'PARP(77)=1.016 ! CR', + 'PARP(78)=0.538 ! CR', + 'PARP(80)=0.1 ! Prob. colored parton from BBR', + 'PARP(83)=0.356 ! Multiple interactions: matter distribution parameter', + 'PARP(84)=0.651 ! Multiple interactions: matter distribution parameter', + 'PARP(62)=1.025 ! ISR cutoff', + 'MSTP(91)=1 ! Gaussian primordial kT', + 'PARP(93)=10.0 ! primordial kT-max', + 'MSTP(81)=21 ! multiple parton interactions 1 is Pythia default', + 'MSTP(82)=4 ! Defines the multi-parton model'), + processParameters = cms.vstring('MSEL=0 ! User defined processes', + 'MSUB(11)=1 ! Min bias process', + 'MSUB(12)=1 ! Min bias process', + 'MSUB(13)=1 ! Min bias process', + 'MSUB(28)=1 ! Min bias process', + 'MSUB(53)=1 ! Min bias process', + 'MSUB(68)=1 ! Min bias process', + 'MSUB(92)=1 ! Min bias process, single diffractive', + 'MSUB(93)=1 ! Min bias process, single diffractive', + 'MSUB(94)=1 ! Min bias process, double diffractive', + 'MSUB(95)=1 ! Min bias process'), + parameterSets = cms.vstring('pythiaUESettings', + 'processParameters') + ) +) From dc91b5336971450f115e130661a98b3304c82dbd Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 30 Sep 2013 12:04:34 +0200 Subject: [PATCH 138/182] Delete obsolete GEMDIGI producer modules --- .../run_nopileup_GEMCSCDigi_CSCStubs_cfg.py | 113 --------------- .../run_pileup_GEMCSCDigi_CSCStubs_cfg.py | 129 ------------------ 2 files changed, 242 deletions(-) delete mode 100644 GEMValidation/test/run_nopileup_GEMCSCDigi_CSCStubs_cfg.py delete mode 100644 GEMValidation/test/run_pileup_GEMCSCDigi_CSCStubs_cfg.py diff --git a/GEMValidation/test/run_nopileup_GEMCSCDigi_CSCStubs_cfg.py b/GEMValidation/test/run_nopileup_GEMCSCDigi_CSCStubs_cfg.py deleted file mode 100644 index a8948620e0fb2..0000000000000 --- a/GEMValidation/test/run_nopileup_GEMCSCDigi_CSCStubs_cfg.py +++ /dev/null @@ -1,113 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -process = cms.Process("GEMDIGI") - -process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(20) ) - -#process.Timing = cms.Service("Timing") -process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) - - -process.load('Configuration.StandardSequences.Services_cff') -process.load('FWCore.MessageService.MessageLogger_cfi') -process.load('Configuration.EventContent.EventContent_cff') -process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.StandardSequences.MagneticField_38T_cff') -process.load('Configuration.StandardSequences.Digi_cff') -process.load('Configuration.StandardSequences.EndOfProcess_cff') - -process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMXML_cfi') -#process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMr08v01XML_cfi') -#process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMr10v01XML_cfi') -process.load('Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi') -process.load('Geometry.CommonDetUnit.globalTrackingGeometry_cfi') -process.load('Geometry.MuonNumbering.muonNumberingInitialization_cfi') -process.load('Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometryDB_cff') -process.load('Geometry.DTGeometryBuilder.idealForDigiDtGeometryDB_cff') -process.load('Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff') -process.load('Geometry.GEMGeometry.gemGeometry_cfi') - -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.GlobalTag.globaltag = 'POSTLS161_V12::All' -#process.GlobalTag.globaltag = 'DESIGN60_V5::All' - - -# GEM digitizer -process.load('SimMuon.GEMDigitizer.muonGEMDigis_cfi') - -# GEM-CSC trigger pad digi producer -process.load('SimMuon.GEMDigitizer.muonGEMCSCPadDigis_cfi') - - -# customization of the process.pdigi sequence to add the GEM digitizer -from SimMuon.GEMDigitizer.customizeGEMDigi import * -#process = customize_digi_addGEM(process) # run all detectors digi -process = customize_digi_addGEM_muon_only(process) # only muon+GEM digi -#process = customize_digi_addGEM_gem_only(process) # only GEM digi - - -# upgrade CSC customizations -from SLHCUpgradeSimulations.Configuration.muonCustoms import customise_csc_geom_cond_digi -process = customise_csc_geom_cond_digi(process) - -# unganged local stubs emilator: -process.load('L1Trigger.CSCTriggerPrimitives.cscTriggerPrimitiveDigisPostLS1_cfi') -#from L1Trigger.CSCTriggerPrimitives.cscTriggerPrimitiveDigisPostLS1_cfi import cscTriggerPrimitiveDigisPostLS1 -process.simCscTriggerPrimitiveDigis = process.cscTriggerPrimitiveDigisPostLS1 - - - - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - '/store/user/lpcgem/willhf/willhf/muonGun_50k_pT20_lpcgem/muonGun_50k_pT20_lpcgem/c1acdeba4dd656a272c6606974911938/out_sim_4_1_KHY.root' - ) -) - - -process.output = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string( - 'file:SingleMuPt20_pu100_DIGI_.root' - ), - outputCommands = cms.untracked.vstring( - 'keep *_*_*_*', - # drop all CF stuff - 'drop *_mix_*_*', - # drop tracker simhits - 'drop PSimHits_*_Tracker*_*', - # drop calorimetry stuff - 'drop PCaloHits_*_*_*', - # clean up simhits from other detectors - 'drop PSimHits_*_Totem*_*', - 'drop PSimHits_*_FP420*_*', - 'drop PSimHits_*_BSC*_*', - # drop some not useful muon digis and links - 'drop *_*_MuonCSCStripDigi_*', - 'drop *_*_MuonCSCStripDigiSimLinks_*', - #'drop *SimLink*_*_*_*', - 'drop *RandomEngineStates_*_*_*', - 'drop *_randomEngineStateProducer_*_*' - ), - SelectEvents = cms.untracked.PSet( - SelectEvents = cms.vstring('digi_step') - ) -) - - - -#process.contentAna = cms.EDAnalyzer("EventContentAnalyzer") - - -process.digi_step = cms.Path(process.pdigi) -process.cscL1stubs_step = cms.Path(process.simCscTriggerPrimitiveDigis) -process.endjob_step = cms.Path(process.endOfProcess) -process.out_step = cms.EndPath(process.output) - - -process.schedule = cms.Schedule( - process.digi_step, - process.cscL1stubs_step, - process.endjob_step, - process.out_step -) - diff --git a/GEMValidation/test/run_pileup_GEMCSCDigi_CSCStubs_cfg.py b/GEMValidation/test/run_pileup_GEMCSCDigi_CSCStubs_cfg.py deleted file mode 100644 index 599e4ade9def0..0000000000000 --- a/GEMValidation/test/run_pileup_GEMCSCDigi_CSCStubs_cfg.py +++ /dev/null @@ -1,129 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -process = cms.Process("GEMDIGI") - -process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(20) ) - -#process.Timing = cms.Service("Timing") -process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) - - -process.load('Configuration.StandardSequences.Services_cff') -process.load('FWCore.MessageService.MessageLogger_cfi') -process.load('Configuration.EventContent.EventContent_cff') -process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.StandardSequences.MagneticField_38T_cff') -process.load('Configuration.StandardSequences.Digi_cff') -process.load('Configuration.StandardSequences.EndOfProcess_cff') - -process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMXML_cfi') -#process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMr08v01XML_cfi') -#process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMr10v01XML_cfi') -process.load('Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi') -process.load('Geometry.CommonDetUnit.globalTrackingGeometry_cfi') -process.load('Geometry.MuonNumbering.muonNumberingInitialization_cfi') -process.load('Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometryDB_cff') -process.load('Geometry.DTGeometryBuilder.idealForDigiDtGeometryDB_cff') -process.load('Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff') -process.load('Geometry.GEMGeometry.gemGeometry_cfi') - -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.GlobalTag.globaltag = 'POSTLS161_V12::All' -#process.GlobalTag.globaltag = 'DESIGN60_V5::All' - - -# GEM digitizer -process.load('SimMuon.GEMDigitizer.muonGEMDigis_cfi') - -# GEM-CSC trigger pad digi producer -process.load('SimMuon.GEMDigitizer.muonGEMCSCPadDigis_cfi') - - -# customization of the process.pdigi sequence to add the GEM digitizer -from SimMuon.GEMDigitizer.customizeGEMDigi import * -#process = customize_digi_addGEM(process) # run all detectors digi -process = customize_digi_addGEM_muon_only(process) # only muon+GEM digi -#process = customize_digi_addGEM_gem_only(process) # only GEM digi - - -# upgrade CSC customizations -from SLHCUpgradeSimulations.Configuration.muonCustoms import customise_csc_geom_cond_digi -process = customise_csc_geom_cond_digi(process) - -# unganged local stubs emilator: -process.load('L1Trigger.CSCTriggerPrimitives.cscTriggerPrimitiveDigisPostLS1_cfi') -#from L1Trigger.CSCTriggerPrimitives.cscTriggerPrimitiveDigisPostLS1_cfi import cscTriggerPrimitiveDigisPostLS1 -process.simCscTriggerPrimitiveDigis = process.cscTriggerPrimitiveDigisPostLS1 - - -# list of MinBias files for pileup has to be provided -ff = open('filelist_pileup.txt', "r") -pu_files = ff.read().split('\n') -ff.close() -pu_files = filter(lambda x: x.endswith('.root'), pu_files) - -process.mix.input = cms.SecSource("PoolSource", - nbPileupEvents = cms.PSet( - averageNumber = cms.double(50) #### THIS IS AVERAGE PILEUP NUMBER THAT YOU MIGHT WANT TO CHANGE - ), - type = cms.string('poisson'), - sequential = cms.untracked.bool(False), - fileNames = cms.untracked.vstring(*pu_files) -) - - - - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - '/store/user/lpcgem/willhf/willhf/muonGun_50k_pT20_lpcgem/muonGun_50k_pT20_lpcgem/c1acdeba4dd656a272c6606974911938/out_sim_4_1_KHY.root' - ) -) - - -process.output = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string( - 'file:SingleMuPt20_pu100_DIGI_.root' - ), - outputCommands = cms.untracked.vstring( - 'keep *_*_*_*', - # drop all CF stuff - 'drop *_mix_*_*', - # drop tracker simhits - 'drop PSimHits_*_Tracker*_*', - # drop calorimetry stuff - 'drop PCaloHits_*_*_*', - # clean up simhits from other detectors - 'drop PSimHits_*_Totem*_*', - 'drop PSimHits_*_FP420*_*', - 'drop PSimHits_*_BSC*_*', - # drop some not useful muon digis and links - 'drop *_*_MuonCSCStripDigi_*', - 'drop *_*_MuonCSCStripDigiSimLinks_*', - #'drop *SimLink*_*_*_*', - 'drop *RandomEngineStates_*_*_*', - 'drop *_randomEngineStateProducer_*_*' - ), - SelectEvents = cms.untracked.PSet( - SelectEvents = cms.vstring('digi_step') - ) -) - - - -#process.contentAna = cms.EDAnalyzer("EventContentAnalyzer") - - -process.digi_step = cms.Path(process.pdigi) -process.cscL1stubs_step = cms.Path(process.simCscTriggerPrimitiveDigis) -process.endjob_step = cms.Path(process.endOfProcess) -process.out_step = cms.EndPath(process.output) - - -process.schedule = cms.Schedule( - process.digi_step, - process.cscL1stubs_step, - process.endjob_step, - process.out_step -) - From 1eb4dd9f417fa42eba9fa8b1fc94ef3257e793e4 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 30 Sep 2013 12:05:45 +0200 Subject: [PATCH 139/182] Move W to mu nu fragment to GEMPhysics --- GEMPhysics/python/WtoMuNu_14TeV_cff.py | 34 +++++ .../python/WtoMuNu_14TeV_cfi_GEN_SIM.py | 128 ------------------ 2 files changed, 34 insertions(+), 128 deletions(-) create mode 100644 GEMPhysics/python/WtoMuNu_14TeV_cff.py delete mode 100644 GEMValidation/python/WtoMuNu_14TeV_cfi_GEN_SIM.py diff --git a/GEMPhysics/python/WtoMuNu_14TeV_cff.py b/GEMPhysics/python/WtoMuNu_14TeV_cff.py new file mode 100644 index 0000000000000..4b40cae95ac03 --- /dev/null +++ b/GEMPhysics/python/WtoMuNu_14TeV_cff.py @@ -0,0 +1,34 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Generator.PythiaUEZ2starSettings_cfi import * + +generator = cms.EDFilter("Pythia6GeneratorFilter", + pythiaPylistVerbosity = cms.untracked.int32(0), + filterEfficiency = cms.untracked.double(1.0), + pythiaHepMCVerbosity = cms.untracked.bool(False), + crossSection = cms.untracked.double(1774.0), + comEnergy = cms.double(14000.0), + maxEventsToPrint = cms.untracked.int32(0), + PythiaParameters = cms.PSet( + pythiaUESettingsBlock, + processParameters = cms.vstring( + 'MSEL = 0 !User defined processes', + 'MSUB(2) = 1 !W production', + 'MDME(190,1) = 0 !W decay into dbar u', + 'MDME(191,1) = 0 !W decay into dbar c', + 'MDME(192,1) = 0 !W decay into dbar t', + 'MDME(194,1) = 0 !W decay into sbar u', + 'MDME(195,1) = 0 !W decay into sbar c', + 'MDME(196,1) = 0 !W decay into sbar t', + 'MDME(198,1) = 0 !W decay into bbar u', + 'MDME(199,1) = 0 !W decay into bbar c', + 'MDME(200,1) = 0 !W decay into bbar t', + 'MDME(206,1) = 0 !W decay into e+ nu_e', + 'MDME(207,1) = 1 !W decay into mu+ nu_mu', + 'MDME(208,1) = 0 !W decay into tau+ nu_tau'), + # This is a vector of ParameterSet names to be read, in this order + parameterSets = cms.vstring('pythiaUESettings', + 'processParameters' + ), + ) +) diff --git a/GEMValidation/python/WtoMuNu_14TeV_cfi_GEN_SIM.py b/GEMValidation/python/WtoMuNu_14TeV_cfi_GEN_SIM.py deleted file mode 100644 index 78b7fd8f575d8..0000000000000 --- a/GEMValidation/python/WtoMuNu_14TeV_cfi_GEN_SIM.py +++ /dev/null @@ -1,128 +0,0 @@ -# Auto generated configuration file -# using: -# Revision: 1.400 -# Source: /local/reps/CMSSW/CMSSW/Configuration/PyReleaseValidation/python/ConfigBuilder.py,v -# with command line options: WtoMuNu_14TeV_cfi.py -s GEN,SIM --conditions POSTLS161_V12::All --geometry Geometry/GEMGeometry/cmsExtendedGeometryPostLS1plusGEMXML_cfi --datatier GEN-SIM --eventcontent FEVTDEBUG -n 200 --no_exec --fileout out_sim.root --evt_type WtoMuNu_14TeV_cfi.py -import FWCore.ParameterSet.Config as cms - -process = cms.Process('SIM') - -# import of standard configurations -process.load('Configuration.StandardSequences.Services_cff') -process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') -process.load('FWCore.MessageService.MessageLogger_cfi') -process.load('Configuration.EventContent.EventContent_cff') -process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMXML_cfi') -process.load('Configuration.StandardSequences.MagneticField_38T_cff') -process.load('Configuration.StandardSequences.Generator_cff') -process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic8TeVCollision_cfi') -process.load('GeneratorInterface.Core.genFilterSummary_cff') -process.load('Configuration.StandardSequences.SimIdeal_cff') -process.load('Configuration.StandardSequences.EndOfProcess_cff') -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(10000) -) - -# Input source -process.source = cms.Source("EmptySource") - -process.options = cms.untracked.PSet( - -) - -# Production Info -process.configurationMetadata = cms.untracked.PSet( - version = cms.untracked.string('$Revision: 1.400 $'), - annotation = cms.untracked.string('WtoMuNu_14TeV_cfi.py nevts:200'), - name = cms.untracked.string('PyReleaseValidation') -) - -# Output definition - -process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", - splitLevel = cms.untracked.int32(0), - eventAutoFlushCompressedSize = cms.untracked.int32(5242880), - outputCommands = process.FEVTDEBUGEventContent.outputCommands, - fileName = cms.untracked.string('out_sim.root'), - dataset = cms.untracked.PSet( - filterName = cms.untracked.string(''), - dataTier = cms.untracked.string('GEN-SIM') - ), - SelectEvents = cms.untracked.PSet( - SelectEvents = cms.vstring('generation_step') - ) -) - -# Additional output definition - -# Other statements -process.genstepfilter.triggerConditions=cms.vstring("generation_step") -from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'POSTLS161_V12::All', '') - -from Configuration.Generator.PythiaUEZ2starSettings_cfi import * -process.generator = cms.EDFilter("Pythia6GeneratorFilter", - pythiaPylistVerbosity = cms.untracked.int32(0), - filterEfficiency = cms.untracked.double(1.0), - pythiaHepMCVerbosity = cms.untracked.bool(False), - crossSection = cms.untracked.double(1774.0), - comEnergy = cms.double(14000.0), - maxEventsToPrint = cms.untracked.int32(0), - PythiaParameters = cms.PSet( - pythiaUESettingsBlock, - processParameters = cms.vstring( - 'MSEL = 0 !User defined processes', - 'MSUB(2) = 1 !W production', - 'MDME(190,1) = 0 !W decay into dbar u', - 'MDME(191,1) = 0 !W decay into dbar c', - 'MDME(192,1) = 0 !W decay into dbar t', - 'MDME(194,1) = 0 !W decay into sbar u', - 'MDME(195,1) = 0 !W decay into sbar c', - 'MDME(196,1) = 0 !W decay into sbar t', - 'MDME(198,1) = 0 !W decay into bbar u', - 'MDME(199,1) = 0 !W decay into bbar c', - 'MDME(200,1) = 0 !W decay into bbar t', - 'MDME(206,1) = 0 !W decay into e+ nu_e', - 'MDME(207,1) = 1 !W decay into mu+ nu_mu', - 'MDME(208,1) = 0 !W decay into tau+ nu_tau'), - # This is a vector of ParameterSet names to be read, in this order - parameterSets = cms.vstring('pythiaUESettings', - 'processParameters' - ), - ) -) - -# select generated muons and antimuons -process.genMuons = cms.EDFilter("PdgIdCandViewSelector", - src = cms.InputTag("genParticles"), - pdgId = cms.vint32( 13, -13 ) -) - -# filter by applying cuts to these generated muons -process.genMuonsGEM = cms.EDFilter("CandViewSelector", - src = cms.InputTag("genMuons"), - cut = cms.string( "abs(eta)<2.4 & abs(eta)>0.9" ), - filter = cms.bool(True) -) - -process.gen_mu_select = cms.Sequence(process.genMuons * process.genMuonsGEM) - -# Path and EndPath definitions -process.generation_step = cms.Path(process.pgen * process.gen_mu_select) -process.simulation_step = cms.Path(process.gen_mu_select * process.psim) -process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) -process.endjob_step = cms.EndPath(process.endOfProcess) -process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) - -process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) - -# Schedule definition -process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.endjob_step,process.FEVTDEBUGoutput_step) - -for path in process.paths: - getattr(process,path)._seq = process.generator * getattr(process,path)._seq - From 4212d607f077e6b8c73cb0473e416debdd77791b Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 30 Sep 2013 12:06:12 +0200 Subject: [PATCH 140/182] Generator fragment for PU studies --- GEMPhysics/python/SingleNuPt5-40_cff.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 GEMPhysics/python/SingleNuPt5-40_cff.py diff --git a/GEMPhysics/python/SingleNuPt5-40_cff.py b/GEMPhysics/python/SingleNuPt5-40_cff.py new file mode 100644 index 0000000000000..386759ca24a41 --- /dev/null +++ b/GEMPhysics/python/SingleNuPt5-40_cff.py @@ -0,0 +1,17 @@ +import FWCore.ParameterSet.Config as cms + +generator = cms.EDProducer("FlatRandomPtGunProducer", + PGunParameters = cms.PSet( + MaxPt = cms.double(40.01), + MinPt = cms.double(4.99), + PartID = cms.vint32(-12,-14,-16), + MaxEta = cms.double(2.2), + MaxPhi = cms.double(3.14159265359), + MinEta = cms.double(-2.2), + MinPhi = cms.double(-3.14159265359) + ), + Verbosity = cms.untracked.int32(0), + psethack = cms.string('single mu pt 5-40 forward'), + AddAntiParticle = cms.bool(True), + firstRun = cms.untracked.uint32(1) +) From ae2f04eae0db48892a118544acb1b8c49f2a71bd Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 30 Sep 2013 05:10:49 -0500 Subject: [PATCH 141/182] Remove obsolete files --- GEMValidation/bin/BuildFile.xml | 12 - .../bin/produceDigiValidationPlots.C | 523 ------------------ .../bin/produceDigiValidationPlots_cfg.py | 8 - .../bin/produceRecHitValidationPlots.C | 280 ---------- .../bin/produceRecHitValidationPlots_cfg.py | 11 - .../bin/produceSimHitValidationPlots.C | 460 --------------- .../bin/produceSimHitValidationPlots_cfg.py | 12 - 7 files changed, 1306 deletions(-) delete mode 100644 GEMValidation/bin/BuildFile.xml delete mode 100644 GEMValidation/bin/produceDigiValidationPlots.C delete mode 100644 GEMValidation/bin/produceDigiValidationPlots_cfg.py delete mode 100644 GEMValidation/bin/produceRecHitValidationPlots.C delete mode 100644 GEMValidation/bin/produceRecHitValidationPlots_cfg.py delete mode 100644 GEMValidation/bin/produceSimHitValidationPlots.C delete mode 100644 GEMValidation/bin/produceSimHitValidationPlots_cfg.py diff --git a/GEMValidation/bin/BuildFile.xml b/GEMValidation/bin/BuildFile.xml deleted file mode 100644 index a0cd4fe3eb749..0000000000000 --- a/GEMValidation/bin/BuildFile.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/GEMValidation/bin/produceDigiValidationPlots.C b/GEMValidation/bin/produceDigiValidationPlots.C deleted file mode 100644 index 6486719077ed3..0000000000000 --- a/GEMValidation/bin/produceDigiValidationPlots.C +++ /dev/null @@ -1,523 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "boost/lexical_cast.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "FWCore/FWLite/interface/AutoLibraryLoader.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/PythonParameterSet/interface/MakeParameterSets.h" - -void draw_geff(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut denom_cut, TCut extra_num_cut, TString opt = "", int color = kBlue, int marker_st = 1, float marker_sz = 1.); -void draw_occ(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut cut, TString opt = ""); -void draw_1D(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut cut, TString opt = ""); -void draw_bx(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut cut, TString opt = ""); - -int main( int argc, char * argv[] ) -{ - int returnStatus_( 0 ); - - // Load libraries - gSystem->Load( "libFWCoreFWLite" ); - AutoLibraryLoader::enable(); - - // Check configuration file - if ( argc < 2 ) { - std::cout << argv[ 0 ] << " --> Usage:" << std::endl - << " " << argv[ 0 ] << " [CONFIG_FILE.py]" << std::endl; - returnStatus_ += 0x1; - return returnStatus_; - } - - if ( ! edm::readPSetsFrom( argv[ 1 ] )->existsAs< edm::ParameterSet >( "process" ) ) { - std::cout << argv[ 0 ] << " --> ERROR:" << std::endl - << " cms.PSet 'process' missing in " << argv[ 1 ] << std::endl; - returnStatus_ += 0x2; - return returnStatus_; - } - - const edm::ParameterSet & process_( edm::readPSetsFrom( argv[ 1 ] )->getParameter< edm::ParameterSet >( "process" ) ); - const TString inputFile_( process_.getParameter< std::string >( "inputFile" ) ); - const TString targetDir_( process_.getParameter< std::string >( "targetDir" ) ); - const TString ext_( process_.getParameter< std::string >( "ext" ) ); - const unsigned npads_(process_.getParameter< unsigned >( "npads" )); - const TString npadss(boost::lexical_cast< std::string >(npads_)); - - // Constants - const TString analyzer_("GEMDigiAnalyzer"); - const TString digis_("GEMDigiTree"); - const TString pads_("GEMCSCPadDigiTree"); - const TString copads_("GEMCSCCoPadDigiTree"); - const TString tracks_("TrackTree"); - const TCut rm1("region==-1"); - const TCut rp1("region==1"); - const TCut l1("layer==1"); - const TCut l2("layer==2"); - - // Open input file - std::cout << std::endl - << argv[ 0 ] << " --> INFO:" << std::endl - << " using input file '" << inputFile_ << "'" << std::endl; - - TFile * fileIn_( TFile::Open( inputFile_, "UPDATE" ) ); - if ( ! fileIn_ ) { - std::cout << argv[ 0 ] << " --> ERROR:" << std::endl - << " input file '" << inputFile_ << "' missing" << std::endl; - returnStatus_ += 0x10; - return returnStatus_; - } - - TDirectory * dirAna_( (TDirectory *) fileIn_->Get( analyzer_ ) ); - if ( ! dirAna_ ) { - std::cout << argv[ 0 ] << " --> WARNING:" << std::endl - << " simhits '" << analyzer_ << "' does not exist in input file" << std::endl; - returnStatus_ += 0x20; - return returnStatus_; - } - - TTree * treeDigis_( (TTree *) dirAna_->Get( digis_ ) ); - if ( ! treeDigis_ ) { - std::cout << argv[ 0 ] << " --> WARNING:" << std::endl - << " digis '" << digis_ << "' does not exist in directory" << std::endl; - returnStatus_ += 0x30; - return returnStatus_; - } - - /// occupancy plots - draw_occ(targetDir_, "strip_dg_xy_rm1_l1", ext_, treeDigis_, "Digi occupancy: region-1, layer1; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", rm1 && l1, "COLZ"); - draw_occ(targetDir_, "strip_dg_xy_rm1_l2", ext_, treeDigis_, "Digi occupancy: region-1, layer2; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", rm1 && l2, "COLZ"); - draw_occ(targetDir_, "strip_dg_xy_rp1_l1", ext_, treeDigis_, "Digi occupancy: region1, layer1; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", rp1 && l1, "COLZ"); - draw_occ(targetDir_, "strip_dg_xy_rp1_l2", ext_, treeDigis_, "Digi occupancy: region1, layer2; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", rp1 && l2, "COLZ"); - - draw_occ(targetDir_, "strip_dg_zr_rm1", ext_, treeDigis_, "Digi occupancy: region-1; globalZ [cm]; globalR [cm]", - "h_", "(200,-573,-564,55,130,240)", "g_r:g_z", rm1, "COLZ"); - draw_occ(targetDir_, "strip_dg_zr_rp1", ext_, treeDigis_, "Digi occupancy: region1; globalZ [cm]; globalR [cm]", - "h_", "(200,564,573,55,130,240)", "g_r:g_z", rp1, "COLZ"); - - draw_occ(targetDir_, "strip_dg_phistrip_rm1_l1", ext_, treeDigis_, "Digi occupancy: region-1 layer1; phi [rad]; strip", - "h_", "(280,-3.141592654,3.141592654,192,0,384)", "strip:g_phi", rm1 && l1, "COLZ"); - draw_occ(targetDir_, "strip_dg_phistrip_rm1_l2", ext_, treeDigis_, "Digi occupancy: region-1 layer2; phi [rad]; strip", - "h_", "(280,-3.141592654,3.141592654,192,0,384)", "strip:g_phi", rm1 && l2, "COLZ"); - draw_occ(targetDir_, "strip_dg_phistrip_rp1_l1", ext_, treeDigis_, "Digi occupancy: region1 layer1; phi [rad]; strip", - "h_", "(280,-3.141592654,3.141592654,192,0,384)", "strip:g_phi", rp1 && l1, "COLZ"); - draw_occ(targetDir_, "strip_dg_phistrip_rp1_l2", ext_, treeDigis_, "Digi occupancy: region1 layer2; phi [rad]; strip", - "h_", "(280,-3.141592654,3.141592654,192,0,384)", "strip:g_phi", rp1 && l2, "COLZ"); - - draw_1D(targetDir_, "strip_dg_rm1_l1", ext_, treeDigis_, "Digi occupancy per strip number, region-1 layer1;strip number;entries", - "h_", "(384,0.5,384.5)", "strip", rm1 && l1); - draw_1D(targetDir_, "strip_dg_rm1_l2", ext_, treeDigis_, "Digi occupancy per strip number, region-1 layer2;strip number;entries", - "h_", "(384,0.5,384.5)", "strip", rm1 && l2); - draw_1D(targetDir_, "strip_dg_rp1_l1", ext_, treeDigis_, "Digi occupancy per strip number, region1 layer1;strip number;entries", - "h_", "(384,0.5,384.5)", "strip", rp1 && l1); - draw_1D(targetDir_, "strip_dg_rp1_l2", ext_, treeDigis_, "Digi occupancy per strip number, region1 layer2;strip number;entries", - "h_", "(384,0.5,384.5)", "strip", rp1 && l2); - - /// Bunch crossing plots - draw_bx(targetDir_, "strip_digi_bx_rm1_l1", ext_, treeDigis_, "Bunch crossing: region-1, layer1;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", rm1 && l1); - draw_bx(targetDir_, "strip_digi_bx_rm1_l2", ext_, treeDigis_, "Bunch crossing: region-1, layer2;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", rm1 && l2); - draw_bx(targetDir_, "strip_digi_bx_rp1_l1", ext_, treeDigis_, "Bunch crossing: region1, layer1;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", rp1 && l1); - draw_bx(targetDir_, "strip_digi_bx_rp1_l2", ext_, treeDigis_, "Bunch crossing: region1, layer2;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", rp1 && l2); - - - TTree * treePads_( (TTree *) dirAna_->Get( pads_ ) ); - if ( ! treePads_ ) { - std::cout << argv[ 0 ] << " --> WARNING:" << std::endl - << " pads '" << pads_ << "' does not exist in directory" << std::endl; - returnStatus_ += 0x30; - return returnStatus_; - } - - /// occupancy plots - draw_occ(targetDir_, "pad_dg_xy_rm1_l1", ext_, treePads_, "Pad occupancy: region-1, layer1; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", rm1 && l1, "COLZ"); - draw_occ(targetDir_, "pad_dg_xy_rm1_l2", ext_, treePads_, "Pad occupancy: region-1, layer2; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", rm1 && l2, "COLZ"); - draw_occ(targetDir_, "pad_dg_xy_rp1_l1", ext_, treePads_, "Pad occupancy: region1, layer1; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", rp1 && l1, "COLZ"); - draw_occ(targetDir_, "pad_dg_xy_rp1_l2", ext_, treePads_, "Pad occupancy: region1, layer2; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", rp1 && l2, "COLZ"); - - draw_occ(targetDir_, "pad_dg_zr_rm1", ext_, treePads_, "Pad occupancy: region-1; globalZ [cm]; globalR [cm]", - "h_", "(200,-573,-564,55,130,240)", "g_r:g_z", rm1, "COLZ"); - draw_occ(targetDir_, "pad_dg_zr_rp1", ext_, treePads_, "Pad occupancy: region1; globalZ [cm]; globalR [cm]", - "h_", "(200,564,573,55,130,240)", "g_r:g_z", rp1, "COLZ"); - - draw_occ(targetDir_, "pad_dg_phipad_rm1_l1", ext_, treePads_, "Pad occupancy: region-1 layer1; phi [rad]; pad", - "h_", "(280,-3.141592654,3.141592654," + boost::lexical_cast< std::string >((double) (npads_/2.)) + ",0," + npadss + ")", "pad:g_phi", rm1 && l1, "COLZ"); - draw_occ(targetDir_, "pad_dg_phipad_rm1_l2", ext_, treePads_, "Pad occupancy: region-1 layer2; phi [rad]; pad", - "h_", "(280,-3.141592654,3.141592654," + boost::lexical_cast< std::string >((double) (npads_/2.)) + ",0," + npadss + ")", "pad:g_phi", rm1 && l2, "COLZ"); - draw_occ(targetDir_, "pad_dg_phipad_rp1_l1", ext_, treePads_, "Pad occupancy: region1 layer1; phi [rad]; pad", - "h_", "(280,-3.141592654,3.141592654," + boost::lexical_cast< std::string >((double) (npads_/2.)) + ",0," + npadss + ")", "pad:g_phi", rp1 && l1, "COLZ"); - draw_occ(targetDir_, "pad_dg_phipad_rp1_l2", ext_, treePads_, "Pad occupancy: region1 layer2; phi [rad]; pad", - "h_", "(280,-3.141592654,3.141592654," + boost::lexical_cast< std::string >((double) (npads_/2.)) + ",0," + npadss + ")", "pad:g_phi", rp1 && l2, "COLZ"); - - draw_1D(targetDir_, "pad_dg_rm1_l1", ext_, treePads_, "Digi occupancy per pad number, region-1 layer1;pad number;entries", - "h_", "(" + npadss + ",0.5," + boost::lexical_cast< std::string >( (double) (npads_ + 0.5)) + ")", "pad", rm1 && l1); - draw_1D(targetDir_, "pad_dg_rm1_l2", ext_, treePads_, "Digi occupancy per pad number, region-1 layer2;pad number;entries", - "h_", "(" + npadss + ",0.5," + boost::lexical_cast< std::string >( (double) (npads_ + 0.5)) + ")", "pad", rm1 && l2); - draw_1D(targetDir_, "pad_dg_rp1_l1", ext_, treePads_, "Digi occupancy per pad number, region1 layer1;pad number;entries", - "h_", "(" + npadss + ",0.5," + boost::lexical_cast< std::string >( (double) (npads_ + 0.5)) + ")", "pad", rp1 && l1); - draw_1D(targetDir_, "pad_dg_rp1_l2", ext_, treePads_, "Digi occupancy per pad number, region1 layer2;pad number;entries", - "h_", "(" + npadss + ",0.5," + boost::lexical_cast< std::string >( (double) (npads_ + 0.5)) + ")", "pad", rp1 && l2); - - /// Bunch crossing plots - draw_bx(targetDir_, "pad_dg_bx_rm1_l1", ext_, treePads_, "Bunch crossing: region-1, layer1;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", rm1 && l1); - draw_bx(targetDir_, "pad_dg_bx_rm1_l2", ext_, treePads_, "Bunch crossing: region-1, layer2;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", rm1 && l2); - draw_bx(targetDir_, "pad_dg_bx_rp1_l1", ext_, treePads_, "Bunch crossing: region1, layer1;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", rp1 && l1); - draw_bx(targetDir_, "pad_dg_bx_rp1_l2", ext_, treePads_, "Bunch crossing: region1, layer2;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", rp1 && l2); - - - TTree * treeCoPads_( (TTree *) dirAna_->Get( copads_ ) ); - if ( ! treePads_ ) { - std::cout << argv[ 0 ] << " --> WARNING:" << std::endl - << " copad '" << copads_ << "' does not exist in directory" << std::endl; - returnStatus_ += 0x30; - return returnStatus_; - } - - /// occupancy plots - draw_occ(targetDir_, "copad_dg_xy_rm1_l1", ext_, treeCoPads_, "Pad occupancy: region-1; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", rm1, "COLZ"); - draw_occ(targetDir_, "copad_dg_xy_rp1_l1", ext_, treeCoPads_, "Pad occupancy: region1; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", rp1, "COLZ"); - - draw_occ(targetDir_, "copad_dg_zr_rm1", ext_, treeCoPads_, "Pad occupancy: region-1; globalZ [cm]; globalR [cm]", - "h_", "(200,-573,-564,55,130,240)", "g_r:g_z", rm1, "COLZ"); - draw_occ(targetDir_, "copad_dg_zr_rp1", ext_, treeCoPads_, "Pad occupancy: region1; globalZ [cm]; globalR [cm]", - "h_", "(200,564,573,55,130,240)", "g_r:g_z", rp1, "COLZ"); - - draw_occ(targetDir_, "copad_dg_phipad_rm1_l1", ext_, treeCoPads_, "Pad occupancy: region-1; phi [rad]; pad", - "h_", "(280,-3.141592654,3.141592654," + boost::lexical_cast< std::string >((double) (npads_/2.)) + ",0," + npadss + ")", "pad:g_phi", rm1, "COLZ"); - draw_occ(targetDir_, "copad_dg_phipad_rp1_l1", ext_, treeCoPads_, "Pad occupancy: region1; phi [rad]; pad", - "h_", "(280,-3.141592654,3.141592654," + boost::lexical_cast< std::string >((double) (npads_/2.)) + ",0," + npadss + ")", "pad:g_phi", rp1, "COLZ"); - - draw_1D(targetDir_, "copad_dg_rm1_l1", ext_, treeCoPads_, "Digi occupancy per pad number, region-1;pad number;entries", - "h_", "(" + npadss + ",0.5," + boost::lexical_cast< std::string >( (double) (npads_ + 0.5)) + ")", "pad", rm1); - draw_1D(targetDir_, "copad_dg_rp1_l1", ext_, treeCoPads_, "Digi occupancy per pad number, region1;pad number;entries", - "h_", "(" + npadss + ",0.5," + boost::lexical_cast< std::string >( (double) (npads_ + 0.5)) + ")", "pad", rp1); - - /// Bunch crossing plots - draw_bx(targetDir_, "copad_dg_bx_rm1", ext_, treeCoPads_, "Bunch crossing: region-1;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", rm1); - draw_bx(targetDir_, "copad_dg_bx_rp1", ext_, treeCoPads_, "Bunch crossing: region1;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", rp1); - - /// Tracks - TTree * treeTracks_( (TTree *) dirAna_->Get( tracks_ ) ); - if ( ! treeTracks_ ) { - std::cout << argv[ 0 ] << " --> WARNING:" << std::endl - << " tracks '" << tracks_ << "' does not exist in directory" << std::endl; - returnStatus_ += 0x30; - return returnStatus_; - } - - const TCut ok_eta("TMath::Abs(eta) > 1.64 && TMath::Abs(eta) < 2.12"); - const TCut ok_gL1sh("gem_sh_layer1 > 0"); - const TCut ok_gL2sh("gem_sh_layer2 > 0"); - const TCut ok_gL1dg("gem_dg_layer1 > 0"); - const TCut ok_gL2dg("gem_dg_layer2 > 0"); - const TCut ok_gL1pad("gem_pad_layer1 > 0"); - const TCut ok_gL2pad("gem_pad_layer2 > 0"); - - /// digis - draw_geff(targetDir_, "eff_eta_track_dg_gem_l1", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Digi in l2;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", "", ok_gL1dg, "P", kBlue); - draw_geff(targetDir_, "eff_eta_track_dg_gem_l2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Digi in l2;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", "", ok_gL2dg, "P", kBlue); - draw_geff(targetDir_, "eff_eta_track_dg_gem_l1or2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Digi in l1 or l2;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", "", ok_gL2dg || ok_gL1dg, "P", kBlue); - draw_geff(targetDir_, "eff_eta_track_dg_gem_l1and2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Digi in l1 and l2;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", "", ok_gL2dg && ok_gL1dg, "P", kBlue); - - draw_geff(targetDir_, "eff_phi_track_dg_gem_l1", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Digi in l1;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, ok_gL1dg, "P", kBlue); - draw_geff(targetDir_, "eff_phi_track_dg_gem_l2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Digi in l2;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, ok_gL2dg, "P", kBlue); - draw_geff(targetDir_, "eff_phi_track_dg_gem_l1or2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Digi in l1 or l2;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, ok_gL2dg || ok_gL1dg, "P", kBlue); - draw_geff(targetDir_, "eff_phi_track_dg_gem_l1and2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Digi in l1 and l2;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, ok_gL2dg && ok_gL1dg, "P", kBlue); - - // digis with matched simhits - draw_geff(targetDir_, "eff_eta_track_dg_sh_gem_l1", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Digi in l1 with a matched SimHit;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_gL1sh, ok_gL1dg, "P", kBlue); - draw_geff(targetDir_, "eff_eta_track_dg_sh_gem_l2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Digi in l2 with a matched SimHit;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_gL2sh, ok_gL2dg, "P", kBlue); - draw_geff(targetDir_, "eff_eta_track_dg_sh_gem_l1or2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Digi in l1 or l2 with a matched SimHit;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_gL1sh || ok_gL2sh, ok_gL2dg || ok_gL1dg, "P", kBlue); - draw_geff(targetDir_, "eff_eta_track_dg_sh_gem_l1and2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Digi in l1 and l2 with a matched SimHit;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_gL1sh && ok_gL2sh, ok_gL2dg && ok_gL1dg, "P", kBlue); - - draw_geff(targetDir_, "eff_phi_track_dg_gem_l1", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Digi in l1 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta && ok_gL1sh, ok_gL1dg, "P", kBlue); - draw_geff(targetDir_, "eff_phi_track_dg_gem_l2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Digi in l2 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta && ok_gL2sh, ok_gL2dg, "P", kBlue); - draw_geff(targetDir_, "eff_phi_track_dg_gem_l1or2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Digi in l1 or l2 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta && (ok_gL1sh || ok_gL2sh), ok_gL2dg || ok_gL1dg, "P", kBlue); - draw_geff(targetDir_, "eff_phi_track_dg_gem_l1and2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Digi in l1 and l2 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta && (ok_gL1sh && ok_gL2sh), ok_gL2dg && ok_gL1dg, "P", kBlue); - - /// pads - draw_geff(targetDir_, "eff_eta_track_pad_gem_l1", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Pad in l1;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", "", ok_gL1pad, "P", kBlue); - draw_geff(targetDir_, "eff_eta_track_pad_gem_l2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Pad in l2;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", "", ok_gL2pad, "P", kBlue); - draw_geff(targetDir_, "eff_eta_track_pad_gem_l1or2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Pad in l1 or l2;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", "", ok_gL2pad || ok_gL1pad, "P", kBlue); - - draw_geff(targetDir_, "eff_phi_track_pad_gem_l1", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Pad in l1;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, ok_gL1pad, "P", kBlue); - draw_geff(targetDir_, "eff_phi_track_pad_gem_l2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Pad in l2;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, ok_gL2pad, "P", kBlue); - draw_geff(targetDir_, "eff_phi_track_pad_gem_l1or2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Pad in l1 or l2;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, ok_gL2pad || ok_gL1pad, "P", kBlue); - - // pads with matched simhits - draw_geff(targetDir_, "eff_eta_track_pad_sh_gem_l1", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Pad in l1 with a matched SimHit;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_gL1sh, ok_gL1pad, "P", kBlue); - draw_geff(targetDir_, "eff_eta_track_pad_sh_gem_l2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Pad in l2 with a matched SimHit;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_gL2sh, ok_gL2pad, "P", kBlue); - draw_geff(targetDir_, "eff_eta_track_pad_sh_gem_l1or2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Pad in l1 or l2 with a matched SimHit;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_gL1sh || ok_gL2sh, ok_gL2pad || ok_gL1pad, "P", kBlue); - - draw_geff(targetDir_, "eff_phi_track_pad_sh_gem_l1", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Pad in l1 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta && ok_gL1sh, ok_gL1pad, "P", kBlue); - draw_geff(targetDir_, "eff_phi_track_pad_sh_gem_l2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Pad in l2 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta && ok_gL2sh, ok_gL2pad, "P", kBlue); - draw_geff(targetDir_, "eff_phi_track_pad_sh_gem_l1or2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM Pad in l1 or l2 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta && (ok_gL1sh || ok_gL2sh), ok_gL2pad || ok_gL1pad, "P", kBlue); - - /// copads - draw_geff(targetDir_, "eff_eta_track_copad_gem", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM CoPad;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", "", ok_gL1pad && ok_gL2pad, "P", kBlue); - draw_geff(targetDir_, "eff_phi_track_copad_gem", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM CoPad;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, ok_gL1pad && ok_gL2pad, "P", kBlue); - - // copads with matched simhits - draw_geff(targetDir_, "eff_eta_track_copad_sh_gem", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM CoPad with a matched SimHit;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_gL1sh && ok_gL2sh, ok_gL1pad && ok_gL2pad, "P", kBlue); - draw_geff(targetDir_, "eff_phi_track_copad_sh_gem", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM CoPad with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta && (ok_gL1sh && ok_gL2sh), ok_gL1pad && ok_gL2pad, "P", kBlue); - - // track plots - draw_1D(targetDir_, "track_pt", ext_, treeTracks_, "Track p_{T};Track p_{T} [GeV];Entries", "h_", "(100,0,200)", "pt", ""); - draw_1D(targetDir_, "track_eta", ext_, treeTracks_, "Track |#eta|;Track |#eta|;Entries", "h_", "(100,1.5,2.2)", "eta", ""); - draw_1D(targetDir_, "track_phi", ext_, treeTracks_, "Track #phi;Track #phi [rad];Entries", "h_", "(100,-3.141592654,3.141592654)", "phi", ""); - - return returnStatus_; -} - -void draw_geff(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut denom_cut, TCut extra_num_cut, TString opt, int color, int marker_st, float marker_sz) -{ - TCanvas* c( new TCanvas("c","c",600,600) ); - c->Clear(); - gPad->SetGrid(1); - gStyle->SetStatStyle(0); - gStyle->SetOptStat(1110); - - t->Draw(to_draw + ">>num_" + h_name + h_bins, denom_cut && extra_num_cut, "goff"); - TH1F* num((TH1F*) gDirectory->Get("num_" + h_name)->Clone("eff_" + h_name)); - - t->Draw(to_draw + ">>denom_" + h_name + h_bins, denom_cut, "goff"); - TH1F* den((TH1F*) gDirectory->Get("denom_" + h_name)->Clone("denom_" + h_name)); - - TGraphAsymmErrors *eff( new TGraphAsymmErrors(num, den)); - - if (!opt.Contains("same")) { - num->Reset(); - num->GetYaxis()->SetRangeUser(0.,1.05); - num->SetStats(0); - num->SetTitle(title); - num->Draw(); - } - eff->SetLineWidth(2); - eff->SetLineColor(color); - eff->SetMarkerStyle(marker_st); - eff->SetMarkerColor(color); - eff->SetMarkerSize(marker_sz); - eff->Draw(opt + " same"); - - // Do fit in the flat region - bool etaPlot(c_title.Contains("eta")); - const double xmin(etaPlot ? 1.64 : -999.); - const double xmax(etaPlot ? 2.12 : 999.); - TF1 *f1 = new TF1("fit1","pol0", xmin, xmax); - TFitResultPtr r = eff->Fit("fit1","RQS"); - TPaveStats *ptstats = new TPaveStats(0.25,0.35,0.75,0.55,"brNDC"); - ptstats->SetName("stats"); - ptstats->SetBorderSize(0); - ptstats->SetLineWidth(0); - ptstats->SetFillColor(0); - ptstats->SetTextAlign(11); - ptstats->SetTextFont(42); - ptstats->SetTextSize(.05); - ptstats->SetTextColor(kRed); - ptstats->SetOptStat(0); - ptstats->SetOptFit(1111); - - std::stringstream sstream; - sstream << TMath::Nint(r->Chi2()); - const TString chi2(boost::lexical_cast< std::string >(sstream.str())); - sstream.str(std::string()); - sstream << r->Ndf(); - const TString ndf(boost::lexical_cast< std::string >(sstream.str())); - sstream.str(std::string()); - sstream << TMath::Nint(r->Prob()*100); - const TString prob(boost::lexical_cast< std::string >(sstream.str())); - sstream.str(std::string()); - sstream << std::setprecision(4) << f1->GetParameter(0) * 100; - const TString p0(boost::lexical_cast< std::string >(sstream.str())); - sstream.str(std::string()); - sstream << std::setprecision(2) << f1->GetParError(0) * 100; - const TString p0e(boost::lexical_cast< std::string >(sstream.str())); - ptstats->AddText("#chi^{2} / ndf: " + chi2 + "/" + ndf); -// ptstats->AddText("Fit probability: " + prob + " %"); -// ptstats->AddText("Fitted efficiency = " + p0 + " #pm " + p0e + " %" ); - ptstats->AddText("Fitted efficiency: " + p0 + " #pm " + p0e + " %"); - ptstats->Draw("same"); - - TPaveText *pt = new TPaveText(0.09899329,0.9178322,0.8993289,0.9737762,"blNDC"); - pt->SetName("title"); - pt->SetBorderSize(1); - pt->SetFillColor(0); - pt->SetFillStyle(0); - pt->SetTextFont(42); - pt->AddText(eff->GetTitle()); - pt->Draw("same"); - c->Modified(); - c->SaveAs(target_dir + c_title + ext); - delete num; - delete den; - delete eff; - delete c; -} - - -void draw_occ(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut cut, TString opt) -{ - gStyle->SetStatStyle(0); - gStyle->SetOptStat(1110); - TCanvas* c = new TCanvas("c","c",600,600); - t->Draw(to_draw + ">>" + h_name + h_bins, cut); - TH2F* h = (TH2F*) gDirectory->Get(h_name)->Clone(h_name); - h->SetTitle(title); - h->SetLineWidth(2); - h->SetLineColor(kBlue); - h->Draw(opt); - c->SaveAs(target_dir + c_title + ext); - delete h; - delete c; -} - -void draw_1D(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut cut, TString opt) -{ - gStyle->SetStatStyle(0); - gStyle->SetOptStat(1110); - TCanvas* c = new TCanvas("c","c",600,600); - t->Draw(to_draw + ">>" + h_name + h_bins, cut); - TH1F* h = (TH1F*) gDirectory->Get(h_name)->Clone(h_name); - h->SetTitle(title); - h->SetLineWidth(2); - h->SetLineColor(kBlue); - h->Draw(opt); - h->SetMinimum(0.); - c->SaveAs(target_dir + c_title + ext); - delete h; - delete c; -} - -void draw_bx(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut cut, TString opt) -{ - gStyle->SetStatStyle(0); - gStyle->SetOptStat(1110); - TCanvas* c = new TCanvas("c","c",600,600); - t->Draw(to_draw + ">>" + h_name + h_bins, cut); - gPad->SetLogy(); - TH1F* h = (TH1F*) gDirectory->Get(h_name)->Clone(h_name); - h->SetTitle(title); - h->SetLineWidth(2); - h->SetLineColor(kBlue); - h->Draw(opt); - h->SetMinimum(1.); - c->SaveAs(target_dir + c_title + ext); - delete h; - delete c; -} diff --git a/GEMValidation/bin/produceDigiValidationPlots_cfg.py b/GEMValidation/bin/produceDigiValidationPlots_cfg.py deleted file mode 100644 index 6d586ec68fe1e..0000000000000 --- a/GEMValidation/bin/produceDigiValidationPlots_cfg.py +++ /dev/null @@ -1,8 +0,0 @@ -import os -import FWCore.ParameterSet.Config as cms - -process = cms.PSet() -process.inputFile = cms.string('/afs/cern.ch/user/d/dildick/work/GEM/CMSSW_6_2_0_pre5/src/gem_digi_ana.root') -process.targetDir = cms.string('/afs/cern.ch/user/d/dildick/work/GEM/CMSSW_6_2_0_pre5/src/new_dir/') -process.ext = cms.string(".png") -process.npads = cms.uint32( 96 ) diff --git a/GEMValidation/bin/produceRecHitValidationPlots.C b/GEMValidation/bin/produceRecHitValidationPlots.C deleted file mode 100644 index e4b70a1bc2d49..0000000000000 --- a/GEMValidation/bin/produceRecHitValidationPlots.C +++ /dev/null @@ -1,280 +0,0 @@ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "boost/lexical_cast.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "FWCore/FWLite/interface/AutoLibraryLoader.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/PythonParameterSet/interface/MakeParameterSets.h" - -using namespace std; - -// void draw_geff(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, -// TString to_draw, TCut denom_cut, TCut extra_num_cut, TString opt = "", int color = kBlue, int marker_st = 1, float marker_sz = 1.); -void draw_occ(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut cut, TString opt = ""); -void draw_1D(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut cut, TString opt = ""); - -int main( int argc, char * argv[] ) -{ - int returnStatus_( 0 ); - - // Load libraries - gSystem->Load( "libFWCoreFWLite" ); - AutoLibraryLoader::enable(); - - // Check configuration file - if ( argc < 2 ) { - std::cout << argv[ 0 ] << " --> Usage:" << std::endl - << " " << argv[ 0 ] << " [CONFIG_FILE.py]" << std::endl; - returnStatus_ += 0x1; - return returnStatus_; - } - - if ( ! edm::readPSetsFrom( argv[ 1 ] )->existsAs< edm::ParameterSet >( "process" ) ) { - std::cout << argv[ 0 ] << " --> ERROR:" << std::endl - << " cms.PSet 'process' missing in " << argv[ 1 ] << std::endl; - returnStatus_ += 0x2; - return returnStatus_; - } - - const edm::ParameterSet & process_( edm::readPSetsFrom( argv[ 1 ] )->getParameter< edm::ParameterSet >( "process" ) ); - const TString inputFile_( process_.getParameter< std::string >( "inputFile" ) ); - const TString targetDir_( process_.getParameter< std::string >( "targetDir" ) ); - const TString ext_( process_.getParameter< std::string >( "ext" ) ); - const int nregion_( process_.getParameter< int >( "nregion" ) ); - const int npart_( process_.getParameter< int >( "npart" ) ); - - // Constants - const TString analyzer_( "GEMRecHitAnalyzer" ); - const TString rechits_( "GEMRecHitTree" ); - const TString simTracks_( "Tracks" ); - const TCut rm1("region==-1"); - const TCut rp1("region==1"); - const TCut l1("layer==1"); - const TCut l2("layer==2"); - - // Open input file - std::cout << std::endl - << argv[ 0 ] << " --> INFO:" << std::endl - << " using input file '" << inputFile_ << "'" << std::endl; - - TFile * fileIn_( TFile::Open( inputFile_, "UPDATE" ) ); - if ( ! fileIn_ ) { - std::cout << argv[ 0 ] << " --> ERROR:" << std::endl - << " input file '" << inputFile_ << "' missing" << std::endl; - returnStatus_ += 0x10; - return returnStatus_; - } - - TDirectory * dirAna_( (TDirectory *) fileIn_->Get( analyzer_ ) ); - if ( ! dirAna_ ) { - std::cout << argv[ 0 ] << " --> WARNING:" << std::endl - << " rechits '" << analyzer_ << "' does not exist in input file" << std::endl; - returnStatus_ += 0x20; - return returnStatus_; - } - - TTree * treeHits_( (TTree *) dirAna_->Get( rechits_ ) ); - if ( ! treeHits_ ) { - std::cout << argv[ 0 ] << " --> WARNING:" << std::endl - << " rechits '" << rechits_ << "' does not exist in directory" << std::endl; - returnStatus_ += 0x30; - return returnStatus_; - } - - /// occupancy - draw_occ(targetDir_, "localrh_xy_rm1_l1", ext_, treeHits_, " SimHit occupancy: region-1, layer1;globalX [cm];globalY [cm]", - "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", rm1 && l1, "COLZ"); - draw_occ(targetDir_, "localrh_xy_rm1_l2", ext_, treeHits_, " SimHit occupancy: region-1, layer2;globalX [cm];globalY [cm]", - "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", rm1 && l2, "COLZ"); - draw_occ(targetDir_, "localrh_xy_rp1_l1", ext_, treeHits_, " SimHit occupancy: region1, layer1;globalX [cm];globalY [cm]", - "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", rp1 && l1, "COLZ"); - draw_occ(targetDir_, "localrh_xy_rp1_l2", ext_, treeHits_, " SimHit occupancy: region1, layer2;globalX [cm];globalY [cm]", - "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", rp1 && l2, "COLZ"); - - draw_occ(targetDir_, "localrh_zr_rm1", ext_, treeHits_, " SimHit occupancy: region-1;globalZ [cm];globalR [cm]", - "h_", "(200,-573,-564,110,130,240)", "sqrt(globalX*globalX+globalY*globalY):globalZ", rm1, "COLZ"); - draw_occ(targetDir_, "localrh_zr_rp1", ext_, treeHits_, " SimHit occupancy: region1;globalZ [cm];globalR [cm]", - "h_", "(200,564,573,110,130,240)", "sqrt(globalX*globalX+globalY*globalY):globalZ", rp1, "COLZ"); - - /// eta occupancy plot - int region=0; - int layer=0; - int roll=0; - TBranch *b_region; - TBranch *b_layer; - TBranch *b_roll; - treeHits_->SetBranchAddress("region", ®ion, &b_region); - treeHits_->SetBranchAddress("layer", &layer, &b_layer); - treeHits_->SetBranchAddress("roll", &roll, &b_roll); - TH1D* h = new TH1D("h", " SimHit occupancy in eta partitions; occupancy in #eta partition; entries",4*npart_,1.,1.+4*npart_); - int nbytes = 0; - int nb = 0; - for (Long64_t jentry=0; jentryGetEntriesFast();jentry++) { - Long64_t ientry = treeHits_->LoadTree(jentry); - if (ientry < 0) break; - nb = treeHits_->GetEntry(jentry); - nbytes += nb; - h->Fill(roll + (layer==2? npart_:0) + (region==1? 2.*npart_:0 ) ); - } - TCanvas* c = new TCanvas("c","c",600,600); - c->Clear(); - gPad->SetLogx(0); - gPad->SetLogy(0); - int ibin(1); - for (int iregion = 1; iregionGetXaxis()->SetBinLabel(ibin,region+layer+part); - ++ibin; - } - } - } - - h->SetMinimum(0.); - h->SetLineWidth(2); - h->SetLineColor(kBlue); - h->Draw(""); - c->SaveAs(targetDir_ +"localrh_globalEta" + ext_); - - return returnStatus_; -} - -// void draw_geff(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, -// TString to_draw, TCut denom_cut, TCut extra_num_cut, TString opt, int color, int marker_st, float marker_sz) -// { -// TCanvas* c( new TCanvas("c","c",600,600) ); -// c->Clear(); -// gPad->SetGrid(1); - -// t->Draw(to_draw + ">>num_" + h_name + h_bins, denom_cut && extra_num_cut, "goff"); -// TH1F* num((TH1F*) gDirectory->Get("num_" + h_name)->Clone("eff_" + h_name)); - -// t->Draw(to_draw + ">>denom_" + h_name + h_bins, denom_cut, "goff"); -// TH1F* den((TH1F*) gDirectory->Get("denom_" + h_name)->Clone("denom_" + h_name)); - -// TGraphAsymmErrors *eff( new TGraphAsymmErrors(num, den)); - -// if (!opt.Contains("same")) { -// num->Reset(); -// num->GetYaxis()->SetRangeUser(0.,1.05); -// num->SetStats(0); -// num->SetTitle(title); -// num->Draw(); -// } -// eff->SetLineWidth(2); -// eff->SetLineColor(color); -// eff->SetMarkerStyle(marker_st); -// eff->SetMarkerColor(color); -// eff->SetMarkerSize(marker_sz); -// eff->Draw(opt + " same"); - -// // Do fit in the flat region -// bool etaPlot(c_title.Contains("eta")); -// const double xmin(etaPlot ? 1.64 : -999.); -// const double xmax(etaPlot ? 2.12 : 999.); -// TF1 *f1 = new TF1("fit1","pol0", xmin, xmax); -// TFitResultPtr r = eff->Fit("fit1","RQS"); -// TPaveStats *ptstats = new TPaveStats(0.25,0.35,0.75,0.55,"brNDC"); -// ptstats->SetName("stats"); -// ptstats->SetBorderSize(0); -// ptstats->SetLineWidth(0); -// ptstats->SetFillColor(0); -// ptstats->SetTextAlign(11); -// ptstats->SetTextFont(42); -// ptstats->SetTextSize(.05); -// ptstats->SetTextColor(kRed); -// ptstats->SetOptStat(0); -// ptstats->SetOptFit(1111); - -// std::stringstream sstream; -// sstream << TMath::Nint(r->Chi2()); -// const TString chi2(boost::lexical_cast< std::string >(sstream.str())); -// sstream.str(std::string()); -// sstream << r->Ndf(); -// const TString ndf(boost::lexical_cast< std::string >(sstream.str())); -// sstream.str(std::string()); -// sstream << TMath::Nint(r->Prob()*100); -// const TString prob(boost::lexical_cast< std::string >(sstream.str())); -// sstream.str(std::string()); -// sstream << f1->GetParameter(0);//<< std::setprecision(4) -// const TString p0(boost::lexical_cast< std::string >(sstream.str())); -// sstream.str(std::string()); -// sstream << std::setprecision(2) << f1->GetParError(0); -// const TString p0e(boost::lexical_cast< std::string >(sstream.str())); -// ptstats->AddText("#chi^{2} / ndf: " + chi2 + "/" + ndf); -// // ptstats->AddText("Fit probability: " + prob + " %"); -// // ptstats->AddText("Fitted efficiency = " + p0 + " #pm " + p0e + " %" ); -// ptstats->AddText("Fitted efficiency: " + p0 + " %"); -// ptstats->Draw("same"); -// c->Modified(); -// c->SaveAs(target_dir + c_title + ext); -// delete num; -// delete den; -// delete eff; -// delete c; -// } - -void draw_occ(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut cut, TString opt) -{ - TCanvas* c = new TCanvas("c","c",600,600); - t->Draw(to_draw + ">>" + h_name + h_bins, cut); - TH2F* h = (TH2F*) gDirectory->Get(h_name)->Clone(h_name); - h->SetTitle(title); - h->SetLineWidth(2); - h->SetLineColor(kBlue); - h->Draw(opt); - c->SaveAs(target_dir + c_title + ext); - delete h; - delete c; -} - -void draw_1D(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut cut, TString opt) -{ - TCanvas* c = new TCanvas("c","c",600,600); - t->Draw(to_draw + ">>" + h_name + h_bins, cut); - TH1F* h = (TH1F*) gDirectory->Get(h_name)->Clone(h_name); - h->SetTitle(title); - h->SetLineWidth(2); - h->SetLineColor(kBlue); - h->Draw(opt); - h->SetMinimum(0.); - c->SaveAs(target_dir + c_title + ext); - delete h; - delete c; -} - diff --git a/GEMValidation/bin/produceRecHitValidationPlots_cfg.py b/GEMValidation/bin/produceRecHitValidationPlots_cfg.py deleted file mode 100644 index bb9afd0a05095..0000000000000 --- a/GEMValidation/bin/produceRecHitValidationPlots_cfg.py +++ /dev/null @@ -1,11 +0,0 @@ -import os -import FWCore.ParameterSet.Config as cms - -process = cms.PSet() -process.verbose = cms.uint32( 1 ) -process.inputFile = cms.string('/afs/cern.ch/user/d/dildick/work/GEM/CMSSW_6_2_0_pre5/src/gem_localrec_ana.root') -process.targetDir = cms.string('/afs/cern.ch/user/d/dildick/work/GEM/CMSSW_6_2_0_pre5/src/new_dir/') -process.ext = cms.string(".png") -process.nregion = cms.int32( 2 ) -process.nlayer = cms.int32( 2 ) -process.npart = cms.int32( 8 ) diff --git a/GEMValidation/bin/produceSimHitValidationPlots.C b/GEMValidation/bin/produceSimHitValidationPlots.C deleted file mode 100644 index ed299ed30756b..0000000000000 --- a/GEMValidation/bin/produceSimHitValidationPlots.C +++ /dev/null @@ -1,460 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "boost/lexical_cast.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "FWCore/FWLite/interface/AutoLibraryLoader.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/PythonParameterSet/interface/MakeParameterSets.h" - -using namespace std; - -void draw_geff(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut denom_cut, TCut extra_num_cut, TString opt = "", int color = kBlue, int marker_st = 1, float marker_sz = 1.); -void draw_occ(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut cut, TString opt = ""); -void draw_1D(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut cut, TString opt = ""); - - - -int main( int argc, char * argv[] ) -{ - int returnStatus_( 0 ); - - // Load libraries - gSystem->Load( "libFWCoreFWLite" ); - AutoLibraryLoader::enable(); - - // Check configuration file - if ( argc < 2 ) { - std::cout << argv[ 0 ] << " --> Usage:" << std::endl - << " " << argv[ 0 ] << " [CONFIG_FILE.py]" << std::endl; - returnStatus_ += 0x1; - return returnStatus_; - } - - if ( ! edm::readPSetsFrom( argv[ 1 ] )->existsAs< edm::ParameterSet >( "process" ) ) { - std::cout << argv[ 0 ] << " --> ERROR:" << std::endl - << " cms.PSet 'process' missing in " << argv[ 1 ] << std::endl; - returnStatus_ += 0x2; - return returnStatus_; - } - - const edm::ParameterSet & process_( edm::readPSetsFrom( argv[ 1 ] )->getParameter< edm::ParameterSet >( "process" ) ); - const TString inputFile_( process_.getParameter< std::string >( "inputFile" ) ); - const TString targetDir_( process_.getParameter< std::string >( "targetDir" ) ); - const TString ext_( process_.getParameter< std::string >( "ext" ) ); - const int nregion_( process_.getParameter< int >( "nregion" ) ); - const int npart_( process_.getParameter< int >( "npart" ) ); - - // Constants - const TString analyzer_( "GEMSimHitAnalyzer" ); - const TString simHits_( "GEMSimHits" ); - const TString simTracks_( "Tracks" ); - const TCut rm1("region==-1"); - const TCut rp1("region==1"); - const TCut l1("layer==1"); - const TCut l2("layer==2"); - - std::vector muonSelection(3); - muonSelection.clear(); - muonSelection.push_back("TMath::Abs(particleType)==13"); - muonSelection.push_back("TMath::Abs(particleType)!=13"); - muonSelection.push_back(""); - - std::vector titlePrefix(3); - titlePrefix.clear(); - titlePrefix.push_back("Muon"); - titlePrefix.push_back("Non muon"); - titlePrefix.push_back("All"); - - std::vector histSuffix(3); - histSuffix.clear(); - histSuffix.push_back("_muon"); - histSuffix.push_back("_nonmuon"); - histSuffix.push_back("_all"); - - // Open input file - std::cout << std::endl - << argv[ 0 ] << " --> INFO:" << std::endl - << " using input file '" << inputFile_ << "'" << std::endl; - - TFile * fileIn_( TFile::Open( inputFile_, "UPDATE" ) ); - if ( ! fileIn_ ) { - std::cout << argv[ 0 ] << " --> ERROR:" << std::endl - << " input file '" << inputFile_ << "' missing" << std::endl; - returnStatus_ += 0x10; - return returnStatus_; - } - - TDirectory * dirAna_( (TDirectory *) fileIn_->Get( analyzer_ ) ); - if ( ! dirAna_ ) { - std::cout << argv[ 0 ] << " --> WARNING:" << std::endl - << " simhits '" << analyzer_ << "' does not exist in input file" << std::endl; - returnStatus_ += 0x20; - return returnStatus_; - } - - TTree * treeHits_( (TTree *) dirAna_->Get( simHits_ ) ); - if ( ! treeHits_ ) { - std::cout << argv[ 0 ] << " --> WARNING:" << std::endl - << " simhits '" << simHits_ << "' does not exist in directory" << std::endl; - returnStatus_ += 0x30; - return returnStatus_; - } - - gStyle->SetStatStyle(0); - - for (unsigned uSel = 0; uSel < 3; ++uSel){ - - TCut sel(muonSelection.at(uSel)); - TString pre(titlePrefix.at(uSel)); - TString suff(histSuffix.at(uSel)); - - // occupancy - draw_occ(targetDir_, "sh_xy_rm1_l1" + suff, ext_, treeHits_, pre + " SimHit occupancy: region-1, layer1;globalX [cm];globalY [cm]", - "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", rm1 && l1 && sel, "COLZ"); - draw_occ(targetDir_, "sh_xy_rm1_l2" + suff, ext_, treeHits_, pre + " SimHit occupancy: region-1, layer2;globalX [cm];globalY [cm]", - "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", rm1 && l2 && sel, "COLZ"); - draw_occ(targetDir_, "sh_xy_rp1_l1" + suff, ext_, treeHits_, pre + " SimHit occupancy: region1, layer1;globalX [cm];globalY [cm]", - "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", rp1 && l1 && sel, "COLZ"); - draw_occ(targetDir_, "sh_xy_rp1_l2" + suff, ext_, treeHits_, pre + " SimHit occupancy: region1, layer2;globalX [cm];globalY [cm]", - "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", rp1 && l2 && sel, "COLZ"); - - draw_occ(targetDir_, "sh_zr_rm1" + suff, ext_, treeHits_, pre + " SimHit occupancy: region-1;globalZ [cm];globalR [cm]", - "h_", "(200,-573,-564,110,130,240)", "sqrt(globalX*globalX+globalY*globalY):globalZ", rm1 && sel, "COLZ"); - draw_occ(targetDir_, "sh_zr_rp1" + suff, ext_, treeHits_, pre + " SimHit occupancy: region1;globalZ [cm];globalR [cm]", - "h_", "(200,564,573,110,130,240)", "sqrt(globalX*globalX+globalY*globalY):globalZ", rp1 && sel, "COLZ"); - - // tof - draw_1D(targetDir_, "sh_tof_rm1_l1" + suff, ext_, treeHits_, pre + " SimHit TOF: region-1, layer1;Time of flight [ns];entries", - "h_", "(40,18,22)", "timeOfFlight", rm1 && l1 && sel); - draw_1D(targetDir_, "sh_tof_rm1_l2" + suff, ext_, treeHits_, pre + " SimHit TOF: region-1, layer2;Time of flight [ns];entries", - "h_", "(40,18,22)", "timeOfFlight", rm1 && l2 && sel); - draw_1D(targetDir_, "sh_tof_rp1_l1" + suff, ext_, treeHits_, pre + " SimHit TOF: region1, layer1;Time of flight [ns];entries", - "h_", "(40,18,22)", "timeOfFlight", rp1 && l1 && sel); - draw_1D(targetDir_, "sh_tof_rp1_l2" + suff, ext_, treeHits_, pre + " SimHit TOF: region1, layer2;Time of flight [ns];entries", - "h_", "(40,18,22)", "timeOfFlight", rp1 && l2 && sel); - - /// momentum plot - TCanvas* c = new TCanvas("c","c",600,600); - c->Clear(); - treeHits_->Draw("pabs>>h(200,0.,200.)",sel); - TH1D* h((TH1D*) gDirectory->Get("h")); - gPad->SetLogx(0); - gPad->SetLogy(1); - h->SetTitle(pre + " SimHits absolute momentum;Momentum [GeV/c];entries"); - h->SetLineWidth(2); - h->SetLineColor(kBlue); - h->Draw(""); - c->SaveAs(targetDir_ +"sh_momentum" + suff + ext_); - -// draw_1D(targetDir_, "sh_pdgid" + suff, ext_, treeHits_, pre + " SimHit PDG Id;PDG Id;entries", -// "h_", "(200,-100.,100.)", "particleType", sel); - - /// eta occupancy plot - int region=0; - int layer=0; - int roll=0; - int particletype=0; - TBranch *b_region; - TBranch *b_layer; - TBranch *b_roll; - TBranch *b_particleType; - treeHits_->SetBranchAddress("region", ®ion, &b_region); - treeHits_->SetBranchAddress("layer", &layer, &b_layer); - treeHits_->SetBranchAddress("roll", &roll, &b_roll); - treeHits_->SetBranchAddress("particleType", &particletype, &b_particleType); - h = new TH1D("h", pre + " SimHit occupancy in eta partitions; occupancy in #eta partition; entries",4*npart_,1.,1.+4*npart_); - int nbytes = 0; - int nb = 0; - for (Long64_t jentry=0; jentryGetEntriesFast();jentry++) { - Long64_t ientry = treeHits_->LoadTree(jentry); - if (ientry < 0) break; - nb = treeHits_->GetEntry(jentry); - nbytes += nb; - switch(uSel){ - case 0: - if (abs(particletype)==13) h->Fill(roll + (layer==2? npart_:0) + (region==1? 2.*npart_:0 ) ); - break; - case 1: - if (abs(particletype)!=13) h->Fill(roll + (layer==2? npart_:0) + (region==1? 2.*npart_:0 ) ); - break; - case 2: - h->Fill(roll + (layer==2? npart_:0) + (region==1? 2.*npart_:0 ) ); - break; - } - } - c->Clear(); - gPad->SetLogx(0); - gPad->SetLogy(0); - int ibin(1); - for (int iregion = 1; iregionGetXaxis()->SetBinLabel(ibin,region+layer+part); - ++ibin; - } - } - } - - h->SetMinimum(0.); - h->SetLineWidth(2); - h->SetLineColor(kBlue); - h->Draw(""); - c->SaveAs(targetDir_ +"sh_globalEta" + suff + ext_); - - /// energy loss plot - h = new TH1D("h","",60,0.,6000.); - Float_t energyLoss=0; - TBranch *b_energyLoss; - treeHits_->SetBranchAddress("energyLoss", &energyLoss, &b_energyLoss); - for (Long64_t jentry=0; jentryGetEntriesFast();jentry++) { - Long64_t ientry = treeHits_->LoadTree(jentry); - if (ientry < 0) break; - nb = treeHits_->GetEntry(jentry); - nbytes += nb; - switch(uSel){ - case 0: - if (abs(particletype)==13) h->Fill( energyLoss*1.e9 ); - break; - case 1: - if (abs(particletype)!=13) h->Fill( energyLoss*1.e9 ); - break; - case 2: - h->Fill( energyLoss*1.e9 ); - break; - } - } - c->Clear(); - gPad->SetLogx(0); - gPad->SetLogy(0); - h->SetTitle(pre + " SimHit energy loss;Energy loss [eV];entries"); - h->SetMinimum(0.); - h->SetLineWidth(2); - h->SetLineColor(kBlue); - h->Draw(""); - c->SaveAs(targetDir_ + "sh_energyloss" + suff + ext_); - - } - - TTree * treeTracks_( (TTree *) dirAna_->Get( simTracks_ ) ); - if ( ! treeTracks_ ) { - std::cout << argv[ 0 ] << " --> WARNING:" << std::endl - << " tracks '" << simTracks_ << "' does not exist in directory" << std::endl; - returnStatus_ += 0x30; - return returnStatus_; - } - - const TCut ok_eta("TMath::Abs(eta) > 1.64 && TMath::Abs(eta) < 2.12"); - const TCut ok_gL1sh("gem_sh_layer1 > 0"); - const TCut ok_gL2sh("gem_sh_layer2 > 0"); - - draw_geff(targetDir_, "eff_eta_track_sh_gem_l1or2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 or GEMl2;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", "", ok_gL1sh || ok_gL2sh, "P", kBlue); - draw_geff(targetDir_, "eff_eta_track_sh_gem_l1", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", "", ok_gL1sh, "P", kBlue); - draw_geff(targetDir_, "eff_eta_track_sh_gem_l2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM SimHit in GEMl2;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", "", ok_gL2sh, "P", kBlue); - draw_geff(targetDir_, "eff_eta_track_sh_gem_l1and2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 and GEMl2;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", "", ok_gL1sh && ok_gL2sh, "P", kBlue); - - draw_geff(targetDir_, "eff_phi_track_sh_gem_l1or2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 or GEMl2;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.14159265358979312,3.14159265358979312)", "phi", ok_eta, ok_gL1sh || ok_gL2sh, "P", kBlue); - draw_geff(targetDir_, "eff_phi_track_sh_gem_l1", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.14159265358979312,3.14159265358979312)", "phi", ok_eta, ok_gL1sh, "P", kBlue); - draw_geff(targetDir_, "eff_phi_track_sh_gem_l2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM SimHit in GEMl2;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.14159265358979312,3.14159265358979312)", "phi", ok_eta, ok_gL2sh, "P", kBlue); - draw_geff(targetDir_, "eff_phi_track_sh_gem_l1and2", ext_, treeTracks_, - "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 and GEMl2;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.14159265358979312,3.14159265358979312)", "phi", ok_eta, ok_gL1sh && ok_gL2sh, "P", kBlue); - -// draw_geff(targetDir_, "eff_globalx_track_sh_gem_l1or2", ext_, treeTracks_, -// "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 or GEMl2;SimTrack globalx;Eff.", -// "h_", "(250,-250.,250)", "globalX", "", ok_gL1sh || ok_gL2sh, "P", kBlue); -// draw_geff(targetDir_, "eff_globalx_track_sh_gem_l1", ext_, treeTracks_, -// "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1;SimTrack globalx;Eff.", -// "h_", "(250,-250.,250)", "globalX", "", ok_gL1sh, "P", kBlue); -// draw_geff(targetDir_, "eff_globalx_track_sh_gem_l2", ext_, treeTracks_, -// "Eff. for a SimTrack to have an associated GEM SimHit in GEMl2;SimTrack globalx;Eff.", -// "h_", "(250,-250.,250)", "globalx_layer1", "", ok_gL2sh, "P", kBlue); -// draw_geff(targetDir_, "eff_globalx_track_sh_gem_l1and2", ext_, treeTracks_, -// "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 and GEMl2;SimTrack globalx;Eff.", -// "h_", "(250,-250.,250)", "globalx_layer1", "", ok_gL1sh && ok_gL2sh, "P", kBlue); - -// draw_geff(targetDir_, "eff_globaly_track_sh_gem_l1or2", ext_, treeTracks_, -// "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 or GEMl2;SimTrack globaly;Eff.", -// "h_", "(250,-250.,250)", "globaly_layer1", "", ok_gL1sh || ok_gL2sh, "P", kBlue); -// draw_geff(targetDir_, "eff_globaly_track_sh_gem_l1", ext_, treeTracks_, -// "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1;SimTrack globaly;Eff.", -// "h_", "(250,-250.,250)", "globaly_layer1", "", ok_gL1sh, "P", kBlue); -// draw_geff(targetDir_, "eff_globaly_track_sh_gem_l2", ext_, treeTracks_, -// "Eff. for a SimTrack to have an associated GEM SimHit in GEMl2;SimTrack globaly;Eff.", -// "h_", "(250,-250.,250)", "globaly_layer1", "", ok_gL2sh, "P", kBlue); -// draw_geff(targetDir_, "eff_globaly_track_sh_gem_l1and2", ext_, treeTracks_, -// "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 and GEMl2;SimTrack globaly;Eff.", -// "h_", "(250,-250.,250)", "globaly_layer1", "", ok_gL1sh && ok_gL2sh, "P", kBlue); - - draw_1D(targetDir_, "track_pt", ext_, treeTracks_, "Track p_{T};Track p_{T} [GeV];Entries", "h_", "(100,0,200)", "pt", ""); - draw_1D(targetDir_, "track_eta", ext_, treeTracks_, "Track |#eta|;Track |#eta|;Entries", "h_", "(100,1.5,2.2)", "eta", ""); - draw_1D(targetDir_, "track_phi", ext_, treeTracks_, "Track #phi;Track #phi [rad];Entries", "h_", "(100,-3.14159265358979312,3.14159265358979312)", "phi", ""); - - return returnStatus_; -} - -void draw_geff(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut denom_cut, TCut extra_num_cut, TString opt, int color, int marker_st, float marker_sz) -{ - TCanvas* c( new TCanvas("c","c",600,600) ); - c->Clear(); - gPad->SetGrid(1); - gStyle->SetStatStyle(0); - t->Draw(to_draw + ">>num_" + h_name + h_bins, denom_cut && extra_num_cut, "goff"); - TH1F* num((TH1F*) gDirectory->Get("num_" + h_name)->Clone("eff_" + h_name)); - - t->Draw(to_draw + ">>denom_" + h_name + h_bins, denom_cut, "goff"); - TH1F* den((TH1F*) gDirectory->Get("denom_" + h_name)->Clone("denom_" + h_name)); - - TGraphAsymmErrors *eff( new TGraphAsymmErrors(num, den)); - - if (!opt.Contains("same")) { - num->Reset(); - num->GetYaxis()->SetRangeUser(0.,1.05); - num->SetStats(0); - num->SetTitle(title); - num->Draw(); - } - eff->SetLineWidth(2); - eff->SetLineColor(color); - eff->SetMarkerStyle(marker_st); - eff->SetMarkerColor(color); - eff->SetMarkerSize(marker_sz); - eff->Draw(opt + " same"); - - // Do fit in the flat region - bool etaPlot(c_title.Contains("eta")); - const double xmin(etaPlot ? 1.64 : -999.); - const double xmax(etaPlot ? 2.12 : 999.); - TF1 *f1 = new TF1("fit1","pol0", xmin, xmax); - TFitResultPtr r = eff->Fit("fit1","RQS"); - TPaveStats *ptstats = new TPaveStats(0.25,0.35,0.75,0.55,"brNDC"); - ptstats->SetName("stats"); - ptstats->SetBorderSize(0); - ptstats->SetLineWidth(0); - ptstats->SetFillColor(0); - ptstats->SetTextAlign(11); - ptstats->SetTextFont(42); - ptstats->SetTextSize(.05); - ptstats->SetTextColor(kRed); - ptstats->SetOptStat(0); - ptstats->SetOptFit(1111); - - std::stringstream sstream; - sstream << TMath::Nint(r->Chi2()); - const TString chi2(boost::lexical_cast< std::string >(sstream.str())); - sstream.str(std::string()); - sstream << r->Ndf(); - const TString ndf(boost::lexical_cast< std::string >(sstream.str())); - sstream.str(std::string()); - sstream << TMath::Nint(r->Prob()*100); - const TString prob(boost::lexical_cast< std::string >(sstream.str())); - sstream.str(std::string()); - sstream << std::setprecision(4) << f1->GetParameter(0) * 100; - const TString p0(boost::lexical_cast< std::string >(sstream.str())); - sstream.str(std::string()); - sstream << std::setprecision(2) << f1->GetParError(0) * 100; - const TString p0e(boost::lexical_cast< std::string >(sstream.str())); - ptstats->AddText("#chi^{2} / ndf: " + chi2 + "/" + ndf); -// ptstats->AddText("Fit probability: " + prob + " %"); -// ptstats->AddText("Fitted efficiency = " + p0 + " #pm " + p0e + " %" ); - ptstats->AddText("Fitted efficiency: " + p0 + " #pm " + p0e + " %"); - ptstats->Draw("same"); - TPaveText *pt = new TPaveText(0.09899329,0.9178322,0.8993289,0.9737762,"blNDC"); - pt->SetName("title"); - pt->SetBorderSize(1); - pt->SetFillColor(0); - pt->SetFillStyle(0); - pt->SetTextFont(42); - pt->AddText(eff->GetTitle()); - pt->Draw("same"); - c->Modified(); - c->SaveAs(target_dir + c_title + ext); - delete num; - delete den; - delete eff; - delete c; -} - -void draw_occ(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut cut, TString opt) -{ - gStyle->SetStatStyle(0); - gStyle->SetOptStat(1110); - TCanvas* c = new TCanvas("c","c",600,600); - t->Draw(to_draw + ">>" + h_name + h_bins, cut); - TH2F* h = (TH2F*) gDirectory->Get(h_name)->Clone(h_name); - h->SetTitle(title); - h->SetLineWidth(2); - h->SetLineColor(kBlue); - h->Draw(opt); - c->SaveAs(target_dir + c_title + ext); - delete h; - delete c; -} - -void draw_1D(TString target_dir, TString c_title, TString ext, TTree *t, TString title, TString h_name, TString h_bins, - TString to_draw, TCut cut, TString opt) -{ - gStyle->SetStatStyle(0); - gStyle->SetOptStat(1110); - TCanvas* c = new TCanvas("c","c",600,600); - t->Draw(to_draw + ">>" + h_name + h_bins, cut); - TH1F* h = (TH1F*) gDirectory->Get(h_name)->Clone(h_name); - h->SetTitle(title); - h->SetLineWidth(2); - h->SetLineColor(kBlue); - h->Draw(opt); - h->SetMinimum(0.); - c->SaveAs(target_dir + c_title + ext); - delete h; - delete c; -} - diff --git a/GEMValidation/bin/produceSimHitValidationPlots_cfg.py b/GEMValidation/bin/produceSimHitValidationPlots_cfg.py deleted file mode 100644 index e5e48eb4118c5..0000000000000 --- a/GEMValidation/bin/produceSimHitValidationPlots_cfg.py +++ /dev/null @@ -1,12 +0,0 @@ -import os -import FWCore.ParameterSet.Config as cms - -process = cms.PSet() -process.verbose = cms.uint32( 1 ) -process.inputFile = cms.string('/afs/cern.ch/user/d/dildick/work/GEM/CMSSW_6_2_0_pre5/src/gem_sh_ana.test.root') -process.targetDir = cms.string('/afs/cern.ch/user/d/dildick/work/GEM/CMSSW_6_2_0_pre5/src/new_dir/') -#process.targetDir = cms.string('./') -process.ext = cms.string(".png") -process.nregion = cms.int32( 2 ) -process.nlayer = cms.int32( 2 ) -process.npart = cms.int32( 8 ) From 1b3abda37348057d94de3a1702f691bc9c76a034 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 1 Oct 2013 00:01:33 +0200 Subject: [PATCH 142/182] Printing extra information --- SimMuL1/scripts/produceDphiDict.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SimMuL1/scripts/produceDphiDict.py b/SimMuL1/scripts/produceDphiDict.py index 663617e535746..9f97b4e7b4e98 100644 --- a/SimMuL1/scripts/produceDphiDict.py +++ b/SimMuL1/scripts/produceDphiDict.py @@ -91,7 +91,13 @@ def produceDphiDict(filesDir, outFileName): ## close the output file outfile.close() + + ## print some additional information print "dPhi library written to:", outfile.name + outfile = open("%s"%(outFileName),"r") + print outfile.read() + outfile.close() + if __name__ == "__main__": produceDphiDict("files/", "GEMCSCdPhiDict.py") From 9e9741434773bfdfa97d90ecc9f8dd6a84b0a54d Mon Sep 17 00:00:00 2001 From: unclok Date: Tue, 1 Oct 2013 23:31:45 +0900 Subject: [PATCH 143/182] fixed std::abs(pdgid == 11) to std::abs(pdgid) == 11 --- GEMValidation/src/SimHitMatcher.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GEMValidation/src/SimHitMatcher.cc b/GEMValidation/src/SimHitMatcher.cc index ec15c3ad1aeb3..109236cebfff4 100644 --- a/GEMValidation/src/SimHitMatcher.cc +++ b/GEMValidation/src/SimHitMatcher.cc @@ -188,7 +188,7 @@ SimHitMatcher::matchSimHitsToSimTrack(std::vector track_ids, if (h.trackId() != track_id) continue; int pdgid = h.particleType(); if (simMuOnlyGEM_ && std::abs(pdgid) != 13) continue; - if (discardEleHitsGEM_ && std::abs(pdgid == 11)) continue; + if (discardEleHitsGEM_ && std::abs(pdgid) == 11) continue; gem_detid_to_hits_[ h.detUnitId() ].push_back(h); gem_hits_.push_back(h); From f58e4c3cfad009067a08130d2f6d20a2ef3f260b Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 2 Oct 2013 20:29:44 +0900 Subject: [PATCH 144/182] there was another std::abs(pdgid == 11) to std::abs(pdgid) == 11 Please enter the commit message for your changes. Lines starting --- GEMValidation/src/SimHitMatcher.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GEMValidation/src/SimHitMatcher.cc b/GEMValidation/src/SimHitMatcher.cc index 109236cebfff4..40a8b97d43589 100644 --- a/GEMValidation/src/SimHitMatcher.cc +++ b/GEMValidation/src/SimHitMatcher.cc @@ -176,7 +176,7 @@ SimHitMatcher::matchSimHitsToSimTrack(std::vector track_ids, if (h.trackId() != track_id) continue; int pdgid = h.particleType(); if (simMuOnlyCSC_ && std::abs(pdgid) != 13) continue; - if (discardEleHitsCSC_ && std::abs(pdgid == 11)) continue; + if (discardEleHitsCSC_ && std::abs(pdgid) == 11) continue; csc_detid_to_hits_[ h.detUnitId() ].push_back(h); csc_hits_.push_back(h); From 043c85673ac5d4f4943cdfc3361dae8cc03cde5e Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 2 Oct 2013 20:49:25 +0900 Subject: [PATCH 145/182] GEMSimHitAnalyzer module not found --- GEMValidation/test/runGEMDigiAnalyzer_cfg.py | 1 + 1 file changed, 1 insertion(+) diff --git a/GEMValidation/test/runGEMDigiAnalyzer_cfg.py b/GEMValidation/test/runGEMDigiAnalyzer_cfg.py index 1567441e99907..f5d4355958431 100644 --- a/GEMValidation/test/runGEMDigiAnalyzer_cfg.py +++ b/GEMValidation/test/runGEMDigiAnalyzer_cfg.py @@ -25,6 +25,7 @@ process.GEMDigiAnalyzer.simTrackMatching.cscCLCTInput = "" process.GEMDigiAnalyzer.simTrackMatching.cscALCTInput = "" process.GEMDigiAnalyzer.simTrackMatching.cscLCTInput = "" +process.load('GEMCode.GEMValidation.GEMSimHitAnalyzer_cfi') process.GEMSimHitAnalyzer.simTrackMatching.gemRecHitInput = "" process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) From 1e4e33109d94445ee5a0d156d470cfd45a6168a6 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 2 Oct 2013 14:10:11 +0200 Subject: [PATCH 146/182] Fix typo --- GEMValidation/src/SimHitMatcher.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GEMValidation/src/SimHitMatcher.cc b/GEMValidation/src/SimHitMatcher.cc index 109236cebfff4..40a8b97d43589 100644 --- a/GEMValidation/src/SimHitMatcher.cc +++ b/GEMValidation/src/SimHitMatcher.cc @@ -176,7 +176,7 @@ SimHitMatcher::matchSimHitsToSimTrack(std::vector track_ids, if (h.trackId() != track_id) continue; int pdgid = h.particleType(); if (simMuOnlyCSC_ && std::abs(pdgid) != 13) continue; - if (discardEleHitsCSC_ && std::abs(pdgid == 11)) continue; + if (discardEleHitsCSC_ && std::abs(pdgid) == 11) continue; csc_detid_to_hits_[ h.detUnitId() ].push_back(h); csc_hits_.push_back(h); From acc4e9af9e6cfbc4b68371c51f4c947147ff22c2 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 2 Oct 2013 14:13:27 +0200 Subject: [PATCH 147/182] Fix typo SimHit -> Digi --- GEMValidation/test/runGEMDigiAnalyzer_cfg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GEMValidation/test/runGEMDigiAnalyzer_cfg.py b/GEMValidation/test/runGEMDigiAnalyzer_cfg.py index 1567441e99907..3b9569542e7a6 100644 --- a/GEMValidation/test/runGEMDigiAnalyzer_cfg.py +++ b/GEMValidation/test/runGEMDigiAnalyzer_cfg.py @@ -25,7 +25,7 @@ process.GEMDigiAnalyzer.simTrackMatching.cscCLCTInput = "" process.GEMDigiAnalyzer.simTrackMatching.cscALCTInput = "" process.GEMDigiAnalyzer.simTrackMatching.cscLCTInput = "" -process.GEMSimHitAnalyzer.simTrackMatching.gemRecHitInput = "" +process.GEMDigiAnalyzer.simTrackMatching.gemRecHitInput = "" process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) From 8fa860996ba6ca4e9195dafa027d716472d21c7a Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 2 Oct 2013 21:49:58 +0900 Subject: [PATCH 148/182] adding local x and y for digi --- GEMValidation/scripts/cuts.py | 3 + .../scripts/produceDigiValidationPlots.py | 55 ++++++++++++++++++- GEMValidation/test/runGEMDigiAnalyzer_cfg.py | 3 +- 3 files changed, 58 insertions(+), 3 deletions(-) diff --git a/GEMValidation/scripts/cuts.py b/GEMValidation/scripts/cuts.py index 55948ce48d360..a82c0c9d9ee45 100644 --- a/GEMValidation/scripts/cuts.py +++ b/GEMValidation/scripts/cuts.py @@ -21,5 +21,8 @@ ok_trk_gL1sh = TCut("has_gem_sh_l1 > 0") ok_trk_gL2sh = TCut("has_gem_sh_l2 > 0") +ok_trk_gL1dg = TCut("has_gem_dg_l1 > 0") +ok_trk_gL2dg = TCut("has_gem_dg_l2 > 0") + ok_lx_odd = TCut("TMath::Abs(TMath::ASin(gem_lx_odd/gem_trk_rho)) < 5*TMath::Pi()/180.") ok_lx_even = TCut("TMath::Abs(TMath::ASin(gem_lx_even/gem_trk_rho)) < 5*TMath::Pi()/180.") diff --git a/GEMValidation/scripts/produceDigiValidationPlots.py b/GEMValidation/scripts/produceDigiValidationPlots.py index 8259f793b7523..ee5c9ae485702 100644 --- a/GEMValidation/scripts/produceDigiValidationPlots.py +++ b/GEMValidation/scripts/produceDigiValidationPlots.py @@ -19,7 +19,7 @@ if __name__ == "__main__": - inputFile = '/afs/cern.ch/user/d/dildick/work/GEM/CMSSW_6_2_0_pre5/src/gem_digi_ana.root' + inputFile = str(sys.argv[1]) targetDir = './' ## extension for figures - add more? @@ -300,3 +300,56 @@ TCut("%s && %s" %(ok_gL1pad.GetTitle(),ok_gL2pad.GetTitle())), "P", kBlue) + + draw_geff(targetDir, "eff_lx_track_dg_gem_l1_even", ext, treeTracks, + "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1;SimTrack localX [cm];Eff.", + "h_", "(100,-100,100)", "gem_lx_even", TCut(""), ok_trk_gL1dg, "P", kBlue) + draw_geff(targetDir, "eff_lx_track_dg_gem_l2_even", ext, treeTracks, + "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl2;SimTrack localX [cm];Eff.", + "h_", "(100,-100,100)", "gem_lx_even", TCut(""), ok_trk_gL2dg, "P", kBlue) + draw_geff(targetDir, "eff_lx_track_dg_gem_l1or2_even", ext, treeTracks, + "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 or GEMl2;SimTrack localX [cm];Eff.", + "h_", "(100,-100,100)", "gem_lx_even", TCut(""), TCut("%s || %s" %(ok_trk_gL1dg.GetTitle(),ok_trk_gL2dg.GetTitle())), "P", kBlue) + draw_geff(targetDir, "eff_lx_track_dg_gem_l1and2_even", ext, treeTracks, + "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 and GEMl2;SimTrack localX [cm];Eff.", + "h_", "(100,-100,100)", "gem_lx_even", TCut(""), TCut("%s && %s" %(ok_trk_gL1dg.GetTitle(),ok_trk_gL2dg.GetTitle())), "P", kBlue) + + draw_geff(targetDir, "eff_lx_track_dg_gem_l1_odd", ext, treeTracks, + "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1;SimTrack localX [cm];Eff.", + "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), ok_trk_gL1dg, "P", kBlue) + draw_geff(targetDir, "eff_lx_track_dg_gem_l2_odd", ext, treeTracks, + "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl2;SimTrack localX [cm];Eff.", + "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), ok_trk_gL2dg, "P", kBlue) + draw_geff(targetDir, "eff_lx_track_dg_gem_l1or2_odd", ext, treeTracks, + "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 or GEMl2;SimTrack localX [cm];Eff.", + "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), TCut("%s || %s" %(ok_trk_gL1dg.GetTitle(),ok_trk_gL2dg.GetTitle())), "P", kBlue) + draw_geff(targetDir, "eff_lx_track_dg_gem_l1and2_odd", ext, treeTracks, + "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 and GEMl2;SimTrack localX [cm];Eff.", + "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), TCut("%s && %s" %(ok_trk_gL1dg.GetTitle(),ok_trk_gL2dg.GetTitle())), "P", kBlue) + + + draw_geff(targetDir, "eff_ly_track_dg_gem_l1_even", ext, treeTracks, + "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1;SimTrack localy [cm];Eff.", + "h_", "(100,-100,100)", "gem_ly_even", TCut(""), ok_trk_gL1dg, "P", kBlue) + draw_geff(targetDir, "eff_ly_track_dg_gem_l2_even", ext, treeTracks, + "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl2;SimTrack localy [cm];Eff.", + "h_", "(100,-100,100)", "gem_ly_even", TCut(""), ok_trk_gL2dg, "P", kBlue) + draw_geff(targetDir, "eff_ly_track_dg_gem_l1or2_even", ext, treeTracks, + "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 or GEMl2;SimTrack localy [cm];Eff.", + "h_", "(100,-100,100)", "gem_ly_even", TCut(""), TCut("%s || %s" %(ok_trk_gL1dg.GetTitle(),ok_trk_gL2dg.GetTitle())), "P", kBlue) + draw_geff(targetDir, "eff_ly_track_dg_gem_l1and2_even", ext, treeTracks, + "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 and GEMl2;SimTrack localy [cm];Eff.", + "h_", "(100,-100,100)", "gem_ly_even", TCut(""), TCut("%s && %s" %(ok_trk_gL1dg.GetTitle(),ok_trk_gL2dg.GetTitle())), "P", kBlue) + + draw_geff(targetDir, "eff_ly_track_dg_gem_l1_odd", ext, treeTracks, + "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1;SimTrack localy [cm];Eff.", + "h_", "(100,-100,100)", "gem_ly_odd", TCut(""), ok_trk_gL1dg, "P", kBlue) + draw_geff(targetDir, "eff_ly_track_dg_gem_l2_odd", ext, treeTracks, + "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl2;SimTrack localy [cm];Eff.", + "h_", "(100,-100,100)", "gem_ly_odd", TCut(""), ok_trk_gL2dg, "P", kBlue) + draw_geff(targetDir, "eff_ly_track_dg_gem_l1or2_odd", ext, treeTracks, + "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 or GEMl2;SimTrack localy [cm];Eff.", + "h_", "(100,-100,100)", "gem_ly_odd", TCut(""), TCut("%s || %s" %(ok_trk_gL1dg.GetTitle(),ok_trk_gL2dg.GetTitle())), "P", kBlue) + draw_geff(targetDir, "eff_ly_track_dg_gem_l1and2_odd", ext, treeTracks, + "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 and GEMl2;SimTrack localy [cm];Eff.", + "h_", "(100,-100,100)", "gem_ly_odd", TCut(""), TCut("%s && %s" %(ok_trk_gL1dg.GetTitle(),ok_trk_gL2dg.GetTitle())), "P", kBlue) diff --git a/GEMValidation/test/runGEMDigiAnalyzer_cfg.py b/GEMValidation/test/runGEMDigiAnalyzer_cfg.py index f5d4355958431..3b9569542e7a6 100644 --- a/GEMValidation/test/runGEMDigiAnalyzer_cfg.py +++ b/GEMValidation/test/runGEMDigiAnalyzer_cfg.py @@ -25,8 +25,7 @@ process.GEMDigiAnalyzer.simTrackMatching.cscCLCTInput = "" process.GEMDigiAnalyzer.simTrackMatching.cscALCTInput = "" process.GEMDigiAnalyzer.simTrackMatching.cscLCTInput = "" -process.load('GEMCode.GEMValidation.GEMSimHitAnalyzer_cfi') -process.GEMSimHitAnalyzer.simTrackMatching.gemRecHitInput = "" +process.GEMDigiAnalyzer.simTrackMatching.gemRecHitInput = "" process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) From 821979cf86767d8655ecbd28bfebed469e43714e Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 2 Oct 2013 15:07:51 +0200 Subject: [PATCH 149/182] Remove outdated instructions --- README.md | 61 ------------------------------------------------------- 1 file changed, 61 deletions(-) diff --git a/README.md b/README.md index 2c7b77f91720d..cb69f1ee24dd3 100644 --- a/README.md +++ b/README.md @@ -34,64 +34,3 @@ http://cms-project-gem-validation.web.cern.ch/cms-project-gem-validation/
* Road map of the development of the GEM-CSC integrated local trigger
https://twiki.cern.ch/twiki/bin/view/MPGD/GEMTriggerRoadMap - - -##Instructions to get the code - -###General GitHub setup - -Follow the instructions on
-http://cms-sw.github.io/cmssw/index.html - -###CMSSW environment setup - -!!! Use CMSSW_6_1_2_SLHC8_patch1 !!! - -
cmsrel CMSSW_6_1_2_SLHC8_patch1
-cd CMSSW_6_1_2_SLHC8_patch1/src
-cmsenv
-git init
-
- -###Get the official CMSSW code - -
git cms-addpkg Geometry/GEMGeometry
-git cms-addpkg Geometry/GEMGeometryBuilder
-git cms-addpkg DataFormats/MuonDetId
-git cms-addpkg DataFormats/GEMRecHit
-git cms-addpkg DataFormats/CSCDigi
-git cms-addpkg L1Trigger/CSCTriggerPrimitives
-git cms-addpkg L1Trigger/GlobalMuonTrigger
-git cms-addpkg DataFormats/L1CSCTrackFinder
-git cms-addpkg SimMuon/GEMDigitizer
-
- -###Checking out and merging the latest GEM developments - - -
git remote add gem-cmssw git://github.com/gem-sw/cmssw.git
-git fetch gem-cmssw
-git merge FETCH_HEAD
-
- -Compile:
scram b -j 9
- -###Adding submodules - -Validation code -
git submodule add git://github.com/gem-sw/GEMCode.git
- -L1TriggerDevelopment: -
git submodule add git://github.com/gem-sw/L1TriggerDPGUpgrade.git
- -Website development -
git submodule add git://github.com/gem-sw/Website.git
- -Check that you are on the master branch in each submodule. Create a new branch for each development. - -Compile
scram b -j 9
From f73514325096179cc5b6fe764a1b46fcc5d5e9d7 Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 2 Oct 2013 22:36:41 +0900 Subject: [PATCH 150/182] input root file to produceDigiValidationPlots as CLI --- GEMValidation/scripts/produceDigiValidationPlots.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GEMValidation/scripts/produceDigiValidationPlots.py b/GEMValidation/scripts/produceDigiValidationPlots.py index ee5c9ae485702..1d57608d8c6e2 100644 --- a/GEMValidation/scripts/produceDigiValidationPlots.py +++ b/GEMValidation/scripts/produceDigiValidationPlots.py @@ -20,8 +20,9 @@ if __name__ == "__main__": inputFile = str(sys.argv[1]) + if len(inputFile) < 3: + inputFile = '/afs/cern.ch/user/d/dildick/work/GEM/CMSSW_6_2_0_pre5/src/gem_digi_ana.root' targetDir = './' - ## extension for figures - add more? ext = ".png" From ba35fabccec612e4caebc0337a006664113f28c4 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 2 Oct 2013 23:14:23 +0200 Subject: [PATCH 151/182] port to CMSSW 620 SLHC with updated geometry and magnetic field --- GEMValidation/test/runGEMCSCAnalyzer_cfg.py | 34 +++++++++------------ 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/GEMValidation/test/runGEMCSCAnalyzer_cfg.py b/GEMValidation/test/runGEMCSCAnalyzer_cfg.py index 321e017a732ff..283bdac6712d0 100644 --- a/GEMValidation/test/runGEMCSCAnalyzer_cfg.py +++ b/GEMValidation/test/runGEMCSCAnalyzer_cfg.py @@ -1,24 +1,22 @@ import FWCore.ParameterSet.Config as cms -process = cms.Process("Demo") - -process.load("FWCore.MessageService.MessageLogger_cfi") - -process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMXML_cfi') -#process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMr08v01XML_cfi') -#process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMr10v01XML_cfi') -process.load('Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi') -process.load('Geometry.CommonDetUnit.globalTrackingGeometry_cfi') -process.load('Geometry.MuonNumbering.muonNumberingInitialization_cfi') -process.load('Geometry.GEMGeometry.gemGeometry_cfi') +process = cms.Process("GEMCSCANA") + +## Standard sequence +process.load('Configuration.StandardSequences.Services_cff') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.Geometry.GeometryExtended2019Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2019_cff') +process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.load('Configuration.StandardSequences.MagneticField_cff') +## TrackingComponentsRecord required for matchers process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorOpposite_cfi') process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAlong_cfi') - -# GEM-CSC trigger pad digi producer -process.load('SimMuon.GEMDigitizer.muonGEMCSCPadDigis_cfi') +## global tag for 2019 upgrade studies +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgrade2019', '') # the analyzer configuration process.load('GEMCode.GEMValidation.GEMCSCAnalyzer_cfi') @@ -37,10 +35,6 @@ #process.GEMCSCAnalyzer.simTrackMatching.discardEleHitsCSC = False #process.GEMCSCAnalyzer.simTrackMatching.discardEleHitsGEM = False - -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.GlobalTag.globaltag = 'POSTLS161_V12::All' - process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100000) ) process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) @@ -105,5 +99,5 @@ fileName = cms.string(ntupleFile) ) -process.p = cms.Path(process.simMuonGEMCSCPadDigis + process.GEMCSCAnalyzer) +process.p = cms.Path(process.GEMCSCAnalyzer) From 971dcd86845aa476aee344f5701e3b26057e8c95 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 3 Oct 2013 00:11:24 +0200 Subject: [PATCH 152/182] Remove unnecessary stuff and add empty rechits collection --- GEMValidation/test/runGEMCSCAnalyzer_cfg.py | 59 +++------------------ 1 file changed, 6 insertions(+), 53 deletions(-) diff --git a/GEMValidation/test/runGEMCSCAnalyzer_cfg.py b/GEMValidation/test/runGEMCSCAnalyzer_cfg.py index 283bdac6712d0..5b8f39be192d5 100644 --- a/GEMValidation/test/runGEMCSCAnalyzer_cfg.py +++ b/GEMValidation/test/runGEMCSCAnalyzer_cfg.py @@ -1,3 +1,5 @@ +#@ this configuration runs an analyzer on GEM and CSC stubs in input + import FWCore.ParameterSet.Config as cms process = cms.Process("GEMCSCANA") @@ -34,69 +36,20 @@ #process.GEMCSCAnalyzer.simTrackMatching.simMuOnlyCSC = False #process.GEMCSCAnalyzer.simTrackMatching.discardEleHitsCSC = False #process.GEMCSCAnalyzer.simTrackMatching.discardEleHitsGEM = False +process.GEMCSCAnalyzer.simTrackMatching.gemRecHitInput = "" -process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100000) ) +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) - -dirPt5 = '/afs/cern.ch/cms/MUON/gem/muonGun_50k_pT20_digi_v3/' -dirPt20 = '/afs/cern.ch/cms/MUON/gem/muonGun_50k_pT5_digi_v2/' - -dirPt5 = '/pnfs/cms/WAX/11/store/user/lpcgem/dildick/dildick/pT5_1M_v1/Digi+L1CSC-MuonGunPt5_1M/82325e40d6202e6fec2dd983c477f3ca/' -dirPt20 = '/pnfs/cms/WAX/11/store/user/lpcgem/dildick/dildick/pT20_1M_v1/Digi+L1CSC-MuonGunPt20_1M/82325e40d6202e6fec2dd983c477f3ca/' - -dirPt5Pt40 = '/pnfs/cms/WAX/11/store/user/lpcgem/yasser1/yasser/MuomGUN_SIM_Pt5-40_50k/MuomGun_digi_Pt5-40_L1CSC_50k/82325e40d6202e6fec2dd983c477f3ca/' -dirPt2Pt50 = '/pnfs/cms/WAX/11/store/user/lpcgem/khotilov/khotilov/MuomGUN_SIM_Pt2-50_100k/MuonGun_DIGI_L1_Pt2-50_100k/29891ddb18281fff4c42a6e5f5d4bc55/' - -dir_pt5 = '/pnfs/cms/WAX/11/store/user/lpcgem/yasser1/yasser/muonGun_50k_pT5_lpcgem/MuomGunPtL1CSC50k5_digi/82325e40d6202e6fec2dd983c477f3ca/' -dir_pt10 = '/pnfs/cms/WAX/11/store/user/lpcgem/yasser1/yasser/muonGun_50k_pT10_lpcgem/MuomGunPt10L1CSC50k_digi/82325e40d6202e6fec2dd983c477f3ca/' -dir_pt15 = '/pnfs/cms/WAX/11/store/user/lpcgem/yasser1/yasser/muonGun_50k_pT15_lpcgem/MuomGun_Pt15_L1CSC_50k_digi/82325e40d6202e6fec2dd983c477f3ca/' -dir_pt20 = '/pnfs/cms/WAX/11/store/user/lpcgem/yasser1/yasser/muonGun_50k_pT20_lpcgem/MuomGunPt20L1CSC50k_digi/82325e40d6202e6fec2dd983c477f3ca/' -dir_pt30 = '/pnfs/cms/WAX/11/store/user/lpcgem/yasser1/yasser/MuonGun_Sim_50k_pT30_v2/MuomGun_Pt30_L1CSC_50k_digi/82325e40d6202e6fec2dd983c477f3ca/' -dir_pt40 = '/pnfs/cms/WAX/11/store/user/lpcgem/yasser1/yasser/muonGun_50k_pT40_lpcgem/MuomGunPt40L1CSC50k_digi/82325e40d6202e6fec2dd983c477f3ca/' - - - -import os - -inputDir = dirPt20 ; ntupleFile = 'gem_csc_delta_pt20_or16.root' -inputDir = dirPt5 ; ntupleFile = 'gem_csc_delta_pt5_or16.root' - -#inputDir = dirPt20 ; ntupleFile = 'gem_csc_delta_pt20_or8.root' -#inputDir = dirPt5 ; ntupleFile = 'gem_csc_delta_pt5_or8.root' - -#inputDir = dirPt20 ; ntupleFile = 'gem_csc_delta_pt20_or4_lct.root' -#inputDir = dirPt5 ; ntupleFile = 'gem_csc_delta_pt5_or4_lct.root' - -#inputDir = dirPt5Pt40 ; ntupleFile = 'gem_csc_delta_pt5pt40_or4.root' -inputDir = dirPt5Pt40 ; ntupleFile = 'gem_csc_eff_pt5pt40_or4.root' - - -inputDir = dir_pt5 ; ntupleFile = 'gem_csc_delta_pt5_pad4.root' -inputDir = dir_pt10 ; ntupleFile = 'gem_csc_delta_pt10_pad4.root' -inputDir = dir_pt15 ; ntupleFile = 'gem_csc_delta_pt15_pad4.root' -inputDir = dir_pt20 ; ntupleFile = 'gem_csc_delta_pt20_pad4.root' -inputDir = dir_pt30 ; ntupleFile = 'gem_csc_delta_pt30_pad4.root' -inputDir = dir_pt40 ; ntupleFile = 'gem_csc_delta_pt40_pad4.root' - -inputDir = dirPt2Pt50 ; ntupleFile = 'gem_csc_eff_pt2pt50_pad4.root' - - -ls = os.listdir(inputDir) - process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring( - #'file:out_sim.root' -# 'file:output_SingleMuPt40.root' -# 'file:/afs/cern.ch/cms/MUON/gem/SingleMuPt40Fwd/SingleMuPt40Fwd_20121205_FixedGeometry_DIGI.root' - #['file:'+inputDir+x for x in ls if x.endswith('root')] - [inputDir[16:] + x for x in ls if x.endswith('root')] + 'file:out_digi.root' ) ) process.TFileService = cms.Service("TFileService", - fileName = cms.string(ntupleFile) + fileName = cms.string('gem-csc_stub_ana.root') ) process.p = cms.Path(process.GEMCSCAnalyzer) From 5d862a1e4e21728d76c3d080ad0aa41d0ec67707 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 7 Oct 2013 08:04:48 -0500 Subject: [PATCH 153/182] Updating standard sequence for SimHit, Digi and RecHit analyzers --- GEMValidation/test/runGEMDigiAnalyzer_cfg.py | 4 ++++ GEMValidation/test/runGEMRecHitAnalyzer_cfg.py | 3 ++- GEMValidation/test/runGEMSimHitAnalyzer_cfg.py | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/GEMValidation/test/runGEMDigiAnalyzer_cfg.py b/GEMValidation/test/runGEMDigiAnalyzer_cfg.py index 1567441e99907..944fda1d45b19 100644 --- a/GEMValidation/test/runGEMDigiAnalyzer_cfg.py +++ b/GEMValidation/test/runGEMDigiAnalyzer_cfg.py @@ -5,10 +5,14 @@ ## Standard sequence process.load('Configuration.StandardSequences.Services_cff') process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.Geometry.GeometryExtended2019Reco_cff') process.load('Configuration.Geometry.GeometryExtended2019_cff') process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') + + ## TrackingComponentsRecord required for matchers process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorOpposite_cfi') diff --git a/GEMValidation/test/runGEMRecHitAnalyzer_cfg.py b/GEMValidation/test/runGEMRecHitAnalyzer_cfg.py index 1edcffdb7b163..5244b24d860b5 100644 --- a/GEMValidation/test/runGEMRecHitAnalyzer_cfg.py +++ b/GEMValidation/test/runGEMRecHitAnalyzer_cfg.py @@ -3,9 +3,10 @@ process = cms.Process("Demo") process.load('Configuration.StandardSequences.Services_cff') +process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.Geometry.GeometryExtended2019Reco_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_cff') +process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') from Configuration.AlCa.GlobalTag import GlobalTag diff --git a/GEMValidation/test/runGEMSimHitAnalyzer_cfg.py b/GEMValidation/test/runGEMSimHitAnalyzer_cfg.py index 61840208f8a7d..4d1f1bb0917da 100644 --- a/GEMValidation/test/runGEMSimHitAnalyzer_cfg.py +++ b/GEMValidation/test/runGEMSimHitAnalyzer_cfg.py @@ -5,10 +5,12 @@ ## Standard sequence process.load('Configuration.StandardSequences.Services_cff') process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.Geometry.GeometryExtended2019Reco_cff') process.load('Configuration.Geometry.GeometryExtended2019_cff') process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') ## TrackingComponentsRecord required for matchers process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorOpposite_cfi') From d7466059cec4d366db977c228dc0b5eecee913cd Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 7 Oct 2013 08:07:29 -0500 Subject: [PATCH 154/182] =?UTF-8?q?Updated=20L1=20CGEM-SC=20emulator=C3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SimMuL1/test/runCustomMuL1Trigger_cfg.py | 305 ++++++++++++----------- 1 file changed, 166 insertions(+), 139 deletions(-) diff --git a/SimMuL1/test/runCustomMuL1Trigger_cfg.py b/SimMuL1/test/runCustomMuL1Trigger_cfg.py index a0183bb1cf06c..0cdb2f73f530c 100644 --- a/SimMuL1/test/runCustomMuL1Trigger_cfg.py +++ b/SimMuL1/test/runCustomMuL1Trigger_cfg.py @@ -1,136 +1,162 @@ +## This configuration runs the DIGI+L1Emulator step + import FWCore.ParameterSet.Config as cms process = cms.Process("MUTRG") - -################################################################################ -# - - -dir_muPt5_pu0 = '/pnfs/cms/WAX/11/store/user/lpcgem/dildick/dildick/pT5_1M_v1/DigiL1CSC-MuonGunPt5_1M/82325e40d6202e6fec2dd983c477f3ca/' -dir_muPt20_pu0 = '/pnfs/cms/WAX/11/store/user/lpcgem/dildick/dildick/pT20_1M_v1/DigiL1CSC-MuonGunPt20_1M/82325e40d6202e6fec2dd983c477f3ca/' - -dir_muPt20_pu200 = '/pnfs/cms/WAX/11/store/user/lpcgem/dildick/dildick/muonGun_50k_pT20_lpcgem/DigiL1CSC-MuonGunPt20_50k-PU200/0de68e8f275fa8e4e39f6990099d44a2/' -dir_mb_pu100 = '/pnfs/cms/WAX/11/store/user/lpcgem/yasser1/yasser/NeutrinoGunPt5-40_v3/NeutrinoGun_pileup100_Pt5-40_50k_digi/6e54e2af5e7284c73c4665d7969fdf1d/' - -dirPt2Pt50 = '/pnfs/cms/WAX/11/store/user/lpcgem/khotilov/khotilov/MuomGUN_SIM_Pt2-50_100k/MuonGun_DIGI_L1_Pt2-50_100k/29891ddb18281fff4c42a6e5f5d4bc55/' - -dirWMu = '/pnfs/cms/WAX/11/store/user/lpcgem/dildick/dildick/WtoMuNu_test/WtoMuNu_test/58b3ea3c731a8657fd489c8437f5f991/' - -inputDir = dir_muPt20_pu200 -inputDir = dir_muPt20_pu0 -inputDir = dir_mb_pu100 -inputDir = dirPt2Pt50 -#inputDir = dirWMu - - -theOutDir = '' -theFileName = 'out.root' - -min_clct_pattern = 2 - -gem_match = False -gem_match = True - -lct_store_gemdphi = False -#lct_store_gemdphi = True - -pt_dphi = 'pt40' - -process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) ) - -#process.Timing = cms.Service("Timing") -process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) - -from GEMCode.SimMuL1.GEMCSCdPhiLib import * -dphi_lct_pad = dphi_lct_pad98 - -################################################################################ - +## Standard sequence process.load('Configuration.StandardSequences.Services_cff') process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') -process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.StandardSequences.MagneticField_38T_cff') -process.load('Configuration.StandardSequences.Digi_cff') -process.load('Configuration.StandardSequences.EndOfProcess_cff') - +process.load('Configuration.Geometry.GeometryExtended2019Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2019_cff') +process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.GlobalTag.globaltag = 'POSTLS161_V12::All' -#process.GlobalTag.globaltag = 'DESIGN60_V5::All' - -process.load('Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi') -process.load('Geometry.CommonDetUnit.globalTrackingGeometry_cfi') -process.load('Geometry.MuonNumbering.muonNumberingInitialization_cfi') -process.load('Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometryDB_cff') -process.load('Geometry.DTGeometryBuilder.idealForDigiDtGeometryDB_cff') -process.load('Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff') -process.load('Geometry.GEMGeometry.gemGeometry_cfi') -process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMXML_cfi') - - +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.Digi_cff') +process.load("Configuration.StandardSequences.L1Emulator_cff") +process.load("Configuration.StandardSequences.L1Extra_cff") +## global tag for 2019 upgrade studies +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgrade2019', '') -############## digi customization +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) ) -# GEM digitizer -process.load('SimMuon.GEMDigitizer.muonGEMDigis_cfi') +#process.Timing = cms.Service("Timing") +process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) -# GEM-CSC trigger pad digi producer -process.load('SimMuon.GEMDigitizer.muonGEMCSCPadDigis_cfi') +## upgrade CSC geometry customizations +runCSCforSLHC = True +if runCSCforSLHC: + from SLHCUpgradeSimulations.Configuration.muonCustoms import * + process = unganged_me1a_geometry(process) + process = digitizer_timing_pre3_median(process) +## upgrade CSC L1 customizations: GEM-CSC emulator +process.load('L1Trigger.CSCTriggerPrimitives.cscTriggerPrimitiveDigisPostLS1_cfi') +process.simCscTriggerPrimitiveDigis = process.cscTriggerPrimitiveDigisPostLS1.clone() +process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag('simMuonCSCDigis', 'MuonCSCComparatorDigi') +process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer = cms.InputTag('simMuonCSCDigis', 'MuonCSCWireDigi') + +## GEM-CSC bending angle library +process.simCscTriggerPrimitiveDigis.gemPadProducer = cms.untracked.InputTag("simMuonGEMCSCPadDigis","") +process.simCscTriggerPrimitiveDigis.clctSLHC.clctPidThreshPretrig = 2 +process.simCscTriggerPrimitiveDigis.clctParam07.clctPidThreshPretrig = 2 +process.simCscTriggerPrimitiveDigis.tmbSLHC.gemMatchDeltaEta = cms.untracked.double(0.08) +process.simCscTriggerPrimitiveDigis.tmbSLHC.gemMatchDeltaBX = cms.untracked.int32(1) + +## upgrade CSC TrackFinder +process.load('L1Trigger.CSCTrackFinder.csctfTrackDigisUngangedME1a_cfi') +process.csctfTrackDigisUngangedME1a.DTproducer = cms.untracked.InputTag("simDtTriggerPrimitiveDigis") +process.csctfTrackDigisUngangedME1a.SectorReceiverInput = cms.untracked.InputTag("simCscTriggerPrimitiveDigis","MPCSORTED") + +## upgrade L1Extra step +from SLHCUpgradeSimulations.Configuration.muonCustoms import customise_csc_L1Extra_allsim +process = customise_csc_L1Extra_allsim(process) +process.l1extraParticles.centralBxOnly = cms.bool(True) +process.l1extraParticles.produceMuonParticles = cms.bool(True) +process.l1extraParticles.produceCaloParticles = cms.bool(False) +process.l1extraParticles.ignoreHtMiss = cms.bool(False) + +## input commands +inputDir = '/pnfs/cms/WAX/11/store/user/lpcgem/dildick/dildick/pT5_1M_v1/DigiL1CSC-MuonGunPt5_1M/82325e40d6202e6fec2dd983c477f3ca/' +ls = os.listdir(inputDir) +process.source = cms.Source("PoolSource", + duplicateCheckMode = cms.untracked.string('noDuplicateCheck'), + inputCommands = cms.untracked.vstring('keep *_*_*_*'), + fileNames = cms.untracked.vstring( + [inputDir[16:] + x for x in ls if x.endswith('root')] + ) +) -# customization of the process.pdigi sequence to add the GEM digitizer -from SimMuon.GEMDigitizer.customizeGEMDigi import * -#process = customize_digi_addGEM(process) # run all detectors digi -process = customize_digi_addGEM_muon_only(process) # only muon+GEM digi -#process = customize_digi_addGEM_gem_only(process) # only GEM digi +physics = True +if not physics: + ## drop all unnecessary collections + process.source.inputCommands = cms.untracked.vstring( + 'keep *_*_*_*', + 'drop *_simCscTriggerPrimitiveDigis_*_*', + 'drop *_simCsctfTrackDigis_*_*', + 'drop *_simDttfDigis_*_*', + 'drop *_simCsctfDigis_*_*', + 'drop *_simGmtDigis_*_*', + 'drop *_l1extraParticles_*_*' + ) + +## output commands +theOutDir = '' +theFileName = 'out_L1.root' +process.output = cms.OutputModule("PoolOutputModule", + fileName = cms.untracked.string(theOutDir + theFileName), + outputCommands = cms.untracked.vstring('keep *_*_*_*') +) -from SLHCUpgradeSimulations.Configuration.muonCustoms import customise_csc_geom_cond_digi -process = customise_csc_geom_cond_digi(process) +physics = True +if not physics: + ## drop all unnecessary collections + process.output.outputCommands = cms.untracked.vstring( + 'keep *_*_*_*', + # drop all CF stuff + 'drop *_mix_*_*', + # drop tracker simhits + 'drop PSimHits_*_Tracker*_*', + # drop calorimetry stuff + 'drop PCaloHits_*_*_*', + 'drop L1Calo*_*_*_*', + 'drop L1Gct*_*_*_*', + # drop calorimetry l1extra + 'drop l1extraL1Em*_*_*_*', + 'drop l1extraL1Jet*_*_*_*', + 'drop l1extraL1EtMiss*_*_*_*', + # clean up simhits from other detectors + 'drop PSimHits_*_Totem*_*', + 'drop PSimHits_*_FP420*_*', + 'drop PSimHits_*_BSC*_*', + # drop some not useful muon digis and links + 'drop *_*_MuonCSCStripDigi_*', + 'drop *_*_MuonCSCStripDigiSimLinks_*', + 'drop *SimLink*_*_*_*', + 'drop *RandomEngineStates_*_*_*', + 'drop *_randomEngineStateProducer_*_*' + ) -############### upgrade CSC L1 customizations -process.load("Configuration.StandardSequences.L1Emulator_cff") -# unganged local stubs emilator: -process.load('L1Trigger.CSCTriggerPrimitives.cscTriggerPrimitiveDigisPostLS1_cfi') -process.simCscTriggerPrimitiveDigis = process.cscTriggerPrimitiveDigisPostLS1 - - -process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'simMuonCSCDigis', 'MuonCSCComparatorDigi' ) -process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer = cms.InputTag( 'simMuonCSCDigis', 'MuonCSCWireDigi' ) -if gem_match: - process.simCscTriggerPrimitiveDigis.gemPadProducer = cms.untracked.InputTag("simMuonGEMCSCPadDigis","") -process.simCscTriggerPrimitiveDigis.clctSLHC.clctPidThreshPretrig = min_clct_pattern -process.simCscTriggerPrimitiveDigis.clctParam07.clctPidThreshPretrig = min_clct_pattern -tmb = process.simCscTriggerPrimitiveDigis.tmbSLHC -tmb.gemMatchDeltaPhiOdd = cms.untracked.double(dphi_lct_pad[pt_dphi]['odd']) -tmb.gemMatchDeltaPhiEven = cms.untracked.double(dphi_lct_pad[pt_dphi]['even']) -tmb.gemMatchDeltaEta = cms.untracked.double(0.08) -tmb.gemMatchDeltaBX = cms.untracked.int32(1) -if lct_store_gemdphi: - tmb.gemClearNomatchLCTs = cms.untracked.bool(False) - tmb.gemMatchDeltaPhiOdd = cms.untracked.double(2.) - tmb.gemMatchDeltaPhiEven = cms.untracked.double(2.) +## custom sequences +process.mul1 = cms.Sequence( + process.SimL1MuTriggerPrimitives * + process.SimL1MuTrackFinders * + process.simRpcTriggerDigis * + process.simGmtDigis * + process.L1Extra +) +process.muL1Short = cms.Sequence( + process.simCscTriggerPrimitiveDigis * + process.SimL1MuTrackFinders * + process.simGmtDigis * + process.L1Extra +) -process.load('L1Trigger.CSCTrackFinder.csctfTrackDigisUngangedME1a_cfi') -process.simCsctfTrackDigis = process.csctfTrackDigisUngangedME1a -process.simCsctfTrackDigis.DTproducer = cms.untracked.InputTag("simDtTriggerPrimitiveDigis") -process.simCsctfTrackDigis.SectorReceiverInput = cms.untracked.InputTag("simCscTriggerPrimitiveDigis","MPCSORTED") -process.load("Configuration.StandardSequences.L1Extra_cff") -from SLHCUpgradeSimulations.Configuration.muonCustoms import customize_l1extra -process = customize_l1extra(process) -l1ep = process.l1extraParticles -l1ep.centralBxOnly = cms.bool(True) -l1ep.produceMuonParticles = cms.bool(True) -l1ep.produceCaloParticles = cms.bool(False) -l1ep.ignoreHtMiss = cms.bool(False) +## define path-steps +shortRun = False +if shortRun: + process.l1emu_step = cms.Path(process.muL1Short) +else: + process.l1emu_step = cms.Path(process.mul1) +process.endjob_step = cms.Path(process.endOfProcess) +process.out_step = cms.EndPath(process.output) +## Schedule definition +process.schedule = cms.Schedule( + process.l1emu_step, + process.endjob_step, + process.out_step +) +""" ################################################################################ # Input @@ -156,8 +182,9 @@ [inputDir[16:] + x for x in ls if x.endswith('root')] ) ) +""" - +""" ################################################################################ # Output @@ -189,45 +216,45 @@ 'drop *_randomEngineStateProducer_*_*' ) ) +""" +""" ################################################################################ -# custom sequences +# + +dir_muPt5_pu0 = '/pnfs/cms/WAX/11/store/user/lpcgem/dildick/dildick/pT5_1M_v1/DigiL1CSC-MuonGunPt5_1M/82325e40d6202e6fec2dd983c477f3ca/' +dir_muPt20_pu0 = '/pnfs/cms/WAX/11/store/user/lpcgem/dildick/dildick/pT20_1M_v1/DigiL1CSC-MuonGunPt20_1M/82325e40d6202e6fec2dd983c477f3ca/' +dir_muPt20_pu200 = '/pnfs/cms/WAX/11/store/user/lpcgem/dildick/dildick/muonGun_50k_pT20_lpcgem/DigiL1CSC-MuonGunPt20_50k-PU200/0de68e8f275fa8e4e39f6990099d44a2/' +dir_mb_pu100 = '/pnfs/cms/WAX/11/store/user/lpcgem/yasser1/yasser/NeutrinoGunPt5-40_v3/NeutrinoGun_pileup100_Pt5-40_50k_digi/6e54e2af5e7284c73c4665d7969fdf1d/' +dirPt2Pt50 = '/pnfs/cms/WAX/11/store/user/lpcgem/khotilov/khotilov/MuomGUN_SIM_Pt2-50_100k/MuonGun_DIGI_L1_Pt2-50_100k/29891ddb18281fff4c42a6e5f5d4bc55/' +dirWMu = '/pnfs/cms/WAX/11/store/user/lpcgem/dildick/dildick/WtoMuNu_test/WtoMuNu_test/58b3ea3c731a8657fd489c8437f5f991/' +inputDir = dir_muPt20_pu200 +inputDir = dir_muPt20_pu0 +inputDir = dir_mb_pu100 +inputDir = dirPt2Pt50 +#inputDir = dirWMu -process.mul1 = cms.Sequence( - process.SimL1MuTriggerPrimitives * - process.SimL1MuTrackFinders * - process.simRpcTriggerDigis * - process.simGmtDigis * - process.L1Extra -) +theOutDir = '' +theFileName = 'out.root' -process.muL1Short = cms.Sequence( - process.simCscTriggerPrimitiveDigis * - process.SimL1MuTrackFinders * - process.simGmtDigis * - process.L1Extra -) +min_clct_pattern = 2 +gem_match = False +gem_match = True -################################################################################ -# define path-steps +lct_store_gemdphi = False +#lct_store_gemdphi = True -process.gem_pads = cms.Path(process.simMuonGEMCSCPadDigis) -#process.l1emu_step = cms.Path(process.mul1) -process.l1emu_step = cms.Path(process.muL1Short) -process.endjob_step = cms.Path(process.endOfProcess) -process.out_step = cms.EndPath(process.output) +pt_dphi = 'pt40' -################################################################################ -# Schedule definition +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) ) -process.schedule = cms.Schedule( - process.gem_pads, - process.l1emu_step, - process.endjob_step, - process.out_step -) +#process.Timing = cms.Service("Timing") +process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) +from GEMCode.SimMuL1.GEMCSCdPhiLib import * +dphi_lct_pad = dphi_lct_pad98 +""" From 3274d5e93e1f0e0d8819d755253bafb6f3df4732 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 7 Oct 2013 15:35:50 +0200 Subject: [PATCH 155/182] bugfix --- SimMuL1/test/runCustomMuL1Trigger_cfg.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/SimMuL1/test/runCustomMuL1Trigger_cfg.py b/SimMuL1/test/runCustomMuL1Trigger_cfg.py index 0cdb2f73f530c..80ad7ca206e9f 100644 --- a/SimMuL1/test/runCustomMuL1Trigger_cfg.py +++ b/SimMuL1/test/runCustomMuL1Trigger_cfg.py @@ -60,16 +60,22 @@ process.l1extraParticles.ignoreHtMiss = cms.bool(False) ## input commands -inputDir = '/pnfs/cms/WAX/11/store/user/lpcgem/dildick/dildick/pT5_1M_v1/DigiL1CSC-MuonGunPt5_1M/82325e40d6202e6fec2dd983c477f3ca/' -ls = os.listdir(inputDir) + process.source = cms.Source("PoolSource", duplicateCheckMode = cms.untracked.string('noDuplicateCheck'), inputCommands = cms.untracked.vstring('keep *_*_*_*'), - fileNames = cms.untracked.vstring( - [inputDir[16:] + x for x in ls if x.endswith('root')] - ) + fileNames = cms.untracked.vstring('file:out_digi.root') ) +import os +useInputDir = False +if useInputDir: + inputDir = '/pnfs/cms/WAX/11/store/user/lpcgem/dildick/dildick/pT5_1M_v1/DigiL1CSC-MuonGunPt5_1M/82325e40d6202e6fec2dd983c477f3ca/' + ls = os.listdir(inputDir) + process.source.fileNames = cms.untracked.vstring( + [inputDir[16:] + x for x in ls if x.endswith('root')] + ) + physics = True if not physics: ## drop all unnecessary collections From 80d0b586b18e3362ec6f583f6f98f9e2344b4fe2 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 8 Oct 2013 02:30:05 +0200 Subject: [PATCH 156/182] Version for approval --- SimMuL1/scripts/highEfficiencyPatterns.py | 31 +++++++++++++++-------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/SimMuL1/scripts/highEfficiencyPatterns.py b/SimMuL1/scripts/highEfficiencyPatterns.py index 017e4f4602b53..07159325ad94e 100644 --- a/SimMuL1/scripts/highEfficiencyPatterns.py +++ b/SimMuL1/scripts/highEfficiencyPatterns.py @@ -115,12 +115,13 @@ def highEfficiencyPatterns(filesDir, plotDir, eff, oddEven, ext): c.SetGridx(1) c.SetGridy(1) c.cd() - h = TH1F(""," GEM-CSC bending Angle CMS Simulation Preliminary;Generated muon p_{T} [GeV/c];",50,0.,50.) + h = TH1F(""," GEM-CSC bending Angle CMS Phase-2 Simulation Preliminary;Generated muon p_{T} [GeV/c];",50,0.,50.) superscript = "p_{T}>p_{T}^{min}" subscript = "0" ## h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<|#Delta#phi_{0}^{WP}| Cut Efficiency"); ## h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<|#Delta#phi_{%s}^{%s}| Cut Efficiency"%(subscript,superscript)); - h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<#Delta#phi_{%s} Cut Efficiency"%(subscript)); +# h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<#Delta#phi_{%s} Cut Efficiency"%(subscript)); + h.GetYaxis().SetTitle("#Delta#phi_{(GEM,CSC)} cut efficiency"); h.GetYaxis().SetTitleOffset(.9) h.SetStats(0) @@ -138,11 +139,11 @@ def highEfficiencyPatterns(filesDir, plotDir, eff, oddEven, ext): if oddEven=="even": ok_dphi = TCut("TMath::Abs(dphi_pad_even) < %f"%(dphi)) denom_cut = ok_pad2_lct2_eta - closeFar = "Close" + closeFar = 'Even ("close")' else: ok_dphi = TCut("TMath::Abs(dphi_pad_odd) < %f"%(dphi)) denom_cut = ok_pad1_lct1_eta - closeFar = "Far" + closeFar = 'Odd ("far")' h2 = draw_eff(t, "", "h2", "(50,0.,50.)", "pt", denom_cut, ok_dphi, marker_colors[i], marker_styles[i]) @@ -151,13 +152,13 @@ def highEfficiencyPatterns(filesDir, plotDir, eff, oddEven, ext): h2.Draw("same") ## add legend - leg = TLegend(0.52,0.17,.93,0.57, "High efficiency patterns:", "brNDC") + leg = TLegend(0.55,0.15,.93,0.57, "High efficiency patterns:", "brNDC") for n in range(len(pt)): superscript = "\"%s\""%(pt_labels[n]) superscript = "p_{T}>%s"%(pt_labels[n]) - subscript = "0" + subscript = "(GEM,CSC)" #leg.AddEntry(histoList[n], "#Delta#phi_{%s}^{%s} = %.1f mrad"%(subscript,superscript,dphis[n]*1000), "p") - leg.AddEntry(histoList[n], "#Delta#phi_{%s} = %.1f mrad"%(subscript,dphis[n]*1000), "p") + leg.AddEntry(histoList[n], "#Delta#phi_{%s} < %.1f mrad"%(subscript,dphis[n]*1000), "p") #leg.AddEntry(histoList[n], "WP = %s"%(pt_labels[n]), "p") @@ -184,15 +185,25 @@ def highEfficiencyPatterns(filesDir, plotDir, eff, oddEven, ext): ## hardcore nitpicking over here! if closeFar == "Close": - xpos = 0.57 + xpos = 0.735 else: - xpos = 0.611 +# xpos = 0.611 + xpos = 0.735 - tex = TLatex(xpos,.75,'"%s" chamber pairs'%(closeFar)) + xpos = .7 + + + tex = TLatex(xpos,.75,"%s"%(closeFar)) tex.Draw("same") tex.SetTextSize(0.05) tex.SetNDC() + tex2 = TLatex(xpos,.68,"Chamber pairs") + tex2.Draw("same") + tex2.SetTextSize(0.05) + tex2.SetNDC() + + ## save the file c.SaveAs("%sGEM_highEffPatterns_%s_%s%s"%(plotDir, eff,oddEven,ext)) From 478d7f17a4ee460007332bcb64739a72879e7032 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 8 Oct 2013 20:39:56 +0200 Subject: [PATCH 157/182] Undoing bugfix --- GEMValidation/src/SimHitMatcher.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/GEMValidation/src/SimHitMatcher.cc b/GEMValidation/src/SimHitMatcher.cc index 40a8b97d43589..25e59f367513c 100644 --- a/GEMValidation/src/SimHitMatcher.cc +++ b/GEMValidation/src/SimHitMatcher.cc @@ -176,7 +176,8 @@ SimHitMatcher::matchSimHitsToSimTrack(std::vector track_ids, if (h.trackId() != track_id) continue; int pdgid = h.particleType(); if (simMuOnlyCSC_ && std::abs(pdgid) != 13) continue; - if (discardEleHitsCSC_ && std::abs(pdgid) == 11) continue; + // discard electron hits in the CSC chambers + if (discardEleHitsCSC_ && pdgid == 11) continue; csc_detid_to_hits_[ h.detUnitId() ].push_back(h); csc_hits_.push_back(h); @@ -188,7 +189,8 @@ SimHitMatcher::matchSimHitsToSimTrack(std::vector track_ids, if (h.trackId() != track_id) continue; int pdgid = h.particleType(); if (simMuOnlyGEM_ && std::abs(pdgid) != 13) continue; - if (discardEleHitsGEM_ && std::abs(pdgid) == 11) continue; + // discard electron hits in the GEM chambers + if (discardEleHitsGEM_ && pdgid == 11) continue; gem_detid_to_hits_[ h.detUnitId() ].push_back(h); gem_hits_.push_back(h); From 29d79a1a8c1d82f790e1ea9c869d76833d186cd9 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 9 Oct 2013 18:27:24 +0200 Subject: [PATCH 158/182] Update standard configuration for rechit analyzer --- GEMValidation/test/runGEMCSCAnalyzer_cfg.py | 5 +- GEMValidation/test/runGEMDigiAnalyzer_cfg.py | 5 +- .../test/runGEMRecHitAnalyzer_cfg.py | 144 ++---------------- .../test/runGEMSimHitAnalyzer_cfg.py | 3 +- 4 files changed, 13 insertions(+), 144 deletions(-) diff --git a/GEMValidation/test/runGEMCSCAnalyzer_cfg.py b/GEMValidation/test/runGEMCSCAnalyzer_cfg.py index 5b8f39be192d5..c7042596a385d 100644 --- a/GEMValidation/test/runGEMCSCAnalyzer_cfg.py +++ b/GEMValidation/test/runGEMCSCAnalyzer_cfg.py @@ -1,5 +1,3 @@ -#@ this configuration runs an analyzer on GEM and CSC stubs in input - import FWCore.ParameterSet.Config as cms process = cms.Process("GEMCSCANA") @@ -7,9 +5,10 @@ ## Standard sequence process.load('Configuration.StandardSequences.Services_cff') process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.Geometry.GeometryExtended2019Reco_cff') -process.load('Configuration.Geometry.GeometryExtended2019_cff') process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') ## TrackingComponentsRecord required for matchers diff --git a/GEMValidation/test/runGEMDigiAnalyzer_cfg.py b/GEMValidation/test/runGEMDigiAnalyzer_cfg.py index c73f5b1bb39d3..545836c4bf3b9 100644 --- a/GEMValidation/test/runGEMDigiAnalyzer_cfg.py +++ b/GEMValidation/test/runGEMDigiAnalyzer_cfg.py @@ -7,12 +7,9 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.Geometry.GeometryExtended2019Reco_cff') -process.load('Configuration.Geometry.GeometryExtended2019_cff') process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') process.load('Configuration.StandardSequences.EndOfProcess_cff') - - +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') ## TrackingComponentsRecord required for matchers process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorOpposite_cfi') diff --git a/GEMValidation/test/runGEMRecHitAnalyzer_cfg.py b/GEMValidation/test/runGEMRecHitAnalyzer_cfg.py index 5244b24d860b5..d13c3a8a39a7e 100644 --- a/GEMValidation/test/runGEMRecHitAnalyzer_cfg.py +++ b/GEMValidation/test/runGEMRecHitAnalyzer_cfg.py @@ -1,7 +1,8 @@ import FWCore.ParameterSet.Config as cms -process = cms.Process("Demo") +process = cms.Process("GEMRECOANA") +## Standard sequence process.load('Configuration.StandardSequences.Services_cff') process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') @@ -9,151 +10,24 @@ process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgrade2019', '') +## TrackingComponentsRecord required for matchers process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorOpposite_cfi') process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAlong_cfi') -process.load("FWCore.MessageService.MessageLogger_cfi") -# process.load("Geometry.MuonCommonData.muonIdealGeometryXML_cfi") -# process.load("Geometry.CMSCommonData.cmsExtendedGeometryPostLS1XML_cfi") -# process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMXML_cfi') -# process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMr08v01XML_cfi') -# process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMr10v01XML_cfi') -#process.load("Geometry.GEMGeometry.gemGeometry_cfi") -#process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi") +## global tag for 2019 upgrade studies +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgrade2019', '') # the analyzer configuration process.load('GEMCode.GEMValidation.GEMRecHitAnalyzer_cfi') process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_100_1_JLq.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_101_1_mKP.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_102_1_h9a.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_103_1_gcC.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_104_1_9HF.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_105_1_4bB.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_106_1_wib.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_107_1_BoS.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_108_1_RS8.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_109_1_SI6.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_10_1_cKF.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_110_1_Xvl.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_111_1_gJs.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_112_1_s5m.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_113_1_2KT.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_114_1_clo.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_115_1_CXA.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_116_1_AIM.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_117_1_d6g.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_118_1_iNX.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_119_1_oZf.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_11_1_0UJ.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_120_1_wJo.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_12_1_jvQ.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_13_1_Uoe.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_14_1_Ofj.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_15_1_GXF.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_16_1_IXM.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_17_1_zJi.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_18_1_rtb.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_19_1_wBb.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_1_1_WyQ.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_20_1_f7z.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_21_1_E0J.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_22_1_wAO.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_23_1_AZC.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_24_1_SZA.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_25_1_8Yv.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_26_1_FJ3.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_27_1_Cui.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_28_1_Q7o.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_29_1_2BT.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_2_1_5h6.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_30_1_Pxq.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_31_1_Ln1.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_32_1_AR7.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_33_1_T9e.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_34_1_Er9.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_35_1_AN1.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_36_1_PWN.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_37_1_qBu.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_38_1_J94.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_39_1_NGX.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_3_1_Fr3.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_40_1_CR7.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_41_1_Dwz.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_42_1_jiT.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_43_1_ChL.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_44_1_bFZ.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_45_1_CmY.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_46_1_tUo.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_47_1_Jk5.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_48_1_jSR.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_49_1_EPN.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_4_1_Ugx.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_50_1_UT2.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_51_1_RGM.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_52_1_vYq.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_53_1_wLK.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_54_1_dfi.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_55_1_3fb.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_56_1_Jtg.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_57_1_IKJ.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_58_1_RQR.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_59_1_7I5.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_5_1_uke.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_60_1_qKf.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_61_1_1l4.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_62_1_6og.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_63_1_bUV.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_64_1_PmI.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_65_1_hCH.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_66_1_dhy.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_67_1_aQs.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_68_1_sC5.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_69_1_gFr.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_6_1_Cgv.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_70_1_UdN.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_71_1_aa8.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_72_1_L9G.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_73_1_e3L.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_74_1_4Up.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_75_1_h5Q.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_76_1_LoO.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_77_1_mCH.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_78_1_OvE.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_79_1_Cgh.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_7_1_ykg.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_80_1_KqP.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_81_1_8iB.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_82_1_tyW.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_83_1_HQj.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_84_1_bzt.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_85_1_HBS.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_86_1_M9u.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_87_1_Tv7.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_88_1_bQb.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_89_1_RkM.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_8_1_5vr.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_90_1_UVC.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_91_1_eRa.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_92_1_Mid.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_93_1_Xwd.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_94_1_3kT.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_95_1_gjd.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_96_1_Kmu.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_97_1_dyN.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_98_1_dxh.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_99_1_bwf.root', - 'file:/lustre/cms/store/user/calabria/calabria_SingleMuPt5_1000_GEN-SIM_CMSSW_6_1_2_SLHC6_patch1_v2/calabria_SingleMuPt5_1000_RECO-GEM_RecHits_CMSSW_6_1_2_SLHC6_patch1_v2/42a9166cac48036c69e0af3a481cbff4/step_GEM_LocalReco_9_1_deK.root', +process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) - ) +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring('file:out_rechit.root') ) process.TFileService = cms.Service("TFileService", diff --git a/GEMValidation/test/runGEMSimHitAnalyzer_cfg.py b/GEMValidation/test/runGEMSimHitAnalyzer_cfg.py index 4d1f1bb0917da..80c0daca51ec8 100644 --- a/GEMValidation/test/runGEMSimHitAnalyzer_cfg.py +++ b/GEMValidation/test/runGEMSimHitAnalyzer_cfg.py @@ -7,10 +7,9 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.Geometry.GeometryExtended2019Reco_cff') -process.load('Configuration.Geometry.GeometryExtended2019_cff') process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') ## TrackingComponentsRecord required for matchers process.load('TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorOpposite_cfi') From a9beb7a67203d5acf50f8b2cf2a9f6b9372aad1c Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 9 Oct 2013 11:36:08 -0500 Subject: [PATCH 159/182] Updated configuration for efficiency analyzer --- SimMuL1/plugins/GEMCSCTriggerEfficiency.cc | 11 +- SimMuL1/plugins/GEMCSCTriggerEfficiency.h | 7 +- SimMuL1/python/GEMCSCTriggerEfficiency_cfi.py | 40 +- .../test/runGEMCSCTriggerEfficiency_cfg.py | 544 +++--------------- 4 files changed, 120 insertions(+), 482 deletions(-) diff --git a/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc b/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc index 04c37ff19e386..1906dda851500 100644 --- a/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc +++ b/SimMuL1/plugins/GEMCSCTriggerEfficiency.cc @@ -182,7 +182,7 @@ GEMCSCTriggerEfficiency::GEMCSCTriggerEfficiency(const edm::ParameterSet& iConfi edm::ParameterSet stripPSet = iConfig.getParameter("strips"); theStripConditions = new CSCDbStripConditions(stripPSet); - CSCTFSPset = iConfig.getParameter("SectorProcessor"); + CSCTFSPset = iConfig.getParameter("sectorProcessor"); ptLUTset = CSCTFSPset.getParameter("PTLUT"); edm::ParameterSet srLUTset = CSCTFSPset.getParameter("SRLUT"); @@ -215,7 +215,7 @@ GEMCSCTriggerEfficiency::GEMCSCTriggerEfficiency(const edm::ParameterSet& iConfi // processed event counter nevt = 0; - gemMatchCfg_ = iConfig.getParameterSet("simTrackGEMMatching"); + gemMatchCfg_ = iConfig.getParameterSet("simTrackMatching"); gemPTs_ = iConfig.getParameter >("gemPTs"); gemDPhisOdd_ = iConfig.getParameter >("gemDPhisOdd"); gemDPhisEven_ = iConfig.getParameter >("gemDPhisEven"); @@ -876,8 +876,8 @@ GEMCSCTriggerEfficiency::resetDbg(DbgStruct& d) // ================================================================================================ // ------------ method called to for each event ------------ -bool -GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) +void +GEMCSCTriggerEfficiency::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { nevt++; @@ -1252,7 +1252,7 @@ GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& iSetu } if ( primaryVert == -1 ) { if (debugALLEVENT) std::cout<<" Warning: NO PRIMARY SIMVERTEX!"<0) return 0; + if (simTracks.size()>0) return; } @@ -2595,7 +2595,6 @@ GEMCSCTriggerEfficiency::filter(edm::Event& iEvent, const edm::EventSetup& iSetu matches.clear (); cleanUp(); - return true; } diff --git a/SimMuL1/plugins/GEMCSCTriggerEfficiency.h b/SimMuL1/plugins/GEMCSCTriggerEfficiency.h index 33f7f7a9deb87..8cf51e7b01a58 100644 --- a/SimMuL1/plugins/GEMCSCTriggerEfficiency.h +++ b/SimMuL1/plugins/GEMCSCTriggerEfficiency.h @@ -7,7 +7,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -79,7 +79,7 @@ class CSCTFDTReceiver; class CSCStripConditions; -class GEMCSCTriggerEfficiency : public edm::EDFilter +class GEMCSCTriggerEfficiency : public edm::EDAnalyzer { public: @@ -213,8 +213,7 @@ class GEMCSCTriggerEfficiency : public edm::EDFilter // methods virtual void beginJob() ; - //virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual bool filter(edm::Event&, const edm::EventSetup&); + virtual void analyze(const edm::Event&, const edm::EventSetup&); virtual void endJob() ; diff --git a/SimMuL1/python/GEMCSCTriggerEfficiency_cfi.py b/SimMuL1/python/GEMCSCTriggerEfficiency_cfi.py index 77cca8d702ccb..3b12e7115c7c9 100644 --- a/SimMuL1/python/GEMCSCTriggerEfficiency_cfi.py +++ b/SimMuL1/python/GEMCSCTriggerEfficiency_cfi.py @@ -1 +1,39 @@ -GEMCSCTriggerEfficiency_cfi.py +import FWCore.ParameterSet.Config as cms + +from GEMCode.GEMValidation.simTrackMatching_cfi import SimTrackMatching + +GEMCSCTriggerEfficiency = cms.EDAnalyzer("GEMCSCTriggerEfficiency", + doME1a = cms.untracked.bool(True), + defaultME1a = cms.untracked.bool(False), + gangedME1a = cms.untracked.bool(False), + minBxALCT = cms.untracked.int32(5), + maxBxALCT = cms.untracked.int32(7), + minBxCLCT = cms.untracked.int32(5), + maxBxCLCT = cms.untracked.int32(7), + minBxLCT = cms.untracked.int32(5), + maxBxLCT = cms.untracked.int32(7), + minBxMPLCT = cms.untracked.int32(5), + maxBxMPLCT = cms.untracked.int32(7), + doStrictSimHitToTrackMatch = cms.untracked.bool(True), + matchAllTrigPrimitivesInChamber = cms.untracked.bool(True), + minDeltaWire = cms.untracked.int32(-2), + maxDeltaWire = cms.untracked.int32(2), + minDeltaStrip = cms.untracked.int32(2), + lightRun = cms.untracked.bool(False), + minNStWith4Hits = cms.untracked.int32(0), + requireME1With4Hits = cms.untracked.bool(False), + gemPTs = cms.vdouble(0., 6., 10., 15., 20., 30., 40.), + gemDPhisOdd = cms.vdouble(1., 0.0182579, 0.01066 , 0.00722795 , 0.00562598 , 0.00416544 , 0.00342827), + gemDPhisEven = cms.vdouble(1., 0.00790009, 0.00483286, 0.0036323, 0.00304879, 0.00253782, 0.00230833), + minSimTrackDR = cms.untracked.double(0.0), + minSimTrPt = cms.untracked.double(2.), + minSimTrPhi = cms.untracked.double(-9.), + maxSimTrPhi = cms.untracked.double(9.), + minSimTrEta = cms.untracked.double(-2.5), + maxSimTrEta = cms.untracked.double(2.5), + invertSimTrPhiEta = cms.untracked.bool(False), + goodChambersOnly = cms.untracked.bool(False), + sectorProcessor = cms.untracked.PSet(), + simTrackMatching = SimTrackMatching, + strips = cms.untracked.PSet() +) diff --git a/SimMuL1/test/runGEMCSCTriggerEfficiency_cfg.py b/SimMuL1/test/runGEMCSCTriggerEfficiency_cfg.py index 88c421b349ce5..0fcdc440a1592 100644 --- a/SimMuL1/test/runGEMCSCTriggerEfficiency_cfg.py +++ b/SimMuL1/test/runGEMCSCTriggerEfficiency_cfg.py @@ -1,118 +1,49 @@ import FWCore.ParameterSet.Config as cms +import sys, os # Hack to add "test" directory to the python path. -import sys, os sys.path.insert(0, os.path.join(os.environ['CMSSW_BASE'], 'src/L1Trigger/CSCTriggerPrimitives/test')) sys.path.insert(0, os.path.join(os.environ['CMSSW_BASE'], 'src')) -process = cms.Process('simmul') - -##### parameters ##### +## initialization +process = cms.Process('GEMCSCTRGANA') -theNumberOfEvents = 1000000 +## CMSSW RELEASE +cmssw = os.getenv( "CMSSW_VERSION" ) +## steering +events = 1000 defaultEmu = False ganged = True ganged = False +pileup='000' +sample='dimu' +globalTag = 'upgrade2019' +#sample='minbias' -w=61 -w=3 -#w=11 -#w=7 - -neutron='' -#neutron='n' -#neutron='hn' -#neutron='rn' - -ptMethod = 33 - - -theME42='' -#theME42='_nome42' -#theME42='_tfbx2' -#theME42='_no1' -#theME42='_mpc18' - - -deltaMatch=2 - -minTrackDR = 0.4 -minTrackDR = 0.0 - -theMinSimTrEta = 0.8 -theMinSimTrEta = -2.5 -theMaxSimTrEta = 2.5 - -need2StWith4Hits = True -needME1With4Hits = False - -## include library of trigger samples +## input from GEMCode.SimMuL1.GEMCSCTriggerSamplesLib import files suffix = '_gem_dphi_pat2_PU0' inputDir = files[suffix] +theInputFiles = [] +import os +for d in range(len(inputDir)): + my_dir = inputDir[d] + if not os.path.isdir(my_dir): + print "ERROR: This is not a valid directory: ", my_dir + if d==len(inputDir)-1: + print "ERROR: No input files were selected" + exit() + continue + print "Proceed to next directory" + ls = os.listdir(my_dir) + theInputFiles.extend([my_dir[16:] + x for x in ls if x.endswith('root')]) + +inputFiles = ['file:out_SingleMuPt10Fwd_GEM2019_8PartIncRad_DIGI_L1.root'] +print "InputFiles: ", inputFiles -##### end parameters ##### - -thePU='000' -#thePU='050' -#thePU='100' -#thePU='200' - -theProc='dimu' -#theProc='minbias' - -thePre='' -#thePre='_pre2' -thePre='_pre3' - -theStep = 50 - -print "proc=%s PU=%s step=%d"%(theProc,thePU,theStep) - - -if (theStep<=5): defaultEmu = True - - -if theProc=='minbias': - minTrackDR = 0. - need2StWith4Hits = False - needME1With4Hits = False - - - -if theStep==3: - theMinSimTrEta = 0.8 - #theMinSimTrEta = -2.1 - theMaxSimTrEta = 2.1 - - - -#theName = theProc+'_pu'+thePU+'_step_'+str(theStep) -#theName = theProc+'_pu'+thePU+'_redigi_'+str(theStep) -theName = theProc+'_'+neutron+'pu'+thePU+'_step_'+str(theStep)+thePre - -#theFileList = 'files_'+theProc+'_3_6_2_'+neutron+'pu'+thePU+'_me42_me1a_2pi.txt' -theInputName = 'file:/tmp/out_'+theName+theME42+'.root' -#theHistoFileName = 'hf_'+theProc+'_3_6_2_'+neutron+'pu'+thePU+'_me42_me1a_2pi_step'+str(theStep)+'.root' -#theHistoFileName = 'hf_'+theProc+'_3_6_2_'+neutron+'pu'+thePU+'_me42_me1a_2pi_redigi'+str(theStep)+'.root' -theFileList = 'files_'+theProc+'_3_6_2_'+neutron+'pu'+thePU+'_me42_me1a_2pi'+thePre+'.txt' -theHistoFileName = 'hp_'+theProc+'_6_0_1_POSTLS161_V12_'+'_'+neutron+'pu'+thePU+'_w'+str(w)+theME42+suffix+'.root' - -if ganged: - theName = theProc+'_'+neutron+'pu'+thePU+'_g_step_'+str(theStep)+thePre+'' - theInputName = 'file:/tmp/out_'+theName+theME42+'.root' - theHistoFileName = 'hp_'+theProc+'_6_0_1_POSTLS161_V12_'+'_'+neutron+'pu'+thePU+'_w'+str(w)+theME42+suffix+'.root' - -#theHistoFileName = "h_Zmumu_pu400_2pi.root" -#theHistoFileName = "h_me42_me1a_dimu_nopu.root" -#theHistoFileName = "h_me42_me1a_dimu_pu400.root" -#theHistoFileName = "h_me42_me1a_dimu_pu400.root" - -print theHistoFileName - - -readout_windows = [ [5,7],[5,7],[5,7],[5,7] ] +## readout windows +w=3 if w==3: readout_windows = [ [5,7],[5,7],[5,7],[5,7] ] if w==11: @@ -122,110 +53,74 @@ if w==61: readout_windows = [ [5,10],[1,11],[1,11],[1,11] ] - -#theInputName = 'file:/uscmst1b_scratch/lpc1/lpctau/khotilov/condor/dimu_2_2_3_pu001_2pi/out_204_1500evt.root' -#theHistoFileName = 'hh_'+theProc+'_2_2_3_pu001_me42_2pi.root' -#theFileList = 'files_dimu_2_2_3_pu001_me42_2pi.txt' - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(theNumberOfEvents) -) +## output +outputFileName = 'hp_' + sample + "_" + cmssw + "_" + globalTag + "_pu%s"%(pileup) + '_w%d'%(w) + suffix + '_eff.root' +outputFileName = 'gem_trigger_eff_ana.root' +print "outputFile:", outputFileName # import of standard configurations +process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.StandardSequences.Services_cff') -#process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -#process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_noesprefer_cff') -#process.load('FrontierConditions_GlobalTag_noesprefer_cff') -process.load('L1TriggerConfig.L1ScalesProducers.L1MuTriggerScalesConfig_cff') -#process.load("Configuration.StandardSequences.Reconstruction_cff") process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.Geometry.GeometryExtended2019Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2019_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgrade2019', '') +process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +process.load('L1TriggerConfig.L1ScalesProducers.L1MuTriggerScalesConfig_cff') process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") - -#process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi") -#process.load('Configuration.StandardSequences.GeometryDB_cff') -process.load('Configuration.Geometry.GeometryExtendedPostLS1Reco_cff') - -process.load('Geometry.GEMGeometry.cmsExtendedGeometryPostLS1plusGEMXML_cfi') -#process.load('Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi') -#process.load('Geometry.CommonDetUnit.globalTrackingGeometry_cfi') -#process.load('Geometry.MuonNumbering.muonNumberingInitialization_cfi') -#process.load('Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometryDB_cff') -#process.load('Geometry.DTGeometryBuilder.idealForDigiDtGeometryDB_cff') -#process.load('Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff') -process.load('Geometry.GEMGeometry.gemGeometry_cfi') - - process.load('Configuration.StandardSequences.Digi_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') process.load("Configuration.StandardSequences.L1Emulator_cff") process.load("Configuration.StandardSequences.L1Extra_cff") - process.load("RecoMuon.TrackingTools.MuonServiceProxy_cff") - -process.load('Configuration.StandardSequences.MagneticField_cff') -# Parametrized magnetic field (new mapping) -process.VolumeBasedMagneticFieldESProducer.useParametrizedTrackerField = True - process.load("SimMuon.CSCDigitizer.muonCSCDigis_cfi") - - process.load('L1Trigger.CSCTrackFinder.csctfTrackDigisUngangedME1a_cfi') -process.simCsctfTrackDigis = process.csctfTrackDigisUngangedME1a +process.simCsctfTrackDigis = process.csctfTrackDigisUngangedME1a.clone() process.simCsctfTrackDigis.DTproducer = cms.untracked.InputTag("simDtTriggerPrimitiveDigis") process.simCsctfTrackDigis.SectorReceiverInput = cms.untracked.InputTag("simCscTriggerPrimitiveDigis","MPCSORTED") process.simCsctfTrackDigis.SectorProcessor.isCoreVerbose = cms.bool(True) - -################################################################################ - -process.load("CSCTriggerPrimitivesReader_cfi") - +process.load('CSCTriggerPrimitivesReader_cfi') process.lctreader.debug = False process.lctreader.dataLctsIn = False process.lctreader.CSCLCTProducerEmul = "simCscTriggerPrimitiveDigis" process.lctreader.CSCComparatorDigiProducer = cms.InputTag("simMuonCSCDigis","MuonCSCComparatorDigi") process.lctreader.CSCWireDigiProducer = cms.InputTag("simMuonCSCDigis","MuonCSCWireDigi") -################################################################################ - process.options = cms.untracked.PSet( -# Rethrow = cms.untracked.vstring('ProductNotFound'), -# FailPath = cms.untracked.vstring('ProductNotFound'), makeTriggerResults = cms.untracked.bool(False), wantSummary = cms.untracked.bool(True) ) -theInputFiles = [] -import os -for d in range(len(inputDir)): - my_dir = inputDir[d] - if not os.path.isdir(my_dir): - print "ERROR: This is not a valid directory: ", my_dir - if d==len(inputDir)-1: - print "ERROR: No input files were selected" - exit() - continue - print "Proceed to next directory" - ls = os.listdir(my_dir) - theInputFiles.extend([my_dir[16:] + x for x in ls if x.endswith('root')]) - -print theInputFiles process.source = cms.Source("PoolSource", duplicateCheckMode = cms.untracked.string('noDuplicateCheck'), -# inputCommands = cms.untracked.vstring( -# 'keep *_*_*_*', -# 'drop *_simDtTriggerPrimitiveDigis_*_MUTRG' -# ), fileNames = cms.untracked.vstring( - *theInputFiles + *inputFiles ) ) -process.TFileService = cms.Service("TFileService", - fileName = cms.string(theHistoFileName) +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(events) ) +process.TFileService = cms.Service("TFileService", + fileName = cms.string(outputFileName) +) -from GEMCode.GEMValidation.simTrackMatching_cfi import SimTrackMatching +process.load('GEMCode.SimMuL1.GEMCSCTriggerEfficiency_cfi') +process.GEMCSCTriggerEfficiency.sectorProcessor = process.simCsctfTrackDigis.SectorProcessor +process.GEMCSCTriggerEfficiency.strips = process.simMuonCSCDigis.strips +process.GEMCSCTriggerEfficiency.minBxALCT = readout_windows[0][0] +process.GEMCSCTriggerEfficiency.maxBxALCT = readout_windows[0][1] +process.GEMCSCTriggerEfficiency.minBxCLCT = readout_windows[1][0] +process.GEMCSCTriggerEfficiency.maxBxCLCT = readout_windows[1][1] +process.GEMCSCTriggerEfficiency.minBxLCT = readout_windows[2][0] +process.GEMCSCTriggerEfficiency.maxBxLCT = readout_windows[2][1] +process.GEMCSCTriggerEfficiency.minBxMPLCT = readout_windows[3][0] +process.GEMCSCTriggerEfficiency.maxBxMPLCT = readout_windows[3][1] +process.GEMCSCTriggerEfficiency.simTrackMatching.gemRecHitInput = "" #SimTrackMatching.verboseSimHit = 1 #SimTrackMatching.verboseGEMDigi = 1 #SimTrackMatching.verboseCSCDigi = 1 @@ -235,315 +130,22 @@ #SimTrackMatching.discardEleHitsCSC = False #SimTrackMatching.discardEleHitsGEM = False +## SLHC customization +from SLHCUpgradeSimulations.Configuration.muonCustoms import * +process = unganged_me1a_geometry(process) +process = customise_csc_L1Extra_allsim(process) - -process.SimMuL1StrictAll = cms.EDFilter("GEMCSCTriggerEfficiency", - doStrictSimHitToTrackMatch = cms.untracked.bool(True), - matchAllTrigPrimitivesInChamber = cms.untracked.bool(True), - -# minDeltaWire = cms.untracked.int32(-2), -# maxDeltaWire = cms.untracked.int32(0), -# minDeltaStrip = cms.untracked.int32(1), - minDeltaWire = cms.untracked.int32(-1*deltaMatch), - maxDeltaWire = cms.untracked.int32(deltaMatch), - minDeltaStrip = cms.untracked.int32(deltaMatch), - - minNStWith4Hits = cms.untracked.int32(0), - requireME1With4Hits = cms.untracked.bool(False), - - simTrackGEMMatching = SimTrackMatching.clone(), - gemPTs = cms.vdouble(0., 6., 10., 15., 20., 30., 40.), - gemDPhisOdd = cms.vdouble(1., 0.0182579, 0.01066 , 0.00722795 , 0.00562598 , 0.00416544 , 0.00342827), - gemDPhisEven = cms.vdouble(1., 0.00790009, 0.00483286, 0.0036323, 0.00304879, 0.00253782, 0.00230833), - - doME1a = cms.untracked.bool(True), - defaultME1a = cms.untracked.bool(defaultEmu), - gangedME1a = cms.untracked.bool(ganged), - - lightRun = cms.untracked.bool(False), - -# debugALLEVENT = cms.untracked.int32(1), -# debugINHISTOS = cms.untracked.int32(1), -# debugALCT = cms.untracked.int32(1), -# debugCLCT = cms.untracked.int32(1), -# debugLCT = cms.untracked.int32(1), -# debugMPLCT = cms.untracked.int32(1), -# debugTFTRACK = cms.untracked.int32(1), -# debugTFCAND = cms.untracked.int32(1), -# debugGMTCAND = cms.untracked.int32(1), -# debugL1EXTRA = cms.untracked.int32(1), -## debugRATE = cms.untracked.int32(1), - - minBxALCT = cms.untracked.int32(readout_windows[0][0]), - maxBxALCT = cms.untracked.int32(readout_windows[0][1]), - minBxCLCT = cms.untracked.int32(readout_windows[1][0]), - maxBxCLCT = cms.untracked.int32(readout_windows[1][1]), - minBxLCT = cms.untracked.int32(readout_windows[2][0]), - maxBxLCT = cms.untracked.int32(readout_windows[2][1]), - minBxMPLCT = cms.untracked.int32(readout_windows[3][0]), - maxBxMPLCT = cms.untracked.int32(readout_windows[3][1]), - - minSimTrackDR = cms.untracked.double(minTrackDR), - - minSimTrPt = cms.untracked.double(2.), - minSimTrPhi = cms.untracked.double(-9.), - maxSimTrPhi = cms.untracked.double(9.), - #minSimTrEta = cms.untracked.double(0.8), - minSimTrEta = cms.untracked.double(theMinSimTrEta), - maxSimTrEta = cms.untracked.double(theMaxSimTrEta), - invertSimTrPhiEta = cms.untracked.bool(False), - - #PTLUT = cms.PSet( - # LowQualityFlag = cms.untracked.uint32(4), - # ReadPtLUT = cms.bool(False), - # PtMethod = cms.untracked.uint32(ptMethod) - #), - SectorProcessor = process.simCsctfTrackDigis.SectorProcessor, - - goodChambersOnly = cms.untracked.bool(False), - strips = process.simMuonCSCDigis.strips -) - -process.SimMuL1StrictAll0 = cms.EDFilter("SimMuL1_Eff", - doStrictSimHitToTrackMatch = cms.untracked.bool(True), - matchAllTrigPrimitivesInChamber = cms.untracked.bool(True), - - minBX = cms.untracked.int32(0), - maxBX = cms.untracked.int32(0), - #centralBxOnlyGMT = cms.untracked.bool(False), - - minBxALCT = cms.untracked.int32(readout_windows[0][0]), - maxBxALCT = cms.untracked.int32(readout_windows[0][1]), - minBxCLCT = cms.untracked.int32(readout_windows[1][0]), - maxBxCLCT = cms.untracked.int32(readout_windows[1][1]), - minBxLCT = cms.untracked.int32(readout_windows[2][0]), - maxBxLCT = cms.untracked.int32(readout_windows[2][1]), - minBxMPLCT = cms.untracked.int32(readout_windows[3][0]), - maxBxMPLCT = cms.untracked.int32(readout_windows[3][1]), - - minSimTrPt = cms.untracked.double(2.), - minSimTrPhi = cms.untracked.double(-9.), - maxSimTrPhi = cms.untracked.double(9.), - minSimTrEta = cms.untracked.double(0.8), - maxSimTrEta = cms.untracked.double(2.5), - invertSimTrPhiEta = cms.untracked.bool(False), - - goodChambersOnly = cms.untracked.bool(False), - strips = process.simMuonCSCDigis.strips -) - -process.SimMuL1StrictAllPLUS = cms.EDFilter("SimMuL1_Eff", - doStrictSimHitToTrackMatch = cms.untracked.bool(True), - matchAllTrigPrimitivesInChamber = cms.untracked.bool(True), - - minBxALCT = cms.untracked.int32(readout_windows[0][0]), - maxBxALCT = cms.untracked.int32(readout_windows[0][1]), - minBxCLCT = cms.untracked.int32(readout_windows[1][0]), - maxBxCLCT = cms.untracked.int32(readout_windows[1][1]), - minBxLCT = cms.untracked.int32(readout_windows[2][0]), - maxBxLCT = cms.untracked.int32(readout_windows[2][1]), - minBxMPLCT = cms.untracked.int32(readout_windows[3][0]), - maxBxMPLCT = cms.untracked.int32(readout_windows[3][1]), - - minSimTrPt = cms.untracked.double(2.), - minSimTrPhi = cms.untracked.double(-9.), - maxSimTrPhi = cms.untracked.double(9.), - minSimTrEta = cms.untracked.double(0.8), - maxSimTrEta = cms.untracked.double(2.5), - invertSimTrPhiEta = cms.untracked.bool(False), - - goodChambersOnly = cms.untracked.bool(False), - strips = process.simMuonCSCDigis.strips, - - lookAtTrackCondition = cms.untracked.int32(1) -) - -process.SimMuL1StrictAllMINUS = cms.EDFilter("SimMuL1_Eff", - doStrictSimHitToTrackMatch = cms.untracked.bool(True), - matchAllTrigPrimitivesInChamber = cms.untracked.bool(True), - - minBxALCT = cms.untracked.int32(readout_windows[0][0]), - maxBxALCT = cms.untracked.int32(readout_windows[0][1]), - minBxCLCT = cms.untracked.int32(readout_windows[1][0]), - maxBxCLCT = cms.untracked.int32(readout_windows[1][1]), - minBxLCT = cms.untracked.int32(readout_windows[2][0]), - maxBxLCT = cms.untracked.int32(readout_windows[2][1]), - minBxMPLCT = cms.untracked.int32(readout_windows[3][0]), - maxBxMPLCT = cms.untracked.int32(readout_windows[3][1]), - - minSimTrPt = cms.untracked.double(2.), - minSimTrPhi = cms.untracked.double(-9.), - maxSimTrPhi = cms.untracked.double(9.), - minSimTrEta = cms.untracked.double(0.8), - maxSimTrEta = cms.untracked.double(2.5), - invertSimTrPhiEta = cms.untracked.bool(False), - - goodChambersOnly = cms.untracked.bool(False), - strips = process.simMuonCSCDigis.strips, - - lookAtTrackCondition = cms.untracked.int32(-1) -) - -process.SimMuL1Strict = cms.EDFilter("SimMuL1_Eff", - doStrictSimHitToTrackMatch = cms.untracked.bool(True), - matchAllTrigPrimitivesInChamber = cms.untracked.bool(False), - - minDeltaWire = cms.untracked.int32(0), - maxDeltaWire = cms.untracked.int32(2), - minDeltaStrip = cms.untracked.int32(1), - - doME1a = cms.untracked.bool(True), - defaultME1a = cms.untracked.bool(defaultEmu), - gangedME1a = cms.untracked.bool(ganged), - - minBxALCT = cms.untracked.int32(readout_windows[0][0]), - maxBxALCT = cms.untracked.int32(readout_windows[0][1]), - minBxCLCT = cms.untracked.int32(readout_windows[1][0]), - maxBxCLCT = cms.untracked.int32(readout_windows[1][1]), - minBxLCT = cms.untracked.int32(readout_windows[2][0]), - maxBxLCT = cms.untracked.int32(readout_windows[2][1]), - minBxMPLCT = cms.untracked.int32(readout_windows[3][0]), - maxBxMPLCT = cms.untracked.int32(readout_windows[3][1]), - - minSimTrPt = cms.untracked.double(2.), - minSimTrPhi = cms.untracked.double(-9.), - maxSimTrPhi = cms.untracked.double(9.), - minSimTrEta = cms.untracked.double(0.8), - maxSimTrEta = cms.untracked.double(2.5), - invertSimTrPhiEta = cms.untracked.bool(False), - - goodChambersOnly = cms.untracked.bool(False), - strips = process.simMuonCSCDigis.strips -) - -process.SimMuL1 = cms.EDFilter("SimMuL1_Eff", - doStrictSimHitToTrackMatch = cms.untracked.bool(False), - matchAllTrigPrimitivesInChamber = cms.untracked.bool(False), - - minDeltaWire = cms.untracked.int32(0), - maxDeltaWire = cms.untracked.int32(2), - minDeltaStrip = cms.untracked.int32(1), - - doME1a = cms.untracked.bool(True), - defaultME1a = cms.untracked.bool(defaultEmu), - gangedME1a = cms.untracked.bool(ganged), - - minBxALCT = cms.untracked.int32(readout_windows[0][0]), - maxBxALCT = cms.untracked.int32(readout_windows[0][1]), - minBxCLCT = cms.untracked.int32(readout_windows[1][0]), - maxBxCLCT = cms.untracked.int32(readout_windows[1][1]), - minBxLCT = cms.untracked.int32(readout_windows[2][0]), - maxBxLCT = cms.untracked.int32(readout_windows[2][1]), - minBxMPLCT = cms.untracked.int32(readout_windows[3][0]), - maxBxMPLCT = cms.untracked.int32(readout_windows[3][1]), - - minSimTrPt = cms.untracked.double(2.), - minSimTrPhi = cms.untracked.double(-9.), - maxSimTrPhi = cms.untracked.double(9.), - minSimTrEta = cms.untracked.double(0.8), - maxSimTrEta = cms.untracked.double(2.5), - invertSimTrPhiEta = cms.untracked.bool(False), - - goodChambersOnly = cms.untracked.bool(False), - strips = process.simMuonCSCDigis.strips -) - -#process.SimMuL1NaturalAll = cms.EDFilter("SimMuL1", -# doStrictSimHitToTrackMatch = cms.untracked.bool(False), -# matchAllTrigPrimitivesInChamber = cms.untracked.bool(True), -# -# minSimTrPt = cms.untracked.double(2.), -# minSimTrPhi = cms.untracked.double(-9.), -# maxSimTrPhi = cms.untracked.double(9.), -# minSimTrEta = cms.untracked.double(0.8), -# maxSimTrEta = cms.untracked.double(2.5), -# invertSimTrPhiEta = cms.untracked.bool(False), -# -# goodChambersOnly = cms.untracked.bool(False), -# strips = process.simMuonCSCDigis.strips -#) -# - -#process.output = cms.OutputModule("PoolOutputModule", -#) - -process.cscdigiana = cms.EDAnalyzer('CSCDigiAnalizer', - fillTree = cms.untracked.bool(False) -) - -################################################################################ -# load configuration for ME42 and *ganged* ME1A - -#process.load('FullSim_Configure_ME42_ME1A_cff') - -if ganged: - process.CSCGeometryESModule.useGangedStripsInME1a = True - process.idealForDigiCSCGeometry.useGangedStripsInME1a = True - -################################################################################ -# Global conditions tag -# https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions#Global_Tags_for_Monte_Carlo_Prod - -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') - -#process.GlobalTag.globaltag = 'DESIGN60_V5::All' -process.GlobalTag.globaltag = 'POSTLS161_V12::All' - -#process.GlobalTag.globaltag = 'DESIGN_37_V4::All' - -#Ideal/trivial conditions - perfectly aligned and calibrated detector. -#Alignment and calibration constants = 1, with no smearing. No bad channels. - - -################################################################################ - -#Automatic addition of the customisation function from SLHCUpgradeSimulations.Configuration.postLS1Customs -#from SLHCUpgradeSimulations.Configuration.postLS1Customs import digiCustoms -from SLHCUpgradeSimulations.Configuration.muonCustoms import customise_csc_geom_cond_digi -process=customise_csc_geom_cond_digi(process) -#call to customisation function digiCustoms imported from SLHCUpgradeSimulations.Configuration.postLS1Customs -#process = digiCustoms(process) - -from SLHCUpgradeSimulations.Configuration.muonCustoms import customize_l1extra -process=customize_l1extra(process) - - -##process.load("CalibMuon.Configuration.getCSCConditions_frontier_cff") -#process.cscConditions.toGet = cms.VPSet( -# cms.PSet(record = cms.string('CSCDBGainsRcd'), tag = cms.string('CSCDBGains_ME42_offline')), -# cms.PSet(record = cms.string('CSCDBNoiseMatrixRcd'), tag = cms.string('CSCDBNoiseMatrix_ME42_Feb2009')), -# cms.PSet(record = cms.string('CSCDBCrosstalkRcd'), tag = cms.string('CSCDBCrosstalk_ME42_offline')), -# cms.PSet(record = cms.string('CSCDBPedestalsRcd'), tag = cms.string('CSCDBPedestals_ME42_offline')) -#) -#process.es_prefer_cscConditions = cms.ESPrefer("PoolDBESSource","cscConditions") -##process.es_prefer_cscBadChambers = cms.ESPrefer("PoolDBESSource","cscBadChambers") -process.CSCGeometryESModule.applyAlignment = False - - - -#process.Timing = cms.Service("Timing") -#process.Tracer = cms.Service("Tracer") - - -#process.ana_seq = cms.Sequence(process.SimMuL1StrictAll+process.SimMuL1NaturalAll) -#process.ana_seq = cms.Sequence(process.SimMuL1StrictAll+process.SimMuL1StrictAll0+process.SimMuL1StrictAll3) -#process.ana_seq = cms.Sequence(process.SimMuL1StrictAll+process.SimMuL1StrictAll0) -#process.ana_seq = cms.Sequence(process.SimMuL1StrictAll+process.SimMuL1StrictAll0+process.SimMuL1StrictAllPLUS+process.SimMuL1StrictAllMINUS) -#process.ana_seq = cms.Sequence(process.SimMuL1StrictAll+process.SimMuL1StrictAllPLUS+process.SimMuL1StrictAllMINUS+process.SimMuL1Strict+process.SimMuL1) -#process.ana_seq = cms.Sequence(process.SimMuL1StrictAll+process.SimMuL1Strict+process.SimMuL1) -process.ana_seq = cms.Sequence(process.SimMuL1StrictAll) +## sequence, path and schedule +process.ana_seq = cms.Sequence(process.GEMCSCTriggerEfficiency) process.reader_seq = cms.Sequence(process.lctreader) -process.cscdigi_seq = cms.Sequence(process.cscdigiana) - -process.l1extra_step = cms.Path(process.L1Extra) -process.ana_step = cms.Path(process.ana_seq) -process.reader_step = cms.Path(process.reader_seq) -process.cscdigi_step = cms.Path(process.cscdigi_seq) +process.l1extra_step = cms.Path(process.L1Extra) +process.ana_step = cms.Path(process.ana_seq) +process.reader_step = cms.Path(process.reader_seq) process.schedule = cms.Schedule( # process.l1extra_step, -# process.cscdigi_step, process.ana_step # process.reader_step ) + From c7a3b3724acec7415104ec47e5d8f75617f35777 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 9 Oct 2013 11:38:02 -0500 Subject: [PATCH 160/182] Updated configuration for rate analyzer --- SimMuL1/plugins/GEMCSCTriggerRate.cc | 2 +- SimMuL1/python/GEMCSCTriggerRate_cfi.py | 2 +- SimMuL1/test/runGEMCSCTriggerRate_cfg.py | 27 ++++++++++++------------ 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/SimMuL1/plugins/GEMCSCTriggerRate.cc b/SimMuL1/plugins/GEMCSCTriggerRate.cc index 775573168958d..8458e0b59dc3c 100644 --- a/SimMuL1/plugins/GEMCSCTriggerRate.cc +++ b/SimMuL1/plugins/GEMCSCTriggerRate.cc @@ -7,7 +7,7 @@ const double GEMCSCTriggerRate::PT_THRESHOLDS_FOR_ETA[N_PT_THRESHOLDS] = {10,15, // ================================================================================================ GEMCSCTriggerRate::GEMCSCTriggerRate(const edm::ParameterSet& iConfig): - CSCTFSPset(iConfig.getParameter("SectorProcessor")), + CSCTFSPset(iConfig.getParameter("sectorProcessor")), ptLUTset(CSCTFSPset.getParameter("PTLUT")), ptLUT(0), matchAllTrigPrimitivesInChamber_(iConfig.getUntrackedParameter("matchAllTrigPrimitivesInChamber", false)), diff --git a/SimMuL1/python/GEMCSCTriggerRate_cfi.py b/SimMuL1/python/GEMCSCTriggerRate_cfi.py index fa1249a056458..c11483786338a 100644 --- a/SimMuL1/python/GEMCSCTriggerRate_cfi.py +++ b/SimMuL1/python/GEMCSCTriggerRate_cfi.py @@ -1,6 +1,6 @@ import FWCore.ParameterSet.Config as cms -GEMCSCTriggerRate = cms.EDFilter("GEMCSCTriggerRate", +GEMCSCTriggerRate = cms.EDAnalyzer("GEMCSCTriggerRate", doME1a = cms.untracked.bool(True), defaultME1a = cms.untracked.bool(False), minBxALCT = cms.untracked.int32(5), diff --git a/SimMuL1/test/runGEMCSCTriggerRate_cfg.py b/SimMuL1/test/runGEMCSCTriggerRate_cfg.py index 4163d33dd4106..fc13cbe66d375 100644 --- a/SimMuL1/test/runGEMCSCTriggerRate_cfg.py +++ b/SimMuL1/test/runGEMCSCTriggerRate_cfg.py @@ -9,18 +9,19 @@ ## steering deltaMatch = 2 -pileup = 100 -events = 1000000 -#sample = 'dimu' -sample = 'minbias' +pileup = '000' +events = 100000 +sample = 'dimu' +#sample = 'minbias' globalTag = 'upgrade2019' ## input from GEMCode.SimMuL1.GEMCSCTriggerSamplesLib import files -suffix = '_gem_dphi_pat2_PU0' -inputDir = files[suffix] -inputDir = ['/afs/cern.ch/user/d/dildick/work/GEM/CMSSW_6_1_2_SLHC6_patch1/src/tempDir/'] -inputFiles = [] +suffix = '_gem98_pt10_pat2_PU0_GEM2019' +#inputDir = files[suffix] +#inputDir = ['/afs/cern.ch/user/d/dildick/work/GEM/CMSSW_6_1_2_SLHC6_patch1/src/tempDir/'] +inputFiles = ['file:out_SingleMuPt10Fwd_GEM2019_8PartIncRad_DIGI_L1.root'] +""" import os for d in range(len(inputDir)): my_dir = inputDir[d] @@ -33,8 +34,9 @@ print "Proceed to next directory" ls = os.listdir(my_dir) inputFiles.extend([my_dir[:] + 'file:' + x for x in ls if x.endswith('root')]) +""" -print "inputFiles:", inputFiles +print "InputFiles: ", inputFiles ## readout windows w = 3 @@ -48,7 +50,7 @@ readout_windows = [ [5,10],[1,11],[1,11],[1,11] ] ## output -outputFileName = 'hp_' + sample + "_" + cmssw + "_" + globalTag + "_pu%d"%(pileup) + '_w%d'%(w) + suffix + '.root' +outputFileName = 'hp_' + sample + "_" + cmssw + "_" + globalTag + "_pu%s"%(pileup) + '_w%d'%(w) + suffix + '_rate.root' print "outputFile:", outputFileName # import of standard configurations @@ -111,12 +113,9 @@ process.GEMCSCTriggerRate.sectorProcessor = process.simCsctfTrackDigis.SectorProcessor process.GEMCSCTriggerRate.strips = process.simMuonCSCDigis.strips - ## customization from SLHCUpgradeSimulations.Configuration.muonCustoms import * -process = customise_csc_Geometry(process) -process = digitizer_timing_pre3_median(process) -process = customise_csc_L1Extra_allsim(process) +process = unganged_me1a_geometry(process) ## Sequence and schedule process.ana_seq = cms.Sequence(process.GEMCSCTriggerRate) From 0e8de8b76a2ee6d36b639d8a75493d9be7ee8e29 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 9 Oct 2013 21:28:09 +0200 Subject: [PATCH 161/182] delete redundant file --- SimMuL1/scripts/matchingEfficiency.C | 568 --------------------------- 1 file changed, 568 deletions(-) delete mode 100644 SimMuL1/scripts/matchingEfficiency.C diff --git a/SimMuL1/scripts/matchingEfficiency.C b/SimMuL1/scripts/matchingEfficiency.C deleted file mode 100644 index 4293359a13bbf..0000000000000 --- a/SimMuL1/scripts/matchingEfficiency.C +++ /dev/null @@ -1,568 +0,0 @@ -//gROOT->ProcessLine(".L effFunctions.C"); - - -gROOT->SetBatch(1); - - -TString filesDir = "files/"; -TString plotDir = "plots/efficiency/"; -TString ext = ".pdf"; - -TCut ok_sh1 = "(has_csc_sh&1) > 0"; -TCut ok_sh2 = "(has_csc_sh&2) > 0"; -TCut ok_st1 = "(has_csc_strips&1) > 0"; -TCut ok_st2 = "(has_csc_strips&2) > 0"; -TCut ok_w1 = "(has_csc_wires&1) > 0"; -TCut ok_w2 = "(has_csc_wires&2) > 0"; -TCut ok_digi1 = (ok_st1 && ok_w1); -TCut ok_digi2 = (ok_st2 && ok_w2); -TCut ok_lct1 = "(has_lct&1) > 0"; -TCut ok_lct2 = "(has_lct&2) > 0"; -TCut ok_lcths1 = ok_lct1 && "hs_lct_odd > 4 && hs_lct_odd < 125"; -TCut ok_lcths2 = ok_lct2 && "hs_lct_even > 4 && hs_lct_even < 125"; - -TCut ok_gsh1 = "(has_gem_sh&1) > 0"; -TCut ok_gsh2 = "(has_gem_sh&2) > 0"; -TCut ok_g2sh1 = "(has_gem_sh2&1) > 0"; -TCut ok_g2sh2 = "(has_gem_sh2&2) > 0"; -TCut ok_gdg1 = "(has_gem_dg&1) > 0"; -TCut ok_gdg2 = "(has_gem_dg&2) > 0"; -TCut ok_pad1 = "(has_gem_pad&1) > 0"; -TCut ok_pad2 = "(has_gem_pad&2) > 0"; -TCut ok_2pad1 = "(has_gem_pad2&1) > 0"; -TCut ok_2pad2 = "(has_gem_pad2&2) > 0"; -TCut ok_pad1_overlap = ok_pad1 || (ok_lct2 && ok_pad2); -TCut ok_pad2_overlap = ok_pad2 || (ok_lct1 && ok_pad1); -TCut ok_copad1 = "(has_gem_copad&1) > 0"; -TCut ok_copad2 = "(has_gem_copad&2) > 0"; - - -TCut Qp = "charge > 0"; -TCut Qn = "charge < 0"; - -TCut Ep = "endcap > 0"; -TCut En = "endcap < 0"; - -TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.14"; -TCut ok_pt = "pt > 20"; - - - -// TCut ok_dphi1 = "dphi_pad_odd < 10."; -// TCut ok_dphi2 = "dphi_pad_even < 10."; - -// enum {GEM_EFF95 = 0, GEM_EFF98, GEM_EFF99}; -// enum {DPHI_PT10 = 0, DPHI_PT15, DPHI_PT20, DPHI_PT30, DPHI_PT40}; - -double mymod(double x, double y) -{ - return fmod(x,y); -} - -// void setDPhi(int label_pt, int label_eff = GEM_EFF98) -// { -// float dphi_odd[3][20] = { -// {0.009887, 0.006685, 0.005194, 0.003849, 0.003133}, -// {0.01076 , 0.007313, 0.005713, 0.004263, 0.003513}, -// {0.011434, 0.007860, 0.006162, 0.004615, 0.003891} }; -// float dphi_even[3][20] = { -// {0.004418, 0.003274, 0.002751, 0.002259, 0.002008}, -// {0.004863, 0.003638, 0.003063, 0.002563, 0.002313}, -// {0.005238, 0.003931, 0.003354, 0.002809, 0.002574} }; -// ok_dphi1 = Form("TMath::Abs(dphi_pad_odd) < %f", dphi_odd[label_eff][label_pt]); -// ok_dphi2 = Form("TMath::Abs(dphi_pad_even) < %f", dphi_even[label_eff][label_pt]); -// } - - -TFile* gf = 0; -TTree* gt = 0; -TString gf_name = ""; - -TTree* getTree(TString f_name) -{ - if (gf_name == f_name && gt != 0) return gt; - cout<Get("GEMCSCAnalyzer/trk_eff"); - return gt; -} - -void eff_hs_dphi(TString f_name, TString p_name) -{ - // efficiency vs half-strip - separate odd-even - TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12"; - //TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<1.74"; - //TCut ok_eta = "TMath::Abs(eta)>1.94 && TMath::Abs(eta)<2.12"; - - TTree *t = getTree(f_name); - setDPhi(DPHI_PT40, GEM_EFF98); - - // TH1F* ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta && ok_gsh1 , ok_pad1, "", kRed); - // TH1F* he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta && ok_gsh2, ok_pad2, "same"); - - //TH1F* ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta, ok_gsh1, "", kRed); - //TH1F* he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta, ok_gsh2, "same"); - - //TH1F* ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta && Qneg, ok_pad1 && ok_dphi1, "", kRed); - //TH1F* he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta && Qneg, ok_pad2 && ok_dphi2, "same"); - //TH1F* ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,-0.2,0.2)", "mymod(phi+TMath::Pi()/36., TMath::Pi()/18.)", ok_eta, ok_lct1, "", kRed); - //TH1F* he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,-0.2,0.2)", "mymod(phi+TMath::Pi()/36., TMath::Pi()/18.)",ok_eta, ok_lct2, "same"); - //TH1F* ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,-0.2,0.2)", "mymod(phi+TMath::Pi()/36., TMath::Pi()/18.)", ok_eta, ok_lct1 || ok_lct2, "", kRed); - //TH1F* hg = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,-0.2,0.2)", "mymod(phi+TMath::Pi()/36., TMath::Pi()/18.)", ok_eta, ok_pad1 || ok_pad2, "same"); - //TH1F* hgp = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,-0.2,0.2)", "mymod(phi+TMath::Pi()/36., TMath::Pi()/18.)", ok_eta&&Qpos, ok_pad1 || ok_pad2, "same", kGreen); - - - //TH1F* ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(384,0.,384.)", "strip_gemsh_odd", ok_gsh1 && ok_eta, ok_pad1, "", kRed); - //TH1F* he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(384,0.,384.)", "strip_gemsh_even", ok_gsh2 && ok_eta, ok_pad2, "same"); - //TH1F* he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(384,0.,384.)", "strip_gemsh_even", ok_gsh2 && ok_eta, ok_pad2, ""); - - //TH1F* ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(384,0.,384.)", "strip_gemsh_odd", ok_gsh1 && ok_eta, ok_gdg1, "", kRed); - //TH1F* he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(384,0.,384.)", "strip_gemsh_even", ok_gsh2 && ok_eta, ok_gdg2, "same"); - - //TH1F* ho = draw_eff(t, "Eff. for track with GEM digi to have GEM pad in chamber;digi strip;Eff.", "h_odd", "(384,0.5,384.5)", "strip_gemdg_odd", ok_gdg1 && ok_eta, ok_pad1, "", kRed); - //TH1F* he = draw_eff(t, "Eff. for track with GEM digi to have GEM pad in chamber;digi strip;Eff.", "h_evn", "(384,0.5,384.5)", "strip_gemdg_even", ok_gdg2 && ok_eta, ok_pad2, "same"); - - //gPad->Print(p_name); -} - - -void efficiency_1(TString f_name, TString p_name, TString pt, bool overlap) -{ - - gStyle->SetTitleStyle(0); - gStyle->SetTitleAlign(13); // coord in top left - gStyle->SetTitleX(0.); - gStyle->SetTitleY(1.); - gStyle->SetTitleW(1); - gStyle->SetTitleH(0.058); - gStyle->SetTitleBorderSize(0); - - gStyle->SetPadLeftMargin(0.126); - gStyle->SetPadRightMargin(0.04); - gStyle->SetPadTopMargin(0.06); - gStyle->SetPadBottomMargin(0.13); - gStyle->SetOptStat(0); - gStyle->SetMarkerStyle(1); - - // efficiency vs half-strip - separate odd-even - TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12"; - TCut cut1; - TCut cut2; - if (overlap) - { - cut1 = ok_pad1_overlap; - cut2 = ok_pad2_overlap; - } - else - { - cut1 = ok_pad1; - cut2 = ok_pad2; - } - - TTree *t = getTree(f_name); - TH1F* ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation Preliminary;LCT half-strip number;Efficiency", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , cut1, "", kRed); - TH1F* he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation Preliminary;LCT half-strip number;Efficiency", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , cut2, "same"); - ho->SetMinimum(0.9); - ho->GetXaxis()->SetLabelSize(0.06); - ho->GetYaxis()->SetLabelSize(0.06); - - - TLegend *leg = new TLegend(0.25,0.23,.75,0.5, NULL, "brNDC"); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->SetTextSize(0.06); - leg->AddEntry((TObject*)0,"muon p_{T} = " + pt + " GeV/c",""); - leg->AddEntry(he, "\"Close\" chamber pairs","l"); - leg->AddEntry(ho, "\"Far\" chamber pairs","l"); - leg->Draw(); - - // TLatex* tex2 = new TLatex(.67,.8," L1 Trigger"); - // tex2->SetTextSize(0.05); - // tex2->SetNDC(); - // tex2->Draw(); - - TLatex * tex = new TLatex(.66,.73,"1.64<|#eta|<2.12"); - tex->SetTextSize(0.05); - tex->SetNDC(); - tex->Draw(); - - gPad->Print(p_name); -} - - -void efficiency_2(TString f_name, TString p_name, TString pt, bool overlap) -{ - // efficiency vs half-strip - including overlaps in odd&even - TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12"; - TCut cut1; - TCut cut2; - if (overlap) - { - cut1 = ok_pad1_overlap; - cut2 = ok_pad2_overlap; - } - else - { - cut1 = ok_pad1; - cut2 = ok_pad2; - } - - TTree *t = getTree(f_name); - - // latest instructions by Vadim: 21-08-2013 - TGraphAsymmErrors* hgn = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;Generated muon #phi [deg];Efficiency", "h_odd", "(40,-10,10)", "mymod(phi*180./TMath::Pi(), 360/18.)", ok_eta&&Qn, ok_pad1 || ok_pad2,"", kRed); - TGraphAsymmErrors* hgp = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;Generated muon #phi [deg];Effciency", "h_odd", "(40,-10,10)", "mymod(phi*180./TMath::Pi(), 360/18.)", ok_eta&&Qp, ok_pad1 || ok_pad2,"same", kBlue); - double maxi = 1.1; - double mini = 0.0; - hgn->SetMinimum(mini); - hgn->SetMaximum(maxi); - hgn->GetXaxis()->SetLabelSize(0.05); - hgn->GetYaxis()->SetLabelSize(0.05); - hgp->GetXaxis()->SetLabelSize(0.05); - hgp->GetYaxis()->SetLabelSize(0.05); - - TLine *l1 = new TLine(-5,mini,-5,maxi); - l1->SetLineStyle(2); - l1->Draw(); - TLine *l1 = new TLine(5,mini,5,maxi); - l1->SetLineStyle(2); - l1->Draw(); - - // hgn->Fit("pol0","R0","",-10,10); - // hgp->Fit("pol0","R0","",-10,10); - // double eff_neg = (hgn->GetFunction("pol0"))->GetParameter(0); - // double eff_pos = (hgp->GetFunction("pol0"))->GetParameter(0); - // std::cout << "negative efficiency" << eff_neg << " " - // << "positive efficiency" << eff_pos << std::endl; - - // ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;local #phi [deg];Efficiency", "h_odd", "(150,-10,10)", "mymod(phi+TMath::Pi()/36., TMath::Pi()/18.) * 180./TMath::Pi()", ok_eta&&Qn, ok_pad1 || ok_pad2, "", kRed); - // he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;local #phi [deg];Efficiency", "h_odd", "(150,-10,10)", "mymod(phi+TMath::Pi()/36., TMath::Pi()/18.) * 180./TMath::Pi()", ok_eta&&Qp, ok_pad1 || ok_pad2, "same",kBlue); - - // TH1F* ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;local #phi [deg];Efficiency", "h_odd", "(130,-5,5)", "fmod(180*phi/TMath::Pi(),5)", ok_lct1 && ok_eta , cut1, "", kRed); - // TH1F* he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation;local #phi [deg];Efficiency", "h_evn", "(130,-5,5)", "fmod(180*phi/TMath::Pi(),5)", ok_lct2 && ok_eta , cut2, "same"); - // ho->SetMinimum(0.); - - TLegend *leg = new TLegend(0.25,0.23,.75,0.5, NULL, "brNDC"); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->SetTextSize(0.06); - leg->AddEntry((TObject*)0,"muon p_{T} = " + pt + " GeV/c",""); - leg->AddEntry(hgp, "Postive muons","l"); - leg->AddEntry(hgn, "Negative muons","l"); - leg->Draw(); - - // Print additional information - /* - TLatex* tex2 = new TLatex(.67,.8," L1 Trigger"); - tex2->SetTextSize(0.05); - tex2->SetNDC(); - tex2->Draw(); - */ - - // TLatex * tex = new TLatex(.66,.73,"1.64<|#eta|<2.12"); - TLatex * tex = new TLatex(.7,.2,"1.64<|#eta|<2.12"); - tex->SetTextSize(0.05); - tex->SetNDC(); - tex->Draw(); - - gPad->Print(p_name); -} - -void drawplot_eff_eta() -{ - - // gROOT->ProcessLine(".L effFunctions.C"); - - TCanvas* cEff = new TCanvas("cEff","cEff",700,450); - cEff->SetGridx(1); - cEff->SetGridy(1); - - TTree *gt = getTree(filesDir + "gem_csc_delta_pt40_pad4.root"); - - //ht = draw_geff(gt, "Eff. for a SimTrack to have an associated LCT;SimTrack |#eta|;Eff.", "h_odd", "(100,1.54,2.2)", "TMath::Abs(eta)", "", ok_lct1 || ok_lct2, "P", kRed); - //hh = draw_geff(gt, "Eff. for a SimTrack to have an associated LCT;SimTrack |#eta|;Eff.", "h_odd", "(100,1.54,2.2)", "TMath::Abs(eta)", "", ok_sh1 || ok_sh2, "P same", kViolet); - h1 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh1, ok_lct1, "P", kRed); - h2 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh2, ok_lct2, "P same"); - eff_base->GetYaxis()->SetRangeUser(0.6,1.05); - TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->AddEntry(h1, "odd chambers","l"); - leg->AddEntry(h2, "even chambers","l"); - leg->Draw(); - TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); - tex->SetNDC(); - tex->Draw(); - cEff->Print(plotDir + "lct_eff_for_Trk_vsTrkEta_pt40" + ext); - - - h1 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT and GEM Pad;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh1, ok_lct1 && ok_pad1, "P", kRed); - h2 = draw_geff(gt, "Eff. for a SimTrack to have an associated ME1/b LCT and GEM Pad;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", ok_sh2, ok_lct2 && ok_pad2, "P same"); - eff_base->GetYaxis()->SetRangeUser(0.6,1.05); - TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->AddEntry(h1, "odd chambers","l"); - leg->AddEntry(h2, "even chambers","l"); - leg->Draw(); - TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); - tex->SetNDC(); - tex->Draw(); - cEff->Print(plotDir + "gem_pad_and_lct_eff_for_Trk_vsTrkEta_pt40" + ext); - - return; - - h1 = draw_geff(gt, "Eff. for a SimTrack to have an associated GEM Pad;SimTrack |#eta|;Eff.", "h_odd", "(70,1.54,2.2)", "TMath::Abs(eta)", "", ok_pad1 || ok_pad2, "P", kViolet); - eff_base->GetYaxis()->SetRangeUser(0.6,1.05); - TLatex * tex = new TLatex(0.17, 0.16,"No Pile-Up"); - tex->SetNDC(); - tex->Draw(); - cEff->Print(plotDir + "gem_pad0_eff_for_Trk_vsTrkEta_pt40" + ext); - - - - - TTree *gt15 = getTree(filesDir + "gem_csc_delta_pt15_pad4.root"); - h1 = draw_geff(gt15, "Eff. for a SimTrack to have an associated LCT;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_lct1 || ok_lct2, "P", kViolet+2); - cEff->Print(plotDir + "lct_eff_for_Trk_vsTrkEta_pt15" + ext); - - - ho = draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", ok_lct1, ok_pad1, "P", kRed); - he = draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta_lct_even)", ok_lct2, ok_pad2, "P same"); - TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->AddEntry(he, "\"Close\" chambers","l"); - leg->AddEntry(ho, "\"Far\" chambers","l"); - leg->Draw(); - cEff->Print(plotDir + "gem_pad_eff_for_LCT_vsLCTEta_pt40" + ext); - - draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1, ok_pad1, "P", kRed); - draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2, ok_pad2, "P same"); - leg->Draw(); - cEff->Print(plotDir + "gem_pad_eff_for_LCT_vsTrkEta_pt40" + ext); - - draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", ok_lct1, ok_pad1_overlap, "P", kRed); - draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta_lct_even)", ok_lct2, ok_pad2_overlap, "P same"); - leg->Draw(); - cEff->Print(plotDir + "gem_pad_eff_for_LCT_vsLCTEta_pt40_overlap" + ext); - - draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1, ok_pad1_overlap, "P", kRed); - draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2, ok_pad2_overlap, "P same"); - leg->Draw(); - cEff->Print(plotDir + "gem_pad_eff_for_LCT_vsTrkEta_pt40_overlap" + ext); - - //draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1 && Ep, ok_pad1_overlap, "P", kRed); - //draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2 && Ep, ok_pad2_overlap, "P same"); - //draw_geff(gt, "Eff. for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_gemsh_odd)", ok_gsh1, ok_gdg1, "P", kRed); - h1 = draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_pad1 || ok_pad2, "P", kViolet); - h2 = draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_2pad1 || ok_2pad2, "P same", kViolet-6); - TLegend *leg = new TLegend(0.42,0.23,.96,0.4, NULL, "brNDC"); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->AddEntry(h1, "at least one pad","l"); - leg->AddEntry(he, "two pads in two GEMs","l"); - leg->Draw(); - cEff->Print(plotDir + "gem_pad_eff_for_Trk_vsTrkEta_pt40" + ext); - - return; - draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_gsh1 || ok_gsh2, "P", kViolet); - draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_g2sh1 || ok_g2sh2 , "P", kOrange); - draw_geff(gt, "Eff. for a SimTrack to have an associated GEM pad;SimTrack |#eta|;Eff.", "h_odd", "(140,1.54,2.2)", "TMath::Abs(eta)", "", ok_copad1 || ok_copad2 , "P same", kRed); - - -} - -void drawplot_eff() -{ - gROOT->ProcessLine(".L effFunctions.C"); - gROOT->ProcessLine(".L tdrstyle.C"); - //setTDRStyle(); - - gStyle->SetTitleStyle(0); - gStyle->SetTitleAlign(13);// coord in top left - gStyle->SetTitleX(0.); - gStyle->SetTitleY(1.); - gStyle->SetTitleW(1); - gStyle->SetTitleH(0.058); - gStyle->SetTitleBorderSize(0); - - TCanvas* cEff = new TCanvas("cEff","cEff",700,500); - - // efficiency_1(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt05" + ext, "5", false); - // efficiency_1(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt10" + ext, "10", false); - // efficiency_1(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt15" + ext, "15", false); - // efficiency_1(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt20" + ext, "20", false); - // efficiency_1(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt30" + ext, "30", false); - // efficiency_1(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt40" + ext, "40", false); - - // efficiency_1(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt05_overlap" + ext, "5", true); - // efficiency_1(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt10_overlap" + ext, "10", true); - // efficiency_1(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt15_overlap" + ext, "15", true); - // efficiency_1(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt20_overlap" + ext, "20", true); - // efficiency_1(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt30_overlap" + ext, "30", true); - // efficiency_1(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_HS_pt40_overlap" + ext, "40", true); - - // efficiency_2(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt05" + ext, "5", false); - // efficiency_2(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt10" + ext, "10", false); - // efficiency_2(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt15" + ext, "15", false); - // efficiency_2(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt20" + ext, "20", false); - // efficiency_2(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt30" + ext, "30", false); - // efficiency_2(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt40" + ext, "40", false); - - // efficiency_2(filesDir + "gem_csc_delta_pt5_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt05_overlap" + ext, "5", true); - // efficiency_2(filesDir + "gem_csc_delta_pt10_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt10_overlap" + ext, "10", true); - // efficiency_2(filesDir + "gem_csc_delta_pt15_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt15_overlap" + ext, "15", true); - - efficiency_2(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt20_overlap" + ext, "20", true); - - - // efficiency_2(filesDir + "gem_csc_delta_pt30_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt30_overlap" + ext, "30", true); - // efficiency_2(filesDir + "gem_csc_delta_pt40_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt40_overlap" + ext, "40", true); - - // drawplot_eff_eta(); -} - - -/* - TTree *gt = getTree("gem_csc_delta_pt40_pad4.root"); - - - draw_eff(gt, "Eff. ;p_{T}, GeV/c;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_sh1 && ok_eta , ok_digi1) - draw_eff(gt, "Eff. ;p_{T}, GeV/c;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_digi1 && ok_eta , ok_lct1) - draw_eff(gt, "Eff. ;p_{T}, GeV/c;Eff.", "hname", "(50,0.,50.)", "pt", ok_sh1 && ok_eta , ok_lct1) - - - draw_eff(gt, "Eff. of |CLCT pattern bend| selection for matched LCTs;p_{T}, GeV/c;Eff.", "hname2", "(50,0.,50.)", "pt", (ok_lct1||ok_lct2) && ok_eta, "TMath::Abs(bend_lct_odd)<2 || TMath::Abs(bend_lct_even)<2") - draw_eff(gt, "Eff. of |CLCT pattern bend| selection for matched LCTs;p_{T}, GeV/c;Eff.", "hname1", "(50,0.,50.)", "pt", (ok_lct1||ok_lct2) && ok_eta, "TMath::Abs(bend_lct_odd)<1 || TMath::Abs(bend_lct_even)<1","same",kBlack) - draw_eff(gt, "Eff. of |CLCT bend|<3 selection for matched LCTs;p_{T}, GeV/c;Eff.", "hname3", "(50,0.,50.)", "pt", (ok_lct1||ok_lct2) && ok_eta, "TMath::Abs(bend_lct_odd)<3 || TMath::Abs(bend_lct_even)<3","same",kGreen+2) - draw_eff(gt, "Eff. of |CLCT bend|<4 selection for matched LCTs;p_{T}, GeV/c;Eff.", "hname4", "(50,0.,50.)", "pt", (ok_lct1||ok_lct2) && ok_eta, "TMath::Abs(bend_lct_odd)<4 || TMath::Abs(bend_lct_even)<4","same",kRed) - - draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;|#eta|;Eff.", "hname", "(90,1.5,2.2)", "TMath::Abs(eta)", ok_lct2, ok_pad2 ) - draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;|#eta|;Eff.", "hname", "(90,1.5,2.2)", "TMath::Abs(eta)", ok_lct1, ok_pad1, "same" ) - - draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;|#phi|;Eff.", "hname", "(128,0,3.2)", "TMath::Abs(phi)", ok_lct2 && ok_eta && ok_pt , ok_pad2 ) - draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;|#phi|;Eff.", "hname", "(128,0,3.2)", "TMath::Abs(phi)", ok_lct1 && ok_eta && ok_pt , ok_pad1, "same" ) - - - draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;p_{T}, GeV/c;Eff.", "h_odd", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1) - draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;p_{T}, GeV/c;Eff.", "h_evn", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2, "same") - - - - - // efficiency vs half-strip - separate odd-even - TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<1.9" - draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1, "", kRed) - draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2, "same") - - // efficiency vs half-strip - including overlaps in odd&even - TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<1.9" - TCut ok_pad1_overlap = ok_pad1 || (ok_lct2 && ok_pad2); - TCut ok_pad2_overlap = ok_pad2 || (ok_lct1 && ok_pad1); - TTree *t = getTree("gem_csc_delta_pt20_pad4.root"); - - draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_odd", "(130,0.5,130.5)", "hs_lct_odd", ok_lct1 && ok_eta , ok_pad1_overlap, "", kRed) - draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT half-strip;Eff.", "h_evn", "(130,0.5,130.5)", "hs_lct_even", ok_lct2 && ok_eta , ok_pad2_overlap, "same") - - - draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", ok_lct1, ok_pad1, "", kRed) - draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;LCT |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta_lct_even)", ok_lct2, ok_pad2, "same") - - draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;trk |#eta|;Eff.", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1, ok_pad1, "", kRed) - draw_eff(gt, "Eff. for track with LCT to have GEM pad in chamber;trk |#eta|;Eff.", "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2, ok_pad2, "same") - - - draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1) - draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_env", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") - - draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd", "(50,0.,50.)", "pt", ok_lct1 && ok_eta && ok_pad1, ok_dphi1) - draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_evn", "(50,0.,50.)", "pt", ok_lct2 && ok_eta && ok_pad2, ok_dphi2, "same") - - - - - - // 98% pt10 - TCut ok_dphi1 = "TMath::Abs(dphi_pad_odd) < 0.01076" - TCut ok_dphi2 = "TMath::Abs(dphi_pad_even) < 0.004863" - draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd_10", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1, "", kRed) - draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_evn_10", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") - // 98% pt30 - TCut ok_dphi1 = "TMath::Abs(dphi_pad_odd) < 0.00571" - TCut ok_dphi2 = "TMath::Abs(dphi_pad_even) < 0.00306" - draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd_20", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1, "same", kRed) - draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_evn_20", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") - // 98% pt30 - TCut ok_dphi1 = "TMath::Abs(dphi_pad_odd) < 0.00426" - TCut ok_dphi2 = "TMath::Abs(dphi_pad_even) < 0.00256" - draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd_30", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1, "same", kRed) - draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_evn_30", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") - // 98% pt40 - TCut ok_dphi1 = "TMath::Abs(dphi_pad_odd) < 0.00351" - TCut ok_dphi2 = "TMath::Abs(dphi_pad_even) < 0.00231" - draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_odd_40", "(50,0.,50.)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1, "same", kRed) - draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "h_evn_40", "(50,0.,50.)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") - - - |#Delta#phi_{odd}(LCT,Pad)| < 5.5 mrad - |#Delta#phi_{even}(LCT,Pad)| < 3.1 mrad - |#Delta#eta(LCT,Pad)| < 0.08 - - draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_sh1 && ok_eta , ok_lct1 && ok_pad1 && ok_dphi1) - draw_eff(gt, "Eff. for track with LCT to have matched GEM pad;p_{T}, GeV/c;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_sh2 && ok_eta , ok_lct2 && ok_pad2 && ok_dphi2, "same") - - - - - draw_eff(gt, "title;pt;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_lct1 && ok_eta , ok_pad1 && ok_dphi1) - - draw_eff(gt, "title;pt;Eff.", "hname", "(45,0.5,45.5)", "pt", ok_lct2 && ok_eta , ok_pad2 && ok_dphi2, "same") - - - draw_eff(gt, "title;|#eta|;Eff.", "hname", "(45,1.5,2.2)", "TMath::Abs(eta)", ok_sh1 , ok_lct1 && ok_pad1 ) - - - draw_eff(gt, "title;|#phi|;Eff.", "hname", "(128,0,3.2)", "TMath::Abs(phi)", ok_sh2 , ok_lct2 && ok_pad2 ) - - - - - gt->Draw("TMath::Abs(eta)", ok_sh1, ""); - gt->Draw("TMath::Abs(eta)", ok_sh1 && ok_lct1, "same"); - gt->Draw("TMath::Abs(eta)", ok_sh1 && ok_lct1 && ok_pad1, "same"); - - gt->Draw("TMath::Abs(phi)", ok_sh1 && ok_lct1 && ok_pad1, ""); - gt->Draw("TMath::Abs(phi)", ok_sh1, ""); - gt->Draw("TMath::Abs(eta)", ok_sh1 && ok_lct1, "same"); - - gt->Draw("TMath::Abs(phi)", ok_sh1, ""); - gt->Draw("TMath::Abs(phi)", ok_sh1 && ok_lct1, "same"); - gt->Draw("TMath::Abs(phi)", ok_sh1 && ok_lct1 && ok_pad1, "same"); - - - gt->Draw("pt", ok_sh1, ""); - gt->Draw("pt", ok_sh1 && ok_lct1, "same"); - gt->Draw("pt", ok_sh1 && ok_lct1 && ok_pad1, "same"); - gt->Draw("pt", ok_sh1, ""); - gt->Draw("pt", ok_sh1 && ok_lct1 && ok_pad1, "same"); - - gt->Draw("pt>>h1", ok_sh1, ""); - dn=(TH1F*)h1->Clone("dn") - gt->Draw("pt>>h2", ok_sh1 && ok_lct1 && ok_pad1, "same"); - nm=(TH1F*)h2->Clone("nm") - - dn->Draw() - nm->Draw("same") - - nm->Divide(dn) - nm->Draw() - - gt->Draw("pt>>h2", ok_sh1 && ok_lct1, "same"); - nmlct=(TH1F*)h2->Clone("nmlct") - nmlct->Divide(dn) - - nm->Draw() - nmlct->Draw("same") -*/ From 594faf578c2b6f47266341bdd428c16e73746196 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 9 Oct 2013 21:29:25 +0200 Subject: [PATCH 162/182] Latest updates for ECFA approval --- .../scripts/drawplot_frankenstein_ptshiftX.C | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C index 8482f3b27b8f2..733bee148991e 100644 --- a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C @@ -59,18 +59,25 @@ void produceRatePlot(TH1D* h, TH1D* i, TH1D* j, TH1D* m, Color_t col0, Color_t c h->GetYaxis()->SetRangeUser(miny, maxy); h->GetXaxis()->SetTitle(""); - TLegend *leg = new TLegend(0.45,0.65,.93,0.93,"","brNDC"); - leg->SetMargin(0.25); + TLegend *leg = new TLegend(0.15,0.88,.93,0.93,"","brNDC"); + leg->SetMargin(0.15); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.04); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(h, "L1 Single Mu (2012 configuration) + ME1/1a unganging","f"); + leg->Draw(); + + TLegend *leg = new TLegend(0.4,0.7,.93,0.88,"","brNDC"); + leg->SetMargin(0.2); leg->SetBorderSize(0); leg->SetFillStyle(0); leg->SetTextSize(0.04); leg->SetFillStyle(1001); leg->SetFillColor(kWhite); - leg->AddEntry(h, "L1 single muon trigger","f"); - leg->AddEntry((TObject*)0, "(final 2012 configuration)",""); - // leg->AddEntry((TObject*)0, "L1 selections (#geq " + k + " stations):",""); leg->AddEntry(i,"CSC #geq" + k + " stubs (anywhere)","f"); - leg->AddEntry(j,"CSC #geq" + k + " stubs (one in ME1/b)","f"); + leg->AddEntry(j,"CSC #geq" + k + " stubs (one in Station 1)","f"); leg->AddEntry(m,"GEM+CSC integrated trigger","f"); leg->AddEntry((TObject*)0,"with #geq" + k + " stubs",""); leg->Draw(); @@ -105,8 +112,8 @@ void produceRatePlot(TH1D* h, TH1D* i, TH1D* j, TH1D* m, Color_t col0, Color_t c leg->SetFillStyle(0); // leg->SetFillStyle(1001); // leg->SetFillColor(kWhite); - leg->AddEntry(hh_ratio_gmt, "(GEM+CSC)/L1 single muon trigger","p"); - leg->AddEntry(hh_ratio, "(GEM+CSC)/CSC #geq" + k + " stubs (one in ME1/b)","p"); + leg->AddEntry(hh_ratio_gmt, "(GEM+CSC)/L1 Single Mu","p"); + leg->AddEntry(hh_ratio, "(GEM+CSC)/CSC #geq" + k + " stubs (one in Station 1)","p"); leg->Draw("same"); c->SaveAs(plots + "rates_vs_pt__PU100__def_" + k + "s_" + k + "s1b_" + k + "s1bgem__" + l + ext); @@ -119,7 +126,7 @@ void drawplot_frankenstein_ptshiftX() gROOT->ProcessLine(".L drawplot_gmtrt.C"); gROOT->ProcessLine(".L getPTHistos.C"); - TString ext = ".pdf"; + TString ext = ".eps"; TString filesDir = "files/"; TString plotDir = "plots/rate_vs_pt_shiftX/"; @@ -221,7 +228,7 @@ void drawplot_frankenstein_ptshiftX() // TString the_ttl = " L1 Single Muon Trigger CMS Simulation Preliminary;L1 candidate muon p_{T}^{cut} [GeV/c];rate [kHz]"; - TString the_ttl = " CMS Simulation Preliminary;L1 muon candidate p_{T}^{cut} [GeV/c];Trigger rate [kHz]"; + TString the_ttl = " CMS Phase-2 Simulation Preliminary;L1 muon candidate p_{T}^{cut} [GeV/c];Trigger rate [kHz]"; hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); From 34bd920838d630edf5ed32696fe5883fd303d9b1 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 10 Oct 2013 10:11:01 +0200 Subject: [PATCH 163/182] Update for ECFA2013 --- SimMuL1/scripts/matchingEfficiency.py | 567 +++++++------------------- 1 file changed, 145 insertions(+), 422 deletions(-) diff --git a/SimMuL1/scripts/matchingEfficiency.py b/SimMuL1/scripts/matchingEfficiency.py index a30b88bbddf57..c129edce5cb8e 100644 --- a/SimMuL1/scripts/matchingEfficiency.py +++ b/SimMuL1/scripts/matchingEfficiency.py @@ -21,7 +21,7 @@ gStyle.SetOptStat(0) gStyle.SetTitleStyle(0) -gStyle.SetTitleAlign(13) ##// coord in top left +gStyle.SetTitleAlign(13) ## coord in top left gStyle.SetTitleX(0.) gStyle.SetTitleY(1.) gStyle.SetTitleW(1) @@ -63,107 +63,6 @@ def getDphi(eff,pt,evenOdd): return dphi_lct_pad["%s"%(eff)]["%s"%(pt)]["%s"%(evenOdd)] - -#_______________________________________________________________________________ -def gemTurnOn(filesDir, plotDir, eff, oddEven, ext): - """Produce plot with GEM high efficiency patterns""" - - pt = ["pt10","pt20","pt30","pt40"] - pt_labels = ["10","20","30","40"] -# pt_labels = ["10 GeV/c","20 GeV/c","30 GeV/c","40 GeV/c"] - dphis = [0.,0.,0.,0.] - - marker_colors = [kRed, kViolet+1, kAzure+2, kGreen-2] - marker_styles = [20,21,23,22] - - t = getTree("%sgem_csc_eff_pt2pt50_pad4.root"%(filesDir)); - - c = TCanvas("c","c",800,600) - c.SetGridx(1) - c.SetGridy(1) - c.cd() - h = TH1F(""," GEM-CSC bending Angle CMS Simulation Preliminary;Generated muon p_{T} [GeV/c];",50,0.,50.) - superscript = "p_{T}>p_{T}^{min}" - subscript = "0" -## h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<|#Delta#phi_{0}^{WP}| Cut Efficiency"); -## h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<|#Delta#phi_{%s}^{%s}| Cut Efficiency"%(subscript,superscript)); - h.GetYaxis().SetTitle(" |#Delta#phi_{{}^{(GEM,CSC)}}|<#Delta#phi_{%s} Cut Efficiency"%(subscript)); - h.GetYaxis().SetTitleOffset(.9) - h.SetStats(0) - - ## label sizes more leglible - h.GetXaxis().SetLabelSize(.05) - h.GetXaxis().SetLabelOffset(.005) - h.GetYaxis().SetLabelSize(.05) - h.GetYaxis().SetLabelOffset(.005) - - h.Draw("") - histoList = [] - for i in range(len(pt)): - dphi = getDphi("%s"%(eff),"%s"%(pt[i]),"%s"%(oddEven)) - dphis[i] = dphi - if oddEven=="even": - ok_dphi = TCut("TMath::Abs(dphi_pad_even) < %f"%(dphi)) - denom_cut = ok_pad2_lct2_eta - closeFar = "Close" - else: - ok_dphi = TCut("TMath::Abs(dphi_pad_odd) < %f"%(dphi)) - denom_cut = ok_pad1_lct1_eta - closeFar = "Far" - - h2 = draw_eff(t, "", "h2", "(50,0.,50.)", "pt", - denom_cut, ok_dphi, marker_colors[i], marker_styles[i]) - histoList.append(h2) - h2.SetMarkerSize(1) - h2.Draw("same") - - ## add legend - leg = TLegend(0.52,0.17,.93,0.57, "High efficiency patterns:", "brNDC") - for n in range(len(pt)): - superscript = "\"%s\""%(pt_labels[n]) - superscript = "p_{T}>%s"%(pt_labels[n]) - subscript = "0" - #leg.AddEntry(histoList[n], "#Delta#phi_{%s}^{%s} = %.1f mrad"%(subscript,superscript,dphis[n]*1000), "p") - leg.AddEntry(histoList[n], "#Delta#phi_{%s} = %.1f mrad"%(subscript,dphis[n]*1000), "p") - #leg.AddEntry(histoList[n], "WP = %s"%(pt_labels[n]), "p") - - - leg.SetBorderSize(0) - leg.SetMargin(0.1) - leg.SetFillStyle(0) - leg.SetFillStyle(1001) - leg.SetFillColor(kWhite) - leg.SetTextSize(0.05) - leg.Draw("same") - - ## Adding additional information - top right - """ - tex2 = TLatex(.75,.82,' L1 Trigger') - tex2.SetTextSize(0.05) - tex2.SetNDC() - tex2.Draw("same") - """ - - tex3 = TLatex(.735,.82,'1.64<|#eta|<2.14') - tex3.SetTextSize(0.05) - tex3.SetNDC() - tex3.Draw("same") - - ## hardcore nitpicking over here! - if closeFar == "Close": - xpos = 0.57 - else: - xpos = 0.611 - - tex = TLatex(xpos,.75,'"%s" chamber pairs'%(closeFar)) - tex.Draw("same") - tex.SetTextSize(0.05) - tex.SetNDC() - - ## save the file - c.SaveAs("%sGEM_turnon_%s_%s%s"%(plotDir, eff,oddEven,ext)) - - #_______________________________________________________________________________ def padMatchingEffVsGenMuonPhiForPosAndNegMuons( filesDir, plotDir, pt, doOverlaps, ext): @@ -184,7 +83,7 @@ def padMatchingEffVsGenMuonPhiForPosAndNegMuons( cut2 = ok_pad2 overlapStr = "" - t = getTree("%sgem_csc_delta_pt%d_pad4.root"%(filesDir,pt)); + t = getTree("%sgem_csc_delta_pt%d_pad4.root"%(filesDir,pt)) ## latest instructions by Vadim on 21-08-2013 ok_pad1_or_pad2 = TCut("%s || %s" %(ok_pad1.GetTitle(),ok_pad2.GetTitle())) @@ -194,7 +93,7 @@ def padMatchingEffVsGenMuonPhiForPosAndNegMuons( ## variables for the plot title = " " * 9 + "GEM pad matching" + " " * 16 + "CMS Simulation Preliminary" xTitle = "Generated muon #phi [deg]" - yTitle = "Efficiency" + yTitle = "Reconstruction efficiency" toPlot = "fmod(phi*180./TMath::Pi(), 360/18.)" h_bins = "(40,-10,10)" nBins = int(h_bins[1:-1].split(',')[0]) @@ -256,44 +155,45 @@ def padMatchingEffVsGenMuonPhiForPosAndNegMuons( tex.Draw() # gPad.Print("%sgem_pad_eff_for_LCT_vs_phi_pt20%s%s"%(plotDir,overlapStr,ext)) - c.Print("%sgem_pad_eff_for_LCT_vs_phi_pt20%s%s"%(plotDir,overlapStr,ext)) + c.Print("%sgem_pad_eff_for_LCT_vs_phi_pt%d%s%s"%(plotDir,pt,overlapStr,ext)) #_______________________________________________________________________________ -def efficiency_1(f_name, p_name, pt, overlap): +def padMatchingEffVsHalfStripForOddEven(filesDir, plotDir, pt, doOverlaps, ext): """efficiency vs half-strip - separate odd-even""" - """ - gStyle->SetTitleStyle(0); - gStyle->SetTitleAlign(13); // coord in top left - gStyle->SetTitleX(0.); - gStyle->SetTitleY(1.); - gStyle->SetTitleW(1); - gStyle->SetTitleH(0.058); - gStyle->SetTitleBorderSize(0); + gStyle.SetTitleStyle(0); + gStyle.SetTitleAlign(13); ##coord in top left + gStyle.SetTitleX(0.); + gStyle.SetTitleY(1.); + gStyle.SetTitleW(1); + gStyle.SetTitleH(0.058); + gStyle.SetTitleBorderSize(0); - gStyle->SetPadLeftMargin(0.126); - gStyle->SetPadRightMargin(0.04); - gStyle->SetPadTopMargin(0.06); - gStyle->SetPadBottomMargin(0.13); - gStyle->SetOptStat(0); - gStyle->SetMarkerStyle(1); + gStyle.SetPadLeftMargin(0.126); + gStyle.SetPadRightMargin(0.04); + gStyle.SetPadTopMargin(0.06); + gStyle.SetPadBottomMargin(0.13); + gStyle.SetOptStat(0); + gStyle.SetMarkerStyle(1); - ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12" - if (overlap): + ok_eta = TCut("TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12") + if (doOverlaps): cut1 = ok_pad1_overlap cut2 = ok_pad2_overlap + overlapStr = "_overlap" else: - cut1 = ok_pad1 - cut2 = ok_pad2 - - t = getTree(f_name) - ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation Preliminary;LCT half-strip number;Efficiency", - "h_odd", "(130,0.5,130.5)", "hs_lct_odd", TCut("%s&&%s"(ok_lct1.GetTitle), ok_eta.GetTitle()), cut1, "", kRed) - he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation Preliminary;LCT half-strip number;Efficiency", - "h_evn", "(130,0.5,130.5)", "hs_lct_even", TCut("%s&&%s"(ok_lct1.GetTitle), ok_eta.GetTitle()), cut2, "same") + cut1 = ok_pad1 + cut2 = ok_pad2 + overlapStr = "" + + t = getTree("%sgem_csc_delta_pt%d_pad4.root"%(filesDir,pt)) + ho = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;LCT half-strip number;Efficiency", + "h_odd", "(130,0.5,130.5)", "hs_lct_odd", TCut("%s&&%s"%(ok_lct1.GetTitle(), ok_eta.GetTitle())), cut1, "", kRed) + he = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;LCT half-strip number;Efficiency", + "h_evn", "(130,0.5,130.5)", "hs_lct_even", TCut("%s&&%s"%(ok_lct1.GetTitle(), ok_eta.GetTitle())), cut2, "same") ho.SetMinimum(0.) ho.GetXaxis().SetLabelSize(0.05) ho.GetYaxis().SetLabelSize(0.05) @@ -307,213 +207,142 @@ def efficiency_1(f_name, p_name, pt, overlap): leg.AddEntry(ho, "\"Far\" chamber pairs","l") leg.Draw(); - tex2 = TLatex(.67,.8," L1 Trigger") - tex2.SetTextSize(0.05) - tex2.SetNDC() - tex2.Draw() - tex = TLatex(.66,.73,"1.64<|#eta|<2.12") tex.SetTextSize(0.05) tex.SetNDC() tex.Draw() ## this has to be fixed - gPad.Print(p_name) - """ + c.Print("%sgem_pad_eff_for_LCT_vs_HS_pt%d%s%s"%(plotDir,pt,overlapStr,ext)) -""" -void efficiency_2(TString f_name, TString p_name, TString pt, bool overlap) -{ - // efficiency vs half-strip - including overlaps in odd&even - TCut ok_eta = "TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12"; - TCut cut1; - TCut cut2; - if (overlap) - { - cut1 = ok_pad1_overlap; - cut2 = ok_pad2_overlap; - } - else - { - cut1 = ok_pad1; - cut2 = ok_pad2; - } - - TTree *t = getTree(f_name); - TH1F* ho = draw_eff(t, " GEM reconstruction efficiency CMS Simulation Preliminary;local #phi [deg];Efficiency", "h_odd", "(130,-5,5)", "fmod(180*phi/TMath::Pi(),5)", ok_lct1 && ok_eta , cut1, "", kRed); - TH1F* he = draw_eff(t, " GEM reconstruction efficiency CMS Simulation Preliminary;local #phi [deg];Efficiency", "h_evn", "(130,-5,5)", "fmod(180*phi/TMath::Pi(),5)", ok_lct2 && ok_eta , cut2, "same"); - ho->SetMinimum(0.); - ho->GetXaxis()->SetLabelSize(0.05); - ho->GetYaxis()->SetLabelSize(0.05); - - TLegend *leg = new TLegend(0.25,0.23,.75,0.5, NULL, "brNDC"); - leg->SetBorderSize(0); - leg->SetFillStyle(0); - leg->SetTextSize(0.06); - leg->AddEntry((TObject*)0,"muon p_{T} = " + pt + " GeV/c",""); - leg->AddEntry(he, "\"Close\" chamber pairs","l"); - leg->AddEntry(ho, "\"Far\" chamber pairs","l"); - leg->Draw(); - - // Print additional information - TLatex* tex2 = new TLatex(.67,.8," L1 Trigger"); - tex2->SetTextSize(0.05); - tex2->SetNDC(); - tex2->Draw(); +#_______________________________________________________________________________ +def padMatchingEffVsLctEtaForOddEven(filesDir, plotDir, pt, doOverlaps, ext): + """efficiency vs LCT eta - separate odd-even""" + + gStyle.SetTitleStyle(0); + gStyle.SetTitleAlign(13); ##coord in top left + gStyle.SetTitleX(0.); + gStyle.SetTitleY(1.); + gStyle.SetTitleW(1); + gStyle.SetTitleH(0.058); + gStyle.SetTitleBorderSize(0); - TLatex * tex = new TLatex(.66,.73,"1.64<|#eta|<2.12"); - tex->SetTextSize(0.05); - tex->SetNDC(); - tex->Draw(); - - gPad->Print(p_name); -} -""" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -def efficiency_1(f_name, p_name, overlap): - """Efficiency to match LCT to GEM pad vs half-strip for even and odd numbered chambers. Option to include chamber overlaps""" - - t = getTree(f_name) - if overlap: + gStyle.SetPadLeftMargin(0.126); + gStyle.SetPadRightMargin(0.04); + gStyle.SetPadTopMargin(0.06); + gStyle.SetPadBottomMargin(0.13); + gStyle.SetOptStat(0); + gStyle.SetMarkerStyle(1); + + ok_eta = TCut("TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12") + if (doOverlaps): cut1 = ok_pad1_overlap cut2 = ok_pad2_overlap + overlapStr = "_overlap" else: cut1 = ok_pad1 cut2 = ok_pad2 + overlapStr = "" - ho = draw_eff(t, "Efficiency for track with LCT to have GEM pad in chamber;LCT half-strip;Efficiency", - "h_odd", "(130,0.5,130.5)", "hs_lct_odd", TCut("%s && %s" %(ok_lct1.GetTitle(),ok_eta.GetTitle())), cut1, kRed, 5) - he = draw_eff(t, "Efficiency for track with LCT to have GEM pad in chamber;LCT half-strip;Efficiency", - "h_evn", "(130,0.5,130.5)", "hs_lct_even", TCut("%s && %s" %(ok_lct2.GetTitle(),ok_eta.GetTitle())), cut2, kBlue, 5) - - c = TCanvas("c","c",700,500) - c.Clear() - c.SetGridx(1) - c.SetGridy(1) - h = TH1F("","Efficiency for track with LCT to have GEM pad in chamber",130,0.5,130.5) - h.SetTitle("Efficiency for track with LCT to have GEM pad in chamber") - h.GetXaxis().SetTitle("LCT half-strip") - h.GetYaxis().SetTitle("Efficiency") - h.SetStats(0) - h.Draw() - ho.Draw("same") - he.Draw("same") - - pt = f_name[f_name.find('pt'):] - pt = pt[2:] - pt = pt[:pt.find('_pad')] - leg = TLegend(0.40,0.2,.7,0.5,"","brNDC") + t = getTree("%sgem_csc_delta_pt%d_pad4.root"%(filesDir,pt)) + ho = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;LCT |#eta|;Efficiency", + "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", TCut("%s&&%s"%(ok_lct1.GetTitle(), ok_eta.GetTitle())), cut1, "", kRed) + he = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;LCT |#eta|;Efficiency", + "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta_lct_even)", TCut("%s&&%s"%(ok_lct1.GetTitle(), ok_eta.GetTitle())), cut2, "same") + ho.SetMinimum(0.) + ho.GetXaxis().SetLabelSize(0.05) + ho.GetYaxis().SetLabelSize(0.05) + + leg = TLegend(0.25,0.23,.75,0.5, "", "brNDC"); leg.SetBorderSize(0) leg.SetFillStyle(0) - leg.SetTextSize(.05) - leg.AddEntry(0, "p_{T} = %s GeV/c"%(pt), "") - leg.AddEntry(0, "a pad spans 4 strips", "") - leg.AddEntry(ho,"odd chambers","l") - leg.AddEntry(he,"even chambers","l") - leg.Draw("same") - c.SaveAs(p_name) - -def drawplot_eff_eta(f_name, plotDir, ext = ".pdf"): - """Efficiency to match LCT to GEM pad vs LCT eta for even and odd numbered chambers. Option to include chamber overlaps""" + leg.SetTextSize(0.06) + leg.AddEntry(0,"muon p_{T} = %s GeV/c"%(pt),"") + leg.AddEntry(he, "\"Close\" chamber pairs","l") + leg.AddEntry(ho, "\"Far\" chamber pairs","l") + leg.Draw(); - c = TCanvas("c","c",700,500) - c.Clear() - c.SetGridx(1) - c.SetGridy(1) + tex = TLatex(.66,.73,"1.64<|#eta|<2.12") + tex.SetTextSize(0.05) + tex.SetNDC() + tex.Draw() + + ## this has to be fixed + c.Print("%sgem_pad_eff_for_LCT_vs_LCT_pt%d%s%s"%(plotDir,pt,overlapStr,ext)) - gt = getTree(f_name) - pt = f_name[f_name.find('pt'):] - pt = pt[2:] - pt = pt[:pt.find('_pad')] +#_______________________________________________________________________________ +def padMatchingEffVsSimTrackEtaForOddEven(filesDir, plotDir, pt, doOverlaps, ext): + """efficiency vs simtrack eta - separate odd-even""" + + gStyle.SetTitleStyle(0); + gStyle.SetTitleAlign(13); ##coord in top left + gStyle.SetTitleX(0.); + gStyle.SetTitleY(1.); + gStyle.SetTitleW(1); + gStyle.SetTitleH(0.058); + gStyle.SetTitleBorderSize(0); + + gStyle.SetPadLeftMargin(0.126); + gStyle.SetPadRightMargin(0.04); + gStyle.SetPadTopMargin(0.06); + gStyle.SetPadBottomMargin(0.13); + gStyle.SetOptStat(0); + gStyle.SetMarkerStyle(1); + + ok_eta = TCut("TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12") + if (doOverlaps): + cut1 = ok_pad1_overlap + cut2 = ok_pad2_overlap + overlapStr = "_overlap" + else: + cut1 = ok_pad1 + cut2 = ok_pad2 + overlapStr = "" - ho = draw_eff(gt, "Efficiency for track with LCT to have GEM pad in chamber;LCT |#eta|;Efficiency", - "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", ok_lct1, ok_pad1, kRed, 5) - he = draw_eff(gt, "Efficiency for track with LCT to have GEM pad in chamber;LCT |#eta|;Efficiency", - "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta_lct_even)", ok_lct2, ok_pad2, kBlue, 5) - h = TH1F("","Efficiency for track with LCT to have GEM pad in chamber",140,1.5,2.2) - h.SetTitle("Efficiency for track with LCT to have GEM pad in chamber") - h.GetXaxis().SetTitle("LCT |#eta|") - h.GetYaxis().SetTitle("Efficiency") - h.SetStats(0) - h.Draw() - ho.Draw("same") - he.Draw("same") - leg = TLegend(0.4,0.2,.7,0.5,"","brNDC") + t = getTree("%sgem_csc_delta_pt%d_pad4.root"%(filesDir,pt)) + ho = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;SimTrack |#eta|;Efficiency", + "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut("%s&&%s"%(ok_lct1.GetTitle(), ok_eta.GetTitle())), cut1, "", kRed) + he = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;SimTrack |#eta|;Efficiency", + "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut("%s&&%s"%(ok_lct1.GetTitle(), ok_eta.GetTitle())), cut2, "same") + ho.SetMinimum(0.) + ho.GetXaxis().SetLabelSize(0.05) + ho.GetYaxis().SetLabelSize(0.05) + + leg = TLegend(0.25,0.23,.75,0.5, "", "brNDC"); leg.SetBorderSize(0) leg.SetFillStyle(0) - leg.SetTextSize(.05) - leg.AddEntry(0, "p_{T} = %s GeV/c"%(pt), "") - leg.AddEntry(0, "a pad spans 4 strips", "") - leg.AddEntry(ho,"odd chambers","l") - leg.AddEntry(he,"even chambers","l") - leg.Draw() - c.SaveAs("%sgem_pad_eff_for_LCT_vsLCTEta_pt%s%s"%(plotDir,pt,ext)) + leg.SetTextSize(0.06) + leg.AddEntry(0,"muon p_{T} = %s GeV/c"%(pt),"") + leg.AddEntry(he, "\"Close\" chamber pairs","l") + leg.AddEntry(ho, "\"Far\" chamber pairs","l") + leg.Draw(); + + tex = TLatex(.66,.73,"1.64<|#eta|<2.12") + tex.SetTextSize(0.05) + tex.SetNDC() + tex.Draw() + + ## this has to be fixed + c.Print("%sgem_pad_eff_for_LCT_vs_TrkEta_pt%d%s%s"%(plotDir,pt,overlapStr,ext)) - draw_eff(gt, "Efficiency for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Efficiency", - "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct1, ok_pad1, kRed, 5) - draw_eff(gt, "Efficiency for track with LCT to have GEM pad in chamber;SimTrack |#eta|;Efficiency", - "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_lct2, ok_pad2, kBlue, 5) - h = TH1F("","Efficiency for track with LCT to have GEM pad in chamber",140,1.5,2.2) - h.SetTitle("Efficiency for track with LCT to have GEM pad in chamber") - h.GetXaxis().SetTitle("SimTrack |#eta|") - h.GetYaxis().SetTitle("Efficiency") - h.SetStats(0) - h.Draw() - ho.Draw("same") - he.Draw("same") - leg = TLegend(0.40,0.2,.7,0.5,"","brNDC") - leg.SetBorderSize(0) - leg.SetFillStyle(0) - leg.SetTextSize(.05) - leg.AddEntry(0, "p_{T} = %s GeV/c"%(pt), "") - leg.AddEntry(0, "a pad spans 4 strips", "") - leg.AddEntry(ho,"odd chambers","l") - leg.AddEntry(he,"even chambers","l") - leg.Draw() - c.SaveAs("%sgem_pad_eff_for_LCT_vsTrkEta_pt%s%s"%(plotDir,pt,ext)) +def makePlots(ext): + input_dir = "files_09_10_2013" + output_dir = "plots_09_10_2013/track_matching_eff/" + + padMatchingEffVsGenMuonPhiForPosAndNegMuons(input_dir,output_dir, 20, True, ext) + padMatchingEffVsHalfStripForOddEven(input_dir,output_dir, 20, True, ext) + padMatchingEffVsLctEtaForOddEven(input_dir,output_dir, 20, True, ext) + padMatchingEffVsSimTrackEtaForOddEven(input_dir,output_dir, 20, True, ext) + +if __name__ == "__main__": + makePlots(".pdf") + makePlots(".png") + makePlots(".eps") + + + ### DO NOT REMOVE THE STUFF IN COMMENTS ### + ### WE MIGHT NEED IT LATER ON ### """ draw_eff(gt, "Efficiency for track with LCT to have GEM pad in chamber;z SimTrack |#eta|;Efficiency", "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_gemsh_odd)", ok_gsh1, ok_gdg1, "P", kRed) @@ -566,40 +395,8 @@ def drawplot_eff_eta(f_name, plotDir, ext = ".pdf"): """ -def halfStripEfficiencies(filesDir, plotDir, ext): - """Plot the halfstrip efficiencies""" - - eff_halfStrip("%sgem_csc_delta_pt5_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt05%s"%(plotDir,ext)) - eff_halfStrip("%sgem_csc_delta_pt10_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt10%s"%(plotDir,ext)) - eff_halfStrip("%sgem_csc_delta_pt15_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt15%s"%(plotDir,ext)) - eff_halfStrip("%sgem_csc_delta_pt20_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt20%s"%(plotDir,ext)) - eff_halfStrip("%sgem_csc_delta_pt30_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt30%s"%(plotDir,ext)) - eff_halfStrip("%sgem_csc_delta_pt40_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt40%s"%(plotDir,ext)) - - eff_halfStrip_overlap("%sgem_csc_delta_pt5_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt05_overlap%s"%(plotDir,ext)) - eff_halfStrip_overlap("%sgem_csc_delta_pt10_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt10_overlap%s"%(plotDir,ext)) - eff_halfStrip_overlap("%sgem_csc_delta_pt15_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt15_overlap%s"%(plotDir,ext)) - eff_halfStrip_overlap("%sgem_csc_delta_pt20_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt20_overlap%s"%(plotDir,ext)) - eff_halfStrip_overlap("%sgem_csc_delta_pt30_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt30_overlap%s"%(plotDir,ext)) - eff_halfStrip_overlap("%sgem_csc_delta_pt40_pad4.root"%(filesDir), "%sgem_pad_eff_for_LCT_vs_HS_pt40_overlap%s"%(plotDir,ext)) - - -def etaMatchingEfficiencies(filesDir, plotDir, ext = ".pdf"): - """Plot the simtrack to LCT,Pad matching efficiency vs eta""" - - drawplot_eff_eta("%sgem_csc_delta_pt5_pad4.root"%(filesDir), plotDir, ext) - drawplot_eff_eta("%sgem_csc_delta_pt10_pad4.root"%(filesDir), plotDir, ext) - drawplot_eff_eta("%sgem_csc_delta_pt15_pad4.root"%(filesDir), plotDir, ext) - drawplot_eff_eta("%sgem_csc_delta_pt20_pad4.root"%(filesDir), plotDir, ext) - drawplot_eff_eta("%sgem_csc_delta_pt30_pad4.root"%(filesDir), plotDir, ext) - drawplot_eff_eta("%sgem_csc_delta_pt40_pad4.root"%(filesDir), plotDir, ext) - - - - - +""" def eff_hs_1(filesDir, plotDir, f_name, ext): - """Halfstrip matching efficiency dphi""" t = getTree("%s%s"%(filesDir, f_name)); # dphi = getDphi("%s"%(eff),"%s"%(pt[i]),"%s"%(oddEven)) @@ -619,7 +416,6 @@ def eff_hs_1(filesDir, plotDir, f_name, ext): def eff_hs_2(filesDir, plotDir, f_name, ext): - """Comment to be added here""" t = getTree("%s%s"%(filesDir, f_name)); c = TCanvas("c","c",800,600) @@ -636,7 +432,6 @@ def eff_hs_2(filesDir, plotDir, f_name, ext): c.SaveAs("%stest%s"%(plotDir, ext)) def eff_hs_3(filesDir, plotDir, f_name, ext): - """Comment to be added here""" t = getTree("%s%s"%(filesDir, f_name)); c = TCanvas("c","c",800,600) @@ -653,7 +448,6 @@ def eff_hs_3(filesDir, plotDir, f_name, ext): c.SaveAs("%stest%s"%(plotDir, ext)) def eff_hs_4(filesDir, plotDir, f_name, ext): - """Comment to be added here""" t = getTree("%s%s"%(filesDir, f_name)); c = TCanvas("c","c",800,600) @@ -671,7 +465,6 @@ def eff_hs_4(filesDir, plotDir, f_name, ext): def eff_hs_5(filesDir, plotDir, f_name, ext): - """Comment to be added here""" t = getTree("%s%s"%(filesDir, f_name)); c = TCanvas("c","c",800,600) @@ -689,7 +482,6 @@ def eff_hs_5(filesDir, plotDir, f_name, ext): def eff_hs_6(filesDir, plotDir, f_name, ext): - """Comment to be added here""" t = getTree("%s%s"%(filesDir, f_name)); c = TCanvas("c","c",800,600) @@ -706,7 +498,6 @@ def eff_hs_6(filesDir, plotDir, f_name, ext): c.SaveAs("%stest%s"%(plotDir, ext)) def eff_hs_7(filesDir, plotDir, f_name, ext): - """Comment to be added here""" t = getTree("%s%s"%(filesDir, f_name)); c = TCanvas("c","c",800,600) @@ -724,7 +515,6 @@ def eff_hs_7(filesDir, plotDir, f_name, ext): def eff_hs_8(filesDir, plotDir, f_name, ext): - """Comment to be added here""" t = getTree("%s%s"%(filesDir, f_name)); c = TCanvas("c","c",800,600) @@ -741,7 +531,6 @@ def eff_hs_8(filesDir, plotDir, f_name, ext): c.SaveAs("%stest%s"%(plotDir, ext)) def eff_hs_9(filesDir, plotDir, f_name, ext): - """Comment to be added here""" t = getTree("%s%s"%(filesDir, f_name)); c = TCanvas("c","c",800,600) @@ -761,7 +550,6 @@ def eff_hs_9(filesDir, plotDir, f_name, ext): def eff_hs_10(filesDir, plotDir, f_name, ext): - """Comment to be added here""" t = getTree("%s%s"%(filesDir, f_name)); c = TCanvas("c","c",800,600) @@ -776,6 +564,7 @@ def eff_hs_10(filesDir, plotDir, f_name, ext): he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;p_{T} [GeV/c];Eff.", "h_odd", "(50,0.,50.)", "pt", ok_lct1_eta, ok_pad1, kRed) ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;p_{T} [GeV/c];Eff.", "h_evn", "(50,0.,50.)", "pt", ok_lct2_eta, ok_pad2) c.SaveAs("%stest%s"%(plotDir, ext)) +""" """ def eff_hs_11(filesDir, plotDir, f_name, ext): @@ -797,40 +586,6 @@ def eff_hs_11(filesDir, plotDir, f_name, ext): c.SaveAs("%stest%s"%(plotDir, ext)) """ - -def eff_hs_all(filesDir, plotDir, f_name, ext): - - eff_hs_1(filesDir, plotDir, f_name, ext) - eff_hs_2(filesDir, plotDir, f_name, ext) - eff_hs_3(filesDir, plotDir, f_name, ext) - eff_hs_4(filesDir, plotDir, f_name, ext) - eff_hs_5(filesDir, plotDir, f_name, ext) - eff_hs_6(filesDir, plotDir, f_name, ext) - eff_hs_7(filesDir, plotDir, f_name, ext) - eff_hs_8(filesDir, plotDir, f_name, ext) - eff_hs_9(filesDir, plotDir, f_name, ext) - """ - eff_hs_10(filesDir, plotDir, f_name, ext) - eff_hs_11(filesDir, plotDir, f_name, ext) - """ - -def eff_hs(filesDir, plotDir, ext): - - eff_hs_all(filesDir, plotDir, "gem_csc_delta_pt5_pad4.root", ext) - eff_hs_all(filesDir, plotDir, "gem_csc_delta_pt10_pad4.root", ext) - eff_hs_all(filesDir, plotDir, "gem_csc_delta_pt15_pad4.root", ext) - eff_hs_all(filesDir, plotDir, "gem_csc_delta_pt20_pad4.root", ext) - eff_hs_all(filesDir, plotDir, "gem_csc_delta_pt30_pad4.root", ext) - eff_hs_all(filesDir, plotDir, "gem_csc_delta_pt40_pad4.root", ext) - - - - - - - - - ## gt = getTree("gem_csc_delta_pt40_pad4.root"); @@ -954,37 +709,5 @@ def eff_hs(filesDir, plotDir, ext): ## nm.Draw() ## nmlct.Draw("same") -if __name__ == "__main__": - """ - We don't always need all plots, hence lots of comments. - """ - - """ - halfStripEfficiencies("files/", "plots/efficiency/", ".pdf") - halfStripEfficiencies("files/", "plots/efficiency/", ".eps") - halfStripEfficiencies("files/", "plots/efficiency/", ".png") - - etaMatchingEfficiencies("files/", "plots/efficiency/", ".pdf") - etaMatchingEfficiencies("files/", "plots/efficiency/", ".eps") - etaMatchingEfficiencies("files/", "plots/efficiency/", ".png") - """ - - """ - gemTurnOn("files/", "plots/efficiency/", "98", "even", ".pdf") - gemTurnOn("files/", "plots/efficiency/", "98", "odd", ".pdf") - gemTurnOn("files/", "plots/efficiency/", "98", "even", ".png") - gemTurnOn("files/", "plots/efficiency/", "98", "odd", ".png") - gemTurnOn("files/", "plots/efficiency/", "98", "even", ".eps") - gemTurnOn("files/", "plots/efficiency/", "98", "odd", ".eps") - """ - -# efficiency_2(filesDir + "gem_csc_delta_pt20_pad4.root", plotDir + "gem_pad_eff_for_LCT_vs_phi_pt20_overlap" + ext, "20", true); - - padMatchingEffVsGenMuonPhiForPosAndNegMuons( - "files/","plots/tempDir/", 20, True, '.pdf') - padMatchingEffVsGenMuonPhiForPosAndNegMuons( - "files/","plots/tempDir/", 20, True, '.eps') - padMatchingEffVsGenMuonPhiForPosAndNegMuons( - "files/","plots/tempDir/", 20, True, '.png') From 2430dcf5439d925d7d8cbed209312c31d05b9bb1 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sat, 19 Oct 2013 18:18:04 +0200 Subject: [PATCH 164/182] bugfix: use nEtaPartitions() to get max partition number --- GEMValidation/plugins/GEMDigiAnalyzer.cc | 5 +++-- GEMValidation/plugins/GEMRecHitAnalyzer.cc | 5 +++-- GEMValidation/plugins/GEMSimHitAnalyzer.cc | 7 +++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/GEMValidation/plugins/GEMDigiAnalyzer.cc b/GEMValidation/plugins/GEMDigiAnalyzer.cc index b030a0655c931..4d77ec3245326 100644 --- a/GEMValidation/plugins/GEMDigiAnalyzer.cc +++ b/GEMValidation/plugins/GEMDigiAnalyzer.cc @@ -211,9 +211,10 @@ void GEMDigiAnalyzer::beginRun(edm::Run const&, edm::EventSetup const& iSetup) iSetup.get().get(gem_geo_); gem_geometry_ = &*gem_geo_; + // FIXME - when a geometry with different partition numbers will be released, the code will brake! const auto top_chamber = static_cast(gem_geometry_->idToDetUnit(GEMDetId(1,1,1,1,1,1))); - // TODO: it's really bad to hardcode max partition number! - const auto bottom_chamber = static_cast(gem_geometry_->idToDetUnit(GEMDetId(1,1,1,1,1,6))); + const int nEtaPartitions(gem_geometry_->chamber(GEMDetId(1,1,1,1,1,1))->nEtaPartitions()); + const auto bottom_chamber = static_cast(gem_geometry_->idToDetUnit(GEMDetId(1,1,1,1,1,nEtaPartitions))); const float top_half_striplength = top_chamber->specs()->specificTopology().stripLength()/2.; const float bottom_half_striplength = bottom_chamber->specs()->specificTopology().stripLength()/2.; const LocalPoint lp_top(0., top_half_striplength, 0.); diff --git a/GEMValidation/plugins/GEMRecHitAnalyzer.cc b/GEMValidation/plugins/GEMRecHitAnalyzer.cc index 36dcdf03b70bb..b02ce4e9fb022 100644 --- a/GEMValidation/plugins/GEMRecHitAnalyzer.cc +++ b/GEMValidation/plugins/GEMRecHitAnalyzer.cc @@ -165,9 +165,10 @@ void GEMRecHitAnalyzer::beginRun(edm::Run const& iRun, edm::EventSetup const& iS iSetup.get().get(gem_geom_); gem_geometry_ = &*gem_geom_; + // FIXME - when a geometry with different partition numbers will be released, the code will brake! const auto top_chamber = static_cast(gem_geometry_->idToDetUnit(GEMDetId(1,1,1,1,1,1))); - // TODO: it's really bad to hardcode max partition number! - const auto bottom_chamber = static_cast(gem_geometry_->idToDetUnit(GEMDetId(1,1,1,1,1,6))); + const int nEtaPartitions(gem_geometry_->chamber(GEMDetId(1,1,1,1,1,1))->nEtaPartitions()); + const auto bottom_chamber = static_cast(gem_geometry_->idToDetUnit(GEMDetId(1,1,1,1,1,nEtaPartitions))); const float top_half_striplength = top_chamber->specs()->specificTopology().stripLength()/2.; const float bottom_half_striplength = bottom_chamber->specs()->specificTopology().stripLength()/2.; const LocalPoint lp_top(0., top_half_striplength, 0.); diff --git a/GEMValidation/plugins/GEMSimHitAnalyzer.cc b/GEMValidation/plugins/GEMSimHitAnalyzer.cc index 5b2ade2a1bf7d..1362c20326d08 100644 --- a/GEMValidation/plugins/GEMSimHitAnalyzer.cc +++ b/GEMValidation/plugins/GEMSimHitAnalyzer.cc @@ -138,9 +138,10 @@ void GEMSimHitAnalyzer::beginRun(const edm::Run &iRun, const edm::EventSetup &iS iSetup.get().get(gem_geom); gem_geometry_ = &*gem_geom; + // FIXME - when a geometry with different partition numbers will be released, the code will brake! const auto top_chamber = static_cast(gem_geometry_->idToDetUnit(GEMDetId(1,1,1,1,1,1))); - // TODO: it's really bad to hardcode max partition number! - const auto bottom_chamber = static_cast(gem_geometry_->idToDetUnit(GEMDetId(1,1,1,1,1,6))); + const int nEtaPartitions(gem_geometry_->chamber(GEMDetId(1,1,1,1,1,1))->nEtaPartitions()); + const auto bottom_chamber = static_cast(gem_geometry_->idToDetUnit(GEMDetId(1,1,1,1,1,nEtaPartitions))); const float top_half_striplength = top_chamber->specs()->specificTopology().stripLength()/2.; const float bottom_half_striplength = bottom_chamber->specs()->specificTopology().stripLength()/2.; const LocalPoint lp_top(0., top_half_striplength, 0.); @@ -433,8 +434,6 @@ void GEMSimHitAnalyzer::buildLUT() std::vector neg_ids; neg_ids.push_back(GEMDetId(-1,1,1,1,36,1).rawId()); - // VK: I would really suggest getting phis from GEMGeometry - std::vector phis; phis.push_back(0.); for(int i=1; i<37; ++i) From 93dfdf64a29e4817fde87e8a000689024c61eb7b Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 24 Oct 2013 06:01:51 -0500 Subject: [PATCH 165/182] option to add ghosts --- GEMValidation/src/CSCStubMatcher.cc | 6 +++--- GEMValidation/src/CSCStubMatcher.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/GEMValidation/src/CSCStubMatcher.cc b/GEMValidation/src/CSCStubMatcher.cc index 7f04634ff472a..0c7dacc3c8893 100644 --- a/GEMValidation/src/CSCStubMatcher.cc +++ b/GEMValidation/src/CSCStubMatcher.cc @@ -23,6 +23,7 @@ CSCStubMatcher::CSCStubMatcher(SimHitMatcher& sh, CSCDigiMatcher& dg) maxBXALCT_ = conf().getUntrackedParameter("maxBXALCT", 8); minBXLCT_ = conf().getUntrackedParameter("minBXLCT", 3); maxBXLCT_ = conf().getUntrackedParameter("maxBXLCT", 8); + addGhostLCTs_ = conf().getUntrackedParameter("addGhostLCTs", true); setVerbose(conf().getUntrackedParameter("verboseCSCStub", 0)); @@ -282,7 +283,7 @@ CSCStubMatcher::matchLCTsToSimTrack(const CSCCorrelatedLCTDigiCollection& lcts) // Add ghost LCTs when there are two in bx // and the two don't share half-strip or wiregroup // TODO: when GEMs would be used to resolve this, there might ned to be an option to turn this off! - if (bx_to_lcts[bx].size() == 2) + if (bx_to_lcts[bx].size() == 2 && addGhostLCTs_) { auto lct11 = bx_to_lcts[bx][0]; auto lct22 = bx_to_lcts[bx][1]; @@ -303,7 +304,6 @@ CSCStubMatcher::matchLCTsToSimTrack(const CSCCorrelatedLCTDigiCollection& lcts) cout<<"added ghosts"< chamberIdsAllCLCT(int csc_type = CSC_ME1b) const; std::set chamberIdsAllALCT(int csc_type = CSC_ME1b) const; @@ -92,6 +91,8 @@ class CSCStubMatcher : public DigiMatcher template std::set selectDetIds(D &digis, int csc_type) const; + + bool addGhostLCTs_; }; From f21f9fbcbe07644c2b3f443a1d0288a4bce95fe7 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Thu, 24 Oct 2013 06:03:18 -0500 Subject: [PATCH 166/182] add lct quality to tree --- GEMValidation/plugins/GEMCSCAnalyzer.cc | 50 ++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/GEMValidation/plugins/GEMCSCAnalyzer.cc b/GEMValidation/plugins/GEMCSCAnalyzer.cc index f05ac929b06a5..db9ad28706f97 100644 --- a/GEMValidation/plugins/GEMCSCAnalyzer.cc +++ b/GEMValidation/plugins/GEMCSCAnalyzer.cc @@ -92,8 +92,8 @@ struct MyTrackEff Char_t has_csc_strips; // #layers with comparator digis > 4 bit1: in odd, bit2: even Char_t has_csc_wires; // #layers with wire digis > 4 bit1: in odd, bit2: even - //Char_t has_clct; // bit1: in odd, bit2: even - //Char_t has_alct; // bit1: in odd, bit2: even + Char_t has_clct; // bit1: in odd, bit2: even + Char_t has_alct; // bit1: in odd, bit2: even Char_t has_lct; // bit1: in odd, bit2: even Char_t bend_lct_odd; @@ -136,8 +136,10 @@ struct MyTrackEff Float_t dphi_pad_even; Float_t deta_pad_odd; Float_t deta_pad_even; -}; + Int_t quality_odd; + Int_t quality_even; +}; void MyTrackEff::init() { @@ -148,10 +150,14 @@ void MyTrackEff::init() endcap = -9; chamber_odd = 0; chamber_even = 0; + quality_odd = 0; + quality_even = 0; has_csc_sh = 0; has_csc_strips = 0; has_csc_wires = 0; + has_alct = 0; + has_clct = 0; has_lct = 0; bend_lct_odd = -9; bend_lct_even = -9; @@ -205,11 +211,13 @@ TTree* MyTrackEff::book(TTree *t, const std::string & name) t->Branch("endcap", &endcap); t->Branch("chamber_odd", &chamber_odd); t->Branch("chamber_even", &chamber_even); + t->Branch("quality_odd", &quality_odd); + t->Branch("quality_even", &quality_even); t->Branch("has_csc_sh", &has_csc_sh); t->Branch("has_csc_strips", &has_csc_strips); t->Branch("has_csc_wires", &has_csc_wires); - //t->Branch("has_clct", &has_clct); - //t->Branch("has_alct", &has_alct); + t->Branch("has_clct", &has_clct); + t->Branch("has_alct", &has_alct); t->Branch("has_lct", &has_lct); t->Branch("bend_lct_odd", &bend_lct_odd); t->Branch("bend_lct_even", &bend_lct_even); @@ -479,6 +487,36 @@ void GEMCSCAnalyzer::analyzeTrackEff(SimTrackMatchManager& match, int trk_no) else etrk_[st].has_csc_wires |= 2; } + // CSC CLCTs + csc_ch_ids = match_lct.chamberIdsCLCT(0); + for(auto d: csc_ch_ids) + { + CSCDetId id(d); + int st = id.station(); + //cout<<"LCT st "< Date: Mon, 28 Oct 2013 12:56:44 +0100 Subject: [PATCH 167/182] Option to store bending angle in CSC TMB --- SimMuL1/test/runCustomMuL1Trigger_cfg.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/SimMuL1/test/runCustomMuL1Trigger_cfg.py b/SimMuL1/test/runCustomMuL1Trigger_cfg.py index 80ad7ca206e9f..e3686bf443a90 100644 --- a/SimMuL1/test/runCustomMuL1Trigger_cfg.py +++ b/SimMuL1/test/runCustomMuL1Trigger_cfg.py @@ -43,8 +43,13 @@ process.simCscTriggerPrimitiveDigis.gemPadProducer = cms.untracked.InputTag("simMuonGEMCSCPadDigis","") process.simCscTriggerPrimitiveDigis.clctSLHC.clctPidThreshPretrig = 2 process.simCscTriggerPrimitiveDigis.clctParam07.clctPidThreshPretrig = 2 -process.simCscTriggerPrimitiveDigis.tmbSLHC.gemMatchDeltaEta = cms.untracked.double(0.08) -process.simCscTriggerPrimitiveDigis.tmbSLHC.gemMatchDeltaBX = cms.untracked.int32(1) +tmb = process.simCscTriggerPrimitiveDigis.tmbSLHC +tmb.gemMatchDeltaEta = cms.untracked.double(0.08) +tmb.gemMatchDeltaBX = cms.untracked.int32(1) +lct_store_gemdphi = True +if lct_store_gemdphi: + tmb.gemClearNomatchLCTs = cms.untracked.bool(False) + tmb.gemMatchDeltaPhiOdd = cms.untracked.double(2.) ## upgrade CSC TrackFinder process.load('L1Trigger.CSCTrackFinder.csctfTrackDigisUngangedME1a_cfi') From 5cb73c653cce7cf9dbb2f7a35eae09a1dff07049 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 28 Oct 2013 14:40:33 +0100 Subject: [PATCH 168/182] option to use different geometries --- SimMuL1/test/runCustomMuL1Trigger_cfg.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/SimMuL1/test/runCustomMuL1Trigger_cfg.py b/SimMuL1/test/runCustomMuL1Trigger_cfg.py index 80ad7ca206e9f..b8a066479dbaa 100644 --- a/SimMuL1/test/runCustomMuL1Trigger_cfg.py +++ b/SimMuL1/test/runCustomMuL1Trigger_cfg.py @@ -1,6 +1,4 @@ -## This configuration runs the DIGI+L1Emulator step - -import FWCore.ParameterSet.Config as cms +## This configuration runs the DIGI+L1Emulator mport FWCore.ParameterSet.Config as cms process = cms.Process("MUTRG") @@ -26,6 +24,13 @@ #process.Timing = cms.Service("Timing") process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) +## GEM geometry customization +use6part = True +if use6part: + mynum = process.XMLIdealGeometryESSource.geomXMLFiles.index('Geometry/MuonCommonData/data/v4/gemf.xml') + process.XMLIdealGeometryESSource.geomXMLFiles.remove('Geometry/MuonCommonData/data/v4/gemf.xml') + process.XMLIdealGeometryESSource.geomXMLFiles.insert(mynum,'Geometry/MuonCommonData/data/v2/gemf.xml') + ## upgrade CSC geometry customizations runCSCforSLHC = True if runCSCforSLHC: From f3533f2bab82f83dddd9f33654947455f68e8eb9 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 28 Oct 2013 14:45:39 +0100 Subject: [PATCH 169/182] fix typo --- SimMuL1/test/runCustomMuL1Trigger_cfg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SimMuL1/test/runCustomMuL1Trigger_cfg.py b/SimMuL1/test/runCustomMuL1Trigger_cfg.py index 2e8b685599bec..c17f8c5ad81a8 100644 --- a/SimMuL1/test/runCustomMuL1Trigger_cfg.py +++ b/SimMuL1/test/runCustomMuL1Trigger_cfg.py @@ -1,4 +1,5 @@ -## This configuration runs the DIGI+L1Emulator mport FWCore.ParameterSet.Config as cms +## This configuration runs the DIGI+L1Emulator step +import FWCore.ParameterSet.Config as cms process = cms.Process("MUTRG") From 619e44c6f40f10d82559241339fbac5280d7dca0 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 29 Oct 2013 22:10:39 +0100 Subject: [PATCH 170/182] only gmt and gem rate plotter --- ...ot_frankenstein_ptshiftX_onlyRedAndGreen.C | 1135 +++++++++++++++++ 1 file changed, 1135 insertions(+) create mode 100644 SimMuL1/scripts/drawplot_frankenstein_ptshiftX_onlyRedAndGreen.C diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX_onlyRedAndGreen.C b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX_onlyRedAndGreen.C new file mode 100644 index 0000000000000..5ec0f4dd9bea7 --- /dev/null +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX_onlyRedAndGreen.C @@ -0,0 +1,1135 @@ +TLatex* drawEtaLabel(TString minEta, TString maxEta, float x=0.17, float y=0.35, float font_size=0.) +{ + TString label(minEta + " < |#eta| < " + maxEta); + TLatex * tex = new TLatex(x, y,label); + if (font_size > 0.) tex->SetFontSize(font_size); + tex->SetTextSize(0.05); + tex->SetNDC(); + tex->Draw(); + return tex; +} + +TLatex* drawLumiLabel(float x=0.17, float y=0.35) +{ + TLatex * tex = new TLatex(x, y,"L = 4*10^{34} cm^{-2} s^{-1}"); + tex->SetTextSize(0.05); + tex->SetNDC(); + tex->Draw(); + return tex; +} + +TLatex* drawL1Label(float x=0.17, float y=0.35) +{ + TLatex * tex = new TLatex(x, y,"L1 trigger in 2012 configuration"); + tex->SetTextSize(0.04); + tex->SetNDC(); + tex->Draw(); + return tex; +} + +void produceRatePlot(TH1D* h, TH1D* i, TH1D* j, TH1D* m, Color_t col0, Color_t col1, Color_t col2, Color_t col3, + float miny, float maxy, TString k, TString l, TString plots, TString ext) +) +{ + TCanvas* c = new TCanvas("c","c",800,800); + c->Clear(); + TPad *pad1 = new TPad("pad1","top pad",0.0,0.25,1.0,1.0); + pad1->Draw(); + TPad *pad2 = new TPad("pad2","bottom pad",0,0.,1.0,.30); + pad2->Draw(); + + pad1->cd(); + pad1->SetLogx(1); + pad1->SetLogy(1); + pad1->SetGridx(1); + pad1->SetGridy(1); + pad1->SetFrameBorderMode(0); + pad1->SetFillColor(kWhite); + + h->SetFillColor(col0); + i->SetFillColor(col1); + j->SetFillColor(col2); + m->SetFillColor(col3); + + h->Draw("e3"); + // i->Draw("same e3"); + // j->Draw("same e3"); + m->Draw("same e3"); + h->Draw("same e3"); + h->GetYaxis()->SetRangeUser(miny, maxy); + h->GetXaxis()->SetTitle(""); + + TLegend *leg = new TLegend(0.15,0.84,.93,0.93,"","brNDC"); + leg->SetMargin(0.15); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.04); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + leg->AddEntry(h, "L1 Single Mu (2012 configuration) + ME1/1a unganging","f"); + leg->AddEntry(m,"GEM+CSC integrated trigger with #geq" + k + " stubs","f"); + leg->Draw(); + + /* + TLegend *leg = new TLegend(0.4,0.78,.93,0.88,"","brNDC"); + leg->SetMargin(0.22); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetTextSize(0.04); + leg->SetFillStyle(1001); + leg->SetFillColor(kWhite); + // leg->AddEntry(i,"CSC #geq" + k + " stubs (anywhere)","f"); + // leg->AddEntry(j,"CSC #geq" + k + " stubs (one in Station 1)","f"); + leg->Draw(); + */ + + drawLumiLabel(0.17,.3); + drawEtaLabel("1.64","2.14",0.17,.37); + + pad2->cd(); + pad2->SetLogx(1); + pad2->SetLogy(1); + pad2->SetGridx(1); + pad2->SetGridy(1); + pad2->SetFillColor(kWhite); + pad2->SetFrameBorderMode(0); + pad2->SetLeftMargin(0.126); + pad2->SetRightMargin(0.04); + pad2->SetTopMargin(0.06); + pad2->SetBottomMargin(0.4); + + TH1D* hh_ratio = setHistoRatio(m, j, "", 0.01,1.1,col2); + hh_ratio->GetXaxis()->SetTitle("L1 muon candidate p_{T}^{cut} [GeV/c]"); + hh_ratio->GetYaxis()->SetNdivisions(3); + // hh_ratio->Draw("P"); + + TH1D* hh_ratio_gmt = setHistoRatio(m, h, "", 0.01,1.1,col0); + hh_ratio_gmt->GetYaxis()->SetNdivisions(3); + hh_ratio_gmt->Draw("P same"); + + leg = new TLegend(0.14,0.38,.45,0.65,NULL,"brNDC"); + leg->SetMargin(0.04); + leg->SetBorderSize(0); + leg->SetTextSize(0.1); + leg->SetFillStyle(0); + // leg->SetFillStyle(1001); + // leg->SetFillColor(kWhite); + leg->AddEntry(hh_ratio_gmt, "(GEM+CSC)/L1 Single Mu","p"); + //leg->AddEntry(hh_ratio, "(GEM+CSC)/CSC #geq" + k + " stubs (one in Station 1)","p"); + leg->Draw("same"); + + c->SaveAs(plots + "rates_vs_pt__PU100__def_" + k + "s_" + k + "s1b_" + k + "s1bgem__" + l + "_only_SMT_GE11" + ext); +} + + + +void drawplot_frankenstein_ptshiftX_onlyRedAndGreen() +{ + gROOT->ProcessLine(".L drawplot_gmtrt.C"); + gROOT->ProcessLine(".L getPTHistos.C"); + + TString ext = ".pdf"; + TString filesDir = "files/"; + TString plotDir = "plots/rate_vs_pt_shiftX/"; + + gem_label = "gem98"; + + gROOT->SetBatch(true); + //gStyle->SetStatW(0.13); + //gStyle->SetStatH(0.08); + gStyle->SetStatW(0.07); + gStyle->SetStatH(0.06); + gStyle->SetOptStat(0); + gStyle->SetTitleStyle(0); + gStyle->SetTitleAlign(13);// coord in top left + gStyle->SetTitleX(0.); + gStyle->SetTitleY(1.); + gStyle->SetTitleW(1); + gStyle->SetTitleH(0.058); + gStyle->SetTitleBorderSize(0); + gStyle->SetPadLeftMargin(0.126); + gStyle->SetPadRightMargin(0.04); + gStyle->SetPadTopMargin(0.06); + gStyle->SetPadBottomMargin(0.13); + gStyle->SetMarkerStyle(1); + + TCanvas* cAll100r = new TCanvas("cAll100r","cAll100r",800,300) ; + gPad->SetLogx(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + TCanvas* cAll100 = new TCanvas("cAll100","cAll100",800,600) ; + gPad->SetLogx(1);gPad->SetLogy(1); + gPad->SetGridx(1);gPad->SetGridy(1); + + + // ********** PAT2 ********** + + getPTHistos("minbias_pt10_pat2", filesDir, filesDir, gem_label); + hh = (TH1D*)result_def_3s1b->Clone("gem_new"); + for (int b = hh->FindBin(7.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); + hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); + for (int b = hh_all->FindBin(7.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); + hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); + for (int b = hh_no1a->FindBin(7.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); + hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); + for (int b = hh_2s1b->FindBin(7.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); + + h06 = (TH1D*)result_gem->Clone("gem_new_06"); + for (int b = h06->FindBin(7.01); b < h06->FindBin(8.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} + h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); + for (int b = h06_all->FindBin(7.01); b < h06_all->FindBin(8.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} + h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); + for (int b = h06_no1a->FindBin(7.01); b < h06_no1a->FindBin(8.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} + h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); + for (int b = h06_2s1b->FindBin(7.01); b < h06_2s1b->FindBin(8.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt15_pat2", filesDir, filesDir, gem_label); + h10 = (TH1D*)result_gem->Clone("gem10"); + for (int b = h10->FindBin(8.01); b < h10->FindBin(10.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} + h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); + for (int b = h10_all->FindBin(8.01); b < h10_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} + h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); + for (int b = h10_no1a->FindBin(8.01); b < h10_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} + h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); + for (int b = h10_2s1b->FindBin(8.01); b < h10_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt20_pat2", filesDir, filesDir, gem_label); + h15 = (TH1D*)result_gem->Clone("gem15"); + for (int b = h15->FindBin(10.01); b < h15->FindBin(15.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} + h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); + for (int b = h15_all->FindBin(10.01); b < h15_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} + h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); + for (int b = h15_no1a->FindBin(10.01); b < h15_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} + h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); + for (int b = h15_2s1b->FindBin(10.01); b < h15_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt30_pat2", filesDir, filesDir, gem_label); + h20 = (TH1D*)result_gem->Clone("gem20"); + for (int b = h20->FindBin(15.01); b < h20->FindBin(20.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} + h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); + for (int b = h20_all->FindBin(15.01); b < h20_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} + h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); + for (int b = h20_no1a->FindBin(15.01); b < h20_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} + h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); + for (int b = h20_2s1b->FindBin(15.01); b < h20_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt40_pat2", filesDir, filesDir, gem_label); + h30 = (TH1D*)result_gem->Clone("gem30"); + for (int b = h30->FindBin(20.01); b <= h30->GetNbinsX(); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} + h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); + for (int b = h30_all->FindBin(20.01); b < h30_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} + h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); + for (int b = h30_no1a->FindBin(20.01); b < h30_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} + h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); + for (int b = h30_2s1b->FindBin(20.01); b < h30_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} + + for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); + for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); + for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); + for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); + + + // TString the_ttl = " L1 Single Muon Trigger CMS Simulation Preliminary;L1 candidate muon p_{T}^{cut} [GeV/c];rate [kHz]"; + TString the_ttl = " CMS Phase-2 Simulation Preliminary;L1 muon candidate p_{T}^{cut} [GeV/c];Trigger rate [kHz]"; + + hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); + hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); + hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); + hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); + + result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); + + result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); + result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); + result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); + result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); + + hh->SetFillColor(kGreen+4); + hh_all->SetFillColor(kGreen+4); + hh_no1a->SetFillColor(kGreen+4); + hh_2s1b->SetFillColor(kGreen+4); + + result_def_2s__pat2 = (TH1D*) result_def_2s->Clone("result_def_2s__pat2"); + result_def_3s__pat2 = (TH1D*) result_def->Clone("result_def_3s__pat2"); + result_def_2s1b__pat2 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat2"); + result_def_3s1b__pat2 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat2"); + result_gmtsing__pat2 = (TH1D*) result_gmtsing->Clone("result_gmtsing__pat2");; + + result_gem_2s1b__pat2 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat2"); + result_gem_3s1b__pat2 = (TH1D*) hh->Clone("result_gem_3s1b__pat2"); + + + /* + // --- def-3s gem-3s-3s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def,"default emulator","f"); + leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh,"with GEM match","f"); + leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + + + // --- def-3s-3s1b gem-3s-3s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3"); + hh->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s1b,"default emulator","f"); + leg->AddEntry(hh,"with GEM match","f"); + leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + + + // --- def-3s-2s1b gem-3s-2s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s1b->Draw("e3"); + hh_2s1b->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s1b,"default emulator","f"); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); + + + // --- def-3s gem-3s-2s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh_2s1b->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def,"default emulator","f"); + leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); + + + // --- def-3s-3s1b gem-3s-2s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3"); + hh_2s1b->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s1b,"default emulator","f"); + leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat2__ratio" + ext); + + + // --- eta 1-2.4 def-3s gem-3s-3s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_all->Draw("e3"); + hh_all->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_all,"default emulator","f"); + leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); + leg->AddEntry(hh_all,"with GEM match","f"); + leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + + + // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_all_3s1b->Draw("e3"); + hh_all->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); + leg->AddEntry(hh_all,"with GEM match","f"); + leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.4",""); + leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + + + // --- eta 1-2.1 def-3s gem-3s-3s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_no1a->Draw("e3"); + hh_no1a->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_no1a,"default emulator","f"); + leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); + leg->AddEntry(hh_no1a,"with GEM match","f"); + leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + + + // --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_no1a_3s1b->Draw("e3"); + hh_no1a->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); + leg->AddEntry(hh_no1a,"with GEM match","f"); + leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat2__ratio" + ext); + + + + + + + */ + // ********** PAT8 ********** + + getPTHistos("minbias_pt10_pat8", filesDir, filesDir, gem_label); + hh = (TH1D*)result_def_3s1b->Clone("gem_new"); + for (int b = hh->FindBin(7.01); b <= hh->GetNbinsX(); ++b) hh->SetBinContent(b, 0); + hh_all = (TH1D*)result_def_eta_all_3s1b->Clone("gem_new_eta_all"); + for (int b = hh_all->FindBin(7.01); b <= hh_all->GetNbinsX(); ++b) hh_all->SetBinContent(b, 0); + hh_no1a = (TH1D*)result_def_eta_no1a_3s1b->Clone("gem_new_eta_no1a"); + for (int b = hh_no1a->FindBin(7.01); b <= hh_no1a->GetNbinsX(); ++b) hh_no1a->SetBinContent(b, 0); + hh_2s1b = (TH1D*)result_def_2s1b->Clone("gem_new_2s1b"); + for (int b = hh_2s1b->FindBin(7.01); b <= hh_2s1b->GetNbinsX(); ++b) hh_2s1b->SetBinContent(b, 0); + + h06 = (TH1D*)result_gem->Clone("gem_new_06"); + for (int b = h06->FindBin(7.01); b < h06->FindBin(8.01); ++b) {hh->SetBinContent(b, h06->GetBinContent(b)); hh->SetBinError(b, h06->GetBinError(b));} + h06_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_06"); + for (int b = h06_all->FindBin(7.01); b < h06_all->FindBin(8.01); ++b) {hh_all->SetBinContent(b, h06_all->GetBinContent(b)); hh_all->SetBinError(b, h06_all->GetBinError(b));} + h06_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_06"); + for (int b = h06_no1a->FindBin(7.01); b < h06_no1a->FindBin(8.01); ++b) {hh_no1a->SetBinContent(b, h06_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h06_no1a->GetBinError(b));} + h06_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_06"); + for (int b = h06_2s1b->FindBin(7.01); b < h06_2s1b->FindBin(8.01); ++b) {hh_2s1b->SetBinContent(b, h06_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h06_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt15_pat8", filesDir, filesDir, gem_label); + h10 = (TH1D*)result_gem->Clone("gem10"); + for (int b = h10->FindBin(8.01); b < h10->FindBin(10.01); ++b) {hh->SetBinContent(b, h10->GetBinContent(b)); hh->SetBinError(b, h10->GetBinError(b));} + h10_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_10"); + for (int b = h10_all->FindBin(8.01); b < h10_all->FindBin(10.01); ++b) {hh_all->SetBinContent(b, h10_all->GetBinContent(b)); hh_all->SetBinError(b, h10_all->GetBinError(b));} + h10_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_10"); + for (int b = h10_no1a->FindBin(8.01); b < h10_no1a->FindBin(10.01); ++b) {hh_no1a->SetBinContent(b, h10_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h10_no1a->GetBinError(b));} + h10_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_10"); + for (int b = h10_2s1b->FindBin(8.01); b < h10_2s1b->FindBin(10.01); ++b) {hh_2s1b->SetBinContent(b, h10_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h10_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt20_pat8", filesDir, filesDir, gem_label); + h15 = (TH1D*)result_gem->Clone("gem15"); + for (int b = h15->FindBin(10.01); b < h15->FindBin(15.01); ++b) {hh->SetBinContent(b, h15->GetBinContent(b)); hh->SetBinError(b, h15->GetBinError(b));} + h15_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_15"); + for (int b = h15_all->FindBin(10.01); b < h15_all->FindBin(15.01); ++b) {hh_all->SetBinContent(b, h15_all->GetBinContent(b)); hh_all->SetBinError(b, h15_all->GetBinError(b));} + h15_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_15"); + for (int b = h15_no1a->FindBin(10.01); b < h15_no1a->FindBin(15.01); ++b) {hh_no1a->SetBinContent(b, h15_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h15_no1a->GetBinError(b));} + h15_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_15"); + for (int b = h15_2s1b->FindBin(10.01); b < h15_2s1b->FindBin(15.01); ++b) {hh_2s1b->SetBinContent(b, h15_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h15_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt30_pat8", filesDir, filesDir, gem_label); + h20 = (TH1D*)result_gem->Clone("gem20"); + for (int b = h20->FindBin(15.01); b < h20->FindBin(20.01); ++b) {hh->SetBinContent(b, h20->GetBinContent(b)); hh->SetBinError(b, h20->GetBinError(b));} + h20_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_20"); + for (int b = h20_all->FindBin(15.01); b < h20_all->FindBin(20.01); ++b) {hh_all->SetBinContent(b, h20_all->GetBinContent(b)); hh_all->SetBinError(b, h20_all->GetBinError(b));} + h20_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_20"); + for (int b = h20_no1a->FindBin(15.01); b < h20_no1a->FindBin(20.01); ++b) {hh_no1a->SetBinContent(b, h20_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h20_no1a->GetBinError(b));} + h20_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_20"); + for (int b = h20_2s1b->FindBin(15.01); b < h20_2s1b->FindBin(20.01); ++b) {hh_2s1b->SetBinContent(b, h20_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h20_2s1b->GetBinError(b));} + + getPTHistos("minbias_pt40_pat8", filesDir, filesDir, gem_label); + h30 = (TH1D*)result_gem->Clone("gem30"); + for (int b = h30->FindBin(20.01); b <= h30->GetNbinsX(); ++b) {hh->SetBinContent(b, h30->GetBinContent(b)); hh->SetBinError(b, h30->GetBinError(b));} + h30_all = (TH1D*)result_gem_eta_all->Clone("gem_new_eta_all_30"); + for (int b = h30_all->FindBin(20.01); b < h30_all->GetNbinsX(); ++b) {hh_all->SetBinContent(b, h30_all->GetBinContent(b)); hh_all->SetBinError(b, h30_all->GetBinError(b));} + h30_no1a = (TH1D*)result_gem_eta_no1a->Clone("gem_new_eta_no1a_30"); + for (int b = h30_no1a->FindBin(20.01); b < h30_no1a->GetNbinsX(); ++b) {hh_no1a->SetBinContent(b, h30_no1a->GetBinContent(b)); hh_no1a->SetBinError(b, h30_no1a->GetBinError(b));} + h30_2s1b = (TH1D*)result_gem_2s1b->Clone("gem_new_2s1b_30"); + for (int b = h30_2s1b->FindBin(20.01); b < h30_2s1b->GetNbinsX(); ++b) {hh_2s1b->SetBinContent(b, h30_2s1b->GetBinContent(b)); hh_2s1b->SetBinError(b, h30_2s1b->GetBinError(b));} + + for (int b = 1; b <= hh->GetNbinsX(); ++b) if (hh->GetBinContent(b)==0) hh->SetBinError(b, 0.); + for (int b = 1; b <= hh_all->GetNbinsX(); ++b) if (hh_all->GetBinContent(b)==0) hh_all->SetBinError(b, 0.); + for (int b = 1; b <= hh_no1a->GetNbinsX(); ++b) if (hh_no1a->GetBinContent(b)==0) hh_no1a->SetBinError(b, 0.); + for (int b = 1; b <= hh_2s1b->GetNbinsX(); ++b) if (hh_2s1b->GetBinContent(b)==0) hh_2s1b->SetBinError(b, 0.); + + + hh = setPTHisto(hh, the_ttl, kGreen+3, 1, 1); + hh_all = setPTHisto(hh_all, the_ttl, kGreen+3, 1, 1); + hh_no1a = setPTHisto(hh_no1a, the_ttl, kGreen+3, 1, 1); + hh_2s1b = setPTHisto(hh_2s1b, the_ttl, kGreen+3, 1, 1); + + result_gmtsing = setPTHisto(result_gmtsing, the_ttl, kAzure+1, 1, 1); + + result_def = setPTHisto(result_def, the_ttl, kAzure+9, 1, 1); + result_def_2s = setPTHisto(result_def_2s, the_ttl, kAzure+9, 1, 1); + result_def_3s1b = setPTHisto(result_def_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_2s1b = setPTHisto(result_def_2s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_all = setPTHisto(result_def_eta_all, the_ttl, kAzure+9, 1, 1); + result_def_eta_all_3s1b = setPTHisto(result_def_eta_all_3s1b, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a = setPTHisto(result_def_eta_no1a, the_ttl, kAzure+9, 1, 1); + result_def_eta_no1a_3s1b = setPTHisto(result_def_eta_no1a_3s1b, the_ttl, kAzure+9, 1, 1); + + + + hh->SetFillColor(kGreen+4); + hh_all->SetFillColor(kGreen+4); + hh_no1a->SetFillColor(kGreen+4); + hh_2s1b->SetFillColor(kGreen+4); + + result_def_2s__pat8 = (TH1D*) result_def_2s->Clone("result_def_2s__pat8"); + result_def_3s__pat8 = (TH1D*) result_def->Clone("result_def_3s__pat8"); + result_def_2s1b__pat8 = (TH1D*) result_def_2s1b->Clone("result_def_2s1b__pat8"); + result_def_3s1b__pat8 = (TH1D*) result_def_3s1b->Clone("result_def_3s1b__pat8"); + result_gmtsing__pat8 = (TH1D*) result_gmtsing->Clone("result_gmtsing__pat8");; + + result_gem_2s1b__pat8 = (TH1D*) hh_2s1b->Clone("result_gem_2s1b__pat8"); + result_gem_3s1b__pat8 = (TH1D*) hh->Clone("result_gem_3s1b__pat8"); + + /* + // --- def-3s gem-3s-3s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def,"default emulator","f"); + leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh,"with GEM match","f"); + leg->AddEntry(result_def,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + + + // --- def-3s-3s1b gem-3s-3s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3"); + hh->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s1b,"default emulator","f"); + leg->AddEntry(hh,"with GEM match","f"); + leg->AddEntry(result_def_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh, result_def_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + + + // --- def-3s-2s1b gem-3s-2s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s1b->Draw("e3"); + hh_2s1b->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s1b,"default emulator","f"); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(result_def_2s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_2s1b,"with #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def_2s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-2s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); + + + // --- def-3s gem-3s-2s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def->Draw("e3"); + hh_2s1b->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def,"default emulator","f"); + leg->AddEntry(result_def,"Tracks: with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(hh_2s1b,"Tracks: with #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); + + + // --- def-3s-3s1b gem-3s-2s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s1b->Draw("e3"); + hh_2s1b->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s1b,"default emulator","f"); + leg->AddEntry(result_def_3s1b,"Tracks req. #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_3s1b,"and require one stub to be from ME1/b",""); + leg->AddEntry(hh_2s1b,"with GEM match","f"); + leg->AddEntry(hh_2s1b,"Tracks req. #geq2 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(hh_2s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_2s1b, result_def_3s1b, "", 0.,3.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__def-3s-3s1b__gem-3s-2s1b__Frankenstein_pat8__ratio" + ext); + + + // --- eta 1-2.4 def-3s gem-3s-3s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_all->Draw("e3"); + hh_all->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_all,"default emulator","f"); + leg->AddEntry(result_def_eta_all,"Tracks: with #geq3 stubs in 1.<|#eta|<2.4",""); + leg->AddEntry(hh_all,"with GEM match","f"); + leg->AddEntry(result_def_eta_all,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_all, result_def_eta_all, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + + + // --- eta 1-2.4 def-3s-3s1b gem-3s-3s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_all_3s1b->Draw("e3"); + hh_all->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_all_3s1b,"default emulator","f"); + leg->AddEntry(hh_all,"with GEM match","f"); + leg->AddEntry(result_def_eta_all_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_eta_all_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_eta_all_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_all, result_def_eta_all_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-240_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + + + // --- eta 1-2.1 def-3s gem-3s-3s1b + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_no1a->Draw("e3"); + hh_no1a->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_no1a,"default emulator","f"); + leg->AddEntry(result_def_eta_no1a,"Tracks: with #geq3 stubs in 1.<|#eta|<2.14",""); + leg->AddEntry(hh_no1a,"with GEM match","f"); + leg->AddEntry(result_def_eta_no1a,"Tracks: same, plus req. one stub from ME1/b",""); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + + + // --- eta 1-2.1 def-3s-3s1b gem-3s-3s1b + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_eta_no1a_3s1b->Draw("e3"); + hh_no1a->Draw("same e3"); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_eta_no1a_3s1b,"default emulator","f"); + leg->AddEntry(hh_no1a,"with GEM match","f"); + leg->AddEntry(result_def_eta_no1a_3s1b,"Tracks req. for both:",""); + leg->AddEntry(result_def_eta_no1a_3s1b,"with #geq3 stubs in 1.64<|#eta|<2.14",""); + leg->AddEntry(result_def_eta_no1a_3s1b,"and require one stub to be from ME1/b",""); + leg->Draw(); + drawPULabel(); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(hh_no1a, result_def_eta_no1a_3s1b, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__100-214_PU100__def-3s-3s1b__gem-3s-3s1b__Frankenstein_pat8__ratio" + ext); + + + + */ + + //-------------------------- "Sequential" combinations ----------------------------- + + result_def_2s__pat2->SetFillColor(kAzure+2); + result_def_2s1b__pat2->SetFillColor(kAzure+5); + result_def_3s__pat2->SetFillColor(kAzure+3); + result_def_3s1b__pat2->SetFillColor(kAzure+6); + + result_def_2s__pat8->SetFillColor(kViolet); + result_def_2s1b__pat8->SetFillColor(kViolet+3); + result_def_3s__pat8->SetFillColor(kViolet+1); + result_def_3s1b__pat8->SetFillColor(kViolet+4); + + result_gmtsing__pat2->SetFillColor(kRed); + result_gmtsing__pat8->SetFillColor(kRed); + + result_gem_2s1b__pat2->SetFillColor(kGreen+1); + result_gem_3s1b__pat2->SetFillColor(kGreen+3); + result_gem_2s1b__pat8->SetFillColor(kGreen-2); + result_gem_3s1b__pat8->SetFillColor(kGreen-3); + + /* + result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); + result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); + result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 3000.); + result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 3000.); + result_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 1000.); + result_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 1000.); + */ + result_def_2s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); + result_def_2s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); + result_def_3s__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); + result_def_3s__pat8->GetYaxis()->SetRangeUser(0.01, 8000.); + result_gem_2s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); + result_gem_3s1b__pat2->GetYaxis()->SetRangeUser(0.01, 8000.); + result_gmtsing__pat2->GetYaxis()->SetRangeUser(.1, 5000.); + result_gmtsing__pat8->GetYaxis()->SetRangeUser(.1, 5000.); + + /* + ///----- 3 stubs + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat2->Draw("e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_gem_3s1b__pat2->Draw("same e3"); + + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_def_3s__pat2,"any stubs","f"); + leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); + leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2" + ext); + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s1b__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s1b__Frankenstein_pat2__ratio" + ext); + hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_def_3s__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat2__ratio" + ext); + + + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat2->Draw("e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_gmtsing__pat2->Draw("same e3"); + result_gem_3s1b__pat2->Draw("same e3"); + + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_def_3s__pat2,"any stubs","f"); + leg->AddEntry(result_def_3s1b__pat2,"has ME1/b stub","f"); + leg->AddEntry(result_gem_3s1b__pat2,"has (ME1/b + GEM) stub","f"); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2" + ext); + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_3s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s_GMT__Frankenstein_pat2__ratio" + ext); + + + TFile fsave("gem_3plus_ptshiftX.root", "RECREATE"); + result_gem_2s1b__pat2->Write(); + result_gem_3s1b__pat2->Write(); + fsave.Write(); + fsave.Close(); + + + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat8->Draw("e3"); + result_def_3s1b__pat8->Draw("same e3"); + result_gem_3s1b__pat8->Draw("same e3"); + + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat8,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_def_3s__pat8,"any stubs","f"); + leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub","f"); + leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub","f"); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s__Frankenstein_pat8" + ext); + + + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat2->Draw("e3"); + result_def_3s__pat8->Draw("same e3"); + result_def_3s1b__pat8->Draw("same e3"); + result_gem_3s1b__pat8->Draw("same e3"); + + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks #geq3 stubs:",""); + leg->AddEntry(result_def_3s__pat2,"any stubs","f"); + leg->AddEntry(result_def_3s__pat8,"any stubs, tight patt.","f"); + leg->AddEntry(result_def_3s1b__pat8,"has ME1/b stub, tight patt.","f"); + leg->AddEntry(result_gem_3s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__164-214_PU100__sequential__3s__Frankenstein" + ext); + + + /// ----- 2 stubs + + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s__pat2->Draw("e3"); + result_def_2s1b__pat2->Draw("same e3"); + result_gem_2s1b__pat2->Draw("same e3"); + + TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_def_2s__pat2,"any stubs","f"); + leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); + leg->Draw(); + + drawPULabel(); + + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat2" + ext); + + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_def_2s1b__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s1b__Frankenstein_pat2__ratio" + ext); + + + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s__pat2->Draw("e3"); + result_def_2s1b__pat2->Draw("same e3"); + result_gmtsing__pat2->Draw("same e3"); + result_gem_2s1b__pat2->Draw("same e3"); + TLegend *leg = new TLegend(0.47,0.685,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); + leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_def_2s__pat2,"any stubs","f"); + leg->AddEntry(result_def_2s1b__pat2,"has ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat2,"has (ME1/b + GEM) stub","f"); + leg->Draw(); + drawPULabel(); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2" + ext); + ((TCanvas*)gROOT->FindObject("cAll100r"))->cd(); + hh_ratio = setHistoRatio(result_gem_2s1b__pat2, result_gmtsing__pat2, "", 0.,1.1); + hh_ratio->Draw("e1"); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s_GMT__Frankenstein_pat2__ratio" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s__pat8->Draw("e3"); + result_def_2s1b__pat8->Draw("same e3"); + result_gem_2s1b__pat8->Draw("same e3"); + TLegend *leg = new TLegend(0.47,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s__pat8,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_def_2s__pat8,"any stubs","f"); + leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub","f"); + leg->Draw(); + drawPULabel(); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s__Frankenstein_pat8" + ext); + + + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_2s__pat2->Draw("e3"); + result_def_2s__pat8->Draw("same e3"); + result_def_2s1b__pat8->Draw("same e3"); + result_gem_2s1b__pat8->Draw("same e3"); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_2s__pat2,"CSCTF tracks #geq2 stubs:",""); + leg->AddEntry(result_def_2s__pat2,"any stubs","f"); + leg->AddEntry(result_def_2s__pat8,"any stubs, tight patt.","f"); + leg->AddEntry(result_def_2s1b__pat8,"has ME1/b stub, tight patt.","f"); + leg->AddEntry(result_gem_2s1b__pat8,"has (ME1/b + GEM) stub, tight patt.","f"); + leg->Draw(); + drawPULabel(); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s__Frankenstein" + ext); + + + /// ----- GMT current "default" single trigger + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_gmtsing__pat2->Draw("e3"); + result_def_2s__pat2->Draw("same e3"); + result_def_2s1b__pat2->Draw("same e3"); + result_def_3s__pat2->Draw("same e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_gmtsing__pat2->Draw("same e3"); + TLegend *leg = new TLegend(0.49,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_gmtsing__pat2,"GMT single Mu selection","f"); + leg->AddEntry(result_def_2s__pat2,"Tracks: #geq2 stubs","f"); + leg->AddEntry(result_def_2s1b__pat2," #geq2 with ME1/b stubs","f"); + leg->AddEntry(result_def_3s__pat2," #geq3 stubs","f"); + leg->AddEntry(result_def_3s1b__pat2," #geq3 with ME1/b stubs","f"); + leg->Draw(); + drawPULabel(); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__GMT__Frankenstein_pat2" + ext); + + ///----- 2 & 3 stubs + ((TCanvas*)gROOT->FindObject("cAll100"))->cd(); + result_def_3s__pat2->Draw("e3"); + result_def_3s1b__pat2->Draw("same e3"); + result_gem_2s1b__pat2->Draw("same e3"); + result_gem_3s1b__pat2->Draw("same e3"); + TLegend *leg = new TLegend(0.4,0.65,.98,0.92,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->AddEntry(result_def_3s__pat2,"CSCTF tracks with:",""); + leg->AddEntry(result_def_3s__pat2,"3+ stubs","f"); + leg->AddEntry(result_def_3s1b__pat2,"3+ stubs with ME1/b stub","f"); + leg->AddEntry(result_gem_2s1b__pat2,"2+ stubs with (ME1/b + GEM) stub","f"); + leg->AddEntry(result_gem_2s1b__pat2,"3+ stubs with (ME1/b + GEM) stub","f"); + leg->Draw(); + drawPULabel(); + gPad->Print(plotDir + "rates__164-214_PU100__sequential__2s3s__Frankenstein_pat2" + ext); + */ + + Color_t col0 = kRed; + Color_t col1 = kViolet+1; + Color_t col2 = kAzure+2; + Color_t col3 = kGreen-2; + + produceRatePlot(result_gmtsing, result_def_2s__pat2, result_def_2s1b__pat2, result_gem_2s1b__pat2, + col0, col1, col2, col3, 0.1, 10000, "2", "loose", plotDir, ext); + //produceRatePlot(result_gmtsing, result_def_2s, result_def_2s1b, result_gem_2s1b, + // col0, col1, col2, col3, 0.1, 10000, "2", "tight", plots, ext); + produceRatePlot(result_gmtsing, result_def_3s__pat2, result_def_3s1b__pat2, result_gem_3s1b__pat2, + col0, col1, col2, col3, 0.01, 10000, "3", "loose", plotDir, ext); + // produceRatePlot(result_gmtsing, result_def_3s, result_def_3s1b, result_gem_3s1b, + // col0, col1, col2, col3, 0.01, 10000, "3", "tight", plots, ext); + + return; +} + From ad8c77514917be4b2e24dd332e9f59388171f448 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 30 Oct 2013 13:51:21 +0100 Subject: [PATCH 171/182] addition of PyROOT AND and OR --- SimMuL1/scripts/cuts.py | 82 +++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 32 deletions(-) diff --git a/SimMuL1/scripts/cuts.py b/SimMuL1/scripts/cuts.py index a5b626ea37501..cdb01b67eaec7 100644 --- a/SimMuL1/scripts/cuts.py +++ b/SimMuL1/scripts/cuts.py @@ -1,62 +1,82 @@ from ROOT import TCut -ok_eta = TCut("TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.14") -ok_pt = TCut("pt > 20.") +#_______________________________________________________________________________ +def AND(cut1,cut2): + return TCut("(%s) && (%s)"%(cut1.GetTitle(),cut2.GetTitle())) -ok_dphi1 = TCut("dphi_pad_odd < 10.") -ok_dphi2 = TCut("dphi_pad_even < 10.") +#_______________________________________________________________________________ +def OR(cut1,cut2): + return TCut("(%s) || (%s)"%(cut1.GetTitle(),cut2.GetTitle())) +#_______________________________________________________________________________ +ok_eta = TCut("TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.14") +ok_pt = TCut("pt > 20.") +## CSC simhits & digis ok_sh1 = TCut("(has_csc_sh&1) > 0") ok_sh2 = TCut("(has_csc_sh&2) > 0") ok_st1 = TCut("(has_csc_strips&1) > 0") ok_st2 = TCut("(has_csc_strips&2) > 0") ok_w1 = TCut("(has_csc_wires&1) > 0") ok_w2 = TCut("(has_csc_wires&2) > 0") -ok_digi1 = TCut("%s && %s" %(ok_st1.GetTitle(),ok_w1.GetTitle())) -ok_digi2 = TCut("%s && %s" %(ok_st2.GetTitle(),ok_w2.GetTitle())) +ok_digi1 = AND(ok_st1,ok_w1) +ok_digi2 = AND(ok_st2,ok_w2) + +## CSC stub ok_lct1 = TCut("(has_lct&1) > 0") ok_lct2 = TCut("(has_lct&2) > 0") -ok_lcths1 = TCut("%s && hs_lct_odd > 4 && hs_lct_odd < 125" %(ok_lct1.GetTitle())) -ok_lcths2 = TCut("%s && hs_lct_odd > 4 && hs_lct_odd < 125" %(ok_lct2.GetTitle())) - +ok_alct1 = TCut("(has_alct&1) > 0") +ok_alct2 = TCut("(has_alct&2) > 0") +ok_clct1 = TCut("(has_clct&1) > 0") +ok_clct2 = TCut("(has_clct&2) > 0") +ok_lct_hs_min = TCut("hs_lct_odd > 4") +ok_lct_hs_max = TCut("hs_lct_odd < 125") +ok_lct_hs = AND(ok_lct_hs_min,ok_lct_hs_max) +ok_lcths1 = AND(ok_lct1,ok_lct_hs) +ok_lcths2 = AND(ok_lct2,ok_lct_hs) + +## GEM simhit ok_gsh1 = TCut("(has_gem_sh&1) > 0") ok_gsh2 = TCut("(has_gem_sh&2) > 0") ok_g2sh1 = TCut("(has_gem_sh2&1) > 0") ok_g2sh2 = TCut("(has_gem_sh2&2) > 0") + + +## GEM digi ok_gdg1 = TCut("(has_gem_dg&1) > 0") ok_gdg2 = TCut("(has_gem_dg&2) > 0") ok_pad1 = TCut("(has_gem_pad&1) > 0") ok_pad2 = TCut("(has_gem_pad&2) > 0") -ok_pad1_lct1 = TCut("%s && %s" %(ok_pad1.GetTitle(),ok_lct1.GetTitle())) -ok_pad2_lct2 = TCut("%s && %s" %(ok_pad2.GetTitle(),ok_lct2.GetTitle())) - -ok_pad1_dphi1 = TCut("%s && %s" %(ok_pad1.GetTitle(),ok_dphi1.GetTitle())) -ok_pad2_dphi2 = TCut("%s && %s" %(ok_pad2.GetTitle(),ok_dphi2.GetTitle())) +ok_dphi1 = TCut("dphi_pad_odd < 10.") +ok_dphi2 = TCut("dphi_pad_even < 10.") -ok_lct1_eta = TCut("%s && %s" %(ok_eta.GetTitle(),ok_lct1.GetTitle())) -ok_lct2_eta = TCut("%s && %s" %(ok_eta.GetTitle(),ok_lct2.GetTitle())) +ok_pad1_lct1 = AND(ok_pad1,ok_lct1) +ok_pad2_lct2 = AND(ok_pad2,ok_lct2) +ok_pad1_dphi1 = AND(ok_pad1,ok_dphi1) +ok_pad2_dphi2 = AND(ok_pad2,ok_dphi2) +ok_lct1_eta = AND(ok_eta,ok_lct1) +ok_lct2_eta = AND(ok_eta,ok_lct2) -ok_pad1_lct1_eta = TCut("%s && %s && %s" %(ok_pad1.GetTitle(),ok_lct1.GetTitle(),ok_eta.GetTitle())) -ok_pad2_lct2_eta = TCut("%s && %s && %s" %(ok_pad2.GetTitle(),ok_lct2.GetTitle(),ok_eta.GetTitle())) +ok_pad1_lct1_eta = AND(ok_pad1,AND(ok_lct1,ok_eta)) +ok_pad2_lct2_eta = AND(ok_pad2,AND(ok_lct2,ok_eta)) -ok_gsh1_lct1_eta = TCut("%s && %s && %s" %(ok_gsh1.GetTitle(),ok_lct1.GetTitle(),ok_eta.GetTitle())) -ok_gsh2_lct2_eta = TCut("%s && %s && %s" %(ok_gsh2.GetTitle(),ok_lct2.GetTitle(),ok_eta.GetTitle())) +ok_gsh1_lct1_eta = AND(ok_gsh1,AND(ok_lct1,ok_eta)) +ok_gsh2_lct2_eta = AND(ok_gsh2,AND(ok_lct2,ok_eta)) -ok_gsh1_eta = TCut("%s && %s" %(ok_gsh1.GetTitle(),ok_eta.GetTitle())) -ok_gsh2_eta = TCut("%s && %s" %(ok_gsh2.GetTitle(),ok_eta.GetTitle())) +ok_gsh1_eta = AND(ok_gsh1,ok_eta) +ok_gsh2_eta = AND(ok_gsh2,ok_eta) -ok_gdg1_eta = TCut("%s && %s" %(ok_gdg1.GetTitle(),ok_eta.GetTitle())) -ok_gdg2_eta = TCut("%s && %s" %(ok_gdg2.GetTitle(),ok_eta.GetTitle())) +ok_gdg1_eta = AND(ok_gdg1,ok_eta) +ok_gdg2_eta = AND(ok_gdg2,ok_eta) ok_2pad1 = TCut("(has_gem_pad2&1) > 0") ok_2pad2 = TCut("(has_gem_pad2&2) > 0") -ok_pad1_overlap = TCut("%s || (%s && %s)" %(ok_pad1.GetTitle(),ok_lct2.GetTitle(),ok_pad2.GetTitle())) -ok_pad2_overlap = TCut("%s || (%s && %s)" %(ok_pad2.GetTitle(),ok_lct1.GetTitle(),ok_pad1.GetTitle())) +ok_pad1_overlap = OR(ok_pad1,AND(ok_lct2,ok_pad2)) +ok_pad2_overlap = OR(ok_pad2,AND(ok_lct1,ok_pad1)) ok_copad1 = TCut("(has_gem_copad&1) > 0") ok_copad2 = TCut("(has_gem_copad&2) > 0") @@ -64,13 +84,11 @@ ok_Qp = TCut("charge > 0") ok_Qn = TCut("charge < 0") -ok_lct1_eta_Qn = TCut("%s && %s && %s" %(ok_lct1.GetTitle(),ok_eta.GetTitle(),ok_Qn.GetTitle())) -ok_lct2_eta_Qn = TCut("%s && %s && %s" %(ok_lct2.GetTitle(),ok_eta.GetTitle(),ok_Qn.GetTitle())) - -ok_lct1_eta_Qp = TCut("%s && %s && %s" %(ok_lct1.GetTitle(),ok_eta.GetTitle(),ok_Qp.GetTitle())) -ok_lct2_eta_Qp = TCut("%s && %s && %s" %(ok_lct2.GetTitle(),ok_eta.GetTitle(),ok_Qp.GetTitle())) - +ok_lct1_eta_Qn = AND(ok_lct1,AND(ok_eta,ok_Qn)) +ok_lct2_eta_Qn = AND(ok_lct2,AND(ok_eta,ok_Qn)) +ok_lct1_eta_Qp = AND(ok_lct1,AND(ok_eta,ok_Qp)) +ok_lct2_eta_Qp = AND(ok_lct2,AND(ok_eta,ok_Qp)) Ep = TCut("endcap > 0") En = TCut("endcap < 0") From 73228e31c872042b5f830d063cb2cfd058502f21 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 30 Oct 2013 14:13:19 +0100 Subject: [PATCH 172/182] use of AND and OR --- SimMuL1/scripts/effFunctions.py | 15 +-- SimMuL1/scripts/highEfficiencyPatterns.py | 4 +- SimMuL1/scripts/matchingEfficiency.py | 109 ++++++++++++++++++---- 3 files changed, 101 insertions(+), 27 deletions(-) diff --git a/SimMuL1/scripts/effFunctions.py b/SimMuL1/scripts/effFunctions.py index d72462543a6b4..fe93fc3663d81 100644 --- a/SimMuL1/scripts/effFunctions.py +++ b/SimMuL1/scripts/effFunctions.py @@ -1,5 +1,5 @@ from ROOT import * - +from cuts import * #_______________________________________________________________________________ def draw_eff(t,title, h_name, h_bins, to_draw, denom_cut, extra_num_cut, @@ -7,7 +7,7 @@ def draw_eff(t,title, h_name, h_bins, to_draw, denom_cut, extra_num_cut, """Make an efficiency plot""" ## total numerator selection cut - num_cut = TCut("%s && %s" %(denom_cut.GetTitle(), extra_num_cut.GetTitle())) + num_cut = AND(denom_cut,extra_num_cut) t.Draw(to_draw + ">>num_" + h_name + h_bins, num_cut, "goff") num = TH1F(gDirectory.Get("num_" + h_name).Clone("num_" + h_name)) @@ -36,13 +36,14 @@ def draw_geff(t, title, h_bins, to_draw, den_cut, extra_num_cut, ## total numerator selection cut ## the extra brackets around the extra_num_cut are necessary !! - num_cut = TCut("%s && (%s)" %(den_cut.GetTitle(), extra_num_cut.GetTitle())) - + num_cut = AND(den_cut,extra_num_cut) + ## PyROOT works a little different than ROOT when you are plotting ## histograms directly from tree. Hence, this work-around - nBins = int(h_bins[1:-1].split(',')[0]) - minBin = int(h_bins[1:-1].split(',')[1]) - maxBin = int(h_bins[1:-1].split(',')[2]) + nBins = int(h_bins[1:-1].split(',')[0]) + minBin = float(h_bins[1:-1].split(',')[1]) + maxBin = float(h_bins[1:-1].split(',')[2]) + num = TH1F("num", "", nBins, minBin, maxBin) den = TH1F("den", "", nBins, minBin, maxBin) diff --git a/SimMuL1/scripts/highEfficiencyPatterns.py b/SimMuL1/scripts/highEfficiencyPatterns.py index 07159325ad94e..7084cd036d082 100644 --- a/SimMuL1/scripts/highEfficiencyPatterns.py +++ b/SimMuL1/scripts/highEfficiencyPatterns.py @@ -46,7 +46,7 @@ def draw_eff(t,title, h_name, h_bins, to_draw, denom_cut, extra_num_cut, """Make an efficiency plot""" ## total numerator selection cut - num_cut = TCut("%s && %s" %(denom_cut.GetTitle(), extra_num_cut.GetTitle())) + num_cut = AND(denom_cut,extra_num_cut) t.Draw(to_draw + ">>num_" + h_name + h_bins, num_cut, "goff") num = TH1F(gDirectory.Get("num_" + h_name).Clone("num_" + h_name)) @@ -73,7 +73,7 @@ def getTree(fileName): """Get tree for given filename""" analyzer = "GEMCSCAnalyzer" - trk_eff = "trk_eff" + trk_eff = "trk_eff_st1" file = TFile.Open(fileName) if not file: diff --git a/SimMuL1/scripts/matchingEfficiency.py b/SimMuL1/scripts/matchingEfficiency.py index c129edce5cb8e..136303935b9cd 100644 --- a/SimMuL1/scripts/matchingEfficiency.py +++ b/SimMuL1/scripts/matchingEfficiency.py @@ -40,7 +40,7 @@ def getTree(fileName): """Get tree for given filename""" analyzer = "GEMCSCAnalyzer" - trk_eff = "trk_eff" + trk_eff = "trk_eff_st1" file = TFile.Open(fileName) if not file: @@ -86,9 +86,9 @@ def padMatchingEffVsGenMuonPhiForPosAndNegMuons( t = getTree("%sgem_csc_delta_pt%d_pad4.root"%(filesDir,pt)) ## latest instructions by Vadim on 21-08-2013 - ok_pad1_or_pad2 = TCut("%s || %s" %(ok_pad1.GetTitle(),ok_pad2.GetTitle())) - ok_eta_and_Qn = TCut("%s && %s" %(ok_eta.GetTitle(),ok_Qn.GetTitle())) - ok_eta_and_Qp = TCut("%s && %s" %(ok_eta.GetTitle(),ok_Qp.GetTitle())) + ok_pad1_or_pad2 = OR(ok_pad1,ok_pad2) + ok_eta_and_Qn = AND(ok_eta,ok_Qn) + ok_eta_and_Qp = AND(ok_eta,ok_Qp) ## variables for the plot title = " " * 9 + "GEM pad matching" + " " * 16 + "CMS Simulation Preliminary" @@ -191,13 +191,14 @@ def padMatchingEffVsHalfStripForOddEven(filesDir, plotDir, pt, doOverlaps, ext): t = getTree("%sgem_csc_delta_pt%d_pad4.root"%(filesDir,pt)) ho = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;LCT half-strip number;Efficiency", - "h_odd", "(130,0.5,130.5)", "hs_lct_odd", TCut("%s&&%s"%(ok_lct1.GetTitle(), ok_eta.GetTitle())), cut1, "", kRed) + "h_odd", "(130,0.5,130.5)", "hs_lct_odd", AND(ok_lct1,ok_eta), cut1, "", kRed) he = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;LCT half-strip number;Efficiency", - "h_evn", "(130,0.5,130.5)", "hs_lct_even", TCut("%s&&%s"%(ok_lct1.GetTitle(), ok_eta.GetTitle())), cut2, "same") + "h_evn", "(130,0.5,130.5)", "hs_lct_even", AND(ok_lct1,ok_eta), cut2, "same") ho.SetMinimum(0.) ho.GetXaxis().SetLabelSize(0.05) ho.GetYaxis().SetLabelSize(0.05) + leg = TLegend(0.25,0.23,.75,0.5, "", "brNDC"); leg.SetBorderSize(0) leg.SetFillStyle(0) @@ -246,10 +247,12 @@ def padMatchingEffVsLctEtaForOddEven(filesDir, plotDir, pt, doOverlaps, ext): overlapStr = "" t = getTree("%sgem_csc_delta_pt%d_pad4.root"%(filesDir,pt)) - ho = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;LCT |#eta|;Efficiency", - "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", TCut("%s&&%s"%(ok_lct1.GetTitle(), ok_eta.GetTitle())), cut1, "", kRed) - he = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;LCT |#eta|;Efficiency", - "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta_lct_even)", TCut("%s&&%s"%(ok_lct1.GetTitle(), ok_eta.GetTitle())), cut2, "same") + topTitle = " GEM pad matching CMS Simulation Preliminary" + xTitle = "LCT |#eta|LCT |#eta|" + yTitle = "Efficiency" + title = "%s;%s;%s"%(topTitle,xTitle,yTitle) + ho = draw_geff(t, title, "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta_lct_odd)", AND(ok_lct1,ok_eta), cut1, "", kRed) + he = draw_geff(t, title, "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta_lct_even)", AND(ok_lct1,ok_eta), cut2, "same") ho.SetMinimum(0.) ho.GetXaxis().SetLabelSize(0.05) ho.GetYaxis().SetLabelSize(0.05) @@ -301,10 +304,14 @@ def padMatchingEffVsSimTrackEtaForOddEven(filesDir, plotDir, pt, doOverlaps, ext overlapStr = "" t = getTree("%sgem_csc_delta_pt%d_pad4.root"%(filesDir,pt)) - ho = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;SimTrack |#eta|;Efficiency", - "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut("%s&&%s"%(ok_lct1.GetTitle(), ok_eta.GetTitle())), cut1, "", kRed) - he = draw_geff(t, " GEM pad matching CMS Simulation Preliminary;SimTrack |#eta|;Efficiency", - "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut("%s&&%s"%(ok_lct1.GetTitle(), ok_eta.GetTitle())), cut2, "same") + + topTitle = " GEM pad matching CMS Simulation Preliminary" + xTitle = "SimTrack |#eta|" + yTitle = "Efficiency" + title = "%s;%s;%s"%(topTitle,xTitle,yTitle) + + ho = draw_geff(t, title, "h_odd", "(140,1.5,2.2)", "TMath::Abs(eta)", AND(ok_lct1,ok_eta), cut1, "", kRed) + he = draw_geff(t, title, "h_evn", "(140,1.5,2.2)", "TMath::Abs(eta)", AND(ok_lct1,ok_eta), cut2, "same") ho.SetMinimum(0.) ho.GetXaxis().SetLabelSize(0.05) ho.GetYaxis().SetLabelSize(0.05) @@ -326,6 +333,68 @@ def padMatchingEffVsSimTrackEtaForOddEven(filesDir, plotDir, pt, doOverlaps, ext ## this has to be fixed c.Print("%sgem_pad_eff_for_LCT_vs_TrkEta_pt%d%s%s"%(plotDir,pt,overlapStr,ext)) +def cscMatchingEfficiencyToStripsAndWires(filesDir, plotDir, ext): + + gStyle.SetTitleStyle(0); + gStyle.SetTitleAlign(13); ##coord in top left + gStyle.SetTitleX(0.); + gStyle.SetTitleY(1.); + gStyle.SetTitleW(1); + gStyle.SetTitleH(0.058); + gStyle.SetTitleBorderSize(0); + + gStyle.SetPadLeftMargin(0.126); + gStyle.SetPadRightMargin(0.04); + gStyle.SetPadTopMargin(0.06); + gStyle.SetPadBottomMargin(0.13); + gStyle.SetOptStat(0); + gStyle.SetMarkerStyle(1); + + ok_eta = TCut("TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.12") + + t = getTree("%sgem-csc_stub_ana_L1_MuonGun_neweta_PU100_Pt20_50k_digi_preTrig2.root"%(filesDir)) + + + ## variables for the plot + topTitle = " " * 9 + "CSC Digi matching" + " " * 16 + "CMS Simulation Preliminary" + xTitle = "Generated muon #eta" + yTitle = "Efficiency" + title = "%s;%s;%s"%(topTitle,xTitle,yTitle) + toPlot = "TMath::Abs(eta)" + h_bins = "(140,1.5,2.2)" + nBins = int(h_bins[1:-1].split(',')[0]) + minBin = float(h_bins[1:-1].split(',')[1]) + maxBin = float(h_bins[1:-1].split(',')[2]) + + c = TCanvas("c","c",700,450) + c.Clear() + base = TH1F("base","",nBins,minBin,maxBin) + base.SetMinimum(0.9) + base.SetMaximum(1.02) + base.Draw("") + base.GetXaxis().SetLabelSize(0.05) + base.GetYaxis().SetLabelSize(0.05) + + h1 = draw_geff(t, title, h_bins, toPlot, ok_sh1, ok_w1, "same", kRed) + h2 = draw_geff(t, title, h_bins, toPlot, ok_sh1, ok_st1, "same") + h3 = draw_geff(t, title, h_bins, toPlot, AND(ok_sh1,OR(ok_w1,ok_st1)), ok_digi1, "same",kGreen+1) + + c.Print("%stest_matching%s"%(plotDir,ext)) + + leg = TLegend(0.25,0.23,.75,0.5, "", "brNDC"); + leg.SetBorderSize(0) + leg.SetFillStyle(0) + leg.SetTextSize(0.06) + leg.AddEntry(h1, "Wires","l") + leg.AddEntry(h2, "Strips","l") + leg.AddEntry(h3, "Wires and strips","l") + leg.Draw(); + + tex = TLatex(.66,.73,"1.64<|#eta|<2.12") + tex.SetTextSize(0.05) + tex.SetNDC() + tex.Draw() + def makePlots(ext): input_dir = "files_09_10_2013" output_dir = "plots_09_10_2013/track_matching_eff/" @@ -336,11 +405,15 @@ def makePlots(ext): padMatchingEffVsSimTrackEtaForOddEven(input_dir,output_dir, 20, True, ext) if __name__ == "__main__": + """ makePlots(".pdf") makePlots(".png") makePlots(".eps") - - + """ + input_dir = "files/" + output_dir = "plots/" + + cscMatchingEfficiencyToStripsAndWires(input_dir, output_dir, ".png") ### DO NOT REMOVE THE STUFF IN COMMENTS ### ### WE MIGHT NEED IT LATER ON ### @@ -543,9 +616,9 @@ def eff_hs_9(filesDir, plotDir, f_name, ext): he.Draw() ho.Draw("same") ho = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;|#phi|;Eff.", "hname", "(128,0,3.2)", "TMath::Abs(phi)", - TCut("%s && %s && %s"%(ok_lct2.GetTitle(), ok_eta.GetTitle(), ok_pt.GetTitle())), ok_pad2,kRed) + AND(ok_lct2,AND(ok_eta,ok_pt)), ok_pad2,kRed) he = draw_eff(t, "Eff. for track with LCT to have GEM pad in chamber;|#phi|;Eff.", "hname", "(128,0,3.2)", "TMath::Abs(phi)", - TCut("%s && %s && %s"%(ok_lct2.GetTitle(), ok_eta.GetTitle(), ok_pt.GetTitle())), ok_pad1) + AND(ok_lct2,AND(ok_eta,ok_pt)), ok_pad1) c.SaveAs("%stest%s"%(plotDir, ext)) From 444f52ef3bf72f9c0758dc03b4b27c3e1cd682bd Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 30 Oct 2013 14:47:13 +0100 Subject: [PATCH 173/182] use of AND and OR --- GEMValidation/scripts/cuts.py | 16 +- GEMValidation/scripts/drawPlots.py | 5 +- .../scripts/produceDigiValidationPlots.py | 141 +++++++++--------- .../scripts/produceRecHitValidationPlots.py | 73 +++++---- .../scripts/produceSimHitValidationPlots.py | 51 +++---- 5 files changed, 143 insertions(+), 143 deletions(-) diff --git a/GEMValidation/scripts/cuts.py b/GEMValidation/scripts/cuts.py index a82c0c9d9ee45..d7a5c2a2d93cb 100644 --- a/GEMValidation/scripts/cuts.py +++ b/GEMValidation/scripts/cuts.py @@ -1,5 +1,15 @@ -from ROOT import TCut +from ROOT import * +#_______________________________________________________________________________ +def AND(cut1,cut2): + return TCut("(%s) && (%s)"%(cut1.GetTitle(),cut2.GetTitle())) + +#_______________________________________________________________________________ +def OR(cut1,cut2): + return TCut("(%s) || (%s)"%(cut1.GetTitle(),cut2.GetTitle())) + + +#_______________________________________________________________________________ rm1 = TCut("region==-1") rp1 = TCut("region==1") l1 = TCut("layer==1") @@ -8,7 +18,9 @@ eta_min = 1.64 eta_max = 2.12 -ok_eta = TCut("TMath::Abs(eta) > %f && TMath::Abs(eta) < %f"%(eta_min,eta_max)) +ok_eta_min = TCut("TMath::Abs(eta) > %f"%(eta_min)) +ok_eta_max = TCut("TMath::Abs(eta) < %f"%(eta_max)) +ok_eta = AND(ok_eta_min,ok_eta_max) ok_gL1sh = TCut("gem_sh_layer1 > 0") ok_gL2sh = TCut("gem_sh_layer2 > 0") ok_gL1dg = TCut("gem_dg_layer1 > 0") diff --git a/GEMValidation/scripts/drawPlots.py b/GEMValidation/scripts/drawPlots.py index 128ab683b2c08..ca4751eb2c2cc 100644 --- a/GEMValidation/scripts/drawPlots.py +++ b/GEMValidation/scripts/drawPlots.py @@ -1,9 +1,6 @@ import sys import math -from ROOT import TString,TTree,TCut,TH1F,TH2F -from ROOT import TCanvas,TGraphAsymmErrors,TF1,TPaveStats,TText,TPaveText -from ROOT import gStyle,gROOT,gDirectory,gPad -from ROOT import kBlue,kRed +from ROOT * from cuts import * diff --git a/GEMValidation/scripts/produceDigiValidationPlots.py b/GEMValidation/scripts/produceDigiValidationPlots.py index 1d57608d8c6e2..79a1d98241cf9 100644 --- a/GEMValidation/scripts/produceDigiValidationPlots.py +++ b/GEMValidation/scripts/produceDigiValidationPlots.py @@ -1,9 +1,6 @@ import sys -from ROOT import TFile,TStyle,TKey,TTree,TH1F,TH2D -from ROOT import TMath,TCanvas,TCut -from ROOT import gStyle,gROOT,gPad -from ROOT import kBlue +from ROOT import * from cuts import * from drawPlots import * @@ -55,13 +52,13 @@ ## occupancy plots draw_occ(targetDir, "strip_dg_xy_rm1_l1", ext, treeDigis, "Digi occupancy: region-1, layer1; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", TCut("%s && %s" %(rm1.GetTitle(), l1.GetTitle())), "COLZ") + "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", AND(rm1,l1), "COLZ") draw_occ(targetDir, "strip_dg_xy_rm1_l2", ext, treeDigis, "Digi occupancy: region-1, layer2; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", TCut("%s && %s" %(rm1.GetTitle(), l2.GetTitle())), "COLZ") + "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", AND(rm1,l2), "COLZ") draw_occ(targetDir, "strip_dg_xy_rp1_l1", ext, treeDigis, "Digi occupancy: region1, layer1; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", TCut("%s && %s" %(rp1.GetTitle(), l1.GetTitle())), "COLZ") + "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", AND(rp1,l1), "COLZ") draw_occ(targetDir, "strip_dg_xy_rp1_l2", ext, treeDigis, "Digi occupancy: region1, layer2; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", TCut("%s && %s" %(rp1.GetTitle(), l2.GetTitle())), "COLZ") + "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", AND(rp1,l2), "COLZ") draw_occ(targetDir, "strip_dg_zr_rm1", ext, treeDigis, "Digi occupancy: region-1; globalZ [cm]; globalR [cm]", "h_", "(200,-573,-564,55,130,240)", "g_r:g_z", rm1, "COLZ") @@ -69,32 +66,32 @@ "h_", "(200,564,573,55,130,240)", "g_r:g_z", rp1, "COLZ") draw_occ(targetDir, "strip_dg_phistrip_rm1_l1", ext, treeDigis, "Digi occupancy: region-1 layer1; phi [rad]; strip", - "h_", "(280,-3.141592654,3.141592654,192,0,384)", "strip:g_phi", TCut("%s && %s" %(rm1.GetTitle(), l1.GetTitle())), "COLZ") + "h_", "(280,-3.141592654,3.141592654,192,0,384)", "strip:g_phi", AND(rm1,l1), "COLZ") draw_occ(targetDir, "strip_dg_phistrip_rm1_l2", ext, treeDigis, "Digi occupancy: region-1 layer2; phi [rad]; strip", - "h_", "(280,-3.141592654,3.141592654,192,0,384)", "strip:g_phi", TCut("%s && %s" %(rm1.GetTitle(), l2.GetTitle())), "COLZ") + "h_", "(280,-3.141592654,3.141592654,192,0,384)", "strip:g_phi", AND(rm1,l2), "COLZ") draw_occ(targetDir, "strip_dg_phistrip_rp1_l1", ext, treeDigis, "Digi occupancy: region1 layer1; phi [rad]; strip", - "h_", "(280,-3.141592654,3.141592654,192,0,384)", "strip:g_phi", TCut("%s && %s" %(rp1.GetTitle(), l1.GetTitle())), "COLZ") + "h_", "(280,-3.141592654,3.141592654,192,0,384)", "strip:g_phi", AND(rp1,l1), "COLZ") draw_occ(targetDir, "strip_dg_phistrip_rp1_l2", ext, treeDigis, "Digi occupancy: region1 layer2; phi [rad]; strip", - "h_", "(280,-3.141592654,3.141592654,192,0,384)", "strip:g_phi", TCut("%s && %s" %(rp1.GetTitle(), l2.GetTitle())), "COLZ") + "h_", "(280,-3.141592654,3.141592654,192,0,384)", "strip:g_phi", AND(rp1,l2), "COLZ") draw_1D(targetDir, "strip_dg_rm1_l1", ext, treeDigis, "Digi occupancy per strip number, region-1 layer1;strip number;entries", - "h_", "(384,0.5,384.5)", "strip", TCut("%s && %s" %(rm1.GetTitle(), l1.GetTitle()))) + "h_", "(384,0.5,384.5)", "strip", AND(rm1,l1)) draw_1D(targetDir, "strip_dg_rm1_l2", ext, treeDigis, "Digi occupancy per strip number, region-1 layer2;strip number;entries", - "h_", "(384,0.5,384.5)", "strip", TCut("%s && %s" %(rm1.GetTitle(), l2.GetTitle()))) + "h_", "(384,0.5,384.5)", "strip", AND(rm1,l2)) draw_1D(targetDir, "strip_dg_rp1_l1", ext, treeDigis, "Digi occupancy per strip number, region1 layer1;strip number;entries", - "h_", "(384,0.5,384.5)", "strip", TCut("%s && %s" %(rp1.GetTitle(), l1.GetTitle()))) + "h_", "(384,0.5,384.5)", "strip", AND(rp1,l1)) draw_1D(targetDir, "strip_dg_rp1_l2", ext, treeDigis, "Digi occupancy per strip number, region1 layer2;strip number;entries", - "h_", "(384,0.5,384.5)", "strip", TCut("%s && %s" %(rp1.GetTitle(), l2.GetTitle()))) + "h_", "(384,0.5,384.5)", "strip", AND(rp1,l2)) ## Bunch crossing plots draw_bx(targetDir, "strip_digi_bx_rm1_l1", ext, treeDigis, "Bunch crossing: region-1, layer1;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", TCut("%s && %s" %(rm1.GetTitle(), l1.GetTitle()))) + "h_", "(11,-5.5,5.5)", "bx", AND(rm1,l1)) draw_bx(targetDir, "strip_digi_bx_rm1_l2", ext, treeDigis, "Bunch crossing: region-1, layer2;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", TCut("%s && %s" %(rm1.GetTitle(), l2.GetTitle()))) + "h_", "(11,-5.5,5.5)", "bx", AND(rm1,l2)) draw_bx(targetDir, "strip_digi_bx_rp1_l1", ext, treeDigis, "Bunch crossing: region1, layer1;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", TCut("%s && %s" %(rp1.GetTitle(), l1.GetTitle()))) + "h_", "(11,-5.5,5.5)", "bx", AND(rp1,l1)) draw_bx(targetDir, "strip_digi_bx_rp1_l2", ext, treeDigis, "Bunch crossing: region1, layer2;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", TCut("%s && %s" %(rp1.GetTitle(), l2.GetTitle()))) + "h_", "(11,-5.5,5.5)", "bx", AND(rp1,l2)) treePads = dirAna.Get(pads) if not treePads: @@ -102,13 +99,13 @@ ## occupancy plots draw_occ(targetDir, "pad_dg_xy_rm1_l1", ext, treePads, "Pad occupancy: region-1, layer1; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", TCut("%s && %s" %(rm1.GetTitle(), l1.GetTitle())), "COLZ") + "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", AND(rm1,l1), "COLZ") draw_occ(targetDir, "pad_dg_xy_rm1_l2", ext, treePads, "Pad occupancy: region-1, layer2; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", TCut("%s && %s" %(rm1.GetTitle(), l2.GetTitle())), "COLZ") + "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", AND(rm1,l2), "COLZ") draw_occ(targetDir, "pad_dg_xy_rp1_l1", ext, treePads, "Pad occupancy: region1, layer1; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", TCut("%s && %s" %(rp1.GetTitle(), l1.GetTitle())), "COLZ") + "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", AND(rp1,l1), "COLZ") draw_occ(targetDir, "pad_dg_xy_rp1_l2", ext, treePads, "Pad occupancy: region1, layer2; globalX [cm]; globalY [cm]", - "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", TCut("%s && %s" %(rp1.GetTitle(), l2.GetTitle())), "COLZ") + "h_", "(260,-260,260,260,-260,260)", "g_x:g_y", AND(rp1,l2), "COLZ") draw_occ(targetDir, "pad_dg_zr_rm1", ext, treePads, "Pad occupancy: region-1; globalZ [cm]; globalR [cm]", "h_", "(200,-573,-564,55,130,240)", "g_r:g_z", rm1, "COLZ") @@ -116,32 +113,32 @@ "h_", "(200,564,573,55,130,240)", "g_r:g_z", rp1, "COLZ") draw_occ(targetDir, "pad_dg_phipad_rm1_l1", ext, treePads, "Pad occupancy: region-1 layer1; phi [rad]; pad", - "h_", "(280,-3.141592654,3.141592654, %f" %(npads/2.) + ",0, %f" %(npads) + ")", "pad:g_phi", TCut("%s && %s" %(rm1.GetTitle(), l1.GetTitle())), "COLZ") + "h_", "(280,-3.141592654,3.141592654, %f" %(npads/2.) + ",0, %f" %(npads) + ")", "pad:g_phi", AND(rm1,l1), "COLZ") draw_occ(targetDir, "pad_dg_phipad_rm1_l2", ext, treePads, "Pad occupancy: region-1 layer2; phi [rad]; pad", - "h_", "(280,-3.141592654,3.141592654, %f" %(npads/2.) + ",0, %f" %(npads) + ")", "pad:g_phi", TCut("%s && %s" %(rm1.GetTitle(), l2.GetTitle())), "COLZ") + "h_", "(280,-3.141592654,3.141592654, %f" %(npads/2.) + ",0, %f" %(npads) + ")", "pad:g_phi", AND(rm1,l2), "COLZ") draw_occ(targetDir, "pad_dg_phipad_rp1_l1", ext, treePads, "Pad occupancy: region1 layer1; phi [rad]; pad", - "h_", "(280,-3.141592654,3.141592654, %f" %(npads/2.) + ",0, %f" %(npads) + ")", "pad:g_phi", TCut("%s && %s" %(rp1.GetTitle(), l1.GetTitle())), "COLZ") + "h_", "(280,-3.141592654,3.141592654, %f" %(npads/2.) + ",0, %f" %(npads) + ")", "pad:g_phi", AND(rp1,l1), "COLZ") draw_occ(targetDir, "pad_dg_phipad_rp1_l2", ext, treePads, "Pad occupancy: region1 layer2; phi [rad]; pad", - "h_", "(280,-3.141592654,3.141592654, %f" %(npads/2.) + ",0, %f" %(npads) + ")", "pad:g_phi", TCut("%s && %s" %(rp1.GetTitle(), l2.GetTitle())), "COLZ") + "h_", "(280,-3.141592654,3.141592654, %f" %(npads/2.) + ",0, %f" %(npads) + ")", "pad:g_phi", AND(rp1,l2), "COLZ") draw_1D(targetDir, "pad_dg_rm1_l1", ext, treePads, "Digi occupancy per pad number, region-1 layer1;pad number;entries", - "h_", "( %f" %(npads) + ",0.5, %f" %(npads + 0.5) + ")", "pad", TCut("%s && %s" %(rm1.GetTitle(), l1.GetTitle()))) + "h_", "( %f" %(npads) + ",0.5, %f" %(npads + 0.5) + ")", "pad", AND(rm1,l1)) draw_1D(targetDir, "pad_dg_rm1_l2", ext, treePads, "Digi occupancy per pad number, region-1 layer2;pad number;entries", - "h_", "( %f" %(npads) + ",0.5, %f" %(npads + 0.5) + ")", "pad", TCut("%s && %s" %(rm1.GetTitle(), l2.GetTitle()))) + "h_", "( %f" %(npads) + ",0.5, %f" %(npads + 0.5) + ")", "pad", AND(rm1,l2)) draw_1D(targetDir, "pad_dg_rp1_l1", ext, treePads, "Digi occupancy per pad number, region1 layer1;pad number;entries", - "h_", "( %f" %(npads) + ",0.5, %f" %(npads + 0.5) + ")", "pad", TCut("%s && %s" %(rp1.GetTitle(), l1.GetTitle()))) + "h_", "( %f" %(npads) + ",0.5, %f" %(npads + 0.5) + ")", "pad", AND(rp1,l1)) draw_1D(targetDir, "pad_dg_rp1_l2", ext, treePads, "Digi occupancy per pad number, region1 layer2;pad number;entries", - "h_", "( %f" %(npads) + ",0.5, %f" %(npads + 0.5) + ")", "pad", TCut("%s && %s" %(rp1.GetTitle(), l2.GetTitle()))) + "h_", "( %f" %(npads) + ",0.5, %f" %(npads + 0.5) + ")", "pad", AND(rp1,l2)) ## Bunch crossing plots draw_bx(targetDir, "pad_dg_bx_rm1_l1", ext, treePads, "Bunch crossing: region-1, layer1;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", TCut("%s && %s" %(rm1.GetTitle(), l1.GetTitle()))) + "h_", "(11,-5.5,5.5)", "bx", AND(rm1,l1)) draw_bx(targetDir, "pad_dg_bx_rm1_l2", ext, treePads, "Bunch crossing: region-1, layer2;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", TCut("%s && %s" %(rm1.GetTitle(), l2.GetTitle()))) + "h_", "(11,-5.5,5.5)", "bx", AND(rm1,l2)) draw_bx(targetDir, "pad_dg_bx_rp1_l1", ext, treePads, "Bunch crossing: region1, layer1;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", TCut("%s && %s" %(rp1.GetTitle(), l1.GetTitle()))) + "h_", "(11,-5.5,5.5)", "bx", AND(rp1,l1)) draw_bx(targetDir, "pad_dg_bx_rp1_l2", ext, treePads, "Bunch crossing: region1, layer2;bunch crossing;entries", - "h_", "(11,-5.5,5.5)", "bx", TCut("%s && %s" %(rp1.GetTitle(), l2.GetTitle()))) + "h_", "(11,-5.5,5.5)", "bx", AND(rp1,l2)) treeCoPads = dirAna.Get(copads) if not treeCoPads: @@ -188,10 +185,10 @@ "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), ok_gL2dg, "P", kBlue) draw_geff(targetDir, "eff_eta_track_dg_gem_l1or2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Digi in l1 or l2;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), TCut("%s || %s" %(ok_gL2dg.GetTitle(), ok_gL1dg.GetTitle())), "P", kBlue) + "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), OR(ok_gL2dg,ok_gL1dg), "P", kBlue) draw_geff(targetDir, "eff_eta_track_dg_gem_l1and2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Digi in l1 and l2;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), TCut("%s && %s" %(ok_gL2dg.GetTitle(), ok_gL1dg.GetTitle())), "P", kBlue) + "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), AND(ok_gL2dg,ok_gL1dg), "P", kBlue) draw_geff(targetDir, "eff_phi_track_dg_gem_l1", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Digi in l1;SimTrack #phi [rad];Eff.", @@ -201,10 +198,10 @@ "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, ok_gL2dg, "P", kBlue) draw_geff(targetDir, "eff_phi_track_dg_gem_l1or2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Digi in l1 or l2;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, TCut("%s || %s" %(ok_gL2dg.GetTitle(), ok_gL1dg.GetTitle())), "P", kBlue) + "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, OR(ok_gL2dg,ok_gL1dg), "P", kBlue) draw_geff(targetDir, "eff_phi_track_dg_gem_l1and2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Digi in l1 and l2;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, TCut("%s && %s" %(ok_gL2dg.GetTitle(), ok_gL1dg.GetTitle())), "P", kBlue) + "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, AND(ok_gL2dg,ok_gL1dg), "P", kBlue) ## digis with matched simhits draw_geff(targetDir, "eff_eta_track_dg_sh_gem_l1", ext, treeTracks, @@ -215,27 +212,27 @@ "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_gL2sh, ok_gL2dg, "P", kBlue) draw_geff(targetDir, "eff_eta_track_dg_sh_gem_l1or2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Digi in l1 or l2 with a matched SimHit;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut("%s || %s" %(ok_gL2sh.GetTitle(), ok_gL1sh.GetTitle())), - TCut("%s || %s" %(ok_gL2dg.GetTitle(), ok_gL1dg.GetTitle())), "P", kBlue) + "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", OR(ok_gL2sh,ok_gL1sh), + OR(ok_gL2dg,ok_gL1dg), "P", kBlue) draw_geff(targetDir, "eff_eta_track_dg_sh_gem_l1and2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Digi in l1 and l2 with a matched SimHit;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut("%s && %s" %(ok_gL2sh.GetTitle(), ok_gL1sh.GetTitle())), - TCut("%s && %s" %(ok_gL2dg.GetTitle(), ok_gL1dg.GetTitle())), "P", kBlue) + "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", AND(ok_gL2sh,ok_gL1sh), + AND(ok_gL2dg,ok_gL1dg), "P", kBlue) draw_geff(targetDir, "eff_phi_track_dg_gem_l1", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Digi in l1 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", TCut("%s && %s" %(ok_eta.GetTitle(), ok_gL1sh.GetTitle())), ok_gL1dg, "P", kBlue) + "h_", "(100,-3.141592654,3.141592654)", "phi", AND(ok_eta,ok_gL1sh), ok_gL1dg, "P", kBlue) draw_geff(targetDir, "eff_phi_track_dg_gem_l2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Digi in l2 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", TCut("%s && %s" %(ok_eta.GetTitle(), ok_gL2sh.GetTitle())), ok_gL2dg, "P", kBlue) + "h_", "(100,-3.141592654,3.141592654)", "phi", AND(ok_eta,ok_gL2sh), ok_gL2dg, "P", kBlue) draw_geff(targetDir, "eff_phi_track_dg_gem_l1or2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Digi in l1 or l2 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", TCut("%s && (%s || %s)"%(ok_eta.GetTitle(),ok_gL1sh.GetTitle(),ok_gL2sh.GetTitle())), - TCut("%s || %s" %(ok_gL2dg.GetTitle(), ok_gL1dg.GetTitle())), "P", kBlue) + "h_", "(100,-3.141592654,3.141592654)", "phi", AND(ok_eta,OR(ok_gL1sh,ok_gL2sh)), + OR(ok_gL2dg,ok_gL1dg), "P", kBlue) draw_geff(targetDir, "eff_phi_track_dg_gem_l1and2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Digi in l1 and l2 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", TCut("%s && (%s && %s)"%(ok_eta.GetTitle(),ok_gL1sh.GetTitle(),ok_gL2sh.GetTitle())), - TCut("%s && %s" %(ok_gL2dg.GetTitle(), ok_gL1dg.GetTitle())), "P", kBlue) + "h_", "(100,-3.141592654,3.141592654)", "phi", AND(ok_eta,AND(ok_gL1sh,ok_gL2sh)), + AND(ok_gL2dg,ok_gL1dg), "P", kBlue) ## pads draw_geff(targetDir, "eff_eta_track_pad_gem_l1", ext, treeTracks, @@ -246,7 +243,7 @@ "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), ok_gL2pad, "P", kBlue) draw_geff(targetDir, "eff_eta_track_pad_gem_l1or2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Pad in l1 or l2;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), TCut("%s || %s"%(ok_gL2pad.GetTitle(), ok_gL1pad.GetTitle())), "P", kBlue) + "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), OR(ok_gL2pad,ok_gL1pad), "P", kBlue) draw_geff(targetDir, "eff_phi_track_pad_gem_l1", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Pad in l1;SimTrack #phi [rad];Eff.", @@ -257,7 +254,7 @@ draw_geff(targetDir, "eff_phi_track_pad_gem_l1or2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Pad in l1 or l2;SimTrack #phi [rad];Eff.", "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, - TCut("%s || %s"%(ok_gL2pad.GetTitle(), ok_gL1pad.GetTitle())), "P", kBlue) + OR(ok_gL2pad,ok_gL1pad), "P", kBlue) ## pads with matched simhits draw_geff(targetDir, "eff_eta_track_pad_sh_gem_l1", ext, treeTracks, @@ -268,37 +265,37 @@ "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_gL2sh, ok_gL2pad, "P", kBlue) draw_geff(targetDir, "eff_eta_track_pad_sh_gem_l1or2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Pad in l1 or l2 with a matched SimHit;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut("%s || %s"%(ok_gL1sh.GetTitle(),ok_gL2sh.GetTitle())), - TCut("%s || %s" %(ok_gL2pad.GetTitle(),ok_gL1pad.GetTitle())), "P", kBlue) + "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", OR(ok_gL1sh,ok_gL2sh), + OR(ok_gL2pad,ok_gL1pad), "P", kBlue) draw_geff(targetDir, "eff_phi_track_pad_sh_gem_l1", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Pad in l1 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", TCut("%s && %s" %(ok_eta.GetTitle(),ok_gL1sh.GetTitle())), ok_gL1pad, "P", kBlue) + "h_", "(100,-3.141592654,3.141592654)", "phi", AND(ok_eta,ok_gL1sh), ok_gL1pad, "P", kBlue) draw_geff(targetDir, "eff_phi_track_pad_sh_gem_l2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Pad in l2 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", TCut("%s && %s" %(ok_eta.GetTitle(),ok_gL2sh.GetTitle())), ok_gL2pad, "P", kBlue) + "h_", "(100,-3.141592654,3.141592654)", "phi", AND(ok_eta,ok_gL2sh), ok_gL2pad, "P", kBlue) draw_geff(targetDir, "eff_phi_track_pad_sh_gem_l1or2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM Pad in l1 or l2 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", TCut("%s && (%s || %s)" %(ok_eta.GetTitle(),ok_gL1sh.GetTitle(),ok_gL2sh.GetTitle())), - TCut("%s || %s" %(ok_gL2pad.GetTitle(),ok_gL1pad.GetTitle())), "P", kBlue) + "h_", "(100,-3.141592654,3.141592654)", "phi", AND(ok_eta,OR(ok_gL1sh,ok_gL2sh)), + OR(ok_gL2pad,ok_gL1pad), "P", kBlue) ## copads draw_geff(targetDir, "eff_eta_track_copad_gem", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM CoPad;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), TCut("%s && %s" %(ok_gL1pad.GetTitle(),ok_gL2pad.GetTitle())), "P", kBlue) + "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), AND(ok_gL1pad,ok_gL2pad), "P", kBlue) draw_geff(targetDir, "eff_phi_track_copad_gem", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM CoPad;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta,TCut("%s && %s"%(ok_gL1pad.GetTitle(), ok_gL2pad.GetTitle())), "P", kBlue) + "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta,AND(ok_gL1pad,ok_gL2pad), "P", kBlue) ## copads with matched simhits draw_geff(targetDir, "eff_eta_track_copad_sh_gem", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM CoPad with a matched SimHit;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut("%s && %s" %(ok_gL1sh.GetTitle(),ok_gL2sh.GetTitle())), - TCut("%s && %s" %(ok_gL1pad.GetTitle(),ok_gL2pad.GetTitle())), "P", kBlue) + "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", AND(ok_gL1sh,ok_gL2sh), + AND(ok_gL1pad,ok_gL2pad), "P", kBlue) draw_geff(targetDir, "eff_phi_track_copad_sh_gem", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM CoPad with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", TCut("%s && %s && %s" %(ok_eta.GetTitle(),ok_gL1sh.GetTitle(),ok_gL2sh.GetTitle())), - TCut("%s && %s" %(ok_gL1pad.GetTitle(),ok_gL2pad.GetTitle())), "P", kBlue) + "h_", "(100,-3.141592654,3.141592654)", "phi", AND(ok_eta,AND(ok_gL1sh,ok_gL2sh)), + AND(ok_gL2pad,ok_gL1pad), "P", kBlue) @@ -310,10 +307,10 @@ "h_", "(100,-100,100)", "gem_lx_even", TCut(""), ok_trk_gL2dg, "P", kBlue) draw_geff(targetDir, "eff_lx_track_dg_gem_l1or2_even", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 or GEMl2;SimTrack localX [cm];Eff.", - "h_", "(100,-100,100)", "gem_lx_even", TCut(""), TCut("%s || %s" %(ok_trk_gL1dg.GetTitle(),ok_trk_gL2dg.GetTitle())), "P", kBlue) + "h_", "(100,-100,100)", "gem_lx_even", TCut(""), OR(ok_trk_gL1dg,ok_trk_gL2dg), "P", kBlue) draw_geff(targetDir, "eff_lx_track_dg_gem_l1and2_even", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 and GEMl2;SimTrack localX [cm];Eff.", - "h_", "(100,-100,100)", "gem_lx_even", TCut(""), TCut("%s && %s" %(ok_trk_gL1dg.GetTitle(),ok_trk_gL2dg.GetTitle())), "P", kBlue) + "h_", "(100,-100,100)", "gem_lx_even", TCut(""), AND(ok_trk_gL1dg,ok_trk_gL2dg), "P", kBlue) draw_geff(targetDir, "eff_lx_track_dg_gem_l1_odd", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1;SimTrack localX [cm];Eff.", @@ -323,10 +320,10 @@ "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), ok_trk_gL2dg, "P", kBlue) draw_geff(targetDir, "eff_lx_track_dg_gem_l1or2_odd", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 or GEMl2;SimTrack localX [cm];Eff.", - "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), TCut("%s || %s" %(ok_trk_gL1dg.GetTitle(),ok_trk_gL2dg.GetTitle())), "P", kBlue) + "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), OR(ok_trk_gL1dg,ok_trk_gL2dg), "P", kBlue) draw_geff(targetDir, "eff_lx_track_dg_gem_l1and2_odd", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 and GEMl2;SimTrack localX [cm];Eff.", - "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), TCut("%s && %s" %(ok_trk_gL1dg.GetTitle(),ok_trk_gL2dg.GetTitle())), "P", kBlue) + "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), AND(ok_trk_gL1dg,ok_trk_gL2dg), "P", kBlue) draw_geff(targetDir, "eff_ly_track_dg_gem_l1_even", ext, treeTracks, @@ -337,10 +334,10 @@ "h_", "(100,-100,100)", "gem_ly_even", TCut(""), ok_trk_gL2dg, "P", kBlue) draw_geff(targetDir, "eff_ly_track_dg_gem_l1or2_even", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 or GEMl2;SimTrack localy [cm];Eff.", - "h_", "(100,-100,100)", "gem_ly_even", TCut(""), TCut("%s || %s" %(ok_trk_gL1dg.GetTitle(),ok_trk_gL2dg.GetTitle())), "P", kBlue) + "h_", "(100,-100,100)", "gem_ly_even", TCut(""), OR(ok_trk_gL1dg,ok_trk_gL2dg), "P", kBlue) draw_geff(targetDir, "eff_ly_track_dg_gem_l1and2_even", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 and GEMl2;SimTrack localy [cm];Eff.", - "h_", "(100,-100,100)", "gem_ly_even", TCut(""), TCut("%s && %s" %(ok_trk_gL1dg.GetTitle(),ok_trk_gL2dg.GetTitle())), "P", kBlue) + "h_", "(100,-100,100)", "gem_ly_even", TCut(""), AND(ok_trk_gL1dg,ok_trk_gL2dg), "P", kBlue) draw_geff(targetDir, "eff_ly_track_dg_gem_l1_odd", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1;SimTrack localy [cm];Eff.", @@ -350,7 +347,7 @@ "h_", "(100,-100,100)", "gem_ly_odd", TCut(""), ok_trk_gL2dg, "P", kBlue) draw_geff(targetDir, "eff_ly_track_dg_gem_l1or2_odd", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 or GEMl2;SimTrack localy [cm];Eff.", - "h_", "(100,-100,100)", "gem_ly_odd", TCut(""), TCut("%s || %s" %(ok_trk_gL1dg.GetTitle(),ok_trk_gL2dg.GetTitle())), "P", kBlue) + "h_", "(100,-100,100)", "gem_ly_odd", TCut(""), OR(ok_trk_gL1dg,ok_trk_gL2dg), "P", kBlue) draw_geff(targetDir, "eff_ly_track_dg_gem_l1and2_odd", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 and GEMl2;SimTrack localy [cm];Eff.", - "h_", "(100,-100,100)", "gem_ly_odd", TCut(""), TCut("%s && %s" %(ok_trk_gL1dg.GetTitle(),ok_trk_gL2dg.GetTitle())), "P", kBlue) + "h_", "(100,-100,100)", "gem_ly_odd", TCut(""), AND(ok_trk_gL1dg,ok_trk_gL2dg), "P", kBlue) diff --git a/GEMValidation/scripts/produceRecHitValidationPlots.py b/GEMValidation/scripts/produceRecHitValidationPlots.py index f4b13f05590c8..178e354363ce8 100644 --- a/GEMValidation/scripts/produceRecHitValidationPlots.py +++ b/GEMValidation/scripts/produceRecHitValidationPlots.py @@ -1,9 +1,6 @@ import sys -from ROOT import TFile,TStyle,TKey,TTree,TH1F,TH2D -from ROOT import TMath,TCanvas,TCut -from ROOT import gStyle,gROOT,gPad -from ROOT import kBlue +from ROOT import * from cuts import * from drawPlots import * @@ -62,31 +59,31 @@ "h_", "(100,-50,+50)", "pull", TCut(""), ""); draw_1D(targetDir, "recHitPullX_rm1_l1", ext, treeHits, "(x_{sim} - x_{rec}) / #sigma_{rec} region-1, layer1; (x_{sim} - x_{rec}) / #sigma_{rec}; entries", - "h_", "(100,-50,+50)", "pull", TCut("%s && %s" %(rm1.GetTitle(), l1.GetTitle())), ""); + "h_", "(100,-50,+50)", "pull", AND(rm1,l1), ""); draw_1D(targetDir, "recHitPullX_rm1_l2", ext, treeHits, "(x_{sim} - x_{rec}) / #sigma_{rec} region-1, layer2; (x_{sim} - x_{rec}) / #sigma_{rec}; entries", - "h_", "(100,-50,+50)", "pull", TCut("%s && %s" %(rm1.GetTitle(), l2.GetTitle())), ""); + "h_", "(100,-50,+50)", "pull", AND(rm1,l2), ""); draw_1D(targetDir, "recHitPullX_rp1_l1", ext, treeHits, "(x_{sim} - x_{rec}) / #sigma_{rec} region+1, layer1; (x_{sim} - x_{rec}) / #sigma_{rec}; entries", - "h_", "(100,-50,+50)", "pull", TCut("%s && %s" %(rp1.GetTitle(), l1.GetTitle())), ""); + "h_", "(100,-50,+50)", "pull", AND(rp1,l1), ""); draw_1D(targetDir, "recHitPullX_rp1_l2", ext, treeHits, "(x_{sim} - x_{rec}) / #sigma_{rec} region'1, layer2; (x_{sim} - x_{rec}) / #sigma_{rec}; entries", - "h_", "(100,-50,+50)", "pull", TCut("%s && %s" %(rp1.GetTitle(), l2.GetTitle())), ""); + "h_", "(100,-50,+50)", "pull", AND(rp1,l2), ""); draw_geff2(targetDir, "recHitEfficiencyPerChamber_rm1_l1", ext, treeHits, treeSimHits, "Local Reco Efficiency vs. chamber : region-1, layer1;chamber", - "h_", "(38,0,38)", "chamber", TCut("%s && %s" %(rm1.GetTitle(), l1.GetTitle())),TCut("%s && %s" %(rm1.GetTitle(), l1.GetTitle())), "P", kBlue); + "h_", "(38,0,38)", "chamber", AND(rm1,l1),AND(rm1,l1), "P", kBlue); draw_geff2(targetDir, "recHitEfficiencyPerChamber_rm1_l2", ext, treeHits, treeSimHits, "Local Reco Efficiency vs. chamber : region-1, layer2;chamber", - "h_", "(38,0,38)", "chamber", TCut("%s && %s" %(rm1.GetTitle(), l2.GetTitle())),TCut("%s && %s" %(rm1.GetTitle(), l2.GetTitle())), "P", kBlue); + "h_", "(38,0,38)", "chamber", AND(rm1,l2),AND(rm1,l2), "P", kBlue); draw_geff2(targetDir, "recHitEfficiencyPerChamber_rp1_l1", ext, treeHits, treeSimHits, "Local Reco Efficiency vs. chamber : region+1, layer1;chamber", - "h_", "(38,0,38)", "chamber", TCut("%s && %s" %(rp1.GetTitle(), l1.GetTitle())),TCut("%s && %s" %(rp1.GetTitle(), l1.GetTitle())), "P", kBlue); + "h_", "(38,0,38)", "chamber", AND(rp1,l1),AND(rp1,l1), "P", kBlue); draw_geff2(targetDir, "recHitEfficiencyPerChamber_rp1_l2", ext, treeHits, treeSimHits, "Local Reco Efficiency vs. chamber : region+1, layer2;chamber", - "h_", "(38,0,38)", "chamber", TCut("%s && %s" %(rp1.GetTitle(), l2.GetTitle())),TCut("%s && %s" %(rp1.GetTitle(), l2.GetTitle())), "P", kBlue); + "h_", "(38,0,38)", "chamber", AND(rp1,l2),AND(rp1,l2), "P", kBlue); draw_occ(targetDir, "localrh_xy_rm1_l1", ext, treeHits, " GEM RecHit occupancy: region-1, layer1;globalX [cm];globalY [cm]", - "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", TCut("%s && %s" %(rm1.GetTitle(), l1.GetTitle())), "COLZ"); + "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", AND(rm1,l1), "COLZ"); draw_occ(targetDir, "localrh_xy_rm1_l2", ext, treeHits, " GEM RecHit occupancy: region-1, layer2;globalX [cm];globalY [cm]", - "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", TCut("%s && %s" %(rm1.GetTitle(), l2.GetTitle())), "COLZ"); + "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", AND(rm1,l2), "COLZ"); draw_occ(targetDir, "localrh_xy_rp1_l1", ext, treeHits, " GEM RecHit occupancy: region1, layer1;globalX [cm];globalY [cm]", - "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", TCut("%s && %s" %(rp1.GetTitle(), l1.GetTitle())), "COLZ"); + "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", AND(rp1,l1), "COLZ"); draw_occ(targetDir, "localrh_xy_rp1_l2", ext, treeHits, " GEM RecHit occupancy: region1, layer2;globalX [cm];globalY [cm]", - "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", TCut("%s && %s" %(rp1.GetTitle(), l2.GetTitle())), "COLZ"); + "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", AND(rp1,l2), "COLZ"); draw_occ(targetDir, "localrh_zr_rm1", ext, treeHits, " GEM RecHit occupancy: region-1;globalZ [cm];globalR [cm]", "h_", "(200,-573,-564,110,130,240)", "sqrt(globalX*globalX+globalY*globalY):globalZ", rm1, "COLZ"); @@ -94,22 +91,22 @@ "h_", "(200,564,573,110,130,240)", "sqrt(globalX*globalX+globalY*globalY):globalZ", rp1, "COLZ"); draw_occ(targetDir, "strip_rh_phistrip_rm1_l1", ext, treeHits, "GEM RecHit occupancy: region-1 layer1; #phi [rad]; strip", - "h_", "(280,-3.141592654,3.141592654,192,0,384)", "firstClusterStrip:globalPhi", TCut("%s && %s" %(rm1.GetTitle(), l1.GetTitle())), "COLZ") + "h_", "(280,-3.141592654,3.141592654,192,0,384)", "firstClusterStrip:globalPhi", AND(rm1,l1), "COLZ") draw_occ(targetDir, "strip_rh_phistrip_rm1_l2", ext, treeHits, "GEM RecHit occupancy: region-1 layer2; #phi [rad]; strip", - "h_", "(280,-3.141592654,3.141592654,192,0,384)", "firstClusterStrip:globalPhi", TCut("%s && %s" %(rm1.GetTitle(), l2.GetTitle())), "COLZ") + "h_", "(280,-3.141592654,3.141592654,192,0,384)", "firstClusterStrip:globalPhi", AND(rm1,l2), "COLZ") draw_occ(targetDir, "strip_rh_phistrip_rp1_l1", ext, treeHits, "GEM RecHit occupancy: region1 layer1; #phi [rad]; strip", - "h_", "(280,-3.141592654,3.141592654,192,0,384)", "firstClusterStrip:globalPhi", TCut("%s && %s" %(rp1.GetTitle(), l1.GetTitle())), "COLZ") + "h_", "(280,-3.141592654,3.141592654,192,0,384)", "firstClusterStrip:globalPhi", AND(rp1,l1), "COLZ") draw_occ(targetDir, "strip_rh_phistrip_rp1_l2", ext, treeHits, "GEM RecHit occupancy: region1 layer2; #phi [rad]; strip", - "h_", "(280,-3.141592654,3.141592654,192,0,384)", "firstClusterStrip:globalPhi", TCut("%s && %s" %(rp1.GetTitle(), l2.GetTitle())), "COLZ") + "h_", "(280,-3.141592654,3.141592654,192,0,384)", "firstClusterStrip:globalPhi", AND(rp1,l2), "COLZ") draw_1D(targetDir, "strip_rh_rm1_l1", ext, treeHits, "GEM RecHit occupancy per strip number, region-1 layer1;strip number;entries", - "h_", "(384,0.5,384.5)", "firstClusterStrip", TCut("%s && %s" %(rm1.GetTitle(), l1.GetTitle()))) + "h_", "(384,0.5,384.5)", "firstClusterStrip", AND(rm1,l1)) draw_1D(targetDir, "strip_rh_rm1_l2", ext, treeHits, "GEM RecHit occupancy per strip number, region-1 layer2;strip number;entries", - "h_", "(384,0.5,384.5)", "firstClusterStrip", TCut("%s && %s" %(rm1.GetTitle(), l2.GetTitle()))) + "h_", "(384,0.5,384.5)", "firstClusterStrip", AND(rm1,l2)) draw_1D(targetDir, "strip_rh_rp1_l1", ext, treeHits, "GEM RecHit occupancy per strip number, region1 layer1;strip number;entries", - "h_", "(384,0.5,384.5)", "firstClusterStrip", TCut("%s && %s" %(rp1.GetTitle(), l1.GetTitle()))) + "h_", "(384,0.5,384.5)", "firstClusterStrip", AND(rp1,l1)) draw_1D(targetDir, "strip_rh_rp1_l2", ext, treeHits, "GEM RecHit occupancy per strip number, region1 layer2;strip number;entries", - "h_", "(384,0.5,384.5)", "firstClusterStrip", TCut("%s && %s" %(rp1.GetTitle(), l2.GetTitle()))) + "h_", "(384,0.5,384.5)", "firstClusterStrip", AND(rp1,l2)) ## Tracks treeTracks = dirAna.Get(simTracks) @@ -125,10 +122,10 @@ "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), ok_gL2rh, "P", kBlue) draw_geff(targetDir, "eff_eta_track_rh_gem_l1or2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM RecHit in l1 or l2;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), TCut("%s || %s" %(ok_gL2rh.GetTitle(), ok_gL1rh.GetTitle())), "P", kBlue) + "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), OR(ok_gL2rh,ok_gL1rh), "P", kBlue) draw_geff(targetDir, "eff_eta_track_rh_gem_l1and2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM RecHit in l1 and l2;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), TCut("%s && %s" %(ok_gL2rh.GetTitle(), ok_gL1rh.GetTitle())), "P", kBlue) + "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), AND(ok_gL2rh,ok_gL1rh), "P", kBlue) draw_geff(targetDir, "eff_phi_track_rh_gem_l1", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM RecHit in l1;SimTrack #phi [rad];Eff.", @@ -138,10 +135,10 @@ "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, ok_gL2rh, "P", kBlue) draw_geff(targetDir, "eff_phi_track_rh_gem_l1or2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM RecHit in l1 or l2;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, TCut("%s || %s" %(ok_gL2rh.GetTitle(), ok_gL1rh.GetTitle())), "P", kBlue) + "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, OR(ok_gL2rh,ok_gL1rh), "P", kBlue) draw_geff(targetDir, "eff_phi_track_rh_gem_l1and2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM RecHit in l1 and l2;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, TCut("%s && %s" %(ok_gL2rh.GetTitle(), ok_gL1rh.GetTitle())), "P", kBlue) + "h_", "(100,-3.141592654,3.141592654)", "phi", ok_eta, AND(ok_gL2rh,ok_gL1rh), "P", kBlue) ## recHits with matched simhits draw_geff(targetDir, "eff_eta_track_rh_sh_gem_l1", ext, treeTracks, @@ -152,25 +149,25 @@ "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", ok_gL2sh, ok_gL2rh, "P", kBlue) draw_geff(targetDir, "eff_eta_track_rh_sh_gem_l1or2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM RecHit in l1 or l2 with a matched SimHit;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut("%s || %s" %(ok_gL2sh.GetTitle(), ok_gL1sh.GetTitle())), - TCut("%s || %s" %(ok_gL2rh.GetTitle(), ok_gL1rh.GetTitle())), "P", kBlue) + "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", OR(ok_gL2sh,ok_gL1sh), + OR(ok_gL2rh,ok_gL1rh), "P", kBlue) draw_geff(targetDir, "eff_eta_track_rh_sh_gem_l1and2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM RecHit in l1 and l2 with a matched SimHit;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut("%s && %s" %(ok_gL2sh.GetTitle(), ok_gL1sh.GetTitle())), - TCut("%s && %s" %(ok_gL2rh.GetTitle(), ok_gL1rh.GetTitle())), "P", kBlue) + "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", AND(ok_gL2sh,ok_gL1sh), + AND(ok_gL2rh,ok_gL1rh), "P", kBlue) draw_geff(targetDir, "eff_phi_track_rh_gem_l1", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM RecHit in l1 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", TCut("%s && %s" %(ok_eta.GetTitle(), ok_gL1sh.GetTitle())), ok_gL1rh, "P", kBlue) + "h_", "(100,-3.141592654,3.141592654)", "phi", AND(ok_eta,ok_gL1sh), ok_gL1rh, "P", kBlue) draw_geff(targetDir, "eff_phi_track_rh_gem_l2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM RecHit in l2 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", TCut("%s && %s" %(ok_eta.GetTitle(), ok_gL2sh.GetTitle())), ok_gL2rh, "P", kBlue) + "h_", "(100,-3.141592654,3.141592654)", "phi", AND(ok_eta,ok_gL2sh), ok_gL2rh, "P", kBlue) draw_geff(targetDir, "eff_phi_track_rh_gem_l1or2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM RecHit in l1 or l2 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", TCut("%s && (%s || %s)"%(ok_eta.GetTitle(),ok_gL1sh.GetTitle(),ok_gL2sh.GetTitle())), - TCut("%s || %s" %(ok_gL2rh.GetTitle(), ok_gL1rh.GetTitle())), "P", kBlue) + "h_", "(100,-3.141592654,3.141592654)", "phi", AND(ok_eta,OR(ok_gL1sh,ok_gL2sh)), + OR(ok_gL2rh,ok_gL1rh), "P", kBlue) draw_geff(targetDir, "eff_phi_track_rh_gem_l1and2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM RecHit in l1 and l2 with a matched SimHit;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.141592654,3.141592654)", "phi", TCut("%s && (%s && %s)"%(ok_eta.GetTitle(),ok_gL1sh.GetTitle(),ok_gL2sh.GetTitle())), - TCut("%s && %s" %(ok_gL2rh.GetTitle(), ok_gL1rh.GetTitle())), "P", kBlue) + "h_", "(100,-3.141592654,3.141592654)", "phi", AND(ok_eta,AND(ok_gL1sh,ok_gL2sh)), + AND(ok_gL2rh,ok_gL1rh), "P", kBlue) diff --git a/GEMValidation/scripts/produceSimHitValidationPlots.py b/GEMValidation/scripts/produceSimHitValidationPlots.py index 313f1878ef507..0d11f8e170eb1 100644 --- a/GEMValidation/scripts/produceSimHitValidationPlots.py +++ b/GEMValidation/scripts/produceSimHitValidationPlots.py @@ -1,9 +1,6 @@ import sys -from ROOT import TFile,TStyle,TKey,TTree,TH1F,TH2D -from ROOT import TMath,TCanvas,TCut,TEfficiency -from ROOT import gStyle,gROOT,gPad -from ROOT import kBlue +from ROOT import * from cuts import * from drawPlots import * @@ -62,27 +59,27 @@ suff = histSuffix[i] draw_occ(targetDir, "sh_xy_rm1_l1" + suff, ext, treeHits, pre + " SimHit occupancy: region-1, layer1;globalX [cm];globalY [cm]", - "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", TCut("%s && %s && %s" %(rm1.GetTitle(), l1.GetTitle(), sel.GetTitle())), "COLZ") + "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", AND(rm1,AND(l1,sel)), "COLZ") draw_occ(targetDir, "sh_xy_rm1_l2" + suff, ext, treeHits, pre + " SimHit occupancy: region-1, layer2;globalX [cm];globalY [cm]", - "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", TCut("%s && %s && %s" %(rm1.GetTitle(), l2.GetTitle(), sel.GetTitle())), "COLZ") + "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", AND(rm1,AND(l2,sel)), "COLZ") draw_occ(targetDir, "sh_xy_rp1_l1" + suff, ext, treeHits, pre + " SimHit occupancy: region1, layer1;globalX [cm];globalY [cm]", - "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", TCut("%s && %s && %s" %(rp1.GetTitle(), l1.GetTitle(), sel.GetTitle())), "COLZ") + "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", AND(rp1,AND(l1,sel)), "COLZ") draw_occ(targetDir, "sh_xy_rp1_l2" + suff, ext, treeHits, pre + " SimHit occupancy: region1, layer2;globalX [cm];globalY [cm]", - "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", TCut("%s && %s && %s" %(rp1.GetTitle(), l2.GetTitle(), sel.GetTitle())), "COLZ") + "h_", "(100,-260,260,100,-260,260)", "globalY:globalX", AND(rp1,AND(l2,sel)), "COLZ") draw_occ(targetDir, "sh_zr_rm1" + suff, ext, treeHits, pre + " SimHit occupancy: region-1;globalZ [cm];globalR [cm]", - "h_", "(200,-573,-564,110,130,240)", "sqrt(globalX*globalX+globalY*globalY):globalZ", TCut('%s && %s'%(rm1.GetTitle(), sel.GetTitle())), "COLZ") + "h_", "(200,-573,-564,110,130,240)", "sqrt(globalX*globalX+globalY*globalY):globalZ", AND(rm1,sel), "COLZ") draw_occ(targetDir, "sh_zr_rp1" + suff, ext, treeHits, pre + " SimHit occupancy: region1;globalZ [cm];globalR [cm]", - "h_", "(200,564,573,110,130,240)", "sqrt(globalX*globalX+globalY*globalY):globalZ", TCut('%s && %s'%(rp1.GetTitle(), sel.GetTitle())), "COLZ") - + "h_", "(200,564,573,110,130,240)", "sqrt(globalX*globalX+globalY*globalY):globalZ", AND(rp1,sel), "COLZ") +4 draw_1D(targetDir, "sh_tof_rm1_l1" + suff, ext, treeHits, pre + " SimHit TOF: region-1, layer1;Time of flight [ns];entries", - "h_", "(40,18,22)", "timeOfFlight", "%s && %s && %s" %(rm1.GetTitle(), l1.GetTitle(), sel.GetTitle())) + "h_", "(40,18,22)", "timeOfFlight", AND(rm1,AND(l1,sel))) draw_1D(targetDir, "sh_tof_rm1_l2" + suff, ext, treeHits, pre + " SimHit TOF: region-1, layer2;Time of flight [ns];entries", - "h_", "(40,18,22)", "timeOfFlight", "%s && %s && %s" %(rm1.GetTitle(), l2.GetTitle(), sel.GetTitle())) + "h_", "(40,18,22)", "timeOfFlight", AND(rm1,AND(l2,sel))) draw_1D(targetDir, "sh_tof_rp1_l1" + suff, ext, treeHits, pre + " SimHit TOF: region1, layer1;Time of flight [ns];entries", - "h_", "(40,18,22)", "timeOfFlight", "%s && %s && %s" %(rp1.GetTitle(), l1.GetTitle(), sel.GetTitle())) + "h_", "(40,18,22)", "timeOfFlight", AND(rp1,AND(l1,sel))) draw_1D(targetDir, "sh_tof_rp1_l2" + suff, ext, treeHits, pre + " SimHit TOF: region1, layer2;Time of flight [ns];entries", - "h_", "(40,18,22)", "timeOfFlight", "%s && %s && %s" %(rp1.GetTitle(), l2.GetTitle(), sel.GetTitle())) + "h_", "(40,18,22)", "timeOfFlight", AND(rp1,AND(l2,sel))) ## momentum plot @@ -191,7 +188,7 @@ draw_geff(targetDir, "eff_eta_track_sh_gem_l1or2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 or GEMl2;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), TCut("%s || %s" %(ok_gL1sh.GetTitle(),ok_gL2sh.GetTitle())), "P", kBlue) + "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), OR(ok_gL1sh,ok_gL2sh), "P", kBlue) draw_geff(targetDir, "eff_eta_track_sh_gem_l1", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1;SimTrack |#eta|;Eff.", "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), ok_gL1sh, "P", kBlue) @@ -200,11 +197,11 @@ "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), ok_gL2sh, "P", kBlue) draw_geff(targetDir, "eff_eta_track_sh_gem_l1and2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 and GEMl2;SimTrack |#eta|;Eff.", - "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), TCut("%s && %s" %(ok_gL1sh.GetTitle(),ok_gL2sh.GetTitle())), "P", kBlue) + "h_", "(140,1.5,2.2)", "TMath::Abs(eta)", TCut(""), AND(ok_gL1sh,ok_gL2sh), "P", kBlue) draw_geff(targetDir, "eff_phi_track_sh_gem_l1or2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 or GEMl2;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.14159265358979312,3.14159265358979312)", "phi", ok_eta, TCut("%s || %s" %(ok_gL1sh.GetTitle(),ok_gL2sh.GetTitle())), "P", kBlue) + "h_", "(100,-3.14159265358979312,3.14159265358979312)", "phi", ok_eta, OR(ok_gL1sh,ok_gL2sh), "P", kBlue) draw_geff(targetDir, "eff_phi_track_sh_gem_l1", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1;SimTrack #phi [rad];Eff.", "h_", "(100,-3.14159265358979312,3.14159265358979312)", "phi", ok_eta, ok_gL1sh, "P", kBlue) @@ -213,7 +210,7 @@ "h_", "(100,-3.14159265358979312,3.14159265358979312)", "phi", ok_eta, ok_gL2sh, "P", kBlue) draw_geff(targetDir, "eff_phi_track_sh_gem_l1and2", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 and GEMl2;SimTrack #phi [rad];Eff.", - "h_", "(100,-3.14159265358979312,3.14159265358979312)", "phi", ok_eta, TCut("%s && %s" %(ok_gL1sh.GetTitle(),ok_gL2sh.GetTitle())), "P", kBlue) + "h_", "(100,-3.14159265358979312,3.14159265358979312)", "phi", ok_eta, AND(ok_gL1sh,ok_gL2sh), "P", kBlue) @@ -225,10 +222,10 @@ "h_", "(100,-100,100)", "gem_lx_even", TCut(""), ok_trk_gL2sh, "P", kBlue) draw_geff(targetDir, "eff_lx_track_sh_gem_l1or2_even", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 or GEMl2;SimTrack localX [cm];Eff.", - "h_", "(100,-100,100)", "gem_lx_even", TCut(""), TCut("%s || %s" %(ok_trk_gL1sh.GetTitle(),ok_trk_gL2sh.GetTitle())), "P", kBlue) + "h_", "(100,-100,100)", "gem_lx_even", TCut(""), OR(ok_trk_gL1sh,ok_trk_gL2sh), "P", kBlue) draw_geff(targetDir, "eff_lx_track_sh_gem_l1and2_even", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 and GEMl2;SimTrack localX [cm];Eff.", - "h_", "(100,-100,100)", "gem_lx_even", TCut(""), TCut("%s && %s" %(ok_trk_gL1sh.GetTitle(),ok_trk_gL2sh.GetTitle())), "P", kBlue) + "h_", "(100,-100,100)", "gem_lx_even", TCut(""), AND(ok_trk_gL1sh,ok_trk_gL2sh), "P", kBlue) draw_geff(targetDir, "eff_ly_track_sh_gem_l1_even", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1;SimTrack localy [cm];Eff.", @@ -238,10 +235,10 @@ "h_", "(100,-100,100)", "gem_ly_even", ok_lx_even, ok_trk_gL2sh, "P", kBlue) draw_geff(targetDir, "eff_ly_track_sh_gem_l1or2_even", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 or GEMl2;SimTrack localy [cm];Eff.", - "h_", "(100,-100,100)", "gem_ly_even", ok_lx_even, TCut("%s || %s" %(ok_trk_gL1sh.GetTitle(),ok_trk_gL2sh.GetTitle())), "P", kBlue) + "h_", "(100,-100,100)", "gem_ly_even", ok_lx_even, OR(ok_trk_gL1sh,ok_trk_gL2sh), "P", kBlue) draw_geff(targetDir, "eff_ly_track_sh_gem_l1and2_even", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 and GEMl2;SimTrack localy [cm];Eff.", - "h_", "(100,-100,100)", "gem_ly_even", ok_lx_even, TCut("%s && %s" %(ok_trk_gL1sh.GetTitle(),ok_trk_gL2sh.GetTitle())), "P", kBlue) + "h_", "(100,-100,100)", "gem_ly_even", ok_lx_even, AND(ok_trk_gL1sh,ok_trk_gL2sh), "P", kBlue) draw_geff(targetDir, "eff_lx_track_sh_gem_l1_odd", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1;SimTrack localX [cm];Eff.", @@ -251,10 +248,10 @@ "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), ok_trk_gL2sh, "P", kBlue) draw_geff(targetDir, "eff_lx_track_sh_gem_l1or2_odd", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 or GEMl2;SimTrack localX [cm];Eff.", - "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), TCut("%s || %s" %(ok_trk_gL1sh.GetTitle(),ok_trk_gL2sh.GetTitle())), "P", kBlue) + "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), OR(ok_trk_gL1sh,ok_trk_gL2sh), "P", kBlue) draw_geff(targetDir, "eff_lx_track_sh_gem_l1and2_odd", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 and GEMl2;SimTrack localX [cm];Eff.", - "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), TCut("%s && %s" %(ok_trk_gL1sh.GetTitle(),ok_trk_gL2sh.GetTitle())), "P", kBlue) + "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), AND(ok_trk_gL1sh,ok_trk_gL2sh), "P", kBlue) draw_geff(targetDir, "eff_ly_track_sh_gem_l1_odd", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1;SimTrack localy [cm];Eff.", @@ -264,10 +261,10 @@ "h_", "(100,-100,100)", "gem_ly_odd", ok_lx_odd, ok_trk_gL2sh, "P", kBlue) draw_geff(targetDir, "eff_ly_track_sh_gem_l1or2_odd", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 or GEMl2;SimTrack localy [cm];Eff.", - "h_", "(100,-100,100)", "gem_ly_odd", ok_lx_odd, TCut("%s || %s" %(ok_trk_gL1sh.GetTitle(),ok_trk_gL2sh.GetTitle())), "P", kBlue) + "h_", "(100,-100,100)", "gem_ly_odd", ok_lx_odd, OR(ok_trk_gL1sh,ok_trk_gL2sh), "P", kBlue) draw_geff(targetDir, "eff_ly_track_sh_gem_l1and2_odd", ext, treeTracks, "Eff. for a SimTrack to have an associated GEM SimHit in GEMl1 and GEMl2;SimTrack localy [cm];Eff.", - "h_", "(100,-100,100)", "gem_ly_odd", ok_lx_odd, TCut("%s && %s" %(ok_trk_gL1sh.GetTitle(),ok_trk_gL2sh.GetTitle())), "P", kBlue) + "h_", "(100,-100,100)", "gem_ly_odd", ok_lx_odd, AND(ok_trk_gL1sh,ok_trk_gL2sh), "P", kBlue) From 162d9a033cf4f0e3a94320aea825f24ccbb83700 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 30 Oct 2013 14:57:11 +0100 Subject: [PATCH 174/182] fix typo --- .../scripts/produceDigiValidationPlots.py | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/GEMValidation/scripts/produceDigiValidationPlots.py b/GEMValidation/scripts/produceDigiValidationPlots.py index 79a1d98241cf9..ddb98896bf83c 100644 --- a/GEMValidation/scripts/produceDigiValidationPlots.py +++ b/GEMValidation/scripts/produceDigiValidationPlots.py @@ -300,54 +300,54 @@ draw_geff(targetDir, "eff_lx_track_dg_gem_l1_even", ext, treeTracks, - "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1;SimTrack localX [cm];Eff.", + "Eff. for a SimTrack to have an associated GEM Digi in GEMl1;SimTrack localX [cm];Eff.", "h_", "(100,-100,100)", "gem_lx_even", TCut(""), ok_trk_gL1dg, "P", kBlue) draw_geff(targetDir, "eff_lx_track_dg_gem_l2_even", ext, treeTracks, - "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl2;SimTrack localX [cm];Eff.", + "Eff. for a SimTrack to have an associated GEM Digi in GEMl2;SimTrack localX [cm];Eff.", "h_", "(100,-100,100)", "gem_lx_even", TCut(""), ok_trk_gL2dg, "P", kBlue) draw_geff(targetDir, "eff_lx_track_dg_gem_l1or2_even", ext, treeTracks, - "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 or GEMl2;SimTrack localX [cm];Eff.", + "Eff. for a SimTrack to have an associated GEM Digi in GEMl1 or GEMl2;SimTrack localX [cm];Eff.", "h_", "(100,-100,100)", "gem_lx_even", TCut(""), OR(ok_trk_gL1dg,ok_trk_gL2dg), "P", kBlue) draw_geff(targetDir, "eff_lx_track_dg_gem_l1and2_even", ext, treeTracks, - "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 and GEMl2;SimTrack localX [cm];Eff.", + "Eff. for a SimTrack to have an associated GEM Digi in GEMl1 and GEMl2;SimTrack localX [cm];Eff.", "h_", "(100,-100,100)", "gem_lx_even", TCut(""), AND(ok_trk_gL1dg,ok_trk_gL2dg), "P", kBlue) draw_geff(targetDir, "eff_lx_track_dg_gem_l1_odd", ext, treeTracks, - "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1;SimTrack localX [cm];Eff.", + "Eff. for a SimTrack to have an associated GEM Digi in GEMl1;SimTrack localX [cm];Eff.", "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), ok_trk_gL1dg, "P", kBlue) draw_geff(targetDir, "eff_lx_track_dg_gem_l2_odd", ext, treeTracks, - "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl2;SimTrack localX [cm];Eff.", + "Eff. for a SimTrack to have an associated GEM Digi in GEMl2;SimTrack localX [cm];Eff.", "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), ok_trk_gL2dg, "P", kBlue) draw_geff(targetDir, "eff_lx_track_dg_gem_l1or2_odd", ext, treeTracks, - "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 or GEMl2;SimTrack localX [cm];Eff.", + "Eff. for a SimTrack to have an associated GEM Digi in GEMl1 or GEMl2;SimTrack localX [cm];Eff.", "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), OR(ok_trk_gL1dg,ok_trk_gL2dg), "P", kBlue) draw_geff(targetDir, "eff_lx_track_dg_gem_l1and2_odd", ext, treeTracks, - "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 and GEMl2;SimTrack localX [cm];Eff.", + "Eff. for a SimTrack to have an associated GEM Digi in GEMl1 and GEMl2;SimTrack localX [cm];Eff.", "h_", "(100,-100,100)", "gem_lx_odd", TCut(""), AND(ok_trk_gL1dg,ok_trk_gL2dg), "P", kBlue) draw_geff(targetDir, "eff_ly_track_dg_gem_l1_even", ext, treeTracks, - "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1;SimTrack localy [cm];Eff.", + "Eff. for a SimTrack to have an associated GEM Digi in GEMl1;SimTrack localy [cm];Eff.", "h_", "(100,-100,100)", "gem_ly_even", TCut(""), ok_trk_gL1dg, "P", kBlue) draw_geff(targetDir, "eff_ly_track_dg_gem_l2_even", ext, treeTracks, - "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl2;SimTrack localy [cm];Eff.", + "Eff. for a SimTrack to have an associated GEM Digi in GEMl2;SimTrack localy [cm];Eff.", "h_", "(100,-100,100)", "gem_ly_even", TCut(""), ok_trk_gL2dg, "P", kBlue) draw_geff(targetDir, "eff_ly_track_dg_gem_l1or2_even", ext, treeTracks, - "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 or GEMl2;SimTrack localy [cm];Eff.", + "Eff. for a SimTrack to have an associated GEM Digi in GEMl1 or GEMl2;SimTrack localy [cm];Eff.", "h_", "(100,-100,100)", "gem_ly_even", TCut(""), OR(ok_trk_gL1dg,ok_trk_gL2dg), "P", kBlue) draw_geff(targetDir, "eff_ly_track_dg_gem_l1and2_even", ext, treeTracks, - "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 and GEMl2;SimTrack localy [cm];Eff.", + "Eff. for a SimTrack to have an associated GEM Digi in GEMl1 and GEMl2;SimTrack localy [cm];Eff.", "h_", "(100,-100,100)", "gem_ly_even", TCut(""), AND(ok_trk_gL1dg,ok_trk_gL2dg), "P", kBlue) draw_geff(targetDir, "eff_ly_track_dg_gem_l1_odd", ext, treeTracks, - "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1;SimTrack localy [cm];Eff.", + "Eff. for a SimTrack to have an associated GEM Digi in GEMl1;SimTrack localy [cm];Eff.", "h_", "(100,-100,100)", "gem_ly_odd", TCut(""), ok_trk_gL1dg, "P", kBlue) draw_geff(targetDir, "eff_ly_track_dg_gem_l2_odd", ext, treeTracks, - "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl2;SimTrack localy [cm];Eff.", + "Eff. for a SimTrack to have an associated GEM Digi in GEMl2;SimTrack localy [cm];Eff.", "h_", "(100,-100,100)", "gem_ly_odd", TCut(""), ok_trk_gL2dg, "P", kBlue) draw_geff(targetDir, "eff_ly_track_dg_gem_l1or2_odd", ext, treeTracks, - "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 or GEMl2;SimTrack localy [cm];Eff.", + "Eff. for a SimTrack to have an associated GEM Digi in GEMl1 or GEMl2;SimTrack localy [cm];Eff.", "h_", "(100,-100,100)", "gem_ly_odd", TCut(""), OR(ok_trk_gL1dg,ok_trk_gL2dg), "P", kBlue) draw_geff(targetDir, "eff_ly_track_dg_gem_l1and2_odd", ext, treeTracks, - "Eff. for a SimTrack to have an associated GEM DigiHit in GEMl1 and GEMl2;SimTrack localy [cm];Eff.", + "Eff. for a SimTrack to have an associated GEM Digi in GEMl1 and GEMl2;SimTrack localy [cm];Eff.", "h_", "(100,-100,100)", "gem_ly_odd", TCut(""), AND(ok_trk_gL1dg,ok_trk_gL2dg), "P", kBlue) From b5746d7d401337a61eac87983b790e4e26926829 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 30 Oct 2013 15:00:19 +0100 Subject: [PATCH 175/182] added snippet for bending angle parametrization --- SimMuL1/scripts/plotGEMCSCdPhi.py | 88 ++++++++++++++++++++++++++----- 1 file changed, 75 insertions(+), 13 deletions(-) diff --git a/SimMuL1/scripts/plotGEMCSCdPhi.py b/SimMuL1/scripts/plotGEMCSCdPhi.py index ba007317bf94f..02bb1227aa9e3 100644 --- a/SimMuL1/scripts/plotGEMCSCdPhi.py +++ b/SimMuL1/scripts/plotGEMCSCdPhi.py @@ -138,17 +138,79 @@ def plotGEMCSCdPhi(filesDir, plotDir, oddEven = "even", ext = ".png", useReverse else: c.SaveAs("%sGEMCSCdPhi_%s_chambers%s"%(plotDir, oddEven, ext)) +def bendingAngleParametrization(filesDir, plotDir, oddEven = "even", ext = ".png"): + """Bending angle parametrization vs eta""" + + pt_values = [5,10,15,20,30,40] + maxi = [0.03,0.015,0.01,0.007,0.005,0.005] + + for i in range(len(pt_values)): + t1 = getTree("%sgem_csc_delta_pt%d_pad4.root"%(filesDir,pt_values[i])) + + if oddEven == "even": + ok_pad_lct = ok_pad2_lct2 + var = "dphi_pad_even" + else: + ok_pad_lct = ok_pad1_lct1 + var = "dphi_pad_odd" + + c = TCanvas("c","c",700,450) + c.Clear() + ## c.SetGridx(1) + ## c.SetGridy(1) + + gStyle.SetTitleStyle(0) + gStyle.SetTitleAlign(13) ##// coord in top left + gStyle.SetTitleX(0.) + gStyle.SetTitleY(1.) + gStyle.SetTitleW(1) + gStyle.SetTitleH(0.058) + gStyle.SetTitleBorderSize(0) + + gStyle.SetPadLeftMargin(0.126) + gStyle.SetPadRightMargin(0.04) + gStyle.SetPadTopMargin(0.06) + gStyle.SetPadBottomMargin(0.13) + gStyle.SetOptStat(0) + gStyle.SetMarkerStyle(1) + + dphi_pt = TH2F("dphi_pt",";#eta;#Delta#phi_{(GEM,CSC)} [rad]",6,1.6,2.14,100,0.,0.03) + t1.Draw("TMath::Abs(%s):TMath::Abs(eta)>>dphi_pt_bin"%(var) , ok_pad_lct) + dphi_pt_bin = TH1F("dphi_pt",";#Delta#phi_{(GEM,CSC)} [rad]",100,0.,0.03) + dphi_pt_bin = dphi_pt.ProjectionY("",0,1) + + + #dphi_pt.GetYaxis().SetRangeUser(0,maxi[i]) + #c.SaveAs("%sbendingAnglePar_%d_%d_%s%s"%(plotDir, pt_values[i], j, oddEven, ext)) + c.SaveAs("%sbendingAnglePar_%d_%s%s"%(plotDir, pt_values[i],oddEven, ext)) + + """ + ## for each eta bin, construct a 1D histogram and redo analysis + for j in range(0,7): + dphi_pt_bin = TH1F("dphi_pt",";#Delta#phi_{(GEM,CSC)} [rad]",100,0.,0.03) + dphi_pt_bin = dphi_pt.ProjectionY("",j,j+1) + t1.Draw("TMath::Abs(%s):TMath::Abs(eta)>>dphi_pt_bin"%(var) , ok_pad_lct) + #dphi_pt.GetYaxis().SetRangeUser(0,maxi[i]) + c.SaveAs("%sbendingAnglePar_%d_%d_%s%s"%(plotDir, pt_values[i], j, oddEven, ext)) + """ + + if __name__ == "__main__": - plotGEMCSCdPhi("files/", "plots/bending/", "even", ".eps", False) - plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".eps", False) - plotGEMCSCdPhi("files/", "plots/bending/", "even", ".pdf", False) - plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".pdf", False) - plotGEMCSCdPhi("files/", "plots/bending/", "even", ".png", False) - plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".png", False) - - plotGEMCSCdPhi("files/", "plots/bending/", "even", ".eps", True) - plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".eps", True) - plotGEMCSCdPhi("files/", "plots/bending/", "even", ".pdf", True) - plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".pdf", True) - plotGEMCSCdPhi("files/", "plots/bending/", "even", ".png", True) - plotGEMCSCdPhi("files/", "plots/bending/", "odd", ".png", True) + input_dir = "files/" + output_dir = "plots_cmssw_601_postls1/bending/" + + plotGEMCSCdPhi(input_dir, output_dir, "even", ".eps", False) + plotGEMCSCdPhi(input_dir, output_dir, "odd", ".eps", False) + plotGEMCSCdPhi(input_dir, output_dir, "even", ".pdf", False) + plotGEMCSCdPhi(input_dir, output_dir, "odd", ".pdf", False) + plotGEMCSCdPhi(input_dir, output_dir, "even", ".png", False) + plotGEMCSCdPhi(input_dir, output_dir, "odd", ".png", False) + + plotGEMCSCdPhi(input_dir, output_dir, "even", ".eps", True) + plotGEMCSCdPhi(input_dir, output_dir, "odd", ".eps", True) + plotGEMCSCdPhi(input_dir, output_dir, "even", ".pdf", True) + plotGEMCSCdPhi(input_dir, output_dir, "odd", ".pdf", True) + plotGEMCSCdPhi(input_dir, output_dir, "even", ".png", True) + plotGEMCSCdPhi(input_dir, output_dir, "odd", ".png", True) + + bendingAngleParametrization(input_dir, output_dir, "odd", ".png") From da6a23526eb81e1c55b8631be0b3f65414ace378 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 30 Oct 2013 15:11:59 +0100 Subject: [PATCH 176/182] silent plotting in C --- .../scripts/drawplot_frankenstein_ptshiftX.C | 2 + SimMuL1/scripts/triggerEfficiencyVsPtPlots.C | 83 ++++++++++--------- 2 files changed, 44 insertions(+), 41 deletions(-) diff --git a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C index 733bee148991e..0b7cca63ea5b3 100644 --- a/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C +++ b/SimMuL1/scripts/drawplot_frankenstein_ptshiftX.C @@ -125,6 +125,8 @@ void drawplot_frankenstein_ptshiftX() { gROOT->ProcessLine(".L drawplot_gmtrt.C"); gROOT->ProcessLine(".L getPTHistos.C"); + gROOT->SetBatch(1); + TString ext = ".eps"; TString filesDir = "files/"; diff --git a/SimMuL1/scripts/triggerEfficiencyVsPtPlots.C b/SimMuL1/scripts/triggerEfficiencyVsPtPlots.C index 9276715e75540..f8eece881b770 100644 --- a/SimMuL1/scripts/triggerEfficiencyVsPtPlots.C +++ b/SimMuL1/scripts/triggerEfficiencyVsPtPlots.C @@ -190,47 +190,48 @@ return heff; void gem_eff_draw() { -gStyle->SetOptStat(0); -gStyle->SetTitleStyle(0); - -int ptreb=2; - -TString hdir = "SimMuL1StrictAll"; - -//TString f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_def_pat2.root"; -TString f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem_dphi0_pat2.root"; -TString f_g98_pt10 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt10_pat2.root"; -TString f_g98_pt15 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt15_pat2.root"; -TString f_g98_pt20 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt20_pat2.root"; -TString f_g98_pt30 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt30_pat2.root"; -TString f_g98_pt40 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt40_pat2.root"; - -TString f_g95_pt10 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt10_pat2.root"; -TString f_g95_pt20 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt20_pat2.root"; -TString f_g95_pt30 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt30_pat2.root"; -TString f_g95_pt40 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt40_pat2.root"; - -double rpt[2] = {0.,49.99}; - -TString htitle = "Efficiency for #mu in 1.6<|#eta|<2.12 to have TF track;p_{T}^{MC}"; - -TString hini = "h_pt_initial_1b"; -TString h2s = "h_pt_after_tfcand_eta1b_2s"; -TString h3s = "h_pt_after_tfcand_eta1b_3s"; -TString h2s1b = "h_pt_after_tfcand_eta1b_2s1b"; -TString h3s1b = "h_pt_after_tfcand_eta1b_3s1b"; - - -TH1D* h_eff_tf0_2s = getEffHisto(f_def, hdir, h2s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_tf0_3s = getEffHisto(f_def, hdir, h3s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_tf0_2s1b = getEffHisto(f_def, hdir, h2s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_tf0_3s1b = getEffHisto(f_def, hdir, h3s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); - - -TH1D* h_eff_tf10_2s = getEffHisto(f_def, hdir, h2s + "_pt10", hini, ptreb, kGreen+4, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_3s = getEffHisto(f_def, hdir, h3s + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); + gStyle->SetOptStat(0); + gStyle->SetTitleStyle(0); + gROOT->SetBatch(1); + int ptreb=2; + + TString hdir = "SimMuL1StrictAll"; + + //TString f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_def_pat2.root"; + TString f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem_dphi0_pat2.root"; + TString f_g98_pt10 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt10_pat2.root"; + TString f_g98_pt15 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt15_pat2.root"; + //TString f_g98_pt20 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt20_pat2.root"; + TString f_g98_pt20 = "/afs/cern.ch/user/d/dildick/work/GEM/CMSSW_6_2_0_SLHC1/src/gem_trigger_eff_ana-out_L1_MuonGun_neweta_PU100_Pt20_50k_digi_preTrig2.root"; + TString f_g98_pt30 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt30_pat2.root"; + TString f_g98_pt40 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt40_pat2.root"; + + TString f_g95_pt10 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt10_pat2.root"; + TString f_g95_pt20 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt20_pat2.root"; + TString f_g95_pt30 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt30_pat2.root"; + TString f_g95_pt40 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt40_pat2.root"; + + double rpt[2] = {0.,49.99}; + + TString htitle = "Efficiency for #mu in 1.6<|#eta|<2.12 to have TF track;p_{T}^{MC}"; + + TString hini = "h_pt_initial_1b"; + TString h2s = "h_pt_after_tfcand_eta1b_2s"; + TString h3s = "h_pt_after_tfcand_eta1b_3s"; + TString h2s1b = "h_pt_after_tfcand_eta1b_2s1b"; + TString h3s1b = "h_pt_after_tfcand_eta1b_3s1b"; + + + TH1D* h_eff_tf0_2s = getEffHisto(f_def, hdir, h2s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_tf0_3s = getEffHisto(f_def, hdir, h3s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_tf0_2s1b = getEffHisto(f_def, hdir, h2s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_tf0_3s1b = getEffHisto(f_def, hdir, h3s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + + + TH1D* h_eff_tf10_2s = getEffHisto(f_def, hdir, h2s + "_pt10", hini, ptreb, kGreen+4, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_3s = getEffHisto(f_def, hdir, h3s + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); //TH1D* h_eff_tf15_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); //TH1D* h_eff_tf15_3s = getEffHisto(f_def, hdir, h3s + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); From 87a0d2f9cbaf87da365e8b970da914fc7faf2e9f Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 30 Oct 2013 15:13:24 +0100 Subject: [PATCH 177/182] std correctness --- SimMuL1/src/MatchCSCMuL1.cc | 394 +++++++++++++++++++++++------------- 1 file changed, 253 insertions(+), 141 deletions(-) diff --git a/SimMuL1/src/MatchCSCMuL1.cc b/SimMuL1/src/MatchCSCMuL1.cc index 3148945ba0228..16e1f3bd4526f 100644 --- a/SimMuL1/src/MatchCSCMuL1.cc +++ b/SimMuL1/src/MatchCSCMuL1.cc @@ -51,8 +51,8 @@ double ptscale[33] = { } - - +//_____________________________________________________________________________ +// Constructor MatchCSCMuL1::MatchCSCMuL1(const SimTrack *s, const SimVertex *v, const CSCGeometry* g): strk(s), svtx(v), cscGeometry(g) { @@ -62,16 +62,18 @@ MatchCSCMuL1::MatchCSCMuL1(const SimTrack *s, const SimVertex *v, const CSCGeom } +//_____________________________________________________________________________ void -MatchCSCMuL1::addSimHit( PSimHit & h) +MatchCSCMuL1::addSimHit(PSimHit & h) { simHits.push_back(h); hitsMapLayer[h.detUnitId()].push_back(h); CSCDetId layerId( h.detUnitId() ); - hitsMapChamber[ layerId.chamberId().rawId() ].push_back(h); + hitsMapChamber[layerId.chamberId().rawId()].push_back(h); } +//_____________________________________________________________________________ int MatchCSCMuL1::keyStation() { @@ -84,6 +86,8 @@ MatchCSCMuL1::keyStation() return 99; } + +//_____________________________________________________________________________ math::XYZVectorD MatchCSCMuL1::vAtStation(int st) { @@ -98,6 +102,8 @@ MatchCSCMuL1::vAtStation(int st) return v0; } + +//_____________________________________________________________________________ math::XYZVectorD MatchCSCMuL1::vSmart() { @@ -105,6 +111,8 @@ MatchCSCMuL1::vSmart() return vAtStation(key_st); } + +//_____________________________________________________________________________ double MatchCSCMuL1::deltaRAtStation(int station, double to_eta, double to_phi) { @@ -114,6 +122,7 @@ MatchCSCMuL1::deltaRAtStation(int station, double to_eta, double to_phi) } +//_____________________________________________________________________________ double MatchCSCMuL1::deltaRSmart(double to_eta, double to_phi) { @@ -122,7 +131,7 @@ MatchCSCMuL1::deltaRSmart(double to_eta, double to_phi) } - +//_____________________________________________________________________________ int MatchCSCMuL1::nSimHits() { @@ -133,6 +142,7 @@ MatchCSCMuL1::nSimHits() } +//_____________________________________________________________________________ vector MatchCSCMuL1::detsWithHits() { @@ -146,6 +156,7 @@ MatchCSCMuL1::detsWithHits() } +//_____________________________________________________________________________ vector MatchCSCMuL1::chambersWithHits(int station, int ring, unsigned minNHits) { @@ -170,6 +181,7 @@ MatchCSCMuL1::chambersWithHits(int station, int ring, unsigned minNHits) } +//_____________________________________________________________________________ vector MatchCSCMuL1::layerHits(int detId) { @@ -183,6 +195,7 @@ MatchCSCMuL1::layerHits(int detId) } +//_____________________________________________________________________________ vector MatchCSCMuL1::chamberHits(int detId) { @@ -201,6 +214,7 @@ MatchCSCMuL1::chamberHits(int detId) } +//_____________________________________________________________________________ std::vector MatchCSCMuL1::allSimHits() { @@ -211,6 +225,7 @@ MatchCSCMuL1::allSimHits() } +//_____________________________________________________________________________ int MatchCSCMuL1::numberOfLayersWithHitsInChamber(int detId) { @@ -227,6 +242,7 @@ MatchCSCMuL1::numberOfLayersWithHitsInChamber(int detId) } +//_____________________________________________________________________________ std::pair MatchCSCMuL1::wireGroupAndStripInChamber( int detId ) { @@ -236,7 +252,7 @@ MatchCSCMuL1::wireGroupAndStripInChamber( int detId ) unsigned n = hits.size(); if ( n == 0 ) return err_pair; - if (CSCConstants::KEY_CLCT_LAYER != CSCConstants::KEY_ALCT_LAYER) cout<<"ALARM: KEY_CLCT_LAYER != KEY_ALCT_LAYER"< MatchCSCMuL1::ALCTsInReadOut() { @@ -299,6 +317,8 @@ MatchCSCMuL1::ALCTsInReadOut() return result; } + +//_____________________________________________________________________________ std::vector< MatchCSCMuL1::ALCT > MatchCSCMuL1::vALCTs(bool readout) { @@ -306,6 +326,8 @@ MatchCSCMuL1::vALCTs(bool readout) return ALCTs; } + +//_____________________________________________________________________________ std::vector MatchCSCMuL1::chambersWithALCTs(bool readout) { @@ -316,6 +338,8 @@ MatchCSCMuL1::chambersWithALCTs(bool readout) return result; } + +//_____________________________________________________________________________ std::vector MatchCSCMuL1::chamberALCTs( int detId, bool readout ) { @@ -329,6 +353,8 @@ MatchCSCMuL1::chamberALCTs( int detId, bool readout ) return result; } + +//_____________________________________________________________________________ std::vector MatchCSCMuL1::bxsWithALCTs( int detId, bool readout ) { @@ -339,6 +365,8 @@ MatchCSCMuL1::bxsWithALCTs( int detId, bool readout ) return result; } + +//_____________________________________________________________________________ std::vector MatchCSCMuL1::chamberALCTsInBx( int detId, int bx, bool readout ) { @@ -350,6 +378,7 @@ MatchCSCMuL1::chamberALCTsInBx( int detId, int bx, bool readout ) } +//_____________________________________________________________________________ std::vector< MatchCSCMuL1::CLCT > MatchCSCMuL1::CLCTsInReadOut() { @@ -359,6 +388,8 @@ MatchCSCMuL1::CLCTsInReadOut() return result; } + +//_____________________________________________________________________________ std::vector< MatchCSCMuL1::CLCT > MatchCSCMuL1::vCLCTs(bool readout) { @@ -366,6 +397,8 @@ MatchCSCMuL1::vCLCTs(bool readout) return CLCTs; } + +//_____________________________________________________________________________ std::vector MatchCSCMuL1::chambersWithCLCTs( bool readout) { @@ -376,6 +409,8 @@ MatchCSCMuL1::chambersWithCLCTs( bool readout) return result; } + +//_____________________________________________________________________________ std::vector MatchCSCMuL1::chamberCLCTs( int detId, bool readout ) { @@ -389,6 +424,8 @@ MatchCSCMuL1::chamberCLCTs( int detId, bool readout ) return result; } + +//_____________________________________________________________________________ std::vector MatchCSCMuL1::bxsWithCLCTs( int detId, bool readout ) { @@ -399,6 +436,8 @@ MatchCSCMuL1::bxsWithCLCTs( int detId, bool readout ) return result; } + +//_____________________________________________________________________________ std::vector MatchCSCMuL1::chamberCLCTsInBx( int detId, int bx, bool readout ) { @@ -410,6 +449,7 @@ MatchCSCMuL1::chamberCLCTsInBx( int detId, int bx, bool readout ) } +//_____________________________________________________________________________ std::vector< MatchCSCMuL1::LCT > MatchCSCMuL1::LCTsInReadOut() { @@ -419,6 +459,8 @@ MatchCSCMuL1::LCTsInReadOut() return result; } + +//_____________________________________________________________________________ std::vector< MatchCSCMuL1::LCT > MatchCSCMuL1::vLCTs(bool readout) { @@ -426,6 +468,8 @@ MatchCSCMuL1::vLCTs(bool readout) return LCTs; } + +//_____________________________________________________________________________ std::vector MatchCSCMuL1::chambersWithLCTs( bool readout ) { @@ -436,6 +480,8 @@ MatchCSCMuL1::chambersWithLCTs( bool readout ) return result; } + +//_____________________________________________________________________________ std::vector MatchCSCMuL1::chamberLCTs( int detId, bool readout ) { @@ -449,6 +495,8 @@ MatchCSCMuL1::chamberLCTs( int detId, bool readout ) return result; } + +//_____________________________________________________________________________ std::vector MatchCSCMuL1::chamberLCTsp( int detId, bool readout ) { @@ -463,6 +511,8 @@ MatchCSCMuL1::chamberLCTsp( int detId, bool readout ) return result; } + +//_____________________________________________________________________________ std::vector MatchCSCMuL1::bxsWithLCTs( int detId, bool readout ) { @@ -473,6 +523,8 @@ MatchCSCMuL1::bxsWithLCTs( int detId, bool readout ) return result; } + +//_____________________________________________________________________________ std::vector MatchCSCMuL1::chamberLCTsInBx( int detId, int bx, bool readout ) { @@ -484,6 +536,7 @@ MatchCSCMuL1::chamberLCTsInBx( int detId, int bx, bool readout ) } +//_____________________________________________________________________________ std::vector< MatchCSCMuL1::MPLCT > MatchCSCMuL1::MPLCTsInReadOut() { @@ -493,6 +546,8 @@ MatchCSCMuL1::MPLCTsInReadOut() return result; } + +//_____________________________________________________________________________ std::vector< MatchCSCMuL1::MPLCT > MatchCSCMuL1::vMPLCTs(bool readout) { @@ -500,6 +555,8 @@ MatchCSCMuL1::vMPLCTs(bool readout) return MPLCTs; } + +//_____________________________________________________________________________ std::vector MatchCSCMuL1::chambersWithMPLCTs(bool readout) { @@ -510,6 +567,8 @@ MatchCSCMuL1::chambersWithMPLCTs(bool readout) return result; } + +//_____________________________________________________________________________ std::vector MatchCSCMuL1::chamberMPLCTs( int detId, bool readout ) { @@ -523,6 +582,8 @@ MatchCSCMuL1::chamberMPLCTs( int detId, bool readout ) return result; } + +//_____________________________________________________________________________ std::vector MatchCSCMuL1::bxsWithMPLCTs( int detId, bool readout ) { @@ -533,6 +594,8 @@ MatchCSCMuL1::bxsWithMPLCTs( int detId, bool readout ) return result; } + +//_____________________________________________________________________________ std::vector MatchCSCMuL1::chamberMPLCTsInBx( int detId, int bx, bool readout ) { @@ -544,22 +607,23 @@ MatchCSCMuL1::chamberMPLCTsInBx( int detId, int bx, bool readout ) } +//_____________________________________________________________________________ void MatchCSCMuL1::print (const char msg[300], bool psimtr, bool psimh, bool palct, bool pclct, bool plct, bool pmplct, bool ptftrack, bool ptfcand) { - cout<<"####### MATCH PRINT: "<momentum().eta() , strk->momentum().phi()); - cout<<" DR to initial dir at station "<first == (int)lId.chamberId().rawId()) nltot += hitsMapLayer[lmapItr->first].size(); } if ( nltot != hitsMapChamber[mapItr->first].size() ) - cout<<" SELF CHACK ALARM!!! : chamber "<first<<" sum of hits in layers = "<first].size()<first<<" sum of hits in layers = "<first].size()< chIds = chambersWithHits(0,0,1); for (size_t ch = 0; ch < chIds.size(); ch++) { CSCDetId chid(chIds[ch]); std::pair ws = wireGroupAndStripInChamber(chIds[ch]); - cout<<" chamber "< chs = chambersWithALCTs(); - cout<<"****** match ALCTs: total="<< ALCTs.size()<<" in "< bxs = bxsWithALCTs( chs[c] ); CSCDetId id(chs[c]); - cout<<" ***** chamber "< stubs = chamberALCTsInBx( chs[c], bxs[b] ); - cout<<" *** bx "< chs = chambersWithCLCTs(); - cout<<"****** match CLCTs: total="<< CLCTs.size()<<" in "< bxs = bxsWithCLCTs( chs[c] ); CSCDetId id(chs[c]); - cout<<" ***** chamber "< stubs = chamberCLCTsInBx( chs[c], bxs[b] ); - cout<<" *** bx "< chs = chambersWithLCTs(); - cout<<"****** match LCTs: total="<< LCTs.size()<<" in "< bxs = bxsWithLCTs( chs[c] ); CSCDetId id(chs[c]); - cout<<" ***** chamber "< stubs = chamberLCTsInBx( chs[c], bxs[b] ); - cout<<" *** bx "<deltaOk<<"&"<deltaOk<deltaOk<<"&"<deltaOk< chs = chambersWithMPLCTs(); - cout<<"****** match MPLCTs: total="<< MPLCTs.size()<<" in "< bxs = bxsWithMPLCTs( chs[c] ); CSCDetId id(chs[c]); - cout<<" ***** chamber "< stubs = chamberMPLCTsInBx( chs[c], bxs[b] ); - cout<<" *** bx "<alct->deltaOk<<"&"<clct->deltaOk<alct->deltaOk<<"&"<clct->deltaOk<print(tfi); - else cout<<"Strange: tfcand "< & tracks, bool sortPtFirst) +//_____________________________________________________________________________ +MatchCSCMuL1::TFTRACK * +MatchCSCMuL1::bestTFTRACK(std::vector< TFTRACK > & tracks, bool sortPtFirst) { if (tracks.size()==0) return NULL; @@ -839,7 +911,9 @@ MatchCSCMuL1::TFTRACK * MatchCSCMuL1::bestTFTRACK(std::vector< TFTRACK > & track } -MatchCSCMuL1::TFCAND * MatchCSCMuL1::bestTFCAND(std::vector< TFCAND > & cands, bool sortPtFirst) +//_____________________________________________________________________________ +MatchCSCMuL1::TFCAND * +MatchCSCMuL1::bestTFCAND(std::vector< TFCAND > & cands, bool sortPtFirst) { if (cands.size()==0) return NULL; @@ -888,7 +962,10 @@ MatchCSCMuL1::TFCAND * MatchCSCMuL1::bestTFCAND(std::vector< TFCAND > & cands, b return &(cands[maxI]); } -MatchCSCMuL1::GMTREGCAND * MatchCSCMuL1::bestGMTREGCAND(std::vector< GMTREGCAND > & cands, bool sortPtFirst) + +//_____________________________________________________________________________ +MatchCSCMuL1::GMTREGCAND * +MatchCSCMuL1::bestGMTREGCAND(std::vector< GMTREGCAND > & cands, bool sortPtFirst) { // first sort by Pt inside the cone (if sortPtFirst), then sort by DR if (cands.size()==0) return NULL; @@ -905,7 +982,10 @@ MatchCSCMuL1::GMTREGCAND * MatchCSCMuL1::bestGMTREGCAND(std::vector< GMTREGCAND return &(cands[maxI]); } -MatchCSCMuL1::GMTCAND * MatchCSCMuL1::bestGMTCAND(std::vector< GMTCAND > & cands, bool sortPtFirst) + +//_____________________________________________________________________________ +MatchCSCMuL1::GMTCAND * +MatchCSCMuL1::bestGMTCAND(std::vector< GMTCAND > & cands, bool sortPtFirst) { // first sort by Pt inside the cone (if sortPtFirst), then sort by DR if (cands.size()==0) return NULL; @@ -943,27 +1023,39 @@ MatchCSCMuL1::TFCAND::TFCAND():match(0),l1cand(0) {} MatchCSCMuL1::TFCAND::TFCAND(MatchCSCMuL1 *m):match(m),l1cand(0) {} - -bool MatchCSCMuL1::ALCT::inReadOut() +//_____________________________________________________________________________ +bool +MatchCSCMuL1::ALCT::inReadOut() { if (getBX()>=match->minBxALCT && getBX()<=match->maxBxALCT) return true; return false; } -bool MatchCSCMuL1::CLCT::inReadOut() + +//_____________________________________________________________________________ +bool +MatchCSCMuL1::CLCT::inReadOut() { if (getBX()>=match->minBxCLCT && getBX()<=match->maxBxCLCT) return true; return false; } -bool MatchCSCMuL1::LCT::inReadOut() + + +//_____________________________________________________________________________ +bool +MatchCSCMuL1::LCT::inReadOut() { if (getBX()>=match->minBxLCT && getBX()<=match->maxBxLCT) return true; return false; } -bool MatchCSCMuL1::MPLCT::inReadOut() + + +//_____________________________________________________________________________ +bool +MatchCSCMuL1::MPLCT::inReadOut() { if (getBX()>=match->minBxMPLCT && getBX()<=match->maxBxMPLCT) return true; @@ -971,9 +1063,11 @@ bool MatchCSCMuL1::MPLCT::inReadOut() } -void MatchCSCMuL1::TFTRACK::init(const csc::L1Track *t, CSCTFPtLUT* ptLUT, - edm::ESHandle< L1MuTriggerScales > &muScales, - edm::ESHandle< L1MuTriggerPtScale > &muPtScale) +//_____________________________________________________________________________ +void +MatchCSCMuL1::TFTRACK::init(const csc::L1Track *t, CSCTFPtLUT* ptLUT, + edm::ESHandle< L1MuTriggerScales > &muScales, + edm::ESHandle< L1MuTriggerPtScale > &muPtScale) { l1trk = t; @@ -1008,7 +1102,7 @@ void MatchCSCMuL1::TFTRACK::init(const csc::L1Track *t, CSCTFPtLUT* ptLUT, // convert the Pt in human readable values (GeV/c) pt = muPtScale->getPtScale()->getLowEdge(trPtBit); - if (trPtBit!=pt_packed) cout<<" trPtBit!=pt_packed: "<0.005) cout<<"scales eta diff: my "<0.03) cout<<"scales phi diff: my "<0.005) std::cout<<"scales pt diff: my "<0.005) std::cout<<"scales eta diff: my "<0.03) std::cout<<"scales phi diff: my "<getPtScale()->getLowEdge(pt_packed) + 1.e-6; - if (fabs(pt - old_pt)>0.005) { debug = 1;cout<<"lut pt diff: old "<0.005) { debug = 1;std::cout<<"lut pt diff: old "<getPhiScale()->getLowEdge(t->localPhi()) + (t->sector()-1)*M_PI/3. + //sector 1 starts at 15 degrees M_PI/12. , 2.*M_PI) ); - if (fabs(deltaPhi(phi,lcl_phi))>0.03) cout<<"lcl phi diff: lcl "<0.03) std::cout<<"lcl phi diff: lcl "<mb1ID() > 0 ) return true; - if(st==1 && l1trk->me1ID() > 0 ) return true; - if(st==2 && l1trk->me2ID() > 0 ) return true; - if(st==3 && l1trk->me3ID() > 0 ) return true; - if(st==4 && l1trk->me4ID() > 0 ) return true; + if(st==0 && l1trk->mb1ID() > 0) return true; + if(st==1 && l1trk->me1ID() > 0) return true; + if(st==2 && l1trk->me2ID() > 0) return true; + if(st==3 && l1trk->me3ID() > 0) return true; + if(st==4 && l1trk->me4ID() > 0) return true; return false; } -bool MatchCSCMuL1::TFTRACK::hasStubCSCOk(int st) +//_____________________________________________________________________________ +bool +MatchCSCMuL1::TFTRACK::hasStubCSCOk(int st) { if (!hasStub(st)) return false; bool cscok = 0; @@ -1059,19 +1157,25 @@ bool MatchCSCMuL1::TFTRACK::hasStubCSCOk(int st) } -unsigned int MatchCSCMuL1::TFTRACK::nStubs(bool mb1, bool me1, bool me2, bool me3, bool me4) +//_____________________________________________________________________________ +unsigned int +MatchCSCMuL1::TFTRACK::nStubs(bool mb1, bool me1, bool me2, bool me3, bool me4) { return (mb1 & hasStub(0)) + (me1 & hasStub(1)) + (me2 & hasStub(2)) + (me3 & hasStub(3)) + (me4 & hasStub(4)); } -unsigned int MatchCSCMuL1::TFTRACK::nStubsCSCOk(bool mb1, bool me1, bool me2, bool me3, bool me4) +//_____________________________________________________________________________ +unsigned int +MatchCSCMuL1::TFTRACK::nStubsCSCOk(bool mb1, bool me1, bool me2, bool me3, bool me4) { return (me1 & hasStubCSCOk(1)) + (me2 & hasStubCSCOk(2)) + (me3 & hasStubCSCOk(3)) + (me4 & hasStubCSCOk(4)); } -bool MatchCSCMuL1::TFTRACK::passStubsMatch(int minLowHStubs, int minMidHStubs, int minHighHStubs) +//_____________________________________________________________________________ +bool +MatchCSCMuL1::TFTRACK::passStubsMatch(int minLowHStubs, int minMidHStubs, int minHighHStubs) { double steta = match->strk->momentum().eta(); int nstubs = nStubs(1,1,1,1,1); @@ -1094,46 +1198,50 @@ bool MatchCSCMuL1::TFTRACK::passStubsMatch(int minLowHStubs, int minMidHStubs, i } -void MatchCSCMuL1::TFTRACK::print(const char msg[300]) +//_____________________________________________________________________________ +void +MatchCSCMuL1::TFTRACK::print(const char msg[300]) { - cout<<"#### TFTRACK PRINT: "<print(); - //cout<<"\n## L1Track Print: "; + //std::cout<<"\n## L1Track Print: "; //l1trk->Print(); - //cout<<"## TFTRACK: - cout<<"\tpt_packed: "<bx()<sector()<<" dr: "<me1ID()<<" "<me2ID()<<" "<me3ID()<<" "<me4ID() + //std::cout<<"## TFTRACK: + std::cout<<"\tpt_packed: "<bx()<sector()<<" dr: "<me1ID()<<" "<me2ID()<<" "<me3ID()<<" "<me4ID() <<" ("<ptLUTAddress()<ptLUTAddress()<getKeyWG()<<" s:"<getStrip()/2 + 1<<" p:"<getPattern()<<" bx:"<getBX()<<"; "; - cout<getKeyWG()<<" s:"<getStrip()/2 + 1<<" p:"<getPattern()<<" bx:"<getBX()<<"; "; + std::cout<trgdigi->getKeyWG()<<" s:"<trgdigi->getStrip()/2 + 1<<" Ok="<deltaOk<<"; "; - cout<meEtap<<", "<mePhip<<"; "; - cout<trgdigi->getKeyWG()<<" s:"<trgdigi->getStrip()/2 + 1<<" Ok="<deltaOk<<"; "; + std::cout<meEtap<<", "<mePhip<<"; "; + std::cout< &muScales, - edm::ESHandle< L1MuTriggerPtScale > &muPtScale) +//_____________________________________________________________________________ +void +MatchCSCMuL1::TFCAND::init(const L1MuRegionalCand *t, CSCTFPtLUT* ptLUT, + edm::ESHandle< L1MuTriggerScales > &muScales, + edm::ESHandle< L1MuTriggerPtScale > &muPtScale) { l1cand = t; @@ -1158,36 +1266,39 @@ void MatchCSCMuL1::TFCAND::init(const L1MuRegionalCand *t, CSCTFPtLUT* ptLUT, double sign_eta = ( (t->eta_packed() & 0x20) == 0) ? 1.:-1; double my_eta = sign_eta*(0.05 * (t->eta_packed() & 0x1F) + 0.925); // 0.9+0.025 = 0.925 double my_pt = ptscale[t->pt_packed()]; - if (fabs(pt - my_pt)>0.005) cout<<"tfcand scales pt diff: my "<0.005) cout<<"tfcand scales eta diff: my "<0.03) cout<<"tfcand scales phi diff: my "<0.005) std::cout<<"tfcand scales pt diff: my "<0.005) std::cout<<"tfcand scales eta diff: my "<0.03) std::cout<<"tfcand scales phi diff: my "<type_idx()==2) sys = "CSC"; if (l1reg->type_idx()==3) sys = "RPCf"; - cout<<"#### GMTREGCAND ("<print(); - cout<<" bx="<bx()<<" values: pt="< &muScales, - edm::ESHandle< L1MuTriggerPtScale > &muPtScale) + edm::ESHandle< L1MuTriggerScales > &muScales, + edm::ESHandle< L1MuTriggerPtScale > &muPtScale) { l1reg = t; pt = muPtScale->getPtScale()->getLowEdge(t->pt_packed()) + 1.e-6; eta = muScales->getRegionalEtaScale(t->type_idx())->getCenter(t->eta_packed()); - //cout<<"regetac"<type_idx()<<"="<type_idx()<<"="<getRegionalEtaScale(t->type_idx())->getLowEdge(t->eta_packed() )<type_idx()<<"="<type_idx()<<"="<getRegionalEtaScale(t->type_idx())->getLowEdge(t->eta_packed() )<getPhiScale()->getLowEdge(t->phi_packed())); nTFStubs = -1; @@ -1197,24 +1308,25 @@ void MatchCSCMuL1::GMTREGCAND::init(const L1MuRegionalCand *t, double sign_eta = ( (t->eta_packed() & 0x20) == 0) ? 1.:-1; double my_eta = sign_eta*(0.05 * (t->eta_packed() & 0x1F) + 0.925); // 0.9+0.025 = 0.925 double my_pt = ptscale[t->pt_packed()]; - if (fabs(pt - my_pt)>0.005) cout<<"gmtreg scales pt diff: my "<0.005) cout<<"gmtreg scales eta diff: my "<0.03) cout<<"gmtreg scales phi diff: my "<0.005) std::cout<<"gmtreg scales pt diff: my "<0.005) std::cout<<"gmtreg scales eta diff: my "<0.03) std::cout<<"gmtreg scales phi diff: my "< &muScales, - edm::ESHandle< L1MuTriggerPtScale > &muPtScale) + edm::ESHandle< L1MuTriggerScales > &muScales, + edm::ESHandle< L1MuTriggerPtScale > &muPtScale) { l1gmt = t; // keep x and y components non-zero and protect against roundoff. pt = muPtScale->getPtScale()->getLowEdge( t->ptIndex() ) + 1.e-6 ; eta = muScales->getGMTEtaScale()->getCenter( t->etaIndex() ) ; - //cout<<"gmtetalo="<getGMTEtaScale()->getLowEdge(t->etaIndex() )< chIds = chambersWithHits(0,0,1); + std::vector chIds = chambersWithHits(0,0,1); for (size_t ch = 0; ch < chIds.size(); ch++) { CSCDetId chid(chIds[ch]); std::pair ws = wireGroupAndStripInChamber(chIds[ch]); std::cout<<" chamber "<me1ID()<<" "<me2ID()<<" "<me3ID()<<" "<me4ID() <<" ("<ptLUTAddress()<ptLUTAddress()<getKeyWG()<<" s:"<getStrip()/2 + 1<<" p:"<getPattern()<<" bx:"<getBX()<<"; "; diff --git a/SimMuL1/src/PSimHitMap.cc b/SimMuL1/src/PSimHitMap.cc index ed2c4fbf7fe57..966fe8e732a87 100644 --- a/SimMuL1/src/PSimHitMap.cc +++ b/SimMuL1/src/PSimHitMap.cc @@ -10,7 +10,9 @@ namespace SimHitAnalysis { -void PSimHitMap::fill(const edm::Event & e) +//_____________________________________________________________________________ +void +PSimHitMap::fill(const edm::Event & e) { theMap.clear(); theEmptyVector.clear(); @@ -40,7 +42,9 @@ void PSimHitMap::fill(const edm::Event & e) } -const edm::PSimHitContainer & PSimHitMap::hits(int detId) const +//_____________________________________________________________________________ +const edm::PSimHitContainer & +PSimHitMap::hits(int detId) const { std::map::const_iterator mapItr = theMap.find(detId); if(mapItr != theMap.end()) return mapItr->second; @@ -48,7 +52,9 @@ const edm::PSimHitContainer & PSimHitMap::hits(int detId) const } -std::vector PSimHitMap::detsWithHits() const +//_____________________________________________________________________________ +std::vector +PSimHitMap::detsWithHits() const { if (theMap.size()==0) return theEmptyVector; std::vector result; @@ -61,7 +67,9 @@ std::vector PSimHitMap::detsWithHits() const } -void PSimHitMap::setInputTag(edm::InputTag &t) +//_____________________________________________________________________________ +void +PSimHitMap::setInputTag(edm::InputTag &t) { theModuleName = t.label(); theCollectionName = t.instance(); diff --git a/SimMuL1/src/PSimHitMapCSC.cc b/SimMuL1/src/PSimHitMapCSC.cc index fb01e0cfa820f..0ba72f2dcbc97 100644 --- a/SimMuL1/src/PSimHitMapCSC.cc +++ b/SimMuL1/src/PSimHitMapCSC.cc @@ -7,7 +7,9 @@ namespace SimHitAnalysis { -void PSimHitMapCSC::fill(const edm::Event & e) +//_____________________________________________________________________________ +void +PSimHitMapCSC::fill(const edm::Event & e) { theMap.clear(); theChLayers.clear(); @@ -35,7 +37,9 @@ void PSimHitMapCSC::fill(const edm::Event & e) } -std::vector PSimHitMapCSC::chambersWithHits() const +//_____________________________________________________________________________ +std::vector +PSimHitMapCSC::chambersWithHits() const { if (theChLayers.size()==0) return theEmptyVector; std::vector result; @@ -48,7 +52,9 @@ std::vector PSimHitMapCSC::chambersWithHits() const } -std::vector PSimHitMapCSC::chamberLayersWithHits(int detId) const +//_____________________________________________________________________________ +std::vector +PSimHitMapCSC::chamberLayersWithHits(int detId) const { std::map >::const_iterator itr = theChLayers.find(detId); if(itr != theChLayers.end()) return itr->second; From 7a9ac58d629975bacd581eccb70294d272b10e86 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 30 Oct 2013 15:59:50 +0100 Subject: [PATCH 179/182] indentation --- SimMuL1/scripts/triggerEfficiencyVsPtPlots.C | 4224 +++++++++--------- 1 file changed, 2102 insertions(+), 2122 deletions(-) diff --git a/SimMuL1/scripts/triggerEfficiencyVsPtPlots.C b/SimMuL1/scripts/triggerEfficiencyVsPtPlots.C index 9276715e75540..1af54fd93fb29 100644 --- a/SimMuL1/scripts/triggerEfficiencyVsPtPlots.C +++ b/SimMuL1/scripts/triggerEfficiencyVsPtPlots.C @@ -1,10 +1,3 @@ - - - - - - - //int kGray=920, kOrange=800, kSpring=820, kTeal=840, kAzure=860, kViolet=880, kPink=900; TFile *f; @@ -17,8 +10,8 @@ TH1F *gh; TH1D *h1, *h2, *he; -TString filesDir = "files/"; -TString plotDir = "plots/efficiency/"; +TString filesDir = "files_09_10_2013/"; +TString plotDir = "plots/trigger_eff_vs_pt/"; TString ext = ".pdf"; double yrange[2]={0.,1.04}; @@ -36,61 +29,48 @@ bool h_eff_eta_steps_full10 = true; //do_h_eff_eta_me1_after_alct_okAlct = true; -void dp(char *prc, char *g, char *pu, int st, char *suffix="", char *neu="") -{ -char nm[300], fnm[300],onm[300]; -//sprintf(nm,"%s_2_2_6_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3",prc,pu,g,st); -sprintf(nm,"%s_3_6_2_%spu%s_me42_me1a%s_2pi_step_%d_pre3_w3%s",prc,neu,pu,g,st,suffix); -//sprintf(nm,"%s_3_7_0_pu%s_me42_me1a%s_2pi_step_%d_pre3_w3",prc,pu,g,st); -sprintf(fnm,"../hp_%s.root",nm); -sprintf(onm,"st_%s",nm); -drawplot_etastep(fnm,"StrictChamber",onm); -} - - - TPaveStats* GetStat(TH1*h) { -TPaveStats* stat = (TPaveStats*)h->FindObject("stats"); -return stat; + TPaveStats* stat = (TPaveStats*)h->FindObject("stats"); + return stat; } TPaveStats* SetOptStat(TH1*h,int op) { -TPaveStats* stat = GetStat(h); -stat->SetOptStat(op); -return stat; + TPaveStats* stat = GetStat(h); + stat->SetOptStat(op); + return stat; } TObject* getH(char dir[100], char name[100]) { -char nm[222]; -sprintf(nm,"%s/%s;1",dir,name); -return f->Get(nm); + char nm[222]; + sprintf(nm,"%s/%s;1",dir,name); + return f->Get(nm); } void Print(TCanvas *c, char nm[200]) { -gPad->RedrawAxis(); -char dirnm[200]; -sprintf(dirnm,"%s/%s",pdir,nm); -c->Print(dirnm); + gPad->RedrawAxis(); + char dirnm[200]; + sprintf(dirnm,"%s/%s",pdir,nm); + c->Print(dirnm); } void myRebin(TH1D* h, int n) { -int nb = h->GetNbinsX(); -Double_t entr = h->GetEntries(); -Double_t bin0 = h->GetBinContent(0); -Double_t binN1 = h->GetBinContent(nb+1); -if (nb % n) binN1 += h->Integral(nb - nb%n + 1,nb); -h->Rebin(n); -nb = h->GetNbinsX(); -h->SetBinContent(0,bin0); -h->SetBinContent(nb+1,binN1); -h->SetEntries(entr); + int nb = h->GetNbinsX(); + Double_t entr = h->GetEntries(); + Double_t bin0 = h->GetBinContent(0); + Double_t binN1 = h->GetBinContent(nb+1); + if (nb % n) binN1 += h->Integral(nb - nb%n + 1,nb); + h->Rebin(n); + nb = h->GetNbinsX(); + h->SetBinContent(0,bin0); + h->SetBinContent(nb+1,binN1); + h->SetEntries(entr); } TH1D* setEffHisto(char *num_name, char *den_name, char *dir, int nrebin, @@ -98,625 +78,625 @@ TH1D* setEffHisto(char *num_name, char *den_name, char *dir, int nrebin, char *htitle, char *xtitle, char *ytitle, double *x_range, double *y_range) { -TH1D* hd0 = (TH1D*)getH(dir,den_name); -TH1D* hn0 = (TH1D*)getH(dir,num_name); + TH1D* hd0 = (TH1D*)getH(dir,den_name); + TH1D* hn0 = (TH1D*)getH(dir,num_name); -TString sden_name(den_name); -TString snum_name(num_name); + TString sden_name(den_name); + TString snum_name(num_name); -TH1D* hd = (TH1D*)hd0->Clone(sden_name+"_cln"); -TH1D* hn = (TH1D*)hn0->Clone(snum_name+"_cln"); -hd->Sumw2(); -hn->Sumw2(); + TH1D* hd = (TH1D*)hd0->Clone(sden_name+"_cln"); + TH1D* hn = (TH1D*)hn0->Clone(snum_name+"_cln"); + hd->Sumw2(); + hn->Sumw2(); -myRebin(hd, nrebin); -myRebin(hn, nrebin); + myRebin(hd, nrebin); + myRebin(hn, nrebin); -TH1D* heff = (TH1D*)hn->Clone(snum_name+"_eff"); + TH1D* heff = (TH1D*)hn->Clone(snum_name+"_eff"); -hd->Sumw2(); -heff->Sumw2(); + hd->Sumw2(); + heff->Sumw2(); -heff->Divide(heff,hd); + heff->Divide(heff,hd); -heff->SetLineColor(lcolor); -heff->SetLineStyle(lstyle); -heff->SetLineWidth(lwidth); + heff->SetLineColor(lcolor); + heff->SetLineStyle(lstyle); + heff->SetLineWidth(lwidth); -heff->SetTitle(htitle); -heff->GetXaxis()->SetTitle(xtitle); -heff->GetYaxis()->SetTitle(ytitle); -heff->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); -heff->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); + heff->SetTitle(htitle); + heff->GetXaxis()->SetTitle(xtitle); + heff->GetYaxis()->SetTitle(ytitle); + heff->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); + heff->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); -heff->GetXaxis()->SetTitleSize(0.07); -heff->GetXaxis()->SetTitleOffset(0.7); -heff->GetYaxis()->SetLabelOffset(0.015); + heff->GetXaxis()->SetTitleSize(0.07); + heff->GetXaxis()->SetTitleOffset(0.7); + heff->GetYaxis()->SetLabelOffset(0.015); -heff->GetXaxis()->SetLabelSize(0.05); -heff->GetYaxis()->SetLabelSize(0.05); + heff->GetXaxis()->SetLabelSize(0.05); + heff->GetYaxis()->SetLabelSize(0.05); -return heff; + return heff; } TH1D* getEffHisto(TString fname, TString hdir, TString num_name, TString den_name, int nrebin, int lcolor, int lstyle, int lwidth, TString title, double *x_range, double *y_range) { -TFile *fh = TFile::Open(fname); + TFile *fh = TFile::Open(fname); -TH1D* hd0 = (TH1D*)fh->Get(hdir + "/" + den_name); -TH1D* hn0 = (TH1D*)fh->Get(hdir + "/" + num_name); + TH1D* hd0 = (TH1D*)fh->Get(hdir + "/" + den_name); + TH1D* hn0 = (TH1D*)fh->Get(hdir + "/" + num_name); -TH1D* hd = (TH1D*)hd0->Clone(den_name+"_cln_"+fname); -TH1D* hn = (TH1D*)hn0->Clone(num_name+"_cln_"+fname); -hd->Sumw2(); -hn->Sumw2(); + TH1D* hd = (TH1D*)hd0->Clone(den_name+"_cln_"+fname); + TH1D* hn = (TH1D*)hn0->Clone(num_name+"_cln_"+fname); + hd->Sumw2(); + hn->Sumw2(); -myRebin(hd, nrebin); -myRebin(hn, nrebin); + myRebin(hd, nrebin); + myRebin(hn, nrebin); -TH1D* heff = (TH1D*)hn->Clone(num_name+"_eff_"+fname); + TH1D* heff = (TH1D*)hn->Clone(num_name+"_eff_"+fname); -hd->Sumw2(); -heff->Sumw2(); + hd->Sumw2(); + heff->Sumw2(); -heff->Divide(heff,hd); + heff->Divide(heff,hd); -heff->SetLineColor(lcolor); -heff->SetLineStyle(lstyle); -heff->SetLineWidth(lwidth); + heff->SetLineColor(lcolor); + heff->SetLineStyle(lstyle); + heff->SetLineWidth(lwidth); -heff->SetTitle(title); -//heff->GetXaxis()->SetTitle(xtitle); -//heff->GetYaxis()->SetTitle(ytitle); -heff->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); -heff->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); + heff->SetTitle(title); + //heff->GetXaxis()->SetTitle(xtitle); + //heff->GetYaxis()->SetTitle(ytitle); + heff->GetXaxis()->SetRangeUser(x_range[0],x_range[1]); + heff->GetYaxis()->SetRangeUser(y_range[0],y_range[1]); -heff->GetXaxis()->SetTitleSize(0.07); -heff->GetXaxis()->SetTitleOffset(0.7); -heff->GetYaxis()->SetLabelOffset(0.015); + heff->GetXaxis()->SetTitleSize(0.07); + heff->GetXaxis()->SetTitleOffset(0.7); + heff->GetYaxis()->SetLabelOffset(0.015); -heff->GetXaxis()->SetLabelSize(0.05); -heff->GetYaxis()->SetLabelSize(0.05); + heff->GetXaxis()->SetLabelSize(0.05); + heff->GetYaxis()->SetLabelSize(0.05); -h1 = hn0; -h2 = hd0; -he = heff; + h1 = hn0; + h2 = hd0; + he = heff; -//fh->Close(); -return heff; + //fh->Close(); + return heff; } void gem_eff_draw() { -gStyle->SetOptStat(0); -gStyle->SetTitleStyle(0); + gStyle->SetOptStat(0); + gStyle->SetTitleStyle(0); -int ptreb=2; + int ptreb=2; -TString hdir = "SimMuL1StrictAll"; + TString hdir = "SimMuL1StrictAll"; -//TString f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_def_pat2.root"; -TString f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem_dphi0_pat2.root"; -TString f_g98_pt10 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt10_pat2.root"; -TString f_g98_pt15 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt15_pat2.root"; -TString f_g98_pt20 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt20_pat2.root"; -TString f_g98_pt30 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt30_pat2.root"; -TString f_g98_pt40 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt40_pat2.root"; + //TString f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_def_pat2.root"; + TString f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem_dphi0_pat2.root"; + TString f_g98_pt10 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt10_pat2.root"; + TString f_g98_pt15 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt15_pat2.root"; + TString f_g98_pt20 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt20_pat2.root"; + TString f_g98_pt30 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt30_pat2.root"; + TString f_g98_pt40 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem98_pt40_pat2.root"; -TString f_g95_pt10 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt10_pat2.root"; -TString f_g95_pt20 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt20_pat2.root"; -TString f_g95_pt30 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt30_pat2.root"; -TString f_g95_pt40 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt40_pat2.root"; + TString f_g95_pt10 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt10_pat2.root"; + TString f_g95_pt20 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt20_pat2.root"; + TString f_g95_pt30 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt30_pat2.root"; + TString f_g95_pt40 = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem95_pt40_pat2.root"; -double rpt[2] = {0.,49.99}; + double rpt[2] = {0.,49.99}; -TString htitle = "Efficiency for #mu in 1.6<|#eta|<2.12 to have TF track;p_{T}^{MC}"; + TString htitle = "Efficiency for #mu in 1.6<|#eta|<2.12 to have TF track;p_{T}^{MC}"; -TString hini = "h_pt_initial_1b"; -TString h2s = "h_pt_after_tfcand_eta1b_2s"; -TString h3s = "h_pt_after_tfcand_eta1b_3s"; -TString h2s1b = "h_pt_after_tfcand_eta1b_2s1b"; -TString h3s1b = "h_pt_after_tfcand_eta1b_3s1b"; + TString hini = "h_pt_initial_1b"; + TString h2s = "h_pt_after_tfcand_eta1b_2s"; + TString h3s = "h_pt_after_tfcand_eta1b_3s"; + TString h2s1b = "h_pt_after_tfcand_eta1b_2s1b"; + TString h3s1b = "h_pt_after_tfcand_eta1b_3s1b"; -TH1D* h_eff_tf0_2s = getEffHisto(f_def, hdir, h2s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_tf0_3s = getEffHisto(f_def, hdir, h3s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_tf0_2s1b = getEffHisto(f_def, hdir, h2s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_tf0_3s1b = getEffHisto(f_def, hdir, h3s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_tf0_2s = getEffHisto(f_def, hdir, h2s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_tf0_3s = getEffHisto(f_def, hdir, h3s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_tf0_2s1b = getEffHisto(f_def, hdir, h2s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_tf0_3s1b = getEffHisto(f_def, hdir, h3s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_tf10_2s = getEffHisto(f_def, hdir, h2s + "_pt10", hini, ptreb, kGreen+4, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_3s = getEffHisto(f_def, hdir, h3s + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_2s = getEffHisto(f_def, hdir, h2s + "_pt10", hini, ptreb, kGreen+4, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_3s = getEffHisto(f_def, hdir, h3s + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); -//TH1D* h_eff_tf15_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); -//TH1D* h_eff_tf15_3s = getEffHisto(f_def, hdir, h3s + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); -//TH1D* h_eff_tf15_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); + //TH1D* h_eff_tf15_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); + //TH1D* h_eff_tf15_3s = getEffHisto(f_def, hdir, h3s + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); + //TH1D* h_eff_tf15_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt15", hini, ptreb, kBlue, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_2s = getEffHisto(f_def, hdir, h2s + "_pt20", hini, ptreb, kOrange+4, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_3s = getEffHisto(f_def, hdir, h3s + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_2s = getEffHisto(f_def, hdir, h2s + "_pt20", hini, ptreb, kOrange+4, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_3s = getEffHisto(f_def, hdir, h3s + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf30_2s = getEffHisto(f_def, hdir, h2s + "_pt30", hini, ptreb, kRed+4, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf30_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf30_3s = getEffHisto(f_def, hdir, h3s + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf30_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf30_2s = getEffHisto(f_def, hdir, h2s + "_pt30", hini, ptreb, kRed+4, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf30_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf30_3s = getEffHisto(f_def, hdir, h3s + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf30_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf40_2s = getEffHisto(f_def, hdir, h2s + "_pt40", hini, ptreb, kViolet+4, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf40_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt40", hini, ptreb, kViolet, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf40_3s = getEffHisto(f_def, hdir, h3s + "_pt40", hini, ptreb, kViolet, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf40_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt40", hini, ptreb, kViolet, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf40_2s = getEffHisto(f_def, hdir, h2s + "_pt40", hini, ptreb, kViolet+4, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf40_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt40", hini, ptreb, kViolet, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf40_3s = getEffHisto(f_def, hdir, h3s + "_pt40", hini, ptreb, kViolet, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf40_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt40", hini, ptreb, kViolet, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_gpt10_2s1b = getEffHisto(f_g98_pt10, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_gpt10_3s1b = getEffHisto(f_g98_pt10, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_gpt10_2s1b = getEffHisto(f_g98_pt10, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_gpt10_3s1b = getEffHisto(f_g98_pt10, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf15_gpt15_2s1b = getEffHisto(f_g98_pt15, hdir, h2s1b + "_pt15", hini, ptreb, kBlue, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf15_gpt15_3s1b = getEffHisto(f_g98_pt15, hdir, h3s1b + "_pt15", hini, ptreb, kBlue, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf15_gpt15_2s1b = getEffHisto(f_g98_pt15, hdir, h2s1b + "_pt15", hini, ptreb, kBlue, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf15_gpt15_3s1b = getEffHisto(f_g98_pt15, hdir, h3s1b + "_pt15", hini, ptreb, kBlue, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_gpt20_2s1b = getEffHisto(f_g98_pt20, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_gpt20_3s1b = getEffHisto(f_g98_pt20, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_gpt20_2s1b = getEffHisto(f_g98_pt20, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_gpt20_3s1b = getEffHisto(f_g98_pt20, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf30_gpt30_2s1b = getEffHisto(f_g98_pt30, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf30_gpt30_3s1b = getEffHisto(f_g98_pt30, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf30_gpt30_2s1b = getEffHisto(f_g98_pt30, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf30_gpt30_3s1b = getEffHisto(f_g98_pt30, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf40_gpt40_2s1b = getEffHisto(f_g98_pt40, hdir, h2s1b + "_pt40", hini, ptreb, kViolet, 7, 2, htitle, rpt,yrange); -TH1D* h_eff_tf40_gpt40_3s1b = getEffHisto(f_g98_pt40, hdir, h3s1b + "_pt40", hini, ptreb, kViolet, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf40_gpt40_2s1b = getEffHisto(f_g98_pt40, hdir, h2s1b + "_pt40", hini, ptreb, kViolet, 7, 2, htitle, rpt,yrange); + TH1D* h_eff_tf40_gpt40_3s1b = getEffHisto(f_g98_pt40, hdir, h3s1b + "_pt40", hini, ptreb, kViolet, 7, 2, htitle, rpt,yrange); -TCanvas* c2s1b = new TCanvas("c2s1b","c2s1b",800,600) ; + TCanvas* c2s1b = new TCanvas("c2s1b","c2s1b",800,600) ; -/* -TH1D* h_eff_gmt20_1b = getEffHisto(f_def, hdir, "h_pt_after_gmt_eta1b_1mu_pt20", hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_gmt30_1b = getEffHisto(f_def, hdir, "h_pt_after_gmt_eta1b_1mu_pt30", hini, ptreb, kBlack-1, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_gmt40_1b = getEffHisto(f_def, hdir, "h_pt_after_gmt_eta1b_1mu_pt40", hini, ptreb, kBlack-2, 1, 2, htitle, rpt, yrange); -h_eff_gmt20_1b->Draw("hist"); -h_eff_gmt30_1b->Draw("hist same"); -h_eff_gmt40_1b->Draw("hist same"); -return; + /* + TH1D* h_eff_gmt20_1b = getEffHisto(f_def, hdir, "h_pt_after_gmt_eta1b_1mu_pt20", hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_gmt30_1b = getEffHisto(f_def, hdir, "h_pt_after_gmt_eta1b_1mu_pt30", hini, ptreb, kBlack-1, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_gmt40_1b = getEffHisto(f_def, hdir, "h_pt_after_gmt_eta1b_1mu_pt40", hini, ptreb, kBlack-2, 1, 2, htitle, rpt, yrange); + h_eff_gmt20_1b->Draw("hist"); + h_eff_gmt30_1b->Draw("hist same"); + h_eff_gmt40_1b->Draw("hist same"); + return; -h_eff_tf40_3s->Draw("hist"); -h_eff_tf40_3s1b->Draw("hist same"); -h_eff_tf40_gpt40_3s1b->Draw("hist same"); -return; -*/ + h_eff_tf40_3s->Draw("hist"); + h_eff_tf40_3s1b->Draw("hist same"); + h_eff_tf40_gpt40_3s1b->Draw("hist same"); + return; + */ -TH1D* h_eff_tf10_gpt15_2s1b = getEffHisto(f_g98_pt15, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 3, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_gpt15_3s1b = getEffHisto(f_g98_pt15, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 3, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_gpt15_2s1b = getEffHisto(f_g98_pt15, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 3, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_gpt15_3s1b = getEffHisto(f_g98_pt15, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 3, 2, htitle, rpt,yrange); -TH1D* h_eff_tf15_gpt20_2s1b = getEffHisto(f_g98_pt20, hdir, h2s1b + "_pt15", hini, ptreb, kViolet, 3, 2, htitle, rpt,yrange); -TH1D* h_eff_tf15_gpt20_3s1b = getEffHisto(f_g98_pt20, hdir, h3s1b + "_pt15", hini, ptreb, kViolet, 3, 2, htitle, rpt,yrange); + TH1D* h_eff_tf15_gpt20_2s1b = getEffHisto(f_g98_pt20, hdir, h2s1b + "_pt15", hini, ptreb, kViolet, 3, 2, htitle, rpt,yrange); + TH1D* h_eff_tf15_gpt20_3s1b = getEffHisto(f_g98_pt20, hdir, h3s1b + "_pt15", hini, ptreb, kViolet, 3, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_gpt30_2s1b = getEffHisto(f_g98_pt30, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 3, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_gpt30_3s1b = getEffHisto(f_g98_pt30, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 3, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_gpt30_2s1b = getEffHisto(f_g98_pt30, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 3, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_gpt30_3s1b = getEffHisto(f_g98_pt30, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 3, 2, htitle, rpt,yrange); -TH1D* h_eff_tf30_gpt40_2s1b = getEffHisto(f_g98_pt40, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 3, 2, htitle, rpt,yrange); -TH1D* h_eff_tf30_gpt40_3s1b = getEffHisto(f_g98_pt40, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 3, 2, htitle, rpt,yrange); + TH1D* h_eff_tf30_gpt40_2s1b = getEffHisto(f_g98_pt40, hdir, h2s1b + "_pt30", hini, ptreb, kRed, 3, 2, htitle, rpt,yrange); + TH1D* h_eff_tf30_gpt40_3s1b = getEffHisto(f_g98_pt40, hdir, h3s1b + "_pt30", hini, ptreb, kRed, 3, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_gpt20_2s1b = getEffHisto(f_g98_pt20, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 3, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_gpt20_3s1b = getEffHisto(f_g98_pt20, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 3, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_gpt20_2s1b = getEffHisto(f_g98_pt20, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 3, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_gpt20_3s1b = getEffHisto(f_g98_pt20, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 3, 2, htitle, rpt,yrange); -TH1D* h_eff_tf15_gpt30_2s1b = getEffHisto(f_g98_pt30, hdir, h2s1b + "_pt15", hini, ptreb, kViolet, 3, 2, htitle, rpt,yrange); -TH1D* h_eff_tf15_gpt30_3s1b = getEffHisto(f_g98_pt30, hdir, h3s1b + "_pt15", hini, ptreb, kViolet, 3, 2, htitle, rpt,yrange); + TH1D* h_eff_tf15_gpt30_2s1b = getEffHisto(f_g98_pt30, hdir, h2s1b + "_pt15", hini, ptreb, kViolet, 3, 2, htitle, rpt,yrange); + TH1D* h_eff_tf15_gpt30_3s1b = getEffHisto(f_g98_pt30, hdir, h3s1b + "_pt15", hini, ptreb, kViolet, 3, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_gpt40_2s1b = getEffHisto(f_g98_pt40, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 3, 2, htitle, rpt,yrange); -TH1D* h_eff_tf20_gpt40_3s1b = getEffHisto(f_g98_pt40, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 3, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_gpt40_2s1b = getEffHisto(f_g98_pt40, hdir, h2s1b + "_pt20", hini, ptreb, kOrange, 3, 2, htitle, rpt,yrange); + TH1D* h_eff_tf20_gpt40_3s1b = getEffHisto(f_g98_pt40, hdir, h3s1b + "_pt20", hini, ptreb, kOrange, 3, 2, htitle, rpt,yrange); -TCanvas* c2s1b = new TCanvas("c2s1b","c2s1b",800,600) ; + TCanvas* c2s1b = new TCanvas("c2s1b","c2s1b",800,600) ; -//h_eff_tf0_2s1b->Draw("hist"); -h_eff_tf10_2s1b->Draw("hist"); -//h_eff_tf15_2s1b->Draw("hist same"); -h_eff_tf20_2s1b->Draw("hist same"); -h_eff_tf30_2s1b->Draw("hist same"); -//h_eff_tf40_2s1b->Draw("hist same"); + //h_eff_tf0_2s1b->Draw("hist"); + h_eff_tf10_2s1b->Draw("hist"); + //h_eff_tf15_2s1b->Draw("hist same"); + h_eff_tf20_2s1b->Draw("hist same"); + h_eff_tf30_2s1b->Draw("hist same"); + //h_eff_tf40_2s1b->Draw("hist same"); -h_eff_tf10_gpt10_2s1b->Draw("hist same"); -h_eff_tf20_gpt20_2s1b->Draw("hist same"); -h_eff_tf30_gpt30_2s1b->Draw("hist same"); + h_eff_tf10_gpt10_2s1b->Draw("hist same"); + h_eff_tf20_gpt20_2s1b->Draw("hist same"); + h_eff_tf30_gpt30_2s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.50,0.17,.999,0.57, NULL, "brNDC"); -leg->SetNColumns(2); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track requires 2+ stubs, one from ME1"); -leg->AddEntry(h_eff_tf10_2s1b, "Trigger p_{T}:", ""); -leg->AddEntry(h_eff_tf10_gpt10_2s1b, "with GEM:", ""); -leg->AddEntry(h_eff_tf10_2s1b, "p_{T}^{TF}>=10", "l"); -leg->AddEntry(h_eff_tf10_gpt10_2s1b, "#Delta#phi for p_{T}=10", "l"); -leg->AddEntry(h_eff_tf20_2s1b, "p_{T}^{TF}>=20", "l"); -leg->AddEntry(h_eff_tf20_gpt20_2s1b, "#Delta#phi for p_{T}=20", "l"); -leg->AddEntry(h_eff_tf30_2s1b, "p_{T}^{TF}>=30", "l"); -leg->AddEntry(h_eff_tf30_gpt30_2s1b, "#Delta#phi for p_{T}=30", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.50,0.17,.999,0.57, NULL, "brNDC"); + leg->SetNColumns(2); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track requires 2+ stubs, one from ME1"); + leg->AddEntry(h_eff_tf10_2s1b, "Trigger p_{T}:", ""); + leg->AddEntry(h_eff_tf10_gpt10_2s1b, "with GEM:", ""); + leg->AddEntry(h_eff_tf10_2s1b, "p_{T}^{TF}>=10", "l"); + leg->AddEntry(h_eff_tf10_gpt10_2s1b, "#Delta#phi for p_{T}=10", "l"); + leg->AddEntry(h_eff_tf20_2s1b, "p_{T}^{TF}>=20", "l"); + leg->AddEntry(h_eff_tf20_gpt20_2s1b, "#Delta#phi for p_{T}=20", "l"); + leg->AddEntry(h_eff_tf30_2s1b, "p_{T}^{TF}>=30", "l"); + leg->AddEntry(h_eff_tf30_gpt30_2s1b, "#Delta#phi for p_{T}=30", "l"); + leg->Draw(); -c2s1b->Print(plotDir + "eff_2s1b" + ext); + c2s1b->Print(plotDir + "eff_2s1b" + ext); -TCanvas* c3s1b = new TCanvas("c3s1b","c3s1b",800,600) ; + TCanvas* c3s1b = new TCanvas("c3s1b","c3s1b",800,600) ; -h_eff_tf10_3s1b->Draw("hist"); -h_eff_tf20_3s1b->Draw("hist same"); -h_eff_tf30_3s1b->Draw("hist same"); + h_eff_tf10_3s1b->Draw("hist"); + h_eff_tf20_3s1b->Draw("hist same"); + h_eff_tf30_3s1b->Draw("hist same"); -h_eff_tf10_gpt10_3s1b->Draw("hist same"); -h_eff_tf20_gpt20_3s1b->Draw("hist same"); -h_eff_tf30_gpt30_3s1b->Draw("hist same"); + h_eff_tf10_gpt10_3s1b->Draw("hist same"); + h_eff_tf20_gpt20_3s1b->Draw("hist same"); + h_eff_tf30_gpt30_3s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.50,0.17,.999,0.57, NULL, "brNDC"); -leg->SetNColumns(2); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track requires 3+ stubs, one from ME1"); -leg->AddEntry(h_eff_tf10_3s1b, "Trigger p_{T}:", ""); -leg->AddEntry(h_eff_tf10_gpt10_3s1b, "with GEM:", ""); -leg->AddEntry(h_eff_tf10_3s1b, "p_{T}^{TF}>=10", "l"); -leg->AddEntry(h_eff_tf10_gpt10_3s1b, "#Delta#phi for p_{T}=10", "l"); -leg->AddEntry(h_eff_tf20_3s1b, "p_{T}^{TF}>=20", "l"); -leg->AddEntry(h_eff_tf20_gpt20_3s1b, "#Delta#phi for p_{T}=20", "l"); -leg->AddEntry(h_eff_tf30_3s1b, "p_{T}^{TF}>=30", "l"); -leg->AddEntry(h_eff_tf30_gpt30_3s1b, "#Delta#phi for p_{T}=30", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.50,0.17,.999,0.57, NULL, "brNDC"); + leg->SetNColumns(2); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track requires 3+ stubs, one from ME1"); + leg->AddEntry(h_eff_tf10_3s1b, "Trigger p_{T}:", ""); + leg->AddEntry(h_eff_tf10_gpt10_3s1b, "with GEM:", ""); + leg->AddEntry(h_eff_tf10_3s1b, "p_{T}^{TF}>=10", "l"); + leg->AddEntry(h_eff_tf10_gpt10_3s1b, "#Delta#phi for p_{T}=10", "l"); + leg->AddEntry(h_eff_tf20_3s1b, "p_{T}^{TF}>=20", "l"); + leg->AddEntry(h_eff_tf20_gpt20_3s1b, "#Delta#phi for p_{T}=20", "l"); + leg->AddEntry(h_eff_tf30_3s1b, "p_{T}^{TF}>=30", "l"); + leg->AddEntry(h_eff_tf30_gpt30_3s1b, "#Delta#phi for p_{T}=30", "l"); + leg->Draw(); -c3s1b->Print(plotDir + "eff_3s1b" + ext); + c3s1b->Print(plotDir + "eff_3s1b" + ext); -TCanvas* c3s_2s1b = new TCanvas("c3s_2s1b","c3s_2s1b",800,600); + TCanvas* c3s_2s1b = new TCanvas("c3s_2s1b","c3s_2s1b",800,600); -h_eff_tf10_3s->Draw("hist"); -h_eff_tf20_3s->Draw("hist same"); -h_eff_tf30_3s->Draw("hist same"); + h_eff_tf10_3s->Draw("hist"); + h_eff_tf20_3s->Draw("hist same"); + h_eff_tf30_3s->Draw("hist same"); -h_eff_tf10_gpt10_2s1b->Draw("hist same"); -h_eff_tf20_gpt20_2s1b->Draw("hist same"); -h_eff_tf30_gpt30_2s1b->Draw("hist same"); + h_eff_tf10_gpt10_2s1b->Draw("hist same"); + h_eff_tf20_gpt20_2s1b->Draw("hist same"); + h_eff_tf30_gpt30_2s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.50,0.17,.999,0.57, NULL, "brNDC"); -leg->SetNColumns(2); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track requires"); -leg->AddEntry(h_eff_tf10_3s, "3+ stubs", ""); -leg->AddEntry(h_eff_tf10_gpt10_2s1b, "2+ stubs with GEM in ME1", ""); -leg->AddEntry(h_eff_tf10_3s, "p_{T}^{TF}>=10", "l"); -leg->AddEntry(h_eff_tf10_gpt10_2s1b, "#Delta#phi for p_{T}=10", "l"); -leg->AddEntry(h_eff_tf20_3s, "p_{T}^{TF}>=20", "l"); -leg->AddEntry(h_eff_tf20_gpt20_2s1b, "#Delta#phi for p_{T}=20", "l"); -leg->AddEntry(h_eff_tf30_3s, "p_{T}^{TF}>=30", "l"); -leg->AddEntry(h_eff_tf30_gpt30_2s1b, "#Delta#phi for p_{T}=30", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.50,0.17,.999,0.57, NULL, "brNDC"); + leg->SetNColumns(2); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track requires"); + leg->AddEntry(h_eff_tf10_3s, "3+ stubs", ""); + leg->AddEntry(h_eff_tf10_gpt10_2s1b, "2+ stubs with GEM in ME1", ""); + leg->AddEntry(h_eff_tf10_3s, "p_{T}^{TF}>=10", "l"); + leg->AddEntry(h_eff_tf10_gpt10_2s1b, "#Delta#phi for p_{T}=10", "l"); + leg->AddEntry(h_eff_tf20_3s, "p_{T}^{TF}>=20", "l"); + leg->AddEntry(h_eff_tf20_gpt20_2s1b, "#Delta#phi for p_{T}=20", "l"); + leg->AddEntry(h_eff_tf30_3s, "p_{T}^{TF}>=30", "l"); + leg->AddEntry(h_eff_tf30_gpt30_2s1b, "#Delta#phi for p_{T}=30", "l"); + leg->Draw(); -c3s_2s1b->Print(plotDir + "eff_3s_2s1b" + ext); + c3s_2s1b->Print(plotDir + "eff_3s_2s1b" + ext); -TCanvas* c3s_def = new TCanvas("c3s_def","c3s_def",800,600); + TCanvas* c3s_def = new TCanvas("c3s_def","c3s_def",800,600); -h_eff_tf10_3s->Draw("hist"); -h_eff_tf20_3s->Draw("hist same"); -h_eff_tf30_3s->Draw("hist same"); + h_eff_tf10_3s->Draw("hist"); + h_eff_tf20_3s->Draw("hist same"); + h_eff_tf30_3s->Draw("hist same"); -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track requires 3+ stubs and"); -leg->AddEntry(h_eff_tf10_3s, "p_{T}^{TF}>=10", "l"); -leg->AddEntry(h_eff_tf20_3s, "p_{T}^{TF}>=20", "l"); -leg->AddEntry(h_eff_tf30_3s, "p_{T}^{TF}>=30", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track requires 3+ stubs and"); + leg->AddEntry(h_eff_tf10_3s, "p_{T}^{TF}>=10", "l"); + leg->AddEntry(h_eff_tf20_3s, "p_{T}^{TF}>=20", "l"); + leg->AddEntry(h_eff_tf30_3s, "p_{T}^{TF}>=30", "l"); + leg->Draw(); -c3s_def->Print(plotDir + "eff_3s_def" + ext); + c3s_def->Print(plotDir + "eff_3s_def" + ext); -TCanvas* c3s1b_def = new TCanvas("c3s1b_def","c3s1b_def",800,600); + TCanvas* c3s1b_def = new TCanvas("c3s1b_def","c3s1b_def",800,600); -h_eff_tf10_3s1b->Draw("hist"); -h_eff_tf20_3s1b->Draw("hist same"); -h_eff_tf30_3s1b->Draw("hist same"); + h_eff_tf10_3s1b->Draw("hist"); + h_eff_tf20_3s1b->Draw("hist same"); + h_eff_tf30_3s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track requires 3+ stubs with ME1 and"); -leg->AddEntry(h_eff_tf10_3s, "p_{T}^{TF}>=10", "l"); -leg->AddEntry(h_eff_tf20_3s, "p_{T}^{TF}>=20", "l"); -leg->AddEntry(h_eff_tf30_3s, "p_{T}^{TF}>=30", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track requires 3+ stubs with ME1 and"); + leg->AddEntry(h_eff_tf10_3s, "p_{T}^{TF}>=10", "l"); + leg->AddEntry(h_eff_tf20_3s, "p_{T}^{TF}>=20", "l"); + leg->AddEntry(h_eff_tf30_3s, "p_{T}^{TF}>=30", "l"); + leg->Draw(); -c3s1b_def->Print(plotDir + "eff_3s1b_def" + ext); + c3s1b_def->Print(plotDir + "eff_3s1b_def" + ext); -h_eff_tf10_2s->SetLineColor(kAzure+2); -h_eff_tf10_2s1b->SetLineColor(kAzure+6); -h_eff_tf10_3s->SetLineColor(kAzure+3); -h_eff_tf10_3s1b->SetLineColor(kAzure+7); -h_eff_tf10_gpt10_2s1b->SetLineColor(kAzure+6); -h_eff_tf10_gpt10_3s1b->SetLineColor(kAzure+7); + h_eff_tf10_2s->SetLineColor(kAzure+2); + h_eff_tf10_2s1b->SetLineColor(kAzure+6); + h_eff_tf10_3s->SetLineColor(kAzure+3); + h_eff_tf10_3s1b->SetLineColor(kAzure+7); + h_eff_tf10_gpt10_2s1b->SetLineColor(kAzure+6); + h_eff_tf10_gpt10_3s1b->SetLineColor(kAzure+7); -h_eff_tf20_2s->SetLineColor(kAzure+2); -h_eff_tf20_2s1b->SetLineColor(kAzure+6); -h_eff_tf20_3s->SetLineColor(kAzure+3); -h_eff_tf20_3s1b->SetLineColor(kAzure+7); -h_eff_tf20_gpt20_2s1b->SetLineColor(kAzure+6); -h_eff_tf20_gpt20_3s1b->SetLineColor(kAzure+7); + h_eff_tf20_2s->SetLineColor(kAzure+2); + h_eff_tf20_2s1b->SetLineColor(kAzure+6); + h_eff_tf20_3s->SetLineColor(kAzure+3); + h_eff_tf20_3s1b->SetLineColor(kAzure+7); + h_eff_tf20_gpt20_2s1b->SetLineColor(kAzure+6); + h_eff_tf20_gpt20_3s1b->SetLineColor(kAzure+7); -h_eff_tf30_2s->SetLineColor(kAzure+2); -h_eff_tf30_2s1b->SetLineColor(kAzure+6); -h_eff_tf30_3s->SetLineColor(kAzure+3); -h_eff_tf30_3s1b->SetLineColor(kAzure+7); -h_eff_tf30_gpt30_2s1b->SetLineColor(kAzure+6); -h_eff_tf30_gpt30_3s1b->SetLineColor(kAzure+7); + h_eff_tf30_2s->SetLineColor(kAzure+2); + h_eff_tf30_2s1b->SetLineColor(kAzure+6); + h_eff_tf30_3s->SetLineColor(kAzure+3); + h_eff_tf30_3s1b->SetLineColor(kAzure+7); + h_eff_tf30_gpt30_2s1b->SetLineColor(kAzure+6); + h_eff_tf30_gpt30_3s1b->SetLineColor(kAzure+7); -h_eff_tf40_2s->SetLineColor(kAzure+2); -h_eff_tf40_2s1b->SetLineColor(kAzure+6); -h_eff_tf40_3s->SetLineColor(kAzure+3); -h_eff_tf40_3s1b->SetLineColor(kAzure+7); -h_eff_tf40_gpt40_2s1b->SetLineColor(kAzure+6); -h_eff_tf40_gpt40_3s1b->SetLineColor(kAzure+7); + h_eff_tf40_2s->SetLineColor(kAzure+2); + h_eff_tf40_2s1b->SetLineColor(kAzure+6); + h_eff_tf40_3s->SetLineColor(kAzure+3); + h_eff_tf40_3s1b->SetLineColor(kAzure+7); + h_eff_tf40_gpt40_2s1b->SetLineColor(kAzure+6); + h_eff_tf40_gpt40_3s1b->SetLineColor(kAzure+7); -TCanvas* c2s_pt10_def = new TCanvas("c2s_pt10_def","c2s_pt10_def",800,600); + TCanvas* c2s_pt10_def = new TCanvas("c2s_pt10_def","c2s_pt10_def",800,600); -h_eff_tf10_2s->Draw("hist"); -h_eff_tf10_2s1b->Draw("hist same"); + h_eff_tf10_2s->Draw("hist"); + h_eff_tf10_2s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track: p_{T}^{TF}>=10 and 2+ stubs"); -leg->AddEntry(h_eff_tf10_2s, "anywhere", "l"); -leg->AddEntry(h_eff_tf10_2s1b, "with ME1", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track: p_{T}^{TF}>=10 and 2+ stubs"); + leg->AddEntry(h_eff_tf10_2s, "anywhere", "l"); + leg->AddEntry(h_eff_tf10_2s1b, "with ME1", "l"); + leg->Draw(); -c2s_pt10_def->Print(plotDir + "eff_2s_pt10_def" + ext); + c2s_pt10_def->Print(plotDir + "eff_2s_pt10_def" + ext); -h_eff_tf10_gpt10_2s1b->Draw("hist same"); -leg->AddEntry(h_eff_tf10_gpt10_2s1b, "with (ME1 + GEM)", "l"); -c2s_pt10_def->Print(plotDir + "eff_2s_pt10_gem" + ext); + h_eff_tf10_gpt10_2s1b->Draw("hist same"); + leg->AddEntry(h_eff_tf10_gpt10_2s1b, "with (ME1 + GEM)", "l"); + c2s_pt10_def->Print(plotDir + "eff_2s_pt10_gem" + ext); -TCanvas* c3s_pt10_def = new TCanvas("c3s_pt10_def","c3s_pt10_def",800,600); + TCanvas* c3s_pt10_def = new TCanvas("c3s_pt10_def","c3s_pt10_def",800,600); -h_eff_tf10_3s->Draw("hist"); -h_eff_tf10_3s1b->Draw("hist same"); + h_eff_tf10_3s->Draw("hist"); + h_eff_tf10_3s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track: p_{T}^{TF}>=10 and 3+ stubs"); -leg->AddEntry(h_eff_tf10_3s, "anywhere", "l"); -leg->AddEntry(h_eff_tf10_3s1b, "with ME1", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track: p_{T}^{TF}>=10 and 3+ stubs"); + leg->AddEntry(h_eff_tf10_3s, "anywhere", "l"); + leg->AddEntry(h_eff_tf10_3s1b, "with ME1", "l"); + leg->Draw(); -c3s_pt10_def->Print(plotDir + "eff_3s_pt10_def" + ext); + c3s_pt10_def->Print(plotDir + "eff_3s_pt10_def" + ext); -h_eff_tf10_gpt10_3s1b->Draw("hist same"); -leg->AddEntry(h_eff_tf10_gpt10_3s1b, "with (ME1 + GEM)", "l"); -c3s_pt10_def->Print(plotDir + "eff_3s_pt10_gem" + ext); + h_eff_tf10_gpt10_3s1b->Draw("hist same"); + leg->AddEntry(h_eff_tf10_gpt10_3s1b, "with (ME1 + GEM)", "l"); + c3s_pt10_def->Print(plotDir + "eff_3s_pt10_gem" + ext); -TCanvas* c2s_pt20_def = new TCanvas("c2s_pt20_def","c2s_pt20_def",800,600); + TCanvas* c2s_pt20_def = new TCanvas("c2s_pt20_def","c2s_pt20_def",800,600); -h_eff_tf20_2s->Draw("hist"); -h_eff_tf20_2s1b->Draw("hist same"); + h_eff_tf20_2s->Draw("hist"); + h_eff_tf20_2s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track: p_{T}^{TF}>=20 and 2+ stubs"); -leg->AddEntry(h_eff_tf20_2s, "anywhere", "l"); -leg->AddEntry(h_eff_tf20_2s1b, "with ME1", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track: p_{T}^{TF}>=20 and 2+ stubs"); + leg->AddEntry(h_eff_tf20_2s, "anywhere", "l"); + leg->AddEntry(h_eff_tf20_2s1b, "with ME1", "l"); + leg->Draw(); -c2s_pt20_def->Print(plotDir + "eff_2s_pt20_def" + ext); + c2s_pt20_def->Print(plotDir + "eff_2s_pt20_def" + ext); -h_eff_tf20_gpt20_2s1b->Draw("hist same"); -leg->AddEntry(h_eff_tf20_gpt20_2s1b, "with (ME1 + GEM)", "l"); -c2s_pt20_def->Print(plotDir + "eff_2s_pt20_gem" + ext); + h_eff_tf20_gpt20_2s1b->Draw("hist same"); + leg->AddEntry(h_eff_tf20_gpt20_2s1b, "with (ME1 + GEM)", "l"); + c2s_pt20_def->Print(plotDir + "eff_2s_pt20_gem" + ext); -TCanvas* c3s_pt20_def = new TCanvas("c3s_pt20_def","c3s_pt20_def",800,600); + TCanvas* c3s_pt20_def = new TCanvas("c3s_pt20_def","c3s_pt20_def",800,600); -h_eff_tf20_3s->Draw("hist"); -h_eff_tf20_3s1b->Draw("hist same"); + h_eff_tf20_3s->Draw("hist"); + h_eff_tf20_3s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track: p_{T}^{TF}>=20 and 3+ stubs"); -leg->AddEntry(h_eff_tf20_3s, "anywhere", "l"); -leg->AddEntry(h_eff_tf20_3s1b, "with ME1", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track: p_{T}^{TF}>=20 and 3+ stubs"); + leg->AddEntry(h_eff_tf20_3s, "anywhere", "l"); + leg->AddEntry(h_eff_tf20_3s1b, "with ME1", "l"); + leg->Draw(); -c3s_pt20_def->Print(plotDir + "eff_3s_pt20_def" + ext); + c3s_pt20_def->Print(plotDir + "eff_3s_pt20_def" + ext); -h_eff_tf20_gpt20_3s1b->Draw("hist same"); -leg->AddEntry(h_eff_tf20_gpt20_3s1b, "with (ME1 + GEM)", "l"); -c3s_pt20_def->Print(plotDir + "eff_3s_pt20_gem" + ext); + h_eff_tf20_gpt20_3s1b->Draw("hist same"); + leg->AddEntry(h_eff_tf20_gpt20_3s1b, "with (ME1 + GEM)", "l"); + c3s_pt20_def->Print(plotDir + "eff_3s_pt20_gem" + ext); -TCanvas* c2s_pt30_def = new TCanvas("c2s_pt30_def","c2s_pt30_def",800,600); + TCanvas* c2s_pt30_def = new TCanvas("c2s_pt30_def","c2s_pt30_def",800,600); -h_eff_tf30_2s->Draw("hist"); -h_eff_tf30_2s1b->Draw("hist same"); + h_eff_tf30_2s->Draw("hist"); + h_eff_tf30_2s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track: p_{T}^{TF}>=30 and 2+ stubs"); -leg->AddEntry(h_eff_tf30_2s, "anywhere", "l"); -leg->AddEntry(h_eff_tf30_2s1b, "with ME1", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track: p_{T}^{TF}>=30 and 2+ stubs"); + leg->AddEntry(h_eff_tf30_2s, "anywhere", "l"); + leg->AddEntry(h_eff_tf30_2s1b, "with ME1", "l"); + leg->Draw(); -c2s_pt30_def->Print(plotDir + "eff_2s_pt30_def" + ext); + c2s_pt30_def->Print(plotDir + "eff_2s_pt30_def" + ext); -h_eff_tf30_gpt30_2s1b->Draw("hist same"); -leg->AddEntry(h_eff_tf30_gpt30_2s1b, "with (ME1 + GEM)", "l"); -c2s_pt30_def->Print(plotDir + "eff_2s_pt30_gem" + ext); + h_eff_tf30_gpt30_2s1b->Draw("hist same"); + leg->AddEntry(h_eff_tf30_gpt30_2s1b, "with (ME1 + GEM)", "l"); + c2s_pt30_def->Print(plotDir + "eff_2s_pt30_gem" + ext); -TCanvas* c3s_pt30_def = new TCanvas("c3s_pt30_def","c3s_pt30_def",800,600); + TCanvas* c3s_pt30_def = new TCanvas("c3s_pt30_def","c3s_pt30_def",800,600); -h_eff_tf30_3s->Draw("hist"); -h_eff_tf30_3s1b->Draw("hist same"); + h_eff_tf30_3s->Draw("hist"); + h_eff_tf30_3s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track: p_{T}^{TF}>=30 and 3+ stubs"); -leg->AddEntry(h_eff_tf30_3s, "anywhere", "l"); -leg->AddEntry(h_eff_tf30_3s1b, "with ME1", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track: p_{T}^{TF}>=30 and 3+ stubs"); + leg->AddEntry(h_eff_tf30_3s, "anywhere", "l"); + leg->AddEntry(h_eff_tf30_3s1b, "with ME1", "l"); + leg->Draw(); -c3s_pt30_def->Print(plotDir + "eff_3s_pt30_def" + ext); + c3s_pt30_def->Print(plotDir + "eff_3s_pt30_def" + ext); -h_eff_tf30_gpt30_3s1b->Draw("hist same"); -leg->AddEntry(h_eff_tf30_gpt30_3s1b, "with (ME1 + GEM)", "l"); -c3s_pt30_def->Print(plotDir + "eff_3s_pt30_gem" + ext); + h_eff_tf30_gpt30_3s1b->Draw("hist same"); + leg->AddEntry(h_eff_tf30_gpt30_3s1b, "with (ME1 + GEM)", "l"); + c3s_pt30_def->Print(plotDir + "eff_3s_pt30_gem" + ext); -TCanvas* c2s_pt40_def = new TCanvas("c2s_pt40_def","c2s_pt40_def",800,600); + TCanvas* c2s_pt40_def = new TCanvas("c2s_pt40_def","c2s_pt40_def",800,600); -h_eff_tf40_2s->Draw("hist"); -h_eff_tf40_2s1b->Draw("hist same"); + h_eff_tf40_2s->Draw("hist"); + h_eff_tf40_2s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track: p_{T}^{TF}>=40 and 2+ stubs"); -leg->AddEntry(h_eff_tf40_2s, "anywhere", "l"); -leg->AddEntry(h_eff_tf40_2s1b, "with ME1", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track: p_{T}^{TF}>=40 and 2+ stubs"); + leg->AddEntry(h_eff_tf40_2s, "anywhere", "l"); + leg->AddEntry(h_eff_tf40_2s1b, "with ME1", "l"); + leg->Draw(); -c2s_pt40_def->Print(plotDir + "eff_2s_pt40_def" + ext); + c2s_pt40_def->Print(plotDir + "eff_2s_pt40_def" + ext); -h_eff_tf40_gpt40_2s1b->Draw("hist same"); -leg->AddEntry(h_eff_tf40_gpt40_2s1b, "with (ME1 + GEM)", "l"); -c2s_pt40_def->Print(plotDir + "eff_2s_pt40_gem" + ext); + h_eff_tf40_gpt40_2s1b->Draw("hist same"); + leg->AddEntry(h_eff_tf40_gpt40_2s1b, "with (ME1 + GEM)", "l"); + c2s_pt40_def->Print(plotDir + "eff_2s_pt40_gem" + ext); -TCanvas* c3s_pt40_def = new TCanvas("c3s_pt40_def","c3s_pt40_def",800,600); + TCanvas* c3s_pt40_def = new TCanvas("c3s_pt40_def","c3s_pt40_def",800,600); -h_eff_tf40_3s->Draw("hist"); -h_eff_tf40_3s1b->Draw("hist same"); + h_eff_tf40_3s->Draw("hist"); + h_eff_tf40_3s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("TF track: p_{T}^{TF}>=40 and 3+ stubs"); -leg->AddEntry(h_eff_tf40_3s, "anywhere", "l"); -leg->AddEntry(h_eff_tf40_3s1b, "with ME1", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("TF track: p_{T}^{TF}>=40 and 3+ stubs"); + leg->AddEntry(h_eff_tf40_3s, "anywhere", "l"); + leg->AddEntry(h_eff_tf40_3s1b, "with ME1", "l"); + leg->Draw(); -c3s_pt40_def->Print(plotDir + "eff_3s_pt40_def" + ext); + c3s_pt40_def->Print(plotDir + "eff_3s_pt40_def" + ext); -h_eff_tf40_gpt40_3s1b->Draw("hist same"); -leg->AddEntry(h_eff_tf40_gpt40_3s1b, "with (ME1 + GEM)", "l"); -c3s_pt40_def->Print(plotDir + "eff_3s_pt40_gem" + ext); + h_eff_tf40_gpt40_3s1b->Draw("hist same"); + leg->AddEntry(h_eff_tf40_gpt40_3s1b, "with (ME1 + GEM)", "l"); + c3s_pt40_def->Print(plotDir + "eff_3s_pt40_gem" + ext); -//return; + //return; -h_eff_tf10_gpt10_3s1b->SetLineColor(kBlue); -h_eff_tf10_gpt15_3s1b->SetLineColor(kMagenta); -h_eff_tf20_gpt20_3s1b->SetLineColor(kBlue+2); -h_eff_tf20_gpt30_3s1b->SetLineColor(kMagenta+2); -h_eff_tf30_gpt30_3s1b->SetLineColor(kBlue+4); -h_eff_tf30_gpt40_3s1b->SetLineColor(kMagenta+4); + h_eff_tf10_gpt10_3s1b->SetLineColor(kBlue); + h_eff_tf10_gpt15_3s1b->SetLineColor(kMagenta); + h_eff_tf20_gpt20_3s1b->SetLineColor(kBlue+2); + h_eff_tf20_gpt30_3s1b->SetLineColor(kMagenta+2); + h_eff_tf30_gpt30_3s1b->SetLineColor(kBlue+4); + h_eff_tf30_gpt40_3s1b->SetLineColor(kMagenta+4); -TCanvas* c3s_tight = new TCanvas("c3s_tight","c3s_tight",800,600); + TCanvas* c3s_tight = new TCanvas("c3s_tight","c3s_tight",800,600); -h_eff_tf10_gpt10_3s1b->Draw("hist"); -h_eff_tf10_gpt15_3s1b->Draw("hist same"); + h_eff_tf10_gpt10_3s1b->Draw("hist"); + h_eff_tf10_gpt15_3s1b->Draw("hist same"); -//h_eff_tf15_gpt15_3s1b->Draw("hist same"); -//h_eff_tf15_gpt20_3s1b->Draw("hist same"); + //h_eff_tf15_gpt15_3s1b->Draw("hist same"); + //h_eff_tf15_gpt20_3s1b->Draw("hist same"); -h_eff_tf20_gpt20_3s1b->Draw("hist same"); -h_eff_tf20_gpt30_3s1b->Draw("hist same"); + h_eff_tf20_gpt20_3s1b->Draw("hist same"); + h_eff_tf20_gpt30_3s1b->Draw("hist same"); -h_eff_tf30_gpt30_3s1b->Draw("hist same"); -h_eff_tf30_gpt40_3s1b->Draw("hist same"); + h_eff_tf30_gpt30_3s1b->Draw("hist same"); + h_eff_tf30_gpt40_3s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetNColumns(2); -leg->SetHeader("TF track: 3+ stubs with ME1"); -leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T}^{TF} cut and", ""); -leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T}^{TF} cut and", ""); -leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T} for #Delta#phi(GEM,LCT)", ""); -leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T} for #Delta#phi(GEM,LCT)", ""); -leg->AddEntry(h_eff_tf10_gpt10_3s1b, "#geq10 and 10", "l"); -leg->AddEntry(h_eff_tf10_gpt15_3s1b, "#geq10 and 15", "l"); -leg->AddEntry(h_eff_tf20_gpt20_3s1b, "#geq20 and 20", "l"); -leg->AddEntry(h_eff_tf20_gpt30_3s1b, "#geq20 and 30", "l"); -leg->AddEntry(h_eff_tf30_gpt30_3s1b, "#geq30 and 30", "l"); -leg->AddEntry(h_eff_tf30_gpt40_3s1b, "#geq30 and 40", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetNColumns(2); + leg->SetHeader("TF track: 3+ stubs with ME1"); + leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T}^{TF} cut and", ""); + leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T}^{TF} cut and", ""); + leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T} for #Delta#phi(GEM,LCT)", ""); + leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T} for #Delta#phi(GEM,LCT)", ""); + leg->AddEntry(h_eff_tf10_gpt10_3s1b, "#geq10 and 10", "l"); + leg->AddEntry(h_eff_tf10_gpt15_3s1b, "#geq10 and 15", "l"); + leg->AddEntry(h_eff_tf20_gpt20_3s1b, "#geq20 and 20", "l"); + leg->AddEntry(h_eff_tf20_gpt30_3s1b, "#geq20 and 30", "l"); + leg->AddEntry(h_eff_tf30_gpt30_3s1b, "#geq30 and 30", "l"); + leg->AddEntry(h_eff_tf30_gpt40_3s1b, "#geq30 and 40", "l"); + leg->Draw(); -c3s_tight->Print(plotDir + "eff_3s_gemtight" + ext); + c3s_tight->Print(plotDir + "eff_3s_gemtight" + ext); -h_eff_tf10_gpt10_3s1b->SetLineColor(kBlue); -h_eff_tf10_gpt20_3s1b->SetLineColor(kMagenta); -h_eff_tf15_gpt15_3s1b->SetLineColor(kBlue+2); -h_eff_tf15_gpt30_3s1b->SetLineColor(kMagenta+2); -h_eff_tf20_gpt20_3s1b->SetLineColor(kBlue+4); -h_eff_tf20_gpt40_3s1b->SetLineColor(kMagenta+4); + h_eff_tf10_gpt10_3s1b->SetLineColor(kBlue); + h_eff_tf10_gpt20_3s1b->SetLineColor(kMagenta); + h_eff_tf15_gpt15_3s1b->SetLineColor(kBlue+2); + h_eff_tf15_gpt30_3s1b->SetLineColor(kMagenta+2); + h_eff_tf20_gpt20_3s1b->SetLineColor(kBlue+4); + h_eff_tf20_gpt40_3s1b->SetLineColor(kMagenta+4); -TCanvas* c3s_tight = new TCanvas("c3s_tight","c3s_tight",800,600); + TCanvas* c3s_tight = new TCanvas("c3s_tight","c3s_tight",800,600); -h_eff_tf10_gpt10_3s1b->Draw("hist"); -h_eff_tf10_gpt20_3s1b->Draw("hist same"); + h_eff_tf10_gpt10_3s1b->Draw("hist"); + h_eff_tf10_gpt20_3s1b->Draw("hist same"); -h_eff_tf15_gpt15_3s1b->Draw("hist same"); -h_eff_tf15_gpt30_3s1b->Draw("hist same"); + h_eff_tf15_gpt15_3s1b->Draw("hist same"); + h_eff_tf15_gpt30_3s1b->Draw("hist same"); -h_eff_tf20_gpt20_3s1b->Draw("hist same"); -h_eff_tf20_gpt40_3s1b->Draw("hist same"); + h_eff_tf20_gpt20_3s1b->Draw("hist same"); + h_eff_tf20_gpt40_3s1b->Draw("hist same"); -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetNColumns(2); -leg->SetHeader("TF track: 3+ stubs with ME1"); -leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T}^{TF} cut and", ""); -leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T}^{TF} cut and", ""); -leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T} for #Delta#phi(GEM,LCT)", ""); -leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T} for #Delta#phi(GEM,LCT)", ""); -leg->AddEntry(h_eff_tf10_gpt10_3s1b, "#geq10 and 10", "l"); -leg->AddEntry(h_eff_tf10_gpt20_3s1b, "#geq10 and 20", "l"); -leg->AddEntry(h_eff_tf15_gpt15_3s1b, "#geq15 and 15", "l"); -leg->AddEntry(h_eff_tf15_gpt30_3s1b, "#geq15 and 30", "l"); -leg->AddEntry(h_eff_tf20_gpt20_3s1b, "#geq20 and 20", "l"); -leg->AddEntry(h_eff_tf20_gpt40_3s1b, "#geq20 and 40", "l"); -leg->Draw(); + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetNColumns(2); + leg->SetHeader("TF track: 3+ stubs with ME1"); + leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T}^{TF} cut and", ""); + leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T}^{TF} cut and", ""); + leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T} for #Delta#phi(GEM,LCT)", ""); + leg->AddEntry(h_eff_tf10_gpt10_3s1b, "p_{T} for #Delta#phi(GEM,LCT)", ""); + leg->AddEntry(h_eff_tf10_gpt10_3s1b, "#geq10 and 10", "l"); + leg->AddEntry(h_eff_tf10_gpt20_3s1b, "#geq10 and 20", "l"); + leg->AddEntry(h_eff_tf15_gpt15_3s1b, "#geq15 and 15", "l"); + leg->AddEntry(h_eff_tf15_gpt30_3s1b, "#geq15 and 30", "l"); + leg->AddEntry(h_eff_tf20_gpt20_3s1b, "#geq20 and 20", "l"); + leg->AddEntry(h_eff_tf20_gpt40_3s1b, "#geq20 and 40", "l"); + leg->Draw(); -c3s_tight->Print(plotDir + "eff_3s_gemtightX" + ext); + c3s_tight->Print(plotDir + "eff_3s_gemtightX" + ext); } @@ -725,217 +705,217 @@ c3s_tight->Print(plotDir + "eff_3s_gemtightX" + ext); void gem_eff_draw_gem1b() { -gStyle->SetOptStat(0); -gStyle->SetTitleStyle(0); - -int ptreb=2; - -TString hdir = "SimMuL1StrictAll"; - -//TString f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_def_pat2.root"; -TString f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem_dphi0_pat2.root"; - -double rpt[2] = {0.,49.99}; - - - -TString hini = "h_pt_initial_gem_1b"; -TString hini_g = "h_pt_gem_1b"; -TString hini_gl = "h_pt_lctgem_1b"; - -TString h2g_00 = "h_pt_after_tfcand_gem1b_2s1b"; -TString h2g_00_123 = "h_pt_after_tfcand_gem1b_2s123"; -TString h2g_00_13 = "h_pt_after_tfcand_gem1b_2s13"; -TString h3g_00 = "h_pt_after_tfcand_gem1b_3s1b"; -TString h2p_00 = "h_pt_after_tfcand_dphigem1b_2s1b"; -TString h2p_00_123 = "h_pt_after_tfcand_dphigem1b_2s123"; -TString h2p_00_13 = "h_pt_after_tfcand_dphigem1b_2s13"; -TString h3p_00 = "h_pt_after_tfcand_dphigem1b_3s1b"; - -TString h2g_15 = "h_pt_after_tfcand_gem1b_2s1b_pt15"; -TString h2g_15_123 = "h_pt_after_tfcand_gem1b_2s123_pt15"; -TString h2g_15_13 = "h_pt_after_tfcand_gem1b_2s13_pt15"; -TString h3g_15 = "h_pt_after_tfcand_gem1b_3s1b_pt15"; -TString h2p_15 = "h_pt_after_tfcand_dphigem1b_2s1b_pt15"; -TString h2p_15_123 = "h_pt_after_tfcand_dphigem1b_2s123_pt15"; -TString h2p_15_13 = "h_pt_after_tfcand_dphigem1b_2s13_pt15"; -TString h3p_15 = "h_pt_after_tfcand_dphigem1b_3s1b_pt15"; - -TString h2g_20 = "h_pt_after_tfcand_gem1b_2s1b_pt20"; -TString h2g_20_123 = "h_pt_after_tfcand_gem1b_2s123_pt20"; -TString h2g_20_13 = "h_pt_after_tfcand_gem1b_2s13_pt20"; -TString h3g_20 = "h_pt_after_tfcand_gem1b_3s1b_pt20"; -TString h2p_20 = "h_pt_after_tfcand_dphigem1b_2s1b_pt20"; -TString h2p_20_123 = "h_pt_after_tfcand_dphigem1b_2s123_pt20"; -TString h2p_20_13 = "h_pt_after_tfcand_dphigem1b_2s13_pt20"; -TString h3p_20 = "h_pt_after_tfcand_dphigem1b_3s1b_pt20"; - -TString h2g_30 = "h_pt_after_tfcand_gem1b_2s1b_pt30"; -TString h2g_30_123 = "h_pt_after_tfcand_gem1b_2s123_pt30"; -TString h2g_30_13 = "h_pt_after_tfcand_gem1b_2s13_pt30"; -TString h3g_30 = "h_pt_after_tfcand_gem1b_3s1b_pt30"; -TString h2p_30 = "h_pt_after_tfcand_dphigem1b_2s1b_pt30"; -TString h2p_30_123 = "h_pt_after_tfcand_dphigem1b_2s123_pt30"; -TString h2p_30_13 = "h_pt_after_tfcand_dphigem1b_2s13_pt30"; -TString h3p_30 = "h_pt_after_tfcand_dphigem1b_3s1b_pt30"; - - -TCanvas* c2 = new TCanvas("c2","c2",800,600) ; -gPad->SetGridx(1); -gPad->SetGridy(1); - - -TString htitle = "Efficiency for #mu (GEM) in 1.64<|#eta|<2.05 to have TF track with ME1/b stub;p_{T}^{MC}"; - -hel = getEffHisto(f_def, hdir, hini_gl, hini_g, ptreb, kBlack, 1, 2, htitle, rpt, yrange07); -hel->Draw("hist"); -het2 = getEffHisto(f_def, hdir, h2g_00, hini_g, ptreb, kGreen+2, 1, 2, htitle, rpt, yrange07); -het2->Draw("same hist"); -het3 = getEffHisto(f_def, hdir, h3g_00, hini_g, ptreb, kGreen+2, 2, 2, htitle, rpt, yrange07); -het3->Draw("same hist"); -het2pt20 = getEffHisto(f_def, hdir, h2g_20, hini_g, ptreb, kBlue, 1, 2, htitle, rpt, yrange07); -het2pt20->Draw("same hist"); -het3pt20 = getEffHisto(f_def, hdir, h3g_20, hini_g, ptreb, kBlue, 2, 2, htitle, rpt, yrange07); -het3pt20->Draw("same hist"); - -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetNColumns(2); -//leg->SetHeader("TF track: 3+ stubs with ME1"); -leg->AddEntry(hel, "ME1/b LCT stub", "l"); -leg->AddEntry(hel, " ", ""); -leg->AddEntry(het2, "any p_{T}^{TF}, 2+ stubs", "l"); -leg->AddEntry(het2pt20, "p_{T}^{TF}#geq20, 2+ stubs", "l"); -leg->AddEntry(het3, "any p_{T}^{TF}, 3+ stubs", "l"); -leg->AddEntry(het3pt20, "p_{T}^{TF}#geq20, 3+ stubs", "l"); -leg->Draw(); - -c2->Print(plotDir + "eff_gem1b_basegem" + ext); - - - -TString htitle = "Efficiency for #mu (GEM+LCT) in 1.64<|#eta|<2.05 to have TF track with ME1/b stub;p_{T}^{MC}"; - -helt2pt20 = getEffHisto(f_def, hdir, h2g_20, hini_gl, ptreb, kMagenta-3, 1, 2, htitle, rpt, yrange07); -helt2pt20->Draw("hist"); -helt3pt20 = getEffHisto(f_def, hdir, h3g_20, hini_gl, ptreb, kMagenta-3, 2, 2, htitle, rpt, yrange07); -helt3pt20->Draw("same hist"); -het2pt20->Draw("same hist"); -het3pt20->Draw("same hist"); - -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetNColumns(2); -leg->SetHeader("TF track p_{T}^{TF}#geq20 with ME1"); -leg->AddEntry(het2pt20, "GEM baseline", ""); -leg->AddEntry(helt2pt20, "GEM+LCT baseline", ""); -leg->AddEntry(het2pt20, "2+ stubs", "l"); -leg->AddEntry(helt2pt20, "2+ stubs", "l"); -leg->AddEntry(het3pt20, "3+ stubs", "l"); -leg->AddEntry(helt3pt20, "3+ stubs", "l"); -leg->Draw(); -c2->Print(plotDir + "eff_gem1b_baselctgem" + ext); - -//return; - -TString htitle = "Efficiency for #mu (GEM) in 1.64<|#eta|<2.05 to have TF track with ME1/b stub;p_{T}^{MC}"; - -het2pt20->Draw("hist"); -het3pt20->Draw("same hist"); -het2pt20p = getEffHisto(f_def, hdir, h2p_20, hini_g, ptreb, kGray+2, 1, 2, htitle, rpt, yrange07); -het2pt20p->Draw("same hist"); -het3pt20p = getEffHisto(f_def, hdir, h3p_20, hini_g, ptreb, kGray+2, 2, 2, htitle, rpt, yrange07); -het3pt20p->Draw("same hist"); - -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetNColumns(2); -leg->SetHeader("TF track p_{T}^{TF}#geq20 with ME1"); -leg->AddEntry(het2pt20, "no GEM #Delta#phi", ""); -leg->AddEntry(het2pt20p, "with GEM #Delta#phi", "l"); -leg->AddEntry(het2pt20, "2+ stubs", "l"); -leg->AddEntry(het2pt20p, "2+ stubs", "l"); -leg->AddEntry(het3pt20, "3+ stubs", "l"); -leg->AddEntry(het3pt20p, "3+ stubs", "l"); -leg->Draw(); -c2->Print(plotDir + "eff_gem1b_basegem_dphi" + ext); - - -htitle = "Efficiency for #mu (GEM+LCT) in 1.64<|#eta|<2.05 to have TF track with ME1/b stub;p_{T}^{MC}"; - -helt2pt20->Draw("hist"); -helt3pt20->Draw("same hist"); -helt2pt20p = getEffHisto(f_def, hdir, h2p_20, hini_gl, ptreb, kGray+2, 1, 2, htitle, rpt, yrange07); -helt2pt20p->Draw("same hist"); -helt3pt20p = getEffHisto(f_def, hdir, h3p_20, hini_gl, ptreb, kGray+2, 2, 2, htitle, rpt, yrange07); -helt3pt20p->Draw("same hist"); - -TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetNColumns(2); -leg->SetHeader("TF track p_{T}^{TF}#geq20 with ME1"); -leg->AddEntry(helt2pt20, "no GEM #Delta#phi", ""); -leg->AddEntry(helt2pt20p, "with GEM #Delta#phi", "l"); -leg->AddEntry(helt2pt20, "2+ stubs", "l"); -leg->AddEntry(helt2pt20p, "2+ stubs", "l"); -leg->AddEntry(helt3pt20, "3+ stubs", "l"); -leg->AddEntry(helt3pt20p, "3+ stubs", "l"); -leg->Draw(); -c2->Print(plotDir + "eff_gem1b_baselpcgem_dphi" + ext); - - -helt2pt20->Draw("hist"); -helt3pt20->Draw("same hist"); -helt2pt20_123 = getEffHisto(f_def, hdir, h2g_20_123, hini_gl, ptreb, kMagenta-3, 9, 2, htitle, rpt, yrange07); -helt2pt20_123->Draw("same hist"); -helt3pt20_13 = getEffHisto(f_def, hdir, h2g_20_13, hini_gl, ptreb, kMagenta-3, 7, 2, htitle, rpt, yrange07); -helt3pt20_13->Draw("same hist"); - -TLegend *leg = new TLegend(0.5,0.17,.999,0.55, NULL, "brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -//leg->SetNColumns(2); -leg->SetHeader("TF track p_{T}^{TF}#geq20 with ME1"); -//leg->AddEntry(helt2pt20, "no GEM #Delta#phi", ""); -//leg->AddEntry(helt2pt20p, "with GEM #Delta#phi", ""); -leg->AddEntry(helt2pt20, "2+ stubs", "l"); -leg->AddEntry(helt2pt20_123, "2+ stubs (no ME1-4 tracks)", "l"); -leg->AddEntry(helt3pt20_13, "2+ stubs (no ME1-2 and ME1-4)", "l"); -leg->AddEntry(helt3pt20, "3+ stubs", "l"); -leg->Draw(); -c2->Print(plotDir + "eff_gem1b_baselpcgem_123" + ext); - -return; - -hegl = getEffHisto(f_def, hdir, hgl, hini, ptreb, kRed, 1, 2, htitle, rpt, yrange); -hegl->Draw("same hist") -heg = getEffHisto(f_def, hdir, hg, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); -heg->Draw("same hist") - - - - -TString hini = "h_pt_initial_1b"; -TString h2s = "h_pt_after_tfcand_eta1b_2s"; -TString h3s = "h_pt_after_tfcand_eta1b_3s"; -TString h2s1b = "h_pt_after_tfcand_eta1b_2s1b"; -TString h3s1b = "h_pt_after_tfcand_eta1b_3s1b"; - - -TH1D* h_eff_tf0_2s = getEffHisto(f_def, hdir, h2s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_tf0_3s = getEffHisto(f_def, hdir, h3s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_tf0_2s1b = getEffHisto(f_def, hdir, h2s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); -TH1D* h_eff_tf0_3s1b = getEffHisto(f_def, hdir, h3s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); - - -TH1D* h_eff_tf10_2s = getEffHisto(f_def, hdir, h2s + "_pt10", hini, ptreb, kGreen+4, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_3s = getEffHisto(f_def, hdir, h3s + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); -TH1D* h_eff_tf10_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); + gStyle->SetOptStat(0); + gStyle->SetTitleStyle(0); + + int ptreb=2; + + TString hdir = "SimMuL1StrictAll"; + + //TString f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_def_pat2.root"; + TString f_def = filesDir + "hp_dimu_6_0_1_POSTLS161_V12__pu000_w3_gem_dphi0_pat2.root"; + + double rpt[2] = {0.,49.99}; + + + + TString hini = "h_pt_initial_gem_1b"; + TString hini_g = "h_pt_gem_1b"; + TString hini_gl = "h_pt_lctgem_1b"; + + TString h2g_00 = "h_pt_after_tfcand_gem1b_2s1b"; + TString h2g_00_123 = "h_pt_after_tfcand_gem1b_2s123"; + TString h2g_00_13 = "h_pt_after_tfcand_gem1b_2s13"; + TString h3g_00 = "h_pt_after_tfcand_gem1b_3s1b"; + TString h2p_00 = "h_pt_after_tfcand_dphigem1b_2s1b"; + TString h2p_00_123 = "h_pt_after_tfcand_dphigem1b_2s123"; + TString h2p_00_13 = "h_pt_after_tfcand_dphigem1b_2s13"; + TString h3p_00 = "h_pt_after_tfcand_dphigem1b_3s1b"; + + TString h2g_15 = "h_pt_after_tfcand_gem1b_2s1b_pt15"; + TString h2g_15_123 = "h_pt_after_tfcand_gem1b_2s123_pt15"; + TString h2g_15_13 = "h_pt_after_tfcand_gem1b_2s13_pt15"; + TString h3g_15 = "h_pt_after_tfcand_gem1b_3s1b_pt15"; + TString h2p_15 = "h_pt_after_tfcand_dphigem1b_2s1b_pt15"; + TString h2p_15_123 = "h_pt_after_tfcand_dphigem1b_2s123_pt15"; + TString h2p_15_13 = "h_pt_after_tfcand_dphigem1b_2s13_pt15"; + TString h3p_15 = "h_pt_after_tfcand_dphigem1b_3s1b_pt15"; + + TString h2g_20 = "h_pt_after_tfcand_gem1b_2s1b_pt20"; + TString h2g_20_123 = "h_pt_after_tfcand_gem1b_2s123_pt20"; + TString h2g_20_13 = "h_pt_after_tfcand_gem1b_2s13_pt20"; + TString h3g_20 = "h_pt_after_tfcand_gem1b_3s1b_pt20"; + TString h2p_20 = "h_pt_after_tfcand_dphigem1b_2s1b_pt20"; + TString h2p_20_123 = "h_pt_after_tfcand_dphigem1b_2s123_pt20"; + TString h2p_20_13 = "h_pt_after_tfcand_dphigem1b_2s13_pt20"; + TString h3p_20 = "h_pt_after_tfcand_dphigem1b_3s1b_pt20"; + + TString h2g_30 = "h_pt_after_tfcand_gem1b_2s1b_pt30"; + TString h2g_30_123 = "h_pt_after_tfcand_gem1b_2s123_pt30"; + TString h2g_30_13 = "h_pt_after_tfcand_gem1b_2s13_pt30"; + TString h3g_30 = "h_pt_after_tfcand_gem1b_3s1b_pt30"; + TString h2p_30 = "h_pt_after_tfcand_dphigem1b_2s1b_pt30"; + TString h2p_30_123 = "h_pt_after_tfcand_dphigem1b_2s123_pt30"; + TString h2p_30_13 = "h_pt_after_tfcand_dphigem1b_2s13_pt30"; + TString h3p_30 = "h_pt_after_tfcand_dphigem1b_3s1b_pt30"; + + + TCanvas* c2 = new TCanvas("c2","c2",800,600) ; + gPad->SetGridx(1); + gPad->SetGridy(1); + + + TString htitle = "Efficiency for #mu (GEM) in 1.64<|#eta|<2.05 to have TF track with ME1/b stub;p_{T}^{MC}"; + + hel = getEffHisto(f_def, hdir, hini_gl, hini_g, ptreb, kBlack, 1, 2, htitle, rpt, yrange07); + hel->Draw("hist"); + het2 = getEffHisto(f_def, hdir, h2g_00, hini_g, ptreb, kGreen+2, 1, 2, htitle, rpt, yrange07); + het2->Draw("same hist"); + het3 = getEffHisto(f_def, hdir, h3g_00, hini_g, ptreb, kGreen+2, 2, 2, htitle, rpt, yrange07); + het3->Draw("same hist"); + het2pt20 = getEffHisto(f_def, hdir, h2g_20, hini_g, ptreb, kBlue, 1, 2, htitle, rpt, yrange07); + het2pt20->Draw("same hist"); + het3pt20 = getEffHisto(f_def, hdir, h3g_20, hini_g, ptreb, kBlue, 2, 2, htitle, rpt, yrange07); + het3pt20->Draw("same hist"); + + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetNColumns(2); + //leg->SetHeader("TF track: 3+ stubs with ME1"); + leg->AddEntry(hel, "ME1/b LCT stub", "l"); + leg->AddEntry(hel, " ", ""); + leg->AddEntry(het2, "any p_{T}^{TF}, 2+ stubs", "l"); + leg->AddEntry(het2pt20, "p_{T}^{TF}#geq20, 2+ stubs", "l"); + leg->AddEntry(het3, "any p_{T}^{TF}, 3+ stubs", "l"); + leg->AddEntry(het3pt20, "p_{T}^{TF}#geq20, 3+ stubs", "l"); + leg->Draw(); + + c2->Print(plotDir + "eff_gem1b_basegem" + ext); + + + + TString htitle = "Efficiency for #mu (GEM+LCT) in 1.64<|#eta|<2.05 to have TF track with ME1/b stub;p_{T}^{MC}"; + + helt2pt20 = getEffHisto(f_def, hdir, h2g_20, hini_gl, ptreb, kMagenta-3, 1, 2, htitle, rpt, yrange07); + helt2pt20->Draw("hist"); + helt3pt20 = getEffHisto(f_def, hdir, h3g_20, hini_gl, ptreb, kMagenta-3, 2, 2, htitle, rpt, yrange07); + helt3pt20->Draw("same hist"); + het2pt20->Draw("same hist"); + het3pt20->Draw("same hist"); + + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetNColumns(2); + leg->SetHeader("TF track p_{T}^{TF}#geq20 with ME1"); + leg->AddEntry(het2pt20, "GEM baseline", ""); + leg->AddEntry(helt2pt20, "GEM+LCT baseline", ""); + leg->AddEntry(het2pt20, "2+ stubs", "l"); + leg->AddEntry(helt2pt20, "2+ stubs", "l"); + leg->AddEntry(het3pt20, "3+ stubs", "l"); + leg->AddEntry(helt3pt20, "3+ stubs", "l"); + leg->Draw(); + c2->Print(plotDir + "eff_gem1b_baselctgem" + ext); + + //return; + + TString htitle = "Efficiency for #mu (GEM) in 1.64<|#eta|<2.05 to have TF track with ME1/b stub;p_{T}^{MC}"; + + het2pt20->Draw("hist"); + het3pt20->Draw("same hist"); + het2pt20p = getEffHisto(f_def, hdir, h2p_20, hini_g, ptreb, kGray+2, 1, 2, htitle, rpt, yrange07); + het2pt20p->Draw("same hist"); + het3pt20p = getEffHisto(f_def, hdir, h3p_20, hini_g, ptreb, kGray+2, 2, 2, htitle, rpt, yrange07); + het3pt20p->Draw("same hist"); + + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetNColumns(2); + leg->SetHeader("TF track p_{T}^{TF}#geq20 with ME1"); + leg->AddEntry(het2pt20, "no GEM #Delta#phi", ""); + leg->AddEntry(het2pt20p, "with GEM #Delta#phi", "l"); + leg->AddEntry(het2pt20, "2+ stubs", "l"); + leg->AddEntry(het2pt20p, "2+ stubs", "l"); + leg->AddEntry(het3pt20, "3+ stubs", "l"); + leg->AddEntry(het3pt20p, "3+ stubs", "l"); + leg->Draw(); + c2->Print(plotDir + "eff_gem1b_basegem_dphi" + ext); + + + htitle = "Efficiency for #mu (GEM+LCT) in 1.64<|#eta|<2.05 to have TF track with ME1/b stub;p_{T}^{MC}"; + + helt2pt20->Draw("hist"); + helt3pt20->Draw("same hist"); + helt2pt20p = getEffHisto(f_def, hdir, h2p_20, hini_gl, ptreb, kGray+2, 1, 2, htitle, rpt, yrange07); + helt2pt20p->Draw("same hist"); + helt3pt20p = getEffHisto(f_def, hdir, h3p_20, hini_gl, ptreb, kGray+2, 2, 2, htitle, rpt, yrange07); + helt3pt20p->Draw("same hist"); + + TLegend *leg = new TLegend(0.55,0.17,.999,0.57, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetNColumns(2); + leg->SetHeader("TF track p_{T}^{TF}#geq20 with ME1"); + leg->AddEntry(helt2pt20, "no GEM #Delta#phi", ""); + leg->AddEntry(helt2pt20p, "with GEM #Delta#phi", "l"); + leg->AddEntry(helt2pt20, "2+ stubs", "l"); + leg->AddEntry(helt2pt20p, "2+ stubs", "l"); + leg->AddEntry(helt3pt20, "3+ stubs", "l"); + leg->AddEntry(helt3pt20p, "3+ stubs", "l"); + leg->Draw(); + c2->Print(plotDir + "eff_gem1b_baselpcgem_dphi" + ext); + + + helt2pt20->Draw("hist"); + helt3pt20->Draw("same hist"); + helt2pt20_123 = getEffHisto(f_def, hdir, h2g_20_123, hini_gl, ptreb, kMagenta-3, 9, 2, htitle, rpt, yrange07); + helt2pt20_123->Draw("same hist"); + helt3pt20_13 = getEffHisto(f_def, hdir, h2g_20_13, hini_gl, ptreb, kMagenta-3, 7, 2, htitle, rpt, yrange07); + helt3pt20_13->Draw("same hist"); + + TLegend *leg = new TLegend(0.5,0.17,.999,0.55, NULL, "brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + //leg->SetNColumns(2); + leg->SetHeader("TF track p_{T}^{TF}#geq20 with ME1"); + //leg->AddEntry(helt2pt20, "no GEM #Delta#phi", ""); + //leg->AddEntry(helt2pt20p, "with GEM #Delta#phi", ""); + leg->AddEntry(helt2pt20, "2+ stubs", "l"); + leg->AddEntry(helt2pt20_123, "2+ stubs (no ME1-4 tracks)", "l"); + leg->AddEntry(helt3pt20_13, "2+ stubs (no ME1-2 and ME1-4)", "l"); + leg->AddEntry(helt3pt20, "3+ stubs", "l"); + leg->Draw(); + c2->Print(plotDir + "eff_gem1b_baselpcgem_123" + ext); + + return; + + hegl = getEffHisto(f_def, hdir, hgl, hini, ptreb, kRed, 1, 2, htitle, rpt, yrange); + hegl->Draw("same hist") + heg = getEffHisto(f_def, hdir, hg, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + heg->Draw("same hist") + + + + + TString hini = "h_pt_initial_1b"; + TString h2s = "h_pt_after_tfcand_eta1b_2s"; + TString h3s = "h_pt_after_tfcand_eta1b_3s"; + TString h2s1b = "h_pt_after_tfcand_eta1b_2s1b"; + TString h3s1b = "h_pt_after_tfcand_eta1b_3s1b"; + + + TH1D* h_eff_tf0_2s = getEffHisto(f_def, hdir, h2s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_tf0_3s = getEffHisto(f_def, hdir, h3s, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_tf0_2s1b = getEffHisto(f_def, hdir, h2s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + TH1D* h_eff_tf0_3s1b = getEffHisto(f_def, hdir, h3s1b, hini, ptreb, kBlack, 1, 2, htitle, rpt, yrange); + + + TH1D* h_eff_tf10_2s = getEffHisto(f_def, hdir, h2s + "_pt10", hini, ptreb, kGreen+4, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_2s1b = getEffHisto(f_def, hdir, h2s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_3s = getEffHisto(f_def, hdir, h3s + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); + TH1D* h_eff_tf10_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt10", hini, ptreb, kGreen+2, 1, 2, htitle, rpt,yrange); } @@ -944,675 +924,675 @@ TH1D* h_eff_tf10_3s1b = getEffHisto(f_def, hdir, h3s1b + "_pt10", hini, ptreb, -void drawplot_etastep(char *fname, char* pu, char *dname="tf") +void triggerEfficiencyVsPtPlots(char *fname, char* pu, char *dname="tf") { -// directory for plots is made as -// pdir = $PWD/pic[_{dname}]_{pu} + // directory for plots is made as + // pdir = $PWD/pic[_{dname}]_{pu} -//gStyle->SetStatW(0.13); -//gStyle->SetStatH(0.08); -gStyle->SetStatW(0.07); -gStyle->SetStatH(0.06); + //gStyle->SetStatW(0.13); + //gStyle->SetStatH(0.08); + gStyle->SetStatW(0.07); + gStyle->SetStatH(0.06); -gStyle->SetOptStat(0); + gStyle->SetOptStat(0); -gStyle->SetTitleStyle(0); + gStyle->SetTitleStyle(0); -char d1[111]="",d2[111]=""; -if (strcmp(dname,"")>0) sprintf(d1,"_%s",dname); -if (strcmp(pu,"")>0) sprintf(d2,"_%s",pu); -sprintf(pdir,"pic%s%s",d1,d2); + char d1[111]="",d2[111]=""; + if (strcmp(dname,"")>0) sprintf(d1,"_%s",dname); + if (strcmp(pu,"")>0) sprintf(d2,"_%s",pu); + sprintf(pdir,"pic%s%s",d1,d2); -if (interactive){ - if( gSystem->AccessPathName(pdir)==0 ) { - cout<<"directory "<Exec(cmd) != 0) {cout<<"can't remode directory! exiting..."<AccessPathName(pdir)==0 ) { + cout<<"directory "<Exec(cmd) != 0) {cout<<"can't remode directory! exiting..."<MakeDirectory(pdir); } - gSystem->MakeDirectory(pdir); -} -//TFile *f = TFile::Open("piluphisto.root"); + //TFile *f = TFile::Open("piluphisto.root"); -cout<<"opening "<Get("SimMuL1/;1"); + // = (TH1D*)f->Get("SimMuL1/;1"); -int etareb=1; -int ptreb=2; + int etareb=1; + int ptreb=2; -//TH1D* eff_eta_after_mpc_ok_plus = setEffHisto("h_eta_after_mpc_ok_plus","h_eta_initial",dir, etareb, kRed, 1,2, "asdasd","xxx","yyy",xrange,yrange); -//eff_eta_after_mpc_ok_plus ->Draw("hist"); + //TH1D* eff_eta_after_mpc_ok_plus = setEffHisto("h_eta_after_mpc_ok_plus","h_eta_initial",dir, etareb, kRed, 1,2, "asdasd","xxx","yyy",xrange,yrange); + //eff_eta_after_mpc_ok_plus ->Draw("hist"); -//################################################################################################ -if (interactive) { + //################################################################################################ + if (interactive) { -TCanvas* c_eff_eta_simh_by_st = new TCanvas("c_eff_eta_simh_by_st","c_eff_eta_simh_by_st",900,800 ) ; -c_eff_eta_simh_by_st->Divide(2,2,0.0001,0.0001); + TCanvas* c_eff_eta_simh_by_st = new TCanvas("c_eff_eta_simh_by_st","c_eff_eta_simh_by_st",900,800 ) ; + c_eff_eta_simh_by_st->Divide(2,2,0.0001,0.0001); -TH1D* h_eta_me1_initial = setEffHisto("h_eta_me1_initial","h_eta_initial0",dir, etareb, kBlue, 1, 2, "eff(#eta): SimHits#geq4 in ME1 (MC 20cd(1); -h_eta_me1_initial->Draw("hist"); -c_eff_eta_simh_by_st->cd(2); -h_eta_me2_initial->Draw("hist"); -c_eff_eta_simh_by_st->cd(3); -h_eta_me3_initial->Draw("hist"); -c_eff_eta_simh_by_st->cd(4); -h_eta_me4_initial->Draw("hist"); + c_eff_eta_simh_by_st->cd(1); + h_eta_me1_initial->Draw("hist"); + c_eff_eta_simh_by_st->cd(2); + h_eta_me2_initial->Draw("hist"); + c_eff_eta_simh_by_st->cd(3); + h_eta_me3_initial->Draw("hist"); + c_eff_eta_simh_by_st->cd(4); + h_eta_me4_initial->Draw("hist"); -Print(c_eff_eta_simh_by_st,"c_eff_eta_simh_by_st" + ext); + Print(c_eff_eta_simh_by_st,"c_eff_eta_simh_by_st" + ext); -TCanvas* c_eff_eta_simh_by_st = new TCanvas("c_eff_eta_mpc_by_st","c_eff_eta_mpc_by_st",900,800 ) ; -c_eff_eta_mpc_by_st->Divide(2,2,0.0001,0.0001); + TCanvas* c_eff_eta_simh_by_st = new TCanvas("c_eff_eta_mpc_by_st","c_eff_eta_mpc_by_st",900,800 ) ; + c_eff_eta_mpc_by_st->Divide(2,2,0.0001,0.0001); -TH1D* h_eta_me1_mpc = setEffHisto("h_eta_me1_mpc","h_eta_initial0",dir, etareb, kBlack, 1, 2, "","MC #eta","",xrange,yrange); -TH1D* h_eta_me2_mpc = setEffHisto("h_eta_me2_mpc","h_eta_initial0",dir, etareb, kBlack, 1, 2, "","MC #eta","",xrange,yrange); -TH1D* h_eta_me3_mpc = setEffHisto("h_eta_me3_mpc","h_eta_initial0",dir, etareb, kBlack, 1, 2, "","MC #eta","",xrange,yrange); -TH1D* h_eta_me4_mpc = setEffHisto("h_eta_me4_mpc","h_eta_initial0",dir, etareb, kBlack, 1, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_me1_mpc = setEffHisto("h_eta_me1_mpc","h_eta_initial0",dir, etareb, kBlack, 1, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_me2_mpc = setEffHisto("h_eta_me2_mpc","h_eta_initial0",dir, etareb, kBlack, 1, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_me3_mpc = setEffHisto("h_eta_me3_mpc","h_eta_initial0",dir, etareb, kBlack, 1, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_me4_mpc = setEffHisto("h_eta_me4_mpc","h_eta_initial0",dir, etareb, kBlack, 1, 2, "","MC #eta","",xrange,yrange); -h_eta_me1_initial->SetTitle("eff(#eta): matched MPC in ME1 (MC 20SetTitle("eff(#eta): matched MPC in ME2 (MC 20SetTitle("eff(#eta): matched MPC in ME3 (MC 20SetTitle("eff(#eta): matched MPC in ME4 (MC 20SetTitle("eff(#eta): matched MPC in ME1 (MC 20SetTitle("eff(#eta): matched MPC in ME2 (MC 20SetTitle("eff(#eta): matched MPC in ME3 (MC 20SetTitle("eff(#eta): matched MPC in ME4 (MC 20cd(1); -h_eta_me1_initial->Draw("hist"); -h_eta_me1_mpc->Draw("hist same"); -c_eff_eta_mpc_by_st->cd(2); -h_eta_me2_initial->Draw("hist"); -h_eta_me2_mpc->Draw("hist same"); -c_eff_eta_mpc_by_st->cd(3); -h_eta_me3_initial->Draw("hist"); -h_eta_me3_mpc->Draw("hist same"); -c_eff_eta_mpc_by_st->cd(4); -h_eta_me4_initial->Draw("hist"); -h_eta_me4_mpc->Draw("hist same"); + c_eff_eta_mpc_by_st->cd(1); + h_eta_me1_initial->Draw("hist"); + h_eta_me1_mpc->Draw("hist same"); + c_eff_eta_mpc_by_st->cd(2); + h_eta_me2_initial->Draw("hist"); + h_eta_me2_mpc->Draw("hist same"); + c_eff_eta_mpc_by_st->cd(3); + h_eta_me3_initial->Draw("hist"); + h_eta_me3_mpc->Draw("hist same"); + c_eff_eta_mpc_by_st->cd(4); + h_eta_me4_initial->Draw("hist"); + h_eta_me4_mpc->Draw("hist same"); -Print(c_eff_eta_mpc_by_st,"c_eff_eta_mpc_by_st" + ext); + Print(c_eff_eta_mpc_by_st,"c_eff_eta_mpc_by_st" + ext); -} -//################################################################################################ -if (interactive) { + } + //################################################################################################ + if (interactive) { -TCanvas* c_eff_eta_simh = new TCanvas("c_eff_eta_simh","c_eff_eta_simh",1000,600 ) ; + TCanvas* c_eff_eta_simh = new TCanvas("c_eff_eta_simh","c_eff_eta_simh",1000,600 ) ; -TH1D* h_eta_initial_1st = setEffHisto("h_eta_initial_1st","h_eta_initial0",dir, etareb, kBlue, 1, 2, "eff(#eta): SimHits#geq4 in #geqN CSC stations","MC #eta","",xrange,yrange); -TH1D* h_eta_initial_2st = setEffHisto("h_eta_initial_2st","h_eta_initial0",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange); -TH1D* h_eta_initial_3st = setEffHisto("h_eta_initial_3st","h_eta_initial0",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_initial_1st = setEffHisto("h_eta_initial_1st","h_eta_initial0",dir, etareb, kBlue, 1, 2, "eff(#eta): SimHits#geq4 in #geqN CSC stations","MC #eta","",xrange,yrange); + TH1D* h_eta_initial_2st = setEffHisto("h_eta_initial_2st","h_eta_initial0",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_initial_3st = setEffHisto("h_eta_initial_3st","h_eta_initial0",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange); -h_eta_initial_1st->Draw("hist"); -h_eta_initial_2st->Draw("hist same"); -h_eta_initial_3st->Draw("hist same"); + h_eta_initial_1st->Draw("hist"); + h_eta_initial_2st->Draw("hist same"); + h_eta_initial_3st->Draw("hist same"); -TLegend *l_eff_eta_simh = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); -l_eff_eta_simh->SetBorderSize(0); -l_eff_eta_simh->SetFillStyle(0); -l_eff_eta_simh->SetHeader("Efficiency for #mu with p_{T}>20 to leave #geq4 SimHits in"); -l_eff_eta_simh->AddEntry(h_eta_initial_1st,"#geq1 CSC stations","pl"); -l_eff_eta_simh->AddEntry(h_eta_initial_2st,"#geq2 CSC stations","pl"); -l_eff_eta_simh->AddEntry(h_eta_initial_3st,"#geq3 CSC stations","pl"); -l_eff_eta_simh->Draw(); + TLegend *l_eff_eta_simh = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); + l_eff_eta_simh->SetBorderSize(0); + l_eff_eta_simh->SetFillStyle(0); + l_eff_eta_simh->SetHeader("Efficiency for #mu with p_{T}>20 to leave #geq4 SimHits in"); + l_eff_eta_simh->AddEntry(h_eta_initial_1st,"#geq1 CSC stations","pl"); + l_eff_eta_simh->AddEntry(h_eta_initial_2st,"#geq2 CSC stations","pl"); + l_eff_eta_simh->AddEntry(h_eta_initial_3st,"#geq3 CSC stations","pl"); + l_eff_eta_simh->Draw(); -Print(c_eff_eta_simh,"c_eff_eta_simh" + ext); + Print(c_eff_eta_simh,"c_eff_eta_simh" + ext); -TCanvas* c_eff_eta_mpc = new TCanvas("c_eff_eta_mpc","c_eff_eta_mpc",1000,600 ) ; + TCanvas* c_eff_eta_mpc = new TCanvas("c_eff_eta_mpc","c_eff_eta_mpc",1000,600 ) ; -TH1D* h_eta_mpc_1st = setEffHisto("h_eta_mpc_1st","h_eta_initial0",dir, etareb, kBlue, 1, 2, "eff(#eta): matched MPC in #geqN CSC stations","MC #eta","",xrange,yrange); -TH1D* h_eta_mpc_2st = setEffHisto("h_eta_mpc_2st","h_eta_initial0",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange); -TH1D* h_eta_mpc_3st = setEffHisto("h_eta_mpc_3st","h_eta_initial0",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_mpc_1st = setEffHisto("h_eta_mpc_1st","h_eta_initial0",dir, etareb, kBlue, 1, 2, "eff(#eta): matched MPC in #geqN CSC stations","MC #eta","",xrange,yrange); + TH1D* h_eta_mpc_2st = setEffHisto("h_eta_mpc_2st","h_eta_initial0",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_mpc_3st = setEffHisto("h_eta_mpc_3st","h_eta_initial0",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange); -h_eta_mpc_1st->Draw("hist"); -h_eta_mpc_2st->Draw("hist same"); -h_eta_mpc_3st->Draw("hist same"); + h_eta_mpc_1st->Draw("hist"); + h_eta_mpc_2st->Draw("hist same"); + h_eta_mpc_3st->Draw("hist same"); -TLegend *l_eff_eta_mpc = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); -l_eff_eta_mpc->SetBorderSize(0); -l_eff_eta_mpc->SetFillStyle(0); -l_eff_eta_mpc->SetHeader("Efficiency for #mu with p_{T}>20 to have matched MPCs in"); -l_eff_eta_mpc->AddEntry(h_eta_mpc_1st,"#geq1 CSC stations","pl"); -l_eff_eta_mpc->AddEntry(h_eta_mpc_2st,"#geq2 CSC stations","pl"); -l_eff_eta_mpc->AddEntry(h_eta_mpc_3st,"#geq3 CSC stations","pl"); -l_eff_eta_mpc->Draw(); + TLegend *l_eff_eta_mpc = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); + l_eff_eta_mpc->SetBorderSize(0); + l_eff_eta_mpc->SetFillStyle(0); + l_eff_eta_mpc->SetHeader("Efficiency for #mu with p_{T}>20 to have matched MPCs in"); + l_eff_eta_mpc->AddEntry(h_eta_mpc_1st,"#geq1 CSC stations","pl"); + l_eff_eta_mpc->AddEntry(h_eta_mpc_2st,"#geq2 CSC stations","pl"); + l_eff_eta_mpc->AddEntry(h_eta_mpc_3st,"#geq3 CSC stations","pl"); + l_eff_eta_mpc->Draw(); -Print(c_eff_eta_mpc,"c_eff_eta_mpc" + ext); + Print(c_eff_eta_mpc,"c_eff_eta_mpc" + ext); -TCanvas* c_eff_eta_mpc_relative = new TCanvas("c_eff_eta_mpc_relative","c_eff_eta_mpc_relative",1000,600 ) ; + TCanvas* c_eff_eta_mpc_relative = new TCanvas("c_eff_eta_mpc_relative","c_eff_eta_mpc_relative",1000,600 ) ; -TH1D* h_eta_mpc_1st_r = setEffHisto("h_eta_mpc_1st","h_eta_initial_1st",dir, etareb, kBlue, 1, 2, "eff(#eta): matched MPC if SimHits#geq4 in #geqN CSC stations","MC #eta","",xrange,yrange); -TH1D* h_eta_mpc_2st_r = setEffHisto("h_eta_mpc_2st","h_eta_initial_2st",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange); -TH1D* h_eta_mpc_3st_r = setEffHisto("h_eta_mpc_3st","h_eta_initial_3st",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_mpc_1st_r = setEffHisto("h_eta_mpc_1st","h_eta_initial_1st",dir, etareb, kBlue, 1, 2, "eff(#eta): matched MPC if SimHits#geq4 in #geqN CSC stations","MC #eta","",xrange,yrange); + TH1D* h_eta_mpc_2st_r = setEffHisto("h_eta_mpc_2st","h_eta_initial_2st",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_mpc_3st_r = setEffHisto("h_eta_mpc_3st","h_eta_initial_3st",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange); -h_eta_mpc_1st_r->Draw("hist"); -h_eta_mpc_2st_r->Draw("hist same"); -h_eta_mpc_3st_r->Draw("hist same"); + h_eta_mpc_1st_r->Draw("hist"); + h_eta_mpc_2st_r->Draw("hist same"); + h_eta_mpc_3st_r->Draw("hist same"); -TLegend *l_eff_eta_mpc_relative = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); -l_eff_eta_mpc_relative->SetBorderSize(0); -l_eff_eta_mpc_relative->SetFillStyle(0); -l_eff_eta_mpc_relative->SetHeader("Efficiency for #mu with p_{T}>20 to have matched MPCs if it has SimHits#geq4 in"); -l_eff_eta_mpc_relative->AddEntry(h_eta_mpc_1st_r,"#geq1 CSC stations","pl"); -l_eff_eta_mpc_relative->AddEntry(h_eta_mpc_2st_r,"#geq2 CSC stations","pl"); -l_eff_eta_mpc_relative->AddEntry(h_eta_mpc_3st_r,"#geq3 CSC stations","pl"); -l_eff_eta_mpc_relative->Draw(); + TLegend *l_eff_eta_mpc_relative = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); + l_eff_eta_mpc_relative->SetBorderSize(0); + l_eff_eta_mpc_relative->SetFillStyle(0); + l_eff_eta_mpc_relative->SetHeader("Efficiency for #mu with p_{T}>20 to have matched MPCs if it has SimHits#geq4 in"); + l_eff_eta_mpc_relative->AddEntry(h_eta_mpc_1st_r,"#geq1 CSC stations","pl"); + l_eff_eta_mpc_relative->AddEntry(h_eta_mpc_2st_r,"#geq2 CSC stations","pl"); + l_eff_eta_mpc_relative->AddEntry(h_eta_mpc_3st_r,"#geq3 CSC stations","pl"); + l_eff_eta_mpc_relative->Draw(); -Print(c_eff_eta_mpc_relative,"c_eff_eta_mpc_relative" + ext); + Print(c_eff_eta_mpc_relative,"c_eff_eta_mpc_relative" + ext); -} + } -//################################################################################################ -if (interactive) { -TCanvas* c_eff_eta_simh_me1 = new TCanvas("c_eff_eta_simh_me1","c_eff_eta_simh_me1",1000,600 ) ; + //################################################################################################ + if (interactive) { + TCanvas* c_eff_eta_simh_me1 = new TCanvas("c_eff_eta_simh_me1","c_eff_eta_simh_me1",1000,600 ) ; -TH1D* h_eta_me1_initial_ = setEffHisto("h_eta_me1_initial","h_eta_initial0",dir, etareb, kBlue, 1, 2, "eff(#eta): SimHits#geq4 in ME1 plus more stations","MC #eta","",xrange,yrange); -TH1D* h_eta_me1_initial_2st = setEffHisto("h_eta_me1_initial_2st","h_eta_initial0",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange); -TH1D* h_eta_me1_initial_3st = setEffHisto("h_eta_me1_initial_3st","h_eta_initial0",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_me1_initial_ = setEffHisto("h_eta_me1_initial","h_eta_initial0",dir, etareb, kBlue, 1, 2, "eff(#eta): SimHits#geq4 in ME1 plus more stations","MC #eta","",xrange,yrange); + TH1D* h_eta_me1_initial_2st = setEffHisto("h_eta_me1_initial_2st","h_eta_initial0",dir, etareb, kBlue, 9, 2, "","MC #eta","",xrange,yrange); + TH1D* h_eta_me1_initial_3st = setEffHisto("h_eta_me1_initial_3st","h_eta_initial0",dir, etareb, kBlue, 2, 2, "","MC #eta","",xrange,yrange); -h_eta_me1_initial_->Draw("hist"); -h_eta_me1_initial_2st->Draw("hist same"); -h_eta_me1_initial_3st->Draw("hist same"); + h_eta_me1_initial_->Draw("hist"); + h_eta_me1_initial_2st->Draw("hist same"); + h_eta_me1_initial_3st->Draw("hist same"); -TLegend *l_eff_eta_simh_me1 = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); -l_eff_eta_simh_me1->SetBorderSize(0); -l_eff_eta_simh_me1->SetFillStyle(0); -l_eff_eta_simh_me1->SetHeader("Efficiency for #mu with p_{T}>20 to leave #geq4 SimHits in"); -l_eff_eta_simh_me1->AddEntry(h_eta_me1_initial_,"ME1","pl"); -l_eff_eta_simh_me1->AddEntry(h_eta_me1_initial_2st,"ME1 + #geq1 stations","pl"); -l_eff_eta_simh_me1->AddEntry(h_eta_me1_initial_3st,"ME1 + #geq2 stations","pl"); -l_eff_eta_simh_me1->Draw(); + TLegend *l_eff_eta_simh_me1 = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); + l_eff_eta_simh_me1->SetBorderSize(0); + l_eff_eta_simh_me1->SetFillStyle(0); + l_eff_eta_simh_me1->SetHeader("Efficiency for #mu with p_{T}>20 to leave #geq4 SimHits in"); + l_eff_eta_simh_me1->AddEntry(h_eta_me1_initial_,"ME1","pl"); + l_eff_eta_simh_me1->AddEntry(h_eta_me1_initial_2st,"ME1 + #geq1 stations","pl"); + l_eff_eta_simh_me1->AddEntry(h_eta_me1_initial_3st,"ME1 + #geq2 stations","pl"); + l_eff_eta_simh_me1->Draw(); -Print(c_eff_eta_simh_me1,"c_eff_eta_simh_me1" + ext); -} -//################################################################################################ - -TCanvas* c_eff_eta_me1_stubs = new TCanvas("c_eff_eta_me1_stubs","c_eff_eta_me1_stubs",1000,600 ) ; - -TH1D* h_eff_eta_me1_after_lct = setEffHisto("h_eta_me1_after_lct","h_eta_initial",dir, etareb, kRed, 2, 2, "eff(#eta): ME1 stub studies","#eta","",xrange,yrange); -TH1D* h_eff_eta_me1_after_alct = setEffHisto("h_eta_me1_after_alct","h_eta_initial",dir, etareb, kBlue+1, 2, 2, "","","",xrange,yrange); -TH1D* h_eff_eta_me1_after_clct = setEffHisto("h_eta_me1_after_clct","h_eta_initial",dir, etareb, kGreen+1, 2, 2, "","","",xrange,yrange); -TH1D* h_eff_eta_me1_after_alct_okAlct = setEffHisto("h_eta_me1_after_alct_okAlct","h_eta_initial",dir, etareb, kBlue+1, 1, 2, "","","",xrange,yrange); -TH1D* h_eff_eta_me1_after_clct_okClct = setEffHisto("h_eta_me1_after_clct_okClct","h_eta_initial",dir, etareb, kGreen+1, 1, 2, "","","",xrange,yrange); -TH1D* h_eff_eta_me1_after_alctclct = setEffHisto("h_eta_me1_after_alctclct","h_eta_initial",dir, etareb, kYellow+2, 2, 2, "","","",xrange,yrange); -TH1D* h_eff_eta_me1_after_alctclct_okAlctClct = setEffHisto("h_eta_me1_after_alctclct_okAlctClct","h_eta_initial",dir, etareb, kYellow+2, 1,2, "","","",xrange,yrange); -TH1D* h_eff_eta_me1_after_lct_okClctAlct = setEffHisto("h_eta_me1_after_lct_okAlctClct","h_eta_initial",dir, etareb, kRed, 1,2, "","","",xrange,yrange); - -h_eff_eta_me1_after_lct->Draw("hist"); -h_eff_eta_me1_after_alct->Draw("same hist"); -h_eff_eta_me1_after_alct_okAlct->Draw("same hist"); -h_eff_eta_me1_after_clct->Draw("same hist"); -h_eff_eta_me1_after_clct_okClct->Draw("same hist"); -h_eff_eta_me1_after_alctclct->Draw("same hist"); -h_eff_eta_me1_after_alctclct_okAlctClct->Draw("same hist"); -h_eff_eta_me1_after_lct->Draw("same hist"); -h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); - -h_eff_eta_me1_after_lct_okClctAlct->Fit("pol0","R0","",1.63,2.38); -eff11 = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); -cout<Fit("pol0","R0","",1.63,2.05); -eff1b = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); -h_eff_eta_me1_after_lct_okClctAlct->Fit("pol0","R0","",2.05,2.38); -eff1a = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); -cout<SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetNColumns(2); -leg->SetHeader("Efficiency for #mu with p_{T}>20 crossing a ME1 chamber with"); -leg->AddEntry(h_eff_eta_me1_after_alct,"any ALCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alct_okAlct,"correct ALCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_clct,"any CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_clct_okClct,"correct CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alctclct,"any ALCT and CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlctClct,"correct ALCT and CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_lct,"any LCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"correct LCT","pl"); -leg->Draw(); - -if (!interactive) { - char ghn[111]; - sprintf(ghn,"h_eff_eta_me1_after_lct_okClctAlct_%s",dname); - gh = (TH1F*)h_eff_eta_me1_after_lct_okClctAlct->Clone(ghn); - gh->GetYaxis()->SetRangeUser(0.8,1.02); - - gh->SetTitle("LCT finding efficiency in ME1 for #mu with p_{T}>10"); - gh->GetXaxis()->SetRangeUser(0.8,2.5); - gh->GetYaxis()->SetRangeUser(0.,1.05); - gh->GetXaxis()->SetTitle("#eta"); - gh->GetYaxis()->SetTitle("Eff."); - gh->GetXaxis()->SetTitleSize(0.07); - gh->GetXaxis()->SetTitleOffset(0.7); - gh->GetYaxis()->SetLabelOffset(0.015); - return; -} + Print(c_eff_eta_simh_me1,"c_eff_eta_simh_me1" + ext); + } + //################################################################################################ + + TCanvas* c_eff_eta_me1_stubs = new TCanvas("c_eff_eta_me1_stubs","c_eff_eta_me1_stubs",1000,600 ) ; + + TH1D* h_eff_eta_me1_after_lct = setEffHisto("h_eta_me1_after_lct","h_eta_initial",dir, etareb, kRed, 2, 2, "eff(#eta): ME1 stub studies","#eta","",xrange,yrange); + TH1D* h_eff_eta_me1_after_alct = setEffHisto("h_eta_me1_after_alct","h_eta_initial",dir, etareb, kBlue+1, 2, 2, "","","",xrange,yrange); + TH1D* h_eff_eta_me1_after_clct = setEffHisto("h_eta_me1_after_clct","h_eta_initial",dir, etareb, kGreen+1, 2, 2, "","","",xrange,yrange); + TH1D* h_eff_eta_me1_after_alct_okAlct = setEffHisto("h_eta_me1_after_alct_okAlct","h_eta_initial",dir, etareb, kBlue+1, 1, 2, "","","",xrange,yrange); + TH1D* h_eff_eta_me1_after_clct_okClct = setEffHisto("h_eta_me1_after_clct_okClct","h_eta_initial",dir, etareb, kGreen+1, 1, 2, "","","",xrange,yrange); + TH1D* h_eff_eta_me1_after_alctclct = setEffHisto("h_eta_me1_after_alctclct","h_eta_initial",dir, etareb, kYellow+2, 2, 2, "","","",xrange,yrange); + TH1D* h_eff_eta_me1_after_alctclct_okAlctClct = setEffHisto("h_eta_me1_after_alctclct_okAlctClct","h_eta_initial",dir, etareb, kYellow+2, 1,2, "","","",xrange,yrange); + TH1D* h_eff_eta_me1_after_lct_okClctAlct = setEffHisto("h_eta_me1_after_lct_okAlctClct","h_eta_initial",dir, etareb, kRed, 1,2, "","","",xrange,yrange); + + h_eff_eta_me1_after_lct->Draw("hist"); + h_eff_eta_me1_after_alct->Draw("same hist"); + h_eff_eta_me1_after_alct_okAlct->Draw("same hist"); + h_eff_eta_me1_after_clct->Draw("same hist"); + h_eff_eta_me1_after_clct_okClct->Draw("same hist"); + h_eff_eta_me1_after_alctclct->Draw("same hist"); + h_eff_eta_me1_after_alctclct_okAlctClct->Draw("same hist"); + h_eff_eta_me1_after_lct->Draw("same hist"); + h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); + + h_eff_eta_me1_after_lct_okClctAlct->Fit("pol0","R0","",1.63,2.38); + eff11 = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); + cout<Fit("pol0","R0","",1.63,2.05); + eff1b = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); + h_eff_eta_me1_after_lct_okClctAlct->Fit("pol0","R0","",2.05,2.38); + eff1a = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); + cout<SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetNColumns(2); + leg->SetHeader("Efficiency for #mu with p_{T}>20 crossing a ME1 chamber with"); + leg->AddEntry(h_eff_eta_me1_after_alct,"any ALCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alct_okAlct,"correct ALCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_clct,"any CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_clct_okClct,"correct CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alctclct,"any ALCT and CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlctClct,"correct ALCT and CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_lct,"any LCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"correct LCT","pl"); + leg->Draw(); + + if (!interactive) { + char ghn[111]; + sprintf(ghn,"h_eff_eta_me1_after_lct_okClctAlct_%s",dname); + gh = (TH1F*)h_eff_eta_me1_after_lct_okClctAlct->Clone(ghn); + gh->GetYaxis()->SetRangeUser(0.8,1.02); + + gh->SetTitle("LCT finding efficiency in ME1 for #mu with p_{T}>10"); + gh->GetXaxis()->SetRangeUser(0.8,2.5); + gh->GetYaxis()->SetRangeUser(0.,1.05); + gh->GetXaxis()->SetTitle("#eta"); + gh->GetYaxis()->SetTitle("Eff."); + gh->GetXaxis()->SetTitleSize(0.07); + gh->GetXaxis()->SetTitleOffset(0.7); + gh->GetYaxis()->SetLabelOffset(0.015); + return; + } -Print(c_eff_eta_me1_stubs,"h_eff_eta_me1_steps_stubs" + ext); + Print(c_eff_eta_me1_stubs,"h_eff_eta_me1_steps_stubs" + ext); -//################################################################################################ + //################################################################################################ -TCanvas* c_eff_eta_me1_tf = new TCanvas("c_eff_eta_me1_tf","c_eff_eta_me1_tf",1000,600 ) ; + TCanvas* c_eff_eta_me1_tf = new TCanvas("c_eff_eta_me1_tf","c_eff_eta_me1_tf",1000,600 ) ; -TH1D* h_eff_eta_me1_after_lct_okClctAlct = setEffHisto("h_eta_me1_after_lct_okAlctClct","h_eta_initial",dir, etareb, kRed, 1,2, "eff(#eta): ME1 TF studies", "#eta","",xrange,yrange); -TH1D* h_eff_eta_me1_after_mplct_okClctAlct_plus = setEffHisto("h_eta_me1_after_mplct_okAlctClct_plus","h_eta_initial",dir, etareb, kBlack, 1,2, "","","",xrange,yrange); -//TH1D* h_eff_eta_after_tfcand_ok_plus = setEffHisto("h_eta_after_tfcand_ok_plus","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange); -//TH1D* h_eff_eta_after_tfcand_ok_plus_pt10 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange); -TH1D* h_eff_eta_me1_after_tf_ok_plus = setEffHisto("h_eta_me1_after_tf_ok_plus","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange); -TH1D* h_eff_eta_me1_after_tf_ok_plus_pt10 = setEffHisto("h_eta_me1_after_tf_ok_plus_pt10","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange); - -h_eff_eta_me1_after_lct_okClctAlct->Draw("hist"); -h_eff_eta_me1_after_mplct_okClctAlct_plus->Draw("same hist"); -h_eff_eta_me1_after_tf_ok_plus->Draw("same hist"); -h_eff_eta_me1_after_tf_ok_plus_pt10->Draw("same hist"); + TH1D* h_eff_eta_me1_after_lct_okClctAlct = setEffHisto("h_eta_me1_after_lct_okAlctClct","h_eta_initial",dir, etareb, kRed, 1,2, "eff(#eta): ME1 TF studies", "#eta","",xrange,yrange); + TH1D* h_eff_eta_me1_after_mplct_okClctAlct_plus = setEffHisto("h_eta_me1_after_mplct_okAlctClct_plus","h_eta_initial",dir, etareb, kBlack, 1,2, "","","",xrange,yrange); + //TH1D* h_eff_eta_after_tfcand_ok_plus = setEffHisto("h_eta_after_tfcand_ok_plus","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange); + //TH1D* h_eff_eta_after_tfcand_ok_plus_pt10 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange); + TH1D* h_eff_eta_me1_after_tf_ok_plus = setEffHisto("h_eta_me1_after_tf_ok_plus","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange); + TH1D* h_eff_eta_me1_after_tf_ok_plus_pt10 = setEffHisto("h_eta_me1_after_tf_ok_plus_pt10","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange); + + h_eff_eta_me1_after_lct_okClctAlct->Draw("hist"); + h_eff_eta_me1_after_mplct_okClctAlct_plus->Draw("same hist"); + h_eff_eta_me1_after_tf_ok_plus->Draw("same hist"); + h_eff_eta_me1_after_tf_ok_plus_pt10->Draw("same hist"); -leg = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("Eff. for #mu with p_{T}>20 crossing ME1+one more station with"); -leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"LCT matched in ME1","pl"); -leg->AddEntry(h_eff_eta_me1_after_mplct_okClctAlct_plus,"MPC matched in ME1+one","pl"); -leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus,"TF track with matched stubs in ME1+one","pl"); -leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in ME1+one","pl"); -leg->Draw(); + leg = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("Eff. for #mu with p_{T}>20 crossing ME1+one more station with"); + leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"LCT matched in ME1","pl"); + leg->AddEntry(h_eff_eta_me1_after_mplct_okClctAlct_plus,"MPC matched in ME1+one","pl"); + leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus,"TF track with matched stubs in ME1+one","pl"); + leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in ME1+one","pl"); + leg->Draw(); -Print(c_eff_eta_me1_tf,"h_eff_eta_me1_tf" + ext); + Print(c_eff_eta_me1_tf,"h_eff_eta_me1_tf" + ext); -//################################################################################################ + //################################################################################################ -TCanvas* c_eff_eta_tf = new TCanvas("c_eff_eta_tf","c_eff_eta_tf",1000,600 ) ; + TCanvas* c_eff_eta_tf = new TCanvas("c_eff_eta_tf","c_eff_eta_tf",1000,600 ) ; -TH1D* h_eff_eta_after_mpc_ok_plus = setEffHisto("h_eta_after_mpc_ok_plus","h_eta_initial",dir, etareb, kBlack, 1,2, "eff(#eta): TF studies","#eta","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus = setEffHisto("h_eta_after_tfcand_ok_plus","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus_pt10 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange); + TH1D* h_eff_eta_after_mpc_ok_plus = setEffHisto("h_eta_after_mpc_ok_plus","h_eta_initial",dir, etareb, kBlack, 1,2, "eff(#eta): TF studies","#eta","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus = setEffHisto("h_eta_after_tfcand_ok_plus","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus_pt10 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange); -h_eff_eta_after_mpc_ok_plus->Draw("hist"); -h_eff_eta_after_tfcand_ok_plus->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus_pt10->Draw("same hist"); + h_eff_eta_after_mpc_ok_plus->Draw("hist"); + h_eff_eta_after_tfcand_ok_plus->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus_pt10->Draw("same hist"); -leg = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("Eff. for #mu with p_{T}>20 crossing #geq2 stations with"); -leg->AddEntry(h_eff_eta_after_mpc_ok_plus,"MPC matched in 2stations","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus,"TF track with matched stubs in 2st","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); -leg->Draw(); + leg = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("Eff. for #mu with p_{T}>20 crossing #geq2 stations with"); + leg->AddEntry(h_eff_eta_after_mpc_ok_plus,"MPC matched in 2stations","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus,"TF track with matched stubs in 2st","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); + leg->Draw(); -Print(c_eff_eta_tf,"h_eff_eta_tf" + ext); + Print(c_eff_eta_tf,"h_eff_eta_tf" + ext); -//################################################################################################ + //################################################################################################ -TCanvas* c_eff_eta_tf_3st1a = new TCanvas("c_eff_eta_tf_3st1a","c_eff_eta_tf_3st1a",1000,600 ) ; + TCanvas* c_eff_eta_tf_3st1a = new TCanvas("c_eff_eta_tf_3st1a","c_eff_eta_tf_3st1a",1000,600 ) ; -TH1D* h_eff_eta_after_mpc_ok_plus = setEffHisto("h_eta_after_mpc_ok_plus","h_eta_initial",dir, etareb, kBlack, 1,2, "eff(#eta): TF studies (3TF stubs in ME1a)","#eta","",xrange,yrange); -TH1D* h_eff_eta_after_mpc_ok_plus_3st = setEffHisto("h_eta_after_mpc_ok_plus_3st","h_eta_initial",dir, etareb, kOrange+2, 1,2, "","","",xrange,yrange); -//TH1D* h_eff_eta_after_mpc_ok_plus_3st1a = setEffHisto("h_eta_after_mpc_ok_plus_3st1a","h_eta_initial",dir, etareb, kBlack-4, 1,2, "","","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus_3st1a = setEffHisto("h_eta_after_tfcand_ok_plus_3st1a","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus_pt10_3st1a = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_3st1a","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange); + TH1D* h_eff_eta_after_mpc_ok_plus = setEffHisto("h_eta_after_mpc_ok_plus","h_eta_initial",dir, etareb, kBlack, 1,2, "eff(#eta): TF studies (3TF stubs in ME1a)","#eta","",xrange,yrange); + TH1D* h_eff_eta_after_mpc_ok_plus_3st = setEffHisto("h_eta_after_mpc_ok_plus_3st","h_eta_initial",dir, etareb, kOrange+2, 1,2, "","","",xrange,yrange); + //TH1D* h_eff_eta_after_mpc_ok_plus_3st1a = setEffHisto("h_eta_after_mpc_ok_plus_3st1a","h_eta_initial",dir, etareb, kBlack-4, 1,2, "","","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus_3st1a = setEffHisto("h_eta_after_tfcand_ok_plus_3st1a","h_eta_initial",dir, etareb, kBlue, 1,2, "","","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus_pt10_3st1a = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_3st1a","h_eta_initial",dir, etareb, kBlue, 2,2, "","","",xrange,yrange); -h_eff_eta_after_mpc_ok_plus->Draw("hist"); -h_eff_eta_after_mpc_ok_plus_3st->Draw("same hist"); -//h_eff_eta_after_mpc_ok_plus_3st1a->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus_3st1a->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus_pt10_3st1a->Draw("same hist"); + h_eff_eta_after_mpc_ok_plus->Draw("hist"); + h_eff_eta_after_mpc_ok_plus_3st->Draw("same hist"); + //h_eff_eta_after_mpc_ok_plus_3st1a->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus_3st1a->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus_pt10_3st1a->Draw("same hist"); -leg = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("Eff. for #mu with p_{T}>20 crossing #geq2 stations with"); -leg->AddEntry(h_eff_eta_after_mpc_ok_plus,"MPC matched in 2stations","pl"); -leg->AddEntry(h_eff_eta_after_mpc_ok_plus_3st,"MPC matched in 3stations","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_3st1a,"TF track with matched stubs in 2st","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_3st1a,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); -leg->Draw(); + leg = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("Eff. for #mu with p_{T}>20 crossing #geq2 stations with"); + leg->AddEntry(h_eff_eta_after_mpc_ok_plus,"MPC matched in 2stations","pl"); + leg->AddEntry(h_eff_eta_after_mpc_ok_plus_3st,"MPC matched in 3stations","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_3st1a,"TF track with matched stubs in 2st","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_3st1a,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); + leg->Draw(); -Print(c_eff_eta_tf_3st1a,"h_eff_eta_tf_3st1a" + ext); + Print(c_eff_eta_tf_3st1a,"h_eff_eta_tf_3st1a" + ext); -//################################################################################################ + //################################################################################################ -TCanvas* c_eff_eta_tf_q = new TCanvas("c_eff_eta_tf_q","c_eff_eta_tf_q",1000,600 ) ; + TCanvas* c_eff_eta_tf_q = new TCanvas("c_eff_eta_tf_q","c_eff_eta_tf_q",1000,600 ) ; -TH1D* h_eff_eta_after_tfcand_ok_plus_q1 = setEffHisto("h_eta_after_tfcand_ok_plus_q1","h_eta_after_mpc_ok_plus",dir, etareb, kBlue, 1,1, "eff(#eta): TF quality studies (denom: 2MPCs)","#eta","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus_q2 = setEffHisto("h_eta_after_tfcand_ok_plus_q2","h_eta_after_mpc_ok_plus",dir, etareb, kCyan+2, 1,1, "","","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus_q3 = setEffHisto("h_eta_after_tfcand_ok_plus_q3","h_eta_after_mpc_ok_plus",dir, etareb, kMagenta+1, 1,1, "","","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus_q1 = setEffHisto("h_eta_after_tfcand_ok_plus_q1","h_eta_after_mpc_ok_plus",dir, etareb, kBlue, 1,1, "eff(#eta): TF quality studies (denom: 2MPCs)","#eta","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus_q2 = setEffHisto("h_eta_after_tfcand_ok_plus_q2","h_eta_after_mpc_ok_plus",dir, etareb, kCyan+2, 1,1, "","","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus_q3 = setEffHisto("h_eta_after_tfcand_ok_plus_q3","h_eta_after_mpc_ok_plus",dir, etareb, kMagenta+1, 1,1, "","","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus_pt10_q1 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_q1","h_eta_after_mpc_ok_plus",dir, etareb, kBlue, 2,2, "eff(#eta): TF quality studies (denom: 2MPCs)","#eta","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus_pt10_q2 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_q2","h_eta_after_mpc_ok_plus",dir, etareb, kCyan+2, 2,2, "","","",xrange,yrange); -TH1D* h_eff_eta_after_tfcand_ok_plus_pt10_q3 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_q3","h_eta_after_mpc_ok_plus",dir, etareb, kMagenta+1, 2,2, "","","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus_pt10_q1 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_q1","h_eta_after_mpc_ok_plus",dir, etareb, kBlue, 2,2, "eff(#eta): TF quality studies (denom: 2MPCs)","#eta","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus_pt10_q2 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_q2","h_eta_after_mpc_ok_plus",dir, etareb, kCyan+2, 2,2, "","","",xrange,yrange); + TH1D* h_eff_eta_after_tfcand_ok_plus_pt10_q3 = setEffHisto("h_eta_after_tfcand_ok_plus_pt10_q3","h_eta_after_mpc_ok_plus",dir, etareb, kMagenta+1, 2,2, "","","",xrange,yrange); -h_eff_eta_after_tfcand_ok_plus_q1->Draw("hist"); -h_eff_eta_after_tfcand_ok_plus_pt10_q1->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus_q2->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus_pt10_q2->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus_q3->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus_pt10_q3->Draw("same hist"); - -leg = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetNColumns(2); -leg->SetHeader("TF track with matched stubs in 2st and "); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_q1,"Q#geq1","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_q1,"Q#geq1, p_{T}^{TF}>10","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_q2,"Q#geq2","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_q2,"Q#geq2, p_{T}^{TF}>10","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_q3,"Q=3","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_q3,"Q=3, p_{T}^{TF}>10","pl"); -leg->Draw(); + h_eff_eta_after_tfcand_ok_plus_q1->Draw("hist"); + h_eff_eta_after_tfcand_ok_plus_pt10_q1->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus_q2->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus_pt10_q2->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus_q3->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus_pt10_q3->Draw("same hist"); + + leg = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetNColumns(2); + leg->SetHeader("TF track with matched stubs in 2st and "); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_q1,"Q#geq1","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_q1,"Q#geq1, p_{T}^{TF}>10","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_q2,"Q#geq2","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_q2,"Q#geq2, p_{T}^{TF}>10","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_q3,"Q=3","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_ok_plus_pt10_q3,"Q=3, p_{T}^{TF}>10","pl"); + leg->Draw(); -Print(c_eff_eta_tf_q,"h_eff_eta_tf_q" + ext); + Print(c_eff_eta_tf_q,"h_eff_eta_tf_q" + ext); -//################################################################################################ + //################################################################################################ -TCanvas* c_eff_pt_tf = new TCanvas("c_eff_pt_tf","c_eff_pt_tf",1000,600 ) ; + TCanvas* c_eff_pt_tf = new TCanvas("c_eff_pt_tf","c_eff_pt_tf",1000,600 ) ; -TH1D* h_eff_pt_after_mpc_ok_plus = setEffHisto("h_pt_after_mpc_ok_plus","h_pt_initial",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.2<#eta<2.1)","p_{T}","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus = setEffHisto("h_pt_after_tfcand_ok_plus","h_pt_initial",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus_pt10 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10","h_pt_initial",dir, ptreb, kBlue, 2,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_mpc_ok_plus = setEffHisto("h_pt_after_mpc_ok_plus","h_pt_initial",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.2<#eta<2.1)","p_{T}","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus = setEffHisto("h_pt_after_tfcand_ok_plus","h_pt_initial",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus_pt10 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10","h_pt_initial",dir, ptreb, kBlue, 2,2, "","","",xrangept,yrange); -h_eff_pt_after_mpc_ok_plus->Draw("hist"); -h_eff_pt_after_tfcand_ok_plus->Draw("same hist"); -h_eff_pt_after_tfcand_ok_plus_pt10->Draw("same hist"); + h_eff_pt_after_mpc_ok_plus->Draw("hist"); + h_eff_pt_after_tfcand_ok_plus->Draw("same hist"); + h_eff_pt_after_tfcand_ok_plus_pt10->Draw("same hist"); -leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetHeader("Eff. for #mu crossing ME1+one more station in 1.2<#eta<2.1 with"); -leg1->AddEntry(h_eff_pt_after_mpc_ok_plus,"MPC matched in 2stations","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus,"TF track with matched stubs in 2st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); -leg1->Draw(); - -Print(c_eff_pt_tf,"h_eff_pt_tf" + ext); - - -//################################################################################################ - -TCanvas* c_eff_pt_tf_eta1b_2s = new TCanvas("c_eff_pt_tf_eta1b_2s","c_eff_pt_tf_eta1b_2s",1000,600 ) ; - -TH1D* h_eff_pt_after_tfcand_eta1b_2s = setEffHisto("h_pt_after_tfcand_eta1b_2s","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_2s_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_2s_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_2s_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_2s_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange); + leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetHeader("Eff. for #mu crossing ME1+one more station in 1.2<#eta<2.1 with"); + leg1->AddEntry(h_eff_pt_after_mpc_ok_plus,"MPC matched in 2stations","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus,"TF track with matched stubs in 2st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); + leg1->Draw(); + + Print(c_eff_pt_tf,"h_eff_pt_tf" + ext); + + + //################################################################################################ + + TCanvas* c_eff_pt_tf_eta1b_2s = new TCanvas("c_eff_pt_tf_eta1b_2s","c_eff_pt_tf_eta1b_2s",1000,600 ) ; + + TH1D* h_eff_pt_after_tfcand_eta1b_2s = setEffHisto("h_pt_after_tfcand_eta1b_2s","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_2s_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_2s_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_2s_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_2s_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_2s_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange); -h_eff_pt_after_tfcand_eta1b_2s->GetXaxis()->SetRangeUser(0.,49.99); + h_eff_pt_after_tfcand_eta1b_2s->GetXaxis()->SetRangeUser(0.,49.99); -h_eff_pt_after_tfcand_eta1b_2s->Draw("hist"); -h_eff_pt_after_tfcand_eta1b_2s_pt10->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_2s_pt20->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_2s_pt25->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_2s_pt30->Draw("same hist"); - -leg1 = new TLegend(0.5,0.15,0.99,0.5,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s,"stubs in (2+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt10,"p_{T}^{TF}>=10, stubs in (2+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt20,"p_{T}^{TF}>=20, stubs in (2+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt25,"p_{T}^{TF}>=25, stubs in (2+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt30,"p_{T}^{TF}>=30, stubs in (2+)st","pl"); -leg1->Draw(); + h_eff_pt_after_tfcand_eta1b_2s->Draw("hist"); + h_eff_pt_after_tfcand_eta1b_2s_pt10->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_2s_pt20->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_2s_pt25->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_2s_pt30->Draw("same hist"); + + leg1 = new TLegend(0.5,0.15,0.99,0.5,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s,"stubs in (2+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt10,"p_{T}^{TF}>=10, stubs in (2+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt20,"p_{T}^{TF}>=20, stubs in (2+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt25,"p_{T}^{TF}>=25, stubs in (2+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s_pt30,"p_{T}^{TF}>=30, stubs in (2+)st","pl"); + leg1->Draw(); -Print(c_eff_pt_tf_eta1b_2s, "h_eff_pt_tf_eta1b_2s" + ext); + Print(c_eff_pt_tf_eta1b_2s, "h_eff_pt_tf_eta1b_2s" + ext); -//################################################################################################ + //################################################################################################ -TCanvas* c_eff_pt_tf_eta1b_2s1b = new TCanvas("c_eff_pt_tf_eta1b_2s1b","c_eff_pt_tf_eta1b_2s1b",1000,600 ) ; + TCanvas* c_eff_pt_tf_eta1b_2s1b = new TCanvas("c_eff_pt_tf_eta1b_2s1b","c_eff_pt_tf_eta1b_2s1b",1000,600 ) ; -TH1D* h_eff_pt_after_tfcand_eta1b_2s1b = setEffHisto("h_pt_after_tfcand_eta1b_2s1b","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_2s1b_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_2s1b_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_2s1b_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_2s1b_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_2s1b = setEffHisto("h_pt_after_tfcand_eta1b_2s1b","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_2s1b_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_2s1b_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_2s1b_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_2s1b_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_2s1b_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange); -h_eff_pt_after_tfcand_eta1b_2s1b->GetXaxis()->SetRangeUser(0.,49.99); + h_eff_pt_after_tfcand_eta1b_2s1b->GetXaxis()->SetRangeUser(0.,49.99); -h_eff_pt_after_tfcand_eta1b_2s1b->Draw("hist"); -h_eff_pt_after_tfcand_eta1b_2s1b_pt10->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_2s1b_pt20->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_2s1b_pt25->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_2s1b_pt30->Draw("same hist"); - -leg1 = new TLegend(0.5,0.15,0.99,0.5,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b,"stubs in ME1+(1+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt10,"p_{T}^{TF}>=10, stubs in ME1+(1+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt20,"p_{T}^{TF}>=20, stubs in ME1+(1+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt25,"p_{T}^{TF}>=25, stubs in ME1+(1+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt30,"p_{T}^{TF}>=30, stubs in ME1+(1+)st","pl"); -leg1->Draw(); + h_eff_pt_after_tfcand_eta1b_2s1b->Draw("hist"); + h_eff_pt_after_tfcand_eta1b_2s1b_pt10->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_2s1b_pt20->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_2s1b_pt25->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_2s1b_pt30->Draw("same hist"); + + leg1 = new TLegend(0.5,0.15,0.99,0.5,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b,"stubs in ME1+(1+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt10,"p_{T}^{TF}>=10, stubs in ME1+(1+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt20,"p_{T}^{TF}>=20, stubs in ME1+(1+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt25,"p_{T}^{TF}>=25, stubs in ME1+(1+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_2s1b_pt30,"p_{T}^{TF}>=30, stubs in ME1+(1+)st","pl"); + leg1->Draw(); -Print(c_eff_pt_tf_eta1b_2s1b, "h_eff_pt_tf_eta1b_2s1b" + ext); + Print(c_eff_pt_tf_eta1b_2s1b, "h_eff_pt_tf_eta1b_2s1b" + ext); -//################################################################################################ + //################################################################################################ -TCanvas* c_eff_pt_tf_eta1b_3s = new TCanvas("c_eff_pt_tf_eta1b_3s","c_eff_pt_tf_eta1b_3s",1000,600 ) ; + TCanvas* c_eff_pt_tf_eta1b_3s = new TCanvas("c_eff_pt_tf_eta1b_3s","c_eff_pt_tf_eta1b_3s",1000,600 ) ; -TH1D* h_eff_pt_after_tfcand_eta1b_3s = setEffHisto("h_pt_after_tfcand_eta1b_3s","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_3s_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_3s_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_3s_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_3s_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_3s = setEffHisto("h_pt_after_tfcand_eta1b_3s","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_3s_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_3s_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_3s_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_3s_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_3s_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange); -h_eff_pt_after_tfcand_eta1b_3s->GetXaxis()->SetRangeUser(0.,49.99); + h_eff_pt_after_tfcand_eta1b_3s->GetXaxis()->SetRangeUser(0.,49.99); -h_eff_pt_after_tfcand_eta1b_3s->Draw("hist"); -h_eff_pt_after_tfcand_eta1b_3s_pt10->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_3s_pt20->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_3s_pt25->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_3s_pt30->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_3s->Draw("hist"); + h_eff_pt_after_tfcand_eta1b_3s_pt10->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_3s_pt20->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_3s_pt25->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_3s_pt30->Draw("same hist"); -leg1 = new TLegend(0.5,0.15,0.99,0.5,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s,"stubs in (3+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt10,"p_{T}^{TF}>=10, stubs in (3+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt20,"p_{T}^{TF}>=20, stubs in (3+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt25,"p_{T}^{TF}>=25, stubs in (3+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt30,"p_{T}^{TF}>=30, stubs in (3+)st","pl"); -leg1->Draw(); + leg1 = new TLegend(0.5,0.15,0.99,0.5,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s,"stubs in (3+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt10,"p_{T}^{TF}>=10, stubs in (3+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt20,"p_{T}^{TF}>=20, stubs in (3+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt25,"p_{T}^{TF}>=25, stubs in (3+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s_pt30,"p_{T}^{TF}>=30, stubs in (3+)st","pl"); + leg1->Draw(); -Print(c_eff_pt_tf_eta1b_3s, "h_eff_pt_tf_eta1b_3s" + ext); + Print(c_eff_pt_tf_eta1b_3s, "h_eff_pt_tf_eta1b_3s" + ext); -//################################################################################################ + //################################################################################################ -TCanvas* c_eff_pt_tf_eta1b_3s1b = new TCanvas("c_eff_pt_tf_eta1b_3s1b","c_eff_pt_tf_eta1b_3s1b",1000,600 ) ; + TCanvas* c_eff_pt_tf_eta1b_3s1b = new TCanvas("c_eff_pt_tf_eta1b_3s1b","c_eff_pt_tf_eta1b_3s1b",1000,600 ) ; -TH1D* h_eff_pt_after_tfcand_eta1b_3s1b = setEffHisto("h_pt_after_tfcand_eta1b_3s1b","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_3s1b_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_3s1b_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_3s1b_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_eta1b_3s1b_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange); - -h_eff_pt_after_tfcand_eta1b_3s1b->GetXaxis()->SetRangeUser(0.,49.99); - -h_eff_pt_after_tfcand_eta1b_3s1b->Draw("hist"); -h_eff_pt_after_tfcand_eta1b_3s1b_pt10->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_3s1b_pt20->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_3s1b_pt25->Draw("same hist"); -h_eff_pt_after_tfcand_eta1b_3s1b_pt30->Draw("same hist"); - -leg1 = new TLegend(0.5,0.15,0.99,0.5,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b,"stubs in ME1+(2+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt10,"p_{T}^{TF}>=10, stubs in ME1+(2+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt20,"p_{T}^{TF}>=20, stubs in ME1+(2+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt25,"p_{T}^{TF}>=25, stubs in ME1+(2+)st","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt30,"p_{T}^{TF}>=30, stubs in ME1+(2+)st","pl"); -leg1->Draw(); - -Print(c_eff_pt_tf_eta1b_3s1b, "h_eff_pt_tf_eta1b_3s1b" + ext); - - - -//################################################################################################ - -/* -TCanvas* c_eff_pth_tf = new TCanvas("c_eff_pth_tf","c_eff_pth_tf",1000,600 ) ; - -TH1D* h_eff_pth_after_mpc_ok_plus = setEffHisto("h_pth_after_mpc_ok_plus","h_pth_initial",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (2.1<#eta<2.4)","p_{T}","",xrangept,yrange); -TH1D* h_eff_pth_after_tfcand_ok_plus = setEffHisto("h_pth_after_tfcand_ok_plus","h_pth_initial",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pth_after_tfcand_ok_plus_pt10 = setEffHisto("h_pth_after_tfcand_ok_plus_pt10","h_pth_initial",dir, ptreb, kBlue, 2,2, "","","",xrangept,yrange); - -h_eff_pth_after_mpc_ok_plus->Draw("hist"); -h_eff_pth_after_tfcand_ok_plus->Draw("same hist"); -h_eff_pth_after_tfcand_ok_plus_pt10->Draw("same hist"); + TH1D* h_eff_pt_after_tfcand_eta1b_3s1b = setEffHisto("h_pt_after_tfcand_eta1b_3s1b","h_pt_initial_1b",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (1.64<#eta<2.14)","p_{T}^{MC}","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_3s1b_pt10 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt10","h_pt_initial_1b",dir, ptreb, kGreen+2, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_3s1b_pt20 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt20","h_pt_initial_1b",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_3s1b_pt25 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt25","h_pt_initial_1b",dir, ptreb, kOrange, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_eta1b_3s1b_pt30 = setEffHisto("h_pt_after_tfcand_eta1b_3s1b_pt30","h_pt_initial_1b",dir, ptreb, kRed, 1,2, "","","",xrangept,yrange); + + h_eff_pt_after_tfcand_eta1b_3s1b->GetXaxis()->SetRangeUser(0.,49.99); + + h_eff_pt_after_tfcand_eta1b_3s1b->Draw("hist"); + h_eff_pt_after_tfcand_eta1b_3s1b_pt10->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_3s1b_pt20->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_3s1b_pt25->Draw("same hist"); + h_eff_pt_after_tfcand_eta1b_3s1b_pt30->Draw("same hist"); + + leg1 = new TLegend(0.5,0.15,0.99,0.5,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetHeader("Eff. for #mu in 1.64<#eta<2.14 to have TF track with"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b,"stubs in ME1+(2+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt10,"p_{T}^{TF}>=10, stubs in ME1+(2+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt20,"p_{T}^{TF}>=20, stubs in ME1+(2+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt25,"p_{T}^{TF}>=25, stubs in ME1+(2+)st","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_eta1b_3s1b_pt30,"p_{T}^{TF}>=30, stubs in ME1+(2+)st","pl"); + leg1->Draw(); + + Print(c_eff_pt_tf_eta1b_3s1b, "h_eff_pt_tf_eta1b_3s1b" + ext); + + + + //################################################################################################ + + /* + TCanvas* c_eff_pth_tf = new TCanvas("c_eff_pth_tf","c_eff_pth_tf",1000,600 ) ; + + TH1D* h_eff_pth_after_mpc_ok_plus = setEffHisto("h_pth_after_mpc_ok_plus","h_pth_initial",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (2.1<#eta<2.4)","p_{T}","",xrangept,yrange); + TH1D* h_eff_pth_after_tfcand_ok_plus = setEffHisto("h_pth_after_tfcand_ok_plus","h_pth_initial",dir, ptreb, kBlue, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pth_after_tfcand_ok_plus_pt10 = setEffHisto("h_pth_after_tfcand_ok_plus_pt10","h_pth_initial",dir, ptreb, kBlue, 2,2, "","","",xrangept,yrange); + + h_eff_pth_after_mpc_ok_plus->Draw("hist"); + h_eff_pth_after_tfcand_ok_plus->Draw("same hist"); + h_eff_pth_after_tfcand_ok_plus_pt10->Draw("same hist"); -leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetHeader("Eff. for #mu crossing ME1+one more station in 2.1<#eta<2.4 with"); -leg1->AddEntry(h_eff_pth_after_mpc_ok_plus,"MPC matched in 2stations","pl"); -leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus,"TF track with matched stubs in 2st","pl"); -leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); -leg1->Draw(); + leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetHeader("Eff. for #mu crossing ME1+one more station in 2.1<#eta<2.4 with"); + leg1->AddEntry(h_eff_pth_after_mpc_ok_plus,"MPC matched in 2stations","pl"); + leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus,"TF track with matched stubs in 2st","pl"); + leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus_pt10,"p_{T}^{TF}>10 TF track with matched stubs in 2st","pl"); + leg1->Draw(); -Print(c_eff_pth_tf,"h_eff_pth_tf" + ext); -*/ + Print(c_eff_pth_tf,"h_eff_pth_tf" + ext); + */ -//################################################################################################ + //################################################################################################ -/* -TCanvas* c_eff_pth_tf_3st1a = new TCanvas("c_eff_pth_tf_3st1a","c_eff_pth_tf_3st1a",1000,600 ) ; + /* + TCanvas* c_eff_pth_tf_3st1a = new TCanvas("c_eff_pth_tf_3st1a","c_eff_pth_tf_3st1a",1000,600 ) ; -TH1D* h_eff_pth_after_mpc_ok_plus = setEffHisto("h_pth_after_mpc_ok_plus","h_pth_initial",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (2.1<#eta<2.4)","p_{T}","",xrangept,yrange); -TH1D* h_eff_pth_after_tfcand_ok_plus_3st1a = setEffHisto("h_pth_after_tfcand_ok_plus_3st1a","h_pth_initial",dir, ptreb, kBlue, 1,2, "eff(p_{T}^{MC}): TF studies (denom: 2MPCs, 2.1<#eta<2.4)","p_{T}","",xrangept,yrange); -TH1D* h_eff_pth_after_tfcand_ok_plus_pt10_3st1a = setEffHisto("h_pth_after_tfcand_ok_plus_pt10_3st1a","h_pth_initial",dir, ptreb, kBlue, 2,2, "","","",xrangept,yrange); + TH1D* h_eff_pth_after_mpc_ok_plus = setEffHisto("h_pth_after_mpc_ok_plus","h_pth_initial",dir, ptreb, kBlack, 1,2, "eff(p_{T}^{MC}): TF studies (2.1<#eta<2.4)","p_{T}","",xrangept,yrange); + TH1D* h_eff_pth_after_tfcand_ok_plus_3st1a = setEffHisto("h_pth_after_tfcand_ok_plus_3st1a","h_pth_initial",dir, ptreb, kBlue, 1,2, "eff(p_{T}^{MC}): TF studies (denom: 2MPCs, 2.1<#eta<2.4)","p_{T}","",xrangept,yrange); + TH1D* h_eff_pth_after_tfcand_ok_plus_pt10_3st1a = setEffHisto("h_pth_after_tfcand_ok_plus_pt10_3st1a","h_pth_initial",dir, ptreb, kBlue, 2,2, "","","",xrangept,yrange); -h_eff_pth_after_mpc_ok_plus->Draw("hist"); -h_eff_pth_after_tfcand_ok_plus_3st1a->Draw("same hist"); -h_eff_pth_after_tfcand_ok_plus_pt10_3st1a->Draw("same hist"); + h_eff_pth_after_mpc_ok_plus->Draw("hist"); + h_eff_pth_after_tfcand_ok_plus_3st1a->Draw("same hist"); + h_eff_pth_after_tfcand_ok_plus_pt10_3st1a->Draw("same hist"); -leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetHeader("Eff. for #mu crossing ME1+one more station in 2.1<#eta<2.4 with"); -leg1->AddEntry(h_eff_pth_after_mpc_ok_plus,"MPC matched in 2stations","pl"); -leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus_3st1a,"TF track with matched stubs in 3st","pl"); -leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus_pt10_3st1a,"p_{T}^{TF}>10 TF track with matched stubs in 3st","pl"); -leg1->Draw(); + leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetHeader("Eff. for #mu crossing ME1+one more station in 2.1<#eta<2.4 with"); + leg1->AddEntry(h_eff_pth_after_mpc_ok_plus,"MPC matched in 2stations","pl"); + leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus_3st1a,"TF track with matched stubs in 3st","pl"); + leg1->AddEntry(h_eff_pth_after_tfcand_ok_plus_pt10_3st1a,"p_{T}^{TF}>10 TF track with matched stubs in 3st","pl"); + leg1->Draw(); -Print(c_eff_pth_tf_3st1a,"h_eff_pth_tf_3st1a" + ext); + Print(c_eff_pth_tf_3st1a,"h_eff_pth_tf_3st1a" + ext); -*/ -//################################################################################################ + */ + //################################################################################################ -TCanvas* c_eff_pt_tf_q = new TCanvas("c_eff_pt_tf_q","c_eff_pt_tf_q",1000,600 ) ; + TCanvas* c_eff_pt_tf_q = new TCanvas("c_eff_pt_tf_q","c_eff_pt_tf_q",1000,600 ) ; -TH1D* h_eff_pt_after_tfcand_ok_plus_q1 = setEffHisto("h_pt_after_tfcand_ok_plus_q1","h_pt_after_mpc_ok_plus",dir, etareb, kBlue, 1,1, "eff(p_{T}^{MC}): TF quality studies (denom: 2MPCs, 1.2<#eta<2.1)","p_{T}^{MC}","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus_q2 = setEffHisto("h_pt_after_tfcand_ok_plus_q2","h_pt_after_mpc_ok_plus",dir, etareb, kCyan+2, 1,1, "eff(p_{T}^{MC}): TF quality studies (denom: 2MPCs, 1.2<#eta<2.1)","p_{T}^{MC}","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus_q3 = setEffHisto("h_pt_after_tfcand_ok_plus_q3","h_pt_after_mpc_ok_plus",dir, etareb, kMagenta+1, 1,1, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus_q1 = setEffHisto("h_pt_after_tfcand_ok_plus_q1","h_pt_after_mpc_ok_plus",dir, etareb, kBlue, 1,1, "eff(p_{T}^{MC}): TF quality studies (denom: 2MPCs, 1.2<#eta<2.1)","p_{T}^{MC}","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus_q2 = setEffHisto("h_pt_after_tfcand_ok_plus_q2","h_pt_after_mpc_ok_plus",dir, etareb, kCyan+2, 1,1, "eff(p_{T}^{MC}): TF quality studies (denom: 2MPCs, 1.2<#eta<2.1)","p_{T}^{MC}","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus_q3 = setEffHisto("h_pt_after_tfcand_ok_plus_q3","h_pt_after_mpc_ok_plus",dir, etareb, kMagenta+1, 1,1, "","","",xrangept,yrange); -//TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q1 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q1","h_pt_after_mpc_ok_plus",dir, etareb, kBlue, 2,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q2 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q2","h_pt_after_mpc_ok_plus",dir, etareb, kCyan+2, 2,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q3 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q3","h_pt_after_mpc_ok_plus",dir, etareb, kMagenta+1, 2,2, "","","",xrangept,yrange); + //TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q1 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q1","h_pt_after_mpc_ok_plus",dir, etareb, kBlue, 2,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q2 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q2","h_pt_after_mpc_ok_plus",dir, etareb, kCyan+2, 2,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q3 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q3","h_pt_after_mpc_ok_plus",dir, etareb, kMagenta+1, 2,2, "","","",xrangept,yrange); -h_eff_pt_after_tfcand_ok_plus_q1->Draw("hist"); -//h_eff_pt_after_tfcand_ok_plus_pt10_q1->Draw("same hist"); -h_eff_pt_after_tfcand_ok_plus_q2->Draw("same hist"); -//h_eff_pt_after_tfcand_ok_plus_pt10_q2->Draw("same hist"); -h_eff_pt_after_tfcand_ok_plus_q3->Draw("same hist"); -h_eff_pt_after_tfcand_ok_plus_pt10_q3->Draw("same hist"); + h_eff_pt_after_tfcand_ok_plus_q1->Draw("hist"); + //h_eff_pt_after_tfcand_ok_plus_pt10_q1->Draw("same hist"); + h_eff_pt_after_tfcand_ok_plus_q2->Draw("same hist"); + //h_eff_pt_after_tfcand_ok_plus_pt10_q2->Draw("same hist"); + h_eff_pt_after_tfcand_ok_plus_q3->Draw("same hist"); + h_eff_pt_after_tfcand_ok_plus_pt10_q3->Draw("same hist"); -leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetNColumns(2); -leg1->SetHeader("TF track with matched stubs in 2st and "); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_q1,"Q#geq1","pl"); -//leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q1,"Q#geq1, p_{T}^{TF}>10","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_q2,"Q#geq2","pl"); -//leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q2,"Q#geq2, p_{T}^{TF}>10","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_q3,"Q=3","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q3,"Q=3, p_{T}^{TF}>10","pl"); -leg1->Draw(); + leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetNColumns(2); + leg1->SetHeader("TF track with matched stubs in 2st and "); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_q1,"Q#geq1","pl"); + //leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q1,"Q#geq1, p_{T}^{TF}>10","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_q2,"Q#geq2","pl"); + //leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q2,"Q#geq2, p_{T}^{TF}>10","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_q3,"Q=3","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q3,"Q=3, p_{T}^{TF}>10","pl"); + leg1->Draw(); -Print(c_eff_pt_tf_q,"h_eff_pt_tf_q" + ext); + Print(c_eff_pt_tf_q,"h_eff_pt_tf_q" + ext); -//################################################################################################ + //################################################################################################ -TCanvas* c_eff_ptres_tf = new TCanvas("c_eff_ptres_tf","c_eff_ptres_tf",1000,600 ) ; + TCanvas* c_eff_ptres_tf = new TCanvas("c_eff_ptres_tf","c_eff_ptres_tf",1000,600 ) ; -TH1D* h_eff_pt_after_tfcand_ok_plus_pt10 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10","h_pt_after_tfcand_ok_plus",dir, ptreb, kBlue, 1,2, "p_{T}^{TF}>10 assignment eff(p_{T}^{MC}) studies (denom: any p_{T}^{TF}, 1.2<#eta<2.1)","p_{T}^{MC}","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q2 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q2","h_pt_after_tfcand_ok_plus_q2",dir, ptreb, kCyan+2, 1,2, "","","",xrangept,yrange); -TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q3 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q3","h_pt_after_tfcand_ok_plus_q3",dir, ptreb, kMagenta+1, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus_pt10 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10","h_pt_after_tfcand_ok_plus",dir, ptreb, kBlue, 1,2, "p_{T}^{TF}>10 assignment eff(p_{T}^{MC}) studies (denom: any p_{T}^{TF}, 1.2<#eta<2.1)","p_{T}^{MC}","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q2 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q2","h_pt_after_tfcand_ok_plus_q2",dir, ptreb, kCyan+2, 1,2, "","","",xrangept,yrange); + TH1D* h_eff_pt_after_tfcand_ok_plus_pt10_q3 = setEffHisto("h_pt_after_tfcand_ok_plus_pt10_q3","h_pt_after_tfcand_ok_plus_q3",dir, ptreb, kMagenta+1, 1,2, "","","",xrangept,yrange); -h_eff_pt_after_tfcand_ok_plus_pt10->Draw("hist"); -h_eff_pt_after_tfcand_ok_plus_pt10_q2->Draw("same hist"); -h_eff_pt_after_tfcand_ok_plus_pt10_q3->Draw("same hist"); + h_eff_pt_after_tfcand_ok_plus_pt10->Draw("hist"); + h_eff_pt_after_tfcand_ok_plus_pt10_q2->Draw("same hist"); + h_eff_pt_after_tfcand_ok_plus_pt10_q3->Draw("same hist"); -leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); -leg1->SetBorderSize(0); -leg1->SetFillStyle(0); -leg1->SetHeader("for #mu with p_{T}>20 crossing ME1+one station to pass p_{T}^{TF}>10 with"); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10,"any Q","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q2,"Q#geq2","pl"); -leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q3,"Q=3","pl"); -leg1->Draw(); + leg1 = new TLegend(0.347,0.19,0.926,0.45,NULL,"brNDC"); + leg1->SetBorderSize(0); + leg1->SetFillStyle(0); + leg1->SetHeader("for #mu with p_{T}>20 crossing ME1+one station to pass p_{T}^{TF}>10 with"); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10,"any Q","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q2,"Q#geq2","pl"); + leg1->AddEntry(h_eff_pt_after_tfcand_ok_plus_pt10_q3,"Q=3","pl"); + leg1->Draw(); -Print(c_eff_ptres_tf,"h_eff_ptres_tf" + ext); + Print(c_eff_ptres_tf,"h_eff_ptres_tf" + ext); -//################################################################################################ + //################################################################################################ -/* -TCanvas* c_eff_DR2_tf = new TCanvas("c_eff_DR2_tf","c_eff_DR2_tf",1000,600 ) ; + /* + TCanvas* c_eff_DR2_tf = new TCanvas("c_eff_DR2_tf","c_eff_DR2_tf",1000,600 ) ; -double xrangeDR[2]={0.,3.5}; + double xrangeDR[2]={0.,3.5}; -TH1D* h_eff_DR_2SimTr_after_tfcand_ok_plus = setEffHisto("h_DR_2SimTr_after_tfcand_ok_plus","h_DR_2SimTr_after_mpc_ok_plus",dir, 3, kBlue, 1,2, "eff(#DeltaR(Tr1,Tr2)): for Tr1: p_{T}^{MC}>20, denom: 2 MPCs, 1.2<#eta<2.1","#DeltaR(Tr1,Tr2)","",xrangeDR,yrange); + TH1D* h_eff_DR_2SimTr_after_tfcand_ok_plus = setEffHisto("h_DR_2SimTr_after_tfcand_ok_plus","h_DR_2SimTr_after_mpc_ok_plus",dir, 3, kBlue, 1,2, "eff(#DeltaR(Tr1,Tr2)): for Tr1: p_{T}^{MC}>20, denom: 2 MPCs, 1.2<#eta<2.1","#DeltaR(Tr1,Tr2)","",xrangeDR,yrange); -h_eff_DR_2SimTr_after_tfcand_ok_plus->SetLineColor(0); -h_eff_DR_2SimTr_after_tfcand_ok_plus->Draw("hist"); + h_eff_DR_2SimTr_after_tfcand_ok_plus->SetLineColor(0); + h_eff_DR_2SimTr_after_tfcand_ok_plus->Draw("hist"); -TGraphAsymmErrors *gg = new TGraphAsymmErrors(); -gg->BayesDivide((const TH1*)h1,(const TH1*)h2); -gg->Draw("p"); + TGraphAsymmErrors *gg = new TGraphAsymmErrors(); + gg->BayesDivide((const TH1*)h1,(const TH1*)h2); + gg->Draw("p"); -Print(c_eff_DR2_tf,"h_eff_DR_2SimTr_tf" + ext); -*/ + Print(c_eff_DR2_tf,"h_eff_DR_2SimTr_tf" + ext); + */ -return;return; + return;return; @@ -1623,792 +1603,792 @@ return;return; -h_eta_initial = (TH1D*)getH(dir,"h_eta_initial"); -h_eta_after_mpc = (TH1D*)getH(dir,"h_eta_after_mpc"); -h_eta_after_mpc_st1 = (TH1D*)getH(dir,"h_eta_after_mpc_st1"); -h_eta_after_mpc_st1_good = (TH1D*)getH(dir,"h_eta_after_mpc_st1_good"); -h_eta_after_mpc_ok = (TH1D*)getH(dir,"h_eta_after_mpc_ok"); -h_eta_after_mpc_ok_plus = (TH1D*)getH(dir,"h_eta_after_mpc_ok_plus"); + h_eta_initial = (TH1D*)getH(dir,"h_eta_initial"); + h_eta_after_mpc = (TH1D*)getH(dir,"h_eta_after_mpc"); + h_eta_after_mpc_st1 = (TH1D*)getH(dir,"h_eta_after_mpc_st1"); + h_eta_after_mpc_st1_good = (TH1D*)getH(dir,"h_eta_after_mpc_st1_good"); + h_eta_after_mpc_ok = (TH1D*)getH(dir,"h_eta_after_mpc_ok"); + h_eta_after_mpc_ok_plus = (TH1D*)getH(dir,"h_eta_after_mpc_ok_plus"); -h_eta_after_tftrack = (TH1D*)getH(dir,"h_eta_after_tftrack"); + h_eta_after_tftrack = (TH1D*)getH(dir,"h_eta_after_tftrack"); -h_eta_after_tfcand = (TH1D*)getH(dir,"h_eta_after_tfcand"); -h_eta_after_tfcand_q1 = (TH1D*)getH(dir,"h_eta_after_tfcand_q1"); -h_eta_after_tfcand_q2 = (TH1D*)getH(dir,"h_eta_after_tfcand_q2"); -h_eta_after_tfcand_q3 = (TH1D*)getH(dir,"h_eta_after_tfcand_q3"); -h_eta_after_tfcand_ok = (TH1D*)getH(dir,"h_eta_after_tfcand_ok"); -h_eta_after_tfcand_ok_plus = (TH1D*)getH(dir,"h_eta_after_tfcand_ok_plus"); -h_eta_after_tfcand_ok_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_ok_pt10"); -h_eta_after_tfcand_ok_plus_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_ok_plus_pt10"); - -h_eta_after_tfcand_all = (TH1D*)getH(dir,"h_eta_after_tfcand_all"); -h_eta_after_tfcand_all_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_all_pt10"); - -h_eta_after_gmtreg = (TH1D*)getH(dir,"h_eta_after_gmtreg"); -h_eta_after_gmtreg_all = (TH1D*)getH(dir,"h_eta_after_gmtreg_all"); -h_eta_after_gmtreg_dr = (TH1D*)getH(dir,"h_eta_after_gmtreg_dr"); -h_eta_after_gmt = (TH1D*)getH(dir,"h_eta_after_gmt"); -h_eta_after_gmt_all = (TH1D*)getH(dir,"h_eta_after_gmt_all"); -h_eta_after_xtra = (TH1D*)getH(dir,"h_eta_after_xtra"); -h_eta_after_xtra_all = (TH1D*)getH(dir,"h_eta_after_xtra_all"); -h_eta_after_xtra_dr = (TH1D*)getH(dir,"h_eta_after_xtra_dr"); - -h_eta_after_tfcand_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_pt10"); -h_eta_after_tfcand_my_st1 = (TH1D*)getH(dir,"h_eta_after_tfcand_my_st1"); -h_eta_after_tfcand_org_st1 = (TH1D*)getH(dir,"h_eta_after_tfcand_org_st1"); -h_eta_after_tfcand_comm_st1 = (TH1D*)getH(dir,"h_eta_after_tfcand_comm_st1"); -h_eta_after_tfcand_my_st1_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_my_st1_pt10"); -h_eta_after_gmtreg_dr_pt10 = (TH1D*)getH(dir,"h_eta_after_gmtreg_dr_pt10"); -h_eta_after_gmtreg_pt10= (TH1D*)getH(dir,"h_eta_after_gmtreg_pt10"); -h_eta_after_gmt_pt10 = (TH1D*)getH(dir,"h_eta_after_gmt_pt10"); -h_eta_after_xtra_dr_pt10 = (TH1D*)getH(dir,"h_eta_after_xtra_dr_pt10"); - -// = (TH1D*)getH(dir,""); - -h_eta_me1_after_alct = (TH1D*)getH(dir,"h_eta_me1_after_alct"); -h_eta_me1_after_alct_okAlct = (TH1D*)getH(dir,"h_eta_me1_after_alct_okAlct"); -h_eta_me1_after_clct = (TH1D*)getH(dir,"h_eta_me1_after_clct"); -h_eta_me1_after_clct_okClct = (TH1D*)getH(dir,"h_eta_me1_after_clct_okClct"); -h_eta_me1_after_alctclct = (TH1D*)getH(dir,"h_eta_me1_after_alctclct"); -h_eta_me1_after_alctclct_okAlct = (TH1D*)getH(dir,"h_eta_me1_after_alctclct_okAlct"); -h_eta_me1_after_alctclct_okClct = (TH1D*)getH(dir,"h_eta_me1_after_alctclct_okClct"); -h_eta_me1_after_alctclct_okAlctClct = (TH1D*)getH(dir,"h_eta_me1_after_alctclct_okAlctClct"); - -h_eta_me1_after_lct = (TH1D*)getH(dir,"h_eta_me1_after_lct"); -h_eta_me1_after_lct_okAlct = (TH1D*)getH(dir,"h_eta_me1_after_lct_okAlct"); -h_eta_me1_after_lct_okAlctClct = (TH1D*)getH(dir,"h_eta_me1_after_lct_okAlctClct"); -h_eta_me1_after_lct_okClct = (TH1D*)getH(dir,"h_eta_me1_after_lct_okClct"); -h_eta_me1_after_lct_okClctAlct = (TH1D*)getH(dir,"h_eta_me1_after_lct_okClctAlct"); -h_eta_me1_after_mplct_okAlctClct = (TH1D*)getH(dir,"h_eta_me1_after_mplct_okAlctClct"); -h_eta_me1_after_mplct_okAlctClct_plus = (TH1D*)getH(dir,"h_eta_me1_after_mplct_okAlctClct_plus"); -h_eta_me1_after_tf_ok = (TH1D*)getH(dir,"h_eta_me1_after_tf_ok"); -h_eta_me1_after_tf_ok_pt10 = (TH1D*)getH(dir,"h_eta_me1_after_tf_ok_pt10"); -h_eta_me1_after_tf_ok_plus = (TH1D*)getH(dir,"h_eta_me1_after_tf_ok_plus"); -h_eta_me1_after_tf_ok_plus_pt10 = (TH1D*)getH(dir,"h_eta_me1_after_tf_ok_plus_pt10"); - - - -myRebin(h_eta_initial,etareb); -myRebin(h_eta_after_mpc,etareb); -myRebin(h_eta_after_mpc_st1,etareb); -myRebin(h_eta_after_mpc_st1_good,etareb); -myRebin(h_eta_after_mpc_ok,etareb); -myRebin(h_eta_after_mpc_ok_plus,etareb); -myRebin(h_eta_after_tftrack,etareb); - -myRebin(h_eta_after_tfcand,etareb); -myRebin(h_eta_after_tfcand_q1,etareb); -myRebin(h_eta_after_tfcand_q2,etareb); -myRebin(h_eta_after_tfcand_q3,etareb); -myRebin(h_eta_after_tfcand_ok,etareb); -myRebin(h_eta_after_tfcand_ok_plus,etareb); -myRebin(h_eta_after_tfcand_ok_pt10,etareb); -myRebin(h_eta_after_tfcand_ok_plus_pt10,etareb); - -myRebin(h_eta_after_tfcand_all,etareb); -myRebin(h_eta_after_tfcand_all_pt10,etareb); - -myRebin(h_eta_after_gmtreg ,etareb); -myRebin(h_eta_after_gmtreg_all,etareb); -myRebin(h_eta_after_gmtreg_dr ,etareb); -myRebin(h_eta_after_gmt ,etareb); -myRebin(h_eta_after_gmt_all ,etareb); -myRebin(h_eta_after_xtra ,etareb); -myRebin(h_eta_after_xtra_all ,etareb); -myRebin(h_eta_after_xtra_dr ,etareb); - -myRebin(h_eta_after_tfcand_pt10,etareb); -myRebin(h_eta_after_tfcand_my_st1,etareb); -myRebin(h_eta_after_tfcand_org_st1,etareb); -myRebin(h_eta_after_tfcand_comm_st1,etareb); -myRebin(h_eta_after_tfcand_my_st1_pt10,etareb); -myRebin(h_eta_after_gmtreg_pt10 ,etareb); -myRebin(h_eta_after_gmtreg_dr_pt10 ,etareb); -myRebin(h_eta_after_gmt_pt10 ,etareb); -myRebin(h_eta_after_xtra_dr_pt10 ,etareb); - -myRebin(h_eta_me1_after_alct,etareb); -myRebin(h_eta_me1_after_alct_okAlct,etareb); -myRebin(h_eta_me1_after_clct,etareb); -myRebin(h_eta_me1_after_clct_okClct,etareb); -myRebin(h_eta_me1_after_alctclct,etareb); -myRebin(h_eta_me1_after_alctclct_okAlct,etareb); -myRebin(h_eta_me1_after_alctclct_okClct,etareb); -myRebin(h_eta_me1_after_alctclct_okAlctClct,etareb); - -myRebin(h_eta_me1_after_lct ,etareb); -myRebin(h_eta_me1_after_lct_okAlct ,etareb); -myRebin(h_eta_me1_after_lct_okAlctClct ,etareb); -myRebin(h_eta_me1_after_lct_okClct ,etareb); -myRebin(h_eta_me1_after_lct_okClctAlct ,etareb); -myRebin(h_eta_me1_after_mplct_okAlctClct ,etareb); -myRebin(h_eta_me1_after_mplct_okAlctClct_plus ,etareb); -myRebin(h_eta_me1_after_tf_ok ,etareb); -myRebin(h_eta_me1_after_tf_ok_pt10 ,etareb); -myRebin(h_eta_me1_after_tf_ok_plus ,etareb); -myRebin(h_eta_me1_after_tf_ok_plus_pt10 ,etareb); - -h_eff_eta_after_mpc = (TH1D*) h_eta_after_mpc->Clone("h_eff_eta_after_mpc"); -h_eff_eta_after_mpc_st1 = (TH1D*) h_eta_after_mpc_st1->Clone("h_eff_eta_after_mpc_st1"); -h_eff_eta_after_mpc_st1_good = (TH1D*) h_eta_after_mpc_st1_good->Clone("h_eff_eta_after_mpc_st1_good"); -h_eff_eta_after_mpc_ok = (TH1D*) h_eta_after_mpc_ok->Clone("h_eff_eta_after_mpc_ok"); -h_eff_eta_after_mpc_ok_plus = (TH1D*) h_eta_after_mpc_ok_plus->Clone("h_eff_eta_after_mpc_ok_plus"); -h_eff_eta_after_tftrack = (TH1D*) h_eta_after_tftrack->Clone("h_eff_eta_after_tftrack"); - -h_eff_eta_after_tfcand = (TH1D*) h_eta_after_tfcand->Clone("h_eff_eta_after_tfcand"); -h_eff_eta_after_tfcand_q1 = (TH1D*) h_eta_after_tfcand_q1->Clone("h_eff_eta_after_tfcand_q1"); -h_eff_eta_after_tfcand_q2 = (TH1D*) h_eta_after_tfcand_q2->Clone("h_eff_eta_after_tfcand_q2"); -h_eff_eta_after_tfcand_q3 = (TH1D*) h_eta_after_tfcand_q3->Clone("h_eff_eta_after_tfcand_q3"); -h_eff_eta_after_tfcand_ok = (TH1D*) h_eta_after_tfcand_ok->Clone("h_eff_eta_after_tfcand_ok"); -h_eff_eta_after_tfcand_ok_plus = (TH1D*) h_eta_after_tfcand_ok_plus->Clone("h_eff_eta_after_tfcand_ok_plus"); -h_eff_eta_after_tfcand_ok_pt10 = (TH1D*) h_eta_after_tfcand_ok_pt10->Clone("h_eff_eta_after_tfcand_ok_pt10"); -h_eff_eta_after_tfcand_ok_plus_pt10 = (TH1D*) h_eta_after_tfcand_ok_plus_pt10->Clone("h_eff_eta_after_tfcand_ok_plus_pt10"); - -h_eff_eta_after_tfcand_all = (TH1D*) h_eta_after_tfcand_all->Clone("h_eff_eta_after_tfcand_all"); -h_eff_eta_after_tfcand_all_pt10 = (TH1D*) h_eta_after_tfcand_all_pt10->Clone("h_eff_eta_after_tfcand_all_pt10"); - -h_eff_eta_after_gmtreg = (TH1D*) h_eta_after_gmtreg->Clone("h_eff_eta_after_gmtreg"); -h_eff_eta_after_gmtreg_all = (TH1D*) h_eta_after_gmtreg_all->Clone("h_eff_eta_after_gmtreg_all"); -h_eff_eta_after_gmtreg_dr = (TH1D*) h_eta_after_gmtreg_dr->Clone("h_eff_eta_after_gmtreg_dr"); -h_eff_eta_after_gmt = (TH1D*) h_eta_after_gmt->Clone("h_eff_eta_after_gmt"); -h_eff_eta_after_gmt_all = (TH1D*) h_eta_after_gmt_all->Clone("h_eff_eta_after_gmt_all"); -h_eff_eta_after_xtra = (TH1D*) h_eta_after_xtra->Clone("h_eff_eta_after_xtra"); -h_eff_eta_after_xtra_all = (TH1D*) h_eta_after_xtra_all->Clone("h_eff_eta_after_xtra_all"); -h_eff_eta_after_xtra_dr = (TH1D*) h_eta_after_xtra_dr->Clone("h_eff_eta_after_xtra_dr"); - -h_eff_eta_after_tfcand_pt10 = (TH1D*) h_eta_after_tfcand_pt10->Clone("h_eff_eta_after_tfcand_pt10"); -h_eff_eta_after_tfcand_my_st1 = (TH1D*) h_eta_after_tfcand_my_st1->Clone("h_eff_eta_after_tfcand_my_st1"); -h_eff_eta_after_tfcand_org_st1 = (TH1D*) h_eta_after_tfcand_org_st1->Clone("h_eff_eta_after_tfcand_org_st1"); -h_eff_eta_after_tfcand_comm_st1 = (TH1D*) h_eta_after_tfcand_comm_st1->Clone("h_eff_eta_after_tfcand_comm_st1"); -h_eff_eta_after_tfcand_my_st1_pt10 = (TH1D*) h_eta_after_tfcand_my_st1_pt10->Clone("h_eff_eta_after_tfcand_my_st1_pt10"); -h_eff_eta_after_gmtreg_pt10 = (TH1D*) h_eta_after_gmtreg_pt10->Clone("h_eff_eta_after_gmtreg_pt10"); -h_eff_eta_after_gmtreg_dr_pt10 = (TH1D*) h_eta_after_gmtreg_dr_pt10->Clone("h_eff_eta_after_gmtreg_dr_pt10"); -h_eff_eta_after_gmt_pt10 = (TH1D*) h_eta_after_gmt_pt10->Clone("h_eff_eta_after_gmt_pt10"); -h_eff_eta_after_xtra_dr_pt10 = (TH1D*) h_eta_after_xtra_dr_pt10->Clone("h_eff_eta_after_xtra_dr_pt10"); - -h_eff_eta_me1_after_alct = (TH1D*) h_eta_me1_after_alct->Clone("h_eff_eta_me1_after_alct"); -h_eff_eta_me1_after_alct_okAlct = (TH1D*) h_eta_me1_after_alct_okAlct->Clone("h_eff_eta_me1_after_alct_okAlct"); -h_eff_eta_me1_after_clct = (TH1D*) h_eta_me1_after_clct->Clone("h_eff_eta_me1_after_clct"); -h_eff_eta_me1_after_clct_okClct = (TH1D*) h_eta_me1_after_clct_okClct->Clone("h_eff_eta_me1_after_clct_okClct"); -h_eff_eta_me1_after_alctclct = (TH1D*) h_eta_me1_after_alctclct->Clone("h_eff_eta_me1_after_alctclct"); -h_eff_eta_me1_after_alctclct_okAlct = (TH1D*) h_eta_me1_after_alctclct_okAlct->Clone("h_eff_eta_me1_after_alctclct_okAlct"); -h_eff_eta_me1_after_alctclct_okClct = (TH1D*) h_eta_me1_after_alctclct_okClct->Clone("h_eff_eta_me1_after_alctclct_okClct"); -h_eff_eta_me1_after_alctclct_okAlctClct = (TH1D*) h_eta_me1_after_alctclct_okAlctClct->Clone("h_eff_eta_me1_after_alctclct_okAlctClct"); - -h_eff_eta_me1_after_lct = (TH1D*) h_eta_me1_after_lct->Clone("h_eff_eta_me1_after_lct"); -h_eff_eta_me1_after_lct_okAlct = (TH1D*) h_eta_me1_after_lct_okAlct->Clone("h_eff_eta_me1_after_lct_okAlct"); -h_eff_eta_me1_after_lct_okAlctClct = (TH1D*) h_eta_me1_after_lct_okAlctClct->Clone("h_eff_eta_me1_after_lct_okAlctClct"); -h_eff_eta_me1_after_lct_okClct = (TH1D*) h_eta_me1_after_lct_okClct->Clone("h_eff_eta_me1_after_lct_okClct"); -h_eff_eta_me1_after_lct_okClctAlct = (TH1D*) h_eta_me1_after_lct_okClctAlct->Clone("h_eff_eta_me1_after_lct_okClctAlct"); -h_eff_eta_me1_after_mplct_okAlctClct = (TH1D*) h_eta_me1_after_mplct_okAlctClct->Clone("h_eff_eta_me1_after_mplct_okAlctClct"); -h_eff_eta_me1_after_mplct_okAlctClct_plus = (TH1D*) h_eta_me1_after_mplct_okAlctClct_plus->Clone("h_eff_eta_me1_after_mplct_okAlctClct_plus"); -h_eff_eta_me1_after_tf_ok = (TH1D*) h_eta_me1_after_tf_ok->Clone("h_eff_eta_me1_after_tf_ok"); -h_eff_eta_me1_after_tf_ok_pt10 = (TH1D*) h_eta_me1_after_tf_ok_pt10->Clone("h_eff_eta_me1_after_tf_ok_pt10"); -h_eff_eta_me1_after_tf_ok_plus = (TH1D*) h_eta_me1_after_tf_ok_plus->Clone("h_eff_eta_me1_after_tf_ok_plus"); -h_eff_eta_me1_after_tf_ok_plus_pt10 = (TH1D*) h_eta_me1_after_tf_ok_plus_pt10->Clone("h_eff_eta_me1_after_tf_ok_plus_pt10"); - - -h_eta_initial->Sumw2(); -h_eff_eta_after_mpc_st1->Sumw2(); -h_eff_eta_after_tfcand_my_st1->Sumw2(); -h_eff_eta_me1_after_alctclct_okAlctClct->Sumw2(); -h_eff_eta_me1_after_lct_okClctAlct->Sumw2(); - -h_eff_eta_after_mpc->Divide(h_eff_eta_after_mpc,h_eta_initial); -h_eff_eta_after_mpc_st1->Divide(h_eff_eta_after_mpc_st1,h_eta_initial,1,1,"B"); -h_eff_eta_after_mpc_st1_good->Divide(h_eff_eta_after_mpc_st1_good,h_eta_initial,1,1,"B"); -h_eff_eta_after_mpc_ok->Divide(h_eff_eta_after_mpc_ok,h_eta_initial); -h_eff_eta_after_mpc_ok_plus->Divide(h_eff_eta_after_mpc_ok_plus,h_eta_initial); - -h_eff_eta_after_tftrack->Divide(h_eff_eta_after_tftrack,h_eta_initial); -h_eff_eta_after_tfcand->Divide(h_eff_eta_after_tfcand,h_eta_initial); -h_eff_eta_after_tfcand_q1->Divide(h_eff_eta_after_tfcand_q1,h_eta_initial); -h_eff_eta_after_tfcand_q2->Divide(h_eff_eta_after_tfcand_q2,h_eta_initial); -h_eff_eta_after_tfcand_q3->Divide(h_eff_eta_after_tfcand_q3,h_eta_initial); -h_eff_eta_after_tfcand_ok->Divide(h_eff_eta_after_tfcand_ok,h_eta_initial); -h_eff_eta_after_tfcand_ok_plus->Divide(h_eff_eta_after_tfcand_ok_plus,h_eta_initial); -h_eff_eta_after_tfcand_ok_pt10->Divide(h_eff_eta_after_tfcand_ok_pt10,h_eta_initial); -h_eff_eta_after_tfcand_ok_plus_pt10->Divide(h_eff_eta_after_tfcand_ok_plus_pt10,h_eta_initial); -h_eff_eta_after_tfcand_all ->Divide(h_eff_eta_after_tfcand_all,h_eta_initial); -h_eff_eta_after_tfcand_all_pt10->Divide(h_eff_eta_after_tfcand_all_pt10,h_eta_initial); - -h_eff_eta_after_gmtreg ->Divide(h_eff_eta_after_gmtreg,h_eta_initial); -h_eff_eta_after_gmtreg_all->Divide(h_eff_eta_after_gmtreg_all,h_eta_initial); -h_eff_eta_after_gmtreg_dr ->Divide(h_eff_eta_after_gmtreg_dr,h_eta_initial); -h_eff_eta_after_gmt ->Divide(h_eff_eta_after_gmt,h_eta_initial); -h_eff_eta_after_gmt_all ->Divide(h_eff_eta_after_gmt_all,h_eta_initial); -h_eff_eta_after_xtra ->Divide(h_eff_eta_after_xtra,h_eta_initial); -h_eff_eta_after_xtra_all ->Divide(h_eff_eta_after_xtra_all,h_eta_initial); -h_eff_eta_after_xtra_dr ->Divide(h_eff_eta_after_xtra_dr,h_eta_initial); - -h_eff_eta_after_tfcand_pt10 ->Divide(h_eff_eta_after_tfcand_pt10,h_eta_initial,1,1,"B"); -h_eff_eta_after_tfcand_my_st1 ->Divide(h_eff_eta_after_tfcand_my_st1,h_eta_initial,1,1,"B"); -h_eff_eta_after_tfcand_org_st1 ->Divide(h_eff_eta_after_tfcand_org_st1,h_eta_initial,1,1,"B"); -h_eff_eta_after_tfcand_comm_st1 ->Divide(h_eff_eta_after_tfcand_comm_st1,h_eta_initial,1,1,"B"); -h_eff_eta_after_tfcand_my_st1_pt10 ->Divide(h_eff_eta_after_tfcand_my_st1_pt10,h_eta_initial,1,1,"B"); -h_eff_eta_after_gmtreg_pt10 ->Divide(h_eff_eta_after_gmtreg_pt10,h_eta_initial); -h_eff_eta_after_gmtreg_dr_pt10 ->Divide(h_eff_eta_after_gmtreg_dr_pt10,h_eta_initial); -h_eff_eta_after_gmt_pt10 ->Divide(h_eff_eta_after_gmt_pt10,h_eta_initial); -h_eff_eta_after_xtra_dr_pt10 ->Divide(h_eff_eta_after_xtra_dr_pt10,h_eta_initial); - - -h_eff_eta_me1_after_alct->Divide(h_eff_eta_me1_after_alct,h_eta_initial); -h_eff_eta_me1_after_alct_okAlct->Divide(h_eff_eta_me1_after_alct_okAlct,h_eta_initial); -h_eff_eta_me1_after_clct->Divide(h_eff_eta_me1_after_clct,h_eta_initial); -h_eff_eta_me1_after_clct_okClct->Divide(h_eff_eta_me1_after_clct_okClct,h_eta_initial); -h_eff_eta_me1_after_alctclct->Divide(h_eff_eta_me1_after_alctclct,h_eta_initial); -h_eff_eta_me1_after_alctclct_okAlct->Divide(h_eff_eta_me1_after_alctclct_okAlct,h_eta_initial); -h_eff_eta_me1_after_alctclct_okClct->Divide(h_eff_eta_me1_after_alctclct_okClct,h_eta_initial); -h_eff_eta_me1_after_alctclct_okAlctClct->Divide(h_eff_eta_me1_after_alctclct_okAlctClct,h_eta_initial); - -h_eff_eta_me1_after_lct ->Divide(h_eff_eta_me1_after_lct,h_eta_initial); -h_eff_eta_me1_after_lct_okAlct ->Divide(h_eff_eta_me1_after_lct_okAlct,h_eta_initial); -h_eff_eta_me1_after_lct_okAlctClct->Divide(h_eff_eta_me1_after_lct_okAlctClct,h_eta_initial); -h_eff_eta_me1_after_lct_okClct ->Divide(h_eff_eta_me1_after_lct_okClct,h_eta_initial); -h_eff_eta_me1_after_lct_okClctAlct->Divide(h_eff_eta_me1_after_lct_okClctAlct,h_eta_initial); -h_eff_eta_me1_after_mplct_okAlctClct->Divide(h_eff_eta_me1_after_mplct_okAlctClct,h_eta_initial); -h_eff_eta_me1_after_mplct_okAlctClct_plus->Divide(h_eff_eta_me1_after_mplct_okAlctClct_plus,h_eta_initial); -h_eff_eta_me1_after_tf_ok ->Divide(h_eff_eta_me1_after_tf_ok,h_eta_initial); -h_eff_eta_me1_after_tf_ok_pt10 ->Divide(h_eff_eta_me1_after_tf_ok_pt10,h_eta_initial); -h_eff_eta_me1_after_tf_ok_plus ->Divide(h_eff_eta_me1_after_tf_ok_plus,h_eta_initial); -h_eff_eta_me1_after_tf_ok_plus_pt10 ->Divide(h_eff_eta_me1_after_tf_ok_plus_pt10,h_eta_initial); - - - -//h_eff_eta_after_mpc->SetFillColor(7); -//h_eff_eta_after_tftrack->SetFillColor(8); -// -//h_eff_eta_after_tfcand ->SetFillColor(1); -//h_eff_eta_after_tfcand_q1->SetFillColor(2); -//h_eff_eta_after_tfcand_q2->SetFillColor(3); -//h_eff_eta_after_tfcand_q3->SetFillColor(4); -// -//h_eff_eta_after_tfcand_all ->SetFillColor(5); - - -TCanvas* c2 = new TCanvas("h_eff_eta","h_eff_eta",900,900 ) ; -c2->Divide(2,2); -c2->cd(1); -h_eff_eta_after_mpc->GetXaxis()->SetRangeUser(0.9,2.5); -h_eff_eta_after_mpc->Draw("hist"); -//h_eff_eta_after_mpc_ok->Draw("same hist"); -h_eff_eta_after_mpc_ok_plus->Draw("same hist"); -//h_eff_eta_after_tftrack->Draw("same hist"); -h_eff_eta_after_tfcand->Draw("same hist"); -//h_eff_eta_after_tfcand_ok->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus->Draw("same hist"); -h_eff_eta_after_tfcand_ok_plus_pt10->Draw("same hist"); - -c2->cd(2); -h_eff_eta_after_tfcand->GetXaxis()->SetRangeUser(0.9,2.5); -h_eff_eta_after_tfcand ->Draw("hist"); -h_eff_eta_after_tfcand_q1->Draw("same hist"); -h_eff_eta_after_tfcand_q2->Draw("same hist"); -h_eff_eta_after_tfcand_q3->Draw("same hist"); -c2->cd(3); -h_eff_eta_after_tfcand_all ->GetXaxis()->SetRangeUser(0.9,2.5); -h_eff_eta_after_tfcand_all ->Draw("hist"); -h_eff_eta_after_tfcand->Draw("same hist"); -c2->cd(2); -Print(c2,"h_eff_eta" + ext); - - -h_eff_eta_after_mpc->SetLineColor(kBlack); -h_eff_eta_after_mpc_st1->SetLineColor(kBlack+2); -h_eff_eta_after_mpc_st1_good->SetLineColor(kBlack+4); -h_eff_eta_after_tftrack->SetLineColor(kViolet-2); -h_eff_eta_after_tfcand->SetLineColor(kBlue); -h_eff_eta_after_gmtreg->SetLineColor(kMagenta-2); -h_eff_eta_after_gmtreg_dr->SetLineColor(kOrange-3); -h_eff_eta_after_gmt->SetLineColor(kGreen+1); -h_eff_eta_after_xtra->SetLineColor(kPink-4); -h_eff_eta_after_xtra_dr->SetLineColor(kRed); - -h_eff_eta_after_tfcand_all ->SetLineColor(kBlue); -h_eff_eta_after_gmtreg_all->SetLineColor(kMagenta-2); -h_eff_eta_after_gmt_all->SetLineColor(kGreen+1); -h_eff_eta_after_xtra_all->SetLineColor(kPink-4); - - -h_eff_eta_after_tfcand_pt10 ->SetLineColor(kBlue); -h_eff_eta_after_tfcand_my_st1 ->SetLineColor(kBlue); -h_eff_eta_after_tfcand_org_st1 ->SetLineColor(kBlue); -h_eff_eta_after_tfcand_comm_st1 ->SetLineColor(kBlue); -h_eff_eta_after_tfcand_my_st1_pt10 ->SetLineColor(30); -h_eff_eta_after_gmtreg_pt10 ->SetLineColor(kMagenta-2); -h_eff_eta_after_gmtreg_dr_pt10 ->SetLineColor(kOrange-3); -h_eff_eta_after_gmt_pt10 ->SetLineColor(kGreen+1); -h_eff_eta_after_xtra_dr_pt10 ->SetLineColor(kRed); - -h_eff_eta_after_mpc_st1_good->SetLineStyle(7); - -h_eff_eta_after_tfcand_pt10 ->SetLineStyle(7); -h_eff_eta_after_tfcand_my_st1 ->SetLineStyle(7); -h_eff_eta_after_tfcand_org_st1 ->SetLineStyle(3); -h_eff_eta_after_tfcand_comm_st1->SetLineStyle(2); -h_eff_eta_after_tfcand_my_st1_pt10->SetLineStyle(7); -h_eff_eta_after_gmtreg_pt10 ->SetLineStyle(7); -h_eff_eta_after_gmtreg_dr_pt10 ->SetLineStyle(7); -h_eff_eta_after_gmt_pt10 ->SetLineStyle(7); -h_eff_eta_after_xtra_dr_pt10 ->SetLineStyle(7); - -h_eff_eta_after_mpc->SetTitle("L1 CSC trigger efficiency dependence on #eta"); -h_eff_eta_after_mpc->GetXaxis()->SetRangeUser(0.85,2.5); -h_eff_eta_after_mpc->GetXaxis()->SetTitle("#eta"); -h_eff_eta_after_mpc->SetMinimum(0); - - - -/* -TCanvas* c22 = new TCanvas("h_eff_eta_steps","h_eff_eta_steps",1200,900 ) ; -c22->Divide(1,2); -c22->cd(1); -h_eff_eta_after_mpc->Draw("hist"); -//h_eff_eta_after_tftrack->Draw("same"); -h_eff_eta_after_tfcand->Draw("same"); -//h_eff_eta_after_gmtreg->Draw("same"); -h_eff_eta_after_gmt->Draw("same"); -//h_eff_eta_after_xtra->Draw("same"); -h_eff_eta_after_xtra_dr->Draw("same"); -leg = new TLegend(0.7815507,0.1702982,0.9846086,0.5740635,NULL,"brNDC"); -//leg->SetTextFont(12); -leg->SetBorderSize(0); -leg->SetTextFont(12); -leg->SetLineColor(1); -leg->SetLineStyle(1); -leg->SetLineWidth(1); -leg->SetFillColor(19); -leg->SetFillStyle(0); -leg->AddEntry(h_eff_eta_after_mpc,"h_eff_eta_after_mpc","pl"); -//leg->AddEntry(h_eff_eta_after_tftrack,"h_eff_eta_after_tftrack","pl"); -leg->AddEntry(h_eff_eta_after_tfcand,"h_eff_eta_after_tfcand","pl"); -//leg->AddEntry(h_eff_eta_after_gmtreg,"h_eff_eta_after_gmtreg","pl"); -leg->AddEntry(h_eff_eta_after_gmt,"h_eff_eta_after_gmt","pl"); -//leg->AddEntry(h_eff_eta_after_xtra,"h_eff_eta_after_xtra","pl"); -leg->AddEntry(h_eff_eta_after_xtra_dr,"h_eff_eta_after_xtra_dr","pl"); -leg->Draw(); -c22->cd(2); -h_eff_eta_after_mpc->GetXaxis()->SetRangeUser(0.9,2.5); -h_eff_eta_after_mpc->Draw("hist"); -//h_eff_eta_after_tftrack->Draw("same"); -h_eff_eta_after_tfcand_all->Draw("same"); -//h_eff_eta_after_gmtreg_all->Draw("same"); -h_eff_eta_after_gmt_all->Draw("same"); -//h_eff_eta_after_xtra_all->Draw("same"); -h_eff_eta_after_xtra_dr->Draw("same"); -leg = new TLegend(0.7815507,0.1702982,0.9846086,0.5740635,NULL,"brNDC"); -//leg->SetTextFont(12); -leg->SetBorderSize(0); -leg->SetTextFont(12); -leg->SetLineColor(1); -leg->SetLineStyle(1); -leg->SetLineWidth(1); -leg->SetFillColor(19); -leg->SetFillStyle(0); -leg->AddEntry(h_eff_eta_after_mpc,"h_eff_eta_after_mpc","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_all,"h_eff_eta_after_tfcand_all","pl"); -//leg->AddEntry(h_eff_eta_after_gmtreg_all,"h_eff_eta_after_gmtreg_all","pl"); -leg->AddEntry(h_eff_eta_after_gmt_all,"h_eff_eta_after_gmt_all","pl"); -//leg->AddEntry(h_eff_eta_after_xtra_all,"h_eff_eta_after_xtra_all","pl"); -leg->AddEntry(h_eff_eta_after_xtra_dr,"h_eff_eta_after_xtra_dr","pl"); -leg->Draw("hist"); -Print(c22,"h_eff_eta_step.eps"); -*/ - -/* // commented on 10/21/09 -TCanvas* c22x = new TCanvas("h_eff_eta_steps_full","h_eff_eta_steps_full",1000,600 ) ; - -h_eff_eta_after_mpc->Draw("hist"); -////h_eff_eta_after_tftrack->Draw("same"); -h_eff_eta_after_tfcand->Draw("same"); -h_eff_eta_after_gmtreg->Draw("same"); -//h_eff_eta_after_gmtreg_dr->Draw("same"); -h_eff_eta_after_gmt->Draw("same"); -////h_eff_eta_after_xtra->Draw("same"); -//h_eff_eta_after_xtra_dr->Draw("same"); - -//h_eff_eta_after_tfcand_pt10 ->Draw("same"); -//h_eff_eta_after_gmtreg_pt10 ->Draw("same"); -////h_eff_eta_after_gmtreg_dr_pt10 ->Draw("same"); -//h_eff_eta_after_gmt_pt10 ->Draw("same"); -//h_eff_eta_after_xtra_dr_pt10 ->Draw("same"); - -TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); -//leg->SetTextFont(12); -leg->SetBorderSize(0); -//leg->SetTextFont(12); -leg->SetFillStyle(0); - -leg->SetHeader("Efficiency after"); -leg->AddEntry(h_eff_eta_after_mpc,"match to MPC","pl"); -//leg->AddEntry(h_eff_eta_after_tftrack,"h_eff_eta_after_tftrack","pl"); -leg->AddEntry(h_eff_eta_after_tfcand,"match to MPC & TF track","pl"); -leg->AddEntry(h_eff_eta_after_gmtreg,"match to MPC & TF trk & CSC GMT trk","pl"); -//leg->AddEntry(h_eff_eta_after_gmtreg_dr,"#Delta R match to CSC GMT trk","pl"); -leg->AddEntry(h_eff_eta_after_gmt,"match to MPC & TF trk & GMT trk","pl"); -//leg->AddEntry(h_eff_eta_after_xtra,"h_eff_eta_after_xtra","pl"); -//leg->AddEntry(h_eff_eta_after_xtra_dr,"#Delta R match to GMT","pl"); -//leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); - -leg->Draw(); -Print(c22x,"h_eff_eta_steps_full.eps"); -Print(c22x,"h_eff_eta_steps_full" + ext); -*/ - -if (h_eff_eta_steps_full10) { - -TCanvas* c22x10 = new TCanvas("h_eff_eta_steps_full10","h_eff_eta_steps_full10",1000,600 ) ; - -h_eff_eta_after_mpc->Draw("hist"); -h_eff_eta_after_tfcand_pt10 ->Draw("same hist"); -h_eff_eta_after_gmtreg_pt10 ->Draw("same hist"); -h_eff_eta_after_gmt_pt10 ->Draw("same hist"); -//h_eff_eta_after_xtra_dr_pt10 ->Draw("same hist"); - -TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); - -leg->SetHeader("With additional TF cut p_{T}>10 Efficiency after"); -leg->AddEntry(h_eff_eta_after_mpc,"match to MPC","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_pt10,"match to MPC & TF track","pl"); -leg->AddEntry(h_eff_eta_after_gmtreg_pt10,"match to MPC & TF trk & CSC GMT trk","pl"); -leg->AddEntry(h_eff_eta_after_gmt_pt10,"match to MPC & TF trk & GMT trk","pl"); -//leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); - -leg->Draw(); -Print(c22x10,"h_eff_eta_steps_full10.eps"); -Print(c22x10,"h_eff_eta_steps_full10" + ext); -Print(c22x10,"h_eff_eta_steps_full10.pdf"); + h_eta_after_tfcand = (TH1D*)getH(dir,"h_eta_after_tfcand"); + h_eta_after_tfcand_q1 = (TH1D*)getH(dir,"h_eta_after_tfcand_q1"); + h_eta_after_tfcand_q2 = (TH1D*)getH(dir,"h_eta_after_tfcand_q2"); + h_eta_after_tfcand_q3 = (TH1D*)getH(dir,"h_eta_after_tfcand_q3"); + h_eta_after_tfcand_ok = (TH1D*)getH(dir,"h_eta_after_tfcand_ok"); + h_eta_after_tfcand_ok_plus = (TH1D*)getH(dir,"h_eta_after_tfcand_ok_plus"); + h_eta_after_tfcand_ok_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_ok_pt10"); + h_eta_after_tfcand_ok_plus_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_ok_plus_pt10"); + + h_eta_after_tfcand_all = (TH1D*)getH(dir,"h_eta_after_tfcand_all"); + h_eta_after_tfcand_all_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_all_pt10"); + + h_eta_after_gmtreg = (TH1D*)getH(dir,"h_eta_after_gmtreg"); + h_eta_after_gmtreg_all = (TH1D*)getH(dir,"h_eta_after_gmtreg_all"); + h_eta_after_gmtreg_dr = (TH1D*)getH(dir,"h_eta_after_gmtreg_dr"); + h_eta_after_gmt = (TH1D*)getH(dir,"h_eta_after_gmt"); + h_eta_after_gmt_all = (TH1D*)getH(dir,"h_eta_after_gmt_all"); + h_eta_after_xtra = (TH1D*)getH(dir,"h_eta_after_xtra"); + h_eta_after_xtra_all = (TH1D*)getH(dir,"h_eta_after_xtra_all"); + h_eta_after_xtra_dr = (TH1D*)getH(dir,"h_eta_after_xtra_dr"); + + h_eta_after_tfcand_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_pt10"); + h_eta_after_tfcand_my_st1 = (TH1D*)getH(dir,"h_eta_after_tfcand_my_st1"); + h_eta_after_tfcand_org_st1 = (TH1D*)getH(dir,"h_eta_after_tfcand_org_st1"); + h_eta_after_tfcand_comm_st1 = (TH1D*)getH(dir,"h_eta_after_tfcand_comm_st1"); + h_eta_after_tfcand_my_st1_pt10 = (TH1D*)getH(dir,"h_eta_after_tfcand_my_st1_pt10"); + h_eta_after_gmtreg_dr_pt10 = (TH1D*)getH(dir,"h_eta_after_gmtreg_dr_pt10"); + h_eta_after_gmtreg_pt10= (TH1D*)getH(dir,"h_eta_after_gmtreg_pt10"); + h_eta_after_gmt_pt10 = (TH1D*)getH(dir,"h_eta_after_gmt_pt10"); + h_eta_after_xtra_dr_pt10 = (TH1D*)getH(dir,"h_eta_after_xtra_dr_pt10"); + + // = (TH1D*)getH(dir,""); + + h_eta_me1_after_alct = (TH1D*)getH(dir,"h_eta_me1_after_alct"); + h_eta_me1_after_alct_okAlct = (TH1D*)getH(dir,"h_eta_me1_after_alct_okAlct"); + h_eta_me1_after_clct = (TH1D*)getH(dir,"h_eta_me1_after_clct"); + h_eta_me1_after_clct_okClct = (TH1D*)getH(dir,"h_eta_me1_after_clct_okClct"); + h_eta_me1_after_alctclct = (TH1D*)getH(dir,"h_eta_me1_after_alctclct"); + h_eta_me1_after_alctclct_okAlct = (TH1D*)getH(dir,"h_eta_me1_after_alctclct_okAlct"); + h_eta_me1_after_alctclct_okClct = (TH1D*)getH(dir,"h_eta_me1_after_alctclct_okClct"); + h_eta_me1_after_alctclct_okAlctClct = (TH1D*)getH(dir,"h_eta_me1_after_alctclct_okAlctClct"); + + h_eta_me1_after_lct = (TH1D*)getH(dir,"h_eta_me1_after_lct"); + h_eta_me1_after_lct_okAlct = (TH1D*)getH(dir,"h_eta_me1_after_lct_okAlct"); + h_eta_me1_after_lct_okAlctClct = (TH1D*)getH(dir,"h_eta_me1_after_lct_okAlctClct"); + h_eta_me1_after_lct_okClct = (TH1D*)getH(dir,"h_eta_me1_after_lct_okClct"); + h_eta_me1_after_lct_okClctAlct = (TH1D*)getH(dir,"h_eta_me1_after_lct_okClctAlct"); + h_eta_me1_after_mplct_okAlctClct = (TH1D*)getH(dir,"h_eta_me1_after_mplct_okAlctClct"); + h_eta_me1_after_mplct_okAlctClct_plus = (TH1D*)getH(dir,"h_eta_me1_after_mplct_okAlctClct_plus"); + h_eta_me1_after_tf_ok = (TH1D*)getH(dir,"h_eta_me1_after_tf_ok"); + h_eta_me1_after_tf_ok_pt10 = (TH1D*)getH(dir,"h_eta_me1_after_tf_ok_pt10"); + h_eta_me1_after_tf_ok_plus = (TH1D*)getH(dir,"h_eta_me1_after_tf_ok_plus"); + h_eta_me1_after_tf_ok_plus_pt10 = (TH1D*)getH(dir,"h_eta_me1_after_tf_ok_plus_pt10"); + + + + myRebin(h_eta_initial,etareb); + myRebin(h_eta_after_mpc,etareb); + myRebin(h_eta_after_mpc_st1,etareb); + myRebin(h_eta_after_mpc_st1_good,etareb); + myRebin(h_eta_after_mpc_ok,etareb); + myRebin(h_eta_after_mpc_ok_plus,etareb); + myRebin(h_eta_after_tftrack,etareb); + + myRebin(h_eta_after_tfcand,etareb); + myRebin(h_eta_after_tfcand_q1,etareb); + myRebin(h_eta_after_tfcand_q2,etareb); + myRebin(h_eta_after_tfcand_q3,etareb); + myRebin(h_eta_after_tfcand_ok,etareb); + myRebin(h_eta_after_tfcand_ok_plus,etareb); + myRebin(h_eta_after_tfcand_ok_pt10,etareb); + myRebin(h_eta_after_tfcand_ok_plus_pt10,etareb); + + myRebin(h_eta_after_tfcand_all,etareb); + myRebin(h_eta_after_tfcand_all_pt10,etareb); + + myRebin(h_eta_after_gmtreg ,etareb); + myRebin(h_eta_after_gmtreg_all,etareb); + myRebin(h_eta_after_gmtreg_dr ,etareb); + myRebin(h_eta_after_gmt ,etareb); + myRebin(h_eta_after_gmt_all ,etareb); + myRebin(h_eta_after_xtra ,etareb); + myRebin(h_eta_after_xtra_all ,etareb); + myRebin(h_eta_after_xtra_dr ,etareb); + + myRebin(h_eta_after_tfcand_pt10,etareb); + myRebin(h_eta_after_tfcand_my_st1,etareb); + myRebin(h_eta_after_tfcand_org_st1,etareb); + myRebin(h_eta_after_tfcand_comm_st1,etareb); + myRebin(h_eta_after_tfcand_my_st1_pt10,etareb); + myRebin(h_eta_after_gmtreg_pt10 ,etareb); + myRebin(h_eta_after_gmtreg_dr_pt10 ,etareb); + myRebin(h_eta_after_gmt_pt10 ,etareb); + myRebin(h_eta_after_xtra_dr_pt10 ,etareb); + + myRebin(h_eta_me1_after_alct,etareb); + myRebin(h_eta_me1_after_alct_okAlct,etareb); + myRebin(h_eta_me1_after_clct,etareb); + myRebin(h_eta_me1_after_clct_okClct,etareb); + myRebin(h_eta_me1_after_alctclct,etareb); + myRebin(h_eta_me1_after_alctclct_okAlct,etareb); + myRebin(h_eta_me1_after_alctclct_okClct,etareb); + myRebin(h_eta_me1_after_alctclct_okAlctClct,etareb); + + myRebin(h_eta_me1_after_lct ,etareb); + myRebin(h_eta_me1_after_lct_okAlct ,etareb); + myRebin(h_eta_me1_after_lct_okAlctClct ,etareb); + myRebin(h_eta_me1_after_lct_okClct ,etareb); + myRebin(h_eta_me1_after_lct_okClctAlct ,etareb); + myRebin(h_eta_me1_after_mplct_okAlctClct ,etareb); + myRebin(h_eta_me1_after_mplct_okAlctClct_plus ,etareb); + myRebin(h_eta_me1_after_tf_ok ,etareb); + myRebin(h_eta_me1_after_tf_ok_pt10 ,etareb); + myRebin(h_eta_me1_after_tf_ok_plus ,etareb); + myRebin(h_eta_me1_after_tf_ok_plus_pt10 ,etareb); + + h_eff_eta_after_mpc = (TH1D*) h_eta_after_mpc->Clone("h_eff_eta_after_mpc"); + h_eff_eta_after_mpc_st1 = (TH1D*) h_eta_after_mpc_st1->Clone("h_eff_eta_after_mpc_st1"); + h_eff_eta_after_mpc_st1_good = (TH1D*) h_eta_after_mpc_st1_good->Clone("h_eff_eta_after_mpc_st1_good"); + h_eff_eta_after_mpc_ok = (TH1D*) h_eta_after_mpc_ok->Clone("h_eff_eta_after_mpc_ok"); + h_eff_eta_after_mpc_ok_plus = (TH1D*) h_eta_after_mpc_ok_plus->Clone("h_eff_eta_after_mpc_ok_plus"); + h_eff_eta_after_tftrack = (TH1D*) h_eta_after_tftrack->Clone("h_eff_eta_after_tftrack"); + + h_eff_eta_after_tfcand = (TH1D*) h_eta_after_tfcand->Clone("h_eff_eta_after_tfcand"); + h_eff_eta_after_tfcand_q1 = (TH1D*) h_eta_after_tfcand_q1->Clone("h_eff_eta_after_tfcand_q1"); + h_eff_eta_after_tfcand_q2 = (TH1D*) h_eta_after_tfcand_q2->Clone("h_eff_eta_after_tfcand_q2"); + h_eff_eta_after_tfcand_q3 = (TH1D*) h_eta_after_tfcand_q3->Clone("h_eff_eta_after_tfcand_q3"); + h_eff_eta_after_tfcand_ok = (TH1D*) h_eta_after_tfcand_ok->Clone("h_eff_eta_after_tfcand_ok"); + h_eff_eta_after_tfcand_ok_plus = (TH1D*) h_eta_after_tfcand_ok_plus->Clone("h_eff_eta_after_tfcand_ok_plus"); + h_eff_eta_after_tfcand_ok_pt10 = (TH1D*) h_eta_after_tfcand_ok_pt10->Clone("h_eff_eta_after_tfcand_ok_pt10"); + h_eff_eta_after_tfcand_ok_plus_pt10 = (TH1D*) h_eta_after_tfcand_ok_plus_pt10->Clone("h_eff_eta_after_tfcand_ok_plus_pt10"); + + h_eff_eta_after_tfcand_all = (TH1D*) h_eta_after_tfcand_all->Clone("h_eff_eta_after_tfcand_all"); + h_eff_eta_after_tfcand_all_pt10 = (TH1D*) h_eta_after_tfcand_all_pt10->Clone("h_eff_eta_after_tfcand_all_pt10"); + + h_eff_eta_after_gmtreg = (TH1D*) h_eta_after_gmtreg->Clone("h_eff_eta_after_gmtreg"); + h_eff_eta_after_gmtreg_all = (TH1D*) h_eta_after_gmtreg_all->Clone("h_eff_eta_after_gmtreg_all"); + h_eff_eta_after_gmtreg_dr = (TH1D*) h_eta_after_gmtreg_dr->Clone("h_eff_eta_after_gmtreg_dr"); + h_eff_eta_after_gmt = (TH1D*) h_eta_after_gmt->Clone("h_eff_eta_after_gmt"); + h_eff_eta_after_gmt_all = (TH1D*) h_eta_after_gmt_all->Clone("h_eff_eta_after_gmt_all"); + h_eff_eta_after_xtra = (TH1D*) h_eta_after_xtra->Clone("h_eff_eta_after_xtra"); + h_eff_eta_after_xtra_all = (TH1D*) h_eta_after_xtra_all->Clone("h_eff_eta_after_xtra_all"); + h_eff_eta_after_xtra_dr = (TH1D*) h_eta_after_xtra_dr->Clone("h_eff_eta_after_xtra_dr"); + + h_eff_eta_after_tfcand_pt10 = (TH1D*) h_eta_after_tfcand_pt10->Clone("h_eff_eta_after_tfcand_pt10"); + h_eff_eta_after_tfcand_my_st1 = (TH1D*) h_eta_after_tfcand_my_st1->Clone("h_eff_eta_after_tfcand_my_st1"); + h_eff_eta_after_tfcand_org_st1 = (TH1D*) h_eta_after_tfcand_org_st1->Clone("h_eff_eta_after_tfcand_org_st1"); + h_eff_eta_after_tfcand_comm_st1 = (TH1D*) h_eta_after_tfcand_comm_st1->Clone("h_eff_eta_after_tfcand_comm_st1"); + h_eff_eta_after_tfcand_my_st1_pt10 = (TH1D*) h_eta_after_tfcand_my_st1_pt10->Clone("h_eff_eta_after_tfcand_my_st1_pt10"); + h_eff_eta_after_gmtreg_pt10 = (TH1D*) h_eta_after_gmtreg_pt10->Clone("h_eff_eta_after_gmtreg_pt10"); + h_eff_eta_after_gmtreg_dr_pt10 = (TH1D*) h_eta_after_gmtreg_dr_pt10->Clone("h_eff_eta_after_gmtreg_dr_pt10"); + h_eff_eta_after_gmt_pt10 = (TH1D*) h_eta_after_gmt_pt10->Clone("h_eff_eta_after_gmt_pt10"); + h_eff_eta_after_xtra_dr_pt10 = (TH1D*) h_eta_after_xtra_dr_pt10->Clone("h_eff_eta_after_xtra_dr_pt10"); + + h_eff_eta_me1_after_alct = (TH1D*) h_eta_me1_after_alct->Clone("h_eff_eta_me1_after_alct"); + h_eff_eta_me1_after_alct_okAlct = (TH1D*) h_eta_me1_after_alct_okAlct->Clone("h_eff_eta_me1_after_alct_okAlct"); + h_eff_eta_me1_after_clct = (TH1D*) h_eta_me1_after_clct->Clone("h_eff_eta_me1_after_clct"); + h_eff_eta_me1_after_clct_okClct = (TH1D*) h_eta_me1_after_clct_okClct->Clone("h_eff_eta_me1_after_clct_okClct"); + h_eff_eta_me1_after_alctclct = (TH1D*) h_eta_me1_after_alctclct->Clone("h_eff_eta_me1_after_alctclct"); + h_eff_eta_me1_after_alctclct_okAlct = (TH1D*) h_eta_me1_after_alctclct_okAlct->Clone("h_eff_eta_me1_after_alctclct_okAlct"); + h_eff_eta_me1_after_alctclct_okClct = (TH1D*) h_eta_me1_after_alctclct_okClct->Clone("h_eff_eta_me1_after_alctclct_okClct"); + h_eff_eta_me1_after_alctclct_okAlctClct = (TH1D*) h_eta_me1_after_alctclct_okAlctClct->Clone("h_eff_eta_me1_after_alctclct_okAlctClct"); + + h_eff_eta_me1_after_lct = (TH1D*) h_eta_me1_after_lct->Clone("h_eff_eta_me1_after_lct"); + h_eff_eta_me1_after_lct_okAlct = (TH1D*) h_eta_me1_after_lct_okAlct->Clone("h_eff_eta_me1_after_lct_okAlct"); + h_eff_eta_me1_after_lct_okAlctClct = (TH1D*) h_eta_me1_after_lct_okAlctClct->Clone("h_eff_eta_me1_after_lct_okAlctClct"); + h_eff_eta_me1_after_lct_okClct = (TH1D*) h_eta_me1_after_lct_okClct->Clone("h_eff_eta_me1_after_lct_okClct"); + h_eff_eta_me1_after_lct_okClctAlct = (TH1D*) h_eta_me1_after_lct_okClctAlct->Clone("h_eff_eta_me1_after_lct_okClctAlct"); + h_eff_eta_me1_after_mplct_okAlctClct = (TH1D*) h_eta_me1_after_mplct_okAlctClct->Clone("h_eff_eta_me1_after_mplct_okAlctClct"); + h_eff_eta_me1_after_mplct_okAlctClct_plus = (TH1D*) h_eta_me1_after_mplct_okAlctClct_plus->Clone("h_eff_eta_me1_after_mplct_okAlctClct_plus"); + h_eff_eta_me1_after_tf_ok = (TH1D*) h_eta_me1_after_tf_ok->Clone("h_eff_eta_me1_after_tf_ok"); + h_eff_eta_me1_after_tf_ok_pt10 = (TH1D*) h_eta_me1_after_tf_ok_pt10->Clone("h_eff_eta_me1_after_tf_ok_pt10"); + h_eff_eta_me1_after_tf_ok_plus = (TH1D*) h_eta_me1_after_tf_ok_plus->Clone("h_eff_eta_me1_after_tf_ok_plus"); + h_eff_eta_me1_after_tf_ok_plus_pt10 = (TH1D*) h_eta_me1_after_tf_ok_plus_pt10->Clone("h_eff_eta_me1_after_tf_ok_plus_pt10"); + + + h_eta_initial->Sumw2(); + h_eff_eta_after_mpc_st1->Sumw2(); + h_eff_eta_after_tfcand_my_st1->Sumw2(); + h_eff_eta_me1_after_alctclct_okAlctClct->Sumw2(); + h_eff_eta_me1_after_lct_okClctAlct->Sumw2(); + + h_eff_eta_after_mpc->Divide(h_eff_eta_after_mpc,h_eta_initial); + h_eff_eta_after_mpc_st1->Divide(h_eff_eta_after_mpc_st1,h_eta_initial,1,1,"B"); + h_eff_eta_after_mpc_st1_good->Divide(h_eff_eta_after_mpc_st1_good,h_eta_initial,1,1,"B"); + h_eff_eta_after_mpc_ok->Divide(h_eff_eta_after_mpc_ok,h_eta_initial); + h_eff_eta_after_mpc_ok_plus->Divide(h_eff_eta_after_mpc_ok_plus,h_eta_initial); + + h_eff_eta_after_tftrack->Divide(h_eff_eta_after_tftrack,h_eta_initial); + h_eff_eta_after_tfcand->Divide(h_eff_eta_after_tfcand,h_eta_initial); + h_eff_eta_after_tfcand_q1->Divide(h_eff_eta_after_tfcand_q1,h_eta_initial); + h_eff_eta_after_tfcand_q2->Divide(h_eff_eta_after_tfcand_q2,h_eta_initial); + h_eff_eta_after_tfcand_q3->Divide(h_eff_eta_after_tfcand_q3,h_eta_initial); + h_eff_eta_after_tfcand_ok->Divide(h_eff_eta_after_tfcand_ok,h_eta_initial); + h_eff_eta_after_tfcand_ok_plus->Divide(h_eff_eta_after_tfcand_ok_plus,h_eta_initial); + h_eff_eta_after_tfcand_ok_pt10->Divide(h_eff_eta_after_tfcand_ok_pt10,h_eta_initial); + h_eff_eta_after_tfcand_ok_plus_pt10->Divide(h_eff_eta_after_tfcand_ok_plus_pt10,h_eta_initial); + h_eff_eta_after_tfcand_all ->Divide(h_eff_eta_after_tfcand_all,h_eta_initial); + h_eff_eta_after_tfcand_all_pt10->Divide(h_eff_eta_after_tfcand_all_pt10,h_eta_initial); + + h_eff_eta_after_gmtreg ->Divide(h_eff_eta_after_gmtreg,h_eta_initial); + h_eff_eta_after_gmtreg_all->Divide(h_eff_eta_after_gmtreg_all,h_eta_initial); + h_eff_eta_after_gmtreg_dr ->Divide(h_eff_eta_after_gmtreg_dr,h_eta_initial); + h_eff_eta_after_gmt ->Divide(h_eff_eta_after_gmt,h_eta_initial); + h_eff_eta_after_gmt_all ->Divide(h_eff_eta_after_gmt_all,h_eta_initial); + h_eff_eta_after_xtra ->Divide(h_eff_eta_after_xtra,h_eta_initial); + h_eff_eta_after_xtra_all ->Divide(h_eff_eta_after_xtra_all,h_eta_initial); + h_eff_eta_after_xtra_dr ->Divide(h_eff_eta_after_xtra_dr,h_eta_initial); + + h_eff_eta_after_tfcand_pt10 ->Divide(h_eff_eta_after_tfcand_pt10,h_eta_initial,1,1,"B"); + h_eff_eta_after_tfcand_my_st1 ->Divide(h_eff_eta_after_tfcand_my_st1,h_eta_initial,1,1,"B"); + h_eff_eta_after_tfcand_org_st1 ->Divide(h_eff_eta_after_tfcand_org_st1,h_eta_initial,1,1,"B"); + h_eff_eta_after_tfcand_comm_st1 ->Divide(h_eff_eta_after_tfcand_comm_st1,h_eta_initial,1,1,"B"); + h_eff_eta_after_tfcand_my_st1_pt10 ->Divide(h_eff_eta_after_tfcand_my_st1_pt10,h_eta_initial,1,1,"B"); + h_eff_eta_after_gmtreg_pt10 ->Divide(h_eff_eta_after_gmtreg_pt10,h_eta_initial); + h_eff_eta_after_gmtreg_dr_pt10 ->Divide(h_eff_eta_after_gmtreg_dr_pt10,h_eta_initial); + h_eff_eta_after_gmt_pt10 ->Divide(h_eff_eta_after_gmt_pt10,h_eta_initial); + h_eff_eta_after_xtra_dr_pt10 ->Divide(h_eff_eta_after_xtra_dr_pt10,h_eta_initial); + + + h_eff_eta_me1_after_alct->Divide(h_eff_eta_me1_after_alct,h_eta_initial); + h_eff_eta_me1_after_alct_okAlct->Divide(h_eff_eta_me1_after_alct_okAlct,h_eta_initial); + h_eff_eta_me1_after_clct->Divide(h_eff_eta_me1_after_clct,h_eta_initial); + h_eff_eta_me1_after_clct_okClct->Divide(h_eff_eta_me1_after_clct_okClct,h_eta_initial); + h_eff_eta_me1_after_alctclct->Divide(h_eff_eta_me1_after_alctclct,h_eta_initial); + h_eff_eta_me1_after_alctclct_okAlct->Divide(h_eff_eta_me1_after_alctclct_okAlct,h_eta_initial); + h_eff_eta_me1_after_alctclct_okClct->Divide(h_eff_eta_me1_after_alctclct_okClct,h_eta_initial); + h_eff_eta_me1_after_alctclct_okAlctClct->Divide(h_eff_eta_me1_after_alctclct_okAlctClct,h_eta_initial); + + h_eff_eta_me1_after_lct ->Divide(h_eff_eta_me1_after_lct,h_eta_initial); + h_eff_eta_me1_after_lct_okAlct ->Divide(h_eff_eta_me1_after_lct_okAlct,h_eta_initial); + h_eff_eta_me1_after_lct_okAlctClct->Divide(h_eff_eta_me1_after_lct_okAlctClct,h_eta_initial); + h_eff_eta_me1_after_lct_okClct ->Divide(h_eff_eta_me1_after_lct_okClct,h_eta_initial); + h_eff_eta_me1_after_lct_okClctAlct->Divide(h_eff_eta_me1_after_lct_okClctAlct,h_eta_initial); + h_eff_eta_me1_after_mplct_okAlctClct->Divide(h_eff_eta_me1_after_mplct_okAlctClct,h_eta_initial); + h_eff_eta_me1_after_mplct_okAlctClct_plus->Divide(h_eff_eta_me1_after_mplct_okAlctClct_plus,h_eta_initial); + h_eff_eta_me1_after_tf_ok ->Divide(h_eff_eta_me1_after_tf_ok,h_eta_initial); + h_eff_eta_me1_after_tf_ok_pt10 ->Divide(h_eff_eta_me1_after_tf_ok_pt10,h_eta_initial); + h_eff_eta_me1_after_tf_ok_plus ->Divide(h_eff_eta_me1_after_tf_ok_plus,h_eta_initial); + h_eff_eta_me1_after_tf_ok_plus_pt10 ->Divide(h_eff_eta_me1_after_tf_ok_plus_pt10,h_eta_initial); + + + + //h_eff_eta_after_mpc->SetFillColor(7); + //h_eff_eta_after_tftrack->SetFillColor(8); + // + //h_eff_eta_after_tfcand ->SetFillColor(1); + //h_eff_eta_after_tfcand_q1->SetFillColor(2); + //h_eff_eta_after_tfcand_q2->SetFillColor(3); + //h_eff_eta_after_tfcand_q3->SetFillColor(4); + // + //h_eff_eta_after_tfcand_all ->SetFillColor(5); + + + TCanvas* c2 = new TCanvas("h_eff_eta","h_eff_eta",900,900 ) ; + c2->Divide(2,2); + c2->cd(1); + h_eff_eta_after_mpc->GetXaxis()->SetRangeUser(0.9,2.5); + h_eff_eta_after_mpc->Draw("hist"); + //h_eff_eta_after_mpc_ok->Draw("same hist"); + h_eff_eta_after_mpc_ok_plus->Draw("same hist"); + //h_eff_eta_after_tftrack->Draw("same hist"); + h_eff_eta_after_tfcand->Draw("same hist"); + //h_eff_eta_after_tfcand_ok->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus->Draw("same hist"); + h_eff_eta_after_tfcand_ok_plus_pt10->Draw("same hist"); + + c2->cd(2); + h_eff_eta_after_tfcand->GetXaxis()->SetRangeUser(0.9,2.5); + h_eff_eta_after_tfcand ->Draw("hist"); + h_eff_eta_after_tfcand_q1->Draw("same hist"); + h_eff_eta_after_tfcand_q2->Draw("same hist"); + h_eff_eta_after_tfcand_q3->Draw("same hist"); + c2->cd(3); + h_eff_eta_after_tfcand_all ->GetXaxis()->SetRangeUser(0.9,2.5); + h_eff_eta_after_tfcand_all ->Draw("hist"); + h_eff_eta_after_tfcand->Draw("same hist"); + c2->cd(2); + Print(c2,"h_eff_eta" + ext); + + + h_eff_eta_after_mpc->SetLineColor(kBlack); + h_eff_eta_after_mpc_st1->SetLineColor(kBlack+2); + h_eff_eta_after_mpc_st1_good->SetLineColor(kBlack+4); + h_eff_eta_after_tftrack->SetLineColor(kViolet-2); + h_eff_eta_after_tfcand->SetLineColor(kBlue); + h_eff_eta_after_gmtreg->SetLineColor(kMagenta-2); + h_eff_eta_after_gmtreg_dr->SetLineColor(kOrange-3); + h_eff_eta_after_gmt->SetLineColor(kGreen+1); + h_eff_eta_after_xtra->SetLineColor(kPink-4); + h_eff_eta_after_xtra_dr->SetLineColor(kRed); + + h_eff_eta_after_tfcand_all ->SetLineColor(kBlue); + h_eff_eta_after_gmtreg_all->SetLineColor(kMagenta-2); + h_eff_eta_after_gmt_all->SetLineColor(kGreen+1); + h_eff_eta_after_xtra_all->SetLineColor(kPink-4); + + + h_eff_eta_after_tfcand_pt10 ->SetLineColor(kBlue); + h_eff_eta_after_tfcand_my_st1 ->SetLineColor(kBlue); + h_eff_eta_after_tfcand_org_st1 ->SetLineColor(kBlue); + h_eff_eta_after_tfcand_comm_st1 ->SetLineColor(kBlue); + h_eff_eta_after_tfcand_my_st1_pt10 ->SetLineColor(30); + h_eff_eta_after_gmtreg_pt10 ->SetLineColor(kMagenta-2); + h_eff_eta_after_gmtreg_dr_pt10 ->SetLineColor(kOrange-3); + h_eff_eta_after_gmt_pt10 ->SetLineColor(kGreen+1); + h_eff_eta_after_xtra_dr_pt10 ->SetLineColor(kRed); + + h_eff_eta_after_mpc_st1_good->SetLineStyle(7); + + h_eff_eta_after_tfcand_pt10 ->SetLineStyle(7); + h_eff_eta_after_tfcand_my_st1 ->SetLineStyle(7); + h_eff_eta_after_tfcand_org_st1 ->SetLineStyle(3); + h_eff_eta_after_tfcand_comm_st1->SetLineStyle(2); + h_eff_eta_after_tfcand_my_st1_pt10->SetLineStyle(7); + h_eff_eta_after_gmtreg_pt10 ->SetLineStyle(7); + h_eff_eta_after_gmtreg_dr_pt10 ->SetLineStyle(7); + h_eff_eta_after_gmt_pt10 ->SetLineStyle(7); + h_eff_eta_after_xtra_dr_pt10 ->SetLineStyle(7); + + h_eff_eta_after_mpc->SetTitle("L1 CSC trigger efficiency dependence on #eta"); + h_eff_eta_after_mpc->GetXaxis()->SetRangeUser(0.85,2.5); + h_eff_eta_after_mpc->GetXaxis()->SetTitle("#eta"); + h_eff_eta_after_mpc->SetMinimum(0); + + + + /* + TCanvas* c22 = new TCanvas("h_eff_eta_steps","h_eff_eta_steps",1200,900 ) ; + c22->Divide(1,2); + c22->cd(1); + h_eff_eta_after_mpc->Draw("hist"); + //h_eff_eta_after_tftrack->Draw("same"); + h_eff_eta_after_tfcand->Draw("same"); + //h_eff_eta_after_gmtreg->Draw("same"); + h_eff_eta_after_gmt->Draw("same"); + //h_eff_eta_after_xtra->Draw("same"); + h_eff_eta_after_xtra_dr->Draw("same"); + leg = new TLegend(0.7815507,0.1702982,0.9846086,0.5740635,NULL,"brNDC"); + //leg->SetTextFont(12); + leg->SetBorderSize(0); + leg->SetTextFont(12); + leg->SetLineColor(1); + leg->SetLineStyle(1); + leg->SetLineWidth(1); + leg->SetFillColor(19); + leg->SetFillStyle(0); + leg->AddEntry(h_eff_eta_after_mpc,"h_eff_eta_after_mpc","pl"); + //leg->AddEntry(h_eff_eta_after_tftrack,"h_eff_eta_after_tftrack","pl"); + leg->AddEntry(h_eff_eta_after_tfcand,"h_eff_eta_after_tfcand","pl"); + //leg->AddEntry(h_eff_eta_after_gmtreg,"h_eff_eta_after_gmtreg","pl"); + leg->AddEntry(h_eff_eta_after_gmt,"h_eff_eta_after_gmt","pl"); + //leg->AddEntry(h_eff_eta_after_xtra,"h_eff_eta_after_xtra","pl"); + leg->AddEntry(h_eff_eta_after_xtra_dr,"h_eff_eta_after_xtra_dr","pl"); + leg->Draw(); + c22->cd(2); + h_eff_eta_after_mpc->GetXaxis()->SetRangeUser(0.9,2.5); + h_eff_eta_after_mpc->Draw("hist"); + //h_eff_eta_after_tftrack->Draw("same"); + h_eff_eta_after_tfcand_all->Draw("same"); + //h_eff_eta_after_gmtreg_all->Draw("same"); + h_eff_eta_after_gmt_all->Draw("same"); + //h_eff_eta_after_xtra_all->Draw("same"); + h_eff_eta_after_xtra_dr->Draw("same"); + leg = new TLegend(0.7815507,0.1702982,0.9846086,0.5740635,NULL,"brNDC"); + //leg->SetTextFont(12); + leg->SetBorderSize(0); + leg->SetTextFont(12); + leg->SetLineColor(1); + leg->SetLineStyle(1); + leg->SetLineWidth(1); + leg->SetFillColor(19); + leg->SetFillStyle(0); + leg->AddEntry(h_eff_eta_after_mpc,"h_eff_eta_after_mpc","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_all,"h_eff_eta_after_tfcand_all","pl"); + //leg->AddEntry(h_eff_eta_after_gmtreg_all,"h_eff_eta_after_gmtreg_all","pl"); + leg->AddEntry(h_eff_eta_after_gmt_all,"h_eff_eta_after_gmt_all","pl"); + //leg->AddEntry(h_eff_eta_after_xtra_all,"h_eff_eta_after_xtra_all","pl"); + leg->AddEntry(h_eff_eta_after_xtra_dr,"h_eff_eta_after_xtra_dr","pl"); + leg->Draw("hist"); + Print(c22,"h_eff_eta_step.eps"); + */ + + /* // commented on 10/21/09 + TCanvas* c22x = new TCanvas("h_eff_eta_steps_full","h_eff_eta_steps_full",1000,600 ) ; + + h_eff_eta_after_mpc->Draw("hist"); + ////h_eff_eta_after_tftrack->Draw("same"); + h_eff_eta_after_tfcand->Draw("same"); + h_eff_eta_after_gmtreg->Draw("same"); + //h_eff_eta_after_gmtreg_dr->Draw("same"); + h_eff_eta_after_gmt->Draw("same"); + ////h_eff_eta_after_xtra->Draw("same"); + //h_eff_eta_after_xtra_dr->Draw("same"); + + //h_eff_eta_after_tfcand_pt10 ->Draw("same"); + //h_eff_eta_after_gmtreg_pt10 ->Draw("same"); + ////h_eff_eta_after_gmtreg_dr_pt10 ->Draw("same"); + //h_eff_eta_after_gmt_pt10 ->Draw("same"); + //h_eff_eta_after_xtra_dr_pt10 ->Draw("same"); + + TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); + //leg->SetTextFont(12); + leg->SetBorderSize(0); + //leg->SetTextFont(12); + leg->SetFillStyle(0); + + leg->SetHeader("Efficiency after"); + leg->AddEntry(h_eff_eta_after_mpc,"match to MPC","pl"); + //leg->AddEntry(h_eff_eta_after_tftrack,"h_eff_eta_after_tftrack","pl"); + leg->AddEntry(h_eff_eta_after_tfcand,"match to MPC & TF track","pl"); + leg->AddEntry(h_eff_eta_after_gmtreg,"match to MPC & TF trk & CSC GMT trk","pl"); + //leg->AddEntry(h_eff_eta_after_gmtreg_dr,"#Delta R match to CSC GMT trk","pl"); + leg->AddEntry(h_eff_eta_after_gmt,"match to MPC & TF trk & GMT trk","pl"); + //leg->AddEntry(h_eff_eta_after_xtra,"h_eff_eta_after_xtra","pl"); + //leg->AddEntry(h_eff_eta_after_xtra_dr,"#Delta R match to GMT","pl"); + //leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); + + leg->Draw(); + Print(c22x,"h_eff_eta_steps_full.eps"); + Print(c22x,"h_eff_eta_steps_full" + ext); + */ + + if (h_eff_eta_steps_full10) { + + TCanvas* c22x10 = new TCanvas("h_eff_eta_steps_full10","h_eff_eta_steps_full10",1000,600 ) ; + + h_eff_eta_after_mpc->Draw("hist"); + h_eff_eta_after_tfcand_pt10 ->Draw("same hist"); + h_eff_eta_after_gmtreg_pt10 ->Draw("same hist"); + h_eff_eta_after_gmt_pt10 ->Draw("same hist"); + //h_eff_eta_after_xtra_dr_pt10 ->Draw("same hist"); + + TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + + leg->SetHeader("With additional TF cut p_{T}>10 Efficiency after"); + leg->AddEntry(h_eff_eta_after_mpc,"match to MPC","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_pt10,"match to MPC & TF track","pl"); + leg->AddEntry(h_eff_eta_after_gmtreg_pt10,"match to MPC & TF trk & CSC GMT trk","pl"); + leg->AddEntry(h_eff_eta_after_gmt_pt10,"match to MPC & TF trk & GMT trk","pl"); + //leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); + + leg->Draw(); + Print(c22x10,"h_eff_eta_steps_full10.eps"); + Print(c22x10,"h_eff_eta_steps_full10" + ext); + Print(c22x10,"h_eff_eta_steps_full10.pdf"); -} + } -/* - -TCanvas* c22x10tf = new TCanvas("h_eff_eta_steps_full10tf","h_eff_eta_steps_full10tf",1000,600 ) ; - -h_eff_eta_after_tfcand_pt10 ->SetLineStyle(1); - -h_eff_eta_after_mpc->Draw("hist"); -h_eff_eta_after_mpc_st1->Draw("same hist"); -//h_eff_eta_after_mpc_st1_good->Draw("same hist"); -h_eff_eta_after_tfcand_org_st1 ->Draw("same hist"); -//h_eff_eta_after_tfcand_comm_st1 ->Draw("same hist"); -h_eff_eta_after_tfcand_pt10 ->Draw("same hist"); -h_eff_eta_after_tfcand_my_st1 ->Draw("same hist"); -h_eff_eta_after_tfcand_my_st1_pt10 ->Draw("same hist"); -//h_eff_eta_after_xtra_dr_pt10 ->Draw("same hist"); - -TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); - -leg->SetHeader("Efficiency after"); -leg->AddEntry(h_eff_eta_after_mpc,"match to MPC","pl"); -leg->AddEntry(h_eff_eta_after_mpc_st1,"match to MPC (at least one in ME1)","pl"); -//leg->AddEntry(h_eff_eta_after_mpc_st1_good,"match to MPC (at least one good in ME1)","pl"); -leg->AddEntry(NUL,"match to MPC & TF track:",""); -leg->AddEntry(h_eff_eta_after_tfcand_pt10," (a) with additional TF cut p_{T}>10","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_org_st1," (b) at least 1 original TF stub in ME1","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_my_st1," (c) at least 1 matched TF stub in ME1","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_my_st1_pt10," (d) at least 1 matched TF stub in ME1 and TF p_{T}>10","pl"); -//leg->AddEntry(h_eff_eta_after_tfcand_comm_st1," at least 1 my=original stub in St1","pl"); -//leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); - -leg->Draw(); -Print(c22x10tf,"h_eff_eta_steps_full10_tf.eps"); -Print(c22x10tf,"h_eff_eta_steps_full10_tf" + ext); - -*/ - -/* // commented on 10/21/09 -TCanvas* c22x10tfs = new TCanvas("h_eff_eta_steps_full10tfs","h_eff_eta_steps_full10tfs",1000,600 ) ; - -h_eff_eta_after_tfcand_pt10 ->SetLineStyle(1); - -h_eff_eta_after_mpc->Draw("hist"); -h_eff_eta_after_mpc_st1->Draw("same hist"); -//h_eff_eta_after_mpc_st1_good->Draw("same hist"); -//h_eff_eta_after_tfcand_org_st1 ->Draw("same hist"); -//h_eff_eta_after_tfcand_comm_st1 ->Draw("same hist"); -h_eff_eta_after_tfcand_pt10 ->Draw("same hist"); -h_eff_eta_after_tfcand_my_st1 ->Draw("same hist"); -//h_eff_eta_after_tfcand_my_st1_pt10 ->Draw("same hist"); -//h_eff_eta_after_xtra_dr_pt10 ->Draw("same hist"); - -TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); - -leg->SetHeader("Efficiency after"); -leg->AddEntry(NUL,"match to MPC:",""); -leg->AddEntry(h_eff_eta_after_mpc," at least one","pl"); -leg->AddEntry(h_eff_eta_after_mpc_st1," at least one in ME1","pl"); -//leg->AddEntry(h_eff_eta_after_mpc_st1_good,"match to MPC (at least one good in ME1)","pl"); -leg->AddEntry(NUL,"match to MPC & TF track:",""); -leg->AddEntry(h_eff_eta_after_tfcand_pt10," with additional TF cut p_{T}>10","pl"); -//leg->AddEntry(h_eff_eta_after_tfcand_org_st1," (b) at least 1 original TF stub in ME1","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_my_st1," at least 1 matched TF stub in ME1","pl"); -//leg->AddEntry(h_eff_eta_after_tfcand_my_st1_pt10," (d) at least 1 matched TF stub in ME1 and TF p_{T}>10","pl"); -//leg->AddEntry(h_eff_eta_after_tfcand_comm_st1," at least 1 my=original stub in St1","pl"); -//leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); - -leg->Draw(); -Print(c22x10tfs,"h_eff_eta_steps_full10_tfs.eps"); -Print(c22x10tfs,"h_eff_eta_steps_full10_tfs" + ext); -Print(c22x10tfs,"h_eff_eta_steps_full10_tfs.pdf"); -*/ - - - -if (do_h_eff_eta_steps_xchk1) { - -TCanvas* c222xx1 = new TCanvas("h_eff_eta_steps_xchk1","h_eff_eta_steps_xchk1",1000,600 ) ; - -h_eff_eta_after_gmtreg->SetTitle("CSC GMT efficiency dependence on #eta (cross-check)"); -h_eff_eta_after_gmtreg->GetXaxis()->SetRangeUser(0.9,2.5); -h_eff_eta_after_gmtreg->GetXaxis()->SetTitle("#eta"); -h_eff_eta_after_gmtreg->SetMinimum(0); -h_eff_eta_after_gmtreg->Draw("hist"); -h_eff_eta_after_gmtreg_dr->Draw("same hist"); - -//h_eff_eta_after_gmtreg_pt10 ->Draw("same hist"); -//h_eff_eta_after_gmtreg_dr_pt10 ->Draw("same hist"); - -TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); - -leg->SetHeader("Efficiency after"); -leg->AddEntry(h_eff_eta_after_gmtreg,"match to MPC & TF trk & CSC GMT trk","pl"); -leg->AddEntry(h_eff_eta_after_gmtreg_dr,"#Delta R match to CSC GMT trk","pl"); -//leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); - -leg->Draw(); -Print(c222xx1,"h_eff_eta_steps_xchk1.eps"); -Print(c222xx1,"h_eff_eta_steps_xchk1" + ext); + /* + + TCanvas* c22x10tf = new TCanvas("h_eff_eta_steps_full10tf","h_eff_eta_steps_full10tf",1000,600 ) ; + + h_eff_eta_after_tfcand_pt10 ->SetLineStyle(1); + + h_eff_eta_after_mpc->Draw("hist"); + h_eff_eta_after_mpc_st1->Draw("same hist"); + //h_eff_eta_after_mpc_st1_good->Draw("same hist"); + h_eff_eta_after_tfcand_org_st1 ->Draw("same hist"); + //h_eff_eta_after_tfcand_comm_st1 ->Draw("same hist"); + h_eff_eta_after_tfcand_pt10 ->Draw("same hist"); + h_eff_eta_after_tfcand_my_st1 ->Draw("same hist"); + h_eff_eta_after_tfcand_my_st1_pt10 ->Draw("same hist"); + //h_eff_eta_after_xtra_dr_pt10 ->Draw("same hist"); + + TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + + leg->SetHeader("Efficiency after"); + leg->AddEntry(h_eff_eta_after_mpc,"match to MPC","pl"); + leg->AddEntry(h_eff_eta_after_mpc_st1,"match to MPC (at least one in ME1)","pl"); + //leg->AddEntry(h_eff_eta_after_mpc_st1_good,"match to MPC (at least one good in ME1)","pl"); + leg->AddEntry(NUL,"match to MPC & TF track:",""); + leg->AddEntry(h_eff_eta_after_tfcand_pt10," (a) with additional TF cut p_{T}>10","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_org_st1," (b) at least 1 original TF stub in ME1","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_my_st1," (c) at least 1 matched TF stub in ME1","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_my_st1_pt10," (d) at least 1 matched TF stub in ME1 and TF p_{T}>10","pl"); + //leg->AddEntry(h_eff_eta_after_tfcand_comm_st1," at least 1 my=original stub in St1","pl"); + //leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); + + leg->Draw(); + Print(c22x10tf,"h_eff_eta_steps_full10_tf.eps"); + Print(c22x10tf,"h_eff_eta_steps_full10_tf" + ext); + + */ + + /* // commented on 10/21/09 + TCanvas* c22x10tfs = new TCanvas("h_eff_eta_steps_full10tfs","h_eff_eta_steps_full10tfs",1000,600 ) ; + + h_eff_eta_after_tfcand_pt10 ->SetLineStyle(1); + + h_eff_eta_after_mpc->Draw("hist"); + h_eff_eta_after_mpc_st1->Draw("same hist"); + //h_eff_eta_after_mpc_st1_good->Draw("same hist"); + //h_eff_eta_after_tfcand_org_st1 ->Draw("same hist"); + //h_eff_eta_after_tfcand_comm_st1 ->Draw("same hist"); + h_eff_eta_after_tfcand_pt10 ->Draw("same hist"); + h_eff_eta_after_tfcand_my_st1 ->Draw("same hist"); + //h_eff_eta_after_tfcand_my_st1_pt10 ->Draw("same hist"); + //h_eff_eta_after_xtra_dr_pt10 ->Draw("same hist"); + + TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + + leg->SetHeader("Efficiency after"); + leg->AddEntry(NUL,"match to MPC:",""); + leg->AddEntry(h_eff_eta_after_mpc," at least one","pl"); + leg->AddEntry(h_eff_eta_after_mpc_st1," at least one in ME1","pl"); + //leg->AddEntry(h_eff_eta_after_mpc_st1_good,"match to MPC (at least one good in ME1)","pl"); + leg->AddEntry(NUL,"match to MPC & TF track:",""); + leg->AddEntry(h_eff_eta_after_tfcand_pt10," with additional TF cut p_{T}>10","pl"); + //leg->AddEntry(h_eff_eta_after_tfcand_org_st1," (b) at least 1 original TF stub in ME1","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_my_st1," at least 1 matched TF stub in ME1","pl"); + //leg->AddEntry(h_eff_eta_after_tfcand_my_st1_pt10," (d) at least 1 matched TF stub in ME1 and TF p_{T}>10","pl"); + //leg->AddEntry(h_eff_eta_after_tfcand_comm_st1," at least 1 my=original stub in St1","pl"); + //leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); + + leg->Draw(); + Print(c22x10tfs,"h_eff_eta_steps_full10_tfs.eps"); + Print(c22x10tfs,"h_eff_eta_steps_full10_tfs" + ext); + Print(c22x10tfs,"h_eff_eta_steps_full10_tfs.pdf"); + */ + + + + if (do_h_eff_eta_steps_xchk1) { + + TCanvas* c222xx1 = new TCanvas("h_eff_eta_steps_xchk1","h_eff_eta_steps_xchk1",1000,600 ) ; + + h_eff_eta_after_gmtreg->SetTitle("CSC GMT efficiency dependence on #eta (cross-check)"); + h_eff_eta_after_gmtreg->GetXaxis()->SetRangeUser(0.9,2.5); + h_eff_eta_after_gmtreg->GetXaxis()->SetTitle("#eta"); + h_eff_eta_after_gmtreg->SetMinimum(0); + h_eff_eta_after_gmtreg->Draw("hist"); + h_eff_eta_after_gmtreg_dr->Draw("same hist"); + + //h_eff_eta_after_gmtreg_pt10 ->Draw("same hist"); + //h_eff_eta_after_gmtreg_dr_pt10 ->Draw("same hist"); + + TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + + leg->SetHeader("Efficiency after"); + leg->AddEntry(h_eff_eta_after_gmtreg,"match to MPC & TF trk & CSC GMT trk","pl"); + leg->AddEntry(h_eff_eta_after_gmtreg_dr,"#Delta R match to CSC GMT trk","pl"); + //leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); + + leg->Draw(); + Print(c222xx1,"h_eff_eta_steps_xchk1.eps"); + Print(c222xx1,"h_eff_eta_steps_xchk1" + ext); -} + } -/* -TCanvas* c222xx2 = new TCanvas("h_eff_eta_steps_xchk2","h_eff_eta_steps_xchk2",1000,600 ) ; - -h_eff_eta_after_gmt->SetTitle("GMT efficiency dependence on #eta (cross-check)"); -h_eff_eta_after_gmt->GetXaxis()->SetRangeUser(0.9,2.5); -h_eff_eta_after_gmt->GetXaxis()->SetTitle("#eta"); -h_eff_eta_after_gmt->SetMinimum(0); -h_eff_eta_after_gmt->SetMaximum(1.05); - -h_eff_eta_after_gmt->Draw(); -h_eff_eta_after_xtra_dr->Draw("same hist"); + /* + TCanvas* c222xx2 = new TCanvas("h_eff_eta_steps_xchk2","h_eff_eta_steps_xchk2",1000,600 ) ; + + h_eff_eta_after_gmt->SetTitle("GMT efficiency dependence on #eta (cross-check)"); + h_eff_eta_after_gmt->GetXaxis()->SetRangeUser(0.9,2.5); + h_eff_eta_after_gmt->GetXaxis()->SetTitle("#eta"); + h_eff_eta_after_gmt->SetMinimum(0); + h_eff_eta_after_gmt->SetMaximum(1.05); + + h_eff_eta_after_gmt->Draw(); + h_eff_eta_after_xtra_dr->Draw("same hist"); -//h_eff_eta_after_gmt_pt10 ->Draw("same hist"); -//h_eff_eta_after_xtra_dr_pt10 ->Draw("same hist"); + //h_eff_eta_after_gmt_pt10 ->Draw("same hist"); + //h_eff_eta_after_xtra_dr_pt10 ->Draw("same hist"); -TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); -//leg->SetTextFont(12); -leg->SetBorderSize(0); -//leg->SetTextFont(12); -leg->SetFillStyle(0); - -leg->SetHeader("Efficiency after"); -leg->AddEntry(h_eff_eta_after_gmt,"match to MPC & TF trk & GMT trk","pl"); -leg->AddEntry(h_eff_eta_after_xtra_dr,"#Delta R match to GMT","pl"); -//leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); - -leg->Draw(); -Print(c222xx2,"h_eff_eta_steps_xchk2.eps"); -Print(c222xx2,"h_eff_eta_steps_xchk2" + ext); -return; - -*/ - - - -h_eff_eta_me1_after_lct ->SetLineColor(kRed); -h_eff_eta_me1_after_lct_okAlct ->SetLineColor(kRed-6); -h_eff_eta_me1_after_lct_okAlctClct->SetLineColor(kMagenta-6); -h_eff_eta_me1_after_lct_okClct ->SetLineColor(kRed-6); -h_eff_eta_me1_after_lct_okClctAlct->SetLineColor(kMagenta-6); -h_eff_eta_me1_after_mplct_okAlctClct->SetLineColor(kBlack); -h_eff_eta_me1_after_mplct_okAlctClct_plus->SetLineColor(kBlack); -h_eff_eta_me1_after_tf_ok ->SetLineColor(kBlue); -h_eff_eta_me1_after_tf_ok_pt10 ->SetLineColor(kBlue+2); -h_eff_eta_me1_after_tf_ok_plus ->SetLineColor(kBlue); -h_eff_eta_me1_after_tf_ok_plus_pt10 ->SetLineColor(kBlue+2); - -h_eff_eta_after_tfcand_all_pt10->SetLineColor(kCyan+2); - -h_eff_eta_me1_after_lct->SetLineWidth(2); -h_eff_eta_me1_after_lct_okAlct->SetLineWidth(2); -h_eff_eta_me1_after_lct_okAlctClct->SetLineWidth(2); -h_eff_eta_me1_after_lct_okClct->SetLineWidth(2); -h_eff_eta_me1_after_lct_okClctAlct->SetLineWidth(2); - -//h_eff_eta_me1_after_lct->SetLineStyle(7); -h_eff_eta_me1_after_lct_okAlct->SetLineStyle(3); -h_eff_eta_me1_after_lct_okAlctClct->SetLineStyle(7); -h_eff_eta_me1_after_lct_okClct->SetLineStyle(3); -h_eff_eta_me1_after_lct_okClctAlct->SetLineStyle(7); -h_eff_eta_me1_after_mplct_okAlctClct_plus->SetLineStyle(7); - -h_eff_eta_me1_after_tf_ok_pt10->SetLineStyle(7); -h_eff_eta_me1_after_tf_ok_plus_pt10->SetLineStyle(7); -h_eff_eta_after_tfcand_all_pt10->SetLineStyle(3); - -h_eff_eta_me1_after_lct->SetTitle("efficiency dependence on #eta: ME1 studies"); -h_eff_eta_me1_after_lct->GetXaxis()->SetRangeUser(0.86,2.5); -h_eff_eta_me1_after_lct->GetXaxis()->SetTitle("#eta"); -h_eff_eta_me1_after_lct->SetMinimum(0); -h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(0.,1.05); - - - -TCanvas* cme1n1 = new TCanvas("h_eff_eta_me1_after_lct","h_eff_eta_me1_after_lct",1000,600 ) ; - - -h_eff_eta_me1_after_lct->Draw("hist"); -//h_eff_eta_me1_after_lct_okAlct->Draw("same hist"); -//h_eff_eta_me1_after_lct_okAlctClct->Draw("same hist"); -h_eff_eta_me1_after_lct_okClct->Draw("same hist"); -h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); -h_eff_eta_me1_after_mplct_okAlctClct->Draw("same hist"); -h_eff_eta_me1_after_mplct_okAlctClct_plus->Draw("same hist"); -h_eff_eta_me1_after_tf_ok ->Draw("same hist"); -h_eff_eta_me1_after_tf_ok_pt10 ->Draw("same hist"); -h_eff_eta_after_tfcand_all_pt10->Draw("same hist"); - -TLegend *leg = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); - -leg->SetHeader("Efficiency for muon with p_{T}>10"); -//leg->AddEntry(NUL,"match to LCT:",""); -leg->AddEntry(h_eff_eta_me1_after_lct,"any LCT in ME1 chamber crossed by #mu","pl"); -//leg->AddEntry(h_eff_eta_me1_after_lct_okAlct," + track's ALCT","pl"); -//leg->AddEntry(h_eff_eta_me1_after_lct_okAlctClct," + track's CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_lct_okClct," + correct CLCT picked","pl"); -leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct," + correct ALCT mached to CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct," + pass MPC selection","pl"); -leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct," + has two MPC matched","pl"); -leg->AddEntry(h_eff_eta_me1_after_tf_ok," + stub used in any TF track","pl"); -leg->AddEntry(h_eff_eta_me1_after_tf_ok_pt10," + stub used in TF track with p_{T}>10 GeV","pl"); -leg->AddEntry(h_eff_eta_after_tfcand_all_pt10,"there is TF track p_{T}>10 in #Delta R<0.3","pl"); -//leg->AddEntry(," ","pl"); -leg->Draw(); -Print(cme1n1,"h_eff_eta_me1_steps_all.eps"); -Print(cme1n1,"h_eff_eta_me1_steps_all" + ext); -Print(cme1n1,"h_eff_eta_me1_steps_all.pdf"); - - - - -TCanvas* cme1n2 = new TCanvas("h_eff_eta_me1_after_lct2","h_eff_eta_me1_after_lct2",800,600 ) ; -h_eff_eta_me1_after_mplct_okAlctClct->GetXaxis()->SetRangeUser(0.86,2.5); -h_eff_eta_me1_after_mplct_okAlctClct->GetXaxis()->SetTitle("#eta"); -h_eff_eta_me1_after_mplct_okAlctClct->SetMinimum(0); -h_eff_eta_me1_after_mplct_okAlctClct->GetYaxis()->SetRangeUser(0.,1.05); -h_eff_eta_me1_after_mplct_okAlctClct->SetTitle("Efficiency in ME1 for #mu with p_{T}>10"); -h_eff_eta_me1_after_mplct_okAlctClct->GetYaxis()->SetTitle("Eff."); -h_eff_eta_me1_after_mplct_okAlctClct->GetXaxis()->SetTitleSize(0.07); -h_eff_eta_me1_after_mplct_okAlctClct->GetXaxis()->SetTitleOffset(0.7); -h_eff_eta_me1_after_mplct_okAlctClct->GetYaxis()->SetLabelOffset(0.015); -gStyle->SetTitleW(1); -gStyle->SetTitleH(0.08); -gStyle->SetTitleStyle(0); -h_eff_eta_me1_after_mplct_okAlctClct->Draw("hist"); -h_eff_eta_me1_after_mplct_okAlctClct_plus->Draw("same hist"); -h_eff_eta_me1_after_tf_ok ->Draw("same hist"); -h_eff_eta_me1_after_tf_ok_pt10 ->Draw("same hist"); - - -TLegend *leg = new TLegend(0.34,0.16,0.87,0.39,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("SimMuon has matched"); -leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct,"MPC LCT stub in ME1","pl"); -leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct_plus," + one more MPC LCT stub in ME234 + ","pl"); -leg->AddEntry(h_eff_eta_me1_after_tf_ok," + this stub was used by a TF track","pl"); -leg->AddEntry(h_eff_eta_me1_after_tf_ok_pt10," + this TF track has p_{T}(TF)>10 GeV","pl"); -leg->Draw(); -Print(cme1n2,"h_eff_eta_me1_tf" + ext); - - - -TCanvas* cme1n2_plus = new TCanvas("h_eff_eta_me1_after_tfplus","h_eff_eta_me1_after_tfplus",800,600 ) ; -h_eff_eta_me1_after_mplct_okAlctClct_plus->GetXaxis()->SetRangeUser(0.86,2.5); -h_eff_eta_me1_after_mplct_okAlctClct_plus->GetXaxis()->SetTitle("#eta"); -h_eff_eta_me1_after_mplct_okAlctClct_plus->SetMinimum(0); -h_eff_eta_me1_after_mplct_okAlctClct_plus->GetYaxis()->SetRangeUser(0.,1.05); -h_eff_eta_me1_after_mplct_okAlctClct_plus->SetTitle("Efficiency in ME1 for #mu with p_{T}>10"); -h_eff_eta_me1_after_mplct_okAlctClct_plus->GetYaxis()->SetTitle("Eff."); -h_eff_eta_me1_after_mplct_okAlctClct_plus->GetXaxis()->SetTitleSize(0.07); -h_eff_eta_me1_after_mplct_okAlctClct_plus->GetXaxis()->SetTitleOffset(0.7); -h_eff_eta_me1_after_mplct_okAlctClct_plus->GetYaxis()->SetLabelOffset(0.015); -gStyle->SetTitleW(1); -gStyle->SetTitleH(0.08); -gStyle->SetTitleStyle(0); -h_eff_eta_me1_after_mplct_okAlctClct_plus->Draw("hist"); -h_eff_eta_me1_after_tf_ok_plus ->Draw("same hist"); -h_eff_eta_me1_after_tf_ok_plus_pt10 ->Draw("same hist"); -h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); - -leg = new TLegend(0.34,0.16,0.87,0.39,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); -leg->SetHeader("SimMuon has matched"); -leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct_plus,"MPC LCT stubs in ME1 and some other station","pl"); -leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus," + these stubs were used by a TF track","pl"); -leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus_pt10," + this TF track has p_{T}(TF)>10 GeV","pl"); -leg->Draw(); -Print(cme1n2_plus,"h_eff_eta_me1_tfplus" + ext); - - - - - - - -h_eff_eta_me1_after_alct->SetLineColor(kBlue+1); -h_eff_eta_me1_after_alct_okAlct->SetLineColor(kBlue+1); -h_eff_eta_me1_after_clct->SetLineColor(kGreen+1); -h_eff_eta_me1_after_clct_okClct->SetLineColor(kGreen+1); -h_eff_eta_me1_after_alctclct->SetLineColor(kYellow+2); -h_eff_eta_me1_after_alctclct_okAlct->SetLineColor(kMagenta+2); -h_eff_eta_me1_after_alctclct_okClct->SetLineColor(kMagenta+3); -h_eff_eta_me1_after_alctclct_okAlctClct->SetLineColor(kYellow+2); + TLegend *leg = new TLegend(0.2518248,0.263986,0.830292,0.5332168,NULL,"brNDC"); + //leg->SetTextFont(12); + leg->SetBorderSize(0); + //leg->SetTextFont(12); + leg->SetFillStyle(0); + + leg->SetHeader("Efficiency after"); + leg->AddEntry(h_eff_eta_after_gmt,"match to MPC & TF trk & GMT trk","pl"); + leg->AddEntry(h_eff_eta_after_xtra_dr,"#Delta R match to GMT","pl"); + //leg->AddEntry(h_eff_eta_after_xtra_dr,"(dashed lines correspond to p_{T}>10)",""); + + leg->Draw(); + Print(c222xx2,"h_eff_eta_steps_xchk2.eps"); + Print(c222xx2,"h_eff_eta_steps_xchk2" + ext); + return; + + */ + + + + h_eff_eta_me1_after_lct ->SetLineColor(kRed); + h_eff_eta_me1_after_lct_okAlct ->SetLineColor(kRed-6); + h_eff_eta_me1_after_lct_okAlctClct->SetLineColor(kMagenta-6); + h_eff_eta_me1_after_lct_okClct ->SetLineColor(kRed-6); + h_eff_eta_me1_after_lct_okClctAlct->SetLineColor(kMagenta-6); + h_eff_eta_me1_after_mplct_okAlctClct->SetLineColor(kBlack); + h_eff_eta_me1_after_mplct_okAlctClct_plus->SetLineColor(kBlack); + h_eff_eta_me1_after_tf_ok ->SetLineColor(kBlue); + h_eff_eta_me1_after_tf_ok_pt10 ->SetLineColor(kBlue+2); + h_eff_eta_me1_after_tf_ok_plus ->SetLineColor(kBlue); + h_eff_eta_me1_after_tf_ok_plus_pt10 ->SetLineColor(kBlue+2); + + h_eff_eta_after_tfcand_all_pt10->SetLineColor(kCyan+2); + + h_eff_eta_me1_after_lct->SetLineWidth(2); + h_eff_eta_me1_after_lct_okAlct->SetLineWidth(2); + h_eff_eta_me1_after_lct_okAlctClct->SetLineWidth(2); + h_eff_eta_me1_after_lct_okClct->SetLineWidth(2); + h_eff_eta_me1_after_lct_okClctAlct->SetLineWidth(2); + + //h_eff_eta_me1_after_lct->SetLineStyle(7); + h_eff_eta_me1_after_lct_okAlct->SetLineStyle(3); + h_eff_eta_me1_after_lct_okAlctClct->SetLineStyle(7); + h_eff_eta_me1_after_lct_okClct->SetLineStyle(3); + h_eff_eta_me1_after_lct_okClctAlct->SetLineStyle(7); + h_eff_eta_me1_after_mplct_okAlctClct_plus->SetLineStyle(7); + + h_eff_eta_me1_after_tf_ok_pt10->SetLineStyle(7); + h_eff_eta_me1_after_tf_ok_plus_pt10->SetLineStyle(7); + h_eff_eta_after_tfcand_all_pt10->SetLineStyle(3); + + h_eff_eta_me1_after_lct->SetTitle("efficiency dependence on #eta: ME1 studies"); + h_eff_eta_me1_after_lct->GetXaxis()->SetRangeUser(0.86,2.5); + h_eff_eta_me1_after_lct->GetXaxis()->SetTitle("#eta"); + h_eff_eta_me1_after_lct->SetMinimum(0); + h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(0.,1.05); + + + + TCanvas* cme1n1 = new TCanvas("h_eff_eta_me1_after_lct","h_eff_eta_me1_after_lct",1000,600 ) ; + + + h_eff_eta_me1_after_lct->Draw("hist"); + //h_eff_eta_me1_after_lct_okAlct->Draw("same hist"); + //h_eff_eta_me1_after_lct_okAlctClct->Draw("same hist"); + h_eff_eta_me1_after_lct_okClct->Draw("same hist"); + h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); + h_eff_eta_me1_after_mplct_okAlctClct->Draw("same hist"); + h_eff_eta_me1_after_mplct_okAlctClct_plus->Draw("same hist"); + h_eff_eta_me1_after_tf_ok ->Draw("same hist"); + h_eff_eta_me1_after_tf_ok_pt10 ->Draw("same hist"); + h_eff_eta_after_tfcand_all_pt10->Draw("same hist"); + + TLegend *leg = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + + leg->SetHeader("Efficiency for muon with p_{T}>10"); + //leg->AddEntry(NUL,"match to LCT:",""); + leg->AddEntry(h_eff_eta_me1_after_lct,"any LCT in ME1 chamber crossed by #mu","pl"); + //leg->AddEntry(h_eff_eta_me1_after_lct_okAlct," + track's ALCT","pl"); + //leg->AddEntry(h_eff_eta_me1_after_lct_okAlctClct," + track's CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_lct_okClct," + correct CLCT picked","pl"); + leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct," + correct ALCT mached to CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct," + pass MPC selection","pl"); + leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct," + has two MPC matched","pl"); + leg->AddEntry(h_eff_eta_me1_after_tf_ok," + stub used in any TF track","pl"); + leg->AddEntry(h_eff_eta_me1_after_tf_ok_pt10," + stub used in TF track with p_{T}>10 GeV","pl"); + leg->AddEntry(h_eff_eta_after_tfcand_all_pt10,"there is TF track p_{T}>10 in #Delta R<0.3","pl"); + //leg->AddEntry(," ","pl"); + leg->Draw(); + Print(cme1n1,"h_eff_eta_me1_steps_all.eps"); + Print(cme1n1,"h_eff_eta_me1_steps_all" + ext); + Print(cme1n1,"h_eff_eta_me1_steps_all.pdf"); + + + + + TCanvas* cme1n2 = new TCanvas("h_eff_eta_me1_after_lct2","h_eff_eta_me1_after_lct2",800,600 ) ; + h_eff_eta_me1_after_mplct_okAlctClct->GetXaxis()->SetRangeUser(0.86,2.5); + h_eff_eta_me1_after_mplct_okAlctClct->GetXaxis()->SetTitle("#eta"); + h_eff_eta_me1_after_mplct_okAlctClct->SetMinimum(0); + h_eff_eta_me1_after_mplct_okAlctClct->GetYaxis()->SetRangeUser(0.,1.05); + h_eff_eta_me1_after_mplct_okAlctClct->SetTitle("Efficiency in ME1 for #mu with p_{T}>10"); + h_eff_eta_me1_after_mplct_okAlctClct->GetYaxis()->SetTitle("Eff."); + h_eff_eta_me1_after_mplct_okAlctClct->GetXaxis()->SetTitleSize(0.07); + h_eff_eta_me1_after_mplct_okAlctClct->GetXaxis()->SetTitleOffset(0.7); + h_eff_eta_me1_after_mplct_okAlctClct->GetYaxis()->SetLabelOffset(0.015); + gStyle->SetTitleW(1); + gStyle->SetTitleH(0.08); + gStyle->SetTitleStyle(0); + h_eff_eta_me1_after_mplct_okAlctClct->Draw("hist"); + h_eff_eta_me1_after_mplct_okAlctClct_plus->Draw("same hist"); + h_eff_eta_me1_after_tf_ok ->Draw("same hist"); + h_eff_eta_me1_after_tf_ok_pt10 ->Draw("same hist"); + + + TLegend *leg = new TLegend(0.34,0.16,0.87,0.39,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("SimMuon has matched"); + leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct,"MPC LCT stub in ME1","pl"); + leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct_plus," + one more MPC LCT stub in ME234 + ","pl"); + leg->AddEntry(h_eff_eta_me1_after_tf_ok," + this stub was used by a TF track","pl"); + leg->AddEntry(h_eff_eta_me1_after_tf_ok_pt10," + this TF track has p_{T}(TF)>10 GeV","pl"); + leg->Draw(); + Print(cme1n2,"h_eff_eta_me1_tf" + ext); + + + + TCanvas* cme1n2_plus = new TCanvas("h_eff_eta_me1_after_tfplus","h_eff_eta_me1_after_tfplus",800,600 ) ; + h_eff_eta_me1_after_mplct_okAlctClct_plus->GetXaxis()->SetRangeUser(0.86,2.5); + h_eff_eta_me1_after_mplct_okAlctClct_plus->GetXaxis()->SetTitle("#eta"); + h_eff_eta_me1_after_mplct_okAlctClct_plus->SetMinimum(0); + h_eff_eta_me1_after_mplct_okAlctClct_plus->GetYaxis()->SetRangeUser(0.,1.05); + h_eff_eta_me1_after_mplct_okAlctClct_plus->SetTitle("Efficiency in ME1 for #mu with p_{T}>10"); + h_eff_eta_me1_after_mplct_okAlctClct_plus->GetYaxis()->SetTitle("Eff."); + h_eff_eta_me1_after_mplct_okAlctClct_plus->GetXaxis()->SetTitleSize(0.07); + h_eff_eta_me1_after_mplct_okAlctClct_plus->GetXaxis()->SetTitleOffset(0.7); + h_eff_eta_me1_after_mplct_okAlctClct_plus->GetYaxis()->SetLabelOffset(0.015); + gStyle->SetTitleW(1); + gStyle->SetTitleH(0.08); + gStyle->SetTitleStyle(0); + h_eff_eta_me1_after_mplct_okAlctClct_plus->Draw("hist"); + h_eff_eta_me1_after_tf_ok_plus ->Draw("same hist"); + h_eff_eta_me1_after_tf_ok_plus_pt10 ->Draw("same hist"); + h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); + + leg = new TLegend(0.34,0.16,0.87,0.39,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); + leg->SetHeader("SimMuon has matched"); + leg->AddEntry(h_eff_eta_me1_after_mplct_okAlctClct_plus,"MPC LCT stubs in ME1 and some other station","pl"); + leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus," + these stubs were used by a TF track","pl"); + leg->AddEntry(h_eff_eta_me1_after_tf_ok_plus_pt10," + this TF track has p_{T}(TF)>10 GeV","pl"); + leg->Draw(); + Print(cme1n2_plus,"h_eff_eta_me1_tfplus" + ext); + + + + + + + + h_eff_eta_me1_after_alct->SetLineColor(kBlue+1); + h_eff_eta_me1_after_alct_okAlct->SetLineColor(kBlue+1); + h_eff_eta_me1_after_clct->SetLineColor(kGreen+1); + h_eff_eta_me1_after_clct_okClct->SetLineColor(kGreen+1); + h_eff_eta_me1_after_alctclct->SetLineColor(kYellow+2); + h_eff_eta_me1_after_alctclct_okAlct->SetLineColor(kMagenta+2); + h_eff_eta_me1_after_alctclct_okClct->SetLineColor(kMagenta+3); + h_eff_eta_me1_after_alctclct_okAlctClct->SetLineColor(kYellow+2); -/* -h_eff_eta_me1_after_alct -h_eff_eta_me1_after_alct_okAlct -h_eff_eta_me1_after_clct -h_eff_eta_me1_after_clct_okClct -h_eff_eta_me1_after_alctclct -h_eff_eta_me1_after_alctclct_okAlct -h_eff_eta_me1_after_alctclct_okClct -h_eff_eta_me1_after_alctclct_okAlctClct -*/ + /* + h_eff_eta_me1_after_alct + h_eff_eta_me1_after_alct_okAlct + h_eff_eta_me1_after_clct + h_eff_eta_me1_after_clct_okClct + h_eff_eta_me1_after_alctclct + h_eff_eta_me1_after_alctclct_okAlct + h_eff_eta_me1_after_alctclct_okClct + h_eff_eta_me1_after_alctclct_okAlctClct + */ -h_eff_eta_me1_after_alct->SetLineStyle(2); -h_eff_eta_me1_after_clct->SetLineStyle(2); -h_eff_eta_me1_after_alctclct->SetLineStyle(2); + h_eff_eta_me1_after_alct->SetLineStyle(2); + h_eff_eta_me1_after_clct->SetLineStyle(2); + h_eff_eta_me1_after_alctclct->SetLineStyle(2); -h_eff_eta_me1_after_alct->SetLineWidth(2); -h_eff_eta_me1_after_alct_okAlct->SetLineWidth(2); -h_eff_eta_me1_after_clct->SetLineWidth(2); -h_eff_eta_me1_after_clct_okClct->SetLineWidth(2); -h_eff_eta_me1_after_alctclct->SetLineWidth(2); -h_eff_eta_me1_after_alctclct_okAlct->SetLineWidth(2); -h_eff_eta_me1_after_alctclct_okClct->SetLineWidth(2); -h_eff_eta_me1_after_alctclct_okAlctClct->SetLineWidth(2); + h_eff_eta_me1_after_alct->SetLineWidth(2); + h_eff_eta_me1_after_alct_okAlct->SetLineWidth(2); + h_eff_eta_me1_after_clct->SetLineWidth(2); + h_eff_eta_me1_after_clct_okClct->SetLineWidth(2); + h_eff_eta_me1_after_alctclct->SetLineWidth(2); + h_eff_eta_me1_after_alctclct_okAlct->SetLineWidth(2); + h_eff_eta_me1_after_alctclct_okClct->SetLineWidth(2); + h_eff_eta_me1_after_alctclct_okAlctClct->SetLineWidth(2); -h_eff_eta_me1_after_lct->SetLineStyle(2); -h_eff_eta_me1_after_lct_okClctAlct->SetLineStyle(1); -h_eff_eta_me1_after_lct_okClctAlct->SetLineColor(kRed); + h_eff_eta_me1_after_lct->SetLineStyle(2); + h_eff_eta_me1_after_lct_okClctAlct->SetLineStyle(1); + h_eff_eta_me1_after_lct_okClctAlct->SetLineColor(kRed); @@ -2418,194 +2398,194 @@ h_eff_eta_me1_after_lct_okClctAlct->SetLineColor(kRed); -TCanvas* cme1na = new TCanvas("h_eff_eta_me1_after_alct","h_eff_eta_me1_after_alct",1000,600 ) ; + TCanvas* cme1na = new TCanvas("h_eff_eta_me1_after_alct","h_eff_eta_me1_after_alct",1000,600 ) ; -//h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(0.,1.05); -//h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(0.5,1.05); -//h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(0.8,1.02); -h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(yrange[0],yrange[1]); -h_eff_eta_me1_after_lct->Draw("hist"); -//h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); + //h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(0.,1.05); + //h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(0.5,1.05); + //h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(0.8,1.02); + h_eff_eta_me1_after_lct->GetYaxis()->SetRangeUser(yrange[0],yrange[1]); + h_eff_eta_me1_after_lct->Draw("hist"); + //h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); -h_eff_eta_me1_after_alct->Draw("same hist"); -h_eff_eta_me1_after_alct_okAlct->Draw("same hist"); -h_eff_eta_me1_after_clct->Draw("same hist"); -h_eff_eta_me1_after_clct_okClct->Draw("same hist"); -h_eff_eta_me1_after_alctclct->Draw("same hist"); -//h_eff_eta_me1_after_alctclct_okAlct->Draw("same hist"); -//h_eff_eta_me1_after_alctclct_okClct->Draw("same hist"); -h_eff_eta_me1_after_alctclct_okAlctClct->Draw("same hist"); + h_eff_eta_me1_after_alct->Draw("same hist"); + h_eff_eta_me1_after_alct_okAlct->Draw("same hist"); + h_eff_eta_me1_after_clct->Draw("same hist"); + h_eff_eta_me1_after_clct_okClct->Draw("same hist"); + h_eff_eta_me1_after_alctclct->Draw("same hist"); + //h_eff_eta_me1_after_alctclct_okAlct->Draw("same hist"); + //h_eff_eta_me1_after_alctclct_okClct->Draw("same hist"); + h_eff_eta_me1_after_alctclct_okAlctClct->Draw("same hist"); -h_eff_eta_me1_after_lct->Draw("same hist"); -h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); + h_eff_eta_me1_after_lct->Draw("same hist"); + h_eff_eta_me1_after_lct_okClctAlct->Draw("same hist"); -h_eff_eta_me1_after_lct_okClctAlct->Fit("pol0","R0","",1.63,2.38); -eff11 = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); -cout<Fit("pol0","R0","",1.63,2.05); -eff1b = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); -h_eff_eta_me1_after_lct_okClctAlct->Fit("pol0","R0","",2.05,2.38); -eff1a = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); + h_eff_eta_me1_after_lct_okClctAlct->Fit("pol0","R0","",1.63,2.38); + eff11 = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); + cout<Fit("pol0","R0","",1.63,2.05); + eff1b = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); + h_eff_eta_me1_after_lct_okClctAlct->Fit("pol0","R0","",2.05,2.38); + eff1a = (h_eff_eta_me1_after_lct_okClctAlct->GetFunction("pol0"))->GetParameter(0); -cout<SetBorderSize(0); -leg->SetFillStyle(0); + TLegend *leg = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); -leg->SetNColumns(2); -leg->SetHeader("Efficiency for #mu with p_{T}>10 crossing a ME1 chamber with"); + leg->SetNColumns(2); + leg->SetHeader("Efficiency for #mu with p_{T}>10 crossing a ME1 chamber with"); -leg->AddEntry(h_eff_eta_me1_after_alct,"any ALCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alct_okAlct,"correct ALCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_clct,"any CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_clct_okClct,"correct CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alct,"any ALCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alct_okAlct,"correct ALCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_clct,"any CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_clct_okClct,"correct CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alctclct,"any ALCT and CLCT","pl"); -//leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlct,"correct ALCT and any CLCT","pl"); -//leg->AddEntry(h_eff_eta_me1_after_alctclct_okClct,"any ALCT and correct CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlctClct,"correct ALCT and CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alctclct,"any ALCT and CLCT","pl"); + //leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlct,"correct ALCT and any CLCT","pl"); + //leg->AddEntry(h_eff_eta_me1_after_alctclct_okClct,"any ALCT and correct CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlctClct,"correct ALCT and CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_lct,"any LCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"correct LCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_lct,"any LCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"correct LCT","pl"); -leg->Draw(); -Print(cme1na,"h_eff_eta_me1_steps_stubs.eps"); -Print(cme1na,"h_eff_eta_me1_steps_stubs" + ext); -Print(cme1na,"h_eff_eta_me1_steps_stubs.pdf"); + leg->Draw(); + Print(cme1na,"h_eff_eta_me1_steps_stubs.eps"); + Print(cme1na,"h_eff_eta_me1_steps_stubs" + ext); + Print(cme1na,"h_eff_eta_me1_steps_stubs.pdf"); -char ghn[111]; -sprintf(ghn,"h_eff_eta_me1_after_lct_okClctAlct_%s",dname); -gh = (TH1F*)h_eff_eta_me1_after_lct_okClctAlct->Clone(ghn); -gh->GetYaxis()->SetRangeUser(0.8,1.02); + char ghn[111]; + sprintf(ghn,"h_eff_eta_me1_after_lct_okClctAlct_%s",dname); + gh = (TH1F*)h_eff_eta_me1_after_lct_okClctAlct->Clone(ghn); + gh->GetYaxis()->SetRangeUser(0.8,1.02); -gh->SetTitle("LCT finding efficiency in ME1 for #mu with p_{T}>10"); -gh->GetXaxis()->SetRangeUser(0.8,2.5); -gh->GetYaxis()->SetRangeUser(0.,1.05); -gh->GetXaxis()->SetTitle("#eta"); -gh->GetYaxis()->SetTitle("Eff."); -gh->GetXaxis()->SetTitleSize(0.07); -gh->GetXaxis()->SetTitleOffset(0.7); -gh->GetYaxis()->SetLabelOffset(0.015); + gh->SetTitle("LCT finding efficiency in ME1 for #mu with p_{T}>10"); + gh->GetXaxis()->SetRangeUser(0.8,2.5); + gh->GetYaxis()->SetRangeUser(0.,1.05); + gh->GetXaxis()->SetTitle("#eta"); + gh->GetYaxis()->SetTitle("Eff."); + gh->GetXaxis()->SetTitleSize(0.07); + gh->GetXaxis()->SetTitleOffset(0.7); + gh->GetYaxis()->SetLabelOffset(0.015); -/* + /* -h_eff_eta_me1_after_clct->SetTitle("CLCT efficiency dependence on #eta: ME1 studies"); -h_eff_eta_me1_after_clct->GetXaxis()->SetRangeUser(0.86,2.5); -h_eff_eta_me1_after_clct->GetXaxis()->SetTitle("#eta"); -h_eff_eta_me1_after_clct->SetMinimum(0); -h_eff_eta_me1_after_clct->GetYaxis()->SetRangeUser(0.,1.05); + h_eff_eta_me1_after_clct->SetTitle("CLCT efficiency dependence on #eta: ME1 studies"); + h_eff_eta_me1_after_clct->GetXaxis()->SetRangeUser(0.86,2.5); + h_eff_eta_me1_after_clct->GetXaxis()->SetTitle("#eta"); + h_eff_eta_me1_after_clct->SetMinimum(0); + h_eff_eta_me1_after_clct->GetYaxis()->SetRangeUser(0.,1.05); -h_eff_eta_me1_after_clct_okClct->SetTitle("Correct CLCT efficiency dependence on #eta: ME1 studies"); -h_eff_eta_me1_after_clct_okClct->GetXaxis()->SetRangeUser(0.86,2.5); -h_eff_eta_me1_after_clct_okClct->GetXaxis()->SetTitle("#eta"); -h_eff_eta_me1_after_clct_okClct->SetMinimum(0); -h_eff_eta_me1_after_clct_okClct->GetYaxis()->SetRangeUser(0.,1.05); + h_eff_eta_me1_after_clct_okClct->SetTitle("Correct CLCT efficiency dependence on #eta: ME1 studies"); + h_eff_eta_me1_after_clct_okClct->GetXaxis()->SetRangeUser(0.86,2.5); + h_eff_eta_me1_after_clct_okClct->GetXaxis()->SetTitle("#eta"); + h_eff_eta_me1_after_clct_okClct->SetMinimum(0); + h_eff_eta_me1_after_clct_okClct->GetYaxis()->SetRangeUser(0.,1.05); -TCanvas* cme1nc = new TCanvas("h_eff_eta_me1_after_clct","h_eff_eta_me1_after_clct",1000,600 ) ; + TCanvas* cme1nc = new TCanvas("h_eff_eta_me1_after_clct","h_eff_eta_me1_after_clct",1000,600 ) ; -h_eff_eta_me1_after_clct_okClct->GetYaxis()->SetRangeUser(0.5,1.02); + h_eff_eta_me1_after_clct_okClct->GetYaxis()->SetRangeUser(0.5,1.02); -//h_eff_eta_me1_after_clct->Draw(); -//h_eff_eta_me1_after_clct_okClct->Draw("same hist"); -h_eff_eta_me1_after_clct_okClct->Draw(); + //h_eff_eta_me1_after_clct->Draw(); + //h_eff_eta_me1_after_clct_okClct->Draw("same hist"); + h_eff_eta_me1_after_clct_okClct->Draw(); -TLegend *leg = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); -leg->SetBorderSize(0); -leg->SetFillStyle(0); + TLegend *leg = new TLegend(0.347,0.222,0.926,0.535,NULL,"brNDC"); + leg->SetBorderSize(0); + leg->SetFillStyle(0); -leg->SetNColumns(2); -leg->SetHeader("Efficiency for #mu with p_{T}>10 crossing a ME1 chamber with"); + leg->SetNColumns(2); + leg->SetHeader("Efficiency for #mu with p_{T}>10 crossing a ME1 chamber with"); -leg->AddEntry(h_eff_eta_me1_after_alct,"any ALCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alct_okAlct,"correct ALCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_clct,"any CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_clct_okClct,"correct CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alct,"any ALCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alct_okAlct,"correct ALCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_clct,"any CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_clct_okClct,"correct CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alctclct,"any ALCT and CLCT","pl"); -//leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlct,"correct ALCT and any CLCT","pl"); -//leg->AddEntry(h_eff_eta_me1_after_alctclct_okClct,"any ALCT and correct CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlctClct,"correct ALCT and CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alctclct,"any ALCT and CLCT","pl"); + //leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlct,"correct ALCT and any CLCT","pl"); + //leg->AddEntry(h_eff_eta_me1_after_alctclct_okClct,"any ALCT and correct CLCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_alctclct_okAlctClct,"correct ALCT and CLCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_lct,"any LCT","pl"); -leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"correct LCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_lct,"any LCT","pl"); + leg->AddEntry(h_eff_eta_me1_after_lct_okClctAlct,"correct LCT","pl"); -leg->Draw(); + leg->Draw(); -Print(cme1na,"h_eff_eta_me1_steps_stubs.eps"); -Print(cme1na,"h_eff_eta_me1_steps_stubs" + ext); -Print(cme1na,"h_eff_eta_me1_steps_stubs.pdf"); -*/ + Print(cme1na,"h_eff_eta_me1_steps_stubs.eps"); + Print(cme1na,"h_eff_eta_me1_steps_stubs" + ext); + Print(cme1na,"h_eff_eta_me1_steps_stubs.pdf"); + */ -//return; + //return; -if (do_h_eff_eta_me1_after_alct_okAlct) { + if (do_h_eff_eta_me1_after_alct_okAlct) { -h_eff_eta_me1_after_alct_okAlct->SetTitle("Correct ALCT efficiency dependence on #eta: ME1 studies"); -h_eff_eta_me1_after_alct_okAlct->GetXaxis()->SetRangeUser(0.86,2.5); -h_eff_eta_me1_after_alct_okAlct->GetXaxis()->SetTitle("#eta"); -h_eff_eta_me1_after_alct_okAlct->SetMinimum(0); -h_eff_eta_me1_after_alct_okAlct->GetYaxis()->SetRangeUser(0.,1.05); + h_eff_eta_me1_after_alct_okAlct->SetTitle("Correct ALCT efficiency dependence on #eta: ME1 studies"); + h_eff_eta_me1_after_alct_okAlct->GetXaxis()->SetRangeUser(0.86,2.5); + h_eff_eta_me1_after_alct_okAlct->GetXaxis()->SetTitle("#eta"); + h_eff_eta_me1_after_alct_okAlct->SetMinimum(0); + h_eff_eta_me1_after_alct_okAlct->GetYaxis()->SetRangeUser(0.,1.05); -TCanvas* cme1nc = new TCanvas("h_eff_eta_me1_after_alctt","h_eff_eta_me1_after_alctt",1000,600 ) ; + TCanvas* cme1nc = new TCanvas("h_eff_eta_me1_after_alctt","h_eff_eta_me1_after_alctt",1000,600 ) ; -h_eff_eta_me1_after_alct_okAlct->GetYaxis()->SetRangeUser(yrange[0],yrange[1]); + h_eff_eta_me1_after_alct_okAlct->GetYaxis()->SetRangeUser(yrange[0],yrange[1]); -//h_eff_eta_me1_after_alct->Draw(); -//h_eff_eta_me1_after_alct_okAlct->Draw("same hist"); -h_eff_eta_me1_after_alct_okAlct->Draw("hist"); + //h_eff_eta_me1_after_alct->Draw(); + //h_eff_eta_me1_after_alct_okAlct->Draw("same hist"); + h_eff_eta_me1_after_alct_okAlct->Draw("hist"); -} + } -return; + return; -/// EFFICIENCY dep. on WIREGROUP + /// EFFICIENCY dep. on WIREGROUP -h_wg_me11_initial = (TH1D*)getH(dir,"h_wg_me11_initial"); -h_wg_me11_after_alct_okAlct = (TH1D*)getH(dir,"h_wg_me11_after_alct_okAlct"); -h_wg_me11_after_alctclct_okAlctClct = (TH1D*)getH(dir,"h_wg_me11_after_alctclct_okAlctClct"); -h_wg_me11_after_lct_okAlctClct = (TH1D*)getH(dir,"h_wg_me11_after_lct_okAlctClct"); + h_wg_me11_initial = (TH1D*)getH(dir,"h_wg_me11_initial"); + h_wg_me11_after_alct_okAlct = (TH1D*)getH(dir,"h_wg_me11_after_alct_okAlct"); + h_wg_me11_after_alctclct_okAlctClct = (TH1D*)getH(dir,"h_wg_me11_after_alctclct_okAlctClct"); + h_wg_me11_after_lct_okAlctClct = (TH1D*)getH(dir,"h_wg_me11_after_lct_okAlctClct"); -h_eff_wg_me11_after_alct_okAlct = (TH1D*) h_wg_me11_after_alct_okAlct->Clone("h_eff_wg_me11_after_alct_okAlct"); -h_eff_wg_me11_after_alctclct_okAlctClct = (TH1D*) h_wg_me11_after_alctclct_okAlctClct->Clone("h_eff_wg_me11_after_alctclct_okAlctClct"); -h_eff_wg_me11_after_lct_okAlctClct = (TH1D*) h_wg_me11_after_lct_okAlctClct->Clone("h_eff_wg_me11_after_lct_okAlctClct"); + h_eff_wg_me11_after_alct_okAlct = (TH1D*) h_wg_me11_after_alct_okAlct->Clone("h_eff_wg_me11_after_alct_okAlct"); + h_eff_wg_me11_after_alctclct_okAlctClct = (TH1D*) h_wg_me11_after_alctclct_okAlctClct->Clone("h_eff_wg_me11_after_alctclct_okAlctClct"); + h_eff_wg_me11_after_lct_okAlctClct = (TH1D*) h_wg_me11_after_lct_okAlctClct->Clone("h_eff_wg_me11_after_lct_okAlctClct"); -h_eff_wg_me11_after_alct_okAlct->Divide(h_eff_wg_me11_after_alct_okAlct,h_wg_me11_initial); -h_eff_wg_me11_after_alctclct_okAlctClct->Divide(h_eff_wg_me11_after_alctclct_okAlctClct,h_wg_me11_initial); -h_eff_wg_me11_after_lct_okAlctClct->Divide(h_eff_wg_me11_after_lct_okAlctClct,h_wg_me11_initial); + h_eff_wg_me11_after_alct_okAlct->Divide(h_eff_wg_me11_after_alct_okAlct,h_wg_me11_initial); + h_eff_wg_me11_after_alctclct_okAlctClct->Divide(h_eff_wg_me11_after_alctclct_okAlctClct,h_wg_me11_initial); + h_eff_wg_me11_after_lct_okAlctClct->Divide(h_eff_wg_me11_after_lct_okAlctClct,h_wg_me11_initial); -h_eff_wg_me11_after_alct_okAlct->SetLineWidth(2); -h_eff_wg_me11_after_alctclct_okAlctClct->SetLineWidth(2); -h_eff_wg_me11_after_lct_okAlctClct->SetLineWidth(2); + h_eff_wg_me11_after_alct_okAlct->SetLineWidth(2); + h_eff_wg_me11_after_alctclct_okAlctClct->SetLineWidth(2); + h_eff_wg_me11_after_lct_okAlctClct->SetLineWidth(2); -h_eff_wg_me11_after_alct_okAlct->SetLineColor(kBlue+1); -h_eff_wg_me11_after_alctclct_okAlctClct->SetLineColor(kYellow+2); -h_eff_wg_me11_after_lct_okAlctClct->SetLineColor(kRed); + h_eff_wg_me11_after_alct_okAlct->SetLineColor(kBlue+1); + h_eff_wg_me11_after_alctclct_okAlctClct->SetLineColor(kYellow+2); + h_eff_wg_me11_after_lct_okAlctClct->SetLineColor(kRed); -h_eff_wg_me11_after_alct_okAlct->SetTitle("Correct ALCT efficiency dependence on WG in ME11"); -h_eff_wg_me11_after_alct_okAlct->SetTitle("wire group"); -h_eff_wg_me11_after_alct_okAlct->SetMinimum(0); -h_eff_wg_me11_after_alct_okAlct->GetYaxis()->SetRangeUser(0.,1.05); + h_eff_wg_me11_after_alct_okAlct->SetTitle("Correct ALCT efficiency dependence on WG in ME11"); + h_eff_wg_me11_after_alct_okAlct->SetTitle("wire group"); + h_eff_wg_me11_after_alct_okAlct->SetMinimum(0); + h_eff_wg_me11_after_alct_okAlct->GetYaxis()->SetRangeUser(0.,1.05); -TCanvas* cme11wgv= new TCanvas("h_eff_wg_me11_after_alct","h_eff_wg_me11_after_alct",1000,600 ) ; -h_eff_wg_me11_after_alct_okAlct->Draw("hist"); -h_eff_wg_me11_after_alctclct_okAlctClct->Draw("same hist"); -h_eff_wg_me11_after_lct_okAlctClct->Draw("same hist"); + TCanvas* cme11wgv= new TCanvas("h_eff_wg_me11_after_alct","h_eff_wg_me11_after_alct",1000,600 ) ; + h_eff_wg_me11_after_alct_okAlct->Draw("hist"); + h_eff_wg_me11_after_alctclct_okAlctClct->Draw("same hist"); + h_eff_wg_me11_after_lct_okAlctClct->Draw("same hist"); From 35470ef25e5e4fffa54509053197f5f1e513b0f6 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 30 Oct 2013 17:10:25 +0100 Subject: [PATCH 180/182] AND and OR any number of TCuts --- SimMuL1/scripts/cuts.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/SimMuL1/scripts/cuts.py b/SimMuL1/scripts/cuts.py index cdb01b67eaec7..25072beccef83 100644 --- a/SimMuL1/scripts/cuts.py +++ b/SimMuL1/scripts/cuts.py @@ -1,12 +1,27 @@ from ROOT import TCut #_______________________________________________________________________________ -def AND(cut1,cut2): - return TCut("(%s) && (%s)"%(cut1.GetTitle(),cut2.GetTitle())) +def AND(*arg): + length = len(arg) + if length < 2: + print "ERROR: invalid number of arguments" + return + result = arg[0] + for i in range(len(arg)-1): + result = TCut("(%s) && (%s)"%(arg[i].GetTitle(),result.GetTitle())) + return result + #_______________________________________________________________________________ -def OR(cut1,cut2): - return TCut("(%s) || (%s)"%(cut1.GetTitle(),cut2.GetTitle())) +def OR(*arg): + length = len(arg) + if length < 2: + print "ERROR: invalid number of arguments" + return + result = arg[0] + for i in range(len(arg)-1): + result = TCut("(%s) || (%s)"%(arg[i].GetTitle(),result.GetTitle())) + return result #_______________________________________________________________________________ ok_eta = TCut("TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.14") From b14f72227743ccfe06d6d007cdfef7b30903e4f3 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Wed, 30 Oct 2013 17:31:29 +0100 Subject: [PATCH 181/182] bugfix AND and OR --- SimMuL1/scripts/cuts.py | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/SimMuL1/scripts/cuts.py b/SimMuL1/scripts/cuts.py index 25072beccef83..1590dddc82059 100644 --- a/SimMuL1/scripts/cuts.py +++ b/SimMuL1/scripts/cuts.py @@ -1,27 +1,44 @@ from ROOT import TCut +#_______________________________________________________________________________ +def ANDtwo(cut1,cut2): + return TCut("(%s) && (%s)"%(cut1.GetTitle(),cut2.GetTitle())) + + +#_______________________________________________________________________________ +def ORtwo(cut1,cut2): + return TCut("(%s) || (%s)"%(cut1.GetTitle(),cut2.GetTitle())) + + #_______________________________________________________________________________ def AND(*arg): length = len(arg) if length < 2: print "ERROR: invalid number of arguments" return - result = arg[0] - for i in range(len(arg)-1): - result = TCut("(%s) && (%s)"%(arg[i].GetTitle(),result.GetTitle())) - return result + if length==2: + return ANDtwo(arg[0],arg[1]) + if length>2: + result = arg[0] + for i in range(1,len(arg)): + result = ANDtwo(result,arg[i]) + return result #_______________________________________________________________________________ -def OR(*arg): +def OR(*arg): length = len(arg) if length < 2: print "ERROR: invalid number of arguments" return - result = arg[0] - for i in range(len(arg)-1): - result = TCut("(%s) || (%s)"%(arg[i].GetTitle(),result.GetTitle())) - return result + if length==2: + return ORtwo(arg[0],arg[1]) + if length>2: + result = arg[0] + for i in range(1,len(arg)): + result = ORtwo(result,arg[i]) + return result + #_______________________________________________________________________________ ok_eta = TCut("TMath::Abs(eta)>1.64 && TMath::Abs(eta)<2.14") From 2688d6f10104764fea7741ab89564d155bf020fb Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Mon, 4 Nov 2013 04:29:05 -0600 Subject: [PATCH 182/182] Add bending angles for Pt 6 GeV --- SimMuL1/scripts/GEMCSCdPhiDict.py | 1 + 1 file changed, 1 insertion(+) diff --git a/SimMuL1/scripts/GEMCSCdPhiDict.py b/SimMuL1/scripts/GEMCSCdPhiDict.py index 9756ffc9c24be..d9d8ad70d5ee1 100644 --- a/SimMuL1/scripts/GEMCSCdPhiDict.py +++ b/SimMuL1/scripts/GEMCSCdPhiDict.py @@ -9,6 +9,7 @@ }, "98" : { 'pt5 ' : { 'odd' : 0.02203511, 'even' : 0.00930056 }, + 'pt06' : { 'odd' : 0.01825790, 'even' : 0.00790009 }, 'pt10' : { 'odd' : 0.01066000, 'even' : 0.00483286 }, 'pt15' : { 'odd' : 0.00722795, 'even' : 0.00363230 }, 'pt20' : { 'odd' : 0.00562598, 'even' : 0.00304878 },