58#include "TRestAxionSolarModel.h"
70 sSolarModelFile =
GetParameter(
"solarAxionModel",
"SolarModel_B16-AGSS09.dat");
71 std::string fullPathName =
SearchFile((std::string)sSolarModelFile);
72 if (fullPathName ==
"") {
73 RESTError <<
"File not found : " << sSolarModelFile <<
RESTendl;
76 sol = SolarModel(fullPathName, OP,
false);
77 sExternalLibraryName = sol.get_solaxlib_name_and_version();
78 sOpacityCodeName = sol.get_opacitycode_name();
79 fRefPhotonCoupling = sol.get_gagg_ref_value_in_inverse_GeV();
80 fRefElectronCoupling = sol.get_gaee_ref_value();
81 bSolarModelInitialized = sol.is_initialised();
82 if (bSolarModelInitialized) {
83 RESTDebug <<
"Solar model file " << sSolarModelFile <<
" successfully loaded!" <<
RESTendl;
85 RESTError <<
"Solar model initialization was not successful!" <<
RESTendl;
95TRestAxionSolarModel::TRestAxionSolarModel(
const char* cfgFileName, std::string name)
103TRestAxionSolarModel::~TRestAxionSolarModel() {}
108 RESTMetadata <<
"+++++++++++++++++++++++++++++++++++++++++++++++++" <<
RESTendl;
109 RESTMetadata <<
" Solar model created with " << sExternalLibraryName <<
"." <<
RESTendl;
110 RESTMetadata <<
" - Solar model file : " << sSolarModelFile <<
RESTendl;
111 RESTMetadata <<
" - Opacity code used : " << sOpacityCodeName <<
RESTendl;
112 RESTMetadata <<
"-------------------------------------------------" <<
RESTendl;
113 RESTMetadata <<
" - Reference value of the axion-photon coupling : " << fRefPhotonCoupling / 1.0e-10
115 RESTMetadata <<
" - Reference value of the axion-electron coupling : " << fRefElectronCoupling / 1.0e-13
117 RESTMetadata <<
" - Units of the solar axion flux from this class : axions / cm^2 s keV" <<
RESTendl;
118 RESTMetadata <<
"+++++++++++++++++++++++++++++++++++++++++++++++++" <<
RESTendl;
121std::string TRestAxionSolarModel::GetSolarModelFileName() {
return sSolarModelFile; }
123std::vector<double> TRestAxionSolarModel::GetSolarAxionFluxGAGamma(std::vector<double> energies,
125 std::vector<double> result;
126 if (bSolarModelInitialized) {
127 RESTWarning <<
"TRestAxionSolarModel::GetSolarAxionFluxGAGamma." <<
RESTendl;
128 RESTWarning <<
"This code has been commented to allow compilation and needs to be reviewed!"
130 RESTWarning <<
"The result vector will be empty!" <<
RESTendl;
133 RESTError <<
"TRestAxionSolarModel not properly initialised for "
134 "RestAxionSolarModel::GetSolarAxionFluxGAGamma(...)!"
140std::vector<double> TRestAxionSolarModel::GetSolarAxionFluxGAGamma(std::vector<double> energies,
141 double g_agamma,
double r_max) {
142 std::vector<double> result = GetSolarAxionFluxGAGamma(energies);
143 for (
auto flux = result.begin(); flux != result.end(); flux++) {
144 *flux *= pow(g_agamma / fRefPhotonCoupling, 2);
149std::vector<double> TRestAxionSolarModel::GetSolarAxionFluxGAE(std::vector<double> energies,
double r_max) {
150 std::vector<double> result;
151 if (bSolarModelInitialized) {
152 RESTWarning <<
"TRestAxionSolarModel::GetSolarAxionFluxGAE." <<
RESTendl;
153 RESTWarning <<
"This code has been commented to allow compilation and needs to be reviewed!"
155 RESTWarning <<
"The result vector will be empty!" <<
RESTendl;
158 RESTError <<
"TRestAxionSolarModel not properly initialised for "
159 "RestAxionSolarModel::GetSolarAxionFluxGAE(...)!"
165std::vector<double> TRestAxionSolarModel::GetSolarAxionFluxGAE(std::vector<double> energies,
double g_agae,
167 std::vector<double> result = GetSolarAxionFluxGAE(energies, r_max);
168 for (
auto flux = result.begin(); flux != result.end(); flux++) {
169 *flux *= pow(g_agae / fRefElectronCoupling, 2);
A metadata class to define theoretical axion models and calculations related.
void Initialize()
Making default settings.
void PrintMetadata()
Implemented it in the derived metadata class to print out specific metadata information.
void InitFromConfigFile()
To make settings from rml file. This method must be implemented in the derived class.