Skip to content

Commit

Permalink
Fix bug in CSV output of making a detector response function.
Browse files Browse the repository at this point in the history
The Detection efficiency was off by the live time of the measurement (i.e., was dividing peak area by source CPS).
  • Loading branch information
wcjohns committed Aug 17, 2024
1 parent 673d53d commit 7024e72
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/MakeDrf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7024e72

Please sign in to comment.