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=[], 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 = [],
source_minimum_pt = 0,
pt_priority_with_delta_r = -1,
particle_link_name = None,
name_suffix = '' )

Definition at line 9 of file JetMatchingConfig.py.

16 name_suffix=''):
17
18 # handle some backward compatability stuff
19 if source is not None:
20 warnings.warn(
21 "'source' option is deprecated, use 'sources'",
22 FutureWarning,
23 stacklevel=2
24 )
25 if sources:
26 raise ValueError(
27 "Can't use 'sources' and 'source' at the same time"
28 )
29 sources = [source]
30
31 if not sources:
32 sources = [target]
33
34 if source_name is None:
35 source_name = 'Or'.join(sources)
36 dr_str = f'deltaRTo{source_name}'
37 deta_str = f'deltaEtaTo{source_name}'
38 dphi_str = f'deltaPhiTo{source_name}'
39 dpt_str = f'deltaPtTo{source_name}'
40 to_suffix = f'From{source_name}'
41 match_str = f'matchedTo{source_name}'
42 n_match_str = f'numberOfMatchesTo{source_name}'
43 def to(f):
44 return f + to_suffix
45
46 ca = ComponentAccumulator()
47 ca.addEventAlgo(
48 CompFactory.ftag.JetMatcherAlg(
49 f'{source_name}To{target}CopyAlg{name_suffix}',
50 targetJet=target,
51 sourceJets=sources,
52 floatsToCopy={f: to(f) for f in floats_to_copy},
53 intsToCopy={i: to(i) for i in ints_to_copy},
54 dR=dr_str,
55 dEta=deta_str,
56 dPhi=dphi_str,
57 dPt=dpt_str,
58 isMatched=match_str,
59 nMatch=n_match_str,
60 ptPriorityWithDeltaR=pt_priority_with_delta_r,
61 sourceMinimumPt=source_minimum_pt,
62 particleLink=(particle_link_name or ""),
63 )
64 )
65 return ca