media


 
                            Regions and Media Codes
                            =======================
 
Contact:  N. West.  Oxford.
 
This document summarises the region and media codes used in SNOMAN and EGS4,
identifies the titles banks that record them and lists the look-up tables that
map between them.
 
 
Media
-----
 
   In SNOMAN the medium for each region is given a 3 or 4 digit PHYSCAL MEDIUM
code.  The set of legal physical media codes is defined in the MEDA titles
bank.  Each medium is also give a GENERIC MEDIUM code defined as follows:-
 
        generic medium code = (physical medium code) / 100
 
A list of media codes can be found in:-
 
        id_media.html
 
EGS4 media codes are the same as generic media codes.  Generic media codes are
useful where the code has to take different paths depending on the type of
media  e.g. Acrylic as opposed to D2O but is insensitive to the exact physical
properties of it e.g. D2O with or without salt.
 
 
Regions
-------
 
    In SNOMAN each homogenous region of the detector is given a unique 7 digit
REGION code consisting of a 3 digit REGION TYPE and a 4 digit REGION SERIAL
NUMBER.  For example the inner (D2O) region has region type 100 and region
serial number 0000.  Region types are defined in:-
 
        id_regions.html
 
EGS4 regions are identical to region types.  In the event data structure
regions are always specified using region codes.  The region type is used as
the bank number for the geometry banks GEDP and GEDS that describe it.  Thus
for D2O there are  GEDP.100 and GEDS.100 banks.  Word KGEDS_IDM of the GEDS
bank holds the  physical media code.
 
 
Mapping Look-Up Tables
----------------------
 
The following look-up tables are defined:-
 
         Mapping                  Array Name           INCLUDE File     See Note
 
Region type -> Physical media     IREGT_MEDP            media_map2.inc
 
Region type -> Generic media      IREGT_MEDG            media_map1.inc     1
 
Physical media -> MEDA entry      MEDP_MEDA             media_data.inc     2
 
Physical media -> ADMX entry      MEDIA_TO_ADMX_OFFSET  additives.inc      3
 
So for example, if IREGT is a region type, then IREGT_MEDP(IREGT) is the
equivalent physical media code.
 
 
Notes
 
1  This mapping is identical to that used in EGS4, indeed the array IREGT_MEDP
   is equivalent to the MED array in /MISC/ declared in the INCLUDE file:-
 
        misc.inc
 
    To use this mapping:-
 
    Within EGS4 use the INCLUDE file:  misc.inc, and use MED array
    In SNOMAN   use the INCLUDE file:  media_map1.inc, and use IREGT_MEDG array.
 
 
2   The MEDA bank consists of entries for an arbitrary number of physical
    media that can come in any order.  So, to save time, a look-up table is
    set up that converts physical media code to the address in MEDA, relative
    to the start point LDMEDA, that holds the data for it.  The code fragment
    below shows how to get the mean refractive index for the physical medium
    MEDP:-
 
             INCLUDE 'media_data.inc'
             INCLUDE 'mt.inc'
 
       .
       .
 
             INTEGER   LEMEDA,MEDP
             REAL      REFX_MEAN
 
       .
       .
 
       *     Get start address for required entry.
             LEMEDA = LDMEDA + MEDP_MEDA(MEDP)
 
       *     Pick up required word of entry.
             REFX_MEAN = RCONS(LEMEDA + KMEDA_REFX_MEAN)

3   The ADMX bank consists of a series of rows each containing a list
    of up to 3 additives that can introduced into a media.  As with
    the MEDA bank, there is a look-up table to map from a physical
    media code to the row offset, if any, that contains its
    additive. The code fragment below shows how to get the bumber of
    additives for the physical medium MEDP:-
 
             include 'bank_admx.inc'
             include 'additives.inc'
             include 'mt.inc'
 
       .
       .
 
             integer   row_offset, nadd, medp
 
       .
       .
       *     Look up additives info
             row_offset = MEDIA_TO_ADMX_OFFSET(MEDP)
             if(row_offset .le. 0) return

             nadd = icons(LDADMX + row_offset + KADMX_ADDITIVES)
 

Go Back to the Snoman Companion Top Page