Skip to content

Commit

Permalink
implemented view for beta particle eff as a function of Q
Browse files Browse the repository at this point in the history
  • Loading branch information
bkatiemills committed Nov 29, 2013
1 parent 4b5a390 commit 6f82f97
Show file tree
Hide file tree
Showing 5 changed files with 281 additions and 74 deletions.
20 changes: 14 additions & 6 deletions efficiencyWidget.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ h1#title{

/*graph///////////////////////////////////////////////////////*/
/*container div*/
#graphDiv{
#graphDiv, #betaGraphDiv{
margin-bottom: 1em;
height: 50em;
width: 70%;
Expand Down Expand Up @@ -193,7 +193,7 @@ h2.widgetTitle{
text-align: center;
}

input.widgetInput, input#filename{
input.widgetInput, input#filename, input#betaFilename{
background-color: #444444;
border-radius: 5px;
color: #CCCCCC;
Expand Down Expand Up @@ -253,7 +253,7 @@ div.leftDiv{
}

/*Control Panel/////////////////////////////////////////////////////*/
div#controlPanel{
div#controlPanel, div#betaControlPanel{
float:right;
width:28%;
min-width:-webkit-max-content;
Expand All @@ -263,7 +263,7 @@ div#controlPanel{
padding: 1em;
}

div.detectorSwitch, a#savePlot{
div.detectorSwitch, a#savePlot, a#saveBetaPlot{
display:inline-block;
padding:1em;
height:3em;
Expand All @@ -274,14 +274,18 @@ div.detectorSwitch, a#savePlot{
-moz-transition: background-color 0.3s;
}

a#savePlot{
a#savePlot, a#saveBetaPlot{
color:#FFFFFF;
text-decoration: none;
font-size: 100%;
padding:1em;
}

input#filename{
a#savePlot:hover, a#saveBetaPlot:hover{
background:#777777;
}

input#filename, input#betaFilename{
width:15em;
text-align: left;
font-size: 100%;
Expand Down Expand Up @@ -330,6 +334,10 @@ div.optionalParameters{
border-top: 1px solid #999999;
}

div#enableSCEPTAR{
background-color: #c0392b;
}

/*img holder for savable data///////////////////////////////////////*/
img#pngDump{
display:none;
Expand Down
14 changes: 9 additions & 5 deletions functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,17 @@ function DESCANTefficiency(logE){

//SCEPTAR simulation
function SCEPTAREfficiency(param, loParam, hiParam, logE){
var logEff = 0,
eff;
var eff,
Q = Math.exp(logE),
leptonOptions = document.getElementById('lepton'),
lepton = leptonOptions.options[leptonOptions.selectedIndex].value;

if(Q<100)
return '0;0;0';

//Evan & Carl requested the 0.8 hack-in instead of param[6]
logEff = 0.8*(1-1/(Math.exp((logE-param[0])/param[1])+1)-1/(Math.exp((logE-param[2])/param[3])+1)-1/(Math.exp((logE-param[4])/param[5])+1));
eff = Math.exp(logEff);
eff = Math.max(eff, 0.00065);
eff = 0.8*(1-1/(Math.exp((Q-param[0])/param[1])+1)-1/(Math.exp((Q-param[2])/param[3])+1)-1/(Math.exp((Q-param[4])/param[5])+1));
if(lepton == 1) eff = Math.max(eff, 0.00065); //only for positrons

return eff + ';' + eff + ';' + eff;
}
Expand Down
66 changes: 52 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ <h1 id='title'>GRIFFIN</h1>
<button id='BrIcc' class='standardButton'>BrIcc</button>
</div>

<x-deck id='plots'>
<!--x-deck contains two views: one for eff(E) for gammas, and one for eff(Q) for betas-->
<x-deck id='plots' selected-index='0'>
<x-card id='gamma'>
<!--Graph///////////////////////////////////////////////////////////-->
<div id='graphDiv'></div>
Expand All @@ -95,7 +96,7 @@ <h2 id='controlTitle' class='widgetTitle'>Plot Options</h2>
<div id='enableHPGe' class='detectorSwitch'>HPGe</div>
<div id='enableLaBr3' class='detectorSwitch'>LaBr3</div>
<div id='enableSiLi' class='detectorSwitch'>Si(Li)</div>
<button id='toBetaPlots' class='standardButton'>To &#946 Plots</button>
<button id='toBetaPlots' class='standardButton' type='button'>To &#946 Plots</button>

<br><br>
<input id='xMin' class='widgetInput' type='number' value='10' min='0' step='any'></input>
Expand Down Expand Up @@ -151,8 +152,47 @@ <h2 id='controlTitle' class='widgetTitle'>Plot Options</h2>
</select>

</div>
<br>
<a id='savePlot' download='efficiencyPlot.png'>Save Plot</a>
<input id='filename', type='text' value='efficiencyPlot.png'></input>
</form>
</div>
</x-card>

<!--div id='SCEPTARControl' class='optionalParameters'>
<x-card id='beta'>
<!--Graph///////////////////////////////////////////////////////////-->
<div id='betaGraphDiv'></div>

<!--Control Panel///////////////////////////////////////////////////-->
<div id='betaControlPanel'>
<form id='betaPlotOptions'>
<h2 id='betaControlTitle' class='widgetTitle'>Plot Options</h2>

<div id='enableSCEPTAR' class='detectorSwitch'>SCEPTAR</div>
<button id='toGammaPlots' class='standardButton' type='button'>To &#947 Plots</button>

<br><br>
<input id='betaxMin' class='widgetInput' type='number' value='10' min='0' step='any'></input>
<label id='betaxMinLabel' class='inputLabel' for='betaxMin'>< Q <</label>
<input id='betaxMax' class='widgetInput' type='number' value='3000' step='any'></input>
<label id='betaxMaxLabel' class='inputLabel' for='betaxMax' step='any'>keV</label>
<select id='betaxScale'>
<option value='lin'>Linear</option>
<option value='log'>Log</option>
</select>

<br><br>
<input id='betayMin' class='widgetInput' type='number' value='null' min='0' step='any'></input>
<label id='betayMinLabel' class='inputLabel' for='betayMin'>< Effic. <</label>
<input id='betayMax' class='widgetInput' type='number' value='null' step='any'></input>
<select id='betayScale'>
<option value='false'>Linear</option>
<option value='true'>Log</option>
</select>

<br><br>

<div id='SCEPTARControl' class='optionalParameters'>
<br>
<label id='leptonLabel' class='inputLabel' for='lepton'>&#946 Decay: </label>
<select id='lepton'>
Expand Down Expand Up @@ -181,19 +221,14 @@ <h2 id='controlTitle' class='widgetTitle'>Plot Options</h2>
<option value='100'>100</option>
</select>
<label id='betaThresholdUnit' class='inputLabel', for='betaThreshold'> keV</label>
</div-->
</div>

<br>
<a id='savePlot' download='efficiencyPlot.png'>Save Plot</a>
<input id='filename', type='text' value='efficiencyPlot.png'></input>
<a id='saveBetaPlot' download='efficiencyPlot.png'>Save Plot</a>
<input id='betaFilename', type='text' value='efficiencyPlot.png'></input>
</form>
</div>
</x-card>

<x-card id='beta'>
<h2>Beta Test</h2>
</x-card>
</x-deck>

<!--Widgets///////////////////////////////////////////////////////////-->
Expand All @@ -206,6 +241,7 @@ <h2 id='singlesWidgetTitle' class='widgetTitle'>Singles</h2>
<option value='HPGe'>HPGe</option>
<option value='LaBr3'>LaBr3</option>
<option value='SiLi'>Si(Li)</option>
<option value='SCEPTAR'>SCEPTAR</option>
</select>
<label id='singlesDetectorsLabel' class='inputLabel' for='singlesDetectors'>at</label>
<input id='singlesInputEnergy' class='widgetInput' type='number' value='100' min='0' step='any'></input>
Expand Down Expand Up @@ -248,6 +284,7 @@ <h2 id='coincWidgetTitle' class='widgetTitle'>Coincidences</h2>
<option value='HPGe'>HPGe</option>
<option value='LaBr3'>LaBr3</option>
<option value='SiLi'>Si(Li)</option>
<option value='SCEPTAR'>SCEPTAR</option>
</select>
<label id='coincDetectorsAlabel' class='inputLabel' for='coincDetectorsA'>at</label>
<input id='coincEnergy1' class='widgetInput' type='number' value='100' min='0' step='any'></input>
Expand All @@ -259,6 +296,7 @@ <h2 id='coincWidgetTitle' class='widgetTitle'>Coincidences</h2>
<option value='HPGe'>HPGe</option>
<option value='LaBr3'>LaBr3</option>
<option value='SiLi'>Si(Li)</option>
<option value='SCEPTAR'>SCEPTAR</option>
</select>
<label id='coincDetectorsBlabel' class='inputLabel' for='coincDetectorsB'>at</label>
<input id='coincEnergy2' class='widgetInput' type='number' value='100' min='0' step='any'></input>
Expand Down Expand Up @@ -301,8 +339,8 @@ <h2 id='triplesWidgetTitle' class='widgetTitle'>Triples</h2>
<option value='HPGe'>HPGe</option>
<option value='LaBr3'>LaBr3</option>
<option value='SiLi'>Si(Li)</option>
<option value='DESCANT'>DESCANT</option>
<option value='SCEPTAR'>&#946 Tag (SCEPTAR)</option>
<option value='DESCANT'>DESCANT</option>
<option value='SCEPTARZDS'>&#946 Tag (SCEPTAR + ZDS)</option>
<option value='SCEPTARPACES'>&#946 Tag (SCEPTAR + Si(Li))</option>
<option value='PACESZDS'>&#946 Tag (Si(Li) + ZDS)</option>
Expand All @@ -317,8 +355,8 @@ <h2 id='triplesWidgetTitle' class='widgetTitle'>Triples</h2>
<option value='HPGe'>HPGe</option>
<option value='LaBr3'>LaBr3</option>
<option value='SiLi'>Si(Li)</option>
<option value='DESCANT'>DESCANT</option>
<option value='SCEPTAR'>&#946 Tag (SCEPTAR)</option>
<option value='DESCANT'>DESCANT</option>
<option value='SCEPTARZDS'>&#946 Tag (SCEPTAR + ZDS)</option>
<option value='SCEPTARPACES'>&#946 Tag (SCEPTAR + Si(Li))</option>
<option value='PACESZDS'>&#946 Tag (Si(Li) + ZDS)</option>
Expand All @@ -333,8 +371,8 @@ <h2 id='triplesWidgetTitle' class='widgetTitle'>Triples</h2>
<option value='HPGe'>HPGe</option>
<option value='LaBr3'>LaBr3</option>
<option value='SiLi'>Si(Li)</option>
<option value='DESCANT'>DESCANT</option>
<option value='SCEPTAR'>&#946 Tag (SCEPTAR)</option>
<option value='DESCANT'>DESCANT</option>
<option value='SCEPTARZDS'>&#946 Tag (SCEPTAR + ZDS)</option>
<option value='SCEPTARPACES'>&#946 Tag (SCEPTAR + Si(Li))</option>
<option value='PACESZDS'>&#946 Tag (Si(Li) + ZDS)</option>
Expand Down
Loading

0 comments on commit 6f82f97

Please sign in to comment.