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

Inject simulated signals in a data stream. More...

#include <InjEct.h>

Inheritance diagram for InjEct:
Collaboration diagram for InjEct:

Public Member Functions

void Inject (Streams *aDetectorStream, const unsigned int aDataSize, double *aData, const double aTimeStart)
 Injects in a data vector.
 
void Plot (Streams *aDetectorStream, const Long64_t aInjectionIndex)
 Plots the local waveform of a given injection.
 
void SetTukeyFraction (const double aFraction)
 Sets the transition of the Tukey window.
 
Constructors and destructors
 InjEct (const string aPattern, const string aPlotStyle="STANDARD", const unsigned int aVerbose=0)
 Constructor of the InjEct class.
 
virtual ~InjEct (void)
 Destructor of the InjEct class.
 
- Public Member Functions inherited from InjRea
double GetInjectionAmplitude (void)
 Returns the current injection amplitude.
 
double GetInjectionAmplitudeMax (const unsigned int aNameIndex)
 Returns the maximum injection amplitude.
 
double GetInjectionAmplitudeMin (const unsigned int aNameIndex)
 Returns the minimum injection amplitude.
 
double GetInjectionDec (void)
 Returns the current injection declination [rad].
 
double GetInjectionEccentricity (void)
 Returns the current injection eccentricity.
 
double GetInjectionFrequency (void)
 Returns the current injection frequency [Hz].
 
double GetInjectionFrequencyMax (const unsigned int aNameIndex)
 Returns the maximum injection frequency [Hz].
 
double GetInjectionFrequencyMin (const unsigned int aNameIndex)
 Returns the minimum injection frequency [Hz].
 
Long64_t GetInjectionIndex (void)
 Returns the index of the current injection.
 
Long64_t GetInjectionIndexAfter (const double aTime)
 Returns the index of the first injection after a given time.
 
string GetInjectionName (const unsigned int aNameIndex)
 Returns a given injection name in the list.
 
string GetInjectionName (void)
 Returns the current injection name.
 
unsigned int GetInjectionNameIndex (void)
 Returns the current injection name index.
 
unsigned int GetInjectionNameN (void)
 Returns the number of injection names.
 
TH1D * GetInjectionParamDist (const string aParamName, const unsigned int aNbins=1, const string aBinType="UNIFORM")
 Returns the 1D distribution of an injection parameter.
 
double GetInjectionPolarization (void)
 Returns the current injection polarization [rad].
 
double GetInjectionRa (void)
 Returns the current injection right-ascension [rad].
 
double GetInjectionSigma (void)
 Returns the current injection sigma [s].
 
double GetInjectionSigmaMax (const unsigned int aNameIndex)
 Returns the maximum injection sigma [s].
 
double GetInjectionSigmaMin (const unsigned int aNameIndex)
 Returns the minimum injection sigma [s].
 
bool GetInjectionTag (const Long64_t aInjIndex)
 Returns an injection tag.
 
bool GetInjectionTag (void)
 Returns the current injection tag.
 
double GetInjectionTime (void)
 Returns the current injection GPS time [s].
 
double GetInjectionTimeEnd (void)
 Returns the GPS ending time of the injection [s] at the center of the Earth.
 
double GetInjectionTimeMax (const unsigned int aNameIndex)
 Returns the maximum injection GPS time.
 
double GetInjectionTimeMin (const unsigned int aNameIndex)
 Returns the minimum injection GPS time.
 
double GetInjectionTimeStart (void)
 Returns the GPS starting time of the injection [s] at the center of the Earth.
 
injtype GetInjectionType (void)
 Returns the current injection type.
 
string GetInputFilePattern (void)
 Returns the input file pattern provided in the constructor.
 
Long64_t GetN (const unsigned int aNameIndex)
 Returns the number of injections of a given name.
 
Long64_t GetN (void)
 Returns the number of injections.
 
double GetSineGaussh0cross (void)
 Returns the SineGauss \(h_{\times rss}\) peak amplitude of current injection.
 
double GetSineGaussh0plus (void)
 Returns the SineGauss \(h_{+rss}\) peak amplitude of current injection.
 
int LoadInjection (const Long64_t aInjIndex)
 Loads a given injection.
 
void SetInjectionTag (const bool aTag)
 Sets a new tag value to the current injection.
 
void SetInjectionTag (const Long64_t aInjIndex, const bool aTag)
 Sets a new tag value to an injection.
 
 InjRea (const string aPattern, const unsigned int aVerbose=0)
 Constructor of the InjRea class.
 
virtual ~InjRea ()
 Destructor of the InjRea 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 ConstructSineGaussWaveform (Streams *aDetectorStream)
 Constructs the local time-domain waveforms \(h_{+}\), \(h_{\times}\), and \(h_{det}\) for the current "Sine-Gaussian" injection.
 
void ConstructUserWaveform (Streams *aDetectorStream)
 Constructs the local time-domain waveforms \(h_{+}\), \(h_{\times}\), and \(h_{det}\) for the current "user-defined" injection.
 

Private Attributes

TGraph * hcross
 Injection waveform \(h_{\times}\) (local time).
 
TGraph * hdet
 Injection waveform projected on the detector \(h_{det}\).
 
TGraph * hplus
 Injection waveform \(h_{+}\) (local time).
 
double tukey_frac
 Fraction of the waveform use to transition to 0 (between 0 and 1).
 

Additional Inherited Members

- Protected Attributes inherited from InjRea
TChain * InjTree
 Injection tree.
 
unsigned int Verbose
 Verbosity level.
 
TGraph * wave_hcross
 Waveform \(h_{\times}(t)\).
 
TGraph * wave_hplus
 Waveform \(h_{+}(t)\).
 
- 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

Inject simulated signals in a data stream.

This class injects signal waveforms in a data vector using injection files produced with InjGen.

The injection waveform is generated at the center of the Earth using the parameters from the injection files. Both polarizations \(h_{+}\) and \(h_{\times}\) are calculated. The waveform timing is adjusted to a given detector (Streams): the waveforms are calculated with the detector local time, accounting for the light travel time and the sky position of the source. Then we compute the detector strain:

\[ h_{det}(t) = T(t)\times \left(F_{+}(t)\times h_{+}(t) + F_{\times}(t)\times h_{\times}(t)\right). \]

The detector antenna factors \(F_{+}\) and \(F_{\times}\) are calculated for the source sky position and polarization angle and at any given time. Moreover, a Tukey window \(T(t)\) is applied to have a nice transition to 0 at both ends of the waveform.

See also
ConstructSineGaussWaveform() and ConstructUserWaveform()
Author
Florent Robinet

Constructor & Destructor Documentation

◆ InjEct()

InjEct::InjEct ( const string  aPattern,
const string  aPlotStyle = "STANDARD",
const unsigned int  aVerbose = 0 
)

Constructor of the InjEct class.

Injections listed in the ROOT files designated by a file pattern are loaded with InjRea. The Tukey window to frame the injection signal is set to 10%: see SetTukeyFraction().

Parameters
[in]aPatternInjection file pattern.
[in]aPlotStyleGwollumPlot style.
[in]aVerboseVerbosity level.

◆ ~InjEct()

InjEct::~InjEct ( void  )
virtual

Destructor of the InjEct class.

Member Function Documentation

◆ ConstructSineGaussWaveform()

void InjEct::ConstructSineGaussWaveform ( Streams aDetectorStream)
private

Constructs the local time-domain waveforms \(h_{+}\), \(h_{\times}\), and \(h_{det}\) for the current "Sine-Gaussian" injection.

The \(h_{+}(t)\) and \(h_{\times}(t)\) waveforms are first calculated at the center of the Earth. Then, they are time-shifted to match the detector local time. Moreover, the wavform amplitude is rescaled by the injection amplitude.

Then we compute the detector strain:

\[ h_{det}(t) = T(t)\times \left(F_{+}(t)\times h_{+}(t) + F_{\times}(t)\times h_{\times}(t)\right). \]

The detector antenna factors \(F_{+}\) and \(F_{\times}\) are calculated for the source sky position and polarization angle and at any given time. Moreover, a Tukey window \(T(t)\) is applied to have nice transitions to 0.

Todo:
Document the waveform calculation.
Parameters
[in]aDetectorStreamDetector stream. It is assumed to be a valid Streams object.

◆ ConstructUserWaveform()

void InjEct::ConstructUserWaveform ( Streams aDetectorStream)
private

Constructs the local time-domain waveforms \(h_{+}\), \(h_{\times}\), and \(h_{det}\) for the current "user-defined" injection.

The \(h_{+}(t)\) and \(h_{\times}(t)\) waveforms are first calculated at the center of the Earth. Then, they are time-shifted to match the detector local time. Moreover, the wavform amplitude is rescaled by the injection amplitude.

Then we compute the detector strain:

\[ h_{det}(t) = T(t)\times \left(F_{+}(t)\times h_{+}(t) + F_{\times}(t)\times h_{\times}(t)\right). \]

The detector antenna factors \(F_{+}\) and \(F_{\times}\) are calculated for the source sky position and polarization angle and at any given time. Moreover, a Tukey window \(T(t)\) is applied to have nice transitions to 0.

Parameters
[in]aDetectorStreamDetector stream. It is assumed to be a valid Streams object.

◆ Inject()

void InjEct::Inject ( Streams aDetectorStream,
const unsigned int  aDataSize,
double *  aData,
const double  aTimeStart 
)

Injects in a data vector.

All the signals overlapping the input data vector are injected.

Note
The native sampling frequency of the Streams object is considered to be the data sampling frequency.
Parameters
[in]aDetectorStreamDetector stream. It is assumed to be a valid Streams object.
[in]aDataSizeInput vector size.
[in,out]aDataPointer to input data vector (time-domain).
[in]aTimeStartGPS time of first data sample.
Todo:
Optimize the loop over injections.

◆ Plot()

void InjEct::Plot ( Streams aDetectorStream,
const Long64_t  aInjectionIndex 
)

Plots the local waveform of a given injection.

Parameters
[in]aDetectorStreamDetector stream. It is assumed to be a valid Streams object.
[in]aInjectionIndexInjection index.

◆ SetTukeyFraction()

void InjEct::SetTukeyFraction ( const double  aFraction)
inline

Sets the transition of the Tukey window.

This number (between 0 and 1) sets the fraction of the waveform used to transition the time series to 0 at both ends. For exemple, using a fraction of 0.1 means that it takes 5% of the waveform duration to transition from 0 to 1 and 5% again to transition from 1 to 0.

Parameters
[in]aFractionFraction of the waveform duration: it must be a number between 0 and 1.

Member Data Documentation

◆ hcross

TGraph* InjEct::hcross
private

Injection waveform \(h_{\times}\) (local time).

◆ hdet

TGraph* InjEct::hdet
private

Injection waveform projected on the detector \(h_{det}\).

◆ hplus

TGraph* InjEct::hplus
private

Injection waveform \(h_{+}\) (local time).

◆ tukey_frac

double InjEct::tukey_frac
private

Fraction of the waveform use to transition to 0 (between 0 and 1).


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