Skip to content
This repository was archived by the owner on Feb 11, 2026. It is now read-only.

Commit 7012e6a

Browse files
committed
doc: various improvements
1 parent dba3553 commit 7012e6a

5 files changed

Lines changed: 76 additions & 56 deletions

File tree

doc/gen/Doxyfile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ TAB_SIZE = 4
285285

286286
ALIASES =
287287
# algorithm properties
288-
ALIASES += algo_brief{1}="@brief **%Algorithm:** \1^^@xrefitem algo \"\" \"\" \1^^@link_to_run_ftn"
288+
ALIASES += algo_brief{1}="@brief **%Algorithm:** \1^^@xrefitem algo \"\" \"List of Algorithms\" \1^^@link_to_run_ftn"
289289
ALIASES += algo_type_filter="@par Type: Filter^^This algorithm will filter input bank(s).^^"
290290
ALIASES += algo_type_transformer="@par Type: Transformer^^This algorithm will change values within input bank(s).^^"
291291
ALIASES += algo_type_creator="@par Type: Creator^^^^- This algorithm creates new bank(s); \ref created_banks \"click here for a description of all created banks\".^^- See also the return value type of this algorithm's action functions, which may be `struct`s with the same set of variables as the created bank.^^^^"
@@ -2550,7 +2550,7 @@ COLLABORATION_GRAPH = NO
25502550
# The default value is: YES.
25512551
# This tag requires that the tag HAVE_DOT is set to YES.
25522552

2553-
GROUP_GRAPHS = YES
2553+
GROUP_GRAPHS = NO
25542554

25552555
# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
25562556
# collaboration diagrams in a style similar to the OMG's Unified Modeling

doc/gen/mainpage.md

Lines changed: 56 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -23,42 +23,48 @@ To see Iguana algorithms used in the context of analysis code, with **various la
2323
| ^ | Includes guidance on how to build Iguana with your C++ code |
2424
| @spacer [Python examples](#examples_python) @spacer | For users of Python tools, such as `PyROOT` |
2525
| @spacer [Fortran examples](#examples_fortran) @spacer | See also the [Fortran usage guide](#fortran_usage_guide) |
26-
| @spacer Java @spacer | We do not yet support Java, but we plan to soon |
26+
| @spacer **Java** @spacer | We do not yet support Java, but we plan to soon |
2727

28-
In summary, the general way to use an Iguana algorithm is as follows; see examples and documentation below for more details.
28+
<br><br>
2929

30-
1. Decide how you will use Iguana with your analysis code (see also the flowchart, just below)
30+
## Usage Summary
31+
32+
In summary, the general way to use an Iguana algorithm is the following:
33+
34+
1. Decide how you will use Iguana with your analysis code (see also [the flowchart](#mainpageFlowchart), just below)
3135
- Use [Iguana Common Functions](#mainpageCommon) if your analysis uses:
32-
- The [HIPO C++ API](https://github.com/gavalian/hipo)
33-
- [`clas12root`](https://github.com/JeffersonLab/clas12root)
36+
- The [**HIPO C++ API**](https://github.com/gavalian/hipo)
37+
- [**`clas12root`**](https://github.com/JeffersonLab/clas12root)
3438
- Our [Our Python bindings](#examples_python)
3539
- Use [Iguana Action Functions](#mainpageAction) otherwise
36-
- Unfortunately, some algorithms are not fully supported by action functions, but we can try to add support upon request
3740
2. Decide [which algorithms](#algo) you want to use
38-
- Tip: you may use `iguana::AlgorithmSequence` to help run a _sequence_ of algorithms
3941
3. Check each algorithm configuration, and [adjust it if you prefer](#mainpageConfiguring)
4042
4. Start each algorithm, which "locks in" its configuration:
4143
- if using Common Functions:
42-
- call `Start()` if you will be using individual `hipo::bank` objects (_e.g._, if you are using `clas12root`)
43-
- call `Start(hipo::banklist&)` if you use `hipo::banklist`
44+
- call @link iguana::Algorithm::Start() `Start()` @endlink if you will be using individual `hipo::bank` objects (_e.g._, if you are using `clas12root`)
45+
- call @link iguana::Algorithm::Start(hipo::banklist&) `Start(hipo::banklist&)` @endlink if you use `hipo::banklist`
46+
- **Tip:** `hipo::banklist` users may use @link iguana::AlgorithmSequence `AlgorithmSequence` @endlink to help run a _sequence_ of algorithms
4447
- if using Action Functions:
45-
- call `Start()`
48+
- call @link iguana::Algorithm::Start() `Start()` @endlink
4649
5. In the event loop, Run the algorithm for each event:
4750
- if using Common Functions, either:
48-
- call specialized `Run` functions, which act on individual `hipo::bank` objects, or
49-
- call `Run(hipo::banklist&)` if you use `hipo::banklist`
50-
- call the Action Function(s) otherwise
51+
- call specialized `Run` functions, which act on individual `hipo::bank` objects and are unique for each algorithm; users of `clas12root` versions _newer_ than `1.8.6` should use this
52+
- call @link iguana::Algorithm::Run(hipo::banklist&) const `Run(hipo::banklist&)` @endlink if you use `hipo::banklist`
53+
- call the [Action Function(s)](#action) otherwise
5154
6. Proceed with your analysis
5255
- if you called a `Run` function, banks will be filtered, transformed, and/or created
5356
- if you called Action Functions, you will need to handle their output yourself
5457
- in either case, see [guidance on how to run algorithms](#mainpageRunning) for more details
55-
7. After your event loop, stop each algorithm by calling `Stop()`
58+
7. After your event loop, stop each algorithm by calling @link iguana::Algorithm::Stop() `Stop()` @endlink
5659

5760
Please let the maintainers know if your use case is not covered in any examples or if you need any help.
5861

62+
@anchor mainpageFlowchart
63+
### Flowchart for Usage
64+
5965
Here is a flowchart, illustrating the above:
6066

61-
<img src="./flowchart_usage.png" width=100%/>
67+
<img src="./flowchart_usage.png" width=60%/>
6268

6369
<br><hr>
6470

@@ -70,9 +76,9 @@ An Iguana algorithm is a function that maps input HIPO bank data to output data.
7076

7177
| Type | Description | Example |
7278
| --- | --- | --- |
73-
| **Filter** | Filters rows of a bank based on a Boolean condition | `iguana::clas12::FiducialFilter`: filter particles with fiducial cuts |
74-
| **Transformer** | Transform (mutate) elements of a bank | `iguana::clas12::MomentumCorrection`: correct particle momenta |
75-
| **Creator** | Create a new bank | `iguana::physics::InclusiveKinematics`: calculate inclusive kinematics @latex{x}, @latex{Q^2}, _etc_. |
79+
| **Filter** | Filters rows of a bank based on a Boolean condition | @link iguana::clas12::FiducialFilter @endlink: filter particles with fiducial cuts |
80+
| **Transformer** | Transform (mutate) elements of a bank | @link iguana::clas12::MomentumCorrection @endlink: correct particle momenta |
81+
| **Creator** | Create a new bank | @link iguana::physics::InclusiveKinematics @endlink: calculate inclusive kinematics @latex{x}, @latex{Q^2}, _etc_. |
7682

7783
The available algorithms are:
7884

@@ -85,7 +91,7 @@ The available algorithms are:
8591
@anchor mainpageRunning
8692
## How to Run Algorithms
8793

88-
Algorithms may be run using either:
94+
Algorithms may be run using one of the following; see [the usage flowchart](#mainpageFlowchart) for help deciding what to do.
8995

9096
- [Common Functions](#mainpageCommon): for users of the [**the HIPO API**](https://github.com/gavalian/hipo), which is likely the case if you are using C++, _e.g._, via `clas12root`
9197
- [Action Functions](#mainpageAction): for all other users
@@ -102,22 +108,30 @@ All algorithms have the following **Common Functions**, which may be used in ana
102108

103109
| Common Functions ||
104110
| --- | --- |
105-
| `Start(hipo::banklist&)` | To be called before event processing |
106-
| `Run(hipo::banklist&)` | To be called for every event |
107-
| `Stop()` | To be called after event processing |
108-
109-
The algorithms are implemented in C++ classes which inherit from the base class `iguana::Algorithm`; these three class methods are overridden in each algorithm.
110-
111-
The `Run(hipo::banklist&)` function should be called on every event; the general consequence, that is, how the user should handle the algorithm's results, depends on the
111+
| `Start` | To be called before event processing |
112+
| `Run` | To be called for every event |
113+
| `Stop` | To be called after event processing |
114+
115+
- for `Start`:
116+
- call @link iguana::Algorithm::Start() `Start()` @endlink if you will be using individual `hipo::bank` objects (_e.g._, if you are using `clas12root`)
117+
- call @link iguana::Algorithm::Start(hipo::banklist&) `Start(hipo::banklist&)` @endlink if you use `hipo::banklist`
118+
- **Tip:** `hipo::banklist` users may use @link iguana::AlgorithmSequence `AlgorithmSequence` @endlink to help run a _sequence_ of algorithms
119+
- for `Run`:
120+
- call specialized `Run` functions, which act on individual `hipo::bank` objects and are unique for each algorithm; users of `clas12root` versions _newer_ than `1.8.6` should use this
121+
- call @link iguana::Algorithm::Run(hipo::banklist&) const `Run(hipo::banklist&)` @endlink if you use `hipo::banklist`
122+
- the `Stop` function is the same for either case
123+
124+
The `Run` function should be called on every event; the general consequence, that is, how the user should handle the algorithm's results, depends on the
112125
algorithm type:
113126

114127
<table>
115128
<tr> <th>Type</th> <th>How to handle the results</th> </tr>
116129
<tr> <td>**Filter**</td> <td>
117-
The involved banks will be filtered.
118-
To iterate over _filtered_ bank rows, use the function `hipo::bank::getRowList`,
119-
rather than iterating from `0` up to `hipo::bank::getRows()`; for example, given a
120-
bank object named `particle_bank`:
130+
The involved banks will be filtered. To iterate over _filtered_ bank rows, use
131+
the function `hipo::bank::getRowList`, rather than iterating from `0` up to
132+
`hipo::bank::getRows()`.
133+
<br>
134+
For example, given a bank object named `particle_bank`:
121135
```cpp
122136
for(auto const& row : particle_bank.getRowList()) {
123137
// loops over only the rows which pass the filter
@@ -130,12 +144,12 @@ for(int row = 0; row < particle_bank.getRows(); row++) {
130144
```
131145
</td> </tr>
132146
<tr> <td>**Transformer**</td> <td>
133-
The transformed `hipo::bank` will simply have
134-
the relevant bank elements changed. For example, momentum correction algorithms
135-
typically change the particle momentum components.
147+
The transformed `hipo::bank` will simply have the relevant bank elements changed.
148+
<br>
149+
For example, momentum correction algorithms typically change the particle momentum components.
136150
</td> </tr>
137151
<tr> <td>**Creator**</td> <td>
138-
Creator-type algorithms will simply create a new `hipo::bank` object, appending
152+
Creator-type algorithms will create a new `hipo::bank` object, appending
139153
it to the end of the input `hipo::banklist`.
140154
<ul>
141155
<li>[Click here for descriptions of all created banks](#created_banks)</li>
@@ -154,6 +168,8 @@ Internally, `Run(hipo::banklist&)` calls Action Functions, which are described i
154168
@anchor mainpageAction
155169
### Action Functions
156170

171+
@todo **Unfortunately, some algorithms are not yet fully supported by action functions, but we can try to add support upon request.**
172+
157173
The action functions do the _real_ work of the algorithm, and are meant to be
158174
easily callable from _any_ analysis, even if HIPO banks are not directly used.
159175
These functions are unique to each algorithm, so view the algorithm
@@ -191,8 +207,8 @@ To maximize compatibility with user analysis code, these functions are overloade
191207
Finally, it is important to note _when_ to call action functions in the analysis code. For example, some action functions should be
192208
called _once_ every event, while others should be called for every particle of the `REC::Particle` bank. Some algorithms
193209
have _both_ of these types of functions, for example:
194-
- `iguana::clas12::ZVertexFilter::PrepareEvent`, which must be called first, at the beginning of an event's analysis
195-
- `iguana::clas12::ZVertexFilter::Filter`, which must be called on every particle, using the _output_ of `PrepareEvent` in one of its input parameters
210+
- @link iguana::clas12::ZVertexFilter::PrepareEvent @endlink, which must be called first, at the beginning of an event's analysis
211+
- @link iguana::clas12::ZVertexFilter::Filter @endlink, which must be called on every particle, using the _output_ of `PrepareEvent` in one of its input parameters
196212

197213
It is highly recommended to read an algorithm's documentation carefully before using it, _especially_ if you use action functions.
198214

@@ -209,7 +225,7 @@ Many algorithms are configurable. An algorithm's configuration parameters and th
209225

210226
Iguana provides a few ways to configure algorithms; in general, you may either:
211227
- use YAML for configuration that gets applied at runtime, _i.e._, no need to recompile
212-
- use `iguana::Algorithm::SetOption` to configure an algorithm more directly, which may require recompilation, depending on how you use Iguana algorithms
228+
- use @link iguana::Algorithm::SetOption @endlink to configure an algorithm more directly, which may require recompilation, depending on how you use Iguana algorithms
213229

214230
The default configuration YAML files are installed in the `etc/` subdirectory of the Iguana installation. If you have set the Iguana environment variables using, _e.g._ `source this_iguana.sh`, or if you are using the version of Iguana installed on `ifarm`, you will have the environment variable `$IGUANA_CONFIG_PATH` set to include this `etc/` directory.
215231

@@ -257,8 +273,8 @@ physics::AlgorithmB
257273
```
258274

259275
Once you have a YAML file, you just need to tell each algorithm to use it:
260-
- use `iguana::Algorithm::SetConfigFile` on each algorithm
261-
- if you use `iguana::AlgorithmSequence`, use `iguana::AlgorithmSequence::SetConfigFileForEachAlgorithm` to use this file for each algorithm in the algorithm sequence
276+
- use @link iguana::Algorithm::SetConfigFile @endlink on each algorithm
277+
- if you use @link iguana::AlgorithmSequence @endlink, use @link iguana::AlgorithmSequence::SetConfigFileForEachAlgorithm @endlink to use this file for each algorithm in the algorithm sequence
262278

263279
### Option 2: Copy the default directory, and modify
264280

@@ -279,4 +295,4 @@ setenv IGUANA_CONFIG_PATH `pwd`/my_iguana_config:$IGUANA_CONFIG_PATH # tcsh or
279295
The algorithms will then search `my_iguana_config` for the configuration before searching the default paths. You may add multiple paths, if needed.
280296
Paths which appear first in `$IGUANA_CONFIG_PATH` will be prioritized when the algorithm searches for configuration parameters; this behavior is similar to that of `$PATH` or `$LD_LIBRARY_PATH`. Note that `source this_iguana.sh` will _overwrite_ `$IGUANA_CONFIG_PATH`.
281297

282-
2. Use `iguana::Algorithm::SetConfigDirectory` instead of prepending `$IGUANA_CONFIG_PATH` (and if you use an algorithm sequence, use `iguana::AlgorithmSequence::SetConfigDirectoryForEachAlgorithm`)
298+
2. Use @link iguana::Algorithm::SetConfigDirectory @endlink instead of prepending `$IGUANA_CONFIG_PATH` (and if you use an algorithm sequence, use @link iguana::AlgorithmSequence::SetConfigDirectoryForEachAlgorithm @endlink)

doc/gen/mermaid/build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# NOTE: this is not automated by `meson`, to avoid introducing `mermaid-cli` dependency;
44
# this is okay, since we do not expect this figure to change often
55
exec mmdc \
6-
-b transparent \
7-
-w 1600 \
8-
-i flowchart_usage.mmd \
9-
-o flowchart_usage.png
6+
--backgroundColor transparent \
7+
--width 1600 \
8+
--input flowchart_usage.mmd \
9+
--output flowchart_usage.png

doc/gen/mermaid/flowchart_usage.mmd

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1+
---
2+
config:
3+
theme: "base"
4+
themeVariables:
5+
fontSize: "20px"
6+
fontFamily: "arial"
7+
edgeLabelBackground: "#ff8"
8+
lineColor: "#880"
9+
tertiaryColor: "#cfc"
10+
primaryBorderColor: "#888"
11+
---
112
flowchart TB
213

3-
%%{init: {
4-
'themeVariables': {
5-
'fontSize': '20px',
6-
'fontFamily': 'arial',
7-
'edgeLabelBackground': '#ff8'
8-
}
9-
}}%%
1014
classDef dec fill:#8f8,color:black
11-
classDef cftn fill:#8ff,color:black
12-
classDef sftn fill:#f8f,color:black
13-
classDef aftn fill:#f88,color:black
15+
classDef cftn fill:#8ff,color:black
16+
classDef sftn fill:#f8f,color:black
17+
classDef aftn fill:#f88,color:black
1418
classDef lang fill:#ff8,color:black
1519

1620
%% language nodes
-1.48 KB
Loading

0 commit comments

Comments
 (0)