Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KM3io.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
common
KM3io.jl
Commits
09b9a901
Verified
Commit
09b9a901
authored
2 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Add example files
parent
d90f4ff4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/src/examples/cherenkov_times.md
+29
-0
29 additions, 0 deletions
docs/src/examples/cherenkov_times.md
docs/src/examples/offline_data.md
+56
-0
56 additions, 0 deletions
docs/src/examples/offline_data.md
with
85 additions
and
0 deletions
docs/src/examples/cherenkov_times.md
0 → 100644
+
29
−
0
View file @
09b9a901
# Cherenkov times
In this example, we will pick the best reconstructed muon (from the Jpp muon
reconstruction chain
`JMuon`
) in each event and calculate the Cherenkov hit time
residuals for each triggered hit.
We open the
`numucc.root`
file from the
`KM3NeTTestData`
package:
```
@example 1
using KM3io, KM3NeTTestData
f = ROOTFile(datapath("offline", "numucc.root"))
```
Each event holds a vector of reconstructed tracks (
`Vector{Trk}`
) behind the
`.trks`
field. This vector contains different stages of reconstruction results
from a variety of reconstruction algorithms (
`JMuon`
,
`JShower`
,
`aashower`
etc.).
`KM3io.jl`
exports helper functions to pick the best reconstructed track
for a given reconstruction algorithm. The logic is based on the reference
implementation in
[
KM3NeT DataFormat
tools
](
https://git.km3net.de/common/km3net-dataformat/-/blob/master/tools/reconstruction.hh
)
.
The function
`bestjppmuon()`
can be used to select the best reconstructed
`JMuon`
for a given event:
```
@example 1
evt = f.offline[1]
m = bestjppmuon(evt)
```
This diff is collapsed.
Click to expand it.
docs/src/examples/offline_data.md
0 → 100644
+
56
−
0
View file @
09b9a901
# Examples
## Offline data
Let's use the
`KM3NeTTestData`
Julia package which contains all kinds of KM3NeT
related sample files. The
`datapath()`
function can be used to get a path to
such a file. In the following, we will discover the
`numucc.root`
file which
contains 10 muon neutrino charged current interaction events.
```
@example 1
using KM3io, KM3NeTTestData
f = ROOTFile(datapath("offline", "numucc.root"))
```
The
`ROOTFile`
is the container object which gives access to both the online and
offline tree. In this case, the online tree is empty
```
@example 1
f.online
```
and the offline tree holds our 10 MC events:
```
@example 1
f.offline
```
### Events
To access a single event, you can use the usual indexing syntax:
```
@example 1
some_event = f.offline[5]
```
or ranges of events:
```
@example 1
events = f.offline[6:9]
```
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
`.hit`
,
`.mc_hits`
,
`.trks`
and
`.mc_trks`
.
Let's grab an event:
```
@example 1
evt = f.offline[3]
```
and have a look at its contents:
```
@example 1
evt.hits
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment