Skip to content

Commit f766e59

Browse files
Improved documentation
Add Documenter setup to use @autodocs to generate all public and internal documentation. Use @ref links to refer to methods and types in main documentation pages. Move get_all_ancestors() method to ClusterSequence (it is not visualisation). Add logo for the package!
1 parent e60edd2 commit f766e59

File tree

13 files changed

+394
-47
lines changed

13 files changed

+394
-47
lines changed

docs/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[deps]
2+
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
23
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
34
JetReconstruction = "44e8cb2c-dfab-4825-9c70-d4808a591196"
5+
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
46

57
[compat]
68
Documenter = "1.4"

docs/make.jl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
using Documenter
2+
using CairoMakie
23
using JetReconstruction
34

4-
makedocs(sitename = "JetReconstruction.jl")
5+
push!(LOAD_PATH,"../ext/")
6+
7+
include(joinpath(@__DIR__, "..", "ext", "JetVisualisation.jl"))
8+
9+
makedocs(sitename = "JetReconstruction.jl",
10+
pages = [
11+
"Home" => "index.md",
12+
"Examples" => "examples.md",
13+
"Reference" => Any[
14+
"Public API" => "lib/public.md",
15+
"Internal API" => "lib/internal.md",
16+
"Visualisation API" => "lib/visualisation.md",
17+
]
18+
],)
519

620
deploydocs(repo = "github.com/JuliaHEP/JetReconstruction.jl.git",
721
push_preview = true)

docs/src/assets/logo.png

31.1 KB
Loading

docs/src/assets/logo.svg

Lines changed: 180 additions & 0 deletions
Loading

docs/src/examples.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,8 @@ Similar to `visualise-jets.jl` this notebook will produce a visualisation of jet
4444
reconstruction in the browser. This is a 3D plot where all the initial energy
4545
deposits are visualised, with colours that indicate in which final cluster the
4646
deposit ended up in.
47+
48+
## `animate-reconstruction.jl`
49+
50+
Performs jet reconstruction and then produces and animation of the process,
51+
showing how the jets merge from their different constituents.

docs/src/index.md

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,16 @@ inclusive ``k_\text{T}``.
1616

1717
## Reconstruction Interface
1818

19-
The main interface for reconstruction is:
19+
The main interface for reconstruction is [`jet_reconstruct`](@ref), called as, e.g.,
2020

21-
```@docs
22-
jet_reconstruct(particles; p = -1, R = 1.0, recombine = +, strategy = RecoStrategy.Best)
21+
```julia
22+
jet_reconstruct(particles; p = -1, R = 1.0)
2323
```
2424

25-
The object returned is a `ClusterSequence`, which internally tracks all merge steps.
25+
Where `particles` is a collection of 4-vector objects to reconstruct.
2626

27-
```@docs
28-
ClusterSequence
29-
```
27+
The object returned is a [`ClusterSequence`](@ref), which internally tracks all
28+
merge steps.
3029

3130
## Strategy
3231

@@ -38,9 +37,12 @@ Three strategies are available for the different algorithms:
3837
| `RecoStrategy.N2Plain` | Global matching of particles at each interation (works well for low $N$) | `plain_jet_reconstruct` |
3938
| `RecoStrategy.N2Tiled` | Use tiles of radius $R$ to limit search space (works well for higher $N$) | `tiled_jet_reconstruct` |
4039

41-
Generally one can use the `jet_reconstruct` interface, shown above, as the *Best* strategy safely as the overhead is extremely low. That interface supports a `strategy` option to switch to a different option.
40+
Generally one can use the `jet_reconstruct` interface, shown above, as the
41+
*Best* strategy safely as the overhead is extremely low. That interface supports
42+
a `strategy` option to switch to a different option.
4243

43-
Another option, if one wishes to use a specific strategy, is to call that strategy's interface directly, e.g.,
44+
Another option, if one wishes to use a specific strategy, is to call that
45+
strategy's interface directly, e.g.,
4446

4547
```julia
4648
# For N2Plain strategy called directly
@@ -54,19 +56,8 @@ Note that there is no `strategy` option in these interfaces.
5456
To obtain final jets both inclusive (``p_T`` cut) and exclusive (``n_{jets}`` or
5557
``d_{ij}`` cut) selections are supported:
5658

57-
```@docs
58-
inclusive_jets(clusterseq::ClusterSequence, ptmin = 0.0)
59-
```
60-
61-
```@docs
62-
exclusive_jets(clusterseq::ClusterSequence; dcut = nothing, njets = nothing)
63-
```
64-
65-
The number of exclusive jets passing a particular `dcut` can be obtained:
66-
67-
```@docs
68-
n_exclusive_jets(clusterseq::ClusterSequence; dcut::AbstractFloat)
69-
```
59+
- [inclusive_jets(clusterseq::ClusterSequence, ptmin = 0.0)](@ref)
60+
- [exclusive_jets(clusterseq::ClusterSequence; dcut = nothing, njets = nothing)](@ref)
7061

7162
### Sorting
7263

@@ -79,7 +70,7 @@ sorted_jets = sort!(inclusive_jets(cs::ClusterSequence; ptmin=5.0),
7970
by=JetReconstruction.energy, rev=true)
8071
```
8172

82-
## Plotting
73+
## Plotting and Animation
8374

8475
![illustration](assets/jetvis.png)
8576

@@ -91,6 +82,10 @@ directory.
9182
The plotting code is a package extension and will load if the one of the `Makie`
9283
modules is loaded in the environment.
9384

85+
The [`animatereco`](@ref) function will animate the reconstruction sequence, given a
86+
`ClusterSequence` object. See the function documentation for the many options
87+
that can be customised.
88+
9489
## Serialisation
9590

9691
The package also provides methods such as `loadjets`, `loadjets!`, and

docs/src/lib/internal.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Jet Reconstruction Internal Documentation
2+
3+
Documentation for `JetReconstruction.jl`'s internal methods and types.
4+
5+
N.B. no guarantee is made of stability of these interfaces or types.
6+
7+
```@meta
8+
CollapsedDocStrings = true
9+
```
10+
11+
## Index
12+
13+
```@index
14+
Pages = ["internal.md"]
15+
```
16+
17+
## Public Interface
18+
19+
```@autodocs
20+
Modules = [JetReconstruction]
21+
Public = false
22+
Order = [:function, :type]
23+
```

docs/src/lib/public.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Jet Reconstruction Public Documentation
2+
3+
Documentation for `JetReconstruction.jl`'s public interfaces.
4+
5+
## Index
6+
7+
```@index
8+
Pages = ["public.md"]
9+
```
10+
11+
## Public Methods and Types
12+
13+
```@autodocs
14+
Modules = [JetReconstruction]
15+
Private = false
16+
Order = [:function, :type]
17+
```

docs/src/lib/visualisation.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Jet Visualisation Documentation
2+
3+
Documentation for visualisation interfaces extension module.
4+
5+
## Index
6+
7+
```@index
8+
Pages = ["visualisation.md"]
9+
```
10+
11+
## Jet Visualisation Public Interfaces
12+
13+
```@autodocs
14+
Modules = [JetVisualisation]
15+
Order = [:function]
16+
```

examples/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@ colours that indicate in which final cluster the deposit ended up in.
2929
This notebook will produce a visualisation of jet reconstruction in the browser.
3030
This is a 3D plot where all the initial energy deposits are visualised, with
3131
colours that indicate in which final cluster the deposit ended up in.
32+
33+
## `animate-reconstruction.jl`
34+
35+
Performs jet reconstruction and then produces and animation of the process,
36+
showing how the jets merge from their different constituents.

0 commit comments

Comments
 (0)