From 10a24f0c2cc4d659ea71fdd12436817acf44dd48 Mon Sep 17 00:00:00 2001 From: redford_s Date: Tue, 4 Apr 2017 13:52:52 +0200 Subject: [PATCH] Check that there's more than one entry for the mean measurement, otherwise the uncertainty is 0. Only alters linearity plots. --- JFMC_CurrentSourceScan.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/JFMC_CurrentSourceScan.cpp b/JFMC_CurrentSourceScan.cpp index 54a62b6..b3e4043 100644 --- a/JFMC_CurrentSourceScan.cpp +++ b/JFMC_CurrentSourceScan.cpp @@ -413,7 +413,7 @@ int main(int argc, char* argv[]) { vector r3_adcerr; vector r3_ferr; - // filter out points at zero + // filter out points at zero and points with 0 error (mean taken from one entry in hist) int m_max = 0; if (module_str == "032" || module_str == "021" || module_str == "022" || module_str == "044") { m_max = 27; @@ -422,13 +422,13 @@ int main(int argc, char* argv[]) { } for (int m = 0; m < m_max; m++) { - if (adcmeans_g1[i][m] != 0) { + if (adcmeans_g1[i][m] != 0 && adcmeanerrs_g1[i][m] != 0) { r1_adc.push_back(adcmeans_g1[i][m]); r1_filter.push_back(filter[m]); r1_adcerr.push_back(adcmeanerrs_g1[i][m]); r1_ferr.push_back(0.); } - if (adcmeans_g2[i][m] != 0) { + if (adcmeans_g2[i][m] != 0 && adcmeanerrs_g2[i][m] != 0) { r3_adc.push_back(adcmeans_g2[i][m]); r3_filter.push_back(filter[m]); r3_adcerr.push_back(adcmeanerrs_g2[i][m]);