Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RVariationBase.hxx
Go to the documentation of this file.
1// Author: Enrico Guiraud, CERN 10/2021
2
3/*************************************************************************
4 * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#ifndef ROOT_RVARIATIONBASE
12#define ROOT_RVARIATIONBASE
13
15#include <ROOT/RDF/Utils.hxx> // ColumnNames_t
16#include <ROOT/RVec.hxx>
17
18#include <array>
19#include <deque>
20#include <memory>
21#include <string>
22#include <vector>
23
24class TTreeReader;
25
26namespace ROOT {
27namespace RDF {
28class RDataSource;
29}
30namespace Detail {
31namespace RDF {
32class RLoopManager;
33}
34} // namespace Detail
35namespace Internal {
36namespace RDF {
37
38/// This type includes all parts of RVariation that do not depend on the callable signature.
40protected:
41 std::vector<std::string> fColNames; ///< The names of the varied columns.
42 std::vector<std::string> fVariationNames; ///< The names of the systematic variation.
43 std::string fType; ///< The type of the custom column as a text string.
44 std::vector<Long64_t> fLastCheckedEntry;
48 /// The nth flag signals whether the nth input column is a custom column or not.
50
51public:
52 RVariationBase(const std::vector<std::string> &colNames, std::string_view variationName,
53 const std::vector<std::string> &variationTags, std::string_view type,
54 const RColumnRegister &colRegister, RLoopManager &lm, const ColumnNames_t &inputColNames);
55
56 RVariationBase(const RVariationBase &) = delete;
60 virtual ~RVariationBase();
61
62 virtual void InitSlot(TTreeReader *r, unsigned int slot) = 0;
63
64 /// Return the (type-erased) address of the value of one variation of one column (can be safely cast back to a T*).
65 virtual void *GetValuePtr(unsigned int slot, const std::string &column, const std::string &variation) = 0;
66 virtual const std::type_info &GetTypeId() const = 0;
67 const std::vector<std::string> &GetColumnNames() const;
68 const std::vector<std::string> &GetVariationNames() const;
69 std::string GetTypeName() const;
70 /// Update the value at the address returned by GetValuePtr with the content corresponding to the given entry
71 virtual void Update(unsigned int slot, Long64_t entry) = 0;
72 /// Clean-up operations to be performed at the end of a task.
73 virtual void FinalizeSlot(unsigned int slot) = 0;
74};
75
76} // namespace RDF
77} // namespace Internal
78} // namespace ROOT
79
80#endif // ROOT_RVARIATIONBASE
ROOT::R::TRInterface & r
Definition Object.C:4
long long Long64_t
Definition RtypesCore.h:80
int type
Definition TGX11.cxx:121
The head node of a RDF computation graph.
A binder for user-defined columns and aliases.
This type includes all parts of RVariation that do not depend on the callable signature.
std::vector< std::string > fColNames
The names of the varied columns.
const std::vector< std::string > & GetVariationNames() const
const std::vector< std::string > & GetColumnNames() const
RVariationBase & operator=(RVariationBase &&)=default
std::string fType
The type of the custom column as a text string.
virtual void FinalizeSlot(unsigned int slot)=0
Clean-up operations to be performed at the end of a task.
virtual const std::type_info & GetTypeId() const =0
ROOT::RVecB fIsDefine
The nth flag signals whether the nth input column is a custom column or not.
virtual void Update(unsigned int slot, Long64_t entry)=0
Update the value at the address returned by GetValuePtr with the content corresponding to the given e...
std::vector< std::string > fVariationNames
The names of the systematic variation.
RVariationBase(RVariationBase &&)=default
std::vector< Long64_t > fLastCheckedEntry
virtual void * GetValuePtr(unsigned int slot, const std::string &column, const std::string &variation)=0
Return the (type-erased) address of the value of one variation of one column (can be safely cast back...
virtual void InitSlot(TTreeReader *r, unsigned int slot)=0
RVariationBase(const RVariationBase &)=delete
RVariationBase & operator=(const RVariationBase &)=delete
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
Definition TTreeReader.h:44
std::vector< std::string > ColumnNames_t
Definition Utils.hxx:35
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...