12#ifndef ROOT_TTreeReaderValue
13#define ROOT_TTreeReaderValue
76 template <BranchProxyRead_t Func>
132 friend class ::TTreeReader;
147 TTreeReaderValueBase(&tr, branchname,
157 Error(
"TTreeReaderValue::Get()",
"Value reader not properly initialized, did you remember to call TTreeReader.Set(Next)Entry()?");
161 return fProxy->IsaPointer() ? *(
T**)address : (
T*)address; }
175 return sElementTypeName.data();
void Error(const char *location, const char *msgfmt,...)
Base class for all the proxy object.
Base class of TTreeReaderValue.
void RegisterWithTreeReader()
Register with tree reader.
@ kSetupMatchBranch
This branch has been set up, branch data type and reader template type match, reading should succeed.
@ kSetupInternalError
The specified branch cannot be found.
@ kSetupMissingBranch
The array cannot find its counter branch: Array[CounterBranch].
@ kSetupMakeClassModeMismatch
The TTreeReader has been destructed / not set.
@ kSetupNotACollection
Mismatch of branch type and reader template type.
@ kSetupMissingDictionary
Some other error - hopefully the error message helps.
@ kSetupMissingCounterBranch
@ kSetupMismatch
To read this branch, we need a dictionary.
@ kSetupTreeDestructed
No initialization has happened yet.
@ kSetupMatch
The branch class type is not a collection.
@ kSetupNoCheck
This branch has been set up, branch data type and reader template type match, reading should succeed.
ESetupStatus GetSetupStatus() const
Read_t fProxyReadFunc
! Pointer to the Read implementation to use.
EReadStatus(TTreeReaderValueBase::* Read_t)()
void NotifyNewTree(TTree *newTree)
The TTreeReader has switched to a new TTree. Update the leaf.
void MarkTreeReaderUnavailable()
Detail::TBranchProxy * GetProxy() const
void * GetAddress()
Returns the memory address of the object being read.
static std::string GetElementTypeName(const std::type_info &ti)
Stringify the template argument.
ESetupStatus fSetupStatus
virtual const char * GetDerivedTypeName() const =0
TTreeReaderValueBase(TTreeReader *reader, const char *branchname, TDictionary *dict)
Construct a tree value reader and register it with the reader object.
Bool_t(ROOT::Detail::TBranchProxy::* BranchProxyRead_t)()
ROOT::Internal::TTreeReaderValueBase::EReadStatus ProxyReadTemplate()
Try to read the value from the TBranchProxy, returns the status of the read.
TTreeReader * fTreeReader
TTreeReaderValueBase & operator=(const TTreeReaderValueBase &)
Copy-assign.
const char * GetBranchName() const
TLeaf * GetLeaf()
If we are reading a leaf, return the corresponding TLeaf.
virtual ~TTreeReaderValueBase()
Unregister from tree reader, cleanup.
EReadStatus ProxyReadDefaultImpl()
virtual void CreateProxy()
Create the proxy object for our branch.
int fHaveStaticClassOffsets
virtual EReadStatus GetReadStatus() const
Detail::TBranchProxy * fProxy
std::vector< Long64_t > fStaticClassOffsets
TBranch * SearchBranchWithCompositeName(TLeaf *&myleaf, TDictionary *&branchActualType, std::string &err)
Search a branch the name of which contains a ".".
static const char * GetBranchDataType(TBranch *branch, TDictionary *&dict, TDictionary const *curDict)
Retrieve the type of data stored by branch; put its dictionary into dict, return its type name.
A Branch for the case of an object.
A TTree is a list of TBranches.
This class defines an abstract interface that must be implemented by all classes that contain diction...
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
An interface for reading values stored in ROOT columnar datasets.
T * operator->()
Return a pointer to the value of the current entry.
TTreeReaderValue()=delete
T * Get()
Return a pointer to the value of the current entry.
virtual const char * GetDerivedTypeName() const
Get the template argument as a string.
TTreeReaderValue(TTreeReader &tr, const char *branchname)
T & operator*()
Return a reference to the value of the current entry.
typename std::remove_const< T >::type NonConstT_t
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
A TTree represents a columnar dataset.