]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/SPECTRA/AliAnalysisCentralCutESD.cxx
New base class for multiplicity tasks
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / AliAnalysisCentralCutESD.cxx
index e5e572c12a6eedeed1d7496e4f4d4aa8ee00ae64..fc212ad4e865644b32f6e8a2855a2ff8771ce088 100644 (file)
@@ -76,6 +76,7 @@ AliAnalysisCentralCutESD::~AliAnalysisCentralCutESD() {
 // Destructor
 // Delete the created priors
 
+       if(fPartPriors) delete [] fPartPriors;
 
        if(fElectronFunction) delete fElectronFunction;
        if(fMuonFunction) delete fMuonFunction;
@@ -132,15 +133,15 @@ Bool_t AliAnalysisCentralCutESD::IsA(AliESDtrack *track, PDG_t reqPartType){
 // Determines the type of the particle
     Int_t charge;
 
-       if(reqPartType < 0){
-               charge = -1;
-       }
-       else{
-               charge = 1;
-       }
+    if(reqPartType < 0){
+      charge = -1;
+    }
+    else{
+      charge = 1;
+    }
 
-    Double_t probability[5];
-    Double_t w[5];
+    Double_t probability[5] = {0.0,0.0,0.0,0.0,0.0};
+    Double_t w[5] = {0.0,0.0,0.0,0.0,0.0};
 
     Long64_t partType = 0;
 
@@ -164,6 +165,7 @@ Bool_t AliAnalysisCentralCutESD::IsA(AliESDtrack *track, PDG_t reqPartType){
 
     if(fPIDtype.Contains("Bayesian")) {
                partType = TMath::LocMax(AliPID::kSPECIES,w);
+               if(partType<0.) return kFALSE;
     }
 
     else if(fPIDtype.Contains("Custom")){