]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
added function that writes a lookedup chain back to disk
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Aug 2006 15:44:36 +0000 (15:44 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Aug 2006 15:44:36 +0000 (15:44 +0000)
PWG0/CreateESDChain.C

index f05eb3799e0b29a34c5ab08233597e8b3dd46a51..b9009f7b5eef8622736b0a649e8d3627c8c8d3d1 100644 (file)
@@ -87,3 +87,24 @@ TChain* CreateESDChain(const char* aDataDir = "ESDfiles.txt", Int_t aRuns = 20,
 
   return chain;
 }
+
+void LookupWrite(TChain* chain, const char* target)
+{
+  // looks up the chain and writes the remaining files to the text file target
+
+  chain->Lookup();
+
+  TObjArray* list = chain->GetListOfFiles();
+  TIterator* iter = list->MakeIterator();
+  TObject* obj = 0;
+
+  ofstream outfile;
+  outfile.open(target);
+
+  while ((obj = iter->Next()))
+    outfile << obj->GetTitle() << "#AliESDs.root" << endl;
+
+  outfile.close();
+
+  delete iter;
+}