ATLAS Offline Software
BunchLumisCondAlgConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 #
3 # File: CoolLumiUtilities/python/BunchLumisCondAlgConfig.py
4 # Created: May 2019, sss
5 # Purpose: Configure BunchLumisCondAlg.
6 #
7 
8 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
9 from AthenaConfiguration.ComponentFactory import CompFactory
10 from AthenaConfiguration.Enums import ProductionStep
11 from IOVDbSvc.IOVDbSvcConfig import addFolders
12 
13 
15  name = 'BunchLumisCondAlg'
16  result = ComponentAccumulator()
17 
18  # Should only be used for Run 1.
19  if flags.IOVDb.DatabaseInstance != 'COMP200':
20  return result
21 
22  folder = '/TDAQ/OLC/BUNCHLUMIS'
23  if flags.Common.isOverlay:
24  # Load reduced channel list for overlay jobs to try to reduce COOL access
25  # Need Lucid AND, OR, HitOR, BcmH OR, BcmV OR
26  folder = '<channelSelection>101,102,103,201,211</channelSelection> ' + folder
27 
28  result.merge (addFolders (flags, folder, 'TDAQ',
29  className='CondAttrListCollection'))
30 
31  from CoolLumiUtilities.FillParamsCondAlgConfig import FillParamsCondAlgCfg
32  result.merge (FillParamsCondAlgCfg(flags))
33  fpalg = result.getCondAlgo ('FillParamsCondAlg')
34 
35  BunchLumisCondAlg=CompFactory.BunchLumisCondAlg
36  alg = BunchLumisCondAlg (name,
37  BunchLumisFolderInputKey = folder,
38  FillParamsInputKey = fpalg.FillParamsOutputKey,
39  BunchLumisOutputKey = 'BunchLumisCondData')
40 
41  result.addCondAlgo (alg)
42  return result
43 
44 
45 if __name__ == "__main__":
46  from AthenaConfiguration.AllConfigFlags import initConfigFlags
47  from AthenaConfiguration.TestDefaults import defaultTestFiles
48 
49  print ('--- data')
50  flags1 = initConfigFlags()
51  flags1.Input.Files = defaultTestFiles.RAW_RUN2
52  flags1.Input.ProjectName = 'data12_8TeV'
53  flags1.lock()
54  acc1 = BunchLumisCondAlgCfg (flags1)
55  acc1.printCondAlgs(summariseProps=True)
56  print ('IOVDbSvc:', acc1.getService('IOVDbSvc').Folders)
57  acc1.wasMerged()
58 
59  print ('--- data+overlay')
60  flags2 = initConfigFlags()
61  flags2.Input.Files = defaultTestFiles.RAW_RUN2
62  flags2.Input.ProjectName = 'data12_8TeV'
63  flags2.Common.ProductionStep = ProductionStep.Overlay
64  flags2.lock()
65  acc2 = BunchLumisCondAlgCfg (flags2)
66  acc2.printCondAlgs(summariseProps=True)
67  print ('IOVDbSvc:', acc2.getService('IOVDbSvc').Folders)
68  acc2.wasMerged()
69 
70  print ('--- default')
71  flags3 = initConfigFlags()
72  flags3.Input.Files = defaultTestFiles.RAW_RUN2
73  flags3.lock()
74  acc3 = BunchLumisCondAlgCfg (flags3)
75  acc3.printCondAlgs(summariseProps=True)
76  print ('IOVDbSvc:', acc3.getServices())
77  acc3.wasMerged()
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.FillParamsCondAlgConfig.FillParamsCondAlgCfg
def FillParamsCondAlgCfg(flags)
Definition: FillParamsCondAlgConfig.py:12
python.BunchLumisCondAlgConfig.BunchLumisCondAlgCfg
def BunchLumisCondAlgCfg(flags)
Definition: BunchLumisCondAlgConfig.py:14
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19