Difference between revisions of "Pi0 RunDatabase"

From Hall A Wiki
Jump to: navigation, search
m (runlist)
(Scripts)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
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.
 
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.
 +
 +
This page is meant to be for documentation for what is available, and not as a HOWTO.
  
 
== Available Tables ==
 
== Available Tables ==
Line 24: Line 26:
 
* addRun2runlist.pl
 
* addRun2runlist.pl
 
** Main script for adding entries to the RunInfo table
 
** Main script for adding entries to the RunInfo table
 +
Usage:
 +
      addRun2runlist.pl [OPTION]
 +
----
 +
Command-line options:
 +
  -r, --runnumber [RUN NUMBER]
 +
      Specify the run number to add.  Currently only takes
 +
      single run numbers for addition.
 +
----
 +
  -d, --timedate [RUN START TIME]
 +
      Specify the start of run time and date.  Uses `date +"%F %T"`
 +
      in the epicsRunStart script.
 +
----
 +
  -n, --targetname [TARGET NAME]
 +
      Specify the target name.  Obtained from the 'haBDSSELECT' EPICS
 +
      variable.
 +
----
 +
  -t, --targetpos [TARGET POSITION]
 +
      Specify the target position.  Obtained from the 'haBDSPOS' EPICS
 +
      variable.
 +
----
 +
  -l, --leftmom "[Left HRS Momentum]"
 +
      Specify the L-HRS momentum setting.  Obtained from the 'HacL_D1_P0rb'
 +
      EPICS variable.
 +
----
 +
  -a, --leftang "[Left HRS Angle]"
 +
      Specify the L-HRS angle.  Obtained from the 'HacL_alignAGL' EPICS
 +
      variable.
 +
----
 +
  -e, --energy "[Beam Energy]"
 +
      Specify the beam energy.  Obtained from the 'halla_MeV' EPICS
 +
      variable.
 +
----
 +
  -i, --bbcurrent "[BigBite Current]"
 +
      Specify the BigBite magnet current.  Obtained from the 'MBIGBOXM'
 +
      EPICS variable.
 +
----
 +
  -g, --bbangle "[BigBite Angle]"
 +
      Specify the BigBite angle.  Read from BB_angle.dat.
  
 
* ~a-onl/bbite/scripts/grabRunInfo.pl
 
* ~a-onl/bbite/scripts/grabRunInfo.pl
Line 124: Line 164:
  
 
== Display ==
 
== Display ==
=== runlist ===
+
=== Runlist ===
 
A current runlist, using the e04007 MySQL database, is found here:
 
A current runlist, using the e04007 MySQL database, is found here:
   [http://hallaweb.jlab.org/experiment/E04-007/runlist/runlist.php]
+
   [http://hallaweb.jlab.org/experiment/E04-007/runlist/runlist.php E04007 Runlist]
  
==
+
=== Kinematic Summary ===
 +
A summary of the production runs, sorted by kinematic letter, is found here:
 +
  [http://hallaweb.jlab.org/experiment/E04-007/runlist/runsummary.php E04007 Kinematics Summary]

Latest revision as of 13:47, 14 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.

This page is meant to be for documentation for what is available, and not as a HOWTO.

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.

Other tables, related to e04007, are considered to be derived from the RunInfo table. They are connected through the RunNumber using Foreign Keys. This means that an entry for a given run in a derived table MUST have a corresponding entry in the RunInfo table.

Each derived table has its Key set to auto-increment. This provides us with the ability to save the history of changes made to the table. To grab the most recent entry, order by the key in descending order and pick the first entry. For example, to grab the most recent entry from the AnalysisInfo table for runnumber 3918:

SELECT * FROM AnalysisInfo WHERE RunInfo.RunNumber=3918 ORDER BY anaID DESC LIMIT 1

Scripts

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

~a-onl/scripts/mysql
  • addRun2runlist.pl
    • Main script for adding entries to the RunInfo table
Usage:
      addRun2runlist.pl [OPTION]
----
Command-line options:
  -r, --runnumber [RUN NUMBER]
      Specify the run number to add.  Currently only takes 
      single run numbers for addition.
----
  -d, --timedate [RUN START TIME]
      Specify the start of run time and date.  Uses `date +"%F %T"`
      in the epicsRunStart script.
----
  -n, --targetname [TARGET NAME]
      Specify the target name.  Obtained from the 'haBDSSELECT' EPICS
      variable.
----
  -t, --targetpos [TARGET POSITION]
      Specify the target position.  Obtained from the 'haBDSPOS' EPICS
      variable.
----
  -l, --leftmom "[Left HRS Momentum]"
      Specify the L-HRS momentum setting.  Obtained from the 'HacL_D1_P0rb'
      EPICS variable.
----
  -a, --leftang "[Left HRS Angle]"
      Specify the L-HRS angle.  Obtained from the 'HacL_alignAGL' EPICS 
      variable.
----
  -e, --energy "[Beam Energy]"
      Specify the beam energy.  Obtained from the 'halla_MeV' EPICS 
      variable.
----
  -i, --bbcurrent "[BigBite Current]"
      Specify the BigBite magnet current.  Obtained from the 'MBIGBOXM' 
      EPICS variable.
----
  -g, --bbangle "[BigBite Angle]"
      Specify the BigBite angle.  Read from BB_angle.dat.
  • ~a-onl/bbite/scripts/grabRunInfo.pl
    • Main script for adding entries to the scalerinfo table
  • setAnalysisInfo.pl
    • Main script for adding entries to the AnalysisInfo table
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.

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              |                |
+-------------------+------------+------+-----+-------------------+----------------+

Display

Runlist

A current runlist, using the e04007 MySQL database, is found here:

 E04007 Runlist

Kinematic Summary

A summary of the production runs, sorted by kinematic letter, is found here:

 E04007 Kinematics Summary