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#include "iguana/services/ConcurrentParam.h"
5
6namespace iguana::clas12 {
7
14 class ZVertexFilter : public Algorithm
15 {
16
18
19 public:
20
21 void Start(hipo::banklist& banks) override;
22 bool Run(hipo::banklist& banks) const override;
23 void Stop() override;
24
29 bool Run(hipo::bank& particleBank, hipo::bank const& configBank) const;
30
35 concurrent_key_t PrepareEvent(int const runnum) const;
36
45 bool Filter(double const zvertex, int const pid, int const status, concurrent_key_t const key) const;
46
49 int GetRunNum(concurrent_key_t const key) const;
50
53 std::vector<double> GetElectronZcuts(concurrent_key_t const key) const;
54
61 void SetElectronZcuts(double zcut_lower, double zcut_upper, concurrent_key_t const key);
62
63 private:
64 hipo::banklist::size_type b_particle, b_config;
65
66 // Reload function
67 void Reload(int const runnum, concurrent_key_t key) const;
68
70 mutable std::unique_ptr<ConcurrentParam<int>> o_runnum;
71
73 mutable std::unique_ptr<ConcurrentParam<std::vector<double>>> o_electron_vz_cuts;
74 };
75
76}
#define DEFINE_IGUANA_ALGORITHM(ALGO_NAME, ALGO_FULL_NAME)
Algorithm(std::string_view name)
Definition Algorithm.h:46
Algorithm: Filter the REC::Particle (or similar) bank by cutting on Z Vertex
Definition Algorithm.h:15
bool Run(hipo::banklist &banks) const override
Run Function: Process an event's hipo::banklist
int GetRunNum(concurrent_key_t const key) const
void Start(hipo::banklist &banks) override
Initialize this algorithm before any events are processed, with the intent to process banks.
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
void Stop() override
Finalize this algorithm after all events are processed.
General CLAS12 algorithms.
Definition Algorithm.h:5