From 076652e9f1d7fb478531611ada9e6b86a824c1da Mon Sep 17 00:00:00 2001 From: "Ryan@fsunuc" Date: Fri, 9 Dec 2022 13:15:32 -0500 Subject: [PATCH] the kinematic is OK, need to add DWBA --- .gitignore | 2 + .gitmodules | 3 + Armory | 1 + Cleopatra | 1 + Simulation_gateway.py | 127 ++++++++++++++++++++ digios | 1 + files/.gitkeep | 0 get_nuclear_data.py | 146 +++++++++++++++++++++++ index.html | 155 +++++++++++++++++++++++++ sample_files/DWBA_sample.txt | 44 +++++++ sample_files/Ex_sample.txt | 6 + sample_files/detectorGeo_sample.txt | 27 +++++ sample_files/reactionConfig_sample.txt | 25 ++++ 13 files changed, 538 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 120000 Armory create mode 120000 Cleopatra create mode 100755 Simulation_gateway.py create mode 160000 digios create mode 100644 files/.gitkeep create mode 100755 get_nuclear_data.py create mode 100644 index.html create mode 100644 sample_files/DWBA_sample.txt create mode 100644 sample_files/Ex_sample.txt create mode 100644 sample_files/detectorGeo_sample.txt create mode 100644 sample_files/reactionConfig_sample.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..19ca352 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +files/* +!files/.gitkeep diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7cad33b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "digios"] + path = digios + url = https://github.com/calemhoffman/digios.git diff --git a/Armory b/Armory new file mode 120000 index 0000000..7039ea6 --- /dev/null +++ b/Armory @@ -0,0 +1 @@ +digios/analysis/Armory \ No newline at end of file diff --git a/Cleopatra b/Cleopatra new file mode 120000 index 0000000..a6d0e69 --- /dev/null +++ b/Cleopatra @@ -0,0 +1 @@ +digios/analysis/Cleopatra \ No newline at end of file diff --git a/Simulation_gateway.py b/Simulation_gateway.py new file mode 100755 index 0000000..e4d89a6 --- /dev/null +++ b/Simulation_gateway.py @@ -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 ("") +print ("") +print ("") +print ("") +if pngName != "" : + print ("" % pngName) + +print ("
Reaction File : %s" % message1) +print ("
DetectorGeo File : %s" % message2) +print ("
Ex File : %s" % message3) +print ("
DWBA File : %s" % message4) +print ("
Plot Config File : %s" % message5) +print ("
%s " % dwba_1) +print ("
%s " % result) +print ("
%s " % haha) +print ("") +print ("") diff --git a/digios b/digios new file mode 160000 index 0000000..d251aa1 --- /dev/null +++ b/digios @@ -0,0 +1 @@ +Subproject commit d251aa1a3533d669cd24f5d932fab3dc160a4dc7 diff --git a/files/.gitkeep b/files/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/get_nuclear_data.py b/get_nuclear_data.py new file mode 100755 index 0000000..9fb01c6 --- /dev/null +++ b/get_nuclear_data.py @@ -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("") +print("") +print("") + +print("
========================= " + 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("
A : %3d, Z : %3d, N : %3d" % (Z+N, Z, N)) + print("
Jpi : %3s" % (temp['jp'][0])) + if halfLife != " " : + print(", half-live : %s sec" % (halfLife)) + print("
Mass : %.4f MeV" % (mass)) + print("
Binding : %.4f MeV/A" % (temp['binding']/1000)) + print("
Binding : %.4f MeV" % (temp['binding']/1000*(Z+N))) + #print("
Sn : %8.3f MeV, Sp : %8.3f MeV" % (Sp(Z+N,Z, 1, 0), Sp(Z+N,Z, 1, 1))) + #print("
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("
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("
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("
No such Isotopes.") + +print("
=============================") + +if float(maxEx) > 0 : + print("
") + query = livechart + "fields=levels&nuclides=" + AZ + tempEx = lc_read_csv(query); + ex = tempEx['energy'] + jp = tempEx['jp'] + l = ex.last_valid_index() + try : + print("") + for i in range(0, l+1): + if float(ex[i]) < float(maxEx)*1000: + print("" % (ex[i], jp[i])) + else: + break + print("
%9.3f %s
") + except: + print("
cannot find Ex data") + + +print("") +print("") + + + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..13d4077 --- /dev/null +++ b/index.html @@ -0,0 +1,155 @@ + + + + SOLARIS Simulation + + + + + + +

SOLARIS Simulation

+ +
+ + + + +
+ +
+
+ + + + diff --git a/sample_files/DWBA_sample.txt b/sample_files/DWBA_sample.txt new file mode 100644 index 0000000..6cf34bf --- /dev/null +++ b/sample_files/DWBA_sample.txt @@ -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 + diff --git a/sample_files/Ex_sample.txt b/sample_files/Ex_sample.txt new file mode 100644 index 0000000..160e6c1 --- /dev/null +++ b/sample_files/Ex_sample.txt @@ -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 diff --git a/sample_files/detectorGeo_sample.txt b/sample_files/detectorGeo_sample.txt new file mode 100644 index 0000000..22b4018 --- /dev/null +++ b/sample_files/detectorGeo_sample.txt @@ -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 diff --git a/sample_files/reactionConfig_sample.txt b/sample_files/reactionConfig_sample.txt new file mode 100644 index 0000000..e21ef48 --- /dev/null +++ b/sample_files/reactionConfig_sample.txt @@ -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