RDFAnalysis  0.1.1
Physics analysis with ROOT::RDataFrame
OutputWriter< Detail > Class Template Reference

Class to write out objects from an RDFAnalysis. More...

#include <OutputWriter.h>

Public Types

using detail_t = Detail
 The node detail type we're templated on. More...
 

Public Member Functions

 OutputWriter (const std::shared_ptr< TDirectory > &directory)
 Create the writer. More...
 
 OutputWriter (const std::string &fileName, bool overwrite=false)
 Create the writer, opening a file to do it. More...
 
void write (Node< Detail > &node)
 Write information from the given node and all downstream. More...
 
void write (Scheduler< Detail > &scheduler)
 Write information from the regions defined by a scheduler. More...
 
void write (std::map< std::string, typename Scheduler< Detail >::Region > &regions)
 Write information from list of named nodes. More...
 
void addWriter (const std::shared_ptr< INodeWriter< Detail >> &writer)
 Add a writer. More...
 
template<typename T >
std::enable_if_t< std::is_base_of< INodeWriter< Detail >, T >{}, void > addWriter (T &&writer)
 Add a writer. More...
 
template<template< class > class T, typename... Args>
std::enable_if_t< std::is_base_of< INodeWriter< Detail >, T< Detail > >{}, void > addWriter (Args &&...args)
 Add a writer. More...
 
std::vector< std::shared_ptr< INodeWriter< Detail > > > & writers ()
 Get the writers. More...
 
const std::vector< std::shared_ptr< INodeWriter< Detail > > > & writers () const
 Get the writers. More...
 

Detailed Description

template<typename Detail>
class RDFAnalysis::OutputWriter< Detail >

Class to write out objects from an RDFAnalysis.

Each named filter in the graph is represented by a folder in the output file. This class only takes care of creating the folder structure, it receives other INodeWriter objects that create the output from any individual node.

Member Typedef Documentation

using detail_t = Detail

The node detail type we're templated on.

Constructor & Destructor Documentation

OutputWriter ( const std::shared_ptr< TDirectory > &  directory)

Create the writer.

Parameters
directoryThe directory to write into
OutputWriter ( const std::string &  fileName,
bool  overwrite = false 
)

Create the writer, opening a file to do it.

Parameters
fileNameThe file to create
overwriteWhether or not to overwrite the output file.

Member Function Documentation

void addWriter ( const std::shared_ptr< INodeWriter< Detail >> &  writer)
inline

Add a writer.

std::enable_if_t<std::is_base_of<INodeWriter<Detail>, T>{}, void> addWriter ( T &&  writer)
inline

Add a writer.

std::enable_if_t<std::is_base_of<INodeWriter<Detail>, T<Detail> >{}, void> addWriter ( Args &&...  args)
inline

Add a writer.

Template Parameters
TThe type of writer to add
ArgsThe types of arguments for the writer constructor
Parameters
argsThe arguments for the constructor.

This version constructs the writer in place. The writer type T will be templated on the right Detail class.

void write ( Node< Detail > &  node)
inline

Write information from the given node and all downstream.

Parameters
nodeThe node to write from
void write ( Scheduler< Detail > &  scheduler)
inline

Write information from the regions defined by a scheduler.

Parameters
schedulerThe scheduler to read from
void write ( std::map< std::string, typename Scheduler< Detail >::Region > &  regions)

Write information from list of named nodes.

Parameters
regionsMapping of output directory names to nodes
std::vector<std::shared_ptr<INodeWriter<Detail> > >& writers ( )
inline

Get the writers.

const std::vector<std::shared_ptr<INodeWriter<Detail> > >& writers ( ) const
inline

Get the writers.


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