Added repository for QA output controls
authordecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 Nov 2011 11:33:12 +0000 (11:33 +0000)
committerdecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 Nov 2011 11:33:12 +0000 (11:33 +0000)
TOF/macrosQA/merge.C [new file with mode: 0644]

diff --git a/TOF/macrosQA/merge.C b/TOF/macrosQA/merge.C
new file mode 100644 (file)
index 0000000..e471235
--- /dev/null
@@ -0,0 +1,25 @@
+//
+// Macro to merge root files
+//
+void merge(Bool_t isOnGrid=kTRUE,
+          Char_t *outputFileName="AnalysisResults.root",
+          Char_t *inputFileName="listOfFiles.txt")
+{
+
+  if (isOnGrid) TGrid::Connect("alien://");
+
+  TFileMerger m;
+  m.OutputFile(outputFileName);
+
+  ifstream ftxt(inputFileName);
+  Char_t fileName[4096];
+  while (!ftxt.eof()) {
+    ftxt.getline(fileName,4096);
+    if (ftxt.eof()) break;
+    m.AddFile(fileName);
+  }
+  ftxt.close();
+
+  m.Merge();
+
+}