-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add general structure * Add photo ionization electrons plugin * update contexts, rename things, merger plugins * Update README.md * Add Logger for delayed electron simulations * Add delayed electrons tests * Add MicrophysicsSummaryMerger * Always save photo_ionization_electrons * Update PI tests * Use base plugin for delayed electrons * Scale the PI strength * Code speedup * Get PI from xedocs * update PeakTruth * Add test for delayed_s1_photons * Disable electron lifetime for delayed electrons. * Get PI delay times from truncated exponential distribution * exclude PI photons from contributing to raw_area * Add number of PI photons in peak * Take PI settings from config file * Add documentation page for PhotoIonizationElectrons * Add delayed electrons plugins to documentation --------- Co-authored-by: Dacheng Xu <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Diego Ramírez García <[email protected]>
- Loading branch information
1 parent
10606a9
commit 8d4154d
Showing
21 changed files
with
768 additions
and
42 deletions.
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.