From 4ca97d9a606188a38c76ee67b24837795ea171d6 Mon Sep 17 00:00:00 2001
From: "Ryan@fsunuc"
Date: Fri, 9 Dec 2022 17:11:04 -0500
Subject: [PATCH] finsihed all basic functions
---
Simulation_gateway.py | 62 +++++++++++++++----
digios | 2 +-
index.html | 24 +++++--
sample_files/DWBA_sample.txt | 1 +
sample_files/PlotConfig_sample.txt | 30 +++++++++
...mple.txt => detectorGeo_HELIOS_sample.txt} | 4 +-
sample_files/detectorGeo_SOLARIS_sample.txt | 31 ++++++++++
7 files changed, 136 insertions(+), 18 deletions(-)
create mode 100644 sample_files/PlotConfig_sample.txt
rename sample_files/{detectorGeo_sample.txt => detectorGeo_HELIOS_sample.txt} (97%)
create mode 100644 sample_files/detectorGeo_SOLARIS_sample.txt
diff --git a/Simulation_gateway.py b/Simulation_gateway.py
index e4d89a6..3af7f65 100755
--- a/Simulation_gateway.py
+++ b/Simulation_gateway.py
@@ -6,6 +6,8 @@ import subprocess
cgitb.enable()
+cgi.maxlen=1024 * 1024
+
form = cgi.FieldStorage()
fn1=""
@@ -18,6 +20,7 @@ message1=""
message2=""
message3=""
message4=""
+message5=""
fileitem = form['filename1']
if fileitem.filename:
@@ -82,36 +85,70 @@ else:
##change to files directory
os.chdir(r"files")
+## remove files ?
+
pngName=""
result=""
haha=""
dwba_1=""
dwba_2=""
+dwba_3=""
+dwba_4=""
+dwbaPNG=""
+inFile=""
+outFile=""
+isDWBA=False
+dwbaExFile=""
+dwbaRootFile=""
+isTransferOK=False
#------- 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')
+ outFile = fn4+ ".out"
+ cmd = "../Cleopatra/ptolemy <%s.in> %s.out" % (fn4, fn4)
+ os.system(cmd)
+ if os.path.exists(outFile) :
+ dwba_2 = outFile
+ dwba_3 = subprocess.run(["../Cleopatra/ExtractXSec", outFile, "1"], stdout=subprocess.PIPE).stdout.decode('utf-8')
+ dwbaRootFile = fn4 + ".root"
+ dwbaExFile = fn4 + ".Ex.txt"
+ dwba_4 = subprocess.run(["../Cleopatra/PlotTGraphTObjArray", dwbaRootFile, "1"], stdout=subprocess.PIPE).stdout.decode('utf-8')
+ dwbaPNG = dwba_4.splitlines().pop()
+ isDWBA = True
-'''
-if fn1=="" or fn2=="" or fn3=="" :
- result = "imcomplete input files"
+if fn1=="" or fn2=="":
+ result = "imcomplete input files for kinematocs Simulation"
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()
-'''
+ if isDWBA :
+ result = subprocess.run(["../Cleopatra/Transfer", fn1, fn2, dwbaExFile, dwbaRootFile, "transfer.root", "reaction.dat", "0"], stdout=subprocess.PIPE).stdout.decode('utf-8')
+ isTransferOK = True
+ else:
+ if fn3=="" :
+ result = "missing Ex.txt"
+ else:
+ result = subprocess.run(["../Cleopatra/Transfer", fn1, fn2, fn3, "", "transfer.root", "reaction.dat", "0"], stdout=subprocess.PIPE).stdout.decode('utf-8')
+ isTransferOK = True
+
+ if isTransferOK :
+ if fn5 =="":
+ haha = subprocess.run(["../Cleopatra/PlotSimulation", "transfer.root"], stdout=subprocess.PIPE).stdout.decode('utf-8')
+ else:
+ haha = subprocess.run(["../Cleopatra/PlotSimulation", "transfer.root", fn5], 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 dwbaPNG != "" :
+ print ("" % dwbaPNG)
+
if pngName != "" :
print ("" % pngName)
@@ -121,6 +158,9 @@ print ("
Ex File : %s" % message3)
print ("
DWBA File : %s" % message4)
print ("
Plot Config File : %s" % message5)
print ("
%s " % dwba_1)
+print ("
%s " % dwba_2)
+print ("
%s " % dwba_3)
+print ("
%s " % dwba_4)
print ("
%s " % result)
print ("
%s " % haha)
print ("")
diff --git a/digios b/digios
index d251aa1..6c2c895 160000
--- a/digios
+++ b/digios
@@ -1 +1 @@
-Subproject commit d251aa1a3533d669cd24f5d932fab3dc160a4dc7
+Subproject commit 6c2c8950171e13ab858e61e1bc75c5d4283c7cb0
diff --git a/index.html b/index.html
index 13d4077..a1dc12d 100644
--- a/index.html
+++ b/index.html
@@ -54,7 +54,17 @@
+
@@ -140,7 +156,7 @@
-
+
diff --git a/sample_files/DWBA_sample.txt b/sample_files/DWBA_sample.txt
index 6cf34bf..744c0fc 100644
--- a/sample_files/DWBA_sample.txt
+++ b/sample_files/DWBA_sample.txt
@@ -42,3 +42,4 @@
#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
+32Si(d,p)33Si 0 1p3/2 3/2- 0.000 8.8MeV/u AK
diff --git a/sample_files/PlotConfig_sample.txt b/sample_files/PlotConfig_sample.txt
new file mode 100644
index 0000000..226a4ad
--- /dev/null
+++ b/sample_files/PlotConfig_sample.txt
@@ -0,0 +1,30 @@
+/////enum plotID { pEZ, /// 0
+///// pRecoilXY, /// 1
+///// pRecoilXY1, /// 2
+///// pRecoilXY2, /// 3
+///// pRecoilRZ, /// 4
+///// pRecoilRTR, /// 5
+///// pTDiffZ, /// 6
+///// pThetaCM, /// 7
+///// pThetaCM_Z, /// 8
+///// pExCal, /// 9
+///// pRecoilRThetaCM, /// 10
+///// pArrayXY, /// 11
+///// pInfo, /// 12
+///// pHitID, /// 13
+///// pElum1XY, /// 14
+///// pEElum1R, /// 15
+///// pElum1RThetaCM, /// 16
+///// pEmpty }; /// 17
+/////=============================================== User Config
+{pEZ, pExCal, pThetaCM, pRecoilRZ, break, pThetaCM_Z, pRecoilXY, pInfo, pRecoilRThetaCM} //Canvas config
+hit == 1 && loop <= 1 && thetaCM > 10
+60 //elum range
+{0,50} //thetaCM range
+false //shownKELines
+false //isOverRideEx
+{-0.5, 4.0} // over-rdied Ex range
+///============================== example of gate
+hit == 1 && loop <= 1 && thetaCM > 10 && detRowID == 0
+hit == 1 && loop <= 1
+15 < rhoElum1 && rhoElum1 < 50 && rhoElum2 > 60
diff --git a/sample_files/detectorGeo_sample.txt b/sample_files/detectorGeo_HELIOS_sample.txt
similarity index 97%
rename from sample_files/detectorGeo_sample.txt
rename to sample_files/detectorGeo_HELIOS_sample.txt
index 22b4018..41e31dd 100644
--- a/sample_files/detectorGeo_sample.txt
+++ b/sample_files/detectorGeo_HELIOS_sample.txt
@@ -1,4 +1,4 @@
--4.00 //Bfield_[T]
+-2.50 //Bfield_[T]
0.00 //Bfield_direction_to_z-axis_[deg]_should_not_use
462.5 //bore_[mm]
11.5 //distance_from_axis_[mm]
@@ -23,5 +23,5 @@ Out //detector_facing_Out_or_In
117.9
176.8
235.8 //5th_det
-290.0
+294.0
#============= end of file
diff --git a/sample_files/detectorGeo_SOLARIS_sample.txt b/sample_files/detectorGeo_SOLARIS_sample.txt
new file mode 100644
index 0000000..f816362
--- /dev/null
+++ b/sample_files/detectorGeo_SOLARIS_sample.txt
@@ -0,0 +1,31 @@
+-2.50 //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
+6 //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
+294.0
+353.2
+412.1
+471.0
+530.0
+#============= end of file