ATLAS Offline Software
RunDependentConfig.py
Go to the documentation of this file.
1 """ComponentAccumulator run dependent service configuration
2 
3 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
4 """
5 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory import CompFactory
7 
8 # Auxiliary
9 def 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
36 def 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 
46 def NoProfileSvcCfg(flags, name="NoProfileSvc", **kwargs):
47  acc = ComponentAccumulator()
48  acc.addService(CompFactory.NoProfileSvc(name, **kwargs), primary=True)
49  return acc
max
#define max(a, b)
Definition: cfImp.cxx:41
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.RunDependentConfig.runLumiListAndScaleFactorLists
def runLumiListAndScaleFactorLists(flags)
Definition: RunDependentConfig.py:16
python.RunDependentConfig.maxNevtsPerXing
def maxNevtsPerXing(flags)
Definition: RunDependentConfig.py:9
python.RunDependentConfig.NoProfileSvcCfg
def NoProfileSvcCfg(flags, name="NoProfileSvc", **kwargs)
Definition: RunDependentConfig.py:46
python.RunDependentConfig.LumiProfileSvcCfg
def LumiProfileSvcCfg(flags, name="LumiProfileSvc", **kwargs)
Definition: RunDependentConfig.py:36