ATLAS Offline Software
Loading...
Searching...
No Matches
BunchGroupCondAlgConfig.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/BunchGroupCondAlgConfig.py
4# Created: May 2019, sss
5# Purpose: Configure BunchGroupCondAlg.
6#
7
8
9from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
10from AthenaConfiguration.ComponentFactory import CompFactory
11from IOVDbSvc.IOVDbSvcConfig import addFolders
12
13
15 name = 'BunchGroupCondAlg'
16 result = ComponentAccumulator()
17
18 folder = ''
19 if flags.IOVDb.DatabaseInstance == 'COMP200':
20 folder = '/TRIGGER/LVL1/BunchGroupContent'
21
22 # Mistakenly created as multi-version folder, must specify HEAD
23 result.merge (addFolders (flags, folder, 'TRIGGER', tag='HEAD',
24 className='AthenaAttributeList'))
25
26 BunchGroupCondAlg=CompFactory.BunchGroupCondAlg
27 alg = BunchGroupCondAlg (name,
28 BunchGroupFolderInputKey = folder,
29 BunchGroupOutputKey = 'BunchGroupCondData')
30
31 result.addCondAlgo (alg)
32 return result
33
34
35if __name__ == "__main__":
36 from AthenaConfiguration.AllConfigFlags import initConfigFlags
37 from AthenaConfiguration.TestDefaults import defaultTestFiles
38 flags = initConfigFlags()
39 flags.Input.Files = defaultTestFiles.RAW_RUN2
40 flags.lock()
41
42 print ('--- data')
43 flags1 = flags.clone()
44 flags1.Input.Files = defaultTestFiles.RAW_RUN2
45 flags1.Input.ProjectName = 'data12_8TeV'
46 flags1.lock()
47 acc1 = BunchGroupCondAlgCfg (flags1)
48 acc1.printCondAlgs(summariseProps=True)
49 print ('IOVDbSvc:', acc1.getService('IOVDbSvc').Folders)
50 acc1.wasMerged()
51
52 print ('--- default')
53 flags2 = flags.clone()
54 flags2.Input.Files = defaultTestFiles.RAW_RUN2
55 flags2.lock()
56 acc2 = BunchGroupCondAlgCfg (flags2)
57 acc2.printCondAlgs(summariseProps=True)
58 print ('IOVDbSvc:', acc2.getServices())
59 acc2.wasMerged()