Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Internal::RDF::RBranchData Struct Reference

Stores properties of each output branch in a Snapshot.

Definition at line 102 of file SnapshotHelpers.hxx.

Classes

struct  EmptyDynamicType
 Stores empty instances of classes, so a dummy object can be written when a systematic variation doesn't pass a selection cut. More...
 
struct  FundamentalType
 Stores variations of a fundamental type. More...
 

Public Member Functions

 RBranchData ()=default
 
 RBranchData (std::string inputBranchName, std::string outputBranchName, bool isDefine, const std::type_info *typeID)
 
void ClearBranchContents ()
 Point the branch address to an empty instance of the type represented by this branch or write null bytes into the space used by the fundamental type.
 
void ClearBranchPointers ()
 
void * EmptyInstance (bool pointerToPointer)
 Return a pointer to an empty instance of the type represented by this branch.
 
bool WriteValueIfFundamental (void *valuePtr)
 For fundamental types represented by TDataType, fetch a value from the pointer into the local branch buffer.
 

Public Attributes

void * fBranchAddressForCArrays = nullptr
 
std::string fInputBranchName
 
const std::type_info * fInputTypeID = nullptr
 
bool fIsCArray = false
 
bool fIsDefine = false
 
TBranchfOutputBranch = nullptr
 
std::string fOutputBranchName
 
std::variant< FundamentalType, EmptyDynamicTypefTypeData = FundamentalType{0}
 
int fVariationIndex = -1
 

#include <ROOT/RDF/SnapshotHelpers.hxx>

Constructor & Destructor Documentation

◆ RBranchData() [1/2]

ROOT::Internal::RDF::RBranchData::RBranchData ( )
default

◆ RBranchData() [2/2]

ROOT::Internal::RDF::RBranchData::RBranchData ( std::string inputBranchName,
std::string outputBranchName,
bool isDefine,
const std::type_info * typeID )

Definition at line 369 of file RDFSnapshotHelpers.cxx.

Member Function Documentation

◆ ClearBranchContents()

void ROOT::Internal::RDF::RBranchData::ClearBranchContents ( )

Point the branch address to an empty instance of the type represented by this branch or write null bytes into the space used by the fundamental type.

This is used in case of variations, when certain defines/actions don't execute. We nevertheless need to write something, so we point the branch to an empty instance.

Definition at line 419 of file RDFSnapshotHelpers.cxx.

◆ ClearBranchPointers()

void ROOT::Internal::RDF::RBranchData::ClearBranchPointers ( )
inline

Definition at line 134 of file SnapshotHelpers.hxx.

◆ EmptyInstance()

void * ROOT::Internal::RDF::RBranchData::EmptyInstance ( bool pointerToPointer)

Return a pointer to an empty instance of the type represented by this branch.

For fundamental types, this is simply an 8-byte region of zeroes. For classes, it is an instance created with TClass::New.

Parameters
pointerToPointerReturn a pointer to a pointer, so it can be used directly in TTree::SetBranchAddress().

Definition at line 388 of file RDFSnapshotHelpers.cxx.

◆ WriteValueIfFundamental()

bool ROOT::Internal::RDF::RBranchData::WriteValueIfFundamental ( void * valuePtr)
inline

For fundamental types represented by TDataType, fetch a value from the pointer into the local branch buffer.

If the branch holds a class type, nothing happens.

Returns
true if the branch holds a fundamental type, false if it holds a class type.

Definition at line 144 of file SnapshotHelpers.hxx.

Member Data Documentation

◆ fBranchAddressForCArrays

void* ROOT::Internal::RDF::RBranchData::fBranchAddressForCArrays = nullptr

Definition at line 124 of file SnapshotHelpers.hxx.

◆ fInputBranchName

std::string ROOT::Internal::RDF::RBranchData::fInputBranchName

Definition at line 120 of file SnapshotHelpers.hxx.

◆ fInputTypeID

const std::type_info* ROOT::Internal::RDF::RBranchData::fInputTypeID = nullptr

Definition at line 122 of file SnapshotHelpers.hxx.

◆ fIsCArray

bool ROOT::Internal::RDF::RBranchData::fIsCArray = false

Definition at line 128 of file SnapshotHelpers.hxx.

◆ fIsDefine

bool ROOT::Internal::RDF::RBranchData::fIsDefine = false

Definition at line 129 of file SnapshotHelpers.hxx.

◆ fOutputBranch

TBranch* ROOT::Internal::RDF::RBranchData::fOutputBranch = nullptr

Definition at line 123 of file SnapshotHelpers.hxx.

◆ fOutputBranchName

std::string ROOT::Internal::RDF::RBranchData::fOutputBranchName

Definition at line 121 of file SnapshotHelpers.hxx.

◆ fTypeData

std::variant<FundamentalType, EmptyDynamicType> ROOT::Internal::RDF::RBranchData::fTypeData = FundamentalType{0}

Definition at line 127 of file SnapshotHelpers.hxx.

◆ fVariationIndex

int ROOT::Internal::RDF::RBranchData::fVariationIndex = -1

Definition at line 126 of file SnapshotHelpers.hxx.

Collaboration diagram for ROOT::Internal::RDF::RBranchData:
[legend]

The documentation for this struct was generated from the following files: