# Mathematical calculation in ROOT

I have .dat file and after reading it i have drawn the graph.Now what i need to do is to take all the points which comes in the range( i.e. the points between the local maximum and minimum points just next to each other of which the difference between these two extreme points is less than or equal to 0.3 % deviation(can be seen from the graph) until that point is encountered where there is a maximum point just before the global minimum point from the beginning) and then taking the average of these all points which have been selected by the above condition( it also needs to be calculate the points which comes under this condition which varies from graph to graph obviously.
I am attaching the .dat file, the commands until the graph is drawn and the pdf file of the graph.
Now what i need is that after the graph is drawn,how should i proceed to accomplish the above task through ROOT commands as to make my task easy as there are lots of graphs.

I would be highly grateful for the reply here i am attaching the data file in .txt form as it didn’t accept the .dat one,so make changes according to it in the command.ev00100filtt.txt (191.7 KB)
10th nov 04.c (3.9 KB)

You will need to write c++ code. In principle you can simply iterate over an array of x,y points, there is nothing specific to ROOT here. If you don’t know how to do this in c++ then maybe stackoverflow might be a more appropriate place to ask.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.