command line tool to dump a object in the file in XML format
authormivanov <marian.ivanov@cern.ch>
Thu, 27 Mar 2014 19:58:29 +0000 (20:58 +0100)
committermivanov <marian.ivanov@cern.ch>
Thu, 27 Mar 2014 19:58:29 +0000 (20:58 +0100)
diff, meld, xmldiff can be than used to compare the content
of 2 files as text files

PWGPP/CalibMacros/xmldump [new file with mode: 0644]

diff --git a/PWGPP/CalibMacros/xmldump b/PWGPP/CalibMacros/xmldump
new file mode 100644 (file)
index 0000000..c25c5fe
--- /dev/null
@@ -0,0 +1,26 @@
+
+
+xmldump(){
+       #
+       # Dump object from file
+        #
+# Example usage:
+#       xmldump /cvmfs/alice.gsi.de/alice/data/2010/OCDB/TPC/Calib/RecoParam/Run0_999999999_v1_s0.root AliCDBEntry Run0_999999999_v1_s0.dump
+
+       fin=$1  
+        object=$2
+        fout=$3
+       
+       echo "void xmldump(){" >xmldump.C
+       echo "printf(\"Hallo world\n\");" >>xmldump.C
+       echo "TFile* fin=TFile::Open(\"$fin\");"     >>xmldump.C
+       echo "TFile* fout=TFile::Open(\"$fout.xml\",\"recreate\");"     >>xmldump.C
+        echo "TObject * obj= (TObject*)fin->Get(\"$2\");"  >>xmldump.C
+        echo "obj->Print();"  >>xmldump.C
+        echo "obj->Write();"  >>xmldump.C
+        echo "delete fout;"  >>xmldump.C
+        echo "}"  >>xmldump.C
+        aliroot -b -q xmldump.C
+}
+
+