Iguana 0.0.0
Implementation Guardian of Analysis Algorithms
Loading...
Searching...
No Matches
Validator.h
1#pragma once
2
3#include <mutex>
4#include <optional>
5
6#include <hipo4/bank.h>
7
8#include "iguana/algorithms/Algorithm.h"
9#include "iguana/algorithms/AlgorithmSequence.h"
10
11namespace iguana {
12
17 class Validator : public Algorithm
18 {
19
20 public:
21
23 Validator(std::string_view name = "validator")
24 : Algorithm(name)
25 , m_output_dir("")
26 {}
27 virtual ~Validator() {}
28
29 void Start(hipo::banklist& banks) override{};
30 void Run(hipo::banklist& banks) const override{};
31 void Stop() override{};
32
35 void SetOutputDirectory(std::string_view output_dir);
36
39 std::optional<std::string> GetOutputDirectory();
40
41 protected:
42
44 std::unique_ptr<AlgorithmSequence> m_algo_seq;
45
47 mutable std::mutex m_mutex;
48
49 private:
50
52 std::string m_output_dir;
53 };
54}
Base class for all algorithms to inherit from.
Definition Algorithm.h:40
Base class for all algorithm validators to inherit from.
Definition Validator.h:18
void Run(hipo::banklist &banks) const override
Run this algorithm for an event.
Definition Validator.h:30
void Stop() override
Finalize this algorithm after all events are processed.
Definition Validator.h:31
void SetOutputDirectory(std::string_view output_dir)
Validator(std::string_view name="validator")
Definition Validator.h:23
void Start(hipo::banklist &banks) override
Initialize this algorithm before any events are processed, with the intent to process banks
Definition Validator.h:29
std::mutex m_mutex
Mutex for locking procedures such as histogram filling in Validator::Run
Definition Validator.h:47
std::optional< std::string > GetOutputDirectory()
std::unique_ptr< AlgorithmSequence > m_algo_seq
An iguana::AlgorithmSequence to be used for this validator.
Definition Validator.h:44
General, top-level namespace for algorithms and infrastructure. For algorithms and bindings,...
Definition Algorithm.h:14