]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG3/vertexingHF/AliAnalysisTaskSEDStarSpectra.cxx
Added check for a valid pointer to the primary vertex
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliAnalysisTaskSEDStarSpectra.cxx
index e2626fe2f20c9e7cbf13b544144b81fb1810aeb9..481f00a28c7370cc5b4469af98241bb7a4e15f3e 100644 (file)
@@ -192,11 +192,6 @@ void AliAnalysisTaskSEDStarSpectra::UserExec(Option_t *)
     return;
   }
   
-  fCEvents->Fill(1);
-  // Load the event
-  fEvents++;
-  AliInfo(Form("Event %d",fEvents));
-  if (fEvents%10000 ==0) AliInfo(Form("Event %d",fEvents));
   AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
   TClonesArray *arrayDStartoD0pi=0;
  
@@ -216,7 +211,19 @@ void AliAnalysisTaskSEDStarSpectra::UserExec(Option_t *)
   } else {
     arrayDStartoD0pi=(TClonesArray*)aodEvent->GetList()->FindObject("Dstar");
   }
+
+
+  // fix for temporary bug in ESDfilter 
+  // the AODs with null vertex pointer didn't pass the PhysSel
+  if(!aodEvent->GetPrimaryVertex()) return;
  
+
+  fCEvents->Fill(1);
+  // Load the event
+  fEvents++;
+  AliInfo(Form("Event %d",fEvents));
+  if (fEvents%10000 ==0) AliInfo(Form("Event %d",fEvents));
+
   // counters for efficiencies
   Int_t icountReco = 0;