Coverity
authorprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Oct 2012 21:18:40 +0000 (21:18 +0000)
committerprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Oct 2012 21:18:40 +0000 (21:18 +0000)
PWGHF/vertexingHF/AliAnalysisTaskSEDplus.cxx
PWGHF/vertexingHF/AliAnalysisTaskSEHFQA.cxx
PWGHF/vertexingHF/AliRDHFCuts.cxx

index fbfb349..c58e398 100644 (file)
@@ -989,7 +989,7 @@ void AliAnalysisTaskSEDplus::UserExec(Option_t */*option*/)
          fMassHist[index]->Fill(invMass);
          if(fCutsDistr){
            Float_t fact=1.;
-           Float_t factor[3];
+           Float_t factor[3]={1.,1.,1.};
            if(fUseStrangeness) fact=GetStrangenessWeights(d,arrayMC,factor);
            fCosPHist[index]->Fill(cosp,fact);
            fDLenHist[index]->Fill(dlen,fact);
index 1f48474..7e788a9 100644 (file)
@@ -748,11 +748,14 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
   AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
   if (fCuts->GetIsUsePID() && fDecayChannel==kLambdactoV0) {
     fCuts->GetPidHF()->SetPidResponse(pidResp);
-    (dynamic_cast<AliRDHFCutsLctoV0*>(fCuts))->GetPidV0pos()->SetPidResponse(pidResp);
-    (dynamic_cast<AliRDHFCutsLctoV0*>(fCuts))->GetPidV0neg()->SetPidResponse(pidResp);
-    fCuts->GetPidHF()->SetOldPid(kFALSE);
-    (dynamic_cast<AliRDHFCutsLctoV0*>(fCuts))->GetPidV0pos()->SetOldPid(kFALSE);
-    (dynamic_cast<AliRDHFCutsLctoV0*>(fCuts))->GetPidV0neg()->SetOldPid(kFALSE);
+    AliRDHFCutsLctoV0* lccuts=dynamic_cast<AliRDHFCutsLctoV0*>(fCuts);
+    if(lccuts){
+      lccuts->GetPidV0pos()->SetPidResponse(pidResp);
+      lccuts->GetPidV0neg()->SetPidResponse(pidResp);
+      fCuts->GetPidHF()->SetOldPid(kFALSE);
+      lccuts->GetPidV0pos()->SetOldPid(kFALSE);
+      lccuts->GetPidV0neg()->SetOldPid(kFALSE);
+    }
   }
 
   // Post the data
index 717d775..c4c7ab7 100644 (file)
@@ -513,11 +513,13 @@ Bool_t AliRDHFCuts::IsEventSelected(AliVEvent *event) {
        if(accept) fWhyRejection=6;
        accept=kFALSE;
       } 
-      if(fCutOnzVertexSPD==2 && TMath::Abs(vSPD->GetZ()-vertex->GetZ())>0.5) {
-       fEvRejectionBits+=1<<kZVtxSPDOutFid;
-       if(accept) fWhyRejection=6;
-       accept=kFALSE;
-      } 
+      if(fCutOnzVertexSPD==2 && vertex){
+       if(TMath::Abs(vSPD->GetZ()-vertex->GetZ())>0.5) {
+         fEvRejectionBits+=1<<kZVtxSPDOutFid;
+         if(accept) fWhyRejection=6;
+         accept=kFALSE;
+       } 
+      }
     }
   }