Coverity
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Mar 2011 11:45:26 +0000 (11:45 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Mar 2011 11:45:26 +0000 (11:45 +0000)
PWG3/vertexingHF/AliAnalysisTaskSEHFQA.cxx
PWG3/vertexingHF/AliAnalysisTaskSEImproveITS.cxx
PWG3/vertexingHF/AliCFVertexingHFCascade.cxx

index 3ac2f50..2d97cd6 100644 (file)
@@ -602,6 +602,10 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
       break; 
     }
   }
+
+
+  if(!aod) {delete [] pdgdaughters;return;}
+
   Bool_t isSimpleMode=fSimpleMode;
   if(!arrayProng) {
     AliInfo("Branch not found! The output will contain only trak related histograms\n");
@@ -630,10 +634,12 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
       return;
     }
   }
-  if(!aod) {delete [] pdgdaughters;return;}
   // fix for temporary bug in ESDfilter 
   // the AODs with null vertex pointer didn't pass the PhysSel
-  if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001) return;
+  if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001) {
+    delete [] pdgdaughters;
+    return;
+  }
 
   // count event
   fNEntries->Fill(0); 
index b23ee92..f0ad603 100644 (file)
@@ -196,6 +196,7 @@ void AliAnalysisTaskSEImproveITS::UserExec(Option_t*) {
   // The event loop
   //
   AliAODEvent *ev=dynamic_cast<AliAODEvent*>(InputEvent());
+  if(!ev) return;
   Double_t bz=ev->GetMagneticField();
 
   // Smear all tracks
index 30240ea..b60690a 100644 (file)
@@ -136,6 +136,8 @@ Bool_t AliCFVertexingHFCascade::GetGeneratedValuesFromMCParticle(Double_t* vecto
        AliAODMCParticle* mcPartDaughterD0 = dynamic_cast<AliAODMCParticle*>(fmcArray->At(daughter0ds));
        AliAODMCParticle* mcPartDaughterPis = dynamic_cast<AliAODMCParticle*>(fmcArray->At(daughter1ds));
 
+       if(!mcPartDaughterD0 || !mcPartDaughterPis) return kFALSE;
+
        Double_t vtx1[3] = {0,0,0};   // primary vertex         
        Double_t vtx2daughter0[3] = {0,0,0};   // secondary vertex from daughter 0
        Double_t vtx2daughter1[3] = {0,0,0};   // secondary vertex from daughter 1
@@ -148,6 +150,8 @@ Bool_t AliCFVertexingHFCascade::GetGeneratedValuesFromMCParticle(Double_t* vecto
        AliAODMCParticle* mcPartDaughter0 = dynamic_cast<AliAODMCParticle*>(fmcArray->At(daughter0)); //D0
        AliAODMCParticle* mcPartDaughter1 = dynamic_cast<AliAODMCParticle*>(fmcArray->At(daughter1)); //pis
 
+       if(!mcPartDaughter0 || !mcPartDaughter1) return kFALSE;
+
        // getting vertex from daughters
        mcPartDaughter0->XvYvZv(vtx2daughter0);  // cm
        mcPartDaughter1->XvYvZv(vtx2daughter1);  //cm