Tracker Databases: Difference between revisions
Line 1: | Line 1: | ||
= Tracker Databases = | = Tracker Databases = | ||
There are a few tracker databases hosted at different sites. This wiki page currently focuses on the ones that interact with Fermilab-hosted <code>mu2e_tracker_prd</code> database and use tools available in the [https://github.com/Mu2e/TrackerHardwareDB TrackerHardwareDB] git repository. | |||
== Setting Up == | |||
To use the tools described on this wiki page, you need to clone the [https://github.com/Mu2e/TrackerHardwareDB TrackerHardwareDB] git repository as follows: | |||
ssh -XY username@mu2egpvmXX.fnal.gov | |||
cd /mu2e/app/users/username/ | |||
git clone https://github.com/Mu2e/TrackerHardwareDB | |||
To get any code updates, you should periodically do | |||
cd TrackerHardwareDB | |||
git pull | |||
== FNAL Planes Database == | == FNAL Planes Database == | ||
The database for the plane construction at FNAL | The database for the plane construction at FNAL. The working version is not hosted on <code>mu2e_tracker_prd</code> but is copied to the <code>imported.fnal_planes</code> database table in <code>mu2e_tracker_prd</code>. | ||
=== Importing === | === Importing === | ||
To import to mu2e_tracker_prd: | To import to <code>mu2e_tracker_prd</code>: | ||
cd TrackerHardwareDB/python | cd TrackerHardwareDB/python | ||
python3 create_imported_fnal_planesdb.py path/to/fnal/planesdb | python3 create_imported_fnal_planesdb.py path/to/fnal/planesdb | ||
Line 28: | Line 38: | ||
To install the panel QC viewer: | To install the panel QC viewer: | ||
cd TrackerHardwareDB/panel-qc-viewer/ | cd TrackerHardwareDB/panel-qc-viewer/ | ||
npm install | npm install | ||
==== Running ==== | ==== Running ==== | ||
To run the panel QC viewer: | To run the panel QC viewer, you need to forward a port when you ssh to the mu2egpvm machine: | ||
ssh -L 3000:localhost:3000 -XY username@mu2egpvmXX.fnal.gov | ssh -L 3000:localhost:3000 -XY username@mu2egpvmXX.fnal.gov | ||
cd | cd TrackerHardwareDB/panel-qc-viewer | ||
npm start | npm start | ||
Line 46: | Line 53: | ||
PORT=XXXX npm start | PORT=XXXX npm start | ||
=== Updating === | |||
There are a few python scripts that can be used to update the <code>qc.panels</code> table. To set up to run the python scripts you need to do the following: | |||
cd TrackerHardwareDB/python | |||
setup mu2e | |||
muse setup Offline | |||
setup pyana | |||
==== Adding a new panel ==== | |||
python3 create_insert_new_panel.py --panel_ids X Y Z | |||
will create .sql files to insert new rows for panels X, Y, and Z. | |||
==== Changing missing_straws, high_current_wires, etc. ==== | |||
python3 create_update_qc_panels_table.py --panel_id XX --{new/add/remove}_{column1} A B C --{new/add/remove}_{column2} D E F | |||
will create .sql files to update panel XX. | |||
Some examples: | |||
* This will replace the current contents of <code>missing_straws</code> column for panel 53 with straw numbers 1, 2, 3. | |||
python3 create_update_qc_panels_table.py --panel_id 53 --new_missing_straws 1 2 3 | |||
* This will add the straw number 4 to the current list of <code>high_current_wires</code> for panel 76: | |||
python3 create_update_qc_panels_table.py --panel_id 76 --add_high_current_wires 4 | |||
* This will remove the straw number 5 from the current list of <code>missing_wires</code> and add the straw numbers 88 and 89 to the current list of <code>loose_omega_pieces</code> for panel 121: | |||
python3 create_update_qc_panels_table.py --panel_id 121 --remove_missing_wires 5 --add_loose_omega_pieces 88 89 |
Revision as of 14:59, 4 April 2023
Tracker Databases
There are a few tracker databases hosted at different sites. This wiki page currently focuses on the ones that interact with Fermilab-hosted mu2e_tracker_prd
database and use tools available in the TrackerHardwareDB git repository.
Setting Up
To use the tools described on this wiki page, you need to clone the TrackerHardwareDB git repository as follows:
ssh -XY username@mu2egpvmXX.fnal.gov cd /mu2e/app/users/username/ git clone https://github.com/Mu2e/TrackerHardwareDB
To get any code updates, you should periodically do
cd TrackerHardwareDB git pull
FNAL Planes Database
The database for the plane construction at FNAL. The working version is not hosted on mu2e_tracker_prd
but is copied to the imported.fnal_planes
database table in mu2e_tracker_prd
.
Importing
To import to mu2e_tracker_prd
:
cd TrackerHardwareDB/python python3 create_imported_fnal_planesdb.py path/to/fnal/planesdb
This will create two .sql files. You will need mu2e_tracker_admin privileges to then do
cd ../sql psql -h ifdb08 -p 5459 mu2e_tracker_prd < create_imported_fnal_planesdb.sql psql -h ifdb08 -p 5459 mu2e_tracker_prd < insert_imported_fnal_planesdb.sql
The information can then be viewed using the panel QC viewer below.
Panel QC Database
The panel QC database that is stored in mu2e_tracker_prd
Viewer
Installation
To install the panel QC viewer:
cd TrackerHardwareDB/panel-qc-viewer/ npm install
Running
To run the panel QC viewer, you need to forward a port when you ssh to the mu2egpvm machine:
ssh -L 3000:localhost:3000 -XY username@mu2egpvmXX.fnal.gov cd TrackerHardwareDB/panel-qc-viewer npm start
Then you can open a browser and go to localhost:3000 on your local machine
To run on a different port you can type:
PORT=XXXX npm start
Updating
There are a few python scripts that can be used to update the qc.panels
table. To set up to run the python scripts you need to do the following:
cd TrackerHardwareDB/python setup mu2e muse setup Offline setup pyana
Adding a new panel
python3 create_insert_new_panel.py --panel_ids X Y Z
will create .sql files to insert new rows for panels X, Y, and Z.
Changing missing_straws, high_current_wires, etc.
python3 create_update_qc_panels_table.py --panel_id XX --{new/add/remove}_{column1} A B C --{new/add/remove}_{column2} D E F
will create .sql files to update panel XX.
Some examples:
- This will replace the current contents of
missing_straws
column for panel 53 with straw numbers 1, 2, 3.
python3 create_update_qc_panels_table.py --panel_id 53 --new_missing_straws 1 2 3
- This will add the straw number 4 to the current list of
high_current_wires
for panel 76:
python3 create_update_qc_panels_table.py --panel_id 76 --add_high_current_wires 4
- This will remove the straw number 5 from the current list of
missing_wires
and add the straw numbers 88 and 89 to the current list ofloose_omega_pieces
for panel 121:
python3 create_update_qc_panels_table.py --panel_id 121 --remove_missing_wires 5 --add_loose_omega_pieces 88 89