Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx committed Nov 15, 2024
1 parent 84df0ea commit 3757eff
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 124 deletions.
2 changes: 1 addition & 1 deletion docs/source/cmt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ In specific CMT is a class within `strax <https://github.com/AxFoundation/strax/

CMT in straxen
--------------
A customized CMT can be implemented given the experiment software, in the case of straxen, experiment specifics can be added to CMT. To set CMT accordingly to straxen a class `CorrectionsManagementService() <https://github.com/XENONnT/straxen/blob/master/straxen/corrections_services.py>`_ allows the user to query and retrieve information. This class uses the start time of a given run to find the corresponding information and version for a given correction. For every correction user must set the proper configuration in order to retrieve the information, the syntax is the following ``my_configuration = (“my_correction”, “version”, True)`` the first part correspond to the string of the correction, then the version, it can be either an ONLINE version or OFFLINE version and finally the boolean correspond to the detector configuration (1T or nT).
A customized CMT can be implemented given the experiment software, in the case of straxen, experiment specifics can be added to CMT. To set CMT accordingly to straxen a class `CorrectionsManagementService() <https://github.com/XENONnT/straxen/blob/master/straxen/corrections_services.py>`_ allows the user to query and retrieve information. This class uses the start time of a given run to find the corresponding information and version for a given correction. For every correction user must set the proper configuration in order to retrieve the information, the syntax is the following ``my_configuration = (“my_correction”, “version”, True)`` the first part correspond to the string of the correction, then the version, it can be either an ONLINE version or OFFLINE version and finally the boolean correspond to the detector configuration.
In the case of straxen there are several plug-ins that call CMT to retrieve information, in that case, the configuration option is set by the ``strax.option()`` and the information is retrieve in `set()` via the function `straxen.get_correction_from_cmt()` and example is shown below where the electron life time is retrieve for a particular run ID, using the ONLINE version for the detector configuration nT=True.


Expand Down
7 changes: 0 additions & 7 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ Straxen is the analysis framework for XENONnT, built on top of the generic `stra
reference/context


.. toctree::
:maxdepth: 1
:caption: 1T Datastructure

reference/datastructure_1T


.. toctree::
:maxdepth: 1
:caption: Reference
Expand Down
53 changes: 0 additions & 53 deletions docs/source/reference/straxen.legacy.plugins_1t.rst

This file was deleted.

45 changes: 0 additions & 45 deletions docs/source/reference/straxen.legacy.rst

This file was deleted.

5 changes: 0 additions & 5 deletions docs/source/scripts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,6 @@ bootstrax [DAQ-only]
As the main DAQ processing script. This is discussed separately. It is only used for XENONnT.


fake_daq
------------------
Script that allows mimiming DAQ-processing by opening raw-records data.


microstrax
------------------
Mini strax interface that allows strax-data to be retrieved using HTTP requests
Expand Down
7 changes: 2 additions & 5 deletions straxen/matplotlib_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def plot_pmts(
c,
label="",
figsize=None,
xenon1t=False,
show_tpc=True,
extend="neither",
vmin=None,
Expand All @@ -40,7 +39,7 @@ def plot_pmts(
# Single-valued array passed
vmax += 1
if figsize is None:
figsize = (11.25, 4.25) if xenon1t else (13.25, 5.75)
figsize = (13.25, 5.75)

f, axes = plt.subplots(1, 2, figsize=figsize)
plot_result = None
Expand All @@ -51,7 +50,6 @@ def plot_pmts(

plot_result = plot_on_single_pmt_array(
c,
xenon1t=xenon1t,
array_name=array_name,
show_tpc=show_tpc,
vmin=vmin,
Expand All @@ -75,7 +73,6 @@ def plot_pmts(
def plot_on_single_pmt_array(
c,
array_name="top",
xenon1t=False,
r=straxen.tpc_r * 1.03,
pmt_label_size=8,
pmt_label_color="white",
Expand Down Expand Up @@ -106,7 +103,7 @@ def plot_on_single_pmt_array(
if vmax is None:
vmax = c.max()

pmt_positions = straxen.pmt_positions(xenon1t=xenon1t).to_records()
pmt_positions = straxen.pmt_positions().to_records()

ax = plt.gca()
ax.set_aspect("equal")
Expand Down
10 changes: 2 additions & 8 deletions tests/test_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ def tearDownClass(cls):
shutil.rmtree(cls.tempdir)

def test_run_selection(self):
st = self.st
# Ignore strax-internal warnings
st.set_context_config({"free_options": tuple(st.config.keys())})
self.st.set_context_config({"free_options": tuple(self.st.config.keys())})

run_df = st.select_runs(available="raw_records")
run_df = self.st.select_runs(available="raw_records")
print(run_df)
run_id = run_df.iloc[0]["name"]
assert run_id == self.run_id
Expand All @@ -59,8 +58,6 @@ def _extract_latest_comment(
assert st.runs is not None, "No registry build?"
assert "comments" in st.runs.keys()
runs = st.select_runs(available=test_for_target)
if context == "demo":
assert len(st.runs)
assert f"{test_for_target}_available" in runs.keys()

def test_extract_latest_comment_nt(self, **opt):
Expand All @@ -69,9 +66,6 @@ def test_extract_latest_comment_nt(self, **opt):
context="xenonnt_online", minimum_run_number=10_000, maximum_run_number=12_000, **opt
)

def test_extract_latest_comment_demo(self):
self._extract_latest_comment(context="demo")

def test_extract_latest_comment_lone_hits(self):
"""Run the test for some target that is not in the default availability check."""
self.test_extract_latest_comment_nt(test_for_target="lone_hits")
Expand Down

0 comments on commit 3757eff

Please sign in to comment.