Metadata-Version: 2.4
Name: TDCRPy
Version: 2.20.38
Summary: TDCR model — Monte Carlo efficiency estimation for liquid scintillation counting
Home-page: https://github.com/RomainCoulon/TDCRPy
Author: Romain Coulon
Author-email: romain.coulon@bipm.org
Project-URL: Documentation, https://github.com/RomainCoulon/TDCRPy/
Project-URL: Bug Tracker, https://github.com/RomainCoulon/TDCRPy/issues
Keywords: TDCR,Monte-Carlo,radionuclide,liquid scintillation,counting
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Natural Language :: French
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENCE.md
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: matplotlib
Requires-Dist: tqdm
Requires-Dist: numba
Requires-Dist: setuptools
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: sphinx; extra == "dev"
Requires-Dist: sphinx-rtd-theme; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license-file
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# TDCRPy

<div align="center">

<img src="docs/logo1.png" alt="TDCRPy Logo" width="200"/>

**A Photo-Physical Stochastic Model for Liquid Scintillation Counting**

![License](https://img.shields.io/badge/license-MIT-blue.svg)
![Python](https://img.shields.io/badge/python-3.11%2B-blue)
![Version](https://img.shields.io/badge/version-2.20.17-green)
![Status](https://img.shields.io/badge/status-stable-green)
![BIPM](https://img.shields.io/badge/maintained%20by-BIPM-005696)

</div>

---

## 📖 Overview

**TDCRPy** is a Python package developed and maintained by the **BIPM** (Bureau International des Poids et Mesures). It estimates detection efficiencies of liquid scintillation counters using the **TDCR** (Triple to Double Coincidence Ratio) or **CIEMAT/NIST** methods.

The calculation is based on a photo-physical stochastic Monte Carlo model, allowing users to address:

* Complex decay schemes (beta spectra via BetaShape, gamma interactions via MCNP matrices).
* Radionuclide mixtures with arbitrary activity fractions.
* Ionisation quenching via the Birks model (electrons and alpha particles).
* Prompt and delayed (triplet-triplet annihilation) fluorescence, giving a light yield that depends on the coincidence resolving time (`delayedFluorescence`, off by default, since v2.20.30).
* Reverse micelle effects in cocktails used for aqueous samples — applied automatically, when an aqueous fraction is declared, to the nuclides measured to need it (`micCorrAuto`; the per-nuclide confinement bias was screened across the whole catalogue in [micelleCatalogue.py](notebooks/physics/micelleCatalogue.py), worst cases Ar-37 12.4 %, Ca-41 10.4 %, Fe-55 5.2 %).
* Asymmetric PMT configurations (per-channel free parameters).
* Full optical Monte Carlo transport (`opticalTransport=True`).
* C/N (CIEMAT/NIST) 2-PMT efficiency curves.

Technical details are described in:

* [Coulon et al., *Applied Radiation and Isotopes* (2024)](https://doi.org/10.1016/j.apradiso.2024.111518)
* [Coulon et al., BIPM Technical Report](http://dx.doi.org/10.13140/RG.2.2.15682.80321)

---

## 📦 Installation

TDCRPy requires Python ≥ 3.11 and a standard scientific environment.

```shell
pip install TDCRPy
```

To upgrade to the latest version:

```shell
pip install TDCRPy --upgrade
```

### Run Tests

Verify the installation by running the unit tests:

```shell
python -m unittest tdcrpy.test.test_tdcrpy
```

---

## 🖥 Graphical interface

If you would rather not write a script, there is a window. It runs the model — efficiency at a given light yield, the light yield fitted to a measured TDCR (stochastic or analytical), the efficiency curve ε_D vs TDCR — and shows the data the model rests on: decay data, β spectra, stopping powers and the Birks quenching function. Every result can be exported as CSV and every curve is plotted in the window, ready to save as PNG, PDF or SVG (`matplotlib` is already a dependency, so there is nothing extra to install).

```bash
tdcrpy-gui            # or: python -m tdcrpy.gui
```

### Setting it up on Windows

**1 — Install Python 3.11 or newer, with tcl/tk.** The window is built with `tkinter`, which ships with CPython but is an *optional component* of the python.org installer. Keep **“tcl/tk and IDLE”** ticked (it is on by default), and tick **“Add python.exe to PATH”** on the first screen. The Microsoft Store build of Python includes tkinter as well. Check it worked:

```bat
python -c "import tkinter; print(tkinter.TkVersion)"
```

A version number (8.6 or similar) means you are ready. `ModuleNotFoundError: No module named 'tkinter'` means Python was installed without tcl/tk — re-run the installer, choose **Modify**, and enable it. Nothing else needs installing: the interface adds no dependency of its own.

**2 — Install TDCRPy.** In a Command Prompt or PowerShell:

```bat
python -m pip install --upgrade TDCRPy
```

Using a virtual environment is recommended, because the interface writes the settings you choose into the package’s `config.toml`:

```bat
python -m venv %USERPROFILE%\tdcrpy-env
%USERPROFILE%\tdcrpy-env\Scripts\activate
python -m pip install TDCRPy
```

**3 — Start it.**

```bat
tdcrpy-gui
```

The first run takes longer than later ones — tens of seconds — because `numba` compiles the Monte-Carlo kernel. The window itself appears immediately; it fills the nuclide and cocktail lists once the library has loaded in the background.

**If `tdcrpy-gui` is not recognised**, the launcher was installed somewhere that is not on your `PATH`. This is normal for `pip install --user`. Either call it by its full path, or use the form that never depends on `PATH`:

```bat
python -m tdcrpy.gui
```

To find the launcher:

```bat
python -c "import sysconfig; print(sysconfig.get_path('scripts'))"
```

**4 — Optional: a desktop shortcut.** Right-click the desktop → **New → Shortcut**, and give it the full path to `tdcrpy-gui.exe` printed by the command above, for example:

```
C:\Users\<you>\tdcrpy-env\Scripts\tdcrpy-gui.exe
```

`tdcrpy-gui.exe` is a *windowed* launcher, so it opens no console behind the interface. If you prefer a batch file — useful for a shared instrument PC, where it can activate the environment first — use `pythonw.exe` rather than `python.exe`, or a console window will stay open for as long as the interface does:

```bat
@echo off
call "%USERPROFILE%\tdcrpy-env\Scripts\activate"
start "" pythonw -m tdcrpy.gui
```

### Troubleshooting

| What you see | What it means |
|---|---|
| `No module named 'tkinter'` | Python installed without tcl/tk. Re-run the installer → Modify → enable “tcl/tk and IDLE”. |
| `'tdcrpy-gui' is not recognized` | The Scripts directory is not on `PATH`. Use `python -m tdcrpy.gui`, or the full path. |
| A console window sits behind the interface | You launched it with `python`. Use `tdcrpy-gui` or `pythonw -m tdcrpy.gui`. |
| Nuclide and cocktail lists stay empty | The background enquiry failed; the log pane shows why. Usually a broken install — check `python -c "import tdcrpy"`. |
| `crashed (code …)` in the status bar | A fault inside the Monte-Carlo kernel, not a problem with your inputs. Re-running usually succeeds. |
| Results differ slightly between identical runs | Expected: the model is a Monte Carlo. Raise *Number of decays N*; the reported uncertainties scale as 1/√N. |

The window is laid out like a desktop application:

| Area | What it holds |
|---|---|
| **Calculations** (sidebar) | Efficiency at a given L · Fit L to a TDCR (stochastic or analytical) · Efficiency curve ε_D vs TDCR |
| **Data & plots** (sidebar) | **Decay data** — branches, γ rays and conversion electrons per decay, as read from PenNuc · **β spectrum** — any transition in the BetaShape archive · **Stopping power** — electrons (one model, or all six side by side) or α particles (ASTAR) · **Ionisation quenching** — Q(E) and Q/E for one or several kB |
| **Input tabs** | Source, Data & plots, Scintillator, Micelles, Delayed fluorescence, Counter. On *Source*, pick a nuclide from the list, give its activity fraction and press *Add*; repeat for a mixture (*Normalise* turns activities or ratios into fractions) |
| **Results** | *Table* (with uncertainties), *Plot* (zoom, pan, save), *Decay view* (with *Verbose log and decay view* ticked: each simulated decay drawn step by step — the sampled decay, the particles emitted, the energy each deposits and how it got there (escaped, Compton, photoabsorbed), the light left after Birks quenching, the mean photoelectrons per PMT and the single/double/triple probabilities; browse decay by decay, save as JSON), *Sources* (where the decay data come from: DDEP evaluation date and LNHB tables, atomic-data evaluator, BetaShape version and citation of every spectrum) and *Log* (the model's own messages, including the reverse-micelle advisories) |
| **Help menu** | Online documentation, example notebooks, the reference paper, the BIPM technical report, issue tracker, *Check for updates…*, licence and *About* |

*Export CSV…* writes the table at full precision, UTF-8 so a spreadsheet shows β and γ correctly, preceded by `#` lines recording the TDCRPy version, the calculation and every setting used (`pandas.read_csv(path, comment='#')` skips them). *Save plot…* writes PNG, PDF or SVG at 300 dpi. F5 runs, Esc cancels, Ctrl+S exports.

The light yield L starts at the typical value for the chosen cocktail (see [Typical light yield per cocktail](#typical-light-yield-per-cocktail)), and follows the cocktail until you type a value of your own. *Propagate nuclear-data uncertainty* repeats the run M times, each on one random realisation of the emission probabilities, and reports the Monte-Carlo and nuclear-data components separately (see [Nuclear-data uncertainty](#nuclear-data-uncertainty)).

Things worth knowing:

* **Running writes your settings to the package `config.toml`**, which scripts and notebooks share. The window snapshots that file when it opens, and *Undo my config changes* puts it back; *Restore shipped defaults* replaces it with `configDefault.toml`.
* Each calculation runs in a **separate process**, so the window stays responsive, *Cancel* is immediate, and a native crash in the Monte-Carlo kernel is reported rather than taking the interface with it.
* **Help ▸ Check for updates…** asks PyPI for the latest release. *Update now* closes the window, lets a small helper install the new version with pip, and reopens it. The update has to happen after the window closes: on Windows, pip cannot replace files that a running program holds open, and a failed attempt leaves a half-uninstalled package. For the same reason the helper first checks that no other program (a Jupyter kernel, a script) still has TDCRPy open, and changes nothing if one does. A source checkout (editable install) is updated with `git pull` instead, and the window says so.

The interface needs no extra dependency — `tkinter` ships with CPython — and the nuclide list, cocktail list and defaults are read from the installed library, never duplicated in the GUI.

## ⚡ Quick Start

Estimate detection efficiencies for **Co-60** using the full stochastic model.

```python
import tdcrpy

L    = 1.2      # free parameter (photons keV⁻¹)
Rad  = "Co-60"  # radionuclide
pmf  = "1"      # activity fraction (100 %)
N    = 10000    # Monte Carlo trials (≥ 10 000 recommended)
kB   = 1.0e-5   # Birks constant (cm keV⁻¹)
V    = 10       # scintillator volume (mL)

result = tdcrpy.TDCRPy.TDCRPy(L, Rad, pmf, N, kB, V)

print(f"eff_S = {result[0]:.4f} ± {result[1]:.4f}")   # single events
print(f"eff_D = {result[2]:.4f} ± {result[3]:.4f}")   # double coincidences
print(f"eff_T = {result[4]:.4f} ± {result[5]:.4f}")   # triple coincidences
```

### Find L from a Measured TDCR Ratio

```python
TD = 0.9776   # measured T/D ratio
result = tdcrpy.TDCRPy.eff(TD, Rad, pmf, kB, V)

print(f"L = {result[0]:.4f} photons/keV")
print(f"eff_T = {result[6]:.4f} ± {result[7]:.4f}")
```

---

## 🛠 Advanced Features

### Asymmetric PMT Configuration

Pass a 3-tuple for the free parameter to model per-channel asymmetry:

```python
L = (1.1, 1.3, 1.2)   # (L_A, L_B, L_C) in photons keV⁻¹
result = tdcrpy.TDCRPy.TDCRPy(L, "Co-60", "1", N, kB, V)

print(f"eff_AB = {result[6]:.4f}")   # A–B double coincidences
print(f"eff_BC = {result[8]:.4f}")
print(f"eff_AC = {result[10]:.4f}")
```

### Radionuclide Mixtures

Provide comma-separated nuclides and their relative activity fractions:

```python
result = tdcrpy.TDCRPy.TDCRPy(L, "Co-60, H-3", "0.8, 0.2", N, kB, V)
```

### Typical light yield per cocktail

`defaultL()` returns a typical L for a cocktail — a sensible fixed value, or the initial guess of a fit. The values are fitted to measured TDCR and pooled over Fe-55, S-35 and Tc-99 sources (mean ± spread, number of determinations):

| Cocktail | L / keV⁻¹ |
|---|---|
| Ultima Gold (default) | 5.92 ± 0.26 (17) |
| Ultima Gold AB | 5.83 ± 0.40 (12) |
| Ultima Gold LLT | 5.72 ± 0.42 (11) |
| ProSafe+ | 4.62 ± 0.36 (16) |
| Hionic-Fluor | 3.90 ± 0.29 (16) |

L depends on the counter as well as the cocktail, so these are starting points, not constants. A cocktail without a measured value gets the Ultima Gold one, flagged as a stand-in:

```python
L, spread, measured = tdcrpy.TDCR_model_lib.defaultL("ProSafe+")   # 4.62, 0.36, True
```

### Nuclear-data uncertainty

With `uncData=True`, a run uses **one random realisation** of the nuclear data: each γ, conversion-electron, X-ray and Auger emission probability is drawn once from a normal distribution of its stated uncertainty (truncated at zero) and kept for all N decays. Branch (β, EC, α) intensities are not perturbed. The uncertainty is the spread of repeated runs, less their Monte-Carlo variance:

```python
import numpy as np
runs = [tdcrpy.TDCRPy.TDCRPy(L, "I-125", "1", N, kB, V, uncData=True) for _ in range(20)]
eff_D, u_mc = np.array([r[2] for r in runs]), np.array([r[3] for r in runs])
u_data = np.sqrt(max(eff_D.var(ddof=1) - np.mean(u_mc**2), 0.0))
```

`eff()` takes `uncData` too. Before 2.20.37 the probabilities were redrawn for every decay, which averages back to the nominal data over a run — the option then propagated nothing. The data component is often small next to the Monte-Carlo noise: resolving it needs large N, and the window reports an upper bound when it is not resolved.

### Decay-data provenance

`decayDataInfo(rad)` says where the data of a nuclide come from, read from the shipped files themselves: the DDEP evaluation date and the LNHB tables, the evaluator and literature cut-off of the X-ray/Auger data, and the BetaShape version, transition type, end point and citation of every β spectrum.

```python
info = tdcrpy.TDCR_model_lib.decayDataInfo("Sr-90")
info["nuclear"]["evaluation_date"]          # '10/05/2005'
[b["program"] for b in info["beta"]]        # ['Beta Spectrum from BetaShape 2.4 (05/2024), ...', 'BetaShape 2.3.1 (12/2023)']
```

### Analytical Model (Pure Beta Emitters)

A faster, deterministic alternative for pure β⁻ nuclides:

```python
# Returns (L0, L_opt, eff_S, eff_D, eff_T)
result = tdcrpy.TDCRPy.effA(TD, "H-3", "1", kB, V)

print(f"L0 = {result[0]:.4f} photons/keV")
print(f"eff_T = {result[4]:.4f}")
```

### Full Optical Monte Carlo Transport

Enable stochastic photon-transport for each event: photons are sampled
from a Poisson distribution, distributed equally among PMTs, and converted
to photoelectrons via Binomial draws (quantum efficiency):

```python
result = tdcrpy.TDCRPy.TDCRPy(L, Rad, pmf, N, kB, V, opticalTransport=True)
```

### C/N Efficiency Curve

Compute the **CIEMAT/NIST efficiency curve** — detection efficiency as a
function of the free parameter *L* for a 2-PMT coincidence system:

```python
import numpy as np
import matplotlib.pyplot as plt
import tdcrpy.TDCR_model_lib as tl

rad = "H-3"
kB  = 1e-5   # Birks constant (cm keV⁻¹)
V   = 10     # volume (mL)
ne  = 1000   # quenching integration bins

L_vec = np.linspace(1, 20, 80)
eff_D = np.array([tl.modelAnalyticalCN(L, rad, kB, V, ne)[2] for L in L_vec])

plt.plot(L_vec, eff_D)
plt.xlabel("L (photons keV⁻¹)")
plt.ylabel("eff_D (double coincidence)")
plt.title(f"C/N efficiency curve — {rad}")
plt.grid(True)
plt.show()
```

To find *L* from a measured C/N counting ratio `CN` (counts_D / counts_S):

```python
from scipy.optimize import brentq

CN_meas = 0.62   # measured D/S ratio

def residual(L):
    eA, eB, eD = tl.modelAnalyticalCN(L, rad, kB, V, ne)
    return eD / ((eA + eB) / 2) - CN_meas

L0 = brentq(residual, 0.5, 30)
_, _, eff_D = tl.modelAnalyticalCN(L0, rad, kB, V, ne)
print(f"L = {L0:.3f} photons/keV,  eff_D = {eff_D:.5f}")
```

---

## ⚙️ Configuration & Physics

Display the current physics settings:

```python
import tdcrpy as td
td.TDCR_model_lib.readParameters(disp=True)
```

### Configuration Reference

| Parameter | Setter | Default | Unit | Description |
| :--- | :--- | :---: | :---: | :--- |
| Electron bins | `modifynE_electron(n)` | 1000 | — | Integration bins for electron quenching |
| Alpha bins | `modifynE_alpha(n)` | 1000 | — | Integration bins for alpha quenching |
| Stopping power | `modifysp_model(m)` | `tan_xia` | — | Low-energy model (`tan_xia`, `joy_luo`, …) |
| Birks parameter | `modifyChou_param(k)` | 0 | cm²/MeV² | Chou bimolecular quenching constant |
| Density | `modifyDensity(ρ)` | 0.98 | g/cm³ | Scintillator density (Ultima Gold) |
| Mean Z / A | `modifyZ(z)`, `modifyA(a)` | 3.25 / 5.94 | — | Effective atomic/mass number |
| Cocktail | `modifyLScocktail(name, fAq)` | `Ultima Gold` | — | LS cocktail + aqueous fraction |
| Micelle correction | `modifyMicCorr(b)` | False | — | Force the reverse-micelle correction on for every nuclide |
| Micelle auto-activation | `modifyMicCorrAuto(b)` | True | — | Apply it by itself to electron-capture nuclides when `fAq > 0`, warning once per nuclide |
| Bias threshold | `modifyMicCorrBiasThreshold(b)` | 0.01 | % | Measured confinement bias above which a nuclide self-activates (`Micelle/micelleBias.csv`) |
| EC threshold | `modifyMicCorrECThreshold(p)` | 0.01 | — | Fallback gate, for a nuclide absent from the bias table |
| Micelle diameter | `modifyDiam_micelle(d)` | 4 | nm | Mean micelle **diameter** (Bergeron 2012) |
| Micelle dispersion | `modifySigma_micelle(s)` | 0 | nm | Size spread; 0 = monodisperse |
| Delayed fluorescence | `modifyDelayedFluorescence(b)` | False | — | Prompt + delayed (TTA) light-yield model; makes the light yield depend on the coincidence window |
| Prompt decay time | `modifyTau_prompt(t)` | 3.0 | ns | `τ_p` — a measured cocktail constant, never fitted |
| Delayed capture time | `modifyTau_delayed(t)` | 85 | ns | `τ_d` — 85 (Ultima Gold family), 138 (toluene); re-derived by `modifyLScocktail` |
| Delayed amplitude | `modifyEta_delayed(e)` | 0.03 | — | `η` — 0.03 (Ultima Gold family), 0.05 (toluene) |
| TTA kinetics | `modifyTTAkinetics(k_q, gamma, A_c)` | 5e6, 1e-11, 1e-13 | s⁻¹, cm³s⁻¹, cm² | Constants behind `S_a` = 1666.7 keV/cm |
| Quantum efficiency | `modifyEffQ(q)` | `0.25,0.25,0.25` | — | PMT quantum efficiencies (A, B, C) |
| Optical transport | `modifyOpticalTransport(b)` | False | — | Enable full optical MC transport |
| Resolving time | `modifyTau(τ)` | 50 | ns | Coincidence resolving time |
| Dead time | `modifyDeadTime(t)` | 30 | µs | Extended dead time |
| Measurement time | `modifyMeasTime(T)` | 60 | min | Measurement duration |

---

## 📓 Notebooks

Notebooks are organised in subfolders by topic under [`notebooks/`](https://github.com/RomainCoulon/TDCRPy/tree/main/notebooks).

### Getting started — [`notebooks/getting_started/`](https://github.com/RomainCoulon/TDCRPy/tree/main/notebooks/getting_started)

| Notebook | Description |
| :--- | :--- |
| [tuturial.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/getting_started/tuturial.ipynb) | **End-to-end tutorial**: fixed-L efficiencies, TDCR fitting (symmetric and asymmetric), radionuclide mixtures, full optical MC transport |
| [changeParameters.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/getting_started/changeParameters.ipynb) | **Configuration**: how to modify every physics parameter (quenching bins, stopping power model, cocktail, PMT efficiencies, dead time…) |

### Detection models — [`notebooks/models/`](https://github.com/RomainCoulon/TDCRPy/tree/main/notebooks/models)

| Notebook | Description |
| :--- | :--- |
| [analyticalModel.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/models/analyticalModel.ipynb) | **Analytical model** (`effA`): fast beta-spectrum-based efficiency for pure β emitters; symmetric and asymmetric PMT configurations |
| [CNmethod.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/models/CNmethod.ipynb) | **CIEMAT/NIST (C/N) method**: 2-PMT coincidence efficiency curve using `modelAnalyticalCN`; L-fitting from measured C/N ratio |
| [cerenkovModel.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/models/cerenkovModel.ipynb) | **Čerenkov counting model**: Frank-Tamm-based efficiency for high-energy beta emitters |
| [cerenkovY90.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/models/cerenkovY90.ipynb) | **Čerenkov model, worked example (Y-90)**: threshold physics, Frank-Tamm photon yield, efficiency vs L, fitting L from a measured TDCR (symmetric and 3-PMT), optical parameters, and ⁹⁰Sr/⁹⁰Y discrimination |
| [opticalTransport.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/models/opticalTransport.ipynb) | **Optical MC transport**: comparison of semi-analytical vs full photon-transport model (`opticalTransport=True`) for H-3, Fe-55, Co-60 |

### Nuclide case studies — [`notebooks/nuclides/`](https://github.com/RomainCoulon/TDCRPy/tree/main/notebooks/nuclides)

| Notebook | Description |
| :--- | :--- |
| [H-3.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/nuclides/H-3.ipynb) | **Tritium (H-3)**: low-energy pure β; analytical and stochastic efficiency, micelle correction effect |
| [Co-60.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/nuclides/Co-60.ipynb) | **Co-60**: γ-emitter with complex decay; analytical approximation vs full stochastic model |
| [Fe-55.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/nuclides/Fe-55.ipynb) | **Fe-55**: electron-capture nuclide producing Mn K-α X-rays and Auger electrons |
| [Sr-90_Y-90.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/nuclides/Sr-90_Y-90.ipynb) | **Sr-90/Y-90 mixture**: secular equilibrium of two pure β emitters (0.546 and 2.28 MeV endpoints) |
| [Zr-93.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/nuclides/Zr-93.ipynb) | **Zr-93**: β/EC branching ratio nuclide with X-ray emission |

### Physics sub-models — [`notebooks/physics/`](https://github.com/RomainCoulon/TDCRPy/tree/main/notebooks/physics)

| Notebook | Description |
| :--- | :--- |
| [quenchingModel.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/physics/quenchingModel.ipynb) | **Birks quenching**: quenched energy vs initial energy for electrons and α particles as a function of kB |
| [stoppingPower.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/physics/stoppingPower.ipynb) | **Stopping power models**: comparison of tan_xia, joy_luo, ashley and other models for electrons |
| [readBetaSpectrum.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/physics/readBetaSpectrum.ipynb) | **Beta spectra**: reading and visualising deposited-energy spectra from BetaShape + MCNP calculations |
| [interaction.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/physics/interaction.ipynb) | **Radiation–matter interactions**: photon and electron energy deposition via MCNP response matrices |
| [micelleEffects.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/physics/micelleEffects.ipynb) | **Micellar quenching**: stochastic reverse-micelle model (`micCorr`); microscopic energy-retention factor and its impact on efficiency for H-3, Fe-55, Ni-63, C-14, Tc-99, at fixed L and with `eff()` TDCR calibration |

### Advanced — [`notebooks/advanced/`](https://github.com/RomainCoulon/TDCRPy/tree/main/notebooks/advanced)

| Notebook | Description |
| :--- | :--- |
| [mixture.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/advanced/mixture.ipynb) | **Radionuclide mixtures**: efficiency of arbitrary multi-component samples with activity fractions |
| [efficiencyCuve.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/advanced/efficiencyCuve.ipynb) | **TDCR efficiency curve**: eff_D and eff_T vs light yield L for a series of kB values |
| [distrubutionTDCR.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/advanced/distrubutionTDCR.ipynb) | **TDCR distribution**: histogram of per-event efficiency values over MC trials; statistical characterisation |
| [cocktailComposition.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/advanced/cocktailComposition.ipynb) | **Cocktail composition**: effect of aqueous fraction (H₂O / HCl) on detection efficiency for H-3 and Sr-90 |
| [cocktailResponse.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/advanced/cocktailResponse.ipynb) | **Cocktail comparison**: eff_D for 12 commercial LS cocktails × 6 nuclides (H-3, C-14, Fe-55, Cr-51, Co-60, Cd-109) |

### Sensitivity — [`notebooks/sensitivity/`](https://github.com/RomainCoulon/TDCRPy/tree/main/notebooks/sensitivity)

| Notebook | Description |
| :--- | :--- |
| [parameterSensitivity.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/sensitivity/parameterSensitivity.ipynb) | **Parameter sensitivity study**: sweeps every tunable model parameter (L, kB, PMT quantum efficiency, cocktail composition, stopping-power model, quenching numerics, micelle correction, counting-chain parameters, optical transport, MC convergence) around its nominal value for H-3 and Sr-90, with a summary tornado chart |

### Validation — [`notebooks/validation/`](https://github.com/RomainCoulon/TDCRPy/tree/main/notebooks/validation)

| Notebook | Description |
| :--- | :--- |
| [functional_validation.ipynb](https://github.com/RomainCoulon/TDCRPy/blob/main/notebooks/validation/functional_validation.ipynb) | **Cross-version validation**: compare two TDCRPy versions side-by-side for H-3, Fe-55, Co-60, Sr-90, Cd-109 across analytical and stochastic models; configurable `VERSION_REF` / `VERSION_NEW` |

---

## 📚 Citation

If you use **TDCRPy** in your work, please cite:

> R. Coulon, J. Hu — **TDCRPy: A Python package for TDCR measurements**  
> *Applied Radiation and Isotopes* (2024)  
> DOI: [10.1016/j.apradiso.2024.111518](https://doi.org/10.1016/j.apradiso.2024.111518)

---

## ⚖️ License

This project is licensed under the **MIT License**.  
Copyright © BIPM (Bureau International des Poids et Mesures).
