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
long long Long64_t
Definition RtypesCore.h:69
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
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 Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
The head node of a RDF computation graph.
A binder for user-defined columns, variations 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:46
std::vector< std::string > ColumnNames_t
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...