]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGJE/EMCALJetTasks/AliEmcalJetFinder.cxx
fix the previous coverity fix on the existence of the particle and the good calorimet...
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / AliEmcalJetFinder.cxx
index c2a75daf24f05dc4cd54161a906a2dcb1d60f3cb..2597933c55ef4cac873fa841e3ff3d046d27c4b6 100644 (file)
@@ -1,6 +1,8 @@
 // $Id$
 //
 // Standalone jet finder
+//   CINT-compatible wrapper for AliFJWrapper, can be used in macros and from the ROOT command line.
+//   Compiled code can use AliFJWrapper directly
 //
 // Authors: R.Haake
 
@@ -39,6 +41,10 @@ AliEmcalJetFinder::~AliEmcalJetFinder()
 Bool_t AliEmcalJetFinder::FindJets()
 {
   // Tidy up and check input
+  for (UInt_t i=0; i<fJetArray.size(); i++) {
+    delete fJetArray[i];
+    fJetArray[i] = 0;
+  }
   fJetArray.clear();
   fJetCount = 0;
   if(!fInputVectorIndex)
@@ -89,7 +95,7 @@ Bool_t AliEmcalJetFinder::FindJets()
 
   fJetArray.resize(fJetCount);
 
-  fastjets.clear();
+  //fastjets.clear(); // will be done by the destructor at the end of the function
   fFastjetWrapper->Clear();
   fInputVectorIndex = 0;
   return kTRUE;
@@ -114,7 +120,7 @@ void AliEmcalJetFinder::FillPtHistogram(TH1* histogram)
 {
   if(!histogram)
     return;
-  for (Int_t i=0; i<fJetArray.size(); i++)
+  for (std::size_t i=0; i<fJetArray.size(); i++)
   {
     histogram->Fill(fJetArray[i]->Pt());
   }
@@ -125,7 +131,7 @@ void AliEmcalJetFinder::FillPhiHistogram(TH1* histogram)
 {
   if(!histogram)
     return;
-  for (Int_t i=0; i<fJetArray.size(); i++)
+  for (std::size_t i=0; i<fJetArray.size(); i++)
   {
     histogram->Fill(fJetArray[i]->Phi());
   }
@@ -136,7 +142,7 @@ void AliEmcalJetFinder::FillEtaHistogram(TH1* histogram)
 {
   if(!histogram)
     return;
-  for (Int_t i=0; i<fJetArray.size(); i++)
+  for (std::size_t i=0; i<fJetArray.size(); i++)
   {
     histogram->Fill(fJetArray[i]->Eta());
   }