Scalers Database

Experiment E852 records > 100 different scalers at BOS and EOS (begin and end of spill). Some scalers are reset to zero at every spill, some are not. Some scalers are 24-bit CAMAC scalers, some are 32-bit Fastbus scalers and some are 48-bit cascaded CAMAC scalers.

The data unpacking routine unpacks the scalers into GROUP_SCALERS. In that group, each scaler has a unique "index".

The "Scalers Database" package described in this document was written to make the use of GROUP_SCALERS easier. For example, it provides functions to access the scalers using symbolic names, such as "S", "S*DT", "Lev1_A1", etc...

Header files, Libraries, Sources and Map files

The C header file scalerDatabase.h defines the data structures and functions used by the scalers database.

Programs using the scalers database should link with the libdata.a library.

The source code is located in the libdata subsystem.

The database data file is located in the map manager file db-files.Map, subsystem db-files, item scalers.

Format of the Map file

The database data file has the following format:

scalers.nchannels: 236

scalers.1.name: CsI_H1
scalers.1.channel: 0
scalers.1.load: 1
scalers.1.reset: 1

scalers.2.name: CsI_H2
scalers.2.channel: 1
scalers.2.load: 1
scalers.2.reset: 1

...
The various fields have the following format:

Format of the scalerDatabase_t array


typedef struct
{
  int flags;          /* flags defined and explained in the header file          */
  const char *name;   /* name of the scaler                                      */
  int offset;         /* offset into the GROUP_SCALERS group, counting from zero */
  int resetAtBOS;     /* 'true' is the scaler is reset at the begin of spill     */

} scalerDatabaseEntry_t;

typedef struct
{
  int nscalers;       /* number of entries in the database */

  scalerDatabaseEntry_t scaler[1];  /* array of entries    */

} scalerDatabase_t;

Subroutines used to access the scalers database


scaler_getDatabase(int runNo)


Purpose:

Arguments:

Return Value:


int scaler_lookupScalerEntry(database,scalerName)


Purpose:

Arguments:

Return Value:


int scaler_lookupScalerOffset(database,scalerName)


Purpose:

Arguments:

Return Value:


int scaler_getValue(scalers,offset)


Purpose:

Arguments:

Return Value:


Author: K.Olchanski, 1996-Apr-13