-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add photoionization plugins #52
Merged
Merged
Changes from all commits
Commits
Show all changes
98 commits
Select commit
Hold shift + click to select a range
7afe5e0
Add general structure
HenningSE d87c1dd
Merge branch 'main' into more_afterpulses
HenningSE 88b87de
Rename
HenningSE 719b996
Add draft for PhotoElectricElectrons plugin
HenningSE 1de091c
Add photo ionization electrons plugin + Bugfix
HenningSE a73a18d
Multiple Updates
HenningSE 75f3ca6
update contexts, rename things, merger plugins
HenningSE 6178808
Datakind hacks
HenningSE 488b9de
Update README.md
HenningSE 059b8ba
Fix the photo ionization code
HenningSE 97fb83a
Merge branch 'more_afterpulses' of https://github.com/XENONnT/fuse in…
HenningSE 8ecbc7e
Use binomial process in electron drift
HenningSE a7fba74
Add Logger for delayed electron simulations
HenningSE 412a45f
Add delayed electrons tests
HenningSE b5416b5
Merge branch 'main' into more_afterpulses
HenningSE 91cb377
Fixing many bugs
HenningSE 29e0e95
Propagate cluster_id to interactions_in_roi
HenningSE 57527ea
Save cluster_id instead of oder_index for indiv. electrons
HenningSE aaba4d7
Update SecondaryScintillation plugin to not rely on order of individu…
HenningSE d54e8cc
Use cluster_id in S2PhotonPropagationBase
HenningSE 94b3d64
BugFix
HenningSE 284312f
Add MicrophysicsSummaryMerger
HenningSE 665aaf3
Lots of bugfixing
HenningSE 82915e9
Merge branch 'main' into more_afterpulses
HenningSE 5c0661f
Take normalized hist
HenningSE 9d0dc90
Merge branch 'more_afterpulses' of https://github.com/XENONnT/fuse in…
HenningSE ad3fd00
Bugfix and cleanup
HenningSE 077de4f
Remove PhotoElectricElectrons
HenningSE 36a0830
Always save photo_ionization_electrons
HenningSE 30336b8
Update the plugin structure figure
HenningSE 38324cd
Small update to the readme
HenningSE 5db7822
Merge branch 'main' into more_afterpulses
HenningSE 8bef585
Merge branch 'main' into more_afterpulses
HenningSE c53dfa6
Update PI tests
HenningSE 9218f00
Merge branch 'main' into more_afterpulses
dachengx 7c5b1d0
Use base plugin for delayed electrons
HenningSE 729870e
Merge branch 'main' into more_afterpulses
HenningSE 69f9a9c
Merge branch 'main' into more_afterpulses
HenningSE 40b1274
Scale the PI strength
HenningSE f6070ff
Merge branch 'more_afterpulses' of https://github.com/XENONnT/fuse in…
HenningSE e759aeb
Merge branch 'main' into more_afterpulses
HenningSE bfdea39
Code speedup
HenningSE f2093c7
Merge branch 'more_afterpulses' of https://github.com/XENONnT/fuse in…
HenningSE 9439f05
Merge branch 'main' into more_afterpulses
HenningSE 1c65754
Merge branch 'main' into more_afterpulses
HenningSE 71e9407
Merge branch 'main' into more_afterpulses
HenningSE c2f6325
Bugfix
HenningSE 207ba89
Update find_cluster.py
HenningSE 19d71b2
Update FindCluster.rst
HenningSE 3597a01
Merge branch 'main' into more_afterpulses
HenningSE 2ae9e73
Add cluster_id
HenningSE bf51063
Numba problems force me to go to float32 for electric field
HenningSE 672ac8b
Rename t to time
HenningSE 335b94a
Missing field rename
HenningSE a3d42cf
Merge branch 'main' into more_afterpulses
HenningSE 1ecf614
Merge branch 'main' into more_afterpulses
HenningSE 8a0322b
Get PI from xedocs
HenningSE e00a742
Merge branch 'main' into more_afterpulses
HenningSE f3d27ce
Merge branch 'main' into more_afterpulses
HenningSE 3b0d74f
Test Bugfixing
HenningSE d3022f4
Fix cluster id for delayed electrons
HenningSE a6b653c
Add empty s1 photon hits for delayed electrons (needed for truth)
HenningSE ae3e18d
update PeakTruth
HenningSE ddf8f01
Add test for delayed_s1_photons
HenningSE 72e9a0d
revert some messed up changes
HenningSE 0d82568
follow up on the last commit
HenningSE e35bb23
Merge branch 'main' into more_afterpulses
HenningSE cdf3bf5
Merge branch 'main' into more_afterpulses
HenningSE a174e97
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 920b7a7
cleanup
HenningSE e722188
fixing
HenningSE dce96fd
fixing
HenningSE 2c20888
Merge branch 'more_afterpulses' of https://github.com/XENONnT/fuse in…
HenningSE 55edc31
Add logging and cleanup
HenningSE 3ad2809
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] f16d849
remove tuple
HenningSE 9cd2968
Merge branch 'more_afterpulses' of https://github.com/XENONnT/fuse in…
HenningSE 30d0a4b
Cleanup
HenningSE b3b64d0
Merge branch 'main' into more_afterpulses
HenningSE 599279d
Modify dtype of csv input
HenningSE 056274d
Merge branch 'main' into more_afterpulses
HenningSE f93dc0c
Merge branch 'main' into more_afterpulses
HenningSE 3f6ed89
Merge branch 'main' into more_afterpulses
HenningSE 2ae7533
Merge branch 'main' into more_afterpulses
ramirezdiego 09b4fb1
Disable electron lifetime for delayed electrons.
HenningSE d811e72
Get PI delay times from truncated exponential distribution
HenningSE 8c1c58c
Merge branch 'main' into more_afterpulses
HenningSE 6c51d83
exclude PI photons from contributing to raw_area
HenningSE 45ec663
Add number of PI photons in peak
HenningSE 8066304
Merge branch 'main' into more_afterpulses
HenningSE d71cdd8
Take PI settings from config file
HenningSE c394270
Update figures
HenningSE 07c5246
Add documentation page for PhotoIonizationElectrons
HenningSE 80e90fe
Merge branch 'main' into more_afterpulses
HenningSE 28a7993
Merge branch 'main' into more_afterpulses
HenningSE b63ab8e
Add delayed electrons plugins to documentation
HenningSE 51eb7d9
Bugfix
HenningSE df9836c
Merge branch 'main' into more_afterpulses
ramirezdiego File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
fuse/plugins/detector_physics/delayed_electrons/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from . import delayed_electrons_drift | ||
from .delayed_electrons_drift import * | ||
|
||
from . import delayed_electrons_extraction | ||
from .delayed_electrons_extraction import * | ||
|
||
from . import delayed_electrons_timing | ||
from .delayed_electrons_timing import * | ||
|
||
from . import delayed_electrons_secondary_scintillation | ||
from .delayed_electrons_secondary_scintillation import * | ||
|
||
from . import photo_ionization_electrons | ||
from .photo_ionization_electrons import * | ||
|
||
from . import delayed_electrons_merger | ||
from .delayed_electrons_merger import * | ||
|
||
from . import delayed_electrons_s1photonhits | ||
from .delayed_electrons_s1photonhits import * |
35 changes: 35 additions & 0 deletions
35
fuse/plugins/detector_physics/delayed_electrons/delayed_electrons_drift.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import strax | ||
import straxen | ||
import logging | ||
from ..electron_drift import ElectronDrift | ||
|
||
export, __all__ = strax.exporter() | ||
|
||
logging.basicConfig(handlers=[logging.StreamHandler()]) | ||
log = logging.getLogger("fuse.detector_physics.delayed_electrons.delayed_electrons_drift") | ||
|
||
|
||
@export | ||
class DelayedElectronsDrift(ElectronDrift): | ||
"""This class is used to simulate the drift of electrons from the sources | ||
of electron afterpulses.""" | ||
|
||
__version__ = "0.0.2" | ||
|
||
child_plugin = True | ||
|
||
depends_on = "photo_ionization_electrons" | ||
provides = "drifted_delayed_electrons" | ||
data_kind = "delayed_interactions_in_roi" | ||
|
||
electron_lifetime_liquid_delayed_electrons = straxen.URLConfig( | ||
default=0, | ||
track=True, | ||
type=(int, float), | ||
child_option=True, | ||
parent_option_name="electron_lifetime_liquid", | ||
help="Electron lifetime in liquid xenon [ns] for delayed electrons", | ||
) | ||
|
||
def compute(self, delayed_interactions_in_roi): | ||
return super().compute(interactions_in_roi=delayed_interactions_in_roi) |
25 changes: 25 additions & 0 deletions
25
fuse/plugins/detector_physics/delayed_electrons/delayed_electrons_extraction.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import strax | ||
import logging | ||
from ..electron_extraction import ElectronExtraction | ||
|
||
export, __all__ = strax.exporter() | ||
|
||
logging.basicConfig(handlers=[logging.StreamHandler()]) | ||
log = logging.getLogger("fuse.detector_physics.delayed_electrons.delayed_electrons_extraction") | ||
|
||
|
||
@export | ||
class DelayedElectronsExtraction(ElectronExtraction): | ||
"""This class is used to simulate the extraction of electrons from the | ||
sources of electron afterpulses.""" | ||
|
||
__version__ = "0.0.1" | ||
|
||
child_plugin = True | ||
|
||
depends_on = ("photo_ionization_electrons", "drifted_delayed_electrons") | ||
provides = "extracted_delayed_electrons" | ||
data_kind = "delayed_interactions_in_roi" | ||
|
||
def compute(self, delayed_interactions_in_roi): | ||
return super().compute(interactions_in_roi=delayed_interactions_in_roi) |
89 changes: 89 additions & 0 deletions
89
fuse/plugins/detector_physics/delayed_electrons/delayed_electrons_merger.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import strax | ||
|
||
from ....vertical_merger_plugin import VerticalMergerPlugin | ||
|
||
export, __all__ = strax.exporter() | ||
|
||
|
||
@export | ||
class DriftedElectronsMerger(VerticalMergerPlugin): | ||
"""Plugin which concatenates the output of the regular and delayed electron | ||
drift plugins.""" | ||
|
||
depends_on = ("drifted_electrons", "drifted_delayed_electrons") | ||
|
||
provides = "merged_drifted_electrons" | ||
data_kind = "interactions_in_roi" | ||
__version__ = "0.0.1" | ||
|
||
|
||
@export | ||
class ExtractedElectronsMerger(VerticalMergerPlugin): | ||
"""Plugin which concatenates the output of the regular and delayed electron | ||
extraction plugins.""" | ||
|
||
depends_on = ("extracted_electrons", "extracted_delayed_electrons") | ||
|
||
provides = "merged_extracted_electrons" | ||
data_kind = "interactions_in_roi" | ||
__version__ = "0.0.1" | ||
|
||
|
||
@export | ||
class SecondaryScintillationPhotonsMerger(VerticalMergerPlugin): | ||
"""Plugin which concatenates the output of the regular and delayed electron | ||
secondary scintillation plugins.""" | ||
|
||
depends_on = ("s2_photons", "delayed_electrons_s2_photons") | ||
|
||
provides = "merged_s2_photons" | ||
data_kind = "individual_electrons" | ||
__version__ = "0.0.1" | ||
|
||
|
||
@export | ||
class SecondaryScintillationPhotonSumMerger(VerticalMergerPlugin): | ||
"""Plugin which concatenates the output of the regular and delayed electron | ||
secondary scintillation plugins.""" | ||
|
||
depends_on = ("s2_photons_sum", "delayed_electrons_s2_photons_sum") | ||
|
||
provides = "merged_s2_photons_sum" | ||
data_kind = "interactions_in_roi" | ||
__version__ = "0.0.1" | ||
|
||
|
||
@export | ||
class ElectronTimingMerger(VerticalMergerPlugin): | ||
"""Plugin which concatenates the output of the regular and delayed electron | ||
timing plugins.""" | ||
|
||
depends_on = ("electron_time", "delayed_electrons_time") | ||
|
||
provides = "merged_electron_time" | ||
data_kind = "individual_electrons" | ||
__version__ = "0.0.1" | ||
|
||
|
||
@export | ||
class MicrophysicsSummaryMerger(VerticalMergerPlugin): | ||
"""Plugin which concatenates the output of the regular and delayed electron | ||
secondary scintillation plugins.""" | ||
|
||
depends_on = ("microphysics_summary", "photo_ionization_electrons") | ||
|
||
provides = "merged_microphysics_summary" | ||
data_kind = "interactions_in_roi" | ||
__version__ = "0.0.1" | ||
|
||
|
||
@export | ||
class S1PhotonHitsMerger(VerticalMergerPlugin): | ||
"""Plugin which concatenates the output of the regular and delayed s1 | ||
photon hits plugins.""" | ||
|
||
depends_on = ("s1_photons", "delayed_s1_photons") | ||
|
||
provides = "merged_s1_photons" | ||
data_kind = "interactions_in_roi" | ||
__version__ = "0.0.1" |
32 changes: 32 additions & 0 deletions
32
fuse/plugins/detector_physics/delayed_electrons/delayed_electrons_s1photonhits.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import strax | ||
import logging | ||
import numpy as np | ||
|
||
from ....plugin import FuseBasePlugin | ||
|
||
export, __all__ = strax.exporter() | ||
|
||
logging.basicConfig(handlers=[logging.StreamHandler()]) | ||
log = logging.getLogger("fuse.detector_physics.delayed_electrons.delayed_electrons_s1photonhits") | ||
|
||
|
||
@export | ||
class S1PhotonHitsEmpty(FuseBasePlugin): | ||
"""Plugin to return zeros for all S1 photon hits of delayed electrons.""" | ||
|
||
__version__ = "0.0.1" | ||
|
||
depends_on = "photo_ionization_electrons" | ||
provides = "delayed_s1_photons" | ||
data_kind = "delayed_interactions_in_roi" | ||
|
||
dtype = [ | ||
(("Number detected S1 photons", "n_s1_photon_hits"), np.int32), | ||
] | ||
dtype = dtype + strax.time_fields | ||
|
||
def compute(self, delayed_interactions_in_roi): | ||
result = np.zeros(len(delayed_interactions_in_roi), dtype=self.dtype) | ||
result["time"] = delayed_interactions_in_roi["time"] | ||
result["endtime"] = delayed_interactions_in_roi["endtime"] | ||
return result |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why
photoionization_modifier
is special?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dachengx, this part is a little trick to properly set the
photoionization_modifier
config argument. The problem is that it is not written to the context config byst.apply_xedocs_configs(version=corrections_version)
(here). As as result theplugin.run_id
would not be overwritten by thecorrections_run_id
here.I solved this problem by explicitly writing this config argument to the context config in the
set_simulation_config_file
function as we loop over all plugins and plugin configs anyways so we will also encounter thephotoionization_modifier
there. As it is now in the context config,plugin.run_id
can now be changed tocorrections_run_id
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this be solved if the
photoionization_modifier
is added to the global config: https://github.com/XENONnT/corrections/blob/92aa12f5fbae460c990e04bc571af0df3f67e68d/XENONnT/global_versions/global_v14.json?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so yes. Then
st.apply_xedocs_configs(version=corrections_version)
should already take care of this.