Logo ROOT   6.12/07
Reference Guide
TTrivialDS.hxx
Go to the documentation of this file.
1 #ifndef ROOT_TTRIVIALTDS
2 #define ROOT_TTRIVIALTDS
3 
4 #include "ROOT/TDataFrame.hxx"
5 #include "ROOT/TDataSource.hxx"
6 
7 namespace ROOT {
8 namespace Experimental {
9 namespace TDF {
10 
12 private:
13  unsigned int fNSlots = 0U;
14  ULong64_t fSize = 0ULL;
15  std::vector<std::pair<ULong64_t, ULong64_t>> fEntryRanges;
16  std::vector<std::string> fColNames{"col0"};
17  std::vector<ULong64_t> fCounter;
18  std::vector<ULong64_t *> fCounterAddr;
19  std::vector<void *> GetColumnReadersImpl(std::string_view name, const std::type_info &);
20 
21 public:
22  TTrivialDS(ULong64_t size);
23  ~TTrivialDS();
24  const std::vector<std::string> &GetColumnNames() const;
25  bool HasColumn(std::string_view colName) const;
26  std::string GetTypeName(std::string_view) const;
27  std::vector<std::pair<ULong64_t, ULong64_t>> GetEntryRanges();
28  void SetEntry(unsigned int slot, ULong64_t entry);
29  void SetNSlots(unsigned int nSlots);
30  void Initialise();
31 };
32 
34 
35 } // ns TDF
36 } // ns Experimental
37 } // ns ROOT
38 
39 #endif
std::string GetTypeName(std::string_view) const
Type of a column as a string, e.g.
Definition: TTrivialDS.cxx:42
basic_string_view< char > string_view
Definition: RStringView.h:35
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
std::vector< ULong64_t * > fCounterAddr
Definition: TTrivialDS.hxx:18
std::vector< std::pair< ULong64_t, ULong64_t > > fEntryRanges
Definition: TTrivialDS.hxx:15
const std::vector< std::string > & GetColumnNames() const
Returns a reference to the collection of the dataset&#39;s column names.
Definition: TTrivialDS.cxx:32
void SetNSlots(unsigned int nSlots)
Inform TDataSource of the number of processing slots (i.e.
Definition: TTrivialDS.cxx:58
TDataSource defines an API that TDataFrame can use to read arbitrary data formats.
Definition: TDataSource.hxx:51
void SetEntry(unsigned int slot, ULong64_t entry)
Advance the "cursors" returned by GetColumnReaders to the selected entry for a particular slot...
Definition: TTrivialDS.cxx:53
std::vector< std::pair< ULong64_t, ULong64_t > > GetEntryRanges()
Return ranges of entries to distribute to tasks.
Definition: TTrivialDS.cxx:47
std::vector< std::string > fColNames
Definition: TTrivialDS.hxx:16
std::vector< ULong64_t > fCounter
Definition: TTrivialDS.hxx:17
void Initialise()
Convenience method called before starting an event-loop.
Definition: TTrivialDS.cxx:67
TDataFrame MakeTrivialDataFrame(ULong64_t size)
Definition: TTrivialDS.cxx:82
bool HasColumn(std::string_view colName) const
Checks if the dataset has a certain column.
Definition: TTrivialDS.cxx:37
unsigned long long ULong64_t
Definition: RtypesCore.h:70
ROOT&#39;s TDataFrame offers a high level interface for analyses of data stored in TTrees.
Definition: TDataFrame.hxx:39
std::vector< void * > GetColumnReadersImpl(std::string_view name, const std::type_info &)
type-erased vector of pointers to pointers to column values - one per slot
Definition: TTrivialDS.cxx:10
char name[80]
Definition: TGX11.cxx:109