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 "models/RGA_inbending_pass1.cpp"
6#include "models/RGA_outbending_pass1.cpp"
7#include "models/RGA_inbending_pass2.cpp"
8#include "models/RGA_outbending_pass2.cpp"
9#include "models/RGC_Summer2022_pass1.cpp"
10
11#include <Math/Vector3D.h>
12#include <Math/VectorUtil.h>
13
14namespace iguana::clas12 {
15
31 {
32
34
35 public:
36
37 void Start(hipo::banklist& banks) override;
38 void Run(hipo::banklist& banks) const override;
39 void Stop() override;
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
104
108 double GetMass(int pid) const;
109
110
114 std::function<double(std::vector<float> const &)> getModelFunction(int runnum) const;
115
117 hipo::banklist::size_type b_particle;
118 hipo::banklist::size_type b_calorimeter;
119 hipo::banklist::size_type b_config; // RUN::config
120
122 double o_threshold = 0.78;
123
125 int o_pass = 1;
126
128 const std::map<std::tuple<int, int, int>, std::function<double(std::vector<float> const &)>> modelMap = {
129 {{5032, 5332, 1}, [](std::vector<float> const &data) { return ApplyCatboostModel_RGA_inbending_pass1(data); }}, // Fall2018 RGA Inbending
130 {{5032, 5332, 2}, [](std::vector<float> const &data) { return ApplyCatboostModel_RGA_inbending_pass2(data); }}, // Fall2018 RGA Inbending
131 {{5333, 5666, 1}, [](std::vector<float> const &data) { return ApplyCatboostModel_RGA_outbending_pass1(data); }}, // Fall2018 RGA Outbending
132 {{5333, 5666, 2}, [](std::vector<float> const &data) { return ApplyCatboostModel_RGA_outbending_pass2(data); }}, // Fall2018 RGA Outbending
133 {{6616, 6783, 1}, [](std::vector<float> const &data) { return ApplyCatboostModel_RGA_inbending_pass1(data); }}, // Spring2019 RGA Inbending
134 {{6616, 6783, 2}, [](std::vector<float> const &data) { return ApplyCatboostModel_RGA_inbending_pass2(data); }}, // Spring2019 RGA Inbending
135 {{6156, 6603, 1}, [](std::vector<float> const &data) { return ApplyCatboostModel_RGA_inbending_pass1(data); }}, // Spring2019 RGB Inbending
136 {{6156, 6603, 2}, [](std::vector<float> const &data) { return ApplyCatboostModel_RGA_inbending_pass2(data); }}, // Spring2019 RGB Inbending
137 {{11093, 11283, 1}, [](std::vector<float> const &data) { return ApplyCatboostModel_RGA_outbending_pass1(data); }}, // Fall2019 RGB Outbending
138 {{11093, 11283, 2}, [](std::vector<float> const &data) { return ApplyCatboostModel_RGA_outbending_pass2(data); }}, // Fall2019 RGB Outbending
139 {{11284, 11300, 1}, [](std::vector<float> const &data) { return ApplyCatboostModel_RGA_inbending_pass1(data); }}, // Fall2019 RGB BAND Inbending
140 {{11284, 11300, 2}, [](std::vector<float> const &data) { return ApplyCatboostModel_RGA_inbending_pass2(data); }}, // Fall2019 RGB BAND Inbending
141 {{11323, 11571, 1}, [](std::vector<float> const &data) { return ApplyCatboostModel_RGA_inbending_pass1(data); }}, // Spring2020 RGB Inbending
142 {{11323, 11571, 2}, [](std::vector<float> const &data) { return ApplyCatboostModel_RGA_inbending_pass2(data); }}, // Spring2020 RGB Inbending
143 {{16042, 16772, 1}, [](std::vector<float> const &data) { return ApplyCatboostModel_RGC_Summer2022_pass1(data); }}, // Summer2022 RGC Inbending
144 {{16042, 16772, 2}, [](std::vector<float> const &data) { return ApplyCatboostModel_RGC_Summer2022_pass1(data); }} // Summer2022 RGC Inbending (no pass2 currently)
145 };
146 };
147
148}
#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: Filter the REC::Particle photons using pretrained GBT models
Definition Algorithm.h:31
void Start(hipo::banklist &banks) override
Initialize this algorithm before any events are processed, with the intent to process banks
bool ForwardDetectorFilter(float const theta) const
void Stop() override
Finalize this algorithm after all events are processed.
void Run(hipo::banklist &banks) const override
Run this algorithm for an event.
CLAS12 algorithms.
Definition Algorithm.h:5