69 geometry=None, autoconfigFromFlags=None, noSystematics=None,
70 onlyNominalOR=False, forceEGammaFullSimConfig=False,
71 returnConfigSeq=False) :
79 trackJets =
not isPhyslite
and not forCompare
81 if autoconfigFromFlags
is not None:
83 geometry = autoconfigFromFlags.GeoModel.Run
85 configSeq = ConfigSequence ()
87 outputContainers = {
'mu_' :
'OutMuons',
88 'el_' :
'OutElectrons',
96 from AnalysisAlgorithmsConfig.ConfigFactory
import ConfigFactory
97 config = ConfigFactory()
99 configSeq += config.makeConfig(
'CommonServices')
100 configSeq.setOptionValue(
'.systematicsHistogram',
'systematicsList')
102 configSeq.setOptionValue(
'.filterSystematics',
"^(?:(?!PseudoData).)*$")
104 configSeq += config.makeConfig(
'PileupReweighting')
108 configSeq += config.makeConfig (
'EventCleaning')
109 configSeq.setOptionValue (
'.runEventCleaning',
True)
112 configSeq += config.makeConfig(
'Jets',
113 containerName=
'AnaJets',
114 jetCollection=
'AntiKt4EMPFlowJets')
115 configSeq.setOptionValue (
'.runJvtUpdate',
False )
116 configSeq.setOptionValue (
'.runNNJvtUpdate',
True )
118 configSeq.setOptionValue (
'.recalibratePhyslite',
False)
120 configSeq += config.makeConfig(
'Jets.JVT',
121 containerName=
'AnaJets' )
125 if geometry
is not LHCPeriod.Run4:
128 btagWP =
"FixedCutBEff_65"
129 configSeq += config.makeConfig(
'Jets.FlavourTagging',
130 containerName=
'AnaJets',
131 selectionName=
'ftag' )
132 configSeq.setOptionValue (
'.noEffSF',
True)
133 configSeq.setOptionValue (
'.btagger', btagger)
134 configSeq.setOptionValue (
'.btagWP', btagWP)
137 btagWP =
"Continuous"
138 configSeq += config.makeConfig(
'Jets.FlavourTagging',
139 containerName=
'AnaJets')
140 configSeq.setOptionValue (
'.btagger', btagger)
141 configSeq.setOptionValue (
'.btagWP', btagWP)
142 configSeq.setOptionValue (
'.saveScores',
'All')
144 configSeq += config.makeConfig(
'Jets.FlavourTaggingEventSF',
145 containerName=
'AnaJets.baselineJvt')
146 configSeq.setOptionValue (
'.btagger', btagger)
147 configSeq.setOptionValue (
'.btagWP', btagWP)
150 configSeq += config.makeConfig(
'Jets',
151 containerName=
'AnaLargeRJets',
152 jetCollection=
'AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets' )
153 outputContainers[
'larger_jet_'] =
'OutLargeRJets'
155 configSeq.setOptionValue (
'.recalibratePhyslite',
False)
158 configSeq += config.makeConfig(
'Jets',
159 containerName=
'AnaTrackJets',
160 jetCollection=
'AntiKtVR30Rmax4Rmin02PV0TrackJets' )
161 outputContainers[
'track_jet_'] =
'OutTrackJets'
163 configSeq += config.makeConfig (
'Jets.PtEtaSelection',
164 containerName=
'AnaJets')
165 configSeq.setOptionValue (
'.selectionDecoration',
'selectPtEta')
166 configSeq.setOptionValue (
'.minPt', jetMinPt)
167 configSeq.setOptionValue (
'.maxEta', jetMaxEta)
169 configSeq += config.makeConfig (
'Jets.PtEtaSelection',
170 containerName=
'AnaLargeRJets')
171 configSeq.setOptionValue (
'.selectionDecoration',
'selectPtEta')
172 configSeq.setOptionValue (
'.minPt', jetMinPt)
173 configSeq.setOptionValue (
'.maxEta', jetMaxEta)
175 configSeq += config.makeConfig (
'Jets.PtEtaSelection',
176 containerName=
'AnaTrackJets')
177 configSeq.setOptionValue (
'.selectionDecoration',
'selectPtEta')
178 configSeq.setOptionValue (
'.minPt', jetMinPt)
179 configSeq.setOptionValue (
'.maxEta', jetMaxEta)
184 configSeq += config.makeConfig (
'Electrons',
185 containerName=
'AnaElectrons' )
186 configSeq.setOptionValue (
'.forceFullSimConfig', forceEGammaFullSimConfig)
188 configSeq.setOptionValue (
'.recalibratePhyslite',
False)
189 configSeq += config.makeConfig (
'Electrons.WorkingPoint',
190 containerName=
'AnaElectrons',
191 selectionName=
'loose')
192 configSeq.setOptionValue (
'.forceFullSimConfig', forceEGammaFullSimConfig)
194 configSeq.setOptionValue (
'.noEffSF',
True)
196 configSeq.setOptionValue (
'.noEffSF', geometry
is LHCPeriod.Run2)
198 configSeq.setOptionValue (
'.identificationWP',
'LooseBLayerLH')
200 configSeq.setOptionValue (
'.identificationWP',
'LooseDNN')
201 configSeq.setOptionValue (
'.isolationWP',
'Loose_VarRad')
202 configSeq.setOptionValue (
'.writeTrackD0Z0',
True)
204 configSeq += config.makeConfig (
'Electrons.PtEtaSelection',
205 containerName=
'AnaElectrons')
206 configSeq.setOptionValue (
'.selectionDecoration',
'selectPtEta')
207 configSeq.setOptionValue (
'.minPt', electronMinPt)
208 configSeq.setOptionValue (
'.maxEta', electronMaxEta)
212 configSeq += config.makeConfig (
'Photons',
213 containerName=
'AnaPhotons' )
214 configSeq.setOptionValue (
'.forceFullSimConfig', forceEGammaFullSimConfig)
215 configSeq.setOptionValue (
'.recomputeIsEM',
False)
217 configSeq.setOptionValue (
'.recalibratePhyslite',
False)
218 configSeq += config.makeConfig (
'Photons.WorkingPoint',
219 containerName=
'AnaPhotons',
220 selectionName=
'tight')
221 configSeq.setOptionValue (
'.forceFullSimConfig', forceEGammaFullSimConfig)
223 configSeq.setOptionValue (
'.noEffSF',
True)
224 configSeq.setOptionValue (
'.qualityWP',
'Tight')
225 configSeq.setOptionValue (
'.isolationWP',
'FixedCutTight')
226 configSeq.setOptionValue (
'.recomputeIsEM',
False)
228 configSeq += config.makeConfig (
'Photons.PtEtaSelection',
229 containerName=
'AnaPhotons')
230 configSeq.setOptionValue (
'.selectionDecoration',
'selectPtEta')
231 configSeq.setOptionValue (
'.minPt', photonMinPt)
232 configSeq.setOptionValue (
'.maxEta', photonMaxEta)
236 configSeq += config.makeConfig (
'Muons',
237 containerName=
'AnaMuons')
239 configSeq.setOptionValue (
'.recalibratePhyslite',
False)
240 configSeq += config.makeConfig (
'Muons.WorkingPoint',
241 containerName=
'AnaMuons',
242 selectionName=
'medium')
243 configSeq.setOptionValue (
'.quality',
'Medium')
244 configSeq.setOptionValue (
'.isolation',
'Loose_VarRad')
246 configSeq.setOptionValue (
'.onlyRecoEffSF',
True)
247 configSeq.setOptionValue (
'.writeTrackD0Z0',
True)
254 configSeq += config.makeConfig (
'Muons.PtEtaSelection',
255 containerName=
'AnaMuons')
256 configSeq.setOptionValue (
'.selectionDecoration',
'selectPtEta')
257 configSeq.setOptionValue (
'.minPt', muonMinPt)
258 configSeq.setOptionValue (
'.maxEta', muonMaxEta)
261 configSeq += config.makeConfig (
'TauJets',
262 containerName=
'AnaTauJets')
263 configSeq += config.makeConfig (
'TauJets.WorkingPoint',
264 containerName=
'AnaTauJets',
265 selectionName=
'tight')
266 configSeq.setOptionValue (
'.quality',
'Tight')
269 configSeq += config.makeConfig(
'TauJets.TriggerSF')
270 configSeq.setOptionValue(
'.containerName',
'AnaTauJets')
271 configSeq.setOptionValue(
'.tauID',
'Tight')
272 configSeq.setOptionValue(
'.triggerChainsPerYear', tauTriggerChainsSF)
274 configSeq += config.makeConfig (
'TauJets.PtEtaSelection',
275 containerName=
'AnaTauJets')
276 configSeq.setOptionValue (
'.selectionDecoration',
'selectPtEta')
277 configSeq.setOptionValue (
'.minPt', tauMinPt)
278 configSeq.setOptionValue (
'.maxEta', tauMaxEta)
282 configSeq += config.makeConfig(
'SystObjectLink', containerName=
'AnaJets')
284 configSeq += config.makeConfig(
'SystObjectLink', containerName=
'AnaLargeRJets')
286 configSeq += config.makeConfig(
'SystObjectLink', containerName=
'AnaTrackJets')
287 configSeq += config.makeConfig(
'SystObjectLink', containerName=
'AnaElectrons')
288 configSeq += config.makeConfig(
'SystObjectLink', containerName=
'AnaPhotons')
289 configSeq += config.makeConfig(
'SystObjectLink', containerName=
'AnaMuons')
290 configSeq += config.makeConfig(
'SystObjectLink', containerName=
'AnaTauJets')
293 if dataType
is not DataType.Data :
295 configSeq += config.makeConfig(
'GeneratorLevelAnalysis')
296 configSeq.setOptionValue (
'.saveCutBookkeepers',
True)
297 configSeq.setOptionValue (
'.runNumber', 284500)
298 configSeq.setOptionValue (
'.cutBookkeepersSystematics',
True)
302 configSeq += config.makeConfig (
'MissingET',
303 containerName=
'AnaMET')
304 configSeq.setOptionValue (
'.jets',
'AnaJets')
305 configSeq.setOptionValue (
'.taus',
'AnaTauJets.tight')
306 configSeq.setOptionValue (
'.electrons',
'AnaElectrons.loose')
307 configSeq.setOptionValue (
'.photons',
'AnaPhotons.tight')
316 configSeq.setOptionValue (
'.muons',
'AnaMuons.medium')
320 configSeq += config.makeConfig(
'OverlapRemoval' )
321 configSeq.setOptionValue (
'.electrons',
'AnaElectrons.loose')
322 configSeq.setOptionValue (
'.photons',
'AnaPhotons.tight')
325 configSeq.setOptionValue (
'.muons',
'AnaMuons.medium')
326 configSeq.setOptionValue (
'.jets',
'AnaJets')
327 configSeq.setOptionValue (
'.taus',
'AnaTauJets.tight')
328 configSeq.setOptionValue (
'.inputLabel',
'preselectOR')
329 configSeq.setOptionValue (
'.outputLabel',
'passesOR' )
330 configSeq.setOptionValue (
'.nominalOnly', onlyNominalOR )
334 configSeq.setOptionValue (
'.addToAllSelections',
True)
335 configSeq.setOptionValue (
'.addPreselection',
True)
338 if not forCompare
and geometry
is not LHCPeriod.Run4:
345 from EventSelectionAlgorithms.EventSelectionConfig
import makeMultipleEventSelectionConfigs
347 met =
'AnaMET', btagDecoration =
'ftag_select_ftag',
348 selectionCutsDict = exampleSelectionCuts, noFilter =
True)
352 configSeq += config.makeConfig (
'ObjectCutFlow',
353 containerName=
'AnaJets',
355 configSeq += config.makeConfig (
'ObjectCutFlow',
356 containerName=
'AnaElectrons',
357 selectionName=
'loose')
358 configSeq += config.makeConfig (
'ObjectCutFlow',
359 containerName=
'AnaPhotons',
360 selectionName=
'tight')
361 configSeq += config.makeConfig (
'ObjectCutFlow',
362 containerName=
'AnaMuons',
363 selectionName=
'medium')
364 configSeq += config.makeConfig (
'ObjectCutFlow',
365 containerName=
'AnaTauJets',
366 selectionName=
'tight')
370 configSeq += config.makeConfig (
'Thinning',
371 containerName=
'AnaElectrons')
372 configSeq.setOptionValue (
'.selectionName',
'loose')
373 configSeq.setOptionValue (
'.outputName',
'OutElectrons')
374 configSeq += config.makeConfig (
'Thinning',
375 containerName=
'AnaPhotons')
376 configSeq.setOptionValue (
'.selectionName',
'tight')
377 configSeq.setOptionValue (
'.outputName',
'OutPhotons')
378 configSeq += config.makeConfig (
'Thinning',
379 containerName=
'AnaMuons')
380 configSeq.setOptionValue (
'.selectionName',
'medium')
381 configSeq.setOptionValue (
'.outputName',
'OutMuons')
382 configSeq += config.makeConfig (
'Thinning',
383 containerName=
'AnaTauJets')
384 configSeq.setOptionValue (
'.selectionName',
'tight')
385 configSeq.setOptionValue (
'.outputName',
'OutTauJets')
386 configSeq += config.makeConfig (
'Thinning',
387 containerName=
'AnaJets')
388 configSeq.setOptionValue (
'.outputName',
'OutJets')
390 configSeq += config.makeConfig (
'Thinning',
391 containerName=
'AnaLargeRJets')
392 configSeq.setOptionValue (
'.outputName',
'OutLargeRJets')
394 configSeq += config.makeConfig (
'Thinning',
395 containerName=
'AnaTrackJets')
396 configSeq.setOptionValue (
'.outputName',
'OutTrackJets')
400 if not forCompare
and geometry
is LHCPeriod.Run2:
402 configSeq += config.makeConfig(
'Trigger' )
403 configSeq.setOptionValue (
'.triggerChainsPerYear', triggerChainsPerYear )
404 configSeq.setOptionValue (
'.noFilter',
True )
405 configSeq.setOptionValue (
'.electronID',
'Tight' )
406 configSeq.setOptionValue (
'.electronIsol',
'Tight_VarRad')
407 configSeq.setOptionValue (
'.photonIsol',
'TightCaloOnly')
408 configSeq.setOptionValue (
'.muonID',
'Tight')
409 configSeq.setOptionValue (
'.electrons',
'AnaElectrons' )
410 configSeq.setOptionValue (
'.photons',
'AnaPhotons' )
411 configSeq.setOptionValue (
'.muons',
'AnaMuons' )
412 configSeq.setOptionValue (
'.taus',
'AnaTauJets' )
413 configSeq.setOptionValue (
'.triggerMatchingChainsPerYear', triggerChainsPerYear)
416 configSeq += config.makeConfig (
'Bootstraps')
417 configSeq.setOptionValue (
'.nReplicas', 2000 )
418 configSeq.setOptionValue (
'.skipOnMC',
False)
422 configSeq += config.makeConfig (
'LeptonSF')
423 if geometry
is not LHCPeriod.Run2:
424 configSeq.setOptionValue (
'.electrons',
'AnaElectrons.loose')
425 configSeq.setOptionValue (
'.muons',
'AnaMuons.medium')
426 configSeq.setOptionValue (
'.photons',
'AnaPhotons.tight')
427 configSeq.setOptionValue (
'.lepton_postfix',
'nominal')
429 configSeq += config.makeConfig (
'Output')
430 configSeq.setOptionValue (
'.treeName',
'analysis')
431 configSeq.setOptionValue (
'.vars', vars)
432 configSeq.setOptionValue (
'.metVars', metVars)
433 configSeq.setOptionValue (
'.containers', outputContainers)
434 disable_commands = []
436 disable_commands += [
437 'disable jet_select_baselineJvt.*',
438 'disable mu_select_medium.*',
439 'disable el_select_loose.*',
440 'disable ph_select_tight.*',
441 'disable tau_select_tight.*',
443 configSeq.setOptionValue (
'.commands', disable_commands)
449 configAccumulator = ConfigAccumulator (algSeq, dataType, isPhyslite, geometry, autoconfigFromFlags=autoconfigFromFlags, noSystematics=noSystematics)
450 configSeq.fullConfigure (configAccumulator)
453 configSeq.printOptions()
455 from AnaAlgorithm.DualUseConfig
import isAthena, useComponentAccumulator
456 if isAthena
and useComponentAccumulator:
457 return configAccumulator.CA