Skip to content

Commit

Permalink
Merge pull request #7 from BillMills/master
Browse files Browse the repository at this point in the history
SCEPTAR O(1)
  • Loading branch information
bkatiemills committed Jan 10, 2014
2 parents c1460fc + 148cc22 commit 97e9fa8
Show file tree
Hide file tree
Showing 7 changed files with 204 additions and 12 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
168 changes: 168 additions & 0 deletions chewSCEPTAR.py
Original file line number Diff line number Diff line change
@@ -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('}');

21 changes: 20 additions & 1 deletion efficiencyWidget.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ <h2 id='triplesWidgetTitle' class='widgetTitle'>Triples</h2>
</div>

<div id='footer'>
GRIFFIN 2013 - Powered by <a href="http://dygraphs.com/">Dygraphs.js</a>
GRIFFIN 2013 - Powered by <a href="http://dygraphs.com/">Dygraphs.js</a> & <a href="http://mozilla.github.io/brick/">Brick</a>
<br>
GRIFFIN Collaboration Spokesperson: Adam Garnsworthy ([email protected]) - GEANT4 Simulations: Evan Rand - UI/UX Design & Web Development: Bill Mills
</div>
Expand Down
15 changes: 8 additions & 7 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br><br>';
detailMessage +='LaBr3 GEANT4 Simulation: 8th order polynomial fit above 40 keV including SCEPTAR and<br>Delrin vacuum chamber.<br><br>'
detailMessage +='Si(Li) Simulation: Relative Efficiency curve shape based on formalism referenced in<br>Radiation Detection & Measurement (G.F. Knoll, Wiley 2000).<br>'
detailMessage +='An absolute normalization is applied per Masters Thesis of Ryan Dunlop, University of Guelph, 2012,<br>High-precision branching ratio measurement for the superallowed beta+ emitter 74Rb, based on<br>the analysis of in-beam 80Rb decay.<br><br>'
detailMessage +='SCEPTAR GEANT4 Simulation: triple Fermi function fit adjusted to asymptotically approach 0.8<br>'
detailMessage +='at high Q per experiment.<br><br>'
detailMessage +='LaBr3 GEANT4 Simulation: 8th order polynomial fit above 40 keV including SCEPTAR and Delrin vacuum chamber.<br><br>'
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.<br><br>'
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.<br><br>'
detailMessage +='The following four configuration efficiencies are based on solid angle coverage of detectors:<br>'
detailMessage +='DESCANT: 27% efficient between 1 and 5 MeV; efficiency lower outside this range, and no value is<br>reported here.<br>'
detailMessage +='DESCANT: 27% efficient between 1 and 5 MeV; efficiency lower outside this range, and no value is reported here.<br>'
detailMessage +='SCEPTAR + ZDS: 65% efficient.<br>'
detailMessage +='SCEPTAR + PACES: 40% efficient.<br>'
detailMessage +='PACES + ZDS: 25% efficient.'
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <e1> and <e2>
//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)();
Expand Down

0 comments on commit 97e9fa8

Please sign in to comment.