-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add TH3 support * Remove debug @show * Add TH3F sample file and script * Improve TH3F sample * Fix hist readout and add tests * Allow returning missing for parents * Add tests for TH3F * More bootstrapping for ridiculous class inheritance madness (aka "why do we need Latex stuff to read a 1D histo??!!??")
- Loading branch information
Showing
5 changed files
with
264 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import random | ||
import ROOT | ||
|
||
# Create a ROOT file to store histograms | ||
file = ROOT.TFile("TH3F.root", "RECREATE") | ||
|
||
# Create a 3D histogram | ||
histogram = ROOT.TH3F( | ||
"histogram", | ||
"Example 3D Histogram;X Axis;Y Axis;Z Axis", | ||
10, -1, 1, | ||
20, -2, 2, | ||
30, -3, 3) | ||
|
||
random.seed(42) | ||
|
||
# Fill the histogram with some random data | ||
for i in range(1, 100000): | ||
x = random.random() * 3 - 1.5 | ||
y = random.random() * 5 - 2.5 | ||
z = random.random() * 7 - 3.5 | ||
histogram.Fill(x, y, z) | ||
|
||
# Write the histogram to the ROOT file | ||
histogram.Write() | ||
|
||
# Close the ROOT file | ||
file.Close() |
Binary file not shown.