EPD offline DB table - update2

#################################################################################

This is updated blog of https://drupal.star.bnl.gov/STAR/blog/sprastar/epd-offline-db-table
and
drupal.star.bnl.gov/STAR/blog/sprastar/epd-offline-db-table-updated

Following tables are updated:

1. Calibrations / epd / epdGain
Added two more columns
 i.
offset
ii.qt_pedestal_sigma

2. Since the group wants all the index to be start from 0 (not 1), I have updated all the comments to reflect this change. I will upload the entries when the database is flushed.
 
idl are here:/star/u/sprastar/EPD/EPDdb/idl/StDb/idl

Following text is copied from above blog and updated at relevant places.

###############################################################################


Keep StTriggerData simple and just keep using  StTriggerData::fmsADC(QT_VME__crate,QT_board_address,QT_channel,prepost) 

and make DB tables for EPD map, make another maker (StEpdHitMaker) to access the DB and convert QT address and channels  to generalized coordinates [ew][pp][tile] and create epd hit class (StEpdHit) and its collection in StEvent, MuDst or picodst. (got help from Akio ).

Following explains the DB structure created to store EPD Geometry and Calibrations tables in STAR Offline database, as requested by database admin
(https://drupal.star.bnl.gov/STAR/comp/db/how-to-user/new-table/):

Necessary table for the moment is mapping of EPD[ew][pp][tile] <=> QT[crate][board][channel] (ADC & TAC)
But, for the completeness and for offline DB requirements, I have created other tables.

1.

Geometry / EPD: epdQTMap.idl
struct epdQTMap {
  unsigned short ew[744];       /* ew=0 East EPD, ew=1 West EPD */
  unsigned short pp[744];       /*pp=1-12, SuperSector number */
  unsigned short tile[744];      /* tile=1-31, tile number in a super sector*/
  short qt_crate_adc[744];       /* VME crate number for ADC channels*/
  short qt_board_adc[744];     /* QT board address for  ADC channles, -1 for non existing channels*/
  short qt_channel_adc[744];  /* qt_channel_adc=1-32, -1 for non existing channels*/
  short qt_crate_tac[744];        /* VME crate number for TAC channels*/
  short qt_board_tac[744];      /* QT board address for TAC channle, -1 for non existing channels*/
  short qt_channel_tac[744]; /* qt_channel_tac=1-32, -1 for non existing channels*/
};

Geometry / EPD: epdFEEMap.idl

struct epdFEEMap {
  unsigned short ew[744];     /* ew=0 East EPD, ew=1 West EPD */
  unsigned short pp[744];     /*pp=1-12, SuperSector number */
  unsigned short tile[744];     /* tile=1-31, tile number in a super sector*/
  short tuff_id[744];              /* TUFF ID, undefined -1 */
  short tuff_group[744];        /* TUFF Group no, undefined -1 */
  short tuff_channel[744];     /* TUFF channel, undefined -1 */
  char wire_1_id[744][20];     /* 1_wire_id, undefined -1 */
  short receiver_board[744];    /* Receiver board # 1...6... undefined -1 */
  short receiver_board_channel[744];   /* Re. brd ch 1...16, unsigned -1*/
  short camac_crate_address[744];      /* Address of CAMAC crate */
};

Calibrations / EPD: epdStatus.idl
struct epdStatus {
  unsigned short ew[744];   /* ew=0 East EPD, ew=1 West EPD */
  unsigned short pp[744];   /*pp=1-12, SuperSector number */
  unsigned short tile[744]; /* tile=1-31, tile number in a super sector*/
  short status[744];           /*  -1 for non existing channels, 0-dead, 1-good*/
};

Calibrations / EPD: epdGain.idl
struct epdGain {
  unsigned short ew[744]; /* ew=0 East EPD, ew=1 West EPD */
  unsigned short pp[744]; /*pp=1-12, SuperSector number */
  unsigned short tile[744]; /* tile=1-31, tile number in a super sector*/
  float vped[744]; /* SiPM vPED, unspecified -999 */
  float mip[744]; /* ADC ch MIP, unspecified -999 */
  float qt_pedestals[744]; /* QT mean pedestal, unspecified -999 */
  float dark_current[744]; /* Dark Current of SiPMs, unspecified -999*/
  float qt_pedestals_sigma[744]; /* QT mean pedestal sigma, unspecified -999 */
  float offset[744]; /* offset, unspecified -999*/

};

These variables are used to map EPD coordinated [ew][pp][tile] to associated QT board and channels, to retrive ADC and TAC information.
Please see below for drawing of the mapping.
744 entries will be stored, and ingeneral not subjected to change, unless other wise due to mapping error or other hardware issues.
For this year only 93 entries (channels) are enough, but for the completness rest of the entreis( channels) are initiallies to -1.

2. IDL file for EPD are locaed here:
/star/u/sprastar/EPD/EPDdb/idl

3. A non-indexed table

4. idl compiles and

  1.     sizeof(epdQTMap_st) per entry is 18  => For all 744 entries 13,392
  2.     sizeof(epdFEEMap_st) per entry is 38  => For all 744 entries 28, 272
  1.     sizeof(epdStatus_st) per entry is 8  => For all 744 entries 5,952
  2.     sizeof(epdGain_st) per entry is 30  => For all 744 entries 22,320

5. EPD-subsystem software coordinator: Prashanth Shanmuganathan (sprastar)