Skip to content

Commit ad302ca

Browse files
authored
Merge pull request #592 from sungbinoh/feature/sungbino_debug_same_start_end_dev
Bug fix for the exactly the same start and end positions for particles from neutrino interactions in AV - To develop
2 parents 7c82c2e + 4d6b420 commit ad302ca

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

sbncode/CAFMaker/FillTrue.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,9 @@ namespace caf {
777777
if (exit_point < 0 && entry_point >= 0) {
778778
exit_point = particle.NumberTrajectoryPoints() - 1;
779779
}
780+
if(exit_point >= 0 && entry_point >=0 && exit_point == entry_point && exit_point < static_cast<int>(particle.NumberTrajectoryPoints()) - 1){
781+
exit_point++; // to avoid exactly the same start and end positions when single index is inside the active volumne
782+
}
780783
if (exit_point >= 0 && ((unsigned)exit_point) < particle.NumberTrajectoryPoints() - 1) {
781784
srparticle.wallout = GetWallCross(active_volumes.at(cryostat_index), particle.Position(exit_point).Vect(), particle.Position(exit_point+1).Vect());
782785
}

0 commit comments

Comments
 (0)