Skip to content

Instantly share code, notes, and snippets.

@agoose77
Last active August 31, 2021 08:50
Show Gist options
  • Save agoose77/5479759fbc6cc3405ffbbdcc227cfa4f to your computer and use it in GitHub Desktop.
Save agoose77/5479759fbc6cc3405ffbbdcc227cfa4f to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"id": "fb5413e5-2298-4e1f-b858-3e3c66fefffe",
"metadata": {
"tags": []
},
"source": [
"# Deconvolve Source Signals of ${}^{10}\\mathrm{C}\\text{-}\\alpha$ Scattering\n",
"In this notebook we will generate a dataset containing the point cloud model inliers obtained from the signal data in the `TEvent` tree."
]
},
{
"cell_type": "markdown",
"id": "5bfb10b1-e227-43df-a330-fef5a312a742",
"metadata": {},
"source": [
"## Prepare source chunks"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "8b91c96e-8633-480e-8d1a-b7b72db2e143",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Stored 'root_path_info' (list)\n"
]
}
],
"source": []
},
{
"cell_type": "markdown",
"id": "cabd6526-0278-40d7-8e4a-bc8014e6e1ee",
"metadata": {},
"source": [
"Given that these early operations are constrained by memory, it is important that each unit of work consumes roughly the same amount of RAM for optimal throughput. This can be estimated from the multiplicity of each event (as the memory is largely determined by the `mmWaveformY` branch which scales as $n \\propto \\text{mul}$."
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "7cd6d1d4-8975-457d-aa98-dd2dc604088b",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "ae4769ac-2e65-41ea-8b42-0792cf8f8df3",
"metadata": {},
"source": [
"Now we can read the events in memory-friendly chunks (ignoring empty chunks!)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "6fc77ae5-f6a9-4943-83be-3172b1be1e60",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "3398872b-a58a-4e70-89bf-bd8f2506c2e0",
"metadata": {
"tags": []
},
"source": [
"## Process TEvent TTrees"
]
},
{
"cell_type": "markdown",
"id": "60211f1d-0c85-478d-a791-e5873dd967a3",
"metadata": {},
"source": [
"Restructure the `TEvent` objects"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "2faf2b96-911e-4123-8203-c33f089d0410",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "84e8223d-6736-484d-a93d-258cdaaf0217",
"metadata": {},
"source": [
"Cleanup signals by removing saturated channels and attenuating the baseline noise"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "1ed0ad2a-7f0b-4f79-bf4f-843ee3fba858",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "6efc810e-3532-4cea-bef1-56d81463a05b",
"metadata": {},
"source": [
"Remove high frequency noise"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "68ed62d5-1dfa-49db-b137-dd1d392a4462",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "8a414637-f692-4c5f-90e8-1ed529633d09",
"metadata": {},
"source": [
"Compute the QT data"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "f18b0f42-5930-411e-89d4-29a4ba1e7ead",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "4415f584-9b77-4df2-a49b-d398a4d1d842",
"metadata": {},
"source": [
"Accumulate the results (generate the dataset)"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "9e1b7e21-9cf3-4603-b9c8-42a9149e494e",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 33,
"id": "834638e3-29ce-461b-b41a-b76773cbe584",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 34,
"id": "abb977d3-0c07-4f43-9979-a5b1e7bfa42d",
"metadata": {
"tags": []
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 36,
"id": "d37295a9-8c53-4dd6-81a5-7eec25283c29",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"if not dataset_path.exists():\n",
" dataset.compute()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.2"
},
"toc-showmarkdowntxt": false
},
"nbformat": 4,
"nbformat_minor": 5
}
jupyterlab >= 3.1.9
jlab-enhanced-cell-toolbar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment