20#ifndef RDF_SNAPSHOTHELPERS
21#define RDF_SNAPSHOTHELPERS
35class RNTupleFillContext;
36class RNTupleParallelWriter;
38class TBufferMergerFile;
55 std::unique_ptr<ROOT::RNTupleParallelWriter>
fWriter;
60 std::vector<std::unique_ptr<ROOT::REntry>>
fEntries;
69 const std::vector<const std::type_info *> &
colTypeIDs);
79 void Exec(
unsigned int slot,
const std::vector<
void *> &values);
83 void FinalizeTask(
unsigned int slot);
87 std::
string GetActionName() {
return "Snapshot"; }
101 const std::type_info *fInputTypeID =
nullptr;
103 void *fBranchAddressForCArrays =
nullptr;
106 bool fIsCArray =
false;
107 bool fIsDefine =
false;
120 fOutputBranch =
nullptr;
121 fBranchAddressForCArrays =
nullptr;
132 bool fBranchAddressesNeedReset{
true};
143 const std::vector<const std::type_info *> &
colTypeIDs);
153 void Exec(
unsigned int,
const std::vector<
void *> &values);
155 void UpdateCArraysPtrs(
const std::vector<
void *> &values);
157 void SetBranches(
const std::vector<
void *> &values);
165 std::
string GetActionName() {
return "Snapshot"; }
169 return [
this](
unsigned int,
const RSampleInfo &)
mutable { fBranchAddressesNeedReset =
true; };
205 const std::vector<const std::type_info *> &
colTypeIDs);
215 void FinalizeTask(
unsigned int slot);
217 void Exec(
unsigned int slot,
const std::vector<
void *> &values);
219 void UpdateCArraysPtrs(
unsigned int slot,
const std::vector<
void *> &values);
221 void SetBranches(
unsigned int slot,
const std::vector<
void *> &values);
229 std::
string GetActionName() {
return "Snapshot"; }
233 return [
this](
unsigned int slot,
const RSampleInfo &)
mutable { fBranchAddressesNeedReset[
slot] = 1; };
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.
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.
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 properties of each output branch in a Snapshot.
RBranchData(std::string inputBranchName, std::string outputBranchName, bool isDefine, const std::type_info *typeID, TBranch *outputBranch=nullptr)
std::string fOutputBranchName
std::unique_ptr< void, std::function< void(void *)> fEmptyInstance)
void ClearBranchPointers()
std::string fInputBranchName
A collection of options to steer the creation of the dataset on file.