-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add corrections_run_id for mini analysis #1339
Conversation
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.
straxen should not touch anything related to simulation. So I would recommend processing corrections_run_id
in fuse. The mini_analysis
can be redefined in fuse and mini_analysis
of fuse can call mini_analysis
of straxen.
i made some comments below on how to redefine the mini_analysis
in fuse.
@@ -39,7 +39,8 @@ def wrapped_f(context: strax.Context, run_id: str, **kwargs): | |||
known_kwargs = ( | |||
"time_range seconds_range time_within time_selection " | |||
"ignore_time_warning " | |||
"selection_str t_reference to_pe config" | |||
"selection_str t_reference to_pe config " | |||
"corrections_run_id" |
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.
You can add another argument to straxen's mini_analysis
function so that it can add additional known_kwargs
to the default ones.
@@ -66,7 +67,12 @@ def wrapped_f(context: strax.Context, run_id: str, **kwargs): | |||
if "to_pe" in parameters and "to_pe" not in kwargs: | |||
to_pe = context.config["gain_model"] | |||
if isinstance(to_pe, str): | |||
to_pe = straxen.URLConfig.evaluate_dry(to_pe, run_id=run_id) | |||
if "corrections_run_id" in kwargs: |
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.
This part should be a stand-alone function called process_to_pe
or other proper names. For straxen, process_to_pe
can be what it was. But for fuse, you can process corrections_run_id
in process_to_pe
.
As being discussed above, this will be implemented in |
What does the code in this PR do / what does it improve?
In the mini analysis code,
straxen
will look for the gain_model for therun_id
specified. However, for MC runs therun_id
is meaningless and should not be used to find corrections. Instead, acorrections_run_id
should be provided for fuse/WFSim-based runs.Can you briefly describe how it works?
Add an extra key argument in the
mini_analysis
base class called "corrections_run_id". If this is provided, find the gain_model according to thecorrections_run_id
.Can you give a minimal working example (or illustrate with a figure)?
Before this PR straxen will try to load gain_model for run "mc_00", which will raise an error. Now it works.