Iguana LATEST
Implementation Guardian of Analysis Algorithms
Loading...
Searching...
No Matches
Algorithm.h
1#pragma once
2
3#include "iguana/algorithms/Algorithm.h"
4#include "iguana/services/ConcurrentParam.h"
5
6namespace iguana::clas12 {
7
12 class ZVertexFilter : public Algorithm
13 {
14
16
17 private: // hooks
18 void ConfigHook() override;
19 void StartHook(hipo::banklist& banks) override;
20 bool RunHook(hipo::banklist& banks) const override;
21
22 public:
23
28 bool Run(hipo::bank& particleBank, hipo::bank const& configBank) const;
29
34 concurrent_key_t PrepareEvent(int const runnum) const;
35
44 bool Filter(double const zvertex, int const pid, int const status, concurrent_key_t const key) const;
45
48 int GetRunNum(concurrent_key_t const key) const;
49
52 std::vector<double> GetElectronZcuts(concurrent_key_t const key) const;
53
60 void SetElectronZcuts(double zcut_lower, double zcut_upper, concurrent_key_t const key);
61
62 private:
63 hipo::banklist::size_type b_particle, b_config;
64
65 // Reload function
66 void Reload(int const runnum, concurrent_key_t key) const;
67
69 std::string o_particle_bank;
70
72 mutable std::unique_ptr<ConcurrentParam<int>> o_runnum;
73
75 mutable std::unique_ptr<ConcurrentParam<std::vector<double>>> o_electron_vz_cuts;
76 };
77
78}
#define DEFINE_IGUANA_ALGORITHM(ALGO_NAME, ALGO_FULL_NAME)
Algorithm(std::string_view name)
Definition Algorithm.h:73
Algorithm: Filter a particle bank by cutting on Z Vertex
Definition Algorithm.h:13
int GetRunNum(concurrent_key_t const key) const
bool Filter(double const zvertex, int const pid, int const status, concurrent_key_t const key) const
Action Function: checks if the Z Vertex is within specified bounds if pid is one for which the filter...
concurrent_key_t PrepareEvent(int const runnum) const
Action Function: prepare the event
void SetElectronZcuts(double zcut_lower, double zcut_upper, concurrent_key_t const key)
sets the z-vertex cuts
bool Run(hipo::bank &particleBank, hipo::bank const &configBank) const
Run Function: Process an event's hipo::bank objects
std::vector< double > GetElectronZcuts(concurrent_key_t const key) const
General CLAS12 algorithms.
Definition Algorithm.h:5