Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
55924ce
gridpack: in-memory event streaming API (bin/event_stream.py) for fix…
theoheimel Oct 9, 2026
fa1aaaf
fix CI: keyword-only args in ChannelEventGenerator.load_json binding …
theoheimel Oct 12, 2026
5cf77b6
Merge remote-tracking branch 'origin/feat-improve-gridpacks' into fea…
theoheimel Oct 12, 2026
1e7069e
Merge remote-tracking branch 'origin/main' into feat-streaming-event-gen
theoheimel Oct 12, 2026
18e0283
docs: event streaming page with a CI-tested p p > e+ e- m_ee example …
theoheimel Oct 12, 2026
301c66d
Merge remote-tracking branch 'origin/feat-streaming-event-gen' into f…
theoheimel Oct 14, 2026
13bdbe3
madspace: optional matrix-element outputs in the Integrand
theoheimel Oct 14, 2026
06ff2dc
madspace: flavor and index of the matrix element as Integrand outputs
theoheimel Oct 14, 2026
5dfae1e
madspace: re- and unweighting steps after the first unweighting
theoheimel Oct 14, 2026
5d66710
madspace: release the GIL in EventGenerator.optimize and fix_max_weights
theoheimel Oct 14, 2026
900ec21
madspace: weighting groups in JSON, fixed maxima of the steps
theoheimel Oct 14, 2026
384d845
madspace: release the GIL when an EventStream is destroyed
theoheimel Oct 14, 2026
4fd1d75
madspace: re- and unweighting steps in the EventStream
theoheimel Oct 14, 2026
3bcbdac
madspace: enum location of WeightingStep.Mode for the .pyi stubs
theoheimel Oct 14, 2026
3a044ae
mg7: [surrogate] run card section
theoheimel Oct 14, 2026
133f045
madspace: unweighting efficiency of each pass in the generation output
theoheimel Oct 14, 2026
5e24047
madspace: weighting steps with matrix elements that return a ratio
theoheimel Oct 14, 2026
370abe8
madspace: matrix elements with a fixed channel index
theoheimel Oct 14, 2026
8b581c2
madspace: integrands with discrete choices of the phase-space mapping
theoheimel Oct 14, 2026
f59cecc
madspace: LHE completion of subprocesses without diagrams
theoheimel Oct 14, 2026
cf7f1b7
mg7: split the launcher into modules
theoheimel Oct 14, 2026
636dead
mg7: weighting steps of each subprocess
theoheimel Oct 14, 2026
68714e6
interface: '[amplicol]' processes
theoheimel Oct 14, 2026
0b2f9c3
mg7: output of the [amplicol] processes
theoheimel Oct 14, 2026
40ce2e9
madspace: weighting step matrix elements with a fixed channel
theoheimel Oct 14, 2026
0e137ac
mg7: outputs with only [amplicol] processes
theoheimel Oct 14, 2026
62cc989
mg7: [amplicol] run card section
theoheimel Oct 14, 2026
b74dee3
mg7: subprocess hooks for other matrix-element backends
theoheimel Oct 14, 2026
6f2c76f
mg7: AmpliCol subprocesses
theoheimel Oct 14, 2026
a8bfeee
mg7: [amplicol] processes with flavour-grouped legs
theoheimel Oct 14, 2026
4e6d716
mg7: coupling orders of the [amplicol] processes
theoheimel Oct 14, 2026
327e2b5
mg7: refuse cuts that are not flavour blind for [amplicol]
theoheimel Oct 14, 2026
b38793b
tests: mg7 [amplicol] cross sections against madmatrix
theoheimel Oct 14, 2026
3ace557
mg7: [amplicol] fixes for quark processes and models without alpha_s
theoheimel Oct 14, 2026
f0dd992
mg7: no madmatrix files in outputs with only [amplicol] processes
theoheimel Oct 14, 2026
4de6aed
mg7: load the [amplicol] libraries once for all their channels
theoheimel Oct 15, 2026
d056758
mg7: mirrored beams of the [amplicol] processes
theoheimel Oct 15, 2026
8f04549
tests: [amplicol] p p > j j j and g g > t t~ g against madmatrix
theoheimel Oct 15, 2026
2d8f603
mg7: generate the [amplicol] artifacts in a worker process
theoheimel Oct 15, 2026
95fedd4
Merge origin/merge-pyamplicol into feat-madspace-amplicol
theoheimel Oct 26, 2026
3ba676e
mg7: [amplicol] with the pyamplicol of pyamplicol/install
theoheimel Oct 26, 2026
988523a
pyamplicol: umami.h is madspace's
theoheimel Oct 26, 2026
d7b2f97
Merge remote-tracking branch 'origin/merge-pyamplicol' into feat-mads…
theoheimel Oct 26, 2026
1c0f5c8
pyamplicol: model-wide generation data once per artifact
theoheimel Oct 26, 2026
19c2a26
madspace: pt^2, not m_T^2, bounds the momentum transfer to the beam
theoheimel Oct 26, 2026
bed7c49
pyamplicol: stage artifact payloads without reading them back
theoheimel Oct 26, 2026
ce5db24
pyamplicol: strict flavour-blind generation
theoheimel Oct 26, 2026
587e4f9
madspace: LHE flavour options drawn in proportion to their weights
theoheimel Oct 26, 2026
daf23c9
mg7: [amplicol] generates one subprocess per verified flavour class
theoheimel Oct 26, 2026
e467b9a
pyamplicol: pack per-process payloads into payloads.pacbin
theoheimel Oct 26, 2026
aab046e
Merge branch 'fix-ttbar-color-ordered-mapping' into feat-madspace-amp…
theoheimel Oct 26, 2026
2e00644
pyamplicol: spool packed payloads instead of staging them as files
theoheimel Oct 26, 2026
1976776
madspace: keep the fixed channel of weighting-step matrix elements in…
theoheimel Oct 26, 2026
c218344
mg7: gridpacks of [amplicol] processes
theoheimel Oct 26, 2026
7ee06f1
madspace: multi-channel weights from the densities of the channel map…
theoheimel Oct 26, 2026
3333a66
pyamplicol: UMAMI phase-space channels with colour-singlet partners a…
theoheimel Oct 26, 2026
4be41de
mg7: [amplicol] multi-channel phase space with colour-singlet partner…
theoheimel Oct 26, 2026
ee52a5a
Merge branch 'feat-madspace-amplicol-flavor' into feat-madspace-amplicol
theoheimel Oct 26, 2026
f0d7183
pyamplicol: config registry test counts process.flavor_blind_strict
theoheimel Oct 27, 2026
dfe3b1f
madspace: limit pretty MadNIS training box to the last 10 subprocesses
theoheimel Oct 27, 2026
668fce1
pyamplicol: umami writer test builders provide read_staged
theoheimel Oct 27, 2026
4033b1d
mg7: move the launcher modules from template_files/mg7 to madgraph/mg7
theoheimel Oct 27, 2026
36325bf
madspace: freeze the maximum weight independently of the thread timing
theoheimel Oct 29, 2026
636ca9c
ci: pyamplicol workflow imports bootstrap from madgraph.mg7 and trigg…
theoheimel Oct 29, 2026
cff09fc
ci: docs examples workflow triggers on madgraph/mg7
theoheimel Oct 29, 2026
cc9d3c2
ci: release smoke test fails when pyamplicol's license check fails
theoheimel Oct 29, 2026
03b4547
mg7: [amplicol] after another bracket is refused like before it
theoheimel Oct 29, 2026
ba95ed9
mg7: always reap the pyamplicol worker and stop waiting for a busy Sy…
theoheimel Oct 29, 2026
0bd0f6b
mg7: launch test writes the run_card from the mg7 template
theoheimel Oct 29, 2026
cb4fa0f
mg7: refuse stale pyamplicol installs at output and before compiling …
theoheimel Oct 29, 2026
f27d8c7
mg7: take the [amplicol] model restriction from the MG model, not the…
theoheimel Oct 29, 2026
ea2f35f
mg7: key the cached [amplicol] model by model, restriction and pyampl…
theoheimel Oct 29, 2026
09ff381
pyamplicol: read exact-runtime payloads through payloads.pacbin when …
theoheimel Oct 29, 2026
059924a
madspace: freeze the step maxima independently of the thread timing
theoheimel Oct 29, 2026
dafb6e0
pyamplicol: s-channel resonances selected at launch, every compatible…
theoheimel Oct 29, 2026
ba4ee23
madspace: give non-finite weighting step ratios the weight 0
theoheimel Oct 29, 2026
0ce842d
pyamplicol: inspect artifacts whose payloads are packed in payloads.p…
theoheimel Oct 29, 2026
57920b2
pyamplicol: take the payload container constants from the manifest mo…
theoheimel Oct 29, 2026
c9adec2
mg7: [amplicol] resonances that go on shell are selected at launch
theoheimel Oct 29, 2026
4a29096
madspace: apply the truncation budget of a smaller target to the step…
theoheimel Oct 29, 2026
2ae747e
madspace: uniform mapping channel weights if no density is valid
theoheimel Oct 29, 2026
d5d9a4e
madspace: first-pass unweighting settings per weighting group
theoheimel Oct 29, 2026
5f542ac
madspace: EventStream status without the inactive channels
theoheimel Oct 29, 2026
b681214
Merge remote-tracking branch 'origin/merge-pyamplicol' into feat-mads…
theoheimel Oct 29, 2026
c116dd6
mg7: first-pass unweighting settings per weighting group, not for the…
theoheimel Oct 29, 2026
7628853
mg7: refuse a [surrogate] with [amplicol] subprocesses
theoheimel Oct 29, 2026
cc5232f
mg7: event stream docs: reweighted [amplicol] events carry ratio weights
theoheimel Oct 29, 2026
08d6e0a
mg7: event stream keeps the unread events of an iterator chunk, refus…
theoheimel Oct 29, 2026
76fc11d
mg7: gridpack runs without an [amplicol] section in its card
theoheimel Oct 29, 2026
f14dae8
mg7: check the .so [surrogate] path and device, pass it the run-time …
theoheimel Oct 29, 2026
e5a0a89
mg7: run check-pyamplicol before compiling the [amplicol] libraries a…
theoheimel Oct 29, 2026
d84453f
mg7: remove an unused start_time
theoheimel Oct 29, 2026
73a2148
madspace: split the flushed weighting-step batches over the idle threads
theoheimel Oct 29, 2026
6d451dc
madspace: one gather per source and one concatenation per weighting-s…
theoheimel Oct 29, 2026
f3c73bc
madspace: skip the weighting steps of survey iterations that are cleared
theoheimel Oct 29, 2026
9070124
mg7: no automatic MLM merging for outputs with [amplicol] processes
theoheimel Oct 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/docs_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ name: MadSpace docs examples
# The other MG7 acceptance workflows all carry `paths-ignore: ['docs/**']`, so a
# docs-only commit currently triggers none of them. This workflow does the
# opposite: it triggers ONLY on the paths that can affect the documentation
# examples, so editing docs/source/madspace/examples/*.rst is actually tested.
# examples, so editing docs/source/madspace/examples/*.rst (or the event
# streaming example in docs/source/event_stream.rst) is actually tested.
on:
push:
branches:
- '**'
paths:
- 'docs/source/madspace/examples/**'
- 'docs/source/event_stream.rst'
- 'madgraph/iolibs/template_files/mg7/**'
- 'madgraph/mg7/**'
- 'madspace/**'
- 'tests/acceptance_tests/test_madspace_examples.py'
- '.github/workflows/docs_examples.yml'
Expand All @@ -18,6 +22,9 @@ on:
types: [opened, synchronize, reopened]
paths:
- 'docs/source/madspace/examples/**'
- 'docs/source/event_stream.rst'
- 'madgraph/iolibs/template_files/mg7/**'
- 'madgraph/mg7/**'
- 'madspace/**'
- 'tests/acceptance_tests/test_madspace_examples.py'
- '.github/workflows/docs_examples.yml'
Expand Down Expand Up @@ -55,4 +62,4 @@ jobs:
- name: run the madspace doc examples
run: |
cd $GITHUB_WORKSPACE
./tests/test_manager.py test_madspace_example_simple_mappings test_madspace_example_cuts test_madspace_example_diagram_mapping test_madspace_example_integration_order test_madspace_example_matrix_element test_madspace_example_pdf test_madspace_example_integrator test_madspace_example_integrator_madnis test_madspace_example_flow_training -pA -t0 -l INFO
./tests/test_manager.py test_madspace_example_simple_mappings test_madspace_example_cuts test_madspace_example_diagram_mapping test_madspace_example_integration_order test_madspace_example_matrix_element test_madspace_example_pdf test_madspace_example_integrator test_madspace_example_integrator_madnis test_madspace_example_flow_training test_gridpack_example_event_stream -pA -t0 -l INFO
4 changes: 2 additions & 2 deletions .github/workflows/pyamplicol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
if [[ -z "$base" || "$base" =~ ^0+$ ]] || ! git cat-file -e "$base^{commit}" 2>/dev/null; then
changed=true
elif git diff --name-only "$base" HEAD \
| grep -qE '^(pyamplicol/|\.github/workflows/pyamplicol|\.github/actions/(pyamplicol|build_pyamplicol|install_pyamplicol)|VERSION$)'; then
| grep -qE '^(pyamplicol/|\.github/workflows/pyamplicol|\.github/actions/(pyamplicol|build_pyamplicol|install_pyamplicol)|madspace/include/madspace/umami\.h$|madgraph/mg7/bootstrap\.py$|VERSION$)'; then
changed=true
else
changed=false
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
python - <<'EOF'
import sys
sys.path.insert(0, ".")
from madgraph.iolibs.template_files.mg7 import bootstrap
from madgraph.mg7 import bootstrap
bootstrap.ensure_pyamplicol(interactive=False)
bootstrap.check_pyamplicol_license()
assert bootstrap.check_pyamplicol_source_hash()
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,16 @@ jobs:
done
test -d madspace/install/madspace

# Also checks that Symbolica accepts pyamplicol's library key.
# Also checks that Symbolica accepts pyamplicol's library key; only the
# wheel download is retried, so a rejected key fails the step.
for attempt in $(seq 10); do
python3 pyamplicol/install.py --bin -y && break
if python3 pyamplicol/install.py --bin -y; then status=0; break; else status=$?; fi
# The wheel installed, so the license check failed: retrying cannot help.
test -d pyamplicol/install/pyamplicol && break
echo "attempt $attempt: pyamplicol==${{ needs.check_version.outputs.version }} not installable yet, retrying..."
sleep 15
done
test "$status" -eq 0
test -d pyamplicol/install/pyamplicol

- name: Sign the tarball with Sigstore
Expand Down
11 changes: 11 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@
if os.path.isdir(os.path.join(_local_install, "madspace")):
sys.path.insert(0, _local_install)

# bin/event_stream.py of the gridpacks, for the API reference in event_stream.rst
sys.path.insert(
0,
os.path.abspath(
os.path.join(
os.path.dirname(__file__),
"..", "..", "madgraph", "iolibs", "template_files", "mg7",
)
),
)

# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
Expand Down
21 changes: 21 additions & 0 deletions docs/source/custom_functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,27 @@ matrix products. If your function relies on it, set ``OMP_NUM_THREADS=1``.
The Python API behind these functions is ``madspace.PythonFunction``. It can also be used
directly with madspace.

.. _custom-function-surrogate:

Python surrogates
-----------------

A Python surrogate of the matrix element (see :ref:`run-card-surrogate`) uses the same
mechanism. Its file defines ``FRAMEWORK`` and ``custom_surrogate(momenta, pdg_ids,
alpha_s)``, which returns :math:`|M|^2` as a float64 array of shape ``(batch,)``. It takes
no parameters. ``momenta`` and ``pdg_ids`` have the shapes and types given above, with the
momenta that the full matrix element gets, and ``alpha_s`` is a float64 array of shape
``(batch,)``. The function is called for all subprocesses, which ``pdg_ids`` identifies:

.. code-block:: python

import numpy as np

FRAMEWORK = "numpy"

def custom_surrogate(momenta, pdg_ids, alpha_s):
return np.ones(len(momenta))

Examples
--------

Expand Down
159 changes: 159 additions & 0 deletions docs/source/event_stream.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
Streaming events from Python
============================

A gridpack can generate events directly into a Python program, without writing any files.
This is useful when the events are consumed right away, for example by an analysis written
in Python or as training data for a neural network. The ``EventStream`` class in the
gridpack's ``bin/event_stream.py`` returns the events either as LHE event objects or as
batches of NumPy arrays or PyTorch tensors.

Event streaming needs a gridpack created with ``run_mode = "fix_max_weight"`` (see
:ref:`gridpack-run-mode`). In this mode, the maximum weight of every channel is fixed when
the gridpack is created. An event is final as soon as it is unweighted, so it can be returned
right away without a survey or a combination step.

Example: the e+ e- invariant mass
---------------------------------

This example fills a histogram of the invariant mass of the electron pair in
``p p > e+ e-``. First, create the gridpack at the MadGraph7 prompt:

.. code-block:: text
:name: event-stream-mg5-commands

generate p p > e+ e-
output mg7 PROC_ppee
launch PROC_ppee
set save_gridpack true
set run_mode fix_max_weight
done

The gridpack is written to ``PROC_ppee/Events/run_01/gridpack``. Its ``bin`` directory
contains ``event_stream.py``, so add it to the Python path and import ``EventStream``. The
script can run from any directory.

.. code-block:: python

import sys

import numpy as np

sys.path.insert(0, "PROC_ppee/Events/run_01/gridpack/bin")
from event_stream import EventStream

Creating an ``EventStream`` starts the event generation in background threads. Its
arguments, like the device, the seed and the batch sizes, default to the values in the
gridpack's ``Cards/grid_run_card.toml``. The stream is endless, so ``max_events`` limits
the number of events. Each batch is an :py:class:`EventBatch <event_stream.EventBatch>`
with one array per LHE field. The particle fields have the shape
``(batch_size, max_particle_count)``.

.. code-block:: python

bins = np.linspace(60.0, 120.0, 31)
hist = np.zeros(len(bins) - 1)
weight_sum = 0.0

with EventStream(seed=42) as stream:
for batch in stream.batches(10000, max_events=100000):
# four-momentum of the e+ e- pair: sum over the outgoing electrons
is_electron = (np.abs(batch.pdg_id) == 11) & (batch.status_code == 1)
e, px, py, pz = (
np.sum(np.where(is_electron, p, 0.0), axis=1)
for p in (batch.energy, batch.px, batch.py, batch.pz)
)
m_ee = np.sqrt(np.maximum(e**2 - px**2 - py**2 - pz**2, 0.0))
hist += np.histogram(m_ee, bins, weights=batch.weight)[0]
weight_sum += np.sum(batch.weight)
cross_section = stream.integral
print(f"cross section: {cross_section:.1f} +- {stream.integral_error:.1f} pb")

The event weights are not normalized to the cross section (see :ref:`event-stream-weights`).
Scaling them to the cross section gives the differential cross section in pb/GeV:

.. code-block:: python

dsigma = hist * cross_section / weight_sum / np.diff(bins)
for low, value in zip(bins[:-1], dsigma):
print(f"{low:5.0f} GeV {value:8.3f} pb/GeV " + "#" * int(50 * value / dsigma.max()))

peak = np.argmax(dsigma)
assert bins[peak] < 91.2 < bins[peak + 1], "the Z peak is missing"

The output shows the Z peak (shortened)::

cross section: 880.2 +- 0.6 pb
...
84 GeV 7.569 pb/GeV ##
86 GeV 16.543 pb/GeV #####
88 GeV 51.287 pb/GeV ################
90 GeV 158.376 pb/GeV ##################################################
92 GeV 66.743 pb/GeV #####################
94 GeV 18.457 pb/GeV #####
...

Output formats
--------------

There are three ways to get events from a stream:

- Iterating over the stream yields one ``madspace.LHEEvent`` at a time. The events are
completed in chunks of 1000 internally. If the loop is left early, the rest of the chunk
is returned first by the next call, so no event is skipped.
- :py:meth:`next_events <event_stream.EventStream.next_events>` returns a list of a given
number of ``LHEEvent`` objects.
- :py:meth:`batches <event_stream.EventStream.batches>` and
:py:meth:`next_batch <event_stream.EventStream.next_batch>` return
:py:class:`EventBatch <event_stream.EventBatch>` objects. With ``output_type="torch"``,
their fields are PyTorch tensors on the CPU instead of NumPy arrays.

Events have different numbers of particles if the process has several subprocesses or
includes decays. The particle fields are then padded with zeros. ``particle_count`` holds
the number of particles of every event and ``particle_mask`` marks the valid entries.

.. _event-stream-weights:

Weights and cross section
-------------------------

After the unweighting, every event weight is ``1``, or ``-1`` for an event with a negative
weight. The exception are overweight events, whose weight exceeded the fixed maximum weight
of their channel. They keep the ratio of their weight to the maximum weight, so their weight
is larger than ``1``. Treating them as ``1`` would bias the distributions in the phase-space
regions where they occur.

The events of ``[amplicol]`` subprocesses are then reweighted to full colour in the default
``mode = "reweight"``: their weight is multiplied by the ratio of the full-colour to the
leading-colour matrix element, so it is not ``1``. With ``mode = "unweight"``, they are
unweighted a second time and have unit weights apart from overweights.

In all cases, to normalize a sample to the cross section, scale its weights by
``stream.integral / sum(weights)``. The cross section estimate improves while events are
generated: it combines the integrals stored in the gridpack with the weighted events
generated by the stream so far. Read it after generating the sample, as in the example
above.

How it works
------------

Each channel of the gridpack keeps a buffer of unweighted events, which background threads
refill whenever it runs low. The channel of every event is drawn at random, with
probabilities given by the current cross section estimates of the channels. Generating
the phase-space points and evaluating the matrix elements happen in separate steps, as in a
normal gridpack run.

The events are reproducible: for a given seed, the stream always returns the same sequence of
events. It does not depend on the number of threads or on how the events are split into
batches.

API reference
-------------

.. autoclass:: event_stream.EventStream
:members:
:special-members: __iter__
:member-order: bysource

.. autoclass:: event_stream.EventBatch
:members:
:member-order: bysource
21 changes: 21 additions & 0 deletions docs/source/gridpacks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ ends:
longer, especially for channels with a low unweighting efficiency, but the gridpack
runs do not have to estimate the maximum weights first. This helps if each run only
generates a few events.
The gridpack also gets ``bin/event_stream.py``, see :ref:`gridpack-event-stream`.

``regular``
The events of the run are generated as usual, then the gridpack is stored.
Expand All @@ -96,6 +97,15 @@ Make sure every job uses a different seed. The default seed ``-1`` draws a fresh
seed for each call, which is fine for independent jobs. The seed that was used is recorded
in the output.

.. _gridpack-event-stream:

Streaming events from Python
----------------------------

A gridpack created with ``run_mode = "fix_max_weight"`` also contains
``bin/event_stream.py``. Its ``EventStream`` class generates events in memory and returns
them to a Python program, without writing any files. See :doc:`event_stream`.

Run card settings
-----------------

Expand Down Expand Up @@ -147,6 +157,9 @@ gridpack is created.
* -
- ``cut_efficiency_threshold``, ``max_cut_repetitions``
- Card only.
* - ``[amplicol]``
- ``first_pass_max_overweight_truncation``, ``first_pass_freeze_max_weight_after``
- ``--first_pass_max_overweight_truncation``, ``--first_pass_freeze_max_weight_after``
* - ``[gridpack]``
- ``output_dir``, ``temp_output_dir``
- ``--output_dir``, ``--temp_output_dir``
Expand All @@ -160,6 +173,14 @@ the main run card, see :doc:`run_card`. ``./bin/generate_events --help`` lists a
Relative ``output_dir`` and ``temp_output_dir`` paths in the card refer to the gridpack
directory. Both are reset to ``""`` when the gridpack is created.

With ``[amplicol]`` processes unweighted to full colour, ``max_overweight_truncation`` and
``freeze_max_weight_after`` set the second pass, which gives the events, and the
``first_pass_`` options the leading-colour unweighting of these processes, as in the main
run. The other processes are unweighted once, as set by ``[generation]``. The colour
accuracy and the mode are fixed when the gridpack is created. The pyamplicol artifacts
the libraries read are copied to ``SubProcesses/``, and ``include_source = true`` is not
supported for these processes.

The card names the ``cpu_mode`` that the gridpack was built with, which can differ from the
``"auto"`` of the original run card. The matrix element libraries carry this name. If you
change ``cpu_mode`` or ``precision``, you have to rebuild them.
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ If you need a stable release, use the
custom_functions
diagram_filters
gridpacks
event_stream
madevent_to_mg7

.. toctree::
Expand Down
11 changes: 11 additions & 0 deletions docs/source/madspace/cpp-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Builders that assemble compute-graph functions for channel weights, energy scale
cpp/SubchannelWeights
cpp/Unweighter
cpp/VegasHistogram
cpp/WeightingStepFunction

Phase-space building blocks
---------------------------
Expand All @@ -85,6 +86,7 @@ Supporting types shared by the mappings: topologies, cuts, observables and densi
cpp/PdfGrid
cpp/Propagator
cpp/Topology
cpp/WeightingStep
cpp/initialize_vegas_grid

Compute graph
Expand Down Expand Up @@ -127,6 +129,7 @@ The high-level driver plus the tensor and device layer it runs on: integration,
cpp/EventHistogramSpec
cpp/EventHistograms
cpp/EventRecord
cpp/EventStream
cpp/FieldLayout
cpp/GeneratorBatchJob
cpp/GeneratorConfig
Expand Down Expand Up @@ -157,6 +160,10 @@ The high-level driver plus the tensor and device layer it runs on: integration,
cpp/Runtime
cpp/Sizes
cpp/StatusFile
cpp/StepChainResult
cpp/StepEvents
cpp/StepIntegral
cpp/StepSettings
cpp/SubprocessObservables
cpp/SubprocessSystArgs
cpp/SystematicsCalculator
Expand All @@ -171,6 +178,8 @@ The high-level driver plus the tensor and device layer it runs on: integration,
cpp/UnalignedRef
cpp/Variation
cpp/VegasGridOptimizer
cpp/WeightingGroup
cpp/WeightingPipeline
cpp/available_backends
cpp/compute_generation_batch_event_count
cpp/cpu_device
Expand All @@ -186,6 +195,8 @@ The high-level driver plus the tensor and device layer it runs on: integration,
cpp/set_simd_mode
cpp/supported_simd_modes
cpp/set_lib_path
cpp/weighting_groups_from_json
cpp/weighting_groups_to_json

Utilities
---------
Expand Down
Loading
Loading