GCC Code Coverage Report


Directory: ./
File: src/iguana/algorithms/clas12/MCProximityMatch/Algorithm.h
Date: 2025-11-25 17:57:04
Coverage Exec Excl Total
Lines: 75.0% 3 0 4
Functions: 100.0% 3 0 3
Branches: 42.9% 6 0 14

Line Branch Exec Source
1 #pragma once
2
3 #include "iguana/algorithms/Algorithm.h"
4
5 namespace iguana::clas12 {
6
7 /// @algo_brief{Simple MC truth matching by proximity}
8 /// @algo_type_creator
9 ///
10 /// This algorithm matches reconstructed and generated particles by proximity, and is only meant for _older_ MC
11 /// files which _lack_ truth-matching banks (`MC::GenMatch` and `MC::RecMatch`). You should prefer the truth-matching
12 /// banks instead, if they are available.
13 class MCProximityMatch : public Algorithm
14 {
15
16
6/14
✓ Branch 2 → 3 taken 1 time.
✗ Branch 2 → 6 not taken.
✗ Branch 5 → 7 not taken.
✓ Branch 5 → 8 taken 1 time.
✓ Branch 9 → 10 taken 1 time.
✗ Branch 9 → 32 not taken.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 10 → 17 not taken.
✓ Branch 17 → 18 taken 1 time.
✗ Branch 17 → 40 not taken.
✓ Branch 24 → 25 taken 1 time.
✗ Branch 24 → 40 not taken.
✗ Branch 32 → 33 not taken.
✗ Branch 32 → 39 not taken.
8 DEFINE_IGUANA_ALGORITHM(MCProximityMatch, clas12::MCProximityMatch)
17
18 public:
19
20 void Start(hipo::banklist& banks) override;
21 bool Run(hipo::banklist& banks) const override;
22 void Stop() override;
23
24 /// @run_function
25 /// @param [in] rec_particle_bank `REC::Particle` bank, the reconstructed particles
26 /// @param [in] mc_particle_bank `MC::Particle` bank, the generated particles
27 /// @param [out] result_bank `MC::RecMatch::Proximity`, which will be created
28 /// @returns `true` if the created bank is not empty
29 bool Run(
30 hipo::bank const& rec_particle_bank,
31 hipo::bank const& mc_particle_bank,
32 hipo::bank& result_bank) const;
33
34 private:
35
36 // banklist indices
37 hipo::banklist::size_type b_rec_particle_bank;
38 hipo::banklist::size_type b_mc_particle_bank;
39 hipo::banklist::size_type b_result;
40
41 // `b_result` bank item indices
42 int i_pindex;
43 int i_mcindex;
44 int i_proximity;
45 };
46
47 }
48