Iguana LATEST
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
18 {
19
21
22 private: // hooks
23 void ConfigHook() override;
24 void StartHook(hipo::banklist& banks) override;
25 bool RunHook(hipo::banklist& banks) const override;
26
27 public:
28
34 bool Run(
35 hipo::bank& particleBank,
36 hipo::bank const& caloBank,
37 hipo::bank const& configBank) const;
38
42 bool ForwardDetectorFilter(float const theta) const;
43
44 private:
45
46 struct calo_row_data {
47 double pcal_x = 0;
48 double pcal_y = 0;
49 double pcal_z = 0;
50 double ecin_x = 0;
51 double ecin_y = 0;
52 double ecin_z = 0;
53 double ecout_x = 0;
54 double ecout_y = 0;
55 double ecout_z = 0;
56 double pcal_e = 0;
57 double pcal_m2u = 0;
58 double pcal_m2v = 0;
59 double ecin_e = 0;
60 double ecin_m2u = 0;
61 double ecin_m2v = 0;
62 double ecout_e = 0;
63 double ecout_m2u = 0;
64 double ecout_m2v = 0;
65 };
66
72 bool PidPurityPhotonFilter(float const E, float const Epcal, float const theta) const;
73
81 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;
82
83
88 bool ClassifyPhoton(std::vector<float> const& input_data, int const runnum) const;
89
90
94 std::map<int, PhotonGBTFilter::calo_row_data> GetCaloMap(hipo::bank const& bank) const;
95
96
100 ROOT::Math::XYZVector GetParticleCaloVector(PhotonGBTFilter::calo_row_data calo_row) const;
101
105 std::function<double(std::vector<float> const&)> getModelFunction(int runnum) const;
106
108 hipo::banklist::size_type b_particle;
109 hipo::banklist::size_type b_calorimeter;
110 hipo::banklist::size_type b_config; // RUN::config
111
113 double o_threshold = 0.78;
114
116 int o_pass = 1;
117
119 static std::map<std::tuple<int, int, int>, std::function<double(std::vector<float> const&)>> const modelMap;
120 };
121
122}
#define DEFINE_IGUANA_ALGORITHM(ALGO_NAME, ALGO_FULL_NAME)
Algorithm(std::string_view name)
Definition Algorithm.h:73
Algorithm: Filter the REC::Particle photons using pretrained GBT models
Definition Algorithm.h:18
bool Run(hipo::bank &particleBank, hipo::bank const &caloBank, hipo::bank const &configBank) const
Run Function: Process an event's hipo::bank objects
bool ForwardDetectorFilter(float const theta) const
General CLAS12 algorithms.
Definition Algorithm.h:5