Loading [MathJax]/extensions/tex2jax.js
Iguana 0.8.0
Implementation Guardian of Analysis Algorithms
All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Modules Pages
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
11#ifdef IGUANA_ROOT_FOUND
12#include <TStyle.h>
13#endif
14
15namespace iguana {
16
21 class Validator : public Algorithm
22 {
23
24 public:
25
27 Validator(std::string_view name = "validator")
28 : Algorithm(name)
29 , m_output_dir("")
30 {
31#ifdef IGUANA_ROOT_FOUND
32 // set styles for all validators' ROOT plots
33 gStyle->SetOptStat(0);
34 gStyle->SetPalette(55);
35#endif
36 }
37 virtual ~Validator() {}
38
39 void Start(hipo::banklist& banks) override{};
40 void Run(hipo::banklist& banks) const override{};
41 void Stop() override{};
42
45 void SetOutputDirectory(std::string_view output_dir);
46
49 std::optional<std::string> GetOutputDirectory();
50
51 protected:
52
54 std::unique_ptr<AlgorithmSequence> m_algo_seq;
55
57 mutable std::mutex m_mutex;
58
59 private:
60
62 std::string m_output_dir;
63 };
64}
Algorithm(std::string_view name)
Definition Algorithm.h:46
Base class for all algorithm validators to inherit from.
Definition Validator.h:22
void Run(hipo::banklist &banks) const override
Run this algorithm for an event.
Definition Validator.h:40
void Stop() override
Finalize this algorithm after all events are processed.
Definition Validator.h:41
void SetOutputDirectory(std::string_view output_dir)
Validator(std::string_view name="validator")
Definition Validator.h:27
void Start(hipo::banklist &banks) override
Initialize this algorithm before any events are processed, with the intent to process banks
Definition Validator.h:39
std::mutex m_mutex
Mutex for locking procedures such as histogram filling in Validator::Run
Definition Validator.h:57
std::optional< std::string > GetOutputDirectory()
std::unique_ptr< AlgorithmSequence > m_algo_seq
An iguana::AlgorithmSequence to be used for this validator.
Definition Validator.h:54
General, top-level namespace for algorithms and infrastructure. For algorithms and bindings,...
Definition Algorithm.h:14