This macro illustrates how to create a hierarchy of directories in a Root file.
Ten directories called plane0, plane1, ..., plane9 are created. Each plane directory contains 200 histograms. Note that the macro deletes the TFile object at the end! Connect the file again in read mode:
Root [0] TFile top("top.root");
The hierarchy can be browsed by the Root browser as shown below
Click on the left pane on one of the plane directories. This shows the list of all histograms in this directory. Double click on one histogram to draw it (left mouse button). Select different options with the right mouse button. Instead of using the browser, you can also do:
Root > tof->cd();
Root > plane3->cd();
Root > h3_90N->Draw();
}
}
for (k=0;k<100;k++) {
hn[i][
j]->Fill(100*
r.Rndm(),i+
j);
hs[i][
j]->Fill(100*
r.Rndm(),i+
j+k);
}
}
}
delete top;
}
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
TDirectory * mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory=kFALSE) override
Create a sub-directory "a" or a hierarchy of sub-directories "a/b/c/...".
Describe directory structure in memory.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Int_t Write(const char *name=nullptr, Int_t opt=0, Int_t bufsiz=0) override
Write memory objects to this file.
1-D histogram with a float per channel (see TH1 documentation)
This is the base class for the ROOT Random number generators.
- Author
- Rene Brun
Definition in file dirs.C.