- Table of contents
- Checking the BFIELD and BEAMMONSPILL Database Table Statuses
Checking the BFIELD and BEAMMONSPILL Database Table Statuses¶
Keep-up processing needs to hold of proceeding on processing if the database tables aren't up-to-date. Currently two cross checks are done, one on the status of beam related data and the other on BField coil status from DCS. These can also be run by hand to check the status at any time. They do require that read access to the MINOS offline database and are made available once the offline code is setup at FNAL.
Usage: is_beam_db_okay is_beam_db_okay [options] -d <NEAR|far> -r <run> [-s <subrun>] or: is_beam_db_okay [options] -t <tstart> -T <tend> <time> of the form: 'YYYY-MM-DD hh:mm:ss' (quoted for space) or a pure number of seconds since epoch options: -D <dbname> [default from ENV_TSQL_URL] -m <maxgap> absolute max of discrepancies [default 9999999] -e <err10k> difference per 10000 [default 2000] -v more verbosity of what the process is doing one MUST have ENV_TSQL_URL/ENV_TSQL_USER/ENV_TSQL_PSWD set one MUST have 'mysql' client available
Actual example of use (time-based case):
$ $SRT_DIST/admin/minfarm/is_beam_db_okay -t '2014-03-01 00:00:00' -T '2014-03-01 08:00:00' is_beam_db_okay results: CNTMATCH=-1 acceptable difference BEAM>STND TIMERANGE 2014-03-01 00:00:00 (1393632000) to 2014-03-01 08:00:00 (1393660800) ENTRIES SPILLTIMEND=15605 BEAMMONSPILL=15606 DIFFER=1 (9999999) MISS10K=0 (2000) $ echo $? # show the returned status 0 := no errors, >0 := problems 0 # example when there are problems $ $SRT_DIST/admin/minfarm/is_beam_db_okay -t '2020-12-31 00:00:00' -T '2020-12-31 08:00:00' no entries in SPILLTIMEND for 2020-12-31 00:00:00 to 2020-12-31 08:00:00 $ echo $? 1
Usage: is_bfld_db_okay -d <near|FAR> -r <run> [-s <subrun>] [-D <dbname>] or: is_bfld_db_okay -d <near|FAR> -t <tstart> -T <tend> [-D <dbname>] <time> of the form: 'YYYY-MM-DD hh:mm:ss' (quoted for space) or a pure number of seconds since epoch if <dbname> not supplied it will be taken from ENV_TSQL_URL one MUST have ENV_TSQL_URL/ENV_TSQL_USER/ENV_TSQL_PSWD set one MUST have 'mysql' client available
In actual use (run/subrun based case):
$ $SRT_DIST/admin/minfarm/is_bfld_db_okay -d Far -r 60291 -s 22 $ echo $? # very quiet success 0 := no problems, >0 := issues 0 # example when the DB wasn't up-to-date due to DCS transfer issues (should be successful in the future) $ $SRT_DIST/admin/minfarm/is_bfld_db_okay -d Far -r 60302 -s 22 mysql --batch --skip-column-names --user=reader --password=XYZZY --host=minos-db1.fnal.gov --database=offline --exec="select TIMESTART,TIMEEND,AGGREGATENO from BFLDDBICOILSTATEVLD where TIMESTART <= "2014-04-03 14:00:44" and TIMEEND >= "2014-04-03 13:00:43" and SIMMASK=1 and AGGREGATENO=1 order by TIMESTART asc" no entries in BFLDDBICOILSTATE for 2014-04-03 13:00:43 to 2014-04-03 14:00:44 $ echo $? 1
A graphical representation of key BField DCS information can be found at:
These plots are made once a day and cover the coil status for a period of 30+ days. They can not and do not distinguish between "coil off" and "have no data" as they use the C++ DBI interface which defaults to "off" when unfilled. Historical plots are linked from that page.