17 #ifndef HERD_ATTENUATIONTOOL_H_
18 #define HERD_ATTENUATIONTOOL_H_
31 constexpr
double m_shortAttenuationLength = 20;
32 constexpr
double m_longAttenuationLength = 470;
33 constexpr
double m_fractionShort = 0.18;
34 constexpr
double m_reflectionCoefficient = 0.7;
36 inline double calcAtt(
const double l) {
37 return (m_fractionShort * exp(-l / m_shortAttenuationLength) +
38 (1 - m_fractionShort) * exp(-l / m_longAttenuationLength));
43 inline double calcAttDir(
const double y) {
48 inline double calcAttRef(
const double y) {
50 return calcAtt(Len_dir) * m_reflectionCoefficient * calcAtt(
m_matLength);
55 std::pair<double, double>
attenuation(
const double hitYPosition) {
56 return std::make_pair(calcAttDir(hitYPosition), calcAttRef(hitYPosition));