# How to extract a data from dna.root file?

**URL:** <https://root-forum.cern.ch/t/how-to-extract-a-data-from-dna-root-file/16182>\
**Category:** ROOT\
**Created:** [June 3, 2013, 1:08pm UTC](https://root-forum.cern.ch/t/how-to-extract-a-data-from-dna-root-file/16182 "2013-06-03T13:08:06Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![rootroot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/rootroot/32/37811_2.png) [@rootroot](https://root-forum.cern.ch/u/rootroot)\
**Post date:** [June 3, 2013, 1:08pm UTC](https://root-forum.cern.ch/t/how-to-extract-a-data-from-dna-root-file/16182/1 "2013-06-03T13:08:06Z")

</div>

Good day for everyone! I need help!

I have simulated a proton particle track using Geant4dna software. The output file is dna.root - see attach 1.

I can visualise this file with a macro “Plot.C”. I can see a file structure using Root Explorer. But i cannot extract data from this file - see attach 2.  
I want to convert file dna.root to a simple txt file like:

## N1 X1 Y1 Z1 E1 TYPE1 … Nn Xn Yn Zn En TYPEn

Where are:  
Ni - number of I event  
Xi, Yi, Zi - 3D coordinates of particle-water interaction  
Ei - deposited energy  
TYPEn - type of interaction (ionisation or exitation).

Briefly, I want to convert dna.root to txt or csv file.

 ![](https://root-forum.cern.ch/uploads/default/original/2X/4/4f1a5bf7832bdbaa7f044967b248724044b45ef9.png)  
  
[dna.root](https://root-forum.cern.ch/uploads/default/original/2X/2/24b45ab9bde677b9efa642424b55d517eaf77795.root) (45 KB)

---

_[View the full topic](https://root-forum.cern.ch/t/how-to-extract-a-data-from-dna-root-file/16182)._
