Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions DQMServices/Components/scripts/dqmiodumpmetadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

f = uproot.open(args.filename)
things = f.keys()
if b'Indices;1' in things:
indices = f[b'Indices']
runs = indices.array(b"Run")
lumis = indices.array(b"Lumi")
firstindex = indices.array(b"FirstIndex")
lastindex = indices.array(b"LastIndex")
types = indices.array(b"Type")
if 'Indices;1' in things:
indices = f['Indices']
runs = indices['Run'].array()
lumis = indices['Lumi'].array()
firstindex = indices['FirstIndex'].array()
lastindex = indices['LastIndex'].array()
types = indices['Type'].array()

counts = defaultdict(lambda: 0)
for run, lumi, first, last, type in zip(runs, lumis, firstindex, lastindex, types):
Expand Down Expand Up @@ -54,5 +54,3 @@ def showrow():

else:
print("This does not look like DQMIO data.")


43 changes: 21 additions & 22 deletions DQMServices/Components/scripts/dqmiolistmes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

f = uproot.open(args.filename)
things = f.keys()
if b'Indices;1' in things:
indices = f[b'Indices']
runs = indices.array(b"Run")
lumis = indices.array(b"Lumi")
firstindex = indices.array(b"FirstIndex")
lastindex = indices.array(b"LastIndex")
types = indices.array(b"Type")
if 'Indices;1' in things:
indices = f['Indices']
runs = indices['Run'].array()
lumis = indices['Lumi'].array()
firstindex = indices['FirstIndex'].array()
lastindex = indices['LastIndex'].array()
types = indices['Type'].array()

# If run is not provided, print all available runs in a given file.
if args.r == None or args.r < 0:
Expand All @@ -36,25 +36,24 @@
exit()

treenames = [ # order matters!
b"Ints",
b"Floats",
b"Strings",
b"TH1Fs",
b"TH1Ss",
b"TH1Ds",
b"TH2Fs",
b"TH2Ss",
b"TH2Ds",
b"TH3Fs",
b"TProfiles",
b"TProfile2Ds"
"Ints",
"Floats",
"Strings",
"TH1Fs",
"TH1Ss",
"TH1Ds",
"TH2Fs",
"TH2Ss",
"TH2Ds",
"TH3Fs",
"TProfiles",
"TProfile2Ds"
]
trees = [f[name][b"FullName"].array() for name in treenames]
trees = [f[name]["FullName"].array() for name in treenames]

for run, lumi, first, last, type in zip(runs, lumis, firstindex, lastindex, types):
if run == args.r and lumi == args.l:
for i in range(first, int(last + 1)): # In DQMIO both ranges are inclusive
print(trees[type][i].decode())
print(trees[type][i])
else:
print("This does not look like DQMIO data.")

2 changes: 1 addition & 1 deletion DQMServices/Demo/test/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ dqmiodumpmetadata.py merged.root | grep -q '4 runs, 12 lumisections'
rootlist ()
{ python3 -c '
import uproot
for k in uproot.open("'"$1"'").allkeys(): print(k.decode())'
for k in uproot.open("'"$1"'").keys(): print(k)'
}

# we need to exclude MEs filled on run and lumi boundaries, since the split job *does* see a different number of begin/end run/lumi transitions.
Expand Down