CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/HLTriggerOffline/Muon/python/hltMuonPostProcessors_cff.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 
00003 from HLTriggerOffline.Muon.hltMuonPostProcessor_cfi import *
00004 
00005 def efficiency_string(numer_label, denom_label,
00006                       plot_type, output_label=None):
00007     
00008     if output_label is None:
00009         output_label = numer_label
00010     if denom_label == "All" and numer_label != "L1":
00011         output_description = "Full Path"
00012     else:
00013         output_description = numer_label
00014     if denom_label == "All":
00015         denom_description = "# Gen #mu"
00016     else:
00017         denom_description = "# Gen #mu Matched to %s" % (denom_label)
00018     numer_description     = "# Gen #mu Matched to %s" % (numer_label)
00019 
00020     if plot_type == "TurnOn1":
00021         title = "pT Turn-On"
00022         xAxis = "p_{T} of Leading Generated Muon (GeV)"
00023         input_type = "PassMaxPt1"
00024     if plot_type == "TurnOn2":
00025         title = "Next-to-Leading pT Turn-On"
00026         xAxis = "p_{T} of Next-to-Leading Generated Muon (GeV)"
00027         input_type = "PassMaxPt2"
00028     if plot_type == "EffEta":
00029         title = "#eta Efficiency"
00030         xAxis = "#eta of Generated Muon (GeV)"
00031         input_type = "PassEta"
00032     if plot_type == "EffPhi":
00033         title = "#phi Efficiency"
00034         xAxis = "#phi of Generated Muon (GeV)"
00035         input_type = "PassPhi"
00036 
00037     yAxis = "%s / %s" % (numer_description, denom_description)
00038     all_titles = "%s for %s; %s; %s" % (title, output_description,
00039                                         xAxis, yAxis)
00040     return "gen%s_%s '%s' gen%s_%s gen%s_%s" % (plot_type, output_label,
00041                                                 all_titles, input_type,
00042                                                 numer_label, input_type,
00043                                                 denom_label)
00044 
00045 
00046 def add_reco_strings(strings):
00047     reco_strings = []
00048     for entry in strings:
00049         reco_strings.append(entry
00050                             .replace("Generated", "Reconstructed")
00051                             .replace("Gen", "Reco")
00052                             .replace("gen", "rec"))
00053     strings.extend(reco_strings)
00054 
00055 
00056 plot_types = ["TurnOn1", "TurnOn2", "EffEta", "EffPhi"] 
00057 efficiency_strings = []
00058 iso_strings = []
00059 noniso_strings = []
00060 
00061 for type in plot_types:
00062     efficiency_strings.append(efficiency_string("L1", "All", type))
00063     for step in ["L2", "L2Iso", "L3", "L3Iso"]:
00064         efficiency_strings.append(efficiency_string(step, "L1", type))
00065     noniso_strings.append(efficiency_string("L3", "All", type, "Total"))
00066     iso_strings.append(efficiency_string("L3Iso", "All", type, "Total"))
00067 
00068 add_reco_strings(efficiency_strings)
00069 add_reco_strings(noniso_strings)
00070 add_reco_strings(iso_strings)
00071 
00072 hltMuonPostMain = hltMuonPostProcessor.clone()
00073 hltMuonPostMain.subDirs = ['HLT/Muon/Distributions/*']
00074 hltMuonPostMain.efficiencyProfile = efficiency_strings
00075 
00076 hltMuonPostNonIso = hltMuonPostMain.clone()
00077 #hltMuonPostNonIso.subDirs = ['HLT/Muon/Distributions/^(?:[^I]+|I(?!so))*$']
00078 hltMuonPostNonIso.subDirs = ['HLT/Muon/Distributions/((?!Iso).)*$']
00079 hltMuonPostNonIso.efficiencyProfile = noniso_strings
00080 
00081 hltMuonPostIso = hltMuonPostMain.clone()
00082 hltMuonPostIso.subDirs = ['HLT/Muon/Distributions/.*Iso.*$']
00083 hltMuonPostIso.efficiencyProfile = iso_strings
00084 
00085 hltMuonPostProcessors = cms.Sequence(
00086     hltMuonPostNonIso *
00087     hltMuonPostIso    *
00088     hltMuonPostMain
00089 )