ATLAS Offline Software
TrigLiveFractionCondAlgConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 #
3 # File: LumiBlockComps/python/TrigLiveFractionCondAlgConfig.py
4 # Created: Jun 2019, sss, from existing TrigLivefractionToolDefault.
5 # Purpose: Configure TrigLiveFractionCondAlg.
6 #
7 
8 from AthenaConfiguration.ComponentFactory import CompFactory
9 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
10 from IOVDbSvc.IOVDbSvcConfig import addFolders
11 
12 
13 # Configuration for TrigLiveFractionCondAlg
15  name = 'TrigLiveFractionCondAlg'
16  result = ComponentAccumulator()
17 
18  kwargs = {}
19  if flags.IOVDb.DatabaseInstance == 'COMP200':
20  folder = '/TRIGGER/LUMI/PerBcidDeadtime'
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  kwargs['DeadtimeFolderInputKey'] = folder
27  kwargs['LuminosityInputKey'] = 'LuminosityCondData'
28 
29  from LumiBlockComps.LuminosityCondAlgConfig import LuminosityCondAlgCfg
30  result.merge (LuminosityCondAlgCfg (flags))
31 
32  else:
33  kwargs['DeadtimeFolderInputKey'] = ''
34  kwargs['LuminosityInputKey'] = ''
35 
36 
37  TrigLiveFractionCondAlg=CompFactory.TrigLiveFractionCondAlg
38  alg = TrigLiveFractionCondAlg (name,
39  TrigLiveFractionOutputKey = 'TrigLiveFractionCondData',
40  **kwargs)
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 ('--- run2')
50  flags1 = initConfigFlags()
51  flags1.Input.Files = defaultTestFiles.RAW_RUN2
52  flags1.lock()
53  acc1 = TrigLiveFractionCondAlgCfg (flags1)
54  acc1.printCondAlgs(summariseProps=True)
55  acc1.wasMerged()
56 
57  print ('--- run1')
58  flags3 = initConfigFlags()
59  flags3.Input.Files = defaultTestFiles.RAW_RUN2
60  flags3.Input.ProjectName = 'data12_8TeV'
61  flags3.lock()
62  acc3 = TrigLiveFractionCondAlgCfg (flags3)
63  acc3.printCondAlgs(summariseProps=True)
64  print ('IOVDbSvc:', acc3.getService('IOVDbSvc').Folders)
65  acc3.wasMerged()
66 
67  print ('--- mc')
68  flags4 = initConfigFlags()
69  flags4.Input.Files = defaultTestFiles.ESD
70  flags4.lock()
71  acc4 = TrigLiveFractionCondAlgCfg (flags4)
72  acc4.printCondAlgs(summariseProps=True)
73  acc4.wasMerged()
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.TrigLiveFractionCondAlgConfig.TrigLiveFractionCondAlgCfg
def TrigLiveFractionCondAlgCfg(flags)
Definition: TrigLiveFractionCondAlgConfig.py:14
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19