]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
protection agains missing aod vertex added
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Jan 2011 07:06:30 +0000 (07:06 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Jan 2011 07:06:30 +0000 (07:06 +0000)
PWG4/JetTasks/AliAnalysisTaskJetSpectrum2.cxx

index 3f8dffd57d09a5bf5dd14b941f35d551c1c5d681..66bf3da6aec9d1a7b8beac445ebf4a43295b9d0a 100644 (file)
@@ -897,7 +897,9 @@ void AliAnalysisTaskJetSpectrum2::UserExec(Option_t */*option*/){
   fh1PtHardTrials->Fill(ptHard,nTrials);
 
   // Real
-  fh1ZVtx->Fill(aod->GetPrimaryVertex()->GetZ());
+  if(aod->GetPrimaryVertex()){// No vtx for pure MC
+    fh1ZVtx->Fill(aod->GetPrimaryVertex()->GetZ());
+  }
 
   // the loops for rec and gen should be indentical... pass it to a separate
   // function ...