RICH, RHIC, TCIM scaler mappings

There are a number of fast scaler systems in STAR and RHIC, reading out into various places
with various mappings. This blog entry is to state what is read out, and where to get it in the various online databases.

Sources: (see https://drupal.star.bnl.gov/STAR/comp/db/onlinedb/online-server-port-map for the actual server and port maps)

RICH:  This is a historical name, from the "RICH" subsystem which existed in STAR in Year 1 and Year 2.  It
is read into EPICS on the platform through a VME Lecroy 1151E scaler board, with a hand-woven oscillator
to convert counts into Hz.  This oscillator appears to be too short by 2% or so, so you should convert the
readings by "Real Hz = 0.982 * Reading".

It is read out into two different databases, through two different paths, and also into the datastream.
First: Conditions_rich database, table richScaler, entries are "rsxx", e.g. rs1, rs2, ... rs16, every 30 seconds
Second:MQ readout, database mq_collector_Conditions_rich, table richScalar, entries are rich_1151E_valXX, every 15 seconds

This also shows up in the datastream at 1-second intervals and gets put into the microdst in
mu->event()->runInfo().xxx, where xxx is a reasonable name
There is the backup that it can be gotten from the offline database
trigDetSums if for some reason the 1-second scalers are missing.

RHIC: This is readback through CDEV from what is sent to RHIC through their scaler boards on the platform.  Some
pieces of this are direct copies through fiber from the platform to RHIC, but other pieces (coincidences of BBC) are done
in the DAQ room and so won't necessarily match exactly the RICH scalers.  One other unfortunate thing is that
there is an off-by-one error in the CDEV readout, so that the signals as labeled on the front of the scaler board are
off by one from what is read out in CDEV.  E.g. what is plugged into channel 1 physically on the board gets read back
in CDEV as channel 16, 2->1, etc. 
Database mq_collector_Conditions_cdev, table rhicScalersDiff, entries are sisScaler.6a-star.x.diffM, e.g. sisScaler.6a-star.1.diffM, ... sisScaler.6a-star.16.diffM

TCIM: This is an internal scaler on the board that distributes the ZDC signals only.  It's available at
Database mq_collector_Conditons_tcim, table tcim_registers, entries with reasonable names

Here is a mapping (updated 6/21/17 with addition of VPD signals to RHIC):

Name RICH Database RICH MQ Database Microdst RHIC Physical RHIC Cdev
(X in sisScaler.6a-star.X.diffM)
TCIM
BBCE rs1 rich_1151E_val1 bbcEastRate() 13 12 N/A
BBCW rs2 rich_1151E_val2 bbcWestRate() 14 13 N/A
BBC E*W rs3 rich_1151E_val3 bbcCoincidenceRate() 12 11 N/A
Yellow Background
(BBCW delayed*BBCE)
rs4 rich_1151E_val4 bbcYellowBackgroundRate() 16 15 N/A
Blue Background (BBCE delayed*BBCW) rs5 rich_1151E_val5 bbcBlueBackgroundRate() 15 14 N/A
ZDC East with 1 us deadtime rs6 rich_1151E_val6 zdcEastRate() 7 6 zdc_east_killer
ZDC West with 1 us deadtime rs7 rich_1151E_val7 zdcWestRate() 6 5 zdc_west_killer
ZDC Coincidence with 1 us deadtime rs8 rich_1151E_val8 zdcCoincidenceRate() 1 16 zdc_coincidence_killer
VPD East rs9 rich_1151E_val9 N/A 9 (After 6/21/17) 8 (After 6/21/17) N/A
VPD West rs10 rich_1151E_val10 N/A 10 (After 6/21/17) 9 (After 6/21/17) N/A
VPD E*W rs11 rich_1151E_val11 N/A 11 (After 6/21/17) 10 (After 6/21/17) N/A
ZDC West with no deadtime rs12 rich_1151E_val12 N/A 2 1 zdc_west
ZDC East with no deadtime rs13 rich_1151E_val13 N/A 3 2 zdc_east
Feed from trigger system, usually ZDCE*ZDCW.
FANOUT/2
rs14 rich_1151E_val14 may be available as l0RateToRich() 8 7 N/A
ZDC Coincidence with no deadtime rs15 rich_1151E_val15 N/A 4 3 zdc_coincidence
MTD rs16 rich_1151E_val16 may be available as backgroundRate() N/A N/A N/A