.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_tot_histogram.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_tot_histogram.py: ================== ToT histogram. ================== Create a simple histogram of the PMT signals (ToTs) in all events. .. GENERATED FROM PYTHON SOURCE LINES 10-34 .. image-sg:: /auto_examples/images/sphx_glr_plot_tot_histogram_001.png :alt: ToT distribution :srcset: /auto_examples/images/sphx_glr_plot_tot_histogram_001.png :class: sphx-glr-single-img .. code-block:: Python # Author: Tamas Gal # License: BSD-3 import tables as tb import matplotlib.pyplot as plt import km3pipe.style from km3net_testdata import data_path km3pipe.style.use("km3pipe") filename = data_path("hdf5/atmospheric_muons_sample.h5") with tb.File(filename) as f: tots = f.get_node("/hits/tot")[:] fig, ax = plt.subplots() ax.hist(tots, bins=max(tots), log=True, edgecolor="none") ax.set_title("ToT distribution") ax.set_xlabel("ToT [ns]") fig.tight_layout() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.696 seconds) .. _sphx_glr_download_auto_examples_plot_tot_histogram.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_tot_histogram.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_tot_histogram.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_