]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGHF/hfe/AliHFEtools.cxx
Why the h*ll do we make a remote commit when pulling?
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliHFEtools.cxx
index b03db05b0ef85b3ee5d874a32c8b16c472609d35..5bc40ce5b8af78f56c907154862cdb33c0bd024e 100644 (file)
@@ -490,6 +490,34 @@ TList *AliHFEtools::GetHFEResultList(const TString str){
     return returnlist;
 }
 
+
+//_________________________________________________________________________
+//Function  AliHFEtools::GetHFEQAList() - opens file from argument and returns TList Object containing String "QA"
+//_________________________________________________________________________
+TList *AliHFEtools::GetHFEQAList(const TString str){
+
+    TFile *f = TFile::Open(str.Data());
+    if(!f || f->IsZombie()){
+        printf("Could not read file %s\n",str.Data()); 
+        return NULL ;
+    }
+    gROOT->cd();
+    TKey *k;
+    TIter next(f->GetListOfKeys());
+    while ((k = dynamic_cast<TKey *>(next()))){
+        TString s(k->GetName());
+        if(s.Contains("QA")) break;
+    }
+    if(!k){
+        printf("Output container not found\n");
+        f->Close(); delete f;
+        return NULL;
+    } 
+    TList *returnlist = dynamic_cast<TList *>(k->ReadObj());
+    f->Close(); delete f;
+    return returnlist;
+}
+
 //__________________________________________
 void AliHFEtools::NormaliseBinWidth(TH1 *histo){
   //