CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
hltHiggsPostProcessors_cff.py
Go to the documentation of this file.
2 
4 
5 # Build the standard strings to the DQM
6 def 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 == "PFTau":
18  objtypeLatex="#tau"
19  else:
20  objtypeLatex=objtype
21 
22  numer_description = "# gen %s passed the %s" % (objtypeLatex,triggerpath)
23  denom_description = "# gen %s " % (objtypeLatex)
24 
25  if plot_type == "TurnOn1":
26  title = "pT Turn-On"
27  xAxis = "p_{T} of Leading Generated %s (GeV/c)" % (objtype)
28  input_type = "gen%sMaxPt1" % (objtype)
29  if plot_type == "TurnOn2":
30  title = "Next-to-Leading pT Turn-On"
31  xAxis = "p_{T} of Next-to-Leading Generated %s (GeV/c)" % (objtype)
32  input_type = "gen%sMaxPt2" % (objtype)
33  if plot_type == "EffEta":
34  title = "#eta Efficiency"
35  xAxis = "#eta of Generated %s " % (objtype)
36  input_type = "gen%sEta" % (objtype)
37  if plot_type == "EffPhi":
38  title = "#phi Efficiency"
39  xAxis = "#phi of Generated %s " % (objtype)
40  input_type = "gen%sPhi" % (objtype)
41 
42  yAxis = "%s / %s" % (numer_description, denom_description)
43  all_titles = "%s for trigger %s; %s; %s" % (title, triggerpath,
44  xAxis, yAxis)
45  return "Eff_%s_%s '%s' %s_%s %s" % (input_type,triggerpath,
46  all_titles,input_type,triggerpath,input_type)
47 
48 # Adding the reco objects
49 def add_reco_strings(strings):
50  reco_strings = []
51  for entry in strings:
52  reco_strings.append(entry
53  .replace("Generated", "Reconstructed")
54  .replace("Gen", "Reco")
55  .replace("gen", "rec"))
56  strings.extend(reco_strings)
57 
58 
59 plot_types = ["TurnOn1", "TurnOn2", "EffEta", "EffPhi"]
60 #--- IMPORTANT: Update this collection whenever you introduce a new object
61 # in the code (from EVTColContainer::getTypeString)
62 obj_types = ["Mu","Ele","Photon","MET","PFTau"]
63 #--- IMPORTANT: Trigger are extracted from the hltHiggsValidator_cfi.py module
64 triggers = [ ]
65 efficiency_strings = []
66 
67 # Extract the triggers used in the hltHiggsValidator
68 from HLTriggerOffline.Higgs.hltHiggsValidator_cfi import hltHiggsValidator as config
69 triggers = set([])
70 for an in config.analysis:
71  s = config.__getattribute__(an)
72  vstr = s.__getattribute__("hltPathsToCheck")
73  map(lambda x: triggers.add(x.replace("_v","")),vstr)
74 triggers = list(triggers)
75 #------------------------------------------------------------
76 
77 # Generating the list with all the efficiencies
78 for type in plot_types:
79  for obj in obj_types:
80  for trig in triggers:
81  efficiency_strings.append(efficiency_string(obj,type,trig))
82 
83 add_reco_strings(efficiency_strings)
84 
85 hltHiggsPostHTauNu = hltHiggsPostProcessor.clone()
86 hltHiggsPostHTauNu.subDirs = ['HLT/Higgs/Htaunu']
87 hltHiggsPostHTauNu.efficiencyProfile = efficiency_strings
88 
89 hltHiggsPostHWW = hltHiggsPostProcessor.clone()
90 hltHiggsPostHWW.subDirs = ['HLT/Higgs/HWW']
91 hltHiggsPostHWW.efficiencyProfile = efficiency_strings
92 
93 hltHiggsPostHZZ = hltHiggsPostProcessor.clone()
94 hltHiggsPostHZZ.subDirs = ['HLT/Higgs/HZZ']
95 hltHiggsPostHZZ.efficiencyProfile = efficiency_strings
96 
97 hltHiggsPostHgg = hltHiggsPostProcessor.clone()
98 hltHiggsPostHgg.subDirs = ['HLT/Higgs/Hgg']
99 hltHiggsPostHgg.efficiencyProfile = efficiency_strings
100 
101 hltHiggsPostH2tau = hltHiggsPostProcessor.clone()
102 hltHiggsPostH2tau.subDirs = ['HLT/Higgs/H2tau']
103 hltHiggsPostH2tau.efficiencyProfile = efficiency_strings
104 
105 hltHiggsPostHtaunu = hltHiggsPostProcessor.clone()
106 hltHiggsPostHtaunu.subDirs = ['HLT/Higgs/Htaunu']
107 hltHiggsPostHtaunu.efficiencyProfile = efficiency_strings
108 
109 
110 hltHiggsPostProcessors = cms.Sequence(
111  hltHiggsPostHWW+
112  hltHiggsPostHZZ+
113  hltHiggsPostHgg+
114  hltHiggsPostHtaunu+
115  hltHiggsPostH2tau
116 )
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
void set(const std::string &name, int value)
set the flag, with a run-time name