]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliReconstruction.cxx
Second round of ESD clean-up at the physics level: possibility to reduce the number...
[u/mrichter/AliRoot.git] / STEER / AliReconstruction.cxx
index 33ade2a548118c2535ea119c95d47a3bdd1b174f..ae6226b81896d60b47122a1d76e42ba5c4b82dc5 100644 (file)
 
 #include <TArrayF.h>
 #include <TFile.h>
+#include <TList.h>
 #include <TSystem.h>
 #include <TROOT.h>
 #include <TPluginManager.h>
 #include "AliAODFmdCluster.h"
 #include "AliAODTracklets.h"
 
-#include "AliQADataMaker.h" 
+//#include "AliQADataMaker.h" 
+#include "AliQA.h"
+#include "AliQADataMakerSteer.h"
 
 #include "AliSysInfo.h" // memory snapshots
 
@@ -208,6 +211,8 @@ AliReconstruction::AliReconstruction(const char* gAliceFilename, const char* cdb
   fFillTriggerESD(kTRUE),
 
   fCleanESD(kTRUE),
+  fV0DCAmax(3.),
+  fV0CsPmin(0.),
   fDmax(50.),
   fZmax(50.),
 
@@ -233,10 +238,14 @@ AliReconstruction::AliReconstruction(const char* gAliceFilename, const char* cdb
   fVertexer(NULL),
   fDiamondProfile(NULL),
 
+  fGRPList(NULL),
+
   fAlignObjArray(NULL),
   fCDBUri(cdbUri),
   fRemoteCDBUri(""),
-  fSpecCDBUri()
+  fSpecCDBUri(), 
+  fRunQA(kTRUE) 
+
 {
 // create reconstruction object with default parameters
   
@@ -244,8 +253,8 @@ AliReconstruction::AliReconstruction(const char* gAliceFilename, const char* cdb
     fReconstructor[iDet] = NULL;
     fLoader[iDet] = NULL;
     fTracker[iDet] = NULL;
-    fQADataMaker[iDet] = NULL;
-       fQACycles[iDet] = 999999;       
+//    fQADataMaker[iDet] = NULL;
+//     fQACycles[iDet] = 999999;       
   }
   AliPID pid;
 }
@@ -267,6 +276,8 @@ AliReconstruction::AliReconstruction(const AliReconstruction& rec) :
   fFillTriggerESD(rec.fFillTriggerESD),
 
   fCleanESD(rec.fCleanESD),
+  fV0DCAmax(rec.fV0DCAmax),
+  fV0CsPmin(fV0CsPmin),
   fDmax(rec.fDmax),
   fZmax(rec.fZmax),
 
@@ -292,10 +303,13 @@ AliReconstruction::AliReconstruction(const AliReconstruction& rec) :
   fVertexer(NULL),
   fDiamondProfile(NULL),
 
+  fGRPList(NULL),
+
   fAlignObjArray(rec.fAlignObjArray),
   fCDBUri(rec.fCDBUri),
   fRemoteCDBUri(rec.fRemoteCDBUri),
-  fSpecCDBUri()
+  fSpecCDBUri(), 
+  fRunQA(kTRUE)
 {
 // copy constructor
 
@@ -306,8 +320,8 @@ AliReconstruction::AliReconstruction(const AliReconstruction& rec) :
     fReconstructor[iDet] = NULL;
     fLoader[iDet] = NULL;
     fTracker[iDet] = NULL;
-    fQADataMaker[iDet] = NULL;
-       fQACycles[iDet] = rec.fQACycles[iDet];  
+//    fQADataMaker[iDet] = NULL;
+//     fQACycles[iDet] = rec.fQACycles[iDet];  
   }
   for (Int_t i = 0; i < rec.fSpecCDBUri.GetEntriesFast(); i++) {
     if (rec.fSpecCDBUri[i]) fSpecCDBUri.Add(rec.fSpecCDBUri[i]->Clone());
@@ -567,6 +581,7 @@ Bool_t AliReconstruction::Run(const char* input)
   
   // set the input
   if (!input) input = fInput.Data();
+     
   TString fileName(input);
   if (fileName.EndsWith("/")) {
     fRawReader = new AliRawReaderFile(fileName);
@@ -602,6 +617,14 @@ Bool_t AliReconstruction::Run(const char* input)
   if (!MisalignGeometry(fLoadAlignData)) if (fStopOnError) return kFALSE;
    AliSysInfo::AddStamp("LoadGeom");
 
+  //QA 
+  AliQADataMakerSteer qas ; 
+  if ( fRunQA && fRawReader) 
+               qas.Run(fRawReader) ; 
+ // checking the QA of previous steps
+  CheckQA() ; 
   // local reconstruction
   if (!fRunLocalReconstruction.IsNull()) {
     if (!RunLocalReconstruction(fRunLocalReconstruction)) {
@@ -679,6 +702,15 @@ Bool_t AliReconstruction::Run(const char* input)
   }
 
   
+  // Get the GRP CDB entry
+  AliCDBEntry* entryGRP = AliCDBManager::Instance()->Get("GRP/GRP/Data");
+       
+  if(entryGRP) {
+       fGRPList = dynamic_cast<TList*> (entryGRP->GetObject());  
+  } else {
+       AliError("No GRP entry found in OCDB!");
+  }
+
   // Get the diamond profile from OCDB
   AliCDBEntry* entry = AliCDBManager::Instance()
        ->Get("GRP/Calib/MeanVertex");
@@ -701,9 +733,6 @@ Bool_t AliReconstruction::Run(const char* input)
   gSystem->GetProcInfo(&ProcInfo);
   AliInfo(Form("Current memory usage %d %d", ProcInfo.fMemResident, ProcInfo.fMemVirtual));
   
-  // checking the QA of previous steps
-  CheckQA() ; 
-  
   for (Int_t iEvent = 0; iEvent < fRunLoader->GetNumberOfEvents(); iEvent++) {
     if (fRawReader) fRawReader->NextEvent();
     if ((iEvent < fFirstEvent) || ((fLastEvent >= 0) && (iEvent > fLastEvent))) {
@@ -798,8 +827,8 @@ Bool_t AliReconstruction::Run(const char* input)
       }
     }
   
-    if (!fFillESD.IsNull()) 
-    RunQA(fFillESD.Data(), esd);
+//    if (!fFillESD.IsNull()) 
+//    RunQA(fFillESD.Data(), esd);
 
     // fill Event header information from the RawEventHeader
     if (fRawReader){FillRawEventHeaderESD(esd);}
@@ -885,21 +914,48 @@ Bool_t AliReconstruction::Run(const char* input)
   }
   
   detStr = fFillESD ; 
-  // write quality assurance ESDs data (one entry for all events)
-  for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
-       if (!IsSelected(fgkDetectorName[iDet], detStr)) 
-               continue;
-    AliQADataMaker * qadm = GetQADataMaker(iDet);
-    if (!qadm) continue;
-    qadm->EndOfCycle(AliQA::kRECPOINTS);
-    qadm->EndOfCycle(AliQA::kESDS);
-    qadm->Finish(AliQA::kRECPOINTS);
-    qadm->Finish(AliQA::kESDS) ; 
-  }
+//  // write quality assurance ESDs data (one entry for all events)
+//  for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+//     if (!IsSelected(fgkDetectorName[iDet], detStr)) 
+//             continue;
+//    AliQADataMaker * qadm = GetQADataMaker(iDet);
+//    if (!qadm) continue;
+//    qadm->EndOfCycle(AliQA::kRECPOINTS);
+//    qadm->EndOfCycle(AliQA::kESDS);
+//    qadm->Finish();
+//  }
 
   tree->GetUserInfo()->Add(esd);
   hlttree->GetUserInfo()->Add(hltesd);
-
+  
+  const TMap *cdbMap = AliCDBManager::Instance()->GetStorageMap();      
+  const TList *cdbList = AliCDBManager::Instance()->GetRetrievedIds();  
+                
+   TMap *cdbMapCopy = new TMap(cdbMap->GetEntries());   
+   cdbMapCopy->SetOwner(1);     
+   cdbMapCopy->SetName("cdbMap");       
+   TIter iter(cdbMap->GetTable());      
+        
+   TPair* pair = 0;     
+   while((pair = dynamic_cast<TPair*> (iter.Next()))){  
+         TObjString* keyStr = dynamic_cast<TObjString*> (pair->Key());  
+         TObjString* valStr = dynamic_cast<TObjString*> (pair->Value());        
+         cdbMapCopy->Add(new TObjString(keyStr->GetName()), new TObjString(valStr->GetName()));         
+   }    
+        
+   TList *cdbListCopy = new TList();    
+   cdbListCopy->SetOwner(1);    
+   cdbListCopy->SetName("cdbList");     
+        
+   TIter iter2(cdbList);        
+        
+   AliCDBId* id=0;      
+   while((id = dynamic_cast<AliCDBId*> (iter2.Next()))){        
+         cdbListCopy->Add(id->Clone());         
+   }    
+        
+   tree->GetUserInfo()->Add(cdbMapCopy);        
+   tree->GetUserInfo()->Add(cdbListCopy);
 
 
   if(fESDPar.Contains("ESD.par")){
@@ -928,12 +984,18 @@ Bool_t AliReconstruction::Run(const char* input)
   // Create tags for the events in the ESD tree (the ESD tree is always present)
   // In case of empty events the tags will contain dummy values
   AliESDTagCreator *esdtagCreator = new AliESDTagCreator();
-  esdtagCreator->CreateESDTags(fFirstEvent,fLastEvent);
+  esdtagCreator->CreateESDTags(fFirstEvent,fLastEvent,fGRPList);
   if (fWriteAOD) {
     AliAODTagCreator *aodtagCreator = new AliAODTagCreator();
-    aodtagCreator->CreateAODTags(fFirstEvent,fLastEvent);
+    aodtagCreator->CreateAODTags(fFirstEvent,fLastEvent,fGRPList);
   }
 
+  //QA 
+  if ( fRunQA ) {
+       qas.Run(AliQA::kRECPOINTS) ;
+       qas.Reset() ;
+       qas.Run(AliQA::kESDS) ;
+  }
   return kTRUE;
 }
 
@@ -1048,20 +1110,20 @@ Bool_t AliReconstruction::RunLocalEventReconstruction(const TString& detectors)
       loader->UnloadDigits();
     }
 
-    AliQADataMaker * qadm = GetQADataMaker(iDet);
-    if (qadm) {
-      AliCodeTimerStart(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
-      AliInfo(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
-         
-     if (qadm->IsCycleDone() ) {
-      qadm->EndOfCycle(AliQA::kRECPOINTS) ; 
-         qadm->EndOfCycle(AliQA::kESDS) ; 
-      qadm->StartOfCycle(AliQA::kRECPOINTS) ; 
-         qadm->StartOfCycle(AliQA::kESDS, "same") ; 
-     }
-      qadm->Exec(AliQA::kRECPOINTS, clustersTree) ; 
-      AliCodeTimerStop(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
-    }
+//    AliQADataMaker * qadm = GetQADataMaker(iDet);
+//    if (qadm) {
+//      AliCodeTimerStart(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
+//      AliInfo(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
+//       
+//     if (qadm->IsCycleDone() ) {
+//      qadm->EndOfCycle(AliQA::kRECPOINTS) ; 
+//       qadm->EndOfCycle(AliQA::kESDS) ; 
+//      qadm->StartOfCycle(AliQA::kRECPOINTS) ; 
+//       qadm->StartOfCycle(AliQA::kESDS, "same") ; 
+//     }
+//      qadm->Exec(AliQA::kRECPOINTS, clustersTree) ; 
+//      AliCodeTimerStop(Form("running quality assurance data maker for %s", fgkDetectorName[iDet]));
+//    }
 
     loader->WriteRecPoints("OVERWRITE");
     loader->UnloadRecPoints();
@@ -1408,11 +1470,11 @@ Bool_t AliReconstruction::FillESD(AliESDEvent*& esd, const TString& detectors)
   AliCodeTimerAuto("")
     static Int_t eventNr=0; 
   TString detStr = detectors;
+  
   for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
-    if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
+  if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
     AliReconstructor* reconstructor = GetReconstructor(iDet);
     if (!reconstructor) continue;
-
     if (!ReadESD(esd, fgkDetectorName[iDet])) {
       AliDebug(1, Form("filling ESD for %s", fgkDetectorName[iDet]));
       TTree* clustersTree = NULL;
@@ -1792,14 +1854,17 @@ void AliReconstruction::CleanUp(TFile* file, TFile* fileOld)
     fLoader[iDet] = NULL;
     delete fTracker[iDet];
     fTracker[iDet] = NULL;
-    delete fQADataMaker[iDet];
-    fQADataMaker[iDet] = NULL;
+//    delete fQADataMaker[iDet];
+//    fQADataMaker[iDet] = NULL;
   }
   delete fVertexer;
   fVertexer = NULL;
   delete fDiamondProfile;
   fDiamondProfile = NULL;
 
+  delete fGRPList;
+  fGRPList = NULL;
+
   delete fRunLoader;
   fRunLoader = NULL;
   delete fRawReader;
@@ -1944,8 +2009,8 @@ void AliReconstruction::ESDFile2AODFile(TFile* esdFile, TFile* aodFile)
     Int_t nV0s      = esd->GetNumberOfV0s();
     Int_t nCascades = esd->GetNumberOfCascades();
     Int_t nKinks    = esd->GetNumberOfKinks();
-    Int_t nVertices = nV0s + nCascades + nKinks + 1 /* = prim. vtx*/;
-    Int_t nJets     = 0;
+       Int_t nVertices = nV0s + 2*nCascades /*could lead to two vertices, one V0 and the Xi */+ nKinks + 1 /* = prim. vtx*/;    
+       Int_t nJets     = 0;
     Int_t nCaloClus = esd->GetNumberOfCaloClusters();
     Int_t nFmdClus  = 0;
     Int_t nPmdClus  = esd->GetNumberOfPmdTracks();
@@ -2287,7 +2352,9 @@ void AliReconstruction::ESDFile2AODFile(TFile* esdFile, TFile* aodFile)
       // add it to the V0 array as well
       Double_t d0[2] = { 999., 99.};
       new(V0s[jV0s++]) AliAODv0(vV0, 999., 99., p_pos, p_neg, d0); // to be refined
-    } // end of the loop on V0s
+    }
+       V0s.Expand(jV0s);        
+    // end of the loop on V0s
     
     // Kinks: it is a big mess the access to the information in the kinks
     // The loop is on the tracks in order to find the mother and daugther of each kink
@@ -2422,10 +2489,10 @@ void AliReconstruction::ESDFile2AODFile(TFile* esdFile, TFile* aodFile)
        }
       }
     }
+    vertices.Expand(jVertices);
 
     // Tracks (primary and orphan)
     for (Int_t nTrack = 0; nTrack < nTracks; ++nTrack) {
-       
 
       if (usedTrack[nTrack]) continue;
 
@@ -2507,7 +2574,8 @@ void AliReconstruction::ESDFile2AODFile(TFile* esdFile, TFile* aodFile)
       else 
        aodTrack->SetChi2MatchTrigger(0.);
     }
-   
+    tracks.Expand(jTracks); // remove 'empty slots' due to unwritten tracks
+       
     // Access to the AOD container of PMD clusters
     TClonesArray &pmdClusters = *(aod->GetPmdClusters());
     Int_t jPmdClusters=0;
@@ -2572,7 +2640,9 @@ void AliReconstruction::ESDFile2AODFile(TFile* esdFile, TFile* aodFile)
       
       caloCluster->SetCaloCluster(); // to be refined!
 
-    } // end of loop on calo clusters
+    } 
+       caloClusters.Expand(jClusters); // resize TObjArray to 'remove' slots for pseudo clusters        
+       // end of loop on calo clusters
 
     // fill EMC cell info
     AliAODCaloCells &EMCCells = *(aod->GetCaloCells());
@@ -2608,9 +2678,6 @@ void AliReconstruction::ESDFile2AODFile(TFile* esdFile, TFile* aodFile)
 
   aodTree->GetUserInfo()->Add(aod);
 
-  // close ESD file
-  esdFile->Close();
-
   // write the tree to the specified file
   aodFile = aodTree->GetCurrentFile();
   aodFile->cd();
@@ -2748,84 +2815,84 @@ void AliReconstruction::TNamedToFile(TTree* fTree, TString fName){
 
 
 //_____________________________________________________________________________
-AliQADataMaker * AliReconstruction::GetQADataMaker(Int_t iDet)
-{
+//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;
-}
-
+//
+//  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;
-  
-}
-
+//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()
@@ -2833,33 +2900,36 @@ void AliReconstruction::CheckQA()
 // check the QA of SIM for this run and remove the detectors 
 // with status Fatal
   
-       TString newDetList ; 
+       TString newRunLocalReconstruction ; 
+       TString newRunTracking ;
+       TString newFillESD ;
+        
        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)) {
+               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 += " " ;                     
+               } 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 = newDetList ; 
+       fRunLocalReconstruction = newRunLocalReconstruction ; 
+       fRunTracking            = newRunTracking ; 
+       fFillESD                = newFillESD ; 
 }
 
 //_____________________________________________________________________________