ATLAS Offline Software
Tools
PyUtils
bin
dump-event-from-file.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
3
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
4
5
""" Dump a pythonized version of the event content using RootFileDumper.
6
The main logic is similar to what's being done in diff-root.
7
Therefore, this can be used in conjunction w/ diff-root for further
8
debugging. """
9
def
dumpEvent
(fname, idx):
10
# import ROOT via RootUtils
11
import
PyUtils.RootUtils
as
ru
12
ru.import_root()
13
14
# file dumper: file, tree
15
data = ru.RootFileDumper(fname,
"CollectionTree"
)
16
17
# iterator: tree, idx
18
values = data.dump(
"CollectionTree"
, [
int
(idx)])
19
20
# loop over the iterator and print the values
21
try
:
22
while
True
:
23
val =
next
(values)
24
print
(val)
25
except
StopIteration:
26
pass
27
28
if
__name__ ==
"__main__"
:
29
import
sys
30
if
len(sys.argv)!=3:
31
print
(
"dump-event-from-file.py: A script to dump event information from a file"
)
32
print
(
"Usage:"
)
33
print
(f
"{sys.argv[0]} <file> <TTree index of the event>"
)
34
else
:
35
dumpEvent
(sys.argv[1], sys.argv[2])
CaloCellPos2Ntuple.int
int
Definition:
CaloCellPos2Ntuple.py:24
dump-event-from-file.dumpEvent
def dumpEvent(fname, idx)
Definition:
dump-event-from-file.py:9
fillPileUpNoiseLumi.next
next
Definition:
fillPileUpNoiseLumi.py:52
print
void print(char *figname, TCanvas *c1)
Definition:
TRTCalib_StrawStatusPlots.cxx:25
Generated on Thu Jan 2 2025 21:09:30 for ATLAS Offline Software by
1.8.18