452 lines
12 KiB
HTML
452 lines
12 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>Heliosmatics</title>
|
||
|
<meta name="description" content="HELIOSMATICS was first build by Ben P. Kay in MS Excel around 2010. Later, it was modified by Ryan Tang. Now, it migrate to web.">
|
||
|
<script src="https://cdn.plot.ly/plotly-2.16.1.min.js"></script>
|
||
|
</head>
|
||
|
<style>
|
||
|
body{
|
||
|
font-family: Arial, Helvetica, sans-serif;
|
||
|
}
|
||
|
</style>
|
||
|
|
||
|
<body>
|
||
|
|
||
|
<h1>HELIOSmatics (experimental...)</h1>
|
||
|
<h3 id='reactionName'> 24F(d,p)25F@10MeV/u</h3>
|
||
|
<table>
|
||
|
<tr>
|
||
|
<td>
|
||
|
<input type="radio" name="SSType" id='HELIOS' value="HELIOS"/>HELIOS
|
||
|
</td>
|
||
|
<td>
|
||
|
<input type="radio" name="SSType" id='SOLARIS' value="SOLARIS" checked="checked"/>SOLARIS
|
||
|
</td>
|
||
|
<td>
|
||
|
<input type="radio" name="SSType" id='ISS' value="ISS"/>ISS
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
<p></p>
|
||
|
<table id="setting">
|
||
|
|
||
|
<tr>
|
||
|
<td style="text-align:right"> Beam (A):</td>
|
||
|
<td><Input type="text" size="7" value="24F" id="beam"/></td>
|
||
|
<td style="text-align:right"> Beam Ex:</td>
|
||
|
<td><Input type="text" size="7" value="0" id="beamEx"/></td>
|
||
|
<td>MeV</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td style="text-align:right"> Target (a):</td>
|
||
|
<td><Input type="text" size="7" value="d" id="target"/></td>
|
||
|
<td style="text-align:right"> Beam Energy:</td>
|
||
|
<td><Input type="text" size="7" value="10" id="KEA"/></td>
|
||
|
<td>MeV/u</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td style="text-align:right"> Light (b):</td>
|
||
|
<td><Input type="text" size="7" value="p" id="light"/></td>
|
||
|
<td style="text-align:right"> min Beam Energy:</td>
|
||
|
<td id='minKEA'>-1.107</td>
|
||
|
<td>MeV/u</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td style="text-align:right"> Heavy (B):</td>
|
||
|
<td id='heavyName'>25F</td>
|
||
|
<td style="text-align:right"> Q-value:</td>
|
||
|
<td id='Q-value'>2.057</td>
|
||
|
<td>MeV</td>
|
||
|
</tr>
|
||
|
<tr></tr>
|
||
|
<tr>
|
||
|
<td style="text-align:right"> B-field:</td>
|
||
|
<td><Input type="text" size="7" value="2" id="BField"/></td>
|
||
|
<td>T</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<table id="ExTable", style="border:1px solid">
|
||
|
<tr>
|
||
|
<td> E<sub>x</sub> [MeV]</td>
|
||
|
<td> θ<sub>cm</sub>[deg]</td>
|
||
|
<td>E<sub>b</sub>[MeV]</td>
|
||
|
<td>Z<sub>b0</sub>[mm]</td>
|
||
|
<td>Z<sub>b</sub>[mm]</td>
|
||
|
<td>2*ρ<sub>b</sub>[mm]</td>
|
||
|
<td>θLab<sub>b</sub>[deg]</td>
|
||
|
<td>T<sub>b</sub>[ns]</td>
|
||
|
<td>E<sub>B</sub>[MeV]</td>
|
||
|
<td>θLab<sub>B</sub>[deg]</td>
|
||
|
<td>Z<sub>B0</sub>/2[mm]</td>
|
||
|
<td>2*ρ<sub>B</sub>[mm]</td>
|
||
|
</tr>
|
||
|
</tr>
|
||
|
<td><input type="text" id='Ex1' name="Ex" size="7" value="0"/></td>
|
||
|
<td><input type="text" id='theta1' name="thetaCM" size="7" value="10"/></td>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td><button type="button" onclick="addRow()">Add E<sub>x</sub></button></td>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td><button type="button" onclick="deleteRow()">Remove E<sub>x</sub></button></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
|
||
|
|
||
|
<div id="Plot_EZ" style="width:600px;height:600px;"></div>
|
||
|
|
||
|
<p id='x1'></p>
|
||
|
<p id='y1'></p>
|
||
|
|
||
|
<!--
|
||
|
<p id="n0"></p>
|
||
|
<p id="n1"></p>
|
||
|
<p id="n2"></p>
|
||
|
<p id="n3"></p>
|
||
|
|
||
|
<p id='beam_k_lab'></p>
|
||
|
<p id='E_tot_cm'></p>
|
||
|
<p id='KE_cm'></p>
|
||
|
<p id='max_Ex'></p>
|
||
|
<p id='beta'></p>
|
||
|
<p id='gamma'></p>
|
||
|
|
||
|
<p id='msg'></p>
|
||
|
-->
|
||
|
|
||
|
</body>
|
||
|
|
||
|
|
||
|
|
||
|
<script>
|
||
|
|
||
|
function addRow() {
|
||
|
var table = document.getElementById("ExTable");
|
||
|
var nRow = table.rows.length;
|
||
|
var row = table.insertRow(nRow-1);
|
||
|
row.innerHTML = '<td><input type="text" name="Ex" size="7" value=\"' + (nRow-2) + '\" id=\"Ex' + (nRow-1) + '\"/></td> \
|
||
|
<td><input type="text" name="thetaCM" size="7" value=\"10\" id=\"theta' + (nRow-1) + '\"/></td> \
|
||
|
<td></td> \
|
||
|
<td></td> \
|
||
|
<td></td> \
|
||
|
<td></td> \
|
||
|
<td></td> \
|
||
|
<td></td> \
|
||
|
<td></td> \
|
||
|
<td></td> \
|
||
|
<td></td> \
|
||
|
<td></td>';
|
||
|
|
||
|
Calculation();
|
||
|
}
|
||
|
|
||
|
function deleteRow(){
|
||
|
var table = document.getElementById("ExTable");
|
||
|
var nRow = table.rows.length;
|
||
|
if ( nRow > 3){
|
||
|
table.deleteRow(nRow-2);
|
||
|
}
|
||
|
|
||
|
Calculation();
|
||
|
}
|
||
|
|
||
|
var beam = []; //A, Z, Mass
|
||
|
var target= [];
|
||
|
var light=[];
|
||
|
var heavy=[];
|
||
|
|
||
|
function GetMass(AZ, id){
|
||
|
var str = 'massProxy.py?AZ=' + AZ;
|
||
|
|
||
|
var client = new XMLHttpRequest();
|
||
|
client.onreadystatechange = function() {
|
||
|
var mass = client.responseText.split(",");
|
||
|
if( id == 0 ){
|
||
|
beam[0] = parseInt(mass[0]);
|
||
|
beam[1] = parseInt(mass[1]);
|
||
|
beam[2] = parseFloat(mass[2]);
|
||
|
}
|
||
|
if( id == 1 ){
|
||
|
target[0] = parseInt(mass[0]);
|
||
|
target[1] = parseInt(mass[1]);
|
||
|
target[2] = parseFloat(mass[2]);
|
||
|
}
|
||
|
if( id == 2 ){
|
||
|
light[0] = parseInt(mass[0]);
|
||
|
light[1] = parseInt(mass[1]);
|
||
|
light[2] = parseFloat(mass[2]);
|
||
|
}
|
||
|
}
|
||
|
client.open('GET', str, false);
|
||
|
client.send();
|
||
|
|
||
|
}
|
||
|
|
||
|
function GetMass2(A,Z){
|
||
|
var str = 'massProxy.py?A=' + A + '&Z=' + Z;
|
||
|
|
||
|
var client = new XMLHttpRequest();
|
||
|
client.onreadystatechange = function() {
|
||
|
var mass = client.responseText.split(",");
|
||
|
heavy[2] = parseFloat(mass[2]);
|
||
|
heavy[3] = mass[3].replace(/\s/g, '');
|
||
|
}
|
||
|
client.open('GET', str, false);
|
||
|
client.send();
|
||
|
|
||
|
}
|
||
|
|
||
|
function Plot(data, titleTxt, rangeX, rangeY){
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
function Calculation(){
|
||
|
var beam_AZ = document.getElementById('beam').value;
|
||
|
GetMass(beam_AZ, 0);
|
||
|
var target_AZ = document.getElementById('target').value;
|
||
|
GetMass(target_AZ, 1);
|
||
|
var light_AZ = document.getElementById('light').value;
|
||
|
GetMass(light_AZ, 2);
|
||
|
|
||
|
heavy[0] = beam[0]+target[0]-light[0];
|
||
|
heavy[1] = beam[1]+target[1]-light[1];
|
||
|
GetMass2(heavy[0], heavy[1]);
|
||
|
heavy_AZ = heavy[3];
|
||
|
|
||
|
var beamEx = parseFloat(document.getElementById('beamEx').value);
|
||
|
var BField = parseFloat(document.getElementById('BField').value);
|
||
|
var KEA = document.getElementById('KEA').value;
|
||
|
var KE = KEA * beam[0];
|
||
|
|
||
|
var reactionName = beam_AZ +"(" + target_AZ + "," + light_AZ + ")" + heavy_AZ + "@" + KEA + "MeV/u";
|
||
|
document.getElementById('reactionName').innerHTML = reactionName;
|
||
|
|
||
|
var Qvalue = - heavy[2] - light[2] + beam[2] + target[2] + beamEx;
|
||
|
var minKEA = (Math.pow(light[2] + heavy[2],2) - Math.pow(beam[2] + target[2],2))/2/target[2]/beam[0];
|
||
|
var helios = document.getElementById('HELIOS').checked;
|
||
|
var solaris = document.getElementById('SOLARIS').checked;
|
||
|
var iss = document.getElementById('ISS').checked;
|
||
|
var perpDistant = 11.5; //mm, detector prepdicular distance
|
||
|
var bore = 462.0; // mm
|
||
|
//if ( solaris == true ){
|
||
|
//
|
||
|
//}
|
||
|
|
||
|
if ( iss == true ){
|
||
|
perpDistant = 20;
|
||
|
}
|
||
|
|
||
|
|
||
|
var beam_k_lab = Math.sqrt(Math.pow(beam[2]+KE,2) - Math.pow(beam[2],2));
|
||
|
var E_tot_cm = Math.sqrt(Math.pow(target[2]+beam[2],2) + 2*target[2]*KE);
|
||
|
var KE_cm = E_tot_cm - beam[2] - target[2];
|
||
|
var max_Ex = KE_cm + Qvalue;
|
||
|
var beta = beam_k_lab/(beam[2] + target[2] + KE);
|
||
|
var gamma = 1./Math.sqrt(1-beta*beta);
|
||
|
|
||
|
document.getElementById('heavyName').innerHTML = heavy_AZ;
|
||
|
document.getElementById('minKEA').innerHTML = minKEA.toFixed(3);
|
||
|
document.getElementById('Q-value').innerHTML = Qvalue.toFixed(3);
|
||
|
|
||
|
|
||
|
/*
|
||
|
document.getElementById('n0').innerHTML = beam[0] + "," + beam[1] + "," + beam[2]
|
||
|
document.getElementById('n1').innerHTML = target[0] + "," + target[1] + "," + target[2]
|
||
|
document.getElementById('n2').innerHTML = light[0] + "," + light[1] + "," + light[2]
|
||
|
document.getElementById('n3').innerHTML = heavy[0] + "," + heavy[1] + "," + heavy[2]
|
||
|
|
||
|
document.getElementById('beam_k_lab').innerHTML = beam_k_lab;
|
||
|
document.getElementById('E_tot_cm').innerHTML = E_tot_cm;
|
||
|
document.getElementById('max_Ex').innerHTML = max_Ex;
|
||
|
document.getElementById('KE_cm').innerHTML = KE_cm;
|
||
|
document.getElementById('beta').innerHTML = beta;
|
||
|
document.getElementById('gamma').innerHTML = gamma;
|
||
|
*/
|
||
|
|
||
|
const c = 299.792468;
|
||
|
|
||
|
var ez_slope = BField * c * light[1]*beta/2/Math.PI/1000; // MeV/mm
|
||
|
|
||
|
var alpha = ez_slope/beta;
|
||
|
var alpha_B = alpha * heavy[1]/light[1];
|
||
|
|
||
|
var tableEx = document.getElementById("ExTable");
|
||
|
var nRow = tableEx.rows.length;
|
||
|
|
||
|
var xList =[];
|
||
|
var yList =[];
|
||
|
|
||
|
for( let i = 1; i < nRow-1; i++){
|
||
|
let Ex = parseFloat(document.getElementById("Ex" + i).value);
|
||
|
let theta = parseFloat(document.getElementById("theta" + i).value);
|
||
|
|
||
|
let haha1 = E_tot_cm*E_tot_cm - Math.pow(heavy[2] + Ex + light[2],2);
|
||
|
let haha2 = E_tot_cm*E_tot_cm - Math.pow(heavy[2] + Ex - light[2],2);
|
||
|
|
||
|
let k_cm = Math.sqrt(haha1*haha2)/2/E_tot_cm;
|
||
|
|
||
|
let cs = Math.cos(theta*Math.PI/180.);
|
||
|
let ss = Math.sin(theta*Math.PI/180.);
|
||
|
let qb = Math.sqrt(light[2]*light[2]+k_cm*k_cm);
|
||
|
|
||
|
|
||
|
let Eb = gamma * qb - gamma * beta * k_cm * cs - light[2];
|
||
|
|
||
|
let Zb0 = (gamma*beta* qb - gamma * k_cm * cs )/alpha; //mm
|
||
|
let rho = k_cm * ss/c/light[1]/BField * 1000; // mm
|
||
|
let Zb = Zb0 * (1- Math.asin(perpDistant/rho)/2/Math.PI);
|
||
|
|
||
|
let thetaLab = 180 - Math.atan2(k_cm * ss, gamma * (beta * qb - k_cm * cs)) * 180/Math.PI;
|
||
|
|
||
|
let Tcyc = (light[2] + Eb)/alpha/c;
|
||
|
|
||
|
tableEx.rows[i].cells[2].innerHTML = Eb.toFixed(3);
|
||
|
tableEx.rows[i].cells[3].innerHTML = Zb0.toFixed(1);
|
||
|
tableEx.rows[i].cells[4].innerHTML = Zb.toFixed(1);
|
||
|
tableEx.rows[i].cells[5].innerHTML = (2*rho).toFixed(1);
|
||
|
tableEx.rows[i].cells[6].innerHTML = thetaLab.toFixed(2);
|
||
|
tableEx.rows[i].cells[7].innerHTML = Tcyc.toFixed(2);
|
||
|
|
||
|
let qB = Math.sqrt(heavy[2]*heavy[2]+k_cm*k_cm);
|
||
|
let EB = gamma * qB + gamma * beta * k_cm * cs - heavy[2];
|
||
|
let thetaLab_B = Math.atan2(-k_cm * ss, gamma * (beta * qB + k_cm * cs)) * 180/Math.PI;
|
||
|
let ZB0 = (gamma*beta* qB + gamma * k_cm * cs )/alpha_B; //mm
|
||
|
let rhoB = k_cm * ss/c/heavy[1]/BField * 1000; // mm
|
||
|
|
||
|
tableEx.rows[i].cells[8].innerHTML = EB.toFixed(3);
|
||
|
tableEx.rows[i].cells[9].innerHTML = thetaLab_B.toFixed(2);
|
||
|
tableEx.rows[i].cells[10].innerHTML = (ZB0/2).toFixed(2);
|
||
|
tableEx.rows[i].cells[11].innerHTML = (2*rhoB).toFixed(2);
|
||
|
|
||
|
var xxx = [];
|
||
|
var yyy = [];
|
||
|
|
||
|
for( let j = 0; j < 100 ; j++){
|
||
|
let thetaCM = Math.PI/Math.log10(100) * Math.log10(100/(100-j)) ;
|
||
|
let temp = 2* Math.PI * ez_slope / beta / k_cm * perpDistant / Math.sin(thetaCM);
|
||
|
if( !isFinite(temp) ) continue;
|
||
|
let pxTemp = beta /ez_slope * (gamma * beta * qb - gamma * k_cm * Math.cos(thetaCM)) * (1 - Math.asin(temp)/Math.PI/2) ;
|
||
|
let pyTemp = gamma * qb - light[2] - gamma * beta * k_cm * Math.cos(thetaCM);
|
||
|
if( !isNaN(pxTemp) && !isNaN(pyTemp) ){
|
||
|
xxx.push(pxTemp);
|
||
|
yyy.push(pyTemp);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
xList.push(xxx);
|
||
|
yList.push(yyy);
|
||
|
|
||
|
};
|
||
|
|
||
|
///------------- generate plot
|
||
|
|
||
|
for( let i = 1; i < nRow-1; i++){
|
||
|
if( i == 1 ){
|
||
|
var data = [
|
||
|
{ x : xList[0], y : yList[0], mode:"lines", type:"scatter"}
|
||
|
];
|
||
|
|
||
|
var layout = {
|
||
|
xaxis: {range: [-700, 0], title: "Z [mm]", mirror : "allticks", linewidth : "1"},
|
||
|
yaxis: {range: [0, 10], title: "Energy [MeV]" , mirror : "allticks", linewidth : "1"},
|
||
|
title: reactionName
|
||
|
};
|
||
|
|
||
|
Plotly.newPlot( "Plot_EZ", data, layout );
|
||
|
|
||
|
}else{
|
||
|
|
||
|
Plotly.addTraces("Plot_EZ", {x : xList[i-1], y: yList[i-1]});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
document.getElementById('beam').addEventListener('keypress',
|
||
|
function(e){
|
||
|
if(e.keyCode == 13){
|
||
|
Calculation();
|
||
|
}
|
||
|
}, false
|
||
|
);
|
||
|
|
||
|
document.getElementById('target').addEventListener('keypress',
|
||
|
function(e){
|
||
|
if(e.keyCode == 13){
|
||
|
Calculation();
|
||
|
}
|
||
|
}, false
|
||
|
);
|
||
|
|
||
|
document.getElementById('light').addEventListener('keypress',
|
||
|
function(e){
|
||
|
if(e.keyCode == 13){
|
||
|
Calculation();
|
||
|
}
|
||
|
}, false
|
||
|
);
|
||
|
|
||
|
document.getElementById('BField').addEventListener('keypress',
|
||
|
function(e){
|
||
|
if(e.keyCode == 13){
|
||
|
Calculation();
|
||
|
}
|
||
|
}, false
|
||
|
);
|
||
|
|
||
|
document.getElementById('beamEx').addEventListener('keypress',
|
||
|
function(e){
|
||
|
if(e.keyCode == 13){
|
||
|
Calculation();
|
||
|
}
|
||
|
}, false
|
||
|
);
|
||
|
|
||
|
document.getElementById('KEA').addEventListener('keypress',
|
||
|
function(e){
|
||
|
if(e.keyCode == 13){
|
||
|
Calculation();
|
||
|
}
|
||
|
}, false
|
||
|
);
|
||
|
|
||
|
window.logMeThis = function(msg){
|
||
|
Calculation();
|
||
|
}
|
||
|
var FuncEx = window.logMeThis.bind(null, "Ex");
|
||
|
window.addEventListener('keypress', FuncEx);
|
||
|
|
||
|
var FuncThetaCM = window.logMeThis.bind(null, "thetaCM");
|
||
|
window.addEventListener('keypress', FuncThetaCM);
|
||
|
|
||
|
var FuncThetaCM = window.logMeThis.bind(null, "SSType");
|
||
|
window.addEventListener('click', FuncThetaCM);
|
||
|
|
||
|
|
||
|
Calculation();
|
||
|
</script>
|
||
|
|
||
|
|
||
|
<html>
|