19CountHelper::CountHelper(
const std::shared_ptr<ULong64_t> &
resultCount,
const unsigned int nSlots)
24void CountHelper::Exec(
unsigned int slot)
29void CountHelper::Finalize()
32 for (
auto &
c : fCounts) {
42void BufferedFillHelper::UpdateMinMax(
unsigned int slot,
double v)
50BufferedFillHelper::BufferedFillHelper(
const std::shared_ptr<Hist_t> &
h,
const unsigned int nSlots)
55 fBuffers.reserve(fNSlots);
57 for (
unsigned int i = 0; i < fNSlots; ++i) {
60 fBuffers.emplace_back(
v);
65void BufferedFillHelper::Exec(
unsigned int slot,
double v)
68 fBuffers[
slot].emplace_back(
v);
71void BufferedFillHelper::Exec(
unsigned int slot,
double v,
double w)
74 fBuffers[
slot].emplace_back(
v);
78Hist_t &BufferedFillHelper::PartialUpdate(
unsigned int slot)
89void BufferedFillHelper::Finalize()
91 for (
unsigned int i = 0; i < fNSlots; ++i) {
93 throw std::runtime_error(
"Cannot fill weighted histogram with values in containers of different sizes.");
101 globalMax != std::numeric_limits<BufEl_t>::lowest()) {
105 for (
unsigned int i = 0; i < fNSlots; ++i) {
111MeanHelper::MeanHelper(
const std::shared_ptr<double> &
meanVPtr,
const unsigned int nSlots)
116void MeanHelper::Exec(
unsigned int slot,
double v)
126void MeanHelper::Finalize()
140 for (
auto &
c : fCounts)
145double &MeanHelper::PartialUpdate(
unsigned int slot)
151StdDevHelper::StdDevHelper(
const std::shared_ptr<double> &
meanVPtr,
const unsigned int nSlots)
156void StdDevHelper::Exec(
unsigned int slot,
double v)
159 auto count = ++fCounts[
slot];
160 auto delta =
v - fMeans[
slot];
161 auto mean = fMeans[
slot] + delta / count;
165 fCounts[
slot] = count;
170void StdDevHelper::Finalize()
174 for (
auto c : fCounts) {
184 for (
unsigned int i = 0; i < fNSlots; ++i) {
190 for (
unsigned int i = 0; i < fNSlots; ++i) {
191 if (fCounts[i] == 0) {
216 const std::string &fileName)
226 throw std::invalid_argument(
"Snapshot: cannot open file \"" + fileName +
"\" in update mode");
233 if (
opts.fOverwriteIfExists) {
234 if (
outTree->InheritsFrom(
"TTree")) {
240 const std::string
msg =
"Snapshot: tree \"" +
treeName +
"\" already present in file \"" + fileName +
241 "\". If you want to delete the original tree and write another, please set "
242 "RSnapshotOptions::fOverwriteIfExists to true.";
243 throw std::invalid_argument(
msg);
248 const std::string &fileName)
258 throw std::invalid_argument(
"Snapshot: cannot open file \"" + fileName +
"\" in update mode");
263 if (
opts.fOverwriteIfExists) {
267 const std::string
msg =
"Snapshot: RNTuple \"" +
ntupleName +
"\" already present in file \"" + fileName +
268 "\". If you want to delete the original ntuple and write another, please set "
269 "the 'fOverwriteIfExists' option to true in RSnapshotOptions.";
270 throw std::invalid_argument(
msg);
281 if (
opts.fOverwriteIfExists) {
288 const std::string
msg =
"Snapshot: object \"" +
ntupleName +
"\" already present in file \"" + fileName +
289 "\". If you want to delete the original object and write a new RNTuple, please set "
290 "the 'fOverwriteIfExists' option to true in RSnapshotOptions.";
291 throw std::invalid_argument(
msg);
318 const auto bname =
leaf->GetName();
336 const auto btype =
leaf->GetTypeName();
340 "RDataFrame::Snapshot: could not correctly construct a leaflist for C-style array in column %s. The "
341 "leaf is of type '%s'. This column will not be written out.",
374 "RDataFrame::Snapshot: could not correctly construct a leaflist for fundamental type in column %s. This "
375 "column will not be written out.",
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
unsigned long long ULong64_t
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Representation of an RNTuple data set in a ROOT file.
A TTree is a list of TBranches.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Mother of all ROOT objects.
A TTree represents a columnar dataset.
char TypeName2ROOTTypeName(const std::string &b)
Convert type name (e.g.
std::string TypeID2TypeName(const std::type_info &id)
Returns the name of a type starting from its type_info An empty string is returned in case of failure...
constexpr std::size_t CacheLineStep()
Stepping through CacheLineStep<T> values in a vector<T> brings you to a new cache line.
void EnsureValidSnapshotRNTupleOutput(const RSnapshotOptions &opts, const std::string &ntupleName, const std::string &fileName)
void EnsureValidSnapshotTTreeOutput(const RSnapshotOptions &opts, const std::string &treeName, const std::string &fileName)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
ROOT::ESTLType STLKind(std::string_view type)
Converts STL container name to number.
ROOT::ESTLType IsSTLCont(std::string_view type)
type : type name: vector<list<classA,allocator>,allocator> result: 0 : not stl container code of cont...
A collection of options to steer the creation of the dataset on file.