Iguana LATEST
Implementation Guardian of Analysis Algorithms
Loading...
Searching...
No Matches
Algorithm.h
1#pragma once
2
3#include "iguana/algorithms/Algorithm.h"
5#include "iguana/services/ConcurrentParam.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 void Reload(int const runnum, double const user_beam_energy, concurrent_key_t key) const;
68
69 // banklist indices
70 hipo::banklist::size_type b_particle;
71 hipo::banklist::size_type b_config;
72 hipo::banklist::size_type b_result;
73
74 // `b_result` bank item indices
75 int i_pindex;
76 int i_Q2;
77 int i_x;
78 int i_y;
79 int i_W;
80 int i_nu;
81 int i_qx;
82 int i_qy;
83 int i_qz;
84 int i_qE;
85 int i_beamPz;
86 int i_targetM;
87
88 // config options
89 std::string o_particle_bank;
90 mutable std::unique_ptr<ConcurrentParam<int>> o_runnum;
91 mutable std::unique_ptr<ConcurrentParam<std::vector<double>>> o_target_PxPyPzM;
92 mutable std::unique_ptr<ConcurrentParam<std::vector<double>>> o_beam_PxPyPzM;
93 double o_beam_mass; // unlikely to change
94 int o_beam_pdg; // unlikely to change
95 double o_override_beam_energy;
96 double o_theta_between_FD_and_FT;
97
98 enum method_reconstruction {
99 scattered_lepton
100 };
101 enum method_lepton_finder {
102 highest_energy_FD_trigger,
103 lund_beam_daughter,
104 };
105 method_reconstruction o_method_reconstruction;
106 method_lepton_finder o_method_lepton_finder;
107 };
108
109}
#define DEFINE_IGUANA_ALGORITHM(ALGO_NAME, ALGO_FULL_NAME)
common objects used in algorithms
double vector_element_t
Vector element type.
Definition TypeDefs.h:12
Algorithm(std::string_view name)
Definition Algorithm.h:73
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