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 building-mode). | |
bool | Clusterize (const int aTag=-1) |
Applies the so-called Clusterize algorithm to the trigger set. | |
double | GetClusterAmplitude (const int aCl) |
Returns the amplitude of cluster with index aCl. | |
double | GetClusterBandWidth (const int aCl) |
Returns the bandwidth of cluster with index aCl. | |
double | GetClusterDuration (const int aCl) |
Returns the duration of cluster with index aCl. | |
int | GetClusterFirstTrigger (const int aCl) |
Returns the index of the first trigger in this cluster. | |
double | GetClusterFrequency (const int aCl) |
Returns the frequency of cluster with index aCl. | |
double | GetClusterFrequencyEnd (const int aCl) |
Returns the ending frequency of cluster with index aCl. | |
double | GetClusterFrequencyStart (const int aCl) |
Returns the starting frequency of cluster with index aCl. | |
int | GetClusterIndex (const double aTime) |
Returns the index of cluster overlapping a given GPS time. | |
double | GetClusterizeDt (void) |
Returns the clustering delta_t parameter. | |
double | GetClusterMaxDuration (void) |
Returns the maximal duration of clusters. | |
double | GetClusterMeanDuration (void) |
Returns the mean duration of clusters. | |
double | GetClusterPhase (const int aCl) |
Returns the phase of cluster with index aCl. | |
double | GetClusterQ (const int aCl) |
Returns the Q of cluster with index aCl. | |
int | GetClusterSize (const int aCl) |
Returns the size of cluster with index aCl. | |
double | GetClusterSNR (const int aCl) |
Returns the SNR of cluster with index aCl. | |
int | GetClusterTag (const int aCl) |
Returns the tag value of cluster with index aCl. | |
double | GetClusterTime (const int aCl) |
Returns the time of cluster with index aCl. | |
double | GetClusterTimeEnd (const int aCl) |
Returns the ending time of cluster with index aCl. | |
double | GetClusterTimeStart (const int aCl) |
Returns the starting time of cluster with index aCl. | |
int | GetNclust (void) |
Returns the number of clusters. | |
int | GetNClust (void) |
Returns the number of clusters. | |
int | GetNclusters (void) |
Returns the number of clusters. | |
int | GetNClusters (void) |
Returns the number of clusters. | |
int | GetNtrig (void) |
Returns the current number of triggers in memory. | |
int | GetNTrig (void) |
Returns the current number of triggers in memory. | |
int | GetNtriggers (void) |
Returns the current number of triggers in memory. | |
int | GetNTriggers (void) |
Returns the current number of triggers in memory. | |
double | GetTriggerAmplitude (const int aTr) |
Returns the amplitude of trigger with index aTr. | |
double | GetTriggerBandWidth (const int aTr) |
Returns the bandwidth of trigger with index aTr. | |
double | GetTriggerDuration (const int aTr) |
Returns the duration of trigger with index aTr. | |
string | GetTriggerFile (const int aTr) |
Returns the file path containing the trigger with index aTr (only available in building-mode). | |
double | GetTriggerFrequency (const int aTr) |
Returns the frequency of trigger with index aTr. | |
double | GetTriggerFrequencyEnd (const int aTr) |
Returns the ending frequency of trigger with index aTr. | |
double | GetTriggerFrequencyStart (const int aTr) |
Returns the starting frequency of trigger with index aTr. | |
int | GetTriggerIndex (const double aTime) |
Returns the index of trigger overlapping a given GPS time. | |
double | GetTriggerPhase (const int aTr) |
Returns the phase of trigger with index aTr. | |
double | GetTriggerQ (const int aTr) |
Returns the Q of trigger with index aTr. | |
Segments * | GetTriggerSegments (TH1D *aThr=NULL, const double aInfValue=1e20) |
Returns the segments associated to the trigger time coverage. | |
double | GetTriggerSNR (const int aTr) |
Returns the SNR of trigger with index aTr. | |
double | GetTriggerTime (const int aTr) |
Returns the time of trigger with index aTr. | |
double | GetTriggerTimeEnd (const int aTr) |
Returns the ending time of trigger with index aTr. | |
double | GetTriggerTimeStart (const int aTr) |
Returns the starting time of trigger with index aTr. | |
bool | ReadTriggerFiles (const string aPattern, const string aDirectory) |
Reads a set of trigger files. | |
void | ResetClusters (void) |
Resets the clusters. | |
void | ResetTriggers (void) |
Resets the triggers. | |
bool | SetClusterBranchStatus (const string aBname, const bool aStatus=true) |
Modifies the branch status of the cluster tree. | |
void | SetClusterizeDt (const double aDt) |
Sets a new clustering delta_t parameter. | |
void | SetClusterizeSizeMin (const double aSizeMin) |
Sets a minimal size for clustering. | |
void | SetClusterizeSNRthr (const double aSNRthr) |
Sets a SNR threshold for clustering. | |
void | SetClusterTag (const int aNewTag) |
Sets a new cluster tag value for all cluster. | |
bool | SetClusterTag (const int aCl, const int aNewTag) |
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 building-mode). | |
Constructors and destructors | |
Triggers (const int aVerbose=0) | |
Constructor of the Triggers class. | |
virtual | ~Triggers (void) |
Destructor of the Triggers class. | |
Protected Attributes | |
double | Camp |
cluster Amplitude (TTree) | |
double | Cfend |
cluster frequency end (TTree) | |
Long64_t | Cfirstentry |
cluster first trigger entry (TTree) | |
double | Cfreq |
cluster frequency (TTree) | |
double | Cfstart |
cluster frequency start (TTree) | |
int * | cl_tag |
cluster tag | |
double | Cmaxdur |
cluster max duration | |
double | Cmeandur |
cluster mean duration | |
double | Cph |
cluster phase (TTree) | |
double | Cq |
cluster Q (TTree) | |
Long64_t | Csize |
cluster size (TTree) | |
double | Csnr |
cluster SNR (TTree) | |
double | Ctend |
cluster time end (TTree) | |
double | Ctime |
cluster time (TTree) | |
TTree * | Ctree |
cluster parameter tree | |
double | Ctstart |
cluster time start (TTree) | |
double | Tamp |
trigger amplitude (TTree) | |
double | Tfend |
trigger ending frequency (TTree) | |
double | Tfreq |
trigger frequency (TTree) | |
double | Tfstart |
trigger starting frequency (TTree) | |
Long64_t * | Toffsets |
tree offsets in the chain - DO NOT DELETE | |
double | Tph |
trigger phase (TTree) | |
double | Tq |
trigger Q (TTree) | |
double | Tsnr |
trigger SNR (TTree) | |
double | Ttend |
trigger ending time (TTree) | |
double | Ttime |
trigger time (TTree) | |
TTree * | Ttree |
pointer to active Ttree | |
TTree * | Ttree_make |
trigger parameter tree building-mode | |
Chain * | Ttree_read |
trigger parameter trees reading-mode | |
double | Ttstart |
trigger starting time (TTree) | |
int | Ttstart_ms |
trigger starting time (ms) (TTree) | |
int | Verbose |
verbosity level |
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 as described in the GWOLLUM convention for triggers.
The trigger set can be defined according to two modes and some methods are mode-specific:
PLEASE NOTE that this class is rather technical and the user is invited to use the MakeTriggers or ReadTriggers classes instead.
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 [FIXME]
Triggers::Triggers | ( | const int | aVerbose = 0 |
) |
Constructor of the Triggers class.
The trigger and cluster trees are initialized. By default, the building-mode is selected.
Parameters are set to default:
aVerbose | verbosity level |
Triggers::~Triggers | ( | void | ) | [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 building-mode).
The trigger parameters are defined in the GWOLLUM convention for triggers. The timing parameters (time, tstart and tend) are recorded with a precision of 1 microsecond.
aTime | ||
aFrequency | ||
aSNR | ||
aQ | ||
aTstart | = Min( atstart, atime ) | |
aTend | = Max( atend, atime ) | |
aFstart | = Min( afstart, afrequency ) | |
aFend | = Max( afend, afrequency ) | |
aAmplitude | ||
aPhase |
Reimplemented in TriggerBuffer.
bool Triggers::Clusterize | ( | const int | aTag = -1 |
) |
Applies the so-called Clusterize algorithm to the trigger set.
If the triggers were previously clustered, the memory is cleaned first (see ResetClusters()).
The Clusterize algorithm assumes the trigger set is sorted by increasing values of tstart. The user must make sure this is the case. The SortTriggers() function can be used to sort the triggers before the clustering.
Resulting clusters are tagged. By default, this tag is -1 for all clusters.
The clustering algorithms are described in FIXME
aTag | default tag for all clusters |
double Triggers::GetClusterAmplitude | ( | const int | aCl | ) | [inline] |
Returns the amplitude of cluster with index aCl.
0.0 is returned if this function fails.
aCl | cluster index |
double Triggers::GetClusterBandWidth | ( | const int | aCl | ) | [inline] |
Returns the bandwidth of cluster with index aCl.
0.0 is returned if this function fails.
aCl | cluster index |
double Triggers::GetClusterDuration | ( | const int | aCl | ) | [inline] |
Returns the duration of cluster with index aCl.
0.0 is returned if this function fails.
aCl | cluster index |
int Triggers::GetClusterFirstTrigger | ( | const int | aCl | ) | [inline] |
Returns the index of the first trigger in this cluster.
-1 is returned if this function fails.
aCl | cluster index |
double Triggers::GetClusterFrequency | ( | const int | aCl | ) | [inline] |
Returns the frequency of cluster with index aCl.
0.0 is returned if this function fails.
aCl | cluster index |
double Triggers::GetClusterFrequencyEnd | ( | const int | aCl | ) | [inline] |
Returns the ending frequency of cluster with index aCl.
0.0 is returned if this function fails.
aCl | cluster index |
double Triggers::GetClusterFrequencyStart | ( | const int | aCl | ) | [inline] |
Returns the starting frequency of cluster with index aCl.
0.0 is returned if this function fails.
aCl | cluster index |
int Triggers::GetClusterIndex | ( | const double | aTime | ) |
Returns the index of cluster overlapping a given GPS time.
-1 is returned if no cluster is found.
aTime | GPS time to test |
double Triggers::GetClusterizeDt | ( | void | ) | [inline] |
Returns the clustering delta_t parameter.
double Triggers::GetClusterMaxDuration | ( | void | ) | [inline] |
Returns the maximal duration of clusters.
double Triggers::GetClusterMeanDuration | ( | void | ) | [inline] |
Returns the mean duration of clusters.
double Triggers::GetClusterPhase | ( | const int | aCl | ) | [inline] |
Returns the phase of cluster with index aCl.
-100.0 is returned if this function fails.
aCl | cluster index |
double Triggers::GetClusterQ | ( | const int | aCl | ) | [inline] |
Returns the Q of cluster with index aCl.
0.0 is returned if this function fails.
aCl | cluster index |
int Triggers::GetClusterSize | ( | const int | aCl | ) | [inline] |
Returns the size of cluster with index aCl.
0 is returned if this function fails.
aCl | cluster index |
double Triggers::GetClusterSNR | ( | const int | aCl | ) | [inline] |
Returns the SNR of cluster with index aCl.
0.0 is returned if this function fails.
aCl | cluster index |
int Triggers::GetClusterTag | ( | const int | aCl | ) | [inline] |
Returns the tag value of cluster with index aCl.
-100 is returned if no cluster is found.
aCl | cluster index |
double Triggers::GetClusterTime | ( | const int | aCl | ) | [inline] |
Returns the time of cluster with index aCl.
0.0 is returned if this function fails.
aCl | cluster index |
double Triggers::GetClusterTimeEnd | ( | const int | aCl | ) | [inline] |
Returns the ending time of cluster with index aCl.
0.0 is returned if this function fails.
aCl | cluster index |
double Triggers::GetClusterTimeStart | ( | const int | aCl | ) | [inline] |
Returns the starting time of cluster with index aCl.
0.0 is returned if this function fails.
aCl | cluster index |
int Triggers::GetNclust | ( | void | ) | [inline] |
Returns the number of clusters.
int Triggers::GetNClust | ( | void | ) | [inline] |
Returns the number of clusters.
int Triggers::GetNclusters | ( | void | ) | [inline] |
Returns the number of clusters.
int Triggers::GetNClusters | ( | void | ) | [inline] |
Returns the number of clusters.
int Triggers::GetNtrig | ( | void | ) | [inline] |
Returns the current number of triggers in memory.
int Triggers::GetNTrig | ( | void | ) | [inline] |
Returns the current number of triggers in memory.
int Triggers::GetNtriggers | ( | void | ) | [inline] |
Returns the current number of triggers in memory.
Reimplemented in TriggerBuffer.
int Triggers::GetNTriggers | ( | void | ) | [inline] |
Returns the current number of triggers in memory.
double Triggers::GetTriggerAmplitude | ( | const int | aTr | ) | [inline] |
Returns the amplitude of trigger with index aTr.
0.0 is returned if this function fails.
aTr | trigger index |
double Triggers::GetTriggerBandWidth | ( | const int | aTr | ) | [inline] |
Returns the bandwidth of trigger with index aTr.
0.0 is returned if this function fails.
aTr | trigger index |
double Triggers::GetTriggerDuration | ( | const int | aTr | ) | [inline] |
Returns the duration of trigger with index aTr.
0.0 is returned if this function fails.
aTr | trigger index |
string Triggers::GetTriggerFile | ( | const int | aTr | ) |
Returns the file path containing the trigger with index aTr (only available in building-mode).
"none" is returned if this function fails.
aTr | trigger index |
double Triggers::GetTriggerFrequency | ( | const int | aTr | ) | [inline] |
Returns the frequency of trigger with index aTr.
0.0 is returned if this function fails.
aTr | trigger index |
double Triggers::GetTriggerFrequencyEnd | ( | const int | aTr | ) | [inline] |
Returns the ending frequency of trigger with index aTr.
0.0 is returned if this function fails.
aTr | trigger index |
double Triggers::GetTriggerFrequencyStart | ( | const int | aTr | ) | [inline] |
Returns the starting frequency of trigger with index aTr.
0.0 is returned if this function fails.
aTr | trigger index |
int Triggers::GetTriggerIndex | ( | const double | aTime | ) |
Returns the index of trigger overlapping a given GPS time.
-1 is returned if no trigger is found.
aTime | GPS time to test |
double Triggers::GetTriggerPhase | ( | const int | aTr | ) | [inline] |
Returns the phase of trigger with index aTr.
-100.0 is returned if this function fails.
aTr | trigger index |
double Triggers::GetTriggerQ | ( | const int | aTr | ) | [inline] |
Returns the Q of trigger with index aTr.
0.0 is returned if this function fails.
aTr | trigger index |
Segments * Triggers::GetTriggerSegments | ( | TH1D * | aThr = NULL , |
|
const double | aInfValue = 1e20 | |||
) |
Returns the segments associated to the trigger time coverage.
For each trigger, the segment [tstart; tend[ is added to a list of segments. The final list is returned as a Segments pointer.
It is possible to perform a trigger selection where only triggers above threshold are considered. The TH1D threshold object is used as a SNR threshold defined in frequency bins. Additionnaly, if the SNR threshold in a given bin is larger than 'aInfValue', the threshold is considered infinite and no trigger can be selected for this bin.
NOTE: for performance reasons, it is better to sort the triggers before calling this function(see SortTriggers()).
aThr | threshold object | |
aInfValue | value above which the threshold is considered infinite |
double Triggers::GetTriggerSNR | ( | const int | aTr | ) | [inline] |
Returns the SNR of trigger with index aTr.
0.0 is returned if this function fails.
aTr | trigger index |
double Triggers::GetTriggerTime | ( | const int | aTr | ) | [inline] |
Returns the time of trigger with index aTr.
0.0 is returned if this function fails.
aTr | trigger index |
double Triggers::GetTriggerTimeEnd | ( | const int | aTr | ) | [inline] |
Returns the ending time of trigger with index aTr.
0.0 is returned if this function fails.
aTr | trigger index |
double Triggers::GetTriggerTimeStart | ( | const int | aTr | ) | [inline] |
Returns the starting time of trigger with index aTr.
0.0 is returned if this function fails.
aTr | trigger index |
bool Triggers::ReadTriggerFiles | ( | const string | aPattern, | |
const string | aDirectory | |||
) |
Reads a set of trigger files.
As soon as this function is called, the Triggers object is switched to a reading mode. Some functions are therefore de-activated. The reading mode can be removed with the ResetTriggers() function. This function can be used multiple times in a row to update the trigger set.
aPattern | trigger file pattern | |
aDirectory | ROOT directory where to find the 'triggers' tree. |
void Triggers::ResetClusters | ( | void | ) |
Resets the clusters.
The clusters are flushed out of memory.
void Triggers::ResetTriggers | ( | void | ) |
Resets the triggers.
All triggers and clusters are flushed out. The reading mode is removed.
bool Triggers::SetClusterBranchStatus | ( | const string | aBname, | |
const bool | aStatus = true | |||
) |
Modifies the branch status of the cluster tree.
This function allows to change the status of the cluster tree branches. See also TTree::SetBranchStatus( ). This function is particularly useful to speed up processes looping over clusters.
IMPORTANT: The user MUST re-activate the branch before using any other class functions.
aBname | branch name | |
aStatus | new status |
void Triggers::SetClusterizeDt | ( | const double | aDt | ) | [inline] |
Sets a new clustering delta_t parameter.
Sets a new delta_t value for the time-clustering. The value should be given in seconds.
aDt | new delta_t value in seconds |
void Triggers::SetClusterizeSizeMin | ( | const double | aSizeMin | ) | [inline] |
Sets a minimal size for clustering.
Only clusters with a size greater than this threshold will be recorded.
aSizeMin | new size threshold |
void Triggers::SetClusterizeSNRthr | ( | const double | aSNRthr | ) | [inline] |
Sets a SNR threshold for clustering.
Only clusters with a SNR greater than this threshold will be recorded.
aSNRthr | new SNR threshold |
void Triggers::SetClusterTag | ( | const int | aNewTag | ) | [inline] |
Sets a new cluster tag value for all cluster.
This function allows to assign a new tag value all clusters.
aNewTag | new cluster tag value |
bool Triggers::SetClusterTag | ( | const int | aCl, | |
const int | aNewTag | |||
) |
Sets a new cluster tag value.
This function allows to assign a new tag value to cluster 'aCl'.
aCl | cluster index | |
aNewTag | 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. See also TTree::SetBranchStatus( ). This function is particularly useful to speed up processes looping over triggers.
IMPORTANT: The user MUST re-activate the branch before using any other class functions.
aBname | branch name | |
aStatus | new status |
bool Triggers::SortTriggers | ( | void | ) |
Sort triggers by increasing values of tstart (only available in building-mode).
double Triggers::Camp [protected] |
cluster Amplitude (TTree)
double Triggers::Cfend [protected] |
cluster frequency end (TTree)
Long64_t Triggers::Cfirstentry [protected] |
cluster first trigger entry (TTree)
double Triggers::Cfreq [protected] |
cluster frequency (TTree)
double Triggers::Cfstart [protected] |
cluster frequency start (TTree)
int* Triggers::cl_tag [protected] |
cluster tag
double Triggers::Cmaxdur [protected] |
cluster max duration
double Triggers::Cmeandur [protected] |
cluster mean duration
double Triggers::Cph [protected] |
cluster phase (TTree)
double Triggers::Cq [protected] |
cluster Q (TTree)
Long64_t Triggers::Csize [protected] |
cluster size (TTree)
double Triggers::Csnr [protected] |
cluster SNR (TTree)
double Triggers::Ctend [protected] |
cluster time end (TTree)
double Triggers::Ctime [protected] |
cluster time (TTree)
TTree* Triggers::Ctree [protected] |
cluster parameter tree
double Triggers::Ctstart [protected] |
cluster time start (TTree)
double Triggers::Tamp [protected] |
trigger amplitude (TTree)
double Triggers::Tfend [protected] |
trigger ending frequency (TTree)
double Triggers::Tfreq [protected] |
trigger frequency (TTree)
double Triggers::Tfstart [protected] |
trigger starting frequency (TTree)
Long64_t* Triggers::Toffsets [protected] |
tree offsets in the chain - DO NOT DELETE
double Triggers::Tph [protected] |
trigger phase (TTree)
double Triggers::Tq [protected] |
trigger Q (TTree)
double Triggers::Tsnr [protected] |
trigger SNR (TTree)
double Triggers::Ttend [protected] |
trigger ending time (TTree)
double Triggers::Ttime [protected] |
trigger time (TTree)
TTree* Triggers::Ttree [protected] |
pointer to active Ttree
TTree* Triggers::Ttree_make [protected] |
trigger parameter tree building-mode
Chain* Triggers::Ttree_read [protected] |
trigger parameter trees reading-mode
double Triggers::Ttstart [protected] |
trigger starting time (TTree)
int Triggers::Ttstart_ms [protected] |
trigger starting time (ms) (TTree)
int Triggers::Verbose [protected] |
verbosity level