85#include "TRestAxionSolarFlux.h"
110 RESTDebug <<
"Entering TRestAxionSolarFlux constructor( cfgFileName, name )" <<
RESTendl;
111 RESTDebug <<
"File: " << cfgFileName <<
" Name: " << name <<
RESTendl;
148 std::vector<std::vector<Double_t>> fluxData;
152 new TH2F(Form(
"FluxTable_%s", GetName()),
"", 100, 0., 1., (Int_t)(20. / binSize), 0., 20.);
154 for (
const auto& data : fluxData) {
155 Double_t r = 0.005 + data[0];
156 Double_t en = data[1] - 0.005;
157 Double_t flux = data[2] * binSize;
159 originalHist->Fill(r, en, flux);
162 return (TH1F*)originalHist->ProjectionY();
174 fCanvas =
new TCanvas(
"canv",
"This is the canvas title", 1400, 1200);
177 TPad* pad1 =
new TPad(
"pad1",
"This is pad1", 0.01, 0.02, 0.99, 0.97);
193 return h->GetBinContent(h->FindBin(energy));
204 fCanvas =
new TCanvas(
"canv",
"This is the canvas title", 1200, 500);
207 TPad* pad1 =
new TPad(
"pad1",
"This is pad1", 0.01, 0.02, 0.99, 0.97);
212 pad1->SetRightMargin(0.09);
213 pad1->SetLeftMargin(0.15);
214 pad1->SetBottomMargin(0.15);
217 ht->SetLineColor(kBlack);
218 ht->SetFillStyle(4050);
219 ht->SetFillColor(kBlue - 10);
234 RESTMetadata <<
"--------" <<
RESTendl;
236 RESTMetadata <<
"--------" <<
RESTendl;
A metadata class to load tabulated solar axion fluxes.
void Initialize()
It is required in order to load solar flux tables into memory.
TRestAxionSolarFlux()
Default constructor.
Double_t GetFluxAtEnergy(Double_t energy, Double_t m=0)
It returns a flux in cm-2 s-1 keV-1 at the energy given by argument.
TCanvas * fCanvas
A canvas pointer for drawing.
~TRestAxionSolarFlux()
Default destructor.
virtual Bool_t LoadTables()=0
It defines how to read the solar tables at the inhereted class.
Double_t fCouplingStrength
Axion coupling strength.
TCanvas * DrawFluxFile(std::string fname, Double_t binSize=0.01)
It draws the contents of a .flux file. This method just receives the name of the ....
TH1F * GetFluxHistogram(std::string fname, Double_t binSize=0.01)
It builds a histogram using the contents of the .flux file given in the argument.
std::string fCouplingType
Axion coupling. Defines coupling type and strength.
Int_t fSeed
Seed used in random generator.
TRandom3 * fRandom
Random number generator.
void PrintMetadata()
Prints on screen the information about the metadata members of TRestAxionSolarFlux.
virtual TH1F * GetEnergySpectrum(Double_t m=0)=0
It returns an energy integrated spectrum in cm-2 s-1 keV-1.
Bool_t fTablesLoaded
A metadata member to control if this class has been initialized.
virtual TCanvas * DrawSolarFlux()
It draws the contents of a .flux file. This method just receives the.