22.05.2014 Views

CERN Program Library Long Writeup W5013 - CERNLIB ...

CERN Program Library Long Writeup W5013 - CERNLIB ...

CERN Program Library Long Writeup W5013 - CERNLIB ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Geant 3.16 GEANT User’s Guide BASE410<br />

Origin : R.Brun Submitted: 08.08.87<br />

Revision : Revised: 08.11.93<br />

Documentation :<br />

Utility Routines<br />

CALL GLOOK<br />

(CHNAME,IVECT,N,ILOOK*)<br />

CHNAME<br />

IVECT<br />

N<br />

ILOOK<br />

(CHARACTER*4) variable containing the name to be searched for in IVECT;<br />

(INTEGER) array containing the ASCII code of the names among which NAME is searched. The<br />

names are stored 4 characters per word;<br />

(INTEGER) number of items in IVECT;<br />

(INTEGER) position in IVECT where NAME has been found, 0 if not found.<br />

This routine is very useful when searching for a string stored in a ZEBRA bank. For instance to find the<br />

position of the ’CRYS’ volume in the volume bank, the following piece of code could be written:<br />

+SEQ,GCBANK.<br />

+SEQ,GCNUM.<br />

.<br />

.<br />

.<br />

CALL GLOOK(’CRYS’,IQ(JVOLUM+1),NVOLUM,IVO)<br />

IF(IVO.GT.0) THEN<br />

JVO = LQ(JVOLUM-IVO)<br />

ELSE<br />

JVO = 0<br />

ENDIF<br />

JVO, if different from 0, is the pointer to the data bank containing the information relative to the volume<br />

’CRYS’.<br />

CALL GEVKEV<br />

(EGEV,ENERU*,CHUNIT*)<br />

EGEV<br />

ENERU<br />

CHUNIT<br />

(REAL) input, energy in GeV;<br />

(REAL) output, energy in the new unit;<br />

(CHARACTER*4) unit in which the energy has been converted.<br />

This subroutine converts the input energy in GeV to a unit in which 1 ≤ E ≤ 999. CHUNIT contains the<br />

new unit. The following piece of code illustrates the use of GEVKEV:<br />

+SEQ,GCTRAK.<br />

CHARACTER*4 CHUNIT<br />

.<br />

.<br />

.<br />

CALL GEVKEV(DESTEP, DE, CHUNIT)<br />

WRITE(6,10000) DE, CHUNIT<br />

10000 FORMAT(’ The energy loss in this step is ’,F7.2,A)<br />

41 BASE410 – 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!