Skip to content

Commit

Permalink
Merge pull request #107 from rest-for-physics/lobis-fix-negative-times
Browse files Browse the repository at this point in the history
Fix negative time due to overflow
  • Loading branch information
lobis authored Feb 28, 2024
2 parents f2fc15f + 9fb15fb commit ab3f747
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/TRestDetectorHitsToSignalProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ TRestEvent* TRestDetectorHitsToSignalProcess::ProcessEvent(TRestEvent* inputEven
if (GetVerboseLevel() >= TRestStringOutput::REST_Verbose_Level::REST_Extreme) {
cout << "Drift velocity : " << fDriftVelocity << " mm/us" << endl;
}
time = ((Int_t)(time / fSampling)) * fSampling; // now time is in unit "us", but dispersed

time = floor(time / fSampling) * fSampling;

fSignalEvent->AddChargeToSignal(daqId, time, energy);

Expand Down

0 comments on commit ab3f747

Please sign in to comment.