]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Jan, 15th, 2013 : Coverity fix - defect 11329
authoramaire <amaire@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Jan 2013 18:03:24 +0000 (18:03 +0000)
committeramaire <amaire@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Jan 2013 18:03:24 +0000 (18:03 +0000)
Fix in the number of priors initialised for AliPID
https://alicoverity.cern.ch:8443/sourcebrowser.htm?projectId=10001#mergedDefectId=11329

Double_t lPriorsGuessXi   [AliPID::kSPECIESCN] = {0, 0, 2, 0, 1,  0,0,0,0};
Double_t lPriorsGuessOmega[AliPID::kSPECIESCN] = {0, 0, 1, 1, 1,  0,0,0,0};
            // If the boolean for charged option is activated in AliPID::SetPriors, only the first 9 double_t in the array are read anyway.
            // But Coverity sniffs an issue (a priori, previous implementation was safe but the logic is a bit twisted; Coverity is not totally wrong).
            // Use AliPID::kSPECIESCN (=14) is size of the array + initialise what I am interested in (charged particle = 9 first particles)
            // The rest of the table will be initialised to 0 anyway.

// Combined VO-positive-daughter PID
AliPID pPidXi;         pPidXi.SetPriors(    lPriorsGuessXi    , kTRUE); // kTRUE = for charged particle PID
AliPID pPidOmega;      pPidOmega.SetPriors( lPriorsGuessOmega , kTRUE); // kTRUE = for charged particle PID

PWGLF/STRANGENESS/Cascades/AliAnalysisTaskCheckCascade.cxx
PWGLF/STRANGENESS/Cascades/AliAnalysisTaskCheckPerformanceCascade.cxx

index 5667c292c13ed3cdfa3ebb8dde63ee601a3d7c38..72c59e3d9f7a93b8c9baa440f07cd72da5397996 100644 (file)
@@ -2167,8 +2167,14 @@ void AliAnalysisTaskCheckCascade::UserExec(Option_t *)
        
        // A - Combined PID
        // Reasonable guess for the priors for the cascade track sample (e-, mu, pi, K, p)
-       Double_t lPriorsGuessXi[10]    = {0, 0, 2, 0, 1,  0,0,0,0,0};
-       Double_t lPriorsGuessOmega[10] = {0, 0, 1, 1, 1,  0,0,0,0,0};
+        Double_t lPriorsGuessXi   [AliPID::kSPECIESCN] = {0, 0, 2, 0, 1,  0,0,0,0};
+        Double_t lPriorsGuessOmega[AliPID::kSPECIESCN] = {0, 0, 1, 1, 1,  0,0,0,0};
+            // Trick Jan, 15th, 2013 : Coverity fix - defect 11329
+            // If the boolean for charged option is activated in AliPID::SetPriors, only the first 9 double_t in the array are read anyway.
+            // But Coverity sniffs an issue (a priori safe but the logic is a bit twisted; Coverity is not totally wrong).
+            // Use AliPID::kSPECIESCN (=14) is size of the array + initialise what I am interested in (charged particle = 9 first particles)
+            // The rest of the table will be initialised to 0 anyway.
+        
        
        // Combined VO-positive-daughter PID
        AliPID pPidXi;         pPidXi.SetPriors(    lPriorsGuessXi    , kTRUE);  // kTRUE = for charged particle PID
index a470c80b651126e3e0f76659dd5dfa953d1589bf..69aa16f4e6382af66d6a29a722eeb2951f3d9c9f 100644 (file)
@@ -2232,8 +2232,13 @@ for (Int_t iXi = 0; iXi < ncascades; iXi++)
 
         // 3.1.A - Combined PID
        // Reasonable guess for the priors for the cascade track sample (e-, mu, pi, K, p)
-       Double_t lPriorsGuessXi[10]    = {0, 0, 2, 0, 1,  0,0,0,0,0};
-       Double_t lPriorsGuessOmega[10] = {0, 0, 1, 1, 1,  0,0,0,0,0};
+       Double_t lPriorsGuessXi   [AliPID::kSPECIESCN] = {0, 0, 2, 0, 1,  0,0,0,0};
+       Double_t lPriorsGuessOmega[AliPID::kSPECIESCN] = {0, 0, 1, 1, 1,  0,0,0,0};
+            // Trick Jan, 15th, 2013 : Coverity fix - defect 11329
+            // If the boolean for charged option is activated in AliPID::SetPriors, only the first 9 double_t in the array are read anyway.
+            // But Coverity sniffs an issue (a priori safe but the logic is a bit twisted; Coverity is not totally wrong).
+            // Use AliPID::kSPECIESCN (=14) is size of the array + initialise what I am interested in (charged particle = 9 first particles)
+            // The rest of the table will be initialised to 0 anyway.
        
        // Combined VO-positive-daughter PID
        AliPID pPidXi;         pPidXi.SetPriors(    lPriorsGuessXi    , kTRUE); // kTRUE = for charged particle PID