![]() |
GWOLLUM 4.2.0
Tools for gravitational-wave analyses
|
Inject simulated signals in a data stream. More...
#include <InjEct.h>
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 | SetAntennaPeriodicity (const double aPeriod) |
Sets the periodicty to update the antenna factor. | |
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. | |
![]() | |
Long64_t | GetFirstInjectionIndexEndAfter (const double aTime) |
Returns the index of the first injection ending after a given time. | |
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 | GetLastInjectionIndexStartBefore (const double aTime) |
Returns the index of the last injection starting before a given time. | |
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. | |
![]() | |
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 | 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 | |
double | antenna_period |
Optimization: periodicity to update the antenna factors. | |
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 | |
![]() | |
TChain * | InjTree |
Injection tree. | |
Monitor * | mon |
Class monitor. | |
TGraph * | wave_hcross |
Waveform \(h_{\times}(t)\). | |
TGraph * | wave_hplus |
Waveform \(h_{+}(t)\). | |
![]() | |
string | name |
Name. | |
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. | |
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.
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().
[in] | aPattern | Injection file pattern. |
[in] | aPlotStyle | GwollumPlot style. |
[in] | aVerbose | Verbosity level. |
|
virtual |
Destructor of the InjEct class.
|
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. They are calculated periodically as defined with SetAntennaPeriodicity(). For each waveform sample, the antenna factors are interpolated between the two time values.
Moreover, a Tukey window \(T(t)\) is applied to have nice transitions to 0.
[in] | aDetectorStream | Detector stream. It is assumed to be a valid Streams object. |
|
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. They are calculated periodically as defined with SetAntennaPeriodicity(). For each waveform sample, the antenna factors are interpolated between the two time values.
Moreover, a Tukey window \(T(t)\) is applied to have nice transitions to 0.
[in] | aDetectorStream | Detector stream. It is assumed to be a valid Streams object. |
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.
[in] | aDetectorStream | Detector stream. It is assumed to be a valid Streams object. |
[in] | aDataSize | Input vector size. |
[in,out] | aData | Pointer to input data vector (time-domain). |
[in] | aTimeStart | GPS time of first data sample. |
void InjEct::Plot | ( | Streams * | aDetectorStream, |
const Long64_t | aInjectionIndex | ||
) |
Plots the local waveform of a given injection.
[in] | aDetectorStream | Detector stream. It is assumed to be a valid Streams object. |
[in] | aInjectionIndex | Injection index. |
|
inline |
Sets the periodicty to update the antenna factor.
When calculating the injection waveform (ConstructUserWaveform()), the antenna factor is updated periodically. Set the periodidicity with this function.
[in] | aPeriod | Time period to update the antenna factors [s]. |
|
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.
[in] | aFraction | Fraction of the waveform duration: it must be a number between 0 and 1. |
|
private |
Optimization: periodicity to update the antenna factors.
|
private |
Injection waveform \(h_{\times}\) (local time).
|
private |
Injection waveform projected on the detector \(h_{det}\).
|
private |
Injection waveform \(h_{+}\) (local time).
|
private |
Fraction of the waveform use to transition to 0 (between 0 and 1).