How to populate offline triggerThreshold and triggerDefinition tables

These two tables are used in StRoot/StTriggerUtilities to obtain the threshold, offline ID, onbits and offbits of a given trigger. They reside under Calibrations/trg/ in the offline DB directory. The offline tables get values from table dict and trigger respectively in the online database Conditions/rts.

In the online table, for every run the table has an entry, however in the offline table entry is distinct from beginTime. So for each run, before we populate the offline tables, we need to get the beginTime of runs that we want to populate. The beginTime is returned by providing a run, where it gets its values from table runDescriptor in online database RunLog. The sample code getBeginTime.C does this job, where it takes run number as its argument. The beginTime will be stored under directory beginTimes/ with file name starting with runnumber followed by ".beginTimes.txt".

Once you have get the beginTime for a given run, you can populate the tables by running code write_trigger_threshold.C and write_trigger_definition.C. Before you writing to these tables, make sure you have write access to the STAR offline tables. Both codes take a run number as their arguments.

After you have written new entries to these tables, you can use code read_trigger_threshold.C and read_trigger_definition.C. For reading these tables, you don't have to have write access to the tables. Therefore these codes can be used for reading previous entered entries. Both codes take a run number as their arguments as well.

All the sample codes can be found at CVS repository.
cvs co StRoot/StTriggerUtilities/macros/
or you can browse them at the link below.

Special notes
1. Please remember to check the correct port number to the online database server for different years. The port number is detailed at the following link.
2. Make sure the online database server is accessible, currently we are using on rcaf (on other online nodes may also work).