ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
JetTagging
JetTagDerivationUtils
python
JetMatchingConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
4
from
AthenaConfiguration.ComponentFactory
import
CompFactory
5
6
import
warnings
7
8
9
def
JetMatchingCfg
(flags, target, source=None,
10
sources=[],
11
source_name=None,
12
floats_to_copy=[],
13
ints_to_copy=[],
14
chars_to_copy=[],
15
add_suffix_with_source=True,
16
source_minimum_pt=0,
17
pt_priority_with_delta_r=-1,
18
particle_link_name=None,
19
name_suffix=''):
20
21
# handle some backward compatability stuff
22
if
source
is
not
None
:
23
warnings.warn(
24
"'source' option is deprecated, use 'sources'"
,
25
FutureWarning,
26
stacklevel=2
27
)
28
if
sources:
29
raise
ValueError(
30
"Can't use 'sources' and 'source' at the same time"
31
)
32
sources = [source]
33
34
if
not
sources:
35
sources = [target]
36
37
if
source_name
is
None
:
38
source_name =
'Or'
.join(sources)
39
40
dr_str = f
'deltaRTo{source_name}'
41
deta_str = f
'deltaEtaTo{source_name}'
42
dphi_str = f
'deltaPhiTo{source_name}'
43
dpt_str = f
'deltaPtTo{source_name}'
44
match_str = f
'matchedTo{source_name}'
45
n_match_str = f
'numberOfMatchesTo{source_name}'
46
47
def
to(f):
48
return
f + f
'From{source_name}'
if
add_suffix_with_source
else
f
49
50
ca = ComponentAccumulator()
51
ca.addEventAlgo(
52
CompFactory.ftag.JetMatcherAlg(
53
f
'{source_name}To{target}CopyAlg{name_suffix}'
,
54
targetJet=target,
55
sourceJets=sources,
56
floatsToCopy={f: to(f)
for
f
in
floats_to_copy},
57
intsToCopy={i: to(i)
for
i
in
ints_to_copy},
58
charsToCopy={c: to(c)
for
c
in
chars_to_copy},
59
dR=dr_str,
60
dEta=deta_str,
61
dPhi=dphi_str,
62
dPt=dpt_str,
63
isMatched=match_str,
64
nMatch=n_match_str,
65
ptPriorityWithDeltaR=pt_priority_with_delta_r,
66
sourceMinimumPt=source_minimum_pt,
67
particleLink=(particle_link_name
or
""
),
68
)
69
)
70
return
ca
JetMatchingConfig.JetMatchingCfg
JetMatchingCfg(flags, target, source=None, sources=[], source_name=None, floats_to_copy=[], ints_to_copy=[], chars_to_copy=[], add_suffix_with_source=True, source_minimum_pt=0, pt_priority_with_delta_r=-1, particle_link_name=None, name_suffix='')
Definition
JetMatchingConfig.py:19
Generated on
for ATLAS Offline Software by
1.17.0