ATLAS Offline Software
Loading...
Searching...
No Matches
AssociationUtilsConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3from AthenaConfiguration.ComponentFactory import CompFactory
4
5def OverlapRemovalToolCfg(ConfigFlags,
6 masterName='OverlapRemovalTool',
7 inputLabel='selected', outputLabel='overlaps',
8 bJetLabel='', maxElePtForBJetAwareOR = 100. * 1000,
9 boostedLeptons=False,
10 outputPassValue=False,
11 linkOverlapObjects=False,
12 doEleEleOR=False,
13 doElectrons=True, doMuons=True, doJets=True,
14 doTaus=True, doPhotons=True, doFatJets=False,
15 **kwargs):
16
17 """
18 Provides the pre-configured overlap removal recommendations.
19 All overlap tools will be (private) added to the master tool
20 which is then returned by this function.
21
22 Arguments:
23 masterName - set the name of the master tool.
24 inputLabel - set the InputLabel property for all tools.
25 outputLabel - set the OutputLabel property for all tools.
26 bJetLabel - set user bjet decoration name. Leave blank to
27 disable btag-aware overlap removal.
28 maxElePtForBJetAwareOR - set the maximum electron pT for which b-tag
29 aware overlap removal is done. Set to negative
30 value to use for all electrons.
31 boostedLeptons - enable sliding dR cones for boosted lepton
32 analyses.
33 outputPassValue - set the OutputPassValue property for all tools
34 which determines whether passing objects are
35 marked with true or false.
36 linkOverlapObjects - enable ElementLinks to overlap objects.
37 doEleEleOR - enable electron-electron overlap removal.
38 doXXXX - these flags enable/disable object types to
39 configure tools for: doElectrons, doMuons,
40 doJets, doTaus, doPhotons, doFatJets.
41 kwargs - additional properties to be applied to all tools.
42 For example: OutputLevel.
43 """
44
45 # These properties can be applied to all tools
46 common_args = {
47 'InputLabel' : inputLabel,
48 'OutputLabel' : outputLabel,
49 'OutputPassValue' : outputPassValue
50 }
51 # Extend with additional user-defined global properties
52 common_args.update(kwargs)
53
54 # Configure the master tool
55 orTool = CompFactory.ORUtils.OverlapRemovalTool(masterName, **common_args)
56
57 # Overlap tools share an additional common property for object linking
58 common_args['LinkOverlapObjects'] = linkOverlapObjects
59
60 # Electron-electron
61 if doElectrons and doEleEleOR:
62 orTool.EleEleORT = CompFactory.ORUtils.EleEleOverlapTool('EleEleORT', **common_args)
63
64 # Electron-muon
65 if doElectrons and doMuons:
66 orTool.EleMuORT = CompFactory.ORUtils.EleMuSharedTrkOverlapTool('EleMuORT', **common_args)
67 # Electron-jet
68 if doElectrons and doJets:
69 orTool.EleJetORT = CompFactory.ORUtils.EleJetOverlapTool('EleJetORT',
70 BJetLabel=bJetLabel,
71 MaxElePtForBJetAwareOR=maxElePtForBJetAwareOR,
72 UseSlidingDR=boostedLeptons,
73 **common_args)
74 # Muon-jet
75 if doMuons and doJets:
76 orTool.MuJetORT = CompFactory.ORUtils.MuJetOverlapTool('MuJetORT',
77 BJetLabel=bJetLabel,
78 UseSlidingDR=boostedLeptons,
79 **common_args)
80
81 # Tau-electron
82 if doTaus and doElectrons:
83 orTool.TauEleORT = CompFactory.ORUtils.DeltaROverlapTool('TauEleORT', DR=0.2, **common_args)
84 # Tau-muon
85 if doTaus and doMuons:
86 orTool.TauMuORT = CompFactory.ORUtils.DeltaROverlapTool('TauMuORT', DR=0.2, **common_args)
87 # Tau-jet
88 if doTaus and doJets:
89 orTool.TauJetORT = CompFactory.ORUtils.DeltaROverlapTool('TauJetORT', DR=0.2, **common_args)
90
91 # Photon-electron
92 if doPhotons and doElectrons:
93 orTool.PhoEleORT = CompFactory.ORUtils.DeltaROverlapTool('PhoEleORT', **common_args)
94 # Photon-muon
95 if doPhotons and doMuons:
96 orTool.PhoMuORT = CompFactory.ORUtils.DeltaROverlapTool('PhoMuORT', **common_args)
97 # Photon-jet
98 if doPhotons and doJets:
99 orTool.PhoJetORT = CompFactory.ORUtils.DeltaROverlapTool('PhoJetORT', **common_args)
100
101 # Electron-fatjet
102 if doElectrons and doFatJets:
103 orTool.EleFatJetORT = CompFactory.ORUtils.DeltaROverlapTool('EleFatJetORT', DR=1.0, **common_args)
104 # Jet-fatjet
105 if doJets and doFatJets:
106 orTool.JetFatJetORT = CompFactory.ORUtils.DeltaROverlapTool('JetFatJetORT', DR=1.0, **common_args)
107
108 acc = ComponentAccumulator()
109 acc.setPrivateTools(orTool)
110 return acc
111
112
OverlapRemovalToolCfg(ConfigFlags, masterName='OverlapRemovalTool', inputLabel='selected', outputLabel='overlaps', bJetLabel='', maxElePtForBJetAwareOR=100. *1000, boostedLeptons=False, outputPassValue=False, linkOverlapObjects=False, doEleEleOR=False, doElectrons=True, doMuons=True, doJets=True, doTaus=True, doPhotons=True, doFatJets=False, **kwargs)