2020-11-16 13:38:39 -05:00
|
|
|
/*
|
|
|
|
|
|
|
|
Target.h
|
2021-09-06 16:18:49 -04:00
|
|
|
A basic target unit for use in the Mask environment. A target
|
2020-11-16 13:38:39 -05:00
|
|
|
is defined as a single compound with elements Z,A of a given stoichiometry
|
|
|
|
Holds an energy loss class
|
|
|
|
|
|
|
|
Based on code by D.W. Visser written at Yale for the original SPANC
|
|
|
|
|
|
|
|
Written by G.W. McCann Aug. 2020
|
|
|
|
|
|
|
|
*/
|
|
|
|
#ifndef TARGET_H
|
|
|
|
#define TARGET_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2021-09-06 16:18:49 -04:00
|
|
|
#include <cmath>
|
2020-11-16 13:38:39 -05:00
|
|
|
#include "EnergyLoss.h"
|
2022-06-09 11:29:02 -04:00
|
|
|
#include "catima/gwm_integrators.h"
|
|
|
|
#include "MassLookup.h"
|
2020-11-16 13:38:39 -05:00
|
|
|
|
2021-09-06 16:18:49 -04:00
|
|
|
namespace Mask {
|
|
|
|
|
|
|
|
class Target {
|
|
|
|
|
|
|
|
public:
|
|
|
|
Target(double thick);
|
|
|
|
~Target();
|
|
|
|
void SetElements(std::vector<int>& z, std::vector<int>& a, std::vector<int>& stoich);
|
|
|
|
bool ContainsElement(int z, int a);
|
2021-09-23 11:42:14 -04:00
|
|
|
double GetEnergyLossTotal(int zp, int ap, double startEnergy, double angle);
|
|
|
|
double GetReverseEnergyLossTotal(int zp, int ap, double finalEnergy, double angle);
|
|
|
|
double GetEnergyLossFractionalDepth(int zp, int ap, double startEnergy, double angle, double percent_depth);
|
|
|
|
double GetReverseEnergyLossFractionalDepth(int zp, int ap, double finalEnergy, double angle, double percent_depth);
|
2021-09-06 16:18:49 -04:00
|
|
|
inline const double& GetThickness() { return thickness; }
|
|
|
|
inline int GetNumberOfElements() { return Z.size(); }
|
|
|
|
inline int GetElementZ(int index) { return Z[index]; }
|
|
|
|
inline int GetElementA(int index) { return A[index]; }
|
|
|
|
inline int GetElementStoich(int index) { return Stoich[index]; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
EnergyLoss eloss;
|
2022-06-09 11:29:02 -04:00
|
|
|
catima::Material target_material;
|
2021-09-06 16:18:49 -04:00
|
|
|
double thickness;
|
2022-06-09 11:29:02 -04:00
|
|
|
double thickness_gcm2;
|
2021-09-06 16:18:49 -04:00
|
|
|
std::vector<int> Z, A, Stoich;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2020-11-16 13:38:39 -05:00
|
|
|
|
|
|
|
#endif
|