Skip to content

Commit

Permalink
Final changes: more segmentation fault protection, 220Rn file comment…
Browse files Browse the repository at this point in the history
…s. -MMS
  • Loading branch information
”szydagis” committed Jun 23, 2020
1 parent 746c70e commit 566fa98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/220RnCalib.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

#!/bin/bash
#Be sure to turn off verbosity in analysis.hh for best results!
rm Pb212.dat;
# Be sure to turn off verbosity in analysis.hh for best results!
# And add standard header to Pb212.dat before attempting to run rootNEST
rm Pb212.dat &> /dev/null;

./testNEST 740 beta .125017 1.39536 -1 -1 0 >> Pb212.dat 2> /dev/null
./testNEST 955 beta 1.39536 3.89835 -1 -1 0 >> Pb212.dat 2> /dev/null
Expand Down Expand Up @@ -213,3 +214,4 @@ rm Pb212.dat;
./testNEST 1491 gamma 540 550 -1 -1 0 >> Pb212.dat 2> /dev/null

#SOURCE: arXiv:1602.01138 R.F. Lang et al. "A 220Rn source for..."
# the calibration of low-background experiments" JINST 11 P04004
2 changes: 2 additions & 0 deletions src/testNEST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,8 @@ vector<vector<double>> GetBand(vector<double> S1s, vector<double> S2s,
if (resol) band[j][0] /= numPts;
band[j][1] /= numPts;
band[j][2] /= numPts;
if ( numPts > signals[j].size() )
numPts = signals[j].size(); // seg fault prevention line
for (i = 0; i < (int)numPts; i++) {
if (signals[j][i] != -999.)
band[j][3] += pow(signals[j][i] - band[j][2], 2.); // std dev calc
Expand Down

0 comments on commit 566fa98

Please sign in to comment.