Adapted from the hvector tree tutorial.
#include <cstdio>
#include <iostream>
#include <memory>
#include <vector>
#include <utility>
void Write()
{
auto model = RNTupleModel::Create();
std::shared_ptr<std::vector<float>>
fldVpx = model->MakeField<std::vector<float>>(
"vpx");
auto fldVpy = model->MakeField<std::vector<float>>(
"vpy");
auto fldVpz = model->MakeField<std::vector<float>>(
"vpz");
auto fldVrand = model->MakeField<std::vector<float>>(
"vrand");
TH1F hpx(
"hpx",
"This is the px distribution", 100, -4, 4);
auto c1 =
new TCanvas(
"c1",
"Dynamic Filling Example", 200, 10, 700, 500);
for (
int j = 0;
j <
npx; ++
j) {
float px, py, pz;
pz = px*px + py*py;
}
break;
}
}
}
void Read()
{
auto model = RNTupleModel::Create();
auto fldVpx = model->MakeField<std::vector<float>>(
"vpx");
std::cout << "Entry number 42 in JSON format:" << std::endl;
TH1F h(
"h",
"This is the px distribution", 100, -4, 4);
}
break;
}
}
}
{
Write();
Read();
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TRandom * gRandom
R__EXTERN TSystem * gSystem
The RNTupleModel encapulates the schema of an ntuple.
An RNTuple that is used to read data from storage.
An RNTuple that gets filled with entries (data) and writes them to storage.
1-D histogram with a float per channel (see TH1 documentation)
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
Double_t Rndm() override
Machine independent random number generator.
virtual void Rannor(Float_t &a, Float_t &b)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).