CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
hltSMPPostProcessors_cff Namespace Reference

Functions

def make_efficiency_string
 
def make_smp_postprocessor
 

Variables

tuple hltSMPPostProcessors
 
tuple hltSMPPostSingleEle = make_smp_postprocessor("SingleEle", plot_types=plot_types, object_types=object_types, extra_str_templates=[truevtx_string_template])
 
tuple hltSMPPostSinglePhoton = make_smp_postprocessor("SinglePhoton", plot_types=plot_types, object_types=object_types, extra_str_templates=[truevtx_string_template])
 
list object_types = ["Mu","Ele","Photon","MET","PFTau"]
 
list plot_types = ["TurnOn1", "TurnOn2", "EffEta", "EffPhi"]
 
string truevtx_string_template = "Eff_trueVtxDist_@ANALYSIS@_gen_@TRIGGER@ ' Efficiency of @TRIGGER@ vs nb of interactions ; nb events passing each path ' trueVtxDist_@ANALYSIS@_gen_@TRIGGER@ trueVtxDist_@ANALYSIS@_gen"
 

Function Documentation

def hltSMPPostProcessors_cff.make_efficiency_string (   objtype,
  plot_type,
  triggerpath 
)

Definition at line 6 of file hltSMPPostProcessors_cff.py.

Referenced by make_smp_postprocessor().

6 
7 def make_efficiency_string(objtype,plot_type,triggerpath):
8  # --- IMPORTANT: Add here a elif if you are introduce a new collection
9  # (see EVTColContainer::getTypeString)
10  if objtype == "Mu" :
11  objtypeLatex="#mu"
12  elif objtype == "Photon":
13  objtypeLatex="#gamma"
14  elif objtype == "Ele":
15  objtypeLatex="e"
16  elif objtype == "MET" :
17  objtypeLatex="MET"
18  elif objtype == "PFTau":
19  objtypeLatex="#tau"
20  else:
21  objtypeLatex=objtype
22 
23  numer_description = "# gen %s passed the %s" % (objtypeLatex,triggerpath)
24  denom_description = "# gen %s " % (objtypeLatex)
25 
26  if plot_type == "TurnOn1":
27  title = "pT Turn-On"
28  xAxis = "p_{T} of Leading Generated %s (GeV/c)" % (objtype)
29  input_type = "gen%sMaxPt1" % (objtype)
30  if plot_type == "TurnOn2":
31  title = "Next-to-Leading pT Turn-On"
32  xAxis = "p_{T} of Next-to-Leading Generated %s (GeV/c)" % (objtype)
33  input_type = "gen%sMaxPt2" % (objtype)
34  if plot_type == "EffEta":
35  title = "#eta Efficiency"
36  xAxis = "#eta of Generated %s " % (objtype)
37  input_type = "gen%sEta" % (objtype)
38  if plot_type == "EffPhi":
39  title = "#phi Efficiency"
40  xAxis = "#phi of Generated %s " % (objtype)
41  input_type = "gen%sPhi" % (objtype)
42 
43  yAxis = "%s / %s" % (numer_description, denom_description)
44  all_titles = "%s for trigger %s; %s; %s" % (title, triggerpath,
45  xAxis, yAxis)
46  return "Eff_%s_%s '%s' %s_%s %s" % (input_type,triggerpath,
47  all_titles,input_type,triggerpath,input_type)
def hltSMPPostProcessors_cff.make_smp_postprocessor (   analysis_name,
  plot_types = ["TurnOn1",
  TurnOn2,
  EffEta,
  EffPhi,
  object_types = ["Mu",
  Ele,
  Photon,
  MET,
  PFMET,
  PFTau,
  Jet,
  extra_str_templates = [] 
)

Definition at line 49 of file hltSMPPostProcessors_cff.py.

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

49 
50 def make_smp_postprocessor(analysis_name, plot_types=["TurnOn1", "TurnOn2", "EffEta", "EffPhi"], object_types=["Mu","Ele","Photon","MET","PFMET","PFTau","Jet"], extra_str_templates=[]):
51  postprocessor = hltSMPPostProcessor.clone()
52  postprocessor.subDirs = ["HLT/SMP/" + analysis_name]
53  efficiency_strings = [] # List of plots to look for. This is quite a bit larger than the number of plots that will be made.
54 
55  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"
56  efficiency_strings.append(efficiency_summary_string)
57  efficiency_strings.append(efficiency_summary_string.replace("Generated", "Reconstructed").replace("Gen", "Reco").replace("gen", "rec"))
58 
59  for plot_type in plot_types:
60  for object_type in object_types:
61  for trigger in [x.replace("_v", "") for x in _config.__getattribute__(analysis_name).hltPathsToCheck]:
62  this_efficiency_string = make_efficiency_string(object_type, plot_type, trigger)
63  efficiency_strings.append(this_efficiency_string)
64  efficiency_strings.append(this_efficiency_string.replace("Generated", "Reconstructed").replace("Gen", "Reco").replace("gen", "rec"))
65 
66  for str_template in extra_str_templates:
67  this_extra_string = str_template.replace("@ANALYSIS@", analysis_name).replace("@TRIGGER@", trigger)
68  efficiency_strings.append(this_extra_string)
69  efficiency_strings.append(this_extra_string.replace("Generated", "Reconstructed").replace("Gen", "Reco").replace("gen", "rec"))
70 
71  postprocessor.efficiencyProfile = efficiency_strings
72  return postprocessor
73 

Variable Documentation

tuple hltSMPPostProcessors_cff.hltSMPPostProcessors
Initial value:
1 = cms.Sequence(
2  hltSMPPostSingleEle+
3 # hltSMPPostSingleMu+
4  hltSMPPostSinglePhoton
5 )

Definition at line 89 of file hltSMPPostProcessors_cff.py.

tuple hltSMPPostProcessors_cff.hltSMPPostSingleEle = make_smp_postprocessor("SingleEle", plot_types=plot_types, object_types=object_types, extra_str_templates=[truevtx_string_template])

Definition at line 81 of file hltSMPPostProcessors_cff.py.

tuple hltSMPPostProcessors_cff.hltSMPPostSinglePhoton = make_smp_postprocessor("SinglePhoton", plot_types=plot_types, object_types=object_types, extra_str_templates=[truevtx_string_template])

Definition at line 83 of file hltSMPPostProcessors_cff.py.

list hltSMPPostProcessors_cff.object_types = ["Mu","Ele","Photon","MET","PFTau"]

Definition at line 77 of file hltSMPPostProcessors_cff.py.

list hltSMPPostProcessors_cff.plot_types = ["TurnOn1", "TurnOn2", "EffEta", "EffPhi"]

Definition at line 74 of file hltSMPPostProcessors_cff.py.

string hltSMPPostProcessors_cff.truevtx_string_template = "Eff_trueVtxDist_@ANALYSIS@_gen_@TRIGGER@ ' Efficiency of @TRIGGER@ vs nb of interactions ; nb events passing each path ' trueVtxDist_@ANALYSIS@_gen_@TRIGGER@ trueVtxDist_@ANALYSIS@_gen"

Definition at line 78 of file hltSMPPostProcessors_cff.py.