Project
Loading...
Searching...
No Matches
o2::framework::GenericRootTreeReader< KeyType > Class Template Reference

#include <RootTreeReader.h>

Classes

class  BranchConfigurationElement
 
class  BranchConfigurationInterface
 
struct  BranchDefinition
 
struct  ConstructorArg
 helper structure to hold the constructor arguments for BranchConfigurationElement stages More...
 
struct  SpecialPublishHook
 

Public Types

enum struct  PublishingMode { Single , Loop }
 Publishing mode determines what to do when the number of entries in the tree is reached. More...
 
using self_type = GenericRootTreeReader< KeyType >
 
using key_type = KeyType
 
using BinaryDataStoreType = std::vector< char >
 
using ConstructorArgs = std::vector< ConstructorArg >
 
using ROOTSerializedByClass = o2::framework::ROOTSerialized< char, TClass >
 

Public Member Functions

 GenericRootTreeReader ()
 default constructor
 
template<typename... Args>
 GenericRootTreeReader (const char *treename, Args &&... args)
 
void addFile (const char *fileName)
 add a file as source for the tree
 
bool next ()
 
self_typeoperator++ ()
 prefix increment, move to the next entry
 
self_typeoperator++ (int)=delete
 postfix increment forbidden
 
template<typename ContextType , typename... HeaderTypes>
bool operator() (ContextType &context, HeaderTypes &&... headers) const
 
int getCount () const
 return the number of published entries
 

Detailed Description

template<typename KeyType>
class o2::framework::GenericRootTreeReader< KeyType >

Definition at line 141 of file RootTreeReader.h.

Member Typedef Documentation

◆ BinaryDataStoreType

template<typename KeyType >
using o2::framework::GenericRootTreeReader< KeyType >::BinaryDataStoreType = std::vector<char>

Definition at line 149 of file RootTreeReader.h.

◆ ConstructorArgs

template<typename KeyType >
using o2::framework::GenericRootTreeReader< KeyType >::ConstructorArgs = std::vector<ConstructorArg>

Definition at line 188 of file RootTreeReader.h.

◆ key_type

template<typename KeyType >
using o2::framework::GenericRootTreeReader< KeyType >::key_type = KeyType

Definition at line 145 of file RootTreeReader.h.

◆ ROOTSerializedByClass

template<typename KeyType >
using o2::framework::GenericRootTreeReader< KeyType >::ROOTSerializedByClass = o2::framework::ROOTSerialized<char, TClass>

the type wrapper to mark the data to be ROOT serialized, object is passed by not-type-aware char*, and the actual class info is provided.

Definition at line 448 of file RootTreeReader.h.

◆ self_type

template<typename KeyType >
using o2::framework::GenericRootTreeReader< KeyType >::self_type = GenericRootTreeReader<KeyType>

Definition at line 144 of file RootTreeReader.h.

Member Enumeration Documentation

◆ PublishingMode

template<typename KeyType >
enum struct o2::framework::GenericRootTreeReader::PublishingMode
strong

Publishing mode determines what to do when the number of entries in the tree is reached.

Enumerator
Single 

no more data after end of tree

Loop 

start over at entry 0

Definition at line 152 of file RootTreeReader.h.

Constructor & Destructor Documentation

◆ GenericRootTreeReader() [1/2]

template<typename KeyType >
o2::framework::GenericRootTreeReader< KeyType >::GenericRootTreeReader ( )

default constructor

◆ GenericRootTreeReader() [2/2]

template<typename KeyType >
template<typename... Args>
o2::framework::GenericRootTreeReader< KeyType >::GenericRootTreeReader ( const char treename,
Args &&...  args 
)
inline

constructor

Parameters
treenamename of tree to process variable argument list of file names (const char*), the number of entries to publish (int), or the publishing mode, followed by pairs of KeyType and branch name

Definition at line 395 of file RootTreeReader.h.

Member Function Documentation

◆ addFile()

template<typename KeyType >
void o2::framework::GenericRootTreeReader< KeyType >::addFile ( const char fileName)
inline

add a file as source for the tree

Definition at line 405 of file RootTreeReader.h.

◆ getCount()

template<typename KeyType >
int o2::framework::GenericRootTreeReader< KeyType >::getCount ( ) const
inline

return the number of published entries

Definition at line 474 of file RootTreeReader.h.

◆ next()

template<typename KeyType >
bool o2::framework::GenericRootTreeReader< KeyType >::next ( )
inline

move to the next entry

Returns
true if data is available

Definition at line 413 of file RootTreeReader.h.

◆ operator()()

template<typename KeyType >
template<typename ContextType , typename... HeaderTypes>
bool o2::framework::GenericRootTreeReader< KeyType >::operator() ( ContextType &  context,
HeaderTypes &&...  headers 
) const
inline

process functor It expects a context which is used by lambda capture in the snapshot function. Loop over all branch definitions and publish by using the snapshot function. The default forwards to DPL DataAllocator snapshot.

Note: For future extension we probably get rid of the context and want to use o2::snapshot, can be easily adjusted by exchanging the lambda.

Definition at line 458 of file RootTreeReader.h.

◆ operator++() [1/2]

template<typename KeyType >
self_type & o2::framework::GenericRootTreeReader< KeyType >::operator++ ( )
inline

prefix increment, move to the next entry

Definition at line 438 of file RootTreeReader.h.

◆ operator++() [2/2]

template<typename KeyType >
self_type & o2::framework::GenericRootTreeReader< KeyType >::operator++ ( int  )
delete

postfix increment forbidden


The documentation for this class was generated from the following file: