finally... a couple of minutes for two Coverity bugs (B.Hippolyte)
authorbhippoly <bhippoly@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 22 May 2011 12:30:17 +0000 (12:30 +0000)
committerbhippoly <bhippoly@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 22 May 2011 12:30:17 +0000 (12:30 +0000)
PWG2/SPECTRA/AliAnalysisCentralCutESD.cxx
PWG2/SPECTRA/AliProtonSpectraCorrection.cxx

index c133b8c..8b7824c 100644 (file)
@@ -180,10 +180,12 @@ Bool_t AliAnalysisCentralCutESD::IsA(AliESDtrack *track, PDG_t reqPartType){
                return kFALSE;
     }
 
-    if(partType<0.) return kFALSE;
-
-    else if((AliPID::ParticleCode(partType)) != reqPartType) return kFALSE;
-
+    if(partType<0.) {
+      return kFALSE;
+    }
+    else { // then here partType >=0 so ok for ParticleCode !
+      if((AliPID::ParticleCode(partType)) != reqPartType) return kFALSE;
+    }
     if(track->Charge() != charge) return kFALSE;
     
     return kTRUE;
index e7ab1e1..e4c2cc9 100644 (file)
@@ -254,6 +254,7 @@ void AliProtonSpectraCorrection::FillCorrectionMaps(AliESDEvent *esd,
     Int_t label = track->GetLabel();
     if (label<0) continue;
     AliMCParticle *mcPart  = dynamic_cast<AliMCParticle *>(mcEvent->GetTrack(label));
+    if (!mcPart) continue;
 
     if((fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kTPC)||(fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kHybrid)) {
       AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();