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
aa787a34
Verified
Commit
aa787a34
authored
2 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Add more examples
parent
fb40a11a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/make.jl
+4
-1
4 additions, 1 deletion
docs/make.jl
docs/src/examples.md
+0
-56
0 additions, 56 deletions
docs/src/examples.md
with
4 additions
and
57 deletions
docs/make.jl
+
4
−
1
View file @
aa787a34
...
...
@@ -11,7 +11,10 @@ makedocs(;
),
pages
=
[
"Home"
=>
"index.md"
,
"Examples"
=>
"examples.md"
,
"Examples"
=>
Any
[
"Offline data"
=>
"examples/offline_data.md"
,
"Cherenkov times"
=>
"examples/cherenkov_times.md"
,
],
"API"
=>
"api.md"
],
repo
=
"https://git.km3net.de/common/KM3io.jl/blob/{commit}{path}#L{line}"
,
...
...
This diff is collapsed.
Click to expand it.
docs/src/examples.md
deleted
100644 → 0
+
0
−
56
View file @
fb40a11a
# 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