CMS 3D CMS Logo

Functions
hltHiggsPostProcessors_cff Namespace Reference

Functions

def make_efficiency_string (objtype, plot_type, triggerpath)
 
def make_higgs_postprocessor (analysis_name, plot_types=["TurnOn1", TurnOn2, EffEta, EffPhi, object_types=["Mu", Ele, Photon, MET, PFMET, PFTau, Jet, extra_str_templates=[])
 

Function Documentation

def hltHiggsPostProcessors_cff.make_efficiency_string (   objtype,
  plot_type,
  triggerpath 
)

Definition at line 6 of file hltHiggsPostProcessors_cff.py.

Referenced by make_higgs_postprocessor().

6 def make_efficiency_string(objtype,plot_type,triggerpath):
7  # --- IMPORTANT: Add here a elif if you are introduce a new collection
8  # (see EVTColContainer::getTypeString)
9  if objtype == "Mu":
10  objtypeLatex="#mu"
11  elif objtype == "Photon":
12  objtypeLatex="#gamma"
13  elif objtype == "Ele":
14  objtypeLatex="e"
15  elif objtype == "MET" :
16  objtypeLatex="MET"
17  elif objtype == "PFMET" :
18  objtypeLatex="PFMET"
19  elif objtype == "PFTau":
20  objtypeLatex="#tau"
21  elif objtype == "Jet":
22  objtypeLatex="jet"
23  else:
24  objtypeLatex=objtype
25 
26  numer_description = "# gen %s passed the %s" % (objtypeLatex,triggerpath)
27  denom_description = "# gen %s " % (objtypeLatex)
28 
29  if plot_type == "TurnOn1":
30  title = "pT Turn-On"
31  xAxis = "p_{T} of Leading Generated %s (GeV/c)" % (objtype)
32  input_type = "gen%sMaxPt1" % (objtype)
33  elif plot_type == "TurnOn2":
34  title = "Next-to-Leading pT Turn-On"
35  xAxis = "p_{T} of Next-to-Leading Generated %s (GeV/c)" % (objtype)
36  input_type = "gen%sMaxPt2" % (objtype)
37  elif plot_type == "EffEta":
38  title = "#eta Efficiency"
39  xAxis = "#eta of Generated %s " % (objtype)
40  input_type = "gen%sEta" % (objtype)
41  elif plot_type == "EffPhi":
42  title = "#phi Efficiency"
43  xAxis = "#phi of Generated %s " % (objtype)
44  input_type = "gen%sPhi" % (objtype)
45  elif "TurnOn" in plot_type:
46  title = "%sth Leading pT Turn-On" % (plot_type[-1])
47  xAxis = "p_{T} of %sth Leading Generated %s (GeV/c)" % (plot_type[-1], objtype)
48  input_type = "gen%sMaxPt%s" % (objtype, plot_type[-1])
49  elif plot_type == "EffdEtaqq":
50  title = "#Delta #eta_{qq} Efficiency"
51  xAxis = "#Delta #eta_{qq} of Generated %s " % (objtype)
52  input_type = "gen%sdEtaqq" % (objtype)
53  elif plot_type == "Effmqq":
54  title = "m_{qq} Efficiency"
55  xAxis = "m_{qq} of Generated %s " % (objtype)
56  input_type = "gen%smqq" % (objtype)
57  elif plot_type == "EffdPhibb":
58  title = "#Delta #phi_{bb} Efficiency"
59  xAxis = "#Delta #phi_{bb} of Generated %s " % (objtype)
60  input_type = "gen%sdPhibb" % (objtype)
61  elif plot_type == "EffCSV1":
62  title = "CSV1 Efficiency"
63  xAxis = "CSV1 of Generated %s " % (objtype)
64  input_type = "gen%sCSV1" % (objtype)
65  elif plot_type == "EffCSV2":
66  title = "CSV2 Efficiency"
67  xAxis = "CSV2 of Generated %s " % (objtype)
68  input_type = "gen%sCSV2" % (objtype)
69  elif plot_type == "EffCSV3":
70  title = "CSV3 Efficiency"
71  xAxis = "CSV3 of Generated %s " % (objtype)
72  input_type = "gen%sCSV3" % (objtype)
73  elif plot_type == "EffmaxCSV":
74  title = "max CSV Efficiency"
75  xAxis = "max CSV of Generated %s " % (objtype)
76  input_type = "gen%smaxCSV" % (objtype)
77 
78  yAxis = "%s / %s" % (numer_description, denom_description)
79  all_titles = "%s for trigger %s; %s; %s" % (title, triggerpath,
80  xAxis, yAxis)
81  return "Eff_%s_%s '%s' %s_%s %s" % (input_type,triggerpath,
82  all_titles,input_type,triggerpath,input_type)
83 
84 #--- IMPORTANT: Trigger are extracted from the hltHiggsValidator_cfi.py module
def make_efficiency_string(objtype, plot_type, triggerpath)
def hltHiggsPostProcessors_cff.make_higgs_postprocessor (   analysis_name,
  plot_types = ["TurnOn1",
  TurnOn2,
  EffEta,
  EffPhi,
  object_types = ["Mu",
  Ele,
  Photon,
  MET,
  PFMET,
  PFTau,
  Jet,
  extra_str_templates = [] 
)

Definition at line 86 of file hltHiggsPostProcessors_cff.py.

References reco.if(), make_efficiency_string(), and python.rootplot.root2matplotlib.replace().

86 def make_higgs_postprocessor(analysis_name, plot_types=["TurnOn1", "TurnOn2", "EffEta", "EffPhi"], object_types=["Mu","Ele","Photon","MET","PFMET","PFTau","Jet"], extra_str_templates=[]):
87  postprocessor = hltHiggsPostProcessor.clone()
88  postprocessor.subDirs = ["HLT/Higgs/" + analysis_name]
89  efficiency_strings = [] # List of plots to look for. This is quite a bit larger than the number of plots that will be made.
90 
91  efficiency_summary_string = "EffSummaryPaths_" + analysis_name + "_gen ' Efficiency of paths used in " + analysis_name + " ; trigger path ' SummaryPaths_" + analysis_name + "_gen_passingHLT SummaryPaths_" + analysis_name + "_gen"
92  efficiency_strings.append(efficiency_summary_string)
93  efficiency_strings.append(efficiency_summary_string.replace("Generated", "Reconstructed").replace("Gen", "Reco").replace("gen", "rec"))
94 
95  for plot_type in plot_types:
96  for object_type in object_types:
97  for trigger in [x.replace("_v", "") for x in _config.__getattribute__(analysis_name).hltPathsToCheck]:
98  this_efficiency_string = make_efficiency_string(object_type, plot_type, trigger)
99  efficiency_strings.append(this_efficiency_string)
100  efficiency_strings.append(this_efficiency_string.replace("Generated", "Reconstructed").replace("Gen", "Reco").replace("gen", "rec"))
101 
102  for str_template in extra_str_templates:
103  this_extra_string = str_template.replace("@ANALYSIS@", analysis_name).replace("@TRIGGER@", trigger)
104  efficiency_strings.append(this_extra_string)
105  efficiency_strings.append(this_extra_string.replace("Generated", "Reconstructed").replace("Gen", "Reco").replace("gen", "rec"))
106 
107  postprocessor.efficiencyProfile = efficiency_strings
108  return postprocessor
109 
def make_higgs_postprocessor(analysis_name, plot_types=["TurnOn1", TurnOn2, EffEta, EffPhi, object_types=["Mu", Ele, Photon, MET, PFMET, PFTau, Jet, extra_str_templates=[])
def replace(string, replacements)
def make_efficiency_string(objtype, plot_type, triggerpath)