{"id":20646212,"url":"https://github.com/dpscience/dltpulsegenerator","last_synced_at":"2025-06-25T02:03:23.379Z","repository":{"id":61180581,"uuid":"120616873","full_name":"dpscience/DLTPulseGenerator","owner":"dpscience","description":"DLTPulseGenerator - A library for the simulation of lifetime spectra based on realistically modelled detector-output pulses","archived":false,"fork":false,"pushed_at":"2022-10-10T15:03:29.000Z","size":2585,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-16T02:52:45.162Z","etag":null,"topics":["antimatter","apd","detector","digtizer","drs4","drs4-evaluation-board","flim","fluorescence-microscopy-imaging","generated-pulses","lifetime-spectra","lifetime-spectroscopy","pals","photodiodes","photomultiplier","positron","positron-lifetime-spectra","pulse","signal-processing","simulation","simulator"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dpscience.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-07T13:12:15.000Z","updated_at":"2022-08-29T08:23:59.000Z","dependencies_parsed_at":"2022-10-12T06:50:42.375Z","dependency_job_id":null,"html_url":"https://github.com/dpscience/DLTPulseGenerator","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/dpscience/DLTPulseGenerator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpscience%2FDLTPulseGenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpscience%2FDLTPulseGenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpscience%2FDLTPulseGenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpscience%2FDLTPulseGenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dpscience","download_url":"https://codeload.github.com/dpscience/DLTPulseGenerator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpscience%2FDLTPulseGenerator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261789229,"owners_count":23209774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["antimatter","apd","detector","digtizer","drs4","drs4-evaluation-board","flim","fluorescence-microscopy-imaging","generated-pulses","lifetime-spectra","lifetime-spectroscopy","pals","photodiodes","photomultiplier","positron","positron-lifetime-spectra","pulse","signal-processing","simulation","simulator"],"created_at":"2024-11-16T16:24:45.148Z","updated_at":"2025-06-25T02:03:23.357Z","avatar_url":"https://github.com/dpscience.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"![badge-OS](https://img.shields.io/badge/OS-tested%20under%20Windows%2010-brightgreen)\n![badge-OS](https://img.shields.io/badge/OS-tested%20under%20Windows%2011-brightgreen)\n\nSupport this project and keep always updated about recent software releases, bug fixes and major improvements by [following on researchgate](https://www.researchgate.net/project/DDRS4PALS-a-software-for-the-acquisition-and-simulation-of-positron-annihilation-lifetime-spectra-PALS-using-the-DRS4-evaluation-board) or [github](https://github.com/dpscience?tab=followers).\n\n[![badge-researchGate](https://img.shields.io/badge/project-researchGate-brightgreen)](https://www.researchgate.net/project/DDRS4PALS-a-software-for-the-acquisition-and-simulation-of-positron-annihilation-lifetime-spectra-PALS-using-the-DRS4-evaluation-board)\n\n![badge-followers](https://img.shields.io/github/followers/dpscience?style=social)\n![badge-stars](https://img.shields.io/github/stars/dpscience/DLTPulseGenerator?style=social)\n![badge-forks](https://img.shields.io/github/forks/dpscience/DLTPulseGenerator?style=social)\n\n# DLTPulseGenerator\n\n![badge-OS](https://img.shields.io/badge/OS-Windows-blue)\n![badge-language](https://img.shields.io/badge/language-C++-blue)\n![badge-language](https://img.shields.io/badge/language-Python-blue)\n![badge-license](https://img.shields.io/badge/license-BSD-blue)\n\nCopyright (c) 2016-2022 Dr. Danny Petschke (danny.petschke@uni-wuerzburg.de). All rights reserved.\u003cbr\u003e\u003cbr\u003e\n\u003cb\u003eDLTPulseGenerator\u003c/b\u003e - A library for the simulation of lifetime spectra based on detector-output pulses.\n\n### ``Software Applications using DLTPulseGenerator Library``\n\n\u003cb\u003e[DDRS4PALS](https://github.com/dpscience/DDRS4PALS) software\u003c/b\u003e written by Danny Petschke.\n\n# Quickstart Guide\n\n### ``C++ Example Code``\n\n```c++\n#define forever                 while(true)\n#define DDELETE_SAFETY(__ptr__) { if (__ptr__) { delete __ptr__; __ptr__ = nullptr; } }\n\nint main() {\n  printf(\"let's go ...\\n\\n\");\n\n  /* 1a. define your virtual setup and desired spectrum to be simulated */\n  \n  DLTSetup setup                     = DLTSetup_DEMO; \n  DLTPulse pulse                     = DLTPulse_DEMO; \n  DLTPHS phs                         = DLTPHS_DEMO; \n  DLTSimulationInput simulationInput = DLTSimulationInput_DEMO; \n  \n  /* 1b. set the trigger-levels for both detector branches A and B */\n  \n  const double triggerA_in_mV = 50.0;\n  const double triggerB_in_mV = 50.0;\n  \n  /* 2. create an instance of DLTPulseGenerator class and pass your setup information and simulation input */\n  \n  DLTPulseGenerator *pulseGenerator = new DLTPulseGenerator(simulationInput, phs, setup, pulse, nullptr);\n  \n  /* pulses to be manipulated by calling 'emitPulses(..)' */\n  \n  DLTPulseF pulseA, pulseB;\n  \n  forever {\n    /* receive the pulses */ \n    \n    if (pulseGenerator-\u003eemitPulses(\u0026pulseA, \u0026pulseB, triggerA_in_mV, triggerB_in_mV)) {\n    \n      /* now its your turn ... use the generated pulses for whatever purposes ... for example ... */\n      \n      /* const double timingA = determineCFTiming(pulseA, level=50.);\n\t const double timingB = determineCFTiming(pulseB, level=50.);\n\n\t const double lifetime = calcTimeDifference(timingA, timingB);\n\n\t ... add to the lifetime spectrum ... */\n    }\n    else\n      break;\n  }\n  \n  DDELETE_SAFETY(pulseGenerator)\n}\n```\n\n### ``Python Example Code``\n\nDLTPulseGenerator can be compiled as linked library enabling access from programming languages such as Python (or Matlab).\n\nA library wrapper for Python ([pyDLTPulseGenerator.py](https://github.com/dpscience/DLTPulseGenerator/tree/master/pyDLTPulseGenerator)) demonstrating the usage of [ctypes-library](https://docs.python.org/3/library/ctypes.html) is provided (see [pyDLTPulseGeneratorApp.py](https://github.com/dpscience/DLTPulseGenerator/blob/master/pyDLTPulseGenerator/pyDLTPulseGenerator.py)). \n\nExamples can be found ([here](https://github.com/dpscience/DLTPulseGenerator/tree/master/pyDLTPulseGenerator)).\n\n```python\nimport pyDLTPulseGenerator as dpg # import 'pyDLTPulseGenerator' module\nimport matplotlib.pyplot as plt\n\nnumberOfPulses = 100000 # number of pulses to be generated ...\n\n# set trigger levels for branches A \u0026 B [mV] ...\n    \ntriggerA = -25. # [mV]\ntriggerB = -25. # [mV]\n\n# define your simulation input (or apply the defaults) ...\n    \nlt          = dpg.DLTSimulationInput()\nsetupInfo   = dpg.DLTSetup()\npulseInfo   = dpg.DLTPulse()\nphs         = dpg.DLTPHS()\n\n# create an instance of DLTPulseGenerator ...\n    \npulseGen = dpg.DLTPulseGenerator(phs,\n                                 lt,\n                                 setupInfo,\n                                 pulseInfo,\n                                 'dltpulsegenerator.dll')\n\t\t\t\t \t\t\t\n# catch errors ...\n    \nif not pulseGen.printErrorDescription():\n    quit() # kill process on error ...\n\npulseA = dpg.DLTPulseF() # pulse of detector A\npulseB = dpg.DLTPulseF() # pulse of detector B\n\nfor i in range(numberOfPulses):    \n    if not pulseGen.emitPulses(pulseA,pulseB,triggerA,triggerB): # generate pulse pairs ...\n        continue\n\t\n    plt.plot(pulseA.getTime(),pulseA.getVoltage(),'r-',label=\"pulse-A\")\n    plt.plot(pulseB.getTime(),pulseB.getVoltage(),'b-',label=\"pulse-B\")\n    plt.show()\n    \n    // ...\n\n```\n\n# Related Presentation \u0026 Publications\n\n### ``DLTPulseGenerator v1.0``\n\n[![DOI](https://img.shields.io/badge/DOI-10.1016%2Fj.softx.2018.04.002-yellowgreen)](https://doi.org/10.1016/j.softx.2018.04.002)\n\nThis \u003cb\u003e[release v1.0](https://github.com/dpscience/DLTPulseGenerator/releases/tag/1.0)\u003c/b\u003e refers to the \u003cb\u003eoriginal paper by Petschke \u003ci\u003eet al.\u003c/i\u003e published in SoftwareX (Elsevier, 2018)\u003c/b\u003e \n\n[DLTPulseGenerator: A library for the simulation of lifetime spectra based on detector-output pulses](https://doi.org/10.1016/j.softx.2018.04.002)\u003cbr\u003e\n\nand provides the simulation of lifetime spectra consisting of \u003ci\u003ediscrete characteristic lifetimes\u003c/i\u003e based on detector-output pulses modelled by a log-normal distribution function.\n\n![SoftX_1_0](/images/softxPub.png)\n\n### ``DLTPulseGenerator v1.1``\n\n[![DOI](https://img.shields.io/badge/DOI-10.1016%2Fj.softx.2018.05.001-yellowgreen)](https://doi.org/10.1016/j.softx.2018.05.001)\n\nThis \u003cb\u003e[release v1.1](https://github.com/dpscience/DLTPulseGenerator/releases/tag/1.1)\u003c/b\u003e refers to the \u003cb\u003eupdate paper (v1.1) by Petschke \u003ci\u003eet al.\u003c/i\u003e published in SoftwareX (Elsevier, 2018)\u003c/b\u003e \n\n[Update (v1.1) to DLTPulseGenerator: A library for the simulation of lifetime spectra based on detector-output pulses](https://doi.org/10.1016/j.softx.2018.05.001)\u003cbr\u003e\n\nand provides the simulation of lifetime spectra consisting of \u003ci\u003edistributed characteristic lifetimes\u003c/i\u003e as can be found in porous materials such as polymers or glasses due to distributions in their pore-sizes.\n\n![SoftX_1_1](/images/softxPub_1_1.png)\n\n### ``DLTPulseGenerator v1.2``\n\n[![DOI](https://img.shields.io/badge/DOI-10.1016%2Fj.softx.2018.06.003-yellowgreen)](https://doi.org/10.1016/j.softx.2018.06.003)\n\nThis \u003cb\u003e[release v1.2](https://github.com/dpscience/DLTPulseGenerator/releases/tag/1.2)\u003c/b\u003e refers to the \u003cb\u003eupdate paper (v1.2) by Petschke \u003ci\u003eet al.\u003c/i\u003e published in SoftwareX (Elsevier, 2018)\u003c/b\u003e\n\n[Update (v1.2) to DLTPulseGenerator: A library for the simulation of lifetime spectra based on detector-output pulses](https://doi.org/10.1016/j.softx.2018.06.003)\u003cbr\u003e\n\nand enables the simulation of lifetime spectra consisting of non-Gaussian or any-distributed and linearly combined Instrument Response Functions (IRF) for the PDS A/B and MU.\n\n![SoftX_1_2](/images/softxPub_1_2.png)\n\n### ``DLTPulseGenerator v1.3``\n\n[![DOI](https://img.shields.io/badge/DOI-10.1016%2Fj.softx.2019.02.003-yellowgreen)](https://doi.org/10.1016/j.softx.2019.02.003)\n\nThis \u003cb\u003e[release v1.3](https://github.com/dpscience/DLTPulseGenerator/releases/tag/1.3)\u003c/b\u003e refers to the \u003cb\u003eupdate paper (v1.3) by Petschke \u003ci\u003eet al.\u003c/i\u003e published in SoftwareX (Elsevier, 2019)\u003c/b\u003e\n\n[Update (v1.3) to DLTPulseGenerator: A library for the simulation of lifetime spectra based on detector-output pulses](https://doi.org/10.1016/j.softx.2019.02.003)\u003cbr\u003e\n\nand provides the simulation of realistic hardware influences mainly originating from the parts of the A/D converter such as baseline-offset jitter, random noise, fixed pattern and random aperture jitters on the time axis or the digitization depth.\n\n![SoftX_1_3](/images/softxPub_1_3.png)\n\n### ``DLTPulseGenerator v1.4``\n### ``DLTPulseGenerator v1.5``\n\n\u003cb\u003eDLTPulseGenerator v1.4 and 1.5\u003c/b\u003e\u003cbr\u003e[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.718134.svg)](https://doi.org/10.5281/zenodo.718134)\u003cbr\u003e\nThis \u003cb\u003e[release v1.5](https://github.com/dpscience/DLTPulseGenerator/releases/tag/1.5)\u003c/b\u003e enables the incorporation of pulse height spectra (PHS) from real data or\ngenerated by Geant4, so that effects on the background contributing to the lifetime spectra with regard to the PHS window settings can be studied more realistically.\n\n### ``Presentation at 18th International Conference on Positron Annihilation (ICPA-18) in Orlando (Aug. 2018)``\n\n[ICPA-18 (Orlando): DLTPulseGenerator - A C/C++ library for the simulation of lifetime spectra based on detector output-pulses](https://www.researchgate.net/publication/329782711_ICPA-18_Orlando_DLTPulseGenerator_-_A_CC_library_for_the_simulation_of_lifetime_spectra_based_on_detector_output-pulses)\u003cbr\u003e\n\n# How to cite this Library?\n\n* \u003cb\u003eYou should at least cite the following publication.\u003c/b\u003e\u003cbr\u003e\n\n[![DOI](https://img.shields.io/badge/DOI-10.1016%2Fj.softx.2018.04.002-yellowgreen)](https://doi.org/10.1016/j.softx.2018.04.002)\n\n[DLTPulseGenerator: A library for the simulation of lifetime spectra based on detector-output pulses (SoftwareX 2018, Elsevier)](https://doi.org/10.1016/j.softx.2018.04.002)\u003cbr\u003e\u003cbr\u003e\n\n* \u003cb\u003eAdditionally, you should cite the version of DLTPulseGenerator library used in your study.\u003c/b\u003e\u003cbr\u003e\n\nYou can cite all released software versions by using the \u003cb\u003eDOI 10.5281/zenodo.7031107\u003c/b\u003e. This DOI represents all versions, and will always resolve to the latest one.\u003cbr\u003e\n\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7031107.svg)](https://doi.org/10.5281/zenodo.7031107)\n\n# License of DLTPulseGenerator (BSD-3-Clause)\n\nCopyright (c) 2016-2022 Dr. Danny Petschke (danny.petschke@uni-wuerzburg.de). All rights reserved.\u003cbr\u003e\n\nRedistribution and use in source and binary forms, with or without modification,\u003cbr\u003e \nare permitted provided that the following conditions are met:\u003cbr\u003e\u003cbr\u003e\n\n 1. Redistributions of source code must retain the above copyright notice\u003cbr\u003e\n    this list of conditions and the following disclaimer.\u003cbr\u003e\u003cbr\u003e\n\n 2. Redistributions in binary form must reproduce the above copyright notice,\u003cbr\u003e \n    this list of conditions and the following disclaimer in the documentation\u003cbr\u003e \n    and/or other materials provided with the distribution.\u003cbr\u003e\u003cbr\u003e\n\n 3. Neither the name of the copyright holder \"Danny Petschke\" nor the names of\u003cbr\u003e \n    its contributors may be used to endorse or promote products derived from \u003cbr\u003e\n    this software without specific prior written permission.\u003cbr\u003e\u003cbr\u003e\n\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\u003cbr\u003e \n OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\u003cbr\u003e \n MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\u003cbr\u003e \n COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\u003cbr\u003e \n EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\u003cbr\u003e \n SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\u003cbr\u003e \n HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\u003cbr\u003e \n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\u003cbr\u003e \n EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\u003cbr\u003e\n \n see also [BSD-3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpscience%2Fdltpulsegenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdpscience%2Fdltpulsegenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpscience%2Fdltpulsegenerator/lists"}