From 7024e72a06e303bfd63f461825e70f8eeb7d0df7 Mon Sep 17 00:00:00 2001 From: William Johnson Date: Fri, 16 Aug 2024 19:44:56 -0700 Subject: [PATCH] Fix bug in CSV output of making a detector response function. The Detection efficiency was off by the live time of the measurement (i.e., was dividing peak area by source CPS). --- src/MakeDrf.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MakeDrf.cpp b/src/MakeDrf.cpp index 56959838..28156cf6 100644 --- a/src/MakeDrf.cpp +++ b/src/MakeDrf.cpp @@ -3511,7 +3511,8 @@ void MakeDrf::writeCsvSummary( std::ostream &out, { SpecUtils::ireplace_all( d.source_information, ",", " "); - const double deteff = d.peak_area / d.source_count_rate; + const double peakCps = d.peak_area / d.livetime; + const double deteff = peakCps / d.source_count_rate; const double deteffUncert = deteff * sqrt( pow(d.peak_area_uncertainty/d.peak_area,2) + pow(d.source_count_rate_uncertainty/d.source_count_rate,2) ); const double geomFactor = (d.distance < 0.0) ? 1.0 : DetectorPeakResponse::fractionalSolidAngle(diam, d.distance);