ATLAS Offline Software
OnlineLumiCalibrationCondAlgConfig.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/OnlineLumiCalibrationCondAlgConfig.py
4 # Created: May 2019, sss
5 # Purpose: Configure OnlineLumiCalibrationCondAlg.
6 #
7 
8 from AthenaConfiguration.ComponentFactory import CompFactory
9 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
10 from IOVDbSvc.IOVDbSvcConfig import addFolders
11 
12 
14  name = 'OnlineLumiCalibrationCondAlg'
15  result = ComponentAccumulator()
16 
17  if flags.Input.isMC:
18  return result
19 
20  # For both runs 1 and 2
21  folder = '/TDAQ/OLC/CALIBRATIONS'
22  result.merge (addFolders (flags, folder, 'TDAQ',
23  className='CondAttrListCollection'))
24 
25  OnlineLumiCalibrationCondAlg=CompFactory.OnlineLumiCalibrationCondAlg
26  alg = OnlineLumiCalibrationCondAlg (name,
27  CalibrationFolderInputKey = folder,
28  LumiCalibOutputKey = 'OnlineLumiCalibrationCondData')
29 
30  result.addCondAlgo (alg)
31  return result
32 
33 
34 if __name__ == "__main__":
35  from AthenaConfiguration.AllConfigFlags import initConfigFlags
36  from AthenaConfiguration.TestDefaults import defaultTestFiles
37 
38  print ('--- data')
39  flags1 = initConfigFlags()
40  flags1.Input.Files = defaultTestFiles.RAW_RUN2
41  flags1.lock()
42  acc1 = OnlineLumiCalibrationCondAlgCfg (flags1)
43  acc1.printCondAlgs(summariseProps=True)
44  print ('IOVDbSvc:', acc1.getService('IOVDbSvc').Folders)
45  acc1.wasMerged()
46 
47  print ('--- mc')
48  flags2 = initConfigFlags()
49  flags2.Input.Files = defaultTestFiles.ESD
50  flags2.lock()
51  acc2 = OnlineLumiCalibrationCondAlgCfg (flags2)
52  acc2.printCondAlgs(summariseProps=True)
53  print ('IOVDbSvc:', acc2.getServices())
54  acc2.wasMerged()
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.OnlineLumiCalibrationCondAlgConfig.OnlineLumiCalibrationCondAlgCfg
def OnlineLumiCalibrationCondAlgCfg(flags)
Definition: OnlineLumiCalibrationCondAlgConfig.py:13
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19