Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
225 commits
Select commit Hold shift + click to select a range
0b00553
fixed gas_scatter_proportion tested
casesyh Jun 26, 2020
9bf9ca2
add chi2 calculation
casesyh Jul 8, 2020
bb0bc61
fix the checking of scatter spectra file
casesyh Jul 11, 2020
fab92a7
fix the checking of scatter spectra file
casesyh Jul 11, 2020
c173168
internal config error
casesyh Jul 11, 2020
fa62da5
fix magnetic field mismatch between notebook and mermithid result
casesyh Aug 20, 2020
96f1259
add radiation loss
casesyh Sep 3, 2020
a27dc40
check in before adding file for composite trap fitting
casesyh Sep 9, 2020
021156b
composite gaussian resolution function implemented
casesyh Sep 10, 2020
6727ea2
add poisson chi2
casesyh Sep 15, 2020
5a8fae7
update KrComplexLineShape to use simulated resolution for fake data g…
casesyh Sep 16, 2020
69617b9
add convolve_ins_resolution
casesyh Sep 17, 2020
6ac5ac1
resolve probabilities containing NaN
casesyh Sep 23, 2020
d5d090a
testing stan analysis test scripts in termite
casesyh Sep 27, 2020
a582ef7
use termite script for testing
casesyh Sep 27, 2020
e04a4f3
update the files
casesyh Sep 28, 2020
be09e5a
delete configuration for magnetic field
casesyh Sep 28, 2020
5825a96
make path_to_ins_resolution_data_txt configurable in fake_data_stan_a…
casesyh Oct 1, 2020
352c672
test resolution function configurable
casesyh Oct 5, 2020
d5ddea3
Loading/using simulated resolution file
taliaweiss Oct 9, 2020
1494fd0
Adopting YuHao's simulated res file naming
taliaweiss Oct 9, 2020
186ee0f
Sample simulated resolution counts rates to account for errors
taliaweiss Oct 9, 2020
10c08f3
add MultiGAsComplexLineShape.py
casesyh Oct 18, 2020
7c013dc
np.random in convolve_ins_resolution
casesyh Oct 18, 2020
cc4f411
update convolve_ins_resolution_combining_four_trap
casesyh Oct 19, 2020
bd27aaa
update convolve_ins_resolution_combining_four_trap
casesyh Oct 20, 2020
acf830a
started adding new options re ins resolution
taliaweiss Oct 20, 2020
5fd5dde
Merge branch 'simulated_ins_resolution_in_fake_data_generator' of htt…
taliaweiss Oct 20, 2020
3231065
add dirac peak option to every make_spectrum
casesyh Oct 20, 2020
0d6cd30
change fix_ftc to use_simulated_inst_reso
casesyh Oct 20, 2020
33dece6
add configuration use_combined_four_trap_inst_reso
casesyh Oct 20, 2020
5474e89
add configuration use_combined_four_trap_inst_reso in FakeDataGenerat…
casesyh Oct 20, 2020
a9b1ac7
Continued YuHao's work adding trap combining/error sampling
taliaweiss Oct 20, 2020
ab5ecc1
Made my naming consistent with YuHao's
taliaweiss Oct 20, 2020
d3496c9
Set radiation loss to True by default
taliaweiss Oct 20, 2020
673bd51
add base_shape configuration to multi gas line shape processor
casesyh Oct 20, 2020
c03617e
Make B-field fixed input for fake data gen
taliaweiss Oct 20, 2020
e0693de
Merge branch 'simulated_ins_resolution_in_fake_data_generator' of htt…
taliaweiss Oct 20, 2020
726b88d
Added missing commas
taliaweiss Oct 20, 2020
fd5eead
put emitted_peak = self.base_shape inside make_spectrum functions
casesyh Oct 20, 2020
684ca43
fixed various small errors in implementation of new features
taliaweiss Oct 21, 2020
ab86d1d
prepare to add smeared triangle resolutio and gaussian+lorentzian res…
casesyh Oct 21, 2020
2871962
Fixed errors; added temporary diagnoistic plots
taliaweiss Oct 21, 2020
7801316
Changed default inst res files
taliaweiss Oct 21, 2020
3fc6772
Fixed temporary diagnostic plots
taliaweiss Oct 21, 2020
f884b91
add smeared triangle and gaussian + lorentzian reoslution
casesyh Oct 22, 2020
d0bf786
Enabled FakeDataGenerator to use complex ls as func of K
taliaweiss Oct 22, 2020
6d99c11
Fixed scatter peak bug; removed temporary plots/printing
taliaweiss Oct 22, 2020
dc418e7
Set bin width of std_eV_array manually
taliaweiss Oct 24, 2020
aed8ddc
Changed default simulated res to T2 version
taliaweiss Oct 24, 2020
6cf5179
push the changes in there
casesyh Oct 25, 2020
2cd91fa
add fitting with composite gaussian lorentzian resolution
casesyh Nov 2, 2020
350f496
fix survival probability
casesyh Nov 3, 2020
8227397
fixed survival probability free scatter proportion
casesyh Nov 4, 2020
d70e4c0
add fitting with partially fixed scatter proportion
casesyh Nov 5, 2020
a94dfc5
update fitting with fixed survival probability partially fixed scatte…
casesyh Nov 6, 2020
2229336
add mass 28 gases
casesyh Nov 16, 2020
5fbb06f
make gases and scatter proportion configurable
casesyh Nov 17, 2020
2323155
make gases and scatter_proportion configurable
casesyh Nov 17, 2020
6325498
add elevated, composite, composite with pedestal factor gaussian reso…
casesyh Nov 17, 2020
bb46e17
composite gaussian resolution scaled and simulated resolution scaled
casesyh Nov 24, 2020
86dee6e
add fitting with simulated resolution scaled and fit reconstruction e…
casesyh Dec 5, 2020
033937d
test git it's been a while
casesyh Jan 24, 2021
514305d
make recon eff param configurable
casesyh Jan 25, 2021
fbb7b49
Merge branch 'multi_gas_scattering' into combining_multi_gas_scatteri…
casesyh Jan 26, 2021
4bc4e14
fix typo in variable name recon_eff_param_c
casesyh Jan 28, 2021
bf8f2a1
Fixed the interface between the fake data generator and the complex l…
huyanxy Jan 28, 2021
b376b79
Merge branch 'combining_multi_gas_scattering_with_simulated_ins_resol…
huyanxy Jan 28, 2021
cac1723
Testing merge of simulated_ins... and multigas... branches
taliaweiss Jan 28, 2021
50089b1
Merge branch 'combining_multi_gas_scattering_with_simulated_ins_resol…
taliaweiss Jan 28, 2021
b32b50b
Testing changes
taliaweiss Jan 28, 2021
a160e85
added more configurables in the fake data generator. Changed variabl…
huyanxy Jan 29, 2021
1249f6a
organized configs
huyanxy Jan 29, 2021
26b7b1d
Testing recon eff in Stan
taliaweiss Jan 29, 2021
3d94d86
Fixed bug in recon eff implementation in complex lineshape
taliaweiss Jan 29, 2021
b830e9c
Removed double-definition of self.scatter_proportion in FakeDataGener…
taliaweiss Jan 29, 2021
2fc7e17
move self.shakeSpectrumClassInstance into InternalConfigure
casesyh Feb 5, 2021
7d29504
Commenting changes
taliaweiss Feb 8, 2021
c7ff7a3
Merge branch 'combining_multi_gas_scattering_with_simulated_ins_resol…
taliaweiss Feb 8, 2021
236a737
add a few comments above the make spectrum's
casesyh Feb 8, 2021
97386cf
Merge branch 'combining_multi_gas_scattering_with_simulated_ins_resol…
taliaweiss Feb 8, 2021
ff744ef
Merged in develop; added comments to FakeDataGenerator's InternalConf…
taliaweiss Feb 8, 2021
0283d97
added shake json file path in the fake data generator; fixed bug (ext…
huyanxy Feb 9, 2021
7719ce2
fixed result dictionary keys for the fitted survival probability. No…
huyanxy Feb 9, 2021
fc3a164
changed comments about the options for the resolution function config
huyanxy Feb 9, 2021
bf49a03
Removed unnecessary path config from FakeDataGenerator
taliaweiss Feb 9, 2021
4f37578
Pulling Xueying's changes
taliaweiss Feb 9, 2021
f16a5e6
fix bug (incorrect function name)
huyanxy Feb 10, 2021
6a2dd07
fix bug (incorrect function name in multi gas lineshape)
huyanxy Feb 10, 2021
a0f279e
removed self.path_to_quad_trap_eff_interp variable (no longer needed)
huyanxy Feb 10, 2021
fbacdb7
fix make spectrum function call bug in method spectrum_func_composite…
casesyh Feb 10, 2021
021ddca
make self.shakeSpectrumClassInstance configuration only happen when s…
casesyh Feb 10, 2021
5be7d8a
fixed function call in complex lineshape
huyanxy Feb 10, 2021
9d6ca2c
included Yu-Hao's change to the shape spectrum input option
huyanxy Feb 10, 2021
a482415
fixed function call
huyanxy Feb 10, 2021
41bbe00
fixed function call
huyanxy Feb 10, 2021
297eb80
Cleaned up code per Christine's recommendations on pull request
taliaweiss Feb 12, 2021
250d3e7
fit with modified exponential scatter peak amplitude ratios
casesyh Mar 15, 2021
2f6f6ed
Added function to compute frac events in ROI for count rate predictions
taliaweiss Mar 16, 2021
7900b6d
Merge branch 'combining_multi_gas_scattering_with_simulated_ins_resol…
taliaweiss Mar 16, 2021
aa3a1c3
add survival probability in parameters
casesyh Mar 16, 2021
79909fd
Updated FakeDataGenerator to use correct recon eff model
taliaweiss Mar 31, 2021
0c3398c
Added Dirac delta option to new complex lineshape function, fixed errors
taliaweiss Apr 1, 2021
69bcf34
add fitting with gaussian resolution
casesyh Jun 23, 2021
5ba3280
add 'gaussian_resolution_fit_scatter_peak_ratio' to resolution functi…
casesyh Jun 24, 2021
76c1d9d
minor modifications in Complex_line_shape_fitter.py
casesyh Jun 24, 2021
c7c89da
copy the MultiGasComplexLineShape.py from combining_branch_temp_for_u…
casesyh Jun 25, 2021
00a65f7
missed adding f_radiation_loss = self.radiation_loss_f() around line 348
casesyh Jun 25, 2021
273522e
upload Complex_line_shape_fitter.py
casesyh Jun 25, 2021
347fb49
Made gaussian res an option in FakeDataGenerator
taliaweiss Jun 28, 2021
29eb20b
Fixed background function for FakeDataGenerator
taliaweiss Jun 30, 2021
703e8bc
Temporarily added diagnostic plotting functions
taliaweiss Jul 1, 2021
36d1d81
Fixed bug in Gaussian response fn option
taliaweiss Jul 20, 2021
42d3926
Merge branch 'develop' into combining_ComplexLineShape_and_FakeDataGe…
taliaweiss Jul 22, 2021
83d6106
add configuration use_quad_eff_interp
casesyh Jul 28, 2021
5f32964
Changed survival_prob default to 1
taliaweiss Jul 28, 2021
e5d160e
Merge branch 'combining_ComplexLineShape_and_FakeDataGenerator' of ht…
taliaweiss Jul 28, 2021
ed96284
Updated len(std_eV_array) for Phase II
taliaweiss Jul 28, 2021
92750ea
Added scale factor to fake data generator
taliaweiss Aug 1, 2021
5cb8e15
Allow energy res to vary with K in data gen
taliaweiss Aug 2, 2021
58400bd
Cleaning - ins res variation with K in data gen
taliaweiss Aug 2, 2021
63efaf0
Changed ins res width defaults; fixed error
taliaweiss Aug 2, 2021
c56ea19
Removed temporary plotting and printing
taliaweiss Aug 2, 2021
dacc784
added tritium frequentists analysis
cclaessens Aug 4, 2021
481ec91
Added comments re new input parameters in generator
taliaweiss Aug 4, 2021
dcb10c8
debugging
cclaessens Aug 4, 2021
4dfb896
Merge branch 'feature/MCUncertaintyPropagation' into feature/taup_202…
cclaessens Aug 4, 2021
9052050
two small fixes
cclaessens Aug 5, 2021
0c25da8
fixing gaussian resolution with detailed lineshape combo
cclaessens Aug 6, 2021
d0d7b11
fixes in helium lineshape model
cclaessens Aug 7, 2021
f0959e2
Re-introduced trap weight and resolution bin sampling
taliaweiss Aug 7, 2021
0d2809b
Merge branch 'combining_ComplexLineShape_and_FakeDataGenerator' of ht…
taliaweiss Aug 7, 2021
2329283
sampling b and c from gamma
cclaessens Aug 10, 2021
0d3350f
fixed molecular final states file and added extended
Aug 11, 2021
28ec76c
fixed molecular final states file and added extended
Juliana-S Aug 11, 2021
62b242c
fixed molecular final states file and added extended
Juliana-S Aug 11, 2021
3a4c198
removed option configuration via fit_options dictionary in DoOneFit, …
cclaessens Aug 11, 2021
395bb86
Merge branch 'combining_ComplexLineShape_and_FakeDataGenerator' into …
cclaessens Aug 11, 2021
54a0516
Avoid flipping lineshape for simplified model
taliaweiss Aug 15, 2021
c606dae
rearrange the configurations in complex line shape fitter test
casesyh Aug 23, 2021
ba8410b
rearrange the configurations in complex line shape fitter test
casesyh Aug 23, 2021
8aac6ff
implemented correlated b and c sampling, limited resolution to greate…
cclaessens Sep 22, 2021
6394d34
added nuisance parameters
cclaessens Oct 4, 2021
10f24d5
Testing channel runtime correction
taliaweiss Oct 7, 2021
9caafcd
Merge branch 'combining_ComplexLineShape_and_FakeDataGenerator' of ht…
taliaweiss Oct 7, 2021
cb59f86
commenting and re-organizing tritium frequentist analysis
cclaessens Oct 13, 2021
59ca535
more reorganization
cclaessens Oct 13, 2021
9aed766
made model parameters configurable
cclaessens Oct 14, 2021
a17f87a
missed a comment
cclaessens Oct 14, 2021
58bc31d
fixes
cclaessens Oct 14, 2021
e373596
Fix livetime correction
taliaweiss Oct 17, 2021
c738edb
moving param reads and if statements to where they are needed
cclaessens Oct 18, 2021
10a124a
Fixed normalization process
taliaweiss Oct 19, 2021
f090948
update MultiGasComplexLineShape.py
casesyh Oct 20, 2021
1009485
update MultiGasComplexLineShape.py
casesyh Oct 20, 2021
c23ce65
notes for update: added fit_data_simulated_resolution_scaled_fit_scat…
casesyh Oct 20, 2021
01dbb34
update MultiGasComplexLineShape.py
casesyh Oct 20, 2021
869bc03
update internal run
casesyh Oct 20, 2021
f43e4b6
update fit_data_simulated_resolution_scaled_fit_scatter_peak_ratio
casesyh Oct 20, 2021
57f45e9
update fit_data_simulated_resolution_scaled_fit_scatter_peak_ratio
casesyh Oct 20, 2021
8011208
update fit_data_simulated_resolution_scaled_fit_scatter_peak_ratio
casesyh Oct 20, 2021
c6ebe4f
modify test_analysis/Complex_line_shape_fitter.py
casesyh Oct 20, 2021
209372e
update mermithid/processors/misc/MultiGasComplexLineShape.py
casesyh Oct 20, 2021
7fa0461
Scatter peak ratio re-parameterization in fake data gen
taliaweiss Oct 21, 2021
23bd22a
Merge branch 'combining_ComplexLineShape_and_FakeDataGenerator' of ht…
taliaweiss Oct 21, 2021
746071d
modified simplified lineshape and added channel livetime correction
cclaessens Oct 22, 2021
1109f4f
add configurable detection eff
casesyh Oct 22, 2021
11b6075
Merge branch 'combining_ComplexLineShape_and_FakeDataGenerator' of ht…
casesyh Oct 22, 2021
55663e5
update test_analysis/Complex_line_shape_fitter.py
casesyh Oct 22, 2021
7915c22
change factor to 0.4626
casesyh Oct 23, 2021
f234253
added fixed parameter configuraion as dictionary
cclaessens Oct 23, 2021
f744126
some fixes
cclaessens Oct 23, 2021
c73a2de
fixes for nuisance parameter analysis
cclaessens Nov 16, 2021
b533721
fixed neutrino mass bias
cclaessens Dec 12, 2021
8b52cec
changed b and c to p and q
cclaessens Jan 14, 2022
5e60088
more b and c replaced by p and q
cclaessens Jan 15, 2022
e2455af
Merge branch 'combining_ComplexLineShape_and_FakeDataGenerator' into …
cclaessens Jan 15, 2022
701b949
Fixed freq var approach; added p and q var
taliaweiss Feb 1, 2022
749786f
e phase space now calculated in beta_rates
cclaessens Feb 9, 2022
2cd0df7
linking two gaussian model parameters to resolution
cclaessens Feb 10, 2022
f4394ab
fixes to using derived two-gaussian model
cclaessens Mar 3, 2022
048f08e
Merge branch 'combining_ComplexLineShape_and_FakeDataGenerator' into …
cclaessens Mar 3, 2022
433f2fd
hydrogen fraction is now fit parameter
cclaessens Apr 6, 2022
70f2c50
added frequency dependent detector response and made frequentists ana…
cclaessens Apr 18, 2022
aea654b
moved iminuit setup to separate method
cclaessens Apr 26, 2022
29c3482
p and q factors work for gaussian resolution in fake data generation.…
cclaessens May 27, 2022
410cc32
added correlated parameters in frequentist analysis
cclaessens May 28, 2022
55e2c32
frequency dependence in asimov data and faster final states
cclaessens May 29, 2022
f92ae93
fix for when response is not scattered
cclaessens May 29, 2022
3564ad7
fixed correlated parameters not working in contour plot
cclaessens May 30, 2022
1621d29
h2_fractionn can be MC propagated
cclaessens May 31, 2022
36934ab
Updated molecular endpoint value
taliaweiss Jun 27, 2022
20799ef
working on neutrino mass fit fix
cclaessens Jul 5, 2022
9bb26f4
updates in fake data generation and likelihood fitter.
cclaessens Aug 23, 2022
b972e1b
commented freq var logging
cclaessens Aug 29, 2022
0539962
returning likelihoods on demand
cclaessens Nov 9, 2022
042d916
working on likelihood returns for fc limits
cclaessens Nov 10, 2022
9e5354f
returning LL given true mass model instead of tue data
cclaessens Nov 10, 2022
bc2aa39
use neg neg likelihood to get constrained result
cclaessens Nov 11, 2022
ada791c
back to only using true mass
cclaessens Nov 11, 2022
bbb7da5
back to just using pos loglikelihood
cclaessens Nov 11, 2022
6ff097e
added ll normalization
cclaessens Nov 11, 2022
b5dde80
comparing likelihoods of given all but mass parameter true
cclaessens Nov 11, 2022
2099fd5
more normalization and using other parameters' best fit values again
cclaessens Nov 13, 2022
c45bf05
swapped expectation and observation for likelihood ratio
cclaessens Nov 20, 2022
6282e29
commented elif resolution is gaussian. also changed number of detecto…
cclaessens Nov 23, 2022
09c8ad1
adding frequency variation with gaussian resolution. Also adding effi…
cclaessens Nov 24, 2022
a91751e
Sampling simulated resolution once during configuration.
cclaessens Nov 24, 2022
de870bd
Response energy stepzise can be modified. Efficiency is sampled first…
cclaessens Nov 24, 2022
9ff9f99
Merge branch 'feature/FakeDataGeneratorUpdate' into feature/post_taup…
cclaessens Dec 1, 2022
f600baf
added correlation from max SNR of p q with width resolution in freque…
cclaessens Dec 3, 2022
657a56e
using actual max SNR uncertainty on sigma
cclaessens Dec 3, 2022
4aa16cd
preparing for FC jobs
cclaessens Dec 5, 2022
f450296
preparing for llnl FC jobs
cclaessens Dec 6, 2022
6493d58
making -mbeta² model configurable
cclaessens Dec 8, 2022
1d296d7
trying mean priors instead of best fits for other parameters to gener…
cclaessens Jan 17, 2023
7de4327
going back to using best fit values
cclaessens Jan 18, 2023
da47a46
setting background to zero
cclaessens Jan 18, 2023
e71f3b1
using prior means again for likelihood calculation
cclaessens Jan 21, 2023
2a46342
back to setting background 0 in LL ratio calculation
cclaessens Feb 7, 2023
26cb45e
Updated Cicada (v1.4.1) and Phylloxera (v1.3.1)
nsoblath-pnnl Apr 24, 2023
2d1f818
Update Scarab and Cicada option setting
nsoblath-pnnl Apr 24, 2023
c7b8703
Don't update pip3 (some version shear problem)
nsoblath-pnnl Apr 24, 2023
c7ab6c3
Updated .gitignore to exclude build directories
nsoblath-pnnl Apr 24, 2023
d914a87
Explained source/calculation of numbers in aseev_func_tail
taliaweiss Jan 22, 2026
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,6 @@ ENV/
.mypy_cache/
*.root
*.png

# CMake build directory
build*/
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ include( PackageBuilder )

pbuilder_prepare_project()

set_option( Scarab_BUILD_CODEC_JSON OFF )
set_option( Scarab_BUILD_CODEC_YAML OFF )
set_option( Scarab_BUILD_AUTHENTICATION OFF )
set_option( Scarab_BUILD_CLI OFF )
set_option( Scarab_BUILD_PARAM OFF )
set_option( Scarab_ENABLE_EXECUTABLES OFF )
set_option( Cicada_ENABLE_KATYDID_NAMESPACE OFF )

pbuilder_add_submodule( Cicada Cicada )
pbuilder_add_submodule( Phylloxera Phylloxera )

set( Scarab_BUILD_CODEC_JSON OFF CACHE BOOL "No coded" FORCE)
set( Scarab_BUILD_CODEC_YAML OFF CACHE BOOL "No codec" FORCE)
set( Scarab_BUILD_AUTHENTICATION OFF CACHE BOOL "No auth" FORCE)
set( Scarab_BUILD_PARAM OFF CACHE BOOL "No param" FORCE)

set( Cicada_ENABLE_KATYDID_NAMESPACE OFF CACHE BOOL "Use Cicada namespace" FORCE)

6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ RUN mkdir -p $MERMITHID_BUILD_PREFIX &&\
echo 'export PYTHONPATH=$MERMITHID_BUILD_PREFIX/$(python3 -m site --user-site | sed "s%$(python3 -m site --user-base)%%"):$PYTHONPATH' >> setup.sh &&\
/bin/true

RUN source $COMMON_BUILD_PREFIX/setup.sh &&\
pip install iminuit &&\
/bin/true

########################
FROM mermithid_common as mermithid_done

Expand All @@ -45,6 +41,7 @@ COPY tests $MERMITHID_BUILD_PREFIX/tests

# repeat the cmake command to get the change of install prefix to set correctly (a package_builder known issue)
RUN source $MERMITHID_BUILD_PREFIX/setup.sh &&\
# pip3 install --upgrade pip &&\
cd /tmp_source &&\
mkdir -p build &&\
cd build &&\
Expand All @@ -64,3 +61,4 @@ RUN source $MERMITHID_BUILD_PREFIX/setup.sh &&\
FROM mermithid_common

COPY --from=mermithid_done $MERMITHID_BUILD_PREFIX $MERMITHID_BUILD_PREFIX
RUN pip3 install seaborn statsmodels
34 changes: 24 additions & 10 deletions mermithid/misc/ComplexLineShapeUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ def read_oscillator_str_file(filename):

for line in lines:
if line != "" and line[0]!="#":
raw_data = [float(i) for i in line.split("\t")]
energyOsc[0].append(raw_data[0])
energyOsc[1].append(raw_data[1])
try:
raw_data = [float(i) for i in line.split("\t")]
energyOsc[0].append(raw_data[0])
energyOsc[1].append(raw_data[1])
except:
continue

energyOsc = np.array(energyOsc)
### take data and sort by energy
Expand All @@ -50,9 +53,14 @@ def read_oscillator_str_file(filename):
energyOsc[1] = energyOsc[1][sorted_indices]
return energyOsc

# A sub function for the scatter function. Found in
# A sub function for the scatter function. The oscillator strength tails are from
# this database: https://nl.lxcat.net/home/.
# To get the parameters below, the tails are then fitted using the function in:
# "Energy loss of 18 keV electrons in gaseous T and quench condensed D films"
# by V.N. Aseev et al. 2000
# The tails in the LXCAT database sometimes only go out to a certain energy.
# Sometimes, we need energies extending beyond that value. That is why we
# need to use this parameterized form of the tail.
def aseev_func_tail(energy_loss_array, gas_type):
if gas_type=="H2":
A2, omeg2, eps2 = 0.195, 14.13, 10.60
Expand All @@ -62,14 +70,21 @@ def aseev_func_tail(energy_loss_array, gas_type):
A2, omeg2, eps2 = 0.1187, 33.40, 10.43
elif gas_type=="Ar":
A2, omeg2, eps2 = 0.3344, 21.91, 21.14
elif gas_type=="N2":
A2, omeg2, eps2 = 0.21754816, 44.99897054, 20.43916114
elif gas_type=="CO":
A2, omeg2, eps2 = 0.19583454, 55.21888452, 16.44972596
elif gas_type=="C2H4":
A2, omeg2, eps2 = 0.57492182, 23.77501391, 14.33107345
return A2*omeg2**2./(omeg2**2.+4*(energy_loss_array-eps2)**2.)

#convert oscillator strength into energy loss spectrum
def get_eloss_spec(e_loss, oscillator_strength, kr_17keV_line): #energies in eV
kinetic_en = kr_17keV_line * 1000
kinetic_en = kr_17keV_line
e_rydberg = 13.605693009 #rydberg energy (eV)
a0 = 5.291772e-11 #bohr radius
return np.where(e_loss>0 , 4.*np.pi*a0**2 * e_rydberg / (kinetic_en * e_loss) * oscillator_strength * np.log(4. * kinetic_en * e_loss / (e_rydberg**3.) ), 0)
argument_of_log = np.where(e_loss > 0, 4. * kinetic_en * e_rydberg / (e_loss**2.) , 1e-5)
return np.where(e_loss>0 , 1./(e_loss) * oscillator_strength* np.log(argument_of_log), 0)

# Takes only the nonzero bins of a histogram
def get_only_nonzero_bins(bins,hist):
Expand Down Expand Up @@ -109,11 +124,10 @@ def energy_guess_to_frequency(energy_guess, energy_guess_err, B_field_guess):
return frequency , frequency_err

# Given a frequency and error, converts those to B field values assuming the line is the 17.8 keV line
def central_frequency_to_B_field(central_freq,central_freq_err):
def central_frequency_to_B_field(central_freq):
const = (2.*np.pi*m_e)*(1+kr_17keV_line/mass_energy_electron)/e_charge
B_field = const*central_freq
B_field_err = const*central_freq_err
return B_field , B_field_err
return B_field

# given a FWHM for the lorentian component and the FWHM for the gaussian component,
# this function estimates the FWHM of the resulting voigt distribution
Expand Down Expand Up @@ -200,4 +214,4 @@ def shake_spectrum(self):
x_array = flip_array(x_array)
shake_spectrum = self.full_shake_spectrum(x_array, 0, 24)
return shake_spectrum
###############################################################################
###############################################################################
4 changes: 2 additions & 2 deletions mermithid/misc/Constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def GF(): return 1.1663787*10**(-23) #Gf/(hc)^3, in eV^(-2)
def Vud(): return 0.97425 #CKM element

#Beta decay-specific physical constants
def QT(): return 18563.251 #For atomic tritium (eV), from Bodine et al. (2015)
def QT2(): return 18573.24 #For molecular tritium (eV), Bodine et al. (2015)
def QT(): return 18563.251 #SHOULD BE DOUBLE-CHECKED. For atomic tritium (eV), from Bodine et al. (2015)
def QT2(): return 18574.01 #For molecular tritium (eV). Calculation here: https://projecteight.slack.com/archives/CG5TY2UE7/p1649963449399179, based on Bodine et al. (2015).
def Rn(): return 2.8840*10**(-3) #Helium-3 nuclear radius in units of me, from Kleesiek et al. (2018): https://arxiv.org/pdf/1806.00369.pdf
def M_3He_in_me(): return 5497.885 #Helium-3 mass in units of me, Kleesiek et al. (2018)
def atomic_num(): return 2. #For helium-3
Expand Down
Loading