Commits

Anonymous committed 1c87279

Merger for DRAW files

Comments (0)

Files changed (2)

+2012-01-11  Vakho Tsulaia  <tsulaia@mail.cern.ch>
+
+	* Merger for DRAW files
+
 2012-01-10  Wim Lavrijsen <WLavrijsen@lbl.gov>
         * Expansion of adiabatic changes (still disabled) with initializers and
           better result returns

python/MpMergeUtils.py

 
 def merge_bs_files(output_file, input_files, logfile="log.merge_bs_files"):
     """dummy version of bs files merger"""
-    msg.info("merge_bs_files: [does nothing - to be implemented]")
-    #write_merging_log(logfile, cmd, out, sc)
-    sc = 0
-    return sc
+    msg.info("merge_bs_files: ")
+    import os, commands
+    if os.path.exists(output_file):
+        os.remove(output_file)
+
+    cmd = "AtlCopyBSEvent.exe -e all -o %s" % output_file
+    for file in input_files:
+        cmd = cmd + " %s" % file
+
+    msg.info( " firing merging command for merging bs files:[%s]" % cmd)
+    sc, out = commands.getstatusoutput(cmd)
+    msg.info("merge_bs_files: sc=[%s], log_file=[%s] " % (sc, logfile))
+        
+    write_merging_log(logfile, cmd, out, sc)
+    return sc % 256
 
 def merge_pool_collection_files(output_file, input_files, logfile="log.merge_pool_collection_files"):
     """ merge of pool collection files, like TAG.root"""