Fix by Ruben
authorcoppedis <coppedis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 20 Jan 2012 16:48:11 +0000 (16:48 +0000)
committercoppedis <coppedis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 20 Jan 2012 16:48:11 +0000 (16:48 +0000)
ZDC/AliZDCDigitizer.cxx

index 33787e3..2468acb 100644 (file)
@@ -291,7 +291,11 @@ void AliZDCDigitizer::Digitize(Option_t* /*option*/)
     if(genHeader->InheritsFrom(AliGenHijingEventHeader::Class())) hijingHeader = dynamic_cast <AliGenHijingEventHeader*> (genHeader);
     else if(genHeader->InheritsFrom(AliGenCocktailEventHeader::Class())){
       TList* listOfHeaders = ((AliGenCocktailEventHeader*) genHeader)->GetHeaders();
-      hijingHeader = dynamic_cast <AliGenHijingEventHeader*> (listOfHeaders->FindObject("Hijing"));
+      if(listOfHeaders) hijingHeader = dynamic_cast <AliGenHijingEventHeader*> (listOfHeaders->FindObject("Hijing"));
+      else{
+        AliWarning(" No list of headers from generator -> skipping event\n");
+       continue;
+      }
     }
     if(!hijingHeader) continue;