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

Update yields and clustering #245

Merged
merged 46 commits into from
Sep 9, 2024
Merged

Update yields and clustering #245

merged 46 commits into from
Sep 9, 2024

Conversation

cfuselli
Copy link
Member

@cfuselli cfuselli commented Jul 3, 2024

Refactor NestYields

The plugin is refactored to be more flexible and easier to replace single functions in alternative plugins like BetaYields.
Now we define a NestCalc object in the setup to use it in different functions. We vectorise get_quanta instead of get_quanta_from_nest and we separate yields and quanta calculations into two different functions.
The content of the plugin itself and the results are unchanged.

BetaYield modifications

The plugin now intervenes only on the results of the yields from nest, but still makes use of the getQuanta function from NEST where all the statistical fluctuations ( fano factors etc ) and recombination fluctuations are calculated.

New option: tune NEST width parameters ( NestYields )

We now allow to specify the NRERWidthsParameter that are used by nest to do all the calculations on recombination fluctuation etc, to go from pure yield to actual number of quanta produced. These parameters can be tuned to match our data. Leave dict empty to use defaults from NEST.

New option: return directly yields model output

We add an option to produce simulations turning off all statistical fluctuations and recombination fluctuation.
Handy to study response decoupling from other effects. Use with the option return_yields_only.

New option: Beta yields threshold

Introduce an energy threshold for using the BetaYield ( like only >10keV ) - it's difficult to make a function that goes well also there, and nest gives good behavior at very low energies, setting manually the yields model to 0 at 0.3keV for LY and 0.01keV for CY. This is necessary for us to avoid having yield model going to infinity at these very low values. Use with the option beta_yields_threshold, default to 10keV.

New option: Fix electric field for yields ( BetaYields )

We can now decide to fix the value of electric field that is used to calculate the yields, separately for gammas and betas, using fix_beta_yield_field and fix_gamma_yield_field.

Improvement: Lineage clustering logic

We now add the case of a gamma-phot interaction happening inside a photo-absorption (also gamma-phot) cluster. This additional interactions could be due to x rays emitted.

Bug fix: Lineage cluster classify

It does not matter what the creaproc was, if it is gamma-phot, give gamma yields.

Bug fix: no electrons if create_S2 is False

In the implementation of BetaYields, the treatment of create_S2 was missing. Now we correctly set to zero the production of electrons in the plugin if the create_S2 of the interaction is set to False.

Removal: recombination fluctuation model

The current implementation does not support anymore an empirical data motivated model for recombination fluctuation, as this is now done with all the necessary details by the nest getQuanta function.

@cfuselli cfuselli requested a review from HenningSE July 3, 2024 09:12
@coveralls
Copy link

coveralls commented Jul 3, 2024

Pull Request Test Coverage Report for Build 9775201621

Details

  • 5 of 7 (71.43%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.007%) to 80.506%

Changes Missing Coverage Covered Lines Changed/Added Lines %
fuse/plugins/micro_physics/yields.py 5 7 71.43%
Totals Coverage Status
Change from base Build 9759413086: -0.007%
Covered Lines: 2610
Relevant Lines: 3242

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jul 3, 2024

Pull Request Test Coverage Report for Build 9778929894

Details

  • 7 of 9 (77.78%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.007%) to 80.506%

Changes Missing Coverage Covered Lines Changed/Added Lines %
fuse/plugins/micro_physics/yields.py 7 9 77.78%
Totals Coverage Status
Change from base Build 9759413086: -0.007%
Covered Lines: 2610
Relevant Lines: 3242

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jul 3, 2024

Pull Request Test Coverage Report for Build 9778929894

Details

  • 7 of 9 (77.78%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.001%) to 80.512%

Changes Missing Coverage Covered Lines Changed/Added Lines %
fuse/plugins/micro_physics/yields.py 7 9 77.78%
Totals Coverage Status
Change from base Build 9759413086: -0.001%
Covered Lines: 2611
Relevant Lines: 3243

💛 - Coveralls

@cfuselli cfuselli changed the title Add option to Nest yields to turn off recombination fluctuation Update Beta yields - enhancements and bugs Jul 3, 2024
@coveralls
Copy link

coveralls commented Jul 4, 2024

Pull Request Test Coverage Report for Build 9790254235

Details

  • 8 of 10 (80.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 80.518%

Changes Missing Coverage Covered Lines Changed/Added Lines %
fuse/plugins/micro_physics/yields.py 8 10 80.0%
Totals Coverage Status
Change from base Build 9759413086: 0.005%
Covered Lines: 2612
Relevant Lines: 3244

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jul 9, 2024

Pull Request Test Coverage Report for Build 10769196522

Details

  • 52 of 64 (81.25%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 80.449%

Changes Missing Coverage Covered Lines Changed/Added Lines %
fuse/plugins/micro_physics/lineage_cluster.py 19 21 90.48%
fuse/plugins/micro_physics/yields.py 33 43 76.74%
Totals Coverage Status
Change from base Build 10680392611: 0.4%
Covered Lines: 2543
Relevant Lines: 3161

💛 - Coveralls

@cfuselli cfuselli changed the title Update Beta yields - enhancements and bugs Update yields - enhancements and bug fixes Jul 9, 2024
Copy link
Collaborator

@HenningSE HenningSE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not much to add, the code is very clean. I will try to test is and if it runs fine I will approve.

fuse/plugins/micro_physics/yields.py Outdated Show resolved Hide resolved
HenningSE and others added 6 commits July 16, 2024 09:17
* add classification via secondaries

* remove prints

* make more gammas...

* v24

* v25

* v26

* v27

* v28

* v28

* v29

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove njit

* cleanup

* change logic for alpha and resolve comments pr

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove unnecessary beta classification

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* dietrofront conversion electrons

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@ramirezdiego ramirezdiego self-requested a review September 3, 2024 10:07
@ramirezdiego
Copy link
Collaborator

Ciao @cfuselli, when you find some time, could you update the topmost description of your PR to account for the recent changes and the merged parallel branch? Thanks for the good work!

Copy link
Collaborator

@HenningSE HenningSE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice PR, thank you @cfuselli and @michaweiss89! I would like to wait for @ramirezdiego to have a last look and then we can merge

@HenningSE HenningSE merged commit 5923e2f into main Sep 9, 2024
4 checks passed
@HenningSE HenningSE deleted the yields-no-rf branch September 9, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants