Adapted from the hvector tree tutorial.
#include <cstdio>
#include <iostream>
#include <memory>
#include <vector>
#include <utility>
void Write()
{
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 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
static std::unique_ptr< RNTupleModel > Create()
static std::unique_ptr< RNTupleReader > Open(std::string_view ntupleName, std::string_view storage, const ROOT::RNTupleReadOptions &options=ROOT::RNTupleReadOptions())
Open an RNTuple for reading.
static std::unique_ptr< RNTupleWriter > Recreate(std::unique_ptr< ROOT::RNTupleModel > model, std::string_view ntupleName, std::string_view storage, const ROOT::RNTupleWriteOptions &options=ROOT::RNTupleWriteOptions())
Throws an exception if the model is null.
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).