GWOLLUM 4.2.0
Tools for gravitational-wave analyses
Loading...
Searching...
No Matches
ffl.h
Go to the documentation of this file.
1
6#ifndef __ffl__
7#define __ffl__
8
9#include "Monitor.h"
10#include "GwollumPlot.h"
11#include "Segments.h"
12#include <FrameL.h>
13#include <FrVect.h>
14
15using namespace std;
16
35class ffl{
36
37 public:
38
59 ffl(const string aFrameFileList,
60 const string aPlotStyle = "GWOLLUM",
61 const unsigned int aVerbosity = 0,
62 const string aTmpDirPath = ".",
63 const unsigned int aNTrials = 1,
64 const unsigned int aNSleepSeconds = 0);
65
69 virtual ~ffl(void);
77 inline bool GetStatus(void){ return mon->GetStatus(); };
78
83 void SetPlotName(const string aName);
84
88 inline string GetInputFfl(void){ return fInFrameFile; };
89
99 bool ExtractChannels(const unsigned int aGps);
100
105 inline Segments* GetSegments(void){ return seg; }
106
114 inline unsigned int GetChannelSampling(const string aChannelName, unsigned int &aChannelIndex){
115 for(aChannelIndex=0; aChannelIndex<channels.size(); aChannelIndex++){
116 if(!aChannelName.compare(channels[aChannelIndex]))
117 return sampling[aChannelIndex];
118 }
119 return 0;
120 };
121
128 inline unsigned int GetChannelSampling(const string aChannelName){
129 unsigned int dummy;
130 return GetChannelSampling(aChannelName, dummy);
131 };
132
138 inline bool PrintChannels(const unsigned int aGps=0){
139 bool res = ExtractChannels(aGps);
140 for(unsigned int l=0; l<channels.size(); l++)
141 cout<<channels[l]<<" "<<sampling[l]<<endl;
142 return res;
143 };
144
151 vector <string> GetChannelList(const string aFilter="");
152
159 inline bool IsChannel(const string aChannelName){
160 for(unsigned int l=0; l<channels.size(); l++){
161 if(!aChannelName.compare(channels[l])) return true;
162 }
163 return false;
164 };
165
182 double* GetData(unsigned int &aSize, const string aChannelName,
183 const double aGpsStart, const double aGpsEnd,
184 const double aMissing=999.0);
185
194 bool PrintData(const string aChannelName, const double aGpsStart, const double aGpsEnd, string aFileName);
195
204 TGraph* PlotData(const string aChannelName, const double aGpsStart, const double aGpsEnd);
205
206 private:
207
211 string srandint;
212 unsigned int ntrials;
213 unsigned int nsleepsec;
214
215 // DATA
217 FrFile *frfile;
218
219 // CHANNELS
220 vector <string> channels;
221 vector <unsigned int> sampling;
222
223 // PLOTS
225 TGraph *G;
226
227 // FRAME FILES
228 vector <string> ffl_framefile;
229 vector <unsigned int> ffl_gps;
230 vector <unsigned int> ffl_dur;
231 bool ffl_pure;
232
237 void ReadInputFile(const string aInFile);
238
239 ClassDef(ffl,0)
240
241};
242
243#endif
244
245
Interface to draw and print ROOT objects.
Process monitoring.
Time segment list management.
Interface to draw and print ROOT objects.
Definition GwollumPlot.h:39
Monitor a GWOLLUM processing.
Definition Monitor.h:39
bool GetStatus(void)
Returns the object status.
Definition Monitor.h:109
Manage time segment lists.
Definition Segments.h:29
Load frame files and access data in frames.
Definition ffl.h:35
bool ffl_pure
Flags a pure FFL file --> no need for a working file.
Definition ffl.h:231
bool IsChannel(const string aChannelName)
Tests whether a channel exists in the dataset pointed by the ffl.
Definition ffl.h:159
Segments * GetSegments(void)
Returns a pointer to the segments covered by the ffl.
Definition ffl.h:105
vector< string > GetChannelList(const string aFilter="")
Returns the current channel list.
Definition ffl.cc:209
unsigned int ntrials
Number of trials when accessing the data.
Definition ffl.h:212
vector< unsigned int > ffl_gps
Frame file GPS start.
Definition ffl.h:229
vector< string > channels
List of channels.
Definition ffl.h:220
virtual ~ffl(void)
Destructor of the ffl class.
Definition ffl.cc:99
void ReadInputFile(const string aInFile)
Reads an input file and extracts the list of frame files.
Definition ffl.cc:410
TGraph * G
Graph.
Definition ffl.h:225
vector< unsigned int > ffl_dur
Frame file duration.
Definition ffl.h:230
FrFile * frfile
Fr file.
Definition ffl.h:217
bool PrintData(const string aChannelName, const double aGpsStart, const double aGpsEnd, string aFileName)
Prints a data vector in a text file.
Definition ffl.cc:337
string fInFrameFile
Path to input frame file list.
Definition ffl.h:209
ffl(const string aFrameFileList, const string aPlotStyle="GWOLLUM", const unsigned int aVerbosity=0, const string aTmpDirPath=".", const unsigned int aNTrials=1, const unsigned int aNSleepSeconds=0)
Constructor of the ffl class.
bool ExtractChannels(const unsigned int aGps)
Extracts channels at a given GPS time.
Definition ffl.cc:126
unsigned int GetChannelSampling(const string aChannelName)
Returns the sampling rate of a given channel [Hz].
Definition ffl.h:128
GwollumPlot * GP
Plotting structure.
Definition ffl.h:224
unsigned int nsleepsec
Number of seconds between trials.
Definition ffl.h:213
vector< string > ffl_framefile
Frame file path.
Definition ffl.h:228
unsigned int GetChannelSampling(const string aChannelName, unsigned int &aChannelIndex)
Returns the sampling rate of a given channel [Hz].
Definition ffl.h:114
double * GetData(unsigned int &aSize, const string aChannelName, const double aGpsStart, const double aGpsEnd, const double aMissing=999.0)
Returns a data vector for a given channel and a GPS range.
Definition ffl.cc:238
TGraph * PlotData(const string aChannelName, const double aGpsStart, const double aGpsEnd)
Plots a data vector time series.
Definition ffl.cc:373
void SetPlotName(const string aName)
Sets a new name for the plotting structure.
Definition ffl.cc:116
vector< unsigned int > sampling
List of sampling frequencies.
Definition ffl.h:221
bool GetStatus(void)
Returns the class status.
Definition ffl.h:77
string fWoFrameFile
Path to working frame file (always FFL).
Definition ffl.h:210
Monitor * mon
Class status.
Definition ffl.h:208
Segments * seg
Segments covered by the ffl file.
Definition ffl.h:216
string GetInputFfl(void)
Returns the path to the input frame file list.
Definition ffl.h:88
bool PrintChannels(const unsigned int aGps=0)
Prints the list of channels at a given GPS time.
Definition ffl.h:138
string srandint
Random integer string.
Definition ffl.h:211