You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: io/io/src/TFile.cxx
+39-17Lines changed: 39 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -13,15 +13,35 @@
13
13
\file TFile.cxx
14
14
\class TFile
15
15
\ingroup IO
16
-
\brief A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-like logical structure, possibly including subdirectory hierarchies.
16
+
\brief A file, usually with extension .root, that stores data and code in the form of serialized objects in a
17
+
file-system-like logical structure, possibly including subdirectory hierarchies.
18
+
\note ROOT files contain data, and executable code, for example through TExec, TMacro, and TFormula instances. As for all files, **do not open ROOT files from an unknown origin!**
17
19
\note See also \ref IO
18
20
\note See also \ref rootio (or `io/doc/TFile` folder in your codebase)
19
21
22
+
ROOT files a are an efficient mean to store C++ class instances, e.g. data,
23
+
both as individual objects, in a so called *row-wise fashion*, and in a
24
+
*so-called columnar fashion*. Also executable code can be stored in ROOT files,
25
+
for example in the form of TMacro, TExec or TFormula instances, and the
26
+
related federation of classes.
27
+
28
+
For example, a TCanvas or TPad instance may rely on TExec instances stored in
29
+
their *list of executables* to obtain certain graphics effects: in this case,
30
+
code will be executed upon drawing. A TH1 or a TGraph instance, as well as
31
+
their multidimensional counterparts and derived classes, may also execute code
32
+
upon drawing through TExec instances stored in their *list of functions*.
33
+
Another example of code which is executable is represented by TFormula
34
+
instances, that are the "computational workhorse" of function classes such as
35
+
TF1, its multidimensional counterparts, and related classes. There, jitted C++
36
+
code is executed for example upon evaluation, for example during fits or
37
+
drawing operations, to obtain maximum runtime performance.
38
+
39
+
20
40
<details>
21
41
<summary>ROOT file data format specification</summary>
22
42
23
43
A ROOT file is composed of a header, followed by consecutive data records
24
-
(`TKey` instances) with a well defined format.
44
+
(TKey instances) with a well defined format.
25
45
26
46
The first data record starts at byte fBEGIN (currently set to kBEGIN).
27
47
Bytes 1->kBEGIN contain the file description, when fVersion >= 1000000
0 commit comments