REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Public Member Functions | Private Member Functions | Private Attributes
TRestAxionGeneratorProcess Class Reference

Detailed Description

A process to initialize the axion event (mainly through TRestAxionSolarFlux)

This generator will produce solar axion events with the Sun at position (0,0,-AU) and detector at position (0,0,0).

The axion generation properties, such as coupling type and intensity, are defined by TRestAxionSolarFlux. That class defines the method TRestAxionSolarFlux::GetRandomEnergyAndRadius that is exploited by this process to define initial conditions for each axion, such as angular direction or energy. The flux intensity and its dependency with the solar radius and spectral energy will be fully coded inside TRestAxionSolarFlux, while this method will be able to play with the Sun-generator position, and the size of the target detector (which is placed at (0,0,0)) to define an initial axion position, direction and energy.

The following metadata members can be tuned in this process:


RESTsoft - Software for Rare Event Searches with TPCs

History of developments:

2022-February: New generator implementation using TRestAxionSolarFlux Javier Galan

Author
Javier Galan

Definition at line 32 of file TRestAxionGeneratorProcess.h.

#include <TRestAxionGeneratorProcess.h>

Inheritance diagram for TRestAxionGeneratorProcess:
TRestEventProcess TRestMetadata

Public Member Functions

 ClassDefOverride (TRestAxionGeneratorProcess, 4)
 
RESTValue GetInputEvent () const override
 Get pointer to input event. Must be implemented in the derived class. More...
 
RESTValue GetOutputEvent () const override
 Get pointer to output event. Must be implemented in the derived class. More...
 
const char * GetProcessName () const override
 Returns the name of this process. More...
 
void InitProcess () override
 Process initialization. Data members that require initialization just before start processing should be initialized here. More...
 
void PrintMetadata () override
 Prints out relevant metadata members. More...
 
TRestEventProcessEvent (TRestEvent *eventInput) override
 The main processing event function. More...
 
 TRestAxionGeneratorProcess ()
 Default constructor. More...
 
 ~TRestAxionGeneratorProcess ()
 Default destructor. More...
 
- Public Member Functions inherited from TRestEventProcess
virtual Bool_t AddInputFile (const std::string &file)
 
bool ApplyCut ()
 
virtual void BeginOfEventProcess (TRestEvent *inputEvent=nullptr)
 Begin of event process, preparation work. Called right before ProcessEvent() More...
 
 ClassDefOverride (TRestEventProcess, 3)
 
virtual void EndOfEventProcess (TRestEvent *inputEvent=nullptr)
 End of event process. Nothing to do. Called directly after ProcessEvent() More...
 
virtual void EndProcess ()
 To be executed at the end of the run (outside event loop) More...
 
TRestAnalysisTreeGetAnalysisTree () const
 Return the local analysis tree (dummy) More...
 
TCanvas * GetCanvas () const
 Get canvas. More...
 
TRestAnalysisTreeGetFullAnalysisTree ()
 
virtual RESTValue GetInputEvent () const =0
 Get pointer to input event. Must be implemented in the derived class. More...
 
std::vector< std::string > GetListOfAddedObservables ()
 
virtual RESTValue GetOutputEvent () const =0
 Get pointer to output event. Must be implemented in the derived class. More...
 
virtual const char * GetProcessName () const =0
 
TRestRunGetRunInfo () const
 Return the pointer of the hosting TRestRun object. More...
 
virtual Long64_t GetTotalBytes () const
 
virtual Long64_t GetTotalBytesRead () const
 Interface to external file reading, get the read bytes. To be implemented in external processes. More...
 
virtual void InitFromConfigFile () override
 To make settings from rml file. This method must be implemented in the derived class. More...
 
virtual void InitProcess ()
 To be executed at the beginning of the run (outside event loop) More...
 
Bool_t isExternal () const
 Return whether this process is external process. More...
 
Int_t LoadSectionMetadata () override
 This method does some preparation of xml section. More...
 
virtual void NotifyAnalysisTreeReset ()
 In case the analysis tree is reset(switched to new file), some process needs to have action. More...
 
virtual Bool_t OpenInputFiles (const std::vector< std::string > &files)
 
virtual TRestEventProcessEvent (TRestEvent *inputEvent)=0
 Process one event. More...
 
std::vector< std::string > ReadObservables ()
 
void RegisterAllObservables (Bool_t value=true)
 
virtual Bool_t ResetEntry ()
 
void SetAnalysisTree (TRestAnalysisTree *tree)
 Set analysis tree of this process, then add observables to it.
 
void SetCanvasSize (Int_t x, Int_t y)
 Set canvas size. More...
 
void SetFriendProcess (TRestEventProcess *p)
 Add friendly process to this process.
 
void SetObservableValidation (bool validate)
 
void SetParallelProcess (TRestEventProcess *p)
 Add parallel process to this process.
 
void SetRunInfo (TRestRun *r)
 Set TRestRun for this process. More...
 
Bool_t singleThreadOnly () const
 Return whether this process is single std::thread only. More...
 
 TRestEventProcess ()
 
 ~TRestEventProcess ()
 

Private Member Functions

void Initialize () override
 Function to initialize input/output event members and define the section name. More...
 
void LoadDefaultConfig ()
 

Private Attributes

TRestAxionSolarFluxfAxionFlux
 A pointer to the TRestAxionSolarFlux metadata description. More...
 
TVector2 fAxionMassRange = TVector2(1.e-6, 1e-2)
 The axion mass range in keV. More...
 
Int_t fCounter = 0
 Used internally to define the event id. More...
 
TVector2 fEnergyRange = TVector2(0.05, 10)
 It defines the energy range for the axion event generator. Default between 50eV and 10keV. More...
 
TString fGeneratorType = "solarFlux"
 The generator type (solarFlux/flat) More...
 
TRestAxionEventfOutputAxionEvent
 A pointer to the specific TRestAxionEvent output. More...
 
TRandom3 * fRandom = nullptr
 Internal process random generator. More...
 
Int_t fSeed = 0
 Seed used in random generator. More...
 
TVector3 fTargetPosition = TVector3(0, 0, 0)
 The target position in mm with regards to the sun at (0,0,-AU). More...
 
Double_t fTargetRadius = 800
 The target size in mm (or generator source extension) for the generator. More...
 
Double_t fTotalFlux = 0
 Absolute solar flux (cm-2 s-1). Required for future calculations. More...
 

Additional Inherited Members

- Protected Types inherited from TRestEventProcess
enum  REST_Process_Output { No_Output , Observable , Internal_Var , Full_Output }
 
- Protected Member Functions inherited from TRestEventProcess
void BeginPrintProcess ()
 [name, cut range]
 
void CreateCanvas ()
 Create the canvas. More...
 
void EndPrintProcess ()
 
TRestEventProcessGetFriend (const std::string &nameOrType)
 
TRestEventProcessGetFriendLive (const std::string &nameOrType)
 
template<class T >
T * GetMetadata ()
 Get a metadata object from the host TRestRun. More...
 
TRestMetadataGetMetadata (const std::string &nameOrType)
 
size_t GetNumberOfParallelProcesses () const
 
template<class T >
GetObservableValue (const std::string &name)
 
TRestEventProcessGetParallel (int i)
 
template<class T >
std::vector< T > GetParallelDataMembers (T *member_of_process)
 Get a list of data members from parallel processes which is same to this process's certain data member. More...
 
template<class T >
void SetObservableValue (const std::string &name, const T &value)
 Set observable value for AnalysisTree. More...
 
- Protected Attributes inherited from TRestEventProcess
TRestAnalysisTreefAnalysisTree = nullptr
 
TCanvas * fCanvas = nullptr
 < Canvas for some viewer event More...
 
TVector2 fCanvasSize
 Canvas size. More...
 
std::vector< std::pair< std::string, TVector2 > > fCuts
 Stores cut definitions. Any listed observables should be in the range. More...
 
bool fDynamicObs = false
 It defines whether to use added observables only or all the observables appear in the code. More...
 
bool fIsExternal = false
 It defines if the process reads event data from an external source. More...
 
std::map< std::string, int > fObservablesDefined
 Stores the list of all the appeared process observables in the code. More...
 
std::map< std::string, int > fObservablesUpdated
 Stores the list of process observables updated when processing this event. More...
 
bool fReadOnly = false
 not used, keep for compatibility More...
 
TRestRunfRunInfo = nullptr
 < Pointer to TRestRun object where to find metadata. More...
 
bool fSingleThreadOnly = false
 
bool fValidateObservables = false
 It defines if observable names should be added to the validation list. More...
 

Constructor & Destructor Documentation

◆ TRestAxionGeneratorProcess()

TRestAxionGeneratorProcess::TRestAxionGeneratorProcess ( )

Default constructor.

Definition at line 74 of file TRestAxionGeneratorProcess.cxx.

◆ ~TRestAxionGeneratorProcess()

TRestAxionGeneratorProcess::~TRestAxionGeneratorProcess ( )

Default destructor.

Definition at line 79 of file TRestAxionGeneratorProcess.cxx.

Member Function Documentation

◆ GetInputEvent()

RESTValue TRestAxionGeneratorProcess::GetInputEvent ( ) const
inlineoverridevirtual

Get pointer to input event. Must be implemented in the derived class.

Implements TRestEventProcess.

Definition at line 72 of file TRestAxionGeneratorProcess.h.

◆ GetOutputEvent()

RESTValue TRestAxionGeneratorProcess::GetOutputEvent ( ) const
inlineoverridevirtual

Get pointer to output event. Must be implemented in the derived class.

Implements TRestEventProcess.

Definition at line 73 of file TRestAxionGeneratorProcess.h.

◆ GetProcessName()

const char * TRestAxionGeneratorProcess::GetProcessName ( ) const
inlineoverridevirtual

Returns the name of this process.

Implements TRestEventProcess.

Definition at line 81 of file TRestAxionGeneratorProcess.h.

◆ Initialize()

void TRestAxionGeneratorProcess::Initialize ( )
overrideprivatevirtual

Function to initialize input/output event members and define the section name.

Reimplemented from TRestMetadata.

Definition at line 84 of file TRestAxionGeneratorProcess.cxx.

◆ InitProcess()

void TRestAxionGeneratorProcess::InitProcess ( )
overridevirtual

Process initialization. Data members that require initialization just before start processing should be initialized here.

Reimplemented from TRestEventProcess.

Definition at line 98 of file TRestAxionGeneratorProcess.cxx.

◆ PrintMetadata()

void TRestAxionGeneratorProcess::PrintMetadata ( )
overridevirtual

Prints out relevant metadata members.

Reimplemented from TRestMetadata.

Definition at line 202 of file TRestAxionGeneratorProcess.cxx.

◆ ProcessEvent()

TRestEvent * TRestAxionGeneratorProcess::ProcessEvent ( TRestEvent eventInput)
overridevirtual

The main processing event function.

The axion position must be displaced by the target size. We always do this. It is independent of generator The target is virtually placed at the (0,0,0) + TargetPosition since the experiment is not focussed by the bore but by the whole experiment. In my opinion the target should be either the optics, or the magnet end bore. Then one should place the optics or the magnet end bore at the (0,0,0) + TargetPosition. TODO: The target position and the magnetic field have to be in the same spot in x- and y-direction apparently.

Implements TRestEventProcess.

Definition at line 125 of file TRestAxionGeneratorProcess.cxx.

Field Documentation

◆ fAxionFlux

TRestAxionSolarFlux* TRestAxionGeneratorProcess::fAxionFlux
private

A pointer to the TRestAxionSolarFlux metadata description.

Definition at line 38 of file TRestAxionGeneratorProcess.h.

◆ fAxionMassRange

TVector2 TRestAxionGeneratorProcess::fAxionMassRange = TVector2(1.e-6, 1e-2)
private

The axion mass range in keV.

Definition at line 47 of file TRestAxionGeneratorProcess.h.

◆ fCounter

Int_t TRestAxionGeneratorProcess::fCounter = 0
private

Used internally to define the event id.

Definition at line 41 of file TRestAxionGeneratorProcess.h.

◆ fEnergyRange

TVector2 TRestAxionGeneratorProcess::fEnergyRange = TVector2(0.05, 10)
private

It defines the energy range for the axion event generator. Default between 50eV and 10keV.

Definition at line 62 of file TRestAxionGeneratorProcess.h.

◆ fGeneratorType

TString TRestAxionGeneratorProcess::fGeneratorType = "solarFlux"
private

The generator type (solarFlux/flat)

Definition at line 56 of file TRestAxionGeneratorProcess.h.

◆ fOutputAxionEvent

TRestAxionEvent* TRestAxionGeneratorProcess::fOutputAxionEvent
private

A pointer to the specific TRestAxionEvent output.

Definition at line 35 of file TRestAxionGeneratorProcess.h.

◆ fRandom

TRandom3* TRestAxionGeneratorProcess::fRandom = nullptr
private

Internal process random generator.

Definition at line 44 of file TRestAxionGeneratorProcess.h.

◆ fSeed

Int_t TRestAxionGeneratorProcess::fSeed = 0
private

Seed used in random generator.

Definition at line 59 of file TRestAxionGeneratorProcess.h.

◆ fTargetPosition

TVector3 TRestAxionGeneratorProcess::fTargetPosition = TVector3(0, 0, 0)
private

The target position in mm with regards to the sun at (0,0,-AU).

Definition at line 53 of file TRestAxionGeneratorProcess.h.

◆ fTargetRadius

Double_t TRestAxionGeneratorProcess::fTargetRadius = 800
private

The target size in mm (or generator source extension) for the generator.

Definition at line 50 of file TRestAxionGeneratorProcess.h.

◆ fTotalFlux

Double_t TRestAxionGeneratorProcess::fTotalFlux = 0
private

Absolute solar flux (cm-2 s-1). Required for future calculations.

Definition at line 65 of file TRestAxionGeneratorProcess.h.


The documentation for this class was generated from the following files: