ATLAS Offline Software
MuonGeoModelConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3 from AthenaConfiguration.ComponentFactory import CompFactory
4 
5 def MuonGeoUtilityToolCfg(flags, name = "MuonGeoUtilityTool", **kwargs):
6  result = ComponentAccumulator()
7  the_tool = CompFactory.MuonGMR4.MuonGeoUtilityTool(name, **kwargs)
8  result.addPublicTool(the_tool, primary = True)
9  return result
10 def MdtReadoutGeomToolCfg(flags, name="MdtReadoutGeomTool", **kwargs):
11  result = ComponentAccumulator()
12  kwargs.setdefault("GeoUtilTool", result.getPrimaryAndMerge(MuonGeoUtilityToolCfg(flags)))
13  the_tool = CompFactory.MuonGMR4.MdtReadoutGeomTool(name, **kwargs)
14  result.setPrivateTools(the_tool)
15  return result
16 
17 def RpcReadoutGeomToolCfg(flags, name="RpcReadoutGeomTool", **kwargs):
18  result = ComponentAccumulator()
19  kwargs.setdefault("GeoUtilTool", result.getPrimaryAndMerge(MuonGeoUtilityToolCfg(flags)))
20  the_tool = CompFactory.MuonGMR4.RpcReadoutGeomTool(name, **kwargs)
21  result.setPrivateTools(the_tool)
22  return result
23 
24 def TgcReadoutGeomToolCfg(flags, name="TgcReadoutGeomTool", **kwargs):
25  result = ComponentAccumulator()
26  kwargs.setdefault("GeoUtilTool", result.getPrimaryAndMerge(MuonGeoUtilityToolCfg(flags)))
27  the_tool = CompFactory.MuonGMR4.TgcReadoutGeomTool(name, **kwargs)
28  result.setPrivateTools(the_tool)
29  return result
30 
31 def sTgcReadoutGeomToolCfg(flags, name="sTgcReadoutGeomTool", **kwargs):
32  result = ComponentAccumulator()
33  kwargs.setdefault("GeoUtilTool", result.getPrimaryAndMerge(MuonGeoUtilityToolCfg(flags)))
34  the_tool = CompFactory.MuonGMR4.sTgcReadoutGeomTool(name, **kwargs)
35  result.setPrivateTools(the_tool)
36  return result
37 
38 def MmReadoutGeomToolCfg(flags, name="MmReadoutGeomTool", **kwargs):
39  result = ComponentAccumulator()
40  kwargs.setdefault("GeoUtilTool", result.getPrimaryAndMerge(MuonGeoUtilityToolCfg(flags)))
41  the_tool = CompFactory.MuonGMR4.MmReadoutGeomTool(name, **kwargs)
42  result.setPrivateTools(the_tool)
43  return result
44 
45 def ChamberAssebmbleToolCfg(flags,name="MuonChamberAssembleTool", **kwargs):
46  result = ComponentAccumulator()
47  kwargs.setdefault("GeoUtilTool", result.getPrimaryAndMerge(MuonGeoUtilityToolCfg(flags)))
48  the_tool = CompFactory.MuonGMR4.ChamberAssembleTool(name, **kwargs)
49  result.setPrivateTools(the_tool)
50  return result
51 def MuonDetectorToolCfg(flags, name="MuonDetectorToolR4", **kwargs):
52  result = ComponentAccumulator()
53  sub_detTools = []
54  if flags.Detector.GeometryMDT:
55  sub_detTools.append(result.popToolsAndMerge(MdtReadoutGeomToolCfg(flags)))
56 
57  if flags.Detector.GeometryRPC:
58  sub_detTools.append(result.popToolsAndMerge(RpcReadoutGeomToolCfg(flags)))
59 
60  if flags.Detector.GeometryTGC:
61  sub_detTools.append(result.popToolsAndMerge(TgcReadoutGeomToolCfg(flags)))
62 
63  if flags.Detector.GeometrysTGC:
64  sub_detTools.append(result.popToolsAndMerge(sTgcReadoutGeomToolCfg(flags)))
65 
66  if flags.Detector.GeometryMM:
67  sub_detTools.append(result.popToolsAndMerge(MmReadoutGeomToolCfg(flags)))
68 
69  from AthenaConfiguration.Enums import ProductionStep
70  if flags.Common.ProductionStep is not ProductionStep.Simulation:
71  sub_detTools.append(result.popToolsAndMerge(ChamberAssebmbleToolCfg(flags)))
72  print("MuonDetectorToolCfg: Adding ChamberAssebmbleTool to MuonDetectorTool")
73  kwargs.setdefault("ReadoutEleBuilders", sub_detTools)
74  print(sub_detTools)
75  the_tool = CompFactory.MuonGMR4.MuonDetectorTool(name = name, **kwargs)
76  result.setPrivateTools(the_tool)
77  return result
78 
79 def MuonGeoModelCfg(flags):
80  result = ComponentAccumulator()
81  from AtlasGeoModel.GeoModelConfig import GeoModelCfg
82  geoModelSvc = result.getPrimaryAndMerge(GeoModelCfg(flags))
83  geoModelSvc.DetectorTools+=[result.popToolsAndMerge(MuonDetectorToolCfg(flags))]
84  print("MuonGeoModelCfg: Adding MuonDetectorTool to GeoModelSvc")
85  return result
86 
87 def MuonAlignStoreCfg(flags):
88  result = ComponentAccumulator()
89  if not flags.Muon.usePhaseIIGeoSetup: return result
90  from MuonCondAlgR4.ConditionsConfig import ActsMuonAlignCondAlgCfg
91  result.merge(ActsMuonAlignCondAlgCfg(flags))
92  from ActsAlignmentAlgs.AlignmentAlgsConfig import ActsAlignStoreProviderAlgCfg
93 
94  from ROOT.ActsTrk import DetectorType
95 
96  if flags.Detector.GeometryMDT:
97  result.merge(ActsAlignStoreProviderAlgCfg(flags,
98  name="ActsDetAlignmentAlgMdt",
99  CondAlignStore="MdtActsAlignContainer" if flags.Muon.enableAlignment else "",
100  EventAlignStore="MdtActsAlignContainer",
101  SplitPhysVolCache = False,
102  SplitActsTrfCache = False,
103  FillAlignCache = False,
104  LoadTrackingGeoSvc = False,
105  DetectorType=DetectorType.Mdt))
106  if flags.Detector.GeometryRPC:
107  result.merge(ActsAlignStoreProviderAlgCfg(flags,
108  name="ActsDetAlignmentAlgRpc",
109  CondAlignStore="RpcActsAlignContainer" if flags.Muon.enableAlignment else "",
110  EventAlignStore="RpcActsAlignContainer",
111  SplitPhysVolCache = False,
112  SplitActsTrfCache = False,
113  FillAlignCache = False,
114  LoadTrackingGeoSvc = False,
115  DetectorType=DetectorType.Rpc))
116  if flags.Detector.GeometryTGC:
117  result.merge(ActsAlignStoreProviderAlgCfg(flags,
118  name="ActsDetAlignmentAlgTgc",
119  CondAlignStore="TgcActsAlignContainer" if flags.Muon.enableAlignment else "",
120  EventAlignStore="TgcActsAlignContainer",
121  SplitPhysVolCache = False,
122  SplitActsTrfCache = False,
123  FillAlignCache = False,
124  LoadTrackingGeoSvc = False,
125  DetectorType=DetectorType.Tgc))
126  if flags.Detector.GeometrysTGC:
127  result.merge(ActsAlignStoreProviderAlgCfg(flags,
128  name="ActsDetAlignmentAlgSTGC",
129  CondAlignStore="sTgcActsAlignContainer" if flags.Muon.enableAlignment else "",
130  EventAlignStore="sTgcActsAlignContainer",
131  SplitPhysVolCache = False,
132  SplitActsTrfCache = False,
133  FillAlignCache = False,
134  LoadTrackingGeoSvc = False,
135  DetectorType=DetectorType.sTgc))
136 
137  if flags.Detector.GeometryMM:
138  result.merge(ActsAlignStoreProviderAlgCfg(flags,
139  name="ActsDetAlignmentAlgMM",
140  CondAlignStore="MmActsAlignContainer" if flags.Muon.enableAlignment or \
141  flags.Muon.applyMMPassivation else "",
142  EventAlignStore="MmActsAlignContainer",
143  SplitPhysVolCache = False,
144  SplitActsTrfCache = False,
145  FillAlignCache = False,
146  LoadTrackingGeoSvc = False,
147  DetectorType=DetectorType.Mm))
148 
149 
150  return result
151 
ConditionsConfig.ActsMuonAlignCondAlgCfg
def ActsMuonAlignCondAlgCfg(flags, name="ActsMuonAlignCondAlg", **kwargs)
Definition: ConditionsConfig.py:5
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
MuonGeoModelConfig.MuonAlignStoreCfg
def MuonAlignStoreCfg(flags)
Definition: MuonGeoModelConfig.py:87
MuonGeoModelConfig.MuonGeoUtilityToolCfg
def MuonGeoUtilityToolCfg(flags, name="MuonGeoUtilityTool", **kwargs)
Definition: MuonGeoModelConfig.py:5
MuonGeoModelConfig.ChamberAssebmbleToolCfg
def ChamberAssebmbleToolCfg(flags, name="MuonChamberAssembleTool", **kwargs)
Definition: MuonGeoModelConfig.py:45
MuonGeoModelConfig.MmReadoutGeomToolCfg
def MmReadoutGeomToolCfg(flags, name="MmReadoutGeomTool", **kwargs)
Definition: MuonGeoModelConfig.py:38
MuonGeoModelConfig.sTgcReadoutGeomToolCfg
def sTgcReadoutGeomToolCfg(flags, name="sTgcReadoutGeomTool", **kwargs)
Definition: MuonGeoModelConfig.py:31
MuonGeoModelConfig.TgcReadoutGeomToolCfg
def TgcReadoutGeomToolCfg(flags, name="TgcReadoutGeomTool", **kwargs)
Definition: MuonGeoModelConfig.py:24
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
MuonGeoModelConfig.MdtReadoutGeomToolCfg
def MdtReadoutGeomToolCfg(flags, name="MdtReadoutGeomTool", **kwargs)
Definition: MuonGeoModelConfig.py:10
AlignmentAlgsConfig.ActsAlignStoreProviderAlgCfg
def ActsAlignStoreProviderAlgCfg(flags, name="AlignStoreProviderAlg", **kwargs)
Definition: AlignmentAlgsConfig.py:7
MuonGeoModelConfig.RpcReadoutGeomToolCfg
def RpcReadoutGeomToolCfg(flags, name="RpcReadoutGeomTool", **kwargs)
Definition: MuonGeoModelConfig.py:17
MuonGeoModelConfig.MuonGeoModelCfg
def MuonGeoModelCfg(flags)
Definition: MuonGeoModelConfig.py:79
MuonGeoModelConfig.MuonDetectorToolCfg
def MuonDetectorToolCfg(flags, name="MuonDetectorToolR4", **kwargs)
Definition: MuonGeoModelConfig.py:51
python.GeoModelConfig.GeoModelCfg
def GeoModelCfg(flags)
Definition: GeoModelConfig.py:16