message: IsDPMJet updated to use cocktail iterator
diff: @@ -3063,15 +3063,23 @@ Bool_t AliMultSelectionTask::IsHijing() const {
  //______________________________________________________________________
  Bool_t AliMultSelectionTask::IsDPMJet() const {
  - //Function to check if this is DPMJet
  + //Function to check if this is DPMJet MC
  Bool_t lReturnValue = kFALSE;
  AliMCEvent* mcEvent = MCEvent();
  - if (mcEvent) {
  - AliGenEventHeader* mcGenH = mcEvent->GenEventHeader();
  - if (mcGenH->InheritsFrom(AliGenDPMjetEventHeader::Class())) {
  - //DPMJet Header is there!
  + TList* cocktList = mcEvent->GetCocktailList();
  + if (cocktList) {
  + TIter next(cocktList);
  + while (const TObject *obj=next()){
  + //Look for an object inheriting from the hijing header class
  + if ( obj->InheritsFrom(AliGenDPMjetEventHeader::Class()) ){
  lReturnValue = kTRUE;
  + break;
  + }
  }
  + } // if cocktList
  + else {
  + AliGenEventHeader* mcGenH = mcEvent->GenEventHeader();
  + lReturnValue = mcGenH->InheritsFrom(AliGenDPMjetEventHeader::Class());
  }
  return lReturnValue;
  }
  