GCC Code Coverage Report


Directory: ./
File: src/iguana/algorithms/clas12/EventBuilderFilter/Algorithm.h
Date: 2025-01-05 09:03:17
Exec Total Coverage
Lines: 1 1 100.0%
Functions: 3 4 75.0%
Branches: 5 12 41.7%

Line Branch Exec Source
1 #pragma once
2
3 #include "iguana/algorithms/Algorithm.h"
4
5 namespace iguana::clas12 {
6
7 /// @brief_algo Filter the `REC::Particle` (or similar) bank by PID from the Event Builder
8 ///
9 /// @begin_doc_algo{clas12::EventBuilderFilter | Filter}
10 /// @input_banks{REC::Particle}
11 /// @output_banks{REC::Particle}
12 /// @end_doc
13 ///
14 /// @begin_doc_config
15 /// @config_param{pids | list[int] | list of PDG codes to filter}
16 /// @end_doc
17 class EventBuilderFilter : public Algorithm
18 {
19
20
5/12
✓ Branch 0 taken 8 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 8 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 8 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
54 DEFINE_IGUANA_ALGORITHM(EventBuilderFilter, clas12::EventBuilderFilter)
21
22 public:
23
24 void Start(hipo::banklist& banks) override;
25 void Run(hipo::banklist& banks) const override;
26 void Stop() override;
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 /// @param pids the list of particle PDGs to check
35 /// @returns list of booleans which are `true` for `pids` the user wants
36 std::deque<bool> Filter(std::vector<int> const pids) const;
37
38 private:
39
40 /// `hipo::banklist` index for the particle bank
41 hipo::banklist::size_type b_particle;
42
43 /// Configuration options
44 std::set<int> o_pids;
45 };
46
47 }
48