|
 |
STAR SSD
|
- OFFLINE
|
How to create a new table
Here are few steps to create a table :
On a rcas :
- set up the environment to DEV
- copy the directory $STAR/StDb in your work dir : cp -r $STAR/StDb ./
- create the .idl of your table (in this example, myTable.idl)
- compile StDb : cons +StDb
- St_myTable_TableCint.cxx, St_myTable_TableCint.h, St_MyTable_TableCint.o, St_MyTable_Table.cxx and St_MyTable_Table.o should appear in your root libraries (.slXXX/obj/StDb
- as well MyTable.h in .slXXX/include/
- The next steps are to include in your maker the .h : #include "tables/St_MyTable_Table.h" (in the .cxx) and the correspnding class : class St_MyTable; (in the .h)
How to write table in db
Tutorial from Joerg :
here
As you have a table that you want to update with a new entry, eg ssdNoise.xxxxxxxx.root (new table for pedestal and noise).
You have to know first in which directory/path in MySql it belongs : here
On a rcas :
- create a directory with the correct path : in this example : StarDb/Calibrations/ssd
- set your environment in order to write in Db :
- setenv DB_ACCESS_MODE write
- write your entry : usually I use the macro put2DB.C:
- : root4star -b put2DB.C("StarDb/Calibrations/ssd/**my_entry**")
- the table can be a root file or a .C file
- set your environment back to read mode :setenv DB_ACCESS_MODE read
Jonathan.Bouchet