+//_____________________________________________________________________________
+//AliQADataMaker * AliReconstruction::GetQADataMaker(Int_t iDet)
+//{
+// get the quality assurance data maker object and the loader for a detector
+//
+// if (fQADataMaker[iDet])
+// return fQADataMaker[iDet];
+//
+// // load the QA data maker object
+// TPluginManager* pluginManager = gROOT->GetPluginManager();
+// TString detName = fgkDetectorName[iDet];
+// TString qadmName = "Ali" + detName + "QADataMaker";
+// if (gAlice && !gAlice->GetDetector(detName) && (detName != "HLT"))
+// return NULL;
+//
+// AliQADataMaker * qadm = NULL;
+// // first check if a plugin is defined for the quality assurance data maker
+// TPluginHandler* pluginHandler = pluginManager->FindHandler("AliQADataMaker", detName);
+// // if not, add a plugin for it
+// if (!pluginHandler) {
+// AliDebug(1, Form("defining plugin for %s", qadmName.Data()));
+// TString libs = gSystem->GetLibraries();
+// if (libs.Contains("lib" + detName + "base.so") ||
+// (gSystem->Load("lib" + detName + "base.so") >= 0)) {
+// pluginManager->AddHandler("AliQADataMaker", detName,
+// qadmName, detName + "qadm", qadmName + "()");
+// } else {
+// pluginManager->AddHandler("AliQADataMaker", detName,
+// qadmName, detName, qadmName + "()");
+// }
+// pluginHandler = pluginManager->FindHandler("AliQADataMaker", detName);
+// }
+// if (pluginHandler && (pluginHandler->LoadPlugin() == 0)) {
+// qadm = (AliQADataMaker *) pluginHandler->ExecPlugin(0);
+// }
+// if (qadm) {
+// AliInfo(Form("Initializing quality assurance data maker for %s", fgkDetectorName[iDet]));
+// qadm->Init(AliQA::kRECPOINTS, AliCDBManager::Instance()->GetRun(), GetQACycles(fgkDetectorName[iDet]));
+// qadm->StartOfCycle(AliQA::kRECPOINTS);
+// qadm->Init(AliQA::kESDS, AliCDBManager::Instance()->GetRun());
+// qadm->StartOfCycle(AliQA::kESDS, "same") ;
+// fQADataMaker[iDet] = qadm;
+// }
+//
+// return qadm;
+//}
+//
+//_____________________________________________________________________________
+//Bool_t AliReconstruction::RunQA(const char* detectors, AliESDEvent *& esd)
+//{
+// // run the Quality Assurance data producer
+//
+// AliCodeTimerAuto("")
+// TString detStr = detectors;
+// for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+// if (!IsSelected(fgkDetectorName[iDet], detStr))
+// continue;
+// AliQADataMaker * qadm = GetQADataMaker(iDet);
+// if (!qadm)
+// continue;
+// AliCodeTimerStart(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
+// AliInfo(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
+//
+// qadm->Exec(AliQA::kESDS, esd) ;
+// qadm->Increment() ;
+//
+// AliCodeTimerStop(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
+// }
+// if ((detStr.CompareTo("ALL") != 0) && !detStr.IsNull()) {
+// AliError(Form("the following detectors were not found: %s",
+// detStr.Data()));
+// if (fStopOnError)
+// return kFALSE;
+// }
+//
+// return kTRUE;
+//
+//}
+//
+
+//_____________________________________________________________________________
+void AliReconstruction::CheckQA()
+{
+// check the QA of SIM for this run and remove the detectors
+// with status Fatal
+
+ TString newDetList ;
+ for (Int_t iDet = 0; iDet < AliQA::kNDET; iDet++) {
+ TString detName(AliQA::GetDetName(iDet)) ;
+ if ( fRunLocalReconstruction.Contains(AliQA::GetDetName(iDet)) ||
+ fRunLocalReconstruction.Contains("ALL") ) {
+ AliQA * qa = AliQA::Instance(AliQA::DETECTORINDEX(iDet)) ;
+ if ( qa->IsSet(AliQA::DETECTORINDEX(iDet), AliQA::kSIM, AliQA::kFATAL)) {
+ AliInfo(Form("QA status for %s in Hits and/or SDIGITS and/or Digits was Fatal; No reconstruction performed", detName.Data())) ;
+ } else if ( qa->IsSet(AliQA::DETECTORINDEX(iDet), AliQA::kSIM, AliQA::kERROR)) {
+ AliError(Form("QA status for %s in Hits and/or SDIGITS and/or Digits was ERROR", detName.Data())) ;
+ newDetList += detName ;
+ newDetList += " " ;
+ } else if ( qa->IsSet(AliQA::DETECTORINDEX(iDet), AliQA::kSIM, AliQA::kWARNING) ) {
+ AliWarning(Form("QA status for %s in Hits and/or SDIGITS and/or Digits was WARNING", detName.Data())) ;
+ newDetList += detName ;
+ newDetList += " " ;
+ } else if ( qa->IsSet(AliQA::DETECTORINDEX(iDet), AliQA::kSIM, AliQA::kINFO) ) {
+ AliInfo(Form("QA status for %s in Hits and/or SDIGITS and/or Digits was INFO", detName.Data())) ;
+ newDetList += detName ;
+ newDetList += " " ;
+ } else {
+ newDetList += detName ;
+ newDetList += " " ;
+ }
+ }
+ }
+ fRunLocalReconstruction = newDetList ;
+}
+
+//_____________________________________________________________________________
+Int_t AliReconstruction::GetDetIndex(const char* detector)
+{
+ // return the detector index corresponding to detector
+ Int_t index = -1 ;
+ for (index = 0; index < fgkNDetectors ; index++) {
+ if ( strcmp(detector, fgkDetectorName[index]) == 0 )
+ break ;
+ }
+ return index ;
+}