Coverity fixes
authorfprino <prino@to.infn.it>
Mon, 12 Jan 2015 21:36:50 +0000 (22:36 +0100)
committerfprino <prino@to.infn.it>
Mon, 12 Jan 2015 21:37:13 +0000 (22:37 +0100)
PWGHF/correlationHF/AliAnalysisTaskDStarCorrelations.cxx
PWGHF/correlationHF/AliAnalysisTaskSED0Correlations.cxx

index 1540a0b..ccce4b1 100644 (file)
@@ -846,7 +846,6 @@ void AliAnalysisTaskDStarCorrelations::UserExec(Option_t *){
         Int_t NofEventsinPool = 1;
         if(fmixing) NofEventsinPool = fCorrelator->GetNofEventsInPool();
         
-        Bool_t *trackOrigin = NULL;
        // cout << "crash here 5" << endl;
         //************************************************** LOOP ON EVENTS IN EVENT POOL *****************************************************
         
@@ -922,6 +921,7 @@ void AliAnalysisTaskDStarCorrelations::UserExec(Option_t *){
                  
               
                  
+                Bool_t *trackOrigin = NULL;
                  
                  if(fmontecarlo) {trackOrigin = fAssocCuts->IsMCpartFromHF(label,fmcArray);
                      if(trackOrigin[4]) {/*cout << "Something is wrong with hadron in MC - skipping" << endl; */continue;}
@@ -1029,7 +1029,7 @@ void AliAnalysisTaskDStarCorrelations::UserExec(Option_t *){
                      }
                  }
                  
-                 
+                delete [] trackOrigin;
              } // end loop on associated tracks
             
         } // end loop on events in event pool
index 0cea99f..437bcd9 100644 (file)
@@ -611,7 +611,10 @@ void AliAnalysisTaskSED0Correlations::UserExec(Option_t */*option*/)
     for(Int_t itrack=0; itrack<ntracks; itrack++) { // loop on tacks
       //    ... get the track
       AliAODTrack * track = dynamic_cast<AliAODTrack*>(aod->GetTrack(itrack));
-      if(!track) AliFatal("Not a standard AOD");
+      if(!track){
+       AliWarning("Error in casting to AOD track. Not a standard AOD?");
+       continue;
+      }
       if(TESTBIT(track->GetITSClusterMap(),2) || TESTBIT(track->GetITSClusterMap(),3) ){
        skipEvent=kTRUE;
        fNentries->Fill(16);
@@ -671,7 +674,10 @@ void AliAnalysisTaskSED0Correlations::UserExec(Option_t */*option*/)
 
     for(Int_t itrack=0; itrack<aod->GetNumberOfTracks(); itrack++) { // loop on tacks
       AliAODTrack * track = dynamic_cast<AliAODTrack*>(aod->GetTrack(itrack));
-      if(!track) AliFatal("Not a standard AOD");
+      if(!track){
+       AliWarning("Error in casting to AOD track. Not a standard AOD?");
+       continue;
+      }
       //rejection of tracks
       if(track->GetID() < 0) continue; //discard negative ID tracks
       if(track->Pt() < fPtThreshLow.at(0) || track->Pt() > fPtThreshUp.at(0)) continue; //discard tracks outside pt range for hadrons/K