Amplitude modeling — decaylanguage.modeling#

A class representing a set of decays. Can be subclassed to provide custom converters.

class decaylanguage.modeling.amplitudechain.LS(*values)[source]#

Line shapes supported (currently)

RBW = 0#
GSpline = 1#
kMatrix = 2#
FOCUS = 3#
class decaylanguage.modeling.amplitudechain.AmplitudeChain(particle, daughters=NOTHING, lineshape=None, spinfactor=None, amp=1 + 0j, err=0j, fix=True, name=None)[source]#

This is a chain of decays (a “line”)

lineshape#
spinfactor#
amp#
err#
fix#
name#
all_particles: ClassVar[Particle] = {}#
final_particles: ClassVar[Particle] = {}#
cartesian = False#
classmethod from_matched_line(mat)[source]#

This operates on an already-matched line.

Parameters:

mat – The groupdict output of a match

Returns:

A new amplitude chain instance

expand_lines(linelist)[source]#

Take a DecayTree -> list of DecayTrees with each dead-end daughter expanded to every possible combination. (recursive)

property ls_enum#
property full_amp#
L_range(conserveParity=False)[source]#
property L#
classmethod read_ampgen(filename=None, text=None, grammar=None, parser='lalr', **kargs)[source]#

Read in an ampgen file

Parameters:
  • filename – Filename to read

  • text – Text to read (use instead of filename)

Returns:

array of AmplitudeChains, parameters, constants, event type

decaylanguage.modeling.ampgentransform.get_from_parser(parser, key)[source]#
class decaylanguage.modeling.ampgentransform.AmpGenTransformer(visit_tokens=True)[source]#
Parameters:

visit_tokens (bool)

constant(lines)[source]#
event_type(lines)[source]#
checkfixed(lines)[source]#
variable(lines)[source]#
cplx_decay_line(lines)[source]#
decay(lines)[source]#

This is a GooFit adaptor for amplitude chain.

class decaylanguage.modeling.goofit.SF_4Body(*values)[source]#
DtoPP1_PtoSP2_StoP3P4 = 0#
DtoPP1_PtoVP2_VtoP3P4 = 1#
DtoV1V2_V1toP1P2_V2toP3P4_S = 2#
DtoV1V2_V1toP1P2_V2toP3P4_P = 3#
DtoV1V2_V1toP1P2_V2toP3P4_D = 4#
DtoAP1_AtoVP2_VtoP3P4 = 5#
DtoAP1_AtoVP2Dwave_VtoP3P4 = 6#
DtoVS_VtoP1P2_StoP3P4 = 7#
DtoV1P1_V1toV2P2_V2toP3P4 = 8#
DtoAP1_AtoSP2_StoP3P4 = 9#
DtoTP1_TtoVP2_VtoP3P4 = 10#
FF_12_34_L1 = 11#
FF_12_34_L2 = 12#
FF_123_4_L1 = 13#
FF_123_4_L2 = 14#
ONE = 15#
decaylanguage.modeling.goofit.sprint(stype)[source]#
class decaylanguage.modeling.goofit.DecayStructure(*values)[source]#
FF_12_34 = 0#
FF_1_2_34 = 1#
class decaylanguage.modeling.goofit.GooFitChain(particle, daughters=NOTHING, lineshape=None, spinfactor=None, amp=1 + 0j, err=0j, fix=True, name=None)[source]#

Class to read an AmpGen options file and return GooFit C++ code.

pars: DataFrame = None#
consts: DataFrame = None#
classmethod make_intro(all_states)[source]#

Write out definitions of constant variables and vectors to hold intermediate values.

property decay_structure#

Determine if decay proceeds via two resonances or cascade decay.

property formfactor#

Return form factor based on relative angular momentum L.

spindetails()[source]#

Return string with spin structure.

property spinfactors#

Check if the spin structure is known and return it together with the form factor.

classmethod make_pars()[source]#

Write out the parameters used in the amplitudes.

make_lineshape(structure, masses)[source]#

Write out the line shapes. Each kind of line shape is treated separately.

make_spinfactor(final_states)[source]#

Write out the spin factor and push it to a vector.

make_linefactor(final_states)[source]#

Write out the line shape and push it to a vector.

make_amplitude(final_states)[source]#

Write out the amplitude and push it to a vector.

to_goofit(final_states)[source]#

Write the vectors with the spin factors, line shapes and amplitudes.

classmethod read_ampgen(*args, **kargs)[source]#

Read in an AmpGen file.

Returns:

Array of AmplitudeChains, event type.

class decaylanguage.modeling.goofit.GooFitPyChain(particle, daughters=NOTHING, lineshape=None, spinfactor=None, amp=1 + 0j, err=0j, fix=True, name=None)[source]#

Class to read an AmpGen options file and return a GooFit Python script.

pars: DataFrame = None#
consts: DataFrame = None#
classmethod make_intro(all_states)[source]#

Write out definitions of constant variables and lists to hold intermediate values.

property decay_structure#

Determine if the decay proceeds via two resonances or a cascade decay.

property formfactor#

Return the form factor based on relative angular momentum L.

spindetails()[source]#

Return string with spin structure.

property spinfactors#

Check if the spin structure is known and return it together with the form factor.

classmethod make_pars()[source]#

Write out the parameters used in the amplitudes.

make_lineshape(structure, masses)[source]#

Write out the line shapes. Each kind of line shape is treated separately.

make_spinfactor(final_states)[source]#

Write out the spin factor and push it to a vector.

make_linefactor(final_states)[source]#

Write out the line shape and push it to a vector.

make_amplitude(final_states)[source]#

Write out the amplitude and push it to a vector.

to_goofit(final_states)[source]#

Write the lists with the spin factors, line shapes and amplitudes.

classmethod read_ampgen(*args, **kargs)[source]#

Read in the AmpGen file.

Returns:

Array of AmplitudeChains, event type.

A general base class representing decays.

class decaylanguage.modeling.decay.ModelDecay(particle, daughters=NOTHING, name=None)[source]#

This describes a decay very generally, with search and print features. Subclassed for further usage.

particle#
daughters#
name#
is_vertex()[source]#
is_strong()[source]#
property vertexes#
property structure#

The structure of the decay chain, simplified to only final state particles

list_structure(final_states)[source]#

The structure in the form [(0,1,2,3)], where the dual-list is used for permutations for bose symmatrization. So for final_states=[a,b,c,c], [a,c,[c,b]] would be: [(0,2,3,1),(0,3,2,1)]