# Split the data

**URL:** <https://root-forum.cern.ch/t/split-the-data/53227>\
**Category:** ROOT\
**Tags:** python, hist, root\
**Created:** [January 23, 2023, 3:41pm UTC](https://root-forum.cern.ch/t/split-the-data/53227 "2023-01-23T15:41:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fredrih](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/f/b19c9b/32.png) [@Fredrih](https://root-forum.cern.ch/u/Fredrih)\
**Post date:** [January 23, 2023, 3:41pm UTC](https://root-forum.cern.ch/t/split-the-data/53227/1 "2023-01-23T15:41:44Z")

</div>

Salut.  
The branch contains data on 5000 events: there are 10230 points for each event. How do I make it so that I can work with each event separately?  
Now, when calling rootbrowse, a histogram is displayed with the summation of all events.  
I can send you the file by email.

\_ROOT Version: 6.26/10  
\_Platform: Ubuntu  
\_Compiler: pycharm community

* * *

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [January 23, 2023, 3:46pm UTC](https://root-forum.cern.ch/t/split-the-data/53227/2 "2023-01-23T15:46:04Z")

</div>

Why don’t you use TTree:Draw to select exactly what you want to see?  
rootbrowse is a generic tool to quickly browse your data. For a real analysis  
of your data, you need to use the real ROOT.

---

<div class="post-metadata">

**Author:** ![Fredrih](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/f/b19c9b/32.png) [@Fredrih](https://root-forum.cern.ch/u/Fredrih)\
**Post date:** [January 24, 2023, 11:29am UTC](https://root-forum.cern.ch/t/split-the-data/53227/3 "2023-01-24T11:29:10Z")

</div>

TTree:Draw show all 5000 events on one histogram. I need to work with single events.

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [January 24, 2023, 11:34am UTC](https://root-forum.cern.ch/t/split-the-data/53227/4 "2023-01-24T11:34:32Z")

</div>

> [@Loop in TTree with selection](https://root-forum.cern.ch/t/loop-in-ttree-with-selection/46210/2):
>
> Check out [Chapter: Trees](https://root.cern/root/htmldoc/guides/users-guide/Trees.html) I particular, search for “void tree1r” to see a basic example that shows how to loop over the tree and fill histograms, just like you want.

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [January 24, 2023, 11:34am UTC](https://root-forum.cern.ch/t/split-the-data/53227/5 "2023-01-24T11:34:46Z")

</div>

Hi @Fredrih ,

Indeed, double-clicking on a branch of a tree in the ROOT browser will only display a histogram of the contents of that branch.

For more complex uses, I suggest you try out [RDataFrame](https://root.cern/doc/master/classROOT_1_1RDataFrame.html), your swiss-army knife for physics analysis in ROOT. You can find many tutorials at → [ROOT: Dataframe tutorials](https://root.cern.ch/doc/master/group __tutorial__ dataframe.html), and you can also find examples of usage here in the forum.  
Cheers,  
Vincenzo

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [February 7, 2023, 11:35am UTC](https://root-forum.cern.ch/t/split-the-data/53227/6 "2023-02-07T11:35:07Z")

</div>

Closed on February 7, 2023, 11:35am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
