14def PileUpToolsCfg(flags, **kwargs):
15 """
16 Return ComponentAccumulator with the correct algorithm to carry Digitization PileUpTools
17
18 Keyword argument "PileUpTools" may be an AlgTool or list of AlgTools.
19 """
20 acc = ComponentAccumulator()
21
22
23 PileUpTools = kwargs.setdefault("PileUpTools", [])
24 if not isinstance(PileUpTools, list):
25 kwargs["PileUpTools"] = [PileUpTools]
26
27
28 kwargs["ExtraInputs"] = flags.Digitization.ExtraInputs
29
30
31 if flags.Concurrency.NumThreads > 0 and flags.Digitization.PileUp:
32 Alg = PileUpMTAlg
33 else:
34 if flags.Digitization.DoXingByXingPileUp:
35 Alg = PileUpToolsAlg
36 else:
37 Alg = DigitizationAlg
38
39
40 if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
41 kwargs["EventInfoKey"] = flags.Overlay.BkgPrefix + "EventInfo"
42
43 acc.addEventAlgo(Alg(flags.Digitization.DigiSteeringConf, **kwargs))
44 return acc