Skip to content

Commit f65e013

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

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
@@ -776,6 +776,9 @@ namespace caf {
776776
if (exit_point < 0 && entry_point >= 0) {
777777
exit_point = particle.NumberTrajectoryPoints() - 1;
778778
}
779+
if (exit_point >= 0 && entry_point >=0 && exit_point == entry_point && exit_point < static_cast<int>(particle.NumberTrajectoryPoints()) - 1){
780+
exit_point++; // to avoid exactly the same start and end positions when single index is inside the active volumne
781+
}
779782
if (exit_point >= 0 && ((unsigned)exit_point) < particle.NumberTrajectoryPoints() - 1) {
780783
srparticle.wallout = sbn::GetWallCross(active_volumes.at(cryostat_index), particle.Position(exit_point).Vect(), particle.Position(exit_point+1).Vect());
781784
}

0 commit comments

Comments
 (0)