Coverity Fixes for AliAnalysisTaskTriggeredBF
authormiweber <miweber@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 May 2012 08:28:21 +0000 (08:28 +0000)
committermiweber <miweber@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 May 2012 08:28:21 +0000 (08:28 +0000)
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskTriggeredBF.cxx

index c1c6153..d7fc1d5 100755 (executable)
@@ -346,13 +346,15 @@ void AliAnalysisTaskTriggeredBF::UserExec(Option_t *) {
        \r
        AliEventPool* pool = fPoolMgr->GetEventPool(fCentrality, eventMain->GetPrimaryVertex()->GetZ());\r
        \r
-       if (!pool)\r
+       if (!pool){\r
          AliFatal(Form("No pool found for centrality = %f, zVtx = %f", fCentrality, eventMain->GetPrimaryVertex()->GetZ()));\r
-       \r
+       }\r
+       else{\r
+\r
        //pool->SetDebug(1);\r
        \r
-       if (pool->IsReady() || pool->NTracksInPool() > fMixingTracks / 10 || pool->GetCurrentNEvents() >= 5) \r
-         {\r
+         if (pool->IsReady() || pool->NTracksInPool() > fMixingTracks / 10 || pool->GetCurrentNEvents() >= 5){ \r
+           \r
            \r
            Int_t nMix = pool->GetCurrentNEvents();\r
            //cout << "nMix = " << nMix << " tracks in pool = " << pool->NTracksInPool() << endl;\r
@@ -369,11 +371,12 @@ void AliAnalysisTaskTriggeredBF::UserExec(Option_t *) {
                fMixedBalance->FillBalance(fCentrality,tracksMain,tracksMixed); \r
              }\r
          }\r
-\r
-       // Update the Event pool\r
-       pool->UpdatePool(tracksMain);\r
-       //pool->PrintInfo();\r
-       \r
+         \r
+         // Update the Event pool\r
+         pool->UpdatePool(tracksMain);\r
+         //pool->PrintInfo();\r
+         \r
+       }//pool NULL check  \r
       }//run mixing\r
     \r
     // calculate balance function\r
@@ -567,6 +570,8 @@ TObjArray* AliAnalysisTaskTriggeredBF::GetShuffledTracks(TObjArray *tracks){
     AliVParticle* track = (AliVParticle*) tracks->At(i);\r
     tracksShuffled->Add(new AliBFBasicParticle(track->Eta(), track->Phi(), track->Pt(),chargeVector->at(i)));\r
   }\r
+\r
+  delete chargeVector;\r
    \r
   return tracksShuffled;\r
 }\r