fire v0.19.0
Framework for sImulation and Reconstruction of Events
fire::io Namespace Reference

Geant4 does a GLOBAL definition of the keyword TRUE. More...

Namespaces

namespace  class_version_impl
 hide the SFINAE confusing nonsense from the rest of the world
 
namespace  root
 Reading of ROOT TTree files generated by ROOT-based Framework.
 

Classes

class  AbstractData
 Type-specific base class to hold common data methods. More...
 
struct  access
 empty struct for connecting a instance of Data and the type it wraps More...
 
class  BaseData
 Empty data base allowing recursion. More...
 
struct  constants
 Structure constants vital to serialization method. More...
 
class  Data
 General data set. More...
 
class  Data< AtomicType, std::enable_if_t< is_atomic_v< AtomicType > > >
 Data wrapper for atomic types. More...
 
class  Data< ParameterStorage >
 io::Data specialization for ParameterStorage More...
 
class  Data< std::map< KeyType, ValType > >
 Our wrapper around std::map. More...
 
class  Data< std::vector< ContentType > >
 Our wrapper around std::vector. More...
 
class  ParameterStorage
 Provides dynamic parameter storage by interfacing between a map to variants storing parameters and a h5::Data secialization. More...
 
class  Reader
 Prototype for reading files within fire. More...
 
class  Writer
 Write the fire DataSets into a deterministic structure in the output HDF5 data file. More...
 

Typedefs

template<typename AtomicType >
using is_atomic = std::integral_constant< bool, std::is_arithmetic< AtomicType >::value||std::is_same< AtomicType, std::string >::value >
 HighFive supports many C++ "atomic" types that are used regularly. More...
 

Enumerations

enum class  Bool : bool { TRUE = true , FALSE = false }
 Boolean enum aligned with h5py. More...
 

Functions

HighFive::EnumType< Boolcreate_enum_bool ()
 HighFive method for creating the enum data type.
 
std::unique_ptr< io::Readeropen (const std::string &fp)
 open an input file for reading More...
 

Variables

template<typename AtomicType >
constexpr bool is_atomic_v = is_atomic<AtomicType>::value
 shorthand for easier use
 
template<typename T >
constexpr int class_version = class_version_impl::deducer<T>::version::value
 Helper const expression to pull out class version number. More...
 

Detailed Description

Geant4 does a GLOBAL definition of the keyword TRUE.

Disk input/output namespace.

serialization to and from HDF5 files

Isolation of lower-level interaction with HDF5 files is done here. These classes should never be used directly by the end user except for the attaching-method of defining new serializable types as described in Getting Started.

Access Pattern

Below is a sketch of how the various fire::io::Data template classes interact with each other and the broader fire ecosystem.

Typedef Documentation

◆ is_atomic

template<typename AtomicType >
using fire::io::is_atomic = typedef std::integral_constant<bool, std::is_arithmetic<AtomicType>::value || std::is_same<AtomicType, std::string>::value>

HighFive supports many C++ "atomic" types that are used regularly.

In order to conform to our more flexible structure, I have isolated their deduction into this (currently small) header file.

This will make it easier to fold in future atomic types if we see fit.

Enumeration Type Documentation

◆ Bool

enum class fire::io::Bool : bool
strong

Boolean enum aligned with h5py.

We serialize bools in the same method as h5py so that Python-based analyses are easier.

Function Documentation

◆ open()

std::unique_ptr< io::Reader > fire::io::open ( const std::string fp)

open an input file for reading

Note
We determine the type of input file to open from the extension of the file name. We could implement a "header reading" but that is harder to develop compared to a relatively simple requirement that almost everyone already follows.
Exceptions
fire::Exceptionif the file does not have a recognized extension.
See also
fire::factory::Factory::make for how the readers are constructed

Recognized Extensions

Parameters
[in]fpfile path to file to open
Returns
pointer to io::Reader that has opened file

Variable Documentation

◆ class_version

template<typename T >
constexpr int fire::io::class_version = class_version_impl::deducer<T>::version::value
inlineconstexpr

Helper const expression to pull out class version number.

Assuming T::version is an std::integral_constant (same as the default template struct), we simply pull out that integral_constant value from class_version_impl::deducer.

Template Parameters

in] T class to deduce version for