REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Public Member Functions | Data Fields | Private Member Functions | Private Attributes | Friends
TRestGeant4Metadata Class Reference

Detailed Description

The main class to store the Geant4 simulation conditions that will be used by restG4.

TRestGeant4Metadata is the main class used to interface with restG4 (a REST based Geant4 code distributed with REST) used to launch Geant4 based simulations, and store later on the simulation conditions as metadata information inside the output generated file. The simulations produced by restG4 will write to disk the event data generated as a TRestGeant4Event type. The tutorials page includes a tutorial describing on detail how to launch a restG4 simulation and retrieve basic simulation results.

There are few helper classes that aid to organize and access the information that TRestGeant4Metadata contains, TRestGeant4Particle, TRestGeant4BiasingVolume, TRestGeant4ParticleSource.

After installation of restG4, some basic working examples can be found at $REST_PATH/examples/. We use this class to store restG4 rml parameters like particle type, energy, direction, gdml definition, etc. In addition, we have a class TRestGeant4PhysicsLists in parallel to define the necessary physics processes, EM, hadronic, etc, that will be active in our Geant4 simulation.

In general terms, an RML file to be used with restG4 must define the following sections, and structures.

// We must, as usual, define the location where the REST output files will
// be stored
<globals>
<parameter name="mainDataPath" value="${REST_DATAPATH}" />
<searchPath value="/path/to/geometry" />
</globals>
// A TRestRun section to define few run parameters with a general run
// description.
...
//A TRestGeant4Metadata section defining few parameters, generator, and detector.
...
//A TRestGeant4PhysicsLists section def-inning the physics processes active.
...
The main class to store the Geant4 simulation conditions that will be used by restG4.
Data provider and manager in REST.
Definition: TRestRun.h:18
Note
Wherever 3 dots (...) are provided means a redundant code format, or that additional fields might be required.
The runTag inside the TRestRun class will be overwritten by the name of TRestGeant4Metadata section defined in the RML.

This page describes in detail the different parameters, particle generator types, detector, and other features implemented in restG4, that can be defined inside the section TRestGeant4Metadata. The description of other required sections, as TRestRun or TRestGeant4PhysicsLists, will be found in their respective class documentation.

We can sub-divide the information provided through TRestGeant4Metadata in different parts,

  1. the main parameters related to the simulation conditions, such as number of events to be simulated, random seed, or GDML geometry definitions file,
  2. the definition of the primary particle generator, using the <generator> section, to define which particles will be generated, from where they will be generated, and which energies and direction distributions they will follow,
  3. the definition of what event hits will be written to disk, using the <detector> section,
  4. and the (optional) definition of biasing volumes to simulate particle transmission through extended detector shieldings, using the <biasing> section.

1. Basic simulation parameters

The following list presents the common parameters that must be defined inside TRestGeant4Metadata section to define few simulation conditions in restG4, as important as the detector geometry, or the number of events to be simulated.

Warning
The only requirement is that the gas logical volume (implemented in a single physical volume on the geometry) must be named gasVolume.

The following example illustrates the definition of the common simulation parameters.

<parameter name="nEvents" value="100" />
<parameter name="gdmlFile" value="/path/to/mySetupTemplate.gdml"/>
<parameter name="maxTargetStepSize" value="200" units="um" />
<parameter name="subEventTimeDelay" value="100" units="us" />

2. The primary particle generator section

The generator section describes from where we will launch our primary particles, which particles we will launch, the energy of these particles, their angular distribution and other required functions needed to cover different physics cases.

The complete structure of the primary particle generator follows this scheme.

<generator type="generatorType" ... >
<source use="geant4" particle="particleName" ... >
<angular type="angularDistribution" />
<energy type="energyDistribution" energy="energyValues" units="MeV" />
</source>
<source particle="particleName" ... >
...
</source>
// Add any number of sources.
</generator>

The generator type definition

The different generator types determine the spatial origin of the primaries that will be generated.

We can define any number of primary particles (sources) that will be used to construct an initial event. All primary particles that build an event will have a common position(*). The spatial origin of these sources, or primaries, is specified in the definition of the generator. We have 4 major types of generator, namely:

Together with the generator type, we need to define the shape, size and position. Both size and position are in TVector3 form. The following shapes are supported:

Rotation of the virtual body defined previously is also supported. We need to define parameter "rotationAxis" and "rotationAngle" to do this job. The TVector3 parameter "rotationAxis" is a virtual axis passing through the center of the virtual body, with its three elements representing its direction. "rotationAngle" defines the rotation angle in the view of the axis direction. It is in radian unit.

// We launch particles from random positions on a virtual wall leaned to 45 deg
<generator type="surface" shape="wall" size="(10,10,0)" position="(0,0,0)"
rotationAxis="(1,0,0)" rotationAngle="0.78539816" > ... </generator>

By default all the primaries will be launched homogeneously from the volume or the surface. We can define additional density function to customize the particle origin distribution. The function is a TF3 function with x, y, z the absolute position(position of gdml frame instead of generator frame) of the particle in unit mm. The returned value should be in range 0-1, indicating the relative probability in this position. For example, we simulate some radio isotopes placed on a chip with doping which follows exponential density distribution near the surface:

<generator type="volume" shape="box" size="(10,10,1)mm" position="(0,0,0.5)"
densityFunc="exp(-z/0.01)" > ... </generator>

The source definition

Three type of source definitions can be used to generate primary particles in our simulation. The different types are introduced through the parameter use.

For the third case, which is the default if use field is not defined, we can define any pre-defined particle name existing in Geant4 in the particle field, as leptons or ions. Additionally, we can define any radioactive isotope by using the element name symbol and the number of nucleons (i.e. Rn222, Co60, U238 ). For the radioactive decays we can also define an additional field fullchain="on/off". This parameter specifies if we want to simulate the full radiative chain or a single decay to the next de-excited isotope.

In summary we can use the following options inside the source definition:

Note
For ions, we can also define its electric charge (signed integer) and excited level value in eV, by using the additional fields excitedLevel and charge.

The source energy distribution

A source, or particle, associated kinetic energy is defined by using.

<energy type="energyDistType" ... />

There are different energy distribution types we can use to define the energy of the primary particles. Depending on the type of energy distribution we will be required to add additional parameters. The types we can use in REST are the following types.

The source angular distribution

The momentum direction of a particle is specified by using.

<angular type="angularDistType" ... />

We can use different types of angular distributions to define the initial direction of the particle. We can choose between the following types inside REST.

3. The detector section definition

The information we store in the ROOT file can be defined using the detector section. The detector section is defined as follows

<detector>
<parameter name="energyRange" value="(0,5)" units="MeV" />
<volume name="gas" sensitive="true" chance="1" />
<volume name="shielding" chance="1" />
// Add as many active volumes as needed
</detector>

The detector section defines the sensitive volumes, and the active volumes where data will be stored.

The sensitive, or active, volumes can be any physical volume defined on the GDML geometry. If an event did not produce an energy deposit in the sensitiveVolume, the event will not be stored at all. Therefore, the sensitive volume will serve as a trigger volume to decide when an event should be stored. For the moment we can only define a single sensitive volume, but it might be desirable to introduce boolean operations with different geometry volumes.

We can define the energy range we are interested in by defining the parameter energyRange. The event will be written to disk only if the total energy deposited in all the active volumes of the detector is in the Ei-Ef range.

<parameter name="energyRange" value="(Ei,Ef)" />

This energy range implies that only events that produced an energy deposit at the sensitive volume, and produced a total energy deposit between Ei and Ef, integrated to all the active volumes, will be stored.

We should define inside the <detector> definition all the physical volumes where we want hits to be stored using <volume> definition.

<volume name="gas" chance="1" maxTargetStepSize="1mm"/>

Each active volume defines a chance parameter. This parameter gives the probability to store the hits of an event in a particular volume. For example,

<volume name="gas" chance="1" />
<volume name="vessel" chance="0.1" />

will store all the hits produced in the gas, and 10% of the events will include information of the hits in the vessel. This may be used as a control volume to allow further study of events depositing energy in the vessel, but saving some space in disk in case we do not need to use all the event population.

Note
If we do not specify any volume, then all volumes found in the GDML geometry will be marked as active volumes. If the chance parameter is not given, the chance will be 1 by default.

On top of that, each volume may define a user limit on the maximum step size of particles in that particular volume specifying the maxStepSize parameter.

<volume name="gas" chance="1" maxStepSize="2mm" />
<volume name="vessel" chance="0.1" maxStepSize="1cm" />

Smaller values will provide a higher amount of detail, but it will require additional computational time and storage.

Note
If maxStepSize is not defined, the default value will be 0, and user limits will not be applied for that particular active volume.

We are still allowed to define a default step size for all the active volumes, using:

<volume sensitiveVolume="gas" maxStepSize="1mm" />

The option removeUnwantedTracks can optionally be enabled inside detector section:

<detector><removeUnwantedTracks enabled="true" keepZeroEnergyTracks="true"></detector>

This option will remove all tracks that do not deposit energy in any of the sensitive volumes or in any of the volumes marked as 'keepTracks' (for instance <volume name="veto" keepTracks="true" >).

By default tracks are removed if they do not deposit energy in these volumes but the parameter 'keepZeroEnergyTracks' can be set to true so that all processes are registered, for example a neutron capture taking place in one of the volumes which does not result in energy deposition.

The kill="true" option can be used in the volume definition (<volume name="shield" kill="true" >) to stop a track after entering the volume. The track will be immediately killed and its energy deposition won't be computed. This is useful to speed up certain kinds of simulations.

4. The biasing volumes section (optional)

The REST Geant4 toolkit (restG4) implements a particular biasing technique to simulate external radiation contributions in extensive shieldings. The technique consists in spatially placing biasing volumes between the initial particle generator and the detector (or sensitive volume).

The largest biasing volume must be fully contained inside the original event generator. And the smaller biasing volume should fully contain all the volumes where hits will be stored. The different biasing volumes must be fully contained one in each other (in other words, the biasing volumes should not overlap).

In practice, restG4 will run a total of N+1 Geant4 simulations, being N the number of biasing volumes defined. The first simulation will just count the number of particles of the specified type traversing the biasing volume, registering also their energy and angular distribution. In the second simulation, the number of particles that traversed the biasing volume will be multiplied by a factor, that is defined independently at each biasing volume, using the recorded energy spectrum from the previous simulation. This will continue until the last smaller biasing volume is reached. Only in the last simulation, when events are launched from the smaller biasing volume, hits will be stored.

This biasing technique has been already tested using a virtualBox generator and virtualBox biasing volumes, leading to compatible results if compared to non biased simulations. When using this technique it is recommended that you first do a small scale version of your simulation to compare biased and non-biased results. If both results (from biased and non-biased) agree then you will be more confident you will not obtain misleading results.

In order to obtain the best results using this technique you should try to keep the same number of events reaching each biasing volume. First, some optimization is required. You will need to empirically test the number of events reaching each biasing volume, and adjust the factors according to these results. In order to have reasonable good results you should assure to have at least 10,000 events reaching each of the biasing volumes. If some energies are very unlikely, and not enough statistics exist at the biasing volume the error will be much higher. This should be solved in a future implementation by using weighting factors.

The biasing technique needs to be activated using the following scheme

<biasing value="on" type="virtualBox,virtualSphere" >
<biasingVolume particle="particleName" size="L" position="(X,Y,Z)"
factor="F" energyRange="(Ei,Ef)" />
// Add as many biasing volumes as desired
</biasing>
Note
The biasing is optional, and only required in exceptional circumstances, most of the times will be disabled by using value="off".

We can use two spatial generators to define the biasing volumes (virtualBox and virtualSphere). It is recommended to use the same type as the original generator. But it is left to the user to make his choice.

Warning
The volumes should be placed in increasing order. From smaller to larger volume.

A biasing volume is defined as follows

<biasingVolume particle="particleName" size="L" position="(X,Y,Z)"
factor="F" energyRange="(Ei,Ef)" />

The particle name may be any particle name defined in Geant4. The biasing particle we define is the only particle that will be transferred to the next biasing volume. Therefore, this biasing method is used to study the transmission of a given particle gamma, neutron, etc through a shielding). The size defines the side of the virtualBox or the radius of the virtualSphere, its position X, Y, Z and a factor F that is the multiplication factor to be used in the next run (In other words, the number of particles launched from a biasing volume will be the number of particles that reached the volume times F). Only the particles in the specified energyRange (Ei,Ef) will be considered in the transmission to the next biasing volume.


RESTsoft - Software for Rare Event Searches with TPCs

History of developments:

2015-July: First concept and implementation of TRestG4 classes.

Author
Javier Galan

Definition at line 47 of file TRestGeant4Metadata.h.

#include <TRestGeant4Metadata.h>

Inheritance diagram for TRestGeant4Metadata:
TRestMetadata

Public Member Functions

void AddParticleSource (TRestGeant4ParticleSource *src)
 Adds a new particle source.
 
 ClassDefOverride (TRestGeant4Metadata, 15)
 
Int_t GetActiveVolumeID (const TString &name)
 Returns the id of an active volume giving as parameter its name.
 
TString GetActiveVolumeName (Int_t n) const
 Returns a std::string with the name of the active volume with index n.
 
std::vector< TString > GetActiveVolumes () const
 
TRestGeant4BiasingVolume GetBiasingVolume (int n)
 Return the biasing volume with index n.
 
Double_t GetCosmicFluxInCountsPerCm2PerSecond () const
 Reads the biasing section defined inside TRestGeant4Metadata. More...
 
Double_t GetCosmicIntensityInCountsPerSecond () const
 
Double_t GetEquivalentSimulatedTime () const
 
TString GetGdmlFilename () const
 Returns the main filename of the GDML geometry.
 
TString GetGdmlReference () const
 Returns the reference provided at the GDML file header.
 
const TRestGeant4GeometryInfoGetGeant4GeometryInfo () const
 Returns an immutable reference to the geometry info.
 
const TRestGeant4PhysicsInfoGetGeant4PhysicsInfo () const
 Returns an immutable reference to the physics info.
 
const TRestGeant4PrimaryGeneratorInfoGetGeant4PrimaryGeneratorInfo () const
 Returns an immutable reference to the primary generator info.
 
TString GetGeant4Version () const
 Returns a std::string with the version of Geant4 used on the event data simulation.
 
size_t GetGeant4VersionMajor () const
 
TString GetGeometryPath () const
 Returns the local path to the GDML geometry.
 
std::vector< std::string > GetKillVolumes () const
 
TVector3 GetMagneticField () const
 Returns the world magnetic field in Tesla.
 
TString GetMaterialsReference () const
 Returns the reference provided at the materials file header.
 
Double_t GetMaximumEnergyStored () const
 Returns the maximum event energy required for an event to be stored.
 
Double_t GetMaxStepSize (const TString &volume)
 Returns the maximum step at a particular active volume.
 
Double_t GetMaxTargetStepSize () const
 Returns the value of the maximum Geant4 step size in mm for the target volume.
 
Double_t GetMinimumEnergyStored () const
 Returns the minimum event energy required for an event to be stored.
 
unsigned int GetNumberOfActiveVolumes () const
 Returns the number of active volumes, or geometry volumes that have been selected for data storage.
 
size_t GetNumberOfBiasingVolumes () const
 Returns the number of biasing volumes defined.
 
Long64_t GetNumberOfEvents () const
 Returns the number of events to be simulated.
 
Long64_t GetNumberOfRequestedEntries () const
 
size_t GetNumberOfSensitiveVolumes () const
 
Int_t GetNumberOfSources () const
 Returns the number of primary event sources defined in the generator.
 
TRestGeant4ParticleSourceGetParticleSource (size_t n=0) const
 Returns the name of the particle source with index n (Geant4 based names).
 
bool GetRemoveUnwantedTracks () const
 
bool GetRemoveUnwantedTracksKeepZeroEnergyTracks () const
 
std::vector< std::string > GetRemoveUnwantedTracksVolumesToKeep () const
 
Bool_t GetSaveAllEvents () const
 It returns true if save all events is active.
 
Long_t GetSeed () const
 // Used for faster lookup More...
 
TString GetSensitiveVolume (int n=0) const
 Returns a std::string with the name of the sensitive volume.
 
const std::vector< TString > & GetSensitiveVolumes () const
 
Int_t GetSimulationMaxTimeSeconds () const
 
Long64_t GetSimulationTime () const
 
Double_t GetStorageChance (const TString &volume)
 Returns the probability of an active volume being stored. More...
 
Double_t GetStorageChance (Int_t n) const
 Returns the probability per event to register (write to disk) hits in the storage volume with index n.
 
Double_t GetSubEventTimeDelay () const
 Returns the time gap, in us, required to consider a Geant4 hit as a new independent event. It is used to separate simulated events that in practice will appear as such in our detector. I.e. to separate multiple decay products (sometimes with years time delays) into independent events.
 
void InsertSensitiveVolume (const TString &volume)
 Sets the name of the sensitive volume.
 
bool IsActiveVolume (const char *volumeName) const
 
Int_t isBiasingActive () const
 Returns the number of biasing volumes defined. If 0 the biasing technique is not being used.
 
Bool_t isFullChainActivated () const
 Returns true in case full decay chain simulation is enabled.
 
bool IsKeepTracksVolume (const char *volumeName) const
 
bool IsKillVolume (const char *volumeName) const
 
Bool_t isVolumeStored (const TString &volume) const
 Returns true if the volume named volName has been registered for data storage.
 
void Merge (const TRestGeant4Metadata &)
 
TRestGeant4Metadataoperator= (const TRestGeant4Metadata &metadata)
 
void PrintMetadata () override
 Prints on screen the details about the Geant4 simulation conditions, stored in TRestGeant4Metadata.
 
Bool_t PrintProgress () const
 It returns true if printProgress parameter was set to true.
 
Bool_t RegisterEmptyTracks () const
 It returns false if registerEmptyTracks parameter was set to false.
 
void RemoveParticleSources ()
 Remove all the particle sources.
 
void SetActiveVolume (const TString &name, Double_t chance, Double_t maxStep=0)
 Adds a geometry volume to the list of active volumes. More...
 
void SetFullChain (Bool_t fullChain)
 Enables/disables the full chain decay generation.
 
void SetGdmlFilename (std::string gdmlFile)
 It sets the main filename to be used for the GDML geometry.
 
void SetGdmlReference (std::string reference)
 Returns the reference provided at the GDML file header.
 
void SetGeant4Version (const TString &versionString)
 Sets the value of the Geant4 version.
 
void SetGeometryPath (std::string path)
 It sets the location of the geometry files.
 
void SetMaterialsReference (std::string reference)
 Returns the reference provided at the materials file header.
 
void SetNumberOfEvents (Long64_t n)
 Sets the name of the sensitive volume.
 
void SetNumberOfRequestedEntries (Long64_t n)
 
void SetSaveAllEvents (const Bool_t value)
 Enables or disables the save all events feature.
 
void SetSeed (Long_t seed)
 Used exclusively by restG4 to set the value of the random seed used on Geant4 simulation.
 
void SetSimulationMaxTimeSeconds (Int_t seconds)
 
void SetSimulationTime (Long64_t time)
 
 TRestGeant4Metadata ()
 Default constructor.
 
 TRestGeant4Metadata (const char *configFilename, const std::string &name="")
 Constructor loading data from a config file. More...
 
 TRestGeant4Metadata (const TRestGeant4Metadata &metadata)
 
 ~TRestGeant4Metadata ()
 Default destructor.
 

Data Fields

std::set< std::string > fActiveVolumesSet = {}
 

Private Member Functions

void InitFromConfigFile () override
 Initialization of TRestGeant4Metadata members through a RML file.
 
void Initialize () override
 Initialization of TRestGeant4Metadata members.
 
void ReadBiasing ()
 
void ReadDetector ()
 Reads the storage section defined inside TRestGeant4Metadata. More...
 
void ReadGenerator ()
 Reads the generator section defined inside TRestGeant4Metadata. More...
 
void ReadParticleSource (TRestGeant4ParticleSource *src, TiXmlElement *sourceDefinition)
 It reads the <source definition given by argument.
 

Private Attributes

Bool_t fActivateAllVolumes = false
 Sets all volume as active without having to explicitly list them.
 
std::vector< TString > fActiveVolumes
 A std::vector to store the names of the active volumes.
 
std::vector< TRestGeant4BiasingVolumefBiasingVolumes
 A std::vector containing the biasing volume properties.
 
std::vector< Double_t > fChance
 A std::vector to store the probability value to write to disk the hits in a particular event.
 
TVector2 fEnergyRangeStored = {0, 1E20}
 A 2d-std::vector storing the energy range, in keV, to decide if a particular event should be written to disk or not.
 
Bool_t fFullChain = true
 Defines if a radioactive isotope decay is simulated in full chain (fFullChain=true), or just a single decay (fFullChain=false).
 
TString fGdmlFilename
 The filename of the GDML geometry.
 
TString fGdmlReference
 A GDML geometry reference introduced in the header of the GDML main setup.
 
TRestGeant4GeometryInfo fGeant4GeometryInfo
 Class used to store and retrieve geometry info.
 
TRestGeant4PhysicsInfo fGeant4PhysicsInfo
 Class used to store and retrieve physics info such as process names or particle names.
 
TRestGeant4PrimaryGeneratorInfo fGeant4PrimaryGeneratorInfo
 Class used to store and retrieve Geant4 primary generator info.
 
TString fGeant4Version
 The version of Geant4 used to generate the data.
 
TString fGeometryPath
 The local path to the GDML geometry.
 
bool fIsMerge = false
 
std::set< std::string > fKillVolumes
 
TVector3 fMagneticField = TVector3(0, 0, 0)
 The world magnetic field.
 
TString fMaterialsReference
 A GDML materials reference introduced in the header of the GDML of materials definition.
 
std::vector< Double_t > fMaxStepSize
 A std::vector to store the maximum step size at a particular volume.
 
Double_t fMaxTargetStepSize = 0
 The maximum target step size, in mm, allowed in Geant4 for the target volume (usually the gas volume). It is obsolete now. We define it at the active volume.
 
Int_t fNBiasingVolumes = 0
 The number of biasing volumes used in the simulation. If zero, no biasing technique is used.
 
Long64_t fNEvents = 0
 The number of events simulated, or to be simulated.
 
Long64_t fNRequestedEntries = 0
 The number of events the user requested to be on the file.
 
std::vector< TRestGeant4ParticleSource * > fParticleSource
 It the defines the primary source properties, particle type, momentum, energy, etc.
 
Bool_t fPrintProgress = false
 If this parameter is set to 'true' it will print out on screen every time 10k events are reached.
 
Bool_t fRegisterEmptyTracks = true
 If this parameter is enabled it will register tracks with no hits inside. This is the default behaviour. If it is disabled then empty tracks will not be written to disk at the risk of loosing traceability, but saving disk space and likely improving computing performance for large events.
 
Bool_t fRemoveUnwantedTracks = false
 If activated will remove tracks not present in volumes marked as "keep" or "sensitive".
 
Bool_t fRemoveUnwantedTracksKeepZeroEnergyTracks = false
 Option for 'removeUnwantedTracks', if enabled tracks with hits in volumes will be kept event if they deposit zero energy (such as neutron captures)
 
std::set< std::string > fRemoveUnwantedTracksVolumesToKeep
 A container related to fRemoveUnwantedTracks.
 
Bool_t fSaveAllEvents = false
 If this parameter is set to 'true' it will save all events even if they leave no energy in the sensitive volume (used for debugging purposes). It is set to 'false' by default.
 
Long_t fSeed = 0
 The seed value used for Geant4 random event generator. If it is zero its value will be assigned using the system timestamp.
 
std::vector< TString > fSensitiveVolumes
 The volume that serves as trigger for data storage. Only events that deposit a non-zero energy on this volume will be registered.
 
Int_t fSimulationMaxTimeSeconds = 0
 Time before simulation is ended and saved.
 
Long64_t fSimulationTime = 0
 The time, in seconds, that the simulation took to complete.
 
Double_t fSubEventTimeDelay = 100
 A time gap, in us, determining if an energy hit should be considered (and stored) as an independent event.
 

Friends

class DetectorConstruction
 
class SteppingAction
 
class TRestGeant4Hits
 

Additional Inherited Members

Constructor & Destructor Documentation

◆ TRestGeant4Metadata()

TRestGeant4Metadata::TRestGeant4Metadata ( const char *  configFilename,
const std::string &  name = "" 
)

Constructor loading data from a config file.

If no configuration path is defined using TRestMetadata::SetConfigFilePath the path to the config file must be specified using full path, absolute or relative.

The default behaviour is that the config file must be specified with full path, absolute or relative.

Parameters
configFilenameA const char* giving the path to an RML file.
nameThe name of the specific metadata. It will be used to find the corresponding TRestGeant4Metadata section inside the RML.

Definition at line 764 of file src/TRestGeant4Metadata.cxx.

Member Function Documentation

◆ GetCosmicFluxInCountsPerCm2PerSecond()

Double_t TRestGeant4Metadata::GetCosmicFluxInCountsPerCm2PerSecond ( ) const

Reads the biasing section defined inside TRestGeant4Metadata.

This section allows to define the size and properties of any number of biasing volumes. Biasing volume properties include the multiplicity factor and the range of energies that particles will be propagated to the next biasing volume.

<biasing value="off" type="virtualBox">
<biasingVolume size="2850mm" position="(0,0,0)mm" factor="2" energyRange="(0,5)MeV" />
<biasingVolume size="2450mm" position="(0,0,0)mm" factor="2" energyRange="(0,5)MeV" />
<biasingVolume size="2050mm" position="(0,0,0)mm" factor="2" energyRange="(0,5)MeV" />
</biasing>

Check for more details in the general description of this class.

Definition at line 914 of file src/TRestGeant4Metadata.cxx.

◆ GetSeed()

Long_t TRestGeant4Metadata::GetSeed ( ) const
inline

// Used for faster lookup

Returns the random seed that was used to generate the corresponding geant4 dataset.

Definition at line 175 of file TRestGeant4Metadata.h.

◆ GetStorageChance()

Double_t TRestGeant4Metadata::GetStorageChance ( const TString &  volume)

Returns the probability of an active volume being stored.

Returns the probability per event to register (write to disk) hits in a GDML volume given its geometry name.

Definition at line 1550 of file src/TRestGeant4Metadata.cxx.

◆ ReadDetector()

void TRestGeant4Metadata::ReadDetector ( )
private

Reads the storage section defined inside TRestGeant4Metadata.

This section allows to define which hits will be stored to disk. Different volumes in the geometry can be tagged for hit storage. At least one volume must be tagged as sensitive

<detector>
<parameter name="energyRange" value="(0,5)MeV" />
<volume name="gas" sensitive="true" chance="1" maxStepSize="2mm" />
</detector>

Definition at line 1270 of file src/TRestGeant4Metadata.cxx.

◆ ReadGenerator()

void TRestGeant4Metadata::ReadGenerator ( )
private

Reads the generator section defined inside TRestGeant4Metadata.

This section allows to define the primary particles to be simulated. The generator will allow us to define from where we will launch the primary particles, their energy distribution, and their angular momentum.

<generator type="volume" from="gas" >
<source use="Xe136bb0n.dat"/>
<!--<source use="decay0" particle="Xe136" decayMode="0vbb" daughterLevel="3" />-->
<!--<source use="geant4" particle="Na22" excitedLevel="0.0" fullChain="on">
<angular type="isotropic" />
<energy type="mono" energy="0.0" units="MeV" />
</source>-->
</generator>

Definition at line 1026 of file src/TRestGeant4Metadata.cxx.

◆ SetActiveVolume()

void TRestGeant4Metadata::SetActiveVolume ( const TString &  name,
Double_t  chance,
Double_t  maxStep = 0 
)

Adds a geometry volume to the list of active volumes.

Parameters
nameThe name of the volume to be added to the active volumes list for storage. Using GDML naming convention.
chanceProbability that for a particular event the hits are stored in that volume.
maxStepIt defines the maximum integration step at the active volume.

The aim of this parameter is to define control volumes. Usually the volume of interest will be always registered (chance=1).

Definition at line 1521 of file src/TRestGeant4Metadata.cxx.


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