ATLAS Offline Software
JiveXMLGeometryConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from AthenaConfiguration.AllConfigFlags import initConfigFlags
6 
7 
8 def GeometryWriterCfg(flags, **kwargs):
9  result = ComponentAccumulator()
10  # Add Geometry tool
11  result.addPublicTool(CompFactory.JiveXML.GeometryWriter(name = "GeometryWriter", **kwargs))
12  return result
13 
14 
15 def MuonGeometryWriterCfg(flags, **kwargs):
16  result = ComponentAccumulator()
17  # Add Muon Geometry tool
18  result.addPublicTool(CompFactory.JiveXML.MuonGeometryWriter(name = "MuonGeometryWriter", **kwargs))
19  return result
20 
21 
22 def GeometryJiveXMLCfg(flags):
23  result = ComponentAccumulator()
24  result.merge(GeometryWriterCfg(flags))
25  result.merge(MuonGeometryWriterCfg(flags))
26  return result
27 
28 
29 def AlgoJiveXMLGeometryCfg(flags, **kwargs):
30  result = ComponentAccumulator()
31 
32  kwargs.setdefault("WriteToFile", True)
33  kwargs.setdefault("StreamToServerTool", None)
34  kwargs.setdefault("WriteGeometry", True)
35 
36 
37  result.merge(GeometryJiveXMLCfg(flags))
38 
39  the_alg = CompFactory.JiveXML.AlgoJiveXML(name="AlgoJiveXML", **kwargs)
40  result.addEventAlgo(the_alg, primary=True)
41  return result
42 
43 def main():
44  from AthenaConfiguration.TestDefaults import defaultTestFiles
45  flags = initConfigFlags()
46  flags.Input.Files = defaultTestFiles.RAW_RUN3
47  flags.Exec.MaxEvents = 0
48  flags.GeoModel.AtlasVersion = 'ATLAS-R3S-2021-03-02-00'
49  flags.IOVDb.GlobalTag = 'CONDBR2-BLKPA-2023-02'
50  flags.lock()
51  flags.dump()
52 
53  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
54  result = MainServicesCfg(flags)
55 
56  if flags.Detector.GeometryBpipe:
57  from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
58  result.merge(BeamPipeGeometryCfg(flags))
59 
60  if flags.Detector.GeometryPixel:
61  from PixelGeoModel.PixelGeoModelConfig import PixelReadoutGeometryCfg
62  result.merge(PixelReadoutGeometryCfg(flags))
63 
64  if flags.Detector.GeometrySCT:
65  from SCT_GeoModel.SCT_GeoModelConfig import SCT_ReadoutGeometryCfg
66  result.merge(SCT_ReadoutGeometryCfg(flags))
67 
68  if flags.Detector.GeometryTRT:
69  from TRT_GeoModel.TRT_GeoModelConfig import TRT_ReadoutGeometryCfg
70  result.merge(TRT_ReadoutGeometryCfg(flags))
71 
72  if flags.Detector.GeometryITkPixel:
73  from PixelGeoModelXml.ITkPixelGeoModelConfig import ITkPixelReadoutGeometryCfg
74  result.merge(ITkPixelReadoutGeometryCfg(flags))
75 
76  if flags.Detector.GeometryITkStrip:
77  from StripGeoModelXml.ITkStripGeoModelConfig import ITkStripReadoutGeometryCfg
78  result.merge(ITkStripReadoutGeometryCfg(flags))
79 
80  if flags.Detector.GeometryHGTD:
81  from HGTD_GeoModelXml.HGTD_GeoModelConfig import HGTD_ReadoutGeometryCfg
82  result.merge(HGTD_ReadoutGeometryCfg(flags))
83 
84  if flags.Detector.GeometryLAr:
85  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
86  result.merge(LArGMCfg(flags))
87 
88  if flags.Detector.GeometryTile:
89  from TileGeoModel.TileGMConfig import TileGMCfg
90  result.merge(TileGMCfg(flags))
91 
92  if flags.Detector.GeometryMuon:
93  from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
94  result.merge(MuonGeoModelCfg(flags))
95 
96  geoModel = result.getService("GeoModelSvc")
97  geoModel.DetectorTools["LArDetectorToolNV"].GeometryConfig = "FULL"
98 
99  result.merge(AlgoJiveXMLGeometryCfg(flags))
100 
101  import sys
102  sys.exit(not result.run().isSuccess())
103 
104 if __name__ == "__main__":
105  main()
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
JiveXMLGeometryConfig.MuonGeometryWriterCfg
def MuonGeometryWriterCfg(flags, **kwargs)
Definition: JiveXMLGeometryConfig.py:15
JiveXMLGeometryConfig.GeometryWriterCfg
def GeometryWriterCfg(flags, **kwargs)
Definition: JiveXMLGeometryConfig.py:8
JiveXMLGeometryConfig.AlgoJiveXMLGeometryCfg
def AlgoJiveXMLGeometryCfg(flags, **kwargs)
Definition: JiveXMLGeometryConfig.py:29
BeamPipeGMConfig.BeamPipeGeometryCfg
def BeamPipeGeometryCfg(flags)
Definition: BeamPipeGMConfig.py:5
TRT_GeoModelConfig.TRT_ReadoutGeometryCfg
def TRT_ReadoutGeometryCfg(flags)
Definition: TRT_GeoModelConfig.py:55
JiveXMLGeometryConfig.main
def main()
Definition: JiveXMLGeometryConfig.py:43
JiveXMLGeometryConfig.GeometryJiveXMLCfg
def GeometryJiveXMLCfg(flags)
Definition: JiveXMLGeometryConfig.py:22
SCT_GeoModelConfig.SCT_ReadoutGeometryCfg
def SCT_ReadoutGeometryCfg(flags)
Definition: SCT_GeoModelConfig.py:42
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
HGTD_GeoModelConfig.HGTD_ReadoutGeometryCfg
def HGTD_ReadoutGeometryCfg(flags)
Definition: python/HGTD_GeoModelConfig.py:23
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
PixelGeoModelConfig.PixelReadoutGeometryCfg
def PixelReadoutGeometryCfg(flags)
Definition: PixelGeoModelConfig.py:42
ITkPixelGeoModelConfig.ITkPixelReadoutGeometryCfg
def ITkPixelReadoutGeometryCfg(flags, setGeometryAlignable=False, setAlignmentFolderName="/Indet/Align")
Definition: ITkPixelGeoModelConfig.py:39
python.MuonGeometryConfig.MuonGeoModelCfg
def MuonGeoModelCfg(flags)
Definition: MuonGeometryConfig.py:28
ITkStripGeoModelConfig.ITkStripReadoutGeometryCfg
def ITkStripReadoutGeometryCfg(flags, setGeometryAlignable=False, setAlignmentFolderName="/Indet/Align")
Definition: ITkStripGeoModelConfig.py:39
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7