53 static std::atomic<std::uint32_t>
gThreadId;
56 auto prng = std::make_unique<TRandom3>();
62 auto id =
entry->GetPtr<std::uint32_t>(
"id");
64 auto vpx =
entry->GetPtr<std::vector<float>>(
"vpx");
65 auto vpy =
entry->GetPtr<std::vector<float>>(
"vpy");
66 auto vpz =
entry->GetPtr<std::vector<float>>(
"vpz");
73 int npx =
static_cast<int>(
prng->Rndm(1) * 15);
75 for (
int j = 0;
j <
npx; ++
j) {
78 pz = px * px + py * py;
80 vpx->emplace_back(px);
81 vpy->emplace_back(py);
82 vpz->emplace_back(pz);
93 auto model = RNTupleModel::CreateBare();
94 model->MakeField<std::uint32_t>(
"id");
95 model->MakeField<std::vector<float>>(
"vpx");
96 model->MakeField<std::vector<float>>(
"vpy");
97 model->MakeField<std::vector<float>>(
"vpz");
101 RNTupleWriteOptions options;
102 options.SetApproxZippedClusterSize(1024 * 1024);
107 std::vector<std::thread>
threads;
125 TCanvas *
c1 =
new TCanvas(
"c2",
"Multi-Threaded Filling Example", 200, 10, 1500, 500);
129 TH1F h(
"h",
"This is the px distribution", 100, -4, 4);
138 auto nEvents =
reader->GetNEntries();
140 TH2F hFillSequence(
"",
"Entry Id vs Thread Id;Entry Sequence Number;Filling Thread", 100, 0, nEvents, 100, 0,
142 for (
auto i :
reader->GetEntryRange())
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TStyle * gStyle
The RNTupleModel encapulates the schema of an ntuple.
A writer to fill an RNTuple from multiple contexts.
An RNTuple that is used to read data from storage.
Common user-tunable settings for storing ntuples.
1-D histogram with a float per channel (see TH1 documentation)
2-D histogram with a float per channel (see TH1 documentation)
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
RNTupleGlobalRange GetFieldRange(const RFieldBase &field, const RPageSource &pageSource)
Helper to get the iteration space of the given field that needs to be connected to the given page sou...
void FillData(BinData &dv, const TH1 *hist, TF1 *func=nullptr)
fill the data vector from a TH1.