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
e26f073e
Commit
e26f073e
authored
3 years ago
by
Johannes Schumann
Browse files
Options
Downloads
Patches
Plain Diff
Some restructures
parent
218d5fcd
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
src/KM3io.jl
+1
-76
1 addition, 76 deletions
src/KM3io.jl
src/types.jl
+75
-0
75 additions, 0 deletions
src/types.jl
with
76 additions
and
76 deletions
src/KM3io.jl
+
1
−
76
View file @
e26f073e
...
...
@@ -5,82 +5,7 @@ using Corpuscles
import
Base
:
getindex
abstract type
AbstractHit
end
abstract type
DataFile
end
struct
Cartesian
{
T
}
<:
FieldVector
{
3
,
T
}
x
::
T
y
::
T
z
::
T
end
struct
NeutrinoWeights
{
T
}
<:
FieldVector
{
4
,
T
}
w1
::
T
w2
::
T
w3
::
T
w4
::
T
end
struct
RawHit
<:
AbstractHit
id
::
Integer
PMid
::
Integer
pe
::
Integer
time
::
Integer
end
struct
Hit
<:
AbstractHit
id
::
Integer
PMid
::
Integer
npe
::
Real
time
::
Real
particle
::
Geant3ID
track_id
::
Integer
end
struct
KineticInfo
pos
::
Cartesian
{
T
}
where
{
T
<:
Real
}
dir
::
Cartesian
{
T
}
where
{
T
<:
Real
}
energy
::
Real
time
::
Real
end
struct
Neutrino
id
::
Integer
kin
::
KineticInfo
bjorken
::
Tuple
{
Real
,
Real
}
ichannel
::
Integer
particle
::
PDGID
cc
::
Bool
end
struct
Track
id
::
Integer
kin
::
KineticInfo
particle
::
Geant3ID
end
struct
Event
hits
::
Vector
{
AbstractHit
}
neutrino
::
Union
{
Missing
,
Neutrino
}
tracks
::
Vector
{
Track
}
weights
::
Union
{
Missing
,
NeutrinoWeights
}
end
function
parse_kin
(
fields
::
Vector
{
T
})
where
{
T
<:
AbstractString
}
x
=
parse
(
Float64
,
fields
[
1
])
y
=
parse
(
Float64
,
fields
[
2
])
z
=
parse
(
Float64
,
fields
[
3
])
pos
=
Cartesian
(
x
,
y
,
z
)
vx
=
parse
(
Float64
,
fields
[
4
])
vy
=
parse
(
Float64
,
fields
[
5
])
vz
=
parse
(
Float64
,
fields
[
6
])
dir
=
Cartesian
(
vx
,
vy
,
vz
)
energy
=
parse
(
Float64
,
fields
[
7
])
time
=
parse
(
Float64
,
fields
[
8
])
KineticInfo
(
pos
,
dir
,
energy
,
time
)
end
include
(
"types.jl"
)
include
(
"evt.jl"
)
end
# module
This diff is collapsed.
Click to expand it.
src/types.jl
0 → 100644
+
75
−
0
View file @
e26f073e
abstract type
AbstractHit
end
abstract type
DataFile
end
struct
Cartesian
{
T
}
<:
FieldVector
{
3
,
T
}
x
::
T
y
::
T
z
::
T
end
struct
NeutrinoWeights
{
T
}
<:
FieldVector
{
4
,
T
}
w1
::
T
w2
::
T
w3
::
T
w4
::
T
end
struct
RawHit
<:
AbstractHit
id
::
Integer
PMid
::
Integer
pe
::
Integer
time
::
Integer
end
struct
Hit
<:
AbstractHit
id
::
Integer
PMid
::
Integer
npe
::
Real
time
::
Real
particle
::
Geant3ID
track_id
::
Integer
end
struct
KineticInfo
pos
::
Cartesian
{
T
}
where
{
T
<:
Real
}
dir
::
Cartesian
{
T
}
where
{
T
<:
Real
}
energy
::
Real
time
::
Real
end
struct
Neutrino
id
::
Integer
kin
::
KineticInfo
bjorken
::
Tuple
{
Real
,
Real
}
ichannel
::
Integer
particle
::
PDGID
cc
::
Bool
end
struct
Track
id
::
Integer
kin
::
KineticInfo
particle
::
Geant3ID
end
struct
Event
hits
::
Vector
{
AbstractHit
}
neutrino
::
Union
{
Missing
,
Neutrino
}
tracks
::
Vector
{
Track
}
weights
::
Union
{
Missing
,
NeutrinoWeights
}
end
function
parse_kin
(
fields
::
Vector
{
T
})
where
{
T
<:
AbstractString
}
x
=
parse
(
Float64
,
fields
[
1
])
y
=
parse
(
Float64
,
fields
[
2
])
z
=
parse
(
Float64
,
fields
[
3
])
pos
=
Cartesian
(
x
,
y
,
z
)
vx
=
parse
(
Float64
,
fields
[
4
])
vy
=
parse
(
Float64
,
fields
[
5
])
vz
=
parse
(
Float64
,
fields
[
6
])
dir
=
Cartesian
(
vx
,
vy
,
vz
)
energy
=
parse
(
Float64
,
fields
[
7
])
time
=
parse
(
Float64
,
fields
[
8
])
KineticInfo
(
pos
,
dir
,
energy
,
time
)
end
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