Skip to content

Commit 3984fc0

Browse files
committed
adding an if condition for fixing exactly same start and end positions of true particles from nu-int
1 parent a6dd913 commit 3984fc0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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)