ROOT
git-r3/HEAD
Reference Guide
Loading...
Searching...
No Matches
write_to_file.C
Go to the documentation of this file.
1
void
write_to_file
(){
2
3
// Instance of our histogram
4
TH1F
h
(
"my_histogram"
,
"My Title;X;# of entries"
,100,-5,5);
5
6
// Let's fill it randomly
7
h
.FillRandom(
"gaus"
);
8
9
// Let's open a TFile
10
TFile
out_file(
"my_rootfile.root"
,
"RECREATE"
);
11
12
// Write the histogram in the file
13
h
.Write();
14
15
// Close the file
16
out_file.
Close
();
17
}
h
#define h(i)
Definition
RSha256.hxx:106
TFile
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
Definition
TFile.h:130
TFile::Close
void Close(Option_t *option="") override
Close a file.
Definition
TFile.cxx:982
TH1F
1-D histogram with a float per channel (see TH1 documentation)
Definition
TH1.h:878
write_to_file
void write_to_file()
Definition
write_to_file.C:1
documentation
primer
macros
write_to_file.C
ROOTgit-r3/HEAD - Reference Guide Generated on
(GVA Time) using Doxygen 1.16.1