ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
AthExHistNtup
python
read_hist_ntuple.py
Go to the documentation of this file.
1
#! /usr/bin/env python
2
# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
4
from
ROOT
import
TFile
5
print
(
":"
* 80)
6
print
(
"::: ntuple..."
)
7
f1 = TFile.Open(
"ntuple.root"
,
"READ"
)
8
t = f1.Get(
"trees/tree1"
)
9
print
(
":: entries:"
, t.GetEntries())
10
print
(
":: branches:"
, [b.GetName()
for
b
in
t.GetListOfBranches()])
11
for
i
in
range(t.GetEntries()):
12
if
t.GetEntry(i) <= 0:
13
print
(
"** error reading entry [%i]"
% (i,))
14
break
15
print
(
":: entry [%i]..."
% (i,))
16
print
(
":: run:"
, t.run)
17
print
(
":: size:"
, t.size)
18
print
(
":: rundata:"
, list(t.rundata))
19
print
(
":: done."
)
20
21
print
(
":"
* 80)
22
print
(
"::: histogram..."
)
23
f2 = TFile.Open(
"hist.root"
,
"READ"
)
24
h1 = f2.Get(
"simple1D/h1"
)
25
print
(
":: entries:"
, h1.GetEntries())
26
h1.Draw()
27
print
(
":: done."
)
28
29
print
(
"::: bye."
)
print
void print(char *figname, TCanvas *c1)
Definition
TRTCalib_StrawStatusPlots.cxx:26
Generated on
for ATLAS Offline Software by
1.17.0