DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
Reading a DUNE-DAQ HDF5 file for the TP, TA, and TC contents can be easily done using the trgtools
Python module.
Data accessing follows a very similar procedure between the different readers. The TAReader and TCReader also contain the secondary information about the TPs and TAs that formed the TAs and TCs, respectively. For the np.ndarray
objects, one can also specify the member data they want to access. For example,
The available data members for each reader can be used (and shown) with tpr.tp_dt
, tar.ta_dt
and tar.tp_dt
, and tcr.tc_dt
and tcr.ta_dt
.
Look at the contents of *_dump.py
for more detailed examples of data member usage.
While using interactive Python, one can do help(tpr)
and help(tpr.read_fragment)
for documentation on their usage (and similarly for the other readers and plotters).
One can also access the primary data by indexing the reader class itself. For example,
It is still necessary to specify the secondary data, e.g., tar.tp_data[0]
for TPs in the 0-th TA or ‘tcr.ta_data[10]['adc_integral’]` for the TA ADC integrals in the 10-th TC.
There is also a submodule trgtools.plot
that features a class PDFPlotter
. This class contains common plotting that was repeated between the *_dump.py
. Loading this class requires matplotlib
to be installed, but simply doing import trgtools
does not have this requirement.
By design, the plot_style_dict
requires the keys title
, xlabel
, and ylabel
at a minimum. More options are available to further change the style of the plot, and examples of this are available in the *_dump.py
.
The common plots available in PDFPlotter
is rather limited right now. At this moment, these plots are sufficient, but more common plotting functions can be added.