Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ActsExamples::Sequencer Class Reference

#include <acts/blob/sPHENIX/Examples/Framework/include/ActsExamples/Framework/Sequencer.hpp>

+ Collaboration diagram for ActsExamples::Sequencer:

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 Configconfig () 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::Loggerlogger () 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
 

Detailed Description

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

Constructor & Destructor Documentation

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.

Member Function Documentation

void ActsExamples::Sequencer::addAlgorithm ( std::shared_ptr< IAlgorithm algorithm)

Append an algorithm to the sequence of algorithms.

Exceptions
std::invalid_argumentif 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ActsExamples::Sequencer::addContextDecorator ( std::shared_ptr< IContextDecorator decorator)

Add a context decorator to the set of context decorators.

Exceptions
std::invalid_argumentif 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ActsExamples::Sequencer::addElement ( const std::shared_ptr< SequenceElement > &  element)

Append a sequence element to the sequence

Exceptions
std::invalid_argumentif 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ActsExamples::Sequencer::addReader ( std::shared_ptr< IReader reader)

Add a reader to the set of readers.

Exceptions
std::invalid_argumentif 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

+ Here is the caller graph for this function:

void ActsExamples::Sequencer::addWriter ( std::shared_ptr< IWriter writer)

Add a writer to the set of writers.

Exceptions
std::invalid_argumentif 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const Config& ActsExamples::Sequencer::config ( ) const
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().

+ Here is the caller graph for this function:

std::pair< std::size_t, std::size_t > ActsExamples::Sequencer::determineEventsRange ( ) const
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().

+ Here is the caller graph for this function:

std::pair< std::string, std::size_t > ActsExamples::Sequencer::fpeMaskCount ( const boost::stacktrace::stacktrace &  st,
Acts::FpeType  type 
) const
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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ActsExamples::Sequencer::fpeReport ( ) const
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.

+ Here is the call graph for this function:

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::vector< std::string > ActsExamples::Sequencer::listAlgorithmNames ( ) const
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().

+ Here is the caller graph for this function:

const Acts::Logger& ActsExamples::Sequencer::logger ( ) const
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().

+ Here is the caller graph for this function:

int ActsExamples::Sequencer::run ( )

Run the event loop.

Returns
status code compatible with the main() return code
EXIT_SUCCESS when everying worked without problems
EXIT_FAILURE if something went wrong
Note
If the number of events to process is undefined, the sequencer will process events until the first reader signals the end-of-file. If given, it sets an upper bound.

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

Config ActsExamples::Sequencer::m_cfg
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().

std::vector<std::shared_ptr<IContextDecorator> > ActsExamples::Sequencer::m_decorators
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().

std::unique_ptr<const Acts::Logger> ActsExamples::Sequencer::m_logger
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().

std::atomic<std::size_t> ActsExamples::Sequencer::m_nUnmaskedFpe = 0
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().

std::vector<std::shared_ptr<IReader> > ActsExamples::Sequencer::m_readers
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().

std::vector<SequenceElementWithFpeResult> ActsExamples::Sequencer::m_sequenceElements
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().

tbbWrap::task_arena ActsExamples::Sequencer::m_taskArena
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().

std::unordered_map<std::string, std::string> ActsExamples::Sequencer::m_whiteboardObjectAliases
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().

std::unordered_map<std::string, const DataHandleBase *> ActsExamples::Sequencer::m_whiteBoardState
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().


The documentation for this class was generated from the following files: