FMS DB entries for LED and pi0 mass corrections

Here is a summary of discussions between Dmitry Arkhipkin, Steve Heppelmann, Stephen Trentalange, Akio Ogawa and myself on 9th Nov.

LED corrections

Corrections vary cell-to-cell, run-to-run and within a run. Each run is divided into several "time buckets", each lasting about a minute. The LED data are used to correct for gain variations on short timescales. Currently, each time bucket has a start event and end event for which it is valid. To conform with the database structure, this will be converted to a timestamp. The corresponding timestamp for an event is not available in trigger data. Therefore Steve will provide Dmitry with a list of run numbers, and Dmitry will provide Steve with the timestamps of the first and last event in each run. Steve will validate the run duration by counting the number of bunch crossings during the run, obtained from the trigger data. Assuming the durations match up, he will calculate a timestamp for the first event in each time bucket by counting bunch crossings from the first event to that event. Each DB record will then be entered with the timestamp for the first event for which it is valid. The record for the last time bucket in each run may be entered with an end timestamp, so that runs without LED data will return nothing from the DB.

Each time bucket and will be a single DB record. Each DB record will contain LED ADC + error for ~1200 cells, plus detector and channel numbers to identify the cell. If we assume the entry for each cell contains detector number (char), channel number (short), LED ADC (float) and error (float), that is 11 bytes times ~1200 cells, giving about 13 kB per record. There will be ~15,000 records for run 11 (~500 STAR runs times on average ~30 time buckets per run). 13 kB times 15,000 records equals 200 MB.

Possible record structure:

/* fmsLed.idl
*
* Table: fmsLed
*
* Description: FMS LED ADC value for a single cell in a single time interval.
*
*/

struct fmsLed {
   octet          detector;   /* Detector Id, 1-4. 1 = large north, 2 = large south, 3 = small north, 4 = small south */
   unsigned short channel;    /* Channel, 1-578 for large-cell detectors, 1-288 for small-cell detectors */
   float          adc;        /* LED ADC value */
   float          error;      /* LED uncertainty */
};

pi0 mass corrections 

 These are performed per-day, in order to have sufficient statistics. Each record will contain pi0 mass and error (both floats) plus detector (char) and channel (short) for ~1200 cells, so the record size should be the same as for the LED entries. The start timestamp for each record will be the start time of the first run that started on the day in question. This means that events occurring in a run that spans midnight will all use the calibration from the "before midnight" day, not the actual calendar day on which they occurred.

Possible record structure:

/* fmsPi0Mass.idl
*
* Table: fmsPi0Mass
*
* Description: FMS pi0 mass position for a single cell on a single day.
*
*/

struct fmsPi0Mass {
   octet          detector;   /* Detector Id, 1-4. 1 = large north, 2 = large south, 3 = small north, 4 = small south */
   unsigned short channel;    /* Channel, 1-578 for large-cell detectors, 1-288 for small-cell detectors */
   float          mass;       /* Pi0 mass peak position in GeV/c^2 */
   float          error;      /* Uncertainty on pi0 mass position in GeV/c^2 */
};