GWOLLUM  4.2.0
Tools for gravitational-wave analyses
InjTre Class Reference

Manage injection structures. More...

#include <InjTre.h>

Inheritance diagram for InjTre:

Public Member Functions

unsigned int Add (const double aRa, const double aDec, const double aTime, const double aAmplitude, const double aEccentricity=0.0, const double aPolarization=0.0, const double aSigma=0.0, const double aFrequency=0.0)
 Adds an injection. More...
 
unsigned int GetN (void)
 Returns the current number of injections. More...
 
void Reset (void)
 Resets the injection TTree. More...
 
bool SetWave (TGraph *aHplus, TGraph *aHcross=NULL)
 Sets the user waveform for "Wave" injections. More...
 
bool Write (const string aRootFileName="./myinjections.root")
 Writes injections to disk. More...
 
Constructors and destructors
 InjTre (const injtype aInjType, const string aInjName="gwl_inj", const unsigned int aVerbose=0)
 Constructor of the InjTre class. More...
 
virtual ~InjTre ()
 Destructor of the InjTre class. More...
 

Protected Attributes

unsigned int Verbose
 Verbosity level. More...
 

Private Attributes

double inj_amp
 Injection amplitude. More...
 
double inj_dec
 Injection declination [rad]. More...
 
double inj_ecc
 Injection eccentricity. More...
 
double inj_f0
 Injection frequency [Hz]. More...
 
double inj_psi
 Injection polarization angle [rad]. More...
 
double inj_ra
 Injection right ascension [rad]. More...
 
double inj_sigma
 Injection sigma [s]. More...
 
double inj_time
 Injection time [s]. More...
 
unsigned int inj_time_ns
 Injection subsecond time [ns] (only used for sorting injections in InjRea). More...
 
TTree * InjTree
 Injection tree. More...
 
TGraph * wave_hcross
 Waveform \(h_{\times}(t)\). More...
 
TGraph * wave_hplus
 Waveform \(h_{+}(t)\). More...
 
string wave_name
 Waveform name. More...
 
UInt_t wave_type
 Waveform type: see InjTyp.h. More...
 
TTree * WaveTree
 Waveform tree. More...
 

Detailed Description

Manage injection structures.

Injection parameters are saved in a TTree structure.

  • Name: An injection is given a name.
  • Type: The type of an injection defines the method to compute the time series \(h_+(t)\) and \(h_\times(t)\). Some injections are user-defined. In that case the time series must be provided by the user with the SetWave() function. See InjTyp.h for the supported types.
  • Right-ascension [rad]: sky position.
  • Declination [rad]: sky position.
  • Time since the GPS epoch [s]: this is the time of the injection measured at the center of the Earth.
  • Eccentricity: this is a number between 0 and 1.
  • Polarization angle [rad].
  • Amplitude.
  • Sigma [s].
  • Frequency [Hz].
Author
Florent Robinet

Constructor & Destructor Documentation

◆ InjTre()

InjTre::InjTre ( const injtype  aInjType,
const string  aInjName = "gwl_inj",
const unsigned int  aVerbose = 0 
)

Constructor of the InjTre class.

An injection is identified by a name. Then, it must be given a type: see injtype. For user-defined injections, waveforms must be provided with SetWave().

Parameters
[in]aInjTypeInjection type: see InjTyp.h.
[in]aInjNameInjection name. Do not use white space, they will be repaced by "_".
[in]aVerboseVerbosity level.

◆ ~InjTre()

InjTre::~InjTre ( void  )
virtual

Destructor of the InjTre class.

Member Function Documentation

◆ Add()

unsigned int InjTre::Add ( const double  aRa,
const double  aDec,
const double  aTime,
const double  aAmplitude,
const double  aEccentricity = 0.0,
const double  aPolarization = 0.0,
const double  aSigma = 0.0,
const double  aFrequency = 0.0 
)

Adds an injection.

Returns
The current number of injections in the TTree.
Parameters
[in]aRaInjection right ascension [rad].
[in]aDecInjection declination [rad].
[in]aTimeInjection GPS time [s].
[in]aAmplitudeInjection amplitude.
[in]aEccentricityInjection eccentricity.
[in]aPolarizationInjection polarization angle [rad].
[in]aSigmaInjection sigma [s].
[in]aFrequencyInjection frequency [Hz].

◆ GetN()

unsigned int InjTre::GetN ( void  )
inline

Returns the current number of injections.

◆ Reset()

void InjTre::Reset ( void  )
inline

Resets the injection TTree.

Note
The waveform tree is also reset.

◆ SetWave()

bool InjTre::SetWave ( TGraph *  aHplus,
TGraph *  aHcross = NULL 
)

Sets the user waveform for "Wave" injections.

The source \(h_{+}\) (and optionally \(h_{\times}\)) timeseries must be provided. The TGraphs represent the wave calibrated polarized strains as a function of time in [s]. By convention, t = 0 s is taken to be the time of the injection at the center of the Earth. They are saved locally.

Note
If the \(h_{\times}\) is provided, it must be same the number of points as \(h_{+}\). Moreover, the two timeseries must coincide in time.

In addition to the waveform, the injection must be given:

  • an amplitude \(A\) which is used to scale the waveform amplitude: \(Ah_{+}\) and \(Ah_{\times}\).
  • a sky position: the declination and the right ascension.
  • a polarization angle [rad].
Returns
true if success.
Parameters
[in]aHplusPointer to the \(h_{+}\) time series.
[in]aHcrossPointer to the \(h_{\times}\) time series.

◆ Write()

bool InjTre::Write ( const string  aRootFileName = "./myinjections.root")

Writes injections to disk.

Note
When writing multiple injection files, think about resetting the TTree structure with Reset().
Parameters
[in]aRootFileNameOutput file name.

Member Data Documentation

◆ inj_amp

double InjTre::inj_amp
private

Injection amplitude.

◆ inj_dec

double InjTre::inj_dec
private

Injection declination [rad].

◆ inj_ecc

double InjTre::inj_ecc
private

Injection eccentricity.

◆ inj_f0

double InjTre::inj_f0
private

Injection frequency [Hz].

◆ inj_psi

double InjTre::inj_psi
private

Injection polarization angle [rad].

◆ inj_ra

double InjTre::inj_ra
private

Injection right ascension [rad].

◆ inj_sigma

double InjTre::inj_sigma
private

Injection sigma [s].

◆ inj_time

double InjTre::inj_time
private

Injection time [s].

◆ inj_time_ns

unsigned int InjTre::inj_time_ns
private

Injection subsecond time [ns] (only used for sorting injections in InjRea).

◆ InjTree

TTree* InjTre::InjTree
private

Injection tree.

◆ Verbose

unsigned int InjTre::Verbose
protected

Verbosity level.

◆ wave_hcross

TGraph* InjTre::wave_hcross
private

Waveform \(h_{\times}(t)\).

◆ wave_hplus

TGraph* InjTre::wave_hplus
private

Waveform \(h_{+}(t)\).

◆ wave_name

string InjTre::wave_name
private

Waveform name.

◆ wave_type

UInt_t InjTre::wave_type
private

Waveform type: see InjTyp.h.

◆ WaveTree

TTree* InjTre::WaveTree
private

Waveform tree.


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