11#ifndef ROOT_RDATASOURCE
12#define ROOT_RDATASOURCE
25#include <unordered_map>
40namespace Experimental {
98 const std::unordered_map<std::string, ROOT::RDF::Experimental::RSample *> &
sampleMap);
101std::unique_ptr<ROOT::Detail::RDF::RColumnReaderBase>
148 virtual std::string
AsString() {
return "generic data source"; };
160 friend const std::vector<std::string> &
172 const std::unordered_map<std::string, ROOT::RDF::Experimental::RSample *> &);
174 CreateSampleInfo(
const std::unordered_map<std::string, ROOT::RDF::Experimental::RSample *> &)
const;
182 friend std::unique_ptr<ROOT::Detail::RDF::RColumnReaderBase>
197 virtual std::unique_ptr<ROOT::Detail::RDF::RColumnReaderBase>
250 template <
typename T>
256 [](
void *
p) { return static_cast<T **>(p); });
265 virtual std::unique_ptr<ROOT::Detail::RDF::RColumnReaderBase>
326 virtual std::string
GetLabel() {
return "Custom Datasource"; }
348 return ds->AsString();
unsigned long long ULong64_t
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
The head node of a RDF computation graph.
Mother class of TTypedPointerHolder.
virtual ~TPointerHolder()
virtual TPointerHolder * GetDeepCopy()=0
TPointerHolder(void *ptr)
Class to wrap a pointer and delete the memory associated to it correctly.
TTypedPointerHolder(T *ptr)
TPointerHolder * GetDeepCopy() final
RDataSource defines an API that RDataFrame can use to read arbitrary data formats.
RDataSource(RDataSource &&)=delete
RDataSource(const RDataSource &)=delete
RDataSource & operator=(const RDataSource &)=delete
virtual bool HasColumn(std::string_view colName) const =0
Checks if the dataset has a certain column.
virtual void Finalize()
Convenience method called after concluding an event-loop.
virtual void InitSlot(unsigned int, ULong64_t)
Convenience method called at the start of the data processing associated to a slot.
virtual std::unique_ptr< ROOT::Detail::RDF::RColumnReaderBase > CreateColumnReader(unsigned int slot, std::string_view col, const std::type_info &tid, TTreeReader *)
Creates a column reader for the requested column.
virtual std::string DescribeDataset()
virtual const std::vector< std::string > & GetColumnNamesNoDuplicates() const
virtual void FinalizeSlot(unsigned int)
Convenience method called at the end of the data processing associated to a slot.
virtual ~RDataSource()=default
virtual std::string AsString()
friend ROOT::RDF::RSampleInfo ROOT::Internal::RDF::CreateSampleInfo(const ROOT::RDF::RDataSource &, const std::unordered_map< std::string, ROOT::RDF::Experimental::RSample * > &)
virtual bool SetEntry(unsigned int slot, ULong64_t entry)=0
Advance the "cursors" returned by GetColumnReaders to the selected entry for a particular slot.
virtual std::string GetTypeNameWithOpts(std::string_view colName, bool) const
virtual void SetNSlots(unsigned int nSlots)
Inform RDataSource of the number of processing slots (i.e.
std::vector< void * > Record_t
virtual std::string GetLabel()
Return a string representation of the datasource type.
virtual std::size_t GetNFiles() const
Returns the number of files from which the dataset is constructed.
virtual const std::vector< std::string > & GetColumnNames() const =0
Returns a reference to the collection of the dataset's column names.
virtual const std::vector< std::string > & GetTopLevelFieldNames() const
virtual void InitializeWithOpts(const std::set< std::string > &)
friend void ROOT::Internal::RDF::ProcessMT(RDataSource &, ROOT::Detail::RDF::RLoopManager &)
virtual std::vector< std::pair< ULong64_t, ULong64_t > > GetEntryRanges()=0
Return ranges of entries to distribute to tasks.
RDataSource & operator=(RDataSource &&)=delete
virtual Record_t GetColumnReadersImpl(std::string_view name, const std::type_info &)=0
type-erased vector of pointers to pointers to column values - one per slot
virtual std::string GetTypeName(std::string_view colName) const =0
Type of a column as a string, e.g.
std::vector< T ** > GetColumnReaders(std::string_view columnName)
Called at most once per column by RDF.
virtual std::unique_ptr< ROOT::Detail::RDF::RColumnReaderBase > GetColumnReaders(unsigned int, std::string_view, const std::type_info &)
If the other GetColumnReaders overload returns an empty vector, this overload will be called instead.
virtual void SetGlobalEntryRange(std::pair< ULong64_t, ULong64_t > entryRange)
Restrict processing to a [begin, end) range of entries.
virtual void Initialize()
Convenience method called before starting an event-loop.
std::optional< std::pair< ULong64_t, ULong64_t > > fGlobalEntryRange
virtual void RunFinalChecks(bool) const
This type represents a sample identifier, to be used in conjunction with RDataFrame features such as ...
const_iterator begin() const
const_iterator end() const
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
void RunFinalChecks(const ROOT::RDF::RDataSource &ds, bool nodesLeftNotRun)
void CallInitializeWithOpts(ROOT::RDF::RDataSource &ds, const std::set< std::string > &suppressErrorsForMissingColumns)
const std::vector< std::string > & GetTopLevelFieldNames(const ROOT::RDF::RDataSource &ds)
std::string DescribeDataset(ROOT::RDF::RDataSource &ds)
ROOT::RDF::RSampleInfo CreateSampleInfo(const ROOT::RDF::RDataSource &ds, const std::unordered_map< std::string, ROOT::RDF::Experimental::RSample * > &sampleMap)
std::unique_ptr< ROOT::Detail::RDF::RColumnReaderBase > CreateColumnReader(ROOT::RDF::RDataSource &ds, unsigned int slot, std::string_view col, const std::type_info &tid, TTreeReader *treeReader)
void ProcessMT(ROOT::RDF::RDataSource &ds, ROOT::Detail::RDF::RLoopManager &lm)
std::string GetTypeNameWithOpts(const ROOT::RDF::RDataSource &ds, std::string_view colName, bool vector2RVec)
const std::vector< std::string > & GetColumnNamesNoDuplicates(const ROOT::RDF::RDataSource &ds)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...