ATLAS Offline Software
Loading...
Searching...
No Matches
PileUpMergeSvcConfig.py
Go to the documentation of this file.
1"""ComponentAccumulator configuration for PileUpMergeSvc
2
3Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
4"""
5from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6from AthenaConfiguration.ComponentFactory import CompFactory
7from AthenaConfiguration.Enums import ProductionStep
8
9
10def PileUpMergeSvcCfg(flags, name="PileUpMergeSvc", Intervals=[], **kwargs):
11 """Return ComponentAccumulator with PileUpMergeSvc
12
13 If doing XingByXingPileUp, Intervals should contian PileUpXingFolder tools.
14 Otherwise it should be empty, and we enforce that here.
15 """
16 acc = ComponentAccumulator()
17
18 if not flags.Digitization.DoXingByXingPileUp:
19 # handle input type variety
20 if not isinstance(Intervals, list):
21 Intervals = [Intervals]
22 kwargs["Intervals"] = Intervals
23
24 presampling = flags.Common.ProductionStep == ProductionStep.PileUpPresampling
25 if presampling:
26 kwargs.setdefault(
27 "EventInfoKeyName", flags.Overlay.BkgPrefix + "EventInfo"
28 ) # FIXME Make default?
29 else:
30 kwargs.setdefault("EventInfoKeyName", "EventInfo") # FIXME Make default?
31 acc.addService(CompFactory.PileUpMergeSvc(name, **kwargs), primary=True)
32 return acc
33
34
35def PileUpXingFolderCfg(flags, name="PileUpXingFolder", **kwargs):
36 """Return a configured PileUpXingFolder tool"""
37 acc = ComponentAccumulator()
38 acc.setPrivateTools(CompFactory.PileUpXingFolder(name, **kwargs))
39 return acc
PileUpXingFolderCfg(flags, name="PileUpXingFolder", **kwargs)
PileUpMergeSvcCfg(flags, name="PileUpMergeSvc", Intervals=[], **kwargs)