

.. _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 '/home/moritz/pkg/km3pipe/km3pipe/kp-data/stylelib/km3pipe.mplstyle'




|


.. code-block:: python


    # 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.265 seconds)



.. 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>`

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

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