2 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
3 from AthenaConfiguration.ComponentFactory
import CompFactory
4 from AthenaConfiguration.Enums
import BeamType, LHCPeriod
5 from AthenaConfiguration.AccumulatorCache
import AccumulatorCache
7 from AthenaCommon
import Logging
9 from SimulationConfig.SimEnums
import BeamPipeSimMode, CalibrationRun, CavernBackground, LArParameterization
12 from G4AtlasTools.G4PhysicsRegionConfig
import SX1PhysicsRegionToolCfg, BedrockPhysicsRegionToolCfg, CavernShaftsConcretePhysicsRegionToolCfg, PixelPhysicsRegionToolCfg, SCTPhysicsRegionToolCfg, TRTPhysicsRegionToolCfg, TRT_ArPhysicsRegionToolCfg,ITkPixelPhysicsRegionToolCfg,ITkStripPhysicsRegionToolCfg,HGTDPhysicsRegionToolCfg,BeampipeFwdCutPhysicsRegionToolCfg, FWDBeamLinePhysicsRegionToolCfg, CALOPhysicsRegionToolCfg, EMBPhysicsRegionToolCfg, EMECPhysicsRegionToolCfg, HECPhysicsRegionToolCfg, FCALPhysicsRegionToolCfg, FCAL2ParaPhysicsRegionToolCfg, EMECParaPhysicsRegionToolCfg, FCALParaPhysicsRegionToolCfg, PreSampLArPhysicsRegionToolCfg, DeadMaterialPhysicsRegionToolCfg
13 from G4AtlasTools.G4PhysicsRegionConfig
import DriftWallPhysicsRegionToolCfg, DriftWall1PhysicsRegionToolCfg, DriftWall2PhysicsRegionToolCfg, MuonSystemFastPhysicsRegionToolCfg
16 from G4AtlasTools.G4FieldConfig
import ATLASFieldManagerToolCfg, TightMuonsATLASFieldManagerToolCfg, BeamPipeFieldManagerToolCfg, InDetFieldManagerToolCfg, ITkFieldManagerToolCfg, MuonsOnlyInCaloFieldManagerToolCfg, MuonFieldManagerToolCfg, Q1FwdFieldManagerToolCfg, Q2FwdFieldManagerToolCfg, Q3FwdFieldManagerToolCfg, D1FwdFieldManagerToolCfg, D2FwdFieldManagerToolCfg, Q4FwdFieldManagerToolCfg, Q5FwdFieldManagerToolCfg, Q6FwdFieldManagerToolCfg, Q7FwdFieldManagerToolCfg, Q1HKickFwdFieldManagerToolCfg, Q1VKickFwdFieldManagerToolCfg, Q2HKickFwdFieldManagerToolCfg, Q2VKickFwdFieldManagerToolCfg, Q3HKickFwdFieldManagerToolCfg, Q3VKickFwdFieldManagerToolCfg, Q4VKickAFwdFieldManagerToolCfg, Q4HKickFwdFieldManagerToolCfg, Q4VKickBFwdFieldManagerToolCfg, Q5HKickFwdFieldManagerToolCfg, Q6VKickFwdFieldManagerToolCfg, FwdRegionFieldManagerToolCfg
18 from G4AtlasTools.G4AtlasToolsConfig
import SensitiveDetectorMasterToolCfg, G4CaloTransportToolCfg
20 CylindricalEnvelope, PolyconicalEnvelope, MaterialDescriptionTool,VoxelDensityTool,G4AtlasDetectorConstructionTool,BoxEnvelope=CompFactory.getComps(
"CylindricalEnvelope",
"PolyconicalEnvelope",
"MaterialDescriptionTool",
"VoxelDensityTool",
"G4AtlasDetectorConstructionTool",
"BoxEnvelope")
30 kwargs.setdefault(
"ActivateLVNotifier",
True)
31 kwargs.setdefault(
"ActivatePVNotifier",
False)
32 result.addService(CompFactory.G4GeometryNotifierSvc(name, **kwargs), primary =
True)
38 from Geo2G4.Geo2G4Config
import Geo2G4SvcCfg
39 kwargs.setdefault(
"Geo2G4Svc", result.getPrimaryAndMerge(
Geo2G4SvcCfg(flags)).name)
42 result.setPrivateTools(CompFactory.GeoDetectorTool(name, **kwargs))
48 from BeamPipeGeoModel.BeamPipeGMConfig
import BeamPipeGeometryCfg
50 kwargs.setdefault(
"DetectorName",
"BeamPipe")
51 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
57 from PixelGeoModel.PixelGeoModelConfig
import PixelSimulationGeometryCfg
59 kwargs.setdefault(
"DetectorName",
"Pixel")
60 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
66 from SCT_GeoModel.SCT_GeoModelConfig
import SCT_SimulationGeometryCfg
68 kwargs.setdefault(
"DetectorName",
"SCT")
69 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
75 from PLRGeoModelXml.PLR_GeoModelConfig
import PLR_GeometryCfg
77 kwargs.setdefault(
"DetectorName",
"PLR")
78 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
84 from BCMPrimeGeoModelXml.BCMPrimeGeoModelConfig
import BCMPrimeGeometryCfg
86 kwargs.setdefault(
"DetectorName",
"BCMPrime")
87 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
93 from PixelGeoModelXml.ITkPixelGeoModelConfig
import ITkPixelSimulationGeometryCfg
95 kwargs.setdefault(
"DetectorName",
"ITkPixel")
96 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
102 from StripGeoModelXml.ITkStripGeoModelConfig
import ITkStripSimulationGeometryCfg
104 kwargs.setdefault(
"DetectorName",
"ITkStrip")
105 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
111 if flags.HGTD.Geometry.useGeoModelXml:
112 from HGTD_GeoModelXml.HGTD_GeoModelConfig
import HGTD_SimulationGeometryCfg
114 from HGTD_GeoModel.HGTD_GeoModelConfig
import HGTD_SimulationGeometryCfg
117 kwargs.setdefault(
"DetectorName",
"HGTD")
118 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
124 from HGTD_GeoModelXml.HGTDServiceGeoModelConfig
import HGTDServiceGeoModelCfg
126 kwargs.setdefault(
"DetectorName",
"HGTDServices")
127 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
133 from TRT_GeoModel.TRT_GeoModelConfig
import TRT_SimulationGeometryCfg
135 kwargs.setdefault(
"DetectorName",
"TRT")
136 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
142 from InDetServMatGeoModel.InDetServMatGeoModelConfig
import InDetServiceMaterialCfg
144 kwargs.setdefault(
"DetectorName",
"InDetServMat")
145 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
151 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
153 kwargs.setdefault(
"DetectorName",
"LArMgr")
154 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
160 from TileGeoModel.TileGMConfig
import TileGMCfg
162 kwargs.setdefault(
"DetectorName",
"Tile")
163 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
169 from AtlasGeoModel.ForDetGeoModelConfig
import ForDetGeometryCfg
171 kwargs.setdefault(
"DetectorName",
"LUCID")
172 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
178 from AtlasGeoModel.ForDetGeoModelConfig
import ForDetGeometryCfg
180 kwargs.setdefault(
"DetectorName",
"ALFA")
181 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
187 from AtlasGeoModel.ForDetGeoModelConfig
import ForDetGeometryCfg
189 kwargs.setdefault(
"DetectorName",
"ZDC")
190 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
196 from AtlasGeoModel.ForDetGeoModelConfig
import ForDetGeometryCfg
198 kwargs.setdefault(
"DetectorName",
"AFP")
199 kwargs.setdefault(
"GeoDetectorName",
"AFP_GeoModel")
200 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
206 from AtlasGeoModel.ForDetGeoModelConfig
import ForDetGeometryCfg
208 kwargs.setdefault(
"DetectorName",
"FwdRegion")
209 kwargs.setdefault(
"GeoDetectorName",
"ForwardRegionGeoModel")
210 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
217 if not flags.Muon.usePhaseIIGeoSetup:
218 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
220 kwargs.setdefault(
"DetectorName",
"Muon")
222 kwargs.setdefault(
"DetectorName",
"MuonR4")
223 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
230 kwargs.setdefault(
"DetectorName",
"ITK")
231 kwargs.setdefault(
"InnerRadius", 28.8*mm)
232 kwargs.setdefault(
"OuterRadius", 1.148*m)
233 if flags.GeoModel.Run >= LHCPeriod.Run4:
235 kwargs.setdefault(
"dZ", 354.5*cm)
237 kwargs.setdefault(
"dZ", 347.5*cm)
240 if flags.Detector.GeometryITkPixel:
242 SubDetectorList += [toolITkPixel]
243 if flags.Detector.GeometryITkStrip:
245 SubDetectorList += [toolITkStrip]
246 if flags.Detector.GeometryPLR:
248 SubDetectorList += [toolPLR]
249 if flags.Detector.GeometryBCMPrime:
251 SubDetectorList += [toolBCMPrime]
253 if flags.Detector.GeometryHGTD:
255 SubDetectorList += [toolHGTD]
257 kwargs.setdefault(
"SubDetectors", SubDetectorList)
264 kwargs.setdefault(
"DetectorName",
"IDET")
266 if flags.GeoModel.Run
in [LHCPeriod.Run2, LHCPeriod.Run3]:
267 innerRadius = 28.9*mm
268 kwargs.setdefault(
"InnerRadius", innerRadius)
269 kwargs.setdefault(
"OuterRadius", 1.148*m)
270 kwargs.setdefault(
"dZ", 347.5*cm)
273 if flags.Detector.GeometryPixel:
275 SubDetectorList += [toolPixel]
276 if flags.Detector.GeometrySCT:
278 SubDetectorList += [toolSCT]
279 if flags.Detector.GeometryTRT:
281 SubDetectorList += [toolTRT]
284 SubDetectorList += [toolIDetServices]
285 kwargs.setdefault(
"SubDetectors", SubDetectorList)
293 kwargs.setdefault(
"DetectorName",
"CALO")
294 if flags.GeoModel.Run >= LHCPeriod.Run4:
296 kwargs.setdefault(
"NSurfaces", 22)
297 kwargs.setdefault(
"InnerRadii", [41.,41.,41.,41.,41.,41.,64.,64.,120.,120.,1148.,1148.,120.,120.,64.,64.,41.,41.,41.,41.,41.,41.])
298 kwargs.setdefault(
"OuterRadii", [415.,415.,3795.,3795.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,3795.,3795.,415.,415.])
299 kwargs.setdefault(
"ZSurfaces", [-6781.,-6747.,-6747.,-6530.,-6530.,-4587.,-4587.,-4472.,-4472.,-3545.,-3545.,3545.,3545.,4472.,4472.,4587.,4587.,6530.,6530.,6747.,6747.,6781.])
301 kwargs.setdefault(
"NSurfaces", 18)
302 kwargs.setdefault(
"InnerRadii", [41.,41.,41.,41.,41.,41.,120.,120.,1148.,1148.,120.,120.,41.,41.,41.,41.,41.,41.])
303 kwargs.setdefault(
"OuterRadii", [415.,415.,3795.,3795.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,4251.,3795.,3795.,415.,415.])
304 kwargs.setdefault(
"ZSurfaces", [-6781.,-6747.,-6747.,-6530.,-6530.,-4587.,-4587.,-3475.,-3475.,3475.,3475.,4587.,4587.,6530.,6530.,6747.,6747.,6781.])
306 if flags.Detector.GeometryLAr:
308 SubDetectorList += [ toolLArMgr ]
309 if flags.Detector.GeometryTile:
311 SubDetectorList += [ toolTile ]
312 kwargs.setdefault(
"SubDetectors", SubDetectorList)
320 kwargs.setdefault(
"DetectorName",
"ForDetEnvelope")
323 if flags.Detector.GeometryFwdRegion:
325 SubDetectorList += [ toolFwdRegion ]
330 if flags.Detector.GeometryZDC:
332 SubDetectorList += [ toolZDC ]
333 if flags.Detector.GeometryALFA:
335 SubDetectorList += [ toolALFA ]
336 if flags.Detector.GeometryAFP:
338 SubDetectorList += [ toolAFP ]
339 kwargs.setdefault(
"SubDetectors", SubDetectorList)
341 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
348 kwargs.setdefault(
"DetectorName",
"MUONQ02")
349 kwargs.setdefault(
"NSurfaces", 34)
350 kwargs.setdefault(
"InnerRadii", [1050.,1050.,1050.,1050.,436.7,436.7,279.,279.,70.,70.,420.,420.,3800.,3800.,4255.,4255.,4255.,4255.,4255.,4255.,3800.,3800.,420.,420.,70.,70.,279.,279.,436.7,436.7,1050.,1050.,1050.,1050.])
351 kwargs.setdefault(
"OuterRadii", [1500.,1500.,2750.,2750.,12650.,12650.,13400.,13400.,14200.,14200.,14200.,14200.,14200.,14200.,14200.,14200.,13000.,13000.,14200.,14200.,14200.,14200.,14200.,14200.,14200.,14200.,13400.,13400.,12650.,12650.,2750.,2750.,1500.,1500.])
352 kwargs.setdefault(
"ZSurfaces", [-26046.,-23001.,-23001.,-22030.,-22030.,-18650.,-18650.,-12900.,-12900.,-6783.,-6783.,-6748.,-6748.,-6550.,-6550.,-4000.,-4000.,4000.,4000.,6550.,6550.,6748.,6748.,6783.,6783.,12900.,12900.,18650.,18650.,22030.,22030.,23001.,23001.,26046.])
354 if flags.Detector.GeometryMuon:
356 SubDetectorList += [ toolMuon ]
358 kwargs.setdefault(
"SubDetectors", SubDetectorList)
364 kwargs.setdefault(
"DetectorName",
"TTR_BARREL")
365 kwargs.setdefault(
"NSurfaces", 14)
366 kwargs.setdefault(
"InnerRadii", [70.,70.,12500.,12500.,12500.,12500.,13000.,13000.,12500.,12500.,12500.,12500.,70.,70.])
367 kwargs.setdefault(
"OuterRadii", [12501.,12501.,12501.,12501.,13001.,13001.,13001.,13001.,13001.,13001.,12501.,12501.,12501.,12501.])
368 kwargs.setdefault(
"ZSurfaces", [-22031.,-22030.,-22030.,-12901.,-12901.,-12900.,-12900., 12900.,12900.,12901.,12901.,22030.,22030.,22031.])
370 kwargs.setdefault(
"SubDetectors", SubDetectorList)
378 if flags.Beam.Type
is BeamType.Cosmics
or flags.Sim.CavernBackground
not in [CavernBackground.Off, CavernBackground.Signal]:
379 if flags.Beam.Type
is BeamType.Cosmics
and hasattr(flags,
"Sim.ReadTR"):
382 if flags.Detector.GeometryMuon:
384 toolMuon = accMuon.popPrivateTools()
385 SubDetectorList += [ toolMuon ]
386 if flags.Detector.GeometryID:
388 SubDetectorList += [ toolIDET ]
389 if flags.Detector.GeometryITk
or flags.Detector.GeometryHGTD:
391 SubDetectorList += [ toolITK ]
392 if flags.Detector.GeometryCalo:
394 SubDetectorList += [ toolCALO ]
395 if flags.Detector.GeometryMuon:
396 result.merge(accMuon)
397 if flags.Detector.GeometryBpipe:
399 SubDetectorList += [ toolBpipe ]
400 if flags.Detector.GeometryLucid:
402 SubDetectorList += [ toolLucid ]
403 if flags.Detector.GeometryFwdRegion
or flags.Detector.GeometryAFP
or flags.Detector.GeometryALFA
or flags.Detector.GeometryZDC:
405 SubDetectorList += [ toolFwdRegion ]
407 result.setPrivateTools(SubDetectorList)
414 kwargs.setdefault(
"DetectorName",
"Atlas")
415 kwargs.setdefault(
"NSurfaces", 18)
417 innerRadii = [0.0] * 18
418 kwargs.setdefault(
"InnerRadii", innerRadii)
424 AtlasForwardOuterR = 2751.
425 AtlasOuterR1 = 14201.
426 AtlasOuterR2 = 14201.
429 if not (flags.Detector.GeometryMuon
or flags.Detector.GeometryCavern):
432 if not flags.Detector.GeometryCalo:
436 outerRadii = [0.0] * 18
437 for i
in (0, 1, 16, 17):
438 outerRadii[i] = 1501.
439 for i
in (2, 3, 14, 15):
440 outerRadii[i] = AtlasForwardOuterR
441 for i
in (4, 5, 12, 13):
442 outerRadii[i] = AtlasOuterR2
443 for i
in range(6, 12):
444 outerRadii[i] = AtlasOuterR1
447 if flags.Sim.WorldRRange:
448 routValue = flags.Sim.WorldRRange
449 if flags.Sim.WorldRRange >
max(AtlasOuterR1, AtlasOuterR2):
450 for i
in range(4, 14):
451 outerRadii[i] = routValue
453 raise RuntimeError(
'getATLASEnvelope: ERROR flags.Sim.WorldRRange must be > %f. Current value %f' % (
max(AtlasOuterR1, AtlasOuterR2), routValue) )
454 kwargs.setdefault(
"OuterRadii", outerRadii)
457 zSurfaces = [-26046., -23001., -23001., -22031., -22031., -12899., -12899., -6741., -6741., 6741., 6741., 12899., 12899., 22031., 22031., 23001., 23001., 26046.]
459 if flags.Detector.GeometryFwdRegion
or flags.Detector.GeometryAFP
or flags.Detector.GeometryALFA
or flags.Detector.GeometryZDC:
460 zSurfaces[0] = -400000.
461 zSurfaces[17] = 400000.
464 if flags.Sim.WorldZRange:
465 if flags.Sim.WorldZRange < 26046.:
466 raise RuntimeError(
'getATLASEnvelope: ERROR flags.Sim.WorldZRange must be > 26046. Current value: %f' % flags.Sim.WorldZRange)
467 zSurfaces[17] = flags.Sim.WorldZRange + 100.
468 zSurfaces[16] = flags.Sim.WorldZRange + 50.
469 zSurfaces[15] = flags.Sim.WorldZRange + 50.
470 zSurfaces[14] = flags.Sim.WorldZRange
471 zSurfaces[13] = flags.Sim.WorldZRange
472 zSurfaces[0] = -flags.Sim.WorldZRange - 100.
473 zSurfaces[1] = -flags.Sim.WorldZRange - 50.
474 zSurfaces[2] = -flags.Sim.WorldZRange - 50.
475 zSurfaces[3] = -flags.Sim.WorldZRange
476 zSurfaces[4] = -flags.Sim.WorldZRange
478 kwargs.setdefault(
"ZSurfaces", zSurfaces)
480 kwargs.setdefault(
"SubDetectors", SubDetectorList)
488 kwargs.setdefault(
"TestBeam", flags.Beam.Type
is BeamType.TestBeam)
495 voxelDensitySettings = {}
496 if flags.Detector.GeometryITkPixel:
497 voxelDensitySettings[
"ITkPixelDetector"] = 0.05
498 if flags.Detector.GeometryITkStrip:
499 voxelDensitySettings[
"ITkStrip::Barrel"] = 0.05
500 voxelDensitySettings[
"ITkStrip::ITkStrip_Forward"] = 0.05
503 voxelDensitySettings[
"ITkStrip::SCT_Forward"] = 0.05
504 kwargs.setdefault(
"VolumeVoxellDensityLevel",voxelDensitySettings)
512 regionCreatorList = []
514 if flags.Detector.GeometryCavern
or flags.Sim.CavernBackground
not in [CavernBackground.Off, CavernBackground.Signal]:
515 regionCreatorList += [
520 if flags.Detector.GeometryID:
521 if flags.Detector.GeometryPixel:
523 if flags.Detector.GeometrySCT:
525 if flags.Detector.GeometryTRT:
527 if flags.GeoModel.Run
in [LHCPeriod.Run2, LHCPeriod.Run3]:
531 if flags.Detector.GeometryBpipe:
532 if flags.Sim.BeamPipeSimMode
is not BeamPipeSimMode.Normal:
534 if not flags.Detector.GeometryFwdRegion
and (flags.Detector.GeometryAFP
or flags.Detector.GeometryALFA
or flags.Detector.GeometryZDC):
536 if flags.Detector.GeometryITk:
537 if flags.Detector.GeometryITkPixel:
539 if flags.Detector.GeometryITkStrip:
541 if flags.Detector.GeometryHGTD:
543 if flags.Detector.GeometryITk
or flags.Detector.GeometryHGTD:
545 if flags.Detector.GeometryBpipe:
546 if flags.Sim.BeamPipeSimMode
is not BeamPipeSimMode.Normal:
548 if not flags.Detector.GeometryFwdRegion
and (flags.Detector.GeometryAFP
or flags.Detector.GeometryALFA
or flags.Detector.GeometryZDC):
550 if flags.Detector.GeometryCalo:
551 if flags.Detector.GeometryLAr:
553 if flags.Sim.LArParameterization
is not LArParameterization.NoFrozenShowers \
554 and flags.Sim.CalibrationRun
in [CalibrationRun.LAr, CalibrationRun.LArTile, CalibrationRun.LArTileZDC, CalibrationRun.DeadLAr]:
555 Logging.log.info(
'You requested both calibration hits and frozen showers / parameterization in the LAr.')
556 Logging.log.info(
' Such a configuration is not allowed, and would give junk calibration hits where the showers are modified.')
557 Logging.log.info(
' Please try again with a different value of either flags.Sim.LArParameterization (' +
str(flags.Sim.LArParameterization.value) +
') or flags.Sim.CalibrationRun ('+
str(flags.Sim.CalibrationRun.value)+
')')
558 raise RuntimeError(
'Configuration not allowed')
559 regionCreatorList += [
564 fullCommandList =
'\t'.
join(flags.Sim.G4Commands)
565 if flags.Sim.LArParameterization
is LArParameterization.FrozenShowers
or 'EMECPara' in fullCommandList:
573 regionCreatorList += [
575 if flags.Sim.LArParameterization
is not LArParameterization.NoFrozenShowers:
578 if flags.Sim.LArParameterization
in [LArParameterization.DeadMaterialFrozenShowers, LArParameterization.FrozenShowersFCalOnly, LArParameterization.FastCaloSim]:
580 regionCreatorList += [
583 if flags.Sim.LArParameterization
is LArParameterization.FastCaloSim:
588 if flags.Detector.GeometryMuon:
590 regionCreatorList += [
594 if flags.Sim.CavernBackground
not in [CavernBackground.Off, CavernBackground.Read]
and not flags.Sim.RecordFlux:
596 result.setPrivateTools(regionCreatorList)
601 regionCreatorList = []
622 result.setPrivateTools(regionCreatorList)
631 if flags.Sim.TightMuonStepping:
633 fieldMgrList += [tool]
636 fieldMgrList += [tool]
637 if flags.Detector.GeometryBpipe:
639 fieldMgrList += [tool]
640 if flags.Detector.GeometryID:
642 fieldMgrList += [tool]
643 if flags.Detector.GeometryITk
or flags.Detector.GeometryHGTD:
645 fieldMgrList += [tool]
646 if flags.Detector.GeometryCalo
and flags.Sim.MuonFieldOnlyInCalo:
648 fieldMgrList += [tool]
649 if flags.Detector.GeometryMuon:
651 fieldMgrList += [tool]
654 if flags.Detector.GeometryFwdRegion:
679 result.setPrivateTools(fieldMgrList)
686 result.setPrivateTools(fieldMgrList)
691 geoConfigToolList = []
697 result.setPrivateTools(geoConfigToolList)
708 if "SenDetMasterTool" not in kwargs:
709 kwargs.setdefault(
"SenDetMasterTool",
712 if flags.Beam.Type
is BeamType.TestBeam:
714 from G4AtlasTools.G4TestBeamGeometryConfig
import TileTB_WorldEnvelopeCfg
716 kwargs.setdefault(
"RegionCreators", [])
717 kwargs.setdefault(
"FieldManagers", [])
719 kwargs.setdefault(
"World",
'LArTB_World')
721 kwargs.setdefault(
"FieldManagers", result.popToolsAndMerge(
TB_FieldMgrListCfg(flags)))
723 if flags.Detector.GeometryCavern:
724 kwargs.setdefault(
"World", result.popToolsAndMerge(
CavernWorldCfg(flags)))
726 kwargs.setdefault(
"World", result.popToolsAndMerge(
ATLASEnvelopeCfg(flags)))
728 if flags.BField.solenoidOn
or flags.BField.barrelToroidOn
or flags.BField.endcapToroidOn:
731 if flags.Sim.LArParameterization
is LArParameterization.FastCaloSim:
732 kwargs.setdefault(
"G4CaloTransportTool", result.addPublicTool(result.popToolsAndMerge(
G4CaloTransportToolCfg(flags))))
739 from AtlasGeoModel.CavernGMConfig
import CavernGeometryCfg
741 kwargs.setdefault(
"DetectorName",
"CavernInfra")
742 result.setPrivateTools(result.popToolsAndMerge(
GeoDetectorToolCfg(flags, name, **kwargs)))
748 kwargs.setdefault(
"DetectorName",
"World")
751 if flags.Sim.CavernBackground
is CavernBackground.Off:
755 bedrockDX = 1000.*3000
756 bedrockDZ = 1000.*3000
758 from CosmicGenerator.CosmicGeneratorConfig
import CavernPropertyCalculator
759 theCavernProperties = CavernPropertyCalculator()
760 if theCavernProperties.BedrockDX(flags) > bedrockDX:
761 bedrockDX = theCavernProperties.BedrockDX(flags)
762 if theCavernProperties.BedrockDZ(flags) > bedrockDZ:
763 bedrockDZ = theCavernProperties.BedrockDZ(flags)
765 kwargs.setdefault(
"dX", bedrockDX)
766 kwargs.setdefault(
"dY", 57300 + 41000 + 1000)
767 kwargs.setdefault(
"dZ", bedrockDZ)
769 kwargs.setdefault(
"NumberOfHoles", 1)
770 kwargs.setdefault(
"HoleNames", [
'BelowCavern'])
771 kwargs.setdefault(
"Hole_dX", [bedrockDX])
772 kwargs.setdefault(
"Hole_dY", [41000])
773 kwargs.setdefault(
"Hole_dZ", [bedrockDZ])
775 kwargs.setdefault(
"HolePosX", [0])
776 kwargs.setdefault(
"HolePosY", [-58300])
777 kwargs.setdefault(
"HolePosZ", [0])
783 kwargs.setdefault(
"SubDetectors", subDetectorList)
784 result.setPrivateTools(
BoxEnvelope(name, **kwargs))