#include <iostream>
#include <memory>
#include <mutex>
#include <random>
#include <thread>
#include <vector>
void FillData(
int id, RNTupleParallelWriter *
writer)
{
auto eventId =
entry->GetPtr<std::uint32_t>(
"eventId");
auto d =
static_cast<double>(gen()) / generator::max();
*
rndm =
static_cast<float>(
d);
}
{
std::cout <<
"Thread #" <<
id <<
" wrote events #" <<
eventIdStart <<
" - #"
}
}
void Write()
{
std::cout << " === Writing with staged cluster committing ===" << std::endl;
auto model = RNTupleModel::CreateBare();
model->MakeField<std::uint32_t>("eventId");
model->MakeField<float>("rndm");
RNTupleWriteOptions options;
options.SetApproxZippedClusterSize(32'000);
}
{
auto eventId =
entry->GetPtr<std::uint32_t>(
"eventId");
auto d =
static_cast<double>(gen()) / generator::max();
*
rndm =
static_cast<float>(
d);
{
std::cout <<
"Thread #" <<
id <<
" wrote events #" <<
firstEvent <<
" - #" <<
lastEvent <<
" as entries #"
}
}
}
{
std::cout <<
"Thread #" <<
id <<
" wrote events #" <<
firstEvent <<
" - #" <<
lastEvent <<
" as entries #"
}
}
{
std::cout <<
"\n === ... with sequencing in blocks of " <<
kNEventsPerBlock <<
" events ===" << std::endl;
auto model = RNTupleModel::CreateBare();
model->MakeField<std::uint32_t>("eventId");
model->MakeField<float>("rndm");
RNTupleWriteOptions options;
options.SetApproxZippedClusterSize(32'000);
}
{
Write();
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
The RNTupleModel encapulates the schema of an ntuple.
A writer to fill an RNTuple from multiple contexts.
Common user-tunable settings for storing ntuples.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.