# Histogram pattern

**URL:** <https://root-forum.cern.ch/t/histogram-pattern/38776>\
**Category:** Newbie\
**Tags:** hist\
**Created:** [April 8, 2020, 3:43pm UTC](https://root-forum.cern.ch/t/histogram-pattern/38776 "2020-04-08T15:43:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [April 8, 2020, 4:46pm UTC](https://root-forum.cern.ch/t/histogram-pattern/38776/2 "2020-04-08T16:46:13Z")

</div>

> [@How I can convert dat file to root file](https://root-forum.cern.ch/t/how-i-can-convert-dat-file-to-root-file/37793/2):
>
> { TGraph \*g = new TGraph("10B27Al-120MeV-Ge-8.dat"); g-\>SetTitle("Sample title;channel number;#counts"); Int\_t T\_real = g-\>GetY()[0]; g-\>GetY()[0] = 0; Int\_t T\_vivo = g-\>GetY()[1]; g-\>GetY()[1] = 0; std::cout \<\< "Espectro en: " \<\< g-\>GetN() \<\< " canales" \<\< std::endl; std::cout \<\< "T real: " \<\< T\_real \<\< " s" \<\< std::endl; std::cout \<\< "T vivo: " \<\< T\_vivo \<\< " s" \<\< std::endl; g-\>Draw("ALP"); // g-\>SetMinimum(1); gPad-\>SetLogy(1); }

---

_[View the full topic](https://root-forum.cern.ch/t/histogram-pattern/38776)._
