15 TH1D hist(
"hist",
"hist", 10, 0, 100);
16 hist.FillRandom(
"gaus", 1000);
23 file->Put(hist.GetName(), hist);
24 file->Put(std::string(
"a/") + hist.GetName(), hist);
25 file->Put(std::string(
"a/b/") + hist.GetName(), hist);
37 for (
auto key : file->ListKeys()) {
41 auto hist = file->Get<
TH1D>(key.GetPath());
44 std::cout << key.GetClassName() <<
" at " << key.GetPath() <<
';' << key.GetCycle() <<
":\n";
45 std::cout <<
" entries: " << hist->
GetEntries() <<
"\n";
51 const char *
const fileName =
"rfile_basics.root";
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TSystem * gSystem
static std::unique_ptr< RFile > Recreate(std::string_view path)
Opens the file for reading/writing, overwriting it if it already exists.
static std::unique_ptr< RFile > Open(std::string_view path)
Opens the file for reading.
1-D histogram with a double per channel (see TH1 documentation)
virtual Double_t GetEntries() const
Return the current number of entries.
virtual int Unlink(const char *name)
Unlink, i.e.