GWOLLUM 4.2.0
Tools for gravitational-wave analyses
Loading...
Searching...
No Matches
MakeTriggers Class Reference

Write triggers to disk. More...

#include <MakeTriggers.h>

Inheritance diagram for MakeTriggers:
Collaboration diagram for MakeTriggers:

Classes

struct  h5_segments
 Segment structure for hdf5. More...
 
struct  h5_triggers
 Trigger structure for hdf5. More...
 

Public Member Functions

void Reset (void)
 Resets all.
 
void SetProcessName (const string aProcessName)
 Set the process name.
 
void SetProcessVersion (const string aProcessVersion)
 Sets the version for this process.
 
string Write (const string aOutDir=".", const string aFileFormat="", const string aFileName="", const string aSubDir="", const string aWriteMode="RECREATE", const bool aWriteMeta=true)
 Writes triggers to disk.
 
bool WriteMetaData (void)
 Writes the metadata in a ROOT file.
 
Constructors and destructors
 MakeTriggers (const string aStreamName, const unsigned int aVerbose=0)
 Constructor of the MakeTriggers class.
 
virtual ~MakeTriggers (void)
 Destructor of the MakeTriggers class.
 
- Public Member Functions inherited from Triggers
bool AddTrigger (const double aTime, const double aFrequency, const double aSNR, const double aQ, const double aTstart, const double aTend, const double aFstart, const double aFend, const double aAmplitude, const double aPhase)
 Adds a trigger to the Triggers object (only available in write-mode).
 
bool Clusterize (const int aTag=1)
 Clusters the triggers.
 
double GetClusterAmplitude (const unsigned int aClusterIndex)
 Returns the amplitude of a given cluster.
 
double GetClusterBandwidth (const unsigned int aClusterIndex)
 Returns the bandwidth of a given cluster [Hz].
 
double GetClusterDuration (const unsigned int aClusterIndex)
 Returns the duration of a given cluster [s].
 
Long64_t GetClusterFirstTrigger (const unsigned int aClusterIndex)
 Returns the index of the first trigger in a given cluster.
 
double GetClusterFrequency (const unsigned int aClusterIndex)
 Returns the frequency of a given cluster [Hz].
 
double GetClusterFrequencyEnd (const unsigned int aClusterIndex)
 Returns the end frequency of a given cluster [Hz].
 
double GetClusterFrequencyStart (const unsigned int aClusterIndex)
 Returns the start frequency of a given cluster [Hz].
 
int GetClusterIndex (const double aTime)
 Returns the index of cluster overlapping a given GPS time.
 
double GetClusterizeDt (void)
 Gets the clustering \(\delta t\) parameter.
 
unsigned int GetClusterizeSizeMin (void)
 Gets the cluster minimal size: \(M_{min}\).
 
double GetClusterizeSnrThr (void)
 Gets the SNR threshold for clustering.
 
double GetClusterMaxDuration (void)
 Returns the maximal duration of clusters [s].
 
double GetClusterMeanDuration (void)
 Returns the mean duration of clusters [s].
 
unsigned int GetClusterN (void)
 Returns the current number of clusters in memory.
 
double GetClusterPhase (const unsigned int aClusterIndex)
 Returns the phase of a given cluster [rad].
 
double GetClusterQ (const unsigned int aClusterIndex)
 Returns the quality factor of a given cluster.
 
unsigned int GetClusterSize (const unsigned int aClusterIndex)
 Returns the size (number of triggers) a given cluster.
 
double GetClusterSnr (const unsigned int aClusterIndex)
 Returns the signal-to-noise ratio of a given cluster.
 
int GetClusterTag (const unsigned int aClusterIndex)
 Returns the tag of a given cluster.
 
double GetClusterTime (const unsigned int aClusterIndex)
 Returns the time of a given cluster [s].
 
double GetClusterTimeEnd (const unsigned int aClusterIndex)
 Returns the end time of a given cluster [s].
 
double GetClusterTimeStart (const unsigned int aClusterIndex)
 Returns the start time of a given cluster [s].
 
double GetClusterTotalDuration (void)
 Returns the total duration of clusters [s].
 
double GetTriggerAmplitude (const Long64_t aTriggerIndex)
 Returns the amplitude of a given trigger.
 
double GetTriggerBandwidth (const Long64_t aTriggerIndex)
 Returns the bandwidth of a given trigger [Hz].
 
double GetTriggerDuration (const Long64_t aTriggerIndex)
 Returns the duration of a given trigger [s].
 
double GetTriggerFrequency (const Long64_t aTriggerIndex)
 Returns the frequency of a given trigger [Hz].
 
double GetTriggerFrequencyEnd (const Long64_t aTriggerIndex)
 Returns the end frequency of a given trigger [Hz].
 
double GetTriggerFrequencyStart (const Long64_t aTriggerIndex)
 Returns the start frequency of a given trigger [Hz].
 
Long64_t GetTriggerN (void)
 Returns the current number of triggers in memory.
 
double GetTriggerPhase (const Long64_t aTriggerIndex)
 Returns the phase of a given trigger [rad].
 
double GetTriggerQ (const Long64_t aTriggerIndex)
 Returns the quality factor of a given trigger.
 
double GetTriggerSnr (const Long64_t aTriggerIndex)
 Returns the signal-to-noise ratio of a given trigger.
 
double GetTriggerTime (const Long64_t aTriggerIndex)
 Returns the time of a given trigger [s].
 
double GetTriggerTimeEnd (const Long64_t aTriggerIndex)
 Returns the end time of a given trigger [s].
 
double GetTriggerTimeStart (const Long64_t aTriggerIndex)
 Returns the start time of a given trigger [s].
 
bool ReadTriggerFiles (const string aPattern, const string aDirectory="")
 Reads a set of trigger files.
 
void Reset (void)
 Resets the Triggers object.
 
void ResetClusters (void)
 Resets the list of clusters.
 
void SetClusterizeDt (const double aDt)
 Sets a new clustering \(\delta t\) parameter.
 
void SetClusterizeSizeMin (const unsigned int aSizeMin)
 Sets the cluster minimal size: \(M_{min}\).
 
void SetClusterizeSnrThr (const double aSnrThr)
 Sets the SNR threshold for clustering: \(\rho_{min}\).
 
void SetClusterTag (const int aTag)
 Sets a new tag value for all clusters.
 
void SetClusterTag (const unsigned int aClusterIndex, const int aTag)
 Sets a new cluster tag value.
 
bool SetTriggerBranchStatus (const string aBname, const bool aStatus=true)
 Modifies the branch status of the trigger tree.
 
bool SortTriggers (void)
 Sort triggers by increasing values of tstart (only available in write-mode).
 
 Triggers (const unsigned int aVerbose=0)
 Constructor of the Triggers class.
 
virtual ~Triggers (void)
 Destructor of the Triggers class.
 
- Public Member Functions inherited from Segments
bool AddSegment (const double aGpsStart, const double aGpsEnd, const int aTag=1)
 Adds a segment to the list.
 
bool AddSegments (Segments *aSeg)
 Adds a segment list to the list.
 
bool Append (const double aGpsStart, const double aGpsEnd, const int aTag=1)
 Appends a segment to the list.
 
bool Append (Segments *aSeg)
 Appends segments to the list.
 
bool Append (TTree *aSegmentTree)
 Appends segments to the list.
 
bool Append (vector< double > aGpsStarts, vector< double > aGpsEnds, vector< double > aTags)
 Appends segments to the list.
 
bool ApplyPadding (const double aPadStart, const double aPadEnd)
 Apply a padding to all segments.
 
void Dump (unsigned int aNcols=2, const string aTxtFileName="")
 Dumps the current segment list in the standard output or in a file.
 
double GetDuration (const unsigned int aSegmentIndex=0)
 Returns the duration of a given segment.
 
double GetEnd (const unsigned int aSegmentIndex=0)
 Returns the ending time of a given segment.
 
vector< double > GetEnds (void)
 Returns the list of segment ends.
 
double GetFirst ()
 Returns the starting time of the first segment.
 
TH1I * GetHisto (const double aOffset=0.0)
 Returns an histogram representing the segments.
 
TH1I * GetHistogram (const double aGpsStart, const double aGpsEnd, const double aOffset=0.0)
 Returns an histogram representing the segments.
 
double GetLast ()
 Returns the ending time of the last segment.
 
double GetLiveTime (const double aGpsStart, const double aGpsEnd)
 Returns the livetime between two GPS times.
 
double GetLiveTime (const unsigned int aSegmentIndex)
 Returns the livetime of one segment.
 
double GetLiveTime (void)
 Returns the total livetime.
 
double GetLiveTimeWithTag (const int aTag)
 Returns the livetime for segments with a given tag.
 
unsigned int GetN (void)
 Returns the number of time segments in the list.
 
unsigned int GetNWithTag (const int aTag)
 Returns the number of time segments in the list with a given tag.
 
int GetSegmentStartBefore (const double aGps)
 Returns the segment starting just before a given GPS time.
 
double GetStart (const unsigned int aSegmentIndex=0)
 Returns the starting time of a given segment.
 
vector< double > GetStarts (void)
 Returns the list of segment starts.
 
bool GetStatus (void) const
 Returns the status of the Segments object.
 
int GetTag (const unsigned int aSegmentIndex=0)
 Returns the tag of a given segment.
 
vector< int > GetTags (void)
 Returns the list of segment tags.
 
TTree * GetTree (const double aGpsStart, const double aGpsEnd)
 Returns a formatted TTree representing the segments.
 
TTree * GetTree (void)
 Returns a formatted TTree representing the segments.
 
bool Intersect (const double aGpsStart, const double aGpsEnd, const int aTag=1)
 Intersects with a segment.
 
bool Intersect (Segments *aSeg)
 Intersects with a segment list.
 
bool IsInsideSegment (const double aGps)
 Checks whether a given GPS time is inside a segment of the list.
 
bool IsInsideSegment (unsigned int &aSegmentIndex, const double aGps)
 Checks whether a given GPS time is inside a segment of the list.
 
bool MakeSecond (void)
 Rounds segment boundaries to integer seconds.
 
void Reset (void)
 Resets the segment list.
 
bool Reverse (void)
 Reverses the segment list.
 
void SetTag (const unsigned int aSegmentIndex, const int aTag)
 Tags a given segment.
 
void SetTags (const int aTag)
 Tags all segments.
 
bool TruncateAfter (const double aGps)
 Removes segments after a given time.
 
bool TruncateBefore (const double aGps)
 Removes segments before a given time.
 
 Segments (void)
 Default constructor of the Segments class.
 
 Segments (const string aSegmentFile, const int aDefaultTag=1)
 Constructor of the Segments class.
 
 Segments (TTree *aSegmentTree)
 Constructor of the Segments class.
 
 Segments (const string aFilePattern, const string aDirectory, const string aTreeName)
 Constructor of the Segments class.
 
 Segments (const vector< double > aGpsStarts, const vector< double > aGpsEnds)
 Constructor of the Segments class.
 
 Segments (const double aGpsStart, const double aGpsEnd, const int aTag=1)
 Constructor of the Segments class.
 
virtual ~Segments (void)
 Destructor of the Segments class.
 
- 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\).
 
unsigned int GetDetectorIndex (void)
 Returns the detector index for this stream.
 
string GetDetectorPrefix (void)
 Returns the detector prefix for this stream.
 
string GetDirectory (const string aOutDir=".")
 Returns the stream directory.
 
double GetLocalTime (const double aRa, const double aDec, const double aGeocentricTime)
 Converts the geocentric time to the detector local time [s].
 
string GetName (void)
 Returns the stream full name.
 
string GetNameConv (void)
 Returns the stream name using the LIGO-Virgo file name convention.
 
string GetNamePrefix (void)
 Returns the stream name prefix.
 
string GetNameSuffix (void)
 Returns the stream name suffix.
 
string GetNameSuffixUnderScore (void)
 Returns the stream name suffix with only underscores.
 
TH2D * GetSkyAntennaFactor (const unsigned int aGpsTime)
 Returns the sky map of the detector antenna factor for a given time.
 
bool GetSkyRingPoint (double &aThetaS, double &aPhiS, const double aGmst, const double aDeltaT, const double aOmegaS, Streams *aDprime)
 Returns the sky position of a GW signal when detected by two detectors.
 
bool GetSkyRingPointRaDec (double &aDecS, double &aRaS, const double aGmst, const double aDeltaT, const double aOmegaS, Streams *aDprime)
 Returns the sky position of a GW signal when detected by two detectors (radec).
 
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.
 
void SetName (const string aName)
 Sets a new name to the stream.
 
 Streams (const string aName, const unsigned int aVerbose=0)
 Constructor of the Streams class.
 
virtual ~Streams (void)
 Destructor of the Streams class.
 
- Public Member Functions inherited from Sample
double GetHighPassFrequency (void)
 Returns the current highpass frequency.
 
unsigned int GetNativeFrequency (void)
 Returns the current native sampling frequency [Hz].
 
unsigned int GetWindowSize (void)
 Returns the window size (=0 if no windowing).
 
unsigned int GetWorkingFrequency (void)
 Returns the current working sampling frequency [Hz].
 
void SetDCRemoval (const bool aDCremove=true)
 Activates/Deactivates the DC removal.
 
bool SetFrequencies (const unsigned int aNativeFrequency, const unsigned int aWorkingFrequency, const double aHighPassFrequency=0.0)
 Defines frequencies for the transformation.
 
bool SetHighPassFrequency (const double aHighPassFrequency)
 Defines a highpass frequency.
 
bool SetNativeFrequency (const int aNativeFrequency)
 Sets a new native sampling frequency.
 
void SetWindow (const unsigned int aWindowSize, double *aWindow)
 Defines the window.
 
bool SetWorkingFrequency (const unsigned int aWorkingFrequency)
 Sets a new working sampling frequency.
 
bool Transform (const unsigned int aInSize, double *aInData, const unsigned int aOutSize, double *aOutData)
 Transforms data.
 
 Sample (const unsigned int aVerbosity=0)
 Constructor of the Sample class.
 
virtual ~Sample (void)
 Destructor of the Sample class.
 
- 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).
 
void Add (const string aTag, const string aKey, const int aDefaultValue, const unsigned int aSize=0)
 Adds an option to the list (int).
 
void Add (const string aTag, const string aKey, const string aDefaultValue, const unsigned int aSize=0)
 Adds an option to the list (string).
 
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).
 
void AddOptionValue (const string aTag, const string aKey, const double aValue)
 Appends a value to a variable-size option (double).
 
void AddOptionValue (const string aTag, const string aKey, const int aValue)
 Appends a value to a variable-size option (int).
 
void AddOptionValue (const string aTag, const string aKey, const string aValue)
 Appends a value to a variable-size option (string).
 
void AddOptionValue (const string aTag, const string aKey, const unsigned int aValue)
 Appends a value to a variable-size option (unsigned int).
 
void Copy (GwollumOptions *aG)
 Copies an external GwollumOptions object into this.
 
void FillTree (void)
 Saves options in a TTree.
 
double GetOptionDefaultD (const unsigned int aOptionIndex)
 Returns an option default value.
 
int GetOptionDefaultI (const unsigned int aOptionIndex)
 Returns an option default value.
 
string GetOptionDefaultS (const unsigned int aOptionIndex)
 Returns an option default value.
 
unsigned int GetOptionDefaultU (const unsigned int aOptionIndex)
 Returns an option default value.
 
unsigned int GetOptionIndex (const string aTag, const string aKey)
 Returns the option index.
 
string GetOptionKey (const unsigned int aOptionIndex)
 Returns an option key.
 
unsigned int GetOptionNumberOfValues (const string aTag, const string aKey)
 Returns the option number of values.
 
unsigned int GetOptionSize (const string aTag, const string aKey)
 Returns the option size.
 
unsigned int GetOptionSize (const unsigned int aOptionIndex)
 Returns an option size.
 
unsigned int GetOptionsN (void)
 Returns the number of options.
 
string GetOptionTag (const unsigned int aOptionIndex)
 Returns an option tag.
 
char GetOptionType (const string aTag, const string aKey)
 Returns the option type.
 
char GetOptionType (const unsigned int aOptionIndex)
 Returns an option type.
 
double GetOptionValueD (const string aTag, const string aKey, const unsigned int aValIndex)
 Returns an option value (double).
 
bool GetOptionValueD (double &aValue, const string aTag, const string aKey, const unsigned int aValIndex)
 Returns an option value (double).
 
int GetOptionValueI (const string aTag, const string aKey, const unsigned int aValIndex)
 Returns an option value (int).
 
bool GetOptionValueI (int &aValue, const string aTag, const string aKey, const unsigned int aValIndex)
 Returns an option value (int).
 
string GetOptionValueS (const string aTag, const string aKey, const unsigned int aValIndex)
 Returns an option value (string).
 
bool GetOptionValueS (string &aValue, const string aTag, const string aKey, const unsigned int aValIndex)
 Returns an option value (string).
 
vector< double > GetOptionValuesD (const string aTag, const string aKey)
 Returns the list of option values (double).
 
vector< int > GetOptionValuesI (const string aTag, const string aKey)
 Returns the list of option values (int).
 
vector< string > GetOptionValuesS (const string aTag, const string aKey)
 Returns the list of option values (string).
 
vector< unsigned int > GetOptionValuesU (const string aTag, const string aKey)
 Returns the list of option values (unsigned int).
 
unsigned int GetOptionValueU (const string aTag, const string aKey, const unsigned int aValIndex)
 Returns an option value (unsigned int).
 
bool GetOptionValueU (unsigned int &aValue, const string aTag, const string aKey, const unsigned int aValIndex)
 Returns an option value (unsigned int).
 
bool Is (const string aTag, const string aKey)
 Checks whether an option exists.
 
bool IsProvided (const string aTag, const string aKey)
 Checks whether an option was provided.
 
bool IsTheSame (GwollumOptions *aG)
 Checks whether two GwollumOptions objects are identical.
 
bool ReadChain (bool &aIsUniform, TChain *aChain)
 Reads options from a TChain.
 
unsigned int ReadTextFile (const string aOptionFile)
 Reads an option file and extract the list of options.
 
bool ReadTree (const string aRootFileName, const string aTreeName)
 Reads options from a TTree in a ROOT file.
 
bool ReadTree (TTree *aTree)
 Reads options from a TTree.
 
void RemoveOption (const string aTag, const string aKey)
 Removes an option.
 
void Reset (void)
 Resets the list of options.
 
void ResetOption (const string aTag, const string aKey)
 Resets the list of option values.
 
void SetDefault (const string aTag, const string aKey)
 Sets an option to default value.
 
void SetOptionValue (const string aTag, const string aKey, const unsigned int aValIndex, const double aValue)
 Sets a value of an option (double).
 
void SetOptionValue (const string aTag, const string aKey, const unsigned int aValIndex, const int aValue)
 Sets a value of an option (int).
 
void SetOptionValue (const string aTag, const string aKey, const unsigned int aValIndex, const string aValue)
 Sets a value of an option (string).
 
void SetOptionValue (const string aTag, const string aKey, const unsigned int aValIndex, const unsigned int aValue)
 Sets a value of an option (unsigned int).
 
void WriteH5 (H5::H5File *aFile, H5::DataSpace &aDataSpace)
 Writes the options as attributes in a hdf5 file.
 
void WriteTextFile (const string aFileName)
 Writes all options in a text file.
 
void WriteTree (const string aTreeName)
 Writes the option TTree in a TFile.
 
void WriteTree (const string aTreeName, const string aRootFileName, const string aSubDirectory="")
 Writes the option TTree in a TFile.
 
 GwollumOptions (void)
 Constructor of the GwollumOptions class.
 
virtual ~GwollumOptions (void)
 Destructor of the GwollumOptions class.
 

Protected Attributes

double Mend
 Meta end time.
 
double Mfmax
 Meta maximum fend.
 
double Mfmin
 Meta minimum fstart.
 
string Mprocessname
 Meta process name.
 
string Mprocessuser
 Meta user name.
 
string Mprocessversion
 Meta process version.
 
double Mqmax
 Meta maximum Q.
 
double Mqmin
 Meta minimum Q.
 
double Msnrmax
 Meta maximum SNR.
 
double Msnrmin
 Meta minimum SNR.
 
double Mstart
 Meta start time.
 
TTree * Mtree
 Metadata tree.
 
- Protected Attributes inherited from Triggers
int randid
 Random integer to identify the class object.
 
string srandid
 Random integer (string) to identify the class object.
 
double Tamp
 Trigger amplitude.
 
double Tfend
 Trigger ending frequency [Hz].
 
double Tfreq
 Trigger frequency [Hz].
 
double Tfstart
 Trigger starting frequency [Hz].
 
Long64_t * Toffsets
 Tree offsets in the chain (read-mode) - DO NOT DELETE.
 
double Tph
 Trigger phase [rad].
 
double Tq
 Trigger Q.
 
double Tsnr
 Trigger SNR.
 
double Ttend
 Trigger GPS ending time.
 
double Ttime
 Trigger GPS time.
 
TTree * Ttree
 Pointer to active Ttree.
 
TChain * Ttree_read
 Trigger tree read-mode.
 
TTree * Ttree_write
 Trigger tree write-mode.
 
double Ttstart
 Trigger GPS starting time.
 
int Ttstart_us
 Trigger starting time (us).
 
int Verbose
 verbosity level
 
- Protected Attributes inherited from Streams
string Name
 Stream name.
 
- Protected Attributes inherited from Sample
double fHighPassFrequency
 Cutoff frequency.
 
unsigned int fNativeFrequency
 Native sampling frequency.
 
bool fRemoveDC
 DC removal flag.
 
unsigned int fVerbosity
 Verbosity level.
 
double * fWindow
 Window.
 
unsigned int fWindowSize
 Window size.
 
unsigned int fWorkingFrequency
 Working sampling frequency.
 

Private Types

typedef struct MakeTriggers::h5_segments h5_segments
 Segment structure for hdf5.
 
typedef struct MakeTriggers::h5_triggers h5_triggers
 Trigger structure for hdf5.
 

Private Member Functions

void GetMetaSegment (double &aStart, double &aStop)
 Returns the start/stop metadata.
 
void WriteHDF5 (const string aFileName)
 Write triggers in a HDF5 file.
 
void WriteTXT (const string aFileName)
 Write triggers in a text file.
 

Private Attributes

H5::CompType * h5_type
 Datatype for hdf5 (triggers).
 
H5::CompType * h5_type_s
 Datatype for hdf5 (segments).
 

Detailed Description

Write triggers to disk.

This class is designed to write triggers in a ROOT tree (other supported formats: hdf5, txt). When triggers are produced by some external algorithms, the MakeTriggers class can be used to manage output triggers and to save them to disk.

The ROOT files contains multiple TTree:

  • "triggers": this is the TTree with the trigger parameters (Triggers)
  • "metadata": this tree contains a single entry with trigger metadata.
  • "segments": this tree saves the list of segments.
  • "gwloptions": list of GWOLLUM options recorded with GwollumOptions.

The user is responsible to fill both the Segments and the Triggers structure from which this class inherits.

Author
Florent Robinet

Member Typedef Documentation

◆ h5_segments

Segment structure for hdf5.

◆ h5_triggers

Trigger structure for hdf5.

trigger structure for hdf5

Constructor & Destructor Documentation

◆ MakeTriggers()

MakeTriggers::MakeTriggers ( const string  aStreamName,
const unsigned int  aVerbose = 0 
)

Constructor of the MakeTriggers class.

The different structures are initialized:

Parameters
[in]aStreamNameStream name.
[in]aVerboseVerbosity level.

◆ ~MakeTriggers()

MakeTriggers::~MakeTriggers ( void  )
virtual

Destructor of the MakeTriggers class.

Member Function Documentation

◆ GetMetaSegment()

void MakeTriggers::GetMetaSegment ( double &  aStart,
double &  aStop 
)
private

Returns the start/stop metadata.

Parameters
[out]aStartGPS start time.
[out]aStopGPS stop time.

◆ Reset()

void MakeTriggers::Reset ( void  )

Resets all.

The memory is cleaned up:

Note
GwollumOptions are preserved.

◆ SetProcessName()

void MakeTriggers::SetProcessName ( const string  aProcessName)
inline

Set the process name.

Parameters
[in]aProcessNameProcess name.

◆ SetProcessVersion()

void MakeTriggers::SetProcessVersion ( const string  aProcessVersion)
inline

Sets the version for this process.

Parameters
[in]aProcessVersionProcess version.

◆ Write()

string MakeTriggers::Write ( const string  aOutDir = ".",
const string  aFileFormat = "",
const string  aFileName = "",
const string  aSubDir = "",
const string  aWriteMode = "RECREATE",
const bool  aWriteMeta = true 
)

Writes triggers to disk.

This function writes all the triggers added until now in an output file as well as the segments and metadata. The MakeTriggers object is then completely reset (see MakeTriggers::Reset()).

Returns
The output file path is returned (last file). An empty string is returned if this function fails in some way.

Several output formats are supported:

  • 'root': standard GWOLLUM root trigger file
  • 'hdf5': hdf5 format
  • 'txt': text file with columns

Multiple output formats can be requested at once. Use a single string to list the requested formats.

Note
For the hdf5 and txt formats, if triggers were clustered, only clusters are saved. For the root format, only triggers are saved.
Warning
If options were added with GwollumOptions, the GwollumOptions::FillTree() function must be called first (and only once)! Otherwise options will not be saved (empty tree).

The optional argument 'aFileName' is used to bypass the file naming convention of GWOLLUM. With this option, the trigger file will be given a new name: [aFileName].[format]

For ROOT files, it is possible to write the trees in a ROOT sub-directory. Use the optional argument 'aSubDir'. Only in this case, the trigger file can be updated when adding several directories. To do this, use aWriteMode="UPDATE".

Parameters
[in]aOutDirOutput directory (must exist).
[in]aFileFormatList of file formats.
[in]aFileNameNew name for ouput file. Use "" for GWOLLUM convention.
[in]aSubDirROOT sub-directory name to write the triggers (only for ROOT format).
[in]aWriteModeWrite mode: "RECREATE" or "UPDATE" (only with sub-directories).
[in]aWriteMetaFlag to write (or not) the metadata tree.

◆ WriteHDF5()

void MakeTriggers::WriteHDF5 ( const string  aFileName)
private

Write triggers in a HDF5 file.

Parameters
[in]aFileNameFile name.

◆ WriteMetaData()

bool MakeTriggers::WriteMetaData ( void  )

Writes the metadata in a ROOT file.

Three trees are saved: the trigger "metadata" tree, the "segments" tree, and the "gwloptions" tree (if any).

Warning
If options were added with GwollumOptions, the GwollumOptions::FillTree() function must be called first (and only once)! Otherwise options will not be saved (empty tree).
Precondition
A ROOT file must be open first and set to the directory where to write the TTree.

◆ WriteTXT()

void MakeTriggers::WriteTXT ( const string  aFileName)
private

Write triggers in a text file.

Parameters
[in]aFileNameFile name.

Member Data Documentation

◆ h5_type

H5::CompType* MakeTriggers::h5_type
private

Datatype for hdf5 (triggers).

◆ h5_type_s

H5::CompType* MakeTriggers::h5_type_s
private

Datatype for hdf5 (segments).

◆ Mend

double MakeTriggers::Mend
protected

Meta end time.

◆ Mfmax

double MakeTriggers::Mfmax
protected

Meta maximum fend.

◆ Mfmin

double MakeTriggers::Mfmin
protected

Meta minimum fstart.

◆ Mprocessname

string MakeTriggers::Mprocessname
protected

Meta process name.

◆ Mprocessuser

string MakeTriggers::Mprocessuser
protected

Meta user name.

◆ Mprocessversion

string MakeTriggers::Mprocessversion
protected

Meta process version.

◆ Mqmax

double MakeTriggers::Mqmax
protected

Meta maximum Q.

◆ Mqmin

double MakeTriggers::Mqmin
protected

Meta minimum Q.

◆ Msnrmax

double MakeTriggers::Msnrmax
protected

Meta maximum SNR.

◆ Msnrmin

double MakeTriggers::Msnrmin
protected

Meta minimum SNR.

◆ Mstart

double MakeTriggers::Mstart
protected

Meta start time.

◆ Mtree

TTree* MakeTriggers::Mtree
protected

Metadata tree.


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