HerdSoftware  0.1.1
Public Types | Public Member Functions | Private Attributes | List of all members
Herd::MCGenerationInfo Class Reference

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
 

Detailed Description

Information about particle generation in MC simulation.

This class holds information about how the particles were generated in the Monte Carlo simulation.

Member Enumeration Documentation

◆ Direction

Enum for the kind of direction generation.

Enumerator
NONE 
FIXED 
ISOTROPIC 
UNIFORM 

◆ Position

Enum for the kind of position generation.

Enumerator
NONE 
POINT 
SPHERE 
RECTANGLE 

◆ Spectrum

Enum for the kind of spectrum generation.

Enumerator
NONE 
MONOCHROMATIC 
POWERLAW 

Constructor & Destructor Documentation

◆ MCGenerationInfo()

Herd::MCGenerationInfo::MCGenerationInfo ( )

Default constructor.

◆ ~MCGenerationInfo()

virtual Herd::MCGenerationInfo::~MCGenerationInfo ( )
virtualdefault

Destructor.

Member Function Documentation

◆ DirectionType()

Direction Herd::MCGenerationInfo::DirectionType ( ) const
inline

Gets the type of direction generation.

Returns an enum value describing how the directions of primary particles where generated.

Returns
The type of direction generation.

◆ EnergyRange()

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.

Returns
The energy range for power-law generation (GeV).
Exceptions
Exceptionif particles were not generated with a monochromatic spectrum.

◆ FixedDirection()

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.

Returns
The fixed generation direction.
Exceptions
Exceptionif particles were not generated with a fixed direction.

◆ FixedEnergy()

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.

Returns
The fixed generation energy (GeV).
Exceptions
Exceptionif particles were not generated with a monochromatic spectrum.

◆ FixedPoint()

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.

Returns
the generation point (cm).
Exceptions
#EA::Exceptionif particles were not generated from a fixed point.

◆ GeneratorName()

std::string Herd::MCGenerationInfo::GeneratorName ( ) const

Gets the name of the particle generator.

Returns
The name of the particle generator.

◆ IsotropicAzimuthAngleRange()

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.

Returns
The range for azimuth angle of isotropic generation directions (rad).
Exceptions
Exceptionif particles were not generated with an isotropic direction.

◆ IsotropicPolarAngleRange()

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.

Returns
The range for polar angle of isotropic generation directions (rad).
Exceptions
Exceptionif particles were not generated with an isotropic direction.

◆ ParticlePDGCode()

int Herd::MCGenerationInfo::ParticlePDGCode ( ) const

Gets the PDG code of the generated particle.

Returns
the PDG code of the generated particle.

◆ PositionType()

Position Herd::MCGenerationInfo::PositionType ( ) const
inline

Gets the type of position generation.

Returns an enum value describing how the positions of primary particles where generated.

Returns
The type of position generation.

◆ Rectangle()

Herd::Rectangle Herd::MCGenerationInfo::Rectangle ( ) const

Gets the generation rectangle.

Returns
the generation rectangle.
Exceptions
#Exceptionif particles were not generated from a rectangle.

◆ SetAcceptanceCheck()

void Herd::MCGenerationInfo::SetAcceptanceCheck ( bool  accChecked)

Sets the acceptance check flag.

Parameters
accCheckedacceptance flag (true when acceptance was checked diring the simulation).

◆ SetDirectionType()

void Herd::MCGenerationInfo::SetDirectionType ( Direction  dir)

Sets the type of direction generation.

Parameters
dirThe type of direction generation to be set.

◆ SetFixedDirection()

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

Parameters
dirThe fixed generation direction.
Exceptions
Exceptionif particles were not generated with a fixed direction.

◆ SetFixedEnergy()

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.

Parameters
energyThe fixed generation energy (GeV).
Exceptions
Exceptionif particles were not generated with a fixed direction.

◆ SetFixedPoint()

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.

Returns
the generation point (cm).
Exceptions
#Exceptionif particles were not generated from a fixed point.

◆ SetGeneratorName()

void Herd::MCGenerationInfo::SetGeneratorName ( std::string  name)

Sets the name of the particle generator.

Parameters
nameThe name of the particle generator.

◆ SetIsotropicAnglesRanges()

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.

Parameters
minPolarThe minimum polar angle (rad).
maxPolarThe maximum polar angle (rad).
minAzimuthThe minimum azimuth angle (rad).
maxAzimuthThe maximum azimuth angle (rad).
Exceptions
Exceptionif particles were not generated with an isotropic direction or if a maximum angle is less than the corresponding minimum angle.

◆ SetParticlePDGCode()

void Herd::MCGenerationInfo::SetParticlePDGCode ( int  pdgCode)

Sets the PDG code of the generated particle.

Parameters
pdgCodethe PDG code of the generated particle.

◆ SetPositionType()

void Herd::MCGenerationInfo::SetPositionType ( Position  pos)

Sets the type of position generation.

Parameters
posThe type of position generation to be set.

◆ SetPowerLawSpectrum()

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.

Parameters
minEnergyThe minimum generation energy (GeV).
maxEnergyThe maximum generation energy (GeV).
spectralIndexThe spectral index.
Exceptions
Exceptionif particles were not generated with a monochromatic spectrum or if maxEnergy < minEnergy.

◆ SetRectangle()

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.

Parameters
pointsThree points at the vertices of the rectangle (the fourth is automatically deduced).
Exceptions
Exceptionif particles were not generated from a rectangle or if the given points do not define a rectangle.
See also
Herd::Rectangle

◆ SetSpectrumType()

void Herd::MCGenerationInfo::SetSpectrumType ( Spectrum  sp)

Sets the type of spectrum generation.

Parameters
spThe type of spectrum generation to be set.

◆ SetSphereCap()

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.

Parameters
sphereCapCenterThe center of the generation sphere cap (cm).
sphereCapPositionThe position of the sphere cap (cm) relative to the sphere center.
sphereCapExtensionThe angular extension of the sphere cap (rad).
Exceptions
#Exceptionif particles were not generated from a sphere cap.

◆ SetUniformAnglesRanges()

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.

Parameters
minPolarThe minimum polar angle (rad).
maxPolarThe maximum polar angle (rad).
minAzimuthThe minimum azimuth angle (rad).
maxAzimuthThe maximum azimuth angle (rad).
Exceptions
Exceptionif particles were not generated with an uniform direction or if a maximum angle is less than the corresponding minimum angle.

◆ SpectralIndex()

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.

Returns
The spectral index for power-law generation.
Exceptions
Exceptionif particles were not generated with a monochromatic spectrum.

◆ SpectrumType()

Spectrum Herd::MCGenerationInfo::SpectrumType ( ) const
inline

Gets the type of spectrum generation.

Returns an enum value describing how the energies of primary particles where generated.

Returns
The type of spectrum generation.

◆ SphereCapCenter()

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.

Returns
the center of the generation spohere cap (cm)
Exceptions
#Exceptionif particles were not generated from a sphere cap.

◆ SphereCapExtension()

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.

Returns
the angular extension of the generation sphere cap (rad).
Exceptions
#Exceptionif particles were not generated from a sphere cap.

◆ SphereCapPosition()

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.

Returns
the position of the generation sphere cap (cm).
Exceptions
#Exceptionif particles were not generated from a sphere cap.

◆ UniformAzimuthAngleRange()

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.

Returns
The range for azimuth angle of uniform generation directions (rad).
Exceptions
Exceptionif particles were not generated with an uniform direction.

◆ UniformPolarAngleRange()

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.

Returns
The range for polar angle of uniform generation directions (rad).
Exceptions
Exceptionif particles were not generated with an uniform direction.

◆ WasAcceptanceCheckActive()

bool Herd::MCGenerationInfo::WasAcceptanceCheckActive ( ) const

Checks if the acceptance check was active during particle generation.

Returns
true if the acceptance check was active.

Member Data Documentation

◆ _acceptanceCheck

bool Herd::MCGenerationInfo::_acceptanceCheck
private

◆ _direction

Direction Herd::MCGenerationInfo::_direction
private

◆ _fixedShootingDirection

Herd::Vec3D Herd::MCGenerationInfo::_fixedShootingDirection
private

◆ _fixedShootingEnergy

float Herd::MCGenerationInfo::_fixedShootingEnergy
private

◆ _fixedShootingPoint

Point Herd::MCGenerationInfo::_fixedShootingPoint
private

◆ _generatorName

std::string Herd::MCGenerationInfo::_generatorName
private

◆ _maxAzimuth

float Herd::MCGenerationInfo::_maxAzimuth
private

◆ _maxEnergy

float Herd::MCGenerationInfo::_maxEnergy
private

◆ _maxPolar

float Herd::MCGenerationInfo::_maxPolar
private

◆ _minAzimuth

float Herd::MCGenerationInfo::_minAzimuth
private

◆ _minEnergy

float Herd::MCGenerationInfo::_minEnergy
private

◆ _minPolar

float Herd::MCGenerationInfo::_minPolar
private

◆ _particlePdgCode

int Herd::MCGenerationInfo::_particlePdgCode
private

◆ _position

Position Herd::MCGenerationInfo::_position
private

◆ _rectangle

Herd::Rectangle Herd::MCGenerationInfo::_rectangle
private

◆ _spectralIndex

float Herd::MCGenerationInfo::_spectralIndex
private

◆ _spectrum

Spectrum Herd::MCGenerationInfo::_spectrum
private

◆ _sphereCapCenter

Point Herd::MCGenerationInfo::_sphereCapCenter
private

◆ _sphereCapExtension

float Herd::MCGenerationInfo::_sphereCapExtension
private

◆ _sphereCapPosition

Vec3D Herd::MCGenerationInfo::_sphereCapPosition
private

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