3 from AthenaConfiguration.AccumulatorCache
import AccumulatorCache
5 from AthenaConfiguration.ComponentFactory
import CompFactory
6 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
8 from AthenaConfiguration.Enums
import ProductionStep
9 from ExtraParticles.PDGHelpers
import getPDGTABLE
17 shutil.move(
'PDGTABLE.MeV',
'PDGTABLE.MeV.org')
22 lines =
open(
'PDGTABLE.MeV.org').readlines()
23 for pdgid,mass,name,charge
in replace:
24 if not re.search(
r'[MW]\s+'+
str(pdgid)+
r'\s+\S+',
''.
join(lines)):
25 lines.append(
'M' +
str(pdgid).rjust(8) +
''.ljust(26) +
26 (
'%11.5E' % mass).ljust(15) +
27 '+0.0E+00'.ljust(9) +
'-0.0E+00'.ljust(9) +
28 name.strip() +
''.ljust(6) + charge.strip()+
''.rjust(20-len(name.strip())) +
'\n')
29 lines.append(
'W' +
str(pdgid).rjust(8) +
''.ljust(26) +
30 '0.E+00'.ljust(15) +
'+0.0E+00'.ljust(9) +
'-0.0E+00'.ljust(9) +
31 name.strip() +
''.ljust(6) + charge.strip()+
''.rjust(20-len(name.strip())) +
'\n')
33 from past.builtins
import xrange
34 for i
in xrange(len(lines)):
35 if re.search(
r'M\s+'+
str(pdgid)+
r'\s+\S+', lines[i]):
37 lines[i] = l[0:35] + (
'%11.5E' % mass).ljust(14) + l[49:]
39 update =
open(
'PDGTABLE.MeV',
'w')
40 update.write(
''.
join(lines))
47 C1Mass = eval(flags.Input.SpecialConfiguration.get(
"AMSBC1Mass",
None))
48 N1Mass = eval(flags.Input.SpecialConfiguration.get(
"AMSBN1Mass",
None))
49 C1Lifetime = eval(flags.Input.SpecialConfiguration.get(
"AMSBC1Lifetime",
"-1.0"))
51 kwargs.setdefault(
"CharginoPlusMass", C1Mass)
52 kwargs.setdefault(
"CharginoPlusStable", (C1Lifetime < 0))
53 if not (C1Lifetime < 0):
54 kwargs.setdefault(
"CharginoPlusLifetime", C1Lifetime)
56 kwargs.setdefault(
"CharginoMinusMass", C1Mass)
57 kwargs.setdefault(
"CharginoMinusStable", (C1Lifetime < 0))
58 if not (C1Lifetime < 0):
59 kwargs.setdefault(
"CharginoMinusLifetime", C1Lifetime)
61 kwargs.setdefault(
"NeutralinoMass", N1Mass)
63 result.setPrivateTools(CompFactory.CharginosPhysicsTool(name, **kwargs))
70 C1ToEleBR = eval(flags.Input.SpecialConfiguration.get(
"AMSBC1ToEleBR",
"-1.0"))
73 C1ToMuBR = eval(flags.Input.SpecialConfiguration.get(
"AMSBC1ToMuBR",
"-1.0"))
76 kwargs.setdefault(
"ParticleName",
"s_chi_plus_1")
77 kwargs.setdefault(
"BR",C1ToPiBR)
78 kwargs.setdefault(
"Daughters",
"s_chi_0_1,pi+")
79 result.setPrivateTools(CompFactory.AddPhysicsDecayTool(name, **kwargs))
86 C1ToEleBR = eval(flags.Input.SpecialConfiguration.get(
"AMSBC1ToEleBR",
"-1.0"))
89 C1ToMuBR = eval(flags.Input.SpecialConfiguration.get(
"AMSBC1ToMuBR",
"-1.0"))
92 kwargs.setdefault(
"ParticleName",
"s_chi_minus_1")
93 kwargs.setdefault(
"BR",C1ToPiBR)
94 kwargs.setdefault(
"Daughters",
"s_chi_0_1,pi-")
95 result.setPrivateTools(CompFactory.AddPhysicsDecayTool(name, **kwargs))
102 C1ToEleBR = eval(flags.Input.SpecialConfiguration.get(
"AMSBC1ToEleBR",
"-1.0"))
105 kwargs.setdefault(
"ParticleName",
"s_chi_plus_1")
106 kwargs.setdefault(
"BR",C1ToEBR)
107 kwargs.setdefault(
"Daughters",
"s_chi_0_1,nu_e,e+")
108 result.setPrivateTools(CompFactory.AddPhysicsDecayTool(name, **kwargs))
115 C1ToEleBR = eval(flags.Input.SpecialConfiguration.get(
"AMSBC1ToEleBR",
"-1.0"))
118 kwargs.setdefault(
"ParticleName",
"s_chi_minus_1")
119 kwargs.setdefault(
"BR",C1ToEBR)
120 kwargs.setdefault(
"Daughters",
"s_chi_0_1,anti_nu_e,e-")
121 result.setPrivateTools(CompFactory.AddPhysicsDecayTool(name, **kwargs))
128 C1ToMuBR = eval(flags.Input.SpecialConfiguration.get(
"AMSBC1ToMuBR",
"-1.0"))
130 C1ToMuonBR = C1ToMuBR
131 kwargs.setdefault(
"ParticleName",
"s_chi_plus_1")
132 kwargs.setdefault(
"BR",C1ToMuonBR)
133 kwargs.setdefault(
"Daughters",
"s_chi_0_1,nu_mu,mu+")
134 result.setPrivateTools(CompFactory.AddPhysicsDecayTool(name, **kwargs))
141 C1ToMuBR = eval(flags.Input.SpecialConfiguration.get(
"AMSBC1ToMuBR",
"-1.0"))
143 C1ToMuonBR = C1ToMuBR
144 kwargs.setdefault(
"ParticleName",
"s_chi_minus_1")
145 kwargs.setdefault(
"BR",C1ToMuonBR)
146 kwargs.setdefault(
"Daughters",
"s_chi_0_1,anti_nu_mu,mu-")
147 result.setPrivateTools(CompFactory.AddPhysicsDecayTool(name, **kwargs))
153 if flags.Common.ProductionStep == ProductionStep.Simulation:
154 from G4AtlasServices.G4AtlasServicesConfig
import PhysicsListSvcCfg
156 C1Mass = eval(flags.Input.SpecialConfiguration[
"AMSBC1Mass"])
157 N1Mass = eval(flags.Input.SpecialConfiguration[
"AMSBN1Mass"])
160 from ExtraParticles.PDGHelpers
import updateExtraParticleAcceptList
162 if flags.Common.ProductionStep == ProductionStep.Simulation:
165 C1Lifetime = eval(flags.Input.SpecialConfiguration.get(
"AMSBC1Lifetime",
"-1.0"))
169 C1ToEleBR = eval(flags.Input.SpecialConfiguration.get(
"AMSBC1ToEleBR",
"-1.0"))
173 C1ToMuBR = eval(flags.Input.SpecialConfiguration.get(
"AMSBC1ToMuBR",
"-1.0"))
177 result.getService(
"PhysicsListSvc").PhysOption += physicsOptions
183 kwargs.setdefault('TargetEvent',1)
184 kwargs.setdefault(
'VerboseLevel',1)
185 kwargs.setdefault(
'TargetPdgIDs',
190 from G4DebuggingTools.G4DebuggingToolsConfig
import VerboseSelectorToolCfg