2021-02-13 17:38:38 -05:00
|
|
|
/*
|
|
|
|
ReactionSystem.h
|
|
|
|
ReactionSystem is the base class from which all kinematics calculations should inherit. It contains all members and functions
|
|
|
|
to perform a single step reaction/decay, which is the basic building block of all subsequent types of reactions in MASK. More
|
|
|
|
complicated systems (see TwoStepSystem and ThreeStepSystem) add further data members and override the virtual functions.
|
|
|
|
|
|
|
|
--GWM Jan. 2021
|
|
|
|
*/
|
2020-11-16 13:38:39 -05:00
|
|
|
#ifndef REACTIONSYSTEM_H
|
|
|
|
#define REACTIONSYSTEM_H
|
|
|
|
|
|
|
|
#include "Reaction.h"
|
2021-08-24 11:55:32 -04:00
|
|
|
#include "KinematicsExceptions.h"
|
2020-11-16 13:38:39 -05:00
|
|
|
#include <vector>
|
2021-09-03 17:03:41 -04:00
|
|
|
#include <random>
|
2020-11-16 13:38:39 -05:00
|
|
|
|
2020-12-11 16:56:27 -05:00
|
|
|
namespace Mask {
|
|
|
|
|
2021-09-03 17:03:41 -04:00
|
|
|
class ReactionSystem {
|
|
|
|
public:
|
|
|
|
ReactionSystem();
|
|
|
|
virtual ~ReactionSystem();
|
2020-11-16 13:38:39 -05:00
|
|
|
|
2021-09-03 17:03:41 -04:00
|
|
|
virtual bool SetNuclei(std::vector<int>& z, std::vector<int>& a) = 0;
|
|
|
|
virtual void RunSystem() = 0;
|
2021-10-08 16:20:46 -04:00
|
|
|
virtual const std::vector<Nucleus>& GetNuclei() = 0;
|
2021-09-03 17:03:41 -04:00
|
|
|
|
|
|
|
void AddTargetLayer(std::vector<int>& zt, std::vector<int>& at, std::vector<int>& stoich, double thickness);
|
|
|
|
|
|
|
|
/*Set sampling parameters*/
|
|
|
|
inline void SetBeamDistro(double mean, double sigma) {
|
|
|
|
if(m_beamDist)
|
|
|
|
delete m_beamDist;
|
|
|
|
m_beamDist = new std::normal_distribution<double>(mean, sigma);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void SetTheta1Range(double min, double max) {
|
|
|
|
if(m_theta1Range)
|
|
|
|
delete m_theta1Range;
|
|
|
|
m_theta1Range = new std::uniform_real_distribution<double>(std::cos(min*deg2rad), std::cos(max*deg2rad));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void SetPhi1Range(double min, double max) {
|
|
|
|
if(m_phi1Range)
|
|
|
|
delete m_phi1Range;
|
|
|
|
m_phi1Range = new std::uniform_real_distribution<double>(min*deg2rad, max*deg2rad);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void SetExcitationDistro(double mean, double sigma) {
|
|
|
|
if(m_exDist)
|
|
|
|
delete m_exDist;
|
|
|
|
m_exDist = new std::normal_distribution<double>(mean, sigma);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline const std::string& GetSystemEquation() const { return m_sys_equation; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void LinkTarget() = 0;
|
|
|
|
virtual void SetSystemEquation() = 0;
|
|
|
|
|
|
|
|
LayeredTarget target;
|
|
|
|
|
|
|
|
//Sampling information
|
|
|
|
std::normal_distribution<double> *m_beamDist, *m_exDist;
|
|
|
|
std::uniform_real_distribution<double> *m_theta1Range, *m_phi1Range;
|
|
|
|
|
|
|
|
bool target_set_flag, gen_set_flag;
|
|
|
|
int rxnLayer;
|
|
|
|
std::string m_sys_equation;
|
2021-10-08 16:20:46 -04:00
|
|
|
std::vector<Nucleus> nuclei;
|
2021-09-03 17:03:41 -04:00
|
|
|
static constexpr double deg2rad = M_PI/180.0;
|
|
|
|
};
|
2020-11-16 13:38:39 -05:00
|
|
|
|
2021-09-03 17:03:41 -04:00
|
|
|
}
|
2020-12-11 16:56:27 -05:00
|
|
|
|
2020-11-16 13:38:39 -05:00
|
|
|
#endif
|