The user must define locally a REAL*4 vector to fill the ntupla, XTUP. This declaration can be placed at the beginning of MGDRAW routine, just after the inclusion of all standard commons.

.... * PARAMETER (NNTUPLE=8) REAL*4 XTUP(nntuple) * ....

In this routine the user must comment ALL the WRITE fortran cards, which are intended to write a file where all transport events are recorded: this is not usefull here, as the relevant information is stored in a basic ntupla of HBOOK.

Then we show only the relevant section relative to ENTRY BXDRAW. The meaning of the relevant variables in BXDRAW is the following:

* Jtrack = identity number of the particle * * Etrack = total energy of the particle * * Am = mass energy of the particle * * Cx,y,ztrck = direction cosines of the current particle * * Mreg = region number before the boundary crossing * * Newreg = region number after the boundary crossing * * xco,yco,zco = coordinates of the particle at boundary crossing *

In order to select the desired boundary, we remember that in our geometry description, the detector depth was defined as the crossing between region 3 and 4.

.... *======================================================================* * * * Boundary-(X)crossing DRAWing: * * * * Icode = 1x: call from Kaskad * * 19: boundary crossing * * Icode = 2x: call from Emfsco * * 29: boundary crossing * * Icode = 3x: call from Kasneu * * 39: boundary crossing * * Icode = 4x: call from Kashea * * 49: boundary crossing * * Icode = 5x: call from Kasoph * * 59: boundary crossing * * * *======================================================================* * * ENTRY BXDRAW ( ICODE, MREG, NEWREG, XSCO, YSCO, ZSCO ) C-STA WRITE(*,*) 'BXDRAW ',icode,mreg,newreg,jtrack $ ,etrack,am(jtrack) IF(MREG.EQ.3.AND.NEWREG.EQ.4) THEN ! Select the desired boundary IF( JTRACK.EQ.10.OR.JTRACK.EQ.11 ) THEN ! Select muons IF(ETRACK.GT.AM(JTRACK)) THEN ! Muon has survived XTUP(1) = JTRACK XTUP(2) = ETRACK-AM(JTRACK) XTUP(3) = XSCO XTUP(4) = YSCO XTUP(5) = ZSCO XTUP(6) = CXTRCK XTUP(7) = CYTRCK XTUP(8) = CZTRCK CALL HFN(100,XTUP) ENDIF ENDIF ENDIF C-END RETURN * END IF ....

Giuseppe Battistoni 平成17年3月7日