GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 5 / 0 / 5
Functions: 100.0% 3 / 0 / 3
Branches: 44.4% 8 / 0 / 18

src/iguana/algorithms/physics/SingleHadronKinematics/Algorithm.h
Line Branch Exec Source
1 #pragma once
2
3 #include "iguana/algorithms/Algorithm.h"
4 #include <Math/Vector3D.h>
5 #include <Math/Vector4D.h>
6
7 namespace iguana::physics {
8
9 /// @algo_brief{Calculate semi-inclusive hadron kinematic quantities}
10 /// @algo_type_creator
11 ///
12 /// @doc_config{physics/SingleHadronKinematics}
13 ///
14 /// The output bank `%physics::SingleHadronKinematics` will have the same number of rows as the input particle bank
15 /// - we want the output bank to have the same number of rows and ordering as the input
16 /// particle bank, so that banks which reference the input particle bank's rows (usually via `pindex`) can be used to
17 /// reference the output bank's rows too
18 /// - rows of the input particle bank which were filtered upstream will also be filtered out here, and all the values of the
19 /// corresponding row in the output bank will be zeroed, since no calculations are performed for
20 /// those particles
21 /// - particles which are not listed in the configuration parameter `hadron_list` will also be filtered out and zeroed
22 class SingleHadronKinematics : public Algorithm
23 {
24
25
8/18
None:
✓ Branch 3 → 4 taken 286 times.
✗ Branch 3 → 25 not taken.
✓ Branch 11 → 12 taken 2 times.
✗ Branch 11 → 35 not taken.
iguana::physics::SingleHadronKinematics::SingleHadronKinematics(std::basic_string_view<char, std::char_traits<char> >):
✓ Branch 2 → 3 taken 2 times.
✗ Branch 2 → 6 not taken.
✗ Branch 5 → 7 not taken.
✓ Branch 5 → 8 taken 2 times.
✓ Branch 9 → 10 taken 2 times.
✗ Branch 9 → 32 not taken.
✓ Branch 10 → 11 taken 2 times.
✗ Branch 10 → 17 not taken.
✓ Branch 17 → 18 taken 2 times.
✗ Branch 17 → 40 not taken.
✓ Branch 24 → 25 taken 2 times.
✗ Branch 24 → 40 not taken.
✗ Branch 32 → 33 not taken.
✗ Branch 32 → 39 not taken.
308 DEFINE_IGUANA_ALGORITHM(SingleHadronKinematics, physics::SingleHadronKinematics)
26
27 private: // hooks
28 void ConfigHook() override;
29 void StartHook(hipo::banklist& banks) override;
30 bool RunHook(hipo::banklist& banks) const override;
31
32 public:
33
34 /// @run_function
35 /// @param [in] particle_bank particle bank (_e.g._, `REC::Particle`)
36 /// @param [in] inc_kin_bank `%physics::InclusiveKinematics`, produced by the `physics::InclusiveKinematics` algorithm
37 /// @param [out] result_bank `%physics::SingleHadronKinematics`, which will be created
38 /// @returns `false` if the input banks do not have enough information, _e.g._, if the inclusive kinematics bank is empty,
39 /// or if the created bank is empty
40 bool Run(
41 hipo::bank const& particle_bank,
42 hipo::bank const& inc_kin_bank,
43 hipo::bank& result_bank) const;
44
45 private:
46
47 // banklist indices
48 hipo::banklist::size_type b_particle;
49 hipo::banklist::size_type b_inc_kin;
50 hipo::banklist::size_type b_result;
51
52 // `b_result` bank item indices
53 int i_pindex;
54 int i_pdg;
55 int i_z;
56 int i_PhPerp;
57 int i_MX2;
58 int i_xF;
59 int i_yB;
60 int i_phiH;
61 int i_xi;
62
63 // config options
64 std::string o_particle_bank;
65 std::set<int> o_hadron_pdgs;
66 };
67
68 }
69