Introduction

The SVT has two conditions in the conditions database which veto the data analysis of events. This veto is done in hps-java in the SvtEventFlagger.java. This code checks bias and SVT position using svtBiasConstants and svtMotorPositions. The information for there come from the Conditions Database. The information for the Conditions Database comes from MYA (note: link only accessible on JLab network). 

Previous work for the 2015 test run by Sho is (partially) documented here: myaCharge.pdf

Mya Channels Used

The position of the SVT is determined from the SVT motor shaft position. The MYA channels are: "hps:svt_top:motor.RBV" and "hps:svt_bot:motor.RBV". The bias voltage read back comes from the channels: "SVT:bias:top:{:d}:v_sens" and "SVT:bias:bot:{:d}:v_sens" where the {:d} is an integer from 0 to 17 for top and 20 to 37 for bottom. MYA data is stored in a MySQL database at JLab. The data has a timestamp in ms since epoch in the UTC timezone. From the documentation:

The time field is a 64-bit integer, refered to Mya time format. A native MySQL time data type is not used because they do not include a fraction of a second. The data stored in this integer is actually the composite of the standard UNIX time and the fractional part of the second. UNIX time is a 64-bit offset in seconds from the epoch (1970-01-01 00:00:00 GMT), and is stored in the upper 36 bits of the field. The fractional portion of the second is stored in the lower 28 bits of the field, with the weight of the MSB being 0.5 seconds and LSB 3.7253 nano-seconds . Therefore the units of the whole 64-bit timestamp can be thought of as seconds-times-2^28. Even the all of the 64-bit UNIX time is not retained, the Mya time format will last until the year 3058.
Note the Mya time format differs also from the epics time format, in that the epics timestamp is two separate 32-bit integers. The first is a second offset also, but is relative to the epics epoch (1990) instead of the UNIX epoch. The epics fraction is in units of nanoseconds.
The data tables use the time field as the primary key. This enforces unique timestamps and makes queries for a channel over a desired time range very fast. Since the data for a channel is inserted into its table in increasing time order, a block of consecutive data updates is fetched with a minimal number of disk seeks.
The MYA data is available through a web based interface which will return a JSON format data stream. The web interface allows the data to be converted automatically to "local server time" (using 'a':'on'). Since the run start and run stop times from the RCDB (run control database) are also in "local server time", the code makes use of this conversion.

MYA data sparsification:

The MYA data is sparcified if the value does not change outside of a predetermined range. This range is set in the configuration for each specific channel. Interpreting the data thus means that you do not interpolate data points, instead the value should be considered constant until the next entry in the data tables.

 



 
  • No labels