Analysis Software
Documentation for sPHENIX simulation software
|
#include <acts/blob/sPHENIX/Examples/Framework/include/ActsExamples/Framework/Sequencer.hpp>
Classes | |
struct | Config |
struct | FpeMask |
struct | SequenceElementWithFpeResult |
Public Member Functions | |
Sequencer (const Config &cfg) | |
void | addContextDecorator (std::shared_ptr< IContextDecorator > decorator) |
void | addReader (std::shared_ptr< IReader > reader) |
void | addAlgorithm (std::shared_ptr< IAlgorithm > algorithm) |
void | addElement (const std::shared_ptr< SequenceElement > &element) |
void | addWriter (std::shared_ptr< IWriter > writer) |
void | addWhiteboardAlias (const std::string &aliasName, const std::string &objectName) |
Add an alias to the whiteboard. | |
Acts::FpeMonitor::Result | fpeResult () const |
int | run () |
const Config & | config () const |
Get const access to the config. | |
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. | |
std::pair< std::string, std::size_t > | fpeMaskCount (const boost::stacktrace::stacktrace &st, Acts::FpeType type) const |
void | fpeReport () const |
const Acts::Logger & | logger () const |
Private Attributes | |
Config | m_cfg |
tbbWrap::task_arena | m_taskArena |
std::vector< std::shared_ptr < IContextDecorator > > | m_decorators |
std::vector< std::shared_ptr < IReader > > | m_readers |
std::vector < SequenceElementWithFpeResult > | m_sequenceElements |
std::unique_ptr< const Acts::Logger > | m_logger |
std::unordered_map < std::string, std::string > | m_whiteboardObjectAliases |
std::unordered_map < std::string, const DataHandleBase * > | m_whiteBoardState |
std::atomic< std::size_t > | m_nUnmaskedFpe = 0 |
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 58 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 58 of file Sequencer.hpp
ActsExamples::Sequencer::Sequencer | ( | const Config & | cfg | ) |
Definition at line 106 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 106 of file Sequencer.cpp
References ACTS_INFO, m_cfg, ActsExamples::Sequencer::Config::numThreads, and ActsExamples::Sequencer::Config::trackFpes.
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 148 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 148 of file Sequencer.cpp
References addElement(), and testing::internal::move().
Referenced by Acts::Python::addFramework(), main(), propagationExample(), runDetectorAlignment(), runDigitizationExample(), runHoughExample(), runMaterialMapping(), runMeasurementsToSP(), runRecCKFTracks(), runRecTruthTracks(), runSeedingExample(), setupDigitization(), ActsExamples::setupGeant4Simulation(), ActsExamples::Simulation::setupInput(), ActsExamples::setupMaterialRecording(), and setupParticleSmearing().
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 131 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 131 of file Sequencer.cpp
References ACTS_INFO, m_decorators, and testing::internal::move().
Referenced by Acts::Python::addFramework(), main(), materialValidationExample(), propagationExample(), runDetectorAlignment(), runDigitizationExample(), runHoughExample(), runMaterialMapping(), runMeasurementsToSP(), runRecCKFTracks(), runRecTruthTracks(), runSeedingExample(), and ActsExamples::Options::setupMagneticFieldServices().
void ActsExamples::Sequencer::addElement | ( | const std::shared_ptr< SequenceElement > & | element | ) |
Append a sequence element to the sequence
std::invalid_argument | if the element is NULL. |
Definition at line 163 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 163 of file Sequencer.cpp
References ACTS_DEBUG, ACTS_ERROR, ACTS_INFO, in, it, m_cfg, m_sequenceElements, m_whiteboardObjectAliases, m_whiteBoardState, Acts::Test::pos, ActsExamples::Sequencer::Config::runDataFlowChecks, physmon_simulation::s, parse_cmake_options::source, and Acts::IntegrationTest::valid().
Referenced by addAlgorithm(), addReader(), and addWriter().
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 140 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 140 of file Sequencer.cpp
References addElement(), m_readers, and testing::internal::move().
Referenced by Acts::Python::addFramework(), main(), runDigitizationExample(), runMaterialMapping(), ActsExamples::runMaterialRecording(), ActsExamples::Simulation::setupInput(), setupMeasurementReading(), setupParticleReading(), and setupSimHitReading().
void ActsExamples::Sequencer::addWhiteboardAlias | ( | const std::string & | aliasName, |
const std::string & | objectName | ||
) |
Add an alias to the whiteboard.
Definition at line 262 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 262 of file Sequencer.cpp
References it, m_whiteboardObjectAliases, and m_whiteBoardState.
Referenced by Acts::Python::addFramework().
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 156 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 156 of file Sequencer.cpp
References addElement(), and testing::internal::move().
Referenced by Acts::Python::addFramework(), main(), materialValidationExample(), propagationExample(), runDetectorAlignment(), runDigitizationExample(), runHoughExample(), runMaterialMapping(), ActsExamples::runMaterialRecording(), runMeasurementsToSP(), runRecCKFTracks(), runRecTruthTracks(), runSeedingExample(), and ActsExamples::Simulation::setupOutput().
|
inline |
Get const access to the config.
Definition at line 156 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 156 of file Sequencer.hpp
References m_cfg.
Referenced by Acts::Python::addFramework().
|
private |
Determine range of (requested) events; [SIZE_MAX, SIZE_MAX) for error.
Definition at line 292 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 292 of file Sequencer.cpp
References ACTS_ERROR, ACTS_INFO, end, ActsExamples::Sequencer::Config::events, m_cfg, m_readers, Acts::UnitConstants::min, summary::reader, ActsExamples::Sequencer::Config::skip, and physmon_ckf_tracking::u.
Referenced by run().
|
private |
Definition at line 655 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 655 of file Sequencer.cpp
References test_fpe::count, end, file, Acts::FpeMonitor::getSourceLocation(), it, test_fpe::lines, loc, m_cfg(), physmon_vertexing::start, and to_string().
Referenced by run().
|
private |
Definition at line 604 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 604 of file Sequencer.cpp
References KFPMath::a, ACTS_ERROR, ACTS_INFO, KFPMath::b, test_fpe::count, f, check_smearing_config::lhs, m_cfg(), ambiguity_solver_perf::merged, check_smearing_config::rhs, Acts::Experimental::detail::BlueprintHelper::sort(), Acts::FpeMonitor::stackTraceToString(), to_string(), Acts::Test::transform, and parse_cmake_options::type.
Acts::FpeMonitor::Result ActsExamples::Sequencer::fpeResult | ( | ) | const |
Definition at line 676 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 676 of file Sequencer.cpp
References check_smearing_config::lhs, Acts::FpeMonitor::Result::merge(), ambiguity_solver_perf::merged, and check_smearing_config::rhs.
Referenced by Acts::Python::addFramework().
|
private |
List of all configured algorithm names.
Definition at line 277 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 277 of file Sequencer.cpp
References m_decorators, m_sequenceElements, and TauVsDIS_MachineLearning_Differentiation::names.
Referenced by run().
|
inlineprivate |
Definition at line 187 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 187 of file Sequencer.hpp
References m_logger.
Referenced by run().
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 412 of file Sequencer.cpp.
View newest version in sPHENIX GitHub at line 412 of file Sequencer.cpp
References ACTS_DEBUG, ACTS_ERROR, ACTS_FATAL, ACTS_INFO, ACTS_VERBOSE, test_fpe::count, Acts::Logging::DEBUG, determineEventsRange(), event, ActsExamples::tbbWrap::task_arena::execute(), ActsExamples::Sequencer::Config::failOnFirstFpe, fpeMaskCount(), ActsExamples::AlgorithmContext::fpeMonitor, ActsExamples::Sequencer::Config::fpeStackTraceLength, Acts::getDefaultLogger(), i, ActsExamples::Sequencer::Config::iterationCallback, Acts::Logger::level(), listAlgorithmNames(), logger(), ActsExamples::Sequencer::Config::logLevel, m_cfg, m_decorators, m_nUnmaskedFpe, m_sequenceElements, m_taskArena, m_whiteboardObjectAliases, TauVsDIS_MachineLearning_Differentiation::names, ActsExamples::Sequencer::Config::numThreads, physmon_track_finding_ttbar::r, Acts::FpeMonitor::stackTraceToString(), SUCCESS, to_string(), ActsExamples::Sequencer::Config::trackFpes, parse_cmake_options::type, and KFPMath::zero().
Referenced by main(), materialValidationExample(), propagationExample(), runDetectorAlignment(), runDigitizationExample(), runHoughExample(), runMaterialMapping(), ActsExamples::runMaterialRecording(), runMeasurementsToSP(), runRecCKFTracks(), runRecTruthTracks(), and runSeedingExample().
|
private |
Definition at line 174 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 174 of file Sequencer.hpp
Referenced by addElement(), config(), determineEventsRange(), run(), and Sequencer().
|
private |
Definition at line 176 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 176 of file Sequencer.hpp
Referenced by addContextDecorator(), listAlgorithmNames(), and run().
|
private |
Definition at line 179 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 179 of file Sequencer.hpp
Referenced by logger().
|
private |
Definition at line 185 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 185 of file Sequencer.hpp
Referenced by run().
|
private |
Definition at line 177 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 177 of file Sequencer.hpp
Referenced by addReader(), and determineEventsRange().
|
private |
Definition at line 178 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 178 of file Sequencer.hpp
Referenced by addElement(), listAlgorithmNames(), and run().
|
private |
Definition at line 175 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 175 of file Sequencer.hpp
Referenced by run().
|
private |
Definition at line 181 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 181 of file Sequencer.hpp
Referenced by addElement(), addWhiteboardAlias(), and run().
|
private |
Definition at line 183 of file Sequencer.hpp.
View newest version in sPHENIX GitHub at line 183 of file Sequencer.hpp
Referenced by addElement(), and addWhiteboardAlias().