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

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

+ Inheritance diagram for ActsExamples::RootParticleWriter:
+ Collaboration diagram for ActsExamples::RootParticleWriter:

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

Detailed Description

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

Constructor & Destructor Documentation

ActsExamples::RootParticleWriter::RootParticleWriter ( const Config cfg,
Acts::Logging::Level  lvl 
)
ActsExamples::RootParticleWriter::~RootParticleWriter ( )
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

Member Function Documentation

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

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

+ Here is the call graph for this function:

ActsExamples::ProcessCode ActsExamples::RootParticleWriter::writeT ( const AlgorithmContext ctx,
const SimParticleContainer particles 
)
overrideprotectedvirtual

Type-specific write implementation.

Parameters
[in]ctxis the algorithm context
[in]particlesare 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.

+ Here is the call graph for this function:

Member Data Documentation

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

std::vector<float> ActsExamples::RootParticleWriter::m_eta
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().

uint32_t ActsExamples::RootParticleWriter::m_eventId = 0
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().

std::vector<uint32_t> ActsExamples::RootParticleWriter::m_generation
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().

std::vector<float> ActsExamples::RootParticleWriter::m_m
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().

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

TTree* ActsExamples::RootParticleWriter::m_outputTree = nullptr
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().

std::vector<float> ActsExamples::RootParticleWriter::m_p
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().

std::vector<uint32_t> ActsExamples::RootParticleWriter::m_particle
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().

std::vector<uint64_t> ActsExamples::RootParticleWriter::m_particleId
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().

std::vector<int32_t> ActsExamples::RootParticleWriter::m_particleType
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().

std::vector<float> ActsExamples::RootParticleWriter::m_phi
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().

std::vector<uint32_t> ActsExamples::RootParticleWriter::m_process
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().

std::vector<float> ActsExamples::RootParticleWriter::m_pt
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().

std::vector<float> ActsExamples::RootParticleWriter::m_px
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().

std::vector<float> ActsExamples::RootParticleWriter::m_py
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().

std::vector<float> ActsExamples::RootParticleWriter::m_pz
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().

std::vector<float> ActsExamples::RootParticleWriter::m_q
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().

std::vector<uint32_t> ActsExamples::RootParticleWriter::m_subParticle
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().

std::vector<uint32_t> ActsExamples::RootParticleWriter::m_vertexPrimary
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().

std::vector<uint32_t> ActsExamples::RootParticleWriter::m_vertexSecondary
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().

std::vector<float> ActsExamples::RootParticleWriter::m_vt
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().

std::vector<float> ActsExamples::RootParticleWriter::m_vx
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().

std::vector<float> ActsExamples::RootParticleWriter::m_vy
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().

std::vector<float> ActsExamples::RootParticleWriter::m_vz
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().

std::mutex ActsExamples::RootParticleWriter::m_writeMutex
private

Definition at line 73 of file RootParticleWriter.hpp.

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


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