From d3cd22d7ad134e7e7d96560b277e2c84fa5af79a Mon Sep 17 00:00:00 2001 From: "Ryan@fsunuc" Date: Wed, 11 Jan 2023 20:47:43 -0500 Subject: [PATCH] added PlotConfig generation --- simpleInput.py | 72 ++++++++++++++++++++------------------------------ simpleSim.html | 3 ++- 2 files changed, 31 insertions(+), 44 deletions(-) diff --git a/simpleInput.py b/simpleInput.py index 54b2730..e5a630b 100755 --- a/simpleInput.py +++ b/simpleInput.py @@ -20,18 +20,12 @@ def FindAZ(AZ): form = cgi.FieldStorage() beam_AZ = form.getvalue('beam_AZ') -#beam_A = form.getvalue('beam_A') -#beam_Z = form.getvalue('beam_Z') beam_Jpi = form.getvalue('beam_Jpi') beam_Ex = form.getvalue('beam_Ex') target_AZ = form.getvalue('target_AZ') -#target_A = form.getvalue('target_A') -#target_Z = form.getvalue('target_Z') lRecoil_AZ = form.getvalue('lRecoil_AZ') -#lRecoil_A = form.getvalue('lRecoil_A') -#lRecoil_Z = form.getvalue('lRecoil_Z') KEA = form.getvalue('KEA') BField = form.getvalue('BField') @@ -137,42 +131,6 @@ f.close() #================== if DWBA, write DWBA.txt, else write Ex.txt fn4 = "sim_DWBA.txt" -''' -beamName="" -hRecoil_A = int(beam_A) + int(target_A) - int(lRecoil_A) -hRecoil_Z = int(beam_Z) + int(target_Z) - int(lRecoil_Z) -hRecoilName="" - -targetName="" -lRecoilName="" - -if target_A == "1" and target_Z == "0": - targetName="n" -if target_A == "1" and target_Z == "1": - targetName="p" -if target_A == "2" and target_Z == "1": - targetName="d" -if target_A == "3" and target_Z == "1": - targetName="t" -if target_A == "3" and target_Z == "2": - targetName="3He" -if target_A == "4" and target_Z == "2": - targetName="a" - - -if lRecoil_A == "1" and lRecoil_Z == "0": - lRecoilName="n" -if lRecoil_A == "1" and lRecoil_Z == "1": - lRecoilName="p" -if lRecoil_A == "2" and lRecoil_Z == "1": - lRecoilName="d" -if lRecoil_A == "3" and lRecoil_Z == "1": - lRecoilName="t" -if lRecoil_A == "3" and lRecoil_Z == "2": - lRecoilName="3He" -if lRecoil_A == "4" and lRecoil_Z == "2": - lRecoilName="a" -''' hRecoil = [ beam[0] + target[0] - lRecoil[0], beam[1] + target[1] - lRecoil[1] ] hRecoil_AZ = FindName(hRecoil[0], hRecoil[1]); @@ -206,7 +164,34 @@ if isDWBA == False: f.close() #================== write PlotConfig.txt (to be done) -fn5="" +fn5="PlotConfig.txt" + +plotStr="{" +plotSize=len(plot) +for i in range(plotSize): + plotStr += plot[i] + ", " + if( i == (int)(plotSize/2) and i > 3 ) : + plotStr += "break, " +plotStr +="pInfo}\n" + +gateStr ="" +gateSize=len(gate) +for i in range(gateSize): + gateStr += gate[i] + if( i < gateSize - 1 ): + gateStr += " && " +gateStr +="\n" + +f = open(fn5, "w") +f.write(plotStr) +f.write(gateStr) +f.write("60 //elum range\n") +f.write("{0, 50} //thetaCM range\n") +f.write("false //showKElines\n") +f.write("false //isOverRideEx\n") +f.write("{-0.5, 4.0} //over-ride Ex range\n") +f.close() + #==================== Run Simulation dwba_1="" @@ -304,6 +289,7 @@ if isDWBA: print ("
%s " % dwba_4) print ("
%s " % result) print ("
%s " % haha) + print ("") print ("") diff --git a/simpleSim.html b/simpleSim.html index 242c55b..1d1ce32 100644 --- a/simpleSim.html +++ b/simpleSim.html @@ -152,7 +152,7 @@ -

Plot config (still working on):

+

Plot config:

E vs Z
Ex (cal.)
@@ -161,6 +161,7 @@ Recoil X vs Y
Recoil-R vs ThetaCM
Recoil R vs Z
+ Time diff vs Z
Array X vs Y