This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| root:pyroot_ttree [2018/02/28 13:58] – [TChain] iwn | root:pyroot_ttree [2018/02/28 14:03] (current) – [TChain] iwn | ||
|---|---|---|---|
| Line 102: | Line 102: | ||
| <code python> | <code python> | ||
| for event in tree: | for event in tree: | ||
| - | print tree.px | + | print event.px |
| </ | </ | ||
| If you also need the event' | If you also need the event' | ||
| <code python> | <code python> | ||
| for i, event in enumerate(tree): | for i, event in enumerate(tree): | ||
| - | print i, tree.px | + | print i, event.px |
| </ | </ | ||
| - | |||
| ===== Making a histogram with TTree ===== | ===== Making a histogram with TTree ===== | ||
| Line 197: | Line 196: | ||
| print event.px | print event.px | ||
| </ | </ | ||
| - | Note it's also possible to use a glob wildcard: '' | + | Looping over the events in a chain is similar as for [[root: |