Line | Branch | Exec | Source |
---|---|---|---|
1 | #pragma once | ||
2 | |||
3 | #include "iguana/algorithms/Algorithm.h" | ||
4 | #include "iguana/algorithms/TypeDefs.h" | ||
5 | |||
6 | namespace iguana::clas12 { | ||
7 | |||
8 | /// @brief_algo Momentum Corrections | ||
9 | /// | ||
10 | /// Adapted from <https://clasweb.jlab.org/wiki/index.php/CLAS12_Momentum_Corrections#tab=Correction_Code> | ||
11 | /// | ||
12 | /// @begin_doc_algo{clas12::MomentumCorrection | Transformer} | ||
13 | /// @input_banks{RUN::config, REC::Particle, REC::Particle::Sector} | ||
14 | /// @output_banks{REC::Particle} | ||
15 | /// @end_doc | ||
16 | class MomentumCorrection : public Algorithm | ||
17 | { | ||
18 | |||
19 |
5/12✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 4 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 4 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
|
27 | DEFINE_IGUANA_ALGORITHM(MomentumCorrection, clas12::MomentumCorrection) |
20 | |||
21 | public: | ||
22 | |||
23 | void Start(hipo::banklist& banks) override; | ||
24 | void Run(hipo::banklist& banks) const override; | ||
25 | void Stop() override; | ||
26 | |||
27 | /// @action_function{scalar transformer} Apply the momentum correction | ||
28 | /// @param px @f$p_x@f$ | ||
29 | /// @param py @f$p_y@f$ | ||
30 | /// @param pz @f$p_z@f$ | ||
31 | /// @param sec the sector | ||
32 | /// @param pid the particle PDG | ||
33 | /// @param torus torus setting | ||
34 | /// @returns the transformed momentum | ||
35 | Momentum3 Transform(vector_element_t const px, vector_element_t const py, vector_element_t const pz, int const sec, int const pid, float const torus) const; | ||
36 | |||
37 | /// @action_function{scalar creator} Calculate the correction factor for inbending data | ||
38 | /// @param px @f$p_x@f$ | ||
39 | /// @param py @f$p_y@f$ | ||
40 | /// @param pz @f$p_z@f$ | ||
41 | /// @param sec the sector | ||
42 | /// @param pid the particle PDG | ||
43 | /// @returns the correction factor | ||
44 | double CorrectionInbending(vector_element_t const px, vector_element_t const py, vector_element_t const pz, int const sec, int const pid) const; | ||
45 | |||
46 | /// @action_function{scalar creator} Calculate the correction factor for outbending data | ||
47 | /// @param px @f$p_x@f$ | ||
48 | /// @param py @f$p_y@f$ | ||
49 | /// @param pz @f$p_z@f$ | ||
50 | /// @param sec the sector | ||
51 | /// @param pid the particle PDG | ||
52 | /// @returns the correction factor | ||
53 | double CorrectionOutbending(vector_element_t const px, vector_element_t const py, vector_element_t const pz, int const sec, int const pid) const; | ||
54 | |||
55 | /// @action_function{scalar creator} Energy loss correction for inbending data | ||
56 | /// @param px @f$p_x@f$ | ||
57 | /// @param py @f$p_y@f$ | ||
58 | /// @param pz @f$p_z@f$ | ||
59 | /// @param pid the particle PDG | ||
60 | /// @returns the correction factor | ||
61 | double EnergyLossInbending(vector_element_t const px, vector_element_t const py, vector_element_t const pz, int const pid) const; | ||
62 | |||
63 | /// @action_function{scalar creator} Energy loss correction for outbending data | ||
64 | /// @param px @f$p_x@f$ | ||
65 | /// @param py @f$p_y@f$ | ||
66 | /// @param pz @f$p_z@f$ | ||
67 | /// @param pid the particle PDG | ||
68 | /// @returns the correction factor | ||
69 | double EnergyLossOutbending(vector_element_t const px, vector_element_t const py, vector_element_t const pz, int const pid) const; | ||
70 | |||
71 | private: | ||
72 | |||
73 | /// `hipo::banklist` indices | ||
74 | hipo::banklist::size_type b_particle; | ||
75 | hipo::banklist::size_type b_sector; | ||
76 | hipo::banklist::size_type b_config; | ||
77 | }; | ||
78 | |||
79 | } | ||
80 |