EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
|
#include <acts/blob/sPHENIX/Examples/Framework/include/ActsExamples/Framework/Sequencer.hpp>
Classes | |
struct | Config |
Public Member Functions | |
Sequencer (const Config &cfg) | |
void | addService (std::shared_ptr< IService > service) |
void | addContextDecorator (std::shared_ptr< IContextDecorator > decorator) |
void | addReader (std::shared_ptr< IReader > reader) |
void | addAlgorithm (std::shared_ptr< IAlgorithm > algorithm) |
void | addWriter (std::shared_ptr< IWriter > writer) |
int | run () |
Private Member Functions | |
std::vector< std::string > | listAlgorithmNames () const |
List of all configured algorithm names. | |
std::pair< size_t, size_t > | determineEventsRange () const |
Determine range of (requested) events; [SIZE_MAX, SIZE_MAX) for error. | |
const Acts::Logger & | logger () const |
Private Attributes | |
Config | m_cfg |
std::vector< std::shared_ptr < IService > > | m_services |
std::vector< std::shared_ptr < IContextDecorator > > | m_decorators |
std::vector< std::shared_ptr < IReader > > | m_readers |
std::vector< std::shared_ptr < IAlgorithm > > | m_algorithms |
std::vector< std::shared_ptr < IWriter > > | m_writers |
std::unique_ptr< const Acts::Logger > | m_logger |
A simple algorithm sequencer for event processing.
This is the backbone of the framework. It reads events from file, runs the configured algorithms for each event, and writes selected data back to a file.
Definition at line 31 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 31 of file Sequencer.hpp
ActsExamples::Sequencer::Sequencer | ( | const Config & | cfg | ) |
Definition at line 25 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 25 of file Sequencer.cpp
References m_cfg, and ActsExamples::Sequencer::Config::numThreads.
void ActsExamples::Sequencer::addAlgorithm | ( | std::shared_ptr< IAlgorithm > | algorithm | ) |
Append an algorithm to the sequence of algorithms.
std::invalid_argument | if the algorithm is NULL. |
Definition at line 60 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 60 of file Sequencer.cpp
References ACTS_INFO.
Referenced by main(), materialMappingExample(), propagationExample(), and runGeantinoRecording().
void ActsExamples::Sequencer::addContextDecorator | ( | std::shared_ptr< IContextDecorator > | decorator | ) |
Add a context decorator to the set of context decorators.
std::invalid_argument | if the decorator is NULL. |
Definition at line 43 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 43 of file Sequencer.cpp
References ACTS_INFO.
Referenced by main(), and propagationExample().
void ActsExamples::Sequencer::addReader | ( | std::shared_ptr< IReader > | reader | ) |
Add a reader to the set of readers.
std::invalid_argument | if the reader is NULL. |
Definition at line 52 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 52 of file Sequencer.cpp
References ACTS_INFO.
Referenced by main(), and materialMappingExample().
void ActsExamples::Sequencer::addService | ( | std::shared_ptr< IService > | service | ) |
Add a service to the set of services.
std::invalid_argument | if the service is NULL. |
Definition at line 35 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 35 of file Sequencer.cpp
References ACTS_INFO.
void ActsExamples::Sequencer::addWriter | ( | std::shared_ptr< IWriter > | writer | ) |
Add a writer to the set of writers.
std::invalid_argument | if the writer is NULL. |
Definition at line 69 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 69 of file Sequencer.cpp
References ACTS_INFO.
Referenced by main(), materialMappingExample(), materialValidationExample(), propagationExample(), and runGeantinoRecording().
|
private |
Determine range of (requested) events; [SIZE_MAX, SIZE_MAX) for error.
Definition at line 112 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 112 of file Sequencer.cpp
References ACTS_ERROR, ACTS_INFO, max, min, reader(), and Acts::UnitConstants::u.
|
private |
List of all configured algorithm names.
Definition at line 77 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 77 of file Sequencer.cpp
References algorithm, eicpy.verify::names, and reader().
|
inlineprivate |
Definition at line 111 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 111 of file Sequencer.hpp
References m_logger.
int ActsExamples::Sequencer::run | ( | ) |
Run the event loop.
main()
return code This function is intended to be run as the last thing in the tool main function and its return value can be used directly as the program return value, i.e.
int main(int argc, char* argv[]) { Sequencer::Config cfg; ... // configure the sequencer Sequencer seq; ... // set up the algorithms return seq.run(); }
This will run the start-of-run hook for all configured services, run all configured readers, algorithms, and writers for each event, then invoke the end-of-run hook for all configured writers.
Decorate the context
Definition at line 228 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 228 of file Sequencer.cpp
References ACTS_INFO, Acts::getDefaultLogger(), init(), eicpy.verify::names, SUCCESS, nlohmann::to_string(), and zero.
Referenced by main(), materialMappingExample(), materialValidationExample(), propagationExample(), and runGeantinoRecording().
|
private |
Definition at line 107 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 107 of file Sequencer.hpp
|
private |
Definition at line 103 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 103 of file Sequencer.hpp
Referenced by Sequencer().
|
private |
Definition at line 105 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 105 of file Sequencer.hpp
|
private |
Definition at line 109 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 109 of file Sequencer.hpp
Referenced by logger().
|
private |
Definition at line 106 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 106 of file Sequencer.hpp
|
private |
Definition at line 104 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 104 of file Sequencer.hpp
|
private |
Definition at line 108 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 108 of file Sequencer.hpp