message: function to remove background-only events in new MCs
diff: @@ -403,6 +403,16 @@ double AliMultDepSpecAnalysisTask::GetParticleWeight(AliVParticle* particle)
  return 1.0;
  }
  +// helper function to reject events containing only background
  +bool IsBackgroundEvent(AliVEvent* event) {
  + AliVTrack* track = nullptr;
  + for (int i = 0; i < event->GetNumberOfTracks(); ++i) {
  + track = dynamic_cast<AliVTrack*>(event->GetTrack(i));
  + if (std::abs(track->GetLabel()) < AliMCEvent::BgLabelOffset()) return false;
  + }
  + return true;
  +}
  +
  //**************************************************************************************************
  /**
  * Initialize event quantities. Sets fEvent, fMCEvent, fMeasMult, fTrueMult
  @@ -425,11 +435,10 @@ bool AliMultDepSpecAnalysisTask::InitEvent()
  AliError("fMCEvent not available\n");
  return false;
  }
  - if(fIsNewReco && AliAnalysisUtils::IsSameBunchPileupInGeneratedEvent(fMCEvent)) {
  + if(fIsNewReco && IsBackgroundEvent(fEvent)) {
  // reject all the events with simulated in-bunch pileup
  return false;
  }
  -
  fMCVtxZ = fMCEvent->GetPrimaryVertex()->GetZ();
  if (fMCEnableDDC) {
  