# Find peaks on 100 datasets

**URL:** <https://root-forum.cern.ch/t/find-peaks-on-100-datasets/58987>\
**Category:** Newbie\
**Created:** [April 14, 2024, 7:49am UTC](https://root-forum.cern.ch/t/find-peaks-on-100-datasets/58987 "2024-04-14T07:49:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vladik411413](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vladik411413/32/36215_2.png) [@vladik411413](https://root-forum.cern.ch/u/vladik411413)\
**Post date:** [April 14, 2024, 7:49am UTC](https://root-forum.cern.ch/t/find-peaks-on-100-datasets/58987/1 "2024-04-14T07:49:37Z")

</div>

Hi! I want to determine the x0 coordinates of 1 gaussian peak on each of the 100 datasets (text files where the points y and x are). And then I want to plot 1 TGraph errors, where the dependence of x0 on the parameter t will be presented. Is there an easy way to do it? Pls help

_ROOT Version:_ Not Provided  
_Platform:_ Linux  
_Compiler:_ Make

* * *

---

<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:** [April 14, 2024, 10:38am UTC](https://root-forum.cern.ch/t/find-peaks-on-100-datasets/58987/2 "2024-04-14T10:38:28Z")

</div>

Hi,

Yours looks like an interesting challenge.  
You can transform all 100 datasets in TGraph instances in a loop, do your fits, and save the parameters in a TGraphErrors.  
You can have a look to the documentation of the aforementioned classes as a start.

Best,  
D
