OscProb
PMNS_Iter.cxx
Go to the documentation of this file.
1
2//
3// Implementation of oscillations of neutrinos in matter in a
4// three-neutrino framework.
5//
6// jcoelho\@apc.in2p3.fr
8
9#include "PMNS_Iter.h"
10
11using namespace OscProb;
12
13//.............................................................................
19PMNS_Iter::PMNS_Iter() : PMNS_Fast(), fPrec(1e-3) {}
20
21//.............................................................................
26
27//.............................................................................
35void PMNS_Iter::SetIsNuBar(bool isNuBar)
36{
37 // Check if value is actually changing
38 fBuiltHms *= (fIsNuBar == isNuBar);
39
40 fIsNuBar = isNuBar;
41}
42
43//.............................................................................
48{
49 double kr2GNe = kK2 * M_SQRT2 * kGf;
50 kr2GNe *= p.density * p.zoa; // Matter potential in eV
51
52 fVL = kr2GNe * kKm2eV * p.length;
53
54 fExpVL = complexD(cos(fVL), -sin(fVL));
55 if (fIsNuBar) fExpVL = conj(fExpVL);
56}
57
58//.............................................................................
63
64//.............................................................................
69{
70 // Do vacuum oscillation
71 if (!fBuiltHms) {
73 fBuiltHms = true;
74 fGotES = true;
76 return;
77 }
78
79 if (fGotES) return;
80
81 for (int i = 1; i < fNumNus; i++) { fEval[i] *= fPrevEnergy / fEnergy; }
82
84
85 fGotES = true;
86 return;
87}
88
89//.............................................................................
93void PMNS_Iter::SetPrec(double prec)
94{
95 fPrec = prec;
96 if (fPrec <= 0) fPrec = 1e-3;
97}
98
99//.............................................................................
104{
105 SetExpVL(p);
106
107 double dm = 0;
108 for (int i = 0; i < fNumNus; i++) {
109 if (dm < fabs(fDm[i])) dm = fabs(fDm[i]);
110 }
111 dm *= kKm2eV * p.length / (2 * kGeV2eV * fEnergy);
112
113 int nsplit = sqrt(0.065 * dm * fVL / fPrec);
114 if (nsplit > 1) {
115 p.length /= nsplit;
116 SetExpVL(p);
117 }
118 else
119 nsplit = 1;
120
121 for (int i = 0; i < nsplit; i++) {
123 PropMatter();
124 }
125}
126
bool fIsNuBar
Anti-neutrino flag.
Definition: PMNS_Base.h:293
vectorC fNuState
The neutrino current state.
Definition: PMNS_Base.h:283
int fNumNus
Number of neutrino flavours.
Definition: PMNS_Base.h:277
double fEnergy
Neutrino energy.
Definition: PMNS_Base.h:292
static const double kK2
mol/GeV^2/cm^3 to eV
Definition: PMNS_Base.h:216
static const double kKm2eV
km to eV^-1
Definition: PMNS_Base.h:215
virtual void PropagatePath(NuPath p)
Propagate neutrino through a single path.
Definition: PMNS_Base.cxx:983
bool fGotES
Tag to avoid recalculating eigensystem.
Definition: PMNS_Base.h:299
static const double kGf
G_F in units of GeV^-2.
Definition: PMNS_Base.h:220
vectorD fEval
Eigenvalues of the Hamiltonian.
Definition: PMNS_Base.h:289
bool fBuiltHms
Tag to avoid rebuilding Hms.
Definition: PMNS_Base.h:298
vectorD fDm
m^2_i - m^2_1 in vacuum
Definition: PMNS_Base.h:279
static const double kGeV2eV
GeV to eV.
Definition: PMNS_Base.h:217
Implementation of oscillations of neutrinos in matter in a three-neutrino framework.
Definition: PMNS_Fast.h:40
virtual void SetVacuumEigensystem()
Set the eigensystem to the analytic solution of the vacuum Hamiltonian.
Definition: PMNS_Fast.cxx:143
virtual void SolveHam()
Just use the vacuum to start.
Definition: PMNS_Iter.cxx:68
complexD fExpVL
Matter phase shift.
Definition: PMNS_Iter.h:62
virtual void PropMatter()
Propagate through matter part.
Definition: PMNS_Iter.cxx:62
virtual ~PMNS_Iter()
Destructor.
Definition: PMNS_Iter.cxx:25
virtual void SetExpVL(NuPath p)
Set the matter propagation term.
Definition: PMNS_Iter.cxx:47
double fPrec
Iterative precision.
Definition: PMNS_Iter.h:59
virtual void PropagatePath(NuPath p)
Reimplement propagation.
Definition: PMNS_Iter.cxx:103
double fVL
Matter potential.
Definition: PMNS_Iter.h:61
virtual void SetIsNuBar(bool isNuBar)
Set the anti-neutrino flag.
Definition: PMNS_Iter.cxx:35
virtual void SetPrec(double prec)
Set the iterative precision.
Definition: PMNS_Iter.cxx:93
double fPrevEnergy
Definition: PMNS_Iter.h:64
Some useful general definitions.
Definition: Absorption.h:6
std::complex< double > complexD
Definition: Definitions.h:21
A struct representing a neutrino path segment.
Definition: NuPath.h:34
double density
The density of the path segment in g/cm^3.
Definition: NuPath.h:79
double length
The length of the path segment in km.
Definition: NuPath.h:78
double zoa
The effective Z/A value of the path segment.
Definition: NuPath.h:80