From 63fb132fc4ecbdf47498b8414c2050a9f75d477c Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Fri, 25 Oct 2024 23:38:25 +0200 Subject: [PATCH 1/2] do not error on negative energy (why?) --- src/TRestDetectorHitsReadoutAnalysisProcess.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/TRestDetectorHitsReadoutAnalysisProcess.cxx b/src/TRestDetectorHitsReadoutAnalysisProcess.cxx index ef371fab..0221cdc1 100644 --- a/src/TRestDetectorHitsReadoutAnalysisProcess.cxx +++ b/src/TRestDetectorHitsReadoutAnalysisProcess.cxx @@ -24,10 +24,11 @@ TRestEvent* TRestDetectorHitsReadoutAnalysisProcess::ProcessEvent(TRestEvent* in if (energy == 0) { continue; } else if (energy < 0) { - // this should never happen + // This should never happen. Why does it happen? cerr << "TRestDetectorHitsReadoutAnalysisProcess::ProcessEvent() : " - << "Negative energy found in hit " << hitIndex << endl; - exit(1); + << "Negative energy found in hit " << hitIndex << ". Energy (keV): " << energy << endl; + // exit(1); + continue; // We should error, but for now we just skip the hit } // when working with hits derived from experimental data, only relative z is available, so it cannot // be used to check if a position is inside the readout. We use z=0 in this case which in most cases From 04dec5ed7134a6dc99332b690b41d2217210bcbb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 25 Oct 2024 21:39:36 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/TRestDetectorHitsReadoutAnalysisProcess.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TRestDetectorHitsReadoutAnalysisProcess.cxx b/src/TRestDetectorHitsReadoutAnalysisProcess.cxx index 0221cdc1..862b2f27 100644 --- a/src/TRestDetectorHitsReadoutAnalysisProcess.cxx +++ b/src/TRestDetectorHitsReadoutAnalysisProcess.cxx @@ -28,7 +28,7 @@ TRestEvent* TRestDetectorHitsReadoutAnalysisProcess::ProcessEvent(TRestEvent* in cerr << "TRestDetectorHitsReadoutAnalysisProcess::ProcessEvent() : " << "Negative energy found in hit " << hitIndex << ". Energy (keV): " << energy << endl; // exit(1); - continue; // We should error, but for now we just skip the hit + continue; // We should error, but for now we just skip the hit } // when working with hits derived from experimental data, only relative z is available, so it cannot // be used to check if a position is inside the readout. We use z=0 in this case which in most cases