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

#include <acts/blob/sPHENIX/Examples/Io/Root/include/ActsExamples/Io/Root/RootMeasurementWriter.hpp>

+ Inheritance diagram for ActsExamples::RootMeasurementWriter:
+ Collaboration diagram for ActsExamples::RootMeasurementWriter:

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 Configconfig () 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::Loggerlogger () 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< SimHitContainerm_inputSimHits {this, "InputSimHits"}
 
ReadDataHandle< IndexMultimap
< Index > > 
m_inputMeasurementSimHitsMap
 
ReadDataHandle< ClusterContainerm_inputClusters {this, "InputClusters"}
 

Detailed Description

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

Constructor & Destructor Documentation

ActsExamples::RootMeasurementWriter::~RootMeasurementWriter ( )
override

Virtual destructor.

Definition at line 86 of file RootMeasurementWriter.cpp.

View newest version in sPHENIX GitHub at line 86 of file RootMeasurementWriter.cpp

Member Function Documentation

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

ActsExamples::ProcessCode ActsExamples::RootMeasurementWriter::finalize ( )
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.

ActsExamples::ProcessCode ActsExamples::RootMeasurementWriter::writeT ( const AlgorithmContext ctx,
const MeasurementContainer measurements 
)
overrideprotectedvirtual

This implementation holds the actual writing method and is called by the WriterT<>::write interface

Parameters
ctxThe Algorithm context with per event information
measurementsis 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.

+ Here is the call graph for this function:

Member Data Documentation

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

std::unordered_map<Acts::GeometryIdentifier, const Acts::Surface*> ActsExamples::RootMeasurementWriter::m_dSurfaces
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

ReadDataHandle<ClusterContainer> ActsExamples::RootMeasurementWriter::m_inputClusters {this, "InputClusters"}
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().

ReadDataHandle<IndexMultimap<Index> > ActsExamples::RootMeasurementWriter::m_inputMeasurementSimHitsMap
private
Initial value:
{
this, "InputMeasurementSimHitsMap"}

Definition at line 293 of file RootMeasurementWriter.hpp.

View newest version in sPHENIX GitHub at line 293 of file RootMeasurementWriter.hpp

Referenced by RootMeasurementWriter().

ReadDataHandle<SimHitContainer> ActsExamples::RootMeasurementWriter::m_inputSimHits {this, "InputSimHits"}
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().

TFile* ActsExamples::RootMeasurementWriter::m_outputFile
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().

Acts::GeometryHierarchyMap<std::unique_ptr<DigitizationTree> > ActsExamples::RootMeasurementWriter::m_outputTrees
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().

std::mutex ActsExamples::RootMeasurementWriter::m_writeMutex
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


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