hgcroc-toa-simulator


Namehgcroc-toa-simulator JSON
Version 0.4.5 PyPI version JSON
download
home_page
SummaryApplication that simulates the two-stage TDC implemented in the HGCROCv3 ASIC
upload_time2023-03-29 09:34:17
maintainer
docs_urlNone
authorAlexander Becker
requires_python
licenseGPL3
keywords simulation electronics science
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===============================
ToA simulation for the HGCROCv3
===============================

To have a reference with witch to compare the measured Data with, as well as being able to generate data
for software system tests and help people in understanding the behaviour of the Time to Digital converters
(TDC) of the HGCROCv3, this simulation provides data generation and visualisation techniques.

Installation from pypi
----------------------
.. _pypi_installation:

The easiest and recommended way to install the package is by simply installing it from PyPi. to do this
you can run:

::

        pip install hgcroc-toa-simulator

This will automatically install the latest public version of the software.


Installation from source
------------------------
.. _source_installation:

The code in this repository constitutes a python package so with the current version of this repository
it can be installed using

::

        pip install .

optionally it can be installed in *editable mode* with

::

        pip install --editable .

Editable mode allows changes made in the repository code to affect the installed package immediately.

Usage
-----
The software is built to be a command line tool. After either pypi_installation_ or source_installation_, the ``toa-simulator`` command will
be available on the command line.

All commands and subcommands provide a ``help`` function that lists all available options and shows how
the command is to be called. The tool is quite sensitive to the exact order in whitch options, arguments
and subcommands are written, please stick to the format outlined in the ``help`` section of the tool.

The ``toa-simulator`` has a total of 5 subcommands.
* The ``generate-data`` subcommand generates uniformily distributed events from 0 to 25000ps and converts them to ToA codes using the ToA software simulation.
* The ``convert-data`` subcommand reads in arrival times from an input file and converts them to ToA codes which are written to ``stdout`` or a file
* The ``histogram`` generates uniformily distributed random arrival times and creates a histogram of the resulting ToA codes. Code distributions for different 
slow control configurations of the ToA can be drawn into the same plot.

* The ``plot-timing`` shows a view of the internal state of the TDC and describes how the TDC-code was generated.

Persistent configuration
------------------------
If the command line utility is run multiple times in a row, it generates a new TDC with slightly different
characteristics (in the same way the fabrication process would generate a slightly different behaviour for
each instance of the TDC. To acheive reliable results the exact internal state can be written to a config
file for use in later invocations.


Examples
========

histogram
---------
The easiest thing to get going is to run the ``histogram`` command as follows:

::

        toa-simulator histogram 40000 -sh

This will generate 40000 ToA codes, histogram them and then show the result on the screen. Using the ``-cs`` option we can se the results for different settings
of the ``CTRL_IN_SIG_CTDC_P_D`` configuration parameter. This would then look like:

::

        toa-simulator histogram 40000 -sh -cs 0 -cs 10 -cs 20 -cs 30

Which will draw 4 histograms in the same plot, one for each value of ``CTRL_IN_SIG_CTDC_P_D`` and show them together in the same histogram.

convert-data
------------
To convert data generated externally to the toa-simulator the ``convert-data`` subcommand can be used. The convert data function reads in data from a file
that looks similar to:

::

        Here we have some meta information
        Arrival Time [ps]
        402.3
        102.2
        803.2
        444
        579
        913
        8799

Each line has to have a single number on is that represents the arrival time that is to be converted. It can have arbitrarily many header lines.
The number of header-lines need to be passed to the ``convert-data`` command in the ``-s`` option (see the ``toa-simulator convert-data help``).
It will produce a new-line separated sequence of ToA codes on ``stdout``, or optionally write the output to a file. The position of the output Code
corresponds to the position of the arrival time-stamp in the input.

To process the above file with the path ``example_input.txt`` the following command can be used to output the resulting ToA codes into the console:

::

        toa-simulator convert-data example-input.txt



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "hgcroc-toa-simulator",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "simulation,electronics,science",
    "author": "Alexander Becker",
    "author_email": "a.becker@cern.ch",
    "download_url": "https://files.pythonhosted.org/packages/8e/78/23c521e5ccf9f5728f851b3e9797e934d2b7e165217160c3374c1ebafea0/hgcroc-toa-simulator-0.4.5.tar.gz",
    "platform": null,
    "description": "===============================\nToA simulation for the HGCROCv3\n===============================\n\nTo have a reference with witch to compare the measured Data with, as well as being able to generate data\nfor software system tests and help people in understanding the behaviour of the Time to Digital converters\n(TDC) of the HGCROCv3, this simulation provides data generation and visualisation techniques.\n\nInstallation from pypi\n----------------------\n.. _pypi_installation:\n\nThe easiest and recommended way to install the package is by simply installing it from PyPi. to do this\nyou can run:\n\n::\n\n        pip install hgcroc-toa-simulator\n\nThis will automatically install the latest public version of the software.\n\n\nInstallation from source\n------------------------\n.. _source_installation:\n\nThe code in this repository constitutes a python package so with the current version of this repository\nit can be installed using\n\n::\n\n        pip install .\n\noptionally it can be installed in *editable mode* with\n\n::\n\n        pip install --editable .\n\nEditable mode allows changes made in the repository code to affect the installed package immediately.\n\nUsage\n-----\nThe software is built to be a command line tool. After either pypi_installation_ or source_installation_, the ``toa-simulator`` command will\nbe available on the command line.\n\nAll commands and subcommands provide a ``help`` function that lists all available options and shows how\nthe command is to be called. The tool is quite sensitive to the exact order in whitch options, arguments\nand subcommands are written, please stick to the format outlined in the ``help`` section of the tool.\n\nThe ``toa-simulator`` has a total of 5 subcommands.\n* The ``generate-data`` subcommand generates uniformily distributed events from 0 to 25000ps and converts them to ToA codes using the ToA software simulation.\n* The ``convert-data`` subcommand reads in arrival times from an input file and converts them to ToA codes which are written to ``stdout`` or a file\n* The ``histogram`` generates uniformily distributed random arrival times and creates a histogram of the resulting ToA codes. Code distributions for different \nslow control configurations of the ToA can be drawn into the same plot.\n\n* The ``plot-timing`` shows a view of the internal state of the TDC and describes how the TDC-code was generated.\n\nPersistent configuration\n------------------------\nIf the command line utility is run multiple times in a row, it generates a new TDC with slightly different\ncharacteristics (in the same way the fabrication process would generate a slightly different behaviour for\neach instance of the TDC. To acheive reliable results the exact internal state can be written to a config\nfile for use in later invocations.\n\n\nExamples\n========\n\nhistogram\n---------\nThe easiest thing to get going is to run the ``histogram`` command as follows:\n\n::\n\n        toa-simulator histogram 40000 -sh\n\nThis will generate 40000 ToA codes, histogram them and then show the result on the screen. Using the ``-cs`` option we can se the results for different settings\nof the ``CTRL_IN_SIG_CTDC_P_D`` configuration parameter. This would then look like:\n\n::\n\n        toa-simulator histogram 40000 -sh -cs 0 -cs 10 -cs 20 -cs 30\n\nWhich will draw 4 histograms in the same plot, one for each value of ``CTRL_IN_SIG_CTDC_P_D`` and show them together in the same histogram.\n\nconvert-data\n------------\nTo convert data generated externally to the toa-simulator the ``convert-data`` subcommand can be used. The convert data function reads in data from a file\nthat looks similar to:\n\n::\n\n        Here we have some meta information\n        Arrival Time [ps]\n        402.3\n        102.2\n        803.2\n        444\n        579\n        913\n        8799\n\nEach line has to have a single number on is that represents the arrival time that is to be converted. It can have arbitrarily many header lines.\nThe number of header-lines need to be passed to the ``convert-data`` command in the ``-s`` option (see the ``toa-simulator convert-data help``).\nIt will produce a new-line separated sequence of ToA codes on ``stdout``, or optionally write the output to a file. The position of the output Code\ncorresponds to the position of the arrival time-stamp in the input.\n\nTo process the above file with the path ``example_input.txt`` the following command can be used to output the resulting ToA codes into the console:\n\n::\n\n        toa-simulator convert-data example-input.txt\n\n\n",
    "bugtrack_url": null,
    "license": "GPL3",
    "summary": "Application that simulates the two-stage TDC implemented in the HGCROCv3 ASIC",
    "version": "0.4.5",
    "split_keywords": [
        "simulation",
        "electronics",
        "science"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dfcfd4a45b63cfb515e3fef272113266824a4f145572a4f505bafa51ecda9faf",
                "md5": "205f7877dcf606bfd82680388f65098b",
                "sha256": "308d18b53286aede47626fc6019616811504503ffc67318bcf022efc004a117d"
            },
            "downloads": -1,
            "filename": "hgcroc_toa_simulator-0.4.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "205f7877dcf606bfd82680388f65098b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 32989,
            "upload_time": "2023-03-29T09:34:05",
            "upload_time_iso_8601": "2023-03-29T09:34:05.834387Z",
            "url": "https://files.pythonhosted.org/packages/df/cf/d4a45b63cfb515e3fef272113266824a4f145572a4f505bafa51ecda9faf/hgcroc_toa_simulator-0.4.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8e7823c521e5ccf9f5728f851b3e9797e934d2b7e165217160c3374c1ebafea0",
                "md5": "7ec7677a4d68ee0479b991f26f7c3a10",
                "sha256": "a1be64bc14a01163005ad29a836e8936985dd9d3487eee545d6664f326cfc463"
            },
            "downloads": -1,
            "filename": "hgcroc-toa-simulator-0.4.5.tar.gz",
            "has_sig": false,
            "md5_digest": "7ec7677a4d68ee0479b991f26f7c3a10",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 31914,
            "upload_time": "2023-03-29T09:34:17",
            "upload_time_iso_8601": "2023-03-29T09:34:17.821898Z",
            "url": "https://files.pythonhosted.org/packages/8e/78/23c521e5ccf9f5728f851b3e9797e934d2b7e165217160c3374c1ebafea0/hgcroc-toa-simulator-0.4.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-29 09:34:17",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "hgcroc-toa-simulator"
}
        
Elapsed time: 0.05021s