ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Sim
MCTruthBase
python
MCTruthBaseConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
4
from
AthenaConfiguration.ComponentFactory
import
CompFactory
5
6
def
getEnvelopeMap
(flags):
7
# Map of volume name to output collection name
8
envelopeMap = dict()
9
10
# TODO - implement CTB config
11
# if flags.TestBeam.LArFarUpstreamMaterial:
12
# envelopeMap['LARFARUPSTREAMMATERIAL::LARFARUPSTREAMMATERIAL'] = 'LArFarUpstreamMaterialExitLayer'
13
from
AthenaConfiguration.Enums
import
BeamType
14
if
flags.Beam.Type
is
BeamType.Cosmics:
15
16
if
"TRT_Barrel"
in
flags.Sim.CosmicFilterVolumeNames:
17
envelopeMap[
'TRT::BarrelOuterSupport'
] =
'TRTBarrelEntryLayer'
18
elif
"TRT_EC"
in
flags.Sim.CosmicFilterVolumeNames:
19
envelopeMap[
'TRT::WheelA'
] =
'TRTECAEntryLayer'
20
envelopeMap[
'TRT::WheelB'
] =
'TRTECBEntryLayer'
21
elif
"SCT_Barrel"
in
flags.Sim.CosmicFilterVolumeNames:
22
envelopeMap[
'SCT::ThShieldOuterCly'
] =
'SCTBarrelEntryLayer'
# could be ThShieldInnerCly or Cyl..
23
elif
"Pixel"
in
flags.Sim.CosmicFilterVolumeNames:
24
envelopeMap[
'Pixel::Pixel'
] =
'PixelEntryLayer'
25
if
not
flags.Sim.ISFRun:
26
if
flags.Detector.GeometryID:
27
envelopeMap[
'IDET::IDET'
] =
'CaloEntryLayer'
28
if
flags.Detector.GeometryITk:
29
envelopeMap[
'ITK::ITK'
] =
'CaloEntryLayer'
30
if
flags.Detector.GeometryCalo:
31
envelopeMap[
'CALO::CALO'
] =
'MuonEntryLayer'
32
if
flags.Detector.GeometryMuon:
#was geometry in old style, should it be?
33
envelopeMap[
'MUONQ02::MUONQ02'
] =
'MuonExitLayer'
34
return
envelopeMap
35
36
37
def
MCTruthSteppingActionToolCfg
(flags, name='G4UA::MCTruthSteppingActionTool
', **kwargs):
38
"""Retrieve the MCTruthSteppingActionTool"""
39
result = ComponentAccumulator()
40
kwargs.setdefault(
"VolumeCollectionMap"
,
getEnvelopeMap
(flags))
41
kwargs.setdefault(
"SecondarySavingLevel"
, 2)
42
43
subDetLevel = 1
44
if
"ATLAS"
in
flags.GeoModel.AtlasVersion
and
flags.Detector.GeometryCavern:
45
subDetLevel = 2
46
kwargs.setdefault(
"SubDetVolumeLevel"
, subDetLevel)
47
48
result.setPrivateTools( CompFactory.G4UA.MCTruthSteppingActionTool(name, **kwargs) )
49
return
result
MCTruthBaseConfig.getEnvelopeMap
getEnvelopeMap(flags)
Definition
MCTruthBaseConfig.py:6
MCTruthBaseConfig.MCTruthSteppingActionToolCfg
MCTruthSteppingActionToolCfg(flags, name='G4UA::MCTruthSteppingActionTool', **kwargs)
Definition
MCTruthBaseConfig.py:37
Generated on
for ATLAS Offline Software by
1.17.0