Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Ugly BBF quanta generator implementation #57

Merged
merged 8 commits into from
Aug 15, 2022
Merged

Ugly BBF quanta generator implementation #57

merged 8 commits into from
Aug 15, 2022

Conversation

terliuk
Copy link
Contributor

@terliuk terliuk commented Jul 5, 2022

What is the problem / what does the code in this PR do
Fast and dirty copy-paste of BBF model to use as quanta generator here. Not sure how good the model parameter now, so probably will need to be updated (should we make a versioned file similar to fax config?)

Can you give a minimal working example (or illustrate with a figure)?
just set --YieldModel bbf

Comment on lines +113 to +129
if args['yield'].lower()=="nest":
photons, electrons, excitons = epix.quanta_from_NEST(epix.awkward_to_flat_numpy(result['ed']),
epix.awkward_to_flat_numpy(result['nestid']),
epix.awkward_to_flat_numpy(result['e_field']),
epix.awkward_to_flat_numpy(result['A']),
epix.awkward_to_flat_numpy(result['Z']),
epix.awkward_to_flat_numpy(result['create_S2']),
density=epix.awkward_to_flat_numpy(result['xe_density']))
elif args['yield'].lower()=="bbf":
bbfyields=epix.BBF_quanta_generator()
photons, electrons, excitons = bbfyields.get_quanta_vectorized(
energy=epix.awkward_to_flat_numpy(result['ed']),
interaction=epix.awkward_to_flat_numpy(result['nestid']),
field=epix.awkward_to_flat_numpy(result['e_field'])
)
else:
raise RuntimeError("Unknown yield model: ", args['yields'])
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @terliuk thanks for starting to implement this to epix. I think it would keep the code a bit cleaner if we set up a single quanta generation class containing both the NEST and BBF option. In run_epix.py we would then just call this one class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suggest that we open a ticket and refactor it later, as I do not think that now making code nice is a priority, to be honest.

@zihaoxu98
Copy link
Contributor

I have updated the NR parameters from the newest AmBe fitting (note here). I think we might trust this emission model as the first "iteration"

Screen Shot 2022-08-10 at 9 57 50 AM

"fano" : 0.059
}
self.ERs = [7,8,11]
self.NRs = [0,1]
Copy link
Collaborator

Choose a reason for hiding this comment

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

@terliuk Is this a typo? Don't we have just 0 for NRs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

1 corresponds to WIMP interaction type in NEST, so I added it there.

@ramirezdiego ramirezdiego merged commit a5848fc into master Aug 15, 2022
@ramirezdiego ramirezdiego deleted the bbfyields branch August 15, 2022 09:17
ramirezdiego added a commit that referenced this pull request Sep 29, 2022
* Harmonize with the latest WFSim/epix versions
* Fix.
* Fix.
* Added a draft of the nT macro-clustering based on Micha's study
* Fixed some calculation parameters, added a new example notebook
* Add NR filter before quanta generation (#53)
* New branch version.
* NR-only cut string.
* Fixed import of the NR cut config parameter
* Fixed version label
* nr cut with ER component smaller than 32kev
* nr cut
* field
* change er threshold
* add nr to bin run_epix
* Add NR cut info to README
* store_true for NR cut

Co-authored-by: Pavel Kavrigin <[email protected]>
Co-authored-by: Shenyang Shi <[email protected]>
Co-authored-by: ramirezdiego <[email protected]>

* Update HISTORY for release
* Bump version: 0.2.2 → 0.3.0
* Set arg defaults (#55)
* set nr_only cut default to false
* add error for invalid input format
* Save primary particle position (#56)
* Added x_pri, y_pri, z_pri to the output
* Debugged x_pri, y_pri, z_pri recording
* WFSim requirements

Co-authored-by: Diego Ramírez García <[email protected]>

* Update HISTORY for release
* Bump version: 0.3.0 → 0.3.1
* Fix the notebook + fix cS2 calculation.
* First implementation of BBF quanta generator (#57)
* Added BBF yield quanta generation in epix
* Fix white space
* updated readme
* New intermediate results as defaults
* Nex/Ni ratio for NR is computed inside and does not need to be provided
* update nr parameters
* add back fixed parameters in BBF fitting
* Correct syntax

Co-authored-by: Zihao Xu <[email protected]>
Co-authored-by: Diego Ramírez García <[email protected]>

* Update HISTORY for release
* Bump version: 0.3.1 → 0.3.2
* fix conflict with master
* removing import simualtor for merging with master
* adding simualator to init

Co-authored-by: Pavel Kavrigin <[email protected]>
Co-authored-by: Shenyang Shi <[email protected]>
Co-authored-by: ramirezdiego <[email protected]>
Co-authored-by: Andrii Terliuk <[email protected]>
Co-authored-by: Zihao Xu <[email protected]>
Co-authored-by: Giovanni Volta <[email protected]>
ramirezdiego added a commit that referenced this pull request Mar 10, 2023
* Add NR filter before quanta generation (#53)

* New branch version.
* NR-only cut string.
* Fixed import of the NR cut config parameter
* Fixed version label
* nr cut with ER component smaller than 32kev
* nr cut
* field
* change er threshold
* add nr to bin run_epix
* Add NR cut info to README
* store_true for NR cut

Co-authored-by: Pavel Kavrigin <[email protected]>
Co-authored-by: Shenyang Shi <[email protected]>
Co-authored-by: ramirezdiego <[email protected]>

* Update HISTORY for release

* Bump version: 0.2.2 → 0.3.0

* Set arg defaults (#55)

* set nr_only cut default to false
* add error for invalid input format

* Save primary particle position (#56)

* Added x_pri, y_pri, z_pri to the output
* Debugged x_pri, y_pri, z_pri recording
* WFSim requirements

Co-authored-by: Diego Ramírez García <[email protected]>

* Update HISTORY for release

* Bump version: 0.3.0 → 0.3.1

* First implementation of BBF quanta generator (#57)

* Added BBF yield quanta generation in epix
* Fix white space
* updated readme
* New intermediate results as defaults
* Nex/Ni ratio for NR is computed inside and does not need to be provided
* update nr parameters
* add back fixed parameters in BBF fitting
* Correct syntax

Co-authored-by: Zihao Xu <[email protected]>
Co-authored-by: Diego Ramírez García <[email protected]>

* Update HISTORY for release

* Bump version: 0.3.1 → 0.3.2

* fix fast sim

* remove prints

* including Jaron ss-ms res

* commit berfore pull

* decision tree clustering working

* Specify not working numba in req. file (#62)

* fix loop for

* updated

* add prim position for materials and e dep from G4

* fixing bugs

* updates for the meeting

* a very bad example

* Update requirements.txt (#63)

* Bump version: 0.3.2 → 0.3.3

* Sync hystory

* Update python-publish.yml

* Add zenodo badge

* Set S2 clustering algorithm in the config

* New example notebook

---------

Co-authored-by: Pavel Kavrigin <[email protected]>
Co-authored-by: Pavel Kavrigin <[email protected]>
Co-authored-by: Shenyang Shi <[email protected]>
Co-authored-by: ramirezdiego <[email protected]>
Co-authored-by: Andrii Terliuk <[email protected]>
Co-authored-by: Zihao Xu <[email protected]>
Co-authored-by: Jaron Grigat <[email protected]>
Co-authored-by: Joran R. Angevaare <[email protected]>
Co-authored-by: Joran Angevaare <[email protected]>
Co-authored-by: PavelKavrigin <[email protected]>
Co-authored-by: Pavel Kavrigin <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants