Coverity fix - issue related to /PWGHF/vertexingHF/AliRDHFCuts::PtBin(Double_t) const
authorMateusz Ploskon <mploskon@lbl.gov>
Wed, 11 Dec 2013 14:31:53 +0000 (15:31 +0100)
committerMateusz Ploskon <mploskon@lbl.gov>
Wed, 11 Dec 2013 15:41:56 +0000 (16:41 +0100)
PWGJE/FlavourJetTasks/AliAnalysisTaskFlavourJetCorrelations.cxx

index 6a64fae..4548818 100644 (file)
@@ -790,6 +790,12 @@ void AliAnalysisTaskFlavourJetCorrelations::SideBandBackground(AliAODRecoCascade
    Double_t mPDGD0=TDatabasePDG::Instance()->GetParticle(421)->Mass();\r
    \r
    Int_t bin = fCuts->PtBin(candDstar->Pt());\r
+   if (bin < 0)\r
+     {\r
+       // coverity - issue related to /PWGHF/vertexingHF/AliRDHFCuts::PtBin(Double_t) const\r
+       AliFatal("bin < 0 used as an array index; check: /PWGHF/vertexingHF/AliRDHFCuts::PtBin(Double_t) const");\r
+       bin = 9999; // coverity - should be unreachable anyhow\r
+     }\r
    Float_t fourSigmal= mPDGD0-4.*fSigmaD0[bin] , sixSigmal= mPDGD0-8.*fSigmaD0[bin];\r
    Float_t fourSigmar= mPDGD0+4.*fSigmaD0[bin] , sixSigmar= mPDGD0+8.*fSigmaD0[bin];\r
    \r