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

Commit

Permalink
Get gains from CMT (#172)
Browse files Browse the repository at this point in the history
* Get gains from CMT

Some of the aftermath of XENONnT/straxen#457

* Update requirements.txt

* Update requirements.txt

* Update requirements.txt

* Update test_wfsim.py

* Update test_wfsim.py

Co-authored-by: tianyu zhu <tz2263@columbia.edu>
  • Loading branch information
JoranAngevaare and zhut19 authored Jun 23, 2021
1 parent 37fee9d commit f221af2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
strax
utilix>=0.5.3
straxen==0.18.4
straxen>=0.19.0
uproot>=4.0.0
8 changes: 5 additions & 3 deletions tests/test_wfsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def test_sim_1T():
with tempfile.TemporaryDirectory() as tempdir:
log.debug(f'Working in {tempdir}')
testing_config_1T = dict(
hev_gain_model=('to_pe_constant', 0.0085),
gain_model=('to_pe_constant', 0.0085),
hev_gain_model=("1T_to_pe_placeholder", True),
gain_model=("1T_to_pe_placeholder", True),
)
st = strax.Context(
storage=tempdir,
Expand Down Expand Up @@ -60,7 +60,9 @@ def test_sim_nT_basics():
with tempfile.TemporaryDirectory() as tempdir:
log.debug(f'Working in {tempdir}')
conf = straxen.contexts.xnt_common_config
conf['gain_model'] = ('to_pe_constant', 0.01)
conf['gain_model'] = ("to_pe_placeholder", True)
conf['hev_gain_model'] = ("to_pe_placeholder", True)
conf['hit_min_amplitude'] = 'pmt_commissioning_initial'
resource, conf_override = test_load_nt()

# The SPE table in this package is for a single channel
Expand Down
4 changes: 2 additions & 2 deletions wfsim/strax_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ def set_config(self,):
self.config.update(overrides)

# Update gains to the nT defaults
self.to_pe = straxen.get_to_pe(self.run_id, self.config['gain_model'],
self.config['channel_map']['tpc'][1]+1)
self.to_pe = straxen.get_correction_from_cmt(self.run_id,
self.config['gain_model'])

adc_2_current = (self.config['digitizer_voltage_range']
/ 2 ** (self.config['digitizer_bits'])
Expand Down

0 comments on commit f221af2

Please sign in to comment.