-
Notifications
You must be signed in to change notification settings - Fork 33
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
updated S2 corrected area #686
Changes from 1 commit
c803719
1fb38c7
4824d18
1fb4a1c
57cb49e
7446530
20cb8da
3cf9b59
b059089
87021c1
af213a5
af955ee
5ab3157
aa490a3
ca47034
119df0b
443755e
4994476
406c912
6aa7419
176de84
6649601
633ea0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -598,8 +598,24 @@ def get_veto_tags(events, split_tags, result): | |
(0, pax_file('XENON1T_s1_xyz_lce_true_kr83m_SR0_pax-680_fdc-3d_v0.json')), # noqa | ||
(first_sr1_run, pax_file('XENON1T_s1_xyz_lce_true_kr83m_SR1_pax-680_fdc-3d_v0.json'))]), # noqa | ||
strax.Option( | ||
's2_xy_correction_map', | ||
help="S2 (x, y) correction map. Correct S2 position dependence " | ||
's2_xy_correction_map_top', | ||
help="S2top (x, y) correction map. Correct S2 position dependence " | ||
"manly due to bending of anode/gate-grid, PMT quantum efficiency " | ||
"and extraction field distribution, as well as other geometric factors.", | ||
default_by_run=[ | ||
(0, pax_file('XENON1T_s2_xy_ly_SR0_24Feb2017.json')), | ||
(170118_1327, pax_file('XENON1T_s2_xy_ly_SR1_v2.2.json'))]), | ||
strax.Option( | ||
's2_xy_correction_map_bottom', | ||
help="S2bottom (x, y) correction map. Correct S2 position dependence " | ||
"manly due to bending of anode/gate-grid, PMT quantum efficiency " | ||
"and extraction field distribution, as well as other geometric factors.", | ||
default_by_run=[ | ||
(0, pax_file('XENON1T_s2_xy_ly_SR0_24Feb2017.json')), | ||
(170118_1327, pax_file('XENON1T_s2_xy_ly_SR1_v2.2.json'))]), | ||
strax.Option( | ||
's2_xy_correction_map_total', | ||
help="S2total (x, y) correction map. Correct S2 position dependence " | ||
"manly due to bending of anode/gate-grid, PMT quantum efficiency " | ||
"and extraction field distribution, as well as other geometric factors.", | ||
default_by_run=[ | ||
|
@@ -626,8 +642,14 @@ class CorrectedAreas(strax.Plugin): | |
Note: | ||
Please be aware that for both, the main and alternative S1, the | ||
area is corrected according to the xy-position of the main S2. | ||
|
||
There are now 3 components of cS2s: cS2top, cS2bot and cS2tot, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
all computed with respect to corresponding S2 components. Therefore | ||
cS2tot and cS2top+cS2bot are slightly different. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
Also the cS2aft is calculated by cS2top/cS2tot for now. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
""" | ||
__version__ = '0.1.1' | ||
__version__ = '0.1.2' | ||
|
||
depends_on = ['event_basics', 'event_positions'] | ||
dtype = [('cs1', np.float32, 'Corrected S1 area [PE]'), | ||
|
@@ -641,8 +663,12 @@ def setup(self): | |
|
||
if isinstance(self.config['s1_xyz_correction_map'], str): | ||
self.config['s1_xyz_correction_map'] = [self.config['s1_xyz_correction_map']] | ||
if isinstance(self.config['s2_xy_correction_map'], str): | ||
self.config['s2_xy_correction_map'] = [self.config['s2_xy_correction_map']] | ||
if isinstance(self.config['s2_xy_correction_map_top'], str): | ||
self.config['s2_xy_correction_map_top'] = [self.config['s2_xy_correction_map_top']] | ||
if isinstance(self.config['s2_xy_correction_map_bottom'], str): | ||
self.config['s2_xy_correction_map_bottom'] = [self.config['s2_xy_correction_map_bottom']] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
if isinstance(self.config['s2_xy_correction_map_total'], str): | ||
self.config['s2_xy_correction_map_total'] = [self.config['s2_xy_correction_map_total']] | ||
|
||
self.s1_map = InterpolatingMap( | ||
get_cmt_resource(self.run_id, | ||
|
@@ -651,9 +677,17 @@ def setup(self): | |
*self.config['s1_xyz_correction_map']]), | ||
fmt='text')) | ||
|
||
self.s2_map = InterpolatingMap( | ||
self.s2top_map = InterpolatingMap( | ||
get_cmt_resource(self.run_id, | ||
tuple([*self.config['s2_xy_correction_map']]), | ||
tuple([*self.config['s2_xy_correction_map_top']]), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
fmt='text')) | ||
self.s2bot_map = InterpolatingMap( | ||
get_cmt_resource(self.run_id, | ||
tuple([*self.config['s2_xy_correction_map_bottom']]), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
fmt='text')) | ||
self.s2tot_map = InterpolatingMap( | ||
get_cmt_resource(self.run_id, | ||
tuple([*self.config['s2_xy_correction_map_total']]), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
fmt='text')) | ||
|
||
def compute(self, events): | ||
|
@@ -672,6 +706,21 @@ def compute(self, events): | |
# S2(x,y) corrections use the observed S2 positions | ||
s2_positions = np.vstack([events['s2_x'], events['s2_y']]).T | ||
alt_s2_positions = np.vstack([events['alt_s2_x'], events['alt_s2_y']]).T | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
cs2top=(events['s2_area'] * events['s2_area_fraction_top'] * lifetime_corr | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
/ self.s2top_map(s2_positions)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
alt_cs2top=(events['alt_s2_area']* events['alt_s2_area_fraction_top'] * alt_lifetime_corr | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
/ self.s2top_map(alt_s2_positions)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
|
||
cs2bot=(events['s2_area'] * (1-events['s2_area_fraction_top']) * lifetime_corr | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
/ self.s2bot_map(s2_positions)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
alt_cs2bot=(events['alt_s2_area'] * (1-events['s2_area_fraction_top']) * alt_lifetime_corr | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
/ self.s2bot_map(alt_s2_positions)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
|
||
cs2tot=(events['s2_area'] * lifetime_corr | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
/ self.s2tot_map(s2_positions)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
alt_cs2tot=(events['alt_s2_area'] * alt_lifetime_corr | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
/ self.s2tot_map(alt_s2_positions)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pep8] reported by reviewdog 🐶 |
||
|
||
return dict( | ||
time=events['time'], | ||
|
@@ -680,10 +729,18 @@ def compute(self, events): | |
cs1=events['s1_area'] / self.s1_map(event_positions), | ||
alt_cs1=events['alt_s1_area'] / self.s1_map(event_positions), | ||
|
||
cs2=(events['s2_area'] * lifetime_corr | ||
/ self.s2_map(s2_positions)), | ||
alt_cs2=(events['alt_s2_area'] * alt_lifetime_corr | ||
/ self.s2_map(alt_s2_positions))) | ||
cs2top = cs2top, | ||
alt_cs2top = alt_cs2top, | ||
|
||
cs2bot = cs2bot, | ||
alt_cs2bot = alt_cs2bot, | ||
|
||
cs2tot = cs2tot, | ||
alt_cs2tot = alt_cs2tot, | ||
|
||
cs2_area_fraction_top = cs2top/cs2tot, | ||
alt_cs2_area_fraction_top = alt_cs2top/alt_cs2tot | ||
) | ||
|
||
|
||
@export | ||
|
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.
[pep8] reported by reviewdog 🐶
W293 blank line contains whitespace