+ // load the QA data maker object
+ TPluginManager* pluginManager = gROOT->GetPluginManager();
+ TString detName = fgkDetectorName[iDet];
+ TString qadmName = "Ali" + detName + "QADataMakerRec";
+ if (gAlice && !gAlice->GetDetector(detName) && (detName != "HLT"))
+ return NULL;
+
+ // first check if a plugin is defined for the quality assurance data maker
+ TPluginHandler* pluginHandler = pluginManager->FindHandler("AliQADataMakerRec", 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("AliQADataMakerRec", detName,
+ qadmName, detName + "qadm", qadmName + "()");
+ } else {
+ pluginManager->AddHandler("AliQADataMakerRec", detName,
+ qadmName, detName, qadmName + "()");
+ }
+ pluginHandler = pluginManager->FindHandler("AliQADataMakerRec", detName);
+ }
+ if (pluginHandler && (pluginHandler->LoadPlugin() == 0)) {
+ qadm = (AliQADataMakerRec *) pluginHandler->ExecPlugin(0);
+ }
+
+ 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;
+ AliQADataMakerRec * 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 newRunLocalReconstruction ;
+ TString newRunTracking ;
+ TString newFillESD ;
+
+ for (Int_t iDet = 0; iDet < AliQA::kNDET; iDet++) {
+ TString detName(AliQA::GetDetName(iDet)) ;
+ AliQA * qa = AliQA::Instance(AliQA::DETECTORINDEX_t(iDet)) ;
+ if ( qa->IsSet(AliQA::DETECTORINDEX_t(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 ( fRunLocalReconstruction.Contains(AliQA::GetDetName(iDet)) ||
+ fRunLocalReconstruction.Contains("ALL") ) {
+ newRunLocalReconstruction += detName ;
+ newRunLocalReconstruction += " " ;
+ }
+ if ( fRunTracking.Contains(AliQA::GetDetName(iDet)) ||
+ fRunTracking.Contains("ALL") ) {
+ newRunTracking += detName ;
+ newRunTracking += " " ;
+ }
+ if ( fFillESD.Contains(AliQA::GetDetName(iDet)) ||
+ fFillESD.Contains("ALL") ) {
+ newFillESD += detName ;
+ newFillESD += " " ;
+ }
+ }
+ }
+ fRunLocalReconstruction = newRunLocalReconstruction ;
+ fRunTracking = newRunTracking ;
+ fFillESD = newFillESD ;
+}
+
+//_____________________________________________________________________________
+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 ;
+}
+//_____________________________________________________________________________
+Bool_t AliReconstruction::FinishPlaneEff() {
+ //
+ // Here execute all the necessary operationis, at the end of the tracking phase,
+ // in case that evaluation of PlaneEfficiencies was required for some detector.
+ // E.g., write into a DataBase file the PlaneEfficiency which have been evaluated.
+ //
+ // This Preliminary version works only FOR ITS !!!!!
+ // other detectors (TOF,TRD, etc. have to develop their specific codes)
+ //
+ // Input: none
+ // Return: kTRUE if all operations have been done properly, kFALSE otherwise
+ //
+ Bool_t ret=kFALSE;
+ //for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < 1; iDet++) { // for the time being only ITS
+ //if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
+ if(fTracker[iDet]) {
+ AliPlaneEff *planeeff=fTracker[iDet]->GetPlaneEff();
+ ret=planeeff->WriteIntoCDB();
+ if(planeeff->GetCreateHistos()) {
+ TString name="PlaneEffHisto";
+ name+=fgkDetectorName[iDet];
+ name+=".root";
+ ret*=planeeff->WriteHistosToFile(name,"RECREATE");
+ }
+ }
+ }
+ return ret;
+}
+//_____________________________________________________________________________
+Bool_t AliReconstruction::InitPlaneEff() {
+//
+ // Here execute all the necessary operations, before of the tracking phase,
+ // for the evaluation of PlaneEfficiencies, in case required for some detectors.
+ // E.g., read from a DataBase file a first evaluation of the PlaneEfficiency
+ // which should be updated/recalculated.
+ //
+ // This Preliminary version will work only FOR ITS !!!!!
+ // other detectors (TOF,TRD, etc. have to develop their specific codes)
+ //
+ // Input: none
+ // Return: kTRUE if all operations have been done properly, kFALSE otherwise
+ //
+ AliWarning(Form("Implementation of this method not yet done !! Method return kTRUE"));
+ return kTRUE;
+}