![]() |
GWOLLUM 4.2.0
Tools for gravitational-wave analyses
|
Manage a trigger set. More...
#include <Triggers.h>
Public Member Functions | |
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]. | |
bool | GetStatus (void) |
Returns the class status. | |
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). | |
Constructors and destructors | |
Triggers (const unsigned int aVerbose=0) | |
Constructor of the Triggers class. | |
virtual | ~Triggers (void) |
Destructor of the Triggers class. | |
Protected Attributes | |
Monitor * | mon |
Class monitor. | |
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). | |
Private Attributes | |
vector< double > | Camp |
Cluster Amplitude. | |
vector< double > | Cfend |
Cluster frequency end. | |
vector< Long64_t > | Cfirstentry |
Cluster first trigger entry. | |
vector< double > | Cfreq |
Cluster frequency. | |
vector< double > | Cfstart |
Cluster frequency start. | |
double | cl_maxdur |
Cluster max duration. | |
double | cl_meandur |
Cluster mean duration. | |
double | cl_totdur |
Cluster total duration. | |
double | clusterize_delta_t |
Time clustering parameter \(\delta t\) [s]. | |
unsigned int | clusterize_sizemin |
Minimum cluster size \(M_{min}\). | |
double | clusterize_snr_thr |
Minimum cluster SNR \(\rho_{min}\). | |
vector< double > | Cph |
Cluster phase. | |
vector< double > | Cq |
Cluster Q. | |
vector< unsigned int > | Csize |
Cluster size. | |
vector< double > | Csnr |
Cluster SNR. | |
vector< int > | Ctag |
Cluster tag. | |
vector< double > | Ctend |
Cluster GPS time end. | |
vector< double > | Ctime |
Cluster GPS time. | |
vector< double > | Ctstart |
Cluster GPS time start. | |
bool | readmode |
Read/write mode: true=read, false=write. | |
Manage a trigger set.
This class is designed to manage a set of triggers. A trigger is described as a set of parameters and these parameters are stored in a ROOT TTree.
The trigger set can be defined according to two modes and some methods are mode-specific:
This class also offers the possibility to cluster the set of triggers with an algorithm called Clusterize. For the description of the clustering algorithms, see Clusterize().
Triggers::Triggers | ( | const unsigned int | aVerbose = 0 | ) |
Constructor of the Triggers class.
The trigger and cluster structures are initialized. By default, the write-mode is activated. To Read triggers, call ReadTriggerFiles().
The clustering (see Clusterize()) parameters are given default values:
[in] | aVerbose | Verbosity level. |
|
virtual |
Destructor of the Triggers class.
bool Triggers::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).
[in] | aTime | Trigger GPS time [s]. |
[in] | aFrequency | Trigger frequency [Hz]. |
[in] | aSNR | Trigger Signal-to-noise ratio. |
[in] | aQ | Trigger Quality factor. |
[in] | aTstart | Trigger GPS start time [s]. |
[in] | aTend | Trigger GPS end time [s]. |
[in] | aFstart | Trigger frequency start [Hz]. |
[in] | aFend | Trigger frequency end [Hz]. |
[in] | aAmplitude | Trigger amplitude. |
[in] | aPhase | Trigger phase [rad]. |
bool Triggers::Clusterize | ( | const int | aTag = 1 | ) |
Clusters the triggers.
Triggers are clustered with an algorithm called "clusterize".
The clusterize algorithm considers 2 consecutive triggers. If the time distance between the end of the first trigger and the start of the second trigger is smaller than (or equal to) \(\delta t\), the 2 triggers are clustered together. This also true if the first trigger ends after the start of the second trigger. This operation is iterated over the list of triggers.
A cluster is given parameters:
A cluster is saved only if all the following conditions are met:
The clustering parameters \(\delta t\), \(M_{min}\), and \(\rho_{min}\) are set with SetClusterizeDt(),SetClusterizeSizeMin(), and SetClusterizeSnrThr() respectively.
Resulting clusters are tagged. By default, this tag is set 1 for all clusters.
[in] | aTag | Default tag assigned to all clusters. |
|
inline |
Returns the amplitude of a given cluster.
[in] | aClusterIndex | Cluster index. |
|
inline |
Returns the bandwidth of a given cluster [Hz].
[in] | aClusterIndex | Cluster index. |
|
inline |
Returns the duration of a given cluster [s].
[in] | aClusterIndex | Cluster index. |
|
inline |
Returns the index of the first trigger in a given cluster.
[in] | aClusterIndex | Cluster index. |
|
inline |
Returns the frequency of a given cluster [Hz].
[in] | aClusterIndex | Cluster index. |
|
inline |
Returns the end frequency of a given cluster [Hz].
[in] | aClusterIndex | Cluster index. |
|
inline |
Returns the start frequency of a given cluster [Hz].
[in] | aClusterIndex | Cluster index. |
int Triggers::GetClusterIndex | ( | const double | aTime | ) |
Returns the index of cluster overlapping a given GPS time.
[in] | aTime | GPS time to test. |
|
inline |
Gets the clustering \(\delta t\) parameter.
|
inline |
Gets the cluster minimal size: \(M_{min}\).
|
inline |
Gets the SNR threshold for clustering.
|
inline |
Returns the maximal duration of clusters [s].
|
inline |
Returns the mean duration of clusters [s].
|
inline |
Returns the current number of clusters in memory.
|
inline |
Returns the phase of a given cluster [rad].
[in] | aClusterIndex | Cluster index. |
|
inline |
Returns the quality factor of a given cluster.
[in] | aClusterIndex | Cluster index. |
|
inline |
Returns the size (number of triggers) a given cluster.
[in] | aClusterIndex | Cluster index. |
|
inline |
Returns the signal-to-noise ratio of a given cluster.
[in] | aClusterIndex | Cluster index. |
|
inline |
Returns the tag of a given cluster.
[in] | aClusterIndex | Cluster index. |
|
inline |
Returns the time of a given cluster [s].
[in] | aClusterIndex | Cluster index. |
|
inline |
Returns the end time of a given cluster [s].
[in] | aClusterIndex | Cluster index. |
|
inline |
Returns the start time of a given cluster [s].
[in] | aClusterIndex | Cluster index. |
|
inline |
Returns the total duration of clusters [s].
|
inline |
Returns the class status.
|
inline |
Returns the amplitude of a given trigger.
[in] | aTriggerIndex | Trigger index. |
|
inline |
Returns the bandwidth of a given trigger [Hz].
[in] | aTriggerIndex | Trigger index. |
|
inline |
Returns the duration of a given trigger [s].
[in] | aTriggerIndex | Trigger index. |
|
inline |
Returns the frequency of a given trigger [Hz].
[in] | aTriggerIndex | Trigger index. |
|
inline |
Returns the end frequency of a given trigger [Hz].
[in] | aTriggerIndex | Trigger index. |
|
inline |
Returns the start frequency of a given trigger [Hz].
[in] | aTriggerIndex | Trigger index. |
|
inline |
Returns the current number of triggers in memory.
|
inline |
Returns the phase of a given trigger [rad].
[in] | aTriggerIndex | Trigger index. |
|
inline |
Returns the quality factor of a given trigger.
[in] | aTriggerIndex | Trigger index. |
|
inline |
Returns the signal-to-noise ratio of a given trigger.
[in] | aTriggerIndex | Trigger index. |
|
inline |
Returns the time of a given trigger [s].
[in] | aTriggerIndex | Trigger index. |
|
inline |
Returns the end time of a given trigger [s].
[in] | aTriggerIndex | Trigger index. |
|
inline |
Returns the start time of a given trigger [s].
[in] | aTriggerIndex | Trigger index. |
bool Triggers::ReadTriggerFiles | ( | const string | aPattern, |
const string | aDirectory = "" |
||
) |
Reads a set of trigger files.
When this function is called, the Triggers object is switched to a read-mode. The trigger tree points to the list of triggers saved in the input files. Some (write-mode) functions are therefore de-activated. The read-mode can be removed with the ResetTriggers() function.
[in] | aPattern | Trigger file pattern. |
[in] | aDirectory | ROOT directory where to find the 'triggers' tree. |
void Triggers::Reset | ( | void | ) |
Resets the Triggers object.
All triggers and clusters are flushed out. The object is back to write mode.
void Triggers::ResetClusters | ( | void | ) |
Resets the list of clusters.
All clusters in memory are deleted.
|
inline |
Sets a new clustering \(\delta t\) parameter.
[in] | aDt | New \(\delta t\) value [s]. |
|
inline |
Sets the cluster minimal size: \(M_{min}\).
[in] | aSizeMin | New cluster minimal size: \(M_{min}\). |
|
inline |
Sets the SNR threshold for clustering: \(\rho_{min}\).
[in] | aSnrThr | SNr threshold: \(\rho_{min}\). |
|
inline |
Sets a new tag value for all clusters.
aTag | New cluster tag value. |
|
inline |
Sets a new cluster tag value.
[in] | aClusterIndex | Cluster index. |
[in] | aTag | New cluster tag value. |
bool Triggers::SetTriggerBranchStatus | ( | const string | aBname, |
const bool | aStatus = true |
||
) |
Modifies the branch status of the trigger tree.
This function allows to change the status of the trigger tree branches. This function is particularly useful to speed up processes looping over triggers.
[in] | aBname | Branch name. |
[in] | aStatus | New branch status. |
bool Triggers::SortTriggers | ( | void | ) |
Sort triggers by increasing values of tstart (only available in write-mode).
The TTree::BuildIndex() is used with "tstart" as a major index and "tstart_us" as a minor index.
|
private |
Cluster Amplitude.
|
private |
Cluster frequency end.
|
private |
Cluster first trigger entry.
|
private |
Cluster frequency.
|
private |
Cluster frequency start.
|
private |
Cluster max duration.
|
private |
Cluster mean duration.
|
private |
Cluster total duration.
|
private |
Time clustering parameter \(\delta t\) [s].
|
private |
Minimum cluster size \(M_{min}\).
|
private |
Minimum cluster SNR \(\rho_{min}\).
|
private |
Cluster phase.
|
private |
Cluster Q.
|
private |
Cluster size.
|
private |
Cluster SNR.
|
private |
Cluster tag.
|
private |
Cluster GPS time end.
|
private |
Cluster GPS time.
|
private |
Cluster GPS time start.
|
protected |
Class monitor.
|
protected |
Random integer to identify the class object.
|
private |
Read/write mode: true=read, false=write.
|
protected |
Random integer (string) to identify the class object.
|
protected |
Trigger amplitude.
|
protected |
Trigger ending frequency [Hz].
|
protected |
Trigger frequency [Hz].
|
protected |
Trigger starting frequency [Hz].
|
protected |
Tree offsets in the chain (read-mode) - DO NOT DELETE.
|
protected |
Trigger phase [rad].
|
protected |
Trigger Q.
|
protected |
Trigger SNR.
|
protected |
Trigger GPS ending time.
|
protected |
Trigger GPS time.
|
protected |
Pointer to active Ttree.
|
protected |
Trigger tree read-mode.
|
protected |
Trigger tree write-mode.
|
protected |
Trigger GPS starting time.
|
protected |
Trigger starting time (us).