8 inputLabel = '', outputLabel = 'passesOR',
9 linkOverlapObjects = False,
10 doEleEleOR = False, doElectrons = True,
11 doMuons = True, doJets = True,
12 doTaus = True, doTauAntiTauJetOR = False,
13 doPhotons = True, doFatJets = False,
14 enableUserPriority = False,
16 antiTauIDTauLabel = '', antiTauLabel = '',
17 antiTauBJetLabel = '',
18 boostedLeptons = False,
20 shallowViewOutput = True,
21 enableCutflow = False ):
22 """Function creating the overlap removal algorithm sequence
24 The function sets up a multi-input/multi-output analysis algorithm sequnce,
25 which needs to be used in a quite particular way. First off you need to set
26 the arguments of this function correctly.
28 Then, you need to call the configure(...) method on the algorithm sequence
29 returned by this function in the following way:
31 overlapSequence.configure(
33 'electrons' : 'AnalysisElectrons_%SYS%',
34 'photons' : 'AnalysisPhotons_%SYS%',
35 'muons' : 'AnalysisMuons_%SYS%',
36 'jets' : 'AnalysisJets_%SYS%',
37 'taus' : 'AnalysisTauJets_%SYS%' },
39 'electrons' : 'AnalysisElectronsOR_%SYS%',
40 'photons' : 'AnalysisPhotonsOR_%SYS%',
41 'muons' : 'AnalysisMuonsOR_%SYS%',
42 'jets' : 'AnalysisJetsOR_%SYS%',
43 'taus' : 'AnalysisTauJetsOR_%SYS%' } )
46 - You need to provide input and output names in pairs, you must not skip
47 specifying an output name if you specified an input name, and vice
49 - You only define inputs/outputs that your analysis uses. The "labels" of
50 the possible inputs/outputs are: "electrons", "photons", "muons",
51 "jets", "taus" and "fatJets".
53 Function keyword arguments:
54 dataType -- The data type to run on ("data", "mc" or "afii")
55 inputLabel -- Any possible label to pick up the selected objects with. If
56 left empty, all objects from the input containers are
58 outputLabel -- Decoration put on the output variables. Set to "true" for
59 objects passing the overlap removal.
60 linkOverlapObjects -- Set up an element link between overlapping objects
61 doEleEleOR -- Set up electron-electron overlap removal
62 doTauAntiTauJetOR -- Set up Tau-AntiTau-Jet overlap removal
63 doXXXX -- these flags enable/disable object types to
64 configure tools for: doElectrons, doMuons,
65 doJets, doTaus, doPhotons, doFatJets.
66 enableUserPriority -- If enabled, the Ele-, Mu-, Tau- and PhoJetOR tools
67 will respect the user priority in the inputLabel.
68 E.g. SUSYTools assigns all signal objects the
69 priority 2 and pre-selected jets the priority 1.
70 bJetLabel -- Flag to select b-jets with for lepton OR.
71 If left empty, no b-jets are used in the overlap removal.
72 antiTauIDTauLabel -- Flag to select ID tau with for Tau-AntiTau-Jet OR.
73 antiTauLabel -- Flag to select antiTau with. Required for Tau-AntiTau-Jet OR.
74 antiTauBJetLabel -- Flag to select b-jets with for Tau-AntiTau-Jet OR.
75 boostedLeptons -- Set to True to enable boosted lepton overlap removal
76 shallowViewOutput -- Create a view container if required
77 enableCutflow -- Whether or not to dump the cutflow
80 if dataType
not in [
"data",
"mc",
"afii"] :
81 raise ValueError (
"invalid data type: " + dataType)
84 seq = AnaAlgSequence(
'OverlapAnalysisSequence' + postfix )
87 alg =
createAlgorithm(
'CP::OverlapRemovalAlg',
'OverlapRemovalAlg' + postfix )
88 alg.OutputLabel = outputLabel
89 if not shallowViewOutput:
90 alg.electronsDecoration = outputLabel +
'_%SYS%,as_char'
91 alg.muonsDecoration = outputLabel +
'_%SYS%,as_char'
92 alg.tausDecoration = outputLabel +
'_%SYS%,as_char'
93 alg.jetsDecoration = outputLabel +
'_%SYS%,as_char'
94 alg.photonsDecoration = outputLabel +
'_%SYS%,as_char'
95 alg.fatJetsDecoration = outputLabel +
'_%SYS%,as_char'
98 addPrivateTool( alg,
'overlapTool',
'ORUtils::OverlapRemovalTool' )
99 alg.overlapTool.InputLabel = inputLabel
100 alg.overlapTool.OutputLabel = outputLabel
107 alg.overlapTool.OutputPassValue =
True
110 if doElectrons
and doEleEleOR:
112 'ORUtils::EleEleOverlapTool' )
113 alg.overlapTool.EleEleORT.InputLabel = inputLabel
114 alg.overlapTool.EleEleORT.OutputLabel = outputLabel
115 alg.overlapTool.EleEleORT.LinkOverlapObjects = linkOverlapObjects
116 alg.overlapTool.EleEleORT.OutputPassValue =
True
120 if doElectrons
and doMuons:
122 'ORUtils::EleMuSharedTrkOverlapTool' )
123 alg.overlapTool.EleMuORT.InputLabel = inputLabel
124 alg.overlapTool.EleMuORT.OutputLabel = outputLabel
125 alg.overlapTool.EleMuORT.LinkOverlapObjects = linkOverlapObjects
126 alg.overlapTool.EleMuORT.OutputPassValue =
True
130 if doElectrons
and doJets:
132 'ORUtils::EleJetOverlapTool' )
133 alg.overlapTool.EleJetORT.InputLabel = inputLabel
134 alg.overlapTool.EleJetORT.OutputLabel = outputLabel
135 alg.overlapTool.EleJetORT.LinkOverlapObjects = linkOverlapObjects
136 alg.overlapTool.EleJetORT.BJetLabel = bJetLabel
137 alg.overlapTool.EleJetORT.UseSlidingDR = boostedLeptons
138 alg.overlapTool.EleJetORT.EnableUserPriority = enableUserPriority
139 alg.overlapTool.EleJetORT.OutputPassValue =
True
143 if doMuons
and doJets:
145 'ORUtils::MuJetOverlapTool' )
146 alg.overlapTool.MuJetORT.InputLabel = inputLabel
147 alg.overlapTool.MuJetORT.OutputLabel = outputLabel
148 alg.overlapTool.MuJetORT.LinkOverlapObjects = linkOverlapObjects
149 alg.overlapTool.MuJetORT.BJetLabel = bJetLabel
150 alg.overlapTool.MuJetORT.UseSlidingDR = boostedLeptons
151 alg.overlapTool.MuJetORT.EnableUserPriority = enableUserPriority
152 alg.overlapTool.MuJetORT.OutputPassValue =
True
156 if doTaus
and doElectrons:
158 'ORUtils::DeltaROverlapTool' )
159 alg.overlapTool.TauEleORT.InputLabel = inputLabel
160 alg.overlapTool.TauEleORT.OutputLabel = outputLabel
161 alg.overlapTool.TauEleORT.LinkOverlapObjects = linkOverlapObjects
162 alg.overlapTool.TauEleORT.DR = 0.2
163 alg.overlapTool.TauEleORT.OutputPassValue =
True
167 if doTaus
and doMuons:
169 'ORUtils::DeltaROverlapTool' )
170 alg.overlapTool.TauMuORT.InputLabel = inputLabel
171 alg.overlapTool.TauMuORT.OutputLabel = outputLabel
172 alg.overlapTool.TauMuORT.LinkOverlapObjects = linkOverlapObjects
173 alg.overlapTool.TauMuORT.DR = 0.2
174 alg.overlapTool.TauMuORT.OutputPassValue =
True
178 if doTaus
and doJets:
179 if doTauAntiTauJetOR:
181 'ORUtils::TauAntiTauJetOverlapTool' )
182 alg.overlapTool.TauJetORT.TauLabel = antiTauIDTauLabel
183 alg.overlapTool.TauJetORT.AntiTauLabel = antiTauLabel
184 alg.overlapTool.TauJetORT.BJetLabel = antiTauBJetLabel
187 'ORUtils::DeltaROverlapTool' )
189 alg.overlapTool.TauJetORT.InputLabel = inputLabel
190 alg.overlapTool.TauJetORT.OutputLabel = outputLabel
191 alg.overlapTool.TauJetORT.LinkOverlapObjects = linkOverlapObjects
192 alg.overlapTool.TauJetORT.DR = 0.2
193 alg.overlapTool.TauJetORT.EnableUserPriority = enableUserPriority
194 alg.overlapTool.TauJetORT.OutputPassValue =
True
198 if doPhotons
and doElectrons:
200 'ORUtils::DeltaROverlapTool' )
201 alg.overlapTool.PhoEleORT.InputLabel = inputLabel
202 alg.overlapTool.PhoEleORT.OutputLabel = outputLabel
203 alg.overlapTool.PhoEleORT.LinkOverlapObjects = linkOverlapObjects
204 alg.overlapTool.PhoEleORT.OutputPassValue =
True
208 if doPhotons
and doMuons:
210 'ORUtils::DeltaROverlapTool' )
211 alg.overlapTool.PhoMuORT.InputLabel = inputLabel
212 alg.overlapTool.PhoMuORT.OutputLabel = outputLabel
213 alg.overlapTool.PhoMuORT.LinkOverlapObjects = linkOverlapObjects
214 alg.overlapTool.PhoMuORT.OutputPassValue =
True
218 if doPhotons
and doJets:
220 'ORUtils::DeltaROverlapTool' )
221 alg.overlapTool.PhoJetORT.InputLabel = inputLabel
222 alg.overlapTool.PhoJetORT.OutputLabel = outputLabel
223 alg.overlapTool.PhoJetORT.LinkOverlapObjects = linkOverlapObjects
224 alg.overlapTool.PhoJetORT.EnableUserPriority = enableUserPriority
225 alg.overlapTool.PhoJetORT.OutputPassValue =
True
229 if doElectrons
and doFatJets:
231 'ORUtils::DeltaROverlapTool' )
232 alg.overlapTool.EleFatJetORT.InputLabel = inputLabel
233 alg.overlapTool.EleFatJetORT.OutputLabel = outputLabel
234 alg.overlapTool.EleFatJetORT.LinkOverlapObjects = linkOverlapObjects
235 alg.overlapTool.EleFatJetORT.DR = 1.0
236 alg.overlapTool.EleFatJetORT.OutputPassValue =
True
240 if doJets
and doFatJets:
242 'ORUtils::DeltaROverlapTool' )
243 alg.overlapTool.JetFatJetORT.InputLabel = inputLabel
244 alg.overlapTool.JetFatJetORT.OutputLabel = outputLabel
245 alg.overlapTool.JetFatJetORT.LinkOverlapObjects = linkOverlapObjects
246 alg.overlapTool.JetFatJetORT.DR = 1.0
247 alg.overlapTool.JetFatJetORT.OutputPassValue =
True
251 if shallowViewOutput:
253 inputPropName = {
'electrons' :
'electrons',
257 'photons' :
'photons',
258 'fatJets' :
'fatJets' },
259 outputPropName = {
'electrons' :
'electronsOut',
260 'muons' :
'muonsOut',
263 'photons' :
'photonsOut',
264 'fatJets' :
'fatJetsOut' } )
268 inputPropName = {
'electrons' :
'electrons',
272 'photons' :
'photons',
273 'fatJets' :
'fatJets' } )
277 if shallowViewOutput:
278 for container
in [ (
'electrons', doElectrons ),
279 (
'muons', doMuons ),
282 (
'photons', doPhotons ),
283 (
'fatJets', doFatJets ) ]:
286 if not container[ 1 ]:
292 'OverlapRemovalCutFlowDumperAlg_%s' % container[ 0 ] + postfix )
293 alg.histPattern = container[ 0 ] + postfix +
'_OR_cflow_%SYS%'
295 alg.selections = [
'%s,as_char' % inputLabel,
296 '%s,as_char' % outputLabel ]
298 alg.selections = [
'%s,as_char' % outputLabel ]
299 seq.append( alg, inputPropName = { container[ 0 ] :
'input' } )
303 'OverlapRemovalViewMaker_%s' % container[ 0 ] + postfix )
304 alg.selection = [
'%s,as_char' % outputLabel ]
305 seq.append( alg, inputPropName = { container[ 0 ] :
'input' },
306 outputPropName = { container[ 0 ] :
'output' } )