HerdSoftware
0.1.1
|
Information about particle generation in MC simulation. More...
#include <dataobjects/MCGenerationInfo.h>
Public Types | |
enum | Position { Position::NONE, Position::POINT, Position::SPHERE, Position::RECTANGLE } |
Enum for the kind of position generation. More... | |
enum | Direction { Direction::NONE, Direction::FIXED, Direction::ISOTROPIC, Direction::UNIFORM } |
enum | Spectrum { Spectrum::NONE, Spectrum::MONOCHROMATIC, Spectrum::POWERLAW } |
Enum for the kind of spectrum generation. More... | |
Public Member Functions | |
MCGenerationInfo () | |
Default constructor. More... | |
virtual | ~MCGenerationInfo ()=default |
Destructor. More... | |
void | SetGeneratorName (std::string name) |
Sets the name of the particle generator. More... | |
std::string | GeneratorName () const |
Gets the name of the particle generator. More... | |
void | SetAcceptanceCheck (bool accChecked) |
Sets the acceptance check flag. More... | |
bool | WasAcceptanceCheckActive () const |
Checks if the acceptance check was active during particle generation. More... | |
void | SetParticlePDGCode (int pdgCode) |
Sets the PDG code of the generated particle. More... | |
int | ParticlePDGCode () const |
Gets the PDG code of the generated particle. More... | |
Position | PositionType () const |
Gets the type of position generation. More... | |
void | SetPositionType (Position pos) |
Sets the type of position generation. More... | |
Point | FixedPoint () const |
Gets the particle generation point. More... | |
void | SetFixedPoint (Point genPoint) |
Sets the particle generation point. More... | |
Point | SphereCapCenter () const |
Gets the center of the generation sphere cap. More... | |
Vec3D | SphereCapPosition () const |
Gets the position of the generation sphere cap. More... | |
float | SphereCapExtension () const |
Gets the extension of the generation sphere cap. More... | |
void | SetSphereCap (Point sphereCapCenter, Vec3D sphereCapPosition, float sphereCapExtension) |
Sets the generation sphere cap. More... | |
Herd::Rectangle | Rectangle () const |
Gets the generation rectangle. More... | |
void | SetRectangle (std::array< Point, 3 > points) |
Sets the generation rectangle. More... | |
Direction | DirectionType () const |
Gets the type of direction generation. More... | |
void | SetDirectionType (Direction dir) |
Sets the type of direction generation. More... | |
Vec3D | FixedDirection () const |
Gets the fixed generation direction. More... | |
void | SetFixedDirection (Vec3D dir) |
Sets the fixed generation direction. More... | |
std::pair< float, float > | IsotropicPolarAngleRange () const |
Gets the minimum and maximum polar angles for isotropic generation. More... | |
std::pair< float, float > | IsotropicAzimuthAngleRange () const |
Gets the minimum and maximum azimuth angles for isotropic generation. More... | |
std::pair< float, float > | UniformAzimuthAngleRange () const |
Gets the minimum and maximum azimuth angles for uniform generation. More... | |
std::pair< float, float > | UniformPolarAngleRange () const |
Gets the minimum and maximum polar angles for uniform generation. More... | |
void | SetIsotropicAnglesRanges (float minPolar, float maxPolar, float minAzimuth, float maxAzimuth) |
Sets the minimum and maximum polar and azimuth angles for isotropic generation. More... | |
void | SetUniformAnglesRanges (float minPolar, float maxPolar, float minAzimuth, float maxAzimuth) |
Sets the minimum and maximum polar and azimuth angles for uniform generation. More... | |
Spectrum | SpectrumType () const |
Gets the type of spectrum generation. More... | |
void | SetSpectrumType (Spectrum sp) |
Sets the type of spectrum generation. More... | |
float | FixedEnergy () const |
Gets the fixed generation energy. More... | |
void | SetFixedEnergy (float energy) |
Sets the fixed generation energy. More... | |
std::pair< float, float > | EnergyRange () const |
Gets the energy range used for power-law spectrum generation. More... | |
float | SpectralIndex () const |
Gets the spectral index used for power-law spectrum generation. More... | |
void | SetPowerLawSpectrum (float minEnergy, float maxEnergy, float spectralIndex) |
Sets the power-law spectrum generation. More... | |
Private Attributes | |
std::string | _generatorName |
bool | _acceptanceCheck |
int | _particlePdgCode |
Position | _position |
Point | _fixedShootingPoint |
Point | _sphereCapCenter |
Vec3D | _sphereCapPosition |
float | _sphereCapExtension |
Herd::Rectangle | _rectangle |
Direction | _direction |
Herd::Vec3D | _fixedShootingDirection |
float | _minPolar |
float | _maxPolar |
float | _minAzimuth |
float | _maxAzimuth |
Spectrum | _spectrum |
float | _fixedShootingEnergy |
float | _minEnergy |
float | _maxEnergy |
float | _spectralIndex |
Information about particle generation in MC simulation.
This class holds information about how the particles were generated in the Monte Carlo simulation.
|
strong |
|
strong |
|
strong |
Herd::MCGenerationInfo::MCGenerationInfo | ( | ) |
Default constructor.
|
virtualdefault |
Destructor.
|
inline |
Gets the type of direction generation.
Returns an enum value describing how the directions of primary particles where generated.
std::pair< float, float > Herd::MCGenerationInfo::EnergyRange | ( | ) | const |
Gets the energy range used for power-law spectrum generation.
If generation was not done with a power-law spectrum (i.e. if SetSpectrumType has not been called in advance with Spectrum::POWERLAW as argument) an #Exception is thrown.
Exception | if particles were not generated with a monochromatic spectrum. |
Vec3D Herd::MCGenerationInfo::FixedDirection | ( | ) | const |
Gets the fixed generation direction.
If generation was not done with a fixed shooting direction (i.e. if SetDirectionType has not been called in advance with Direction::FIXED as argument) an #Exception is thrown.
Exception | if particles were not generated with a fixed direction. |
float Herd::MCGenerationInfo::FixedEnergy | ( | ) | const |
Gets the fixed generation energy.
If generation was not done with a monochromatic spectrum (i.e. if SetSpectrumType has not been called in advance with Spectrum::MONOCHROMATIC as argument) an #Exception is thrown.
Exception | if particles were not generated with a monochromatic spectrum. |
Point Herd::MCGenerationInfo::FixedPoint | ( | ) | const |
Gets the particle generation point.
Gets the point from which particles were generated. If generation was not from a fixed point (i.e. if SetPositionType has not been called in advance with Position::POINT as argument) an #Exception is thrown.
#EA::Exception | if particles were not generated from a fixed point. |
std::string Herd::MCGenerationInfo::GeneratorName | ( | ) | const |
Gets the name of the particle generator.
std::pair< float, float > Herd::MCGenerationInfo::IsotropicAzimuthAngleRange | ( | ) | const |
Gets the minimum and maximum azimuth angles for isotropic generation.
The azimuth angle is referred to the local reference frame in the generation point. If generation direction was not isotropic (i.e. if SetDirectionType has not been called in advance with Direction::ISOTROPIC as argument) an #Exception is thrown.
Exception | if particles were not generated with an isotropic direction. |
std::pair< float, float > Herd::MCGenerationInfo::IsotropicPolarAngleRange | ( | ) | const |
Gets the minimum and maximum polar angles for isotropic generation.
The polar angle is referred to the normal to the surface in the generation point. If generation direction was not isotropic (i.e. if SetDirectionType has not been called in advance with Direction::ISOTROPIC as argument) an #Exception is thrown.
Exception | if particles were not generated with an isotropic direction. |
int Herd::MCGenerationInfo::ParticlePDGCode | ( | ) | const |
Gets the PDG code of the generated particle.
|
inline |
Gets the type of position generation.
Returns an enum value describing how the positions of primary particles where generated.
Herd::Rectangle Herd::MCGenerationInfo::Rectangle | ( | ) | const |
Gets the generation rectangle.
#Exception | if particles were not generated from a rectangle. |
void Herd::MCGenerationInfo::SetAcceptanceCheck | ( | bool | accChecked | ) |
Sets the acceptance check flag.
accChecked | acceptance flag (true when acceptance was checked diring the simulation). |
void Herd::MCGenerationInfo::SetDirectionType | ( | Direction | dir | ) |
Sets the type of direction generation.
dir | The type of direction generation to be set. |
void Herd::MCGenerationInfo::SetFixedDirection | ( | Vec3D | dir | ) |
Sets the fixed generation direction.
If generation was not done with a fixed shooting direction (i.e. if SetDirectionType has not been called in advance with Direction::FIXED as argument) an #Exception is thrown
dir | The fixed generation direction. |
Exception | if particles were not generated with a fixed direction. |
void Herd::MCGenerationInfo::SetFixedEnergy | ( | float | energy | ) |
Sets the fixed generation energy.
If generation was not done with a monochromatic spectrum (i.e. if SetSpectrumType has not been called in advance with Spectrum::MONOCHROMATIC as argument) an #Exception is thrown.
energy | The fixed generation energy (GeV). |
Exception | if particles were not generated with a fixed direction. |
void Herd::MCGenerationInfo::SetFixedPoint | ( | Point | genPoint | ) |
Sets the particle generation point.
Sets the point from which particles were generated. If generation was not from a fixed point (i.e. if SetPositionType has not been called in advance with Position::POINT as argument) an #Exception is thrown.
#Exception | if particles were not generated from a fixed point. |
void Herd::MCGenerationInfo::SetGeneratorName | ( | std::string | name | ) |
Sets the name of the particle generator.
name | The name of the particle generator. |
void Herd::MCGenerationInfo::SetIsotropicAnglesRanges | ( | float | minPolar, |
float | maxPolar, | ||
float | minAzimuth, | ||
float | maxAzimuth | ||
) |
Sets the minimum and maximum polar and azimuth angles for isotropic generation.
The polar and azimuth angles are referred to the local reference frame in the generation point. If generation direction was not isotropic (i.e. if SetDirectionType has not been called in advance with Direction::ISOTROPIC as argument) or if max{Polar,Azimuth} < min{Polar,Azimuth} an #Exception is thrown.
minPolar | The minimum polar angle (rad). |
maxPolar | The maximum polar angle (rad). |
minAzimuth | The minimum azimuth angle (rad). |
maxAzimuth | The maximum azimuth angle (rad). |
Exception | if particles were not generated with an isotropic direction or if a maximum angle is less than the corresponding minimum angle. |
void Herd::MCGenerationInfo::SetParticlePDGCode | ( | int | pdgCode | ) |
Sets the PDG code of the generated particle.
pdgCode | the PDG code of the generated particle. |
void Herd::MCGenerationInfo::SetPositionType | ( | Position | pos | ) |
Sets the type of position generation.
pos | The type of position generation to be set. |
void Herd::MCGenerationInfo::SetPowerLawSpectrum | ( | float | minEnergy, |
float | maxEnergy, | ||
float | spectralIndex | ||
) |
Sets the power-law spectrum generation.
If generation was not done with a monochromatic spectrum (i.e. if SetSpectrumType has not been called in advance with Spectrum::MONOCHROMATIC as argument) or if maxEnergy < minEnergy then an #Exception is thrown.
minEnergy | The minimum generation energy (GeV). |
maxEnergy | The maximum generation energy (GeV). |
spectralIndex | The spectral index. |
Exception | if particles were not generated with a monochromatic spectrum or if maxEnergy < minEnergy. |
void Herd::MCGenerationInfo::SetRectangle | ( | std::array< Point, 3 > | points | ) |
Sets the generation rectangle.
If generation was not from a plane (i.e. if SetPositionType has not been called in advance with Position::PLANE as argument) or if the three points do not define a rectangle then an #Exception is thrown.
points | Three points at the vertices of the rectangle (the fourth is automatically deduced). |
Exception | if particles were not generated from a rectangle or if the given points do not define a rectangle. |
void Herd::MCGenerationInfo::SetSpectrumType | ( | Spectrum | sp | ) |
Sets the type of spectrum generation.
sp | The type of spectrum generation to be set. |
void Herd::MCGenerationInfo::SetSphereCap | ( | Point | sphereCapCenter, |
Vec3D | sphereCapPosition, | ||
float | sphereCapExtension | ||
) |
Sets the generation sphere cap.
Sets the center, position and angular extension of the sphere cap from which particles were generated. The sphere position vector is relative to the sphere center, not to the origin of the reference frame. If generation was not from a sphere cap (i.e. if SetPositionType has not been called in advance with Position::SPHERE as argument) an #Exception is thrown.
sphereCapCenter | The center of the generation sphere cap (cm). |
sphereCapPosition | The position of the sphere cap (cm) relative to the sphere center. |
sphereCapExtension | The angular extension of the sphere cap (rad). |
#Exception | if particles were not generated from a sphere cap. |
void Herd::MCGenerationInfo::SetUniformAnglesRanges | ( | float | minPolar, |
float | maxPolar, | ||
float | minAzimuth, | ||
float | maxAzimuth | ||
) |
Sets the minimum and maximum polar and azimuth angles for uniform generation.
The polar and azimuth angles are referred to the global reference frame. If generation direction was not uniform (i.e. if SetDirectionType has not been called in advance with Direction::UNIFORM as argument) or if max{Polar,Azimuth} < min{Polar,Azimuth} an #Exception is thrown.
minPolar | The minimum polar angle (rad). |
maxPolar | The maximum polar angle (rad). |
minAzimuth | The minimum azimuth angle (rad). |
maxAzimuth | The maximum azimuth angle (rad). |
Exception | if particles were not generated with an uniform direction or if a maximum angle is less than the corresponding minimum angle. |
float Herd::MCGenerationInfo::SpectralIndex | ( | ) | const |
Gets the spectral index used for power-law spectrum generation.
If generation was not done with a power-law spectrum (i.e. if SetSpectrumType has not been called in advance with Spectrum::POWERLAW as argument) an #Exception is thrown.
Exception | if particles were not generated with a monochromatic spectrum. |
|
inline |
Gets the type of spectrum generation.
Returns an enum value describing how the energies of primary particles where generated.
Vec3D Herd::MCGenerationInfo::SphereCapCenter | ( | ) | const |
Gets the center of the generation sphere cap.
Gets the center of the sphere cap from which particles were generated. If generation was not from a sphere cap (i.e. if SetPositionType has not been called in advance with Position::SPHERE as argument) an #Exception is thrown.
#Exception | if particles were not generated from a sphere cap. |
float Herd::MCGenerationInfo::SphereCapExtension | ( | ) | const |
Gets the extension of the generation sphere cap.
Gets the angular extension of the sphere cap from which particles were generated. If generation was not from a sphere cap (i.e. if SetPositionType has not been called in advance with Position::SPHERE as argument) an #Exception is thrown.
#Exception | if particles were not generated from a sphere cap. |
Vec3D Herd::MCGenerationInfo::SphereCapPosition | ( | ) | const |
Gets the position of the generation sphere cap.
Gets the position of the sphere cap (relative to the center of the sphere cap) from which particles were generated. If generation was not from a sphere cap (i.e. if SetPositionType has not been called in advance with Position::SPHERE as argument) an #Exception is thrown.
#Exception | if particles were not generated from a sphere cap. |
std::pair< float, float > Herd::MCGenerationInfo::UniformAzimuthAngleRange | ( | ) | const |
Gets the minimum and maximum azimuth angles for uniform generation.
The azimuth angle is referred to the global reference frame. If generation direction was not uniform (i.e. if SetDirectionType has not been called in advance with Direction::UNIFORM as argument) an #Exception is thrown.
Exception | if particles were not generated with an uniform direction. |
std::pair< float, float > Herd::MCGenerationInfo::UniformPolarAngleRange | ( | ) | const |
Gets the minimum and maximum polar angles for uniform generation.
The polar angle is referred to the global reference frame. If generation direction was not uniform (i.e. if SetDirectionType has not been called in advance with Direction::UNIFORM as argument) an #Exception is thrown.
Exception | if particles were not generated with an uniform direction. |
bool Herd::MCGenerationInfo::WasAcceptanceCheckActive | ( | ) | const |
Checks if the acceptance check was active during particle generation.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |