Basis File Format

A basis is a binary file consisting of three sections:
  1. header
  2. list of basis signals
  3. lookup table
The header is a 256 byte character array giving the basis version number, the total number of grid points and the dimension of the lookup table.

The second section of this file is a list of basis signals. Each basis signal is given by Basis_Point data structure defined in gdecomp.h

#define GRID_SEGS 37 
typedef struct {
  char  iseg, ir, ip, iz;        
  float x, y, z;             
  float signal[GRID_SEGS][50]; 
  int   lo_time[GRID_SEGS], hi_time[GRID_SEGS];
} Basis_Point;

Here iseg, ir, ip, iz gives the segment number and the radial, phi and z indices of the grid point, x, y, z gives the cartesian coordinate of the grid point and signal[][] is an array of waveforms corresponding to the charge on each segment pad and the central contact. The arrays lo_time[] and hi_time[] set limits for the time interval the signal will be for each segment.

The third section of this file is a four dimensional lookup table used to index the basis signals in the second section. This is also declared is gdecomp.h.

extern int grid_pos_lu[SSEG][SRAD][SPHI][SZZZ];

This array gives the offset of the Basis_Point structure corresponding to a given segment number and (r, phi, z) index. This is important as it gives the signal decomposition algorithm an efficient way to lookup adjacent basis point during the fit procedure.

Both raw and response-corrected basis file use the same format. They only differ in the waveforms they contain.
Comments