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