Skip to content
Snippets Groups Projects
Commit a5e1038d authored by Documenter.jl's avatar Documenter.jl
Browse files

build based on af58ad14

parent f77a9d7c
No related branches found
No related tags found
No related merge requests found
Showing
with 2064 additions and 2 deletions
v0.16.6
\ No newline at end of file
v0.16.7
\ No newline at end of file
v0.16.6
\ No newline at end of file
v0.16.7
\ No newline at end of file
{"documenter":{"julia_version":"1.9.1","generation_timestamp":"2024-03-20T10:06:16","documenter_version":"1.3.0"}}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="640"
height="150"
viewBox="0 0 169.333 39.688"
version="1.1"
id="svg34"
sodipodi:docname="KM3io.svg"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<title
id="title321">KM3io.jl logo</title>
<sodipodi:namedview
id="namedview36"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="3.81875"
inkscape:cx="275.61375"
inkscape:cy="-18.461539"
inkscape:window-width="3832"
inkscape:window-height="2134"
inkscape:window-x="3840"
inkscape:window-y="18"
inkscape:window-maximized="1"
inkscape:current-layer="g32" />
<defs
id="defs5">
<clipPath
id="b"
clipPathUnits="userSpaceOnUse">
<use
xlink:href="#a"
id="use2" />
</clipPath>
</defs>
<path
d="m 41.233,9.632 h 5.445 v 8.3 l 9.788,-8.3 h 4.204 l -11.045,9.339 14.008,12.75 H 57.07 L 46.678,22.26 v 9.463 h -5.445 z m 23.982,0 h 5.274 l 7.632,15.094 7.54,-15.094 h 5.165 v 22.09 H 85.412 V 17.326 L 78.2,31.722 H 76.106 L 68.644,17.156 v 14.566 h -3.428 z m 34.717,10.471 q 1.194,-0.124 2.171,-0.496 0.993,-0.388 1.707,-0.978 0.713,-0.605 1.101,-1.396 0.388,-0.806 0.388,-1.753 0,-0.605 -0.217,-1.132 -0.202,-0.543 -0.574,-0.93 -0.373,-0.388 -0.9,-0.606 -0.527,-0.232 -1.163,-0.232 -0.45,0 -0.993,0.232 -0.543,0.233 -1.086,0.636 -0.527,0.388 -1.024,0.916 -0.496,0.527 -0.853,1.132 l -1.955,-0.884 q 0.388,-1.055 1.024,-1.97 0.636,-0.931 1.52,-1.614 0.9,-0.698 2.033,-1.085 1.147,-0.404 2.544,-0.404 1.334,0 2.497,0.373 1.163,0.356 2.032,1.008 0.869,0.651 1.365,1.536 0.512,0.884 0.512,1.923 0,0.45 -0.233,1.024 -0.217,0.558 -0.62,1.148 -0.388,0.59 -0.946,1.179 -0.559,0.59 -1.21,1.101 0.884,0.388 1.644,1.008 0.776,0.605 1.334,1.35 0.559,0.745 0.869,1.582 0.326,0.838 0.326,1.66 0,1.955 -0.807,3.413 -0.791,1.458 -2.187,2.435 -1.396,0.977 -3.304,1.458 -1.893,0.481 -4.08,0.481 -1.07,0 -1.924,-0.155 -0.853,-0.155 -1.458,-0.434 -0.59,-0.295 -0.9,-0.683 -0.31,-0.403 -0.31,-0.868 0,-0.466 0.248,-0.76 0.264,-0.31 0.652,-0.481 0.388,-0.187 0.838,-0.264 0.45,-0.078 0.837,-0.078 0.822,0 1.443,0.233 0.636,0.233 1.148,0.512 0.512,0.28 0.93,0.512 0.435,0.232 0.885,0.232 0.884,0 1.551,-0.325 0.683,-0.326 1.132,-0.869 0.466,-0.543 0.698,-1.241 0.233,-0.714 0.233,-1.49 0,-0.992 -0.419,-1.83 -0.419,-0.853 -1.272,-1.473 -0.853,-0.636 -2.156,-0.993 -1.303,-0.357 -3.071,-0.357 z m 16.396,-4.126 5.042,-1.396 v 17.14 h -5.042 z m -0.217,-6.22 q 0,-0.512 0.202,-0.962 0.217,-0.45 0.59,-0.776 0.371,-0.341 0.868,-0.527 0.496,-0.202 1.055,-0.202 0.558,0 1.054,0.202 0.497,0.186 0.87,0.527 0.371,0.326 0.589,0.776 0.217,0.45 0.217,0.961 0,0.512 -0.217,0.962 -0.218,0.45 -0.59,0.776 -0.372,0.326 -0.869,0.527 -0.496,0.186 -1.054,0.186 -0.559,0 -1.055,-0.186 -0.497,-0.201 -0.869,-0.527 -0.372,-0.326 -0.59,-0.776 -0.201,-0.45 -0.201,-0.962 z m 17.901,22.275 q -1.985,0 -3.676,-0.651 -1.691,-0.652 -2.917,-1.784 -1.225,-1.148 -1.923,-2.7 -0.683,-1.55 -0.683,-3.335 0,-1.923 0.683,-3.536 0.698,-1.63 1.923,-2.793 1.226,-1.179 2.901,-1.83 1.691,-0.667 3.677,-0.667 1.985,0 3.676,0.651 1.706,0.636 2.932,1.769 1.24,1.132 1.939,2.652 0.698,1.52 0.698,3.273 0,1.846 -0.698,3.475 -0.698,1.629 -1.94,2.855 -1.225,1.21 -2.915,1.923 -1.691,0.698 -3.677,0.698 z M 134.602,30 q 0.698,0 1.272,-0.45 0.59,-0.45 1.008,-1.21 0.419,-0.76 0.651,-1.753 0.249,-0.993 0.249,-2.078 0,-1.598 -0.233,-3.01 -0.233,-1.411 -0.776,-2.466 -0.527,-1.055 -1.396,-1.676 -0.853,-0.62 -2.094,-0.62 -0.59,0 -1.148,0.45 -0.543,0.434 -0.962,1.179 -0.418,0.744 -0.682,1.722 -0.248,0.977 -0.248,2.047 0,1.614 0.294,3.04 0.295,1.428 0.854,2.498 0.574,1.07 1.38,1.706 0.807,0.621 1.83,0.621 z m 10.92,-0.17 q 0,-0.466 0.17,-0.87 0.172,-0.418 0.466,-0.713 0.31,-0.31 0.714,-0.48 0.419,-0.187 0.884,-0.187 0.465,0 0.884,0.186 0.42,0.17 0.714,0.481 0.31,0.295 0.48,0.714 0.187,0.403 0.187,0.868 0,0.466 -0.186,0.885 -0.17,0.403 -0.481,0.713 -0.295,0.295 -0.714,0.465 -0.419,0.171 -0.884,0.171 -0.465,0 -0.884,-0.17 -0.403,-0.171 -0.714,-0.466 -0.294,-0.31 -0.465,-0.713 -0.17,-0.42 -0.17,-0.885 z"
id="path7"
style="font-size:31.7692px;line-height:1.25;font-family:'Tamil MN';-inkscape-font-specification:'Tamil MN';letter-spacing:0;word-spacing:0;stroke-width:0.794234" />
<path
d="m 158.816,31.722 q 0,2.218 -0.512,3.568 -0.496,1.365 -1.411,2.11 -0.915,0.76 -2.203,1.008 -1.287,0.263 -2.854,0.263 -1.055,0 -1.877,-0.186 -0.822,-0.17 -1.38,-0.48 -0.56,-0.31 -0.838,-0.73 -0.295,-0.403 -0.295,-0.853 0,-0.791 0.62,-1.318 0.62,-0.528 1.691,-0.528 0.403,0 0.73,0.124 0.31,0.124 0.558,0.31 0.248,0.202 0.45,0.42 0.186,0.232 0.325,0.434 0.357,0.465 0.59,0.62 0.248,0.155 0.45,0.155 0.217,0 0.387,-0.108 0.171,-0.109 0.28,-0.388 0.108,-0.28 0.155,-0.745 0.062,-0.465 0.062,-1.194 V 15.977 l 5.072,-1.396 z m -5.29,-21.966 q 0,-0.511 0.202,-0.961 0.217,-0.45 0.59,-0.776 0.372,-0.341 0.868,-0.527 0.497,-0.202 1.055,-0.202 0.559,0 1.055,0.202 0.497,0.186 0.869,0.527 0.372,0.326 0.59,0.776 0.216,0.45 0.216,0.961 0,0.512 -0.217,0.962 -0.217,0.45 -0.59,0.776 -0.371,0.326 -0.868,0.527 -0.496,0.186 -1.055,0.186 -0.558,0 -1.055,-0.186 -0.496,-0.201 -0.868,-0.527 -0.373,-0.326 -0.59,-0.776 -0.201,-0.45 -0.201,-0.962 z m 14.489,21.966 h -5.01 V 8.376 l 5.01,-1.396 z"
id="path9"
style="font-size:31.7692px;line-height:1.25;font-family:'Tamil MN';-inkscape-font-specification:'Tamil MN';letter-spacing:0;word-spacing:0;stroke-width:0.794234" />
<path
style="fill:#3f61d7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.194319"
d="m 122.12509,9.5034651 c 0,1.8882749 -1.51491,3.4179689 -3.38326,3.4179689 -1.86836,0 -3.38328,-1.529694 -3.38328,-3.4179689 0,-1.887515 1.51492,-3.4179718 3.38328,-3.4179718 1.86835,0 3.38326,1.5304568 3.38326,3.4179718"
id="path371" />
<g
clip-path="url(#b)"
transform="translate(-22.078 -88.72)"
id="g32">
<circle
id="a"
cx="39.401"
cy="106.043"
r="16"
style="fill:#b3b3b3;stroke-width:.350949;stroke-linejoin:round" />
<path
style="fill:#3f61d7;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.234504"
d="m 44.326967,123.25614 c 0,1.88828 -2.206268,3.41797 -4.927276,3.41797 -2.721021,0 -4.927304,-1.52969 -4.927304,-3.41797 0,-1.88751 2.206283,-3.41797 4.927304,-3.41797 2.721008,0 4.927276,1.53046 4.927276,3.41797"
id="path371-3" />
<path
d="m 48.228135,113.5 a 3.675,3.675 0 1 1 3.678,-3.675 3.679,3.679 0 0 1 -3.678,3.675 z"
class="cls-3"
style="fill:#ca3c32;stroke-width:0.412882"
id="path14" />
<path
d="m 57.060135,113.5 a 3.675,3.675 0 1 1 3.678,-3.675 3.679,3.679 0 0 1 -3.678,3.675 z"
class="cls-4"
style="fill:#9259a3;stroke-width:0.412882"
id="path16" />
<path
d="m 52.650135,105.85 a 3.675,3.675 0 1 1 3.674,-3.675 3.67,3.67 0 0 1 -3.674,3.674 z"
class="cls-5"
style="fill:#399746;stroke-width:0.412882"
id="path18" />
<path
d="m 21.731135,113.5 a 3.675,3.675 0 1 1 3.68,-3.675 3.679,3.679 0 0 1 -3.68,3.675 z"
class="cls-3"
style="fill:#ca3c32;stroke-width:0.412882"
id="path20" />
<path
d="m 30.564135,113.5 a 3.675,3.675 0 1 1 3.678,-3.675 3.679,3.679 0 0 1 -3.678,3.675 z"
class="cls-4"
style="fill:#9259a3;stroke-width:0.412882"
id="path22" />
<path
d="m 30.951598,98.056224 a 3.675,2.569137 0 1 1 3.678,-2.569136 3.679,2.5719333 0 0 1 -3.678,2.569136 z"
class="cls-4"
style="fill:#9259a3;stroke-width:0.345216"
id="path22-3" />
<path
d="m 26.150126,119.0792 a 3.675,2.569137 0 1 1 3.678,-2.56914 3.679,2.5719333 0 0 1 -3.678,2.56914 z"
class="cls-4"
style="fill:#9259a3;stroke-width:0.345216"
id="path22-3-9" />
<path
d="m 52.74135,119.08185 a 3.675,2.569137 0 1 1 3.678,-2.56914 3.679,2.5719333 0 0 1 -3.678,2.56914 z"
class="cls-4"
style="fill:#9259a3;stroke-width:0.345216"
id="path22-3-9-1" />
<path
d="m 26.154135,105.85 a 3.675,3.675 0 1 1 3.674,-3.675 3.67,3.67 0 0 1 -3.674,3.674 z"
class="cls-5"
style="fill:#399746;stroke-width:0.412882"
id="path24" />
<path
d="m 34.981135,98.5 a 3.675,3.675 0 1 0 3.68,3.675 3.679,3.679 0 0 0 -3.68,-3.675 z"
class="cls-3"
style="fill:#ca3c32;stroke-width:0.412882"
id="path26" />
<path
d="m 48.402688,92.969702 a 3.675,2.5691377 0 1 0 3.68,2.569141 3.679,2.571934 0 0 0 -3.68,-2.569141 z"
class="cls-3"
style="fill:#ca3c32;stroke-width:0.345216"
id="path26-5" />
<path
d="m 34.981087,113.94093 a 3.675,2.5691377 0 1 0 3.68,2.56914 3.679,2.571934 0 0 0 -3.68,-2.56914 z"
class="cls-3"
style="fill:#ca3c32;stroke-width:0.345216"
id="path26-5-6" />
<path
d="m 43.813135,98.5 a 3.675,3.675 0 1 0 3.679,3.675 3.679,3.679 0 0 0 -3.679,-3.675 z"
class="cls-4"
style="fill:#9259a3;stroke-width:0.412882"
id="path28" />
<path
d="m 39.399135,106.15 a 3.675,3.675 0 1 0 3.675,3.675 3.67,3.67 0 0 0 -3.675,-3.674 z"
class="cls-5"
style="fill:#399746;stroke-width:0.412882"
id="path30" />
<path
d="m 39.710811,92.917932 a 3.675,2.5691842 0 1 0 3.675,2.569184 3.67,2.5656887 0 0 0 -3.675,-2.568485 z"
class="cls-5"
style="fill:#399746;stroke-width:0.345219"
id="path30-7" />
<path
d="m 43.817196,113.94093 a 3.675,2.5691842 0 1 0 3.675,2.56919 3.67,2.5656887 0 0 0 -3.675,-2.56849 z"
class="cls-5"
style="fill:#399746;stroke-width:0.345219"
id="path30-7-2" />
</g>
<metadata
id="metadata319">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:title>KM3io.jl logo</dc:title>
<dc:date>2023-04-12</dc:date>
<dc:creator>
<cc:Agent>
<dc:title>Johannes Schumann</dc:title>
</cc:Agent>
</dc:creator>
<dc:rights>
<cc:Agent>
<dc:title>KM3NeT </dc:title>
</cc:Agent>
</dc:rights>
<dc:publisher>
<cc:Agent>
<dc:title>KM3NeT </dc:title>
</cc:Agent>
</dc:publisher>
<dc:language>en</dc:language>
<dc:subject>
<rdf:Bag>
<rdf:li>neutrino km3net io dataformat root</rdf:li>
</rdf:Bag>
</dc:subject>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
</cc:License>
</rdf:RDF>
</metadata>
</svg>
This diff is collapsed.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
// Small function to quickly swap out themes. Gets put into the <head> tag..
function set_theme_from_local_storage() {
// Initialize the theme to null, which means default
var theme = null;
// If the browser supports the localstorage and is not disabled then try to get the
// documenter theme
if (window.localStorage != null) {
// Get the user-picked theme from localStorage. May be `null`, which means the default
// theme.
theme = window.localStorage.getItem("documenter-theme");
}
// Check if the users preference is for dark color scheme
var darkPreference =
window.matchMedia("(prefers-color-scheme: dark)").matches === true;
// Initialize a few variables for the loop:
//
// - active: will contain the index of the theme that should be active. Note that there
// is no guarantee that localStorage contains sane values. If `active` stays `null`
// we either could not find the theme or it is the default (primary) theme anyway.
// Either way, we then need to stick to the primary theme.
//
// - disabled: style sheets that should be disabled (i.e. all the theme style sheets
// that are not the currently active theme)
var active = null;
var disabled = [];
var primaryLightTheme = null;
var primaryDarkTheme = null;
for (var i = 0; i < document.styleSheets.length; i++) {
var ss = document.styleSheets[i];
// The <link> tag of each style sheet is expected to have a data-theme-name attribute
// which must contain the name of the theme. The names in localStorage much match this.
var themename = ss.ownerNode.getAttribute("data-theme-name");
// attribute not set => non-theme stylesheet => ignore
if (themename === null) continue;
// To distinguish the default (primary) theme, it needs to have the data-theme-primary
// attribute set.
if (ss.ownerNode.getAttribute("data-theme-primary") !== null) {
primaryLightTheme = themename;
}
// Check if the theme is primary dark theme so that we could store its name in darkTheme
if (ss.ownerNode.getAttribute("data-theme-primary-dark") !== null) {
primaryDarkTheme = themename;
}
// If we find a matching theme (and it's not the default), we'll set active to non-null
if (themename === theme) active = i;
// Store the style sheets of inactive themes so that we could disable them
if (themename !== theme) disabled.push(ss);
}
var activeTheme = null;
if (active !== null) {
// If we did find an active theme, we'll (1) add the theme--$(theme) class to <html>
document.getElementsByTagName("html")[0].className = "theme--" + theme;
activeTheme = theme;
} else {
// If we did _not_ find an active theme, then we need to fall back to the primary theme
// which can either be dark or light, depending on the user's OS preference.
var activeTheme = darkPreference ? primaryDarkTheme : primaryLightTheme;
// In case it somehow happens that the relevant primary theme was not found in the
// preceding loop, we abort without doing anything.
if (activeTheme === null) {
console.error("Unable to determine primary theme.");
return;
}
// When switching to the primary light theme, then we must not have a class name
// for the <html> tag. That's only for non-primary or the primary dark theme.
if (darkPreference) {
document.getElementsByTagName("html")[0].className =
"theme--" + activeTheme;
} else {
document.getElementsByTagName("html")[0].className = "";
}
}
for (var i = 0; i < document.styleSheets.length; i++) {
var ss = document.styleSheets[i];
// The <link> tag of each style sheet is expected to have a data-theme-name attribute
// which must contain the name of the theme. The names in localStorage much match this.
var themename = ss.ownerNode.getAttribute("data-theme-name");
// attribute not set => non-theme stylesheet => ignore
if (themename === null) continue;
// we'll disable all the stylesheets, except for the active one
ss.disabled = !(themename == activeTheme);
}
}
set_theme_from_local_storage();
function maybeAddWarning() {
// DOCUMENTER_NEWEST is defined in versions.js, DOCUMENTER_CURRENT_VERSION and DOCUMENTER_STABLE
// in siteinfo.js.
// If either of these are undefined something went horribly wrong, so we abort.
if (
window.DOCUMENTER_NEWEST === undefined ||
window.DOCUMENTER_CURRENT_VERSION === undefined ||
window.DOCUMENTER_STABLE === undefined
) {
return;
}
// Current version is not a version number, so we can't tell if it's the newest version. Abort.
if (!/v(\d+\.)*\d+/.test(window.DOCUMENTER_CURRENT_VERSION)) {
return;
}
// Current version is newest version, so no need to add a warning.
if (window.DOCUMENTER_NEWEST === window.DOCUMENTER_CURRENT_VERSION) {
return;
}
// Add a noindex meta tag (unless one exists) so that search engines don't index this version of the docs.
if (document.body.querySelector('meta[name="robots"]') === null) {
const meta = document.createElement("meta");
meta.name = "robots";
meta.content = "noindex";
document.getElementsByTagName("head")[0].appendChild(meta);
}
const div = document.createElement("div");
div.classList.add("outdated-warning-overlay");
const closer = document.createElement("button");
closer.classList.add("outdated-warning-closer", "delete");
closer.addEventListener("click", function () {
document.body.removeChild(div);
});
const href = window.documenterBaseURL + "/../" + window.DOCUMENTER_STABLE;
div.innerHTML =
'This documentation is not for the latest stable release, but for either the development version or an older release.<br><a href="' +
href +
'">Click here to go to the documentation for the latest stable release.</a>';
div.appendChild(closer);
document.body.appendChild(div);
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", maybeAddWarning);
} else {
maybeAddWarning();
}
File added
This diff is collapsed.
\RequirePackage{luatex85}
\documentclass[tikz]{standalone}
% Default preamble
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{groupplots}
\usepgfplotslibrary{polar}
\usepgfplotslibrary{smithchart}
\usepgfplotslibrary{statistics}
\usepgfplotslibrary{dateplot}
\usepgfplotslibrary{ternary}
\begin{document}
\begin{tikzpicture}
\begin{axis}[ybar, const plot, grid, xlabel={\Delta t / ns}, ylabel={counts}]
\addplot+
coordinates {
(-9.5,3.0)
(-8.5,5.0)
(-7.5,6.0)
(-6.5,5.0)
(-5.5,34.0)
(-4.5,81.0)
(-3.5,202.0)
(-2.5,413.0)
(-1.5,699.0)
(-0.5,950.0)
(0.5,874.0)
(1.5,778.0)
(2.5,601.0)
(3.5,425.0)
(4.5,319.0)
(5.5,231.0)
(6.5,181.0)
(7.5,171.0)
(8.5,134.0)
(9.5,122.0)
(10.5,93.0)
(11.5,91.0)
(12.5,87.0)
(13.5,65.0)
(14.5,71.0)
(15.5,63.0)
(16.5,59.0)
(17.5,54.0)
(18.5,50.0)
(19.5,36.0)
(20.5,44.0)
(21.5,42.0)
(22.5,37.0)
(23.5,40.0)
(24.5,42.0)
(25.5,35.0)
(26.5,37.0)
(27.5,24.0)
(28.5,36.0)
(29.5,36.0)
(30.5,44.0)
(31.5,23.0)
(32.5,30.0)
(33.5,28.0)
(34.5,24.0)
(35.5,25.0)
(36.5,18.0)
(37.5,17.0)
(38.5,16.0)
(39.5,20.0)
(40.5,13.0)
(41.5,17.0)
(42.5,11.0)
(43.5,15.0)
(44.5,14.0)
(45.5,13.0)
(46.5,6.0)
(47.5,11.0)
(48.5,7.0)
(49.5,15.0)
}
\closedcycle
;
\end{axis}
\end{tikzpicture}
\end{document}
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Cherenkov times · KM3io.jl</title><meta name="title" content="Cherenkov times · KM3io.jl"/><meta property="og:title" content="Cherenkov times · KM3io.jl"/><meta property="twitter:title" content="Cherenkov times · KM3io.jl"/><meta name="description" content="Documentation for KM3io.jl."/><meta property="og:description" content="Documentation for KM3io.jl."/><meta property="twitter:description" content="Documentation for KM3io.jl."/><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../search_index.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script><link href="../../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../../"><img src="../../assets/logo.svg" alt="KM3io.jl logo"/></a><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../../">Home</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="../../manual/rootfiles/">ROOT Files</a></li><li><a class="tocitem" href="../../manual/detector/">Detector and its Components</a></li><li><a class="tocitem" href="../../manual/calibration/">Calibration</a></li><li><a class="tocitem" href="../../manual/tools/">Tools</a></li></ul></li><li><span class="tocitem">Examples</span><ul><li><a class="tocitem" href="../offline_data/">Offline data</a></li><li class="is-active"><a class="tocitem" href>Cherenkov times</a></li><li><a class="tocitem" href="../controlhost/">Accessing Live Data</a></li><li><a class="tocitem" href="../hdf5/">HDF5</a></li></ul></li><li><a class="tocitem" href="../../api/">API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Examples</a></li><li class="is-active"><a href>Cherenkov times</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Cherenkov times</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.km3net.de/common/KM3io.jl" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.km3net.de/common/KM3io.jl/blob/main/docs/src/examples/cherenkov_times.md#L" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Cherenkov-times"><a class="docs-heading-anchor" href="#Cherenkov-times">Cherenkov times</a><a id="Cherenkov-times-1"></a><a class="docs-heading-anchor-permalink" href="#Cherenkov-times" title="Permalink"></a></h1><p>In this example, we will pick the best reconstructed muon (from the Jpp muon reconstruction chain <code>JMuon</code>) in each event and calculate the Cherenkov hit time residuals for each triggered hit.</p><p>We open the a sample file from the <code>KM3NeTTestData</code> package:</p><pre><code class="language-julia hljs">using KM3io, KM3NeTTestData
f = ROOTFile(datapath(&quot;offline&quot;, &quot;mcv6.0.gsg_muon_highE-CC_50-500GeV.km3sim.jterbr00008357.jorcarec.aanet.905.root&quot;))</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">ROOTFile{OfflineTree (140 events)}</code></pre><p>Each event holds a vector of reconstructed tracks (<code>Vector{Trk}</code>) behind the <code>.trks</code> field. This vector contains different stages of reconstruction results from a variety of reconstruction algorithms (<code>JMuon</code>, <code>JShower</code>, <code>aashower</code> etc.). <code>KM3io.jl</code> exports helper functions to pick the best reconstructed track for a given reconstruction algorithm. The logic is based on the reference implementation in <a href="https://git.km3net.de/common/km3net-dataformat/-/blob/master/tools/reconstruction.hh">KM3NeT DataFormat tools</a>. The function <code>bestjppmuon()</code> can be used to select the best reconstructed <code>JMuon</code> for a given event:</p><pre><code class="language-julia hljs">evt = f.offline[1]
best_muon = bestjppmuon(evt)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">Trk(1, [472.38683488288035, 526.1421552520982, 198.52185151902515], [0.14146977403136585, 0.9861486218588713, 0.0865863652162581], 5.8796099548102595e7, 544.9525806125414, 0.0, 40.55672709261793, 4000, Int32[1, 2, 5, 3, 5, 4], [0.014885871185356527, 0.010385140089653992, -40.55672709261793, 21.0, 544.9525806125414, 62.53353460788458, 3.9927948910593534, 14.0, 0.0, 8.658344340729155, 45.03600640024326, 0.0, 0.0, 1501.6459845444228, -60.9373245973645, 602.0, 18.0])</code></pre><p>We now use this track as a seed to calculate the Cherenkov photon (see <a href="../../api/#KM3io.CherenkovPhoton"><code>CherenkovPhoton</code></a>) parameters using <a href="../../api/#KM3io.cherenkov"><code>cherenkov()</code></a> for each hit triggered hit in the event. To select only triggered hits, we use the <a href="../../api/#KM3io.triggered"><code>triggered()</code></a> function together withe <code>filter()</code> which returns a new vector of triggered hits:</p><pre><code class="language-julia hljs">cherenkov(best_muon, filter(triggered, evt.hits))</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">18-element Vector{CherenkovPhoton}:
CherenkovPhoton(27.456056524385705, 40.873619315665835, 23.01132932189433, 5.879636441354458e7, -3.3185445815324783, -0.6308750235550007, [-0.5280726983220052, 0.8386645132949296, -0.1333456389489177])
CherenkovPhoton(19.589541083469918, 29.162798528739554, 34.066894977706106, 5.879634739559217e7, -3.233592174947262, -0.5615835242962758, [-0.10332584557538887, 0.8159650107370725, -0.5687924673279173])
CherenkovPhoton(10.86335249693415, 16.17218896884205, 44.610162820726465, 5.879632277897501e7, -13.470975004136562, -0.7747565822537276, [-0.2741635374885438, 0.8327626017287875, -0.48097900564751106])
CherenkovPhoton(10.958658115674492, 16.31406970745347, 44.59234480366246, 5.879632337250174e7, -12.580501735210419, -0.12671424342178933, [-0.2699696583845673, 0.8324204577911087, -0.4839344635408405])
CherenkovPhoton(10.944182695875304, 16.29252026178632, 44.40568465253136, 5.879632265069598e7, 3.0913040190935135, -0.9323746132442533, [-0.28061324969503537, 0.8332805365263898, -0.4763399537534972])
CherenkovPhoton(11.17928745250317, 16.642518897357846, 44.22007515662778, 5.8796323642327406e7, 15.824672594666481, 0.13091951330569712, [-0.28166643233811883, 0.8333641475329505, -0.47557146518750953])
CherenkovPhoton(10.90295605293336, 16.23114647681559, 44.79747555408915, 5.8796323675116315e7, 23.333883680403233, 0.21074029444645023, [-0.27966746730903425, 0.8332052197790003, -0.4770274305131501])
CherenkovPhoton(10.834690812223172, 16.129520540155593, 44.741227103812335, 5.879632301979044e7, 35.40920955687761, -0.5058063194444712, [-0.27591434972063633, 0.8329041936340702, -0.4797310453212485])
CherenkovPhoton(38.84032185176909, 57.82128719239538, -7.3748303011806655, 5.879634105250908e7, 2.452490918338299, -0.869871832680696, [-0.49768036486114947, 0.8411698501975048, -0.21153613769372911])
CherenkovPhoton(28.22562353198971, 42.01926777682648, 4.187186042072117, 5.879630689544618e7, 0.01255381852388382, 0.010809985106091385, [-0.20536281574231854, 0.826660216630483, -0.5238883470271404])
CherenkovPhoton(14.785344110263079, 22.01082759562596, 20.557497574678035, 5.8796269418408036e7, 1.031591959297657, -0.8687222096306455, [-0.49539706637778913, 0.8412721768556203, -0.2164321396486352])
CherenkovPhoton(14.88094434135218, 22.153146921365803, 20.51061784167785, 5.879626991701378e7, 6.563986226916313, -0.3270806917438915, [-0.49376584703803356, 0.8413399367600128, -0.21986904991715162])
CherenkovPhoton(15.035038797101658, 22.382546147629952, 20.413422353617566, 5.8796270648541935e7, 10.363458067178726, 0.45681008948052304, [-0.49501594042850555, 0.841288399552909, -0.21723960849575105])
CherenkovPhoton(35.48962576204839, 52.8331317997193, -2.014094840107113, 5.879633597758977e7, 1.9564102292060852, -0.4138351012632555, [0.2341920351405915, 0.7697450484845674, -0.5938405939393154])
CherenkovPhoton(35.32252555236435, 52.58437100801102, -1.7938275339033325, 5.879633556747952e7, 3.269520476460457, -0.8429145215271237, [0.23451716273478773, 0.7696930575084193, -0.5937796709269916])
CherenkovPhoton(25.877763469142074, 38.52402663285318, 9.45499183787367, 5.8796308381212674e7, -0.5812126770615578, -0.9686719491474437, [0.27451879989430933, 0.7631813220745428, -0.5849732456626894])
CherenkovPhoton(26.084505456694867, 38.83180183313701, 9.19462645688342, 5.8796308929165296e7, 2.361834704875946, -0.39414201377088814, [0.2777981674998186, 0.7626371978873142, -0.5841341306004368])
CherenkovPhoton(17.507053914837183, 26.062615963014824, 19.40524417300148, 5.8796284221979275e7, 1.8830207213759422, -0.9165095376090591, [0.3547191740867844, 0.7494025149884511, -0.5590797600201369])</code></pre><p>To obtain more statistics, we iterate through all the events and calculate the Cherenkov time residuals for each set of hits based on the best reconstruction track. We fill the time residuals in a 1D histogram using the <a href="https://github.com/Moelf/FHist.jl">FHist</a> package.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>This example uses <a href="https://github.com/KristofferC/PGFPlotsX.jl">PGFPlotsX</a> which is a wrapper for the LaTeX library PGFPlots. Feel free to adapt the example to use your favourite plotting library.</p></div></div><pre><code class="language-julia hljs">using FHist
Δts = Hist1D(;bins=-10:50)
for evt ∈ f.offline
m = bestjppmuon(evt)
cherenkov_photons = cherenkov(m, filter(triggered, evt.hits))
for cp ∈ cherenkov_photons
push!(Δts, cp.Δt)
end
end
axis = @pgf Axis(
{
ybar, const_plot, grid,
xlabel=raw&quot;\Delta t / ns&quot;,
ylabel=&quot;counts&quot;,
},
PlotInc(Coordinates(bincenters(Δts), bincounts(Δts)), raw&quot;\closedcycle&quot;)
)
axis</code></pre><p><a href="../cherenkov.pdf">[.pdf]</a>, <a href="../cherenkov.tex">[generated .tex]</a></p><p><img src="../cherenkov.svg" alt/></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../offline_data/">« Offline data</a><a class="docs-footer-nextpage" href="../controlhost/">Accessing Live Data »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Wednesday 20 March 2024 10:06">Wednesday 20 March 2024</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Accessing Live Data · KM3io.jl</title><meta name="title" content="Accessing Live Data · KM3io.jl"/><meta property="og:title" content="Accessing Live Data · KM3io.jl"/><meta property="twitter:title" content="Accessing Live Data · KM3io.jl"/><meta name="description" content="Documentation for KM3io.jl."/><meta property="og:description" content="Documentation for KM3io.jl."/><meta property="twitter:description" content="Documentation for KM3io.jl."/><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../search_index.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script><link href="../../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../../"><img src="../../assets/logo.svg" alt="KM3io.jl logo"/></a><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../../">Home</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="../../manual/rootfiles/">ROOT Files</a></li><li><a class="tocitem" href="../../manual/detector/">Detector and its Components</a></li><li><a class="tocitem" href="../../manual/calibration/">Calibration</a></li><li><a class="tocitem" href="../../manual/tools/">Tools</a></li></ul></li><li><span class="tocitem">Examples</span><ul><li><a class="tocitem" href="../offline_data/">Offline data</a></li><li><a class="tocitem" href="../cherenkov_times/">Cherenkov times</a></li><li class="is-active"><a class="tocitem" href>Accessing Live Data</a><ul class="internal"><li><a class="tocitem" href="#Launching-JLigier"><span>Launching <code>JLigier</code></span></a></li><li><a class="tocitem" href="#Simulating-the-DAQ"><span>Simulating the DAQ</span></a></li><li><a class="tocitem" href="#Retrieving-Events"><span>Retrieving Events</span></a></li></ul></li><li><a class="tocitem" href="../hdf5/">HDF5</a></li></ul></li><li><a class="tocitem" href="../../api/">API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Examples</a></li><li class="is-active"><a href>Accessing Live Data</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Accessing Live Data</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.km3net.de/common/KM3io.jl" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.km3net.de/common/KM3io.jl/blob/main/docs/src/examples/controlhost.md#L" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Accessing-Live-Data"><a class="docs-heading-anchor" href="#Accessing-Live-Data">Accessing Live Data</a><a id="Accessing-Live-Data-1"></a><a class="docs-heading-anchor-permalink" href="#Accessing-Live-Data" title="Permalink"></a></h1><p>This example shows how to access and process live data (events) from the KM3NeT DAQ system. We will use two Jpp command line tools (<a href="https://common.pages.km3net.de/jpp/#JLigier"><code>JLigier</code></a> and <a href="https://common.pages.km3net.de/jpp/#JRegurgitate"><code>JRegurgitate</code></a>) to create a ligier dispatcher and send triggered DAQ events to it.</p><p>This example uses Jpp v14.4.3 and real data from a KM3NeT detector (online ROOT format) with the filename <code>KM3NeT_00000075_00010275.root</code> which can be found on the HPSS storage.</p><h2 id="Launching-JLigier"><a class="docs-heading-anchor" href="#Launching-JLigier">Launching <code>JLigier</code></a><a id="Launching-JLigier-1"></a><a class="docs-heading-anchor-permalink" href="#Launching-JLigier" title="Permalink"></a></h2><p>We open a terminal and launch the <code>JLigier</code> process with a high debug level. This ligier is the central communication point and it will receive messages which are tagged with short label of maximum 8 characters.</p><pre><code class="language-shell hljs">$ JLigier -P 5553 -d 3
Port 5553
Memory limit 16760735744
Queue limit 100</code></pre><p>The ligier is now running and and listening on port 5553 of all host IP addresses (including the localhost <code>127.0.0.1</code>). Clients can connect to it and subscribe for a given set of message tags. Leave this terminal open.</p><h2 id="Simulating-the-DAQ"><a class="docs-heading-anchor" href="#Simulating-the-DAQ">Simulating the DAQ</a><a id="Simulating-the-DAQ-1"></a><a class="docs-heading-anchor-permalink" href="#Simulating-the-DAQ" title="Permalink"></a></h2><p>The first client we start in new terminal session is the <a href="https://common.pages.km3net.de/jpp/#JRegurgitate"><code>JRegurgitate</code></a> process which takes a ROOT file (in online format), a class identifier, a few other parameters like the frequency and timeout of the messages and also the IP and port of the ligier to send to. We will use this application to simulate the KM3NeT DAQ – at least the output of the <a href="https://common.pages.km3net.de/jpp/#JDataFilter"><code>JDataFilter</code></a> which is responsible for triggering events and sending them downstreams to a <code>JLigier</code> so that they can be picked up by the <a href="https://common.pages.km3net.de/jpp/#JDataWriter"><code>JDataWriter</code></a> to store them in <a href="../../manual/rootfiles/#online_dataformat">ROOT files (online format)</a>.</p><pre><code class="language-shell hljs">$ JRegurgitate -f /data/sea/KM3NeT_00000075_00010275.root -C JDAQEvent -R 2 -T 10000000 -H 127.0.0.1:5553</code></pre><p>This program is fairly quite but if you look at the terminal where the <code>JLigier</code> is running, you&#39;ll see a flood of messages, showing that a new client has connected and data is received (tagged with <code>IO_EVT</code>). It also prints the number of bytes of each message:</p><pre><code class="language-shell hljs">$ JLigier -P 5553 -d 3
Port 30001
Memory limit 16760735744
Queue limit 100
New client[4]
Client[4].read(0,1,1756)
Client[4].read(1,2,0)
Message[4] IO_EVT 1772
Client[4].read(0,1,1394)
Client[4].read(1,2,0)
Message[4] IO_EVT 1410
Client[4].read(0,1,1716)
...
...
...</code></pre><h2 id="Retrieving-Events"><a class="docs-heading-anchor" href="#Retrieving-Events">Retrieving Events</a><a id="Retrieving-Events-1"></a><a class="docs-heading-anchor-permalink" href="#Retrieving-Events" title="Permalink"></a></h2><p>Now open a thrid terminal and fire up the Julia REPL. With a few lines, we will able to connect to the ligier and receive DAQ events interactively.</p><pre><code class="language-julia-repl hljs">julia&gt; using KM3io
julia&gt; c = CHClient{KM3io.DAQEvent}(ip&quot;127.0.0.1&quot;, 5553)
CHClient{DAQEvent}(ip&quot;127.0.0.1&quot;, 0x7531, CHTag[CHTag(&quot;IO_EVT&quot;)], Sockets.TCPSocket(RawFD(20) open, 0 bytes waiting))
julia&gt; for e in c
@show e
end
e = DAQEvent with 126 snapshot and 7 triggered hits
e = DAQEvent with 138 snapshot and 6 triggered hits
e = DAQEvent with 149 snapshot and 6 triggered hits
e = DAQEvent with 149 snapshot and 6 triggered hits
e = DAQEvent with 136 snapshot and 6 triggered hits
...
...
...</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../cherenkov_times/">« Cherenkov times</a><a class="docs-footer-nextpage" href="../hdf5/">HDF5 »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Wednesday 20 March 2024 10:06">Wednesday 20 March 2024</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
File added
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>HDF5 · KM3io.jl</title><meta name="title" content="HDF5 · KM3io.jl"/><meta property="og:title" content="HDF5 · KM3io.jl"/><meta property="twitter:title" content="HDF5 · KM3io.jl"/><meta name="description" content="Documentation for KM3io.jl."/><meta property="og:description" content="Documentation for KM3io.jl."/><meta property="twitter:description" content="Documentation for KM3io.jl."/><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../search_index.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script><link href="../../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../../"><img src="../../assets/logo.svg" alt="KM3io.jl logo"/></a><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../../">Home</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="../../manual/rootfiles/">ROOT Files</a></li><li><a class="tocitem" href="../../manual/detector/">Detector and its Components</a></li><li><a class="tocitem" href="../../manual/calibration/">Calibration</a></li><li><a class="tocitem" href="../../manual/tools/">Tools</a></li></ul></li><li><span class="tocitem">Examples</span><ul><li><a class="tocitem" href="../offline_data/">Offline data</a></li><li><a class="tocitem" href="../cherenkov_times/">Cherenkov times</a></li><li><a class="tocitem" href="../controlhost/">Accessing Live Data</a></li><li class="is-active"><a class="tocitem" href>HDF5</a><ul class="internal"><li><a class="tocitem" href="#Creating-datasets"><span>Creating datasets</span></a></li><li><a class="tocitem" href="#Reading-datasets"><span>Reading datasets</span></a></li><li><a class="tocitem" href="#Adding-metadata"><span>Adding metadata</span></a></li></ul></li></ul></li><li><a class="tocitem" href="../../api/">API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Examples</a></li><li class="is-active"><a href>HDF5</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>HDF5</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.km3net.de/common/KM3io.jl" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.km3net.de/common/KM3io.jl/blob/main/docs/src/examples/hdf5.md#L" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="HDF5"><a class="docs-heading-anchor" href="#HDF5">HDF5</a><a id="HDF5-1"></a><a class="docs-heading-anchor-permalink" href="#HDF5" title="Permalink"></a></h1><p>Plain ASCII (CSV) files are often perfectly fine for small, tabular datasets but when dealing with larger amounts of data, HDF5 comes in handy with compression, metadata and hierachical datasets. KM3NeT uses HDF5 in many analysis chains, often to store intermediate or end results.</p><p>This example shows how to create an HDF5 file and write some vectors of structs into different datasets.</p><pre><code class="language-julia hljs">using KM3io
using Random
Random.seed!(23) # to make things reproducible ;)
f = H5File(&quot;foo.h5&quot;, &quot;w&quot;)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">H5File(HDF5.File: (read-write) foo.h5, Dict{String, H5CompoundDataset}(), ReentrantLock(nothing, 0x00000000, 0x00, Base.GenericCondition{Base.Threads.SpinLock}(Base.IntrusiveLinkedList{Task}(nothing, nothing), Base.Threads.SpinLock(0)), (0, 0, 139779710648320)))</code></pre><p>We now have an <code>H5File</code> instance which we can use to store datasets.</p><p>Let&#39;s say we have our custom data type (<code>struct</code>) like</p><pre><code class="language-julia hljs">struct Particle
x::Float32
y::Float32
E::Int64
end</code></pre><p>and we generate instances of <code>Particle</code> in a loop which we want to dump directly into an HDF5 file to the dataset stored at <code>simulation/particles</code>, meaning that <code>simulation</code> is the group name and <code>particles</code> the dataset name.</p><h2 id="Creating-datasets"><a class="docs-heading-anchor" href="#Creating-datasets">Creating datasets</a><a id="Creating-datasets-1"></a><a class="docs-heading-anchor-permalink" href="#Creating-datasets" title="Permalink"></a></h2><p>First, we create our dataset with our type <code>Particle</code>. This is a so called <code>H5CompoundDataset</code> and resembles a dataset wich has a compound type (<code>struct</code>) associated with it:</p><pre><code class="language-julia hljs">dset = create_dataset(f, &quot;simulation/particles&quot;, Particle)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">H5CompoundDataset{Main.Particle}(HDF5.Dataset: /simulation/particles (file: foo.h5 xfer_mode: 0), KM3io.H5CompoundDatasetCache{Main.Particle}(Main.Particle[], 10000), ReentrantLock(nothing, 0x00000000, 0x00, Base.GenericCondition{Base.Threads.SpinLock}(Base.IntrusiveLinkedList{Task}(nothing, nothing), Base.Threads.SpinLock(0)), (0, 0, 139779710648320)))</code></pre><p>We fill some random particles using the dummy loop:</p><pre><code class="language-julia hljs">for i in 1:1000
# creates some random particle
particle = Particle(rand(), rand(), rand(1:1000))
# we push to the dataset, just like if it was an Array
push!(dset, particle)
end</code></pre><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>To avoid excessive I/O, KM3io uses a cache for each <code>H5CompoundDataset</code>. If you don&#39;t close the <code>H5File</code> properly, you might lose data which is still sitting in the cache. Therefore, always use <code>close(f)</code> to make sure that all the caches are dumped to the HDF5 file. The methods <code>flush(d::H5CompoundDataset)</code> and <code>flush(f::H5File)</code> can be used to manually to prematurely flush the cache of a dataset or all caches of an HDF5 file respectively.</p></div></div><p>Let&#39;s close the file</p><pre><code class="language-julia hljs">close(f)</code></pre><h2 id="Reading-datasets"><a class="docs-heading-anchor" href="#Reading-datasets">Reading datasets</a><a id="Reading-datasets-1"></a><a class="docs-heading-anchor-permalink" href="#Reading-datasets" title="Permalink"></a></h2><p>We open the file from the previous example with <code>HDF5.jl</code>, just to demonstrate that we can read it without any <code>KM3NeT</code> related libraries:</p><pre><code class="language-julia hljs">using HDF5
f = h5open(&quot;foo.h5&quot;)
particles = f[&quot;simulation/particles&quot;]
@show particles[1:5]</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">5-element Vector{NamedTuple{(:x, :y, :E), Tuple{Float32, Float32, Int64}}}:
(x = 0.6173128, y = 0.7017544, E = 846)
(x = 0.15231268, y = 0.5729589, E = 919)
(x = 0.3698977, y = 0.9852652, E = 29)
(x = 0.20275348, y = 0.61091214, E = 43)
(x = 0.9130694, y = 0.80798453, E = 492)</code></pre><p>Notice that <code>HDF5.jl</code> automatically created <code>NamedTuple</code> instances with the same fieldnames as our own <code>struct</code> definition of <code>Particle</code>. This means that the elements behave just like the original one regarding the field access:</p><pre><code class="language-julia hljs">particles[2].E</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">919</code></pre><p>The whole vector can also be reinterpreted to the original <code>struct</code> definition with zero-cost. This can be mandatory if the data is then passed to other methods which require a specific type (in this case <code>Particle</code>). The following line will only work if <code>Particle</code> is already defined (i.e. the correspoinding module has been loaded). It is also mandatory to pass a slice (here, we pass the full slice by using <code>[:]</code>) to <code>reinterpret</code> and not the dataset itself:</p><pre><code class="language-julia hljs">reinterpreted_particles = reinterpret(Particle, particles[:])</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">1000-element reinterpret(Main.Particle, ::Vector{NamedTuple{(:x, :y, :E), Tuple{Float32, Float32, Int64}}}):
Main.Particle(0.6173128f0, 0.7017544f0, 846)
Main.Particle(0.15231268f0, 0.5729589f0, 919)
Main.Particle(0.3698977f0, 0.9852652f0, 29)
Main.Particle(0.20275348f0, 0.61091214f0, 43)
Main.Particle(0.9130694f0, 0.80798453f0, 492)
Main.Particle(0.64656323f0, 0.22889934f0, 645)
Main.Particle(0.6973233f0, 0.50635964f0, 273)
Main.Particle(0.40650654f0, 0.3752744f0, 761)
Main.Particle(0.95921856f0, 0.50115997f0, 367)
Main.Particle(0.33829075f0, 0.14806244f0, 259)
Main.Particle(0.3361519f0, 0.85591096f0, 550)
Main.Particle(0.6328468f0, 0.9447911f0, 602)
Main.Particle(0.77841556f0, 0.89120376f0, 336)
Main.Particle(0.6592056f0, 0.43078482f0, 478)
Main.Particle(0.39405528f0, 0.71947837f0, 995)
Main.Particle(0.8272534f0, 0.04592278f0, 144)
Main.Particle(0.10343988f0, 0.1650157f0, 186)
Main.Particle(0.81352913f0, 0.4152046f0, 815)
Main.Particle(0.9511939f0, 0.5394598f0, 921)</code></pre><p>Each element is now a proper <code>Particle</code> instance:</p><pre><code class="language-julia hljs">reinterpreted_particles[4]</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">Main.Particle(0.20275348f0, 0.61091214f0, 43)</code></pre><p><code>KM3io</code> also writes the name of the <code>struct</code> into the attributes of the dataset:</p><pre><code class="language-julia hljs">attrs(particles)[&quot;struct_name&quot;]</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">&quot;Particle&quot;</code></pre><h2 id="Adding-metadata"><a class="docs-heading-anchor" href="#Adding-metadata">Adding metadata</a><a id="Adding-metadata-1"></a><a class="docs-heading-anchor-permalink" href="#Adding-metadata" title="Permalink"></a></h2><p>Sometimes it&#39;s useful to keep track of additional metadata, e.g. a given set of parameters for a specific dataset. The <code>addmeta()</code> function can be used to attach key-value-pairs from a struct to a variety of HDF5 structures, like files, datasets or groups. The following example demonstrates it:</p><pre><code class="language-julia hljs">using KM3io
using HDF5
struct SimulationParameters
can_height::Int32
can_radius::Int32
minimum_energy::Float64
maximum_energy::Float64
end
simparams = SimulationParameters(800, 200, 1e3, 1e7)
f = h5open(&quot;simulation.h5&quot;, &quot;w&quot;)
addmeta(f, simparams)
attributes(f)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">🗂️ Attributes of HDF5.File: (read-write) simulation.h5
├─ 🏷️ can_height
├─ 🏷️ can_radius
├─ 🏷️ maximum_energy
└─ 🏷️ minimum_energy</code></pre><p>To access individual attributes, use <code>HDF5.read_attribute</code>:</p><pre><code class="language-julia hljs">read_attribute(f, &quot;can_radius&quot;)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">200</code></pre><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>It is possible to add metadata to datasets and groups too. Make sure that the struct you pass to <code>addmeta()</code> only contains primitive types or strings in their fields. Arrays and other nested or compound fieldtypes are not supported by HDF5.</p></div></div></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../controlhost/">« Accessing Live Data</a><a class="docs-footer-nextpage" href="../../api/">API »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Wednesday 20 March 2024 10:06">Wednesday 20 March 2024</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Offline data · KM3io.jl</title><meta name="title" content="Offline data · KM3io.jl"/><meta property="og:title" content="Offline data · KM3io.jl"/><meta property="twitter:title" content="Offline data · KM3io.jl"/><meta name="description" content="Documentation for KM3io.jl."/><meta property="og:description" content="Documentation for KM3io.jl."/><meta property="twitter:description" content="Documentation for KM3io.jl."/><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../search_index.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script><link href="../../assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../../"><img src="../../assets/logo.svg" alt="KM3io.jl logo"/></a><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../../">Home</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="../../manual/rootfiles/">ROOT Files</a></li><li><a class="tocitem" href="../../manual/detector/">Detector and its Components</a></li><li><a class="tocitem" href="../../manual/calibration/">Calibration</a></li><li><a class="tocitem" href="../../manual/tools/">Tools</a></li></ul></li><li><span class="tocitem">Examples</span><ul><li class="is-active"><a class="tocitem" href>Offline data</a><ul class="internal"><li><a class="tocitem" href="#Events"><span>Events</span></a></li></ul></li><li><a class="tocitem" href="../cherenkov_times/">Cherenkov times</a></li><li><a class="tocitem" href="../controlhost/">Accessing Live Data</a></li><li><a class="tocitem" href="../hdf5/">HDF5</a></li></ul></li><li><a class="tocitem" href="../../api/">API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Examples</a></li><li class="is-active"><a href>Offline data</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Offline data</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.km3net.de/common/KM3io.jl" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.km3net.de/common/KM3io.jl/blob/main/docs/src/examples/offline_data.md#L" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Offline-data"><a class="docs-heading-anchor" href="#Offline-data">Offline data</a><a id="Offline-data-1"></a><a class="docs-heading-anchor-permalink" href="#Offline-data" title="Permalink"></a></h1><p>Let&#39;s use the <code>KM3NeTTestData</code> Julia package which contains all kinds of KM3NeT related sample files. The <code>datapath()</code> function can be used to get a path to such a file. In the following, we will discover the <code>numucc.root</code> file which contains 10 muon neutrino charged current interaction events.</p><pre><code class="language-julia hljs">using KM3io, KM3NeTTestData
f = ROOTFile(datapath(&quot;offline&quot;, &quot;numucc.root&quot;))</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">ROOTFile{OnlineTree (0 events, 0 summaryslices), OfflineTree (10 events)}</code></pre><p>The <code>ROOTFile</code> is the container object which gives access to both the online and offline tree. In this case, the online tree is empty</p><pre><code class="language-julia hljs">f.online</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">OnlineTree (0 events, 0 summaryslices)</code></pre><p>and the offline tree holds our 10 MC events:</p><pre><code class="language-julia hljs">f.offline</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">OfflineTree (10 events)</code></pre><h2 id="Events"><a class="docs-heading-anchor" href="#Events">Events</a><a id="Events-1"></a><a class="docs-heading-anchor-permalink" href="#Events" title="Permalink"></a></h2><p>To access a single event, you can use the usual indexing syntax:</p><pre><code class="language-julia hljs">some_event = f.offline[5]</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">Evt (4105 hits, 78 MC hits, 0 tracks, 10 MC tracks)</code></pre><p>or ranges of events:</p><pre><code class="language-julia hljs">events = f.offline[6:9]</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">4-element Vector{Evt}:
Evt (4301 hits, 50 MC hits, 60 tracks, 13 MC tracks)
Evt (3949 hits, 58 MC hits, 59 tracks, 11 MC tracks)
Evt (4180 hits, 49 MC hits, 66 tracks, 10 MC tracks)
Evt (4210 hits, 35 MC hits, 38 tracks, 13 MC tracks)</code></pre><h3 id="Hits"><a class="docs-heading-anchor" href="#Hits">Hits</a><a id="Hits-1"></a><a class="docs-heading-anchor-permalink" href="#Hits" title="Permalink"></a></h3><p>Each event consists of a vector of hits, MC hits, tracks and MC tracks. Depending on the file, they may be empty. They are accessible via the fields <code>.hit</code>, <code>.mc_hits</code>, <code>.trks</code> and <code>.mc_trks</code>.</p><p>Let&#39;s grab an event:</p><pre><code class="language-julia hljs">evt = f.offline[3]</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">Evt (3680 hits, 28 MC hits, 38 tracks, 12 MC tracks)</code></pre><p>and have a look at its contents:</p><pre><code class="language-julia hljs">evt.hits</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">3680-element Vector{CalibratedHit}:
CalibratedHit(101, 0x00000014, 0x00000000, 0x0000001c, 0x0000000000000000, 4.1278339e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(101, 0x00000013, 0x00000000, 0x0000001a, 0x0000000000000000, 4.1283561e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(102, 0x00000012, 0x00000000, 0x00000019, 0x0000000000000000, 4.1282618e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(103, 0x00000002, 0x00000000, 0x0000001b, 0x0000000000000000, 4.1278687e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(103, 0x00000012, 0x00000000, 0x00000018, 0x0000000000000000, 4.1285088e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(104, 0x0000000c, 0x00000000, 0x00000015, 0x0000000000000000, 4.1280852e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(105, 0x00000013, 0x00000000, 0x0000001a, 0x0000000000000000, 4.1279503e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(105, 0x00000003, 0x00000000, 0x0000001b, 0x0000000000000000, 4.12895e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(106, 0x00000005, 0x00000000, 0x0000001c, 0x0000000000000000, 4.1280505e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(106, 0x0000001a, 0x00000000, 0x00000015, 0x0000000000000000, 4.1285236e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(11513, 0x00000016, 0x00000000, 0x0000000a, 0x0000000000000000, 4.1283562e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(11514, 0x00000003, 0x00000000, 0x00000012, 0x0000000000000000, 4.1278657e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(11514, 0x00000012, 0x00000000, 0x00000019, 0x0000000000000000, 4.1286932e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(11515, 0x00000003, 0x00000000, 0x00000013, 0x0000000000000000, 4.1278167e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(11516, 0x00000015, 0x00000000, 0x0000001b, 0x0000000000000000, 4.1288682e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(11517, 0x00000001, 0x00000000, 0x00000015, 0x0000000000000000, 4.1282884e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(11518, 0x00000013, 0x00000000, 0x00000015, 0x0000000000000000, 4.1281458e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(11518, 0x00000002, 0x00000000, 0x0000001d, 0x0000000000000000, 4.1281468e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
CalibratedHit(11518, 0x00000013, 0x00000000, 0x00000019, 0x0000000000000000, 4.1284348e7, [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])</code></pre><p>Let&#39;s close this file properly:</p><pre><code class="language-julia hljs">close(f)</code></pre><h3 id="Usr-data"><a class="docs-heading-anchor" href="#Usr-data">Usr data</a><a id="Usr-data-1"></a><a class="docs-heading-anchor-permalink" href="#Usr-data" title="Permalink"></a></h3><p>You can also access &quot;usr&quot;-data, which is a dynamic placeholder (<code>Dict{String, Float64}</code>) to store arbitrary data. Some software store values here which are only losely defined. Ideally, if these fields are used regulary by a software, a proper definition in the KM3NeT dataformat should be created and added to the according <code>Struct</code> as a field.</p><p>Here is an example how to access the &quot;usr&quot;-data of a single event:</p><pre><code class="language-julia hljs">f = ROOTFile(datapath(&quot;offline&quot;, &quot;usr-sample.root&quot;))
f.offline[1].usr</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">Dict{String, Float64} with 17 entries:
&quot;NTrigDOMs&quot; =&gt; 7.0
&quot;NTrigLines&quot; =&gt; 6.0
&quot;ChargeBelow&quot; =&gt; 649.0
&quot;ClassficationScore&quot; =&gt; 0.168634
&quot;NTrigHits&quot; =&gt; 30.0
&quot;NGeometryVetoHits&quot; =&gt; 0.0
&quot;ChargeRatio&quot; =&gt; 0.213333
&quot;ToT&quot; =&gt; 825.0
&quot;DeltaPosZ&quot; =&gt; 37.5197
&quot;RecoQuality&quot; =&gt; 85.4596
&quot;LastPartPosZ&quot; =&gt; 97.7753
&quot;NSnapHits&quot; =&gt; 51.0
&quot;NSpeedVetoHits&quot; =&gt; 0.0
&quot;RecoNDF&quot; =&gt; 37.0
&quot;FirstPartPosZ&quot; =&gt; 135.295
&quot;CoC&quot; =&gt; 118.63
&quot;ChargeAbove&quot; =&gt; 176.0</code></pre><pre><code class="language-julia hljs">close(f)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../manual/tools/">« Tools</a><a class="docs-footer-nextpage" href="../cherenkov_times/">Cherenkov times »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Wednesday 20 March 2024 10:06">Wednesday 20 March 2024</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
File added
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Home · KM3io.jl</title><meta name="title" content="Home · KM3io.jl"/><meta property="og:title" content="Home · KM3io.jl"/><meta property="twitter:title" content="Home · KM3io.jl"/><meta name="description" content="Documentation for KM3io.jl."/><meta property="og:description" content="Documentation for KM3io.jl."/><meta property="twitter:description" content="Documentation for KM3io.jl."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script><link href="assets/custom.css" rel="stylesheet" type="text/css"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href><img src="assets/logo.svg" alt="KM3io.jl logo"/></a><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li class="is-active"><a class="tocitem" href>Home</a><ul class="internal"><li><a class="tocitem" href="#Installation"><span>Installation</span></a></li><li><a class="tocitem" href="#Quickstart"><span>Quickstart</span></a></li><li><a class="tocitem" href="#Acknowledgements"><span>Acknowledgements</span></a></li></ul></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="manual/rootfiles/">ROOT Files</a></li><li><a class="tocitem" href="manual/detector/">Detector and its Components</a></li><li><a class="tocitem" href="manual/calibration/">Calibration</a></li><li><a class="tocitem" href="manual/tools/">Tools</a></li></ul></li><li><span class="tocitem">Examples</span><ul><li><a class="tocitem" href="examples/offline_data/">Offline data</a></li><li><a class="tocitem" href="examples/cherenkov_times/">Cherenkov times</a></li><li><a class="tocitem" href="examples/controlhost/">Accessing Live Data</a></li><li><a class="tocitem" href="examples/hdf5/">HDF5</a></li></ul></li><li><a class="tocitem" href="api/">API</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Home</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Home</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://git.km3net.de/common/KM3io.jl" title="View the repository"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">Repository</span></a><a class="docs-navbar-link" href="https://git.km3net.de/common/KM3io.jl/blob/main/docs/src/index.md#L" title="Edit source"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="KM3io.jl"><a class="docs-heading-anchor" href="#KM3io.jl">KM3io.jl</a><a id="KM3io.jl-1"></a><a class="docs-heading-anchor-permalink" href="#KM3io.jl" title="Permalink"></a></h1><p><code>KM3io.jl</code> is a Julia library which implements high-performance I/O functions and additional utilities to deal with dataformats used in KM3NeT, e.g. <a href="https://root.cern.ch">ROOT</a> (online/offline files), <a href="https://wiki.km3net.de/index.php/Dataformats#Detector_Description_.28.detx_and_.datx.29">DETX</a> (detector geometry and calibrations) and acoustics (waveforms and hardware). In contrast to Python, you are free to utilise as many (nested) <code>for</code>-loops as you like while still being as fast as in e.g. in C++.</p><p>Apropos <a href="https://root.cern.ch">ROOT</a> and C++, the <a href="https://git.km3net.de/common/km3net-dataformat">KM3NeT Dataformat</a> is defined in C++ and uses the I/O functionality of the ROOT framework to create the online and offline ROOT files. Luckily, there is a pure Julia library named <a href="https://github.com/JuliaHEP/UnROOT.jl">UnROOT.jl</a> that provides access the the ROOT files without the need to install ROOT or the corresponding C++ library. This allows <code>KM3io.jl</code> to be completely free from these external dependencies.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>The library is still under development so that the API might slightly change. Feedback and contributions are highly welcome!</p></div></div><h2 id="Installation"><a class="docs-heading-anchor" href="#Installation">Installation</a><a id="Installation-1"></a><a class="docs-heading-anchor-permalink" href="#Installation" title="Permalink"></a></h2><p><code>KM3io.jl</code> is <strong>not an officially registered Julia package</strong> but it&#39;s available via the <strong><a href="https://git.km3net.de/common/julia-registry">KM3NeT Julia registry</a></strong>. To add the KM3NeT Julia registry to your local Julia registry list, follow the instructions in its <a href="https://git.km3net.de/common/julia-registry#adding-the-registry">README</a> or simply do</p><pre><code class="nohighlight hljs">git clone https://git.km3net.de/common/julia-registry ~/.julia/registries/KM3NeT</code></pre><p>After that, you can instal <code>KM3io.jl</code> just like any other Julia package:</p><pre><code class="nohighlight hljs">julia&gt; import Pkg; Pkg.add(&quot;KM3io&quot;)</code></pre><h2 id="Quickstart"><a class="docs-heading-anchor" href="#Quickstart">Quickstart</a><a id="Quickstart-1"></a><a class="docs-heading-anchor-permalink" href="#Quickstart" title="Permalink"></a></h2><pre><code class="language-julia-repl hljs">julia&gt; using KM3io, KM3NeTTestData
julia&gt; f = ROOTFile(datapath(&quot;offline&quot;, &quot;numucc.root&quot;))
ROOTFile{OnlineTree (0 events, 0 summaryslices), OfflineTree (10 events)}
julia&gt; f.offline
OfflineTree (10 events)
julia&gt; some_event = f.offline[3]
KM3io.Evt (3680 hits, 28 MC hits, 38 tracks, 12 MC tracks)</code></pre><h2 id="Acknowledgements"><a class="docs-heading-anchor" href="#Acknowledgements">Acknowledgements</a><a id="Acknowledgements-1"></a><a class="docs-heading-anchor-permalink" href="#Acknowledgements" title="Permalink"></a></h2><p>Thanks to <a href="https://git.km3net.de/jschumann">Johannes Schumann</a> for providing the awesome project logo!</p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="manual/rootfiles/">ROOT Files »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.3.0 on <span class="colophon-date" title="Wednesday 20 March 2024 10:06">Wednesday 20 March 2024</span>. Using Julia version 1.9.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment