EPD DB Access


Important to remember: No empty lines in the end of txt file which you are uploading!!!!




Offline DB & JEVP && Online monitoring plots

1) You have to have permissions to write in the EDP database - ask for it Dmitry Arkhipkin.

2) Log in the RCF and rcas node. Go to folder /star/u/mstefaniak/EPD/AccessDb/, there you can find all the important
a) macros:

checkOfflineDB.C.       --> verifies offline DB if there are any obvious errors 
getTxt_epdQTMap.C   --> creates the table with the data base for a given timing stamp 
write_epdQTMap.C.    --> writes new table to the DB offline


b) folder:

txt_tables/ --> working/temporary tables are here


3) Procedure to implement changes iin Offline DB:
cd /star/u/mstefaniak/EPD/AccessDb/
get the table from given day, for example 31th May 12:30:00 - DATE_STAMP= 
20230531, TIME_STAMP= 123000

root4star -b -q 'getTxt_epdQTMap.C(DATE_STAMP, TIME_STAMP)'  

table will appear in txt_tables/epd_qtmap_ DATE_STAMP_ TIME_STAMP.txt

Open write_epdQTMap.C:
vim write_epdQTMap.C
put the new txt table to read it in and check if last lines are commented - if yes, proceed with test:

root4star -b -q write_epdQTMap.C

You are checking if you have the correct number of tiles written in table - ok? proceed to upload, open again write_epdQTMap.C  and uncomment last lines. Run again:

root4star -b -q write_epdQTMap.C

Now the DB is updated. 

Nearly-Final check, set the timing stamp in the code and:

root4star -b -q checkOfflineDB.C

=========================================================================================================

JEVP DB:

Go to: 
daqman (https://drupal.star.bnl.gov/STAR/blog/adams92/how-gain-access-daqman-epd-work)
cd /net/evp/a/jevp/client/epd
go to 2023 folder
make a new same name as before: 
epd_qtmap_ DATE_STAMP_ TIME_STAMP.txt
and insert the content of the db table txt file you got before (you can use "cat" to print the content, and then just copy/paste to the new one)
go back to 2023: cd ../
print the content: ls -lha
There is a link: 
EPD_QTmap.txt -> 2023/epd_qtmap_20230607_120000.txt
make a new one for your new DB: 
ln -sf 2023/epd_qtmap_20230607_120000.txt EPD_QTmap.txt
check:
again print files: ls -lha
check what is inside: cat  
EPD_QTmap.txt

DONE

Online monitoring plots

BE CAREFUL WITH VIM!!!!!!

similar procedure as in previous point:
log to: ssh 
onlmon@onl04
go to folder :cd  
/ldaphome/onlmon/epd2023/Signal/StRoot/StEpdQAMaker

[same as in previous point bu
t DO NOT USE VIM!!! ]
go to 2023 folder
make a new same name as before: 
epd_qtmap_ DATE_STAMP_ TIME_STAMP.txt
and insert the content of the db table txt file you got before (you can use "cat" to print the content, and then just copy/paste to the new one)
go back to 2023: cd ../
print the content: ls -lha
There is a link: 
EPD_QTmap.txt -> 2023/epd_qtmap_20230607_120000.txt
make a new one for your new DB: 
ln -sf 2023/epd_qtmap_20230607_120000.txt EPD_QTmap.txt
check:
again print files: ls -lha
check what is inside: cat  
EPD_QTmap.txt

DATA BASES UPLOADED


=========================================================================================================
=========================================================================================================
=========================================================================================================

Final check:

Offline DB:
Use macro
/ldaphome/mstefaniak/scripts/getCrDbChFromDb.C to check if the change you implemented is really there:
root4star -b -q 'getCrDbChFromDb.C(EW, PP, TT)'

JEVP plots:
https://online.star.bnl.gov/RTS/JEVP/protected/PHP/jevpViewer.php

Online monitoring plots:
https://online.star.bnl.gov/epd/#adc

Be patient and wait for the next run :)
(otherwise you will not notice the potential errors!!!)