2 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
3 from AthenaConfiguration.ComponentFactory
import CompFactory
4 from AthenaConfiguration.Enums
import BeamType
5 from SimulationConfig.SimEnums
import BeamPipeSimMode, CalibrationRun, CavernBackground, LArParameterization
6 from AthenaConfiguration.AccumulatorCache
import AccumulatorCache
13 if flags.Sim.LArParameterization
is LArParameterization.FastCaloSim:
14 from G4FastSimulation.G4FastSimulationConfig
import FastCaloSimCfg
17 if flags.Detector.GeometryBpipe:
18 if not flags.Detector.GeometryFwdRegion
and (flags.Detector.GeometryAFP
or flags.Detector.GeometryALFA
or flags.Detector.GeometryZDC):
20 from ForwardTransport.ForwardTransportConfig
import ForwardTransportModelCfg
22 if flags.Sim.BeamPipeSimMode
is not BeamPipeSimMode.Normal:
23 from G4FastSimulation.G4FastSimulationConfig
import SimpleFastKillerCfg
25 if flags.Detector.GeometryLAr:
26 if flags.Sim.LArParameterization
is LArParameterization.NoFrozenShowers:
27 from AthenaCommon.Logging
import logging
28 msg = logging.getLogger(
"FastSimulationToolListCfg")
29 msg.info(
"Not using Frozen Showers" )
31 from LArG4FastSimulation.LArG4FastSimulationConfig
import EMBFastShowerCfg, EMECFastShowerCfg, FCALFastShowerCfg, FCAL2FastShowerCfg
33 if flags.Sim.LArParameterization
is LArParameterization.FrozenShowers:
38 if flags.Sim.LArParameterization
in [LArParameterization.DeadMaterialFrozenShowers, LArParameterization.FrozenShowersFCalOnly, LArParameterization.FastCaloSim]:
39 from G4FastSimulation.G4FastSimulationConfig
import DeadMaterialShowerCfg
42 if flags.Sim.LArParameterization
is LArParameterization.FastCaloSim:
43 from G4FastSimulation.G4FastSimulationConfig
import FastCaloSimCfg
45 if flags.Detector.GeometryMuon:
46 if flags.Sim.CavernBackground
not in [CavernBackground.Off, CavernBackground.Read]
and not flags.Sim.RecordFlux:
47 from TrackWriteFastSim.TrackWriteFastSimConfig
import NeutronFastSimCfg
49 result.setPrivateTools(tools)
56 FastSimulationMasterTool = CompFactory.FastSimulationMasterTool
63 FastSimulationMasterTool = CompFactory.FastSimulationMasterTool
65 result.setPrivateTools(tool)
72 kwargs.setdefault(
"UseSimplifiedGeo",
bool(flags.Sim.SimplifiedGeoPath))
73 if flags.Sim.SimplifiedGeoPath:
75 kwargs.setdefault(
'SimplifiedWorldLogName',
"WorldLog")
77 kwargs.setdefault(
'TransportLimitVolume',
"Envelope")
79 kwargs.setdefault(
'MaxSteps', 100)
82 kwargs.setdefault(
'TransportLimitVolume',
"MuonSys")
84 kwargs.setdefault(
'MaxSteps', 5000)
86 result.setPrivateTools(CompFactory.G4CaloTransportTool(name, **kwargs))
93 if flags.Detector.EnableLucid:
94 from LUCID_G4_SD.LUCID_G4_SDConfig
import LUCID_SensitiveDetectorCfg
96 if flags.Detector.EnableForward:
97 if flags.Detector.EnableZDC:
98 from ZDC_SD.ZDC_SDConfig
import ZDC_FiberSDCfg
100 if flags.Sim.CalibrationRun
in [CalibrationRun.ZDC, CalibrationRun.LArTileZDC]:
101 from ZDC_SD.ZDC_SDConfig
import ZDC_G4CalibSDCfg
103 if flags.Detector.EnableALFA:
104 from ALFA_G4_SD.ALFA_G4_SDConfig
import ALFA_SensitiveDetectorCfg
106 if flags.Detector.EnableAFP:
107 from AFP_G4_SD.AFP_G4_SDConfig
import AFP_SensitiveDetectorCfg
113 result.setPrivateTools(tools)
120 if (flags.Detector.EnableMuon
and flags.Sim.CavernBackground
in [CavernBackground.Write, CavernBackground.WriteWorld])
or flags.Sim.StoppedParticleFile:
121 from TrackWriteFastSim.TrackWriteFastSimConfig
import TrackFastSimSDCfg
123 result.setPrivateTools(tools)
129 if flags.Sim.LArParameterization
is LArParameterization.FastCaloSim:
130 from ISF_FastCaloSimParametrization.ISF_FastCaloSimParametrizationConfig
import CaloCellContainerSDCfg
132 result.setPrivateTools(tools)
139 if flags.Detector.EnableITkPixel:
140 from PixelG4_SD.PixelG4_SDToolConfig
import ITkPixelSensorSDCfg
143 if flags.Detector.EnableITkStrip:
144 from SCT_G4_SD.SCT_G4_SDToolConfig
import ITkStripSensorSDCfg
146 if flags.Detector.EnablePLR:
147 from PixelG4_SD.PixelG4_SDToolConfig
import PLRSensorSDCfg
150 result.setPrivateTools(tools)
158 if flags.Detector.EnableHGTD:
159 from HGTD_G4_SD.HGTD_G4_SDToolConfig
import HgtdSensorSDCfg
163 result.setPrivateTools(tools)
171 if flags.Detector.EnablePixel:
172 from PixelG4_SD.PixelG4_SDToolConfig
import PixelSensorSDCfg
174 if flags.Detector.EnableSCT:
175 from SCT_G4_SD.SCT_G4_SDToolConfig
import SctSensorSDCfg
177 if flags.Detector.EnableTRT:
178 from TRT_G4_SD.TRT_G4_SDToolConfig
import TRTSensitiveDetectorCfg
180 if flags.Detector.EnableBCM:
181 from BCM_G4_SD.BCM_G4_SDToolConfig
import BCMSensorSDCfg
183 from BLM_G4_SD.BLM_G4_SDToolConfig
import BLMSensorSDCfg
186 result.setPrivateTools(tools)
194 if flags.Detector.EnableLAr:
195 from LArG4SD.LArG4SDToolConfig
import LArEMBSensitiveDetectorCfg, LArEMECSensitiveDetectorCfg, LArFCALSensitiveDetectorCfg, LArHECSensitiveDetectorCfg
201 if flags.Detector.EnableMBTS:
202 from MinBiasScintillator.MinBiasScintillatorToolConfig
import MinBiasScintillatorSDCfg
205 if flags.Sim.CalibrationRun
in [CalibrationRun.LAr, CalibrationRun.LArTile, CalibrationRun.LArTileZDC]:
206 from LArG4SD.LArG4SDToolConfig
import LArDeadSensitiveDetectorToolCfg, LArActiveSensitiveDetectorToolCfg, LArInactiveSensitiveDetectorToolCfg
210 elif flags.Sim.CalibrationRun
is CalibrationRun.DeadLAr:
211 from LArG4SD.LArG4SDToolConfig
import LArDeadSensitiveDetectorToolCfg
214 if flags.Detector.EnableTile:
215 if flags.Sim.CalibrationRun
in [CalibrationRun.Tile, CalibrationRun.LArTile, CalibrationRun.LArTileZDC]:
216 from TileGeoG4Calib.TileGeoG4CalibConfig
import TileGeoG4CalibSDCfg
219 from TileGeoG4SD.TileGeoG4SDToolConfig
import TileGeoG4SDCfg
221 if flags.Sim.RecordStepInfo:
222 from ISF_FastCaloSimSD.ISF_FastCaloSimSDToolConfig
import FCS_StepInfoSDToolCfg
225 result.setPrivateTools(tools)
230 if flags.Muon.usePhaseIIGeoSetup:
231 from MuonSensitiveDetectorsR4.SensitiveDetectorsCfg
import SetupSensitiveDetectorsCfg
233 from MuonG4SD.MuonG4SDConfig
import SetupSensitiveDetectorsCfg
239 if flags.Beam.Type
is BeamType.Cosmics
and not flags.Sim.ReadTR:
240 from TrackWriteFastSim.TrackWriteFastSimConfig
import CosmicTRSDCfg
242 result.setPrivateTools(tools)
247 from SimulationConfig.SimEnums
import LArParameterization
248 writtenContainers =[]
249 if flags.Detector.GeometryMuon:
250 if flags.Muon.usePhaseIIGeoSetup:
251 from MuonSensitiveDetectorsR4.SensitiveDetectorsCfg
import SimHitContainerListCfg
254 from MuonG4SD.MuonG4SDConfig
import SimHitContainerListCfg
256 if flags.Detector.GeometryLAr:
257 if flags.Sim.LArParameterization
is LArParameterization.FastCaloSim:
258 writtenContainers += [(
"LArHitContainer",
"LArHitEMB_G4")]
259 writtenContainers += [(
"LArHitContainer",
"LArHitEMEC_G4")]
260 writtenContainers += [(
"LArHitContainer",
"LArHitFCAL_G4")]
261 writtenContainers += [(
"LArHitContainer",
"LArHitHEC_G4")]
263 writtenContainers += [(
"LArHitContainer",
"LArHitEMB")]
264 writtenContainers += [(
"LArHitContainer",
"LArHitEMEC")]
265 writtenContainers += [(
"LArHitContainer",
"LArHitFCAL")]
266 writtenContainers += [(
"LArHitContainer",
"LArHitHEC")]
267 if flags.Detector.GeometryTile:
268 if flags.Sim.LArParameterization
is LArParameterization.FastCaloSim:
269 writtenContainers += [(
"TileHitVector",
"MBTSHits_G4")]
270 writtenContainers += [(
"TileHitVector",
"TileHitVec_G4")]
272 writtenContainers += [(
"TileHitVector",
"MBTSHits")]
273 writtenContainers += [(
"TileHitVector",
"TileHitVec")]
274 if flags.Detector.GeometryTRT:
275 writtenContainers += [(
"TRTUncompressedHitCollection",
"TRTUncompressedHits")]
276 if flags.Detector.EnableBCM:
277 writtenContainers += [(
"SiHitCollection",
"BCMHits")]
278 writtenContainers += [(
"SiHitCollection",
"BLMHits")]
279 if flags.Detector.EnablePixel:
280 writtenContainers += [(
"SiHitCollection",
"PixelHits")]
281 if flags.Detector.EnableSCT:
282 writtenContainers += [(
"SiHitCollection",
"SCT_Hits")]
283 from SimulationConfig.SimEnums
import CalibrationRun
284 if flags.Sim.CalibrationRun
in [CalibrationRun.LAr, CalibrationRun.LArTile]:
286 writtenContainers += [
287 (
'CaloCalibrationHitContainer' ,
'StoreGateSvc+LArCalibrationHitActive_DEAD' ),
288 (
'CaloCalibrationHitContainer' ,
'StoreGateSvc+LArCalibrationHitDeadMaterial_DEAD' ),
289 (
'CaloCalibrationHitContainer' ,
'StoreGateSvc+LArCalibrationHitInactive_DEAD' )
292 return writtenContainers
296 from SimulationConfig.SimEnums
import LArParameterization
297 if flags.Sim.LArParameterization
is LArParameterization.FastCaloSim:
298 dependencies+=[(
'CaloDetDescrManager',
'ConditionStore+CaloDetDescrManager'),
299 (
'LArfSamplSym',
'ConditionStore+LArfSamplSym'),
300 (
'TileSamplingFraction',
'ConditionStore+TileSamplingFraction')]
301 from MuonSensitiveDetectorsR4.SensitiveDetectorsCfg
import MuonDependenciesCfg
318 result.setPrivateTools(tools)
326 if flags.Detector.EnableTile:
327 if flags.Sim.CalibrationRun
in [CalibrationRun.Tile, CalibrationRun.LArTile, CalibrationRun.LArTileZDC]:
328 from TileGeoG4Calib.TileGeoG4CalibConfig
import TileCTBGeoG4CalibSDCfg
331 from TileGeoG4SD.TileGeoG4SDToolConfig
import TileCTBGeoG4SDCfg
333 from MuonWall.MuonWallConfig
import MuonWallSDCfg
335 result.setPrivateTools(tools)
342 if flags.Detector.EnablePixel:
343 from PixelG4_SD.PixelG4_SDToolConfig
import PixelSensor_CTBCfg
345 if flags.Detector.EnableSCT:
346 from SCT_G4_SD.SCT_G4_SDToolConfig
import SctSensor_CTBCfg
348 if flags.Detector.EnableTRT:
349 from TRT_G4_SD.TRT_G4_SDToolConfig
import TRTSensitiveDetector_CTBCfg
351 if flags.Detector.EnableLAr:
352 from LArG4SD.LArG4SDToolConfig
import LArEMBSensitiveDetectorCfg
354 if flags.Sim.CalibrationRun
in [CalibrationRun.LAr, CalibrationRun.LArTile, CalibrationRun.LArTileZDC, CalibrationRun.DeadLAr]:
355 tools += [
'LArH8CalibSensitiveDetector' ]
356 if flags.Detector.EnableTile:
357 if flags.Sim.CalibrationRun
in [CalibrationRun.Tile, CalibrationRun.LArTile, CalibrationRun.LArTileZDC]:
358 from TileGeoG4Calib.TileGeoG4CalibConfig
import TileCTBGeoG4CalibSDCfg
361 from TileGeoG4SD.TileGeoG4SDToolConfig
import TileCTBGeoG4SDCfg
363 tools += [
'MuonWallSD' ]
364 if flags.Detector.EnableMuon:
365 tools += [
'MuonEntryRecord' ]
368 result.setPrivateTools(tools)
375 if flags.Beam.Type
is BeamType.TestBeam:
377 elif "tb_LArH6" in flags.GeoModel.AtlasVersion:
379 elif "ctbh8" in flags.GeoModel.AtlasVersion:
384 result.setPrivateTools(CompFactory.SensitiveDetectorMasterTool(name, **kwargs))
390 tool = result.popToolsAndMerge(CompFactory.SensitiveDetectorMasterTool(name, **kwargs))
391 result.setPrivateTools(tool)