Skip to content

Commit

Permalink
fix: check for angular momentum in form factor (#230)
Browse files Browse the repository at this point in the history
* ci: compute full test coverage in tox job
  • Loading branch information
redeboer committed Feb 22, 2022
1 parent e7bef4f commit 0edbf98
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 66 deletions.
6 changes: 5 additions & 1 deletion src/ampform/helicity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,13 +746,17 @@ def _generate_kinematic_variable_set(
get_invariant_mass_label(transition.topology, decay.children[1].id),
real=True,
)
angular_momentum: Optional[int] = decay.interaction.l_magnitude
if angular_momentum is None:
if decay.parent.particle.spin.is_integer():
angular_momentum = int(decay.parent.particle.spin)
return TwoBodyKinematicVariableSet(
incoming_state_mass=inv_mass,
outgoing_state_mass1=child1_mass,
outgoing_state_mass2=child2_mass,
helicity_theta=theta,
helicity_phi=phi,
angular_momentum=decay.extract_angular_momentum(),
angular_momentum=angular_momentum,
)


Expand Down
12 changes: 0 additions & 12 deletions src/ampform/helicity/decay.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,6 @@ def from_transition(
interaction=transition.interactions[node_id],
)

def extract_angular_momentum(self) -> int:
angular_momentum = self.interaction.l_magnitude
if angular_momentum is not None:
return angular_momentum
spin_magnitude = self.parent.particle.spin
if spin_magnitude.is_integer():
return int(spin_magnitude)
raise ValueError(
f"Spin magnitude ({spin_magnitude}) of single particle state"
" cannot be used as the angular momentum as it is not integral!"
)


def get_helicity_info(
transition: StateTransition, node_id: int
Expand Down
52 changes: 0 additions & 52 deletions tests/helicity/test_decay.py

This file was deleted.

2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ description =
allowlist_externals =
pytest
commands =
pytest {posargs:tests} \
pytest {posargs:src tests} \
--cov-fail-under=75 \
--cov-report=html \
--cov-report=xml \
Expand Down

0 comments on commit 0edbf98

Please sign in to comment.