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 == "refittedStandAloneMuons":
12  objtypeLatex="refittedStandAlone #mu"
13  elif objtype == "Ele":
14  objtypeLatex="e"
15  elif objtype == "Photon":
16  objtypeLatex="#gamma"
17  elif objtype == "PFTau":
18  objtypeLatex="#tau"
19  elif objtype == "PFJet":
20  objtypeLatex="PFJet"
21  elif objtype == "MET" :
22  objtypeLatex="MET"
23  elif objtype == "PFMET" :
24  objtypeLatex="PFMET"
25  elif objtype == "CaloJet" :
26  objtypeLatex="CaloJet"
27  else:
28  objtypeLatex=objtype
29 
30  numer_description = "# gen %s passed the %s" % (objtypeLatex,triggerpath)
31  denom_description = "# gen %s " % (objtypeLatex)
32 
33  if plot_type == "TurnOn1":
34  title = "pT Turn-On"
35  xAxis = "p_{T} of Leading Generated %s (GeV/c)" % (objtype)
36  input_type = "gen%sMaxPt1" % (objtype)
37  if plot_type == "TurnOn2":
38  title = "Next-to-Leading pT Turn-On"
39  xAxis = "p_{T} of Next-to-Leading Generated %s (GeV/c)" % (objtype)
40  input_type = "gen%sMaxPt2" % (objtype)
41  if plot_type == "TurnOn3":
42  title = "HT Turn-On"
43  xAxis = "HT of Leading Generated %s (GeV/c)" % (objtype)
44  input_type = "gen%sSumEt" % (objtype)
45  if plot_type == "EffEta":
46  title = "#eta Efficiency"
47  xAxis = "#eta of Generated %s " % (objtype)
48  input_type = "gen%sEta" % (objtype)
49  if plot_type == "EffPhi":
50  title = "#phi Efficiency"
51  xAxis = "#phi of Generated %s " % (objtype)
52  input_type = "gen%sPhi" % (objtype)
53 
54  yAxis = "%s / %s" % (numer_description, denom_description)
55  all_titles = "%s for trigger %s; %s; %s" % (title, triggerpath,
56  xAxis, yAxis)
57  return "Eff_%s_%s '%s' %s_%s %s" % (input_type,triggerpath,
58  all_titles,input_type,triggerpath,input_type)
59 
60 # Adding the reco objects
61 def add_reco_strings(strings):
62  reco_strings = []
63  for entry in strings:
64  reco_strings.append(entry
65  .replace("Generated", "Reconstructed")
66  .replace("Gen", "Reco")
67  .replace("gen", "rec"))
68  strings.extend(reco_strings)
69 
70 
71 plot_types = ["TurnOn1", "TurnOn2", "TurnOn3", "EffEta", "EffPhi"]
72 #--- IMPORTANT: Update this collection whenever you introduce a new object
73 # in the code (from EVTColContainer::getTypeString)
74 obj_types = ["Mu","refittedStandAloneMuons","Ele","Photon","PFTau","PFJet","MET","PFMET","CaloJet"]
75 #--- IMPORTANT: Trigger are extracted from the hltExoticaValidator_cfi.py module
76 triggers = [ ]
77 efficiency_strings = []
78 
79 # Extract the triggers used in the hltExoticaValidator, for each path
80 from HLTriggerOffline.Exotica.hltExoticaValidator_cfi import hltExoticaValidator as _config
81 triggers = set([])
82 for an in _config.analysis:
83  s = _config.__getattribute__(an)
84  vstr = s.__getattribute__("hltPathsToCheck")
85  map(lambda x: triggers.add(x.replace("_v","")),vstr)
86 triggers = list(triggers)
87 print triggers
88 #------------------------------------------------------------
89 
90 # Generating the list with all the efficiencies
91 for type in plot_types:
92  for obj in obj_types:
93  for trig in triggers:
94  efficiency_strings.append(efficiency_string(obj,type,trig))
95 #for item in efficiency_strings:
96 # print item
97 
98 add_reco_strings(efficiency_strings)
99 
100 #--- IMPORTANT: Here you have to add the analyses one by one.
101 hltExoticaPostHighPtDimuon = hltExoticaPostProcessor.clone()
102 hltExoticaPostHighPtDimuon.subDirs = ['HLT/Exotica/HighPtDimuon']
103 hltExoticaPostHighPtDimuon.efficiencyProfile = efficiency_strings
104 
105 hltExoticaPostHighPtDielectron = hltExoticaPostProcessor.clone()
106 hltExoticaPostHighPtDielectron.subDirs = ['HLT/Exotica/HighPtDielectron']
107 hltExoticaPostHighPtDielectron.efficiencyProfile = efficiency_strings
108 
109 hltExoticaPostHighPtElectron = hltExoticaPostProcessor.clone()
110 hltExoticaPostHighPtElectron.subDirs = ['HLT/Exotica/HighPtElectron']
111 hltExoticaPostHighPtElectron.efficiencyProfile = efficiency_strings
112 
113 hltExoticaPostLowPtElectron = hltExoticaPostProcessor.clone()
114 hltExoticaPostLowPtElectron.subDirs = ['HLT/Exotica/LowPtElectron']
115 hltExoticaPostLowPtElectron.efficiencyProfile = efficiency_strings
116 
117 hltExoticaPostLowPtDimuon = hltExoticaPostProcessor.clone()
118 hltExoticaPostLowPtDimuon.subDirs = ['HLT/Exotica/LowPtDimuon']
119 hltExoticaPostLowPtDimuon.efficiencyProfile = efficiency_strings
120 
121 hltExoticaPostLowPtDielectron = hltExoticaPostProcessor.clone()
122 hltExoticaPostLowPtDielectron.subDirs = ['HLT/Exotica/LowPtDielectron']
123 hltExoticaPostLowPtDielectron.efficiencyProfile = efficiency_strings
124 
125 hltExoticaPostHighPtPhoton = hltExoticaPostProcessor.clone()
126 hltExoticaPostHighPtPhoton.subDirs = ['HLT/Exotica/HighPtPhoton']
127 hltExoticaPostHighPtPhoton.efficiencyProfile = efficiency_strings
128 
129 hltExoticaPostDiPhoton = hltExoticaPostProcessor.clone()
130 hltExoticaPostDiPhoton.subDirs = ['HLT/Exotica/DiPhoton']
131 hltExoticaPostDiPhoton.efficiencyProfile = efficiency_strings
132 
133 hltExoticaPostHT = hltExoticaPostProcessor.clone()
134 hltExoticaPostHT.subDirs = ['HLT/Exotica/HT']
135 hltExoticaPostHT.efficiencyProfile = efficiency_strings
136 
137 hltExoticaPostJetNoBptx = hltExoticaPostProcessor.clone()
138 hltExoticaPostJetNoBptx.subDirs = ['HLT/Exotica/JetNoBptx']
139 hltExoticaPostJetNoBptx.efficiencyProfile = efficiency_strings
140 
141 hltExoticaPostMuonNoBptx = hltExoticaPostProcessor.clone()
142 hltExoticaPostMuonNoBptx.subDirs = ['HLT/Exotica/MuonNoBptx']
143 hltExoticaPostMuonNoBptx.efficiencyProfile = efficiency_strings
144 
145 hltExoticaPostDisplacedEleMu = hltExoticaPostProcessor.clone()
146 hltExoticaPostDisplacedEleMu.subDirs = ['HLT/Exotica/DisplacedEleMu']
147 hltExoticaPostDisplacedEleMu.efficiencyProfile = efficiency_strings
148 
149 hltExoticaPostDisplacedDimuon = hltExoticaPostProcessor.clone()
150 hltExoticaPostDisplacedDimuon.subDirs = ['HLT/Exotica/DisplacedDimuon']
151 hltExoticaPostDisplacedDimuon.efficiencyProfile = efficiency_strings
152 
153 hltExoticaPostDisplacedL2Dimuon = hltExoticaPostProcessor.clone()
154 hltExoticaPostDisplacedL2Dimuon.subDirs = ['HLT/Exotica/DisplacedL2Dimuon']
155 hltExoticaPostDisplacedL2Dimuon.efficiencyProfile = efficiency_strings
156 
157 # Not integrated yet
158 hltExoticaPostMonojet = hltExoticaPostProcessor.clone()
159 hltExoticaPostMonojet.subDirs = ['HLT/Exotica/Monojet']
160 hltExoticaPostMonojet.efficiencyProfile = efficiency_strings
161 
162 hltExoticaPostPureMET = hltExoticaPostProcessor.clone()
163 hltExoticaPostPureMET.subDirs = ['HLT/Exotica/PureMET']
164 hltExoticaPostPureMET.efficiencyProfile = efficiency_strings
165 
166 hltExoticaPostProcessors = cms.Sequence(
167  # Di-lepton paths
168  hltExoticaPostHighPtDimuon +
169  hltExoticaPostHighPtDielectron +
170  hltExoticaPostLowPtDimuon +
171  hltExoticaPostLowPtDielectron +
172  # Single Lepton paths
173  hltExoticaPostHighPtElectron +
174  hltExoticaPostLowPtElectron +
175  # Photon paths
176  hltExoticaPostHighPtPhoton +
177  hltExoticaPostDiPhoton +
178  # HT path
179  hltExoticaPostHT +
180  # NoBptx paths
181  hltExoticaPostJetNoBptx +
182  hltExoticaPostMuonNoBptx +
183  # Displaced paths
184  hltExoticaPostDisplacedEleMu +
185  hltExoticaPostDisplacedDimuon +
186  hltExoticaPostDisplacedL2Dimuon +
187  # Others (to be properly integrated)
188  hltExoticaPostMonojet +
189  hltExoticaPostPureMET
190  )
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