GWOLLUM  4.2.0
Tools for gravitational-wave analyses
ReadTriggerMetaData Class Reference

Access metadata in trigger files. More...

#include <ReadTriggerMetaData.h>

Inheritance diagram for ReadTriggerMetaData:
Collaboration diagram for ReadTriggerMetaData:

Public Member Functions

double GetFrequencyMax (void)
 Returns the absolute maximum frequency [Hz]. More...
 
double GetFrequencyMin (void)
 Returns the absolute minimum frequency [Hz]. More...
 
string GetProcessName (void)
 Returns the process name. More...
 
string GetProcessUser (void)
 Returns the process user name. More...
 
string GetProcessVersion (void)
 Returns the process version. More...
 
double GetQMax (void)
 Returns the absolute maximum Q value. More...
 
double GetQMin (void)
 Returns the absolute minimum Q value. More...
 
double GetSnrMax (void)
 Returns the absolute maximum SNR value. More...
 
double GetSnrMin (void)
 Returns the absolute minimum SNR value. More...
 
string Merge (const string aOutputDirectory)
 Merge all input files into one single file. More...
 
Constructors and destructors
 ReadTriggerMetaData (const string aPattern, const string aDirectory="", const unsigned int aVerbose=0)
 Constructor of the ReadTriggerMetaData class. More...
 
virtual ~ReadTriggerMetaData (void)
 Destructor of the ReadTriggerMetaData class. More...
 
- Public Member Functions inherited from Segments
bool AddSegment (const double aGpsStart, const double aGpsEnd, const int aTag=1)
 Adds a segment to the list. More...
 
bool AddSegments (Segments *aSeg)
 Adds a segment list to the list. More...
 
bool Append (const double aGpsStart, const double aGpsEnd, const int aTag=1)
 Appends a segment to the list. More...
 
bool Append (Segments *aSeg)
 Appends segments to the list. More...
 
bool Append (TTree *aSegmentTree)
 Appends segments to the list. More...
 
bool Append (vector< double > aGpsStarts, vector< double > aGpsEnds, vector< double > aTags)
 Appends segments to the list. More...
 
bool ApplyPadding (const double aPadStart, const double aPadEnd)
 Apply a padding to all segments. More...
 
void Dump (unsigned int aNcols=2, const string aTxtFileName="")
 Dumps the current segment list in the standard output or in a file. More...
 
double GetDuration (const unsigned int aSegmentIndex=0)
 Returns the duration of a given segment. More...
 
double GetEnd (const unsigned int aSegmentIndex=0)
 Returns the ending time of a given segment. More...
 
vector< double > GetEnds (void)
 Returns the list of segment ends. More...
 
double GetFirst ()
 Returns the starting time of the first segment. More...
 
TH1I * GetHisto (const double aOffset=0.0)
 Returns an histogram representing the segments. More...
 
TH1I * GetHistogram (const double aGpsStart, const double aGpsEnd, const double aOffset=0.0)
 Returns an histogram representing the segments. More...
 
double GetLast ()
 Returns the ending time of the last segment. More...
 
double GetLiveTime (const double aGpsStart, const double aGpsEnd)
 Returns the livetime between two GPS times. More...
 
double GetLiveTime (const unsigned int aSegmentIndex)
 Returns the livetime of one segment. More...
 
double GetLiveTime (void)
 Returns the total livetime. More...
 
double GetLiveTimeWithTag (const int aTag)
 Returns the livetime for segments with a given tag. More...
 
unsigned int GetN (void)
 Returns the number of time segments in the list. More...
 
unsigned int GetNWithTag (const int aTag)
 Returns the number of time segments in the list with a given tag. More...
 
int GetSegmentStartBefore (const double aGps)
 Returns the segment starting just before a given GPS time. More...
 
double GetStart (const unsigned int aSegmentIndex=0)
 Returns the starting time of a given segment. More...
 
vector< double > GetStarts (void)
 Returns the list of segment starts. More...
 
bool GetStatus (void) const
 Returns the status of the Segments object. More...
 
int GetTag (const unsigned int aSegmentIndex=0)
 Returns the tag of a given segment. More...
 
vector< int > GetTags (void)
 Returns the list of segment tags. More...
 
TTree * GetTree (const double aGpsStart, const double aGpsEnd)
 Returns a formatted TTree representing the segments. More...
 
TTree * GetTree (void)
 Returns a formatted TTree representing the segments. More...
 
bool Intersect (const double aGpsStart, const double aGpsEnd, const int aTag=1)
 Intersects with a segment. More...
 
bool Intersect (Segments *aSeg)
 Intersects with a segment list. More...
 
bool IsInsideSegment (const double aGps)
 Checks whether a given GPS time is inside a segment of the list. More...
 
bool IsInsideSegment (unsigned int &aSegmentIndex, const double aGps)
 Checks whether a given GPS time is inside a segment of the list. More...
 
bool MakeSecond (void)
 Rounds segment boundaries to integer seconds. More...
 
void Reset (void)
 Resets the segment list. More...
 
bool Reverse (void)
 Reverses the segment list. More...
 
void SetTag (const unsigned int aSegmentIndex, const int aTag)
 Tags a given segment. More...
 
void SetTags (const int aTag)
 Tags all segments. More...
 
bool TruncateAfter (const double aGps)
 Removes segments after a given time. More...
 
bool TruncateBefore (const double aGps)
 Removes segments before a given time. More...
 
 Segments (void)
 Default constructor of the Segments class. More...
 
 Segments (const string aSegmentFile, const int aDefaultTag=1)
 Constructor of the Segments class. More...
 
 Segments (TTree *aSegmentTree)
 Constructor of the Segments class. More...
 
 Segments (const string aFilePattern, const string aDirectory, const string aTreeName)
 Constructor of the Segments class. More...
 
 Segments (const vector< double > aGpsStarts, const vector< double > aGpsEnds)
 Constructor of the Segments class. More...
 
 Segments (const double aGpsStart, const double aGpsEnd, const int aTag=1)
 Constructor of the Segments class. More...
 
virtual ~Segments (void)
 Destructor of the Segments class. More...
 
- Public Member Functions inherited from Streams
void GetDetectorAMResponse (double &aFplus, double &aFcross, const double aRa, const double aDec, const double aPsi, const double aGmst)
 Computes antenna factors \(F_+\) and \(F_\times\). More...
 
unsigned int GetDetectorIndex (void)
 Returns the detector index for this stream. More...
 
string GetDetectorPrefix (void)
 Returns the detector prefix for this stream. More...
 
string GetDirectory (const string aOutDir=".")
 Returns the stream directory. More...
 
double GetLocalTime (const double aRa, const double aDec, const double aGeocentricTime)
 Converts the geocentric time to the detector local time [s]. More...
 
string GetName (void)
 Returns the stream full name. More...
 
string GetNameConv (void)
 Returns the stream name using the LIGO-Virgo file name convention. More...
 
string GetNamePrefix (void)
 Returns the stream name prefix. More...
 
string GetNameSuffix (void)
 Returns the stream name suffix. More...
 
string GetNameSuffixUnderScore (void)
 Returns the stream name suffix with only underscores. More...
 
string GetTriggerFileName (const unsigned int aGpsStart, const unsigned int aDuration, const string aFileFormat="root", const string aProcessName="PROC", const string aOutDir=".")
 Returns the stream trigger file name. More...
 
void SetName (const string aName)
 Sets a new name to the stream. More...
 
 Streams (const string aName, const unsigned int aVerbose=0)
 Constructor of the Streams class. More...
 
virtual ~Streams (void)
 Destructor of the Streams class. More...
 
- Public Member Functions inherited from Sample
double GetHighPassFrequency (void)
 Returns the current highpass frequency. More...
 
unsigned int GetNativeFrequency (void)
 Returns the current native sampling frequency [Hz]. More...
 
unsigned int GetWindowSize (void)
 Returns the window size (=0 if no windowing). More...
 
unsigned int GetWorkingFrequency (void)
 Returns the current working sampling frequency [Hz]. More...
 
void SetDCRemoval (const bool aDCremove=true)
 Activates/Deactivates the DC removal. More...
 
bool SetFrequencies (const unsigned int aNativeFrequency, const unsigned int aWorkingFrequency, const double aHighPassFrequency=0.0)
 Defines frequencies for the transformation. More...
 
bool SetHighPassFrequency (const double aHighPassFrequency)
 Defines a highpass frequency. More...
 
bool SetNativeFrequency (const int aNativeFrequency)
 Sets a new native sampling frequency. More...
 
void SetWindow (const unsigned int aWindowSize, double *aWindow)
 Defines the window. More...
 
bool SetWorkingFrequency (const unsigned int aWorkingFrequency)
 Sets a new working sampling frequency. More...
 
bool Transform (const unsigned int aInSize, double *aInData, const unsigned int aOutSize, double *aOutData)
 Transforms data. More...
 
 Sample (const unsigned int aVerbosity=0)
 Constructor of the Sample class. More...
 
virtual ~Sample (void)
 Destructor of the Sample class. More...
 
- Public Member Functions inherited from GwollumOptions
void Add (const string aTag, const string aKey, const double aDefaultValue, const unsigned int aSize=0)
 Adds an option to the list (double). More...
 
void Add (const string aTag, const string aKey, const int aDefaultValue, const unsigned int aSize=0)
 Adds an option to the list (int). More...
 
void Add (const string aTag, const string aKey, const string aDefaultValue, const unsigned int aSize=0)
 Adds an option to the list (string). More...
 
void Add (const string aTag, const string aKey, const unsigned int aDefaultValue, const unsigned int aSize=0)
 Adds an option to the list (unsigned int). More...
 
void AddOptionValue (const string aTag, const string aKey, const double aValue)
 Appends a value to a variable-size option (double). More...
 
void AddOptionValue (const string aTag, const string aKey, const int aValue)
 Appends a value to a variable-size option (int). More...
 
void AddOptionValue (const string aTag, const string aKey, const string aValue)
 Appends a value to a variable-size option (string). More...
 
void AddOptionValue (const string aTag, const string aKey, const unsigned int aValue)
 Appends a value to a variable-size option (unsigned int). More...
 
void Copy (GwollumOptions *aG)
 Copies an external GwollumOptions object into this. More...
 
void FillTree (void)
 Saves options in a TTree. More...
 
double GetOptionDefaultD (const unsigned int aOptionIndex)
 Returns an option default value. More...
 
int GetOptionDefaultI (const unsigned int aOptionIndex)
 Returns an option default value. More...
 
string GetOptionDefaultS (const unsigned int aOptionIndex)
 Returns an option default value. More...
 
unsigned int GetOptionDefaultU (const unsigned int aOptionIndex)
 Returns an option default value. More...
 
unsigned int GetOptionIndex (const string aTag, const string aKey)
 Returns the option index. More...
 
string GetOptionKey (const unsigned int aOptionIndex)
 Returns an option key. More...
 
unsigned int GetOptionNumberOfValues (const string aTag, const string aKey)
 Returns the option number of values. More...
 
unsigned int GetOptionSize (const string aTag, const string aKey)
 Returns the option size. More...
 
unsigned int GetOptionSize (const unsigned int aOptionIndex)
 Returns an option size. More...
 
unsigned int GetOptionsN (void)
 Returns the number of options. More...
 
string GetOptionTag (const unsigned int aOptionIndex)
 Returns an option tag. More...
 
char GetOptionType (const string aTag, const string aKey)
 Returns the option type. More...
 
char GetOptionType (const unsigned int aOptionIndex)
 Returns an option type. More...
 
double GetOptionValueD (const string aTag, const string aKey, const unsigned int aValIndex)
 Returns an option value (double). More...
 
bool GetOptionValueD (double &aValue, const string aTag, const string aKey, const unsigned int aValIndex)
 Returns an option value (double). More...
 
int GetOptionValueI (const string aTag, const string aKey, const unsigned int aValIndex)
 Returns an option value (int). More...
 
bool GetOptionValueI (int &aValue, const string aTag, const string aKey, const unsigned int aValIndex)
 Returns an option value (int). More...
 
string GetOptionValueS (const string aTag, const string aKey, const unsigned int aValIndex)
 Returns an option value (string). More...
 
bool GetOptionValueS (string &aValue, const string aTag, const string aKey, const unsigned int aValIndex)
 Returns an option value (string). More...
 
vector< double > GetOptionValuesD (const string aTag, const string aKey)
 Returns the list of option values (double). More...
 
vector< int > GetOptionValuesI (const string aTag, const string aKey)
 Returns the list of option values (int). More...
 
vector< string > GetOptionValuesS (const string aTag, const string aKey)
 Returns the list of option values (string). More...
 
vector< unsigned int > GetOptionValuesU (const string aTag, const string aKey)
 Returns the list of option values (unsigned int). More...
 
unsigned int GetOptionValueU (const string aTag, const string aKey, const unsigned int aValIndex)
 Returns an option value (unsigned int). More...
 
bool GetOptionValueU (unsigned int &aValue, const string aTag, const string aKey, const unsigned int aValIndex)
 Returns an option value (unsigned int). More...
 
bool Is (const string aTag, const string aKey)
 Checks whether an option exists. More...
 
bool IsProvided (const string aTag, const string aKey)
 Checks whether an option was provided. More...
 
bool IsTheSame (GwollumOptions *aG)
 Checks whether two GwollumOptions objects are identical. More...
 
bool ReadChain (bool &aIsUniform, TChain *aChain)
 Reads options from a TChain. More...
 
unsigned int ReadTextFile (const string aOptionFile)
 Reads an option file and extract the list of options. More...
 
bool ReadTree (const string aRootFileName, const string aTreeName)
 Reads options from a TTree in a ROOT file. More...
 
bool ReadTree (TTree *aTree)
 Reads options from a TTree. More...
 
void RemoveOption (const string aTag, const string aKey)
 Removes an option. More...
 
void Reset (void)
 Resets the list of options. More...
 
void ResetOption (const string aTag, const string aKey)
 Resets the list of option values. More...
 
void SetDefault (const string aTag, const string aKey)
 Sets an option to default value. More...
 
void SetOptionValue (const string aTag, const string aKey, const unsigned int aValIndex, const double aValue)
 Sets a value of an option (double). More...
 
void SetOptionValue (const string aTag, const string aKey, const unsigned int aValIndex, const int aValue)
 Sets a value of an option (int). More...
 
void SetOptionValue (const string aTag, const string aKey, const unsigned int aValIndex, const string aValue)
 Sets a value of an option (string). More...
 
void SetOptionValue (const string aTag, const string aKey, const unsigned int aValIndex, const unsigned int aValue)
 Sets a value of an option (unsigned int). More...
 
void WriteH5 (H5::H5File *aFile, H5::DataSpace &aDataSpace)
 Writes the options as attributes in a hdf5 file. More...
 
void WriteTextFile (const string aFileName)
 Writes all options in a text file. More...
 
void WriteTree (const string aTreeName)
 Writes the option TTree in a TFile. More...
 
void WriteTree (const string aTreeName, const string aRootFileName, const string aSubDirectory="")
 Writes the option TTree in a TFile. More...
 
 GwollumOptions (void)
 Constructor of the GwollumOptions class. More...
 
virtual ~GwollumOptions (void)
 Destructor of the GwollumOptions class. More...
 

Protected Attributes

unsigned int Verbose
 Verbosity level. More...
 
- Protected Attributes inherited from Streams
string Name
 Stream name. More...
 
- Protected Attributes inherited from Sample
double fHighPassFrequency
 Cutoff frequency. More...
 
unsigned int fNativeFrequency
 Native sampling frequency. More...
 
bool fRemoveDC
 DC removal flag. More...
 
unsigned int fVerbosity
 Verbosity level. More...
 
double * fWindow
 Window. More...
 
unsigned int fWindowSize
 Window size. More...
 
unsigned int fWorkingFrequency
 Working sampling frequency. More...
 

Private Attributes

bool go_uniform
 true if the Gwollum options are uniform. More...
 
double * Mend
 End time. More...
 
double * Mfmax
 Meta frequency max. More...
 
double Mfmax_stat
 Meta frequency max (static). More...
 
double * Mfmin
 Meta frequency min. More...
 
double Mfmin_stat
 Meta frequency min (static). More...
 
unsigned int Mn
 Number of entries. More...
 
string Mprocessname
 Process name. More...
 
string Mprocessuser
 User name. More...
 
string Mprocessversion
 Process version. More...
 
double * Mqmax
 Meta Q max. More...
 
double Mqmax_stat
 Meta Q max (static). More...
 
double * Mqmin
 Meta Q min. More...
 
double Mqmin_stat
 Meta Q min (static). More...
 
double * Msnrmax
 Meta SNR max. More...
 
double Msnrmax_stat
 Meta SNR max (static). More...
 
double * Msnrmin
 Meta SNR min. More...
 
double Msnrmin_stat
 Meta SNR min (static). More...
 
double * Mstart
 Start time. More...
 
string pattern
 Input file pattern. More...
 
string subdir
 Input file subdirectory. More...
 

Detailed Description

Access metadata in trigger files.

This class is designed to read triggers metadata stored in TTrees saved in ROOT files. It should be used when you are only interested by the metadata content of trigger files. Only the segment and metadata contents of the files are loaded so this class is much faster than the ReadTriggers class since the triggers are never loaded. This is quite useful when hundreds of files need to be scanned.

Author
Florent Robinet

Constructor & Destructor Documentation

◆ ReadTriggerMetaData()

ReadTriggerMetaData::ReadTriggerMetaData ( const string  aPattern,
const string  aDirectory = "",
const unsigned int  aVerbose = 0 
)

Constructor of the ReadTriggerMetaData class.

The segment tree and the metadata tree in ROOT files designated by a file pattern are scanned.

The metadata parameters (frequency, Q, and SNR) are scanned and the absolute minimum/maximum is found.

The metadata may also include a list of options. The options are downloaded as a GwollumOptions object.

The segment tree in the input files are also downloaded. These segments can be accessed using the methods of the Segments class from which this class inherits.

The stream name in the metadata is used to initiate the Streams object.

Warning
When scanning the files, the reference process name and stream name are determined from the first file. Then, if, for the next files, the process name or the stream name changes, files are skipped.
Note
The process version and the username are extracted from the last file.
Parameters
[in]aPatternInput file pattern.
[in]aDirectoryROOT subdirectory. Use "" if none.
[in]aVerboseVerbosity level.

◆ ~ReadTriggerMetaData()

ReadTriggerMetaData::~ReadTriggerMetaData ( void  )
virtual

Destructor of the ReadTriggerMetaData class.

Member Function Documentation

◆ GetFrequencyMax()

double ReadTriggerMetaData::GetFrequencyMax ( void  )
inline

Returns the absolute maximum frequency [Hz].

◆ GetFrequencyMin()

double ReadTriggerMetaData::GetFrequencyMin ( void  )
inline

Returns the absolute minimum frequency [Hz].

◆ GetProcessName()

string ReadTriggerMetaData::GetProcessName ( void  )
inline

Returns the process name.

◆ GetProcessUser()

string ReadTriggerMetaData::GetProcessUser ( void  )
inline

Returns the process user name.

◆ GetProcessVersion()

string ReadTriggerMetaData::GetProcessVersion ( void  )
inline

Returns the process version.

◆ GetQMax()

double ReadTriggerMetaData::GetQMax ( void  )
inline

Returns the absolute maximum Q value.

◆ GetQMin()

double ReadTriggerMetaData::GetQMin ( void  )
inline

Returns the absolute minimum Q value.

◆ GetSnrMax()

double ReadTriggerMetaData::GetSnrMax ( void  )
inline

Returns the absolute maximum SNR value.

◆ GetSnrMin()

double ReadTriggerMetaData::GetSnrMin ( void  )
inline

Returns the absolute minimum SNR value.

◆ Merge()

string ReadTriggerMetaData::Merge ( const string  aOutputDirectory)

Merge all input files into one single file.

Warning
The merge operation can only happen if the set of option is uniform accross the multiple files.
Returns
The path to the output file. "" is returned if the merge fails.
Parameters
[in]aOutputDirectoryOutput directory.

Member Data Documentation

◆ go_uniform

bool ReadTriggerMetaData::go_uniform
private

true if the Gwollum options are uniform.

◆ Mend

double* ReadTriggerMetaData::Mend
private

End time.

◆ Mfmax

double* ReadTriggerMetaData::Mfmax
private

Meta frequency max.

◆ Mfmax_stat

double ReadTriggerMetaData::Mfmax_stat
private

Meta frequency max (static).

◆ Mfmin

double* ReadTriggerMetaData::Mfmin
private

Meta frequency min.

◆ Mfmin_stat

double ReadTriggerMetaData::Mfmin_stat
private

Meta frequency min (static).

◆ Mn

unsigned int ReadTriggerMetaData::Mn
private

Number of entries.

◆ Mprocessname

string ReadTriggerMetaData::Mprocessname
private

Process name.

◆ Mprocessuser

string ReadTriggerMetaData::Mprocessuser
private

User name.

◆ Mprocessversion

string ReadTriggerMetaData::Mprocessversion
private

Process version.

◆ Mqmax

double* ReadTriggerMetaData::Mqmax
private

Meta Q max.

◆ Mqmax_stat

double ReadTriggerMetaData::Mqmax_stat
private

Meta Q max (static).

◆ Mqmin

double* ReadTriggerMetaData::Mqmin
private

Meta Q min.

◆ Mqmin_stat

double ReadTriggerMetaData::Mqmin_stat
private

Meta Q min (static).

◆ Msnrmax

double* ReadTriggerMetaData::Msnrmax
private

Meta SNR max.

◆ Msnrmax_stat

double ReadTriggerMetaData::Msnrmax_stat
private

Meta SNR max (static).

◆ Msnrmin

double* ReadTriggerMetaData::Msnrmin
private

Meta SNR min.

◆ Msnrmin_stat

double ReadTriggerMetaData::Msnrmin_stat
private

Meta SNR min (static).

◆ Mstart

double* ReadTriggerMetaData::Mstart
private

Start time.

◆ pattern

string ReadTriggerMetaData::pattern
private

Input file pattern.

◆ subdir

string ReadTriggerMetaData::subdir
private

Input file subdirectory.

◆ Verbose

unsigned int ReadTriggerMetaData::Verbose
protected

Verbosity level.


The documentation for this class was generated from the following files: