ATLAS Offline Software
CaloBCIDLumiCondAlgConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 # File: CaloRec/python/CaloBCIDLumiCondAlgConfig.py
4 # Created: Mar 2020, sss
5 # Purpose: Configure CaloBCIDLumiCondAlg.
6 
7 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
8 from AthenaConfiguration.ComponentFactory import CompFactory
9 
10 
12  result = ComponentAccumulator()
13 
14  from CaloRec.CaloBCIDCoeffsCondAlgConfig import CaloBCIDCoeffsCondAlgCfg
15  result.merge (CaloBCIDCoeffsCondAlgCfg (flags))
16 
17  if flags.Input.isMC is False:
18  from LumiBlockComps.LuminosityCondAlgConfig import LuminosityCondAlgCfg
19  result.merge (LuminosityCondAlgCfg (flags))
20 
21  else:
22  from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
23  result.merge (BunchCrossingCondAlgCfg(flags))
24 
25 
26  CaloBCIDLumiCondAlg = CompFactory.CaloBCIDLumiCondAlg # CaloRec
27  alg = CaloBCIDLumiCondAlg ('CaloBCIDLumiCondAlg',
28  CoeffsKey = 'CaloBCIDCoeffs',
29  BunchCrossingCondDataKey = 'BunchCrossingData',
30  LuminosityCondDataKey = 'LuminosityCondData',
31  isMC = flags.Input.isMC,
32  OutputLumiKey = 'CaloBCIDLumi')
33  result.addCondAlgo (alg)
34 
35  return result
36 
37 
38 if __name__ == "__main__":
39  from AthenaConfiguration.AllConfigFlags import initConfigFlags
40  from AthenaConfiguration.TestDefaults import defaultGeometryTags, defaultTestFiles
41 
42  only = ['CaloBCIDCoeffsCondAlg',
43  'CaloBCIDLumiCondAlg',
44  'LuminosityCondAlg',
45  'BunchCrossingCondAlg']
46 
47  print ('--- data')
48  flags1 = initConfigFlags()
49  flags1.Input.Files = defaultTestFiles.RAW_RUN2
50  flags1.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
51  flags1.lock()
52  acc1 = CaloBCIDLumiCondAlgCfg (flags1)
53  acc1.printConfig(summariseProps=True, onlyComponents=only)
54  print ('IOVDbSvc:', acc1.getService('IOVDbSvc').Folders)
55  acc1.wasMerged()
56 
57  print ('--- mc')
58  flags2 = initConfigFlags()
59  flags2.Input.Files = defaultTestFiles.ESD
60  flags2.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
61  flags2.lock()
62  acc2 = CaloBCIDLumiCondAlgCfg (flags2)
63  acc2.printConfig(summariseProps=True, onlyComponents=only)
64  print ('IOVDbSvc:', acc2.getService('IOVDbSvc').Folders)
65  acc2.wasMerged()
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.CaloBCIDLumiCondAlgConfig.CaloBCIDLumiCondAlgCfg
def CaloBCIDLumiCondAlgCfg(flags)
Definition: CaloBCIDLumiCondAlgConfig.py:11
python.BunchCrossingCondAlgConfig.BunchCrossingCondAlgCfg
def BunchCrossingCondAlgCfg(flags)
Definition: BunchCrossingCondAlgConfig.py:8
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19