ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FW::RootParticleWriter Exception Referencefinal

#include <acts/blob/master/Examples/Io/Root/include/ACTFW/Io/Root/RootParticleWriter.hpp>

+ Inheritance diagram for FW::RootParticleWriter:
+ Collaboration diagram for FW::RootParticleWriter:

Classes

struct  Config
 

Public Member Functions

 RootParticleWriter (const Config &cfg, Acts::Logging::Level lvl)
 
 ~RootParticleWriter () finaloverride
 Ensure underlying file is closed.
 
ProcessCode endRun () finaloverride
 End-of-run hook.
 
- Public Member Functions inherited from FW::WriterT< SimParticleContainer >
 WriterT (std::string objectName, std::string writerName, Acts::Logging::Level level)
 
std::string name () const finaloverride
 Provide the name of the writer.
 
ProcessCode write (const AlgorithmContext &context) finaloverride
 Read the object and call the type-specific member function.
 
ProcessCode endRun () override
 No-op default implementation.
 
- Public Member Functions inherited from FW::IWriter
virtual ~IWriter ()=default
 

Protected Member Functions

ProcessCode writeT (const AlgorithmContext &ctx, const SimParticleContainer &particles) finaloverride
 
- Protected Member Functions inherited from FW::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
 Event identifier.
 
uint64_t m_particleId
 Event-unique particle identifier a.k.a barcode.
 
int32_t m_particleType
 Particle type a.k.a. PDG particle number.
 
uint32_t m_process
 Production process type, i.e. what generated the particle.
 
float m_vx
 Production position components in mm.
 
float m_vy
 
float m_vz
 
float m_vt
 
float m_px
 Momentum components in GeV.
 
float m_py
 
float m_pz
 
float m_m
 Mass in GeV.
 
float m_q
 Charge in e.
 
float m_eta
 Direction pseudo-rapidity.
 
float m_phi
 Direction angle in the transverse plane.
 
float m_pt
 Transverse momentum in GeV.
 
uint32_t m_vertexPrimary
 
uint32_t m_vertexSecondary
 
uint32_t m_particle
 
uint32_t m_generation
 
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 31 of file RootParticleWriter.hpp.

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

Constructor & Destructor Documentation

FW::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 19 of file RootParticleWriter.cpp.

View newest version in sPHENIX GitHub at line 19 of file RootParticleWriter.cpp

References FW::RootParticleWriter::Config::fileMode, FW::RootParticleWriter::Config::filePath, m_cfg, m_eta, m_eventId, m_generation, m_m, m_outputFile, m_outputTree, 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 FW::RootParticleWriter::Config::treeName.

FW::RootParticleWriter::~RootParticleWriter ( )
finaloverride

Ensure underlying file is closed.

Definition at line 65 of file RootParticleWriter.cpp.

View newest version in sPHENIX GitHub at line 65 of file RootParticleWriter.cpp

Member Function Documentation

FW::ProcessCode FW::RootParticleWriter::endRun ( )
finaloverridevirtual

End-of-run hook.

Implements FW::IWriter.

Definition at line 71 of file RootParticleWriter.cpp.

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

References ACTS_INFO, and SUCCESS.

FW::ProcessCode FW::RootParticleWriter::writeT ( const AlgorithmContext ctx,
const SimParticleContainer particles 
)
finaloverrideprotectedvirtual

Type-specific write implementation.

Parameters
[in]ctxis the algorithm context
[in]particlesare the particle to be written

Implements FW::WriterT< SimParticleContainer >.

Definition at line 81 of file RootParticleWriter.cpp.

View newest version in sPHENIX GitHub at line 81 of file RootParticleWriter.cpp

References ACTS_ERROR, Acts::UnitConstants::e, Acts::VectorHelpers::eta(), FW::AlgorithmContext::eventNumber, Acts::UnitConstants::GeV, Acts::UnitConstants::mm, Acts::UnitConstants::ns, particle, Acts::VectorHelpers::perp(), Acts::VectorHelpers::phi(), and SUCCESS.

+ Here is the call graph for this function:

Member Data Documentation

Config FW::RootParticleWriter::m_cfg
private

Definition at line 65 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

float FW::RootParticleWriter::m_eta
private

Direction pseudo-rapidity.

Definition at line 89 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

uint32_t FW::RootParticleWriter::m_eventId
private

Event identifier.

Definition at line 70 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

uint32_t FW::RootParticleWriter::m_generation
private

Definition at line 98 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

float FW::RootParticleWriter::m_m
private

Mass in GeV.

Definition at line 84 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

TFile* FW::RootParticleWriter::m_outputFile = nullptr
private

Definition at line 67 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

TTree* FW::RootParticleWriter::m_outputTree = nullptr
private

Definition at line 68 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

uint32_t FW::RootParticleWriter::m_particle
private

Definition at line 97 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

uint64_t FW::RootParticleWriter::m_particleId
private

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

Definition at line 72 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

int32_t FW::RootParticleWriter::m_particleType
private

Particle type a.k.a. PDG particle number.

Definition at line 74 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

float FW::RootParticleWriter::m_phi
private

Direction angle in the transverse plane.

Definition at line 91 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

uint32_t FW::RootParticleWriter::m_process
private

Production process type, i.e. what generated the particle.

Definition at line 76 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

float FW::RootParticleWriter::m_pt
private

Transverse momentum 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().

float FW::RootParticleWriter::m_px
private

Momentum components in GeV.

Definition at line 82 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

float FW::RootParticleWriter::m_py
private

Definition at line 82 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

float FW::RootParticleWriter::m_pz
private

Definition at line 82 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

float FW::RootParticleWriter::m_q
private

Charge in e.

Definition at line 86 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

uint32_t FW::RootParticleWriter::m_subParticle
private

Definition at line 99 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

uint32_t FW::RootParticleWriter::m_vertexPrimary
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().

uint32_t FW::RootParticleWriter::m_vertexSecondary
private

Definition at line 96 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

float FW::RootParticleWriter::m_vt
private

Definition at line 80 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

float FW::RootParticleWriter::m_vx
private

Production position components in mm.

Definition at line 78 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

float FW::RootParticleWriter::m_vy
private

Definition at line 78 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

float FW::RootParticleWriter::m_vz
private

Definition at line 78 of file RootParticleWriter.hpp.

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

Referenced by RootParticleWriter().

std::mutex FW::RootParticleWriter::m_writeMutex
private

Definition at line 66 of file RootParticleWriter.hpp.

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


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