void Write(std::string_view
ntupleName, std::string_view fileName)
{
auto fldVpx = model->MakeField<std::vector<float>>(
"vpx");
auto fldVpy = model->MakeField<std::vector<float>>(
"vpy");
auto fldVpz = model->MakeField<std::vector<float>>(
"vpz");
auto fldN = model->MakeField<std::uint64_t>(
"vn");
float px, py, pz;
pz = px * px + py * py;
}
}
}
void Read(
const std::vector<RNTupleOpenSpec> &
ntuples)
{
auto c =
new TCanvas(
"c",
"RNTupleProcessor Example", 200, 10, 700, 500);
TH1F hPx(
"h",
"This is the px distribution", 100, -4, 4);
auto ptrPx = model->MakeField<std::vector<float>>(
"vpx");
<< " total entries processed so far)" << std::endl;
}
}
}
std::cout <<
"Processed a total of " <<
processor->GetNEntriesProcessed() <<
" entries" << std::endl;
}
{
Write("ntuple1", "ntuple1.root");
Write("ntuple2", "ntuple2.root");
Write("ntuple3", "ntuple3.root");
std::vector<RNTupleOpenSpec>
ntuples = {
{"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())
Creates an RNTupleWriter backed by storage, overwriting it if one with the same URI exists.
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 ].