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

Correct elife at the last in corrected_areas #1258

Merged
merged 3 commits into from Sep 6, 2023
Merged

Conversation

dachengx
Copy link
Collaborator

@dachengx dachengx commented Sep 6, 2023

What does the code in this PR do / what does it improve?

We corrected PI after elife in #1247, so that got a lot of nan cs2_area_fraction_top.

Can you briefly describe how it works?

Now we correct the cS2 in the order of:

  1. S2(x,y)
  2. SEG and EE
  3. PI
  4. elife

Can you give a minimal working example (or illustrate with a figure)?

Please include the following if applicable:

  • Update the docstring(s)
  • Update the documentation
  • Tests to check the (new) code is working as desired.
  • Does it solve one of the open issues on github?

straxen/plugins/events/corrected_areas.py Show resolved Hide resolved
straxen/plugins/events/corrected_areas.py Outdated Show resolved Hide resolved
straxen/plugins/events/corrected_areas.py Show resolved Hide resolved
straxen/plugins/events/corrected_areas.py Show resolved Hide resolved
straxen/plugins/events/corrected_areas.py Show resolved Hide resolved
straxen/plugins/events/corrected_areas.py Show resolved Hide resolved
straxen/plugins/events/corrected_areas.py Show resolved Hide resolved
@dachengx
Copy link
Collaborator Author

dachengx commented Sep 6, 2023

Using run_id 051806, comparing the result of old and new versions:

----------
old nan cs2 22.9%
new nan cs2 22.9%
difference cs2 8.8%
mean abs difference cs2 1.7e-03
----------
old nan cs2_area_fraction_top 22.9%
new nan cs2_area_fraction_top 1.5%
difference cs2_area_fraction_top 45.9%
mean abs difference cs2_area_fraction_top 2.7e-08
----------
old nan cs2_area_fraction_top_wo_picorr 0.0%
new nan cs2_area_fraction_top_wo_picorr 1.5%
difference cs2_area_fraction_top_wo_picorr 28.9%
mean abs difference cs2_area_fraction_top_wo_picorr 1.6e-08
----------
old nan cs2_wo_elifecorr 0.0%
new nan cs2_wo_elifecorr 0.0%
difference cs2_wo_elifecorr 0.0%
mean abs difference cs2_wo_elifecorr 0.0e+00
----------
old nan cs2_wo_picorr 22.9%
new nan cs2_wo_picorr 0.0%
difference cs2_wo_picorr 98.1%
mean abs difference cs2_wo_picorr 4.8e+03
----------

The difference on cs2_wo_picorr is as expected.

Copy link
Contributor

@jingqiangye jingqiangye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Dacheng. Indeed, I loaded the same run and most events now have non-nan values for cs2_area_fraction_top, except for 6 events which I believe to be blinded events. I also use xedocs to set config and the photoionization correction is as expected. The code looks much cleaner.

I thinkcs2_area_fraction_top and cs2_area_fraction_top_wo_elifecorr are always the same, also true for cs2_area_fraction_top_wo_timecorr and cs2_area_fraction_top_wo_picorr, but I guess it's more convenient to have all values there so analysts are not required to know all of this.

Copy link
Contributor

@jingqiangye jingqiangye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the description of cs2_wo_* is consistent with code. Very good!

@dachengx
Copy link
Collaborator Author

dachengx commented Sep 6, 2023

Also the description of cs2_wo_* is consistent with code. Very good!

You can also check the readthedocs: https://straxen--1258.org.readthedocs.build/en/1258/reference/datastructure_nT.html#corrected-areas

image

@dachengx
Copy link
Collaborator Author

dachengx commented Sep 6, 2023

The left caveat is that we should also update PeakCorrectedAreas https://github.com/XENONnT/straxen/blob/2e9eaaa7e146e8a19573849293aa796ac46630ee/straxen/plugins/peaks/peak_corrections.py, and solve #1257. But let's put it in another PR.

@dachengx dachengx merged commit 7e49677 into master Sep 6, 2023
8 of 9 checks passed
@dachengx dachengx deleted the cs2_aft_elife_last branch September 6, 2023 21:25
@dachengx dachengx mentioned this pull request Sep 7, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants