11 name_suffix=''):
12
13 if source is None:
14 source = target
15
16 dr_str = f'deltaRTo{source}'
17 deta_str = f'deltaEtaTo{source}'
18 dphi_str = f'deltaPhiTo{source}'
19 dpt_str = f'deltaPtTo{source}'
20 to_suffix = f'From{source}'
21 match_str = f'matchedTo{source}'
22 def to(f):
23 return f + to_suffix
24
25 ca = ComponentAccumulator()
26 ca.addEventAlgo(
27 CompFactory.ftag.JetMatcherAlg(
28 f'{source}To{target}CopyAlg{name_suffix}',
29 targetJet=target,
30 sourceJets=[source],
31 floatsToCopy={f: to(f) for f in floats_to_copy},
32 intsToCopy={i: to(i) for i in ints_to_copy},
33 dR=dr_str,
34 dEta=deta_str,
35 dPhi=dphi_str,
36 dPt=dpt_str,
37 match=match_str,
38 ptPriorityWithDeltaR=pt_priority_with_delta_r,
39 sourceMinimumPt=source_minimum_pt,
40 particleLink=(particle_link_name or ""),
41 )
42 )
43 return ca