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 = "SumEt Turn-On"
34  xAxis = "SumEt of Leading Generated %s (GeV/c)" % (objtype)
35  input_type = "gen%sSumEt" % (objtype)
36  if plot_type == "EffEta":
37  title = "#eta Efficiency"
38  xAxis = "#eta of Generated %s " % (objtype)
39  input_type = "gen%sEta" % (objtype)
40  if plot_type == "EffPhi":
41  title = "#phi Efficiency"
42  xAxis = "#phi of Generated %s " % (objtype)
43  input_type = "gen%sPhi" % (objtype)
44 
45  yAxis = "%s / %s" % (numer_description, denom_description)
46  all_titles = "%s for trigger %s; %s; %s" % (title, triggerpath,
47  xAxis, yAxis)
48  return "Eff_%s_%s '%s' %s_%s %s" % (input_type,triggerpath,
49  all_titles,input_type,triggerpath,input_type)
50 
51 # Adding the reco objects
52 def add_reco_strings(strings):
53  reco_strings = []
54  for entry in strings:
55  reco_strings.append(entry
56  .replace("Generated", "Reconstructed")
57  .replace("Gen", "Reco")
58  .replace("gen", "rec"))
59  strings.extend(reco_strings)
60 
61 
62 plot_types = ["TurnOn1", "TurnOn2", "TurnOn3", "EffEta", "EffPhi"]
63 #--- IMPORTANT: Update this collection whenever you introduce a new object
64 # in the code (from EVTColContainer::getTypeString)
65 obj_types = ["Mu","refittedStandAloneMuons","Track","Ele","Photon","PFTau","PFJet","MET","PFMET","PFMHT","GenMET","CaloJet"
66  ,"CaloMET","l1MET"]
67 #--- IMPORTANT: Trigger are extracted from the hltExoticaValidator_cfi.py module
68 triggers = [ ]
69 efficiency_strings = []
70 
71 # Extract the triggers used in the hltExoticaValidator, for each path
72 from HLTriggerOffline.Exotica.hltExoticaValidator_cfi import hltExoticaValidator as _config
73 triggers = set([])
74 for an in _config.analysis:
75  s = _config.__getattribute__(an)
76  vstr = s.__getattribute__("hltPathsToCheck")
77  map(lambda x: triggers.add(x.replace("_v","")),vstr)
78 triggers = list(triggers)
79 print triggers
80 #------------------------------------------------------------
81 
82 # Generating the list with all the efficiencies
83 for type in plot_types:
84  for obj in obj_types:
85  for trig in triggers:
86  efficiency_strings.append(efficiency_string(obj,type,trig))
87 #for item in efficiency_strings:
88 # print item
89 
90 add_reco_strings(efficiency_strings)
91 
92 #--- IMPORTANT: Here you have to add the analyses one by one.
93 hltExoticaPostHighPtDimuon = hltExoticaPostProcessor.clone()
94 hltExoticaPostHighPtDimuon.subDirs = ['HLT/Exotica/HighPtDimuon']
95 hltExoticaPostHighPtDimuon.efficiencyProfile = efficiency_strings
96 
97 hltExoticaPostHighPtDielectron = hltExoticaPostProcessor.clone()
98 hltExoticaPostHighPtDielectron.subDirs = ['HLT/Exotica/HighPtDielectron']
99 hltExoticaPostHighPtDielectron.efficiencyProfile = efficiency_strings
100 
101 hltExoticaPostHighPtElectron = hltExoticaPostProcessor.clone()
102 hltExoticaPostHighPtElectron.subDirs = ['HLT/Exotica/HighPtElectron']
103 hltExoticaPostHighPtElectron.efficiencyProfile = efficiency_strings
104 
105 hltExoticaPostLowPtElectron = hltExoticaPostProcessor.clone()
106 hltExoticaPostLowPtElectron.subDirs = ['HLT/Exotica/LowPtElectron']
107 hltExoticaPostLowPtElectron.efficiencyProfile = efficiency_strings
108 
109 hltExoticaPostLowPtDimuon = hltExoticaPostProcessor.clone()
110 hltExoticaPostLowPtDimuon.subDirs = ['HLT/Exotica/LowPtDimuon']
111 hltExoticaPostLowPtDimuon.efficiencyProfile = efficiency_strings
112 
113 hltExoticaPostLowPtDielectron = hltExoticaPostProcessor.clone()
114 hltExoticaPostLowPtDielectron.subDirs = ['HLT/Exotica/LowPtDielectron']
115 hltExoticaPostLowPtDielectron.efficiencyProfile = efficiency_strings
116 
117 hltExoticaPostHighPtPhoton = hltExoticaPostProcessor.clone()
118 hltExoticaPostHighPtPhoton.subDirs = ['HLT/Exotica/HighPtPhoton']
119 hltExoticaPostHighPtPhoton.efficiencyProfile = efficiency_strings
120 
121 hltExoticaPostDiPhoton = hltExoticaPostProcessor.clone()
122 hltExoticaPostDiPhoton.subDirs = ['HLT/Exotica/DiPhoton']
123 hltExoticaPostDiPhoton.efficiencyProfile = efficiency_strings
124 
125 hltExoticaPostSingleMuon = hltExoticaPostProcessor.clone()
126 hltExoticaPostSingleMuon.subDirs = ['HLT/Exotica/SingleMuon']
127 hltExoticaPostSingleMuon.efficiencyProfile = efficiency_strings
128 
129 hltExoticaPostHT = hltExoticaPostProcessor.clone()
130 hltExoticaPostHT.subDirs = ['HLT/Exotica/HT']
131 hltExoticaPostHT.efficiencyProfile = efficiency_strings
132 
133 hltExoticaPostJetNoBptx = hltExoticaPostProcessor.clone()
134 hltExoticaPostJetNoBptx.subDirs = ['HLT/Exotica/JetNoBptx']
135 hltExoticaPostJetNoBptx.efficiencyProfile = efficiency_strings
136 
137 hltExoticaPostMuonNoBptx = hltExoticaPostProcessor.clone()
138 hltExoticaPostMuonNoBptx.subDirs = ['HLT/Exotica/MuonNoBptx']
139 hltExoticaPostMuonNoBptx.efficiencyProfile = efficiency_strings
140 
141 hltExoticaPostDisplacedMuEG = hltExoticaPostProcessor.clone()
142 hltExoticaPostDisplacedMuEG.subDirs = ['HLT/Exotica/DisplacedMuEG']
143 hltExoticaPostDisplacedMuEG.efficiencyProfile = efficiency_strings
144 
145 hltExoticaPostDisplacedDimuon = hltExoticaPostProcessor.clone()
146 hltExoticaPostDisplacedDimuon.subDirs = ['HLT/Exotica/DisplacedDimuon']
147 hltExoticaPostDisplacedDimuon.efficiencyProfile = efficiency_strings
148 
149 hltExoticaPostDisplacedL2Dimuon = hltExoticaPostProcessor.clone()
150 hltExoticaPostDisplacedL2Dimuon.subDirs = ['HLT/Exotica/DisplacedL2Dimuon']
151 hltExoticaPostDisplacedL2Dimuon.efficiencyProfile = efficiency_strings
152 
153 hltExoticaPostMonojet = hltExoticaPostProcessor.clone()
154 hltExoticaPostMonojet.subDirs = ['HLT/Exotica/Monojet']
155 hltExoticaPostMonojet.efficiencyProfile = efficiency_strings
156 
157 hltExoticaPostMonojetBackup = hltExoticaPostProcessor.clone()
158 hltExoticaPostMonojetBackup.subDirs = ['HLT/Exotica/MonojetBackup']
159 hltExoticaPostMonojetBackup.efficiencyProfile = efficiency_strings
160 
161 hltExoticaPostPureMET = hltExoticaPostProcessor.clone()
162 hltExoticaPostPureMET.subDirs = ['HLT/Exotica/PureMET']
163 hltExoticaPostPureMET.efficiencyProfile = efficiency_strings
164 
165 hltExoticaPostMETplusTrack = hltExoticaPostProcessor.clone()
166 hltExoticaPostMETplusTrack.subDirs = ['HLT/Exotica/METplusTrack']
167 hltExoticaPostMETplusTrack.efficiencyProfile = efficiency_strings
168 
169 hltExoticaDisplacedDimuonDijet = hltExoticaPostProcessor.clone()
170 hltExoticaDisplacedDimuonDijet.subDirs = ['HLT/Exotica/DisplacedDimuonDijet']
171 hltExoticaDisplacedDimuonDijet.efficiencyProfile = efficiency_strings
172 
173 hltExoticaEleMu = hltExoticaPostProcessor.clone()
174 hltExoticaEleMu.subDirs = ['HLT/Exotica/EleMu']
175 hltExoticaEleMu.efficiencyProfile = efficiency_strings
176 
177 hltExoticaPhotonMET = hltExoticaPostProcessor.clone()
178 hltExoticaPhotonMET.subDirs = ['HLT/Exotica/PhotonMET']
179 hltExoticaPhotonMET.efficiencyProfile = efficiency_strings
180 
181 hltExoticaHTDisplacedJets = hltExoticaPostProcessor.clone()
182 hltExoticaHTDisplacedJets.subDirs = ['HLT/Exotica/HTDisplacedJets']
183 hltExoticaHTDisplacedJets.efficiencyProfile = efficiency_strings
184 
185 hltExoticaPostProcessors = cms.Sequence(
186  # Di-lepton paths
187  hltExoticaPostHighPtDimuon +
188  hltExoticaPostHighPtDielectron +
189  hltExoticaPostLowPtDimuon +
190  hltExoticaPostLowPtDielectron +
191  # Single Lepton paths
192  hltExoticaPostHighPtElectron +
193  hltExoticaPostLowPtElectron +
194  # Photon paths
195  hltExoticaPostHighPtPhoton +
196  hltExoticaPostDiPhoton +
197  # HT path
198  hltExoticaPostHT +
199  # NoBptx paths
200  hltExoticaPostJetNoBptx +
201  hltExoticaPostMuonNoBptx +
202  # Displaced paths
203  hltExoticaPostDisplacedMuEG +
204  hltExoticaPostDisplacedDimuon +
205  hltExoticaPostDisplacedL2Dimuon +
206  # Others
207  hltExoticaPostMonojet +
208  hltExoticaPostMonojetBackup +
209  hltExoticaPostPureMET +
210  hltExoticaPostMETplusTrack +
211  hltExoticaDisplacedDimuonDijet +
212  hltExoticaEleMu +
213  hltExoticaPhotonMET +
214  hltExoticaHTDisplacedJets
215  )
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