ATLAS Offline Software
Loading...
Searching...
No Matches
TileGMConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentFactory import CompFactory
4from AthenaConfiguration.Enums import ProductionStep, BeamType
5from AtlasGeoModel.GeoModelConfig import GeoModelCfg
6
7def TileGMCfg(flags):
8 result=GeoModelCfg(flags)
9
10 tileDetectorTool = CompFactory.TileDetectorTool()
11 if flags.Common.ProductionStep not in [ProductionStep.Simulation, ProductionStep.FastChain]:
12 tileDetectorTool.GeometryConfig = "RECO"
13
14 if flags.Beam.Type is BeamType.TestBeam:
15 if flags.Tile.Sim.Ushape != 'NONE':
16 tileDetectorTool.Ushape = flags.Tile.Sim.Ushape
17 if flags.Tile.Sim.Steel != 'NONE':
18 tileDetectorTool.Steel = flags.Tile.Sim.Steel
19 if flags.Tile.Sim.PVT != 'NONE':
20 tileDetectorTool.PVT = flags.Tile.Sim.PVT
21 if flags.Tile.Sim.CsTube != 'NONE':
22 tileDetectorTool.CsTube = flags.Tile.Sim.CsTube
23
24 result.getPrimary().DetectorTools += [ tileDetectorTool ]
25
26 if flags.Common.ProductionStep in [ProductionStep.Simulation, ProductionStep.Digitization] and flags.Beam.Type is BeamType.TestBeam:
27 if (flags.TestBeam.Layout=='tb_Tile2000_2003_2B2EB'):
28 # 2 Barrels + 2 Extended Barrels
29 result.getPrimary().TileVersionOverride='TileTB-2B2EB-00'
30 elif (flags.TestBeam.Layout=='tb_Tile2000_2003_2B1EB'):
31 # 2 Barrels + 1 Extended Barrel
32 result.getPrimary().TileVersionOverride='TileTB-2B1EB-00'
33 elif (flags.TestBeam.Layout=='tb_Tile2000_2003_3B'):
34 # 3 Barrels
35 result.getPrimary().TileVersionOverride='TileTB-3B-00'
36 elif (flags.TestBeam.Layout=='tb_Tile2000_2003_5B'):
37 # 5 Barrels
38 result.getPrimary().TileVersionOverride='TileTB-5B-00'
39
40
41
42 return result
43
44
45if __name__ == "__main__":
46 from AthenaConfiguration.AllConfigFlags import initConfigFlags
47 from AthenaConfiguration.TestDefaults import defaultGeometryTags, defaultTestFiles
48
49 flags = initConfigFlags()
50 flags.Input.Files = defaultTestFiles.RAW_RUN2
51 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
52 flags.lock()
53
54 acc = TileGMCfg( flags )
55 acc.store( open( "test.pkl", "wb" ) )
56 print("All OK")
void print(char *figname, TCanvas *c1)
TileGMCfg(flags)