]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliReconstruction.cxx
Removal of memory leaks (Laurent)
[u/mrichter/AliRoot.git] / STEER / AliReconstruction.cxx
index 3e240d45808c9d4d003741d90566c444336c98e7..277fffdf026a7916a99d598ef3555b1d1f5c4ec5 100644 (file)
@@ -1147,6 +1147,13 @@ Bool_t AliReconstruction::LoadCDB()
     if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
     AliCDBManager::Instance()->GetAll(Form("%s/Calib/*",fgkDetectorName[iDet]));
   }
+
+  // Temporary fix - one has to define the correct policy in order
+  // to load the trigger OCDB entries only for the detectors that
+  // in the trigger or that are needed in order to put correct
+  // information in ESD
+  AliCDBManager::Instance()->GetAll("TRIGGER/*/*");
+
   return kTRUE;
 }
 //_____________________________________________________________________________
@@ -1843,6 +1850,7 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
                  t->RelateToVertexBxByBz(pvtx, b, kVeryBig);
              } 
           }
+         delete pvtx; pvtx=NULL;
        }
 
        // TPC-only primary vertex
@@ -1869,6 +1877,7 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
                  t->RelateToVertexTPCBxByBz(pvtx, b, kVeryBig);
              } 
           }
+         delete pvtx; pvtx=NULL;
        }
 
     }
@@ -2079,6 +2088,7 @@ void AliReconstruction::Terminate()
   if (!fInput) {
     AliESDTagCreator *esdtagCreator = new AliESDTagCreator();
     esdtagCreator->CreateESDTags(fFirstEvent,fLastEvent,fGRPData, AliQAv1::Instance()->GetQA(), AliQAv1::Instance()->GetEventSpecies(), AliQAv1::kNDET, AliRecoParam::kNSpecies);
+    delete esdtagCreator;
   }
 
   // Cleanup of CDB manager: cache and active storages!
@@ -2371,18 +2381,18 @@ Bool_t AliReconstruction::RunMuonTracking(AliESDEvent*& esd)
   
   Int_t rv = tracker->Clusters2Tracks(esd);
   
-  if ( rv )
-  {
-    AliError(Form("%s Clusters2Tracks failed", fgkDetectorName[iDet]));
-    return kFALSE;
-  }
-  
   fLoader[iDet]->UnloadRecPoints();
 
   tracker->UnloadClusters();
   
   delete tracker;
   
+  if ( rv )
+  {
+    AliError(Form("%s Clusters2Tracks failed", fgkDetectorName[iDet]));
+    return kFALSE;
+  }
+  
   return kTRUE;
 }
 
@@ -2677,7 +2687,7 @@ Bool_t AliReconstruction::FillTriggerScalers(AliESDEvent*& esd)
      //AliTimeStamp* timestamp = new AliTimeStamp(10308000, 0, (ULong64_t)486238);
      AliESDHeader* esdheader = fesd->GetHeader();
      for(Int_t i=0;i<50;i++){
-          if((1<<i) & esd->GetTriggerMask()){
+          if((1ull<<i) & esd->GetTriggerMask()){
           AliTriggerScalersESD* scalesd = fRunScalers->GetScalersForEventClass( timestamp, i+1);
           if(scalesd)esdheader->SetTriggerScalersRecord(scalesd);
         }
@@ -3245,9 +3255,21 @@ Bool_t AliReconstruction::SetRunQA(TString detAndAction)
        }
        Int_t colon = detAndAction.Index(":") ; 
        fQADetectors = detAndAction(0, colon) ; 
-       if (fQADetectors.Contains("ALL") )
-               fQADetectors = fFillESD ; 
-               fQATasks   = detAndAction(colon+1, detAndAction.Sizeof() ) ; 
+       if (fQADetectors.Contains("ALL") ){
+    TString tmp = fFillESD ;
+    Int_t minus = fQADetectors.Last('-') ; 
+    TString toKeep = fFillESD ; 
+    TString toRemove("") ;
+    while (minus >= 0) {
+      toRemove = fQADetectors(minus+1, fQADetectors.Length()) ; 
+      toRemove = toRemove.Strip() ; 
+      toKeep.ReplaceAll(toRemove, "") ; 
+      fQADetectors.ReplaceAll(Form("-%s", toRemove.Data()), "") ; 
+      minus = fQADetectors.Last('-') ; 
+    }
+    fQADetectors = toKeep ; 
+  }  
+  fQATasks   = detAndAction(colon+1, detAndAction.Sizeof() ) ; 
        if (fQATasks.Contains("ALL") ) {
                fQATasks = Form("%d %d %d %d", AliQAv1::kRAWS, AliQAv1::kDIGITSR, AliQAv1::kRECPOINTS, AliQAv1::kESDS) ; 
        } else {