HerdSoftware  0.4.0
MCGenerationInfo.h
Go to the documentation of this file.
1 /*
2  * MCGenerationInfo.h
3  *
4  * Created on: 5 Nov 2018
5  * Author: Nicola Mori
6  */
7 
10 #ifndef HERD_MCGENERATIONINFO_H_
11 #define HERD_MCGENERATIONINFO_H_
12 
15 
16 #ifdef HS_USE_ROOT
17 #include "Rtypes.h"
18 #endif
19 
20 namespace Herd {
21 
28 public:
31 
33  virtual ~MCGenerationInfo() = default;
34 
39  void SetGeneratorName(std::string name);
40 
45  [[nodiscard]] std::string GeneratorName() const;
46 
51  void SetAcceptanceCheck(bool accChecked);
52 
57  [[nodiscard]] bool WasAcceptanceCheckActive() const;
58 
63  void SetParticlePDGCode(int pdgCode);
64 
69  [[nodiscard]] int ParticlePDGCode() const;
70 
71  /* ******* POSITION ******* */
72 
74  enum class Position { NONE, POINT, SPHERE, RECTANGLE };
75 
82  [[nodiscard]] Position PositionType() const { return _position; }
83 
88  void SetPositionType(Position pos);
89 
99  [[nodiscard]] Point FixedPoint() const;
100 
108  void SetFixedPoint(Point genPoint);
109 
119  [[nodiscard]] Point SphereCapCenter() const;
120 
130  [[nodiscard]] Vec3D SphereCapPosition() const;
131 
141  [[nodiscard]] float SphereCapExtension() const;
142 
155  void SetSphereCap(Point sphereCapCenter, Vec3D sphereCapPosition, float sphereCapExtension);
156 
162  [[nodiscard]] Herd::Rectangle Rectangle() const;
163 
174  void SetRectangle(std::array<Point, 3> points);
175 
176  /* ******* DIRECTION ******* */
177 
179  enum class Direction { NONE, FIXED, ISOTROPIC, UNIFORM };
180 
187  [[nodiscard]] Direction DirectionType() const { return _direction; }
188 
193  void SetDirectionType(Direction dir);
194 
203  [[nodiscard]] Vec3D FixedDirection() const;
204 
213  void SetFixedDirection(Vec3D dir);
214 
224  [[nodiscard]] std::pair<float, float> IsotropicPolarAngleRange() const;
225 
235  [[nodiscard]] std::pair<float, float> IsotropicAzimuthAngleRange() const;
236 
246  [[nodiscard]] std::pair<float, float> UniformAzimuthAngleRange() const;
247 
257  [[nodiscard]] std::pair<float, float> UniformPolarAngleRange() const;
258 
272  void SetIsotropicAnglesRanges(float minPolar, float maxPolar, float minAzimuth, float maxAzimuth);
273 
287  void SetUniformAnglesRanges(float minPolar, float maxPolar, float minAzimuth, float maxAzimuth);
288 
289  /* ******* SPECTRUM ******* */
290 
293 
300  [[nodiscard]] Spectrum SpectrumType() const { return _spectrum; }
301 
306  void SetSpectrumType(Spectrum sp);
307 
316  [[nodiscard]] float FixedEnergy() const;
317 
326  void SetFixedEnergy(float energy);
327 
336  [[nodiscard]] std::pair<float, float> EnergyRange() const;
337 
346  [[nodiscard]] float SpectralIndex() const;
347 
358  void SetPowerLawSpectrum(float minEnergy, float maxEnergy, float spectralIndex);
359 
360 private:
361  std::string _generatorName;
364 
365  /* *** Position ***/
367  // fixed
369  // sphere
372  float _sphereCapExtension; // rad
373  // rectangle
375 
376  /* *** Direction *** */
378  // fixed
380  // isotropic
382 
383  /* *** Spectrum *** */
385  // monochromatic
386  float _fixedShootingEnergy; // GeV
387  // power law
388  float _minEnergy, _maxEnergy; // GeV
390 
391 #ifdef HS_USE_ROOT
392  ClassDef(MCGenerationInfo, 1)
393 #endif
394 };
395 
396 } // namespace Herd
397 
398 #endif /* HERD_MCGENERATIONINFO_H_ */
Herd::MCGenerationInfo::PositionType
Position PositionType() const
Gets the type of position generation.
Definition: MCGenerationInfo.h:82
Point.h
Herd::MCGenerationInfo::_sphereCapPosition
Vec3D _sphereCapPosition
Definition: MCGenerationInfo.h:371
Herd::MCGenerationInfo::~MCGenerationInfo
virtual ~MCGenerationInfo()=default
Destructor
Herd::MCGenerationInfo::Rectangle
Herd::Rectangle Rectangle() const
Gets the generation rectangle.
Definition: MCGenerationInfo.cpp:90
Herd::MCGenerationInfo::DirectionType
Direction DirectionType() const
Gets the type of direction generation.
Definition: MCGenerationInfo.h:187
Herd::Vec3D
A class describing a vector in 3D space.
Definition: Vec3D.h:33
Herd::Rectangle
A rectangle in 3D space.
Definition: Rectangle.h:26
Herd::MCGenerationInfo::Direction::FIXED
@ FIXED
Herd::MCGenerationInfo
Information about particle generation in MC simulation.
Definition: MCGenerationInfo.h:27
Herd::MCGenerationInfo::WasAcceptanceCheckActive
bool WasAcceptanceCheckActive() const
Checks if the acceptance check was active during particle generation.
Definition: MCGenerationInfo.cpp:27
Herd::MCGenerationInfo::_fixedShootingDirection
Herd::Vec3D _fixedShootingDirection
Definition: MCGenerationInfo.h:379
Herd::MCGenerationInfo::IsotropicPolarAngleRange
std::pair< float, float > IsotropicPolarAngleRange() const
Gets the minimum and maximum polar angles for isotropic generation.
Definition: MCGenerationInfo.cpp:132
Herd::MCGenerationInfo::_minPolar
float _minPolar
Definition: MCGenerationInfo.h:381
Herd::MCGenerationInfo::_maxAzimuth
float _maxAzimuth
Definition: MCGenerationInfo.h:381
Herd::MCGenerationInfo::SpectralIndex
float SpectralIndex() const
Gets the spectral index used for power-law spectrum generation.
Definition: MCGenerationInfo.cpp:230
Herd::MCGenerationInfo::SetPositionType
void SetPositionType(Position pos)
Sets the type of position generation.
Definition: MCGenerationInfo.cpp:35
Herd::MCGenerationInfo::SetUniformAnglesRanges
void SetUniformAnglesRanges(float minPolar, float maxPolar, float minAzimuth, float maxAzimuth)
Sets the minimum and maximum polar and azimuth angles for uniform generation.
Definition: MCGenerationInfo.cpp:178
Herd::MCGenerationInfo::SphereCapCenter
Point SphereCapCenter() const
Gets the center of the generation sphere cap.
Definition: MCGenerationInfo.cpp:60
Herd::MCGenerationInfo::SetSpectrumType
void SetSpectrumType(Spectrum sp)
Sets the type of spectrum generation.
Definition: MCGenerationInfo.cpp:198
Herd::MCGenerationInfo::SpectrumType
Spectrum SpectrumType() const
Gets the type of spectrum generation.
Definition: MCGenerationInfo.h:300
Herd::MCGenerationInfo::UniformPolarAngleRange
std::pair< float, float > UniformPolarAngleRange() const
Gets the minimum and maximum polar angles for uniform generation.
Definition: MCGenerationInfo.cpp:146
Herd
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:22
Herd::MCGenerationInfo::Spectrum
Spectrum
Enum for the kind of spectrum generation.
Definition: MCGenerationInfo.h:292
Herd::MCGenerationInfo::Spectrum::POWERLAW
@ POWERLAW
Herd::MCGenerationInfo::SphereCapExtension
float SphereCapExtension() const
Gets the extension of the generation sphere cap.
Definition: MCGenerationInfo.cpp:74
Herd::MCGenerationInfo::_spectrum
Spectrum _spectrum
Definition: MCGenerationInfo.h:384
Herd::MCGenerationInfo::Position::POINT
@ POINT
Herd::MCGenerationInfo::_acceptanceCheck
bool _acceptanceCheck
Definition: MCGenerationInfo.h:362
Herd::MCGenerationInfo::FixedDirection
Vec3D FixedDirection() const
Gets the fixed generation direction.
Definition: MCGenerationInfo.cpp:118
Herd::MCGenerationInfo::_position
Position _position
Definition: MCGenerationInfo.h:366
Herd::MCGenerationInfo::_maxPolar
float _maxPolar
Definition: MCGenerationInfo.h:381
Herd::MCGenerationInfo::FixedEnergy
float FixedEnergy() const
Gets the fixed generation energy.
Definition: MCGenerationInfo.cpp:209
Herd::MCGenerationInfo::_sphereCapCenter
Point _sphereCapCenter
Definition: MCGenerationInfo.h:370
Herd::MCGenerationInfo::SetSphereCap
void SetSphereCap(Point sphereCapCenter, Vec3D sphereCapPosition, float sphereCapExtension)
Sets the generation sphere cap.
Definition: MCGenerationInfo.cpp:81
Rectangle.h
Herd::MCGenerationInfo::SetAcceptanceCheck
void SetAcceptanceCheck(bool accChecked)
Sets the acceptance check flag.
Definition: MCGenerationInfo.cpp:25
Herd::MCGenerationInfo::SetRectangle
void SetRectangle(std::array< Point, 3 > points)
Sets the generation rectangle.
Definition: MCGenerationInfo.cpp:97
Herd::MCGenerationInfo::Direction
Direction
Definition: MCGenerationInfo.h:179
Herd::MCGenerationInfo::FixedPoint
Point FixedPoint() const
Gets the particle generation point.
Definition: MCGenerationInfo.cpp:46
Herd::MCGenerationInfo::EnergyRange
std::pair< float, float > EnergyRange() const
Gets the energy range used for power-law spectrum generation.
Definition: MCGenerationInfo.cpp:223
Herd::MCGenerationInfo::SetPowerLawSpectrum
void SetPowerLawSpectrum(float minEnergy, float maxEnergy, float spectralIndex)
Sets the power-law spectrum generation.
Definition: MCGenerationInfo.cpp:237
Herd::MCGenerationInfo::SetParticlePDGCode
void SetParticlePDGCode(int pdgCode)
Sets the PDG code of the generated particle.
Definition: MCGenerationInfo.cpp:29
Herd::MCGenerationInfo::Direction::ISOTROPIC
@ ISOTROPIC
Herd::MCGenerationInfo::Position::NONE
@ NONE
Herd::MCGenerationInfo::Direction::UNIFORM
@ UNIFORM
Herd::MCGenerationInfo::ParticlePDGCode
int ParticlePDGCode() const
Gets the PDG code of the generated particle.
Definition: MCGenerationInfo.cpp:31
Herd::MCGenerationInfo::SetFixedPoint
void SetFixedPoint(Point genPoint)
Sets the particle generation point.
Definition: MCGenerationInfo.cpp:53
Herd::MCGenerationInfo::SetDirectionType
void SetDirectionType(Direction dir)
Sets the type of direction generation.
Definition: MCGenerationInfo.cpp:106
Herd::MCGenerationInfo::_minAzimuth
float _minAzimuth
Definition: MCGenerationInfo.h:381
Herd::MCGenerationInfo::_particlePdgCode
int _particlePdgCode
Definition: MCGenerationInfo.h:363
Herd::MCGenerationInfo::_direction
Direction _direction
Definition: MCGenerationInfo.h:377
Herd::MCGenerationInfo::Spectrum::NONE
@ NONE
Herd::MCGenerationInfo::Direction::NONE
@ NONE
Herd::MCGenerationInfo::SetFixedEnergy
void SetFixedEnergy(float energy)
Sets the fixed generation energy.
Definition: MCGenerationInfo.cpp:216
Herd::MCGenerationInfo::Position
Position
Enum for the kind of position generation.
Definition: MCGenerationInfo.h:74
Herd::MCGenerationInfo::_rectangle
Herd::Rectangle _rectangle
Definition: MCGenerationInfo.h:374
Herd::MCGenerationInfo::_spectralIndex
float _spectralIndex
Definition: MCGenerationInfo.h:389
Herd::MCGenerationInfo::SetFixedDirection
void SetFixedDirection(Vec3D dir)
Sets the fixed generation direction.
Definition: MCGenerationInfo.cpp:125
Herd::MCGenerationInfo::UniformAzimuthAngleRange
std::pair< float, float > UniformAzimuthAngleRange() const
Gets the minimum and maximum azimuth angles for uniform generation.
Definition: MCGenerationInfo.cpp:153
Herd::MCGenerationInfo::IsotropicAzimuthAngleRange
std::pair< float, float > IsotropicAzimuthAngleRange() const
Gets the minimum and maximum azimuth angles for isotropic generation.
Definition: MCGenerationInfo.cpp:139
Herd::MCGenerationInfo::SetIsotropicAnglesRanges
void SetIsotropicAnglesRanges(float minPolar, float maxPolar, float minAzimuth, float maxAzimuth)
Sets the minimum and maximum polar and azimuth angles for isotropic generation.
Definition: MCGenerationInfo.cpp:160
Herd::MCGenerationInfo::_sphereCapExtension
float _sphereCapExtension
Definition: MCGenerationInfo.h:372
Herd::MCGenerationInfo::GeneratorName
std::string GeneratorName() const
Gets the name of the particle generator.
Definition: MCGenerationInfo.cpp:23
Herd::MCGenerationInfo::SetGeneratorName
void SetGeneratorName(std::string name)
Sets the name of the particle generator.
Definition: MCGenerationInfo.cpp:21
Herd::MCGenerationInfo::_fixedShootingEnergy
float _fixedShootingEnergy
Definition: MCGenerationInfo.h:386
Herd::MCGenerationInfo::Position::RECTANGLE
@ RECTANGLE
Herd::MCGenerationInfo::_minEnergy
float _minEnergy
Definition: MCGenerationInfo.h:388
Herd::MCGenerationInfo::_maxEnergy
float _maxEnergy
Definition: MCGenerationInfo.h:388
Herd::MCGenerationInfo::SphereCapPosition
Vec3D SphereCapPosition() const
Gets the position of the generation sphere cap.
Definition: MCGenerationInfo.cpp:67
Herd::MCGenerationInfo::_fixedShootingPoint
Point _fixedShootingPoint
Definition: MCGenerationInfo.h:368
Herd::MCGenerationInfo::_generatorName
std::string _generatorName
Definition: MCGenerationInfo.h:361
Herd::MCGenerationInfo::Spectrum::MONOCHROMATIC
@ MONOCHROMATIC
Herd::MCGenerationInfo::Position::SPHERE
@ SPHERE
Herd::MCGenerationInfo::MCGenerationInfo
MCGenerationInfo()
Default constructor.
Definition: MCGenerationInfo.cpp:14