Skip to content

Commit d94e0db

Browse files
authored
[starsim] Fix logic handling multiple hit banks in the stgc (#499)
g2t_stg.F copies hits from the three sensitive volumes into the single g2t_stg_hit table. When no hits are registered in a single sensitive volume, the loop _should_ proceed to query the next SV for hits. Instead, the code branched to the return statement, resulting in no hits being saved for the remaining SVs. This PR fixes the issue.
1 parent 28b6c4f commit d94e0db

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pams/sim/g2t/g2t_stg.F

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ FUNCTION G2T_STG (g2t_track_h, g2t_track ,
2020
if (isys.eq.1) CALL g2r_get_sys('STGM','STGP',Iprin,Idigi)
2121
if (isys.eq.2) CALL g2r_get_sys('STGM','STGL',Iprin,Idigi)
2222
if (isys.eq.3) CALL g2r_get_sys('STGM','STGS',Iprin,Idigi)
23-
IF (Iprin.lt.0) go to 99
2423

25-
24+
IF (Iprin.ge.0 ) THEN
2625

27-
Do While (G2R_GET_HIT('stg') .eq. 0)
26+
Do While (G2R_GET_HIT('stg') .eq. 0)
2827

2928
i=i+1
3029
g2t_fts_hit_h.nok = i
@@ -49,7 +48,10 @@ FUNCTION G2T_STG (g2t_track_h, g2t_track ,
4948
g2t_track(trac).hit_fts_p = i
5049
g2t_track(trac).n_stg_hit = g2t_track(trac).n_stg_hit + 1
5150

52-
enddo * G2R_GET_HIT
51+
enddo * G2R_GET_HIT
52+
53+
ENDIF
54+
5355
enddo * Isys
5456

5557
99 RETURN

0 commit comments

Comments
 (0)