builder
builder¶
import ampform.dynamics.builder
Build dynamics
with correct variable names and values.
- class TwoBodyKinematicVariableSet(incoming_state_mass: Symbol, outgoing_state_mass1: Symbol, outgoing_state_mass2: Symbol, helicity_theta: Symbol, helicity_phi: Symbol, angular_momentum: int | None = None)[source]¶
Bases:
object
Data container for the essential variables of a two-body decay.
This data container is inserted into a
ResonanceDynamicsBuilder
, so that it can build some lineshape expression from thedynamics
module. It also allows to insert custom dynamics into the amplitude model.
- BuilderReturnType¶
Type that a
ResonanceDynamicsBuilder
should return.The first element in this
tuple
is thesympy.Expr
that describes the dynamics for the resonance. The second element are suggested parameter values (seeparameter_defaults
) for theSymbol
instances that appear in thesympy.Expr
.
- class ResonanceDynamicsBuilder(*args, **kwargs)[source]¶
Bases:
Protocol
Protocol that is used by
set_dynamics
.Follow this
Protocol
when defining a builder function that is to be used byset_dynamics
. For an example, see the source codecreate_relativistic_breit_wigner
, which creates arelativistic_breit_wigner
.See also
- __call__(resonance: Particle, variable_pool: TwoBodyKinematicVariableSet) BuilderReturnType [source]¶
Formulate a dynamics
Expr
for this resonance.
- create_non_dynamic(resonance: Particle, variable_pool: TwoBodyKinematicVariableSet) BuilderReturnType [source]¶
- create_non_dynamic_with_ff(resonance: Particle, variable_pool: TwoBodyKinematicVariableSet) BuilderReturnType [source]¶
Generate (only) a Blatt-Weisskopf form factor for a two-body decay.
Returns the
sqrt
of aBlattWeisskopfSquared
.
- class RelativisticBreitWignerBuilder(form_factor: bool = False, energy_dependent_width: bool = False, phsp_factor: PhaseSpaceFactorProtocol | None = None)[source]¶
Bases:
object
Factory for building relativistic Breit-Wigner expressions.
The
__call__()
of this builder complies with theResonanceDynamicsBuilder
, so instances of this class can be used inset_dynamics()
.- Parameters
form_factor – Formulate a relativistic Breit-Wigner function multiplied by a Blatt-Weisskopf form factor, see Equation (1).
energy_dependent_width – Use an
EnergyDependentWidth
in the denominator of the Breit-Wigner. See PDG2020, §Resonances, p.6, Equation (49.21).phsp_factor – A class that complies with the
PhaseSpaceFactorProtocol
that is used in the energy-dependent width. Defaults toPhaseSpaceFactor
.
- __call__(resonance: Particle, variable_pool: TwoBodyKinematicVariableSet) BuilderReturnType [source]¶
Formulate a relativistic Breit-Wigner for this resonance.
- create_relativistic_breit_wigner(resonance: Particle, variable_pool: TwoBodyKinematicVariableSet) BuilderReturnType ¶
Create a
relativistic_breit_wigner
for a two-body decay.This is a convenience function for a
RelativisticBreitWignerBuilder
_without_ form factor.
- create_relativistic_breit_wigner_with_ff(resonance: Particle, variable_pool: TwoBodyKinematicVariableSet) BuilderReturnType ¶
Create a
relativistic_breit_wigner_with_ff
for a two-body decay.This is a convenience function for a
RelativisticBreitWignerBuilder
_with_ form factor and a ‘normal’PhaseSpaceFactor
.
- create_analytic_breit_wigner(resonance: Particle, variable_pool: TwoBodyKinematicVariableSet) BuilderReturnType ¶
Create a
relativistic_breit_wigner_with_ff
with analytic continuation.This is a convenience function for a
RelativisticBreitWignerBuilder
_with_ form factor and a ‘analytic’ phase space factor (seePhaseSpaceFactorAnalytic
).See also