Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:59:53

0001 #!/bin/bash
0002 
0003 # This script can be used to append existing tags on orcon to new tags.
0004 # It downloads tags from orcoff to the dbfile.db.
0005 # It then prepares the files to append the orcoff tags to the sqlite ones.
0006 # It runs load_iov to create the new tables.
0007 
0008 tagIdentifier="GR09"
0009 oldVersion=31X_v1
0010 newVersion=ideal
0011 newIOV=100355
0012 
0013 for tag in `cmscond_list_iov -c oracle://cms_orcoff_prod/CMS_COND_21X_STRIP -P /afs/cern.ch/cms/DB/conddb | grep ${tagIdentifier}`; do
0014     echo $tag
0015     cmscond_export_iov -D CondFormatsSiStripObjects -P /afs/cern.ch/cms/DB/conddb -s  oracle://cms_orcoff_prod/CMS_COND_21X_STRIP -d sqlite_file:dbfile.db -i $tag -t $tag
0016 done
0017 
0018 for tag in `cmscond_list_iov -c sqlite_file:dbfile.db -P /afs/cern.ch/cms/DB/conddb | grep ${tagIdentifier}_${oldVersion}`; do
0019     # # First the ideal tag which will start from iov = 1
0020     idealTag=`echo $tag | sed -e "s/${oldVersion}/${newVersion}/g"`
0021     echo "Dumping payloadToken for ${idealTag}"
0022     cmscond_list_iov -c sqlite_file:dbfile.db -t $idealTag > ${tag}.txt
0023     echo "Dumping payloadToken for ${tag}"
0024     cmscond_list_iov -c sqlite_file:dbfile.db -t $tag >> ${tag}.txt
0025 
0026     # Remove five lines starting from line 6 (included)
0027     # -i means that it will modify directly the file
0028     sed -i '6, +4 d' ${tag}.txt
0029     oldIOV=$[${newIOV}-1]
0030     echo "Ideal IOV is from 1 to $oldIOV"
0031     echo "o2o IOV is from $newIOV to infinity"
0032     # Replace only in line 5
0033     sed -i "5s/4294967295/${oldIOV}/" ${tag}.txt
0034     sed -i "6s/1 /${newIOV}/" ${tag}.txt
0035     sed -i "1s/_hlt//" ${tag}.txt
0036 
0037     cmscond_load_iov -c sqlite_file:dbfile.db ${tag}.txt
0038 done