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

Private Attributes

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

Additional Inherited Members

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

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 ( Streams aStream,
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.

Parameters
[in]aStreamInput data stream in which to inject. Only the pointer is saved by the class.
[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 ( void  )
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.

◆ ConstructUserWaveform()

void InjEct::ConstructUserWaveform ( void  )
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.

◆ Inject()

void InjEct::Inject ( 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]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 ( const Long64_t  aInjectionIndex)

Plots the local waveform of a given injection.

Parameters
[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).

◆ InStream

Streams* InjEct::InStream
private

Input stream (DO NOT DELETE).

◆ 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: