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

Creating extensions #63

Merged
merged 10 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,18 @@ Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
TypedTables = "9d95f2ec-7b3d-5a63-8d20-e2491e220bb9"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[weakdeps]
MJDSigGen = "0b925020-e659-485c-98dd-189633cb4be4"

[extensions]
LegendGeSimExt = "MJDSigGen"

[compat]
ArgCheck = "1, 2"
ArraysOfArrays = "0.5, 0.6"
CurveFit = "0.3, 0.5, 0.6"
DSP = "0.7"
DelimitedFiles = "1"
DelimitedFiles = " 1"
giriPHM marked this conversation as resolved.
Show resolved Hide resolved
Distributions = "0.23, 0.24, 0.25"
ElasticArrays = "1"
HDF5 = "0.15, 0.16, 0.17"
Expand All @@ -57,22 +63,22 @@ LegendHDF5IO = "0.1"
LegendTextIO = "0.1"
LsqFit = "0.13, 0.14, 0.15"
MJDSigGen = "0.2"
Parameters = "0.12"
Parameters = "0.12, 0.13"
Polynomials = "2, 3, 4"
PropDicts = "0.2"
RadiationDetectorDSP = "0.2.1"
RadiationDetectorSignals = "0.3"
RadiationSpectra = "0.5"
Random123 = "1.2"
Random123 = "1.2, 1.7" # Compatible with 1.7?
giriPHM marked this conversation as resolved.
Show resolved Hide resolved
RecipesBase = "1"
Requires = "0.5, 1"
SignalAnalysis = "0.4, 0.5, 0.6, 0.7, 0.8, 0.9"
SolidStateDetectors = "0.10.3"
SolidStateDetectors = "0.10.5"
giriPHM marked this conversation as resolved.
Show resolved Hide resolved
StaticArrays = "0.12, 1"
Statistics = "1"
StatsBase = "0.32, 0.33, 0.34"
StructArrays = "0.5, 0.6"
Tables = "1"
TypedTables = "1.2"
TypedTables = "1.2, 1.4" #Compatible with 1.4.6?
giriPHM marked this conversation as resolved.
Show resolved Hide resolved
Unitful = "1"
julia = "1.10"
julia = "1.11"
giriPHM marked this conversation as resolved.
Show resolved Hide resolved
27 changes: 0 additions & 27 deletions ext/LegendGeSimExt.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
module LegendGeSimExt
#using MJDSigGen: SiggenSimulator
#@info "Error here"
using LegendGeSim
#@info "Error"
using PropDicts
#@info "Error_prop"
using LegendGeSim
#@info "Error_Lgsim"
using LegendGeSim: Environment
#@info "le_env"
#using MJDSigGen: SiggenSimulator
using MJDSigGen
using MJDSigGen: SigGenSetup
#@info "Error_mjd"
#using LegendGeSim: PSSimulator
using LegendGeSim: SiggenSimulator
using ArgCheck
using ArraysOfArrays
Expand Down Expand Up @@ -54,20 +45,10 @@ import LsqFit

using SolidStateDetectors: ConstructiveSolidGeometry as CSG

#abstract type PSSimulator end


#include("legend_detector_to_siggen.jl")
#@info "Here_then"
#include("mjdsiggen_utils.jl")
#@info "Error_after_files"



####################################
### FieldGen
####################################
@info "27"
"""
SiggeSimulator(sim_conf::PropDict)

Expand Down Expand Up @@ -166,7 +147,6 @@ else
#...do nothing, siggen will later read the files based on the generated conifg
@info "Cached simulation found. Reading cached fields from $fieldgen_wp_name"
end
@info "73"
# a SigGenSetup object
SigGenSetup(siggen_config_name)
end
Expand Down Expand Up @@ -215,7 +195,6 @@ function LegendGeSim.impurity_density_model(meta::PropDict, crystal_metadata::Pr
imp_filename, L - det_z0
end

@info "123"
"""
Simulation method: siggen
"""
Expand All @@ -224,9 +203,7 @@ Simulation method: siggen

function LegendGeSim.simulate_waveforms(stp_events::Table, detector::SigGenSetup, ::SiggenSimulator)
T = Float32 # This should be somehow defined and be passed properly
println("127")
@info("~.~.~ Siggen")
@info "129"

nevents = length(stp_events)
wf_array = Array{RDWaveform}(undef, nevents)
Expand Down Expand Up @@ -272,7 +249,6 @@ function LegendGeSim.simulate_waveforms(stp_events::Table, detector::SigGenSetup
end


#@info "252"

"""
simulate_wf(pos, edep, siggen_setup)
Expand Down Expand Up @@ -310,7 +286,6 @@ function LegendGeSim.capacitance_matrix(sim::SigGenSetup)
[c -c; -c c]
end
#export capacitance_matrix
#@info "288"
#legend_detector_to_siggen
function siggen_config(meta::PropDict, env::Environment, simulator::SiggenSimulator; overwrite::Bool=false)
# ----------------------------------------------------------------------------
Expand Down Expand Up @@ -439,7 +414,6 @@ function siggen_config(meta::PropDict, env::Environment, simulator::SiggenSimula
# (currently kinda redundant but that's because we have no idea what's gonna happen later)
sig_conf_name, fieldgen_names["wp_name"]
end
#@info "417"

"""
meta2siggen(meta, env)
Expand Down Expand Up @@ -559,7 +533,6 @@ function meta2siggen(meta::PropDict, env::Environment)
end

#mjdsiggen_utils.jl
#@info "537"

function SolidStateDetectors.ElectricPotential(sim::SigGenSetup)
E_pot, W_pot, E_abs, E_r, E_z = LegendGeSim.MJDSigGen.read_fields(sim);
giriPHM marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Loading