Iguana 0.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
37
54 {
55
57
58 public:
59
60 void Start(hipo::banklist& banks) override;
61 void Run(hipo::banklist& banks) const override;
62 void Stop() override;
63
69 concurrent_key_t PrepareEvent(int const runnum, double const beam_energy = -1) const;
70
78 vector_element_t const lepton_px,
79 vector_element_t const lepton_py,
80 vector_element_t const lepton_pz,
81 concurrent_key_t const key) const;
82
83 private:
84
93 int FindScatteredLepton(hipo::bank const& particle_bank, concurrent_key_t const key) const;
94
95 void Reload(int const runnum, double const user_beam_energy, concurrent_key_t key) const;
96
97 // banklist indices
98 hipo::banklist::size_type b_particle;
99 hipo::banklist::size_type b_config;
100 hipo::banklist::size_type b_result;
101
102 // `b_result` bank item indices
103 int i_pindex;
104 int i_Q2;
105 int i_x;
106 int i_y;
107 int i_W;
108 int i_nu;
109 int i_qx;
110 int i_qy;
111 int i_qz;
112 int i_qE;
113 int i_beamPz;
114 int i_targetM;
115
116 // config options
117 mutable std::unique_ptr<ConcurrentParam<int>> o_runnum;
118 mutable std::unique_ptr<ConcurrentParam<std::vector<double>>> o_target_PxPyPzM;
119 mutable std::unique_ptr<ConcurrentParam<std::vector<double>>> o_beam_PxPyPzM;
120 double o_beam_mass; // unlikely to change
121 int o_beam_pdg; // unlikely to change
122
123 enum method_reconstruction { scattered_lepton };
124 enum method_lepton_finder { highest_energy_FD_trigger };
125 method_reconstruction o_method_reconstruction;
126 method_lepton_finder o_method_lepton_finder;
127
128 std::unique_ptr<RCDBReader> m_rcdb;
129 };
130
131}
#define DEFINE_IGUANA_ALGORITHM(ALGO_NAME, ALGO_FULL_NAME)
Type definitions for common objects used in algorithms.
Base class for all algorithms to inherit from.
Definition Algorithm.h:40
Algorithm: Calculate inclusive kinematics quantities defined in iguana::physics::InclusiveKinematicsV...
Definition Algorithm.h:54
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
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
void Run(hipo::banklist &banks) const override
Run this algorithm for an event.
Physics algorithms.
Definition Algorithm.h:8
std::size_t concurrent_key_t
concurrent hash key type
double vector_element_t
Vector element type.
Definition TypeDefs.h:11
Set of inclusive kinematics variables.
Definition Algorithm.h:11
vector_element_t qy
-component of virtual photon momentum
Definition Algorithm.h:17
double targetM
target mass (GeV)
Definition Algorithm.h:35
vector_element_t qE
-component of virtual photon momentum
Definition Algorithm.h:21
vector_element_t qx
-component of virtual photon momentum
Definition Algorithm.h:15
vector_element_t qz
-component of virtual photon momentum
Definition Algorithm.h:19
int pindex
REC::Particle row (pindex) of the scattered electron
Definition Algorithm.h:13
double beamPz
beam momentum -component (GeV)
Definition Algorithm.h:33