XENONnT / straxen

Streaming analysis for XENON
BSD 3-Clause "New" or "Revised" License
20 stars 32 forks source link

SR1 offline simulation strax context #1253

Closed shenyangshi closed 1 year ago

shenyangshi commented 1 year ago

Before you submit this PR: make sure to put all operations-related information in a wiki-note, a PR should be about code and is publicly accessible

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

Create a xedocs based simulation context using the exact corrections as real data. Simplify the logics.

Can you briefly describe how it works?

  1. Create a plain vanilla strax context
  2. Overwrite raw_records with wfsim raw_records
  3. Overwrite xedocs url config with a specific run's of the user's choice
  4. Add simulation needed configs in the strax config

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

Please include the following if applicable:

Notes on testing

All italic comments can be removed from this template.

shenyangshi commented 1 year ago

https://github.com/XENONnT/cutax/pull/296

shenyangshi commented 1 year ago

Hi @ramirezdiego, thanks! I indeed thought about rewriting the xenonnt_simulation, but I don't want to break existing code that uses the cmt options a lot.

About the extra kwargs, I also thought about including them in the new context, but the namings are complex and even I cannot remember which is which. Maybe a better idea of the same comlexity is to modify st.config directly after setting up the context.

dachengx commented 1 year ago

Hi @ramirezdiego, thanks! I indeed thought about rewriting the xenonnt_simulation, but I don't want to break existing code that uses the cmt options a lot.

About the extra kwargs, I also thought about including them in the new context, but the namings are complex and even I cannot remember which is which. Maybe a better idea of the same comlexity is to modify st.config directly after setting up the context.

I agree that we should keep the old simulation context unchanged, because of the backward compatibility requirement.

dachengx commented 1 year ago

@shenyangshi Can this new context also be used on SR0?

shenyangshi commented 1 year ago

Can this new context also be used on SR0?

Yes it can, if you give a SR0 run id and pick the SR0 fax_config.

FaroutYLq commented 1 year ago

Hi @dachengx. Can we merge this and release v2.1.3 today?

dachengx commented 1 year ago

Would you add tests of the new context? Like: https://github.com/XENONnT/straxen/blob/a1eadc4f6d7f3d4a3adf1ea3babd66f6d3eb38ea/tests/test_contexts.py#L140. @shenyangshi

shenyangshi commented 1 year ago

@dachengx I think you can merge now.

dachengx commented 1 year ago

Hi @dachengx. Can we merge this and release v2.1.3 today?

Will merge if the test passes. Will release v2.1.3 if this is merged today.