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"
4
5#include <Math/Vector3D.h>
6#include <Math/VectorUtil.h>
7
8namespace iguana::clas12 {
9
21 {
22
24
25 public:
26
27 void Start(hipo::banklist& banks) override;
28 bool Run(hipo::banklist& banks) const override;
29 void Stop() override;
30
36 bool Run(
37 hipo::bank& particleBank,
38 hipo::bank const& caloBank,
39 hipo::bank const& configBank) const;
40
44 bool ForwardDetectorFilter(float const theta) const;
45
46 private:
47
48 struct calo_row_data {
49 double pcal_x = 0;
50 double pcal_y = 0;
51 double pcal_z = 0;
52 double ecin_x = 0;
53 double ecin_y = 0;
54 double ecin_z = 0;
55 double ecout_x = 0;
56 double ecout_y = 0;
57 double ecout_z = 0;
58 double pcal_e = 0;
59 double pcal_m2u = 0;
60 double pcal_m2v = 0;
61 double ecin_e = 0;
62 double ecin_m2u = 0;
63 double ecin_m2v = 0;
64 double ecout_e = 0;
65 double ecout_m2u = 0;
66 double ecout_m2v = 0;
67 };
68
74 bool PidPurityPhotonFilter(float const E, float const Epcal, float const theta) const;
75
83 bool Filter(hipo::bank const& particleBank, hipo::bank const& caloBank, std::map<int, PhotonGBTFilter::calo_row_data> calo_map, int const row, int const runnum) const;
84
85
90 bool ClassifyPhoton(std::vector<float> const& input_data, int const runnum) const;
91
92
96 std::map<int, PhotonGBTFilter::calo_row_data> GetCaloMap(hipo::bank const& bank) const;
97
98
102 ROOT::Math::XYZVector GetParticleCaloVector(PhotonGBTFilter::calo_row_data calo_row) const;
103
107 std::function<double(std::vector<float> const&)> getModelFunction(int runnum) const;
108
110 hipo::banklist::size_type b_particle;
111 hipo::banklist::size_type b_calorimeter;
112 hipo::banklist::size_type b_config; // RUN::config
113
115 double o_threshold = 0.78;
116
118 int o_pass = 1;
119
121 static std::map<std::tuple<int, int, int>, std::function<double(std::vector<float> const&)>> const modelMap;
122 };
123
124}
#define DEFINE_IGUANA_ALGORITHM(ALGO_NAME, ALGO_FULL_NAME)
Algorithm(std::string_view name)
Definition Algorithm.h:46
Algorithm: Filter the REC::Particle photons using pretrained GBT models
Definition Algorithm.h:21
void Start(hipo::banklist &banks) override
Initialize this algorithm before any events are processed, with the intent to process banks.
bool Run(hipo::bank &particleBank, hipo::bank const &caloBank, hipo::bank const &configBank) const
Run Function: Process an event's hipo::bank objects
bool Run(hipo::banklist &banks) const override
Run Function: Process an event's hipo::banklist
bool ForwardDetectorFilter(float const theta) const
void Stop() override
Finalize this algorithm after all events are processed.
General CLAS12 algorithms.
Definition Algorithm.h:5