ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
ActsPlugins::RootMaterialTrackIo Class Reference

Simple payload class that can be wrapped for reading and writing. More...

#include <ActsPlugins/Root/RootMaterialTrackIo.hpp>

Classes

struct  Config

Public Member Functions

 RootMaterialTrackIo (const Config &cfg)
 Constructor from config struct.
 ~RootMaterialTrackIo ()=default
 Destructor.
void connectForRead (TChain &materialChain)
 sets the branch connection for reading from a file
void connectForWrite (TTree &materialTree)
 sets the branch connection for writing to a file
Acts::RecordedMaterialTrack read () const
 Read the material track from the tree.
void write (const Acts::GeometryContext &gctx, std::uint32_t eventNum, const Acts::RecordedMaterialTrack &materialTrack)
 Write the material track to the tree.

Detailed Description

Simple payload class that can be wrapped for reading and writing.

Constructor & Destructor Documentation

◆ RootMaterialTrackIo()

ActsPlugins::RootMaterialTrackIo::RootMaterialTrackIo ( const Config & cfg)
explicit

Constructor from config struct.

Parameters
cfgthe configuration for the accessor

◆ ~RootMaterialTrackIo()

ActsPlugins::RootMaterialTrackIo::~RootMaterialTrackIo ( )
default

Destructor.

Member Function Documentation

◆ connectForRead()

void ActsPlugins::RootMaterialTrackIo::connectForRead ( TChain & materialChain)

sets the branch connection for reading from a file

Parameters
materialChainthe TChain to read the material track from

◆ connectForWrite()

void ActsPlugins::RootMaterialTrackIo::connectForWrite ( TTree & materialTree)

sets the branch connection for writing to a file

Parameters
materialTreethe TTree to write the material track to

◆ read()

Acts::RecordedMaterialTrack ActsPlugins::RootMaterialTrackIo::read ( ) const

Read the material track from the tree.

Note
the caller has to do the TChain::GetEntry() before this call
Returns
the material track

◆ write()

void ActsPlugins::RootMaterialTrackIo::write ( const Acts::GeometryContext & gctx,
std::uint32_t eventNum,
const Acts::RecordedMaterialTrack & materialTrack )

Write the material track to the tree.

Parameters
gctxthe geometry context
eventNumthe event number to write
materialTrackthe material track to be written out
Note
the caller has to do the TTree::Fill() after this call