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

Manage streams. More...

#include <Streams.h>

Inheritance diagram for Streams:
Collaboration diagram for Streams:

Public Member Functions

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.
 
Constructors and destructors
 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].
 
bool GetStatus (void)
 Returns the class status.
 
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.
 

Protected Attributes

string Name
 Stream name.
 
- Protected Attributes inherited from Sample
double fHighPassFrequency
 Cutoff frequency.
 
unsigned int fNativeFrequency
 Native sampling frequency.
 
bool fRemoveDC
 DC removal flag.
 
double * fWindow
 Window.
 
unsigned int fWindowSize
 Window size.
 
unsigned int fWorkingFrequency
 Working sampling frequency.
 
Monitormon
 Class monitor.
 

Private Member Functions

void ComputeDetectorResponse (void)
 Computes the detector spatial response matrix.
 
void MakeDetector (void)
 Associates detector's properties to the stream (based on prefix).
 

Private Attributes

unsigned int DetIndex
 Detector index.
 
double DetLoc [3]
 Detector location (vertex) on Earth.
 
string NamePrefix
 Stream prefix.
 
string NameSuffix
 Stream suffix.
 
string NameSuffixUnderScore
 Stream suffix with only underscores.
 
double Response [3][3]
 Detector response.
 
unsigned int verbose
 Verbosity level.
 

Detailed Description

Manage streams.

This class is designed to identify data streams. In particular, the Stream object can be converted into one detector of the LIGO-virgo-KAGRA global network if the stream name is recognized as such. In that case many specific functions are provided to access the detector properties.

Author
Florent Robinet

Constructor & Destructor Documentation

◆ Streams()

Streams::Streams ( const string  aName,
const unsigned int  aVerbose = 0 
)

Constructor of the Streams class.

A stream is identified by its name which shall follow the stream name convention.

See also
SetName()
Parameters
[in]aNameStream name.
[in]aVerboseVerbosity level.

◆ ~Streams()

Streams::~Streams ( void  )
virtual

Destructor of the Streams class.

Member Function Documentation

◆ ComputeDetectorResponse()

void Streams::ComputeDetectorResponse ( void  )
private

Computes the detector spatial response matrix.

◆ GetDetectorAMResponse()

void Streams::GetDetectorAMResponse ( double &  aFplus,
double &  aFcross,
const double  aRa,
const double  aDec,
const double  aPsi,
const double  aGmst 
)

Computes antenna factors \(F_+\) and \(F_\times\).

Antenna factors are calculated for a source at a specified sky position, polarization angle, and sidereal time. The implementation follows the formulae given in Anderson et al., PRD 63 042003 (2001)

Parameters
[out]aFplusReturned \(F_+\) value.
[out]aFcrossReturned \(F_\times\) value.
[in]aRaRight ascension [rad].
[in]aDecDeclination [rad].
[in]aPsiPolarisation angle [rad].
[in]aGmstSideral time [rad].

◆ GetDetectorIndex()

unsigned int Streams::GetDetectorIndex ( void  )
inline

Returns the detector index for this stream.

◆ GetDetectorPrefix()

string Streams::GetDetectorPrefix ( void  )
inline

Returns the detector prefix for this stream.

◆ GetDirectory()

string Streams::GetDirectory ( const string  aOutDir = ".")
inline

Returns the stream directory.

Convention: ./[name]

Optionally, a root directory can be added: [aOutDir]/[name]

Parameters
[in]aOutDirRoot directory.

◆ GetLocalTime()

double Streams::GetLocalTime ( const double  aRa,
const double  aDec,
const double  aGeocentricTime 
)
inline

Converts the geocentric time to the detector local time [s].

The wave propagation direction must be given by the right ascension and declination.

Parameters
[in]aRaRight ascension [rad].
[in]aDecDeclination [rad].
[in]aGeocentricTimeGeocentric time [s].

◆ GetName()

string Streams::GetName ( void  )
inline

Returns the stream full name.

◆ GetNameConv()

string Streams::GetNameConv ( void  )
inline

Returns the stream name using the LIGO-Virgo file name convention.

◆ GetNamePrefix()

string Streams::GetNamePrefix ( void  )
inline

Returns the stream name prefix.

◆ GetNameSuffix()

string Streams::GetNameSuffix ( void  )
inline

Returns the stream name suffix.

◆ GetNameSuffixUnderScore()

string Streams::GetNameSuffixUnderScore ( void  )
inline

Returns the stream name suffix with only underscores.

Dash characters are turned into underscore characters.

◆ GetSkyAntennaFactor()

TH2D * Streams::GetSkyAntennaFactor ( const unsigned int  aGpsTime)

Returns the sky map of the detector antenna factor for a given time.

The returned histogram (declination vs right ascension) is filled with the antenna factor values: \(\sqrt{F_{+}^2 + F_{\times}^2}\).

Note
The user is in charge of deleting the returned histogram.
Parameters
[in]aGpsTimeGPS time [s].

◆ GetSkyRingPoint()

bool Streams::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.

When detected by two detectors, a gravitational-wave source can be located along a ring in the sky. The GW event is detected at time \(t\) in this detector and at \(t^\prime\) in another detector. We note \(\delta t = t^\prime-t\) the gravitational-wave travel time between the two detectors. We parameterize the position on the ring using the angle \(\omega\) which can take values between \(0\) and \(2\pi\).

We define the reference frame \(\cal{R}\) with an origin positioned at the vertex of this detector, \(D\), and the axes \((x, y, z)\) oriented along the celestial axes. In this reference frame, the vertex of the second detector, \(D^\prime\), is located at \(D^\prime = (d_x,\, d_y,\, d_z)_{\cal{R}}\), or, in spherical coordinates \(D^\prime = (d\sin\theta\cos\varphi,\, d\sin\theta\sin\varphi,\, d\cos\theta)_{\cal{R}}\), where \(d\) is the distance between the two detectors.

We define a second reference frame \(\cal{R}^\prime\) with an origin positioned at the vertex of the other detector ( \(D^\prime\)). The reference frame \(\cal{R}^\prime\) is obtained after rotating \(\cal{R}\) with the rotation matrix \(R\). The rotation \(R\) is a sequence of two extrinsic rotations: first a rotation about the \(y\) axis with a \(\theta\) angle, then a rotation about the \(z\) axis with a \(\varphi\) angle. The rotation matrix can be written as:

\[ R = \left[ {\begin{array}{ccc} \cos\varphi\cos\theta & \sin\varphi\cos\theta & -\sin\theta \\ -\sin\varphi & \cos\theta & 0 \\ \cos\varphi\sin\theta & \sin\varphi\sin\theta & \cos\theta \end{array} } \right] \]

The two reference frames are represented in the following figure. Solid lines (resp. dashed lines) are used to represent the axis of \(\cal{R}\) (resp. \(\cal{R}^\prime\)).

Sky ring associated to a two-detector position.

The unit vector pointing in the direction of the GW source is noted \(\vec{u}_s=(\sin\theta_s\cos\varphi_s,\, \sin\theta_s\sin\varphi_s,\, \cos\theta_s)_{\cal{R}}\). The position of the source must therefore verify:

\[ \vec{u}_s\cdot\overrightarrow{DD^\prime} = -c\delta t = d\cos\gamma_s \]

where \(c\) is the speed of light in vacuum and \(\gamma_s\) is the angle between the \(\overrightarrow{DD^\prime}\) axis and the source vector \(\vec{u}_s\). The source position is degenerated and can be anywhere along the ring defined by the cone with an opening angle \(\gamma_s\). The angle \(\gamma_s\) is completely determined by the previous equation, assuming the time delay \(\delta t\) is known: \(\gamma_s = \arccos(-c\delta t / d)\). In \(\cal{R}^\prime\), the source vector \(\vec{u}_s\) coordinates are \(\vec{u}_s=(\sin\gamma_s\cos\omega_s,\, \sin\gamma_s\sin\omega_s,\, \cos\gamma_s)_{\cal{R}^\prime}\). The \(\gamma_s\) angle is derived from the time delay and \(\omega_s\) must be provided by the user.

The rotation to move from \(\cal{R}^\prime\) to \(\cal{R}\) is described by the inverse of \(R\). For a rotation matrix, we simply use the transpose matrix: \(R^{-1} = R^T\):

\[ \left( {\begin{array}{c} \sin\theta_s\cos\varphi_s \\ \sin\theta_s\sin\varphi_s \\ \cos\theta_s \end{array} } \right)_{\cal{R}} = R^T \times \left( {\begin{array}{c} \sin\gamma_s\cos\omega_s \\ \sin\gamma_s\sin\omega_s \\ \cos\gamma_s \end{array} } \right)_{\cal{R}^\prime} \]

Finally, the sideral time must be added to the \(\varphi_s\) angle to account for the Earth roatation.

Parameters
[out]aThetaSSource position in the Earth reference frame (celestial coordinates): polar angle \(\theta_s\) [rad].
[out]aPhiSSource position in the Earth reference frame (celestial coordinates): azimuthal angle \(\varphi_s\) [rad].
[in]aGmstSideral time for this stream [rad].
[in]aDeltaTTime delay between detectors: \(\delta t = t^\prime-t\) [s].
[in]aOmegaSRing angle as defined in \(\cal{R}^\prime\): \(\omega_s\) [rad].
[in]aDprimePointer to the other detector \(D^\prime\).

◆ GetSkyRingPointRaDec()

bool Streams::GetSkyRingPointRaDec ( double &  aDecS,
double &  aRaS,
const double  aGmst,
const double  aDeltaT,
const double  aOmegaS,
Streams aDprime 
)
inline

Returns the sky position of a GW signal when detected by two detectors (radec).

See also
GetSkyRingPoint() for a full description.
Parameters
[out]aDecSSource position in the Earth reference frame (celestial coordinates): declination [rad].
[out]aRaSSource position in the Earth reference frame (celestial coordinates): right ascension [rad].
[in]aGmstSideral time for this stream [rad].
[in]aDeltaTTime delay between detectors: \(\delta t = t^\prime-t\) [s].
[in]aOmegaSRing angle as defined in \(\cal{R}^\prime\): \(\omega_s\) [rad].
[in]aDprimePointer to the other detector \(D^\prime\).

◆ GetTriggerFileName()

string Streams::GetTriggerFileName ( const unsigned int  aGpsStart,
const unsigned int  aDuration,
const string  aFileFormat = "root",
const string  aProcessName = "PROC",
const string  aOutDir = "." 
)
inline

Returns the stream trigger file name.

Parameters
[in]aGpsStartGPS start [s].
[in]aDurationDuration [s].
[in]aFileFormatFile format (extension).
[in]aProcessNameProcess name.
[in]aOutDirOutput directory.

◆ MakeDetector()

void Streams::MakeDetector ( void  )
private

Associates detector's properties to the stream (based on prefix).

◆ SetName()

void Streams::SetName ( const string  aName)

Sets a new name to the stream.

A stream is identified by its name which shall follow the stream name convention: [prefix]:[suffix], where [prefix] is 2-characters string exactly.

Parameters
[in]aNameStream name.

Member Data Documentation

◆ DetIndex

unsigned int Streams::DetIndex
private

Detector index.

◆ DetLoc

double Streams::DetLoc[3]
private

Detector location (vertex) on Earth.

◆ Name

string Streams::Name
protected

Stream name.

◆ NamePrefix

string Streams::NamePrefix
private

Stream prefix.

◆ NameSuffix

string Streams::NameSuffix
private

Stream suffix.

◆ NameSuffixUnderScore

string Streams::NameSuffixUnderScore
private

Stream suffix with only underscores.

◆ Response

double Streams::Response[3][3]
private

Detector response.

◆ verbose

unsigned int Streams::verbose
private

Verbosity level.


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