Pi0 RunDatabase

From Hall A Wiki
Revision as of 03:25, 13 April 2008 by Bryan (Talk | contribs) (General Database Structure)

Jump to: navigation, search

The Pi0 Run Database (e04007) MySQL server is currently (online) run on adaqh1. It is automatically generated but can easily be reconstructed with the available scripts that can be run from any adaq machine.

Available Tables

  • RunInfo
    • Generated at the beginning of the run
  • scalerinfo
    • Generated at the end of the run using scaler information from the "End of Run" HALOG entries
  • AnalysisInfo
    • First entry automatically generated at the start of the run.
    • Further information is filled in by those doing the analysis (online and offline)

General Database Structure

The RunInfo table is intended to be a static table, whose entries are constant and fixed. Only on rare occasions of data corruption/mishandling, should its elements be modified. For this reason, the RunNumber column has been set as the primary key. Thus... there may be only one entry for each RunNumber.

Scripts

These are the scripts that generate the database and fill the tables. All are located here:

~a-onl/scripts/mysql
  • addRun2runlist.pl
  • setAnalysisInfo.pl
  • ~a-onl/bbite/scripts/grabRunInfo.pl

Table Descriptions

RunInfo

+----------------+-------------+------+-----+-------------------+-------+
| Field          | Type        | Null | Key | Default           | Extra |
+----------------+-------------+------+-----+-------------------+-------+
| RunNumber      | int(11)     |      | PRI | 0                 |       |
| RunStartTime   | datetime    | YES  |     | NULL              |       |
| EntryTime      | timestamp   | YES  |     | CURRENT_TIMESTAMP |       |
| TargetName     | varchar(50) | YES  |     | NULL              |       |
| TargetPosition | int(11)     | YES  |     | NULL              |       |
| LeftMomentum   | float       | YES  |     | NULL              |       |
| LeftAngle      | float       | YES  |     | NULL              |       |
| Energy         | float       | YES  |     | NULL              |       |
| BBCurrent      | float       | YES  |     | NULL              |       |
| BBAngle        | float       | YES  |     | NULL              |       |
+----------------+-------------+------+-----+-------------------+-------+

scalerinfo

+-------------------+-----------+------+-----+-------------------+----------------+
| Field             | Type      | Null | Key | Default           | Extra          |
+-------------------+-----------+------+-----+-------------------+----------------+
| scalerID          | int(11)   |      | PRI | NULL              | auto_increment |
| RunInfo_RunNumber | int(11)   | YES  | MUL | NULL              |                |
| EntryTime         | timestamp | YES  |     | CURRENT_TIMESTAMP |                |
| Events            | int(11)   | YES  |     | NULL              |                |
| Time              | float     | YES  |     | NULL              |                |
| T1prescaled       | int(11)   | YES  |     | NULL              |                |
| T1real            | int(11)   | YES  |     | NULL              |                |
| T2prescaled       | int(11)   | YES  |     | NULL              |                |
| T2real            | int(11)   | YES  |     | NULL              |                |
| T3prescaled       | int(11)   | YES  |     | NULL              |                |
| T3real            | int(11)   | YES  |     | NULL              |                |
| T4prescaled       | int(11)   | YES  |     | NULL              |                |
| T4real            | int(11)   | YES  |     | NULL              |                |
| T5prescaled       | int(11)   | YES  |     | NULL              |                |
| T5real            | int(11)   | YES  |     | NULL              |                |
| T6prescaled       | int(11)   | YES  |     | NULL              |                |
| T6real            | int(11)   | YES  |     | NULL              |                |
| T7prescaled       | int(11)   | YES  |     | NULL              |                |
| T7real            | int(11)   | YES  |     | NULL              |                |
| T8prescaled       | int(11)   | YES  |     | NULL              |                |
| T8real            | int(11)   | YES  |     | NULL              |                |
| u1charge          | float     | YES  |     | NULL              |                |
| u3charge          | float     | YES  |     | NULL              |                |
| u10charge         | float     | YES  |     | NULL              |                |
| d1charge          | float     | YES  |     | NULL              |                |
| d3charge          | float     | YES  |     | NULL              |                |
| d10charge         | float     | YES  |     | NULL              |                |
| lhrs_colli        | text      | YES  |     | NULL              |                |
| bb_colli          | text      | YES  |     | NULL              |                |
| sw_comment        | longtext  | YES  |     | NULL              |                |
+-------------------+-----------+------+-----+-------------------+----------------+

AnalysisInfo

+-------------------+------------+------+-----+-------------------+----------------+
| Field             | Type       | Null | Key | Default           | Extra          |
+-------------------+------------+------+-----+-------------------+----------------+
| anaID             | int(11)    |      | PRI | NULL              | auto_increment |
| EntryTime         | timestamp  | YES  |     | CURRENT_TIMESTAMP |                |
| RunInfo_RunNumber | int(11)    | YES  | MUL | NULL              |                |
| UserName          | longtext   | YES  |     | NULL              |                |
| KineName          | longtext   | YES  |     | NULL              |                |
| Production        | tinyint(4) | YES  |     | NULL              |                |
| Comment           | longtext   | YES  |     | NULL              |                |
+-------------------+------------+------+-----+-------------------+----------------+