| 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 | /// @begin_doc_config{clas12/EventBuilderFilter} | ||
| 11 | /// @config_param{pids | list[int] | list of PDG codes to filter} | ||
| 12 | /// @end_doc | ||
| 13 | class EventBuilderFilter : public Algorithm | ||
| 14 | { | ||
| 15 | |||
| 16 |
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) |
| 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,out] particleBank particle bank (_e.g._, `REC::Particle`), which will be filtered | ||
| 26 | /// @returns `false` if all particles are filtered out | ||
| 27 | bool Run(hipo::bank& particleBank) const; | ||
| 28 | |||
| 29 | /// @action_function{scalar filter} checks if the PDG `pid` is a part of the list of user-specified PDGs | ||
| 30 | /// @param pid the particle PDG to check | ||
| 31 | /// @returns `true` if `pid` is one the user wants | ||
| 32 | bool Filter(int const pid) const; | ||
| 33 | |||
| 34 | /// @action_function{vector filter} checks if the PDG `pid` is a part of the list of user-specified PDGs | ||
| 35 | /// @overloads_scalar | ||
| 36 | /// @param pids the list of particle PDGs to check | ||
| 37 | /// @returns list of booleans which are `true` for `pids` the user wants | ||
| 38 | std::deque<bool> Filter(std::vector<int> const pids) const; | ||
| 39 | |||
| 40 | private: | ||
| 41 | |||
| 42 | /// `hipo::banklist` index for the particle bank | ||
| 43 | hipo::banklist::size_type b_particle; | ||
| 44 | |||
| 45 | // Configuration options | ||
| 46 | std::string o_particle_bank; | ||
| 47 | std::set<int> o_pids; | ||
| 48 | }; | ||
| 49 | |||
| 50 | } | ||
| 51 |