fire v0.19.0
Framework for sImulation and Reconstruction of Events
Process.h
1#ifndef FIRE_PROCESS_H
2#define FIRE_PROCESS_H
3
5#include "fire/StorageControl.h"
6#include "fire/Conditions.h"
7#include "fire/Event.h"
8#include "fire/Processor.h"
9#include "fire/RunHeader.h"
10
11namespace fire {
12
16class Process {
17 public:
56 Process(const config::Parameters& configuration);
57
63 ~Process();
64
97 void run();
98
103 const EventHeader& eventHeader() const {
104 return event_.header();
105 }
106
112 return event_.header();
113 }
114
121 const RunHeader& runHeader() const {
122 assert(run_header_);
123 return *run_header_;
124 }
125
133 assert(run_header_);
134 return *run_header_;
135 }
136
150 const std::string& purpose,
151 const std::string& processor
152 ) {
153 storage_control_.addHint(hint,purpose,processor);
154 }
155
165 return *conditions_;
166 }
167
168 private:
189 void newRun(RunHeader& rh);
190
211 bool process(const std::size_t& n_events_processed);
212
213 private:
216
219
222
224 int run_;
225
228
231
234
237
240
243
246
249}; // Process
250
251} // namespace fire
252
253#endif // FIRE_PROCESS_H
Container and cache for conditions and conditions providers.
Definition: Conditions.h:66
Header information of an event such as event number and timestamp.
Definition: EventHeader.h:27
Event class for interfacing with processors.
Definition: Event.h:28
const EventHeader & header() const
Get the event header.
Definition: Event.h:156
The central object managing the data processing.
Definition: Process.h:16
int event_limit_
limit on number of events to process
Definition: Process.h:215
int max_tries_
number of attempts to make before giving up on an event PRODUCTION MODE
Definition: Process.h:221
const RunHeader & runHeader() const
Get a const reference to the run header.
Definition: Process.h:121
Event event_
event object
Definition: Process.h:242
RunHeader * run_header_
the current run header
Definition: Process.h:245
StorageControl storage_control_
object used to determine if an event should be saved or not
Definition: Process.h:236
RunHeader & runHeader()
Get a non-const reference to the run header.
Definition: Process.h:132
EventHeader & eventHeader()
Get a non-constant reference to the event header.
Definition: Process.h:111
io::Writer output_file_
output file we are writing to
Definition: Process.h:230
ENABLE_LOGGING(Process)
log through the 'Process' channel
void addStorageControlHint(StorageControl::Hint hint, const std::string &purpose, const std::string &processor)
Add a storage control hint to the StorageControl system.
Definition: Process.h:148
void run()
Do the processing run.
Definition: Process.cxx:52
int log_frequency_
frequency with which event info is printed
Definition: Process.h:218
Conditions & conditions()
Get a reference to the current conditions system.
Definition: Process.h:164
int run_
run number to use PRODUCTION MODE
Definition: Process.h:224
std::vector< std::string > input_files_
input file listing, PRODUCTION MODE if empty
Definition: Process.h:227
bool process(const std::size_t &n_events_processed)
process the event
Definition: Process.cxx:197
Process(const config::Parameters &configuration)
Construct the process by configuring the necessary objects.
Definition: Process.cxx:10
std::vector< std::unique_ptr< Processor > > sequence_
the sequence of processors to run
Definition: Process.h:233
void newRun(RunHeader &rh)
Method to declare a new run is beginning.
Definition: Process.cxx:184
std::unique_ptr< Conditions > conditions_
handle to conditions system
Definition: Process.h:239
const EventHeader & eventHeader() const
Get a constant reference to the event header.
Definition: Process.h:103
~Process()
close logging before we are done
Definition: Process.cxx:50
Container for run parameters.
Definition: RunHeader.h:27
Isolation of voting system deciding if events should be kept.
Definition: StorageControl.h:21
Hint
Hints that can be provided by processors to the storage controller.
Definition: StorageControl.h:30
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
Class encapsulating parameters for configuring a processor.
Definition: Parameters.h:28
Write the fire DataSets into a deterministic structure in the output HDF5 data file.
Definition: Writer.h:19
Interface to Boost.Logging.