Iguana 1.2.0
Implementation Guardian of Analysis Algorithms
Loading...
Searching...
No Matches
Algorithm.h
1#pragma once
2
3#include "iguana/algorithms/Algorithm.h"
6
7namespace iguana::physics {
8
14 {
15
17
18 private: // hooks
19 void ConfigHook() override;
20 void StartHook(hipo::banklist& banks) override;
21 bool RunHook(hipo::banklist& banks) const override;
22
23 public:
24
31 bool Run(
32 hipo::bank const& particle_bank,
33 hipo::bank const& config_bank,
34 hipo::bank& result_bank) const;
35
41 concurrent_key_t PrepareEvent(int const runnum, double const beam_energy = -1) const;
42
50 vector_element_t const lepton_px,
51 vector_element_t const lepton_py,
52 vector_element_t const lepton_pz,
53 concurrent_key_t const key) const;
54
55 private:
56
65 std::optional<int> const FindScatteredLepton(hipo::bank const& particle_bank, concurrent_key_t const key) const;
66
67 // banklist indices
68 hipo::banklist::size_type b_particle;
69 hipo::banklist::size_type b_config;
70 hipo::banklist::size_type b_result;
71
72 // `b_result` bank item indices
73 int i_pindex;
74 int i_Q2;
75 int i_x;
76 int i_y;
77 int i_W;
78 int i_nu;
79 int i_qx;
80 int i_qy;
81 int i_qz;
82 int i_qE;
83 int i_beamPz;
84 int i_targetM;
85
86 // config options
87 std::string o_particle_bank;
88 mutable std::unique_ptr<ConcurrentParam<int>> o_runnum;
89 mutable std::unique_ptr<ConcurrentParam<std::vector<double>>> o_target_PxPyPzM;
90 mutable std::unique_ptr<ConcurrentParam<std::vector<double>>> o_beam_PxPyPzM;
91 double o_beam_mass; // unlikely to change
92 int o_beam_pdg; // unlikely to change
93 double o_override_beam_energy;
94 double o_theta_between_FD_and_FT;
95
96 // keysmith
97 std::unique_ptr<Keysmith<int>> m_keysmith;
98
99 enum method_reconstruction {
100 scattered_lepton
101 };
102 enum method_lepton_finder {
103 highest_energy_FD_trigger,
104 lund_beam_daughter,
105 };
106 method_reconstruction o_method_reconstruction;
107 method_lepton_finder o_method_lepton_finder;
108 };
109
110}
#define DEFINE_IGUANA_ALGORITHM(ALGO_NAME, ALGO_FULL_NAME)
std::size_t concurrent_key_t
concurrent key type for ConcurrentParam objects
common objects used in algorithms
double vector_element_t
Vector element type.
Definition TypeDefs.h:12
Algorithm(std::string_view name)
Definition Algorithm.h:74
Algorithm: Calculate inclusive kinematics quantities
Definition Algorithm.h:14
InclusiveKinematicsVars ComputeFromLepton(vector_element_t const lepton_px, vector_element_t const lepton_py, vector_element_t const lepton_pz, concurrent_key_t const key) const
Action Function: compute kinematics from the scattered lepton.
concurrent_key_t PrepareEvent(int const runnum, double const beam_energy=-1) const
Action Function: prepare the event
bool Run(hipo::bank const &particle_bank, hipo::bank const &config_bank, hipo::bank &result_bank) const
Run Function: Process an event's hipo::bank objects
Physics algorithms.
Definition Algorithm.h:5
Set of variables created by creator algorithm iguana::physics::InclusiveKinematics.
Definition BankDefs.h:44