GCC Code Coverage Report


Directory: ./
File: src/iguana/algorithms/physics/Depolarization/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: 44.4% 8 0 18

Line Branch Exec Source
1 #pragma once
2
3 #include "iguana/algorithms/Algorithm.h"
4
5 namespace iguana::physics {
6
7 /// @algo_brief{Calculate depolarization factors}
8 /// @algo_type_creator
9 ///
10 /// @par References
11 /// - https://arxiv.org/pdf/hep-ph/0611265
12 /// - https://arxiv.org/pdf/1408.5721
13 class Depolarization : public Algorithm
14 {
15
16
8/18
iguana::physics::Depolarization::Depolarization(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.
None:
✓ Branch 3 → 4 taken 286 times.
✗ Branch 3 → 24 not taken.
✓ Branch 10 → 11 taken 2 times.
✗ Branch 10 → 30 not taken.
304 DEFINE_IGUANA_ALGORITHM(Depolarization, physics::Depolarization)
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] inc_kin_bank `%physics::InclusiveKinematics`, produced by the `physics::InclusiveKinematics` algorithm
26 /// @param [out] result_bank `%physics::Depolarization`, which will be created
27 /// @run_function_returns_true
28 bool Run(
29 hipo::bank const& inc_kin_bank,
30 hipo::bank& result_bank) const;
31
32 /// @action_function{scalar creator} compute depolarization factors
33 /// @param Q2 @latex{Q^2}, from `iguana::physics::InclusiveKinematics`
34 /// @param x Bjorken-@latex{x}, from `iguana::physics::InclusiveKinematics`
35 /// @param y @latex{y}, from `iguana::physics::InclusiveKinematics`
36 /// @param targetM the target mass (likely the proton mass)
37 /// @returns the depolarization factors in a `iguana::physics::DepolarizationVars` instance
38 DepolarizationVars Compute(double const Q2, double const x, double const y, double const targetM) const;
39
40 private:
41
42 // banklist indices
43 hipo::banklist::size_type b_inc_kin;
44 hipo::banklist::size_type b_result;
45
46 // `b_result` bank item indices
47 int i_epsilon;
48 int i_A;
49 int i_B;
50 int i_C;
51 int i_V;
52 int i_W;
53 };
54
55 }
56