diff --git a/README.md b/README.md index 554ea08..a6dc1db 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,7 @@ http://dygraphs.com/ and an add on for image saving: http://cavorite.com/labs/js/dygraphs-export/ -Our many thanks to the developers who contributed to these packages! +and the fabulous brick x-tags library from Mozilla: +http://mozilla.github.io/brick/index.html + +Our many thanks to the developers who contributed to these packages! efficiencyTracker is available under the MIT license. diff --git a/chewSCEPTAR.py b/chewSCEPTAR.py new file mode 100644 index 0000000..ee6c0c5 --- /dev/null +++ b/chewSCEPTAR.py @@ -0,0 +1,168 @@ + +parameters = open('fitParamsSCEPTAR.js', 'w'); + +parameters.write('function loadSCEPTARParameters(){\n'); +parameters.write('\tSCEPTARCoef = {};\n'); + +evan = [ + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z1/Z1/g4FitResults_thres0.000MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z1/Z1/g4FitResults_thres0.025MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z1/Z1/g4FitResults_thres0.050MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z1/Z1/g4FitResults_thres0.075MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z1/Z1/g4FitResults_thres0.100MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z5/Z5/g4FitResults_thres0.000MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z5/Z5/g4FitResults_thres0.025MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z5/Z5/g4FitResults_thres0.050MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z5/Z5/g4FitResults_thres0.075MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z5/Z5/g4FitResults_thres0.100MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z10/Z10/g4FitResults_thres0.000MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z10/Z10/g4FitResults_thres0.025MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z10/Z10/g4FitResults_thres0.050MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z10/Z10/g4FitResults_thres0.075MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z10/Z10/g4FitResults_thres0.100MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z25/Z25/g4FitResults_thres0.000MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z25/Z25/g4FitResults_thres0.025MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z25/Z25/g4FitResults_thres0.050MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z25/Z25/g4FitResults_thres0.075MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z25/Z25/g4FitResults_thres0.100MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z50/Z50/g4FitResults_thres0.000MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z50/Z50/g4FitResults_thres0.025MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z50/Z50/g4FitResults_thres0.050MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z50/Z50/g4FitResults_thres0.075MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z50/Z50/g4FitResults_thres0.100MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z75/Z75/g4FitResults_thres0.000MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z75/Z75/g4FitResults_thres0.025MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z75/Z75/g4FitResults_thres0.050MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z75/Z75/g4FitResults_thres0.075MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z75/Z75/g4FitResults_thres0.100MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z100/Z100/g4FitResults_thres0.000MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z100/Z100/g4FitResults_thres0.025MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z100/Z100/g4FitResults_thres0.050MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z100/Z100/g4FitResults_thres0.075MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v22_Sceptar_Full_Electron/Z100/Z100/g4FitResults_thres0.100MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z1/Z1/g4FitResults_thres0.000MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z1/Z1/g4FitResults_thres0.025MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z1/Z1/g4FitResults_thres0.050MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z1/Z1/g4FitResults_thres0.075MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z1/Z1/g4FitResults_thres0.100MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z5/Z5/g4FitResults_thres0.000MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z5/Z5/g4FitResults_thres0.025MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z5/Z5/g4FitResults_thres0.050MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z5/Z5/g4FitResults_thres0.075MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z5/Z5/g4FitResults_thres0.100MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z10/Z10/g4FitResults_thres0.000MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z10/Z10/g4FitResults_thres0.025MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z10/Z10/g4FitResults_thres0.050MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z10/Z10/g4FitResults_thres0.075MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z10/Z10/g4FitResults_thres0.100MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z25/Z25/g4FitResults_thres0.000MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z25/Z25/g4FitResults_thres0.025MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z25/Z25/g4FitResults_thres0.050MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z25/Z25/g4FitResults_thres0.075MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z25/Z25/g4FitResults_thres0.100MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z50/Z50/g4FitResults_thres0.000MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z50/Z50/g4FitResults_thres0.025MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z50/Z50/g4FitResults_thres0.050MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z50/Z50/g4FitResults_thres0.075MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z50/Z50/g4FitResults_thres0.100MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z75/Z75/g4FitResults_thres0.000MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z75/Z75/g4FitResults_thres0.025MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z75/Z75/g4FitResults_thres0.050MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z75/Z75/g4FitResults_thres0.075MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z75/Z75/g4FitResults_thres0.100MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z100/Z100/g4FitResults_thres0.000MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z100/Z100/g4FitResults_thres0.025MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z100/Z100/g4FitResults_thres0.050MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z100/Z100/g4FitResults_thres0.075MeV_Max.txt', + '/Users/billmills/Desktop/SCEPTAR_Sims/v23_Sceptar_Full_Positron/Z100/Z100/g4FitResults_thres0.100MeV_Max.txt' + ] + +keys = [ + '-110', + '-1125', + '-1150', + '-1175', + '-11100', + '-150', + '-1525', + '-1550', + '-1575', + '-15100', + '-1100', + '-11025', + '-11050', + '-11075', + '-110100', + '-1250', + '-12525', + '-12550', + '-12575', + '-125100', + '-1500', + '-15025', + '-15050', + '-15075', + '-150100', + '-1750', + '-17525', + '-17550', + '-17575', + '-175100', + '-11000', + '-110025', + '-110050', + '-110075', + '-1100100', + '110', + '1125', + '1150', + '1175', + '11100', + '150', + '1525', + '1550', + '1575', + '15100', + '1100', + '11025', + '11050', + '11075', + '110100', + '1250', + '12525', + '12550', + '12575', + '125100', + '1500', + '15025', + '15050', + '15075', + '150100', + '1750', + '17525', + '17550', + '17575', + '175100', + '11000', + '110025', + '110050', + '110075', + '1100100' + ] + +for j in range(0,70): + + f = open(evan[j], 'r'); + for i in range(0,6): + f.readline(); + + coef = '\tSCEPTARCoef[\'' + keys[j] + '\'] = ['; + for line in f: + coef += line.split('\t')[2] + ','; + + coef = coef[:-1]; + coef += '];\n'; + parameters.write(coef); + +parameters.write('}'); + diff --git a/efficiencyWidget.css b/efficiencyWidget.css index 1e99753..7fe25d6 100644 --- a/efficiencyWidget.css +++ b/efficiencyWidget.css @@ -358,14 +358,33 @@ img#pngDump{ border-radius:10px; top:100px; padding:2em; - max-height: 800px; + max-height: 80%; overflow:scroll; + width: 50%; } .tempDialog a{ color: #9999FF; } +/*force scrollbar to appear in Chrome*/ +::-webkit-scrollbar { + width: 7px; + height: 0px; /*suppresses horizontal scroll*/ +} + +::-webkit-scrollbar-track +{ + background-color: rgba(0,0,0,0); + width:11px; +} + +::-webkit-scrollbar-thumb { + border-radius: 4px; + background-color: #777777; + opacity: 0.5; +} + /*Footer and footer-related styles////////////////////////////////////////////////////*/ div#footer{ background-color: #999999; diff --git a/functions.js b/functions.js index 3eba78b..e31b5e0 100644 --- a/functions.js +++ b/functions.js @@ -69,7 +69,7 @@ function DESCANTefficiency(logE){ //SCEPTAR simulation function SCEPTAREfficiency(param, loParam, hiParam, logE){ var eff, - Q = Math.exp(logE), + Q = Math.exp(logE), //this fit was done in a linear-linear space, but we still pass in logE for consistency upstream from here. leptonOptions = document.getElementById('lepton'), lepton = leptonOptions.options[leptonOptions.selectedIndex].value; @@ -79,6 +79,7 @@ function SCEPTAREfficiency(param, loParam, hiParam, logE){ //Evan & Carl requested the 0.8 hack-in instead of param[6] 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 + eff = Math.max(eff, 0); //negative excursions occur at energies ~100 keV for electrons, suppress. return eff + ';' + eff + ';' + eff; } diff --git a/index.html b/index.html index 90cdb08..17f4fee 100644 --- a/index.html +++ b/index.html @@ -419,7 +419,7 @@

Triples

diff --git a/main.js b/main.js index 074433c..d3c404d 100644 --- a/main.js +++ b/main.js @@ -7,13 +7,13 @@ function setup(){ switchToBeta = document.getElementById('toBetaPlots'), switchToGamma = document.getElementById('toGammaPlots'), detailMessage = 'HPGe GEANT4 Simulation: 8th order polynomial fit including SCEPTAR and Delrin vacuum chamber.

'; - detailMessage +='LaBr3 GEANT4 Simulation: 8th order polynomial fit above 40 keV including SCEPTAR and
Delrin vacuum chamber.

' - detailMessage +='Si(Li) Simulation: Relative Efficiency curve shape based on formalism referenced in
Radiation Detection & Measurement (G.F. Knoll, Wiley 2000).
' - detailMessage +='An absolute normalization is applied per Masters Thesis of Ryan Dunlop, University of Guelph, 2012,
High-precision branching ratio measurement for the superallowed beta+ emitter 74Rb, based on
the analysis of in-beam 80Rb decay.

' - detailMessage +='SCEPTAR GEANT4 Simulation: triple Fermi function fit adjusted to asymptotically approach 0.8
' - detailMessage +='at high Q per experiment.

' + detailMessage +='LaBr3 GEANT4 Simulation: 8th order polynomial fit above 40 keV including SCEPTAR and Delrin vacuum chamber.

' + detailMessage +='Si(Li) Simulation: Relative Efficiency curve shape based on formalism referenced in Radiation Detection & Measurement (G.F. Knoll, Wiley 2000). An ' + detailMessage +='absolute normalization is applied per Masters Thesis of Ryan Dunlop, University of Guelph, 2012, "High-precision branching ratio measurement for the superallowed beta+ emitter 74Rb", based on the analysis of in-beam 80Rb decay.

' + detailMessage +='SCEPTAR GEANT4 Simulation: triple Fermi function fit adjusted to asymptotically approach 0.8 ' + detailMessage +='at high Q per experiment. Low-Q position efficiencies fixed to 0.065% per simulated annihilation photopeak efficiency.

' detailMessage +='The following four configuration efficiencies are based on solid angle coverage of detectors:
' - detailMessage +='DESCANT: 27% efficient between 1 and 5 MeV; efficiency lower outside this range, and no value is
reported here.
' + detailMessage +='DESCANT: 27% efficient between 1 and 5 MeV; efficiency lower outside this range, and no value is reported here.
' detailMessage +='SCEPTAR + ZDS: 65% efficient.
' detailMessage +='SCEPTAR + PACES: 40% efficient.
' detailMessage +='PACES + ZDS: 25% efficient.' @@ -128,7 +128,8 @@ function setup(){ }; document.getElementById('details').onclick = function(){ - confirm('GRIFFIN Simulated Efficiency Calculator', detailMessage) + if(!document.getElementById('warning')) + confirm('GRIFFIN Simulated Efficiency Calculator', detailMessage) }; //make sure the plot area is a sane size: diff --git a/widget.js b/widget.js index 16b3906..c25aa45 100644 --- a/widget.js +++ b/widget.js @@ -109,7 +109,7 @@ function computeTriples(){ nCounts = parseFloat(document.getElementById('nTriples').value), eff1, eff2, eff3, efficiency, nSeconds, unit, countingFactor; - //choose the appropriate function and evaluate it at and + //choose the appropriate function and evaluate them eff1 = chooseFunction(detectorA).bind(null, e1)(); eff1 = parseFloat(eff1.slice(eff1.indexOf(';')+1, eff1.lastIndexOf(';') )); eff2 = chooseFunction(detectorB).bind(null, e2)();