next up previous index
Next: GEOM500 Volume attributes Up: GEOM410 Ordering the Previous: Static ordering

Dynamic ordering

The list of neighbours to search when exiting from the INth

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 GSUNEA (CHNAME,ISEARC)

CHNAME
( CHARACTER*4) name of the volume where the user search has to be activated;
ISEARCH
( INTEGER) specifies the kind of search list to be used: a positive value must be specified with this routine to activate user search lists.
This routine should be called once for every volume where user volume search is activated.

CALL GUNEAR (ISEARC,ICALL,XC,JNEAR)

ISEARCH
( INTEGER) number associated to the volume in which the user search is used, it is the same number set by the user with GSUNEA;
ICALL
( INTEGER) type of question that the list of volumes must answer:
1
GMEDIA-like call, where am I?
2
GTNEXT-like call, where can I go?
XC
( REAL) array of 6 containing the position and the direction cosines of the particle (x, y, z, px/p , py/p , px/p );
JNEAR
( INTEGER) pointer to the volume list bank which has to be filled by the user;

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 Nth 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

GEOM500



next up previous index
Next: GEOM500 Volume attributes Up: GEOM410 Ordering the Previous: Static ordering


Janne Saarela
Mon Apr 3 12:46:29 METDST 1995