11def CopyJetParentInfoCfg(flags, jets=None, parents=None):
12 if jets is None:
13 jets = _default_jets
14 parents = _default_parents
15 elif jets != _default_jets and parents is None:
16 raise ValueError("You must specify the jet parent collection")
17
18 copied_ints = ['jetRank']
19
20 ca = ComponentAccumulator()
21 ca.addEventAlgo(
22 CompFactory.ftag.JetLinkMatcherAlg(
23 f'{parents}To{jets}LinkCopyAlg',
24 targetJet=jets,
25 sourceJets=[parents],
26 linkName='Parent',
27 intsToCopy={x:x for x in copied_ints},
28 )
29 )
30 return ca