Bug Fix
authorddobrigk <david.dobrigkeit.chinellato@cern.ch>
Tue, 22 Jul 2014 15:37:46 +0000 (12:37 -0300)
committerddobrigk <david.dobrigkeit.chinellato@cern.ch>
Tue, 22 Jul 2014 15:44:25 +0000 (12:44 -0300)
PWGLF/STRANGENESS/Cascades/AliAnalysisTaskStrangenessVsMultiplicity.cxx

index c5a81dd..07b0e67 100644 (file)
@@ -773,10 +773,12 @@ void AliAnalysisTaskStrangenessVsMultiplicity::UserExec(Option_t *)
             lIndexSecondLargest = i;
         }
     }
-    const AliESDVertex* largestpv=lESDevent ->GetPileupVertexSPD(lIndexSecondLargest);
-    fEvSel_distZ = lPrimarySPDVtx->GetZ() - largestpv->GetZ();
     fEvSel_nContributors = lPrimaryBestESDVtx -> GetNContributors();
-    fEvSel_nContributorsPileup = largestpv -> GetNContributors();
+    if( fEvSel_nSPDPrimVertices > 0 && lIndexSecondLargest > -1){
+        const AliESDVertex* largestpv=lESDevent ->GetPileupVertexSPD(lIndexSecondLargest);
+        fEvSel_distZ = lPrimarySPDVtx->GetZ() - largestpv->GetZ();
+        fEvSel_nContributorsPileup = largestpv -> GetNContributors();
+    }
     
     //First implementation of pileup from multi-vertexer (simple use of analysis utils)
     if ( !fUtils->IsPileUpMV( lESDevent ) ) fEvSel_IsNotPileupMV = kTRUE;