I was trying to modify the DarkMatterIntegrator to include the absorption of gamma rays as well. So, in the DarkMatterIntegrator.cpp (located in /src/integrators), I pasted the following from the PiZeroAbsorptionIntegrator.cpp
QInverseLength DarkMatterIntegrator::absorptionCoefficient(const QEnergy &Egamma_) const {
auto integrand = [this, Egamma_](double eps) {
return static_cast(cmbPhotonField(QEnergy(eps)) *
bwCrossSec->integratedOverTheta(Egamma_, QEnergy(eps)));
};
QEnergy epsMin = 1e-5_eV;
QEnergy epsMax = 5e-3_eV;
double abs_error = 0.0; // disabled
double rel_error = 1.0e-4;
int key = GSL_INTEG_GAUSS51; // GSL_INTEG_GAUSS15;
double result = 0;
double error = 0;
gsl_function_pp<decltype(integrand)> Fp(integrand);
gsl_function *F = static_cast<gsl_function *>(&Fp);
gsl_integration_workspace *w = gsl_integration_workspace_alloc(GSL_LIMIT);
gsl_integration_qag(F, static_cast<double>(epsMin), static_cast<double>(epsMax), abs_error, rel_error, GSL_LIMIT,
key, w, &result, &error);
gsl_integration_workspace_free(w);
return QInverseLength(result);
After pasting, I ran a python code with DarkMatterIntegrator to evaluate flux as a function of gamma -ray energy. The code ran without any errors. But I think I haven't re-compiled properly. To re-compile, should I run make -j in the hermes main directory? Can anyone tell me if what I have done is correct to include absorption for the DM annihilation to gamma-ray process? Also, it looks like what I have done only considers absorption from only the ambient CMB field and not the entire ISRF model (which includes even IR emmisions from dust, the star light as described by Vernetto and Lipari's model).
Any help in this regard would be really useful.