compute_generation_batch_event_count

std::size_t madspace::compute_generation_batch_event_count(std::size_t count_target, double count_unweighted, std::size_t count_requested, std::size_t abs_cross_section_count, double abs_cross_section_rel_error, const GeneratorConfig &config)

Number of events to schedule in the next generation batch.

If close to finishing, returns the remaining count divided by the unweighting efficiency. Otherwise selects a count safely below the target using the integration uncertainty, capped by config's max_batch_fraction of the target.

Parameters:
  • count_target – Total unweighted events wanted.

  • count_unweighted – Unweighted events generated so far.

  • count_requested – Weighted events requested so far, counting each job at its nominal batch size.

  • abs_cross_section_count – Events behind the current cross-section estimate.

  • abs_cross_section_rel_error – Relative error of that estimate.

  • config – Generator configuration.