# Time Callibration of Histograms

**URL:** <https://root-forum.cern.ch/t/time-callibration-of-histograms/17978>\
**Category:** ROOT\
**Created:** [July 28, 2014, 8:41pm UTC](https://root-forum.cern.ch/t/time-callibration-of-histograms/17978 "2014-07-28T20:41:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![seadrows16](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@seadrows16](https://root-forum.cern.ch/u/seadrows16)\
**Post date:** [July 28, 2014, 8:41pm UTC](https://root-forum.cern.ch/t/time-callibration-of-histograms/17978/1 "2014-07-28T20:41:30Z")

</div>

Dear ALL,  
I am relatively new to Root and C++. I am having issues with trying to calibrate the x-axis–change it from channels to units of time–on my histograms; we have already figure out which channels correspond to what times, i.e. channel 371 is 94 ns, channel 1341 is 200 ns, and so on. I beileve SetEntry might be the right approach, but it hasn’t worked for me yet. I would appreciate any advice.  
Thank You,  
Shaquann S.

---

<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:** [July 28, 2014, 10:07pm UTC](https://root-forum.cern.ch/t/time-callibration-of-histograms/17978/2 "2014-07-28T22:07:16Z")

</div>

> [@Can we shift histogram for several channels?](https://root-forum.cern.ch/t/can-we-shift-histogram-for-several-channels/12050/2):
>
> I’m not sure if this is fully kosher, but suit yourself : #include "TAxis.h" #include "TH1.h" #include "TArrayD.h" Double\_t ScaleX(Double\_t x) { Double\_t v; v = 10 \* x + 100; // "linear scaling" function example return v; } Double\_t ScaleY(Double\_t y) { Double\_t v; v = 20 \* y + 200; // "linear scaling" function example return v; } Double\_t ScaleZ(Double\_t z) { Double\_t v; v = 30 \* z + 300; // "linear scaling" function example return v; } void ScaleAxis(TAxis \*a, Double\_t (…

---

<div class="post-metadata">

**Author:** ![seadrows16](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@seadrows16](https://root-forum.cern.ch/u/seadrows16)\
**Post date:** [July 29, 2014, 3:28am UTC](https://root-forum.cern.ch/t/time-callibration-of-histograms/17978/3 "2014-07-29T03:28:45Z")

</div>

So is using an approxiamte linear fit of time with respect to channel the best option? Also, Thank You Wile E. Coyote.
