Iguana 1.0.0
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#include "iguana/services/RCDBReader.h"
7
8namespace iguana::physics {
9
20 {
21
23
24 public:
25
26 void Start(hipo::banklist& banks) override;
27 bool Run(hipo::banklist& banks) const override;
28 void Stop() override;
29
36 bool Run(
37 hipo::bank const& particle_bank,
38 hipo::bank const& config_bank,
39 hipo::bank& result_bank) const;
40
46 concurrent_key_t PrepareEvent(int const runnum, double const beam_energy = -1) const;
47
55 vector_element_t const lepton_px,
56 vector_element_t const lepton_py,
57 vector_element_t const lepton_pz,
58 concurrent_key_t const key) const;
59
60 private:
61
70 int FindScatteredLepton(hipo::bank const& particle_bank, concurrent_key_t const key) const;
71
72 void Reload(int const runnum, double const user_beam_energy, concurrent_key_t key) const;
73
74 // banklist indices
75 hipo::banklist::size_type b_particle;
76 hipo::banklist::size_type b_config;
77 hipo::banklist::size_type b_result;
78
79 // `b_result` bank item indices
80 int i_pindex;
81 int i_Q2;
82 int i_x;
83 int i_y;
84 int i_W;
85 int i_nu;
86 int i_qx;
87 int i_qy;
88 int i_qz;
89 int i_qE;
90 int i_beamPz;
91 int i_targetM;
92
93 // config options
94 mutable std::unique_ptr<ConcurrentParam<int>> o_runnum;
95 mutable std::unique_ptr<ConcurrentParam<std::vector<double>>> o_target_PxPyPzM;
96 mutable std::unique_ptr<ConcurrentParam<std::vector<double>>> o_beam_PxPyPzM;
97 double o_beam_mass; // unlikely to change
98 int o_beam_pdg; // unlikely to change
99
100 enum method_reconstruction { scattered_lepton };
101 enum method_lepton_finder { highest_energy_FD_trigger };
102 method_reconstruction o_method_reconstruction;
103 method_lepton_finder o_method_lepton_finder;
104
105 std::unique_ptr<RCDBReader> m_rcdb;
106 };
107
108}
#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:46
Algorithm: Calculate inclusive kinematics quantities
Definition Algorithm.h:20
void Stop() override
Finalize this algorithm after all events are processed.
void Start(hipo::banklist &banks) override
Initialize this algorithm before any events are processed, with the intent to process banks.
bool Run(hipo::banklist &banks) const override
Run Function: Process an event's hipo::banklist
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