File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -81,12 +81,12 @@ print(f"Read {fname}:{tree_name}. \n {tree.num_entries} events in total")
81
81
> Exercise 1.2: inspect available branches in a rootfile
82
82
> - use ``` tree.keys(filter_name="*",recursive=False) ``` to display all branches
83
83
> - extract a given branch to dataframe
84
- ``` console
84
+ ``` console
85
85
bname = "MCParticles"
86
86
df = tree[bname].array(library="ak")
87
87
df = ak.to_dataframe(df)
88
88
print(df)
89
- ```
89
+ ```
90
90
{: .challenge}
91
91
92
92
@@ -99,7 +99,6 @@ pdg_id = part.pdgid.abspid
99
99
condition1 = df["MCParticles.PDG"]==pdg_id
100
100
# select primary particles
101
101
condition2 = df["MCParticles.generatorStatus"]==1
102
-
103
102
# extract momentum and plot
104
103
# all electrons
105
104
df_new = df[condition1]
You can’t perform that action at this time.
0 commit comments