Goosydata

Home ] Up ] General ] Short ] Syntax ] Postscript ] Hints ] Cursor ] DSN ] Arithmetik ] Line Modes ] Colours ] Polar ] 2Dim ] 3Dim ] Analyzers ] Library ] Types ] Text ] Graphic ] Inbed ] Fit ] Presentation ] Extend ] Concepts ] Dynamic ] Listmode ] Macros ] [ Goosydata ] Online ] Commands (List) ] Commands (Details) ] Install ] MSWindows ] Problems ]

GSI
FRS

 

 

SATAN Help
 
READING GOOSY DATA (GOOREAD)  
Reading of data in GOOSY format is supported by the macro GOOREAD.
GOOREAD reads data in GOOSY format. They are written to the
     variables given (e.g. I1, I2, I3) which are implicitly declared 
     as integers (BIN FIXED(31)) (see example below).
     Keywords of GOOREAD:
      DATA, 
      EVENTTYPE, 
      EVENTSUBTYPE, 
      SUBEVENTTYPE,
      SUBEVENTSUBTYPE, 
      TRIGGER, 
      SUBCRATE,
      PROCID
      CONTROL
      WORDS
     The arguments of the DATA keyword provide the data. The arguments
     of all other keywords (except WORDS) may be used as a filter to 
     select the appropriate data.
     A number is used for selecting the corresponding data 
     ("EVENT(10)"), a variable (BIN FIXED(15)) returns the parameter of 
     the data ("TRIGGER(IT2)").
     An additional "/SELECT" means that this variable is used as a 
     filter for selecting the corresponding data. If the selection is 
     not unique in one event, an error message is lanced.
     The keyword WORDS returns the length of the list-mode data in the
     corresponding subevent counted in 2-byte words in a BIN FIXED(15)
     variable.
     If the analysis program is compiled with the option DEBUG, all 
     data which are not filled into GOOREAD variables are listed. 
     (This way one can analyze the structure of unknown GOOSY data by 
     providing one GOOREAD macro which does not fit to the data.)       
Fastbus and VME data need a scan list in the analysis program which 
attributes the geometrical addresses of the ADCs to the parameters of
GOOREAD. The number of fastbus crates is limited to one. The number of 
VME crates is not limited.
Here an example for the application in an analysis program, including
reading of fastbus data:
|  LISTPROC;
|   ...
|  /* Scan list of fastbus data */
|  FBSCAN ADDR(20) CHANNEL(22) RANGE(LOW)  N(1);
|  FBSCAN ADDR(20) CHANNEL(23) RANGE(HIGH) N(2);
|  FBSCAN ADDR(20) CHANNEL(24) RANGE(LOW)  N(3);
|   
|  DECLARE (IT1,IT2) BIN FIXED(15);
|  IT1 = 15;
|  DECLARE N_WORDS BIN FIXED(15);
|  ANTRY;
|  ...
|  /* Begin of event loop */
|  EVENT FORMAT(GOOSY);
|  /* Filter for three different GOOSY subevents */
|  GOOREAD DATA(I1,I2,I3) EVENTTYPE(10) SUBCRATE(1) TRIGGER(IT1/SELECT);
|  GOOREAD DATA(I16,I17,I18(5)) EVENTTYPE(10) SUBCRATE(2) TRIGGER(IT2);
|  GOOREAD DATA(FB(3)) SUBEVENTSUBTYPE(2) WORDS(N_WORDS);
|  
|  IF IT2 = 4 THEN ANAL ...
|  ANAL ...
|  
|  ENDEVT;
|  ENDANL;      
The GOOSY data formats actually supported by SATAN are listed 
in the following table:      
  EVENTTYPE       :     10    (VME data structure)
  EVENTSUBTYPE    :     1     
  SUBEVENTTYPE    :    10,   (VME subevent structure) 
                       32,    (non-standard)
                       34     (non-standard)
  SUBEVENTSUBTYPE :     1,   (CAMAC data, packed,
                               16 bit address + 16 bis data word)
                        2,    (FASTBUS data, standard,
                               correct module header)
                     3100,    (FASTBUS data, module header filled with 
                               zeroes)
                     3200     (CAMAC data, unpacked, 16 bit data word, 
                               need 2byte swap on VAX)
                     3300     (CAMAC data, unpacked, 16 bit data word, 
                               need 4byte swap on VAX)
----------------------------------------------------------------------
Special data structure SUBEVENTTYPE 10, SUBEVENTSUBTYPE 1 with 32 Bit 
datawords (unpacked) is supported by choosing the data format GOOSY32.
|  EVENT FORMAT(GOOSY32);
Other special data structures (16 Bit datawords, unpacked) without byte
swap or with different kind of byte swap are
|  EVENT FORMAT(GOOSY16);
|  EVENT FORMAT(GOOSY16BS2);
|  EVENT FORMAT(GOOSY16BS4);
----------------------------------------------------------------------
In 2003, a new VME standard data structure has been introduced at the 
FRS. It contains a time stamp, a bit pattern, unpacked 32-bit scaler  
data and packed 16-bit ADC data. The unpacking is supported in SATAN by  
specifying the format "VMEFRS" in the EVENT macro. 
Usage:
|  EVENT FORMAT(VMEFRS);
|  GOOREAD(TIMESTAMP(6),BITPATTERN(4),SCALERS(..),DATA(..)) ...;
More information on the unpacking of this data structure by the macro
SCAN is provided on a dedicated page.
----------------------------------------------------------------------
For special use only:
The array $GOO_ARRAYx$FULL (data type (*) BIN FIXED(31)) gives access 
to the original list-mode data selected by the $GOOREAD macro.
(x denotes the number of the $GOOREAD macro: the first $GOOREAD 
appearing in the analysis program fills the array $GOO_ARRAY1$FULL, 
the second one $GOO_ARRAY2$FULL, and so on.) 
In the case of Fastbus data, the sequence of the elements in 
$GOO_ARRAYx$FULL is the original one of the incoming list-mode data, 
not touched by the FBSCAN macros.
Note that the higher elements of $GOO_ARRAYx$FULL which are not filled
by the incoming data have unpredictable values.
                                       
 
SOME INFORMATION ON THE STRUCTURE OF LIST-MODE DATA IN GOOSY FORMAT
-------------------------------------------------------------------
The first record of a file begins with the file header:
                                          
            File header structure: 
             byte             variable              comment
              1      1        i_fdlen
              2               "       
              3      2        i_ftlen
              4               "
              5      3        i_ftype
              6               "
              7      4        i_fsubtype
              8               "
              9      5        i_fused
             10               " 
             11      6        b_fend
             12               b_fbegin
             13      7        i_fbuf
             14               "
             15      8        "
             16               "
             17      9        i_fevt
             18               "
             19     10        "
             20               "
             21     11        i_fcurrent_i
             22               "
             23     12        "
             24               "
             25     13        i_ftimestamp(1)
             26               "
             27     14        "
             28               "
             29     15        i_ftimestamp(2)
             30               "
             31     16        "
             32               "
             33 ...           i_ffree(4)
                ...           c_flabel char(30) var
                ...           c_ffile char(86) var     
                ...           c_fuser char(30) var
                ...           c_ftime char(24)
                ...           c_frun char(66) var
                ...           c_fexp char(66) var
                             i_flines bin fixed(31)
                             c_fcomment(refer(i_flines)) char(78) var
                                                       
                                                 
The following records begin with the blockheader
      
            Blockheader structure: 
             byte             variable              comment
              1      1        i_dlen        Length of buffer without buffer 
              2               "              header in 16-bit words.
              3      2        i_tlen        unused.
              4               "
              5      3        i_type        A number specifying the buffer
              6               "              type.
              7      4        i_subtype     A number specifying the buffer
              8               "              subtype.
              9      5        i_usedlen     The number of 16-bit words 
             10               "              actually used in this buffer.
             11      6        i_end         '1'B: a fragment is at end of buffer.
             12               i_begin       '1'B: a fragment is at beginning of buffer. 
             13      7        i_buf         
             14               "
             15      8        "
             16               "
             17      9        i_evt
             18               "
             19     10        "
             20               "
             21     11        i_current_i
             22               "
             23     12        "
             24               "
             25     13        i_time(1)     Time stamp VMS 64 bit format.
             26               "
             27     14        "
             28               "
             29     15        i_time(2)
             30               "
             31     16        "
             32               "
             33     17        i_free(1)     Reserved.
             34               "
             35     18        "
             36               "
             37     19        i_free(2)
             38               "
             39     20        "
             40               "
             41     21        i_free(3)
             42               "
             43     22        "
             44               "
             45     23        i_free(4)
             46               "
             47     24        "
             48               "
                     
               
The event data (data written for one trigger event) begin with the event header
      
           structure of event header (event type 10): 
           byte              variable                comment 
            1   1             i_dlen                 Event data length (words).
            2                 "
            3   2             "
            4                 "
            5   3             i_type                 Event type (=10).
            6                 "
            7   4             i_subtype              Event subtype (=1).
            8                 "
            9   5             i_trigger              Trigger ID.
           10                 "
           11   6             i_dummy                Not used.
           12                 "
           13   7             i_count                Event counter.
           14                 "
           15   8             "
           16                 "                  
                                    
                              
The subevent data (a subgroup of data of one event) begin with the subevent header.
      
           structure of subevent header (subevent type 10): 
           byte              variable                comment 
            1   1             i_dlen                 Subevent data length (words).
            2                 "      
            3   2             "
            4                 "
            5   3             i_type                 Subevent type (=10).
            6                 "
            7   4             i_subtype	        Subevent subtype (=1).
            8                 "
            9   5             i_procid               Processor ID.
           10                 " 
           11   6             i_control              Control ID.
           12                 i_subcrate             Subcrate ID. 
                                  
                            
If the record begins with a fragmented event, it begins with the 
event header of a fragmented event                             
                                  
           structure of a fragmented event: 
           byte              variable                comment 
            1   1             i_edlen
            2                 "      
            3   2             "
            4                 "
            5   3             i_etype
            6                 "
            7   4             i_esubtype
            8                 "
            9   5             i_edata (refer(i_edlen))
           10                 " 
                                  
                                               
Some of the subevent-subtype data structures are supported by SATAN.

In order to read the standard GOOSY data structures, the macro
FORMAT(GOOSY) option of the EVENT macro has to be specified
  ==> EVENT FORMAT(GOOSY);
If the data structure is recognized correctly, the macro GOOREAD
supplies the data in the correct sequence.       
Some non-standard data structures are supported, however, the user
must specify the appropriate parameters, e.g. 
   ==> EVENT FORMAT(GOOSY32); 
      
When the data are read on VMS or WINDOWS/NT, they are transformed by
a 4-byte swap. Due to the 4-byte swap, the sequence of two consecutive
2-byte numbers is reversed if compared to the sequence the are written
originally by the front-end processor.        
With the command INPUT / DEBUG, the first 2 bytes of the data are 
listed as they appear after a 4-byte swap of the original data.
.......................................................................
subevent subtype 1 (CAMAC packed)
on data file:
  2 byte     - 2 byte     - 2 byte      - 2 byte     - 2 byte
  data(i)      address(i)   data(j)       address(j)   data(k)
                                                         
after 4-byte swap:                                                    
  2 byte     - 2 byte     - 2 byte      - 2 byte     - 2 byte
  address(i)   data(i)      address(j)    data(j)      address(k)
                                                         
supplied by GOOREAD: (The complete data array is provided, the data
which are not present in the actual event are padded by zeroes.)  
  2 byte   ...  - 2 byte            ... - 2 byte      
  data(1)  ...    data(address(i)) ...    data(address(j))
.......................................................................
subevent subtype 1 (non-standard, to be read with TYPE(GOOSY32))
on data file:
  4 byte     - 4 byte     - 4 byte      - 4 byte     - 4 byte
  data(1)      data(2)      data(3)       data(4)      data(5)
      
after 4-byte swap:
  4 byte     - 4 byte     - 4 byte      - 4 byte     - 4 byte
  data(1)      data(2)      data(3)       data(4)      data(5)
                                                                  
supplied by GOOREAD:                  
  4 byte     - 4 byte     - 4 byte      - 4 byte     - 4 byte
  data(1)      data(2)      data(3)       data(4)      data(5)
.......................................................................
subevent subtype 3100 (Fastbus data)      
.......................................................................
subevent subtype 3200 (CAMAC unpacked) or FORMAT(GOOSY16)
on data file:
  2 byte     - 2 byte     - 2 byte      - 2 byte     - 2 byte
  data(1)      data(2)      data(3)       data(4)      data(5)        
after 4-byte swap:
  2 byte     - 2 byte     - 2 byte      - 2 byte     - 2 byte
  data(2)      data(1)      data(4)       data(3)      data(6)        
supplied by GOOREAD:                  
  2 byte     - 2 byte     - 2 byte      - 2 byte     - 2 byte
  data(1)      data(2)      data(3)       data(4)      data(5)  
.......................................................................
subevent subtype 3300 (CAMAC unpacked)
on data file:
  2 byte     - 2 byte     - 2 byte      - 2 byte     - 2 byte
  data(2)      data(1)      data(4)       data(3)      data(6)        
after 4-byte swap:
  2 byte     - 2 byte     - 2 byte      - 2 byte     - 2 byte
  data(1)      data(2)      data(3)       data(4)      data(5)        
supplied by GOOREAD:                  
  2 byte     - 2 byte     - 2 byte      - 2 byte     - 2 byte
  data(1)      data(2)      data(3)       data(4)      data(5) 
.......................................................................