Adapted from tv3.C Illustrates various RNTuple introspection methods.
#include <cassert>
private:
double fX = 0;
double fY = 0;
double fZ = 0;
public:
double x()
const {
return fX; }
double y()
const {
return fY; }
double z() const { return fZ; }
void SetXYZ(
double x,
double y,
double z) {
fZ = z;
}
};
void Generate()
{
for (unsigned int i = 0; i < 500000; ++i) {
}
}
Generate();
TH1F h1(
"x",
"x component of Vector3", 100, -3, 3);
{
for (
auto i :
reader->GetEntryRange()) {
}
}
TH1F h2(
"y",
"y component of Vector3", 100, -5, 20);
for (
auto i :
reader->GetEntryRange()) {
}
h2.DrawCopy();
float nbytesRead =
reader->GetMetrics().GetCounter(
"RNTupleReader.RPageSourceFile.szReadPayload")->GetValueAsInt() +
reader->GetMetrics().GetCounter(
"RNTupleReader.RPageSourceFile.szReadOverhead")->GetValueAsInt();
std::cout <<
"File size: " <<
fileSize / 1024. / 1024. <<
" MiB" << std::endl;
std::cout <<
"Read from file: " <<
nbytesRead / 1024. / 1024. <<
" MiB" << std::endl;
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
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.
Common user-tunable settings for storing RNTuples.
void SetCompression(std::uint32_t val)
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 Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
virtual TH1 * DrawCopy(Option_t *option="", const char *name_postfix="_copy") const
Copy this histogram and Draw in the current pad.
This is the base class for the ROOT Random number generators.
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
@ kUseGeneralPurpose
Use the new recommended general-purpose setting; it is a best trade-off between compression ratio/dec...