ATLAS Offline Software
TileGMConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentFactory import CompFactory
4 from AthenaConfiguration.Enums import ProductionStep, BeamType
5 from AtlasGeoModel.GeoModelConfig import GeoModelCfg
6 
7 def TileGMCfg(flags):
8  result=GeoModelCfg(flags)
9  result.getPrimary().DetectorTools += [ CompFactory.TileDetectorTool() ]
10  if flags.Common.ProductionStep not in [ProductionStep.Simulation, ProductionStep.FastChain]:
11  result.getPrimary().DetectorTools["TileDetectorTool"].GeometryConfig = "RECO"
12  if flags.Common.ProductionStep is ProductionStep.Simulation and flags.Beam.Type is BeamType.TestBeam:
13  if (flags.TestBeam.Layout=='tb_Tile2000_2003_2B2EB'):
14  # 2 Barrels + 2 Extended Barrels
15  result.getPrimary().TileVersionOverride='TileTB-2B2EB-00'
16  elif (flags.TestBeam.Layout=='tb_Tile2000_2003_2B1EB'):
17  # 2 Barrels + 1 Extended Barrel
18  result.getPrimary().TileVersionOverride='TileTB-2B1EB-00'
19  elif (flags.TestBeam.Layout=='tb_Tile2000_2003_3B'):
20  # 3 Barrels
21  result.getPrimary().TileVersionOverride='TileTB-3B-00'
22  elif (flags.TestBeam.Layout=='tb_Tile2000_2003_5B'):
23  # 5 Barrels
24  result.getPrimary().TileVersionOverride='TileTB-5B-00'
25 
26  return result
27 
28 
29 if __name__ == "__main__":
30  from AthenaConfiguration.AllConfigFlags import initConfigFlags
31  from AthenaConfiguration.TestDefaults import defaultGeometryTags, defaultTestFiles
32 
33  flags = initConfigFlags()
34  flags.Input.Files = defaultTestFiles.RAW_RUN2
35  flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
36  flags.lock()
37 
38  acc = TileGMCfg( flags )
39  acc.store( open( "test.pkl", "wb" ) )
40  print("All OK")
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70
python.GeoModelConfig.GeoModelCfg
def GeoModelCfg(flags)
Definition: GeoModelConfig.py:16
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7