ATLAS Offline Software
Loading...
Searching...
No Matches
JetMatchingConfig Namespace Reference

Functions

 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='')

Function Documentation

◆ JetMatchingCfg()

JetMatchingConfig.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 at line 9 of file JetMatchingConfig.py.

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