]> 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 eefda3d3202072ab5db82975ac14936360918961..ae6226b81896d60b47122a1d76e42ba5c4b82dc5 100644 (file)
@@ -211,6 +211,8 @@ AliReconstruction::AliReconstruction(const char* gAliceFilename, const char* cdb
   fFillTriggerESD(kTRUE),
 
   fCleanESD(kTRUE),
+  fV0DCAmax(3.),
+  fV0CsPmin(0.),
   fDmax(50.),
   fZmax(50.),
 
@@ -274,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),
 
@@ -577,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);
@@ -612,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)) {
@@ -720,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))) {
@@ -918,34 +928,35 @@ Bool_t AliReconstruction::Run(const char* input)
   tree->GetUserInfo()->Add(esd);
   hlttree->GetUserInfo()->Add(hltesd);
   
-  const TMap *cdbMap = AliCDBManager::Instance()->GetStorageMap();
-  const TList *cdbList = AliCDBManager::Instance()->GetRetrievedIds();
+  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);
 
-  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")){
     AliInfo("Attaching ESD.par to Tree");
@@ -981,9 +992,6 @@ Bool_t AliReconstruction::Run(const char* input)
 
   //QA 
   if ( fRunQA ) {
-       AliQADataMakerSteer qas ; 
-       if (fRawReader) 
-               qas.Run(AliQA::kRAWS, input) ; 
        qas.Run(AliQA::kRECPOINTS) ;
        qas.Reset() ;
        qas.Run(AliQA::kESDS) ;
@@ -1462,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;
@@ -2001,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 + 2*nCascades /*could lead to two vertices, one V0 and the Xi */+ 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();
@@ -2344,8 +2352,8 @@ 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
-    } 
-    V0s.Expand(jV0s);
+    }
+       V0s.Expand(jV0s);        
     // end of the loop on V0s
     
     // Kinks: it is a big mess the access to the information in the kinks
@@ -2567,7 +2575,7 @@ void AliReconstruction::ESDFile2AODFile(TFile* esdFile, TFile* aodFile)
        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;
@@ -2633,8 +2641,8 @@ void AliReconstruction::ESDFile2AODFile(TFile* esdFile, TFile* aodFile)
       caloCluster->SetCaloCluster(); // to be refined!
 
     } 
-    caloClusters.Expand(jClusters); // resize TObjArray to 'remove' slots for pseudo clusters
-    // 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());
@@ -2892,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 ; 
 }
 
 //_____________________________________________________________________________