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"
4#include "iguana/services/ConcurrentParam.h"
5
6namespace iguana::clas12 {
7
18 class ZVertexFilter : public Algorithm
19 {
20
22
23 public:
24
25 void Start(hipo::banklist& banks) override;
26 void Run(hipo::banklist& banks) const override;
27 void Stop() override;
28
33 concurrent_key_t PrepareEvent(int const runnum) const;
34
43 bool Filter(double const zvertex, int const pid, int const status, concurrent_key_t const key) const;
44
47 int GetRunNum(concurrent_key_t const key) const;
48
51 std::vector<double> GetElectronZcuts(concurrent_key_t const key) const;
52
59 void SetElectronZcuts(double zcut_lower, double zcut_upper, concurrent_key_t const key);
60
61 private:
62 hipo::banklist::size_type b_particle, b_config;
63
64 // Reload function
65 void Reload(int const runnum, concurrent_key_t key) const;
66
68 mutable std::unique_ptr<ConcurrentParam<int>> o_runnum;
69
71 mutable std::unique_ptr<ConcurrentParam<std::vector<double>>> o_electron_vz_cuts;
72
73 };
74
75}
#define DEFINE_IGUANA_ALGORITHM(ALGO_NAME, ALGO_FULL_NAME)
Base class for all algorithms to inherit from.
Definition Algorithm.h:40
Algorithm: Filter the REC::Particle (or similar) bank by cutting on Z Vertex
Definition Algorithm.h:19
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
std::vector< double > GetElectronZcuts(concurrent_key_t const key) 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
std::size_t concurrent_key_t
concurrent hash key type