11#ifndef ROOT_RDF_RTREECOLUMNREADER
12#define ROOT_RDF_RTREECOLUMNREADER
71 bool fCopyWarningPrinted =
false;
75 if (entry == fLastEntry)
78 auto &readerArray = *fTreeArray;
83 const auto readerArraySize = readerArray.GetSize();
84 if (EStorageType::kUnknown == fStorageType && readerArraySize > 1) {
86 fStorageType = EStorageType::kContiguous;
87 for (
auto i = 0u; i < readerArraySize - 1; ++i) {
88 if ((
char *)&readerArray[i + 1] - (
char *)&readerArray[i] !=
sizeof(T)) {
89 fStorageType = EStorageType::kSparse;
95 if (EStorageType::kContiguous == fStorageType ||
96 (EStorageType::kUnknown == fStorageType && readerArray.GetSize() < 2)) {
97 if (readerArraySize > 0) {
101 auto readerArrayAddr = &readerArray.At(0);
102 RVec<T> rvec(readerArrayAddr, readerArraySize);
106 swap(fRVec, emptyVec);
111 if (!fCopyWarningPrinted) {
112 Warning(
"RTreeColumnReader::Get",
113 "Branch %s hangs from a non-split branch. A copy is being performed in order "
114 "to properly read the content.",
115 readerArray.GetBranchName());
116 fCopyWarningPrinted =
true;
119 (void)fCopyWarningPrinted;
121 if (readerArraySize > 0) {
122 RVec<T> rvec(readerArray.begin(), readerArray.end());
126 swap(fRVec, emptyVec);
161 auto &readerArray = *fTreeArray;
162 const auto readerArraySize = readerArray.GetSize();
163 if (readerArraySize > 0) {
165 RVec<bool> rvec(readerArray.begin(), readerArray.end());
169 swap(fRVec, emptyVec);
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
void * GetImpl(Long64_t entry) final
std::unique_ptr< TTreeReaderArray< T > > fTreeArray
RTreeColumnReader(TTreeReader &r, const std::string &colName)
EStorageType
Enumerator for the memory layout of the branch.
~RTreeColumnReader() override
See the other class template specializations for an explanation.
RVec< T > fRVec
We return a reference to this RVec to clients, to guarantee a stable address and contiguous memory la...
RVec< bool > fRVec
We return a reference to this RVec to clients, to guarantee a stable address and contiguous memory la...
~RTreeColumnReader() override
See the other class template specializations for an explanation.
std::unique_ptr< TTreeReaderArray< bool > > fTreeArray
RTreeColumnReader(TTreeReader &r, const std::string &colName)
void * GetImpl(Long64_t) final
RTreeColumnReader specialization for TTree values read via TTreeReaderValues.
RTreeColumnReader(TTreeReader &r, const std::string &colName)
Construct the RTreeColumnReader. Actual initialization is performed lazily by the Init method.
void * GetImpl(Long64_t) final
~RTreeColumnReader() override
The dtor resets the TTreeReaderValue object.
std::unique_ptr< TTreeReaderValue< T > > fTreeValue
A "std::vector"-like collection of values implementing handy operation to analyse them.
An interface for reading collections stored in ROOT columnar datasets.
An interface for reading values stored in ROOT columnar datasets.
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.