fire v0.19.0
Framework for sImulation and Reconstruction of Events
StorageControl.h
1#ifndef FIRE_STORAGECONTROL_H_
2#define FIRE_STORAGECONTROL_H_
3
4#include <regex>
5#include <string>
6#include <vector>
7
8#include "fire/config/Parameters.h"
9
10namespace fire {
11
22 public:
30 enum class Hint {
31 NoOpinion = 0,
32 Undefined = -1,
33 ShouldKeep = 1,
34 MustKeep = 10,
35 ShouldDrop = 2,
36 MustDrop = 20
37 }; // enum Hint
38
39 public:
49
54 void resetEventState();
55
70 void addHint(Hint hint, const std::string& purpose,
71 const std::string& processor_name);
72
88 bool keepEvent() const;
89
90 private:
94 bool default_keep_{true};
95
108
109 private:
114};
115} // namespace fire
116
117#endif
Isolation of voting system deciding if events should be kept.
Definition: StorageControl.h:21
bool keepEvent() const
Determine if the current event should be kept, based on the defined rules.
Definition: StorageControl.cxx:51
std::vector< Hint > hints_
Collection of hints from the event processors.
Definition: StorageControl.h:113
std::vector< std::pair< std::regex, std::regex > > rules_
Collection of rules allowing certain processors or purposes to be considered ("listened to") during t...
Definition: StorageControl.h:107
Hint
Hints that can be provided by processors to the storage controller.
Definition: StorageControl.h:30
bool default_keep_
Default state for storage control.
Definition: StorageControl.h:94
void addHint(Hint hint, const std::string &purpose, const std::string &processor_name)
Add a storage hint for a given processor.
Definition: StorageControl.cxx:36
StorageControl(const config::Parameters &ps)
Configure the various options for how the storage contol behaves.
Definition: StorageControl.cxx:5
void resetEventState()
Reset the event-by-event state by removing any hints provided by processors during the previous event...
Definition: StorageControl.cxx:34
Class encapsulating parameters for configuring a processor.
Definition: Parameters.h:28