ATLAS Offline Software
Loading...
Searching...
No Matches
RunDependentConfig.py
Go to the documentation of this file.
1"""ComponentAccumulator run dependent service configuration
2
3Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
4"""
5from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6from AthenaConfiguration.ComponentFactory import CompFactory
7
8# Auxiliary
9def maxNevtsPerXing(flags):
10 """Return the largest minbias pileup value, for PileUpEvtLoopMgr caches"""
11 # migrated from DigitizationConfig.lags.py
12 pDicts = flags.Input.RunAndLumiOverrideList
13 return max(element["mu"] for element in pDicts)
14
15
17 # migrated from DigitizationConfig.lags.py
18 runLumiList = []
19 scaleFactorList = []
20 pDicts = flags.Input.RunAndLumiOverrideList
21 MaxCollisionsPerXing = maxNevtsPerXing(flags)
22 for element in pDicts:
23 run = element["run"]
24 lbk = element["lb"]
25 mu = element["mu"]
26 iovt = (run << 32) + lbk
27 runLumiList += [iovt]
28 if MaxCollisionsPerXing > 0:
29 scaleFactorList += [mu/MaxCollisionsPerXing]
30 else:
31 scaleFactorList += [1.0]
32 return runLumiList, scaleFactorList
33
34
35# Config
36def LumiProfileSvcCfg(flags, name="LumiProfileSvc", **kwargs):
37 acc = ComponentAccumulator()
38 runLumiList, scaleFactorList = runLumiListAndScaleFactorLists(flags)
39 #clear svc properties?
40 kwargs.setdefault("RunLumiList", runLumiList)
41 kwargs.setdefault("ScaleFactorList", scaleFactorList)
42 acc.addService(CompFactory.LumiProfileSvc(name, **kwargs), primary=True)
43 return acc
44
45
46def NoProfileSvcCfg(flags, name="NoProfileSvc", **kwargs):
47 acc = ComponentAccumulator()
48 acc.addService(CompFactory.NoProfileSvc(name, **kwargs), primary=True)
49 return acc
#define max(a, b)
Definition cfImp.cxx:41
LumiProfileSvcCfg(flags, name="LumiProfileSvc", **kwargs)
NoProfileSvcCfg(flags, name="NoProfileSvc", **kwargs)