LALSimulation  5.4.0.1-fe68b98
LALSimIMRPhenomUtils.h
Go to the documentation of this file.
1 #ifndef _LALSIM_IMR_PHENOMUTILS_H
2 #define _LALSIM_IMR_PHENOMUTILS_H
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #ifdef __GNUC__
9 #define UNUSED __attribute__ ((unused))
10 #else
11 #define UNUSED
12 #endif
13 
14 #include <lal/LALDatatypes.h>
15 #include <lal/LALConstants.h>
16 #include <lal/LALStdlib.h>
17 
18 // the following definitions are used in XLALSimIMRPhenomPv3HMComputeWignerdElements
19 #define FIVE_OVER_16 0.3125
20 #define THREE_OVER_EIGHT 0.375
21 #define ONE_OVER_TWO 0.5
22 #define ONE_OVER_EIGHT 0.125
23 #define ONE_OVER_FOUR 0.25
24 #define SQRT_6 2.44948974278317788
25 #define FIFTEEN_OVER_32 0.46875
26 #define THREE_OVER_16 0.1875
27 #define ONE_OVER_32 0.03125
28 #define mSQRT_6_OVER_32 -0.07654655446197431
29 #define SQRT_15_OVER_32 0.12103072956898178
30 #define mSQRT_15_OVER_32 -0.12103072956898178
31 #define SQRT_5_OVER_16 0.13975424859373686
32 #define SQRT_6_OVER_32 0.07654655446197431
33 #define SQRT_10_OVER_32 0.09882117688026186
34 #define mSQRT_10_OVER_32 -0.09882117688026186
35 #define SQRT_30_OVER_16 0.3423265984407288
36 
37 #define SEVEN_OVER_16 0.4375
38 #define SEVEN_OVER_32 0.21875
39 #define ONE_OVER_128 0.0078125
40 #define THIRTYFIVE_OVER_128 0.2734375
41 #define ONE_OVER_16 0.0625
42 #define SQRT_2_OVER_64 0.02209708691207961
43 #define mSQRT_2_OVER_64 -0.02209708691207961
44 #define SQRT_7_OVER_16 0.16535945694153692
45 #define SQRT_14_OVER_32 0.11692679333668567
46 #define SQRT_70_16 0.5229125165837972
47 #define NINE_OVER_32 0.28125
48 #define SQRT_7_OVER_32 0.08267972847076846
49 #define SQRT_35_OVER_4 1.479019945774904
50 
51 // void XLALSimPhenomUtilsTest(void);
52 
53 double XLALSimPhenomUtilsMftoHz(REAL8 Mf, REAL8 Mtot_Msun);
54 double XLALSimPhenomUtilsHztoMf(REAL8 fHz, REAL8 Mtot_Msun);
55 
56 double XLALSimPhenomUtilsFDamp0(REAL8 Mtot_Msun, REAL8 distance);
57 
58 REAL8 XLALSimPhenomUtilsPhenomPv2FinalSpin(const REAL8 m1, const REAL8 m2, const REAL8 chi1_l, const REAL8 chi2_l, const REAL8 chip);
59 
60 REAL8 XLALSimPhenomUtilsPhenomPv3HMFinalSpin(const REAL8 m1, const REAL8 m2, const REAL8 chi1x, const REAL8 chi1y, const REAL8 chi1z, const REAL8 chi2x, const REAL8 chi2y, const REAL8 chi2z);
61 
62 double XLALSimPhenomUtilsIMRPhenomDFinalMass(REAL8 m1, REAL8 m2, REAL8 chi1z, REAL8 chi2z);
63 
64 REAL8 XLALSimPhenomUtilsChiP(const REAL8 m1, const REAL8 m2, const REAL8 s1x, const REAL8 s1y, const REAL8 s2x, const REAL8 s2y);
65 
67 
68 /**
69  * a strcut to keep the wigner-d matrix elements
70  */
71 typedef struct tagIMRPhenomPv3HMWignderStruct
72 {
73  REAL8 d22[2][5]; /**< wigner-d matrix elements for ell=2, mprime=+/-2 and positive[0] and negative[1] mprime */
74  REAL8 d21[2][5]; /**< wigner-d matrix elements for ell=2, mprime=+/-1 and positive[0] and negative[1] mprime */
75  REAL8 d33[2][7]; /**< wigner-d matrix elements for ell=3, mprime=+/-3 and positive[0] and negative[1] mprime */
76  REAL8 d32[2][7]; /**< wigner-d matrix elements for ell=3, mprime=+/-2 and positive[0] and negative[1] mprime */
77  REAL8 d44[2][9]; /**< wigner-d matrix elements for ell=4, mprime=+/-4 and positive[0] and negative[1] mprime */
78  REAL8 d43[2][9]; /**< wigner-d matrix elements for ell=4, mprime=+/-3 and positive[0] and negative[1] mprime */
80 
81 /**
82  * a strcut to keep the complex exponential terms of the alpha precession angle
83  */
84 typedef struct tagIMRPhenomPv3HMAlphaStruct
85 {
86  COMPLEX16 alpha2[5]; /**< optimised elements for complex exponential of the alpha angle for ell = 2*/
87  COMPLEX16 alpha3[7]; /**< optimised elements for complex exponential of the alpha angle for ell = 3*/
88  COMPLEX16 alpha4[9]; /**< optimised elements for complex exponential of the alpha angle for ell = 4*/
90 
91 /**
92  * a strcut to keep the spherical harmonic terms
93  */
94 typedef struct tagIMRPhenomPv3HMYlmStruct
95 {
96  COMPLEX16 Ylm2[2][5]; /**< optimised elements Ylms for ell = 2. [0] for Ylm and [1] for conj(Ylm) */
97  COMPLEX16 Ylm3[2][7]; /**< optimised elements Ylms for ell = 3. [0] for Ylm and [1] for conj(Ylm) */
98  COMPLEX16 Ylm4[2][9]; /**< optimised elements Ylms for ell = 4. [0] for Ylm and [1] for conj(Ylm) */
100 
101 int XLALSimIMRPhenomPv3HMComputeWignerdElements(IMRPhenomPv3HMWignderStruct **p, UNUSED UINT4 ell, UNUSED INT4 mprime, UNUSED REAL8 b);
102 
104 
106 
107 #ifdef __cplusplus
108 }
109 #endif
110 
111 #endif /* _LALSIM_IMR_PHENOMUTILS_H */
double XLALSimPhenomUtilsFDamp0(REAL8 Mtot_Msun, REAL8 distance)
compute the frequency domain amplitude pre-factor
double XLALSimPhenomUtilsIMRPhenomDFinalMass(REAL8 m1, REAL8 m2, REAL8 chi1z, REAL8 chi2z)
Helper function used in PhenomHM and PhenomPv3HM Returns the final mass from the fit used in PhenomD.
REAL8 XLALSimPhenomUtilsPhenomPv2FinalSpin(const REAL8 m1, const REAL8 m2, const REAL8 chi1_l, const REAL8 chi2_l, const REAL8 chip)
Wrapper for final-spin formula based on:
REAL8 XLALSimPhenomUtilsChiP(const REAL8 m1, const REAL8 m2, const REAL8 s1x, const REAL8 s1y, const REAL8 s2x, const REAL8 s2y)
Function to compute the effective precession parameter chi_p (1408.1810)
int XLALSimIMRPhenomPv3HMComputeAlphaElements(IMRPhenomPv3HMAlphaStruct **p, UINT4 ell, REAL8 alpha)
int XLALSimIMRPhenomPv3HMComputeWignerdElements(IMRPhenomPv3HMWignderStruct **p, UNUSED UINT4 ell, UNUSED INT4 mprime, UNUSED REAL8 b)
computes the wigner-d elements for -beta in batches.
double XLALSimPhenomUtilsMftoHz(REAL8 Mf, REAL8 Mtot_Msun)
Convert from geometric frequency to frequency in Hz.
double XLALSimPhenomUtilsHztoMf(REAL8 fHz, REAL8 Mtot_Msun)
Convert from frequency in Hz to geometric frequency.
REAL8 XLALSimPhenomUtilsPhenomPv3HMFinalSpin(const REAL8 m1, const REAL8 m2, const REAL8 chi1x, const REAL8 chi1y, const REAL8 chi1z, const REAL8 chi2x, const REAL8 chi2y, const REAL8 chi2z)
Wrapper for final-spin formula based on:
IMRPhenomPv3HMYlmStruct * XLALSimIMRPhenomPv3HMComputeYlmElements(REAL8 theta, REAL8 phi, INT4 ell)
int XLALSimPhenomUtilsPhenomPv3HMWignerdElement(REAL8 *wig_d, UINT4 ell, INT4 mprime, INT4 mm, REAL8 b)
Hard coded expressions for relevant Wignerd matrix elements.
double theta
Definition: bh_sphwf.c:118
double complex COMPLEX16
double REAL8
uint32_t UINT4
int32_t INT4
double alpha
Definition: sgwb.c:106
a strcut to keep the complex exponential terms of the alpha precession angle
a strcut to keep the wigner-d matrix elements
a strcut to keep the spherical harmonic terms