Difference between revisions of "Pi0 RunDatabase"

From Hall A Wiki
Jump to: navigation, search
m (Scripts)
m (Scripts)
Line 22: Line 22:
 
  Usage:
 
  Usage:
 
       setAnalysisInfo.pl [OPTION]
 
       setAnalysisInfo.pl [OPTION]
----
+
----
 
  Command-line options:
 
  Command-line options:
 
   -r, --runnum [LOW NUMBER]-[HIGH NUMBER]
 
   -r, --runnum [LOW NUMBER]-[HIGH NUMBER]
 
       Specify the range of runnumbers to modify.  One number will work
 
       Specify the range of runnumbers to modify.  One number will work
 
       for single run modifications.
 
       for single run modifications.
----
+
----
 
   -u, --username [USERNAME]
 
   -u, --username [USERNAME]
 
       Specify the name of the person making the modification
 
       Specify the name of the person making the modification
----
+
----
 
   -k, --kinematic [KINEMATIC]
 
   -k, --kinematic [KINEMATIC]
 
       Specify the kinematic name.
 
       Specify the kinematic name.
----
+
----
 
   -p, --production [0,1]
 
   -p, --production [0,1]
 
       Specify if the run is production (1) or not (0)
 
       Specify if the run is production (1) or not (0)
----
+
----
 
   -c, --comment "[COMMENT]"
 
   -c, --comment "[COMMENT]"
 
       Add a comment.  For best results, put the entire comment in  
 
       Add a comment.  For best results, put the entire comment in  
 
       quotation marks.
 
       quotation marks.
----
+
----
 
   -v, --verbose
 
   -v, --verbose
 
       Be verbose.
 
       Be verbose.

Revision as of 03:31, 13 April 2008

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
Usage:
      setAnalysisInfo.pl [OPTION]
----
Command-line options:
  -r, --runnum [LOW NUMBER]-[HIGH NUMBER]
      Specify the range of runnumbers to modify.  One number will work
      for single run modifications.
----
  -u, --username [USERNAME]
      Specify the name of the person making the modification
----
  -k, --kinematic [KINEMATIC]
      Specify the kinematic name.
----
  -p, --production [0,1]
      Specify if the run is production (1) or not (0)
----
  -c, --comment "[COMMENT]"
      Add a comment.  For best results, put the entire comment in 
      quotation marks.
----
  -v, --verbose
      Be verbose.
  • ~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              |                |
+-------------------+------------+------+-----+-------------------+----------------+