366 """ Function to write all possible interactiosn that we need
367 First input parameter: input file (string or file handle)
368 Second input parameter: output PDG table (string or file handle)
369 Third input parameter: mass spectrum (enumeration value)
370 Gets R-hadron masses based on get_gluino_Rhadron_masses()
376 if isinstance (interaction_file, str):
377 out_file =
open(interaction_file,
'a')
379 out_file = interaction_file
384 'pi0' : [ 0 , 0 , 0 ],
385 'pi+' : [ 1 , 0 , 0 ],
386 'pi-' : [ -1 , 0 , 0 ],
387 'neutron' : [ 0 , 1 , 0 ],
388 'proton' : [ 1 , 1 , 0 ],
389 'kaon0' : [ 0 , 0 , 1 ],
390 'anti_kaon0' : [ 0 , 0 , -1 ],
391 'kaon+' : [ 1 , 0 , 1 ],
392 'kaon-' : [ -1 , 0 , -1 ]
394 targets = [
'proton' ,
'neutron' ]
396 incoming_rhadrons = {}
397 outgoing_rhadrons = {}
400 if offset_options[abs(pid)][0]==0:
continue
407 if '3' in my_q
or '4' in my_q
or '5' in my_q:
410 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')
411 elif len(my_q)>1
and '9' in str(pid):
413 if my_q
in [
'33',
'44',
'55',
'35']: s_number=0
415 elif my_q
in [
'43',
'53']: s_number = 2
if pid>0
else -2
417 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
418 elif offset_options[abs(pid)][3]==0
and '4' in my_q: s_number=1
if pid<0
else -1
420 elif '3' in my_q
or '5' in my_q: s_number=offset_options[abs(pid)][3]
421 elif '4' in my_q: s_number=-offset_options[abs(pid)][3]
424 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')
427 s_number = my_q.count(
'3') - my_q.count(
'4') + my_q.count(
'5')
428 s_number = s_number
if pid>0
else -s_number
431 pid_name = offset_options[pid][2].strip()
if pid>0
else anti_name(offset_options[abs(pid)][2]).strip()
432 charge = offset_options[abs(pid)][3]
if pid>0
else -offset_options[abs(pid)][3]
433 incoming_rhadrons[pid_name] = [ charge ,
is_baryon(pid) , s_number ]
436 if '4' in my_q
or '5' in my_q:
continue
437 outgoing_rhadrons[pid_name] = [ charge ,
is_baryon(pid) , s_number ]
440 for proj
in incoming_rhadrons:
444 for orhad
in outgoing_rhadrons:
446 for osm1
in sm_particles:
448 total_charge = incoming_rhadrons[proj][0]+sm_particles[t][0]-outgoing_rhadrons[orhad][0]-sm_particles[osm1][0]
450 total_bnumber = incoming_rhadrons[proj][1]+sm_particles[t][1]-outgoing_rhadrons[orhad][1]-sm_particles[osm1][1]
452 total_snumber = incoming_rhadrons[proj][2]+sm_particles[t][2]-outgoing_rhadrons[orhad][2]-sm_particles[osm1][2]
454 if total_charge==0
and total_bnumber==0
and total_snumber==0:
457 for osm2
in sm_particles:
459 total_charge = incoming_rhadrons[proj][0]+sm_particles[t][0]-outgoing_rhadrons[orhad][0]-sm_particles[osm1][0]-sm_particles[osm2][0]
461 total_bnumber = incoming_rhadrons[proj][1]+sm_particles[t][1]-outgoing_rhadrons[orhad][1]-sm_particles[osm1][1]-sm_particles[osm2][1]
463 total_snumber = incoming_rhadrons[proj][2]+sm_particles[t][2]-outgoing_rhadrons[orhad][2]-sm_particles[osm1][2]-sm_particles[osm2][2]
465 if total_charge==0
and total_bnumber==0
and total_snumber==0:
475 if isinstance(interaction_file, str):