Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add kaon hypothesis to ParticleHypothesis #2990

Merged
merged 9 commits into from
Feb 29, 2024

Conversation

plariono
Copy link
Contributor

@plariono plariono commented Feb 26, 2024

This adds the kaon hypothesis such that there's no need to define it by hand.

Currently:

kaon = acts.ParticleHypothesis(321, 0.493677, 1)
>>> import acts
>>> kaon = acts.ParticleHypothesis(321, 0.493677, 1)
>>> kaon.absolutePdg()
<PdgParticle.???: 321>
>>> 

@github-actions github-actions bot added Component - Core Affects the Core module Component - Examples Affects the Examples module Event Data Model labels Feb 26, 2024
Copy link

codecov bot commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 48.69%. Comparing base (9854009) to head (3df842b).

Files Patch % Lines
Core/src/Definitions/ParticleData.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2990      +/-   ##
==========================================
- Coverage   48.70%   48.69%   -0.01%     
==========================================
  Files         493      493              
  Lines       28976    28978       +2     
  Branches    13798    13799       +1     
==========================================
  Hits        14112    14112              
- Misses       4935     4937       +2     
  Partials     9929     9929              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

plariono and others added 2 commits February 27, 2024 10:55
Correction

Co-authored-by: Andreas Stefl <stefl.andreas@gmail.com>
Core/include/Acts/Definitions/PdgParticle.hpp Outdated Show resolved Hide resolved
Core/include/Acts/EventData/ParticleHypothesis.hpp Outdated Show resolved Hide resolved
Core/include/Acts/EventData/ParticleHypothesis.hpp Outdated Show resolved Hide resolved
Examples/Python/src/Base.cpp Outdated Show resolved Hide resolved
Examples/Python/tests/test_event_data.py Outdated Show resolved Hide resolved
plariono and others added 3 commits February 27, 2024 11:35
@andiwand andiwand changed the title Feat: add kaon hypothesis feat: Add kaon hypothesis to ParticleHypothesis Feb 27, 2024
andiwand
andiwand previously approved these changes Feb 27, 2024
@paulgessinger paulgessinger added this to the next milestone Feb 27, 2024
@paulgessinger
Copy link
Member

Some test failures are still present here.

@plariono
Copy link
Contributor Author

@paulgessinger @andiwand can you suggest what should be done for these failed tests to get them passed?

@andiwand
Copy link
Contributor

@paulgessinger @andiwand can you suggest what should be done for these failed tests to get them passed?

>       assert str(kaon) == "ParticleHypothesis{absPdg=K, mass=0.493677, absCharge=1}"
E       AssertionError: assert 'ParticleHypo... absCharge=1}' == 'ParticleHypo... absCharge=1}'
E         
E         - ParticleHypothesis{absPdg=K, mass=0.493677, absCharge=1}
E         + ParticleHypothesis{absPdg=K+, mass=0.493677, absCharge=1}
E         ?                            +

it expects K+ instead of K

either you just change the assert or you specialize kaons here https://github.com/acts-project/acts/blob/main/Core/src/Definitions/ParticleData.cpp#L109

@plariono
Copy link
Contributor Author

@paulgessinger @andiwand can you suggest what should be done for these failed tests to get them passed?

>       assert str(kaon) == "ParticleHypothesis{absPdg=K, mass=0.493677, absCharge=1}"
E       AssertionError: assert 'ParticleHypo... absCharge=1}' == 'ParticleHypo... absCharge=1}'
E         
E         - ParticleHypothesis{absPdg=K, mass=0.493677, absCharge=1}
E         + ParticleHypothesis{absPdg=K+, mass=0.493677, absCharge=1}
E         ?                            +

it expects K+ instead of K

either you just change the assert or you specialize kaons here https://github.com/acts-project/acts/blob/main/Core/src/Definitions/ParticleData.cpp#L109

Thank you @andiwand, should be fixed now.

@andiwand
Copy link
Contributor

one more error popped up @plariono

    def test_pgd_particle():
>       assert len(acts.PdgParticle.__members__) == 17
E       AssertionError: assert 19 == 17
E        +  where 19 = len({'eAntiElectron': <PdgParticle.eAntiElectron: -11>, 'eAntiMuon': <PdgParticle.eAntiMuon: -13>, 'eAntiNeutron': <PdgParticle.eAntiNeutron: -2112>, 'eAntiProton': <PdgParticle.eAntiProton: -2212>, ...})
E        +    where {'eAntiElectron': <PdgParticle.eAntiElectron: -11>, 'eAntiMuon': <PdgParticle.eAntiMuon: -13>, 'eAntiNeutron': <PdgParticle.eAntiNeutron: -2112>, 'eAntiProton': <PdgParticle.eAntiProton: -2212>, ...} = <class 'acts.ActsPythonBindings.PdgParticle'>.__members__
E        +      where <class 'acts.ActsPythonBindings.PdgParticle'> = acts.PdgParticle

Examples/Python/tests/test_base.py:15: AssertionError
=========================== short test summary info ============================
FAILED Examples/Python/tests/test_base.py::test_pgd_particle - AssertionError: assert 19 == 17
 +  where 19 = len({'eAntiElectron': <PdgParticle.eAntiElectron: -11>, 'eAntiMuon': <PdgParticle.eAntiMuon: -13>, 'eAntiNeutron': <PdgParticle.eAntiNeutron: -2112>, 'eAntiProton': <PdgParticle.eAntiProton: -2212>, ...})
 +    where {'eAntiElectron': <PdgParticle.eAntiElectron: -11>, 'eAntiMuon': <PdgParticle.eAntiMuon: -13>, 'eAntiNeutron': <PdgParticle.eAntiNeutron: -2112>, 'eAntiProton': <PdgParticle.eAntiProton: -2212>, ...} = <class 'acts.ActsPythonBindings.PdgParticle'>.__members__
 +      where <class 'acts.ActsPythonBindings.PdgParticle'> = acts.PdgParticle

@kodiakhq kodiakhq bot merged commit 6c910b0 into acts-project:main Feb 29, 2024
54 checks passed
@acts-project-service acts-project-service added the Breaks Athena build This PR breaks the Athena build label Feb 29, 2024
@paulgessinger paulgessinger removed the Breaks Athena build This PR breaks the Athena build label Mar 5, 2024
@paulgessinger
Copy link
Member

paulgessinger commented Mar 5, 2024

Athena failure was unrelated. No action required.

@paulgessinger paulgessinger modified the milestones: next, v33.0.0 Mar 6, 2024
EleniXoch pushed a commit to EleniXoch/acts that referenced this pull request May 6, 2024
This adds the kaon hypothesis such that there's no need to define it by hand.

Currently:
```
kaon = acts.ParticleHypothesis(321, 0.493677, 1)
```

```
>>> import acts
>>> kaon = acts.ParticleHypothesis(321, 0.493677, 1)
>>> kaon.absolutePdg()
<PdgParticle.???: 321>
>>> 
```
asalzburger pushed a commit to asalzburger/acts that referenced this pull request May 21, 2024
This adds the kaon hypothesis such that there's no need to define it by hand.

Currently:
```
kaon = acts.ParticleHypothesis(321, 0.493677, 1)
```

```
>>> import acts
>>> kaon = acts.ParticleHypothesis(321, 0.493677, 1)
>>> kaon.absolutePdg()
<PdgParticle.???: 321>
>>> 
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - Core Affects the Core module Component - Examples Affects the Examples module Event Data Model
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants