ATLAS Offline Software
Functions
python.G4Optimizations Namespace Reference

Functions

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

Function Documentation

◆ disableBeamPipeKill()

def python.G4Optimizations.disableBeamPipeKill (   flags)

Definition at line 21 of file G4Optimizations.py.

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

◆ disableEMRangeCuts()

def python.G4Optimizations.disableEMRangeCuts (   flags)

Definition at line 71 of file G4Optimizations.py.

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

◆ disableFrozenShowersFCalOnly()

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

Definition at line 11 of file G4Optimizations.py.

12  """Turns off GFlash shower parametrization for FCAL"""
13  flags.Sim.LArParameterization = LArParameterization.NoFrozenShowers
14 
15 

◆ disableG4GammaGeneralProcess()

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

Definition at line 83 of file G4Optimizations.py.

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()

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

Definition at line 157 of file G4Optimizations.py.

157 def disableG4Optimizations(flags):
158  """ Ensure all G4Optimizations are disabled - useful for debugging """
162  disableEMRangeCuts(flags)
165  disableBeamPipeKill(flags)
167 
168 

◆ disableMuonFieldOnlyInCalo()

def python.G4Optimizations.disableMuonFieldOnlyInCalo (   flags)

Definition at line 39 of file G4Optimizations.py.

40  flags.Sim.MuonFieldOnlyInCalo = False
41 
42 

◆ disableNeutronRussianRoulette()

def python.G4Optimizations.disableNeutronRussianRoulette (   flags)

Definition at line 61 of file G4Optimizations.py.

62  flags.Sim.NRRThreshold = False
63  flags.Sim.NRRWeight = False
64 
65 

◆ disablePhotonRussianRoulette()

def python.G4Optimizations.disablePhotonRussianRoulette (   flags)

Definition at line 49 of file G4Optimizations.py.

50  flags.Sim.PRRThreshold = False
51  flags.Sim.PRRWeight = False
52 
53 

◆ disableTightMuonStepping()

def python.G4Optimizations.disableTightMuonStepping (   flags)

Definition at line 30 of file G4Optimizations.py.

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

◆ disableWoodcockTracking()

def python.G4Optimizations.disableWoodcockTracking (   flags)

Definition at line 104 of file G4Optimizations.py.

104 def 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()

def python.G4Optimizations.enableBeamPipeKill (   flags)

Definition at line 16 of file G4Optimizations.py.

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

◆ enableEMRangeCuts()

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

Definition at line 66 of file G4Optimizations.py.

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

◆ enableFrozenShowersFCalOnly()

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

Definition at line 5 of file G4Optimizations.py.

6  """Turns on GFlash shower parametrization for FCAL"""
7  flags.Sim.LArParameterization = LArParameterization.FrozenShowersFCalOnly
8  flags.Sim.CalibrationRun = CalibrationRun.Off
9 
10 

◆ enableG4GammaGeneralProcess()

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

Definition at line 77 of file G4Optimizations.py.

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()

def python.G4Optimizations.enableG4Optimizations (   flags)
Enable G4 optimizations

Definition at line 114 of file G4Optimizations.py.

114 def 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
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
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
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.
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
155 
156 

◆ enableMuonFieldOnlyInCalo()

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

Definition at line 34 of file G4Optimizations.py.

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

◆ enableNeutronRussianRoulette()

def 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.

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()

def 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.

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()

def python.G4Optimizations.enableTightMuonStepping (   flags)

Definition at line 26 of file G4Optimizations.py.

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

◆ enableWoodcockTracking()

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

Definition at line 94 of file G4Optimizations.py.

94 def 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()

def python.G4Optimizations.PostIncludeTweakPhysicsRegionsCfg (   flags,
  cfg 
)

Definition at line 187 of file G4Optimizations.py.

187 def 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()

def python.G4Optimizations.WoodcockTrackingInEMEC (   flags)

Definition at line 169 of file G4Optimizations.py.

169 def 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()

def python.G4Optimizations.WoodcockTrackingInEMECPara (   flags)

Definition at line 178 of file G4Optimizations.py.

178 def 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 
python.G4Optimizations.enableBeamPipeKill
def enableBeamPipeKill(flags)
Definition: G4Optimizations.py:16
python.G4Optimizations.disablePhotonRussianRoulette
def disablePhotonRussianRoulette(flags)
Definition: G4Optimizations.py:49
python.G4Optimizations.enableG4Optimizations
def enableG4Optimizations(flags)
Definition: G4Optimizations.py:114
python.G4Optimizations.enableG4GammaGeneralProcess
def enableG4GammaGeneralProcess(flags)
Definition: G4Optimizations.py:77
python.G4Optimizations.disableG4Optimizations
def disableG4Optimizations(flags)
Definition: G4Optimizations.py:157
python.G4Optimizations.disableWoodcockTracking
def disableWoodcockTracking(flags)
Definition: G4Optimizations.py:104
python.G4Optimizations.disableBeamPipeKill
def disableBeamPipeKill(flags)
Definition: G4Optimizations.py:21
python.G4Optimizations.enablePhotonRussianRoulette
def enablePhotonRussianRoulette(flags)
Definition: G4Optimizations.py:43
python.G4Optimizations.enableWoodcockTracking
def enableWoodcockTracking(flags)
Definition: G4Optimizations.py:94
python.G4Optimizations.enableTightMuonStepping
def enableTightMuonStepping(flags)
Definition: G4Optimizations.py:26
python.G4Optimizations.PostIncludeTweakPhysicsRegionsCfg
def PostIncludeTweakPhysicsRegionsCfg(flags, cfg)
Definition: G4Optimizations.py:187
python.G4Optimizations.disableMuonFieldOnlyInCalo
def disableMuonFieldOnlyInCalo(flags)
Definition: G4Optimizations.py:39
python.G4Optimizations.disableFrozenShowersFCalOnly
def disableFrozenShowersFCalOnly(flags)
Definition: G4Optimizations.py:11
python.G4Optimizations.disableNeutronRussianRoulette
def disableNeutronRussianRoulette(flags)
Definition: G4Optimizations.py:61
python.G4Optimizations.enableMuonFieldOnlyInCalo
def enableMuonFieldOnlyInCalo(flags)
Definition: G4Optimizations.py:34
python.G4Optimizations.disableTightMuonStepping
def disableTightMuonStepping(flags)
Definition: G4Optimizations.py:30
python.G4Optimizations.WoodcockTrackingInEMECPara
def WoodcockTrackingInEMECPara(flags)
Definition: G4Optimizations.py:178
python.G4Optimizations.enableFrozenShowersFCalOnly
def enableFrozenShowersFCalOnly(flags)
Definition: G4Optimizations.py:5
python.G4Optimizations.WoodcockTrackingInEMEC
def WoodcockTrackingInEMEC(flags)
Definition: G4Optimizations.py:169
python.G4Optimizations.disableEMRangeCuts
def disableEMRangeCuts(flags)
Definition: G4Optimizations.py:71
python.G4Optimizations.disableG4GammaGeneralProcess
def disableG4GammaGeneralProcess(flags)
Definition: G4Optimizations.py:83
python.G4Optimizations.enableNeutronRussianRoulette
def enableNeutronRussianRoulette(flags)
Definition: G4Optimizations.py:54
python.G4Optimizations.enableEMRangeCuts
def enableEMRangeCuts(flags)
Definition: G4Optimizations.py:66