Added macro for local merging of the QA output
authorfbellini <fbellini@cern.ch>
Thu, 23 Oct 2014 15:39:39 +0000 (17:39 +0200)
committerfbellini <fbellini@cern.ch>
Thu, 23 Oct 2014 15:42:12 +0000 (17:42 +0200)
PWGPP/TOF/trending/localMergeFiles.C [new file with mode: 0644]

diff --git a/PWGPP/TOF/trending/localMergeFiles.C b/PWGPP/TOF/trending/localMergeFiles.C
new file mode 100644 (file)
index 0000000..cb6893a
--- /dev/null
@@ -0,0 +1,19 @@
+
+Int_t localMergeFiles(Char_t * outfile=NULL, Char_t * list=NULL)
+{
+  Int_t filesCounter=0;
+  TFileMerger merger ; 
+  if (!list) {
+    printf("Invalid list of files given as input: nothing done\n");
+    return 0;
+  }    
+  merger.OutputFile(outfile); 
+  TString infile ; 
+  FILE * files = fopen(list, "r") ; 
+  while ( infile.Gets(files) ){
+    if (merger.AddFile(infile)) filesCounter++;     
+  } 
+  printf("Number of files to be merged = %i\n",filesCounter);
+  merger.Merge();  
+  return 1; 
+}