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

Private Member Functions

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

Private Attributes

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

Additional Inherited Members

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

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: