3 # Shell script to compare content of the OCDB entries.
6 # Usage: bash $inputFile $flag $outputFile
8 # Usage: bash $inputFile $object_name $dump_type [XML/MI] $outfile
10 # Usage: bash $inputFile1 $inputFile2 $object_name $dump_type [XML/MI] $outfile
11 # Example usage: see example functions below
15 # create a text file with the OCDB setupt descriptors#
19 # $2 flag type of the input file
22 # AliESDs.root = "ESD"
26 if [ $# -lt 3 ] ; then
27 echo "Usage: $0 \$inputFile \$flag \$outputFile"
34 if [ ! -f ${inFile} ] ; then
35 echo ${inFile} not found!
38 if [ -f ${outFile} ] ; then
43 cat > ${tmpscript} <<HEREDOC
45 AliOCDBtoolkit::DumpOCDBAsTxt("${inFile}","${inFlag}","${outFile}");
49 aliroot -l -q -b ${tmpscript}
50 sleep 60 && rm ${tmpscript} &
61 # $3 type of the dump (XML or MI recursive dump )
64 if [ $# -lt 4 ] ; then
65 echo "Usage: $0 \$inputFile \$object_name \$dump_type [XML/MI] \$outfile"
73 if [ ! -f ${inFile} ] ; then
74 echo ${inFile} not found!
77 if [ -f ${outFile} ] ; then
80 if [ ${ftype} = "XML" ] ; then
82 elif [ ${ftype} = "MI" ] ; then
85 echo "option ${ftype} not recognized! Use \"XML\" or \"MI\"!"
89 cat > ${tmpscript} <<HEREDOC
91 AliOCDBtoolkit::DumpOCDBFile("${inFile}","${outFile}",1,${isXML});
95 aliroot -l -q -b ${tmpscript}
96 sleep 60 && rm ${tmpscript} &
107 # $4 type of the dump (xml or MI recursive dump )
109 # $5 output diff file name
110 if [ $# -lt 5 ] ; then
111 echo "Usage: $0 \$inputFile1 \$inputFile2 \$object_name \$dump_type [XML/MI] \$outfile"
122 if [ ${ftype} = "XML" ] ; then
126 elif [ ${ftype} = "MI" ] ; then
129 echo "option ${ftype} not recognized! Use \"XML\" or \"MI\"!"
132 dumpObject ${inFile1} ${fobject} ${ftype} ${tmp1%.xml}
133 dumpObject ${inFile2} ${fobject} ${ftype} ${tmp2%.xml}
134 diff ${tmp1} ${tmp2} >${outFile}
135 rm ${tmp1} ${tmp2} 2>/dev/null
136 rm "${tmp1}.xml" "${tmp2}.xml" 2>/dev/null
141 # Example usage+ developer test routines.
145 ocdbMakeTable "/hera/alice/jwagner/simulations/benchmark/aliroot_tests/ppbench/rec.log" "log" "testout"
148 dumpObject "/hera/alice/jwagner/OCDB/temp/TPC/Calib/RecoParam/Run0_999999999_v0_s0.root" "object" "XML" "testout2XML"
149 dumpObject "/hera/alice/jwagner/OCDB/temp/TPC/Calib/RecoParam/Run0_999999999_v0_s0.root" "object" "MI" "testout2MI"
152 file1="/hera/alice/jwagner/OCDB/temp/TPC/Calib/RecoParam/Run0_999999999_v0_s0.root"
153 file2="$ALICE_ROOT/OCDB/TPC/Calib/RecoParam/Run0_999999999_v0_s0.root"
154 diffObject ${file1} ${file2} "object" "MI" "testdiffMI"
155 diffObject ${file1} ${file2} "object" "XML" "testdiffXML"
159 source /hera/alice/jwagner/software/aliroot/loadMyAliroot.sh TPCdev