New TPC SpaceCharge and GridLeak database table

Recent work has shown the need for TPC GridLeak corrections to be You do not have access to view this node. The old database table (Calibrations/tpc/tpcGridLeak, using struct tpcGridLeak.idl) for this correction does not allow for this, mandating some modification. I see this as an opportunity to re-organize two highly correlated database tables which have over the years been modified little by little into a less-than-clear state. Some of the history:
  • The spaceCharge table (Calibrations/rich/spaceChargeCorR2, using struct spaceChargeCor.idl) was initially placed in a different detector's area (RICH instead of TPC).
  • Then it was modified not long after that to to have a different database table without changing the struct to accomodate a change in the shape of the charge distribution.
  • This was followed by modifications of additional table members to allow additional parameters in the formula for space charge,
  • Eventually multiple terms in the space charge formula were allowed through multiple elementIDs.
  • At the same time, some members of both tables stopped being useful:
    • multiple field values in the SpaceCharge table (better controlled via timestamps)
    • multiple GridLeak locations (did not work well as a correction)
As these two tables are part of a single calibration process, it makes sense to unite the tables and clean up the clutter, as well as 

Here is my proposed table:
/*    tpcSCGL.idl
*  Table: tpcSCGL
*       description: Table for SpaceCharge and GridLeak Correction parameters
*       SC parameters: 4 array elements for west, plus 4 for east = 8,
*          each of the 4 elements are additive terms in the SC formula
*       GL parameters: 24 array elements for TPC sectors,
*          plus radius and width of the charge sheet
*       scaler and mode definitions in StDetectorDbMaker/St_tpcSCGLC.h

struct tpcSCGL { 

   float   SC[8];         /* Scale factor relating luminosity scaler to SpaceCharge */
   float   SCoffset[8];   /* Offset to define luminosity for SpaceCharge */
   float   SCexponent[8]; /* Luminosity exponential factor for SpaceCharge */
   float   SCscaler[8];   /* Luminosity detector scaler */

   float   GL[24];        /* Scale factor relating SpaceCharge to GridLeak */
   float   GLoffset[24];  /* Offset to define luminosity for GridLeak */
   float   GLradius;      /* Radius of GridLeak between inner/outer sectors */
   float   GLwidth;       /* Width of GridLeak between inner/outer sectors */

   long    mode;          /* Modes to simplify parameter controls */

   char    comment[256];

Adding a comment field is an obvious upgrade. Adding the mode field should allow simplified control of the parameters when testing, such as forcing east and west symmetry, or using the SpaceCharge offsets for GridLeak. Documentation of the modes and the scalers can be in the code where the tables are used (a new interface to this table, StDetectorDbMaker/St_tpcSCGLC.h).

This table would likely have somewhere between 2 and 10 entries per year, based on historical patterns of the existing tables.

Dmitry mentioned the possibility of making the arrays "text" instead of "binary" in their database implementation, which would allow better readability/editability by humans, as long as the arrays are small.

Comments welcome,