File indexing completed on 2025-02-22 10:53:06
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef ROOT_RDEFINEBASE
0012 #define ROOT_RDEFINEBASE
0013
0014 #include "ROOT/RDF/GraphNode.hxx"
0015 #include "ROOT/RDF/RColumnRegister.hxx"
0016 #include "ROOT/RDF/RSampleInfo.hxx"
0017 #include "ROOT/RDF/Utils.hxx"
0018 #include "ROOT/RVec.hxx"
0019
0020 #include <deque>
0021 #include <map>
0022 #include <memory>
0023 #include <string>
0024 #include <vector>
0025
0026 class TTreeReader;
0027
0028 namespace ROOT {
0029 namespace RDF {
0030 class RDataSource;
0031 }
0032 namespace Detail {
0033 namespace RDF {
0034
0035 class RLoopManager;
0036
0037 namespace RDFInternal = ROOT::Internal::RDF;
0038
0039 class RDefineBase {
0040 protected:
0041 const std::string fName;
0042 const std::string fType;
0043 std::vector<Long64_t> fLastCheckedEntry;
0044 RDFInternal::RColumnRegister fColRegister;
0045 RLoopManager *fLoopManager;
0046 const ROOT::RDF::ColumnNames_t fColumnNames;
0047
0048 ROOT::RVecB fIsDefine;
0049 std::vector<std::string> fVariationDeps;
0050 std::string fVariation;
0051
0052 public:
0053 RDefineBase(std::string_view name, std::string_view type, const RDFInternal::RColumnRegister &colRegister,
0054 RLoopManager &lm, const ColumnNames_t &columnNames, const std::string &variationName = "nominal");
0055
0056 RDefineBase &operator=(const RDefineBase &) = delete;
0057 RDefineBase &operator=(RDefineBase &&) = delete;
0058 virtual ~RDefineBase();
0059 virtual void InitSlot(TTreeReader *r, unsigned int slot) = 0;
0060
0061 virtual void *GetValuePtr(unsigned int slot) = 0;
0062 virtual const std::type_info &GetTypeId() const = 0;
0063 std::string GetName() const;
0064 std::string GetTypeName() const;
0065
0066 virtual void Update(unsigned int slot, Long64_t entry) = 0;
0067
0068 virtual void Update(unsigned int , const ROOT::RDF::RSampleInfo &) {}
0069
0070 virtual void FinalizeSlot(unsigned int slot) = 0;
0071
0072 const std::vector<std::string> &GetVariations() const { return fVariationDeps; }
0073
0074
0075 virtual void MakeVariations(const std::vector<std::string> &variations) = 0;
0076
0077
0078 virtual RDefineBase &GetVariedDefine(const std::string &variationName) = 0;
0079 };
0080
0081 }
0082 }
0083 }
0084
0085 #endif