# How to read the rootfiles and TTree

**URL:** <https://root-forum.cern.ch/t/how-to-read-the-rootfiles-and-ttree/34714>\
**Category:** Newbie\
**Created:** [June 19, 2019, 9:42pm UTC](https://root-forum.cern.ch/t/how-to-read-the-rootfiles-and-ttree/34714 "2019-06-19T21:42:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shahina](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/shahina/32/19464_2.png) [@shahina](https://root-forum.cern.ch/u/shahina)\
**Post date:** [June 19, 2019, 9:42pm UTC](https://root-forum.cern.ch/t/how-to-read-the-rootfiles-and-ttree/34714/1 "2019-06-19T21:42:21Z")

</div>

Hi all. I have some root files already present and I need to read the data inside the root file using TTree.How to do that?

---

<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:** [June 20, 2019, 7:57am UTC](https://root-forum.cern.ch/t/how-to-read-the-rootfiles-and-ttree/34714/2 "2019-06-20T07:57:32Z")

</div>

At the root prompt you need first to open your file:

```auto
root[0] auto file = new TFile("your_root_file.root");

```

then

```auto
root[1] file->ls()

```

will show you the content of your file.  
They you can access your tree directly:

```auto
root[2] your_tree->Print();

```
