cdev'06 code


Machinery used to archive (and monitor) cdev info in the STAR online Db
  1. General scheme requires two pairs of processes: acquire (A-->B) and monitor( C-->D) running in 2 independent, infinite loops:
    A) Read relevant records from cdev-server and write them to stdout in XML format
    B) write XML records to online STAR DB
    C) read XML records from online DB
    D) unpack XML, generate plots (jpg) & HTML on the disk, post on the web current content of cdev monitoring pages
  2. The code used in 2006 is archived in $CVSROOT/online/eemc/dataQuery/cdevQuery/
    $CVSROOT/online/eemc/webGenerators/cdevWeb/
  3. the whole monitoring machinery runs simultaneously on several machines under few users and require special I/O prvileges described below in details.
Details of the setup, see also instruction below the table
goal of process main code user@machine directory special priviliges
A) read cdev, write XML cdevQuery/ askCdev balewski@onllinux8 /onllinux/users/balewski/dataQuery/cdevQuery ssh-key to eemcdb@eemc-sc.starp.bnl.gov
B) write XML to online DB eemcDb eemcdb@eemc-sc.starp.bnl.gov ~/onlineCdev2006 ssh-key for balewski & DB write
C) read XML mysql... balewski@onllinux8 /onllinux/users/balewski/webGenerators/cdevWeb none
D) unpack XML, produce HTML plotCdev2005b.tcl balewski@onllinux8 /onllinux/users/balewski/webGenerators/cdevWeb write to web

A-details
  1. login & execute 1 time new.cshrc;
  2. compile w/ make in sub-dir X86;
  3. run by hand askCdev and you should see XML file on the screen;
  4. change cc-code & S6CDEV.DDL if you need different cdev devices or some names have changed. Contact Angelika or Seth for help.

B-details
  1. Ask Michael to setup a fresh DB-table= Conditions_rhic node=VerA/online/cdev , not sure about DB-port?
  2. Ask Michael to give you write privileges and setup new
  3. verify the old exec 'eemcDB' still works and try to write any record to this DB table
  4. the source code & exec for 'eemcDB' program writing to DB is at rcas6nnn at my private directory /star/u/balewski/dbaseIO/src/eemcDb. The simplest is to just copy this exec to a linux machine of choice and use it. Instruction how to compile on version of eemcDB is at the bottom f this page - FYI: at the moment it does not work.

Make A+B work together
  1. on onllinux8 there is macro doing one cdev query + one DB-write : oneCdev2Db.sh - make it to work
  2. the infinite loop is controlled by the macro oneCdev2Db.sh - make it work

C-details all is run as macros
  1. login to onllinux8
  2. verify mySql query works: mysql -h onldb.starp.bnl.gov --port 3502 Conditions_rhic -e "SELECT dataS FROM kretDbBlobS WHERE nodeID=9 ORDER By beginTime desc LIMIT 1 " -s -E returns the last written record (by step B)
D-details all is run as macros
  1. Ask Michael to setup destination, web-visible directory seen from onllinux8 as /onlineweb/www/cdev2008, ask for write privileges, change lik from the main STAR-online age, backup and erase 2006 content to make space.
  2. login to onllinux8 and create set of sub-dirs : wrk/data wrk/jpg wrk/fillHistory/
  3. verify you can write to /onlineweb/www/cdev2008
  4. execute mySql query and write output as wrk/outCdev.eve
  5. exercise tclTk macro plotCdev2005b.tclconverting XML input in to updated web pages - takes ~minute to run, should be no errors
  6. copy by hand udated HTML files and see via web-browser if you got what you want: cp -rp wrk/data wrk/jpg wrk/*html wrk/*eve wrk/fillHistory/ /onlineweb/www/cdev2008
  7. start infinite loop: loopCdevDb2Web.sh

Compilation of eemcDB - stand alone, static DB-IO interface
mkdir aaa
cd aaa
cp -rp /star/u/balewski/dbaseIO/src .
cvs co StRoot/StDbLib
cd StRoot/StDbLib
make clean
make 
cd ../../src
make clean
make
This prescription fails in final compiltaon stage - there are some unresolved dependencies in StDbLib.

Note, there are alternatives to uploading tables to DB, e.g. one could write a stand alone .C macro as attached to this page. Such macro is self contained, no supporting compilable code is needed. However one would need to adjust it to write the cdev tables.