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  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","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 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 hltExoticaPostSingleMuon = hltExoticaPostProcessor.clone()
134 hltExoticaPostSingleMuon.subDirs = ['HLT/Exotica/SingleMuon']
135 hltExoticaPostSingleMuon.efficiencyProfile = efficiency_strings
136 
137 hltExoticaPostHT = hltExoticaPostProcessor.clone()
138 hltExoticaPostHT.subDirs = ['HLT/Exotica/HT']
139 hltExoticaPostHT.efficiencyProfile = efficiency_strings
140 
141 hltExoticaPostJetNoBptx = hltExoticaPostProcessor.clone()
142 hltExoticaPostJetNoBptx.subDirs = ['HLT/Exotica/JetNoBptx']
143 hltExoticaPostJetNoBptx.efficiencyProfile = efficiency_strings
144 
145 hltExoticaPostMuonNoBptx = hltExoticaPostProcessor.clone()
146 hltExoticaPostMuonNoBptx.subDirs = ['HLT/Exotica/MuonNoBptx']
147 hltExoticaPostMuonNoBptx.efficiencyProfile = efficiency_strings
148 
149 hltExoticaPostDisplacedMuEG = hltExoticaPostProcessor.clone()
150 hltExoticaPostDisplacedMuEG.subDirs = ['HLT/Exotica/DisplacedMuEG']
151 hltExoticaPostDisplacedMuEG.efficiencyProfile = efficiency_strings
152 
153 hltExoticaPostDisplacedDimuon = hltExoticaPostProcessor.clone()
154 hltExoticaPostDisplacedDimuon.subDirs = ['HLT/Exotica/DisplacedDimuon']
155 hltExoticaPostDisplacedDimuon.efficiencyProfile = efficiency_strings
156 
157 hltExoticaPostDisplacedL2Dimuon = hltExoticaPostProcessor.clone()
158 hltExoticaPostDisplacedL2Dimuon.subDirs = ['HLT/Exotica/DisplacedL2Dimuon']
159 hltExoticaPostDisplacedL2Dimuon.efficiencyProfile = efficiency_strings
160 
161 hltExoticaPostMonojet = hltExoticaPostProcessor.clone()
162 hltExoticaPostMonojet.subDirs = ['HLT/Exotica/Monojet']
163 hltExoticaPostMonojet.efficiencyProfile = efficiency_strings
164 
165 hltExoticaPostMonojetBackup = hltExoticaPostProcessor.clone()
166 hltExoticaPostMonojetBackup.subDirs = ['HLT/Exotica/MonojetBackup']
167 hltExoticaPostMonojetBackup.efficiencyProfile = efficiency_strings
168 
169 hltExoticaPostPureMET = hltExoticaPostProcessor.clone()
170 hltExoticaPostPureMET.subDirs = ['HLT/Exotica/PureMET']
171 hltExoticaPostPureMET.efficiencyProfile = efficiency_strings
172 
173 hltExoticaPostMETplusTrack = hltExoticaPostProcessor.clone()
174 hltExoticaPostMETplusTrack.subDirs = ['HLT/Exotica/METplusTrack']
175 hltExoticaPostMETplusTrack.efficiencyProfile = efficiency_strings
176 
177 hltExoticaDisplacedDimuonDijet = hltExoticaPostProcessor.clone()
178 hltExoticaDisplacedDimuonDijet.subDirs = ['HLT/Exotica/DisplacedDimuonDijet']
179 hltExoticaDisplacedDimuonDijet.efficiencyProfile = efficiency_strings
180 
181 hltExoticaEleMu = hltExoticaPostProcessor.clone()
182 hltExoticaEleMu.subDirs = ['HLT/Exotica/EleMu']
183 hltExoticaEleMu.efficiencyProfile = efficiency_strings
184 
185 hltExoticaPhotonMET = hltExoticaPostProcessor.clone()
186 hltExoticaPhotonMET.subDirs = ['HLT/Exotica/PhotonMET']
187 hltExoticaPhotonMET.efficiencyProfile = efficiency_strings
188 
189 hltExoticaHTDisplacedJets = hltExoticaPostProcessor.clone()
190 hltExoticaHTDisplacedJets.subDirs = ['HLT/Exotica/HTDisplacedJets']
191 hltExoticaHTDisplacedJets.efficiencyProfile = efficiency_strings
192 
193 hltExoticaPostProcessors = cms.Sequence(
194  # Di-lepton paths
195  hltExoticaPostHighPtDimuon +
196  hltExoticaPostHighPtDielectron +
197  hltExoticaPostLowPtDimuon +
198  hltExoticaPostLowPtDielectron +
199  # Single Lepton paths
200  hltExoticaPostHighPtElectron +
201  hltExoticaPostLowPtElectron +
202  # Photon paths
203  hltExoticaPostHighPtPhoton +
204  hltExoticaPostDiPhoton +
205  # HT path
206  hltExoticaPostHT +
207  # NoBptx paths
208  hltExoticaPostJetNoBptx +
209  hltExoticaPostMuonNoBptx +
210  # Displaced paths
211  hltExoticaPostDisplacedMuEG +
212  hltExoticaPostDisplacedDimuon +
213  hltExoticaPostDisplacedL2Dimuon +
214  # Others
215  hltExoticaPostMonojet +
216  hltExoticaPostMonojetBackup +
217  hltExoticaPostPureMET +
218  hltExoticaPostMETplusTrack +
219  hltExoticaDisplacedDimuonDijet +
220  hltExoticaEleMu +
221  hltExoticaPhotonMET +
222  hltExoticaHTDisplacedJets
223  )
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