the kinematic is OK, need to add DWBA

This commit is contained in:
Ryan@fsunuc 2022-12-09 13:15:32 -05:00
commit 076652e9f1
13 changed files with 538 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
files/*
!files/.gitkeep

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "digios"]
path = digios
url = https://github.com/calemhoffman/digios.git

1
Armory Symbolic link
View File

@ -0,0 +1 @@
digios/analysis/Armory

1
Cleopatra Symbolic link
View File

@ -0,0 +1 @@
digios/analysis/Cleopatra

127
Simulation_gateway.py Executable file
View File

@ -0,0 +1,127 @@
#!/usr/bin/env /usr/bin/python3
import cgi, os
import cgitb
import subprocess
cgitb.enable()
form = cgi.FieldStorage()
fn1=""
fn2=""
fn3=""
fn4=""
fn5=""
message1=""
message2=""
message3=""
message4=""
fileitem = form['filename1']
if fileitem.filename:
fn1 = os.path.basename(fileitem.filename)
if fn1.endswith('.txt') :
open('files/' + fn1, 'wb').write(fileitem.file.read())
message1 = 'The file "' + fn1 + '" was uploaded successfully'
else:
message1 = 'Need to be a txt file'
fn1 = ""
else:
message1 = 'No file was uploaded'
fileitem = form['filename2']
if fileitem.filename:
fn2 = os.path.basename(fileitem.filename)
if fn2.endswith('.txt') :
open('files/' + fn2, 'wb').write(fileitem.file.read())
message2 = 'The file "' + fn2 + '" was uploaded successfully'
else:
message2 = 'Need to be a txt file'
fn2 = ""
else:
message2 = 'No file was uploaded'
fileitem = form['filename3']
if fileitem.filename:
fn3 = os.path.basename(fileitem.filename)
if fn3.endswith('.txt') :
open('files/' + fn3, 'wb').write(fileitem.file.read())
message3 = 'The file "' + fn3 + '" was uploaded successfully'
else:
message3 = 'Need to be a txt file'
fn3 = ""
else:
message3 = 'No file was uploaded'
fileitem = form['filename4']
if fileitem.filename:
fn4 = os.path.basename(fileitem.filename)
if fn4.endswith('') :
open('files/' + fn4, 'wb').write(fileitem.file.read())
message4 = 'The file "' + fn4 + '" was uploaded successfully'
else:
message4 = 'Need to be empty extension file'
fn4 = ""
else:
message4 = 'No file was uploaded'
fileitem = form['filename5']
if fileitem.filename:
fn5 = os.path.basename(fileitem.filename)
if fn5.endswith('.txt') :
open('files/' + fn5, 'wb').write(fileitem.file.read())
message5 = 'The file "' + fn5 + '" was uploaded successfully'
else:
message5 = 'Need to be a txt file'
fn5 = ""
else:
message5 = 'No file was uploaded'
##change to files directory
os.chdir(r"files")
pngName=""
result=""
haha=""
dwba_1=""
dwba_2=""
#------- if only DWBA
if fn4!="" :
dwba_1 = subprocess.run(["../Cleopatra/InFileCreator", fn4, "0", "180", "0.1"] , stdout=subprocess.PIPE).stdout.decode('utf-8')
#result = dwbs_1.find('.in')
#dwba_2 = subprocess.run(["../Cleopatra/ptolemy", , "0", "180", "0.1"] , stdout=subprocess.PIPE).stdout.decode('utf-8')
'''
if fn1=="" or fn2=="" or fn3=="" :
result = "imcomplete input files"
pngName = ""
haha = ""
else:
result = subprocess.run(["../Cleopatra/Transfer", fn1, fn2, fn3, "0"], stdout=subprocess.PIPE).stdout.decode('utf-8')
haha = subprocess.run(["../Cleopatra/PlotSimulation", "transfer.root"], stdout=subprocess.PIPE).stdout.decode('utf-8')
pngName=haha.splitlines().pop()
'''
print ("Content-Type: text/html\r\n\r\n")
print ("<html>")
print ("<style> img {max-width: 100%} </style>")
print ("<style> body { font-family: courier, courier new, serif;} </style>")
print ("<body>")
if pngName != "" :
print ("<img src=\"files/%s\">" % pngName)
print ("<br>Reaction File : %s" % message1)
print ("<br>DetectorGeo File : %s" % message2)
print ("<br>Ex File : %s" % message3)
print ("<br>DWBA File : %s" % message4)
print ("<br>Plot Config File : %s" % message5)
print ("<br><span style=\"white-space: pre-line\"> %s </span>" % dwba_1)
print ("<br><span style=\"white-space: pre-line\"> %s </span>" % result)
print ("<br><span style=\"white-space: pre-line\"> %s </span>" % haha)
print ("</body>")
print ("</html>")

1
digios Submodule

@ -0,0 +1 @@
Subproject commit d251aa1a3533d669cd24f5d932fab3dc160a4dc7

0
files/.gitkeep Normal file
View File

146
get_nuclear_data.py Executable file
View File

@ -0,0 +1,146 @@
#!/usr/bin/env /usr/bin/python3
################################################
import pandas as pd
# the API webpage
# https://www-nds.iaea.org/relnsd/vcharthtml/api_v0_guide.html#examples
# the service URL
livechart = "https://nds.iaea.org/relnsd/v0/data?"
import urllib.request
def lc_read_csv(url):
req = urllib.request.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0')
return pd.read_csv(urllib.request.urlopen(req))
mp = 938.27208816; #MeV/c^2
mn = 939.56542052;
'''
haha = lc_read_csv(livechart + 'fields=ground_states&nuclides=all')
def FindZ(AZ):
query = livechart + "fields=ground_states&nuclides=" + AZ
temp = lc_read_csv(query);
try :
return temp['z']
except :
return 'na'
def FindSym(Z):
try:
return (haha['symbol'][haha['z']==Z]).iloc[0]
except:
return 'na'
def Mass(A, Z):
try :
BEA = float(haha['binding'][haha['z']==Z][haha['n']==(A-Z)])/1000
return (A-Z)*mn + Z*mp - A * BEA
except :
return -404
def MassSym(AZ):
query = livechart + "fields=ground_states&nuclides=" + AZ
temp = lc_read_csv(query);
Z = temp['z']
N = temp['n']
try :
return Z*mp + N*mn - (Z+N)*temp['binding']/1000
except:
return -404
def Sp(A,Z,a,z):
mA = Mass(A,Z)
mB = Mass(A-a, Z-z)
if z == 0 :
mb = a * mn
elif a == z :
mb = a * mp
else :
mb = Mass(a,z)
if (mB == -404 or mb == -404 or mA == -404) :
return -404
else:
return mB + mb - mA
def Ex(AZ, maxMeV):
query = livechart + "fields=levels&nuclides=" + AZ
tempEx = lc_read_csv(query);
try :
return tempEx[['energy', 'jp']][tempEx['energy']<= maxMeV * 1000]
except:
return -404
'''
#===================================================
import cgi, cgitb
form = cgi.FieldStorage()
AZ = form.getvalue('isotopes_name')
maxEx = form.getvalue('maxEx')
if maxEx == "can be omitted" :
maxEx = -1
query = livechart + "fields=ground_states&nuclides=" + AZ
temp = lc_read_csv(query);
print( "Content-type:text/html\r\n\r\n")
print("<html>")
print("<style> body { font-family: courier, courier new, serif;} </style>")
print("<body>")
print("<br>========================= " + AZ )
try :
Z = temp['z'][0]
N = temp['n'][0]
mass = Z*mp + N*mn - (Z+N)*temp['binding']/1000
halfLife = temp['half_life_sec'][0]
print("<br> A : %3d, Z : %3d, N : %3d" % (Z+N, Z, N))
print("<br> Jpi : %3s" % (temp['jp'][0]))
if halfLife != " " :
print(", half-live : %s sec" % (halfLife))
print("<br> Mass : %.4f MeV" % (mass))
print("<br> Binding : %.4f MeV/A" % (temp['binding']/1000))
print("<br> Binding : %.4f MeV" % (temp['binding']/1000*(Z+N)))
#print("<br>Sn : %8.3f MeV, Sp : %8.3f MeV" % (Sp(Z+N,Z, 1, 0), Sp(Z+N,Z, 1, 1)))
#print("<br>S2n : %8.3f MeV, S2p : %8.3f MeV, Sd : %8.3f MeV" % (Sp(Z+N,Z, 2, 0), Sp(Z+N,Z, 2, 2), Sp(Z+N, Z, 2, 1)))
#print("<br>S3n : %8.3f MeV, S3p : %8.3f MeV, St : %8.3f MeV, S(3He) : %8.3f MeV" % (Sp(Z+N,Z, 3, 0), Sp(Z+N,Z, 3, 3), Sp(Z+N, Z, 3, 1), Sp(Z+N, Z, 3, 2)))
#print("<br>S4n : %8.3f MeV, S4p : %8.3f MeV, Sa : %8.3f MeV" % (Sp(Z+N,Z, 4, 0), Sp(Z+N,Z, 4, 4), Sp(Z+N, Z, 4, 2)))
#print(" magnetic dipole : " + temp['magnetic_dipole'][0] + " mu.N")
#print("electric quadruple : " + temp['electric_quadrupole'][0] + " barn")
#if halfLife > 0 :
# print('------------ decay mode:')
# for i in range(1, 4) :
# print("%5s %s %%" % (temp["decay_%d" % i][0], temp["decay_%d_%%" % i][0]))
# print('--------------------------')
except :
print("<br>No such Isotopes.")
print("<br>=============================")
if float(maxEx) > 0 :
print("<br>")
query = livechart + "fields=levels&nuclides=" + AZ
tempEx = lc_read_csv(query);
ex = tempEx['energy']
jp = tempEx['jp']
l = ex.last_valid_index()
try :
print("<table>")
for i in range(0, l+1):
if float(ex[i]) < float(maxEx)*1000:
print("<tr><td style=\"text-align:right\" width=80> %9.3f </td><td style=\"text-align:right\" width = 100> %s</td></tr>" % (ex[i], jp[i]))
else:
break
print("</table>")
except:
print("<br> cannot find Ex data")
print("</body>")
print("</html>")

155
index.html Normal file
View File

@ -0,0 +1,155 @@
<!DOCTYPE html>
<html>
<head>
<title>SOLARIS Simulation </title>
</head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
}
table, th, td {
//border: 1px solid black;
}
header {
background-color: #DF0;
padding: 30px;
text-align: center;
font-size: 35px;
color: black;
}
nav {
float: left;
width : 400px;
height: 100vh;
background: #ccc;
padding: 0px;
}
article {
float: none;
padding: 0px;
margin-left: 400px;
height : 100vh;
background: #F6F6FF;
}
@media (max-width: 1000px) {
nav {
width: 100%;
height: auto;
margin-left : 0;
}
article {
width: 100%;
height: 100vh;
margin-left : 0;
}
}
</style>
<body>
<header><h1>SOLARIS Simulation</h1></header>
<section>
<nav>
<p>Some descriptions/Intructions here...</p>
<!-- ////////////////////////////////////////// -->
<table>
<tr>
<td>Download Sample files:</td>
<td style="text-align:left">
<a href="sample_files/reactionConfig_sample.txt" download="reactionConfig.txt">Reaction File</a>
</td>
</tr>
<tr>
<td></td>
<td style="text-align:left">
<a href="sample_files/detectorGeo_sample.txt" download="detectorGeo.txt">DetectorGeo File</a>
</td>
</tr>
<tr>
<td></td>
<td style="text-align:left">
<a href="sample_files/Ex_sample.txt" download="Ex.txt">Ex File</a>
</td>
</tr>
<tr>
<td></td>
<td style="text-align:left">
<a href="sample_files/DWBA_sample.txt" download="DWBA">DWBA File</a>
</td>
</tr>
<tr>
<td></td>
<td style="text-align:left">
<a href="sample_files/PlotConfig_sample.txt" download="DWBA">Plot Config File</a>
</td>
</tr>
</table>
<p></p><!-- ////////////////////////////////////////// -->
<form enctype = "multipart/form-data" action = "Simulation_gateway.py" method = "post" target="uploaded">
<table>
<tr>
<td style="text-align:right" width="200">Reaction File </td>
<td><input type = "file" name = "filename1" /> </td>
</tr>
<tr>
<td style="text-align:right" width="200">DetectorGeo File </th>
<td><input type = "file" name = "filename2" /> </td>
</tr>
<tr>
<td style="text-align:right" width="200">Ex File </th>
<td><input type = "file" name = "filename3" /> </td>
</tr>
<tr>
<td style="text-align:right" width="200">DWBA File ^ </th>
<td><input type = "file" name = "filename4" /> </td>
</tr>
<tr>
<td style="text-align:right" width="200">Plot Config File * </th>
<td><input type = "file" name = "filename5" /> </td>
</tr>
<tr>
<td>^ can be alone <br>* can be omitted</th>
<td><input type = "submit" value = "Upload & Run Simulation" style="height:50px; width:200px"/> </td>
</tr>
</table>
</form>
<p></p><!-- ////////////////////////////////////////// -->
<form action = "get_nuclear_data.py" method = "POST" target = "NuclearData">
<table>
<tr>
<td style="text-align:right">Isotopes Name:</td>
<td><input type = "text" name = "isotopes_name" size="13" value="18O"/></td>
</tr>
<tr>
<td style="text-align:right">Max Ex [MeV]:</td>
<td><input type = "text" name = "maxEx" size="13" value="can be omitted"/></td>
</tr>
<tr>
<td></td>
<td>
<input type = "submit" value = "Get Isotopes Data" />
</td>
</tr>
</table>
</form>
<iframe name="NuclearData" style="border:none" width="400" height="80%"></iframe>
</nav>
<!-- ////////////////////////////////////////// -->
<article>
<iframe name="uploaded" style="border:none" width="100%" height= "100%"></iframe>
</article>
</section>
</body>
</html>

View File

@ -0,0 +1,44 @@
#========= Input for Cleopatra
#===== # for comment line, must be at the beginning of line
#===== the potential contain two words
# one for incoming
# one for outgoing
#================================================= Potenital abberation
#========================= deuteron
# A = An, Cai, 2006 | E < 183 | 12 < A < 238 | http://dx.doi.org/10.1103/PhysRevC.73.054605
# H = Han, Shi, Shen, 2006 | E < 200 | 12 < A < 209 | http://dx.doi.org/10.1103/PhysRevC.74.044615
# B = Bojowald et al., 1988 | 50 < E < 80 | 27 < A < 208 | http://dx.doi.org/10.1103/PhysRevC.38.1153
# D = Daehnick, Childs, Vrcelj, 1980 | 11.8 < E < 80 | 27 < A < 238 (REL) | http://dx.doi.org/10.1103/PhysRevC.21.2253
# C = Daehnick, Childs, Vrcelj, 1980 | 11.8 < E < 80 | 27 < A < 238 (NON-REL) | http://dx.doi.org/10.1103/PhysRevC.21.2253 // not impletmented yet
# L = Lohr and Haeberli, 1974 | 9 < E < 13 | 40 < A | http://dx.doi.org/10.1016/0375-9474(74)90627-7
# Q = Perey and Perey, 1963 | 12 < E < 25 | 40 < A | http://dx.doi.org/10.1016/0370-1573(91)90039-O
# Z = Zhang, Pang, Lou, 2016 | 5 < E < 170 | A < 18, spe 6-7Li | https://doi.org/10.1103/PhysRevC.94.014619
#========================= proton
# K = Koning and Delaroche, 2009 | 0.001 < E < 200 | 24 < A < 209 | Iso. Dep. | http://dx.doi.org/10.1016/S0375-9474(02)01321-0
# V = Varner et al., (CH89), 1991 | 16 < E < 65 | 4 < A < 209 | http://dx.doi.org/10.1016/0370-1573(91)90039-O
# M = Menet et al., 1971 | 30 < E < 60 | 40 < A | http://dx/doi.org/10.1016/0092-640X(76)90007-3
# G = Becchetti and Greenlees, 1969 | E < 50 | 40 < A | http://dx.doi.org/10.1103/PhysRev.182.1190
# P = Perey, 1963 | E < 20 | 30 < A < 100 | http://dx/doi.org/10.1016/0092-640X(76)90007-3
#========================= A=3
# x = Xu, Guo, Han, Shen, 2011 | E < 250 | 20 < A < 209 | 3He | http://dx.doi.org/10.1007/s11433-011-4488-5
# l = Liang, Li, Cai, 2009 | E < 270 | All masses | http://dx.doi.org/10.1088/0954-3899/36/8/085104
# p = Pang et al., 2009 | All E | All masses | Iso. Dep. | http://dx.doi.org/10.1103/PhysRevC.79.024615
# c = Li, Liang, Cai, 2007 | E < 40 | 48 < A < 232 | Tritons | http://dx.doi.org/10.1016/j.nuclphysa.2007.03.004
# t = Trost et al., 1987 | 10 < E < 220 | 10 < A < 208 | http://dx.doi.org/10.1016/0375-9474(87)90551-3
# h = Hyakutake et al., 1980 | 90 < E < 120 | About 58 < A < 92 | http://dx.doi.org/10.1016/0375-9474(80)90013-5
# b = Becchetti and Greenlees, 1971 | E < 40 | 40 < A | Iso. Dep.
#========================= alpha
# s = Su and Han, 2015 | E < 398 | 20 < A < 209 | http://dx.doi/org/10.1142/S0218301315500925
# a = Avrigeanu et al., 2009 | E ??? | A ??? | http://dx.doi/org/10.1016/j.adt.2009.02.001
# f = Bassani and Picard, 1969(FIXED)| 24 < E < 31 | A = 90 | https://doi.org/10.1016/0375-9474(69)90601-0
#=======================================================================
#reaction gs-spin orbital spin-pi(Ex) Ex ELab Potentials
#206Hg(d,d)206Hg 0 none 9/2+ 0.000 7.39MeV/u AA #elastic
#206Hg(d,d)206Hg 0 none 9/2+ 1.000 7.39MeV/u AA 0.12 #inelastics_0.12=beta
#206Hg(d,p)207Hg 0 1g9/2 9/2+ 0.000 7.39MeV/u AK
#20F(d,t)19F 2 0d5/2 5/2+ 0.197 10MeV/u Vl
#16N(d,3He)15C 2 0p1/2 5/2+ 0.74 12MeV/u Ax
#10Be(t,p)12Be 0 1L=0 0+ 0.000 5MeV/u lA #two-nucleon_transfer
#32Si(t,p)34Si 0 0L=0 0+ 0.000 8MeV/u lA #two-nucleon_transfer
#36Ar(d,a)34Cl 0 4L=2 3+ 0.000 8MeV/u As # (d,a) reaction

View File

@ -0,0 +1,6 @@
//Ex relative_xsec SF sigma_in_MeV
//<--- use "//" for line comment
0.000 1.0 1.0 0.0100
//4.400 1.0 1.0 0.0100
//4.600 1.0 1.0 0.0100
#============_End_of_file

View File

@ -0,0 +1,27 @@
-4.00 //Bfield_[T]
0.00 //Bfield_direction_to_z-axis_[deg]_should_not_use
462.5 //bore_[mm]
11.5 //distance_from_axis_[mm]
10.0 //width_of_detector_[mm]
50 //length_of_detector_[mm]
1000 //recoil_position_+_for_downstream_[mm]
10.0 //inner_radius_of_recoil_detector_[mm]
40.2 //outter_radius_of_recoil_detector_[mm]
false //is_coincident_with_recoil
0 //Recoil_1_position_[mm]_when_0_disable_tree_branch
0 //Recoil_2_position_[mm]
0.00 //Elum_1_position_[mm]_(just_another_recoil_detector_but_for_light_recoil)
0.00 //Elum_2_position_[mm]_when_Elum=0_disable_tree_branch
0 //support_length_[mm]
-121 //first_position_-_for_upstream_[mm]
0.03 //energy_resolution_of_PSD_array_[MeV]
1.00 //position_resolution_of_PSD_array_[mm]
Out //detector_facing_Out_or_In
4 //number_of_detector_as_same_side
0.00 //1st_detector_near_position_in_reference_to_det6_[mm]
58.6 //2nd_det
117.9
176.8
235.8 //5th_det
290.0
#============= end of file

View File

@ -0,0 +1,25 @@
32 //beam_A
14 //beam_Z
2 //target_A
1 //target_Z
1 //recoil_light_A
1 //recoil-light_Z
8.8 //beam-energy_in_MeV/u
0.000 //beam-energy_sigma_in_MeV/u
0.000 //beam-angle_in_mrad
0.000 //beam-emittance_in_mrad
0.00 //x_offset_of_Beam_in_mm
0.00 //y_offset_of_Beam_in_mm
100000 //number_of_Event_being_generated
false //isTargetScattering
0.913 //target_density_in_g/cm3
2.2e-4 //targetThickness_in_cm
../SRIM/20F_in_CD2.txt //stopping_power_for_beam
../SRIM/3H_in_CD2.txt //stopping_power_for_light_recoil
../SRIM19F_in_CD2.txt //stopping_power_for_heavy_recoil
false //isDacay
32 //decayNucleus_A
14 //decayNucleus_Z
false //isReDo
0.0 //excitation_energy_of_A[MeV]
#===== end of file