# .dat to .root

**URL:** <https://root-forum.cern.ch/t/dat-to-root/60045>\
**Category:** Newbie\
**Created:** [June 28, 2024, 10:06am UTC](https://root-forum.cern.ch/t/dat-to-root/60045 "2024-06-28T10:06:02Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [June 29, 2024, 10:00am UTC](https://root-forum.cern.ch/t/dat-to-root/60045/21 "2024-06-29T10:00:53Z")

</div>

Hi,

I used that code in a macro for ROOT 6.32.02.

Cheers,  
Danilo

---

<div class="post-metadata">

**Author:** ![Mukul](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/f4b2a3/32.png) [@Mukul](https://root-forum.cern.ch/u/Mukul)\
**Post date:** [June 29, 2024, 10:06am UTC](https://root-forum.cern.ch/t/dat-to-root/60045/22 "2024-06-29T10:06:04Z")

</div>

> [@Mukul](#):
>
> ROOT Version: 6.26/10  
> Platform: Ubuntu 22.04.2 LTS

This is the version I am working on.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [June 29, 2024, 6:51pm UTC](https://root-forum.cern.ch/t/dat-to-root/60045/23 "2024-06-29T18:51:04Z")

</div>

Try:  
`TFile *f = new TFile("output.root", "RECREATE", "", ROOT::CompressionSettings(ROOT::kLZMA, 9));`

---

<div class="post-metadata">

**Author:** ![Mukul](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/f4b2a3/32.png) [@Mukul](https://root-forum.cern.ch/u/Mukul)\
**Post date:** [June 30, 2024, 11:56am UTC](https://root-forum.cern.ch/t/dat-to-root/60045/24 "2024-06-30T11:56:17Z")

</div>

> [@Wile\_E\_Coyote](#):
>
> TFile \*f = new TFile(“output.root”, “RECREATE”, “”, ROOT::CompressionSettings(ROOT::kLZMA, 9));

Thanks. The file size reduced to 191M.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [June 30, 2024, 12:14pm UTC](https://root-forum.cern.ch/t/dat-to-root/60045/25 "2024-06-30T12:14:40Z")

</div>

Then try `8`, `7`, and `6` (instead of `9`). Maybe the size will not differ much, but it could be faster.

Also, you can try to play with other compression algorithms and levels → [`Compression.h`](https://root.cern.ch/doc/v626/Compression_8h_source.html)

[Previous page](https://root-forum.cern.ch/t/dat-to-root/60045.md?page=1)
