20#ifndef RDF_SNAPSHOTHELPERS
21#define RDF_SNAPSHOTHELPERS
39class RNTupleFillContext;
40class RNTupleParallelWriter;
42class TBufferMergerFile;
59 std::unique_ptr<ROOT::RNTupleParallelWriter>
fWriter;
64 std::vector<std::unique_ptr<ROOT::REntry>>
fEntries;
73 const std::vector<const std::type_info *> &
colTypeIDs);
83 void Exec(
unsigned int slot,
const std::vector<
void *> &values);
87 void FinalizeTask(
unsigned int slot);
91 std::
string GetActionName() {
return "Snapshot"; }
107 static constexpr std::size_t fNBytes = 8;
108 alignas(8) std::array<std::byte, fNBytes> fBytes{std::byte{0}};
116 std::shared_ptr<void> fEmptyInstance =
nullptr;
117 void *fRawPtrToEmptyInstance =
nullptr;
122 const std::type_info *fInputTypeID =
nullptr;
124 void *fBranchAddressForCArrays =
nullptr;
126 int fVariationIndex = -1;
128 bool fIsCArray =
false;
129 bool fIsDefine =
false;
136 fOutputBranch =
nullptr;
137 fBranchAddressForCArrays =
nullptr;
140 void ClearBranchContents();
161 bool fBranchAddressesNeedReset{
true};
172 const std::vector<const std::type_info *> &
colTypeIDs);
182 void Exec(
unsigned int,
const std::vector<
void *> &values);
184 void UpdateCArraysPtrs(
const std::vector<
void *> &values);
186 void SetBranches(
const std::vector<
void *> &values);
194 std::
string GetActionName() {
return "Snapshot"; }
198 return [
this](
unsigned int,
const RSampleInfo &)
mutable { fBranchAddressesNeedReset =
true; };
234 const std::vector<const std::type_info *> &
colTypeIDs);
244 void FinalizeTask(
unsigned int slot);
246 void Exec(
unsigned int slot,
const std::vector<
void *> &values);
248 void UpdateCArraysPtrs(
unsigned int slot,
const std::vector<
void *> &values);
250 void SetBranches(
unsigned int slot,
const std::vector<
void *> &values);
258 std::
string GetActionName() {
return "Snapshot"; }
262 return [
this](
unsigned int slot,
const RSampleInfo &)
mutable { fBranchAddressesNeedReset[
slot] = 1; };
268struct SnapshotOutputWriter;
288 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 ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
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 file.