RDFAnalysis  0.1.1
Physics analysis with ROOT::RDataFrame
SysResultPtr< T > Class Template Reference

Class to wrap together RResultPtrs for different systematic variations. More...

#include <SysResultPtr.h>

Public Member Functions

 SysResultPtr (const std::string &nominalName)
 Create the result. More...
 
template<typename U , typename = std::enable_if_t<std::is_base_of<T, U>{} || std::is_same<T, U>{}, void>>
 SysResultPtr (const std::string &nominalName, const std::map< std::string, ROOT::RDF::RResultPtr< U >> &resultMap)
 Create the result from an existing map. More...
 
auto begin ()
 Iterator to the start of the underlying map. More...
 
auto begin () const
 Const iterator to the start of the underlying map. More...
 
auto end ()
 Iterator to the end of the underlying map. More...
 
auto end () const
 Const iterator to the end of the underlying map. More...
 
std::size_t size () const
 Size of the map (i.e. the number of systematics affecting this result) More...
 
void setMap (const std::map< std::string, ResultWrapper< T >> &newMap)
 Set from a map. More...
 
void reset ()
 Reset all results. More...
 
T * get (const std::string &syst)
 Get the result pointed to. More...
 
bool addResult (const std::string &systematic, const ResultWrapper< T > &result)
 Add the result wrapper for a given systematic. More...
 
template<typename U , typename = std::enable_if_t<std::is_base_of<T, U>{}, void>>
 SysResultPtr (const SysResultPtr< U > &other)
 Allow type conversions in copy construction. More...
 
 operator bool () const
 Allow conversion to bool - returns true if anything is filled. More...
 

Friends

template<typename U >
class SysResultPtr
 

Detailed Description

template<typename T>
class RDFAnalysis::SysResultPtr< T >

Class to wrap together RResultPtrs for different systematic variations.

Template Parameters
TThe type held by the RResultPtrs

This class acts as a specialised map class holding result pointers corresponding to systematic variations of the same quantity. If a systematic variation is requested that does not affect this variable the nominal is returned.

Constructor & Destructor Documentation

SysResultPtr ( const std::string &  nominalName)
inline

Create the result.

Parameters
nominalNameThe name of the nominal variation
SysResultPtr ( const std::string &  nominalName,
const std::map< std::string, ROOT::RDF::RResultPtr< U >> &  resultMap 
)
inline

Create the result from an existing map.

Template Parameters
Thetype of the result ptr
Parameters
nominalNameThe name of the nominal variation
resultMapMap of systematics to RResultPtrs
SysResultPtr ( const SysResultPtr< U > &  other)
inline

Allow type conversions in copy construction.

Template Parameters
UThe held type of the other object
Parameters
otherThe object to copy

Member Function Documentation

bool addResult ( const std::string &  systematic,
const ResultWrapper< T > &  result 
)
inline

Add the result wrapper for a given systematic.

Parameters
systematicThe variation to add
resultThe result to add.
Returns
if a new result was provided
auto begin ( )
inline

Iterator to the start of the underlying map.

auto begin ( ) const
inline

Const iterator to the start of the underlying map.

auto end ( )
inline

Iterator to the end of the underlying map.

auto end ( ) const
inline

Const iterator to the end of the underlying map.

T* get ( const std::string &  syst)
inline

Get the result pointed to.

Parameters
systThe variation to retrieve If the variation doesn't exist then return the nominal.
operator bool ( ) const
inline

Allow conversion to bool - returns true if anything is filled.

void reset ( )
inline

Reset all results.

void setMap ( const std::map< std::string, ResultWrapper< T >> &  newMap)
inline

Set from a map.

std::size_t size ( ) const
inline

Size of the map (i.e. the number of systematics affecting this result)

Friends And Related Function Documentation

friend class SysResultPtr
friend

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