]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliQAChecker.cxx
Fixes for bug #49914: Compilation breaks in trunk, and bug #48629: Trunk cannot read...
[u/mrichter/AliRoot.git] / STEER / AliQAChecker.cxx
index 33b8e338bb05a6c83d55497f30945fb6cc71281f..d53c8c5991dc47a891db45bbd5ec0da068e086fe 100644 (file)
 ///////////////////////////////////////////////////////////////////////////////
 
 #include "AliCDBEntry.h"
-#include "AliCDBManager.h"
+#include "AliQAManager.h"
 #include "AliCDBStorage.h"
-#include "AliRunInfo.h"
+#include "AliRunInfo.h" 
 #include "AliLog.h"
 #include "AliModule.h" 
-#include "AliQA.h"
+#include "AliQAv1.h"
 #include "AliQAChecker.h"
 #include "AliQACheckerBase.h"
 #include "AliCorrQAChecker.h"
 #include "AliGlobalQAChecker.h"
+#include "AliGRPObject.h"
 
 #include <TKey.h>
 #include <TObjArray.h>
@@ -54,10 +55,11 @@ AliQAChecker::AliQAChecker(const char* name, const char* title) :
   fRunInfo(0x0), 
   fRunInfoOwner(kFALSE), 
   fRefFile(0x0), 
-  fFoundDetectors(".")
+  fFoundDetectors("."), 
+  fEventSpecie(AliRecoParam::kDefault) 
 {
   // ctor: initialise checkers and open the data file   
-  for (Int_t det = 0 ; det < AliQA::kNDET ; det++) 
+  for (Int_t det = 0 ; det < AliQAv1::kNDET ; det++) 
     fCheckers[det] = NULL ; 
 }
 
@@ -68,11 +70,12 @@ AliQAChecker::AliQAChecker(const AliQAChecker& qac) :
   fRunInfo(qac.fRunInfo), 
   fRunInfoOwner(kFALSE),   
   fRefFile(qac.fRefFile), 
-  fFoundDetectors(qac.fFoundDetectors)
+  fFoundDetectors(qac.fFoundDetectors),
+  fEventSpecie(qac.fEventSpecie)
 {
   // copy constructor
   
-  for (Int_t det = 0 ; det < AliQA::kNDET ; det++) 
+  for (Int_t det = 0 ; det < AliQAv1::kNDET ; det++) 
     fCheckers[det] = NULL ; 
 }
 
@@ -93,7 +96,7 @@ AliQAChecker::~AliQAChecker()
   if (fRunInfo)
     delete fRunInfo ; 
   delete [] fCheckers ; 
-  AliQA::Close() ; 
+  AliQAv1::Close() ; 
 }
 
 //_____________________________________________________________________________
@@ -106,11 +109,11 @@ AliQAChecker::~AliQAChecker()
 
        AliQACheckerBase * qac = NULL ;
 
-       TString detName(AliQA::GetDetName(det)) ; 
+       TString detName(AliQAv1::GetDetName(det)) ; 
        
-       if (det == AliQA::kGLOBAL) {
+       if (det == AliQAv1::kGLOBAL) {
                qac = new AliGlobalQAChecker() ; 
-       } else if (det == AliQA::kCORR) {
+       } else if (det == AliQAv1::kCORR) {
                qac = new AliCorrQAChecker() ; 
        } else {
                AliDebug(1, Form("Retrieving QA checker for %s", detName.Data())) ; 
@@ -143,51 +146,62 @@ AliQAChecker::~AliQAChecker()
 }
  
 //_____________________________________________________________________________
-void AliQAChecker::GetRefSubDir(const char * det, const char * task, TDirectory *& dirFile, TObjArray *& dirOCDB)     
+void AliQAChecker::GetRefSubDir(const char * det, const char * task, TDirectory *& dirFile, TObjArray **& dirOCDB)     
 { 
   // Opens and returns the file with the reference data 
-       
   dirFile = NULL ; 
-  dirOCDB = NULL ; 
-  TString refStorage(AliQA::GetQARefStorage()) ; 
-  //refStorage += AliQA::GetQARefFileName() ;
-  if (refStorage.Contains(AliQA::GetLabLocalFile())) { 
-    refStorage.ReplaceAll(AliQA::GetLabLocalFile(), "") ; 
-    if ( fRefFile ) 
-      if ( fRefFile->IsOpen() ) 
-                                       fRefFile->Close() ; 
-    fRefFile = TFile::Open(refStorage.Data()) ; 
-    if (!fRefFile) { 
-      AliError(Form("Cannot find reference file %s", refStorage.Data())) ; 
-      dirFile = NULL ; 
-    }
-    dirFile = fRefFile->GetDirectory(det) ; 
-    if (!dirFile) {
-      AliWarning(Form("Directory %s not found in %d", det, refStorage.Data())) ; 
-    } else {
-                       dirFile = dirFile->GetDirectory(task) ; 
-      if (!dirFile) 
-                               AliWarning(Form("Directory %s/%s not found in %s", det, task, refStorage.Data())) ; 
-    }  
-  } else if (refStorage.Contains(AliQA::GetLabLocalOCDB()) || refStorage.Contains(AliQA::GetLabAliEnOCDB())) { 
-    AliCDBManager* man = AliCDBManager::Instance() ;
-    if ( strcmp(AliQA::GetRefDataDirName(), "") == 0 ) { // the name of the last level of the directory is not set (RUNTYPE)
-      // Get it from RunInfo
-      if (!fRunInfo)  // not yet set, get the info from GRP
-                               LoadRunInfoFromGRP() ; 
-      AliQA::SetQARefDataDirName(fRunInfo->GetRunType()) ;
-    }
-    if ( ! man->GetLock() ) { 
-      man->SetDefaultStorage(AliQA::GetQARefStorage()) ; 
-      man->SetSpecificStorage("*", AliQA::GetQARefStorage()) ;
-    }
-    char * detOCDBDir = Form("%s/%s/%s", det, AliQA::GetRefOCDBDirName(), AliQA::GetRefDataDirName()) ; 
-    AliInfo(Form("Reference QA data are taken from %s", detOCDBDir)) ;
-    AliCDBEntry * entry = man->Get(detOCDBDir, man->GetRun()) ;
-    if (entry) {
-      TList * listDetQAD = dynamic_cast<TList *>(entry->GetObject()) ;
-      if ( listDetQAD ) 
-                               dirOCDB = dynamic_cast<TObjArray *>(listDetQAD->FindObject(task)) ; 
+  TString refStorage(AliQAv1::GetQARefStorage()) ;
+//  if (refStorage.Contains(AliQAv1::GetLabLocalFile())) {     
+//    refStorage.ReplaceAll(AliQAv1::GetLabLocalFile(), "") ; 
+//    refStorage += AliQAv1::GetQARefFileName() ;
+//    if ( fRefFile ) 
+//      if ( fRefFile->IsOpen() ) 
+//                                     fRefFile->Close() ; 
+//    fRefFile = TFile::Open(refStorage.Data()) ; 
+//    if (!fRefFile) { 
+//      AliError(Form("Cannot find reference file %s", refStorage.Data())) ; 
+//      dirFile = NULL ; 
+//    }
+//    dirFile = fRefFile->GetDirectory(det) ; 
+//    if (!dirFile) {
+//      AliWarning(Form("Directory %s not found in %d", det, refStorage.Data())) ; 
+//    } else {
+//                     dirFile = dirFile->GetDirectory(task) ; 
+//      if (!dirFile) 
+//                             AliWarning(Form("Directory %s/%s not found in %s", det, task, refStorage.Data())) ; 
+//    }  
+//  } else 
+  if (!refStorage.Contains(AliQAv1::GetLabLocalOCDB()) && !refStorage.Contains(AliQAv1::GetLabAliEnOCDB())) {
+    AliError(Form("%s is not a valid location for reference data", refStorage.Data())) ; 
+    return ; 
+  } else {
+    AliQAManager* manQA = AliQAManager::QAManager() ;
+    for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
+      if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) ) 
+        continue ; 
+      //if ( strcmp(AliQAv1::GetRefDataDirName(), "") == 0 ) { // the name of the last level of the directory is not set (EventSpecie)
+        // Get it from RunInfo
+        //if (!fRunInfo)  // not yet set, get the info from GRP
+        //  LoadRunInfoFromGRP() ; 
+      AliQAv1::SetQARefDataDirName(specie) ;
+      //}
+      if ( ! manQA->GetLock() ) { 
+        manQA->SetDefaultStorage(AliQAv1::GetQARefStorage()) ; 
+        manQA->SetSpecificStorage("*", AliQAv1::GetQARefStorage()) ;
+        manQA->SetRun(AliCDBManager::Instance()->GetRun()) ; 
+        manQA->SetLock() ; 
+      }
+      char * detOCDBDir = Form("%s/%s/%s", det, AliQAv1::GetRefOCDBDirName(), AliQAv1::GetRefDataDirName()) ; 
+      AliCDBEntry * entry = manQA->Get(detOCDBDir, manQA->GetRun()) ;
+      if (entry) {
+        dirOCDB = new TObjArray*[AliRecoParam::kNSpecies] ;    
+        TList * listDetQAD = dynamic_cast<TList *>(entry->GetObject()) ;
+        TIter next(listDetQAD) ;
+        TObjArray * ar ; 
+        while ( (ar = (TObjArray*)next()) )
+          if ( listDetQAD ) 
+          dirOCDB[specie] = dynamic_cast<TObjArray *>(listDetQAD->FindObject(Form("%s/%s", task, AliRecoParam::GetEventSpecieName(specie)))) ; 
+      }
     }
   }
 }
@@ -205,58 +219,106 @@ AliQAChecker * AliQAChecker::Instance()
 void AliQAChecker::LoadRunInfoFromGRP() 
 {
   AliCDBManager* man = AliCDBManager::Instance() ;
-  AliCDBEntry* entry = man->Get(AliQA::GetGRPPath().Data());
-  TMap * data = 0x0 ; 
-  if (entry) 
-    data = dynamic_cast<TMap*>(entry->GetObject());  
-  if (!data) {
-    AliFatal("No GRP entry found in OCDB!");      
+  AliCDBEntry* entry = man->Get(AliQAv1::GetGRPPath().Data());
+  AliGRPObject* grpObject = 0x0;
+  if (entry) {
+
+         TMap* m = dynamic_cast<TMap*>(entry->GetObject());  // old GRP entry
+
+         if (m) {
+           AliInfo("It is a map");
+           //m->Print();
+           grpObject = new AliGRPObject();
+                grpObject->ReadValuesFromMap(m);
+    }
+
+    else {
+           AliInfo("It is a new GRP object");
+        grpObject = dynamic_cast<AliGRPObject*>(entry->GetObject());  // new GRP entry
+    }
+
+    entry->SetOwner(0);
+    AliCDBManager::Instance()->UnloadFromCache("GRP/GRP/Data");
   }
-  TObjString *lhcState=  
-    dynamic_cast<TObjString*>(data->GetValue("fLHCState"));
-  if (!lhcState) {
-    AliWarning(Form("%s entry:  missing value for the LHC state ! Using UNKNOWN", AliQA::GetGRPPath().Data()));
+
+  if (!grpObject) {
+     AliFatal("No GRP entry found in OCDB!");
+  }
+
+  TString lhcState = grpObject->GetLHCState();
+  if (lhcState==AliGRPObject::GetInvalidString()) {
+    AliError("GRP/GRP/Data entry:  missing value for the LHC state ! Using UNKNOWN");
+    lhcState = "UNKNOWN";
   }
-  TObjString *beamType=
-    dynamic_cast<TObjString*>(data->GetValue("fAliceBeamType"));
-  if (!beamType) {
-    AliWarning(Form("%s entry:  missing value for the LHC state ! Using UNKNOWN", AliQA::GetGRPPath().Data()));
+
+  TString beamType = grpObject->GetBeamType();
+  if (beamType==AliGRPObject::GetInvalidString()) {
+    AliError("GRP/GRP/Data entry:  missing value for the beam type ! Using UNKNOWN");
+    beamType = "UNKNOWN";
+  }
+
+  Float_t beamEnergy = grpObject->GetBeamEnergy();
+  if (beamEnergy==AliGRPObject::GetInvalidFloat()) {
+    AliError("GRP/GRP/Data entry:  missing value for the beam energy ! Using 0");
+    beamEnergy = 0;
   }
-  TObjString *beamEnergyStr=
-    dynamic_cast<TObjString*>(data->GetValue("fAliceBeamEnergy"));
-  if (!beamEnergyStr) {
-    AliWarning(Form("%s entry:  missing value for the beam energy ! Using 0", AliQA::GetGRPPath().Data()));
+
+  TString runType = grpObject->GetRunType();
+  if (runType==AliGRPObject::GetInvalidString()) {
+    AliError("GRP/GRP/Data entry:  missing value for the run type ! Using UNKNOWN");
+    runType = "UNKNOWN";
   }
-  TObjString *runType=
-    dynamic_cast<TObjString*>(data->GetValue("fRunType"));
-  if (!runType) {
-    AliWarning(Form("%s entry:  missing value for the run type ! Using UNKNOWN", AliQA::GetGRPPath().Data()));  }
-  TObjString *activeDetectors=
-    dynamic_cast<TObjString*>(data->GetValue("fDetectorMask"));
-  if (!activeDetectors) {
-    AliWarning(Form("%s entry:  missing value for the detector mask ! Using 1074790399", AliQA::GetGRPPath().Data()));  
+
+  Int_t activeDetectors = grpObject->GetDetectorMask();
+  if (activeDetectors==AliGRPObject::GetInvalidInt()) {
+    AliError("GRP/GRP/Data entry:  missing value for the detector mask ! Using 1074790399");
+    activeDetectors = 1074790399;
   }
-  fRunInfo = new AliRunInfo(lhcState ? lhcState->GetString().Data() : "UNKNOWN",
-                           beamType ? beamType->GetString().Data() : "UNKNOWN",
-                           beamEnergyStr ? beamEnergyStr->GetString().Atof() : 0,
-                           runType  ? runType->GetString().Data()  : "UNKNOWN",
-                           activeDetectors ? activeDetectors->GetString().Atoi() : 1074790399);
+
+  fRunInfo = new AliRunInfo(lhcState, beamType, beamEnergy, runType, activeDetectors);
+
   fRunInfoOwner = kTRUE ; 
+
+  // set the event specie
+  fEventSpecie = AliRecoParam::kDefault ;
+  if (strcmp(runType,"PHYSICS")) {
+    // Not a physics run, the event specie is set to kCalib
+    fEventSpecie = AliRecoParam::kCalib ;
+    return;
+  }
+  if (strcmp(lhcState,"STABLE_BEAMS") == 0) {
+    // Heavy ion run (any beam tha is not pp, the event specie is set to kHighMult
+    fEventSpecie = AliRecoParam::kHighMult ;
+    if ((strcmp(beamType,"p-p") == 0) ||
+        (strcmp(beamType,"p-")  == 0) ||
+        (strcmp(beamType,"-p")  == 0) ||
+        (strcmp(beamType,"P-P") == 0) ||
+        (strcmp(beamType,"P-")  == 0) ||
+        (strcmp(beamType,"-P")  == 0)) {
+      // Proton run, the event specie is set to kLowMult
+      fEventSpecie = AliRecoParam::kLowMult ;
+    }
+    else if (strcmp(beamType,"-") == 0) {
+      // No beams, we assume cosmic data
+      fEventSpecie = AliRecoParam::kCosmic ;
+    }
+    else if (strcmp(beamType,"UNKNOWN") == 0) {
+      // No LHC beam information is available, we use the default event specie
+      fEventSpecie = AliRecoParam::kDefault ;
+    }
+  }
 }
 
 //_____________________________________________________________________________
 Bool_t AliQAChecker::Run(const char * fileName)
 {
   // run the Quality Assurance Checker for all tasks Hits, SDigits, Digits, recpoints, tracksegments, recparticles and ESDs
-  // starting from data in file
-
-  Bool_t rv = kFALSE ; 
-  
+  // starting from data in file  
   TStopwatch stopwatch;
   stopwatch.Start();
 
   //search for all detectors QA directories
-  TList * detKeyList = AliQA::GetQADataFile(fileName)->GetListOfKeys() ; 
+  TList * detKeyList = AliQAv1::GetQADataFile(fileName)->GetListOfKeys() ; 
   TIter nextd(detKeyList) ; 
   TKey * detKey ; 
   while ( (detKey = dynamic_cast<TKey *>(nextd()) ) ) {
@@ -265,15 +327,15 @@ Bool_t AliQAChecker::Run(const char * fileName)
     TString detName ; 
     TString detNameQA(detKey->GetName()) ; 
     Int_t det ; 
-    for ( det = 0; det < AliQA::kNDET ; det++) {
-      detName = AliQA::GetDetName(det) ; 
+    for ( det = 0; det < AliQAv1::kNDET ; det++) {
+      detName = AliQAv1::GetDetName(det) ; 
       if (detNameQA.Contains(detName)) {
-       fFoundDetectors+=detName ; 
-       fFoundDetectors+="." ;          
-       break ; 
+        fFoundDetectors+=detName ; 
+        fFoundDetectors+="." ;         
+        break ; 
       }
     } 
-    TDirectory * detDir = AliQA::GetQADataFile(fileName)->GetDirectory(detKey->GetName()) ; 
+    TDirectory * detDir = AliQAv1::GetQADataFile(fileName)->GetDirectory(detKey->GetName()) ; 
     TList * taskKeyList = detDir->GetListOfKeys() ;
     TIter nextt(taskKeyList) ; 
     TKey * taskKey ; 
@@ -285,93 +347,116 @@ Bool_t AliQAChecker::Run(const char * fileName)
       taskDir->cd() ; 
       AliQACheckerBase * qac = GetDetQAChecker(det) ; 
       if (qac)
-               AliInfo(Form("QA checker found for %s", detName.Data())) ; 
+        AliInfo(Form("QA checker found for %s", detName.Data())) ; 
       if (!qac)
-               AliFatal(Form("QA checker not found for %s", detName.Data())) ; 
-      AliQA::ALITASK_t index = AliQA::kNULLTASK ; 
-      if ( taskName == AliQA::GetTaskName(AliQA::kHITS) ) 
-               index = AliQA::kSIM ; 
-      if ( taskName == AliQA::GetTaskName(AliQA::kSDIGITS) ) 
-               index = AliQA::kSIM ; 
-      if ( taskName == AliQA::GetTaskName(AliQA::kDIGITS) ) 
-               index = AliQA::kSIM ; 
-      if ( taskName == AliQA::GetTaskName(AliQA::kRECPOINTS) ) 
-               index = AliQA::kREC ; 
-      if ( taskName == AliQA::GetTaskName(AliQA::kTRACKSEGMENTS) ) 
-               index = AliQA::kREC ; 
-      if ( taskName == AliQA::GetTaskName(AliQA::kRECPARTICLES) ) 
-               index = AliQA::kREC ; 
-      if ( taskName == AliQA::GetTaskName(AliQA::kESDS) ) 
-               index = AliQA::kESD ; 
-      qac->Init(AliQA::DETECTORINDEX_t(det)) ; 
-
-         TDirectory * refDir    = NULL ; 
-         TObjArray * refOCDBDir = NULL ;       
-         GetRefSubDir(detNameQA.Data(), taskName.Data(), refDir, refOCDBDir) ;
-         if ( refDir || refOCDBDir) {
+        AliFatal(Form("QA checker not found for %s", detName.Data())) ; 
+      AliQAv1::ALITASK_t index = AliQAv1::kNULLTASK ; 
+      if ( taskName == AliQAv1::GetTaskName(AliQAv1::kHITS) ) 
+        index = AliQAv1::kSIM ; 
+      if ( taskName == AliQAv1::GetTaskName(AliQAv1::kSDIGITS) ) 
+        index = AliQAv1::kSIM ; 
+      if ( taskName == AliQAv1::GetTaskName(AliQAv1::kDIGITS) ) 
+        index = AliQAv1::kSIM ; 
+      if ( taskName == AliQAv1::GetTaskName(AliQAv1::kRECPOINTS) ) 
+        index = AliQAv1::kREC ; 
+      if ( taskName == AliQAv1::GetTaskName(AliQAv1::kTRACKSEGMENTS) ) 
+        index = AliQAv1::kREC ; 
+      if ( taskName == AliQAv1::GetTaskName(AliQAv1::kRECPARTICLES) ) 
+        index = AliQAv1::kREC ; 
+      if ( taskName == AliQAv1::GetTaskName(AliQAv1::kESDS) ) 
+        index = AliQAv1::kESD ; 
+      qac->Init(AliQAv1::DETECTORINDEX_t(det)) ; 
+      
+      TDirectory * refDir     = NULL ; 
+      TObjArray ** refOCDBDir = NULL ; 
+      GetRefSubDir(detNameQA.Data(), taskName.Data(), refDir, refOCDBDir) ;
                  qac->SetRefandData(refDir, refOCDBDir, taskDir) ;
                  qac->Run(index) ; 
-         }
-       }
+    }
   }
   AliInfo("QA performed for following detectors:") ; 
-  for ( Int_t det = 0; det < AliQA::kNDET; det++) {
-    if (fFoundDetectors.Contains(AliQA::GetDetName(det))) {
-      printf("%s, ",AliQA::GetDetName(det)) ; 
-      fFoundDetectors.ReplaceAll(AliQA::GetDetName(det), "") ; 
+  for ( Int_t det = 0; det < AliQAv1::kNDET; det++) {
+    if (fFoundDetectors.Contains(AliQAv1::GetDetName(det))) {
+      printf("%s, ",AliQAv1::GetDetName(det)) ; 
+      fFoundDetectors.ReplaceAll(AliQAv1::GetDetName(det), "") ; 
     }  
   }
   printf("\n") ; 
-  rv = kTRUE ; 
-
-  return rv ; 
-  
+  return kTRUE ; 
 }
 
 //_____________________________________________________________________________
-Bool_t AliQAChecker::Run(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, TObject * obj)
+Bool_t AliQAChecker::Run(AliQAv1::DETECTORINDEX_t det, AliQAv1::TASKINDEX_t task, TObjArray ** list)
 {
        // run the Quality Assurance Checker for detector det, for task task starting from data in list
 
        AliQACheckerBase * qac = GetDetQAChecker(det) ; 
        if (qac)
-               AliDebug(1, Form("QA checker found for %s", AliQA::GetDetName(det).Data())) ;
+               AliDebug(1, Form("QA checker found for %s", AliQAv1::GetDetName(det).Data())) ;
        if (!qac)
-               AliError(Form("QA checker not found for %s", AliQA::GetDetName(det).Data())) ; 
+               AliError(Form("QA checker not found for %s", AliQAv1::GetDetName(det).Data())) ; 
   
-       AliQA::ALITASK_t index = AliQA::kNULLTASK ; 
-       if ( task == AliQA::kRAWS ) 
-               index = AliQA::kRAW ; 
-       else if ( task == AliQA::kHITS ) 
-               index = AliQA::kSIM ; 
-       else if ( task == AliQA::kSDIGITS ) 
-               index = AliQA::kSIM ; 
-       else if ( task == AliQA::kDIGITS ) 
-               index = AliQA::kSIM ; 
-       else if ( task == AliQA::kRECPOINTS ) 
-               index = AliQA::kREC ; 
-       else if ( task == AliQA::kTRACKSEGMENTS ) 
-               index = AliQA::kREC ; 
-       else if ( task == AliQA::kRECPARTICLES ) 
-               index = AliQA::kREC ; 
-       else if ( task == AliQA::kESDS ) 
-               index = AliQA::kESD ; 
-
-       TDirectory * refDir    = NULL ; 
-       TObjArray * refOCDBDir = NULL ; 
-       qac->Init(det) ; 
-       GetRefSubDir(AliQA::GetDetName(det), AliQA::GetTaskName(task), refDir, refOCDBDir) ;
-       if ( refDir || refOCDBDir)  // references found
-         qac->SetRefandData(refDir, refOCDBDir) ; 
-       
-  TString className(obj->ClassName()) ; 
-  if (className.Contains(TObjArray::Class()->GetName())) {
-    qac->Run(index, static_cast<TObjArray *>(obj)) ; 
-  } else if (className.Contains(TNtupleD::Class()->GetName())) {
-    qac->Run(index, static_cast<TNtupleD *>(obj)) ; 
-  } else {
-    AliError(Form("%s class not implemented", className.Data())) ; 
-    return kFALSE ; 
-  }
+       AliQAv1::ALITASK_t index = AliQAv1::kNULLTASK ; 
+       if ( task == AliQAv1::kRAWS ) 
+               index = AliQAv1::kRAW ; 
+       else if ( task == AliQAv1::kHITS ) 
+               index = AliQAv1::kSIM ; 
+       else if ( task == AliQAv1::kSDIGITS ) 
+               index = AliQAv1::kSIM ; 
+       else if ( task == AliQAv1::kDIGITS ) 
+               index = AliQAv1::kSIM ; 
+       else if ( task == AliQAv1::kRECPOINTS ) 
+               index = AliQAv1::kREC ; 
+       else if ( task == AliQAv1::kTRACKSEGMENTS ) 
+               index = AliQAv1::kREC ; 
+       else if ( task == AliQAv1::kRECPARTICLES ) 
+               index = AliQAv1::kREC ; 
+       else if ( task == AliQAv1::kESDS ) 
+               index = AliQAv1::kESD ; 
+
+       TDirectory * refDir     = NULL ; 
+       TObjArray ** refOCDBDir = NULL  ;       
+  qac->Init(det) ; 
+  GetRefSubDir(AliQAv1::GetDetName(det), AliQAv1::GetTaskName(task), refDir, refOCDBDir) ;
+  qac->SetRefandData(refDir, refOCDBDir) ; 
+  qac->Run(index, list) ; 
        return kTRUE ; 
 }
+
+//_____________________________________________________________________________
+Bool_t AliQAChecker::Run(AliQAv1::DETECTORINDEX_t det, AliQAv1::TASKINDEX_t task, TNtupleD ** list)
+{
+       // run the Quality Assurance Checker for detector det, for task task starting from data in list
+  
+       AliQACheckerBase * qac = GetDetQAChecker(det) ; 
+       if (qac)
+               AliDebug(1, Form("QA checker found for %s", AliQAv1::GetDetName(det).Data())) ;
+       if (!qac)
+               AliError(Form("QA checker not found for %s", AliQAv1::GetDetName(det).Data())) ; 
+  
+       AliQAv1::ALITASK_t index = AliQAv1::kNULLTASK ; 
+       if ( task == AliQAv1::kRAWS ) 
+               index = AliQAv1::kRAW ; 
+       else if ( task == AliQAv1::kHITS ) 
+               index = AliQAv1::kSIM ; 
+       else if ( task == AliQAv1::kSDIGITS ) 
+               index = AliQAv1::kSIM ; 
+       else if ( task == AliQAv1::kDIGITS ) 
+               index = AliQAv1::kSIM ; 
+       else if ( task == AliQAv1::kRECPOINTS ) 
+               index = AliQAv1::kREC ; 
+       else if ( task == AliQAv1::kTRACKSEGMENTS ) 
+               index = AliQAv1::kREC ; 
+       else if ( task == AliQAv1::kRECPARTICLES ) 
+               index = AliQAv1::kREC ; 
+       else if ( task == AliQAv1::kESDS ) 
+               index = AliQAv1::kESD ; 
+  
+       TDirectory * refDir     = NULL ; 
+       TObjArray ** refOCDBDir = NULL ;        
+  qac->Init(det) ; 
+  GetRefSubDir(AliQAv1::GetDetName(det), AliQAv1::GetTaskName(task), refDir, refOCDBDir) ;
+  qac->SetRefandData(refDir, refOCDBDir) ; 
+  qac->Run(index, list) ; 
+  return kTRUE ; 
+}