

.. _sphx_glr_auto_examples_plot_tot_histogram.py:



==================
ToT histogram.
==================

Create a simple histogram of the PMT signals (ToTs) in all events.




.. image:: /auto_examples/images/sphx_glr_plot_tot_histogram_001.png
    :align: center


.. rst-class:: sphx-glr-script-out

 Out::

    Loading style definitions from '/Users/tamasgal/Dev/km3pipe/km3pipe/kp-data/stylelib/km3pipe.mplstyle'




|


.. code-block:: python

    from __future__ import absolute_import, print_function, division

    # Author: Tamas Gal <tgal@km3net.de>
    # License: BSD-3

    import tables as tb
    import matplotlib.pyplot as plt
    import km3pipe.style
    km3pipe.style.use("km3pipe")

    filename = "data/km3net_jul13_90m_muatm50T655.km3_v5r1.JTE_r2356.root.0-499.h5"

    with tb.File(filename) as f:
        tots = f.get_node("/hits/tot")[:]

    plt.hist(tots, bins=254, log=True, edgecolor='none')
    plt.title("ToT distribution")
    plt.xlabel("ToT [ns]")

**Total running time of the script:** ( 0 minutes  0.296 seconds)



.. only :: html

 .. container:: sphx-glr-footer


  .. container:: sphx-glr-download

     :download:`Download Python source code: plot_tot_histogram.py <plot_tot_histogram.py>`



  .. container:: sphx-glr-download

     :download:`Download Jupyter notebook: plot_tot_histogram.ipynb <plot_tot_histogram.ipynb>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
