Analysis Software
Documentation for sPHENIX simulation software
|
#include <acts/blob/sPHENIX/Examples/Io/Root/include/ActsExamples/Io/Root/RootMeasurementWriter.hpp>
Classes | |
struct | Config |
struct | DigitizationTree |
Public Member Functions | |
RootMeasurementWriter (const Config &config, Acts::Logging::Level level) | |
~RootMeasurementWriter () override | |
Virtual destructor. | |
ProcessCode | finalize () override |
End-of-run hook. | |
const Config & | config () const |
Get const access to the config. | |
Public Member Functions inherited from ActsExamples::WriterT< MeasurementContainer > | |
WriterT (std::string objectName, std::string writerName, Acts::Logging::Level level) | |
std::string | name () const override |
Provide the name of the writer. | |
ProcessCode | write (const AlgorithmContext &context) override |
Read the object and call the type-specific member function. | |
ProcessCode | finalize () override |
No-op default implementation. | |
Public Member Functions inherited from ActsExamples::IWriter | |
ProcessCode | internalExecute (const AlgorithmContext &context) final |
ProcessCode | initialize () override |
Fulfil the algorithm interface. | |
Public Member Functions inherited from ActsExamples::SequenceElement | |
virtual | ~SequenceElement ()=default |
const std::vector< const DataHandleBase * > & | writeHandles () const |
const std::vector< const DataHandleBase * > & | readHandles () const |
Protected Member Functions | |
ProcessCode | writeT (const AlgorithmContext &ctx, const MeasurementContainer &measurements) override |
Protected Member Functions inherited from ActsExamples::WriterT< MeasurementContainer > | |
const Acts::Logger & | logger () const |
Private Attributes | |
Config | m_cfg |
std::mutex | m_writeMutex |
protect multi-threaded writes | |
TFile * | m_outputFile |
the output file | |
Acts::GeometryHierarchyMap < std::unique_ptr < DigitizationTree > > | m_outputTrees |
the output trees | |
std::unordered_map < Acts::GeometryIdentifier, const Acts::Surface * > | m_dSurfaces |
All surfaces that could carry measurements. | |
ReadDataHandle< SimHitContainer > | m_inputSimHits {this, "InputSimHits"} |
ReadDataHandle< IndexMultimap < Index > > | m_inputMeasurementSimHitsMap |
ReadDataHandle< ClusterContainer > | m_inputClusters {this, "InputClusters"} |
Write out a planar cluster collection into a root file to avoid immense long vectors, each cluster is one entry in the root file for optimised data writing speed The event number is part of the written data.
A common file can be provided for the writer to attach his TTree, this is done by setting the Config::rootFile pointer to an existing file
Safe to use from multiple writer threads - uses a std::mutex lock.
Definition at line 59 of file RootMeasurementWriter.hpp.
View newest version in sPHENIX GitHub at line 59 of file RootMeasurementWriter.hpp
ActsExamples::RootMeasurementWriter::RootMeasurementWriter | ( | const Config & | config, |
Acts::Logging::Level | level | ||
) |
Constructor with
cfg | configuration struct |
output | logging level |
Definition at line 30 of file RootMeasurementWriter.cpp.
View newest version in sPHENIX GitHub at line 30 of file RootMeasurementWriter.cpp
References ACTS_DEBUG, ACTS_VERBOSE, ActsExamples::RootMeasurementWriter::Config::boundIndices, Acts::GeometryHierarchyMap< value_t >::empty(), ActsExamples::RootMeasurementWriter::Config::fileMode, ActsExamples::RootMeasurementWriter::Config::filePath, Acts::GeometryHierarchyMap< value_t >::idAt(), ActsExamples::ReadDataHandle< T >::initialize(), ActsExamples::RootMeasurementWriter::Config::inputClusters, ActsExamples::RootMeasurementWriter::Config::inputMeasurementSimHitsMap, ActsExamples::RootMeasurementWriter::Config::inputSimHits, m_cfg, m_inputClusters, m_inputMeasurementSimHitsMap, m_inputSimHits, m_outputFile, m_outputTrees, ActsExamples::DataHandleBase::maybeInitialize(), testing::internal::move(), Acts::GeometryHierarchyMap< value_t >::size(), ActsExamples::RootMeasurementWriter::Config::trackingGeometry, and Acts::GeometryHierarchyMap< value_t >::valueAt().
|
override |
Virtual destructor.
Definition at line 86 of file RootMeasurementWriter.cpp.
View newest version in sPHENIX GitHub at line 86 of file RootMeasurementWriter.cpp
|
inline |
Get const access to the config.
Definition at line 272 of file RootMeasurementWriter.hpp.
View newest version in sPHENIX GitHub at line 272 of file RootMeasurementWriter.hpp
References m_cfg.
|
overridevirtual |
End-of-run hook.
Close the file if it's yours
Implements ActsExamples::SequenceElement.
Definition at line 92 of file RootMeasurementWriter.cpp.
View newest version in sPHENIX GitHub at line 92 of file RootMeasurementWriter.cpp
References SUCCESS.
|
overrideprotectedvirtual |
This implementation holds the actual writing method and is called by the WriterT<>::write interface
ctx | The Algorithm context with per event information |
measurements | is the data to be written out |
Implements ActsExamples::WriterT< MeasurementContainer >.
Definition at line 104 of file RootMeasurementWriter.cpp.
View newest version in sPHENIX GitHub at line 104 of file RootMeasurementWriter.cpp
References ActsExamples::averageSimHits(), Acts::PhysicalConstants::c, clusters, Acts::ePos0, ActsExamples::AlgorithmContext::eventNumber, ActsExamples::AlgorithmContext::geoContext, Acts::VectorHelpers::incidentAngles(), logger(), Acts::UnitConstants::m, m_cfg(), ActsExamples::makeRange(), Acts::Test::pos4(), Acts::Surface::referenceFrame(), SUCCESS, writeMapConfig::surface, and physmon_ckf_tracking::u.
|
private |
Definition at line 284 of file RootMeasurementWriter.hpp.
View newest version in sPHENIX GitHub at line 284 of file RootMeasurementWriter.hpp
Referenced by config(), and RootMeasurementWriter().
|
private |
All surfaces that could carry measurements.
Definition at line 290 of file RootMeasurementWriter.hpp.
View newest version in sPHENIX GitHub at line 290 of file RootMeasurementWriter.hpp
|
private |
Definition at line 295 of file RootMeasurementWriter.hpp.
View newest version in sPHENIX GitHub at line 295 of file RootMeasurementWriter.hpp
Referenced by RootMeasurementWriter().
|
private |
Definition at line 293 of file RootMeasurementWriter.hpp.
View newest version in sPHENIX GitHub at line 293 of file RootMeasurementWriter.hpp
Referenced by RootMeasurementWriter().
|
private |
Definition at line 292 of file RootMeasurementWriter.hpp.
View newest version in sPHENIX GitHub at line 292 of file RootMeasurementWriter.hpp
Referenced by RootMeasurementWriter().
|
private |
the output file
Definition at line 286 of file RootMeasurementWriter.hpp.
View newest version in sPHENIX GitHub at line 286 of file RootMeasurementWriter.hpp
Referenced by RootMeasurementWriter().
|
private |
the output trees
Definition at line 288 of file RootMeasurementWriter.hpp.
View newest version in sPHENIX GitHub at line 288 of file RootMeasurementWriter.hpp
Referenced by RootMeasurementWriter().
|
private |
protect multi-threaded writes
Definition at line 285 of file RootMeasurementWriter.hpp.
View newest version in sPHENIX GitHub at line 285 of file RootMeasurementWriter.hpp