The list of neighbours to search when exiting from the
content may depend also on the direction and position of the particle. In case where it is necessary, for performance reasons, to exploit also this information, GEANT offers the possibility to the user to build a dynamic search list.
CALL GUNEAR (ISEARC,ICALL,XC,JNEAR)
The list of volumes where GEANT has to search to answer the question specified by ICALL is returned by the user starting at Q(JNEAR+1. GEANT will only look at the volumes specified by the user and in the order in which they appear in the list. Daughters are numbered from 1 to N according to the order with which they have been positioned in the mother. The list should be filled in the following way:
IQ(JNEAR+1) | = | N, number of volumes in the list |
IQ(JNEAR+1+1) | = | number of the first daughter to search |
IQ(JNEAR+1+2) | = | number of the second daughter to search |
. | ||
. | ||
. | ||
IQ(JNEAR+1+N) | = | number of the daughter to search |
The user should be aware that this routine is called very often, almost at every tracking step, so it should be coded with the maximum efficiency in mind. An example of GUNEAR could be the following:
SUBROUTINE GUNEAR(ISEARC,ICALL,XC,JNEAR) *--- Make sure to add GEANT main store +SEQ, GCBANK. DIMENSION XC(6), MYLIST(100) *--- Executable code IF(ISEARC.EQ.1) THEN *--- Build a list using XC and ISEARC for a GMEDIA type call *--- Put all the daughters where the particle may be in MYLIST(1) = .... . . . MYLIST(N) = .... ELSE *--- Build a list using XC and ISEARC for a GTNEXT type call *--- Put all the daughters where the particle may be going MYLIST(1) = .... . . . MYLIST(N) = .... ENDIF *--- Return the information to GEANT DO 10 I=1,N IQ(JNEAR+1+I) = MYLIST(I) 10 CONTINUE IQ(JNEAR+1) = N *--- End of GUNEAR END