http://cool.cvs.cern.ch/cgi-bin/cool.cgi/cool/contrib/XmlCool/
[How to build and run a simple COOL example using SCRAM]
http://lcgapp.cern.ch/project/CondDB/snapshot/gettingStartedCOOL.html
To check out the package... First:
export CVSROOT=:pserver:anonymous@cool.cvs.cern.ch:/cvs/COOL cvs login (the password is blank) cvs co cool/contrib/XmlCool
Edit xml2cool.cpp under XMLCOOL to input a valid password (defPWD) and databasename (defDBName).
Compile using 'scram b' and then use the command:
unitTest_RelationalCool_COOL2XML mytest
which will download the COOL data in XML format to a file named mytest.xml
This can be transformed to the SCT XML format using an XSL transform and the saxon or xsltproc program
In SR1, the code is at:
/daqsoft/cool/SCT_TEST_COOL_1_2_4/src/RelationalCool?/tests/XML2COOL
The latest transform can be found at
http://sroe.home.cern.ch/sroe/xsl/SCT2COOL.xsl
or
wget "http://sroe.home.cern.ch/sroe/xsl/SCT2COOL.xsl"
Viewing existing uploads to COOL
The standalone SCT system used to upload to CMCPROD, which can be viewed at http://atldbdev01.cern.ch:9243/?dbname=SCT-CMC&folder=/SCT/auxiliaryInfoBut now all uploads (noth SCT standalone and SCT/TRT combined) are to COMPROD, viewable at:
http://atldbdev01.cern.ch:9243/?dbname=SCT-COMPROD&folder=/SCT/auxiliaryInfo
If the above links are not active, you can try restarting the server by http://atldbdev01.cern.ch:9463/?restart=yes
How to download xml file from COOL
- Setup environment (source /daqsoft/cool/setup.sh)
- unitTest_RelationalCool_COOL2XML mytest NaN? "oracle://devdb10;schema=atlas_sct_commcond_dev;user=atlas_sct_commcond_dev;password=thepassword;dbname=DUCK"
where
- mytest is the target file (becomes mytest.xml)
- secong arg is the time (ns since 1970... NaN? defaults to NOW)
- third arg is connections string
- transform to sct compatible xml by the following step
- xsltproc -o checksct.xml COOL2SCT.xsl mytest.xml, where checksct.cml is sct-comaptible xml, COOL2SCT.xsl is transform template
How to upload xml file to COOL
Example: You want to upload the configuration for run 2414, which is located in /work/srsctdaq1/sr1daq/saved_data as configArchive_2414_start.xml.gz.
- cd /daqsoft/cool
- source setup.sh (set up environment)
- gunzip -c /work/srsctdaq1/sr1daq/saved_data/configArchive_2414_start.xml.gz > /work/srsctdaq1/uploads/configArchive_2414_start.xml (create an unzipped copy)
- xsltproc -o /work/srsctdaq1/uploads/run002414.xml /daqsoft/cool/SCT2COOL.xsl /work/srsctdaq1/uploads/configArchive_2414_start.xml (transform the original, with new filename run002414.xml)
- OLD: unitTest_RelationalCool_XML2COOL -a /work/srsctdaq1/uploads/run002414.xml "oracle://atlas_coolprod;schema=atlas_cool_sct;user=ATLAS_COOL_sct_w;password=thepassword;dbname=CMCPROD" 2414 2414 (upload it - as an append to previous uploads, for new IOV range 2414 to 2414)
- NEW: unitTest_RelationalCool_XML2COOL -a /work/srsctdaq1/uploads/run002414.xml "oracle://atlas_coolprod;schema=atlas_cool_sct;user=ATLAS_COOL_sct_w;password=WCOOL4SCT10;dbname=COMPROD" 2414 2414
Note 'thepassword' is defined in /daqsoft/cool/cstring.txt
Scripts are in preparation to automate this process (upload many runs... to be run as a cron):
- /daqsoft/sct/scripts/tocool.sh
- (the above script invokes /daqsoft/sct/coolcopy.pl, which is a perl script to do most of the work)
Further notes from Shaun
- unitTest_RelationalCool_XML2COOL -n DuckTest?.xml "oracle:// devdb10;schema=atlas_sct_commcond_dev;user=atlas_sct_commcond_dev;passwo rd=thepassword;dbname=DUCK" 0 10 Creates a database with Interval Of Validity 0 - 10
unitTest_RelationalCool_COOL2XML myDuck 5 "oracle:// devdb10;schema=atlas_sct_commcond_dev;user=atlas_sct_commcond_dev;passwo rd=thepassword;dbname=DUCK" Retrieves the database to file myDuck.xml
- Testing append to a subsequent IOV I edited one attribute in the file and then issued: unitTest_RelationalCool_XML2COOL -a DuckTest?.xml "oracle:// devdb10;schema=atlas_sct_commcond_dev;user=atlas_sct_commcond_dev;passwo rd=thepassword;dbname=DUCK" 11 20 (i.e IOV 11 to 20) . Using COOL2XML with IOV = 5 and IOV = 15, I was able to retrieve the two versions of the file
- Testing adding an additional channel By adding an additional channel in a folder (in the xml) and repeating the test for IOV from 21 to 30 and then retrieving for time = 25, I was able to confirm that additional objects can be added to a folder
- Semi infinite intervals By issuing unitTest_RelationalCool_XML2COOL -a DuckTest?.xml "oracle:// devdb10;schema=atlas_sct_commcond_dev;user=atlas_sct_commcond_dev;passwo rd=thepassword;dbname=DUCK" 31 (i.e. with the IOV stop time missing) I created entries which were valid from t=31 to t=infinity
- Partial update By creating an xml file with only one channel and changing its value, then issuing unitTest_RelationalCool_XML2COOL -a DuckTest?.xml "oracle:// devdb10;schema=atlas_sct_commcond_dev;user=atlas_sct_commcond_dev;passwo rd=thepassword;dbname=DUCK" 41 I could create files where only one channel was updated but all the other data remained valid
Contents of setup.sh
cd /daqsoft/cool/COOL_1_2_3 export PATH=/afs/cern.ch/sw/lcg/app/spi/scram:$PATH export SCRAM_ARCH=slc3_ia32_gcc323 eval `scram runtime -sh`