30void Write(std::string_view
ntupleName, std::string_view fileName)
34 auto fldVpx = model->MakeField<std::vector<float>>(
"vpx");
35 auto fldVpy = model->MakeField<std::vector<float>>(
"vpy");
36 auto fldVpz = model->MakeField<std::vector<float>>(
"vpz");
37 auto fldN = model->MakeField<std::uint64_t>(
"vn");
47 for (
int j = 0;
j < *
fldN; ++
j) {
50 pz = px * px + py * py;
61void Read(
const std::vector<RNTupleOpenSpec> &
ntuples)
63 auto c =
new TCanvas(
"c",
"RNTupleProcessor Example", 200, 10, 700, 500);
64 TH1F hPx(
"h",
"This is the px distribution", 100, -4, 4);
68 auto ptrPx = model->MakeField<std::vector<float>>(
"vpx");
83 <<
" total entries processed so far)" << std::endl;
93 std::cout <<
"Processed a total of " <<
processor->GetNEntriesProcessed() <<
" entries" << std::endl;
100 Write(
"ntuple1",
"ntuple1.root");
101 Write(
"ntuple2",
"ntuple2.root");
102 Write(
"ntuple3",
"ntuple3.root");
106 std::vector<RNTupleOpenSpec>
ntuples = {
107 {
"ntuple1",
"ntuple1.root"}, {
"ntuple2",
"ntuple2.root"}, {
"ntuple3",
"ntuple3.root"}};
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TRandom * gRandom
Specification of the name and location of an RNTuple, used for creating a new RNTupleProcessor.
Interface for iterating over entries of RNTuples and vertically concatenated RNTuples (chains).
static std::unique_ptr< RNTupleModel > Create()
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 Rannor(Float_t &a, Float_t &b)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1.
virtual UInt_t Integer(UInt_t imax)
Returns a random integer uniformly distributed on the interval [ 0, imax-1 ].