3 from AthenaConfiguration.AccumulatorCache
import AccumulatorCache
5 from AthenaConfiguration.ComponentFactory
import CompFactory
6 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
7 from AthenaConfiguration.Enums
import ProductionStep
8 from ExtraParticles.PDGHelpers
import getPDGTABLE
14 ALINE1=
"M 4110000 {intmass}.E+03 +0.0E+00 -0.0E+00 Monopole 0".
format(intmass=
int(MASS))
15 ALINE2=
"W 4110000 0.E+00 +0.0E+00 -0.0E+00 Monopole 0"
16 BLINE1=
"4110000 {intmass}.00 0.0 {gcharge} # Monopole".
format(intmass=
int(MASS), gcharge=GCHARGE)
17 BLINE2=
"-4110000 {intmass}.00 0.0 -{gcharge} # MonopoleBar".
format(intmass=
int(MASS), gcharge=GCHARGE)
19 f=
open(
'PDGTABLE.MeV',
'a')
20 f.writelines(
str(ALINE1))
22 f.writelines(
str(ALINE2))
25 partmod = os.path.isfile(
'particles.txt')
27 os.remove(
'particles.txt')
28 f=
open(
'particles.txt',
'w')
29 f.writelines(
str(BLINE1))
31 f.writelines(
str(BLINE2))
46 ALINE1=
"M {code} {intmass}.E+03 +0.0E+00 -0.0E+00 Qball +".
format(code=CODE,intmass=
int(MASS))
47 ALINE2=
"W {code} 0.E+00 +0.0E+00 -0.0E+00 Qball +".
format(code=CODE)
48 BLINE1=
"{code} {intmass}.00 {charge} 0.0 # Qball".
format(code=CODE,intmass=
int(MASS), charge=CHARGE)
49 BLINE2=
"-{code} {intmass}.00 -{charge} 0.0 # QballBar".
format(code=CODE,intmass=
int(MASS), charge=CHARGE)
51 f=
open(
'PDGTABLE.MeV',
'a')
52 f.writelines(
str(ALINE1))
54 f.writelines(
str(ALINE2))
57 partmod = os.path.isfile(
'particles.txt')
59 os.remove(
'particles.txt')
60 f=
open(
'particles.txt',
'w')
61 f.writelines(
str(BLINE1))
63 f.writelines(
str(BLINE2))
76 print(
"Trying to load %s, %s for particle with code %s" % (X, Y, CODE))
78 pdgLine1=
"M {code} {intmass}.E+03 +0.0E+00 -0.0E+00 fcp +\n".
format(code=CODE,intmass=
int(MASS))
79 pdgLine2=
"W {code} 0.E+00 +0.0E+00 -0.0E+00 fcp +\n".
format(code=CODE)
80 particleLine1=
"{code} {intmass}.00 {fcharge} 0.0 # fcp\n".
format(code=CODE,intmass=
int(MASS), fcharge=
float(CHARGE))
81 particleLine2=
"-{code} {intmass}.00 -{fcharge} 0.0 # fcpBar\n".
format(code=CODE,intmass=
int(MASS), fcharge=
float(CHARGE))
85 f=
open(
'PDGTABLE.MeV',
'a')
86 f.writelines(
str(pdgLine1))
87 f.writelines(
str(pdgLine2))
89 partmod = os.path.isfile(
'particles.txt')
91 os.remove(
'particles.txt')
92 f=
open(
'particles.txt',
'w')
93 f.writelines(
str(particleLine1))
94 f.writelines(
str(particleLine2))
105 result.setPrivateTools( CompFactory.MonopolePhysicsTool(name, **kwargs) )
111 result.setPrivateTools( CompFactory.G4mplEqMagElectricFieldTool(name, **kwargs) )
116 simdict = flags.Input.SpecialConfiguration
117 if flags.Common.ProductionStep == ProductionStep.Simulation:
119 flags.Sim.OptionalUserActionList += [
'G4UserActions.G4UserActionsConfig.MonopoleLooperKillerToolCfg']
121 flags.Sim.OptionalUserActionList += [
'G4UserActions.G4UserActionsConfig.HIPKillerToolCfg']
122 if "InteractingPDGCodes" not in simdict:
123 assert "CHARGE" in simdict
124 assert "X" in simdict
125 assert "Y" in simdict
126 CODE=
int(20000000)+
int(simdict[
"X"])*1000+
int(simdict[
"Y"])*10
127 simdict[
'InteractingPDGCodes'] =
str([CODE,-1*CODE])
128 flags.Input.SpecialConfiguration = simdict
133 if flags.Common.ProductionStep == ProductionStep.Simulation:
134 from G4AtlasServices.G4AtlasServicesConfig
import PhysicsListSvcCfg
137 simdict = flags.Input.SpecialConfiguration
139 pdgcodes = eval(simdict[
'InteractingPDGCodes'])
if 'InteractingPDGCodes' in simdict
else []
140 from ExtraParticles.PDGHelpers
import updateExtraParticleAcceptList
143 if flags.Common.ProductionStep == ProductionStep.Simulation:
145 result.getService(
"PhysicsListSvc").PhysOption += physicsOptions
155 simdict = flags.Input.SpecialConfiguration
156 if flags.Common.ProductionStep == ProductionStep.Simulation:
158 flags.Sim.OptionalUserActionList += [
'G4UserActions.G4UserActionsConfig.MonopoleLooperKillerToolCfg']
160 flags.Sim.OptionalUserActionList += [
'G4UserActions.G4UserActionsConfig.HIPKillerToolCfg']
161 if "InteractingPDGCodes" not in simdict:
162 assert "CHARGE" in simdict
163 CODE=10000000+
int(
float(simdict[
"CHARGE"])*100)
164 simdict[
'InteractingPDGCodes'] =
str([CODE,-1*CODE])
165 flags.Input.SpecialConfiguration = simdict
170 simdict = flags.Input.SpecialConfiguration
171 if flags.Common.ProductionStep == ProductionStep.Simulation:
172 from G4AtlasServices.G4AtlasServicesConfig
import PhysicsListSvcCfg
174 if "InteractingPDGCodes" not in simdict:
175 assert "CHARGE" in simdict
176 CODE=10000000+
int(
float(simdict[
"CHARGE"])*100)
177 simdict[
'InteractingPDGCodes'] =
str([CODE,-1*CODE])
179 assert "MASS" in simdict
180 assert "CHARGE" in simdict
182 pdgcodes = eval(simdict[
'InteractingPDGCodes'])
if 'InteractingPDGCodes' in simdict
else []
183 from ExtraParticles.PDGHelpers
import updateExtraParticleAcceptList
186 if flags.Common.ProductionStep == ProductionStep.Simulation:
188 result.getService(
"PhysicsListSvc").PhysOption += physicsOptions
194 if flags.Common.ProductionStep == ProductionStep.Simulation:
196 flags.Sim.OptionalUserActionList += [
'G4UserActions.G4UserActionsConfig.MonopoleLooperKillerToolCfg']
198 flags.Sim.OptionalUserActionList += [
'G4UserActions.G4UserActionsConfig.HIPKillerToolCfg']
199 flags.Sim.G4Stepper =
'ClassicalRK4'
200 flags.Sim.G4EquationOfMotion =
"G4mplEqMagElectricField"
201 flags.Sim.TightMuonStepping =
False
202 simdict = flags.Input.SpecialConfiguration
203 if "InteractingPDGCodes" not in simdict:
204 simdict[
'InteractingPDGCodes'] =
str([4110000,-4110000])
205 flags.Input.SpecialConfiguration = simdict
210 if flags.Common.ProductionStep == ProductionStep.Simulation:
211 from G4AtlasServices.G4AtlasServicesConfig
import PhysicsListSvcCfg
214 simdict = flags.Input.SpecialConfiguration
215 assert "MASS" in simdict
216 assert "GCHARGE" in simdict
218 pdgcodes = eval(simdict[
'InteractingPDGCodes'])
if 'InteractingPDGCodes' in simdict
else []
219 from ExtraParticles.PDGHelpers
import updateExtraParticleAcceptList
222 if flags.Common.ProductionStep == ProductionStep.Simulation:
223 from GaudiKernel.GaudiHandles
import PrivateToolHandleArray
225 result.getService(
"PhysicsListSvc").PhysOption = physicsOptions + result.getService(
"PhysicsListSvc").PhysOption
230 kwargs.setdefault('TargetEvent',1)
231 kwargs.setdefault(
'VerboseLevel',1)
232 kwargs.setdefault(
'TargetPdgIDs',
236 from G4DebuggingTools.G4DebuggingToolsConfig
import VerboseSelectorToolCfg