GCC Code Coverage Report


Directory: ./
File: src/iguana/algorithms/clas12/TrajLinker/Algorithm.h
Date: 2025-11-25 17:57:04
Coverage Exec Excl Total
Lines: 80.0% 4 0 5
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{Link particle bank to bank `REC::Traj`}
8 /// @algo_type_creator
9 ///
10 /// This algorithm reads `REC::Traj` and produces a new bank, `REC::Particle::Traj`,
11 /// to make it easier to access commonly used `REC::Traj` information for each particle.
12 ///
13 /// If this algorithm does not provide information you need, ask the maintainers or open a pull request.
14 class TrajLinker : public Algorithm
15 {
16
17
6/14
✓ Branch 2 → 3 taken 3 times.
✗ Branch 2 → 6 not taken.
✗ Branch 5 → 7 not taken.
✓ Branch 5 → 8 taken 3 times.
✓ Branch 9 → 10 taken 3 times.
✗ Branch 9 → 32 not taken.
✓ Branch 10 → 11 taken 3 times.
✗ Branch 10 → 17 not taken.
✓ Branch 17 → 18 taken 3 times.
✗ Branch 17 → 40 not taken.
✓ Branch 24 → 25 taken 3 times.
✗ Branch 24 → 40 not taken.
✗ Branch 32 → 33 not taken.
✗ Branch 32 → 39 not taken.
23 DEFINE_IGUANA_ALGORITHM(TrajLinker, clas12::TrajLinker)
18
19 public:
20
21 void Start(hipo::banklist& banks) override;
22 bool Run(hipo::banklist& banks) const override;
23 void Stop() override;
24
25 /// @run_function
26 /// @param [in] bank_particle `REC::Particle`
27 /// @param [in] bank_traj `REC::Traj`
28 /// @param [out] bank_result `REC::Particle::Traj`, which will be created
29 /// @run_function_returns_true
30 bool Run(
31 hipo::bank const& bank_particle,
32 hipo::bank const& bank_traj,
33 hipo::bank& bank_result) const;
34
35 /// @returns the DC sector given (x,y,z), or `-1` if failed
36 /// @param x x-position
37 /// @param y y-position
38 /// @param z z-position
39 int GetSector(float const& x, float const& y, float const& z) const;
40
41 private:
42
43 /// `hipo::banklist` indices
44 hipo::banklist::size_type b_particle;
45 hipo::banklist::size_type b_traj;
46 hipo::banklist::size_type b_result;
47
48 // `b_result` bank item indices
49 int i_pindex;
50 int i_sector;
51 int i_r1_found;
52 int i_r1_x;
53 int i_r1_y;
54 int i_r1_z;
55 int i_r2_found;
56 int i_r2_x;
57 int i_r2_y;
58 int i_r2_z;
59 int i_r3_found;
60 int i_r3_x;
61 int i_r3_y;
62 int i_r3_z;
63 };
64
65 }
66