]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
added static method to retrieve a QA data object from a given list
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 21 Oct 2009 21:53:14 +0000 (21:53 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 21 Oct 2009 21:53:14 +0000 (21:53 +0000)
STEER/AliQAv1.cxx
STEER/AliQAv1.h

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) 
 {
index bdd9ff830033dd537e6fb18293c3581fbfcc93d1..df101522751fa69dbd5eb5d10d22c328b0b67411 100644 (file)
@@ -12,6 +12,7 @@
 #include <TNamed.h> 
 #include <TMath.h> 
 class TFile ; 
+class TH1 ; 
 
 #include "AliLog.h"
 #include "AliRecoParam.h"
@@ -47,6 +48,7 @@ public:
   Bool_t                 CheckFatal() const ;
   static void            Close() ; 
   static const char *    GetAliTaskName(ALITASK_t tsk) ;
+  static  TH1 *          GetData(TObjArray** list, Int_t index, AliRecoParam::EventSpecie_t) ; 
   Bool_t *               GetEventSpecies() { return fEventSpecies ; }
   static const TString   GetExpert() { return fgkExpert ; }
   static       UInt_t    GetExpertBit() { return fgkExpertBit ; }