So what I would like to do is the following:
I have a CSV file that contains 15 columns and some $10^{6}$ lines of data. Here is a sample of the data:
1,-1,112,0,599,8,128,-981,433,-459,880,-901,682,-913,506
2,-1,107,0,611,8,136,-981,410,-459,882,-901,682,-913,506
3,-1,107,0,612,8,142,-981,378,-459,887,-901,734,-913,519
4,-1,111,0,608,8,142,-981,106,-459,887,-901,744,-913,533
5,-1,113,0,601,8,141,-981,106,-459,867,-901,730,-913,533
6,-1,112,0,601,8,141,-981,234,-459,855,-901,692,-913,509
7,-1,108,0,600,8,148,-981,350,-459,856,-901,692,-913,506
8,-1,108,0,599,8,158,-981,350,-459,869,-901,656,-913,486
9,-1,108,0,601,8,158,-981,925,-459,869,-901,639,-913,443
10,-1,109,0,608,8,137,-981,957,-459,886,-901,642,-913,443
11,-1,109,0,608,8,132,-981,941,-459,907,-901,662,-913,484
I would like to load all the odd numbered columns (1,3,…) into vectors and then pass those vectors to the FFT algorithm in order to draw some conclusions from that.
What I have done to achieve this is the following:
- I have found the tutorial https://root.cern.ch/root/html/tutorials/tree/basic.C.html which describes how to load data from an ASCII file to an ntuple. However, I am uncertain as to how to modify this code to read from the CSV file that I have. I think a modification (maybe replacing the space with a comma?) should be brought to the lines of code:
dir.ReplaceAll("basic.C",""); dir.ReplaceAll("/./","/")
Is that correct?
- I have found the tutorial https://root.cern.ch/root/html/tutorials/fft/FFT.C.html which describes how to use the FFT algorithm for data arrays in the second part. However, I would like to modify this in order to have on one graph the real, imaginary and complex modulus of the discrete fourier transform of the input data. Again, I am unsure as to how should I go about this.
Thanks