]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliQAv1.cxx
added static method to retrieve a QA data object from a given list
[u/mrichter/AliRoot.git] / STEER / AliQAv1.cxx
index 24be2719f45530b3e3440d671156b98722de52d0..f4856f39d7f9e1907b4b7ac3f05537c430381693 100644 (file)
@@ -36,6 +36,7 @@
 // --- ROOT system ---
 #include <TClass.h>
 #include <TFile.h>
+#include <TH1.h>
 #include <TSystem.h>
 #include <TROOT.h>
 
@@ -340,6 +341,25 @@ const char * AliQAv1::GetBitName(QABIT_t bit) const
        return bitName.Data() ;
 }
 
+//_______________________________________________________________
+TH1 * AliQAv1::GetData(TObjArray** list, Int_t index, AliRecoParam::EventSpecie_t eventSpecie)
+{
+    // retrieve QA data from the list at a given index and for a given event specie 
+  TH1 * rv = NULL ; 
+  Int_t esindex = AliRecoParam::AConvert(eventSpecie) ; 
+  TObjArray * arr = list[esindex] ;
+  if (arr) {
+    if ( index > AliQAv1::GetMaxQAObj() ) {
+                       AliErrorClass(Form("Max number of authorized QA objects is %d", AliQAv1::GetMaxQAObj())) ; 
+               } else {
+      if ( arr->At(index) )  {
+        rv = static_cast<TH1*>(arr->At(index)) ; 
+      }        
+    }
+  }  
+  return rv ; 
+}
+
 //_______________________________________________________________
 AliQAv1::DETECTORINDEX_t AliQAv1::GetDetIndex(const char * name) 
 {