GWOLLUM  4.2.0
Tools for gravitational-wave analyses
Coinc2 Class Reference

Set two trigger sets in coincidence. More...

#include <Coinc2.h>

Inheritance diagram for Coinc2:
Collaboration diagram for Coinc2:

Public Member Functions

unsigned int GetActiveClusterN (const unsigned int aSampleIndex)
 Gets the number of active clusters. More...
 
unsigned int GetClusterIndex (const unsigned int aSampleIndex, const unsigned int aCoincIndex)
 Returns the cluster index involved in a given coinc event. More...
 
double GetCoincDeltat (void)
 Returns the chacteristic duration defining a coinc \(\delta t\) [s]. More...
 
double GetCoincLiveTime (void)
 Returns the livetime of coinc segments [s]. More...
 
unsigned int GetCoincN (void)
 Returns the current number of coinc events. More...
 
SegmentsGetCoincSegments (void)
 Returns a pointer to the coincidence segments. More...
 
SegmentsGetCoincSegmentsCopy (void)
 Returns a copy of coincidence segments. More...
 
bool GetCoincTag (const unsigned int aCoincIndex)
 Gets the tag value of a given coinc event. More...
 
double GetCoincTimeWindowEnd (const unsigned int aSampleIndex, const unsigned int aClusterIndex)
 Returns the coincidence time window end \(\tau_e\)[s]. More...
 
double GetCoincTimeWindowStart (const unsigned int aSampleIndex, const unsigned int aClusterIndex)
 Returns the coincidence time window start \(\tau_s\)[s]. More...
 
double GetFrequencyMax (const unsigned int aSampleIndex)
 Returns the miaximum frequency used to select input clusters [Hz]. More...
 
double GetFrequencyMin (const unsigned int aSampleIndex)
 Returns the minimum frequency used to select input clusters [Hz]. More...
 
double GetSnrMin (const unsigned int aSampleIndex)
 Returns the minimum SNR used to select input clusters [Hz]. More...
 
double GetTimeOffset (const unsigned int aSampleIndex)
 Returns the time offset of a trigger set [s]. More...
 
unsigned int MakeCoinc (void)
 Runs the coincidence algorithm. More...
 
bool MakeComparators (void)
 Produce plots for coinc events. More...
 
void PrintCoinc (void)
 Prints the list of coinc events. More...
 
void PrintCoincNot (const unsigned int aSampleIndex)
 Prints the list of active clusters NOT participating to a coinc event. More...
 
void PrintComparators (const string aFileName)
 Prints plots for coinc events. More...
 
void SetCoincDeltat (const double aDeltat)
 Sets the chacteristic duration to define a coinc \(\delta t\). More...
 
void SetCoincTag (const bool aNewTag)
 Sets a new tag for all coinc events. More...
 
void SetCoincTag (const unsigned int aCoincIndex, const bool aNewTag)
 Sets a new tag to a given coinc event. More...
 
void SetFrequencyRange (const unsigned int aSampleIndex, const double aFrequencyMin, const double aFrequencyMax)
 Sets a frequency range to select input clusters. More...
 
void SetSnrMin (const unsigned int aSampleIndex, const double aSnrMin)
 Sets a minimum SNR to select input clusters. More...
 
bool SetTriggers (ReadTriggers *aTrigger0, ReadTriggers *aTrigger1, const double aTimeOffset0=0.0, const double aTimeOffset1=0.0, Segments *aValidSegments=NULL)
 Sets the trigger sets. More...
 
Constructors and destructors
 Coinc2 (const unsigned int aVerbose=0)
 Constructor of the Coinc2 class. More...
 
virtual ~Coinc2 (void)
 Destructor of the Coinc2 class. More...
 
- Public Member Functions inherited from GwollumPlot
void AddLegendEntry (const TObject *aObj, const string aLabel, const string aStyle="LPF")
 Adds a legend entry. More...
 
void AddLegendHeader (const string aLabel)
 Adds a legend header. More...
 
void AddText (const string aText, const double aX, const double aY, const double aSize, const int aPadIndex=0)
 Adds text in the plot. More...
 
void Clear (const int aPadIndex=0)
 Clear pad. More...
 
void DivideCanvas (const unsigned int aNpads)
 Divides current canvas into sub-pads. More...
 
void DivideCanvas (const unsigned int aNx, const unsigned int aNy)
 Divides current canvas into sub-pads. More...
 
void Draw (TObject *aObj, const string aOptions="", const int aPadIndex=0)
 Draws ROOT object. More...
 
void DrawLegend (void)
 Draws current legend box. More...
 
unsigned int GetColorPalette (const unsigned int i)
 Returns color number i in current palette. More...
 
string GetCurrentStyle (void)
 Returns current style name. More...
 
int GetHeight (void)
 Returns the canvas height. More...
 
unsigned int GetNumberOfColors (void)
 Returns the number of colors in current palette. More...
 
int GetOxColorIndex (unsigned int aColorType)
 Returns the color index for the Ox style. More...
 
int GetWidth (void)
 Returns the canvas width. More...
 
void Print (const string aFileName)
 Prints current canvas in a file. More...
 
void Print (const string aFileName, const double aScaleFactor)
 Prints current canvas in a file with a rescaling factor. More...
 
void Print (const string aFileName, const unsigned int aNewWidth, const unsigned int aNewHeight)
 Prints current canvas in a file with a new size. More...
 
void RedrawAxis (Option_t *option="", int aPadIndex=0)
 Redraw the frame axis. More...
 
void ResetLegend (void)
 Resets and removes current legend box. More...
 
void ResizePlot (const unsigned int aWidth, const unsigned int aHeight)
 Resizes the global canvas to new dimensions. More...
 
void SetGridx (const int aValue=1, const int aPadIndex=0)
 Set/Unset grid for X. More...
 
void SetGridy (const int aValue=1, const int aPadIndex=0)
 Set/Unset grid for Y. More...
 
void SetLogx (const int aValue, const int aPadIndex=0)
 Set Lin/Log scale for X. More...
 
void SetLogy (const int aValue, const int aPadIndex=0)
 Set Lin/Log scale for Y. More...
 
void SetLogz (const int aValue, const int aPadIndex=0)
 Set Lin/Log scale for Z. More...
 
void UnDraw (TObject *aObj, const int aPadIndex=0)
 UnDraws a ROOT object. More...
 
void UnDrawLegend (void)
 Removes the legend box from the pad. More...
 
void UpdateText (const string aText)
 Updates text in the plot. More...
 
 GwollumPlot (const string aName, const string aStyleName="GWOLLUM")
 Constructor of the GwollumPlot class. More...
 
virtual ~GwollumPlot (void)
 Destructor of the GwollumPlot class. More...
 

Private Member Functions

void SelectClusters (const unsigned int aSampleIndex)
 Select input clusters. More...
 

Private Attributes

vector< unsigned int > CoC [COINC2_NT]
 Coinc cluster index. More...
 
double coinc_dt
 Coinc time distance [s]. More...
 
SegmentsCoSeg
 Coinc segments. More...
 
bool * CoTag
 Coinc tags. More...
 
double freqmax [COINC2_NT]
 Frequency max selection [Hz]. More...
 
double freqmin [COINC2_NT]
 Frequency min selection [Hz]. More...
 
TGraph * gc_freqfreq
 Frequency vs frequency. More...
 
TGraph * gc_freqtime [4]
 Coinc Frequency vs time. More...
 
TGraph * gc_snrsnr
 Coinc SNR vs SNR. More...
 
TGraph * gc_snrtime [4]
 SNR vs time. More...
 
TH1D * hc_freqfrac [2]
 coinc fraction vs frequency More...
 
TH1D * hc_snrfrac [2]
 coinc fraction vs SNR More...
 
unsigned int nactive [COINC2_NT]
 Number of active clusters. More...
 
double snrmin [COINC2_NT]
 SNR min selection. More...
 
double toffset [COINC2_NT]
 Time offsets [s]. More...
 
ReadTriggerstriggers [COINC2_NT]
 Trigger sets. More...
 
unsigned int verbosity
 Verbosity level. More...
 

Additional Inherited Members

- Protected Attributes inherited from GwollumPlot
string name
 Name. More...
 
int oxcolindex [4]
 TColor indices for Ox. More...
 
TColor * oxcolor [4]
 TColor for Ox. 0=background, 1=middleground/plots, 2=foreground, 3=grid. More...
 
int randid
 Random integer id. More...
 
string srandid
 Random string id. More...
 
string stylename
 Style name. More...
 
TCanvas * Wcan
 Working canvas. More...
 
TLegend * Wleg
 Plot legends. More...
 
TPad * Wpad
 Working pad. More...
 
TText * Wtext
 Additional text. More...
 

Detailed Description

Set two trigger sets in coincidence.

A time coincidence algorithm is implemented in MakeCoinc(). The trigger sets must be defined with SetTriggers(). This class also offers methods to plot coincident triggers. These plots are generated with MakeComparators().

Author
Florent Robinet

Constructor & Destructor Documentation

◆ Coinc2()

Coinc2::Coinc2 ( const unsigned int  aVerbose = 0)

Constructor of the Coinc2 class.

Parameters
[in]aVerboseVerbosity level.

◆ ~Coinc2()

Coinc2::~Coinc2 ( void  )
virtual

Destructor of the Coinc2 class.

Member Function Documentation

◆ GetActiveClusterN()

unsigned int Coinc2::GetActiveClusterN ( const unsigned int  aSampleIndex)
inline

Gets the number of active clusters.

Active clusters are used by the coincidence algorithm. They are defined when calling SetTriggers().

See also
SelectClusters().
Parameters
[in]aSampleIndexTrigger sample index: 0 or 1.

◆ GetClusterIndex()

unsigned int Coinc2::GetClusterIndex ( const unsigned int  aSampleIndex,
const unsigned int  aCoincIndex 
)
inline

Returns the cluster index involved in a given coinc event.

Warning
The validity of the coinc index is not checked.
Parameters
[in]aSampleIndexTrigger sample index: 0 or 1.
[in]aCoincIndexCoinc index.

◆ GetCoincDeltat()

double Coinc2::GetCoincDeltat ( void  )
inline

Returns the chacteristic duration defining a coinc \(\delta t\) [s].

◆ GetCoincLiveTime()

double Coinc2::GetCoincLiveTime ( void  )
inline

Returns the livetime of coinc segments [s].

◆ GetCoincN()

unsigned int Coinc2::GetCoincN ( void  )
inline

Returns the current number of coinc events.

◆ GetCoincSegments()

Segments* Coinc2::GetCoincSegments ( void  )
inline

Returns a pointer to the coincidence segments.

◆ GetCoincSegmentsCopy()

Segments* Coinc2::GetCoincSegmentsCopy ( void  )
inline

Returns a copy of coincidence segments.

◆ GetCoincTag()

bool Coinc2::GetCoincTag ( const unsigned int  aCoincIndex)
inline

Gets the tag value of a given coinc event.

Warning
The validity of the coinc index is not checked.
Parameters
[in]aCoincIndexCoinc index.

◆ GetCoincTimeWindowEnd()

double Coinc2::GetCoincTimeWindowEnd ( const unsigned int  aSampleIndex,
const unsigned int  aClusterIndex 
)
inline

Returns the coincidence time window end \(\tau_e\)[s].

The window end is defined as:

\[ \tau_e = \mathrm{Min}(t_p+\delta t/2, t_e) \]

where \(t_e\) and \(t_p\) are the cluster end time and peak time respectively.

Parameters
[in]aSampleIndexTrigger sample index: 0 or 1.
[in]aClusterIndexCluster index for the selected trigger sample.
Precondition
Both the sample index and cluster index must be valid!

◆ GetCoincTimeWindowStart()

double Coinc2::GetCoincTimeWindowStart ( const unsigned int  aSampleIndex,
const unsigned int  aClusterIndex 
)
inline

Returns the coincidence time window start \(\tau_s\)[s].

The window start is defined as:

\[ \tau_s = \mathrm{Max}(t_p-\delta t/2, t_s) \]

where \(t_s\) and \(t_p\) are the cluster start time and peak time respectively.

Parameters
[in]aSampleIndexTrigger sample index: 0 or 1.
[in]aClusterIndexCluster index for the selected trigger sample.
Precondition
Both the sample index and cluster index must be valid!

◆ GetFrequencyMax()

double Coinc2::GetFrequencyMax ( const unsigned int  aSampleIndex)
inline

Returns the miaximum frequency used to select input clusters [Hz].

Parameters
[in]aSampleIndexTrigger sample index.

◆ GetFrequencyMin()

double Coinc2::GetFrequencyMin ( const unsigned int  aSampleIndex)
inline

Returns the minimum frequency used to select input clusters [Hz].

Parameters
[in]aSampleIndexTrigger sample index.

◆ GetSnrMin()

double Coinc2::GetSnrMin ( const unsigned int  aSampleIndex)
inline

Returns the minimum SNR used to select input clusters [Hz].

Parameters
[in]aSampleIndexTrigger sample index.

◆ GetTimeOffset()

double Coinc2::GetTimeOffset ( const unsigned int  aSampleIndex)
inline

Returns the time offset of a trigger set [s].

Parameters
[in]aSampleIndexTrigger sample index: 0 or 1.

◆ MakeCoinc()

unsigned int Coinc2::MakeCoinc ( void  )

Runs the coincidence algorithm.

The trigger sets must first be defined with SetTriggers(). Only active clusters are considered (see SelectClusters()). For each cluster, an effective duration is defined between \(\tau_s\) and \(\tau_e\):

\[ \tau_s = \mathrm{Max}(t_p-\delta t/2, t_s) \]

\[ \tau_e = \mathrm{Min}(t_p+\delta t/2, t_e) \]

where \(t_s\), \(t_e\), and \(t_p\) are the cluster start time, end time and peak time respectively. Two clusters are said to coincide if their effective durations overlap. All coinc events are tagged to true.

Returns
The number of coinc events.

◆ MakeComparators()

bool Coinc2::MakeComparators ( void  )

Produce plots for coinc events.

List of plots:

  • Fraction of coincident events as a function of SNR and frequency
  • SNR vs SNR for coinc events
  • Frequency vs frequency for coinc events
  • SNR vs time for clusters of trigger sample 0
  • SNR vs time for clusters of trigger sample 1
  • Frequency vs time for clusters of trigger sample 0
  • Frequency vs time for clusters of trigger sample 1
Warning
Only valid coinc events are plotted.

◆ PrintCoinc()

void Coinc2::PrintCoinc ( void  )

Prints the list of coinc events.

◆ PrintCoincNot()

void Coinc2::PrintCoincNot ( const unsigned int  aSampleIndex)

Prints the list of active clusters NOT participating to a coinc event.

Note
Not-active clusters are not printed.
Parameters
[in]aSampleIndexTrigger sample index: 0 or 1.

◆ PrintComparators()

void Coinc2::PrintComparators ( const string  aFileName)

Prints plots for coinc events.

After calling MakeComparators(), the plots are printed in png files.

Parameters
[in]aFileNameOutput file name. Do not provide the file extension, it will be automatically added. For example: "/path/to/directory/filename".

◆ SelectClusters()

void Coinc2::SelectClusters ( const unsigned int  aSampleIndex)
private

Select input clusters.

The input clusters are set to "active" if all the following condition are met:

  • The cluster tag is positive or zero: clusters with a negative tag are ignored.
  • The cluster time (after time offset) is inside the coinc segments.
  • The cluster frequency is inside the frequency range defined with SetFrequencyRange().
  • The cluster SNR is above the minimum defined with SetSnrMin().
Warning
The cluster tag is set to -1 if the time, frequency, or SNR selection fails.
Parameters
[in]aSampleIndexTrigger sample index.

◆ SetCoincDeltat()

void Coinc2::SetCoincDeltat ( const double  aDeltat)
inline

Sets the chacteristic duration to define a coinc \(\delta t\).

Parameters
[in]aDeltatChacteristic duration \(\delta t\) [s].

◆ SetCoincTag() [1/2]

void Coinc2::SetCoincTag ( const bool  aNewTag)
inline

Sets a new tag for all coinc events.

Parameters
[in]aNewTagNew tag value.

◆ SetCoincTag() [2/2]

void Coinc2::SetCoincTag ( const unsigned int  aCoincIndex,
const bool  aNewTag 
)
inline

Sets a new tag to a given coinc event.

Warning
The validity of the coinc index is not checked.
Parameters
[in]aCoincIndexCoinc index.
[in]aNewTagNew tag value.

◆ SetFrequencyRange()

void Coinc2::SetFrequencyRange ( const unsigned int  aSampleIndex,
const double  aFrequencyMin,
const double  aFrequencyMax 
)
inline

Sets a frequency range to select input clusters.

See also
SelectClusters()
Parameters
[in]aSampleIndexTrigger sample index.
[in]aFrequencyMinMinimum frequency [Hz].
[in]aFrequencyMaxMaximum frequency [Hz].

◆ SetSnrMin()

void Coinc2::SetSnrMin ( const unsigned int  aSampleIndex,
const double  aSnrMin 
)
inline

Sets a minimum SNR to select input clusters.

See also
SelectClusters()
Parameters
[in]aSampleIndexTrigger sample index.
[in]aSnrMinMinimum SNR.

◆ SetTriggers()

bool Coinc2::SetTriggers ( ReadTriggers aTrigger0,
ReadTriggers aTrigger1,
const double  aTimeOffset0 = 0.0,
const double  aTimeOffset1 = 0.0,
Segments aValidSegments = NULL 
)

Sets the trigger sets.

The two input ReadTriggers objects define the trigger sets. Only clusters are used in the coincidence. Therefore, triggers must be clustered first using Triggers::Clusterize().

Clusters are selected based on time and frequency: see SelectClusters(). After selection, a cluster is said to be "active".

Warning
Unactive clusters are tagged with a negative value.

Clusters can be time-shifted with a given time offset.

In this function, the coinc segments are constructed. The coinc segments are the intersection of:

  • the input trigger segments after applying the time offsets
  • the input segments aValidSegments if any.
Parameters
[in]aTrigger0Pointer to the first trigger object (must be a valid object).
[in]aTrigger1Pointer to the second trigger object (must be a valid object).
[in]aTimeOffset0Time offset to apply to the clusters of the first set.
[in]aTimeOffset1Time offset to apply to the clusters of the second set.
[in]aValidSegmentsList of segments to consider clusters (before time offset!). Set this to NULL to only use the input trigger segments.

Member Data Documentation

◆ CoC

vector<unsigned int> Coinc2::CoC[COINC2_NT]
private

Coinc cluster index.

◆ coinc_dt

double Coinc2::coinc_dt
private

Coinc time distance [s].

◆ CoSeg

Segments* Coinc2::CoSeg
private

Coinc segments.

◆ CoTag

bool* Coinc2::CoTag
private

Coinc tags.

◆ freqmax

double Coinc2::freqmax[COINC2_NT]
private

Frequency max selection [Hz].

◆ freqmin

double Coinc2::freqmin[COINC2_NT]
private

Frequency min selection [Hz].

◆ gc_freqfreq

TGraph* Coinc2::gc_freqfreq
private

Frequency vs frequency.

◆ gc_freqtime

TGraph* Coinc2::gc_freqtime[4]
private

Coinc Frequency vs time.

◆ gc_snrsnr

TGraph* Coinc2::gc_snrsnr
private

Coinc SNR vs SNR.

◆ gc_snrtime

TGraph* Coinc2::gc_snrtime[4]
private

SNR vs time.

◆ hc_freqfrac

TH1D* Coinc2::hc_freqfrac[2]
private

coinc fraction vs frequency

◆ hc_snrfrac

TH1D* Coinc2::hc_snrfrac[2]
private

coinc fraction vs SNR

◆ nactive

unsigned int Coinc2::nactive[COINC2_NT]
private

Number of active clusters.

◆ snrmin

double Coinc2::snrmin[COINC2_NT]
private

SNR min selection.

◆ toffset

double Coinc2::toffset[COINC2_NT]
private

Time offsets [s].

◆ triggers

ReadTriggers* Coinc2::triggers[COINC2_NT]
private

Trigger sets.

◆ verbosity

unsigned int Coinc2::verbosity
private

Verbosity level.


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