builder
builder¶
import ampform.dynamics.builder
Build dynamics
with correct variable names and values.
- 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
.alias of
Tuple
[sympy.core.expr.Expr
,Dict
[sympy.core.symbol.Symbol
,float
]]
- class RelativisticBreitWignerBuilder(form_factor: bool = False, phsp_factor: Optional[PhaseSpaceFactorProtocol] = 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 with form factor, using
relativistic_breit_wigner_with_ff()
. If set toFalse
,__call__()
builds arelativistic_breit_wigner()
(_without_ form factor).phsp_factor – A class that complies with the
PhaseSpaceFactorProtocol
. Defaults toPhaseSpaceFactor
.
- __call__(resonance: Particle, variable_pool: TwoBodyKinematicVariableSet) BuilderReturnType [source]¶
Formulate a relativistic Breit-Wigner for this resonance.
- class ResonanceDynamicsBuilder(*args, **kwds)[source]¶
Bases:
typing_extensions.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.
- class TwoBodyKinematicVariableSet(incoming_state_mass: Symbol, outgoing_state_mass1: Symbol, outgoing_state_mass2: Symbol, helicity_theta: Symbol, helicity_phi: Symbol, angular_momentum: Optional[int] = 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.
- 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
- 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
.
- 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
.