OscProb
Absorption.cxx
Go to the documentation of this file.
1
2#include <cmath>
3#include <functional>
4#include <numeric>
5
6#include "Absorption.h"
7
8using namespace std;
9
10using namespace OscProb;
11
12const double Absorption::kU = 1.660539066e-24; // atomic mass unit [g]
13
14Absorption::Absorption() {}
15
17
18//.............................................................................
19double Absorption::Trans(double xsec)
20{
21 vector<double> p_trans_vec;
22
23 for (int i = 0; i < int(fNuPaths.size()); i++) {
24 double n = fNuPaths[i].density / kU;
25 double l = fNuPaths[i].length * 1e5; // l in km -> cm
26 double p_trans = exp(-l * n * xsec);
27 p_trans_vec.push_back(p_trans); // probability of NO absorption!
28 }
29
30 // returns probability of transmission
31 return accumulate(p_trans_vec.begin(), p_trans_vec.end(), 1.,
32 multiplies<double>());
33}
34
35//.............................................................................
36void Absorption::SetPath(vector<NuPath> paths) { fNuPaths = paths; }
virtual void SetPath(std::vector< NuPath > paths)
Set a path sequence.
Definition: Absorption.cxx:36
std::vector< NuPath > fNuPaths
Vector of neutrino paths.
Definition: Absorption.h:18
static const double kU
Atomic mass unit.
Definition: Absorption.h:20
virtual ~Absorption()
Definition: Absorption.cxx:16
virtual double Trans(double xsec)
Definition: Absorption.cxx:19
Some useful general definitions.
Definition: Absorption.h:6
Definition: EigenPoint.h:44