Skip to content

Commit

Permalink
troubleshoot
Browse files Browse the repository at this point in the history
  • Loading branch information
lobis committed Mar 7, 2024
1 parent bed83f7 commit 85e1cd0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions inc/TRestDetectorSignal.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ class TRestDetectorSignal {
Double_t GetMinTime() const;
Double_t GetMaxTime() const;

Double_t GetData(Int_t index) const { return (double)fSignalCharge[index]; }
Double_t GetTime(Int_t index) const { return (double)fSignalTime[index]; }
Double_t GetData(Int_t index) const { return fSignalCharge[index]; }
Double_t GetTime(Int_t index) const { return fSignalTime[index]; }

// Setters
void SetSignalID(Int_t sID) { fSignalID = sID; }
Expand Down
6 changes: 6 additions & 0 deletions src/TRestDetectorHitsToSignalProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ TRestEvent* TRestDetectorHitsToSignalProcess::ProcessEvent(TRestEvent* inputEven

fSignalEvent->SortSignals();

const auto minTime = fSignalEvent->GetMinTime();
if (minTime < 0) {
RESTError << "TRestDetectorHitsToSignalProcess: Negative time. This should not happen." << RESTendl;
exit(1);
}

if (GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Debug) {
cout << "TRestDetectorHitsToSignalProcess : Number of signals added : "
<< fSignalEvent->GetNumberOfSignals() << endl;
Expand Down
6 changes: 5 additions & 1 deletion src/TRestDetectorSignal.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,11 @@ Double_t TRestDetectorSignal::GetMinTime() const {
Double_t minTime = numeric_limits<Double_t>::max();
bool found = false;
for (int i = 0; i < GetNumberOfPoints(); i++) {
const auto time = GetTime(i);
const Double_t time = GetTime(i);
if (time < 0) {
RESTWarning << "TRestDetectorSignal::GetMinTime - Negative time value in signal " << fSignalID
<< " at time " << time << " at index " << i << RESTendl;
}
if (time < minTime) {
minTime = time;
found = true;
Expand Down

0 comments on commit 85e1cd0

Please sign in to comment.