19#ifndef RDF_SNAPSHOTHELPERS
20#define RDF_SNAPSHOTHELPERS
38class RNTupleFillContext;
39class RNTupleParallelWriter;
41class TBufferMergerFile;
58 std::unique_ptr<ROOT::RNTupleParallelWriter>
fWriter;
63 std::vector<std::unique_ptr<ROOT::REntry>>
fEntries;
72 const std::vector<const std::type_info *> &
colTypeIDs);
82 void Exec(
unsigned int slot,
const std::vector<
void *> &values);
86 void FinalizeTask(
unsigned int slot);
90 std::
string GetActionName() {
return "Snapshot"; }
106 static constexpr std::size_t fNBytes = 8;
107 alignas(8) std::array<std::byte, fNBytes> fBytes{std::byte{0}};
115 std::shared_ptr<void> fEmptyInstance =
nullptr;
116 void *fRawPtrToEmptyInstance =
nullptr;
121 const std::type_info *fInputTypeID =
nullptr;
123 void *fBranchAddressForCArrays =
nullptr;
127 int fVariationIndex = -1;
129 bool fIsCArray =
false;
130 bool fIsDefine =
false;
137 fOutputBranch =
nullptr;
138 fBranchAddressForCArrays =
nullptr;
141 void ClearBranchContents();
162 bool fBranchAddressesNeedReset{
true};
173 const std::vector<const std::type_info *> &
colTypeIDs);
183 void Exec(
unsigned int,
const std::vector<
void *> &values);
185 void UpdateCArraysPtrs(
const std::vector<
void *> &values);
187 void SetBranches(
const std::vector<
void *> &values);
195 std::
string GetActionName() {
return "Snapshot"; }
199 return [
this](
unsigned int,
const RSampleInfo &)
mutable { fBranchAddressesNeedReset =
true; };
235 const std::vector<const std::type_info *> &
colTypeIDs);
245 void FinalizeTask(
unsigned int slot);
247 void Exec(
unsigned int slot,
const std::vector<
void *> &values);
249 void UpdateCArraysPtrs(
unsigned int slot,
const std::vector<
void *> &values);
251 void SetBranches(
unsigned int slot,
const std::vector<
void *> &values);
259 std::
string GetActionName() {
return "Snapshot"; }
263 return [
this](
unsigned int slot,
const RSampleInfo &)
mutable { fBranchAddressesNeedReset[
slot] = 1; };
269struct SnapshotOutputWriter;
289 const std::vector<const std::type_info *> &
colTypeIDs);
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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 filename
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
Base class for action helpers, see RInterface::Book() for more information.
The head node of a RDF computation graph.
TTree snapshot helper with systematic variations.
std::string GetActionName()
std::shared_ptr< SnapshotOutputWriter > fOutputHandle
RSnapshotOptions fOptions
void ClearOutputBranches()
std::vector< RBranchData > fBranchData
SnapshotHelperWithVariations(SnapshotHelperWithVariations const &) noexcept=delete
SnapshotHelperWithVariations(SnapshotHelperWithVariations &&) noexcept=default
ROOT::RDF::SampleCallback_t GetSampleCallback() final
Override this method to register a callback that is executed before the processing a new data sample ...
std::vector< std::shared_ptr< ROOT::RNTupleFillContext > > fFillContexts
UntypedSnapshotRNTupleHelper(const UntypedSnapshotRNTupleHelper &)=delete
RSnapshotOptions fOptions
std::unique_ptr< ROOT::RNTupleParallelWriter > fWriter
ColumnNames_t fOutputFieldNames
std::unique_ptr< TFile > fOutputFile
UntypedSnapshotRNTupleHelper & operator=(const UntypedSnapshotRNTupleHelper &)=delete
std::vector< std::unique_ptr< ROOT::REntry > > fEntries
std::vector< const std::type_info * > fInputColumnTypeIDs
ROOT::Detail::RDF::RLoopManager * fOutputLoopManager
UntypedSnapshotRNTupleHelper(UntypedSnapshotRNTupleHelper &&) noexcept
std::vector< ROOT::RFieldToken > fFieldTokens
ROOT::Detail::RDF::RLoopManager * fInputLoopManager
ColumnNames_t fInputFieldNames
ROOT::Detail::RDF::RLoopManager * fInputLoopManager
UntypedSnapshotTTreeHelperMT(UntypedSnapshotTTreeHelperMT &&) noexcept
ROOT::Detail::RDF::RLoopManager * fOutputLoopManager
std::vector< std::shared_ptr< ROOT::TBufferMergerFile > > fOutputFiles
std::vector< std::vector< RBranchData > > fBranchData
ROOT::RDF::SampleCallback_t GetSampleCallback() final
Override this method to register a callback that is executed before the processing a new data sample ...
RSnapshotOptions fOptions
std::vector< int > fBranchAddressesNeedReset
std::vector< TTree * > fInputTrees
UntypedSnapshotTTreeHelperMT & operator=(const UntypedSnapshotTTreeHelperMT &)=delete
std::vector< std::unique_ptr< TTree > > fOutputTrees
std::unique_ptr< ROOT::TBufferMerger > fMerger
UntypedSnapshotTTreeHelperMT(const UntypedSnapshotTTreeHelperMT &)=delete
RSnapshotOptions fOptions
ROOT::Detail::RDF::RLoopManager * fOutputLoopManager
ROOT::Detail::RDF::RLoopManager * fInputLoopManager
std::vector< RBranchData > fBranchData
UntypedSnapshotTTreeHelper(UntypedSnapshotTTreeHelper &&) noexcept
std::unique_ptr< TFile > fOutputFile
UntypedSnapshotTTreeHelper(const UntypedSnapshotTTreeHelper &)=delete
std::unique_ptr< TTree > fOutputTree
UntypedSnapshotTTreeHelper & operator=(const UntypedSnapshotTTreeHelper &)=delete
ROOT::RDF::SampleCallback_t GetSampleCallback() final
Override this method to register a callback that is executed before the processing a new data sample ...
This type represents a sample identifier, to be used in conjunction with RDataFrame features such as ...
A TTree is a list of TBranches.
TClass instances represent classes, structs and namespaces in the ROOT type system.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
A TTree represents a columnar dataset.
std::function< void(unsigned int, const ROOT::RDF::RSampleInfo &)> SampleCallback_t
The type of a data-block callback, registered with an RDataFrame computation graph via e....
std::vector< std::string > ColumnNames_t
Stores empty instances of classes, so a dummy object can be written when a systematic variation doesn...
Stores variations of a fundamental type.
FundamentalType(unsigned short size)
Stores properties of each output branch in a Snapshot.
bool WriteValueIfFundamental(void *valuePtr)
For fundamental types represented by TDataType, fetch a value from the pointer into the local branch ...
std::string fOutputBranchName
void ClearBranchPointers()
std::string fInputBranchName
A collection of options to steer the creation of the dataset on disk through Snapshot().