25#include <unordered_set>
26#include <shared_mutex>
40namespace Experimental {
83 static constexpr bool Test(A *
pt, A
const *cpt =
nullptr,
decltype(
pt->begin()) * =
nullptr,
84 decltype(
pt->end()) * =
nullptr,
decltype(cpt->begin()) * =
nullptr,
85 decltype(cpt->end()) * =
nullptr,
typename A::iterator *pi =
nullptr,
86 typename A::const_iterator *pci =
nullptr)
88 using It_t =
typename A::iterator;
89 using CIt_t =
typename A::const_iterator;
90 using V_t =
typename A::value_type;
91 return std::is_same<
decltype(
pt->begin()), It_t>
::value && std::is_same<
decltype(
pt->end()), It_t>
::value &&
92 std::is_same<
decltype(cpt->begin()), CIt_t>
::value && std::is_same<
decltype(cpt->end()), CIt_t>
::value &&
93 std::is_same<
decltype(**pi), V_t &>
::value && std::is_same<
decltype(**pci), V_t
const &>
::value &&
94 !std::is_same<T, std::string>::value;
98 static constexpr bool Test(...)
103 static constexpr bool value = Test<Test_t>(
nullptr);
108 static constexpr bool value =
true;
118 static constexpr bool value =
true;
125template <
typename T,
typename A>
126struct IsVector_t<std::vector<T, A>> :
public std::true_type {};
140template <
bool MustRemove,
typename TypeList>
145template <
typename TypeList>
150template <
bool MustRemove,
typename TypeList>
153template <
bool MustRemove,
typename TypeList>
158template <
typename TypeList>
164template <
bool MustRemove,
typename TypeList>
189void Erase(
const T &that, std::vector<T> &
v)
191 v.erase(std::remove(
v.begin(),
v.end(), that),
v.end());
206unsigned int GetColumnWidth(
const std::vector<std::string>& names,
const unsigned int minColumnSpace = 8u);
211#ifdef R__HAS_HARDWARE_INTERFERENCE_SIZE
213 inline constexpr std::size_t
kCacheLineSize = std::hardware_destructive_interference_size;
227 const std::string &colName);
233 for (
size_t i = 0; i < arr.size(); ++i) {
241template <std::size_t
N,
typename... Ts>
244 auto tuple = std::forward_as_tuple(args...);
245 return std::get<N>(tuple);
248#if __cplusplus >= 201703L
249template <
class... Ts>
250using Disjunction = std::disjunction<Ts...>;
258template <
class B1,
class... Bn>
259struct Disjunction<
B1, Bn...> : std::conditional_t<bool(B1::value), B1, Disjunction<Bn...>> {
263bool IsStrInVec(
const std::string &str,
const std::vector<std::string> &
vec);
268std::vector<T>
Union(
const std::vector<T> &
v1,
const std::vector<T> &
v2)
270 std::vector<T> res =
v1;
273 for (
const auto &
e :
v2)
274 if (std::find(
v1.begin(),
v1.end(),
e) ==
v1.end())
300 auto Insert(
const std::string &
string) ->
decltype(
fStrings)::const_iterator;
314 template <
typename F,
typename... Args>
317 f(std::forward<Args>(args)...);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
A log configuration for a channel, e.g.
A Thread-safe cache for strings.
auto Insert(const std::string &string) -> decltype(fStrings)::const_iterator
Inserts the input string in the cache and returns an iterator to the cached string.
std::unordered_set< std::string > fStrings
RDataSource defines an API that RDataFrame can use to read arbitrary data formats.
typename RemoveFirstParameter< T >::type RemoveFirstParameter_t
A "std::vector"-like collection of values implementing handy operation to analyse them.
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
A TTree represents a columnar dataset.
ROOT::Experimental::RLogChannel & RDFLogChannel()
std::vector< std::string > ReplaceDotWithUnderscore(const std::vector< std::string > &columnNames)
Replace occurrences of '.
const std::type_info & TypeName2TypeID(const std::string &name)
Return the type_info associated to a name.
decltype(auto) GetNthElement(Ts &&...args)
static constexpr std::size_t kCacheLineSize
char TypeName2ROOTTypeName(const std::string &b)
Convert type name (e.g.
std::string TypeID2TypeName(const std::type_info &id)
Returns the name of a type starting from its type_info An empty string is returned in case of failure...
bool IsStrInVec(const std::string &str, const std::vector< std::string > &vec)
void Erase(const T &that, std::vector< T > &v)
Erase that element from vector v
unsigned int GetColumnWidth(const std::vector< std::string > &names, const unsigned int minColumnSpace=8u)
Get optimal column width for printing a table given the names and the desired minimal space between c...
constexpr std::size_t CacheLineStep()
Stepping through CacheLineStep<T> values in a vector<T> brings you to a new cache line.
Long64_t InterpreterCalc(const std::string &code, const std::string &context="")
Jit code in the interpreter with TInterpreter::Calc, throw in case of errors.
typename RemoveFirstParameterIf< MustRemove, TypeList >::type RemoveFirstParameterIf_t
std::string ColumnName2ColumnTypeName(const std::string &colName, TTree *, RDataSource *, RDefineBase *, bool vector2RVec=true)
Return a string containing the type of the given branch.
void CheckReaderTypeMatches(const std::type_info &colType, const std::type_info &requestedType, const std::string &colName)
constexpr std::size_t FindIdxTrue(const T &arr)
std::vector< T > Union(const std::vector< T > &v1, const std::vector< T > &v2)
Return a vector with all elements of v1 and v2 and duplicates removed.
bool IsInternalColumn(std::string_view colName)
Whether custom column with name colName is an "internal" column such as rdfentry_ or rdfslot_.
void InterpreterDeclare(const std::string &code)
Declare code in the interpreter via the TInterpreter::Declare method, throw in case of errors.
typename RemoveFirstTwoParametersIf< MustRemove, TypeList >::type RemoveFirstTwoParametersIf_t
std::vector< std::string > ColumnNames_t
ROOT type_traits extensions.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Struct to wrap the call to a function with a guaranteed order of execution of its arguments.
CallGuaranteedOrder(F &&f, Args &&...args)
Check for container traits.
static constexpr bool Test(A *pt, A const *cpt=nullptr, decltype(pt->begin()) *=nullptr, decltype(pt->end()) *=nullptr, decltype(cpt->begin()) *=nullptr, decltype(cpt->end()) *=nullptr, typename A::iterator *pi=nullptr, typename A::const_iterator *pci=nullptr)
static constexpr bool Test(...)
static constexpr bool value
Detect whether a type is an instantiation of vector<T,A>
RemoveFirstParameter_t< TypeList > type
type is TypeList if MustRemove is false, otherwise it is a TypeList with the first type removed
typename RemoveFirstParameterIf< true, typeTmp >::type type
typename RemoveFirstParameterIf< true, TypeList >::type typeTmp
typename T::value_type value_type
Lightweight storage for a collection of types.