phasespace#
import tensorwaves.data.phasespace
Implementations of a DataGenerator for four-momentum samples.
- class TFPhaseSpaceGenerator(initial_state_mass: float, final_state_masses: Mapping[int, float], bunch_size: int = 50000, *, adaptive_max_weight: bool = False)[source]#
Bases:
DataGeneratorImplements a phase space generator using tensorflow.
- Parameters:
initial_state_mass – Mass of the decaying state.
final_state_masses – Masses keyed by final-state ID.
bunch_size – Number of candidates generated per hit-and-miss iteration.
adaptive_max_weight – Perform the hit-and-miss step against an estimate of the maximum weight instead of against the upper bound of the weights that
phasespaceguarantees. This bound is much larger than the weights that actually occur, especially for many final state particles, so the estimate accepts far more events per bunch. The maximum is estimated from the generated bunches with a margin of 5%. If a bunch contains a weight above the current estimate, the estimate is raised and the sample is generated anew, like inIntensityDistributionGenerator. The generated distribution stays the same, but the events differ from those that are generated without this option for the same seed. See Phase space generators.
- generate(size: int, rng: RealNumberGenerator) DataSample[source]#
Generate a
DataSampleof phase space four-momenta.- Returns:
A
DataSampleof four-momenta arrays of shape \(n \times 4\).
See also
- class TFWeightedPhaseSpaceGenerator(initial_state_mass: float, final_state_masses: Mapping[int, float])[source]#
Bases:
DataGeneratorImplements a phase space generator with weights using tensorflow.
The weights are provided in the returned
DataSampleunder the key"weights".- Parameters:
initial_state_mass – Mass of the decaying state.
final_state_masses – Masses keyed by final-state ID.
See also
- generate(size: int, rng: RealNumberGenerator) DataSample[source]#
Generate a
DataSampleof phase space four-momenta with weights.- Returns:
A
tupleof aDataSample(four-momenta) with an event-wise sequence of weights. The four-momenta are arrays of shape \(n \times 4\).