GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 4 / 0 / 4
Functions: 100.0% 3 / 0 / 3
Branches: 42.9% 6 / 0 / 14

src/iguana/algorithms/clas12/EventBuilderFilter/Algorithm.h
Line Branch Exec Source
1 #pragma once
2
3 #include "iguana/algorithms/Algorithm.h"
4
5 namespace iguana::clas12 {
6
7 /// @algo_brief{Filter the particle bank (`REC::Particle`, or similar) bank by PID from the Event Builder}
8 /// @algo_type_filter
9 ///
10 /// @doc_config{clas12/EventBuilderFilter}
11 class EventBuilderFilter : public Algorithm
12 {
13
14
6/14
✓ Branch 2 → 3 taken 8 times.
✗ Branch 2 → 6 not taken.
✗ Branch 5 → 7 not taken.
✓ Branch 5 → 8 taken 8 times.
✓ Branch 9 → 10 taken 8 times.
✗ Branch 9 → 32 not taken.
✓ Branch 10 → 11 taken 8 times.
✗ Branch 10 → 17 not taken.
✓ Branch 17 → 18 taken 8 times.
✗ Branch 17 → 40 not taken.
✓ Branch 24 → 25 taken 8 times.
✗ Branch 24 → 40 not taken.
✗ Branch 32 → 33 not taken.
✗ Branch 32 → 39 not taken.
74 DEFINE_IGUANA_ALGORITHM(EventBuilderFilter, clas12::EventBuilderFilter)
15
16 private: // hooks
17 void ConfigHook() override;
18 void StartHook(hipo::banklist& banks) override;
19 bool RunHook(hipo::banklist& banks) const override;
20
21 public:
22
23 /// @run_function
24 /// @param [in,out] particleBank particle bank (_e.g._, `REC::Particle`), which will be filtered
25 /// @returns `false` if all particles are filtered out
26 bool Run(hipo::bank& particleBank) const;
27
28 /// @action_function{scalar filter} checks if the PDG `pid` is a part of the list of user-specified PDGs
29 /// @param pid the particle PDG to check
30 /// @returns `true` if `pid` is one the user wants
31 bool Filter(int const pid) const;
32
33 /// @action_function{vector filter} checks if the PDG `pid` is a part of the list of user-specified PDGs
34 /// @overloads_scalar
35 /// @param pids the list of particle PDGs to check
36 /// @returns list of booleans which are `true` for `pids` the user wants
37 std::deque<bool> Filter(std::vector<int> const pids) const;
38
39 private:
40
41 /// `hipo::banklist` index for the particle bank
42 hipo::banklist::size_type b_particle;
43
44 // Configuration options
45 std::string o_particle_bank;
46 std::set<int> o_pids;
47 };
48
49 }
50