Skip to content
Discussion options

You must be logged in to vote

If I'm understanding what you are saying with the ak.sum(events.PMT.E), you want it to sum the energies for all PMTs correct?
I can probably recreate some mock data that look like what you're saying where I have 3 PMTs and they each have 3 values X,Y and Z

import awkward as ak
import numpy as np
import uproot

np.random.seed(42)
events_data = {}
for i in range(1, 4):
    events_data[f'PMT{i}_X'] = np.random.normal(0, 1, 1000).astype(np.float32)
    events_data[f'PMT{i}_Y'] = np.random.normal(0, 1, 1000).astype(np.float32)
    events_data[f'PMT{i}_Z'] = np.random.normal(0, 1, 1000).astype(np.float32)
events = ak.Array(events_data)

with uproot.recreate("mock_data.root") as f:
    f["tree"] = 

Replies: 5 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@wiso
Comment options

Answer selected by wiso
Comment options

You must be logged in to vote
1 reply
@wiso
Comment options

Comment options

You must be logged in to vote
1 reply
@wiso
Comment options

Comment options

You must be logged in to vote
4 replies
@ikrommyd
Comment options

ikrommyd Sep 8, 2025
Collaborator

@wiso
Comment options

@ikrommyd
Comment options

ikrommyd Sep 8, 2025
Collaborator

@ikrommyd
Comment options

ikrommyd Sep 8, 2025
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants