ATLAS Offline Software
Loading...
Searching...
No Matches
python.G4Optimizations Namespace Reference

Functions

 enableFrozenShowersFCalOnly (flags)
 disableFrozenShowersFCalOnly (flags)
 enableBeamPipeKill (flags)
 disableBeamPipeKill (flags)
 enableTightMuonStepping (flags)
 disableTightMuonStepping (flags)
 enableMuonFieldOnlyInCalo (flags)
 disableMuonFieldOnlyInCalo (flags)
 enablePhotonRussianRoulette (flags)
 disablePhotonRussianRoulette (flags)
 enableNeutronRussianRoulette (flags)
 disableNeutronRussianRoulette (flags)
 enableEMRangeCuts (flags)
 disableEMRangeCuts (flags)
 enableG4GammaGeneralProcess (flags)
 disableG4GammaGeneralProcess (flags)
 enableWoodcockTracking (flags)
 disableWoodcockTracking (flags)
 enableG4Optimizations (flags)
 disableG4Optimizations (flags)
 WoodcockTrackingInEMEC (flags)
 WoodcockTrackingInEMECPara (flags)
 PostIncludeTweakPhysicsRegionsCfg (flags, cfg)

Function Documentation

◆ disableBeamPipeKill()

python.G4Optimizations.disableBeamPipeKill ( flags)

Definition at line 21 of file G4Optimizations.py.

21def disableBeamPipeKill(flags):
22 flags.Sim.BeamPipeCut = 100.0
23 flags.Sim.BeamPipeSimMode = BeamPipeSimMode.Normal
24
25

◆ disableEMRangeCuts()

python.G4Optimizations.disableEMRangeCuts ( flags)

Definition at line 71 of file G4Optimizations.py.

71def disableEMRangeCuts(flags):
72 commands = flags.Sim.G4Commands
73 commands.remove("/process/em/applyCuts true")
74 flags.Sim.G4Commands = commands
75
76

◆ disableFrozenShowersFCalOnly()

python.G4Optimizations.disableFrozenShowersFCalOnly ( flags)
Turns off GFlash shower parametrization for FCAL

Definition at line 11 of file G4Optimizations.py.

11def disableFrozenShowersFCalOnly(flags):
12 """Turns off GFlash shower parametrization for FCAL"""
13 flags.Sim.LArParameterization = LArParameterization.NoFrozenShowers
14
15

◆ disableG4GammaGeneralProcess()

python.G4Optimizations.disableG4GammaGeneralProcess ( flags)
Disables G4GammaGeneralProcess AND Woodcock tracking

Definition at line 83 of file G4Optimizations.py.

83def disableG4GammaGeneralProcess(flags):
84 """Disables G4GammaGeneralProcess AND Woodcock tracking"""
85 commands = flags.Sim.G4Commands
86 commands.remove("/process/em/UseGeneralProcess true")
87 commands.remove("/process/em/useWoodcockTracking EMEC") # Woodcock tracking requires G4GammaGeneralProcess
88 flags.Sim.G4Commands = commands
89 optionalUserActions = flags.Sim.OptionalUserActionList
90 optionalUserActions.remove("G4UserActions.G4UserActionsConfig.FixG4CreatorProcessToolCfg")
91 flags.Sim.OptionalUserActionList = optionalUserActions
92
93

◆ disableG4Optimizations()

python.G4Optimizations.disableG4Optimizations ( flags)
Ensure all G4Optimizations are disabled - useful for debugging 

Definition at line 157 of file G4Optimizations.py.

157def disableG4Optimizations(flags):
158 """ Ensure all G4Optimizations are disabled - useful for debugging """
159 disableMuonFieldOnlyInCalo(flags)
160 disablePhotonRussianRoulette(flags)
161 disableNeutronRussianRoulette(flags)
162 disableEMRangeCuts(flags)
163 disableG4GammaGeneralProcess(flags)
164 disableWoodcockTracking(flags)
165 disableBeamPipeKill(flags)
166 disableFrozenShowersFCalOnly(flags)
167
168

◆ disableMuonFieldOnlyInCalo()

python.G4Optimizations.disableMuonFieldOnlyInCalo ( flags)

Definition at line 39 of file G4Optimizations.py.

39def disableMuonFieldOnlyInCalo(flags):
40 flags.Sim.MuonFieldOnlyInCalo = False
41
42

◆ disableNeutronRussianRoulette()

python.G4Optimizations.disableNeutronRussianRoulette ( flags)

Definition at line 61 of file G4Optimizations.py.

61def disableNeutronRussianRoulette(flags):
62 flags.Sim.NRRThreshold = False
63 flags.Sim.NRRWeight = False
64
65

◆ disablePhotonRussianRoulette()

python.G4Optimizations.disablePhotonRussianRoulette ( flags)

Definition at line 49 of file G4Optimizations.py.

49def disablePhotonRussianRoulette(flags):
50 flags.Sim.PRRThreshold = False
51 flags.Sim.PRRWeight = False
52
53

◆ disableTightMuonStepping()

python.G4Optimizations.disableTightMuonStepping ( flags)

Definition at line 30 of file G4Optimizations.py.

30def disableTightMuonStepping(flags):
31 flags.Sim.TightMuonStepping = False
32
33

◆ disableWoodcockTracking()

python.G4Optimizations.disableWoodcockTracking ( flags)

Definition at line 104 of file G4Optimizations.py.

104def disableWoodcockTracking(flags):
105 commands = flags.Sim.G4Commands
106 commands.remove("/process/em/useWoodcockTracking EMEC")
107 flags.Sim.G4Commands = commands
108 if "/process/em/UseGeneralProcess true" not in flags.Sim.G4Commands:
109 optionalUserActions = flags.Sim.OptionalUserActionList
110 optionalUserActions.remove("G4UserActions.G4UserActionsConfig.FixG4CreatorProcessToolCfg")
111 flags.Sim.OptionalUserActionList = optionalUserActions
112
113

◆ enableBeamPipeKill()

python.G4Optimizations.enableBeamPipeKill ( flags)

Definition at line 16 of file G4Optimizations.py.

16def enableBeamPipeKill(flags):
17 flags.Sim.BeamPipeCut = 0.
18 flags.Sim.BeamPipeSimMode = BeamPipeSimMode.FastSim
19
20

◆ enableEMRangeCuts()

python.G4Optimizations.enableEMRangeCuts ( flags)
Turn on range cuts for gamma processes (conv, phot, compt)

Definition at line 66 of file G4Optimizations.py.

66def enableEMRangeCuts(flags):
67 """Turn on range cuts for gamma processes (conv, phot, compt)"""
68 flags.Sim.G4Commands += ['/process/em/applyCuts true']
69
70

◆ enableFrozenShowersFCalOnly()

python.G4Optimizations.enableFrozenShowersFCalOnly ( flags)
Turns on GFlash shower parametrization for FCAL

Definition at line 5 of file G4Optimizations.py.

5def enableFrozenShowersFCalOnly(flags):
6 """Turns on GFlash shower parametrization for FCAL"""
7 flags.Sim.LArParameterization = LArParameterization.FrozenShowersFCalOnly
8 flags.Sim.CalibrationRun = CalibrationRun.Off
9
10

◆ enableG4GammaGeneralProcess()

python.G4Optimizations.enableG4GammaGeneralProcess ( flags)
Activate the G4GammaGeneralProcess and the UserAction required

Definition at line 77 of file G4Optimizations.py.

77def enableG4GammaGeneralProcess(flags):
78 """Activate the G4GammaGeneralProcess and the UserAction required"""
79 flags.Sim.G4Commands+=["/process/em/UseGeneralProcess true"]
80 flags.Sim.OptionalUserActionList += ['G4UserActions.G4UserActionsConfig.FixG4CreatorProcessToolCfg']
81
82

◆ enableG4Optimizations()

python.G4Optimizations.enableG4Optimizations ( flags)
Enable G4 optimizations

Definition at line 114 of file G4Optimizations.py.

114def enableG4Optimizations(flags):
115 """Enable G4 optimizations"""
116
117 # Activate magnetic field switch off in central LAr calorimeter
118 # More info: https://its.cern.ch/jira/browse/ATLPHYSVAL-773
119 enableMuonFieldOnlyInCalo(flags)
120
121 # Photon Russian Roulette
122 # "Fast simulation" killing low energy photons with some probability.
123 # More info: https://its.cern.ch/jira/browse/ATLASSIM-4096
124 enablePhotonRussianRoulette(flags)
125
126 # Neutron Russian Roulette
127 # "Fast simulation" killing low energy neutrons with some probability.
128 # More info: its.cern.ch/jira/browse/ATLASSIM-3924
129 enableNeutronRussianRoulette(flags)
130
131 # EM Range Cuts
132 # Turn on range cuts for gamma processes (conv, phot, compt)
133 # More info: https://its.cern.ch/jira/browse/ATLASSIM-3956
134 enableEMRangeCuts(flags)
135
136 # G4GammaGeneralProcess
137 # Activate the G4GammaGeneralProcess and the UserAction required
138 # to fix the creator process of secondary tracks.
139 enableG4GammaGeneralProcess(flags)
140
141 # Energy Loss fluctuation OFF
142 # Switch off the Energy loss fluctuation process
143 # More info: https://its.cern.ch/jira/browse/ATLASSIM-6995
144 # Main physics validation: https://its.cern.ch/jira/browse/ATLPHYSVAL-1009
145 # Follow-up validation for Muons: https://its.cern.ch/jira/browse/ATLPHYSVAL-1022
146 # Follow-up validation for Egamma: https://its.cern.ch/jira/browse/ATLPHYSVAL-1030
147 # This optimization is on hold for mc23e - for discrepancies seen in the
148 # follow-up validations by EgammaCP group.
149 # It will be evaluated for future campaigns.
150 # flags.Sim.G4Commands+=["/process/eLoss/fluct false"]
151
152 # Activate the Woodcock Tracking in the EMEC
153 # More info: https://its.cern.ch/jira/browse/ATLASSIM-5079
154 enableWoodcockTracking(flags)
155
156

◆ enableMuonFieldOnlyInCalo()

python.G4Optimizations.enableMuonFieldOnlyInCalo ( flags)
Activate magnetic field switch off in central LAr calorimeter

Definition at line 34 of file G4Optimizations.py.

34def enableMuonFieldOnlyInCalo(flags):
35 """Activate magnetic field switch off in central LAr calorimeter"""
36 flags.Sim.MuonFieldOnlyInCalo = True
37
38

◆ enableNeutronRussianRoulette()

python.G4Optimizations.enableNeutronRussianRoulette ( flags)
Activate Neutron Russian Roulette: Fast simulation" killing low energy neutrons with some probability.

Definition at line 54 of file G4Optimizations.py.

54def enableNeutronRussianRoulette(flags):
55 """Activate Neutron Russian Roulette: Fast simulation" killing low energy neutrons with some probability."""
56 flags.Sim.NRRThreshold = 2. # MeV
57 flags.Sim.NRRWeight = 10.
58 flags.Sim.CalibrationRun = CalibrationRun.Off
59
60

◆ enablePhotonRussianRoulette()

python.G4Optimizations.enablePhotonRussianRoulette ( flags)
Activate Photon Russian Roulette: Fast simulation" killing low energy photons with some probability.

Definition at line 43 of file G4Optimizations.py.

43def enablePhotonRussianRoulette(flags):
44 """Activate Photon Russian Roulette: Fast simulation" killing low energy photons with some probability."""
45 flags.Sim.PRRThreshold = 0.5 # MeV
46 flags.Sim.PRRWeight = 10.
47
48

◆ enableTightMuonStepping()

python.G4Optimizations.enableTightMuonStepping ( flags)

Definition at line 26 of file G4Optimizations.py.

26def enableTightMuonStepping(flags):
27 flags.Sim.TightMuonStepping = True
28
29

◆ enableWoodcockTracking()

python.G4Optimizations.enableWoodcockTracking ( flags)
Activate the Woodcock Tracking in the EMEC

Definition at line 94 of file G4Optimizations.py.

94def enableWoodcockTracking(flags):
95 """Activate the Woodcock Tracking in the EMEC"""
96 flags.Sim.G4Commands += ['/process/em/useWoodcockTracking EMEC']
97 # Please note that the Woodcock tracking enables the
98 # G4GammaGeneralProcess therefore the FixG4CreatorProcessTool must
99 # be added if it's not done before
100 if "G4UserActions.G4UserActionsConfig.FixG4CreatorProcessToolCfg" not in flags.Sim.OptionalUserActionList:
101 flags.Sim.OptionalUserActionList += ['G4UserActions.G4UserActionsConfig.FixG4CreatorProcessToolCfg']
102
103

◆ PostIncludeTweakPhysicsRegionsCfg()

python.G4Optimizations.PostIncludeTweakPhysicsRegionsCfg ( flags,
cfg )

Definition at line 187 of file G4Optimizations.py.

187def PostIncludeTweakPhysicsRegionsCfg(flags, cfg):
188 # This postInclude drops BeamPipe::SectionF198 and
189 # BeamPipe::SectionF199 from the DeadMaterial G4Region, to avoid a
190 # clash with the BeampipeFwdCut G4Region.
191 from AthenaConfiguration.ComponentAccumulator import ConfigurationError
192 detConTool = None
193 try:
194 detConTool = cfg.getPublicTool('G4AtlasDetectorConstructionTool')
195 except ConfigurationError:
196 pass
197 if detConTool is None:
198 return
199 detConTool.RegionCreators['DeadMaterialPhysicsRegionTool'].VolumeList.remove('BeamPipe::SectionF198')
200 detConTool.RegionCreators['DeadMaterialPhysicsRegionTool'].VolumeList.remove('BeamPipe::SectionF199')

◆ WoodcockTrackingInEMEC()

python.G4Optimizations.WoodcockTrackingInEMEC ( flags)

Definition at line 169 of file G4Optimizations.py.

169def WoodcockTrackingInEMEC(flags):
170 # Use Woodcock Tracking in the EMEC rather than the EMECPara
171 # G4Region. This preInclude should be added at the end of the list
172 # of preIncludes.
173 commands = flags.Sim.G4Commands
174 commands.remove("/process/em/useWoodcockTracking EMECPara")
175 flags.Sim.G4Commands = commands + ["/process/em/useWoodcockTracking EMEC"]
176
177

◆ WoodcockTrackingInEMECPara()

python.G4Optimizations.WoodcockTrackingInEMECPara ( flags)

Definition at line 178 of file G4Optimizations.py.

178def WoodcockTrackingInEMECPara(flags):
179 # Use Woodcock Tracking in the EMECPara rather than the EMEC
180 # G4Region. This preInclude should be added at the end of the list
181 # of preIncludes.
182 commands = flags.Sim.G4Commands
183 commands.remove("/process/em/useWoodcockTracking EMEC")
184 flags.Sim.G4Commands = commands + ["/process/em/useWoodcockTracking EMECPara"]
185
186