77#include "TRestAxionHelioscopeSignal.h"
142 if (GetDimensions() != point.size()) {
143 RESTError <<
"Point should have same dimensions as number of variables!" <<
RESTendl;
147 if (GetDimensions() != 1) {
148 RESTError <<
"Point should have only 1-dimension! Energy" <<
RESTendl;
154 Double_t probability = 0;
162 flux *=
fBores * apertureArea;
165 Double_t signal = flux * probability;
167 Double_t normFactor = 1;
169 for (
size_t n = 0; n < GetDimensions(); n++) {
173 return normFactor * signal;
185 for (Double_t en = Eo; en < Ef; en += dE) {
189 Double_t probability = 0;
196 flux *=
fBores * apertureArea;
198 signal += flux * probability;
216 RESTInfo <<
"Generating N-dim histogram for " << GetName() <<
RESTendl;
222 Int_t* bins =
new Int_t[
fNbins.size()];
223 Double_t* xlow =
new Double_t[
fNbins.size()];
224 Double_t* xhigh =
new Double_t[
fNbins.size()];
226 for (
size_t n = 0; n <
fNbins.size(); n++) {
232 THnD* hNd =
new THnD(hName, hName,
fNbins.size(), bins, xlow, xhigh);
235 std::vector<double> binWidths;
236 for (
size_t i = 0; i <
fNbins.size(); ++i) {
237 double width =
static_cast<double>(xhigh[i] - xlow[i]) / bins[i];
238 binWidths.push_back(width);
242 std::vector<int> binIndices(
fNbins.size(), 0);
247 std::vector<double> binCenter;
248 for (
size_t i = 0; i <
fNbins.size(); ++i)
249 binCenter.push_back(xlow[i] + (binIndices[i] + 0.5) * binWidths[i]);
255 for (
size_t i = 0; i <
fNbins.size(); ++i) {
257 if (binIndices[i] < bins[i]) {
296 RESTError <<
"TRestAxionHelioscopeSignal::InitFromConfigFile."
297 <<
" Signal should be build with just 1-variable. Energy." <<
RESTendl;
299 RESTError <<
"The first variable should be energy. We recommend to name that variable as \"energy\"."
301 RESTError <<
"Please, double-check the variables definition inside "
302 "TRestAxionHelioscopeSignal::TRestComponent."
321 fField->SetMagneticField(GetMagnetStrength());
322 fField->SetCoherenceLength(GetMagnetLength());
A metadata class to define the gas properties used in axion search calculations.
A basic class to define analytical axion-photon conversion calculations for axion helioscopes.
void AssignBufferGas(TRestAxionBufferGas *buffGas)
It assigns a gas buffer medium to the calculation.
Double_t GammaTransmissionProbability(Double_t Ea, Double_t ma, Double_t mg=0, Double_t absLength=0)
Performs the calculation of axion-photon conversion probability using directly equation (11) from van...
It allows to build a signal model using a given helioscope configuration and solar axion flux compone...
void PrintMetadata() override
Prints on screen the information about the metadata members of TRestAxionSolarFlux.
Double_t fOpticsEfficiency
If optics is present we may add an efficiency for Ngamma calculation.
Double_t fMagnetLength
It defines the magnet length in standard REST units (mm)
Double_t fMagnetRadius
It defines the magnet aperture radius in standard REST units (mm)
void Initialize() override
It will initialize the data frame with the filelist and column names (or observables) that have been ...
Int_t fBores
It defines the number of bores or TPCs (number of magnetic volumes)
TRestAxionField * fField
It provides access to axion-photon conversion probabilites calculations.
void InitFromConfigFile() override
It customizes the retrieval of XML data values of this class.
Double_t fWindowEfficiency
If an x-ray window is present we may add an efficiency for Ngamma calculation.
TRestAxionHelioscopeSignal()
Default constructor.
TRestAxionSolarFlux * fFlux
It defines the solar flux we use inside our magnetic field. Must be defined.
void FillHistograms() override
It will produce a histogram with the distribution using the formula contributions.
Double_t GetSignalRate(std::vector< Double_t > point, Double_t mass=0)
It returns the intensity/rate (in seconds) corresponding to the class defined helioscope configuratio...
std::string fConversionType
It defines the helioscope type (IAXO/AMELIE)
~TRestAxionHelioscopeSignal()
Default destructor.
Double_t fMagnetStrength
It defines the magnetic field strength in T.
TRestAxionBufferGas * fGas
It defines the gas mixture we use inside our magnetic field. Vacuum if it is nullptr.
A metadata class to load tabulated solar axion fluxes.
void Initialize()
It is required in order to load solar flux tables into memory.
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.
It defines a background/signal model distribution in a given parameter space (tipically x,...
void InitFromConfigFile() override
It customizes the retrieval of XML data values of this class.
void PrintMetadata() override
Prints on screen the information about the metadata members of TRestAxionSolarFlux.
Int_t fActiveNode
It is used to define the node that will be accessed for rate retrieval.
std::string fParameter
It is used to parameterize a set of distribution densities (e.g. WIMP or axion mass)
std::vector< Int_t > fNbins
The number of bins in which we should divide each variable.
void Initialize() override
It initializes the random number. We avoid to define the section name here since we will never define...
std::vector< TVector2 > fRanges
The range of each of the variables used to create the PDF distribution.
std::vector< Double_t > fParameterizationNodes
It defines the nodes of the parameterization (Initialized by the dataset)
Bool_t HasNodes()
It returns true if any nodes have been defined.
std::vector< std::string > fVariables
A list with the branches that will be used to create the distribution space.
std::vector< THnD * > fNodeDensity
The generated N-dimensional variable space density for a given node.
@ REST_Info
+show most of the information for each steps
std::string DoubleToString(Double_t d, std::string format="%8.6e")
Gets a string from a double.