CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
hltExoticaPostProcessors_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 == "Ele":
12  objtypeLatex="e"
13  elif objtype == "Photon":
14  objtypeLatex="#gamma"
15  elif objtype == "PFTau":
16  objtypeLatex="#tau"
17  elif objtype == "PFJet":
18  objtypeLatex="PFJet"
19  elif objtype == "MET" :
20  objtypeLatex="MET"
21  else:
22  objtypeLatex=objtype
23 
24  numer_description = "# gen %s passed the %s" % (objtypeLatex,triggerpath)
25  denom_description = "# gen %s " % (objtypeLatex)
26 
27  if plot_type == "TurnOn1":
28  title = "pT Turn-On"
29  xAxis = "p_{T} of Leading Generated %s (GeV/c)" % (objtype)
30  input_type = "gen%sMaxPt1" % (objtype)
31  if plot_type == "TurnOn2":
32  title = "Next-to-Leading pT Turn-On"
33  xAxis = "p_{T} of Next-to-Leading Generated %s (GeV/c)" % (objtype)
34  input_type = "gen%sMaxPt2" % (objtype)
35  if plot_type == "TurnOn3":
36  title = "HT Turn-On"
37  xAxis = "HT of Leading Generated %s (GeV/c)" % (objtype)
38  input_type = "gen%sSumEt" % (objtype)
39  if plot_type == "EffEta":
40  title = "#eta Efficiency"
41  xAxis = "#eta of Generated %s " % (objtype)
42  input_type = "gen%sEta" % (objtype)
43  if plot_type == "EffPhi":
44  title = "#phi Efficiency"
45  xAxis = "#phi of Generated %s " % (objtype)
46  input_type = "gen%sPhi" % (objtype)
47 
48  yAxis = "%s / %s" % (numer_description, denom_description)
49  all_titles = "%s for trigger %s; %s; %s" % (title, triggerpath,
50  xAxis, yAxis)
51  return "Eff_%s_%s '%s' %s_%s %s" % (input_type,triggerpath,
52  all_titles,input_type,triggerpath,input_type)
53 
54 # Adding the reco objects
55 def add_reco_strings(strings):
56  reco_strings = []
57  for entry in strings:
58  reco_strings.append(entry
59  .replace("Generated", "Reconstructed")
60  .replace("Gen", "Reco")
61  .replace("gen", "rec"))
62  strings.extend(reco_strings)
63 
64 
65 plot_types = ["TurnOn1", "TurnOn2", "TurnOn3", "EffEta", "EffPhi"]
66 #--- IMPORTANT: Update this collection whenever you introduce a new object
67 # in the code (from EVTColContainer::getTypeString)
68 obj_types = ["Mu","Ele","Photon","PFTau","PFJet","MET"]
69 #--- IMPORTANT: Trigger are extracted from the hltExoticaValidator_cfi.py module
70 triggers = [ ]
71 efficiency_strings = []
72 
73 # Extract the triggers used in the hltExoticaValidator, for each path
74 from HLTriggerOffline.Exotica.hltExoticaValidator_cfi import hltExoticaValidator as _config
75 triggers = set([])
76 for an in _config.analysis:
77  s = _config.__getattribute__(an)
78  vstr = s.__getattribute__("hltPathsToCheck")
79  map(lambda x: triggers.add(x.replace("_v","")),vstr)
80 triggers = list(triggers)
81 print triggers
82 #------------------------------------------------------------
83 
84 # Generating the list with all the efficiencies
85 for type in plot_types:
86  for obj in obj_types:
87  for trig in triggers:
88  efficiency_strings.append(efficiency_string(obj,type,trig))
89 #for item in efficiency_strings:
90 # print item
91 
92 add_reco_strings(efficiency_strings)
93 
94 #--- IMPORTANT: Here you have to add the analyses one by one.
95 hltExoticaPostHighPtDimuon = hltExoticaPostProcessor.clone()
96 hltExoticaPostHighPtDimuon.subDirs = ['HLT/Exotica/HighPtDimuon']
97 hltExoticaPostHighPtDimuon.efficiencyProfile = efficiency_strings
98 
99 hltExoticaPostHighPtDielectron = hltExoticaPostProcessor.clone()
100 hltExoticaPostHighPtDielectron.subDirs = ['HLT/Exotica/HighPtDielectron']
101 hltExoticaPostHighPtDielectron.efficiencyProfile = efficiency_strings
102 
103 hltExoticaPostEleMu = hltExoticaPostProcessor.clone()
104 hltExoticaPostEleMu.subDirs = ['HLT/Exotica/EleMu']
105 hltExoticaPostEleMu.efficiencyProfile = efficiency_strings
106 
107 hltExoticaPostMonojet = hltExoticaPostProcessor.clone()
108 hltExoticaPostMonojet.subDirs = ['HLT/Exotica/Monojet']
109 hltExoticaPostMonojet.efficiencyProfile = efficiency_strings
110 
111 hltExoticaPostPureMET = hltExoticaPostProcessor.clone()
112 hltExoticaPostPureMET.subDirs = ['HLT/Exotica/PureMET']
113 hltExoticaPostPureMET.efficiencyProfile = efficiency_strings
114 
115 hltExoticaPostHT = hltExoticaPostProcessor.clone()
116 hltExoticaPostHT.subDirs = ['HLT/Exotica/HT']
117 hltExoticaPostHT.efficiencyProfile = efficiency_strings
118 
119 hltExoticaPostProcessors = cms.Sequence(
120  hltExoticaPostHighPtDimuon +
121  hltExoticaPostHighPtDielectron +
122  hltExoticaPostEleMu +
123  hltExoticaPostMonojet +
124  hltExoticaPostPureMET +
125  hltExoticaPostHT
126 )
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