Analysis Software
Documentation for sPHENIX simulation software
|
#include <acts/blob/sPHENIX/Examples/Io/Root/include/ActsExamples/Io/Root/RootParticleWriter.hpp>
Classes | |
struct | Config |
Public Member Functions | |
RootParticleWriter (const Config &cfg, Acts::Logging::Level lvl) | |
~RootParticleWriter () override | |
Ensure underlying file is closed. | |
ProcessCode | finalize () override |
End-of-run hook. | |
const Config & | config () const |
Get readonly access to the config parameters. | |
Public Member Functions inherited from ActsExamples::WriterT< SimParticleContainer > | |
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 SimParticleContainer &particles) override |
Protected Member Functions inherited from ActsExamples::WriterT< SimParticleContainer > | |
const Acts::Logger & | logger () 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. | |
std::vector< uint64_t > | m_particleId |
Event-unique particle identifier a.k.a barcode. | |
std::vector< int32_t > | m_particleType |
Particle type a.k.a. PDG particle number. | |
std::vector< uint32_t > | m_process |
Production process type, i.e. what generated the particle. | |
std::vector< float > | m_vx |
Production position components in mm. | |
std::vector< float > | m_vy |
std::vector< float > | m_vz |
std::vector< float > | m_vt |
std::vector< float > | m_p |
Total momentum in GeV. | |
std::vector< float > | m_px |
Momentum components in GeV. | |
std::vector< float > | m_py |
std::vector< float > | m_pz |
std::vector< float > | m_m |
Mass in GeV. | |
std::vector< float > | m_q |
Charge in e. | |
std::vector< float > | m_eta |
Direction pseudo-rapidity. | |
std::vector< float > | m_phi |
Direction angle in the transverse plane. | |
std::vector< float > | m_pt |
Transverse momentum in GeV. | |
std::vector< uint32_t > | m_vertexPrimary |
std::vector< uint32_t > | m_vertexSecondary |
std::vector< uint32_t > | m_particle |
std::vector< uint32_t > | m_generation |
std::vector< uint32_t > | m_subParticle |
Write out particles as a flat TTree.
Each entry in the TTree corresponds to one particle 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 35 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 35 of file RootParticleWriter.hpp
ActsExamples::RootParticleWriter::RootParticleWriter | ( | const Config & | cfg, |
Acts::Logging::Level | lvl | ||
) |
Construct the particle writer.
cfg is the configuration object lvl is the logging level
Definition at line 26 of file RootParticleWriter.cpp.
View newest version in sPHENIX GitHub at line 26 of file RootParticleWriter.cpp
References ActsExamples::RootParticleWriter::Config::fileMode, ActsExamples::RootParticleWriter::Config::filePath, m_cfg, m_eta, m_eventId, m_generation, m_m, m_outputFile, m_outputTree, m_p, m_particle, m_particleId, m_particleType, m_phi, m_process, m_pt, m_px, m_py, m_pz, m_q, m_subParticle, m_vertexPrimary, m_vertexSecondary, m_vt, m_vx, m_vy, m_vz, and ActsExamples::RootParticleWriter::Config::treeName.
|
override |
Ensure underlying file is closed.
Definition at line 74 of file RootParticleWriter.cpp.
View newest version in sPHENIX GitHub at line 74 of file RootParticleWriter.cpp
|
inline |
Get readonly access to the config parameters.
Definition at line 61 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 61 of file RootParticleWriter.hpp
References m_cfg.
|
overridevirtual |
End-of-run hook.
Implements ActsExamples::SequenceElement.
Definition at line 80 of file RootParticleWriter.cpp.
View newest version in sPHENIX GitHub at line 80 of file RootParticleWriter.cpp
References ACTS_INFO, m_cfg(), and SUCCESS.
|
overrideprotectedvirtual |
Type-specific write implementation.
[in] | ctx | is the algorithm context |
[in] | particles | are the particle to be written |
Implements ActsExamples::WriterT< SimParticleContainer >.
Definition at line 91 of file RootParticleWriter.cpp.
View newest version in sPHENIX GitHub at line 91 of file RootParticleWriter.cpp
References Acts::UnitConstants::e, Acts::VectorHelpers::eta(), ActsExamples::AlgorithmContext::eventNumber, Acts::UnitConstants::GeV, Acts::UnitConstants::mm, Acts::UnitConstants::ns, merge_hashes::p, particle, Acts::VectorHelpers::perp(), Acts::VectorHelpers::phi(), and SUCCESS.
|
private |
Definition at line 72 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 72 of file RootParticleWriter.hpp
Referenced by config(), and RootParticleWriter().
|
private |
Direction pseudo-rapidity.
Definition at line 102 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 102 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Event identifier.
Definition at line 77 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 77 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Definition at line 111 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 111 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Mass in GeV.
Definition at line 97 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 97 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Definition at line 74 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 74 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Definition at line 75 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 75 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Total momentum in GeV.
Definition at line 91 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 91 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Definition at line 110 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 110 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Event-unique particle identifier a.k.a barcode.
Definition at line 79 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 79 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Particle type a.k.a. PDG particle number.
Definition at line 81 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 81 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Direction angle in the transverse plane.
Definition at line 104 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 104 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Production process type, i.e. what generated the particle.
Definition at line 83 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 83 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Transverse momentum in GeV.
Definition at line 106 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 106 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Momentum components in GeV.
Definition at line 93 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 93 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Definition at line 94 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 94 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Definition at line 95 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 95 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Charge in e.
Definition at line 99 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 99 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Definition at line 112 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 112 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Definition at line 108 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 108 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Definition at line 109 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 109 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Definition at line 89 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 89 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Production position components in mm.
Definition at line 85 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 85 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Definition at line 86 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 86 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Definition at line 87 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 87 of file RootParticleWriter.hpp
Referenced by RootParticleWriter().
|
private |
Definition at line 73 of file RootParticleWriter.hpp.
View newest version in sPHENIX GitHub at line 73 of file RootParticleWriter.hpp