Skip to content

Commit

Permalink
small fix for zero energy (#117)
Browse files Browse the repository at this point in the history
* fix random bug

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
lobis and pre-commit-ci[bot] authored May 10, 2024
1 parent 41f054e commit c1a601b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/TRestDetectorHitsReadoutAnalysisProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ TRestEvent* TRestDetectorHitsReadoutAnalysisProcess::ProcessEvent(TRestEvent* in
const auto time = fInputHitsEvent->GetTime(hitIndex);
const auto type = fInputHitsEvent->GetType(hitIndex);

if (energy <= 0) {
if (energy == 0) {
continue;
} else if (energy < 0) {
// this should never happen
cerr << "TRestDetectorHitsReadoutAnalysisProcess::ProcessEvent() : "
<< "Negative or zero energy found in hit " << hitIndex << endl;
<< "Negative energy found in hit " << hitIndex << endl;
exit(1);
}

Expand Down

0 comments on commit c1a601b

Please sign in to comment.