6 from __future__
import print_function
9 The offset options. Dictionary of PDG IDs with offsets.
10 Anti-particles by definition have the same mass as standard particles.
13 PDG ID of SUSY constituent
14 Has an anti-particle (i.e. need to define a particle with an opposite-signed PDG ID)
16 Charge (for PDG table)
18 Mass Offset in the Pythia6 simulation configuration
19 8 mass options documented in the INT note of the stopped particle analysis:
20 https://cds.cern.ch/record/2665511
21 First 3 are the meson fits; 4th is the first specrum shifted to make the gluino R-glueball heaver
22 than the lightest R-mesons, but with the same relative splitting otherwise.
23 Second set of four follow the same pattern, but for the baryon fits.
25 The list of possible R-hadrons comes from the Pythia8 code, in src/RHadrons.cc (at the top)
31 1000005 : [ 0 ,
False ,
'~b ' , -1./3. , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 ] ,
32 1000006 : [ 0 ,
False ,
'~t ' , 2./3. , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 ] ,
33 1000021 : [ 0 ,
False ,
'~g ' , 0 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 ] ,
34 1000022 : [ 0 ,
False ,
'~chi10 ' , 0 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 ] ,
35 1000039 : [ 0 ,
False ,
'~Gr ' , 0 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 , 0.000 ] ,
37 1000993 : [ 1000021 ,
False ,
'~g_glueball ' , 0 , 0.700 , 0.700 , 0.700 , 0.700 , 0.700 , 0.700 , 0.700 , 0.700 , 0.700 ] ,
39 1009113 : [ 1000021 ,
False ,
'~g_rho ' , 0 , 0.650 , 0.610 , 0.403 , 0.717 , 0.000 , 0.717 , 0.403 , 0.717 , 0.000 ] ,
40 1009223 : [ 1000021 ,
False ,
'~g_omega ' , 0 , 0.650 , 0.610 , 0.403 , 0.717 , 0.000 , 0.717 , 0.403 , 0.717 , 0.000 ] ,
41 1009333 : [ 1000021 ,
False ,
'~g_phi ' , 0 , 1.800 , 0.924 , 0.828 , 1.074 , 0.000 , 1.054 , 0.828 , 1.074 , 0.000 ] ,
42 1009443 : [ 1000021 ,
False ,
'~g_J/Psi ' , 0 , 3.400 , 3.259 , 3.099 , 3.419 , 0.000 , 3.399 , 3.099 , 3.419 , 0.000 ] ,
43 1009553 : [ 1000021 ,
False ,
'~g_Upsilon ' , 0 , 9.460 , 9.460 , 9.460 ,11.000 , 0.000 , 9.460 , 9.460 ,11.000 ,10.000 ] ,
45 1009213 : [ 1000021 ,
True ,
'~g_rho+ ' , 1 , 0.650 , 0.610 , 0.403 , 0.717 , 0.000 , 0.717 , 0.403 , 0.717 , 0.000 ] ,
47 1009313 : [ 1000021 ,
True ,
'~g_K*0 ' , 0 , 0.825 , 0.768 , 0.620 , 0.891 , 0.000 , 0.886 , 0.620 , 0.891 , 0.000 ] ,
48 1009323 : [ 1000021 ,
True ,
'~g_K*+ ' , 1 , 0.825 , 0.768 , 0.620 , 0.891 , 0.000 , 0.886 , 0.620 , 0.891 , 0.000 ] ,
50 1009413 : [ 1000021 ,
True ,
'~g_D*+ ' , 1 , 2.000 , 1.940 , 1.843 , 2.067 , 0.000 , 2.062 , 1.843 , 2.067 , 0.000 ] ,
51 1009423 : [ 1000021 ,
True ,
'~g_D*0 ' , 0 , 2.000 , 1.940 , 1.843 , 2.067 , 0.000 , 2.062 , 1.843 , 2.067 , 0.000 ] ,
52 1009433 : [ 1000021 ,
True ,
'~g_D*s+ ' , 1 , 2.200 , 2.094 , 2.034 , 2.248 , 0.000 , 2.228 , 2.034 , 2.248 , 0.000 ] ,
54 1009513 : [ 1000021 ,
True ,
'~g_B*0 ' , 0 , 5.000 , 5.043 , 5.039 , 5.859 , 0.000 , 5.094 , 5.039 , 5.859 , 0.000 ] ,
55 1009523 : [ 1000021 ,
True ,
'~g_B*+ ' , 1 , 5.000 , 5.043 , 5.039 , 5.859 , 0.000 , 5.094 , 5.039 , 5.859 , 0.000 ] ,
56 1009533 : [ 1000021 ,
True ,
'~g_B*s0 ' , 0 , 5.200 , 5.195 , 5.195 , 6.039 , 0.000 , 5.259 , 5.195 , 6.039 , 0.000 ] ,
57 1009543 : [ 1000021 ,
True ,
'~g_B*c+ ' , 1 , 7.000 , 6.360 , 6.280 , 7.210 , 0.000 , 6.430 , 6.280 , 7.210 , 0.000 ] ,
59 1093214 : [ 1000021 ,
True ,
'~g_Lambda0 ' , 0 , 1.150 , 0.562 , 0.280 , 0.715 , 0.000 , 0.715 , 0.280 , 0.715 , 0.000 ] ,
61 1094214 : [ 1000021 ,
True ,
'~g_Sigmac*+ ' , 1 , 2.300 , 1.726 , 1.489 , 1.885 , 0.000 , 1.885 , 1.489 , 1.885 , 0.000 ] ,
62 1094314 : [ 1000021 ,
True ,
'~g_Xic*0 ' , 0 , 2.300 , 1.878 , 1.688 , 2.050 , 0.000 , 2.050 , 1.688 , 2.050 , 0.000 ] ,
63 1094324 : [ 1000021 ,
True ,
'~g_Xic*+ ' , 1 , 2.300 , 1.878 , 1.688 , 2.050 , 0.000 , 2.050 , 1.688 , 2.050 , 0.000 ] ,
65 1095214 : [ 1000021 ,
True ,
'~g_Sigmab*0 ' , 0 , 5.600 , 4.826 , 4.796 , 5.660 , 0.000 , 4.915 , 4.796 , 5.660 , 0.000 ] ,
66 1095314 : [ 1000021 ,
True ,
'~g_Xib*- ' , -1 , 5.750 , 4.978 , 4.970 , 5.840 , 0.000 , 5.080 , 4.970 , 5.840 , 0.000 ] ,
67 1095324 : [ 1000021 ,
True ,
'~g_Xib*0 ' , 0 , 5.750 , 4.978 , 4.970 , 5.840 , 0.000 , 5.080 , 4.970 , 5.840 , 0.000 ] ,
69 1091114 : [ 1000021 ,
True ,
'~g_Delta- ' , -1 , 0.975 , 0.812 , 0.530 , 0.965 , 0.000 , 0.965 , 0.530 , 0.965 , 0.000 ] ,
70 1092114 : [ 1000021 ,
True ,
'~g_Delta0 ' , 0 , 0.975 , 0.812 , 0.530 , 0.965 , 0.000 , 0.965 , 0.530 , 0.965 , 0.000 ] ,
71 1092214 : [ 1000021 ,
True ,
'~g_Delta+ ' , 1 , 0.975 , 0.812 , 0.530 , 0.965 , 0.000 , 0.965 , 0.530 , 0.965 , 0.000 ] ,
72 1092224 : [ 1000021 ,
True ,
'~g_Delta++ ' , 2 , 0.975 , 0.812 , 0.530 , 0.965 , 0.000 , 0.965 , 0.530 , 0.965 , 0.000 ] ,
74 1093114 : [ 1000021 ,
True ,
'~g_Sigma*- ' , -1 , 1.150 , 1.094 , 0.858 , 1.260 , 0.000 , 1.260 , 0.859 , 1.260 , 0.000 ] ,
75 1093224 : [ 1000021 ,
True ,
'~g_Sigma*+ ' , 1 , 1.150 , 1.094 , 0.858 , 1.260 , 0.000 , 1.260 , 0.859 , 1.260 , 0.000 ] ,
76 1093314 : [ 1000021 ,
True ,
'~g_Xi*- ' , -1 , 1.300 , 1.246 , 1.058 , 1.440 , 0.000 , 1.425 , 1.058 , 1.440 , 0.000 ] ,
77 1093324 : [ 1000021 ,
True ,
'~g_Xi*0 ' , 0 , 1.300 , 1.246 , 1.058 , 1.440 , 0.000 , 1.425 , 1.058 , 1.440 , 0.000 ] ,
78 1093334 : [ 1000021 ,
True ,
'~g_Omega- ' , -1 , 1.600 , 1.398 , 1.257 , 1.620 , 0.000 , 1.590 , 1.257 , 1.620 , 0.000 ] ,
80 1094114 : [ 1000021 ,
True ,
'~g_Sigmac*0 ' , 0 , 2.300 , 2.258 , 2.068 , 2.430 , 0.000 , 2.430 , 2.068 , 2.430 , 0.000 ] ,
81 1094224 : [ 1000021 ,
True ,
'~g_Sigmac*++' , 2 , 2.300 , 2.258 , 2.068 , 2.430 , 0.000 , 2.430 , 2.068 , 2.430 , 0.000 ] ,
82 1094334 : [ 1000021 ,
True ,
'~g_Omegac*0 ' , 0 , 2.300 , 2.562 , 2.466 , 2.790 , 0.000 , 2.760 , 2.466 , 2.790 , 0.000 ] ,
84 1095114 : [ 1000021 ,
True ,
'~g_Sigmab*- ' , -1 , 5.600 , 5.358 , 5.350 , 6.220 , 0.000 , 5.460 , 5.350 , 6.220 , 0.000 ] ,
85 1095224 : [ 1000021 ,
True ,
'~g_Sigmab*+ ' , 1 , 5.600 , 5.358 , 5.350 , 6.220 , 0.000 , 5.460 , 5.350 , 6.220 , 0.000 ] ,
86 1095334 : [ 1000021 ,
True ,
'~g_Omegab*- ' , -1 , 5.900 , 5.662 , 5.662 , 6.580 , 0.000 , 5.790 , 5.662 , 6.580 , 0.000 ] ,
89 1000512 : [ 1000005 ,
True ,
'~B0 ' , 0 , 0.325 , 0.314 , 0.220 , 0.365 , 0.000 , 0.365 , 0.220 , 0.365 , 0.000 ] ,
90 1000522 : [ 1000005 ,
True ,
'~B- ' , -1 , 0.325 , 0.314 , 0.220 , 0.365 , 0.000 , 0.365 , 0.220 , 0.365 , 0.000 ] ,
91 1000532 : [ 1000005 ,
True ,
'~Bs0 ' , 0 , 0.500 , 0.466 , 0.419 , 0.540 , 0.000 , 0.530 , 0.419 , 0.540 , 0.000 ] ,
92 1000542 : [ 1000005 ,
True ,
'~Bc- ' , -1 , 1.500 , 1.630 , 1.550 , 1.710 , 0.000 , 1.700 , 1.550 , 1.710 , 0.000 ] ,
93 1000552 : [ 1000005 ,
True ,
'~etab0 ' , 0 , 4.800 , 4.730 , 4.730 , 5.500 , 0.000 , 4.730 , 4.730 , 5.500 , 0.000 ] ,
95 1005113 : [ 1000005 ,
True ,
'~Sigmab- ' , -1 , 0.650 , 0.672 , 0.530 , 0.763 , 0.000 , 0.763 , 0.530 , 0.763 , 0.000 ] ,
96 1005211 : [ 1000005 ,
True ,
'~Sigmab0 ' , 0 , 0.650 , 0.496 , 0.171 , 0.632 , 0.000 , 0.632 , 0.171 , 0.632 , 0.000 ] ,
97 1005213 : [ 1000005 ,
True ,
'~Sigmab*0 ' , 0 , 0.650 , 0.672 , 0.530 , 0.763 , 0.000 , 0.763 , 0.530 , 0.763 , 0.000 ] ,
98 1005223 : [ 1000005 ,
True ,
'~Sigmab+ ' , 1 , 0.650 , 0.672 , 0.530 , 0.763 , 0.000 , 0.763 , 0.530 , 0.763 , 0.000 ] ,
99 1005311 : [ 1000005 ,
True ,
'~Xib- ' , -1 , 0.825 , 0.691 , 0.498 , 0.833 , 0.000 , 0.828 , 0.498 , 0.833 , 0.000 ] ,
100 1005313 : [ 1000005 ,
True ,
'~Xib*- ' , -1 , 0.825 , 0.810 , 0.686 , 0.922 , 0.000 , 0.917 , 0.686 , 0.922 , 0.000 ] ,
101 1005321 : [ 1000005 ,
True ,
'~Xib0 ' , 0 , 0.825 , 0.691 , 0.498 , 0.833 , 0.000 , 0.828 , 0.498 , 0.833 , 0.000 ] ,
102 1005323 : [ 1000005 ,
True ,
'~Xib*0 ' , 0 , 0.825 , 0.810 , 0.686 , 0.922 , 0.000 , 0.917 , 0.686 , 0.922 , 0.000 ] ,
103 1005333 : [ 1000005 ,
True ,
'~Omegab- ' , -1 , 1.000 , 0.952 , 0.863 , 1.095 , 0.000 , 1.075 , 0.863 , 1.095 , 0.000 ] ,
105 1000612 : [ 1000006 ,
True ,
'~T+ ' , 1 , 0.325 , 0.314 , 0.220 , 0.365 , 0.000 , 0.365 , 0.220 , 0.365 , 0.000 ] ,
106 1000622 : [ 1000006 ,
True ,
'~T0 ' , 0 , 0.325 , 0.314 , 0.220 , 0.365 , 0.000 , 0.365 , 0.220 , 0.365 , 0.000 ] ,
107 1000632 : [ 1000006 ,
True ,
'~Ts+ ' , 1 , 0.500 , 0.466 , 0.419 , 0.540 , 0.000 , 0.530 , 0.419 , 0.540 , 0.000 ] ,
108 1000642 : [ 1000006 ,
True ,
'~Tc0 ' , 0 , 1.500 , 1.630 , 1.550 , 1.710 , 0.000 , 1.700 , 1.550 , 1.710 , 0.000 ] ,
109 1000652 : [ 1000006 ,
True ,
'~etat+ ' , 1 , 4.800 , 4.730 , 4.730 , 5.500 , 0.000 , 4.730 , 4.730 , 5.500 , 0.000 ] ,
111 1006113 : [ 1000006 ,
True ,
'~Sigmat0 ' , 0 , 0.650 , 0.672 , 0.530 , 0.763 , 0.000 , 0.763 , 0.530 , 0.763 , 0.000 ] ,
112 1006211 : [ 1000006 ,
True ,
'~Sigmat+ ' , 1 , 0.650 , 0.496 , 0.171 , 0.632 , 0.000 , 0.632 , 0.171 , 0.632 , 0.000 ] ,
113 1006213 : [ 1000006 ,
True ,
'~Sigmat*+ ' , 1 , 0.650 , 0.672 , 0.530 , 0.763 , 0.000 , 0.763 , 0.530 , 0.763 , 0.000 ] ,
114 1006223 : [ 1000006 ,
True ,
'~Sigmat++ ' , 2 , 0.650 , 0.672 , 0.530 , 0.763 , 0.000 , 0.763 , 0.530 , 0.763 , 0.000 ] ,
115 1006311 : [ 1000006 ,
True ,
'~Xit0 ' , 0 , 0.825 , 0.691 , 0.498 , 0.833 , 0.000 , 0.828 , 0.498 , 0.833 , 0.000 ] ,
116 1006313 : [ 1000006 ,
True ,
'~Xit*0 ' , 0 , 0.825 , 0.810 , 0.686 , 0.922 , 0.000 , 0.917 , 0.686 , 0.922 , 0.000 ] ,
117 1006321 : [ 1000006 ,
True ,
'~Xit+ ' , 1 , 0.825 , 0.691 , 0.498 , 0.833 , 0.000 , 0.828 , 0.498 , 0.833 , 0.000 ] ,
118 1006323 : [ 1000006 ,
True ,
'~Xit*+ ' , 1 , 0.825 , 0.810 , 0.686 , 0.922 , 0.000 , 0.917 , 0.686 , 0.922 , 0.000 ] ,
119 1006333 : [ 1000006 ,
True ,
'~Omegat0 ' , 0 , 1.000 , 0.952 , 0.863 , 1.095 , 0.000 , 1.075 , 0.863 , 1.095 , 0.000 ] ,
124 gb_offset = offset_options[1009113][first_mass_set+5]-offset_options[1009113][first_mass_set+1]
125 for pid
in offset_options:
127 if offset_options[pid][0] == 0
or pid == 1000993:
continue
129 offset_options[pid][first_mass_set+4] = offset_options[pid][first_mass_set+1]+gb_offset
131 offset_options[pid][first_mass_set+8] = offset_options[pid][first_mass_set+5]-gb_offset
136 """ Function to return a PDG table formatted charge given an integer charge
137 Input is the charge either as a string or number
143 if n==-1:
return ' -'
144 if n==-2:
return '--'
145 raise RuntimeError(
'Unexpected charge: '+
str(n))
149 """ Function to return a list of quarks in a hadron
153 if '000' in str(x):
return str(x)[5:6]
155 if '00' in str(x):
return str(x)[4:6]
163 if '009' in str(x): b_n=0
164 elif '09' in str(x): b_n=1
165 elif '0006' in str(x): b_n=0
166 elif '0005' in str(x): b_n=0
167 elif '006' in str(x): b_n=1
168 elif '005' in str(x): b_n=1
170 raise RuntimeError(
'is_baryon ERROR Unknown PDG ID: '+
str(x))
171 if int(x)<0:
return -b_n
176 """ Function to turn a particle name into an anti-particle name (mostly charge issues)
179 if '*+' in x:
return x.replace(
'*',
'bar*').
replace(
'+',
'-')
180 if '*-' in x:
return x.replace(
'*',
'bar*').
replace(
'-',
'+')
181 if '++' in x:
return x.replace(
'++',
'bar--')
182 if '--' in x:
return x.replace(
'--',
'bar++')
183 if '+' in x:
return x.replace(
'+',
'bar-')
184 if '-' in x:
return x.replace(
'-',
'bar+')
185 if '*0' in x:
return x.replace(
'*0',
'bar*0')
186 return x.replace(
'0',
'bar0')
190 """ Function to return a dictionary of PDG IDs and masses based on an input param/SLHA/LHE file
191 First parameter: input file (string or file handle)
192 Second parameter: mass spectrum (enumeration value)
195 if isinstance(input_file, str):
196 in_file =
open(input_file,
'r')
203 for l
in in_file.readlines():
209 elif not mass_block:
continue
211 if 'BLOCK' in l.upper().
split(
'#')[0].
split():
break
213 if len(l.split(
'#')[0].
split())<2:
continue
214 pdg_id =
int(l.split(
'#')[0].
split()[0])
216 if pdg_id
in offset_options:
219 if mass > 7e3:
continue
221 masses[pdg_id] = mass
224 if isinstance(input_file, str):
229 for pid
in offset_options:
231 if offset_options[pid][0] == 0:
continue
233 if offset_options[pid][0]
not in masses:
continue
235 if mass_spectrum<0
or first_mass_set+mass_spectrum>len(offset_options[pid]):
236 raise RuntimeError(
"Unknown mass set requested: "+
str(mass_spectrum)+
" > number of options ("+
str(len(offset_options[pid])-first_mass_set+1)+
") for PID "+
str(pid))
238 masses[pid] = masses[ offset_options[pid][0] ] + offset_options[pid][first_mass_set+mass_spectrum]
240 if offset_options[pid][1]:
241 masses[-pid] = masses[ offset_options[pid][0] ] + offset_options[pid][first_mass_set+mass_spectrum]
246 raise RuntimeError(
'No R-hadrons generated!')
253 """ Function to update a PDG table with R-hadron masses
254 First input parameter: input file (string or file handle)
255 Second input parameter: output PDG table (string or file handle)
256 Third input parameter: mass spectrum (enumeration value)
257 Gets R-hadron masses based on get_gluino_Rhadron_masses()
265 if isinstance(pdg_table, str):
266 lines =
open(pdg_table).readlines()
268 lines = pdg_table.readlines()
278 lines.append(
'M %i %11.7E +0.0E+00 -0.0E+00 %s %s'%(pid,masses[pid]*1000.,offset_options[pid][2],
charge(offset_options[pid][3])) +
'\n')
279 lines.append(
'W %i %11.7E +0.0E+00 -0.0E+00 %s %s'%(pid,0.E+00,offset_options[pid][2],
charge(offset_options[pid][3])) +
'\n')
281 update =
open(
'PDGTABLE.MeV',
'w')
282 update.write(
''.
join(lines))
285 from ExtraParticles.PDGHelpers
import updateExtraParticleAcceptList
291 """ Function to update a particle table with R-hadron masses
292 First input parameter: input file (string or file handle)
293 Second input parameter: output particle table (string or file handle)
294 Third input parameter: mass spectrum (enumeration value)
295 Gets R-hadron masses based on get_gluino_Rhadron_masses()
301 if isinstance (particle_table, str):
302 out_file =
open(particle_table,
'a')
304 out_file = particle_table
310 if offset_options[abs(pid)][0]==0: extras += [pid]
311 elif not offset_options[abs(pid)][0]
in primaries: primaries += [ offset_options[abs(pid)][0] ]
318 if p>0: out_file.write(
' %i %04.3f # %s\n'%(p,masses[p],offset_options[abs(p)][2]))
320 else: out_file.write(
' %i %04.3f # %s\n'%(p,masses[p],
anti_name(offset_options[abs(p)][2])))
323 if offset_options[abs(pid)][0]!=p:
continue
327 if pid>0: out_file.write(
' %i %04.3f # %s\n'%(pid,masses[pid],offset_options[abs(pid)][2]))
329 else: out_file.write(
' %i %04.3f # %s\n'%(pid,masses[pid],
anti_name(offset_options[abs(pid)][2])))
333 if p
in primaries:
continue
334 if p>0: out_file.write(
' %i %04.3f # %s\n'%(p,masses[p],offset_options[abs(p)][2]))
336 else: out_file.write(
' %i %04.3f # %s\n'%(p,masses[p],
anti_name(offset_options[abs(p)][2])))
339 if isinstance(particle_table, str):
346 """ Function to return a list of Pythia8 commands to set up an R-hadron mass spectrum.
347 First input parameter: input file (string or file handle)
348 Second input parameter: mass spectrum (enumeration value)
353 commands = [
'RHadrons:setMasses = off']
360 commands += [
str(pid)+
':m0 = '+
str(masses[pid]) ]
367 """ Function to write all possible interactiosn that we need
368 First input parameter: input file (string or file handle)
369 Second input parameter: output PDG table (string or file handle)
370 Third input parameter: mass spectrum (enumeration value)
371 Gets R-hadron masses based on get_gluino_Rhadron_masses()
377 if isinstance (interaction_file, str):
378 out_file =
open(interaction_file,
'a')
380 out_file = interaction_file
385 'pi0' : [ 0 , 0 , 0 ],
386 'pi+' : [ 1 , 0 , 0 ],
387 'pi-' : [ -1 , 0 , 0 ],
388 'neutron' : [ 0 , 1 , 0 ],
389 'proton' : [ 1 , 1 , 0 ],
390 'kaon0' : [ 0 , 0 , 1 ],
391 'anti_kaon0' : [ 0 , 0 , -1 ],
392 'kaon+' : [ 1 , 0 , 1 ],
393 'kaon-' : [ -1 , 0 , -1 ]
395 targets = [
'proton' ,
'neutron' ]
397 incoming_rhadrons = {}
398 outgoing_rhadrons = {}
401 if offset_options[abs(pid)][0]==0:
continue
408 if '3' in my_q
or '4' in my_q
or '5' in my_q:
411 s_number = -(my_q.count(
'3')-my_q.count(
'4')+my_q.count(
'5'))
if pid>0
else my_q.count(
'3')-my_q.count(
'4')+my_q.count(
'5')
412 elif len(my_q)>1
and '9' in str(pid):
414 if my_q
in [
'33',
'44',
'55',
'35']: s_number=0
416 elif my_q
in [
'43',
'53']: s_number = 2
if pid>0
else -2
418 elif offset_options[abs(pid)][3]==0
and (
'3' in my_q
or '5' in my_q): s_number=1
if pid>0
else -1
419 elif offset_options[abs(pid)][3]==0
and '4' in my_q: s_number=1
if pid<0
else -1
421 elif '3' in my_q
or '5' in my_q: s_number=offset_options[abs(pid)][3]
422 elif '4' in my_q: s_number=-offset_options[abs(pid)][3]
425 s_number = -(my_q.count(
'3')-my_q.count(
'4')+my_q.count(
'5'))
if pid>0
else my_q.count(
'3')-my_q.count(
'4')+my_q.count(
'5')
428 s_number = my_q.count(
'3') - my_q.count(
'4') + my_q.count(
'5')
429 s_number = s_number
if pid>0
else -s_number
432 pid_name = offset_options[pid][2].strip()
if pid>0
else anti_name(offset_options[abs(pid)][2]).strip()
433 charge = offset_options[abs(pid)][3]
if pid>0
else -offset_options[abs(pid)][3]
434 incoming_rhadrons[pid_name] = [ charge ,
is_baryon(pid) , s_number ]
437 if '4' in my_q
or '5' in my_q:
continue
438 outgoing_rhadrons[pid_name] = [ charge ,
is_baryon(pid) , s_number ]
441 for proj
in incoming_rhadrons:
445 for orhad
in outgoing_rhadrons:
447 for osm1
in sm_particles:
449 total_charge = incoming_rhadrons[proj][0]+sm_particles[t][0]-outgoing_rhadrons[orhad][0]-sm_particles[osm1][0]
451 total_bnumber = incoming_rhadrons[proj][1]+sm_particles[t][1]-outgoing_rhadrons[orhad][1]-sm_particles[osm1][1]
453 total_snumber = incoming_rhadrons[proj][2]+sm_particles[t][2]-outgoing_rhadrons[orhad][2]-sm_particles[osm1][2]
455 if total_charge==0
and total_bnumber==0
and total_snumber==0:
458 for osm2
in sm_particles:
460 total_charge = incoming_rhadrons[proj][0]+sm_particles[t][0]-outgoing_rhadrons[orhad][0]-sm_particles[osm1][0]-sm_particles[osm2][0]
462 total_bnumber = incoming_rhadrons[proj][1]+sm_particles[t][1]-outgoing_rhadrons[orhad][1]-sm_particles[osm1][1]-sm_particles[osm2][1]
464 total_snumber = incoming_rhadrons[proj][2]+sm_particles[t][2]-outgoing_rhadrons[orhad][2]-sm_particles[osm1][2]-sm_particles[osm2][2]
466 if total_charge==0
and total_bnumber==0
and total_snumber==0:
476 if isinstance(interaction_file, str):
483 """ Print the mass spectra.
484 Input parameter: spectrum number. If -1, print all spectra.
486 for i
in sorted(offset_options.keys()):
487 s=
str(offset_options[i][2])+
' '+
str(i)
489 from past.builtins
import range
490 for j
in range(first_mass_set,len(offset_options[i])): s+=
' '+
str(offset_options[i][j])
492 if first_mass_set+spectrum>len(offset_options[i]):
493 raise RuntimeError(
'Spectrum #'+
str(spectrum)+
' not known for PID '+
str(i))
495 s+=
' '+
str(offset_options[i][spectrum+first_mass_set])