CMS 3D CMS Logo

hltExoticaPostProcessors_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
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  else:
20  objtypeLatex=objtype
21  numer_description = "# gen %s passed the %s" % (objtypeLatex,triggerpath)
22  denom_description = "# gen %s " % (objtypeLatex)
23 
24  if plot_type == "TurnOn1":
25  title = "pT Turn-On"
26  xAxis = "p_{T} of Leading Generated %s (GeV/c)" % (objtype)
27  input_type = "gen%sMaxPt1" % (objtype)
28  if plot_type == "TurnOn2":
29  title = "Next-to-Leading pT Turn-On"
30  xAxis = "p_{T} of Next-to-Leading Generated %s (GeV/c)" % (objtype)
31  input_type = "gen%sMaxPt2" % (objtype)
32  if plot_type == "TurnOn3":
33  title = "Next-to-next-to-Leading pT Turn-On"
34  xAxis = "p_{T} of Next-to-next-to-Leading Generated %s (GeV/c)" % (objtype)
35  input_type = "gen%sMaxPt3" % (objtype)
36  if plot_type == "TurnOn4":
37  title = "SumEt Turn-On"
38  xAxis = "SumEt of Leading Generated %s (GeV/c)" % (objtype)
39  input_type = "gen%sSumEt" % (objtype)
40  if plot_type == "EffEta":
41  title = "#eta Efficiency"
42  xAxis = "#eta of Generated %s " % (objtype)
43  input_type = "gen%sEta" % (objtype)
44  if plot_type == "EffPhi":
45  title = "#phi Efficiency"
46  xAxis = "#phi of Generated %s " % (objtype)
47  input_type = "gen%sPhi" % (objtype)
48  if plot_type == "EffDxy":
49  title = "Dxy Efficiency"
50  xAxis = "Dxy of Generated %s " % (objtype)
51  input_type = "gen%sDxy" % (objtype)
52 
53  yAxis = "%s / %s" % (numer_description, denom_description)
54  all_titles = "%s for trigger %s; %s; %s" % (title, triggerpath,
55  xAxis, yAxis)
56  return "Eff_%s_%s '%s' %s_%s %s" % (input_type,triggerpath,
57  all_titles,input_type,triggerpath,input_type)
58 
59 # Adding the reco objects
60 def add_reco_strings(strings):
61  reco_strings = []
62  for entry in strings:
63  reco_strings.append(entry
64  .replace("Generated", "Reconstructed")
65  .replace("Gen", "Reco")
66  .replace("gen", "rec"))
67  strings.extend(reco_strings)
68 
69 
70 plot_types = ["TurnOn1", "TurnOn2", "TurnOn3", "TurnOn4", "EffEta", "EffPhi", "EffDxy"]
71 #--- IMPORTANT: Update this collection whenever you introduce a new object
72 # in the code (from EVTColContainer::getTypeString)
73 obj_types = ["Mu","refittedStandAloneMuons","Track","Ele","Photon","PFTau","PFJet","MET","PFMET","PFMHT","GenMET","CaloJet"
74  ,"CaloMET","CaloMHT","l1MET"]
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 #------------------------------------------------------------
88 
89 # Generating the list with all the efficiencies
90 for type in plot_types:
91  for obj in obj_types:
92  for trig in triggers:
93  efficiency_strings.append(efficiency_string(obj,type,trig))
94 #for item in efficiency_strings:
95 # print item
96 
97 add_reco_strings(efficiency_strings)
98 
99 #--- IMPORTANT: Here you have to add the analyses one by one.
100 hltExoticaPostLowPtTrimuon = hltExoticaPostProcessor.clone()
101 hltExoticaPostLowPtTrimuon.subDirs = ['HLT/Exotica/LowPtTrimuon']
102 hltExoticaPostLowPtTrimuon.efficiencyProfile = efficiency_strings
103 
104 hltExoticaPostHighPtDimuon = hltExoticaPostProcessor.clone()
105 hltExoticaPostHighPtDimuon.subDirs = ['HLT/Exotica/HighPtDimuon']
106 hltExoticaPostHighPtDimuon.efficiencyProfile = efficiency_strings
107 
108 hltExoticaPostHighPtDielectron = hltExoticaPostProcessor.clone()
109 hltExoticaPostHighPtDielectron.subDirs = ['HLT/Exotica/HighPtDielectron']
110 hltExoticaPostHighPtDielectron.efficiencyProfile = efficiency_strings
111 
112 hltExoticaPostHighPtElectron = hltExoticaPostProcessor.clone()
113 hltExoticaPostHighPtElectron.subDirs = ['HLT/Exotica/HighPtElectron']
114 hltExoticaPostHighPtElectron.efficiencyProfile = efficiency_strings
115 
116 hltExoticaPostLowPtElectron = hltExoticaPostProcessor.clone()
117 hltExoticaPostLowPtElectron.subDirs = ['HLT/Exotica/LowPtElectron']
118 hltExoticaPostLowPtElectron.efficiencyProfile = efficiency_strings
119 
120 hltExoticaPostLowPtDimuon = hltExoticaPostProcessor.clone()
121 hltExoticaPostLowPtDimuon.subDirs = ['HLT/Exotica/LowPtDimuon']
122 hltExoticaPostLowPtDimuon.efficiencyProfile = efficiency_strings
123 
124 hltExoticaPostLowPtDielectron = hltExoticaPostProcessor.clone()
125 hltExoticaPostLowPtDielectron.subDirs = ['HLT/Exotica/LowPtDielectron']
126 hltExoticaPostLowPtDielectron.efficiencyProfile = efficiency_strings
127 
128 hltExoticaPostHighPtPhoton = hltExoticaPostProcessor.clone()
129 hltExoticaPostHighPtPhoton.subDirs = ['HLT/Exotica/HighPtPhoton']
130 hltExoticaPostHighPtPhoton.efficiencyProfile = efficiency_strings
131 
132 hltExoticaPostDiPhoton = hltExoticaPostProcessor.clone()
133 hltExoticaPostDiPhoton.subDirs = ['HLT/Exotica/DiPhoton']
134 hltExoticaPostDiPhoton.efficiencyProfile = efficiency_strings
135 
136 hltExoticaPostSingleMuon = hltExoticaPostProcessor.clone()
137 hltExoticaPostSingleMuon.subDirs = ['HLT/Exotica/SingleMuon']
138 hltExoticaPostSingleMuon.efficiencyProfile = efficiency_strings
139 
140 hltExoticaPostPFHT = hltExoticaPostProcessor.clone()
141 hltExoticaPostPFHT.subDirs = ['HLT/Exotica/PFHT']
142 hltExoticaPostPFHT.efficiencyProfile = efficiency_strings
143 
144 hltExoticaPostCaloHT = hltExoticaPostProcessor.clone()
145 hltExoticaPostCaloHT.subDirs = ['HLT/Exotica/CaloHT']
146 hltExoticaPostCaloHT.efficiencyProfile = efficiency_strings
147 
148 hltExoticaPostJetNoBptx = hltExoticaPostProcessor.clone()
149 hltExoticaPostJetNoBptx.subDirs = ['HLT/Exotica/JetNoBptx']
150 hltExoticaPostJetNoBptx.efficiencyProfile = efficiency_strings
151 
152 hltExoticaPostMuonNoBptx = hltExoticaPostProcessor.clone()
153 hltExoticaPostMuonNoBptx.subDirs = ['HLT/Exotica/MuonNoBptx']
154 hltExoticaPostMuonNoBptx.efficiencyProfile = efficiency_strings
155 
156 hltExoticaPostDisplacedMuEG = hltExoticaPostProcessor.clone()
157 hltExoticaPostDisplacedMuEG.subDirs = ['HLT/Exotica/DisplacedMuEG']
158 hltExoticaPostDisplacedMuEG.efficiencyProfile = efficiency_strings
159 
160 hltExoticaPostDisplacedDimuon = hltExoticaPostProcessor.clone()
161 hltExoticaPostDisplacedDimuon.subDirs = ['HLT/Exotica/DisplacedDimuon']
162 hltExoticaPostDisplacedDimuon.efficiencyProfile = efficiency_strings
163 
164 hltExoticaPostDisplacedL2Dimuon = hltExoticaPostProcessor.clone()
165 hltExoticaPostDisplacedL2Dimuon.subDirs = ['HLT/Exotica/DisplacedL2Dimuon']
166 hltExoticaPostDisplacedL2Dimuon.efficiencyProfile = efficiency_strings
167 
168 hltExoticaPostMonojet = hltExoticaPostProcessor.clone()
169 hltExoticaPostMonojet.subDirs = ['HLT/Exotica/Monojet']
170 hltExoticaPostMonojet.efficiencyProfile = efficiency_strings
171 
172 hltExoticaPostMonojetBackup = hltExoticaPostProcessor.clone()
173 hltExoticaPostMonojetBackup.subDirs = ['HLT/Exotica/MonojetBackup']
174 hltExoticaPostMonojetBackup.efficiencyProfile = efficiency_strings
175 
176 hltExoticaPostPureMET = hltExoticaPostProcessor.clone()
177 hltExoticaPostPureMET.subDirs = ['HLT/Exotica/PureMET']
178 hltExoticaPostPureMET.efficiencyProfile = efficiency_strings
179 
180 hltExoticaPostMETplusTrack = hltExoticaPostProcessor.clone()
181 hltExoticaPostMETplusTrack.subDirs = ['HLT/Exotica/METplusTrack']
182 hltExoticaPostMETplusTrack.efficiencyProfile = efficiency_strings
183 
184 hltExoticaDisplacedDimuonDijet = hltExoticaPostProcessor.clone()
185 hltExoticaDisplacedDimuonDijet.subDirs = ['HLT/Exotica/DisplacedDimuonDijet']
186 hltExoticaDisplacedDimuonDijet.efficiencyProfile = efficiency_strings
187 
188 hltExoticaEleMu = hltExoticaPostProcessor.clone()
189 hltExoticaEleMu.subDirs = ['HLT/Exotica/EleMu']
190 hltExoticaEleMu.efficiencyProfile = efficiency_strings
191 
192 hltExoticaPhotonMET = hltExoticaPostProcessor.clone()
193 hltExoticaPhotonMET.subDirs = ['HLT/Exotica/PhotonMET']
194 hltExoticaPhotonMET.efficiencyProfile = efficiency_strings
195 
196 hltExoticaHTDisplacedJets = hltExoticaPostProcessor.clone()
197 hltExoticaHTDisplacedJets.subDirs = ['HLT/Exotica/HTDisplacedJets']
198 hltExoticaHTDisplacedJets.efficiencyProfile = efficiency_strings
199 
200 hltExoticaDSTJets = hltExoticaPostProcessor.clone()
201 hltExoticaDSTJets.subDirs = ['HLT/Exotica/DSTJets']
202 hltExoticaDSTJets.efficiencyProfile = efficiency_strings
203 
204 hltExoticaDSTMuons = hltExoticaPostProcessor.clone()
205 hltExoticaDSTMuons.subDirs = ['HLT/Exotica/DSTMuons']
206 hltExoticaDSTMuons.efficiencyProfile = efficiency_strings
207 
208 hltExoticaTracklessJets = hltExoticaPostProcessor.clone()
209 hltExoticaTracklessJets.subDirs = ['HLT/Exotica/TracklessJets']
210 hltExoticaTracklessJets.efficiencyProfile = efficiency_strings
211 
212 hltExoticaPostProcessors = cms.Sequence(
213  # Tri-lepton paths
214  hltExoticaPostLowPtTrimuon +
215  # Di-lepton paths
216  hltExoticaPostHighPtDimuon +
217  hltExoticaPostHighPtDielectron +
218  hltExoticaPostLowPtDimuon +
219  hltExoticaPostLowPtDielectron +
220  # Single Lepton paths
221  hltExoticaPostHighPtElectron +
222  hltExoticaPostLowPtElectron +
223  # Photon paths
224  hltExoticaPostHighPtPhoton +
225  hltExoticaPostDiPhoton +
226  # HT path
227  hltExoticaPostPFHT +
228  hltExoticaPostCaloHT +
229  # NoBptx paths
230  hltExoticaPostJetNoBptx +
231  hltExoticaPostMuonNoBptx +
232  # Displaced paths
233  hltExoticaPostDisplacedMuEG +
234  hltExoticaPostDisplacedDimuon +
235  hltExoticaPostDisplacedL2Dimuon +
236  # Others
237  hltExoticaPostMonojet +
238  hltExoticaPostMonojetBackup +
239  hltExoticaPostPureMET +
240  hltExoticaPostMETplusTrack +
241  hltExoticaDisplacedDimuonDijet +
242  hltExoticaEleMu +
243  hltExoticaPhotonMET +
244  hltExoticaHTDisplacedJets +
245  hltExoticaTracklessJets +
246  # scouting triggers
247  hltExoticaDSTJets +
248  hltExoticaDSTMuons
249  )
def efficiency_string(objtype, plot_type, triggerpath)
def replace(string, replacements)
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