forked from joaoabcoelho/OscProb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NuPath.h
138 lines (121 loc) · 4.52 KB
/
NuPath.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
////////////////////////////////////////////////////////////////////////
/// \struct OscProb::NuPath
///
/// \brief A struct representing a neutrino path segment
///
/// This struct stores the properties of a neutrino path segment
/// so that the neutrino propagation through a path is done
/// consistently in the PMNS classes.
///
/// \author coelho\@lal.in2p3.fr
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// \struct OscProb::PremLayer
///
/// \brief A struct representing a spherical shell of matter
/// for earth models
///
/// This struct stores the properties of a spherical shell
/// to be used by the PremModel class in order to build an
/// earth model. Only the outer radius of the shell is stored,
/// so PremLayer's need to be assembled in order inside a vector.
///
/// \author coelho\@lal.in2p3.fr
////////////////////////////////////////////////////////////////////////
#ifndef NUPATH_H
#define NUPATH_H
#include <vector>
namespace OscProb {
struct NuPath
{
///
/// \brief Constructor.
///
/// Constructor.
///
/// By default it creates a path of zero length and zero density.
/// The effective Z/A value is set to 0.5 by default.
///
/// The properties of the path can be given directly in the construction.
///
/// @param l - The length of the path segment in km
/// @param d - The density of the path segment in g/cm^3
/// @param z - The effective Z/A value of the path segment
/// @param ly - An index to identify the matter type (e.g. earth inner core)
///
NuPath(double l=0, double d=0, double z=0.5, int ly=0){
SetPath(l,d,z,ly);
}
///
/// \brief Set the properties of the neutrino path.
///
/// Set the properties of the neutrino path.
///
/// By default it sets the path to zero length and zero density.
/// The effective Z/A value is set to 0.5 by default.
///
/// @param l - The length of the path segment in km
/// @param d - The density of the path segment in g/cm^3
/// @param z - The effective Z/A value of the path segment
/// @param ly - An index to identify the matter type (e.g. earth inner core)
///
void SetPath(double l=0, double d=0, double z=0.5, int ly=0){
length = l;
density = d;
zoa = z;
layer = ly;
}
double length; ///< The length of the path segment in km
double density; ///< The density of the path segment in g/cm^3
double zoa; ///< The effective Z/A value of the path segment
int layer; ///< An index to identify the matter type
};
struct PremLayer
{
///
/// \brief Constructor.
///
/// Constructor.
///
/// By default it creates a layer of zero radius and zero density.
/// The effective Z/A value is set to 0.5 by default.
///
/// The properties of the layer can be given directly in the construction.
///
/// @param r - The outer radius of the layer in km
/// @param d - The density of the layer in g/cm^3
/// @param z - The effective Z/A value of the layer
/// @param ly - An index to identify the matter type (e.g. earth inner core)
///
PremLayer(double r=0, double d=0, double z=0.5, int ly=0){
SetLayer(r,d,z,ly);
}
///
/// \brief Set the properties of the layer.
///
/// Set the properties of the layer.
///
/// By default it sets the layer to zero radius and zero density.
/// The effective Z/A value is set to 0.5 by default.
///
/// @param r - The outer radius of the layer in km
/// @param d - The density of the layer in g/cm^3
/// @param z - The effective Z/A value of the layer
/// @param ly - An index to identify the matter type (e.g. earth inner core)
///
void SetLayer(double r=0, double d=0, double z=0.5, int ly=0){
radius = r;
density = d;
zoa = z;
layer = ly;
}
double radius; ///< The outer radius of the layer in km
double density; ///< The density of the layer in g/cm^3
double zoa; ///< The effective Z/A value of the layer
int layer; ///< An index to identify the matter type
};
OscProb::NuPath AvgPath(OscProb::NuPath &p1, OscProb::NuPath &p2); ///< Get the average of two paths
OscProb::NuPath AvgPath(std::vector<OscProb::NuPath> &pv); ///< Get the average of a vector of paths
std::vector<OscProb::NuPath> MergePaths(std::vector<OscProb::NuPath> &inputPath, int j, int k); ///< Merge paths j and k in vector
}
#endif