# Need Help Determining Flatness in ROOT (ProjectionX)

**URL:** <https://root-forum.cern.ch/t/need-help-determining-flatness-in-root-projectionx/60147>\
**Category:** Newbie\
**Tags:** graphics, hist, root\
**Created:** [July 9, 2024, 4:16pm UTC](https://root-forum.cern.ch/t/need-help-determining-flatness-in-root-projectionx/60147 "2024-07-09T16:16:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Soufiyan-Yachou](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/soufiyan-yachou/32/25806_2.png) [@Soufiyan-Yachou](https://root-forum.cern.ch/u/Soufiyan-Yachou)\
**Post date:** [July 9, 2024, 4:16pm UTC](https://root-forum.cern.ch/t/need-help-determining-flatness-in-root-projectionx/60147/1 "2024-07-09T16:16:55Z")

</div>

\_\_\_Hi everyone,

I have a cumulative dose curve for XY and YZ, and I want to determine the flatness for just the first millimeter. I need to fix the Y-axis to measure the flatness in just the first millimeter, but I don’t know how to do it in ROOT (ProjectionX).  
thank u for your helping in Advanced !

_ROOT Version:_ 6.24  
_Platform:_ Ubuntu Linux  
_Compiler:_ Not Provided

* * *

---

<div class="post-metadata">

**Author:** ![jonas](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jonas/32/24756_2.png) [@jonas](https://root-forum.cern.ch/u/jonas)\
**Post date:** [July 9, 2024, 10:41pm UTC](https://root-forum.cern.ch/t/need-help-determining-flatness-in-root-projectionx/60147/2 "2024-07-09T22:41:44Z")

</div>

Welcome back @Soufiyan-Yachou! I think we need a bit more info to answer this question.

How do you store these curves? In a TGraph? And what do you mathematically mean by “flatness”?

---

<div class="post-metadata">

**Author:** ![Soufiyan-Yachou](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/soufiyan-yachou/32/25806_2.png) [@Soufiyan-Yachou](https://root-forum.cern.ch/u/Soufiyan-Yachou)\
**Post date:** [July 10, 2024, 11:24am UTC](https://root-forum.cern.ch/t/need-help-determining-flatness-in-root-projectionx/60147/3 "2024-07-10T11:24:29Z")

</div>

Hi Jonas,

Thank you. It’s in the form of a histogram. The “flatness of dose” refers to the distribution of dose along the x, y, and z axes. Mathematically, it is represented as:  
Flatness Beam = 100 x (Dmax-Dmin)/Dmax+Dmin.
