66#include "TRestAxionGeneratorProcess.h"
99 RESTDebug <<
"Entering ... TRestAxionGeneratorProcess::InitProcess" <<
RESTendl;
101 fAxionFlux = GetMetadata<TRestAxionSolarFlux>();
104 if (!this->
GetError()) this->
SetError(
"The solar flux definition was not found.");
126 RESTDebug <<
"TRestAxionGeneratorProcess::ProcessEvent : " <<
fCounter <<
RESTendl;
131 TVector3 axionDirection = TVector3(0, 0, 1);
138 x = 2 * (
fRandom->Rndm() - 0.5);
139 y = 2 * (
fRandom->Rndm() - 0.5);
141 }
while (r > 1 || r == 0);
145 std::pair<Double_t, Double_t> p;
149 Double_t radius = p.second;
151 axionPosition = TVector3(REST_Physics::solarRadius * radius * x / r,
154 axionDirection = -axionPosition.Unit();
163 RESTWarning <<
"Not a valid energy range was defined!" <<
RESTendl;
177 x = 2 * (
fRandom->Rndm() - 0.5);
178 y = 2 * (
fRandom->Rndm() - 0.5);
180 }
while (r > 1 || r == 0);
209 RESTMetadata <<
"Random seed: " << (UInt_t)
fSeed <<
RESTendl;
213 RESTMetadata <<
"+++++++++++++++++++++++++++++++++++++++++++++++++" <<
RESTendl;
An event data class to define the parameters related to an axion particle.
A process to initialize the axion event (mainly through TRestAxionSolarFlux)
TVector3 fTargetPosition
The target position in mm with regards to the sun at (0,0,-AU).
TRestAxionGeneratorProcess()
Default constructor.
TRandom3 * fRandom
Internal process random generator.
Double_t fTotalFlux
Absolute solar flux (cm-2 s-1). Required for future calculations.
TVector2 fAxionMassRange
The axion mass range in keV.
void PrintMetadata() override
Prints out relevant metadata members.
void Initialize() override
Function to initialize input/output event members and define the section name.
Int_t fSeed
Seed used in random generator.
Double_t fTargetRadius
The target size in mm (or generator source extension) for the generator.
void InitProcess() override
Process initialization. Data members that require initialization just before start processing should ...
TVector2 fEnergyRange
It defines the energy range for the axion event generator. Default between 50eV and 10keV.
TRestAxionEvent * fOutputAxionEvent
A pointer to the specific TRestAxionEvent output.
Int_t fCounter
Used internally to define the event id.
TString fGeneratorType
The generator type (solarFlux/flat)
TRestAxionSolarFlux * fAxionFlux
A pointer to the TRestAxionSolarFlux metadata description.
TRestEvent * ProcessEvent(TRestEvent *eventInput) override
The main processing event function.
~TRestAxionGeneratorProcess()
Default destructor.
void Initialize()
It is required in order to load solar flux tables into memory.
virtual std::pair< Double_t, Double_t > GetRandomEnergyAndRadius(TVector2 eRange=TVector2(-1, -1), Double_t mass=0)=0
It defines how to generate Monte Carlo energy and radius values to reproduce the flux.
virtual Double_t IntegrateFluxInRange(TVector2 eRange=TVector2(-1, -1), Double_t mass=0)=0
It returns the integrated flux at earth in cm-2 s-1 for the given energy range.
bool fIsExternal
It defines if the process reads event data from an external source.
A base class for any REST event.
@ REST_Debug
+show the defined debug messages
constexpr double AU
Average Sun-Earth distance in m.