Skip to content

Commit

Permalink
Fixing small bug when target_pitch is best_pitch
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Granado committed Oct 23, 2024
1 parent 75ccaec commit c26b199
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/digits_hits/src/GateVirtualSegmentationSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ G4double GateVirtualSegmentationSD::calculatePitch(G4double crystal_size, G4doub
double min_diff = 999;
int num_pitches = 1;

if (std::fmod(crystal_size, target_pitch) == 0) return target_pitch;

while (true) {
double pitch = crystal_size / num_pitches;

Expand Down

0 comments on commit c26b199

Please sign in to comment.