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

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

+ Inheritance diagram for ActsExamples::RootSimHitWriter:
+ Collaboration diagram for ActsExamples::RootSimHitWriter:

Classes

struct  Config
 

Public Member Functions

 RootSimHitWriter (const Config &config, Acts::Logging::Level level)
 
 ~RootSimHitWriter () override
 Ensure underlying file is closed.
 
ProcessCode finalize () override
 End-of-run hook.
 
const Configconfig () const
 Get readonly access to the config parameters.
 
- Public Member Functions inherited from ActsExamples::WriterT< SimHitContainer >
 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 SimHitContainer &hits) override
 
- Protected Member Functions inherited from ActsExamples::WriterT< SimHitContainer >
const Acts::Loggerlogger () const
 

Private Attributes

Config m_cfg
 
std::mutex m_writeMutex
 
TFile * m_outputFile = nullptr
 
TTree * m_outputTree = nullptr
 
uint32_t m_eventId = 0
 Event identifier.
 
uint64_t m_geometryId = 0
 Hit surface identifier.
 
uint64_t m_particleId = 0
 Event-unique particle identifier a.k.a. barcode.
 
float m_tx = 0
 True global hit position components in mm.
 
float m_ty = 0
 
float m_tz = 0
 
float m_tt = 0
 
float m_tpx = 0
 True particle four-momentum in GeV at hit position before interaction.
 
float m_tpy = 0
 
float m_tpz = 0
 
float m_te = 0
 
float m_deltapx = 0
 True change in particle four-momentum in GeV due to interactions.
 
float m_deltapy = 0
 
float m_deltapz = 0
 
float m_deltae = 0
 
int32_t m_index = 0
 Hit index along the particle trajectory.
 
uint32_t m_volumeId = 0
 
uint32_t m_boundaryId = 0
 
uint32_t m_layerId = 0
 
uint32_t m_approachId = 0
 
uint32_t m_sensitiveId = 0
 

Detailed Description

Write out simulated hits as a flat TTree.

Each entry in the TTree corresponds to one hit for optimum writing speed. The event number is part of the written data.

Safe to use from multiple writer threads. To avoid thread-saftey issues, the writer must be the sole owner of the underlying file. Thus, the output file pointer can not be given from the outside.

Definition at line 34 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 34 of file RootSimHitWriter.hpp

Constructor & Destructor Documentation

ActsExamples::RootSimHitWriter::RootSimHitWriter ( const Config config,
Acts::Logging::Level  level 
)

Construct the particle writer.

Parameters
configis the configuration object
levelis the logging level

Definition at line 24 of file RootSimHitWriter.cpp.

View newest version in sPHENIX GitHub at line 24 of file RootSimHitWriter.cpp

References ActsExamples::RootSimHitWriter::Config::fileMode, ActsExamples::RootSimHitWriter::Config::filePath, m_approachId, m_boundaryId, m_cfg, m_deltae, m_deltapx, m_deltapy, m_deltapz, m_eventId, m_geometryId, m_index, m_layerId, m_outputFile, m_outputTree, m_particleId, m_sensitiveId, m_te, m_tpx, m_tpy, m_tpz, m_tt, m_tx, m_ty, m_tz, m_volumeId, and ActsExamples::RootSimHitWriter::Config::treeName.

ActsExamples::RootSimHitWriter::~RootSimHitWriter ( )
override

Ensure underlying file is closed.

Definition at line 71 of file RootSimHitWriter.cpp.

View newest version in sPHENIX GitHub at line 71 of file RootSimHitWriter.cpp

Member Function Documentation

const Config& ActsExamples::RootSimHitWriter::config ( ) const
inline

Get readonly access to the config parameters.

Definition at line 60 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 60 of file RootSimHitWriter.hpp

References m_cfg.

ActsExamples::ProcessCode ActsExamples::RootSimHitWriter::finalize ( )
overridevirtual

End-of-run hook.

Implements ActsExamples::SequenceElement.

Definition at line 77 of file RootSimHitWriter.cpp.

View newest version in sPHENIX GitHub at line 77 of file RootSimHitWriter.cpp

References ACTS_VERBOSE, m_cfg(), and SUCCESS.

Referenced by BOOST_AUTO_TEST_CASE().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ActsExamples::ProcessCode ActsExamples::RootSimHitWriter::writeT ( const AlgorithmContext ctx,
const SimHitContainer hits 
)
overrideprotectedvirtual

Type-specific write implementation.

Parameters
[in]ctxis the algorithm context
[in]hitsare the hits to be written

Implements ActsExamples::WriterT< SimHitContainer >.

Definition at line 88 of file RootSimHitWriter.cpp.

View newest version in sPHENIX GitHub at line 88 of file RootSimHitWriter.cpp

References ActsExamples::AlgorithmContext::eventNumber, Acts::UnitConstants::GeV, Acts::UnitConstants::mm, Acts::UnitConstants::ns, and SUCCESS.

Member Data Documentation

uint32_t ActsExamples::RootSimHitWriter::m_approachId = 0
private

Definition at line 95 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 95 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

uint32_t ActsExamples::RootSimHitWriter::m_boundaryId = 0
private

Definition at line 93 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 93 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

Config ActsExamples::RootSimHitWriter::m_cfg
private

Definition at line 71 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 71 of file RootSimHitWriter.hpp

Referenced by config(), and RootSimHitWriter().

float ActsExamples::RootSimHitWriter::m_deltae = 0
private

Definition at line 88 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 88 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

float ActsExamples::RootSimHitWriter::m_deltapx = 0
private

True change in particle four-momentum in GeV due to interactions.

Definition at line 88 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 88 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

float ActsExamples::RootSimHitWriter::m_deltapy = 0
private

Definition at line 88 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 88 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

float ActsExamples::RootSimHitWriter::m_deltapz = 0
private

Definition at line 88 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 88 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

uint32_t ActsExamples::RootSimHitWriter::m_eventId = 0
private

Event identifier.

Definition at line 76 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 76 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

uint64_t ActsExamples::RootSimHitWriter::m_geometryId = 0
private

Hit surface identifier.

Definition at line 78 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 78 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

int32_t ActsExamples::RootSimHitWriter::m_index = 0
private

Hit index along the particle trajectory.

Definition at line 90 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 90 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

uint32_t ActsExamples::RootSimHitWriter::m_layerId = 0
private

Definition at line 94 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 94 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

TFile* ActsExamples::RootSimHitWriter::m_outputFile = nullptr
private

Definition at line 73 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 73 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

TTree* ActsExamples::RootSimHitWriter::m_outputTree = nullptr
private

Definition at line 74 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 74 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

uint64_t ActsExamples::RootSimHitWriter::m_particleId = 0
private

Event-unique particle identifier a.k.a. barcode.

Definition at line 80 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 80 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

uint32_t ActsExamples::RootSimHitWriter::m_sensitiveId = 0
private

Definition at line 96 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 96 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

float ActsExamples::RootSimHitWriter::m_te = 0
private

Definition at line 86 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 86 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

float ActsExamples::RootSimHitWriter::m_tpx = 0
private

True particle four-momentum in GeV at hit position before interaction.

Definition at line 86 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 86 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

float ActsExamples::RootSimHitWriter::m_tpy = 0
private

Definition at line 86 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 86 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

float ActsExamples::RootSimHitWriter::m_tpz = 0
private

Definition at line 86 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 86 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

float ActsExamples::RootSimHitWriter::m_tt = 0
private

Definition at line 84 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 84 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

float ActsExamples::RootSimHitWriter::m_tx = 0
private

True global hit position components in mm.

Definition at line 82 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 82 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

float ActsExamples::RootSimHitWriter::m_ty = 0
private

Definition at line 82 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 82 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

float ActsExamples::RootSimHitWriter::m_tz = 0
private

Definition at line 82 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 82 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

uint32_t ActsExamples::RootSimHitWriter::m_volumeId = 0
private

Definition at line 92 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 92 of file RootSimHitWriter.hpp

Referenced by RootSimHitWriter().

std::mutex ActsExamples::RootSimHitWriter::m_writeMutex
private

Definition at line 72 of file RootSimHitWriter.hpp.

View newest version in sPHENIX GitHub at line 72 of file RootSimHitWriter.hpp


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