forked from joaoabcoelho/OscProb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EigenPoint.cxx
73 lines (66 loc) · 1.92 KB
/
EigenPoint.cxx
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
////////////////////////////////////////////////////////////////////////
//
// Struct to organise eigensystems for caching
//
//.................................................
//
// coelho\@lal.in2p3.fr
////////////////////////////////////////////////////////////////////////
#include "EigenPoint.h"
using namespace OscProb;
//......................................................................
///
/// Constructor.
///
/// Uses number of neutrinos to fix eigensystem size.
///
/// @param numNus - the number of neutrino flavours
/// @param e - the neutrino energy
/// @param p - the neutrino path
/// @param n - nu-nubar flag
///
EigenPoint::EigenPoint(int numNus, double e, NuPath p, bool n) :
fEval(numNus,0), fEvec(numNus, std::vector<complexD>(numNus,0))
{
SetVars(e,p,n);
}
//......................................................................
///
/// Set the eigensystem properties to new values
///
/// @param e - the neutrino energy
/// @param p - the neutrino path
/// @param n - nu-nubar flag
///
void EigenPoint::SetVars(double e, NuPath p, bool n)
{
fEnergy = e;
fPath = p;
fNubar = n;
SetNE();
}
//......................................................................
///
/// Compute the combined energy-density parameter
///
void EigenPoint::SetNE()
{
fNE = fEnergy * fPath.density * fPath.zoa;
if(fNE < 1e-12) fNE = 1e-12;
if(fNubar) fNE = -fNE;
}
//......................................................................
///
/// Comparison operator used for sorting into set
///
bool EigenPoint::operator < (const EigenPoint &rhs) const {
if(fNE == rhs.fNE) return fPath.zoa < rhs.fPath.zoa;
return fNE < rhs.fNE;
}
//......................................................................
///
/// Identity operator used for finding existing eigensystems
///
bool EigenPoint::operator == (const EigenPoint &rhs) const {
return (fNE == rhs.fNE) && (fPath.zoa == rhs.fPath.zoa);
}